diff --git a/app/assets/.gitignore b/apps/bootstrap/assets/.gitignore similarity index 100% rename from app/assets/.gitignore rename to apps/bootstrap/assets/.gitignore diff --git a/app/css/bootstrap-responsive.css b/apps/bootstrap/css/bootstrap-responsive.css similarity index 100% rename from app/css/bootstrap-responsive.css rename to apps/bootstrap/css/bootstrap-responsive.css diff --git a/app/css/bootstrap-responsive.min.css b/apps/bootstrap/css/bootstrap-responsive.min.css similarity index 100% rename from app/css/bootstrap-responsive.min.css rename to apps/bootstrap/css/bootstrap-responsive.min.css diff --git a/app/css/bootstrap.css b/apps/bootstrap/css/bootstrap.css similarity index 100% rename from app/css/bootstrap.css rename to apps/bootstrap/css/bootstrap.css diff --git a/app/css/bootstrap.min.css b/apps/bootstrap/css/bootstrap.min.css similarity index 100% rename from app/css/bootstrap.min.css rename to apps/bootstrap/css/bootstrap.min.css diff --git a/app/css/site.css b/apps/bootstrap/css/site.css similarity index 100% rename from app/css/site.css rename to apps/bootstrap/css/site.css diff --git a/app/img/glyphicons-halflings-white.png b/apps/bootstrap/img/glyphicons-halflings-white.png similarity index 100% rename from app/img/glyphicons-halflings-white.png rename to apps/bootstrap/img/glyphicons-halflings-white.png diff --git a/app/img/glyphicons-halflings.png b/apps/bootstrap/img/glyphicons-halflings.png similarity index 100% rename from app/img/glyphicons-halflings.png rename to apps/bootstrap/img/glyphicons-halflings.png diff --git a/app/index.php b/apps/bootstrap/index.php similarity index 80% rename from app/index.php rename to apps/bootstrap/index.php index 8f98090..e3188c1 100644 --- a/app/index.php +++ b/apps/bootstrap/index.php @@ -2,7 +2,7 @@ defined('YII_DEBUG') or define('YII_DEBUG', true); -require(__DIR__ . '/../framework/yii.php'); +require(__DIR__ . '/../../framework/yii.php'); $config = require(__DIR__ . '/protected/config/main.php'); $application = new yii\web\Application($config); diff --git a/app/js/bootstrap.js b/apps/bootstrap/js/bootstrap.js similarity index 100% rename from app/js/bootstrap.js rename to apps/bootstrap/js/bootstrap.js diff --git a/app/js/bootstrap.min.js b/apps/bootstrap/js/bootstrap.min.js similarity index 100% rename from app/js/bootstrap.min.js rename to apps/bootstrap/js/bootstrap.min.js diff --git a/app/protected/.htaccess b/apps/bootstrap/protected/.htaccess similarity index 100% rename from app/protected/.htaccess rename to apps/bootstrap/protected/.htaccess diff --git a/app/protected/config/assets.php b/apps/bootstrap/protected/config/assets.php similarity index 100% rename from app/protected/config/assets.php rename to apps/bootstrap/protected/config/assets.php diff --git a/app/protected/config/main.php b/apps/bootstrap/protected/config/main.php similarity index 100% rename from app/protected/config/main.php rename to apps/bootstrap/protected/config/main.php diff --git a/app/protected/controllers/SiteController.php b/apps/bootstrap/protected/controllers/SiteController.php similarity index 100% rename from app/protected/controllers/SiteController.php rename to apps/bootstrap/protected/controllers/SiteController.php diff --git a/app/protected/models/ContactForm.php b/apps/bootstrap/protected/models/ContactForm.php similarity index 100% rename from app/protected/models/ContactForm.php rename to apps/bootstrap/protected/models/ContactForm.php diff --git a/app/protected/models/LoginForm.php b/apps/bootstrap/protected/models/LoginForm.php similarity index 100% rename from app/protected/models/LoginForm.php rename to apps/bootstrap/protected/models/LoginForm.php diff --git a/app/protected/models/User.php b/apps/bootstrap/protected/models/User.php similarity index 100% rename from app/protected/models/User.php rename to apps/bootstrap/protected/models/User.php diff --git a/app/protected/runtime/.gitignore b/apps/bootstrap/protected/runtime/.gitignore similarity index 100% rename from app/protected/runtime/.gitignore rename to apps/bootstrap/protected/runtime/.gitignore diff --git a/app/protected/views/layouts/main.php b/apps/bootstrap/protected/views/layouts/main.php similarity index 100% rename from app/protected/views/layouts/main.php rename to apps/bootstrap/protected/views/layouts/main.php diff --git a/app/protected/views/site/about.php b/apps/bootstrap/protected/views/site/about.php similarity index 100% rename from app/protected/views/site/about.php rename to apps/bootstrap/protected/views/site/about.php diff --git a/app/protected/views/site/contact.php b/apps/bootstrap/protected/views/site/contact.php similarity index 100% rename from app/protected/views/site/contact.php rename to apps/bootstrap/protected/views/site/contact.php diff --git a/app/protected/views/site/index.php b/apps/bootstrap/protected/views/site/index.php similarity index 100% rename from app/protected/views/site/index.php rename to apps/bootstrap/protected/views/site/index.php diff --git a/app/protected/views/site/login.php b/apps/bootstrap/protected/views/site/login.php similarity index 100% rename from app/protected/views/site/login.php rename to apps/bootstrap/protected/views/site/login.php diff --git a/docs/guide/bootstrap.md b/docs/guide/bootstrap.md index 5f00a75..1bc3fe6 100644 --- a/docs/guide/bootstrap.md +++ b/docs/guide/bootstrap.md @@ -7,7 +7,7 @@ If you have installed Yii under a Web-accessible folder, you should be able to access this application through the following URL: ~~~ -http://localhost/yii/app/index.php +http://localhost/yii/apps/bootstrap/index.php ~~~ diff --git a/framework/console/webapp/config.php b/framework/console/webapp/config.php deleted file mode 100644 index 47ddcc1..0000000 --- a/framework/console/webapp/config.php +++ /dev/null @@ -1,17 +0,0 @@ - array( - 'index.php' => array( - 'handler' => function($source) use ($controller) { - return $controller->replaceRelativePath($source, realpath(YII_PATH.'/yii.php'), 'yii'); - }, - 'permissions' => 0777, - ), - 'protected/runtime' => array( - 'permissions' => 0755, - ), - ), -); diff --git a/framework/console/webapp/default/index.php b/framework/console/webapp/default/index.php deleted file mode 100644 index 2aa3580..0000000 --- a/framework/console/webapp/default/index.php +++ /dev/null @@ -1,10 +0,0 @@ -run(); diff --git a/framework/console/webapp/default/protected/config/main.php b/framework/console/webapp/default/protected/config/main.php deleted file mode 100644 index 5817783..0000000 --- a/framework/console/webapp/default/protected/config/main.php +++ /dev/null @@ -1,20 +0,0 @@ - 'webapp', - 'name' => 'My Web Application', - - 'components' => array( - // uncomment the following to use a MySQL database - /* - 'db' => array( - 'class' => 'yii\db\Connection', - 'dsn' => 'mysql:host=localhost;dbname=testdrive', - 'username' => 'root', - 'password' => '', - ), - */ - 'cache' => array( - 'class' => 'yii\caching\DummyCache', - ), - ), -); diff --git a/framework/console/webapp/default/protected/controllers/SiteController.php b/framework/console/webapp/default/protected/controllers/SiteController.php deleted file mode 100644 index ac8c1dd..0000000 --- a/framework/console/webapp/default/protected/controllers/SiteController.php +++ /dev/null @@ -1,15 +0,0 @@ -render('index', array( - 'name' => 'Qiang', - )); - } -} diff --git a/framework/console/webapp/default/protected/views/layouts/main.php b/framework/console/webapp/default/protected/views/layouts/main.php deleted file mode 100644 index 9837038..0000000 --- a/framework/console/webapp/default/protected/views/layouts/main.php +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - <?php echo Html::encode($this->title)?> - - -

