Page 1 of 1

JLoader/jimport question in 1.5RC4

Posted: Thu Dec 27, 2007 10:05 pm
by dnblankedelman
Hi-

I'm trying to understand what I think is probably a pretty simple question. I'm wondering what the canonical Joomla way is to import classes found deep in the standard library directories. For example, let's say you want to use JSessionStorageDatabase found in libraries//joomla/session/storage/database.php.

I would have guessed one would be able to use jimport("joomla.session.storage.database") to make use of the spiffy autoloading/performance improvements detailed here: http://forum.joomla.org/index.php?topic=225224.0. But lots of careful single-stepping through the JLoader classes in loader.php has convinced me that jimport doesn't handle things this way. It looks like jimport("joomla.session.storage.database") would happily let me import a class called JDatabase (since the name is constructed using the last part of the specification) but beyond that I'm out of luck and have to resort to the standard PHP functions.  Is this the case, or am I missing something?

Thanks for any help you can offer.

    -- dNb

Re: JLoader/jimport question in 1.5RC4

Posted: Fri Dec 28, 2007 4:26 pm
by mjaz
You never need to load classes with multiple names like JFooBar. I'm writing something for our blog, keep an eye on http://blog.joomlatools.org

Re: JLoader/jimport question in 1.5RC4

Posted: Fri Dec 28, 2007 4:41 pm
by dnblankedelman
mjaz wrote:You never need to load classes with multiple names like JFooBar.  I'm writing something for our blog, keep an eye on http://blog.joomlatools.org


Hmm, ok. Already read the blog religiously, I'll look forward to the full response. Thanks!

   -- dNb

Re: JLoader/jimport question in 1.5RC4

Posted: Sat Dec 29, 2007 4:32 pm
by mjaz

Re: JLoader/jimport question in 1.5RC4

Posted: Sun Dec 30, 2007 12:27 am
by dnblankedelman


Super answer! Thanks so much for taking the time to write this.

  -- dNb