liberty_code_module / framework
模块
v1.0.0
2022-01-11 21:55 UTC
Requires
- php: ~7 || ~8
- liberty_code/command: ^1.0.
- liberty_code/controller: ^1.0.
- liberty_code/framework: ^1.0.
- liberty_code/library: ^1.0.
- liberty_code/parser: ^1.0.
- liberty_code/request_flow: ^1.0.
This package is auto-updated.
Last update: 2024-09-05 00:02:25 UTC
README
描述
库包含框架模块,用于管理应用程序框架引擎。
要求
- 脚本语言:PHP:版本 ~7 || ~8
安装
有几种可能的安装方式
Composer
要求
需要安装Composer。更多信息请访问:https://getcomposer.org
命令:在项目根路径移动
cd "<project_root_path>"
命令:安装
php composer.phar require liberty_code_module/framework ["<version>"]
注意
包含vendor
如果项目使用Composer,必须包含vendor
require_once('<project_root_path>/vendor/autoload.php');
配置
安装命令允许在composer文件中添加:
{ "require": { "liberty_code_module/framework": "<version>" } }
包含
下载
- 下载以下存储库。
- 将其放在存储库根路径上。
包含源代码
require_once('<repository_root_path>/include/Include.php');
应用程序安装
配置
配置:应用程序模块:"
在列表部分添加,所需模块
示例:YML配置格式,从Composer安装
list: [ { path: "/vendor/liberty_code_module/framework/src/application", config_parser: { type: "string_table_php", source_format_get_regexp: "#^\\<\\?php\\s*(.*)(\\s\\?\\>)?\\s*$#ms", source_format_set_pattern: "<?php \\n%1$s", cache_parser_require: true, cache_file_parser_require: true } }, { path: "/vendor/liberty_code_module/framework/src/app_mode", config_parser: { type: "string_table_php", source_format_get_regexp: "#^\\<\\?php\\s*(.*)(\\s\\?\\>)?\\s*$#ms", source_format_set_pattern: "<?php \\n%1$s", cache_parser_require: true, cache_file_parser_require: true } }, { path: "/vendor/liberty_code_module/framework/src/cache", config_parser: { type: "string_table_php", source_format_get_regexp: "#^\\<\\?php\\s*(.*)(\\s\\?\\>)?\\s*$#ms", source_format_set_pattern: "<?php \\n%1$s", cache_parser_require: true, cache_file_parser_require: true } }, { path: "/vendor/liberty_code_module/framework/src/module", config_parser: { type: "string_table_php", source_format_get_regexp: "#^\\<\\?php\\s*(.*)(\\s\\?\\>)?\\s*$#ms", source_format_set_pattern: "<?php \\n%1$s", cache_parser_require: true, cache_file_parser_require: true } } ]
用法
以下示例假设命令行应用程序相对路径为“bin/app”。
应用程序
功能允许获取框架应用程序信息。
示例
cd "<project_root_path>"
...
// Get application root directory full path
php bin/app app:get:root_path
应用程序模式
功能允许获取框架应用程序模式信息。
示例
cd "<project_root_path>"
...
// Get all application mode keys
php bin/app app_mode:get:key -a
缓存
功能允许管理框架应用程序缓存。
示例
cd "<project_root_path>"
...
// Remove all items, from cache
php bin/app cache:remove
模块
功能允许管理框架应用程序中的模块。
示例
cd "<project_root_path>"
...
// Create specified module
// (module_root_path is relative, from application root path)
php bin/app module:create "<module_key>" "<module_root_path>"
...
// Register specified module, in application
php bin/app module:register "<module_root_path>"
...
// Get all module keys
php bin/app module:get:key "<module_root_path>"