AboutThis library started in the Summer of 2008 and is still in an early stage.
This library has two aims. Firstly, it bundles small and simple re-usable functions that I use regularly, such as functions to work on 2-dimensional arrays. Secondly, it features new solutions to more complex but common problems, that other libraries or frameworks did not solve in a way I was looking for.
Part of this library may depend on the Zend Framework.
This library uses simpletest for unit testing.
ComponentsOpen for trialThe following components are open for trial.
CV_OutputFilter (beta)forces the developer to escape output data, effectively preventing Cross Site Scripting caused by laziness. For more info read the examples, the unit tests and the Google Groups Thread
CV_Collection (alpha)A powerful collection class, based on SPL::ArrayObject. It is superior from simply using arrays for managing collections. Among other features, CV_Collection offers methods for sorting and filtering, similar to PHPLinq.
CV_Collection has a few significant advantages over PHPLinq.
A shorter, more readable interface. Names easier to learn for PHP developers. While PHPLinq reminds of SQL, CV_Collection widely re-uses the familar names of the standard php Array-functions. Security assistance. Both CV_Collection and PHPLinq use expressions provided as strings, for queries. This opens the serious danger of code injection. To assist in avoiding security vulnerabilities, CV_Collection provides support for binding variables, similar to what PDO allows for SQL-Queries. This way embedding potentially dangerous strings directly into the expression string can be avoided. CV_Collection can be used for collections of any kind of data. It however offers special convenience functions for collections of objects and database records. These include extracting a "column" from a database result set and using the database IDs as array keys.
CV_Collection offers a fluent interface aka. support for method chaining.
CV_Filter_Input (stable)extends Zend_Filter_Input to allow proper handling of arrays, also submitted as a patch http://framework.zend.com/issues/browse/ZF-4354
IncompleteThe following components exist in a very incomplete state in the code base.
CV_ORM (pre-alpha)an Object-relational mapping approach, that aims to solve some problems all competitors share. The recognized competitors are ezpdo, ezComponents, doctrine, propel, PEAR DB_DataObject. Some goals of this implementation:
easy out-of-the box functionality: include and run, no configuration needed (except for database login). Have ORM in place within 10 seconds. (Especially no huge XML configuration as in Propel) completely customizable model implementations (using code generation based on replaceable code templates), in order to allow conformity to any existing architecture be adaptable to the developers taste of style and architecture for models, in other words: use getters or public attributes or ArrayAccess or get set or whatever you like. It's up to you, you can adapt the implementation completely to what you like in a simple way. use your own custom class extension strategy, no forced base class as in doctrine and propel, no proxing object as in ezpdo direct access to objects related over several hops, not just one (one-to-many) or two (many-to-many) but through arbitrary relationship paths maximum re-use of data already in the database schema: your change your schema -> your models change right away. retrieval and merging of the schemas from several sources: database, an array configuration format, your custom schema source. This allows to transparently add data not available in one source. Your database does not provide foreign key information? Or you want to change the name of the class member retrieving related objects? Just complement the missing data by additional configuration. This also allows to tolerate database changes, no migration problems as in the other ORM frameworks DataMapper, not ActiveRecord, in other words separation of model and database logic
CV_Form (pre-alpha)aims to implement form handling in a way that is php-developer-friendly as well as web-designer-friendly.
PlannedPrototypes for the following components exist, but are not yet in shape to be put into the code base.
CV_ErrorHandler (planned)An error handling class that works with set_error_handler and set_exception_handler . It will offer the following features:
allows to specify include/exclude rules based on path and error code respects the @ operator to oppress error messages creates a snapshot of the variable state, when the error occurred for later analysis send E-Mails to a specified address accumulates several errors into 2 emails (2 not 1 for technical reasons) waits for a given time until it sends the next mail provides a GUI to analyze the variable state snapshops for a specific error
CV_Controller (planned)A very light-weight controller class as in Model-View-Controller.
CV_View (planned)A very light-weight view class as in Model-View-Controller. The class makes use of CV_OutputFilter to provide convenient and secure views.
CV_TranslatorA class that assists in very easy to implement and yet very flexible localization. It provides support to be integrated into CV_View.
CV_Singleton / CV_Multiton (planned)Abstract classes to rapidly implement the Singleton or Multiton design patterns for new classes.
Copyright © 2013 Black Duck Software, Inc. and its contributors, Some Rights Reserved. Unless otherwise marked, this work is licensed under a Creative Commons Attribution 3.0 Unported License . Ohloh ® and the Ohloh logo are trademarks of Black Duck Software, Inc. in the United States and/or other jurisdictions. All other trademarks are the property of their respective holders.