Commit 3bef7365 by Qiang Xue

Fixes #624: renamed www to web.

parent ae287f12
...@@ -34,7 +34,7 @@ backend ...@@ -34,7 +34,7 @@ backend
models/ contains backend-specific model classes models/ contains backend-specific model classes
runtime/ contains files generated during runtime runtime/ contains files generated during runtime
views/ contains view files for the Web application 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 frontend
assets/ contains application assets such as JavaScript and CSS assets/ contains application assets such as JavaScript and CSS
config/ contains frontend configurations config/ contains frontend configurations
...@@ -42,7 +42,7 @@ frontend ...@@ -42,7 +42,7 @@ frontend
models/ contains frontend-specific model classes models/ contains frontend-specific model classes
runtime/ contains files generated during runtime runtime/ contains files generated during runtime
views/ contains view files for the Web application 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 vendor/ contains dependent 3rd-party packages
environments/ contains environment-based overrides environments/ contains environment-based overrides
``` ```
...@@ -107,8 +107,8 @@ the installed application. You only need to do these once for all. ...@@ -107,8 +107,8 @@ the installed application. You only need to do these once for all.
Now you should be able to access: Now you should be able to access:
- the frontend using the URL `http://localhost/yii-advanced/frontend/www/` - the frontend using the URL `http://localhost/yii-advanced/frontend/web/`
- the backend using the URL `http://localhost/yii-advanced/backend/www/` - the backend using the URL `http://localhost/yii-advanced/backend/web/`
assuming `yii-advanced` is directly under the document root of your Web server. assuming `yii-advanced` is directly under the document root of your Web server.
...@@ -14,8 +14,8 @@ use yii\web\AssetBundle; ...@@ -14,8 +14,8 @@ use yii\web\AssetBundle;
*/ */
class AppAsset extends AssetBundle class AppAsset extends AssetBundle
{ {
public $basePath = '@wwwroot'; public $basePath = '@webroot';
public $baseUrl = '@www'; public $baseUrl = '@web';
public $css = array( public $css = array(
'css/site.css', 'css/site.css',
); );
......
...@@ -26,13 +26,13 @@ ...@@ -26,13 +26,13 @@
"extra": { "extra": {
"yii-install-writable": [ "yii-install-writable": [
"backend/runtime", "backend/runtime",
"backend/www/assets", "backend/web/assets",
"console/runtime", "console/runtime",
"console/migrations", "console/migrations",
"frontend/runtime", "frontend/runtime",
"frontend/www/assets" "frontend/web/assets"
] ]
} }
} }
...@@ -14,8 +14,8 @@ use yii\web\AssetBundle; ...@@ -14,8 +14,8 @@ use yii\web\AssetBundle;
*/ */
class AppAsset extends AssetBundle class AppAsset extends AssetBundle
{ {
public $basePath = '@wwwroot'; public $basePath = '@webroot';
public $baseUrl = '@www'; public $baseUrl = '@web';
public $css = array( public $css = array(
'css/site.css', 'css/site.css',
); );
......
...@@ -24,7 +24,7 @@ DIRECTORY STRUCTURE ...@@ -24,7 +24,7 @@ DIRECTORY STRUCTURE
runtime/ contains files generated during runtime runtime/ contains files generated during runtime
vendor/ contains dependent 3rd-party packages vendor/ contains dependent 3rd-party packages
views/ contains view files for the Web application 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: ...@@ -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 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. assuming `yii-basic` is directly under the document root of your Web server.
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
"extra": { "extra": {
"yii-install-writable": [ "yii-install-writable": [
"runtime", "runtime",
"www/assets" "web/assets"
], ],
"yii-install-executable": [ "yii-install-executable": [
"yii" "yii"
......
...@@ -15,8 +15,8 @@ use yii\web\AssetBundle; ...@@ -15,8 +15,8 @@ use yii\web\AssetBundle;
*/ */
class AppAsset extends AssetBundle class AppAsset extends AssetBundle
{ {
public $basePath = '@wwwroot'; public $basePath = '@webroot';
public $baseUrl = '@www'; public $baseUrl = '@web';
public $css = array( public $css = array(
'css/site.css', 'css/site.css',
); );
......
...@@ -11,5 +11,5 @@ modules: ...@@ -11,5 +11,5 @@ modules:
enabled: [Filesystem, TestHelper, Yii2] enabled: [Filesystem, TestHelper, Yii2]
config: config:
Yii2: Yii2:
entryScript: 'www/index-test.php' entryScript: 'web/index-test.php'
url: 'http://localhost/' url: 'http://localhost/'
...@@ -22,7 +22,7 @@ You can then install the Bootstrap Application using the following command: ...@@ -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 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. assuming `yii-basic` is directly under the document root of your Web server.
...@@ -59,7 +59,7 @@ yii-basic/ ...@@ -59,7 +59,7 @@ yii-basic/
contact.php the view for the 'contact' action contact.php the view for the 'contact' action
index.php the view for the 'index' action index.php the view for the 'index' action
login.php the view for the 'login' 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 index.php Web application entry script file
assets/ containing published resource files assets/ containing published resource files
css/ containing CSS files css/ containing CSS files
......
...@@ -245,8 +245,8 @@ Themes ...@@ -245,8 +245,8 @@ Themes
Themes work completely different in 2.0. They are now based on a path map to "translate" a source 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 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 `array('/web/views' => '/web/themes/basic')`, then the themed version for a view file
`/www/views/site/index.php` will be `/www/themes/basic/site/index.php`. `/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 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. of the context of a controller or a widget.
......
...@@ -21,9 +21,9 @@ use yii\helpers\FileHelper; ...@@ -21,9 +21,9 @@ use yii\helpers\FileHelper;
* with its themed version if part of its path matches one of the keys in [[pathMap]]. * 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. * Then the matched part will be replaced with the corresponding array value.
* *
* For example, if [[pathMap]] is `array('/www/views' => '/www/themes/basic')`, * For example, if [[pathMap]] is `array('/web/views' => '/web/themes/basic')`,
* then the themed version for a view file `/www/views/site/index.php` will be * then the themed version for a view file `/web/views/site/index.php` will be
* `/www/themes/basic/site/index.php`. * `/web/themes/basic/site/index.php`.
* *
* To use a theme, you should configure the [[View::theme|theme]] property of the "view" application * To use a theme, you should configure the [[View::theme|theme]] property of the "view" application
* component like the following: * component like the following:
...@@ -31,8 +31,8 @@ use yii\helpers\FileHelper; ...@@ -31,8 +31,8 @@ use yii\helpers\FileHelper;
* ~~~ * ~~~
* 'view' => array( * 'view' => array(
* 'theme' => array( * 'theme' => array(
* 'basePath' => '@wwwroot/themes/basic', * 'basePath' => '@webroot/themes/basic',
* 'baseUrl' => '@www/themes/basic', * 'baseUrl' => '@web/themes/basic',
* ), * ),
* ), * ),
* ~~~ * ~~~
......
...@@ -22,7 +22,7 @@ use yii\console\Controller; ...@@ -22,7 +22,7 @@ use yii\console\Controller;
* yii asset /path/to/myapp/config.php /path/to/myapp/config/assets_compressed.php * yii asset /path/to/myapp/config.php /path/to/myapp/config/assets_compressed.php
* 4. Adjust your web application config to use compressed assets. * 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. * 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, * Note: by default this command relies on an external tools to perform actual files compression,
...@@ -587,7 +587,7 @@ EOD; ...@@ -587,7 +587,7 @@ EOD;
<?php <?php
/** /**
* Configuration file for the "yii asset" console command. * Configuration file for the "yii asset" console command.
* Note that in the console environment, some path aliases like '@wwwroot' and '@www' may not exist. * Note that in the console environment, some path aliases like '@webroot' and '@web' may not exist.
* Please define these missing path aliases. * Please define these missing path aliases.
*/ */
return array( return array(
...@@ -599,7 +599,7 @@ return array( ...@@ -599,7 +599,7 @@ return array(
// Asset bundle for compression output: // Asset bundle for compression output:
'targets' => array( 'targets' => array(
'app\config\AllAsset' => array( 'app\config\AllAsset' => array(
'basePath' => 'path/to/www', 'basePath' => 'path/to/web',
'baseUrl' => '', 'baseUrl' => '',
'js' => 'js/all-{ts}.js', 'js' => 'js/all-{ts}.js',
'css' => 'css/all-{ts}.css', 'css' => 'css/all-{ts}.css',
......
...@@ -55,8 +55,8 @@ class Application extends \yii\base\Application ...@@ -55,8 +55,8 @@ class Application extends \yii\base\Application
*/ */
public function handleRequest($request) public function handleRequest($request)
{ {
Yii::setAlias('@wwwroot', dirname($request->getScriptFile())); Yii::setAlias('@webroot', dirname($request->getScriptFile()));
Yii::setAlias('@www', $request->getBaseUrl()); Yii::setAlias('@web', $request->getBaseUrl());
if (empty($this->catchAll)) { if (empty($this->catchAll)) {
list ($route, $params) = $request->resolve(); list ($route, $params) = $request->resolve();
......
...@@ -30,11 +30,11 @@ class AssetManager extends Component ...@@ -30,11 +30,11 @@ class AssetManager extends Component
/** /**
* @return string the root directory storing the published asset files. * @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. * @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 * @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 * asset files are copied to [[basePath]]. Using symbolic links has the benefit that the published
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment