From 3bef7365f1fcfa5ddbf5a93398beb222b1e29193 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Thu, 25 Jul 2013 07:57:49 -0400 Subject: [PATCH] Fixes #624: renamed www to web. --- apps/advanced/README.md | 8 +-- apps/advanced/backend/config/AppAsset.php | 4 +- apps/advanced/backend/web/.gitignore | 1 + apps/advanced/backend/web/assets/.gitignore | 2 + apps/advanced/backend/web/css/site.css | 78 ++++++++++++++++++++++ apps/advanced/backend/www/.gitignore | 1 - apps/advanced/backend/www/assets/.gitignore | 2 - apps/advanced/backend/www/css/site.css | 78 ---------------------- apps/advanced/composer.json | 4 +- apps/advanced/frontend/config/AppAsset.php | 4 +- apps/advanced/frontend/web/.gitignore | 1 + apps/advanced/frontend/web/assets/.gitignore | 2 + apps/advanced/frontend/web/css/site.css | 78 ++++++++++++++++++++++ apps/advanced/frontend/www/.gitignore | 1 - apps/advanced/frontend/www/assets/.gitignore | 2 - apps/advanced/frontend/www/css/site.css | 78 ---------------------- apps/basic/README.md | 4 +- apps/basic/composer.json | 2 +- apps/basic/config/AppAsset.php | 4 +- apps/basic/tests/functional.suite.dist.yml | 2 +- apps/basic/web/assets/.gitignore | 2 + apps/basic/web/css/site.css | 78 ++++++++++++++++++++++ apps/basic/web/index-test.php | 18 +++++ apps/basic/web/index.php | 14 ++++ apps/basic/www/assets/.gitignore | 2 - apps/basic/www/css/site.css | 78 ---------------------- apps/basic/www/index-test.php | 18 ----- apps/basic/www/index.php | 14 ---- docs/guide/bootstrap.md | 4 +- docs/guide/upgrade-from-v1.md | 4 +- framework/yii/base/Theme.php | 10 +-- .../yii/console/controllers/AssetController.php | 6 +- framework/yii/web/Application.php | 4 +- framework/yii/web/AssetManager.php | 4 +- 34 files changed, 306 insertions(+), 306 deletions(-) create mode 100644 apps/advanced/backend/web/.gitignore create mode 100644 apps/advanced/backend/web/assets/.gitignore create mode 100644 apps/advanced/backend/web/css/site.css delete mode 100644 apps/advanced/backend/www/.gitignore delete mode 100644 apps/advanced/backend/www/assets/.gitignore delete mode 100644 apps/advanced/backend/www/css/site.css create mode 100644 apps/advanced/frontend/web/.gitignore create mode 100644 apps/advanced/frontend/web/assets/.gitignore create mode 100644 apps/advanced/frontend/web/css/site.css delete mode 100644 apps/advanced/frontend/www/.gitignore delete mode 100644 apps/advanced/frontend/www/assets/.gitignore delete mode 100644 apps/advanced/frontend/www/css/site.css create mode 100644 apps/basic/web/assets/.gitignore create mode 100644 apps/basic/web/css/site.css create mode 100644 apps/basic/web/index-test.php create mode 100644 apps/basic/web/index.php delete mode 100644 apps/basic/www/assets/.gitignore delete mode 100644 apps/basic/www/css/site.css delete mode 100644 apps/basic/www/index-test.php delete mode 100644 apps/basic/www/index.php diff --git a/apps/advanced/README.md b/apps/advanced/README.md index 59a1b77..7055360 100644 --- a/apps/advanced/README.md +++ b/apps/advanced/README.md @@ -34,7 +34,7 @@ backend models/ contains backend-specific model classes runtime/ contains files generated during runtime views/ contains view files for the Web application - www/ contains the entry script and Web resources + web/ contains the entry script and Web resources frontend assets/ contains application assets such as JavaScript and CSS config/ contains frontend configurations @@ -42,7 +42,7 @@ frontend models/ contains frontend-specific model classes runtime/ contains files generated during runtime views/ contains view files for the Web application - www/ contains the entry script and Web resources + web/ contains the entry script and Web resources vendor/ contains dependent 3rd-party packages environments/ contains environment-based overrides ``` @@ -107,8 +107,8 @@ the installed application. You only need to do these once for all. Now you should be able to access: -- the frontend using the URL `http://localhost/yii-advanced/frontend/www/` -- the backend using the URL `http://localhost/yii-advanced/backend/www/` +- the frontend using the URL `http://localhost/yii-advanced/frontend/web/` +- the backend using the URL `http://localhost/yii-advanced/backend/web/` assuming `yii-advanced` is directly under the document root of your Web server. diff --git a/apps/advanced/backend/config/AppAsset.php b/apps/advanced/backend/config/AppAsset.php index 525b693..944807a 100644 --- a/apps/advanced/backend/config/AppAsset.php +++ b/apps/advanced/backend/config/AppAsset.php @@ -14,8 +14,8 @@ use yii\web\AssetBundle; */ class AppAsset extends AssetBundle { - public $basePath = '@wwwroot'; - public $baseUrl = '@www'; + public $basePath = '@webroot'; + public $baseUrl = '@web'; public $css = array( 'css/site.css', ); diff --git a/apps/advanced/backend/web/.gitignore b/apps/advanced/backend/web/.gitignore new file mode 100644 index 0000000..148f2b0 --- /dev/null +++ b/apps/advanced/backend/web/.gitignore @@ -0,0 +1 @@ +/index.php \ No newline at end of file diff --git a/apps/advanced/backend/web/assets/.gitignore b/apps/advanced/backend/web/assets/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/apps/advanced/backend/web/assets/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/apps/advanced/backend/web/css/site.css b/apps/advanced/backend/web/css/site.css new file mode 100644 index 0000000..890a953 --- /dev/null +++ b/apps/advanced/backend/web/css/site.css @@ -0,0 +1,78 @@ +body { + padding-top: 20px; + padding-bottom: 60px; +} + +/* Custom container */ +.container { + margin: 0 auto; + max-width: 1000px; +} + +.container > hr { + margin: 60px 0; +} + +/* Main marketing message and sign up button */ +.jumbotron { + margin: 80px 0; + text-align: center; +} + +.jumbotron h1 { + font-size: 100px; + line-height: 1; +} + +.jumbotron .lead { + font-size: 24px; + line-height: 1.25; +} + +.jumbotron .btn { + font-size: 21px; + padding: 14px 24px; +} + +/* Supporting marketing content */ +.marketing { + margin: 60px 0; +} + +.marketing p + h4 { + margin-top: 28px; +} + +/* Customize the navbar links to be fill the entire space of the .navbar */ +.navbar .navbar-inner { + padding: 0; +} + +.navbar .nav { + margin: 0; + display: table; + width: 100%; +} + +.navbar .nav li { + display: table-cell; + width: 1%; + float: none; +} + +.navbar .nav li a { + font-weight: bold; + text-align: center; + border-left: 1px solid rgba(255, 255, 255, .75); + border-right: 1px solid rgba(0, 0, 0, .1); +} + +.navbar .nav li:first-child a { + border-left: 0; + border-radius: 3px 0 0 3px; +} + +.navbar .nav li:last-child a { + border-right: 0; + border-radius: 0 3px 3px 0; +} diff --git a/apps/advanced/backend/www/.gitignore b/apps/advanced/backend/www/.gitignore deleted file mode 100644 index 148f2b0..0000000 --- a/apps/advanced/backend/www/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/index.php \ No newline at end of file diff --git a/apps/advanced/backend/www/assets/.gitignore b/apps/advanced/backend/www/assets/.gitignore deleted file mode 100644 index c96a04f..0000000 --- a/apps/advanced/backend/www/assets/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file diff --git a/apps/advanced/backend/www/css/site.css b/apps/advanced/backend/www/css/site.css deleted file mode 100644 index 890a953..0000000 --- a/apps/advanced/backend/www/css/site.css +++ /dev/null @@ -1,78 +0,0 @@ -body { - padding-top: 20px; - padding-bottom: 60px; -} - -/* Custom container */ -.container { - margin: 0 auto; - max-width: 1000px; -} - -.container > hr { - margin: 60px 0; -} - -/* Main marketing message and sign up button */ -.jumbotron { - margin: 80px 0; - text-align: center; -} - -.jumbotron h1 { - font-size: 100px; - line-height: 1; -} - -.jumbotron .lead { - font-size: 24px; - line-height: 1.25; -} - -.jumbotron .btn { - font-size: 21px; - padding: 14px 24px; -} - -/* Supporting marketing content */ -.marketing { - margin: 60px 0; -} - -.marketing p + h4 { - margin-top: 28px; -} - -/* Customize the navbar links to be fill the entire space of the .navbar */ -.navbar .navbar-inner { - padding: 0; -} - -.navbar .nav { - margin: 0; - display: table; - width: 100%; -} - -.navbar .nav li { - display: table-cell; - width: 1%; - float: none; -} - -.navbar .nav li a { - font-weight: bold; - text-align: center; - border-left: 1px solid rgba(255, 255, 255, .75); - border-right: 1px solid rgba(0, 0, 0, .1); -} - -.navbar .nav li:first-child a { - border-left: 0; - border-radius: 3px 0 0 3px; -} - -.navbar .nav li:last-child a { - border-right: 0; - border-radius: 0 3px 3px 0; -} diff --git a/apps/advanced/composer.json b/apps/advanced/composer.json index 0e393cf..2d5b987 100644 --- a/apps/advanced/composer.json +++ b/apps/advanced/composer.json @@ -26,13 +26,13 @@ "extra": { "yii-install-writable": [ "backend/runtime", - "backend/www/assets", + "backend/web/assets", "console/runtime", "console/migrations", "frontend/runtime", - "frontend/www/assets" + "frontend/web/assets" ] } } diff --git a/apps/advanced/frontend/config/AppAsset.php b/apps/advanced/frontend/config/AppAsset.php index 0a3a5e8..0ba2c1d 100644 --- a/apps/advanced/frontend/config/AppAsset.php +++ b/apps/advanced/frontend/config/AppAsset.php @@ -14,8 +14,8 @@ use yii\web\AssetBundle; */ class AppAsset extends AssetBundle { - public $basePath = '@wwwroot'; - public $baseUrl = '@www'; + public $basePath = '@webroot'; + public $baseUrl = '@web'; public $css = array( 'css/site.css', ); diff --git a/apps/advanced/frontend/web/.gitignore b/apps/advanced/frontend/web/.gitignore new file mode 100644 index 0000000..148f2b0 --- /dev/null +++ b/apps/advanced/frontend/web/.gitignore @@ -0,0 +1 @@ +/index.php \ No newline at end of file diff --git a/apps/advanced/frontend/web/assets/.gitignore b/apps/advanced/frontend/web/assets/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/apps/advanced/frontend/web/assets/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/apps/advanced/frontend/web/css/site.css b/apps/advanced/frontend/web/css/site.css new file mode 100644 index 0000000..890a953 --- /dev/null +++ b/apps/advanced/frontend/web/css/site.css @@ -0,0 +1,78 @@ +body { + padding-top: 20px; + padding-bottom: 60px; +} + +/* Custom container */ +.container { + margin: 0 auto; + max-width: 1000px; +} + +.container > hr { + margin: 60px 0; +} + +/* Main marketing message and sign up button */ +.jumbotron { + margin: 80px 0; + text-align: center; +} + +.jumbotron h1 { + font-size: 100px; + line-height: 1; +} + +.jumbotron .lead { + font-size: 24px; + line-height: 1.25; +} + +.jumbotron .btn { + font-size: 21px; + padding: 14px 24px; +} + +/* Supporting marketing content */ +.marketing { + margin: 60px 0; +} + +.marketing p + h4 { + margin-top: 28px; +} + +/* Customize the navbar links to be fill the entire space of the .navbar */ +.navbar .navbar-inner { + padding: 0; +} + +.navbar .nav { + margin: 0; + display: table; + width: 100%; +} + +.navbar .nav li { + display: table-cell; + width: 1%; + float: none; +} + +.navbar .nav li a { + font-weight: bold; + text-align: center; + border-left: 1px solid rgba(255, 255, 255, .75); + border-right: 1px solid rgba(0, 0, 0, .1); +} + +.navbar .nav li:first-child a { + border-left: 0; + border-radius: 3px 0 0 3px; +} + +.navbar .nav li:last-child a { + border-right: 0; + border-radius: 0 3px 3px 0; +} diff --git a/apps/advanced/frontend/www/.gitignore b/apps/advanced/frontend/www/.gitignore deleted file mode 100644 index 148f2b0..0000000 --- a/apps/advanced/frontend/www/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/index.php \ No newline at end of file diff --git a/apps/advanced/frontend/www/assets/.gitignore b/apps/advanced/frontend/www/assets/.gitignore deleted file mode 100644 index c96a04f..0000000 --- a/apps/advanced/frontend/www/assets/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file diff --git a/apps/advanced/frontend/www/css/site.css b/apps/advanced/frontend/www/css/site.css deleted file mode 100644 index 890a953..0000000 --- a/apps/advanced/frontend/www/css/site.css +++ /dev/null @@ -1,78 +0,0 @@ -body { - padding-top: 20px; - padding-bottom: 60px; -} - -/* Custom container */ -.container { - margin: 0 auto; - max-width: 1000px; -} - -.container > hr { - margin: 60px 0; -} - -/* Main marketing message and sign up button */ -.jumbotron { - margin: 80px 0; - text-align: center; -} - -.jumbotron h1 { - font-size: 100px; - line-height: 1; -} - -.jumbotron .lead { - font-size: 24px; - line-height: 1.25; -} - -.jumbotron .btn { - font-size: 21px; - padding: 14px 24px; -} - -/* Supporting marketing content */ -.marketing { - margin: 60px 0; -} - -.marketing p + h4 { - margin-top: 28px; -} - -/* Customize the navbar links to be fill the entire space of the .navbar */ -.navbar .navbar-inner { - padding: 0; -} - -.navbar .nav { - margin: 0; - display: table; - width: 100%; -} - -.navbar .nav li { - display: table-cell; - width: 1%; - float: none; -} - -.navbar .nav li a { - font-weight: bold; - text-align: center; - border-left: 1px solid rgba(255, 255, 255, .75); - border-right: 1px solid rgba(0, 0, 0, .1); -} - -.navbar .nav li:first-child a { - border-left: 0; - border-radius: 3px 0 0 3px; -} - -.navbar .nav li:last-child a { - border-right: 0; - border-radius: 0 3px 3px 0; -} diff --git a/apps/basic/README.md b/apps/basic/README.md index 31b5ecc..b5e1ec2 100644 --- a/apps/basic/README.md +++ b/apps/basic/README.md @@ -24,7 +24,7 @@ DIRECTORY STRUCTURE runtime/ contains files generated during runtime vendor/ contains dependent 3rd-party packages views/ contains view files for the Web application - www/ contains the entry script and Web resources + web/ contains the entry script and Web resources @@ -53,7 +53,7 @@ You can then install the Bootstrap Application using the following command: php composer.phar create-project --stability=dev yiisoft/yii2-app-basic yii-basic ~~~ -Now you should be able to access the application using the URL `http://localhost/yii-basic/www/`, +Now you should be able to access the application using the URL `http://localhost/yii-basic/web/`, assuming `yii-basic` is directly under the document root of your Web server. diff --git a/apps/basic/composer.json b/apps/basic/composer.json index b01c56c..dd50b69 100644 --- a/apps/basic/composer.json +++ b/apps/basic/composer.json @@ -26,7 +26,7 @@ "extra": { "yii-install-writable": [ "runtime", - "www/assets" + "web/assets" ], "yii-install-executable": [ "yii" diff --git a/apps/basic/config/AppAsset.php b/apps/basic/config/AppAsset.php index 2546969..94369bf 100644 --- a/apps/basic/config/AppAsset.php +++ b/apps/basic/config/AppAsset.php @@ -15,8 +15,8 @@ use yii\web\AssetBundle; */ class AppAsset extends AssetBundle { - public $basePath = '@wwwroot'; - public $baseUrl = '@www'; + public $basePath = '@webroot'; + public $baseUrl = '@web'; public $css = array( 'css/site.css', ); diff --git a/apps/basic/tests/functional.suite.dist.yml b/apps/basic/tests/functional.suite.dist.yml index aa777ac..6dd9193 100644 --- a/apps/basic/tests/functional.suite.dist.yml +++ b/apps/basic/tests/functional.suite.dist.yml @@ -11,5 +11,5 @@ modules: enabled: [Filesystem, TestHelper, Yii2] config: Yii2: - entryScript: 'www/index-test.php' + entryScript: 'web/index-test.php' url: 'http://localhost/' diff --git a/apps/basic/web/assets/.gitignore b/apps/basic/web/assets/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/apps/basic/web/assets/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/apps/basic/web/css/site.css b/apps/basic/web/css/site.css new file mode 100644 index 0000000..890a953 --- /dev/null +++ b/apps/basic/web/css/site.css @@ -0,0 +1,78 @@ +body { + padding-top: 20px; + padding-bottom: 60px; +} + +/* Custom container */ +.container { + margin: 0 auto; + max-width: 1000px; +} + +.container > hr { + margin: 60px 0; +} + +/* Main marketing message and sign up button */ +.jumbotron { + margin: 80px 0; + text-align: center; +} + +.jumbotron h1 { + font-size: 100px; + line-height: 1; +} + +.jumbotron .lead { + font-size: 24px; + line-height: 1.25; +} + +.jumbotron .btn { + font-size: 21px; + padding: 14px 24px; +} + +/* Supporting marketing content */ +.marketing { + margin: 60px 0; +} + +.marketing p + h4 { + margin-top: 28px; +} + +/* Customize the navbar links to be fill the entire space of the .navbar */ +.navbar .navbar-inner { + padding: 0; +} + +.navbar .nav { + margin: 0; + display: table; + width: 100%; +} + +.navbar .nav li { + display: table-cell; + width: 1%; + float: none; +} + +.navbar .nav li a { + font-weight: bold; + text-align: center; + border-left: 1px solid rgba(255, 255, 255, .75); + border-right: 1px solid rgba(0, 0, 0, .1); +} + +.navbar .nav li:first-child a { + border-left: 0; + border-radius: 3px 0 0 3px; +} + +.navbar .nav li:last-child a { + border-right: 0; + border-radius: 0 3px 3px 0; +} diff --git a/apps/basic/web/index-test.php b/apps/basic/web/index-test.php new file mode 100644 index 0000000..80d0953 --- /dev/null +++ b/apps/basic/web/index-test.php @@ -0,0 +1,18 @@ +run(); diff --git a/apps/basic/web/index.php b/apps/basic/web/index.php new file mode 100644 index 0000000..fb66386 --- /dev/null +++ b/apps/basic/web/index.php @@ -0,0 +1,14 @@ +run(); diff --git a/apps/basic/www/assets/.gitignore b/apps/basic/www/assets/.gitignore deleted file mode 100644 index c96a04f..0000000 --- a/apps/basic/www/assets/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file diff --git a/apps/basic/www/css/site.css b/apps/basic/www/css/site.css deleted file mode 100644 index 890a953..0000000 --- a/apps/basic/www/css/site.css +++ /dev/null @@ -1,78 +0,0 @@ -body { - padding-top: 20px; - padding-bottom: 60px; -} - -/* Custom container */ -.container { - margin: 0 auto; - max-width: 1000px; -} - -.container > hr { - margin: 60px 0; -} - -/* Main marketing message and sign up button */ -.jumbotron { - margin: 80px 0; - text-align: center; -} - -.jumbotron h1 { - font-size: 100px; - line-height: 1; -} - -.jumbotron .lead { - font-size: 24px; - line-height: 1.25; -} - -.jumbotron .btn { - font-size: 21px; - padding: 14px 24px; -} - -/* Supporting marketing content */ -.marketing { - margin: 60px 0; -} - -.marketing p + h4 { - margin-top: 28px; -} - -/* Customize the navbar links to be fill the entire space of the .navbar */ -.navbar .navbar-inner { - padding: 0; -} - -.navbar .nav { - margin: 0; - display: table; - width: 100%; -} - -.navbar .nav li { - display: table-cell; - width: 1%; - float: none; -} - -.navbar .nav li a { - font-weight: bold; - text-align: center; - border-left: 1px solid rgba(255, 255, 255, .75); - border-right: 1px solid rgba(0, 0, 0, .1); -} - -.navbar .nav li:first-child a { - border-left: 0; - border-radius: 3px 0 0 3px; -} - -.navbar .nav li:last-child a { - border-right: 0; - border-radius: 0 3px 3px 0; -} diff --git a/apps/basic/www/index-test.php b/apps/basic/www/index-test.php deleted file mode 100644 index 80d0953..0000000 --- a/apps/basic/www/index-test.php +++ /dev/null @@ -1,18 +0,0 @@ -run(); diff --git a/apps/basic/www/index.php b/apps/basic/www/index.php deleted file mode 100644 index fb66386..0000000 --- a/apps/basic/www/index.php +++ /dev/null @@ -1,14 +0,0 @@ -run(); diff --git a/docs/guide/bootstrap.md b/docs/guide/bootstrap.md index e6cfb1f..c1a40b6 100644 --- a/docs/guide/bootstrap.md +++ b/docs/guide/bootstrap.md @@ -22,7 +22,7 @@ You can then install the Bootstrap Application using the following command: php composer.phar create-project --stability=dev yiisoft/yii2-app-basic yii-basic ~~~ -Now you should be able to access the Bootstrap Application using the URL `http://localhost/yii-basic/www/`, +Now you should be able to access the Bootstrap Application using the URL `http://localhost/yii-basic/web/`, assuming `yii-basic` is directly under the document root of your Web server. @@ -59,7 +59,7 @@ yii-basic/ contact.php the view for the 'contact' action index.php the view for the 'index' action login.php the view for the 'login' action - www/ containing Web-accessible resources + web/ containing Web-accessible resources index.php Web application entry script file assets/ containing published resource files css/ containing CSS files diff --git a/docs/guide/upgrade-from-v1.md b/docs/guide/upgrade-from-v1.md index 79c6c3f..51118d9 100644 --- a/docs/guide/upgrade-from-v1.md +++ b/docs/guide/upgrade-from-v1.md @@ -245,8 +245,8 @@ Themes Themes work completely different in 2.0. They are now based on a path map to "translate" a source view into a themed view. For example, if the path map for a theme is -`array('/www/views' => '/www/themes/basic')`, then the themed version for a view file -`/www/views/site/index.php` will be `/www/themes/basic/site/index.php`. +`array('/web/views' => '/web/themes/basic')`, then the themed version for a view file +`/web/views/site/index.php` will be `/web/themes/basic/site/index.php`. For this reason, theme can now be applied to any view file, even if a view rendered outside of the context of a controller or a widget. diff --git a/framework/yii/base/Theme.php b/framework/yii/base/Theme.php index 91c32dc..ffd2732 100644 --- a/framework/yii/base/Theme.php +++ b/framework/yii/base/Theme.php @@ -21,9 +21,9 @@ use yii\helpers\FileHelper; * with its themed version if part of its path matches one of the keys in [[pathMap]]. * Then the matched part will be replaced with the corresponding array value. * - * For example, if [[pathMap]] is `array('/www/views' => '/www/themes/basic')`, - * then the themed version for a view file `/www/views/site/index.php` will be - * `/www/themes/basic/site/index.php`. + * For example, if [[pathMap]] is `array('/web/views' => '/web/themes/basic')`, + * then the themed version for a view file `/web/views/site/index.php` will be + * `/web/themes/basic/site/index.php`. * * To use a theme, you should configure the [[View::theme|theme]] property of the "view" application * component like the following: @@ -31,8 +31,8 @@ use yii\helpers\FileHelper; * ~~~ * 'view' => array( * 'theme' => array( - * 'basePath' => '@wwwroot/themes/basic', - * 'baseUrl' => '@www/themes/basic', + * 'basePath' => '@webroot/themes/basic', + * 'baseUrl' => '@web/themes/basic', * ), * ), * ~~~ diff --git a/framework/yii/console/controllers/AssetController.php b/framework/yii/console/controllers/AssetController.php index 1fa99dd..c4d4b5a 100644 --- a/framework/yii/console/controllers/AssetController.php +++ b/framework/yii/console/controllers/AssetController.php @@ -22,7 +22,7 @@ use yii\console\Controller; * yii asset /path/to/myapp/config.php /path/to/myapp/config/assets_compressed.php * 4. Adjust your web application config to use compressed assets. * - * Note: in the console environment some path aliases like '@wwwroot' and '@www' may not exist, + * Note: in the console environment some path aliases like '@webroot' and '@web' may not exist, * so corresponding paths inside the configuration should be specified directly. * * Note: by default this command relies on an external tools to perform actual files compression, @@ -587,7 +587,7 @@ EOD; array( 'app\config\AllAsset' => array( - 'basePath' => 'path/to/www', + 'basePath' => 'path/to/web', 'baseUrl' => '', 'js' => 'js/all-{ts}.js', 'css' => 'css/all-{ts}.css', diff --git a/framework/yii/web/Application.php b/framework/yii/web/Application.php index 8753ebe..249b0b4 100644 --- a/framework/yii/web/Application.php +++ b/framework/yii/web/Application.php @@ -55,8 +55,8 @@ class Application extends \yii\base\Application */ public function handleRequest($request) { - Yii::setAlias('@wwwroot', dirname($request->getScriptFile())); - Yii::setAlias('@www', $request->getBaseUrl()); + Yii::setAlias('@webroot', dirname($request->getScriptFile())); + Yii::setAlias('@web', $request->getBaseUrl()); if (empty($this->catchAll)) { list ($route, $params) = $request->resolve(); diff --git a/framework/yii/web/AssetManager.php b/framework/yii/web/AssetManager.php index eeffb01..702fd30 100644 --- a/framework/yii/web/AssetManager.php +++ b/framework/yii/web/AssetManager.php @@ -30,11 +30,11 @@ class AssetManager extends Component /** * @return string the root directory storing the published asset files. */ - public $basePath = '@wwwroot/assets'; + public $basePath = '@webroot/assets'; /** * @return string the base URL through which the published asset files can be accessed. */ - public $baseUrl = '@www/assets'; + public $baseUrl = '@web/assets'; /** * @var boolean whether to use symbolic link to publish asset files. Defaults to false, meaning * asset files are copied to [[basePath]]. Using symbolic links has the benefit that the published