Selaa lähdekoodia

update composer and view

朱金辉 2 vuotta sitten
vanhempi
commit
3cf93b09b7
5 muutettua tiedostoa jossa 17 lisäystä ja 30 poistoa
  1. 4 19
      README.md
  2. 2 2
      src/Application.php
  3. 3 1
      src/View/Loader.php
  4. 1 1
      src/View/Resource.php
  5. 7 7
      src/View/Smarty.php

+ 4 - 19
README.md

@@ -6,8 +6,8 @@
 composer.json:
 
 {
-    "name": "zhujinhui/your-project",
-    "description": "Your Project",
+    "name": "zhujinhui/svideo",
+    "description": "短发布平台",
     "type": "project",
     "license": "MIT",
     "authors": [
@@ -18,24 +18,9 @@ composer.json:
     ],
     "autoload": {
         "psr-4": {
-            "YourProject\\": ""
+            "Svideo\\": ""
         }
     },
-    "scripts": {
-        "post-autoload-dump": [
-            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
-            "@php artisan package:discover --ansi"
-        ],
-        "post-update-cmd": [
-            "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
-        ],
-        "post-root-package-install": [
-            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
-        ],
-        "post-create-project-cmd": [
-            "@php artisan key:generate --ansi"
-        ]
-    },
     "config": {
         "secure-http": false,
         "vendor-dir": "../vendor"
@@ -49,7 +34,7 @@ composer.json:
         {"packagist": false}
     ],
     "require": {
-        "jinhui.zhu/qii": "1.0.4"
+        "jinhui.zhu/qii": "1.0.3"
     }
 }
 ```

+ 2 - 2
src/Application.php

@@ -355,7 +355,7 @@ class Application
      * 设置数据库使用的文件
      *
      * @param $iniFile
-     * @throws \Qii_Exceptions_Overwrite
+     * @throws \Qii\Exceptions\Overwrite
      */
     public function setDBIniFile($iniFile)
     {
@@ -450,7 +450,7 @@ class Application
         if (!$this->dispatcher instanceof \Qii\Base\Dispatcher) {
             throw new \Exception('Dispatcher must instance of Qii\Base\Dispatcher', __LINE__);
         }
-        //如果设置了host的话,看host对应的controller路径
+        //如果app.ini中设置了host的话,看host对应的controller路径
         $hosts = $this->appConfigure('hosts');
         if (!empty($hosts) && is_array($hosts) && count($hosts) > 0) {
             foreach ($hosts AS $host) {

+ 3 - 1
src/View/Loader.php

@@ -1,6 +1,8 @@
 <?php
 namespace Qii\View;
 
+use Qii\Exceptions\Unsupported;
+
 class Loader
 {
 	protected $view;
@@ -15,7 +17,7 @@ class Loader
 	{
 		if(!in_array($engine, $this->allow))
 		{
-			throw new \Qii\Exceptions\Unsupported(\Qii::i('Unsupported method', $engine));
+			throw new Unsupported(\Qii::i('Unsupported method', $engine));
 		}
 		$class = '\Qii\View\\'. ucwords($engine);
 		return $this->view = new $class();

+ 1 - 1
src/View/Resource.php

@@ -133,7 +133,7 @@ class Resource
 
 	/**
 	 * 格式化资源数据
-	 * @return stdClass
+	 * @return $this
 	 */
 	public function resource(array $resource)
 	{

+ 7 - 7
src/View/Smarty.php

@@ -8,11 +8,13 @@
  */
 namespace Qii\View;
 
-\Qii\Autoloader\Import::requires(Qii_DIR . DS . 'View' . DS . 'smarty' . DS . 'Autoloader.php');
+use Qii\Autoloader\Import;
+
+Import::requires(Qii_DIR . DS . 'View' . DS . 'smarty' . DS . 'Autoloader.php');
 \Smarty_Autoloader::register(true);
-\Qii\Autoloader\Import::requires(Qii_DIR . DS . DS . 'View' . DS . 'smarty' . DS . 'SmartyBC.class.php');
-\Qii\Autoloader\Import::requires(Qii_DIR . DS . DS . 'View' . DS . 'smarty' . DS . 'sysplugins' .DS. 'smartyexception.php');
-\Qii\Autoloader\Import::requires(Qii_DIR . DS . DS . 'View' . DS . 'smarty' . DS . 'sysplugins' .DS. 'smartycompilerexception.php');
+Import::requires(Qii_DIR . DS . DS . 'View' . DS . 'smarty' . DS . 'SmartyBC.class.php');
+Import::requires(Qii_DIR . DS . DS . 'View' . DS . 'smarty' . DS . 'sysplugins' .DS. 'smartyexception.php');
+Import::requires(Qii_DIR . DS . DS . 'View' . DS . 'smarty' . DS . 'sysplugins' .DS. 'smartycompilerexception.php');
 
 class Smarty extends \SmartyBC implements \Qii\View\Intf
 {
@@ -168,6 +170,4 @@ class Smarty extends \SmartyBC implements \Qii\View\Intf
 		}
 		return true;
 	}
-}
-
-?>
+}