Download the PHP package ankewk/zerophp without Composer

On this page you can find all versions of the php package ankewk/zerophp. 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 zerophp

ZeroPHP

PHP Framework


设计思想


框架


安装


使用 Docker 运行

本指南将帮助您使用 Docker 快速启动 ZeroPHP 项目。

前提条件

启动步骤

  1. 克隆项目

  2. 启动容器 使用 Docker Compose 启动服务:

    这将启动两个容器:

    • MySQL 容器 (端口 33306)
    • Apache + PHP 容器 (端口 8888)
  3. 访问应用 在浏览器中访问:

  4. 数据库连接
    • 主机: mysql (在容器内部) 或 localhost (从宿主机连接)
    • 端口: 33306
    • 用户名: root
    • 密码: (空)
    • 数据库名: zero

停止服务

数据持久化

注意事项

  1. 确保端口 33306 和 8888 在您的主机上没有被占用
  2. 首次启动时,MySQL 容器会初始化数据库,可能需要几秒钟时间
  3. 如果需要重新构建 Web 容器,可以使用:

多环境配置

环境介绍

ZeroPHP 支持三种环境配置:

  1. 开发环境 (dev):本地开发使用,默认启用调试模式
  2. 测试环境 (uat):用户验收测试使用,禁用调试模式
  3. 生产环境 (prod):正式上线使用,禁用调试模式

配置文件结构

配置文件位于 conf/env/ 目录下:

如何切换环境

方法 1:设置环境变量 (推荐)

在启动应用前设置 APP_ENV 环境变量:

方法 2:修改配置文件

conf/config.php 文件中直接修改默认环境:

自定义配置

您可以根据需要在各环境的配置文件中添加或修改配置项。所有配置项会被加载到 $config 数组中,并通过 define 函数定义为常量。

注意事项

  1. 生产环境请确保 debug 设置为 false,避免暴露敏感信息
  2. 数据库密码等敏感信息建议通过环境变量设置,不要硬编码在配置文件中
  3. 新增配置项时,请确保在所有环境的配置文件中都添加相应的配置

自动路由功能

ZeroPHP框架支持自动路由机制,无需手动配置路由即可访问控制器和方法。

最近更新

自动路由规则

  1. URL路径格式: /控制器名/方法名
  2. 控制器名会自动转换为大写开头,并添加Controller后缀
  3. 方法名会自动添加Zero后缀
  4. 默认为Index控制器和index方法

示例

注意事项

  1. 自动路由会在手动配置的路由之后生效,若两者冲突,以手动配置的路由为准
  2. 控制器文件名和类名必须遵循XxxController.phpXxxController的命名规范
  3. 方法名必须以Zero结尾

框架结构


命令行工具


应用


FAQ


All versions of zerophp with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
phpunit/phpunit Version ^6
zircote/swagger-php Version ^3.2
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 ankewk/zerophp contains the following files

Loading the files please wait ...