CWX Project uses closures (annonymous functions), supported by PHP 5.3 and higher.
I will try to fix this and to support very old PHP 5.2.x
That would be great! I’m still using PHP 5.2 too, already changed the functions in the cwx-project.php …
// PHP Date conversion
$callback_dc = create_function('$matches', '
switch($matches[0]){
case \'dd\': return \'d\';
case \'d\': return \'j\';
case \'mm\': return \'m\';
case \'m\': return \'n\';
case \'yy\': return \'y\';
case \'yyyy\': return \'Y\';
}
return \'\';
');
self::$dateFormatOut = self::$dateFormatIn = preg_replace_callback($search, $callback_dc, self::$dateFormat);
// Date format for jQ UI Datepicker
$callback_df = create_function('$matches', '
switch($matches[0]){
case \'d\': return \'dd\';
case \'m\': return \'mm\';
case \'m\': return \'n\';
case \'yyyy\': return \'yy\';
case \'yyyy\': return \'Y\';
}
return $matches[0];
');
self::$dateFormatJSOut = preg_replace_callback($search, $callback_df, self::$dateFormat);
So the plugin gets installed, but when I hit the “Create Project” button, my server crashes. There must be another part thats not compatible with the old PHP version.
@cwmedia
your solution looks really elegant. I will use it, if you don’t mind, and put credits with your name where appropriate 🙂
thank you!
I will also look into the crash thing you reported.
All code that prevented CWX Project from running on PHP 5.2 should be fixed.
This took a while because it wasn’t easy to find and set up an OS that comes with PHP 5.2.4
Thank you guys, this was really important, I guess 🙂
Have fun with version 1.0.2!