Skip to content

Commit

Permalink
Updates to release v1.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed Jun 6, 2017
1 parent 8d78f6a commit f0de22c
Show file tree
Hide file tree
Showing 278 changed files with 6,873 additions and 2,103 deletions.
36 changes: 33 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,37 @@
Contributing to yii2-app-practical-a
==================================
Looking to contribute something to yii2-app-practical-a? **Here's how you can help.**

We really appreciate clear bug reports that _consistently_ show an issue
_within yii2-app-practical_.

The ideal bug report follows these guidelines:

1. **Use the [GitHub issue search][issue-search]** — Check if the issue
has already been reported.
2. **Check if the issue has been fixed** — Try to reproduce the problem
using the code in the `master` branch.

Please try to be as detailed as possible in your bug report, especially if an
isolated test case cannot be made. Some useful questions to include the answer
to are:

- What steps can be used to reproduce the issue?
- What is the bug and what is the expected outcome?
- What browser(s) and Operating System have you tested with?
- Does the bug happen consistently across all tested browsers?
- What version of jQuery are you using? And what version of yii2-app-practical-a?
- Are you using yii2-app-practical-a with other plugins?

All of these questions will help others fix and identify any potential bugs.

Contributing to Yii2
====================

- [Report an issue](docs/internals/report-an-issue.md)
- [Translate documentation or messages](docs/internals/translation-workflow.md)
- [Report an issue](https://github.com/yiisoft/yii2/blob/master/docs/internals/report-an-issue.md)
- [Translate documentation or messages](https://github.com/yiisoft/yii2/blob/master/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)
- [Contribute to the core code or fix bugs](https://github.com/yiisoft/yii2/blob/master/docs/internals/git-workflow.md)

[issue-search]: https://github.com/kartik-v/yii2-app-practical-a/search?q=&type=Issues
[issue-tracker]: https://github.com/kartik-v/yii2-app-practical-a/issues
9 changes: 5 additions & 4 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
### What steps will reproduce the problem?

### What is expected?
### What's expected?

### What do you get instead?


### Additional info

| Question | Answer
| ---------------- | ----------------
| Yii version |
| Q | A
| ---------------- | ---
| Yii vesion |
| PHP version |
| Operating system |
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
| Question | Answer
| ------------- | -------------
| Q | A
| ------------- | ---
| Is bugfix? | yes/no
| New feature? | yes/no
| Breaks BC? | yes/no
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,12 @@ composer.phar
phpunit.phar
# local phpunit config
/phpunit.xml

# backend files
/backend/assets

# frontend files
/assets
/index.php
/index-test.php
/robots.txt
22 changes: 6 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,19 @@ 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=*"
- travis_retry composer global require "fxp/composer-asset-plugin:~1.3.1"
- travis_retry composer update --dev --prefer-dist --no-interaction
# 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 ../../..
- mysql -e 'CREATE DATABASE yii2practical_test;'
- php yii_test migrate --interactive=0

script:
- |
php -S localhost:8080 > /dev/null 2>&1 &
cd tests
codecept run
- composer validate --strict
- vendor/bin/codecept run
36 changes: 21 additions & 15 deletions CHANGE.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
Change Log: `yii2-app-practical`
================================
Change Log: `yii2-app-practical-a`
==================================

## Version 1.5.2

**Date:** 2017-06-06

- Based on latest yii2-advanced-app until 06-Jun-2017.

## Version 1.5.1

**Date:** 2016-04-08

- (enh #12): Improve security for .htaccess.
- (bug #13): Set correct writable folders.
- (bug #15): Correct `backend\assets_b\AppAsset` typo.
- (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.
- (enh #18): Include index files in `.gitignore`.
- (bug #17): Correct composer.json source for `yii2-app-practical-a`.
- (bug #16): Fix `gii` config for backend prod.
- (bug #15): Correct `backend\assets_b\AppAsset` typo.
- (bug #13): Set correct writable folders.
- (enh #12): Improve security for .htaccess.
- 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.
Expand All @@ -27,38 +33,38 @@ Change Log: `yii2-app-practical`

**Date:** 2014-10-25

- Based on latest yii2-advanced-app until 25-Oct-2014.
- (enh # 9): Included identity cookie settings for backend.
- (enh # 10): Included CSRF token cookie setting for backend.
- (enh # 11): Update codeception default settings for tests
- (enh # 10): Included CSRF token cookie setting for backend.
- (enh # 9): Included identity cookie settings for backend.
- Based on latest yii2-advanced-app until 25-Oct-2014.


## Version 1.3.0

**Date:** 2014-08-14

- Based on latest yii2-advanced-app until 14-Oct-2014.
- (enh # 6): Easier AppAsset baseUrl setting
- Based on latest yii2-advanced-app until 14-Oct-2014.

## Version 1.2.0

**Date:** 2014-08-09

- Based on latest yii2-advanced-app until 09-Oct-2014.
- (enh #4): User model findIdentity() does not take into account user status.
- Based on latest yii2-advanced-app until 09-Oct-2014.

## Version 1.1.0

**Date:** 2014-06-30

- Based on latest yii2-advanced-app until 30-Jun-2014.
- Included `.htaccess` for backend.
- Based on latest yii2-advanced-app until 30-Jun-2014.


## Version 1.0.0

**Date:** 2014-06-01

- Initial release.
- Based on latest yii2-advanced-app until 31-May-2014.
- Initial release.

107 changes: 12 additions & 95 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ http://domain/app
and backend this way

```
http://domain/backend
http://domain/app/backend
```

All other aspects of the app configuration remain the same as the **yii2-advanced** app. The `common`, and `console`
Expand All @@ -67,18 +67,20 @@ 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).
Detailed documentation can be referred at [docs/guide/README.md](docs/guide/README.md).

DIRECTORY STRUCTURE
-------------------

```
/
/ contains the frontend entry script, favicon, and robots.txt.
assets/ contains the frontend web runtime assets
assets/ contains frontend application runtime web assets such as JavaScript and CSS
common
config/ contains shared configurations
mail/ contains view files for e-mails
models/ contains model classes used in both backend and frontend
tests/ contains tests for common classes
console
config/ contains console configurations
controllers/ contains console controllers (commands)
Expand All @@ -87,109 +89,24 @@ console
runtime/ contains files generated during runtime
backend
/ contains the backend entry script, favicon, and robots.txt.
assets/ contains the backend web runtime assets
assets_b/ contains backend application assets such as JavaScript and CSS
assets/ contains the backend application runtime web assets such as JavaScript and CSS
assets_b/ contains web assets and scripts used by backend application
config/ contains backend configurations
controllers/ contains Web controller classes
models/ contains backend-specific model classes
runtime/ contains files generated during runtime
tests/ contains tests for backend application
views/ contains view files for the Web application
web/ contains the entry script and Web resources
frontend
assets/ contains frontend application assets such as JavaScript and CSS
assets/ contains web assets and scripts used by frontend application
config/ contains frontend configurations
controllers/ contains Web controller classes
models/ contains frontend-specific model classes
runtime/ contains files generated during runtime
tests/ contains tests for frontend application
views/ contains view files for the Web application
widgets/ contains frontend widgets
vendor/ contains dependent 3rd-party packages
environments/ contains environment-based overrides
tests contains various tests for the "practical" application
codeception/ contains tests developed with Codeception PHP Testing Framework
```

REQUIREMENTS
------------

The minimum requirement by this application template that your Web server supports PHP 5.4.0.


INSTALLATION
------------

You can choose to install the application using one of the following methods.

### Install via Composer

If you do not have [Composer](http://getcomposer.org/), you may install it by following the instructions
at [getcomposer.org](http://getcomposer.org/doc/00-intro.md#installation-nix).

You can then install the application using the following command:

~~~
php composer.phar global require "fxp/composer-asset-plugin:~1.0.0"
php composer.phar create-project --prefer-dist --stability=dev kartik-v/yii2-app-practical-a practical-a
~~~

### Install from an Archive File

Download the [archive file](https://github.com/kartik-v/yii2-app-practical-a/archive/master.zip) directly to a directory named `practical` that is directly under the Web root.

> Note: When using a archive file method, the vendor folder is not automatically created. You must download the [latest yii2-advanced archive](https://github.com/yiisoft/yii2/releases/download/2.0.6/yii-advanced-app-2.0.6.tgz) and then extract the vendor folder from here. Then you must copy this folder directly under the app root (i.e. `practical` directory).
After this is complete, follow the instructions given in "GETTING STARTED".

GETTING STARTED
---------------

After you install the application, you have to conduct the following steps to initialize
the installed application. You only need to do these once for all.

1. Run command `init` to initialize the application with a specific environment.
2. Create a new database and adjust the `components['db']` configuration in `common/config/main-local.php` accordingly.
3. Apply migrations with console command `yii migrate`. This will create tables needed for the application to work.
4. Set document roots of your Web server:

- for frontend `/path/to/yii-application/` and using the URL `http://frontend/`
- for backend `/path/to/yii-application/backend/web/` and using the URL `http://backend/`

To login into the application, you need to first sign up, with any of your email address, username and password.
Then, you can login into the application with same email address and password at any time.

5. Edit the config files as needed. Especially set the correct paths for the user identity cookie in `backend/config/main-local.php`.

MORE DOCUMENTATION
------------------

You can read the [yii2-advanced application guide](https://github.com/yiisoft/yii2-app-advanced/blob/master/docs/guide/README.md) to understand details on working with the advanced application.

TESTING
-------

Follow the [`tests` section README](https://github.com/kartik-v/yii2-app-practical-a/tree/master/tests/README.md) for setting up the tests. For details of testing in Yii 2.0, read the [testing overview and setup](http://www.yiiframework.com/doc-2.0/guide-test-overview.html) within the Yii 2.0 Guide. Setting up the testing environment broadly involves the following steps.

Install additional composer packages:
* `php composer.phar require --dev "codeception/codeception: 2.0" "codeception/specify: *" "codeception/verify: *"`

This application boilerplate uses database in testing, so you should create three databases that are used in tests:
* `yii2_practical_unit` - database for unit tests;
* `yii2_practical_functional` - database for functional tests;
* `yii2_practical_acceptance` - database for acceptance tests.

To make your database up to date, you can run in needed test folder `yii migrate`, for example
if you are starting from `frontend` tests then you should run `yii migrate` in each suite folder `acceptance`, `functional`, `unit`
it will upgrade your database to the last state according migrations.

To be able to run acceptance tests you need a running webserver. For this you can use the php builtin server and run it in the directory where your main project folder is located. For example if your application is located in `/www/practical` all you need to is:
`cd /www` and then `php -S 127.0.0.1:8080` because the default configuration of acceptance tests expects the url of the application to be `/practical/`.
If you already have a server configured or your application is not located in a folder called `practical`, you may need to adjust the `TEST_ENTRY_URL` in `frontend/tests/_bootstrap.php` and `backend/tests/_bootstrap.php`.

After that is done you should be able to run your tests, for example to run `frontend` tests do:

* `cd frontend`
* `../vendor/bin/codecept build`
* `../vendor/bin/codecept run`

In similar way you can run tests for other application tiers - `backend`, `console`, `common`.

You can also adjust you application suite configs and `_bootstrap.php` settings to use other urls and files, as it is done in `yii2-basic`.
```
Loading

0 comments on commit f0de22c

Please sign in to comment.