- OpenX Community Forums

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Openx / Php 5.3.0 Compatability, Efforts to maintain OpenX compatability with newer PHP 5.3+ builds
pixelchutes
post Jul 29 2009, 06:34 PM
Post #1


Beginner
*

Group: Members
Posts: 4
Joined: 29-July 09
From: USA
Member No.: 29,608



OpenX 2.8.1
PHP 5.3.0
MySQL 5.1.32-log
CentOS 5.2 / Apache/2.2.11 (Unix)
Login type: admin

Dear OpenX Team / Community,

With last month's release of PHP 5.3.0 the PHP team also made available a list of recently deprecated functions: http://php.net/manual/en/migration53.deprecated.php

After some research on my part, it appears OpenX is no longer compatible with PHP 5.3+. What are the current efforts being done to support this new release, if any?

A quick audit of the OpenX files bumped up against the PHP 5.3.0 deprecated functions list better illustrates this point:

dl()
./lib/pear/PEAR.php

ereg()
./lib/pear/DB/ifx.php
./lib/pear/Image/Canvas/PDF.php
./lib/pear/Image/Canvas/GD.php
./lib/pear/Image/Graph/Layout.php
./lib/pear/OS/Guess.php
./lib/pear/PEAR/PackageFile.php
./lib/pear/Date/Calc.php
./lib/pear/Spreadsheet/Excel/Writer/Parser.php
./lib/max/FileScanner.php
./lib/max/Dal/DataObjects/DB_DataObjectCommon.php
./lib/max/Plugin.php
./lib/pclzip/pclzip.lib.php
./lib/OA/Admin/Option.php
./plugins/invocationTags/oxInvocationTags/adlayer.class.php
./www/admin/zone-advanced.php
./www/admin/lib-zones.inc.php
./www/admin/lib-append.inc.php

ereg_replace()
./lib/pear/OS/Guess.php
./lib/pear/Numbers/Words/lang.pt_BR.php
./www/admin/updates-product.php

eregi()
./lib/pear/OS/Guess.php
./lib/pear/PEAR/Registry.php
./lib/pear/PEAR/DependencyDB.php
./lib/pear/XML/Parser.php
./lib/pear/Spreadsheet/Excel/Writer/Parser.php
./lib/pear/Net/IPv4.php
./lib/max/Dal/DataObjects/Images.php
./lib/OX/Extension/authentication/authentication.php
./lib/OA/Dll.php
./www/admin/lib-storage.inc.php

magic_quotes_runtime() or set_magic_quotes_runtime()
./lib/pear/Cache/Lite.php
./lib/pear/PEAR/Config.php
./lib/pear/PEAR/Registry.php
./lib/pear/PEAR/DependencyDB.php
./lib/max/Dal/DataObjects/Channel.php
./lib/max/Delivery/limitations.delivery.php
./lib/max/other/lib-acl.inc.php
./lib/pclzip/pclzip.lib.php
./lib/OA/Upgrade/EnvironmentManager.php

split()
./lib/pear/DB/QueryTool/Query.php
./lib/pear/DB/common.php
./lib/pear/DB/ibase.php
./lib/pear/DB/oci8.php
./lib/pear/Image/Graph/Layout/Horizontal.php
./lib/pear/Image/Graph/Layout/Vertical.php
./lib/pear/OS/Guess.php
./lib/pear/System.php
./lib/pear/Config/Container/IniFile.php
./lib/pear/PEAR/RunTest.php
./lib/pear/PEAR/Frontend/CLI.php
./lib/pear/Date/Span.php
./lib/pear/HTML/Template/Flexy/Compiler/SmartyConvertor.php
./lib/pear/HTML/QuickForm.php
./lib/pear/HTML/QuickForm/select.php
./lib/pear/XML/RPC.php
./lib/pear/Spreadsheet/Excel/Writer/Worksheet.php
./lib/pear/Spreadsheet/Excel/Writer/Parser.php
./lib/pear/Net/URL.php
./lib/max/ErrorHandler.php
./lib/minify/HTTP/ConditionalGet.php
./lib/smarty/Smarty_Compiler.class.php
./lib/smarty/plugins/modifier.count_words.php
./lib/smarty/plugins/modifier.count_paragraphs.php
./lib/smarty/plugins/block.textformat.php
./lib/smarty/plugins/modifier.spacify.php
./lib/smarty/plugins/function.fetch.php
./lib/smarty/internals/core.write_cache_file.php
./lib/smarty/internals/core.create_dir_structure.php
./lib/smarty/internals/core.assign_smarty_interface.php
./lib/Zend/Locale.php
./lib/Zend/Locale/Format.php
./lib/Zend/Http/Response.php
./lib/OA/Admin/Statistics/Delivery/Common.php
./lib/OA/Admin/Option.php
./lib/OA/Admin/Settings.php
./lib/OA/Sync.php
./lib/OA/Dal/PasswordRecovery.php
./plugins/etc/oxMarket/etc/DataObjects/Ext_market_web_stats.php
./var/plugins/DataObjects/Ext_market_web_stats.php
./var/templates_compiled/%%11^112^112788A9%%zone-edit.html.php
./www/admin/assets/js/numberFormat.php
./www/admin/numberFormat.js.php
./www/admin/stats-conversions.php
./www/admin/plugins/oxMarket/oxMarket.class.php
./www/admin/banner-zone.php
./www/admin/lib-swf.inc.php
./www/admin/banner-edit.php

