Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Go PHP 5
PHP 4 has served the web developer community for seven years now, and served it well. However, it also shows its age. Most of PHP 4's shortcomings have been addressed by PHP 5, released three years ago, but the transition from PHP 4 to PHP 5 has been slow for a number of reasons.
PHP developers cannot leverage PHP 5's full potential without dropping support for PHP 4, but PHP 4 is still installed on a majority of shared web hosts and users would then be forced to switch to a different application. Web hosts cannot upgrade their servers to PHP 5 without making it impossible for their users to run PHP 4-targeted web apps, and have no incentive to go to the effort of testing and deploying PHP 5 while most web apps are still compatible with PHP 4 and the PHP development team still provides maintenance support for PHP 4. The PHP development team, of course, can't drop maintenance support for PHP 4 while most web hosts still run PHP 4.
It is a dangerous cycle, and one that needs to be broken. The PHP developer community has decided that it is indeed now time to move forward, together. Therefore, the listed software projects have all agreed that effective February 5th, 2008, any new feature releases will have a minimum version requirement of at least PHP 5.2.0. Furthermore, the listed web hosts have agreed that effective February 5th, 2008, they will include PHP 5.2 (or a more recent version) in their service offer.
It is our belief that this will provide web hosts reason to upgrade and the PHP development team the ability to retire PHP 4 and focus efforts on PHP 5 and the forthcoming PHP 6, all without penalizing any existing project for being "first out of the gate".
List projects already committed to the switch, including big names like Phpmyadmin, Pear, Gallery, Typo3 and Drupal.
http://gophp5.org/projects
Should vanilla join this campaign
PHP developers cannot leverage PHP 5's full potential without dropping support for PHP 4, but PHP 4 is still installed on a majority of shared web hosts and users would then be forced to switch to a different application. Web hosts cannot upgrade their servers to PHP 5 without making it impossible for their users to run PHP 4-targeted web apps, and have no incentive to go to the effort of testing and deploying PHP 5 while most web apps are still compatible with PHP 4 and the PHP development team still provides maintenance support for PHP 4. The PHP development team, of course, can't drop maintenance support for PHP 4 while most web hosts still run PHP 4.
It is a dangerous cycle, and one that needs to be broken. The PHP developer community has decided that it is indeed now time to move forward, together. Therefore, the listed software projects have all agreed that effective February 5th, 2008, any new feature releases will have a minimum version requirement of at least PHP 5.2.0. Furthermore, the listed web hosts have agreed that effective February 5th, 2008, they will include PHP 5.2 (or a more recent version) in their service offer.
It is our belief that this will provide web hosts reason to upgrade and the PHP development team the ability to retire PHP 4 and focus efforts on PHP 5 and the forthcoming PHP 6, all without penalizing any existing project for being "first out of the gate".
List projects already committed to the switch, including big names like Phpmyadmin, Pear, Gallery, Typo3 and Drupal.
http://gophp5.org/projects
Should vanilla join this campaign
0
This discussion has been closed.
Comments
The advantage of dropping php4 support for the core would be mainly a cleaner api (object passed by reference, magic methods...).
The better support for xml and other php5 feature would be great for extensions; but not so much necessary for the core.
The disadvantage of dropping php4 support is that Vanilla 2 wouldn't be compatible on some host and that some user would have to change of host.
Since Vanilla users are for most them, I believe, developer, we should switch to php5 only support.
Sounds like PHP5 is better pretty much all round, and dropping PHP4 support would help keep things minimal and clean — the core of what Vanilla is surely?
class Delegation { private static $DelegateCollection = array(); public $Name; public $DelegationParameters = array(); static function AddDelegate($ClassName, $DelegateName, $DelegateFnc) { if (!array_key_exists($ClassName, self::$DelegateCollection)) { self::$DelegateCollection[$ClassName] = array(); } if (!array_key_exists($DelegateName, self::$DelegateCollection[$ClassName])) { self::$DelegateCollection[$ClassName][$DelegateName] = array(); } self::$DelegateCollection[$ClassName][$DelegateName][] = $DelegateFnc; } static function CallDelegate($Instance, $DelegateName) { if ($Instance->Name && !empty($Instance->Name) ){ $ClassName = $Instance->Name; } else { $ClassName = get_class($Instance); } if (array_key_exists($ClassName, self::$DelegateCollection) && array_key_exists($DelegateName, self::$DelegateCollection[$ClassName]) ){ foreach (self::$DelegateCollection[$ClassName][$DelegateName] as $DelegateFnc) { if (function_exists($DelegateFnc)) { $DelegateFnc($Instance); } } } } protected function _CallDelegate($DelegateName) { self::CallDelegate($this, $DelegateName); } }
It is easier to use since you don't have to feed your classes with the Context object:
class Example extends Delegation { function __construct() { $this->Name = 'Example'; } function test() { $this->_CallDelegate('test'); } } function ExampleDelegation($Example) { echo "Example object is calling ExampleDelegation<br/>"; } Delegation::AddDelegate('Example', 'test', 'ExampleDelegation'); $Example = new Example(); $Example->test(); // output "Example object is calling ExampleDelegation<br/>" class OtherExample { function test() { Delegation::CallDelegate($this, 'test'); } } function OtherExampleDelegation() { echo "OtherExample object is calling OtherExampleDelegation<br/>";; } Delegation::AddDelegate('OtherExample', 'test', 'OtherExampleDelegation'); $OtherExample = new OtherExample(); $OtherExample->test(); // output "OtherExample object is calling OtherExampleDelegation<br/>"
I understand it depends on the complexity of current scripts being used, but would current (simple) PHP 4 scripts be reasonably expected to continue working under PHP 5?
Not all php4 functions are supported in PHP5, or behave the same in php 5, So minor adjustments will be required to your php 4 code. You won't need a major overhaul of your code. although that would be a good for the future if you atleast rewrite your code to be strict php5 compliant and leverage its unique capabilities. After all PHP 6 is just around the corner.
From PHP website
With media temple you can set per domain (from the control panel) or per directory (you have to set it manually with .htaccess) which version of php to use.
For Plesk version 8.21, you can set the version per domain. And since Centos 4.4, you can install php 5.1.6; I guess that should be the version for Plesk.
I don't know for cPanel, but they should have this option.
So provider can easily migrate to php5 without their users noticing it. Current user can get php4 enable by default and the option to enable php5. New user would have the opposite: php5 by default with the option to enable php4.
"PHP 5.2.4 has been installed the server where your account is located. It will be in use by default, given that none of the .htaccess files on your account reference a CGI version of PHP."
So all of my scripts appear to work with PHP 5!
Actually now that I think about it, one of my scripts that used globals stopped working a few months back, I had to add this to fix it...
foreach($_POST AS $key => $value) { ${$key} = $value; } foreach($_GET AS $key => $value) { ${$key} = $value; }
Maybe this was when they switched to PHP5?
Posted: Saturday, 20 October 2007 at 8:09AM
I did a search for the error I was getting and added the above snippet as suggested, it worked, job done!
Posted: Tuesday, 23 October 2007 at 5:37AM