如何安装 Luthier CI

栏目: PHP · 发布时间: 5年前

内容简介:转到该application文件夹并执行以下命令:启用Composer
  • PHP >= 5.6 (Compatible con PHP 7)
  • CodeIgniter 3

需要Composer Luthier CI通过Composer安装。你可以在这里得到它。here.

转到该application文件夹并执行以下命令:

composer require luthier/luthier
复制代码

启用Composer autoloadhooks

要使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 文件夹具有写入权限


以上所述就是小编给大家介绍的《如何安装 Luthier CI》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

The Practice of Programming

The Practice of Programming

Brian W. Kernighan、Rob Pike / Addison-Wesley / 1999-2-14 / USD 49.99

With the same insight and authority that made their book The Unix Programming Environment a classic, Brian Kernighan and Rob Pike have written The Practice of Programming to help make individual progr......一起来看看 《The Practice of Programming》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器