Commit da9d544c by Qiang Xue

psr-4 change.

parent d9802aac
...@@ -97,24 +97,24 @@ ...@@ -97,24 +97,24 @@
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"yii\\apidoc\\": "extensions/apidoc/",
"yii\\authclient\\": "extensions/authclient/",
"yii\\bootstrap\\": "extensions/bootstrap/",
"yii\\codeception\\": "extensions/codeception/",
"yii\\debug\\": "extensions/debug/",
"yii\\elasticsearch\\": "extensions/elasticsearch/",
"yii\\faker\\": "extensions/faker/", "yii\\faker\\": "extensions/faker/",
"yii\\gii\\": "extensions/gii/",
"yii\\imagine\\" : "extensions/imagine/",
"yii\\jui\\": "extensions/jui/",
"yii\\mongodb\\": "extensions/mongodb/",
"yii\\redis\\": "extensions/redis/",
"yii\\smarty\\": "extensions/smarty/",
"yii\\swiftmailer\\": "extensions/swiftmailer/",
"yii\\sphinx\\": "extensions/sphinx/",
"yii\\twig\\": "extensions/twig/" "yii\\twig\\": "extensions/twig/"
}, },
"psr-0": { "psr-0": {
"yii\\apidoc\\": "extensions/",
"yii\\authclient\\": "extensions/",
"yii\\bootstrap\\": "extensions/",
"yii\\codeception\\": "extensions/",
"yii\\debug\\": "extensions/",
"yii\\elasticsearch\\": "extensions/",
"yii\\gii\\": "extensions/",
"yii\\imagine\\" : "extensions/",
"yii\\jui\\": "extensions/",
"yii\\mongodb\\": "extensions/",
"yii\\redis\\": "extensions/",
"yii\\smarty\\": "extensions/",
"yii\\swiftmailer\\": "extensions/",
"yii\\sphinx\\": "extensions/",
"yii\\": "framework/" "yii\\": "framework/"
} }
} }
......
...@@ -81,7 +81,7 @@ Autoloading ...@@ -81,7 +81,7 @@ Autoloading
All classes, interfaces and traits are loaded automatically at the moment they are used. There's no need to use All classes, interfaces and traits are loaded automatically at the moment they are used. There's no need to use
`include` or `require`. It is, as well, true for Composer-loaded packages and Yii extensions. `include` or `require`. It is, as well, true for Composer-loaded packages and Yii extensions.
Autoloader works according to [PSR-0](). That means namespaces and class, interface and trait Autoloader works according to [PSR-4](). That means namespaces and class, interface and trait
names should correspond to file system paths except root namespace path that is defined by an alias. names should correspond to file system paths except root namespace path that is defined by an alias.
For example, if standard alias `@app` refers to `/var/www/example.com/` then `\app\models\User` will be loaded from For example, if standard alias `@app` refers to `/var/www/example.com/` then `\app\models\User` will be loaded from
......
Yii2 class loader Yii2 class loader
================= =================
Yii 2 class loader is PSR-0 compliant. That means it can handle most of the PHP Yii 2 class loader is PSR-4 compliant. That means it can handle most of the PHP
libraries and frameworks out there. libraries and frameworks out there.
In order to autoload a library you need to set a root alias for it. In order to autoload a library you need to set a root alias for it.
......
...@@ -23,8 +23,7 @@ ...@@ -23,8 +23,7 @@
"phpdocumentor/reflection": "1.0.2" "phpdocumentor/reflection": "1.0.2"
}, },
"autoload": { "autoload": {
"psr-0": { "yii\\apidoc\\": "" } "psr-4": { "yii\\apidoc\\": "" }
}, },
"target-dir": "yii/apidoc",
"bin": ["apidoc"] "bin": ["apidoc"]
} }
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
"ext-curl": "*" "ext-curl": "*"
}, },
"autoload": { "autoload": {
"psr-0": { "yii\\authclient\\": "" } "psr-4": { "yii\\authclient\\": "" }
}, }
"target-dir": "yii/authclient"
} }
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
"twbs/bootstrap": "3.0.*" "twbs/bootstrap": "3.0.*"
}, },
"autoload": { "autoload": {
"psr-0": { "yii\\bootstrap\\": "" } "psr-4": { "yii\\bootstrap\\": "" }
}, }
"target-dir": "yii/bootstrap"
} }
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
"yiisoft/yii2": "*" "yiisoft/yii2": "*"
}, },
"autoload": { "autoload": {
"psr-0": { "yii\\codeception\\": "" } "psr-4": { "yii\\codeception\\": "" }
}, }
"target-dir": "yii/codeception"
} }
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