Skip to content

Commit

Permalink
Updates to release v1.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed Apr 8, 2016
1 parent bf7dfe4 commit 356bc18
Show file tree
Hide file tree
Showing 103 changed files with 2,930 additions and 254 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Ignore all test and documentation for archive
/.github export-ignore
/.gitattributes export-ignore
/.scrutinizer.yml export-ignore
/.travis.yml export-ignore
/docs export-ignore
7 changes: 7 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Contributing to Yii2
====================

- [Report an issue](docs/internals/report-an-issue.md)
- [Translate documentation or messages](docs/internals/translation-workflow.md)
- [Give us feedback or start a design discussion](http://www.yiiframework.com/forum/index.php/forum/42-general-discussions-for-yii-20/)
- [Contribute to the core code or fix bugs](docs/internals/git-workflow.md)
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
### What steps will reproduce the problem?

### What is expected?

### What do you get instead?

### Additional info

| Question | Answer
| ---------------- | ----------------
| Yii version |
| PHP version |
| Operating system |
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
| Question | Answer
| ------------- | -------------
| Is bugfix? | yes/no
| New feature? | yes/no
| Breaks BC? | yes/no
| Tests pass? | yes/no
| Fixed issues | comma-separated list of tickets # fixed by the PR, if any
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# index files
/index.php
/index-test.php

# yii console command
/yii

Expand Down
45 changes: 45 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
language: php

php:
- 5.4
- 5.5
- 5.6
- 7.0
# - hhvm

# faster builds on new travis setup not using sudo
sudo: false

# cache vendor dirs
cache:
directories:
- $HOME/.composer/cache

install:
- travis_retry composer self-update && composer --version
- travis_retry composer global require "fxp/composer-asset-plugin:~1.1.0"
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- travis_retry composer install --dev --prefer-dist --no-interaction
# codeception
- travis_retry composer global require "codeception/codeception=2.0.*" "codeception/specify=*" "codeception/verify=*"
# setup application:
- |
./init --env=Development
sed -i s/root/travis/ common/config/main-local.php
sed -i "s/'cookieValidationKey' => ''/'cookieValidationKey' => 'testkey'/" frontend/config/main.php
sed -i "s/'cookieValidationKey' => ''/'cookieValidationKey' => 'testkey'/" backend/config/main.php
cd tests/codeception/backend && codecept build
cd ../common && codecept build
cd ../console && codecept build
cd ../frontend && codecept build
cd ../../../
before_script:
- mysql -e 'CREATE DATABASE yii2_advanced_tests;';
- cd tests/codeception/bin && php yii migrate --interactive=0 && cd ../../..

script:
- |
php -S localhost:8080 > /dev/null 2>&1 &
cd tests
codecept run
8 changes: 4 additions & 4 deletions CHANGE.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
Change Log: `yii2-app-practical-a`
==================================
Change Log: `yii2-app-practical`
================================

## Version 1.5.1

**Date:** 2015-09-06
**Date:** 2016-04-08

- (enh #12): Improve security for .htaccess.
- (bug #13): Set correct writable folders.
- (bug #15): Correct `backend\assets_b\AppAsset` typo.
- Based on latest yii2-advanced-app until 29-Jul-2015.
- (bug #16): Fix `gii` config for backend prod.
- (bug #17): Correct composer.json source for `yii2-app-practical-a`.
- (enh #18): Include index files in `.gitignore`.
- (enh #19): Upgrade migrations as per yii 2.0.6 Schema builder.
- Update to use yii 2.0.6 archive.
- Update sessions configuration for frontend and backend.
- Include `urlManagerFE` component in backend config to enable access to frontend routes.
- Based on latest yii2-advanced-app until 29-Jul-2015.

## Version 1.5.0

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
POSSIBILITY OF SUCH DAMAGE.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ SOME KEY ADDITIONS
3. The template has isolated cookie settings for backend and frontend so that you can seamlessly access frontend and backend from same client.
The config files includes special `identity` and `csrf` cookie parameter settings for backend. Edit it according to your needs if necessary.

Detailed documentation on yii2-app-advanced concepts and usage can be referred at [docs/guide/README.md](docs/guide/README.md).

DIRECTORY STRUCTURE
-------------------
```
Expand Down
7 changes: 1 addition & 6 deletions backend/assets_b/AppAsset.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/

namespace backend\assets_b;

use yii\web\AssetBundle;

/**
* @author Qiang Xue <[email protected]>
* Main backend application asset bundle.
* @author Kartik Visweswaran <[email protected]>
* @since 2.0
*/
Expand Down
22 changes: 21 additions & 1 deletion backend/assets_b/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,15 @@ a.desc:after {
content: "\e156";
}

.grid-view th {
.grid-view td {
white-space: nowrap;
}

.grid-view .filters input,
.grid-view .filters select {
min-width: 50px;
}

.hint-block {
display: block;
margin-top: 5px;
Expand All @@ -89,3 +94,18 @@ a.desc:after {
padding: 10px 20px;
margin: 0 0 15px 0;
}

/* align the logout "link" (button in form) of the navbar */
.nav > li > form {
padding: 8px;
}

@media(max-width:768px) {
.nav li > form {
padding: 3px;
}
}

.nav > li > form > button:hover {
text-decoration: none;
}
10 changes: 9 additions & 1 deletion backend/config/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
);

return [
'id' => 'app-backend',
'id' => 'app-practical-a-backend',
'basePath' => dirname(__DIR__),
'controllerNamespace' => 'backend\controllers',
'bootstrap' => ['log'],
Expand All @@ -29,6 +29,14 @@
'errorHandler' => [
'errorAction' => 'site/error',
],
/*
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
],
],
*/
],
'params' => $params,
];
6 changes: 3 additions & 3 deletions backend/controllers/SiteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
namespace backend\controllers;

use Yii;
use yii\filters\AccessControl;
use yii\web\Controller;
use common\models\LoginForm;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;
use common\models\LoginForm;

/**
* Site controller
Expand Down Expand Up @@ -60,7 +60,7 @@ public function actionIndex()

public function actionLogin()
{
if (!\Yii::$app->user->isGuest) {
if (!Yii::$app->user->isGuest) {
return $this->goHome();
}

Expand Down
13 changes: 8 additions & 5 deletions backend/views/layouts/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,14 @@
if (Yii::$app->user->isGuest) {
$menuItems[] = ['label' => 'Login', 'url' => ['/site/login']];
} else {
$menuItems[] = [
'label' => 'Logout (' . Yii::$app->user->identity->username . ')',
'url' => ['/site/logout'],
'linkOptions' => ['data-method' => 'post']
];
$menuItems[] = '<li>'
. Html::beginForm(['/site/logout'], 'post')
. Html::submitButton(
'Logout (' . Yii::$app->user->identity->username . ')',
['class' => 'btn btn-link']
)
. Html::endForm()
. '</li>';
}
echo Nav::widget([
'options' => ['class' => 'navbar-nav navbar-right'],
Expand Down
2 changes: 1 addition & 1 deletion backend/views/site/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<div class="col-lg-5">
<?php $form = ActiveForm::begin(['id' => 'login-form']); ?>

<?= $form->field($model, 'username') ?>
<?= $form->field($model, 'username')->textInput(['autofocus' => true]) ?>

<?= $form->field($model, 'password')->passwordInput() ?>

Expand Down
8 changes: 4 additions & 4 deletions common/config/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
Yii::setAlias('common', dirname(__DIR__));
Yii::setAlias('frontend', dirname(dirname(__DIR__)) . '/frontend');
Yii::setAlias('backend', dirname(dirname(__DIR__)) . '/backend');
Yii::setAlias('console', dirname(dirname(__DIR__)) . '/console');
Yii::setAlias('@common', dirname(__DIR__));
Yii::setAlias('@frontend', dirname(dirname(__DIR__)) . '/frontend');
Yii::setAlias('@backend', dirname(dirname(__DIR__)) . '/backend');
Yii::setAlias('@console', dirname(dirname(__DIR__)) . '/console');
2 changes: 1 addition & 1 deletion common/models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,4 @@ public function removePasswordResetToken()
{
$this->password_reset_token = null;
}
}
}
26 changes: 11 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
{
"name": "kartik-v/yii2-app-practical-a",
"description": "Yii 2 Practical-A Application Template (based on advanced)",
"keywords": ["yii2", "framework", "practical", "practical-a", "application template"],
"homepage": "http://demos.krajee.com/app-practical",
"name": "yiisoft/yii2-app-advanced",
"description": "Yii 2 Advanced Project Template",
"keywords": ["yii2", "framework", "advanced", "project template"],
"homepage": "http://www.yiiframework.com/",
"type": "project",
"license": "BSD-3-Clause",
"authors": [
{
"name": "Kartik Visweswaran",
"email": "[email protected]",
"homepage": "http://www.krajee.com/"
}
],
"support": {
"issues": "https://github.com/kartik-v/yii2-app-practical-a/issues?state=open",
"source": "https://github.com/kartik-v/yii2-app-practical-a/"
"issues": "https://github.com/yiisoft/yii2/issues?state=open",
"forum": "http://www.yiiframework.com/forum/",
"wiki": "http://www.yiiframework.com/wiki/",
"irc": "irc://irc.freenode.net/yii",
"source": "https://github.com/yiisoft/yii2"
},
"minimum-stability": "dev",
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": ">=2.0.5",
"yiisoft/yii2": ">=2.0.6",
"yiisoft/yii2-bootstrap": "*",
"yiisoft/yii2-swiftmailer": "*"
},
Expand All @@ -38,4 +34,4 @@
"bower-asset-library": "vendor/bower"
}
}
}
}
1 change: 1 addition & 0 deletions console/migrations/m130524_201442_init.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public function up()
'password_hash' => $this->string()->notNull(),
'password_reset_token' => $this->string()->unique(),
'email' => $this->string()->notNull()->unique(),

'status' => $this->smallInteger()->notNull()->defaultValue(10),
'created_at' => $this->integer()->notNull(),
'updated_at' => $this->integer()->notNull(),
Expand Down
31 changes: 31 additions & 0 deletions docs/guide-es/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Plantilla de Proyecto Avanzado de Yii 2
=======================================

La Plantilla de Proyecto Avanzado de [Yii 2](http://www.yiiframework.com/) es el mejor esqueleto para el desarrollo de aplicaciones web complejas con múltiples capas

La plantilla incluye tres capas: front end, back end, y consola, cada una de ellas, es una aplicación separada de Yii.

La plantilla esta diseñada para trabajar en un entorno de desarrollo en equipo. Soporta el despliegue de la aplicación en diferentes entornos.

También va un poco más allá con respecto a características y proporciona una base de datos esencial lista para usar, con registro de usuarios y restablecimiento de contraseñas.

Primeros Pasos
--------------

* [Instalación](start-installation.md)
* [Diferencias respecto a la plantilla básica](start-comparison.md)
* [Configurando Composer](start-composer.md)

Estructura
----------

* [Directorios](structure-directories.md)
* [Alias Predefinidos](structure-path-aliases.md)
* [Aplicaciones](structure-applications.md)
* [Configuración y Entorno](structure-environments.md)

Temas adicionales
-----------------

* [Creando enlaces del backend al frontend](topic-link-backend-frontend.md)
* [Añadiendo más aplicaciones](topic-adding-more-apps.md)
Loading

0 comments on commit 356bc18

Please sign in to comment.