P4A 3 commit digest (4th feb 2008): the big one

This is one on the biggest commit ever done in the world :-) There are a lot of changes “under the hood”, please read the changelog because it’s really important for you to know what is changed.

I’m really in hurry thus this digest is not as beautiful as I would but…

One of the most important thing is the new field validation infrastructure, you can simply do a $field->addValidator(new P4A_Validate_GreaterThan(5)) and you’ll know that your field won’t be valid until its value won’t be greater than 5. We’ve a lot of validators ’cause we subclass every Zend_Validate class (we need to subclass because Zend_Validate doesn’t support translatable error messages). P4A_Mask::saveRow() now automatically validates every field highlights the errors on the mask.

Another important point is that I rewrote the popup management, now we don’t have 2 masks opened at the same time (this has a few engineering problems) and opening a popup will cause a complete redesign of the mask (solving some other jquery related bugs we had). Wait, popup management is not complete, we already have new ideas to bring the ajax experience to a new level but I need time to write code…

oh how I would need time…

Here’s the changelog:

– PEAR::Net_Useragent_Detect was updated to 2.4.0
– P4A_Object, P4A_Widget and P4A_Data_Source are now declared as abstract
– the “eval” call within P4A_Object::actionHandler() method was changed to a call_user_func_array which seems to be faster
– all “function &function_name” declarations were changed to “function function_name”, removing the & symbol
– many ‘&’ symbols were removed cause of the new PHP5 reference management
– P4A_Table and P4A_DB_Navigator were php5ized
– P4A_Table_Col::setFormatted() and unsetFormatted() methods were removed, use isFormatted(null/true/false) instead
– P4A_Table_Col::setFormat() and unsetFormat() methods were removed
P4A_Table_Col now has the “onformat” event that can be triggered to do custom format operations (same as P4A_Field)
– P4A_DB_Source::getFieldName() method was removed
– P4A_Data_Field::getSchemaTableField() method was added, it will return “schema.table.field”
– P4A_Data_Field::setReadOnly() method was removed, use isReadOnly(null/true/false)
P4A_Quote_SQL_Value() global function was added
– a bug with P4A_DB was fixed to allow sqlite to work the right way with sequences
PEAR repository was removed
– PEAR::validate module was renamed to pear_validate.php and moved to p4a/libraries/ directory
– PEAR::Net_Useragent_Detect module was renamed to pear_net_useragent_detect.php and moved to p4a/libraries/ directory
P4A_Mkdir_Recursive() global function was added to P4A standard library
– All System::mkdir calls were changed to use the new P4A_Mkdir_Recursive() function
– a bunch of unuseful referenced were removed from core helpers
GetId3 library was updated to 2.0.0b4 (which is php5 only), helper apps for windows servers were removed, they’ve to be installed in the system path thus we cannot ship them with p4a package ’cause they would be unuseful
P4A_Field::setType(‘image’) now causes a fatal error, image is not a recognized type anymore, always use file, it will render images/video/audio preview if it’s possible
– P4A now sets error_reporting to P4A_MINIMAL_ERROR_REPORTING before using getid3() and then restore the error_reporting to the previous value
– P4A_Validate and PEAR::Validate classes were removed
P4A_Field::addValidator() method was added, you can pass it Zend_Validate_* obejects
P4A_Field::isValid() method was added to check if the validators chain is respected or not
– P4A_Base_Mask::setRequiredField() method now relies on Zend_Validator_NotEmpty
– P4A_Base_Mask::checkRequiredFields() method was renamed to validateFields() and now checks all validators chains for all fields and not only required fields
– all javascripts were refactored
javascript/css popup management was reworked
– P4A_Base_Mask::setRequiredField(), validateFields(), warning(), error() and info() methods were moved to P4A_Mask
– P4A_Validate_Alnum, P4A_Validate_Alpha, P4A_Validate_Between, P4A_Validate_Ccnum, P4A_Validate_Date, P4A_Validate_Digits, P4A_Validate_EmailAddress, P4A_Validate_Float, P4A_Validate_GreaterThan, P4A_Validate_Hex,
P4A_Validate_Hostname, P4A_Validate_InArray, P4A_Validate_Int, P4A_Validate_Ip, P4A_Validate_LessThan, P4A_Validate_NotEmpty, P4A_Validate_Regex and P4A_Validate_StringLength classes were added.
These classes rely on Zend_Validate_* classes but we need them to allow translation of error messages
– P4A::isPopupOpened() and getFocusedObjectId() methods are now marked as deprecated
– popup system was completely rewritten
when generating image thumbnails now we pass by the application’s index file instead of directly linking phpthumb
– phpThumb was updated to 1.7.8
– jQuery::form was updated to 2.0.3
ajax upload was enabled again
– a bug with getID3 was solved, now we catch the exception triggered when file is not recognized and simply go on
YAHOO YUI CSS reset was added
P4A_Mask::validateFields() method is now automatically called by P4A_Mask::saveRow()
P4A_Table::setTitle() and getTitle() methods were removed, use setLabel() and getLabel() instead

Leave a Reply

Your email address will not be published. Required fields are marked *