ManiaLib 3.0 compatibility with PHP 5.5.1

Open source, lightweight PHP framework for Manialink and Web development.

Moderator: NADEO

Post Reply
User avatar
Chris92
Translator
Translator
Posts: 951
Joined: 15 Jun 2010, 13:22
Location: Vilshofen, Germany
Contact:

ManiaLib 3.0 compatibility with PHP 5.5.1

Post by Chris92 » 23 Oct 2013, 15:19

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.
Check out my Personal Twitter account!

User avatar
magnetik
Nadeo
Nadeo
Posts: 1677
Joined: 01 Feb 2012, 19:13
Location: Bordeaux
Contact:

Re: ManiaLib 3.0 does not work with PHP 5.5.1

Post by magnetik » 23 Oct 2013, 15:51

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.
ManiaPlanet technical documentation portal (Dedicated, ManiaLink, ManiaScript, Titles...) -- contribute!

User avatar
Chris92
Translator
Translator
Posts: 951
Joined: 15 Jun 2010, 13:22
Location: Vilshofen, Germany
Contact:

Re: ManiaLib 3.0 does not work with PHP 5.5.1

Post by Chris92 » 23 Oct 2013, 15:59

I've seen several revisions in the "Changes" tab marked as Version 3.1, 3.1.1 but those got never released officially ;)
Check out my Personal Twitter account!

User avatar
magnetik
Nadeo
Nadeo
Posts: 1677
Joined: 01 Feb 2012, 19:13
Location: Bordeaux
Contact:

Re: ManiaLib 3.0 does not work with PHP 5.5.1

Post by magnetik » 23 Oct 2013, 16:17

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;
ManiaPlanet technical documentation portal (Dedicated, ManiaLink, ManiaScript, Titles...) -- contribute!

User avatar
Chris92
Translator
Translator
Posts: 951
Joined: 15 Jun 2010, 13:22
Location: Vilshofen, Germany
Contact:

Re: ManiaLib 3.0 does not work with PHP 5.5.1

Post by Chris92 » 23 Oct 2013, 16:43

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?
Check out my Personal Twitter account!

The_Big_Boo
Posts: 1041
Joined: 15 Jun 2010, 15:46

Re: ManiaLib 3.0 does not work with PHP 5.5.1

Post by The_Big_Boo » 23 Oct 2013, 17:11

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);
OS: Win 7 Pro x64
RAM: 2x4GB Corsair @ 1600MHz
CPU: Intel i5 760 @ 3.6GHz
Mobo: Asus P7P55D-E
GPU: NVidia GTX 760 2GB
HDD: WD Black 1TB
Sound: VIA VT1828S (onboard)
Peripherals: Razer DeathAdder - Razer DeathStalker - Logitech F310

User avatar
Chris92
Translator
Translator
Posts: 951
Joined: 15 Jun 2010, 13:22
Location: Vilshofen, Germany
Contact:

Re: ManiaLib 3.0 does not work with PHP 5.5.1

Post by Chris92 » 23 Oct 2013, 18:41

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 =)
Check out my Personal Twitter account!

Post Reply

Return to “ManiaLib”

Who is online

Users browsing this forum: No registered users and 2 guests