Page 1 of 1

ManiaLib 3.0 compatibility with PHP 5.5.1

Posted: 23 Oct 2013, 15:19
by Chris92
Hello, I wanted to use ManiaLib 3.0 to build a Manialink on my Windows machine where I use XAMPP.
It comes with PHP 5.5.1.
I downloaded ManiaLib 3.0, fresh install and I get this PHP error when I try to open the /manialib/index.php in my browser.

Code: Select all

Fatal error: Class 'ManiaLib\Gui\Elements\Quad' not found in D:\XAMPP\htdocs\manialib\libraries\ManiaLib\Gui\Cards\Panel.php on line 21
There are probably several files that won't work but I only get this error since I have no idea how to fix it.

EDIT: Seems like only the public 3.0 release is affected. Did a "svn checkout" on the manialib sourcecode and r807 seems to work just fine.

Re: ManiaLib 3.0 does not work with PHP 5.5.1

Posted: 23 Oct 2013, 15:51
by magnetik
Indeed the release is quite old, I've added to our todo list to make an updated version.

We are almost always using the SVN version internally so it should be quite stable.

If you spot any error related to your PHP version we will correct them as fast as possible.

Re: ManiaLib 3.0 does not work with PHP 5.5.1

Posted: 23 Oct 2013, 15:59
by Chris92
I've seen several revisions in the "Changes" tab marked as Version 3.1, 3.1.1 but those got never released officially ;)

Re: ManiaLib 3.0 does not work with PHP 5.5.1

Posted: 23 Oct 2013, 16:17
by magnetik
To avoid all errors if you use the mysql connector bundled with ManiaLive, you should change the file manialib/libraries/ManiaLib/Application/Bootstrapper.php

change

Code: Select all

static $errorReporting = E_ALL;
in

Code: Select all

static $errorReporting = E_ALL ^ E_DEPRECATED;

Re: ManiaLib 3.0 does not work with PHP 5.5.1

Posted: 23 Oct 2013, 16:43
by Chris92
Okay thanks, had to change it to this or it wouldn't work (note the apostrophes)

Code: Select all

static $errorReporting = 'E_ALL ^ E_DEPRECATED';

Now to another question I have.
In ManiaLib 2.0 I used to be able to do this to add a menu header to a navigation.

Code: Select all

$menu = \ManiaLib\Gui\Cards\Navigation\Config::getInstance();
$menu->titleBgURL = 'http://example.com/manialib/media/images/MenuHeaderTM.dds';
This seems to have changed. Can you tell me what method I have to use now?

Re: ManiaLib 3.0 does not work with PHP 5.5.1

Posted: 23 Oct 2013, 17:11
by The_Big_Boo
Chris92 wrote:Okay thanks, had to change it to this or it wouldn't work (note the apostrophes)

Code: Select all

static $errorReporting = 'E_ALL ^ E_DEPRECATED';
This won't work as you're expecting.

For a temporary fix, change back that line to just E_ALL (without single quotes) and change line 25 to:

Code: Select all

error_reporting(static::$errorReporting ^ E_DEPRECATED);

Re: ManiaLib 3.0 does not work with PHP 5.5.1

Posted: 23 Oct 2013, 18:41
by Chris92
The_Big_Boo wrote:
Chris92 wrote:Okay thanks, had to change it to this or it wouldn't work (note the apostrophes)

Code: Select all

static $errorReporting = 'E_ALL ^ E_DEPRECATED';
This won't work as you're expecting.

For a temporary fix, change back that line to just E_ALL (without single quotes) and change line 25 to:

Code: Select all

error_reporting(static::$errorReporting ^ E_DEPRECATED);
Thanks =)