Archive for February, 2008

P4A new licensing model »

Now P4A 2 is released under GPL 2, why? Because we think that when you use free software you have to give back something. GPL 2 was actually chosen because the developer using P4A would not have to publish the source code to the public audience, but only give the full source to his customer (and release it under GPL 2 too).

We all know that GPL 2 is not the right license for network based software, because it only talks about software distribution, something like “when you give the software to your customer, you’ve to give the source code too”. Here comes the problem, developers never give their software to the customer, but install it on a server, thus they actually don’t have to give the source code to the customer because they didn’t give him the binary code… This is a way to bypass the GPL license and do closed source software.

That’s why we need a new license, everyone should respect the same rules and the same ideals.

P4A 3 will be released under the AFFERO GPL 3

Why AFFERO GPL 3?

  • Free Software Foundation says this is the right license for network based applications
  • It’s a GPL 3 plus a note that gives every user of the application the right to download the full source code

What about commercial software?
We know someone may not want to release his source code thus we’re thinking about releasing P4A 3 also under a commercial license. The commercial release would be sold for a small fee (see “pricing ideas”) that will be used to continue and improve the development of P4A itself.

Will the commercial release be different/better than the open source one?
Absolutely not! Both version will always be identical!

What would you buy?

  • the right to release your software under a license you choose (open source or proprietary)
  • the right to remove P4A credits from your applications
  • the right to have free P4A updates for 1 year
  • the right to create unlimited applications, used by unlimited users and published on unlimited websites and unlimited servers

Pricing idea:
100 Eur + VAT for every developer involved in the process of creating a commercial software based on P4A.
Example: if 2 analysts and 3 developers work together on a commercial software based on P4A, than you should buy 3 licenses.

Commercial license limitations

  • you won’t have the right to transfer the license to anyone (neither who will buy your software)
  • the license you’ll chose for your software won’t be transferred to P4A itself, which will act as a library in that case
  • you won’t have the right to release P4A itself under a different license
  • you won’t have the right to fork P4A itself

Note that this is not the real license, it’s just a draft idea, please let me have your feedback about that!

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_DEFAULT_ERROR_REPORTING, P4A_EXTENDED_ERROR_REPORTING, P4A_MINIMAL_ERROR_REPORTING constants were added
- 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