如何安裝 Luthier CI
- PHP >= 5.6 (Compatible con PHP 7)
- CodeIgniter 3
需要Composer Luthier CI通過Composer安裝。你可以在這裡得到它。here.
轉到該application資料夾並執行以下命令:
composer require luthier/luthier 複製程式碼
啟用Composerautoload 和hooks
要使Luthier CI工作,必須在框架中啟用Composer 自動載入和掛鉤。在檔案中config.php修改以下內容:
<?php # application/config/config.php // (...) $config['enable_hooks']= TRUE; $config['composer_autoload'] = TRUE; // (...) 複製程式碼
在hooks.php檔案中,將Luthier CI掛鉤分配給$hook變數:
<?php # application/config/hooks.php defined('BASEPATH') OR exit('No direct script access allowed'); // (...) $hook = Luthier\Hook::getHooks(); 複製程式碼
在routes.php檔案中,將Luthier CI路由分配給$route變數:
<?php # application/config/routes.php defined('BASEPATH') OR exit('No direct script access allowed'); // (...) $route = Luthier\Route::getRoutes(); 複製程式碼
第一次執行Luthier CI時,會自動建立一些檔案和資料夾:
routes/web.php routes/api.php routes/cli.php controllers/Luthier.php middleware
在框架初始化期間,呼叫鉤子:
Luthier\Hook::getHooks()返回一個帶有Luthier CI使用的鉤子的陣列,包括啟動它所需的鉤子。
此時,Luthier CI分析並編譯上述前三個檔案中定義的所有路由。
然後,當框架載入application/config/routes.php檔案中的路由時,
Luthier\Route::getRoutes()返回一個數組,其中包含CodeIgniter理解的格式的路由。
以下所有內容都是框架的正常執行。
編寫許可權( Writing permissions )
如果在建立Luthier CI基本檔案期間出現錯誤,則可能是由於許可權不足。確保該application
資料夾具有寫入許可權