xp-framework/core
Composer 安装命令:
composer require xp-framework/core
包简介
The XP framework is an all-purpose, object oriented PHP framework.
关键字:
README 文档
README
This is the XP Framework's development checkout.
Installation
If you just want to use the XP Framework, grab a release using composer require xp-framework/core. If you wish to use this development checkout, clone this repository instead.
Runners
The entry point for software written in the XP Framework is not the PHP interpreter's CLI / web server API but either a command line runner or a specialized web entry point. These runners can be installed by using the following one-liner:
$ cd ~/bin $ curl -sSL https://github.com/xp-runners/reference/releases/download/v9.3.0/setup-9.3.0.sh | sh
Using it
To use the the XP Framework development checkout, put the following in your ~/bin/xp.ini file:
use=/path/to/xp/core
Finally, start xp -v to see it working:
$ xp -v
XP 12.11.1-dev { PHP/8.5.7 & Zend/4.5.7 } @ Windows NT SURFACE 10.0 build 26200 (Windows 11) AMD64
Copyright (c) 2001-2026 the XP group
FileSystemCL<./src/main/php>
FileSystemCL<./src/test/php>
FileSystemCL<./src/main/resources>
FileSystemCL<./src/test/resources>
FileSystemCL<.>
Basic usage
The XP Framework runs scripts or classes.
Hello World
Save the following sourcecode to a file called ageindays.script.php:
<?php namespace examples; use util\{Date, Dates}; use util\cmd\Console; $span= Dates::diff(new Date($argv[1]), Date::now()); Console::writeLine('Hey, you are ', $span->getDays(), ' days old');
Now run it:
$ xp ageindays.script.php 1977-12-14 Hey, you are 17721 days old
Alternatively, you can put this code inside a class and give it a static main method. This way, you can use features like inheritance, trait inclusion etcetera. This time, save the code to a file called AgeInDays.class.php.
<?php use util\{Date, Dates}; use util\cmd\Console; class AgeInDays { public static function main(array $args): int { $span= Dates::diff(new Date($args[0]), Date::now()); Console::writeLine('Hey, you are ', $span->getDays(), ' days old'); return 0; } }
Note the arguments have shifted by one: If you want the class' name, simply use self::class!
$ xp AgeInDays 1977-12-14 Hey, you are 17721 days old
Contributing
To contribute, use the GitHub way - fork, hack, and submit a pull request! ![]()
Enjoy!
xp-framework/core 适用场景与选型建议
xp-framework/core 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 543.72k 次下载、GitHub Stars 达 19, 最近一次更新时间为 2014 年 09 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「xp」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 xp-framework/core 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 xp-framework/core 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 xp-framework/core 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
High-performance, opinionated PHP 8 web framework with O(1) routing, parallel async MySQL, type-safe asset bridge, and React-island frontend
The skeleton application for the Geoffrey agent framework.
Framework used for the Darflen social media project.
Speedrunner package for programming certification exam
Micro-framework PHP enxuto e modular: ORM, Router, Auth, Validation, Security, Container, View, Queue, Console e Schema.
统计信息
- 总下载量: 543.72k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 20
- 点击次数: 13
- 依赖项目数: 98
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2014-09-01
