Download the PHP package lisijie/framework without Composer

On this page you can find all versions of the php package lisijie/framework. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package framework

一个轻量级PHP框架

一个优雅、简洁、高效的PHP框架,用于快速开发扩展性强、可维护性强的PHP项目,零学习成本。

安装说明

只安装框架:

创建一个带有基本应用程序模板的项目(推荐)

使用说明

一、目录结构

一个基本的应用目录结构如下:

|- app 应用目录
|  |- Command 命令行脚本控制器(可选)
|  |- Config 配置文件
|  |- Controller Web控制器
|  |- Exception 自定义异常类型和异常处理器(可选)
|  |- Model 数据模型,提供数据的读写接口,一张表对应一个类(可选)
|  |- Service Service模块,封装业务逻辑,操作Model(可选)
|  |- View 视图模板文件
|- data 运行时数据目录(日志、缓存文件等)
|- public 发布目录,存放外部可访问的资源和index.php入口文件
|- vendor composer第三方包目录

框架使用符合PSR规范的自动加载机制,可以在 app 目录下创建其他包。如工具包 Util,使用的命名空间为 App\Util

二、配置文件

配置文件统一放置在 app/Config 目录下,其下又分了 development、testing、pre_release、production 子目录,分别用于开发环境、测试环境、预发布环境、生产环境的配置。放在 Config 根目录下的配置文件表示全局配置,如路由配置。放在环境目录下的为差异配置。加载方式是:首先读取全局配置,然后读取差异配置,然后将差异配置的配置项覆盖到全局配置。

配置的获取方式为:

其中 app 表示配置文件名,varname 表示配置项, default 表示当不存在该配置项时,使用它作为返回值。

三、命令行脚本

很多项目都会有在命令行模式下执行PHP脚本的需求,例如结合crontab做定时数据统计、数据清理等。在本框架中,命令行脚本控制器统一放在Command目录下,需要继承自 Core\Command,如果需要参数,则必须在方法中声明。示例代码:

执行命令行脚本方法:

直接在终端使用以下命令执行

例如以上代码的执行命令为

如果你需要定时执行以上命令,把它添加到crontab配置中即可。

四、控制器

控制器位于 app\Controller 目录下,可以在该目录下创建多个包,每个控制器类的名称以 Controller 为后缀。如:MainController.php。一个控制器类大致如下:

每个动作方法必须加上 Action 后缀。对应的访问地址为:http://domain.com/?r=main/index。其中 r 参数为路由变量,路由地址是 main/index。路由地址为全小写形式,多个单词将被转换成小写+减号的形式,例如 UserInfoController::indexAction() 对应的路由地址为 user-info/index。为了让url看起来更加美观,建议在web服务器配置url rewrite。

五、服务器配置

Nginx

要启用Url重写,请在Nginx网站配置中增加以下配置:

location / {
    try_files $uri $uri/ /index.php?$args;
}

All versions of framework with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
ext-mbstring Version *
psr/simple-cache Version ~1.0
psr/container Version ~1.0
psr/http-message Version ~1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lisijie/framework contains the following files

Loading the files please wait ....