[TMF] ManiaLib 2.0 preview

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

Moderator: NADEO

User avatar
gouxim
Nadeo
Nadeo
Posts: 1186
Joined: 14 Jun 2010, 17:20

[TMF] ManiaLib 2.0 preview

Post by gouxim »

Hey fellow coders,

Although we just released version 1.0b of ManiaLib, we are already using a new 2.0 version at Nadeo.

I just imported it in the trunk of our svn, so if you are intersted you can checkout the trunk. Beware though, it's is an experimental version: quickly changing codebase, no documentation, use of extensions such as APC, etc.

http://code.google.com/p/manialib/source/checkout
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
User avatar
gouxim
Nadeo
Nadeo
Posts: 1186
Joined: 14 Jun 2010, 17:20

Re: ManiaLib 2.0

Post by gouxim »

If anyone is interested, we can make a alpha zip package out of it.
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
User avatar
w1lla
Posts: 2287
Joined: 15 Jun 2010, 11:09
Location: Netherlands
Contact:

Re: ManiaLib 2.0

Post by w1lla »

im interested to see how it has become...
TM² Info
SM Info
QM Info

OS: Windows 10 x64 Professional
MB: MSI 970A-G46
Processor: AMD FX-6300 3500 mHz
RAM Memory: 16 GB DDR3
Video: SAPPHIRE DUAL-X R9 280X 3GB GDDR5
KB: Logitech G510s
Mouse: Logitech G300s
Mode Creation
ManiaScript Docs
User avatar
gouxim
Nadeo
Nadeo
Posts: 1186
Joined: 14 Jun 2010, 17:20

Re: ManiaLib 2.0

Post by gouxim »

If you juste want to take a look, you can browse the code online:
http://code.google.com/p/manialib/source/browse/ (2.0 is currently the trunk/)

I can give you a quick summary of the architecture.
We are now using "fake namespaces" like what you can find on PEAR or in the Zend Framework for example.

Basically there's is a "libraries" folder which contains all the code, and ALL the code is made of classes.
It works like packages.

For example:
/libraries/ManiaLib/Database/Connection.php
contains the class called
ManiaLib_Database_Connection

It helps a lot organizing the code, and the fact that the class names are that long is not too much of a problem with auto-completion feature of Eclipse PDT.

When you create your Manialink, your are going to put evrything in a package. For example, we created the ManiaLibDemo package that contains all the code of the manialink "manialib":

http://code.google.com/p/manialib/sourc ... iaLibDemo/

When we write our views, the long names where actually a problem, so we created some shortcut classes (when we have migrated to PHP 5.3, this won't be a problem anymore with true namespace support, but for now we are stuck with 5.2):

For example instead of always writing:
"new ManiaLib_Gui_Elements_Quad()"
we use:
"new Quad()"
and Quad is just a class that extends ManiaLib_Gui_Elements_Quad

It also helps a bit with backward compatibility (well, we still broke pretty much everything to get the new architecture in place).

If you want to use the new version, you can "at your own risk": no documentation, the code is evolving very fast and we may break stuff at any time. The 1.0 is branch is more stable. In any case, don't hesitate to ask in a thread in this forum if you have technical questions (whether they are on the 1.0 or 2.0 branch), i am sure it will help others.

Let me know if your are intersted in a ZIP package of the 2.0 to work with it.
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
User avatar
w1lla
Posts: 2287
Joined: 15 Jun 2010, 11:09
Location: Netherlands
Contact:

Re: ManiaLib 2.0

Post by w1lla »

could you post the 2.0 alpha package so i can give it a try.
TM² Info
SM Info
QM Info

OS: Windows 10 x64 Professional
MB: MSI 970A-G46
Processor: AMD FX-6300 3500 mHz
RAM Memory: 16 GB DDR3
Video: SAPPHIRE DUAL-X R9 280X 3GB GDDR5
KB: Logitech G510s
Mouse: Logitech G300s
Mode Creation
ManiaScript Docs
User avatar
gouxim
Nadeo
Nadeo
Posts: 1186
Joined: 14 Jun 2010, 17:20

Re: ManiaLib 2.0

Post by gouxim »

Allright. I still have a couple of bugs to fix, I'll release a preview package in a couple of days.
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
User avatar
gouxim
Nadeo
Nadeo
Posts: 1186
Joined: 14 Jun 2010, 17:20

Re: ManiaLib 2.0

Post by gouxim »

Hey there,

I added a preview package of ManiaLib 2.0 here: http://code.google.com/p/manialib/downloads/list

Here's some instructions for anyone interested in testing it. It must emphasize the fact that it is a preview package, so there's no doc, there's no guarantee it's working and it requires some good knowledge in PHP and OOP.

WARNING!!!
Protect your /config folder so that people can NOT access it throught HTTP
(with a .htaccess file for example)
If you don't do that, people will be able to download your INI config file and see, for example, your database credentials.

Requirements:
* PHP 5.2+
* PHP APC extension (or another cache extension, but you will need to write a driver in ManiaLib/Cache/Driver

How to make it work
* Create a namespace for your application (you can look at the ManiaLibDemo example)
* Edit config/app.ini to match your app

How to stay up to date
Do not modifiy anything in /ManiaLib
When I release a new package, you will just have to override the /ManiaLib package in the libraries folder
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
User avatar
gouxim
Nadeo
Nadeo
Posts: 1186
Joined: 14 Jun 2010, 17:20

Re: ManiaLib 2.0

Post by gouxim »

We are going to update ManiaLib 2.0 to use namespaces, just like ManiaLive does. The idea is that both projects share architecture and some packages so we and the community can share help and documentation on those projects.

I may realase soon a preview package of ManiaLib 2.0 with namespaces, let me know if anyone is interested.
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
User avatar
gouxim
Nadeo
Nadeo
Posts: 1186
Joined: 14 Jun 2010, 17:20

Re: ManiaLib 2.0

Post by gouxim »

I uploaded a zip package with the latest revision of ManiaLib 2.0. It's a preview package.
It now uses namespaces just like ManiaLive, so PHP 5.3+ is required.

Download: http://code.google.com/p/manialib/downloads/list
API doc: http://api.manialib.com/2.0/

Same warning as before still applies
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
reaby
Posts: 956
Joined: 29 Dec 2010, 23:26
Location: Eastern Finland
Contact:

Re: ManiaLib 2.0

Post by reaby »

Thanks, if i have time i'll look into standalone manialib2, tho mostly i use it from manialive.
Keep up the good work guys!
Locked

Return to “ManiaLib”

Who is online

Users browsing this forum: No registered users and 1 guest