mysql_escape_string()
./lib/pear/DB/mysql.php
./lib/wact/db/drivers/mysql.inc.php


Kind Regards,

Mike

NOTE:
This audit was done on an already installed system. I have not confirmed whether any deprecated references exist in any of the install/setup files.
Go to the top of the page
 
+Quote Post
Mentor
post Jul 31 2009, 02:16 PM
Post #2


Mentor
********

Group: Members
Posts: 7,442
Joined: 17-June 08
From: Poland
Member No.: 21,806



Hi pixelchutes,

Welcome to the OpenX community forums!

Thank you for the information. I will provide you with a feedback once I get some information from our developers regarding the issue.
Go to the top of the page
 
+Quote Post
pixelchutes
post Jul 31 2009, 02:19 PM
Post #3


Beginner
*

Group: Members
Posts: 4
Joined: 29-July 09
From: USA
Member No.: 29,608



Thank you, Michael. I look forward to hearing from you and am happy to help in anyway that I can. Best of luck to the devs! wink.gif
Go to the top of the page
 
+Quote Post
Mentor
post Jul 31 2009, 03:06 PM
Post #4


Mentor
********

Group: Members
Posts: 7,442
Joined: 17-June 08
From: Poland
Member No.: 21,806



Hi,

All the compatibility issues are going to be fixed in the next OpenX 2.8.2 release.
Go to the top of the page
 
+Quote Post
Spritz
post Aug 4 2009, 12:20 PM
Post #5


Administrator
********

Group: OpenX Consultants
Posts: 1,606
Joined: 8-May 01
From: Ferrara, Italy
Member No.: 1



I think I didn't understand what this was about and misled Michal: apologies for that.

The functions you listed are deprecated in PHP 5.3 for future removal: they're perfectly legal and working in 5.3 even though they won't liekly be in PHP 5.4 and/or PHP 6.

What does that mean for OpenX?

That 2.8.1 is fully compatible with the latest and greter stable PHP version currently available, but potentially won't run on the next major PHP version. However, by the time 5.4 is ready, I'm pretty sure OpenX won't be using those functions anymore.
Go to the top of the page
 
+Quote Post
pixelchutes
post Aug 4 2009, 02:12 PM
Post #6


Beginner
*

Group: Members
Posts: 4
Joined: 29-July 09
From: USA
Member No.: 29,608



QUOTE (Spritz @ Aug 4 2009, 12:20 PM) *
I think I didn't understand what this was about and misled Michal: apologies for that.

The functions you listed are deprecated in PHP 5.3 for future removal: they're perfectly legal and working in 5.3 even though they won't liekly be in PHP 5.4 and/or PHP 6.

What does that mean for OpenX?

That 2.8.1 is fully compatible with the latest and greter stable PHP version currently available, but potentially won't run on the next major PHP version. However, by the time 5.4 is ready, I'm pretty sure OpenX won't be using those functions anymore.


@Matteo,

Thank you for this clarification! I am sorry to have mislead anyone. So, the functions themselves still exist (for now) and it would only be an issue if the new E_DEPRECATED error level was being used in error_reporting(), is that correct? (We have been using this new error mode in some of our other PHP code and therefore have been seeing errors related to these soon to be obsolete functions.)

I am glad to find out that these functions are still valid for PHP 5.3, I apologize for my misunderstanding.

As for OpenX 2.8.1, have you successfully tested on an instance of PHP 5.3.0?
Go to the top of the page
 
+Quote Post
Spritz
post Aug 4 2009, 02:56 PM
Post #7


Administrator
********

Group: OpenX Consultants
Posts: 1,606
Joined: 8-May 01
From: Ferrara, Italy
Member No.: 1



QUOTE (pixelchutes @ Aug 4 2009, 04:12 PM) *
Thank you for this clarification! I am sorry to have mislead anyone. So, the functions themselves still exist (for now) and it would only be an issue if the new E_DEPRECATED error level was being used in error_reporting(), is that correct? (We have been using this new error mode in some of our other PHP code and therefore have been seeing errors related to these soon to be obsolete functions.)

I am glad to find out that these functions are still valid for PHP 5.3, I apologize for my misunderstanding.

As for OpenX 2.8.1, have you successfully tested on an instance of PHP 5.3.0?


