• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extending a 3rd party library but not within the same file (best practice)

#1
[eluser]Exangelus[/eluser]
Hi all,

I'm using the superb Form Generation library from Frank Michel but I wanna extend it for some additional functionality. However I'd like to keep my library and the FormGen library in seperate files so I can easily update the FormGen library when Frank brings out a new version.

It's like this:
Lib_a.php
Lib_b.php

Now Lib_b.php is autoloaded and inside is:
Code:
class Lib_b extends Lib_a

But Lib_a is inside a seperate file and now I've a problem... the stuff already fails while loading libraries because the Lib_a is unknown however if I put require('Lib_a.php'); in the Lib_b.php file before the class definition it still fails while it should know Lib_a by then.
Also autoloading both Lib_a and Lib_b doesn't work, sequence seems to be irrelevant.

Anyone been in the same situation or think you got a handle on this? All help is greatly appreciated!

#2
[eluser]Exangelus[/eluser]
I just found the solution, it was the autoload order but do a sync error with my FTP that I didn't notice I was under the impression it did not work.. sorry for the overhead Smile this topic can be locked..


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.