• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Inferno - 3rd Party Classes for CodeIgniter

[eluser]Elliot Haughin[/eluser]
For quite some time I’ve been fed up of downloading PHP Classes and having to modify them to turn them into CodeIgniter Libraries.

I’ve also longed to have a version of CodeIgniter that’s pre-filled with lots of really cool and useful libraries. Ready to use on the fly, or autoloaded on every request.

Well, I’d like to introduce ‘Inferno’, the solution to this problem. By wrapping standard, unmodified PHP Classes into libraries, it forms the base of what will soon become a large base of functionality.

Read all about it here:
Inferno - CodeIgniter PHP Class Wrapper

[eluser]Sam Dark[/eluser]
Downloaded. Will play with it soon…

That is quite possibly one of the most useful contributions i've seen so far. Kudos to you!

If i get the idea correct. Instead of changing the class files themselves, a extended inferno class hooks the class to CI with the methods you needed to change in the class files. Making it possible to update the class without changing the files all over again.

Pretty neat!

Very clever, good work Elliot.

[eluser]Elliot Haughin[/eluser]
Yeah, the concept is simple... include the 3rd party class in a wrapper.

The wrapper performs any modifications needed. For example, allowing users to reference camelCasedFunctions with the CI-way of camel_cased_functions.

This way, you can update the 3rd party class straight from a fresh download without having to modify it.

To do this, we need some magic from PHP5... which I've always been reluctant of (since CI is 4+), but with the official death of PHP4, I'm not too bothered about that now.

The only file you should ever need to change is the wrapper.

The idea eventually is to build up a big load of PHP classes which run inside of inferno, and can be downloaded in one sweet package.
Or, you can just use it as a method of wrapping whatever 3rd party classes you'd like to run as CI Libraries.

Any suggestions for great PHP Classes you'd like to see put in the fire?

I'm beginning to wonder why the inferno wrapper library is needed? Why not do
class Simplepie_ci {
        private $CI;        

        function Simplepie_ci()
            include (APPPATH.'libraries/third_party/simplepie/simplepie.inc');

            $this->CI = & get_instance();
            $this->CI->simplepie = new Simplepie();
        function __call($method, $arguments)
            return call_user_func_array(array($this->CI->simplepie,    $method), $arguments);
And call the wrapper direct

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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