title)?>

-
- -
- - - diff --git a/framework/console/webapp/default/protected/views/site/index.php b/framework/console/webapp/default/protected/views/site/index.php deleted file mode 100644 index 08c5288..0000000 --- a/framework/console/webapp/default/protected/views/site/index.php +++ /dev/null @@ -1 +0,0 @@ -Hello, ! diff --git a/framework/web/AccessRule.php b/framework/web/AccessRule.php index aaf4f6b..e565e18 100644 --- a/framework/web/AccessRule.php +++ b/framework/web/AccessRule.php @@ -9,9 +9,6 @@ namespace yii\web; use yii\base\Component; use yii\base\Action; -use yii\base\Controller; -use yii\web\User; -use yii\web\Request; /** * diff --git a/framework/web/User.php b/framework/web/User.php index 2fbea91..88fc12d 100644 --- a/framework/web/User.php +++ b/framework/web/User.php @@ -461,7 +461,7 @@ class User extends Component if ($auth !== null) { return $auth->checkAccess($this->getId(), $operation, $params); } else { - return true; + return false; } } } diff --git a/readme.md b/readme.md index 6293292..f395e95 100644 --- a/readme.md +++ b/readme.md @@ -13,7 +13,8 @@ without prior notices. **Yii 2.0 is not ready for production use yet.** DIRECTORY STRUCTURE ------------------- - app/ a ready-to-use application built on Yii 2 + apps/ ready-to-use Web apps built on Yii 2 + bootstrap/ a simple app supporting user login and contact page build/ internally used build tools docs/ documentation framework/ framework source files