satoripophq/codeigniter-composer

使用Composer安装CodeIgniter框架3的包

v1.0 2017-04-04 17:09 UTC

This package is not auto-updated.

Last update: 2024-09-29 01:54:28 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

此包使用Composer安装官方的CodeIgniter (版本 3.1.*),并使用安全文件夹结构。

注意:如果您想安装CodeIgniter4(开发中),请参阅https://github.com/sabri-elgueder/codeigniter-composer/tree/4.x

您可以使用一条命令将CodeIgniter系统文件夹更新到最新版本。

文件夹结构

codeigniter/
├── application/
├── composer.json
├── composer.lock
├── public/
│   ├── .htaccess
│   └── index.php
└── vendor/
    └── codeigniter/
        └── framework/
            └── system/

要求

如何使用

安装CodeIgniter

$ composer create-project satoripophq/codeigniter-composer codeigniter

以上命令将public/.htaccess安装到您的URL中,以删除index.php。如果您不需要它,请将其删除。

并且它修改了application/config/config.php

$config['composer_autoload'] = FALSE;
↓
$config['composer_autoload'] = realpath(APPPATH . '../vendor/autoload.php');
$config['index_page'] = 'index.php';
↓
$config['index_page'] = '';

安装系统消息的翻译

如果您想安装系统消息的翻译

$ cd /path/to/codeigniter
$ php bin/install.php translations 3.1.0

安装第三方库

CodeIgniter匹配CLI:

$ php bin/install.php matches-cli master

CodeIgniter HMVC模块:

$ php bin/install.php hmvc-modules master

模块扩展 - HMVC:

$ php bin/install.php modular-extensions-hmvc master

CodeIgniter模板库:

$ php bin/install.php codeigniter-template-library master

Ion Auth:

$ php bin/install.php ion-auth 2

CodeIgniter3文件名检查器:

$ php bin/install.php filename-checker master

CodeIgniter Rest服务器:

$ php bin/install.php restserver 2.7.2

更新CodeIgniter

$ cd /path/to/codeigniter
$ composer update

如果application文件夹或index.php中的文件发生更改,您必须手动更新文件。请参阅CodeIgniter用户指南

参考