JInstaller adapter path option

Locked
User avatar
happy_noodle_boy
Joomla! Guru
Joomla! Guru
Posts: 692
Joined: Thu Aug 18, 2005 10:32 am
Location: United Kingdom
Contact:

JInstaller adapter path option

Post by happy_noodle_boy » Wed Jan 30, 2008 9:50 am

I think it would be a good idea to have a config option for the JInstaller class, when creating a new instance, to set the adapter path. This would allow me to use the installer class for my own custom installer, but keep its adapters outside of the core libraries folders.

At the moment I think the only way to use it in this way is to extend the Jinstaller class and add a new setAdapter function with the modified  path.

an example:

Code: Select all

$installer =& JInstaller::getInstance( array(
    'adapter_path' => JPATH_COMPONENT .DS. 'adapters'
) );  
then the setAdapter function in Jinstaller class:

Code: Select all

function setAdapter($name, $adapter = null)
{
    if (!is_object($adapter))
    {			
        // Try to load the adapter object
        require_once($this->adapter_path.DS.strtolower($name).'.php');
        $class = 'JInstaller'.ucfirst($name);
        if (!class_exists($class)) {
            return false;
        }
        $adapter = new $class($this);
        $adapter->parent =& $this;
    }
    $this->_adapters[$name] =& $adapter;
    return true;
}
Any other suggestions?
just because you're not paranoid, doesn't mean everybody isn't out to get you.
http://www.maketradefair.org

Locked

Return to “Wishlists and Feature Requests - Archive”