quidphp/main
Composer 安装命令:
composer require quidphp/main
包简介
PHP library that provides a set of base objects and collections
关键字:
README 文档
README
About
QuidPHP/Main is a PHP library that provides a set of base objects and collections that can be extended to build something more specific. It is part of the QuidPHP package and can also be used standalone.
License
QuidPHP/Main is available as an open-source software under the MIT license.
Documentation
QuidPHP/Main documentation is available at QuidPHP/Docs.
Installation
QuidPHP/Main can be easily installed with Composer. It is available on Packagist.
$ composer require quidphp/main
Once installed, the Quid\Main namespace will be available within your PHP application.
Requirement
QuidPHP/Main requires the following:
- PHP 8.1
- All requirements of quidphp/base
Dependency
QuidPHP/Main has the following dependency:
- quidphp/base - Quid\Base - PHP library that provides a set of low-level static methods
The dependency will be resolved by using the Composer installation process.
Comment
QuidPHP/Main code is commented and all methods are explained (in French).
Convention
QuidPHP/Main is built on the following conventions:
- Coding: No curly braces are used in a IF statement if the condition can be resolved in only one statement.
- Config: A special $config static property exists in all classes. This property gets recursively merged with the parents' property on initialization.
- Dynamic: Classes are dynamic and objects need to be instantiated, very few static methods
- Interfaces: Interfaces are stored within the Contract subdirectory.
- Traits: Traits filenames start with an underscore (_).
- Type: Files, function arguments and return types are strict typed.
Overview
QuidPHP/Main contains 118 classes, traits and interfaces. Here is an overview:
- ArrMap - Abstract class that provides base methods to make a collection
- ArrObj - Abstract class that implements the methods necessary for the ArrayAccess, Countable and Iterator interfaces
- Arrs - Class for a collection containing a multidimensional array
- Autoload - Class that provides custom autoloading logic, including alias autoloading and class within closures
- Calendar - Class that provides logic for the calendar widget
- Cart - Class used to to manage a cart containing different items
- CatchableException - Class for a catchable exception
- Com - Class that provides the logic to store positive, negative or neutral communication messages
- Concatenator - Class used to concatenate the content of many files or directories
- Contract
- Cache - Interface to detail the methods required for implementing caching functionality to an object
- Catchable - Interface to mark an exception as catchable
- Email - Interface to describe methods of an objet containing an email
- FileStorage - Interface to describe a file objet which has a defined storage folder
- Hierarchy - Interface to describe the methods required to access the hierarchy of an objet
- Import - Interface to precise the methods required for being able to import and export to an objet
- Log - Interface to detail the methods required for implementing logging functionality to an object
- Meta - Interface to describe methods making an objet a source of meta-data
- Queue - Interface to detail the methods required for implementing queuing functionality to an object
- Session - Interface to detail the methods required for an objet to be a session storage
- Error - Class used as a basic error handler
- Exception - Class for a default exception
- Extender - Class for a collection containing a list of classes extending others
- Extenders - Class for a collection containing many extender objects
- File - Class for a basic file object
- Audio - Class for an audio file (like mp3)
- Binary - Abstract class for a binary file
- Cache - Class for a cache storage file
- Calendar - Class for a calendar file (like ics)
- Css - Class for a css or scss file
- Csv - Class for a csv file
- Doc - Class for a doc file, like microsoft word
- Dump - Class for file which contains an exported value (similar to var_export)
- Email - Class for a file which is an email (in json format)
- Error - Class for an error storage file
- Font - Class for a font file (like ttf)
- Html - Class for an html file
- Image - Abstract class for an image file (raster or vector)
- ImageRaster - Class for a pixelated image file
- ImageVector - Class for a vector image file (like svg)
- Js - Class for a js file
- Json - Class for a json file
- Log - Class for a log storage file
- Pdf - Class for pdf file
- Php - Class for a php file
- Queue - Class for a queue storage file
- Serialize - Class for a file with content that should be serialized
- Session - Class for a session storage file, which is serialized
- Text - Abstract class for a text file
- Txt - Class for txt file (like txt)
- Video - Class for a video file (like mp4)
- Xml - Class for an xml file
- Zip - Class for a zip file
- _concatenate - Trait with methods to concatenate files and directories
- _log - Trait that grants methods to allow a file object to do logging
- _storage - Trait that provides methods to link a file object to a specific storage directory
- Files - Class for a collection containing many file objects
- Flash - Class for a collection containing flash-like data (delete on read)
- Importer - Class providing the logic to export data from an objet and importing into another one
- Insensitive - Class for a collection containing an insensitive array
- Insert - Class for a collection containing an insert-only array (cannot update)
- Lang - Class for a collection object containing language texts and translations
- Localization - Class for storing localization data, like latitude and longitude
- Map - Class that provides a set of methods for a collection
- _arr - Trait that provides methods to allow advanced unidimensional array manipulation to a collection
- _arrs - Trait that provides methods to allow advanced multidimensional array manipulation to a collection
- _basic - Trait that provides simple boolean methods to analyze the type of array within the collection
- _classe - Trait that grants methods to work with a collection containing fully qualified class name strings
- _classeObj - Trait that gives methods to work with a collection containing fqcn strings or objects
- _cloner - Trait that provides a method to make sure the collection is cloned on every update
- _count - Trait that provides a method to limit the length of a collection
- _filter - Trait that provides a method to filter a collection by providing a condition or callback
- _flash - Trait that grants methods for the collection to delete an entry once it has been retrieved
- _insensitive - Trait that transforms the collection from case sensitive to insensitive
- _map - Trait that provides a method to recursively change the entries (map) by providing a callback
- _nav - Trait that provides methods to a collection in order to work with pagination
- _obj - Trait that grants methods to work with a collection containing instantiated objects
- _prepend - Trait that replaces methods to make the collection prepend per default (add at the beginning)
- _readOnly - Trait that provides a simple readOnly lock to a collection
- _reference - Trait that permits the collection to work from a reference array source
- _sequential - Trait that makes sure the keys of the collection are always sequential
- _sort - Trait that provides methods to change the order of entries within the collection
- MapObj - Class for a collection containing objects
- Request - Class with methods to manage an HTTP request
- RequestHistory - Class for a collection containing an history of requests
- Res - Class with methods to manage a resource
- Response - Class with methods to manage an HTTP response
- ResponseCurrent - Class for an object that acts as representation of current response
- Role - Class that provides basic logic for a role
- Roles - Class for a collection containing many roles
- Root - Abstract class extended by all others
- Service - Abstract class that provides basic methods to manage a third-party service
- ServiceMailer - Abstract class with basic methods that needs to be extended by a mailing service
- ServiceRequest - Abstract class with basic methods for a service that works with HTTP request
- ServiceVideo - Abstract class with basic methods for a service that provides a video object after an HTTP request
- Services - Class for a collection containing many service objects
- Session - Class that implements the methods necessary for the SessionHandlerInterface interface
- Std - Class for a collection with a complete set of methods
- Timeout - Class for a collection containing timeout data (to deny an action if it already has happened too much)
- Update - Class for a collection containing an update-only array (cannot insert after initialization)
- Video - Class for an object representing a video with some meta-data
- Widget - Abstract class that provides basic methods for a widget
- Xml - Class that provides basic methods to make an XML sitemap
- _arrObj - Trait that provides methods to respect the ArrayAccess, Countable and Iterator native interfaces
- _attr - Trait that grants methods to work with the dynamic property attr
- _attrPermission - Trait that provides methods to work with permissions in attr
- _cache - Trait that provides methods to get or set a cached value from an object
- _email - Trait that provides methods to use the object as an email
- _inst - Trait that provides methods to store an instantiated objet within a static property
- _log - Trait that provides a required method to allow logging with the object
- _overload - Trait that allows a class to retrieve its overloaded version - higher up in the class hierarchy
- _queue - Trait that provides methods required for implementing queuing functionality to an object
- _root - Trait that provides basic object methods and magic methods
- _rootClone - Trait that provides a default __clone magic function
- _serialize - Trait that provides methods for serializing and unserializing object
- _throw - Trait that provides static methods to throw exception from an object
Testing
QuidPHP/Main contains 34 test classes:
- Arrs - Class for testing Quid\Main\Arrs
- Autoload - Class for testing Quid\Main\Autoload
- Calendar - Class for testing Quid\Main\Calendar
- Cart - Class for testing Quid\Main\Cart
- CatchableException - Class for testing Quid\Main\CatchableException
- Com - Class for testing Quid\Main\Com
- Concatenator - Class for testing Quid\Main\Concatenator
- Error - Class for testing Quid\Main\Error
- Exception - Class for testing Quid\Main\Exception
- Extender - Class for testing Quid\Main\Extender
- Extenders - Class for testing Quid\Main\Extenders
- File - Class for testing Quid\Main\File
- Files - Class for testing Quid\Main\Files
- Flash - Class for testing Quid\Main\Flash
- Importer - Class for testing Quid\Main\Importer
- Insensitive - Class for testing Quid\Main\Insensitive
- Insert - Class for testing Quid\Main\Insert
- Lang - Class for testing Quid\Main\Lang
- Localization - Class for testing Quid\Main\Localization
- Map - Class for testing Quid\Main\Map
- MapObj - Class for testing Quid\Main\MapObj
- Request - Class for testing Quid\Main\Request
- RequestHistory - Class for testing Quid\Main\RequestHistory
- Res - Class for testing Quid\Main\Res
- Response - Class for testing Quid\Main\Response
- ResponseCurrent - Class for testing Quid\Main\ResponseCurrent
- Role - Class for testing Quid\Main\Role
- Roles - Class for testing Quid\Main\Roles
- Session - Class for testing Quid\Main\Session
- Std - Class for testing Quid\Main\Std
- Timeout - Class for testing Quid\Main\Timeout
- Update - Class for testing Quid\Main\Update
- Video - Class for testing Quid\Main\Video
- Xml - Class for testing Quid\Main\Xml
QuidPHP/Main testsuite can be run by creating a new QuidPHP/Assert project.
quidphp/main 适用场景与选型建议
quidphp/main 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 246 次下载、GitHub Stars 达 4, 最近一次更新时间为 2019 年 08 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php-framework」 「quid」 「quidphp」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 quidphp/main 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 quidphp/main 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 quidphp/main 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A lightweight, secure-by-default PHP microframework built on Slim – providing Laravel-like features (ORM, authentication, migrations, caching) without the bloat. Perfect for building REST APIs and small-to-medium PHP applications.
A PHP nano framework for REST API's & Micro-Services
The Core Framework for MightyPHP Framework
PHP library that provides database access and a comprehensive ORM
PHP library that provides an extendable platform to create dynamic applications
Oauth 2 client for Ubiquity framework
统计信息
- 总下载量: 246
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 2
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-08-27