@@ -500,9 +500,11 @@ public function discover_install($eid = null)
500500 }
501501
502502 // Lazy load the adapter
503+ $ adapter = null ;
503504 if (!isset ($ this ->_adapters [$ this ->extension ->type ]) || !is_object ($ this ->_adapters [$ this ->extension ->type ]))
504505 {
505- if (!$ this ->setAdapter ($ this ->extension ->type ))
506+ $ params = array ('extension ' => $ this ->extension );
507+ if (!$ this ->setAdapter ($ this ->extension ->type , $ adapter , $ params ))
506508 {
507509 return false ;
508510 }
@@ -691,17 +693,22 @@ public function update($path = null)
691693 * Package uninstallation method
692694 *
693695 * @param string $type Package type
694- * @param mixed $identifier Package identifier for adapter
696+ * @param mixed $eid Package identifier for adapter
695697 *
696698 * @return boolean True if successful
697699 *
698700 * @since 3.1
699701 */
700- public function uninstall ($ type , $ identifier )
702+ public function uninstall ($ type , $ eid )
701703 {
704+ $ this ->extension = JTable::getInstance ('extension ' );
705+ $ this ->extension ->load (array ('type ' =>$ type , 'extension_id ' =>$ eid ));
706+
707+ $ adapter = null ;
702708 if (!isset ($ this ->_adapters [$ type ]) || !is_object ($ this ->_adapters [$ type ]))
703709 {
704- if (!$ this ->setAdapter ($ type ))
710+ $ params = array ('extension ' => $ this ->extension );
711+ if (!$ this ->setAdapter ($ type , $ adapter , $ params ))
705712 {
706713 // We failed to get the right adapter
707714 return false ;
@@ -714,12 +721,12 @@ public function uninstall($type, $identifier)
714721 // Fire the onExtensionBeforeUninstall event.
715722 JPluginHelper::importPlugin ('extension ' );
716723 $ dispatcher = JEventDispatcher::getInstance ();
717- $ dispatcher ->trigger ('onExtensionBeforeUninstall ' , array ('eid ' => $ identifier ));
724+ $ dispatcher ->trigger ('onExtensionBeforeUninstall ' , array ('eid ' => $ eid ));
718725
719726 // Run the uninstall.
720727 $ errorMsg = '' ;
721728 try {
722- $ result = (bool ) $ this ->_adapters [$ type ]->uninstall ($ identifier );
729+ $ result = (bool ) $ this ->_adapters [$ type ]->uninstall ($ eid );
723730 }
724731 catch (Exception $ e )
725732 {
@@ -735,7 +742,7 @@ public function uninstall($type, $identifier)
735742 'onExtensionAfterUninstall ' ,
736743 array (
737744 'installer ' => clone $ this ,
738- 'eid ' => $ identifier ,
745+ 'eid ' => $ eid ,
739746 'result ' => $ result
740747 )
741748 );
@@ -776,9 +783,11 @@ public function refreshManifestCache($eid)
776783 }
777784
778785 // Lazy load the adapter
786+ $ adapter = null ;
779787 if (!isset ($ this ->_adapters [$ this ->extension ->type ]) || !is_object ($ this ->_adapters [$ this ->extension ->type ]))
780788 {
781- if (!$ this ->setAdapter ($ this ->extension ->type ))
789+ $ params = array ('extension ' => $ this ->extension );
790+ if (!$ this ->setAdapter ($ this ->extension ->type , $ adapter , $ params ))
782791 {
783792 return false ;
784793 }
@@ -839,9 +848,11 @@ public function setupInstall()
839848 $ type = (string ) $ this ->manifest ->attributes ()->type ;
840849
841850 // Lazy load the adapter
851+ $ adapter = null ;
842852 if (!isset ($ this ->_adapters [$ type ]) || !is_object ($ this ->_adapters [$ type ]))
843853 {
844- if (!$ this ->setAdapter ($ type ))
854+ $ params = array ('manifest ' => $ this ->manifest );
855+ if (!$ this ->setAdapter ($ type , $ adapter , $ params ))
845856 {
846857 return false ;
847858 }
@@ -1851,6 +1862,10 @@ public function copyManifest($cid = 1)
18511862 */
18521863 public function findManifest ()
18531864 {
1865+ if (!$ this ->getPath ('source ' )) {
1866+ return false ;
1867+ }
1868+
18541869 // Get an array of all the XML files from the installation directory
18551870 $ xmlfiles = JFolder::files ($ this ->getPath ('source ' ), '.xml$ ' , 1 , true );
18561871
0 commit comments