The deprecated functions exist in PHP 5.3.x. The E_DEPRECATED messages are just a warning to PHP developers to make them aware that they are using something that will cease to exist in future versions of PHP. OpenX 2.8.1+ is masking E_DEPRECATED warnings and not showing them, plus has a number of other fixes that allow it to smoothly work with PHP 5.3 (e.g. a getHostName function used in previous versions was renamed to avoid clashing with the newly added core PHP function).

PHP 5.3 is also used (along with older versions) in our continuous integration setup.
Go to the top of the page
 
+Quote Post
jmut
post May 31 2010, 08:10 AM
Post #8


Beginner
*

Group: Members
Posts: 6
Joined: 25-March 08
Member No.: 20,742



Original poster kinda asked the wrong questions.

functions of interest are those:
get_class
clearstatcache
call_user_func
usort
natsort
uasort
uksort
array_flip
array_unique


As mentioned in "Backward Incompatible Changes" http://www.php.net/manual/en/migration53.incompatible.php

Also not very clear which version of 3rd party libs are used. ZF , PEAR etc.

The very least I see some calls to clearstatcache in PEAR lib(unsure if at all in use of course in openx) that might lead to trouble.
So question is again is openx officially working on php5.3 or this is some ad hoc tesing by couple of devs or something?

Cheers
Go to the top of the page
 
+Quote Post
Frantique
post Jun 7 2010, 02:48 PM
Post #9


Beginner
*

Group: Members
Posts: 4
Joined: 7-June 10
Member No.: 122,091



System config:
OpenX v2.8.5: Apache 2.2.15, PHP 5.3.2 , MySQL 5.1.46-log

Alot of problems, campagins-*.php, etc. files are delivered for download, for the moment I see nothing in the logs, now I've started a line by line debugging... It seems to be some incompatibility with PEAR(?)...

Go to the top of the page
 
+Quote Post
jmut
post Jun 7 2010, 03:07 PM
Post #10


Beginner
*

Group: Members
Posts: 6
Joined: 25-March 08
Member No.: 20,742



QUOTE (Frantique @ Jun 7 2010, 02:48 PM) *
System config:
OpenX v2.8.5: Apache 2.2.15, PHP 5.3.2 , MySQL 5.1.46-log

Alot of problems, campagins-*.php, etc. files are delivered for download, for the moment I see nothing in the logs, now I've started a line by line debugging... It seems to be some incompatibility with PEAR(?)...


More like misconfigured apache on your side..this can hardly be due to PHP 5.3
Go to the top of the page
 
+Quote Post
Frantique
post Jun 8 2010, 07:51 AM
Post #11


Beginner
*

Group: Members
Posts: 4
Joined: 7-June 10
Member No.: 122,091



No, the server is running 60+ hosts, none of them has this problem. Anyway, it looks that for some reason it dies when trying to add elements to array. For example in campaign-banners.php:

QUOTE
// Display navigation
$aOtherAdvertisers = Admin_DA::getAdvertisers(array('agency_id' => $agencyId));
$aOtherCampaigns = Admin_DA::getPlacements(array('advertiser_id' => $clientid));

$oHeaderModel = buildHeaderModel($aEntities);

phpAds_PageHeader(null, $oHeaderModel);

....

//TODO do we need to filter out system entities here, or will the DAO do that?
$aAdvertiserMap = array();
foreach ($aAdvertisers as $clientid => $aClient) {
$aAdvertiserMap[$clientid] = array('name' => $aClient['clientname'],
'url' => "advertiser-campaigns.php?clientid=".$clientid);

}


The problematic parts in bold.


Go to the top of the page
 
+Quote Post
jmut
post Jun 8 2010, 10:09 AM
Post #12


Beginner
*

Group: Members
Posts: 6
Joined: 25-March 08
Member No.: 20,742



can you paste some url from openx system that leads to this. I don't experience any such behavior yet.
Also paste the vhost used for openx. I also assume you're using 2.8.5 version currently
Cheers
Go to the top of the page
 
+Quote Post
Frantique
post Jun 8 2010, 10:12 AM
Post #13


Beginner
*

Group: Members
Posts: 4
Joined: 7-June 10
Member No.: 122,091



Server access in PM.
Go to the top of the page
 
+Quote Post
Frantique
post Jun 8 2010, 01:09 PM
Post #14


Beginner
*

Group: Members
Posts: 4
Joined: 7-June 10
Member No.: 122,091



I FOUND THE BUG!!!!

In /lib/max/SqlBuilder.php

Line: 904


That break; should not be there:

Instead of:

default:
$aLimitations[] = "$columnName = $value";
break;
}


Should be:

default:
$aLimitations[] = "$columnName = $value";
}


(UPDATE: Eventually it sould be semicolon as well, like this:

default;
$aLimitations[] = "$columnName = $value";
break;
}

)
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

 

Locations of visitors to this page