objective-php/primitives
Composer 安装命令:
composer require objective-php/primitives
包简介
Primitives classes for ObjectivePHP
README 文档
README
Disclaimer
This document is written in globish, the flavour of English we're trying to use in France. We know how bad our english is, please don't pay too much attention to it :)
Although we're thinking to this library for a while now, its implementation is still in early stage, and for the next coming months, you'll probably see a few code and a lot of changes in it. This means that if you're interested in this project, you're more than welcome to try it, contribute to it, make proposals for it, but please don't use it in production projects for now!
Project introduction
Primitives objects are foundation of Objective PHP. Objective PHP aims at providing some high-level component to provide PHP with a more objective syntax. The goals of Objective PHP libraries can be summed up like this:
- make extensive use of PHP OOP capabilities
- work with data objects, no multipurpose, dummy containers (aka variables)
- package commonly needed data processing into reliable, efficient and unit tested methods
- turn any error in Exception to ease failure handling
- bring to PHP a more elegant, modern and fluent way to write code (partly inspired by Javascript)
- auto-completion minded library for enhancing developer productivity
- make use of more language's features (like closures)
Our primitives library is intended achieve most of these goals. The very first set of object will contain:
- ObjectivePHP\Primitives\String
- ObjectivePHP\Primitives\Collection
Each of them will both wrap native functions in a object-oriented way and expose higher level methods to perform many usual data manipulation over those. More on this coming soon, in another document describing the coding standard and rules.
What's next?
First, we'll focus on the three above mentioned classes. We'll consider releasing a 1.0 version once they are ready to get implemented in third-party code with total reliability. Starting from here, we'll be able to work on a much more detailed roadmap.
This roadmap will not only anticipate Primitives library evolutions, but also include parallel development of extended libraries, built on top of Primitives, and offering some even higher level components for real life use:
- HTML Tag
- CSS Styles
- File/Stream
- Image
- Point (coordinates)
- ...
These are just some examples of what kind of classes we intend to work on, but much more are to come.
Once again, you all are invited to contribute by submitting us proposals, trying and testing what we do, contribute (code or documentation). For any contact, please drop us a message at team@objective-php.org
Installation
Manual
You can clone our Github repository by running:
git clone http://github.com/objective-php/primitives
If you're to proceed this way, you probably don't need more explanation about how to use the library :)
Composer
The easiest way to install the library and get ready to play with it is by using Composer. Run the following command in an empty folder you just created for Primitives:
composer require --dev objective-php/primitives:dev-master
Then, you can start coding using primitive classes by requiring Composer's autoload.php located in its vendor directory.
Hmm, before starting coding, please take the time to read this file till the end :)
How to test the work in progress?
Run unit tests
First of all, before playing around with our primitives, please always run the unit tests suite. Our tests are written using PHPUnit, and can be run as follow:
cd [clone directory]/tests
./phpunit .
Write some code
At this time, you're on your own to find out what Primitives can do for you, sorry for that, we'll soon work on some samples to help you getting started. Meanwhile, you can instantiate the various classes and learn by yourself their capabilities by relying on your IDE auto-completion feature ;)
use ObjectivePHP\Primitives\String; use ObjectivePHP\Primitives\Collection; // allow Primitives classes autoloading // Note: this is assuming you used Composer to install the library! require 'vendor/autoload.php'; $identifier = new String(uniqid()); $server = new Collection($_SERVER);
May the OOP be with PHP!
objective-php/primitives 适用场景与选型建议
objective-php/primitives 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 135.14k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2015 年 03 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「primitives」 「collection」 「objective php」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 objective-php/primitives 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 objective-php/primitives 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 objective-php/primitives 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Generic engine to match identifiers against simple yet powerful patterns
Objective PHP applicative framework
Routing mechanism for Objective PHP
Objective PHP Components
Cli commands handling library
Access Control List engine
统计信息
- 总下载量: 135.14k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 2
- 依赖项目数: 19
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2015-03-07