定制 pixel418/ubiq 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pixel418/ubiq

Composer 安装命令:

composer require pixel418/ubiq

包简介

Functions for readable treatment of string, array & object

README 文档

README

Functions for readable treatment of string, array & object.

  1. Let's code
    1.1 Simple
    1.2 Readable
    1.3 Normalized
  2. Documentation
    2.1 String manipulation
    2.2 Array manipulation
    2.3 Object manipulation
  3. How to Install
  4. How to Contribute
  5. Author & Community

Let's code

Simple

With Ubiq, your treatments are simple.

$string = 'example.com/my/path';
\UString::substrBefore( $string, '/' );
// Returns 'example.com'
// Instead of usual implementation: substr( $string, 0, strpos( $string, '/' ) );

↑ top

Readable

With Ubiq, even your complex treatments still readable.

$string = 'example.com/my/path';
\UString::substrBefore( $string, '/' );
// Returns 'example.com'
\UString::substrBefore( $string, [ '/', '.' ] );
// Returns 'example'
\UString::substrBeforeLast( $string, [ '/', '.' ] );
// Returns 'example.com/my'

↑ top

Normalized

Ubiq has consistent and normalized api.

$string = 'my/path';
// Without prefix, the method return the result of the treatment
\UString::startWith( $string, '/' );
// Returns '/my/path'
$string = 'my/path';
// With 'is' prefix, the method return the result of the test
\UString::isStartWith( $string, '/' );
// Returns FALSE
$string = 'my/path';
// With 'do' prefix, the method treat by reference
\UString::doStartWith( $string, '/' );
// $string value is now '/my/path'

↑ top

How to Install

If you don't have composer, you have to install it.

Add or complete the composer.json file at the root of your repository, like this :

{
    "require": {
        "pixel418/ubiq": "0.4.*"
    }
}

Ubiq can now be downloaded via composer.

To use it, you just have to load the composer autoloader :

require_once( './vendor/autoload.php' );

↑ top

How to Contribute

  1. Fork the Ubiq repository
  2. Create a new branch for each feature or improvement
  3. Send a pull request from each feature branch to the develop branch

If you don't know much about pull request, you can read the Github article.

All pull requests must follow the PSR1 standard and be accompanied by passing phpunit tests.

↑ top

Author & Community

Ubiq is under the MIT License.
It is created and maintained by Thomas ZILLIOX.

↑ top

统计信息

  • 总下载量: 31.44k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 0
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-01-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固