资讯专栏INFORMATION COLUMN

Luthier CI 命令行 Command line

yimo / 771人阅读

摘要:写入权限确保该文件夹具有写入权限,以便这些命令正常工作仅适用于开发出于安全原因,如果您的应用程序配置了或环境,则将禁用这些命令激活默认情况下禁用工具。

命令行 Command line 内容 Contents

介绍 Introduction

句法 Syntax

使用CLI路由 Using CLI routes

内置CLI工具 Built-in CLI tools

激活 Activation

"luthier make"命令 "luthier make" command

"luthier migrate"命令 "luthier migrate" command

介绍 ( Introduction )

感谢Luthier CI,您可以通过命令行界面(CLI)利用框架提供的各种可能性。

句法 Syntax

CLI路由的语法类似于HTTP和AJAX路由。必须在application/routes/cli.php文件中定义CLI路由

例:


CLI路由共享与HTTP / AJAX对应的相同属性,您可以在此处了解有关它们的更多信息。

使用CLI路由 Using CLI routes

CLI路由共享与HTTP / AJAX对应的相同属性,您可以在此处了解有关它们的更多信息。

例:

$ php path/to/app/index.php [segment1] [segument2] ... [segmentN]

所以,有这条路线:

Route::cli("make/controller/{name}", function($name){
    echo "Making the controller " . $name ;
});

它可以通过运行访问:

$ php path/to/app/index.php make controller test

结果将是:

Making the controller test
内置CLI工具 Built-in CLI tools

从版本0.2.0开始,Luthier CI附带了几个命令行工具,可以帮助您完成一些重复性任务。

写入权限

确保该application文件夹具有写入权限,以便这些命令正常工作

仅适用于开发

出于安全原因,如果您的应用程序配置了testing或production环境 ,则将禁用这些命令

激活 Activation

默认情况下禁用CLI工具。要激活它们,只需在路线文件中添加几行



  luthier make command

这允许生成各种各样的框架文件。

句法:

$ php index.php luthier make [resource] [name] [type?(sequenatial|date)=date]

其中resource是资源的类型(controller,model,helper,library,middleware或migration),name是资源的名称和type(在创建迁移的情况下)被迁移以产生类型。

例子:

// Creating a controller:
$ php index.php luthier make controller ControllerName

// Creating a model:
$ php index.php luthier make model ModelName

// Creating a library:
$ php index.php luthier make library LibraryName

// Creating a helper:
$ php index.php luthier make helper HelperName

// Creating a middleware:
$ php index.php luthier make middleware MiddlewareName

// Creating a migration (by default, migrations are created by date)
$ php index.php luthier make migration create_users_table
$ php index.php luthier make migration create_users_table date
$ php index.php luthier make migration create_users_table sequential
luthier migrate command

运行(或回滚)迁移。

句法

$ php index.php luthier migrate [version?=latest]

version要运行的迁移的版本在哪里。如果省略,它将继续迁移到最新的可用版本。

也可以使用以下特殊值之一version:

reverse: 撤消所有迁移

refresh: 撤消所有迁移,然后继续迁移到最新的可用版本

例子:

$ php index.php luthier migrate reverse
$ php index.php luthier migrate refresh

文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/31397.html

相关文章

  • Luthier CI 路由 Routes

    摘要:使用时,必须为每个路由定义接受的谓词,并且任何与这些参数不匹配的请求都将生成错误。使用,可以使用匿名函数作为控制器,甚至可以在不使用单个控制器的情况下构建完整的应用程序。通过使用您告诉的方法,该路由将在请求下可用。 路由 ( Routes ) 内容 ( Contents ) 介绍 Introduction 路由类型 Route types 句法 Syntax 命名空间 Nam...

    RichardXG 评论0 收藏0
  • Luthier CI安装 Installation

    摘要:安装内容要求安装获得启用自动加载和挂钩将与您的应用程序连接初始化要求安装获得需要通过安装。编写权限如果在创建基本文件期间出现错误,则可能是由于权限不足。确保该文件夹具有写入权限 安装 ( Installation ) 内容 ( Contents ) 要求 Requirements 安装 Installation 获得Luthier CI Get Luthier CI 启用Co...

    inapt 评论0 收藏0
  • Luthier CI 简单的认证 SimpleAuth

    摘要:访问控制列表的配置与访问控制列表使用的类别和权限类别组的名称和的关联排列。 简单的认证 SimpleAuth 内容 Contents 介绍 Introduction 安装 Installation 第1步:复制所需的文件 Step 1: Copy the required files 第2步:安装数据库 Step 2: Install the database 第3步:定义...

    Scorpion 评论0 收藏0
  • 关于Luthier CI

    摘要:欢迎关于是的一个插件,增加了有趣的功能,旨在简化大型网站和的构建。它是为了尽可能地与框架集成,因此在安装后,应用程序中已存在的所有内容应该继续正常工作。在大多数情况下,安装不会超过分钟社区和支持要报告错误并提出更改,请访问上的存储库 欢迎 关于Luthier CI Luthier CI是CodeIgniter的一个插件,增加了有趣的功能,旨在简化大型网站和API的构建。 它是为了尽可能...

    lk20150415 评论0 收藏0
  • Luthier CI 认证 Authentication

    摘要:认证介绍包含构建用户身份验证系统所需的所有工具。不幸的是,它缺乏易于实现,维护和扩展的集成接口或库。激活作为可选模块,必须首先激活认证功能。它专为最常见的身份验证设计通过表单和数据库进行传统登录。 认证 Authentication 介绍 Introduction CodeIgniter包含构建用户身份验证系统所需的所有工具。不幸的是,它缺乏易于实现,维护和扩展的集成接口或库。 Lut...

    FrancisSoung 评论0 收藏0

发表评论

0条评论

最新活动
阅读需要支付1元查看
<