Topic: More php 7 fixes

I've done a few more php 7 fixes.

https://github.com/cambell-prince/frontaccounting/commit/65957eac3be2fae85088be43466b89d1025e7c31

Cambell https://github.com/cambell-prince

Re: More php 7 fixes

Hope these constructors do not disrupt existing PHP 5.3 users.

Re: More php 7 fixes

PHP 5.3 went end of life nearly 3 years ago.  The Travis Tests are running on PHP 5.4 and are all passing.

If you all were to integrate the test from this PR then you would be able to continually run the tests on Travis against multiple versions of PHP.

There are also additional changes in a subsequent commit.

Cambell https://github.com/cambell-prince

Re: More php 7 fixes

PHP 5.3 going EOL  does not affect this version of FA and it's large userbase who are still on those versions. The newer versions and forks can cater to the latest versions of PHP. Almost all the users are on some form of private VPNs or on LANs for FA usage or protected by some other means or do not need the benefits of the later versions of PHP.

Re: More php 7 fixes

The changes were made against 2.4, the unstable branch.  So, are you saying there's a large user base of 2.4 users using php 5.3?  If that's the case simply add that to the Travis test set.

Cambell https://github.com/cambell-prince

Re: More php 7 fixes

Yes, many users are on PHP 5.3.

Re: More php 7 fixes

FYI, the old style constructors (same name as class) started to be deprecated in PHP 5.3.3 (in the case that a namespace was used - which is not used in FA).  The new style __construct was introduced in PHP 5.  The old style is deprecated in PHP 7.

See http://php.net/manual/en/language.oop5.decon.php for more info.

Cambell https://github.com/cambell-prince

Re: More php 7 fixes

So guys.. do you have a guess on when FA 2.4 can be used on production ??
where can i download the latest FA 2.4 with your latest fixes ?

Regards.

Re: More php 7 fixes

Actually FA 2.4RC1 is already used in production by quite a few users. You will ofcourse need to be aware that database changes will possibly devolve in time for this branch though upgrade paths will exist for standard installs (but not guaranteed for the extensions).

The latest code for this branch is available here.

Re: More php 7 fixes

apmuthu wrote:

Actually FA 2.4RC1 is already used in production by quite a few users. You will ofcourse need to be aware that database changes will possibly devolve in time for this branch though upgrade paths will exist for standard installs (but not guaranteed for the extensions).

The latest code for this branch is available here.

Thanks mate.

Re: More php 7 fixes

apmuthu wrote: wrote:

You will of course need to be aware that database changes will possibly devolve in time for this branch though upgrade paths will exist for standard installs.

Call me an idiot (and you are probably right) but what does that mean when you say "database changes will possibly devolve." If I use this branch will I still be able to easily upgrade to the final...?

Re: More php 7 fixes

In general, yes. Sometimes there may be glitches in upgradation and user testing reports will help iron out such bugs.

As FA 2.4 is the unstable and development version, when new features are needed or issues addressed, it may require database structure  and/or data changes. Such changes are generally placed in an alter sql/php file in the sql folder that may need to be executed manually (with care as to the db_prefix) or possibly through the web interface - Setup -> Software Upgrade. The best way is to manually execute the changes in a MySQL client, line by line on a backup of the database first and then perform the actions on the live one - YMMV.

13 (edited by Dynamic 05/31/2017 09:37:50 am)

Re: More php 7 fixes

I am having a problem running frontaccounting ever since I changed my CMS to wordpress. It appears wordpress is using PHP 7 and calling it in my .htaccess, but FA will not run correctly. Half the time I am getting white screens and the other times I get these three errors and pages refuse to work.

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; cart has a deprecated constructor in /myaccountsfolder/sales/includes/cart_class.inc on line 24

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; line_details has a deprecated constructor in /myaccountsfolder/sales/includes/cart_class.inc on line 650

session_start(): Cannot send session cache limiter - headers already sent (output started at /myaccountsfolder/sales/includes/cart_class.inc:24) in file: /myaccountsfolder/includes/session.inc at line 29

The workaround is changing this handler in the .htaccess from:

AddHandler application/x-httpd-php70s .php

to

AddHandler application/x-httpd-php56s .php

When I do this both wordpress and FA work fine, but whenever I change a setting in the backend in wordpress, or post anything on the site (basically whenever I use the CMS) the .htaccess is reverted by wordpress back to calling PHP 7.

What do I do? I have tried all the changes listed by cambell but it still does not work (though I do not have this file in my FA directory:

includes/ui/ControlRenderer.inc

I am running FA 2.4 but this issue began before I upgraded and upgrading does nothng to fix it.

Re: More php 7 fixes

Set the immutable bit for the .htaccess file or move it's contents to the webserver config file itself possibly on a per folder tree basis.

Running separate subdomains for each application (wordpress, frontaccounting) with their own PHP version setting may be another option.

Re: More php 7 fixes

@apmuthu your solution for creating a subdomain worked. I created accounts.mydomain.com and pointed it to the FA installation, then added the php5.6 handler to that .htaccess, and it now works independently. Thanks.