JLoader/jimport question in 1.5RC4

Locked
dnblankedelman
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Dec 27, 2007 6:40 pm

JLoader/jimport question in 1.5RC4

Post by dnblankedelman » Thu Dec 27, 2007 10:05 pm

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

User avatar
mjaz
Joomla! Guru
Joomla! Guru
Posts: 821
Joined: Thu Nov 10, 2005 10:08 am
Contact:

Re: JLoader/jimport question in 1.5RC4

Post by mjaz » Fri Dec 28, 2007 4:26 pm

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
Better SEO & multi-lingual Joomla sites with Nooku Content
http://www.nooku.org
Nooku Framework for advanced Joomla extension development
http://www.nooku.org/framework

dnblankedelman
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Dec 27, 2007 6:40 pm

Re: JLoader/jimport question in 1.5RC4

Post by dnblankedelman » Fri Dec 28, 2007 4:41 pm

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

User avatar
mjaz
Joomla! Guru
Joomla! Guru
Posts: 821
Joined: Thu Nov 10, 2005 10:08 am
Contact:

Re: JLoader/jimport question in 1.5RC4

Post by mjaz » Sat Dec 29, 2007 4:32 pm

Better SEO & multi-lingual Joomla sites with Nooku Content
http://www.nooku.org
Nooku Framework for advanced Joomla extension development
http://www.nooku.org/framework

dnblankedelman
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Dec 27, 2007 6:40 pm

Re: JLoader/jimport question in 1.5RC4

Post by dnblankedelman » Sun Dec 30, 2007 12:27 am

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

  -- dNb


Locked

Return to “Joombie Coding Q/A”