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.
It’s a bit difficult to explain without showing you the code… so why not download it and see?
Inferno is pretty basic right now, but it performs a simple job, quite elegantly.
$this->inferno->load('aws'); $this->inferno->aws->load('sqs'); $queues = $this->inferno->aws->sqs->list_queues();
To celebrate the death of PHP4… Inferno is PHP5 only!
Now, I’m ready for suggestions… what libraries should we start packing into this little CI distribution?




Elliot, you sir, are a machine (that’s of course a compliment). That said, I think it would be much more helpful if you only distributed what was added. Not because of any license implications or anything, but simply because if you distribute all of CI, then you’ll need to update each time we update… and that’ll get to be a burden. Plus, there is cool stuff in there already that’s not in the download, and much more cool stuff on the horizon.
Anyhow, just a thought, and great work.
I’m speechless. Not only is this an awesome addition to CI, but both of the projects that I spend so much time working on are both bundled!
Tarzan development is moving pretty quickly right now. I’d recommend following @Tarzan_AWS to keep up with the latest changes and updates.
Elliot, this is quite impressive. I don’t have anything to suggest, but I do have a serious high five for you!
That’s some seriously-awesome-stuff!
I agree with Derek though that you should supply an Inferno-only version without CI. That would make it easier to integrate Inferno into existing projects.
This is just plain awesome! A big high five to you Elliott, if this all works out good then you’ve really saved me a huge headache of issues I’ve been having with the Akismet library. Anyhow great work and simply this is just fantastic! Great Work!
Hey guys… thanks for the feedback.
Over the next few days I will be adding more libraries to the default distribution, adding a little user guide, and stripping out the default CI install too.
The main reason for including it was so people could quickly test it.
Elliot
[...] there that don’t follow Elliot Haughins blog, he released an awesome project yesterday called Inferno. The idea here is to create a version of CI that has a bunch of third party code libraries already [...]
Very very nice work Elliot.
I think you could prepare two files, one with CI and one without.
Anyway great job =)
Great work as always! Thanks for making this available, it is going to have a huge impact on the CI community!
This is great, definitely a necessity for any project. Do you have a list of libraries you’re planning on adding? Will you provide any documentation on how to add libraries? It looks like you need to know a little bit about how each library works in order to add the class.
this is going to be great, what an awesome initiative!
I think including a lot of the zend libraries may save some time since they’ve done a lot of the class work. i’ve used this method of splicing them in for a while, but it’s so much fluff for not enough payoff i sometimes wonder why I bother when some dont work in CI anyways. http://tinyurl.com/36mnjk
[...] от этой проблемы можно с помощью библиотеки Inferno. Ее предназначение – подключение сторонних библиотек [...]
Hi, good work with CI and nice idea with inferno. So my suggestion about a lib is great PHPExcel for generating XLS and PDF files http://www.codeplex.com/PHPExcel
Support for the YouTube API would be great, as well as Flickr.
Great work Elliot.
Cool idea
One suggestion:
Is it possible for you to give the option of loading the third party libraries into the CI instance instead of the Inferno instance? The setting being in the inferno config?
So, instead of doing:
$this->inferno->load(’simplepie’);
$this->inferno->simplepie->set_feed_url(’http://www.haughin.com/feed/’);
$this->inferno->simplepie->set_cache_location(APPPATH.’cache/rss’);
$this->inferno->simplepie->init();
$this->inferno->simplepie->handle_content_type();
You could do:
$this->inferno->load(’simplepie’);
$this->simplepie->set_feed_url(’http://www.haughin.com/feed/’);
$this->simplepie->set_cache_location(APPPATH.’cache/rss’);
$this->simplepie->init();
$this->simplepie->handle_content_type();
I haven’t tested this yet but the Inferno libraries “load” function would be changed to something along the lines of:
var $CI;
function load($lib, $params = null)
{
// if $config['use_CI'] = TRUE; in inferno’s config
if ($this->use_CI)
{
$this->CI =& get_instance();
}
if ( isset($this->$lib) || ($this->use_CI && isset($this->CI->$lib)))
{
log_message(’debug’, ‘INFERNO :: Load ‘.$lib.’ – Class already loaded!’);
return;
}
include(INFERNO_PATH.’inferno_’.$lib.’.php’);
$class_name = ‘Inferno_’.ucfirst($lib);
if ($this->use_CI)
{
$this->CI->$lib = new $class_name($params);
}
else
{
$this->$lib = new $class_name($params);
}
}
Here’s a revised version that tests OK.
In “application/config/inferno.php”:
$config['inferno_instance'] = FALSE; // FALSE to use CI
In “application/libararies/inferno.php”:
function load($lib, $params = null)
{
if ( $this->inferno_instance && isset($this->$lib) || !$this->inferno_instance && isset($this->obj->$lib))
{
log_message(’debug’, ‘INFERNO :: Load ‘.$lib.’ – Class already loaded!’);
return;
}
include(INFERNO_PATH.’inferno_’.$lib.’.php’);
$class_name = ‘Inferno_’.ucfirst($lib);
if ($this->inferno_instance)
{
$this->$lib = new $class_name($params);
}
else
{
$this->obj->$lib = new $class_name($params);
}
}
Sorry, Elliot, please delete the “revised” comment above. I missed out on including some code and have made a cleaner, simplified version:
In “application/config/inferno.php” add:
$config['inferno_instance'] = TRUE; // Set to FALSE to use CI instance
In “application/libraries/inferno.php”, replace class with:
class Inferno {
function Inferno($config = array())
{
$this->obj =& get_instance();
define(’INFERNO_PATH’, APPPATH.’libraries/inferno/’);
// Add each config value to the class
foreach($config as $key => $value)
{
$this->$key = $value;
}
$this->_autoload();
}
function _autoload()
{
if ( $this->inferno_autoload )
{
$libs = explode(’,', $this->inferno_autoload);
foreach ( $libs as $lib )
{
$this->load(trim($lib));
}
}
}
function load($lib, $params = null)
{
if ( $this->inferno_instance && isset($this->$lib) || !$this->inferno_instance && isset($this->obj->$lib))
{
log_message(’debug’, ‘INFERNO :: Load ‘.$lib.’ – Class already loaded!’);
return;
}
include(INFERNO_PATH.’inferno_’.$lib.’.php’);
$class_name = ‘Inferno_’.ucfirst($lib);
if ($this->inferno_instance == TRUE)
{
$this->$lib = new $class_name($params);
}
else
{
$this->obj->$lib = new $class_name($params);
}
}
}
I vote for the Sphinx search API
Great site. I’m learning to develop web applications as well. How long would you have to have coded in PHP before you dive into Codeigniter framework? How much do I need to know about MySQL before developing a full robust web application?
This is awesome. My biggest feature request is documentation.
When I try to upload avatar in .JPG i see : Fatal error: Call to undefined function: imagecreatefromjpeg()
and avatar is not saved.
With avatars in .gif everythink is OK.
Elliot, Did you create an install without the CI code base?
love it elliot. why not some twitter and flickr lovin?
That’s darn good stuff! What about adding Facebook here? (To make Facebook apps, and why not Connect also)
Thanks for sharing this =)
i’ve made something like that it’s a
Codeigniter+dojo+jquery+KFM browser (it’s cool) + some dojo GUI php library
and a structure that can make any web application i want in a flash you just have to make the plug in and add them to the page you want then wooooow the site is there
i named it Vunsy
i want you to test it and tell me your opinion (it’s still in the Dev version )
it’s a call for contribution,
http://freshmeat.net/projects/vunsy
so please try it and contact me on blazeeboy[at]gmail[dot]com