PageRenderTime 49ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 1ms

/libraries/joomla/installer/adapters/plugin.php

https://github.com/cosmocommerce/joomla
PHP | 679 lines | 422 code | 63 blank | 194 comment | 76 complexity | c723bc95cdaaf2324dfe94b7695e32d1 MD5 | raw file
Possible License(s): Apache-2.0, LGPL-2.1
  1. <?php
  2. /**
  3. * @version $Id$
  4. * @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
  5. * @license GNU General Public License version 2 or later; see LICENSE.txt
  6. */
  7. // No direct access
  8. defined('JPATH_BASE') or die;
  9. jimport('joomla.base.adapterinstance');
  10. /**
  11. * Plugin installer
  12. *
  13. * @package Joomla.Framework
  14. * @subpackage Installer
  15. * @since 1.5
  16. */
  17. class JInstallerPlugin extends JAdapterInstance
  18. {
  19. /** @var string install function routing */
  20. var $route = 'Install';
  21. protected $manifest = null;
  22. protected $manifest_script = null;
  23. protected $name = null;
  24. protected $scriptElement = null;
  25. /**
  26. * Custom loadLanguage method
  27. *
  28. * @access public
  29. * @param string $path the path where to find language files
  30. * @since 1.6
  31. */
  32. public function loadLanguage($path)
  33. {
  34. $this->manifest = &$this->parent->getManifest();
  35. $element = $this->manifest->files;
  36. if ($element)
  37. {
  38. $group = strtolower((string)$this->manifest->attributes()->group);
  39. $name = '';
  40. if (count($element->children()))
  41. {
  42. foreach ($element->children() as $file)
  43. {
  44. if ((string)$file->attributes()->plugin)
  45. {
  46. $name = strtolower((string)$file->attributes()->plugin);
  47. break;
  48. }
  49. }
  50. }
  51. if ($name)
  52. {
  53. $extension = "plg_${group}_${name}";
  54. $lang =& JFactory::getLanguage();
  55. $source = $path;
  56. $folder = (string)$element->attributes()->folder;
  57. if ($folder && file_exists("$path/$folder"))
  58. {
  59. $source = "$path/$folder";
  60. }
  61. $lang->load($extension . '.manage', $source, null, false, false)
  62. || $lang->load($extension, $source, null, false, false)
  63. || $lang->load($extension . '.manage', JPATH_ADMINISTRATOR, null, false, false)
  64. || $lang->load($extension, JPATH_ADMINISTRATOR, null, false, false)
  65. || $lang->load($extension . '.manage', $source, $lang->getDefault(), false, false)
  66. || $lang->load($extension, $source, $lang->getDefault(), false, false)
  67. || $lang->load($extension . '.manage', JPATH_ADMINISTRATOR, $lang->getDefault(), false, false)
  68. || $lang->load($extension, JPATH_ADMINISTRATOR, $lang->getDefault(), false, false);
  69. }
  70. }
  71. }
  72. /**
  73. * Custom install method
  74. *
  75. * @access public
  76. * @return boolean True on success
  77. * @since 1.5
  78. */
  79. public function install()
  80. {
  81. // Get a database connector object
  82. $db = &$this->parent->getDbo();
  83. // Get the extension manifest object
  84. $this->manifest = $this->parent->getManifest();
  85. $xml = $this->manifest;
  86. /**
  87. * ---------------------------------------------------------------------------------------------
  88. * Manifest Document Setup Section
  89. * ---------------------------------------------------------------------------------------------
  90. */
  91. // Set the extensions name
  92. $name = (string)$xml->name;
  93. $name = JFilterInput::getInstance()->clean($name, 'string');
  94. $this->set('name', $name);
  95. // Get the component description
  96. $description = (string)$xml->description;
  97. if ($description) {
  98. $this->parent->set('message', JText::_($description));
  99. }
  100. else {
  101. $this->parent->set('message', '');
  102. }
  103. /*
  104. * Backward Compatability
  105. * @todo Deprecate in future version
  106. */
  107. $type = (string)$xml->attributes()->type;
  108. // Set the installation path
  109. if (count($xml->files->children()))
  110. {
  111. foreach ($xml->files->children() as $file)
  112. {
  113. if ((string)$file->attributes()->$type)
  114. {
  115. $element = (string)$file->attributes()->$type;
  116. break;
  117. }
  118. }
  119. }
  120. $group = (string)$xml->attributes()->group;
  121. if (!empty ($element) && !empty($group)) {
  122. $this->parent->setPath('extension_root', JPATH_ROOT.DS.'plugins'.DS.$group.DS.$element);
  123. }
  124. else
  125. {
  126. $this->parent->abort(JText::_('Plugin').' '.JText::_($this->route).': '.JText::_('No plugin file specified'));
  127. return false;
  128. }
  129. /*
  130. * Check if we should enable overwrite settings
  131. */
  132. // Check to see if a plugin by the same name is already installed
  133. $query = 'SELECT `extension_id`' .
  134. ' FROM `#__extensions`' .
  135. ' WHERE folder = '.$db->Quote($group) .
  136. ' AND element = '.$db->Quote($element);
  137. $db->setQuery($query);
  138. try {
  139. $db->Query();
  140. }
  141. catch(JException $e)
  142. {
  143. // Install failed, roll back changes
  144. $this->parent->abort(JText::_('Plugin').' '.JText::_($this->route).': '.$db->stderr(true));
  145. return false;
  146. }
  147. $id = $db->loadResult();
  148. // if its on the fs...
  149. if (file_exists($this->parent->getPath('extension_root')) && (!$this->parent->getOverwrite() || $this->parent->getUpgrade()))
  150. {
  151. $updateElement = $xml->update;
  152. // upgrade manually set
  153. // update function available
  154. // update tag detected
  155. if ($this->parent->getUpgrade() || ($this->parent->manifestClass && method_exists($this->parent->manifestClass,'update')) || is_a($updateElement, 'JXMLElement'))
  156. {
  157. // force these one
  158. $this->parent->setOverwrite(true);
  159. $this->parent->setUpgrade(true);
  160. if ($id) { // if there is a matching extension mark this as an update; semantics really
  161. $this->route = 'Update';
  162. }
  163. }
  164. else if (!$this->parent->getOverwrite())
  165. {
  166. // overwrite is set
  167. // we didn't have overwrite set, find an udpate function or find an update tag so lets call it safe
  168. $this->parent->abort(JText::_('Plugin').' '.JText::_($this->route).': '.JText::_('Another extension is already using directory').': "'.$this->parent->getPath('extension_root').'"');
  169. return false;
  170. }
  171. }
  172. /**
  173. * ---------------------------------------------------------------------------------------------
  174. * Installer Trigger Loading
  175. * ---------------------------------------------------------------------------------------------
  176. */
  177. // If there is an manifest class file, lets load it; we'll copy it later (don't have dest yet)
  178. if ((string)$xml->scriptfile)
  179. {
  180. $manifestScript = (string)$xml->scriptfile;
  181. $manifestScriptFile = $this->parent->getPath('source').DS.$manifestScript;
  182. if (is_file($manifestScriptFile))
  183. {
  184. // load the file
  185. include_once $manifestScriptFile;
  186. }
  187. // Set the class name
  188. $classname = 'plg'.$group.$element.'InstallerScript';
  189. if (class_exists($classname))
  190. {
  191. // create a new instance
  192. $this->parent->manifestClass = new $classname($this);
  193. // and set this so we can copy it later
  194. $this->set('manifest_script', $manifestScript);
  195. // Note: if we don't find the class, don't bother to copy the file
  196. }
  197. }
  198. // run preflight if possible (since we know we're not an update)
  199. ob_start();
  200. ob_implicit_flush(false);
  201. if ($this->parent->manifestClass && method_exists($this->parent->manifestClass,'preflight')) {
  202. $this->parent->manifestClass->preflight($this->route, $this);
  203. }
  204. $msg = ob_get_contents(); // create msg object; first use here
  205. ob_end_clean();
  206. /**
  207. * ---------------------------------------------------------------------------------------------
  208. * Filesystem Processing Section
  209. * ---------------------------------------------------------------------------------------------
  210. */
  211. // If the plugin directory does not exist, lets create it
  212. $created = false;
  213. if (!file_exists($this->parent->getPath('extension_root')))
  214. {
  215. if (!$created = JFolder::create($this->parent->getPath('extension_root')))
  216. {
  217. $this->parent->abort(JText::_('Plugin').' '.JText::_($this->route).': '.JText::_('FAILED_TO_CREATE_DIRECTORY').': "'.$this->parent->getPath('extension_root').'"');
  218. return false;
  219. }
  220. }
  221. /*
  222. * If we created the plugin directory and will want to remove it if we
  223. * have to roll back the installation, lets add it to the installation
  224. * step stack
  225. */
  226. if ($created) {
  227. $this->parent->pushStep(array ('type' => 'folder', 'path' => $this->parent->getPath('extension_root')));
  228. }
  229. // Copy all necessary files
  230. if ($this->parent->parseFiles($xml->files, -1) === false)
  231. {
  232. // Install failed, roll back changes
  233. $this->parent->abort();
  234. return false;
  235. }
  236. // Parse optional tags -- media and language files for plugins go in admin app
  237. $this->parent->parseMedia($xml->media, 1);
  238. $this->parent->parseLanguages($xml->languages, 1);
  239. // If there is a manifest script, lets copy it.
  240. if ($this->get('manifest_script'))
  241. {
  242. $path['src'] = $this->parent->getPath('source').DS.$this->get('manifest_script');
  243. $path['dest'] = $this->parent->getPath('extension_root').DS.$this->get('manifest_script');
  244. if (!file_exists($path['dest']))
  245. {
  246. if (!$this->parent->copyFiles(array ($path)))
  247. {
  248. // Install failed, rollback changes
  249. $this->parent->abort(JText::_('Plugin').' '.JText::_($this->route).': '.JText::_('Could not copy PHP manifest file.'));
  250. return false;
  251. }
  252. }
  253. }
  254. /**
  255. * ---------------------------------------------------------------------------------------------
  256. * Database Processing Section
  257. * ---------------------------------------------------------------------------------------------
  258. */
  259. // Was there a plugin already installed with the same name?
  260. if ($id)
  261. {
  262. if (!$this->parent->getOverwrite())
  263. {
  264. // Install failed, roll back changes
  265. $this->parent->abort(JText::_('Plugin').' '.JText::_($this->route).': '.JText::_('Plugin').' "'. $this->get('name') .'" '.JText::_('ALREADY_EXISTS'));
  266. return false;
  267. }
  268. }
  269. else
  270. {
  271. // Store in the extensions table (1.6)
  272. $row = & JTable::getInstance('extension');
  273. $row->name = $this->get('name');
  274. $row->type = 'plugin';
  275. $row->ordering = 0;
  276. $row->element = $element;
  277. $row->folder = $group;
  278. $row->enabled = 0;
  279. $row->protected = 0;
  280. $row->access = 1;
  281. $row->client_id = 0;
  282. $row->params = $this->parent->getParams();
  283. $row->custom_data = ''; // custom data
  284. $row->system_data = ''; // system data
  285. $row->manifest_cache = $this->parent->generateManifestCache();
  286. // Editor plugins are published by default
  287. if ($group == 'editors') {
  288. $row->enabled = 1;
  289. }
  290. if (!$row->store())
  291. {
  292. // Install failed, roll back changes
  293. $this->parent->abort(JText::_('Plugin').' '.JText::_($this->route).': '.$db->stderr(true));
  294. return false;
  295. }
  296. // Since we have created a plugin item, we add it to the installation step stack
  297. // so that if we have to rollback the changes we can undo it.
  298. $this->parent->pushStep(array ('type' => 'extension', 'id' => $row->extension_id));
  299. $id = $row->extension_id;
  300. }
  301. /*
  302. * Let's run the queries for the module
  303. * If Joomla 1.5 compatible, with discreet sql files - execute appropriate
  304. * file for utf-8 support or non-utf-8 support
  305. */
  306. // try for Joomla 1.5 type queries
  307. // second argument is the utf compatible version attribute
  308. $utfresult = $this->parent->parseSQLFiles($xml->{strtolower($this->route)}->sql);
  309. if ($utfresult === false)
  310. {
  311. // Install failed, rollback changes
  312. $this->parent->abort(JText::_('Module').' '.JText::_($this->route).': '.JText::_('SQLERRORORFILE')." ".$db->stderr(true));
  313. return false;
  314. }
  315. // Start Joomla! 1.6
  316. ob_start();
  317. ob_implicit_flush(false);
  318. if ($this->parent->manifestClass && method_exists($this->parent->manifestClass,$this->route)) {
  319. $this->parent->manifestClass->{$this->route}($this);
  320. }
  321. $msg .= ob_get_contents(); // append messages
  322. ob_end_clean();
  323. /**
  324. * ---------------------------------------------------------------------------------------------
  325. * Finalization and Cleanup Section
  326. * ---------------------------------------------------------------------------------------------
  327. */
  328. // Lastly, we will copy the manifest file to its appropriate place.
  329. if (!$this->parent->copyManifest(-1))
  330. {
  331. // Install failed, rollback changes
  332. $this->parent->abort(JText::_('Plugin').' '.JText::_($this->route).': '.JText::_('COULD_NOT_COPY_SETUP_FILE'));
  333. return false;
  334. }
  335. // And now we run the postflight
  336. ob_start();
  337. ob_implicit_flush(false);
  338. if ($this->parent->manifestClass && method_exists($this->parent->manifestClass,'postflight')) {
  339. $this->parent->manifestClass->postflight($this->route, $this);
  340. }
  341. $msg .= ob_get_contents(); // append messages
  342. ob_end_clean();
  343. if ($msg != '') {
  344. $this->parent->set('extension_message', $msg);
  345. }
  346. return $id;
  347. }
  348. /**
  349. * Custom update method
  350. *
  351. * @access public
  352. * @return boolean True on success
  353. * @since 1.6
  354. */
  355. function update()
  356. {
  357. // set the overwrite setting
  358. $this->parent->setOverwrite(true);
  359. $this->parent->setUpgrade(true);
  360. // set the route for the install
  361. $this->route = 'Update';
  362. // go to install which handles updates properly
  363. return $this->install();
  364. }
  365. /**
  366. * Custom uninstall method
  367. *
  368. * @access public
  369. * @param int $cid The id of the plugin to uninstall
  370. * @param int $clientId The id of the client (unused)
  371. * @return boolean True on success
  372. * @since 1.5
  373. */
  374. public function uninstall($id)
  375. {
  376. // Initialise variables.
  377. $row = null;
  378. $retval = true;
  379. $db = &$this->parent->getDbo();
  380. // First order of business will be to load the module object table from the database.
  381. // This should give us the necessary information to proceed.
  382. $row = & JTable::getInstance('extension');
  383. if (!$row->load((int) $id))
  384. {
  385. JError::raiseWarning(100, JText::_('ERRORUNKOWNEXTENSION'));
  386. return false;
  387. }
  388. // Is the plugin we are trying to uninstall a core one?
  389. // Because that is not a good idea...
  390. if ($row->protected)
  391. {
  392. JError::raiseWarning(100, JText::_('Plugin').' '.JText::_('Uninstall').': '.JText::sprintf('WARNCOREPLUGIN', $row->name)."<br />".JText::_('WARNCOREPLUGIN2'));
  393. return false;
  394. }
  395. // Get the plugin folder so we can properly build the plugin path
  396. if (trim($row->folder) == '')
  397. {
  398. JError::raiseWarning(100, JText::_('Plugin').' '.JText::_('Uninstall').': '.JText::_('Folder field empty, cannot remove files'));
  399. return false;
  400. }
  401. // Set the plugin root path
  402. if (is_dir(JPATH_ROOT.DS.'plugins'.DS.$row->folder.DS.$row->element)) {
  403. // Use 1.6 plugins
  404. $this->parent->setPath('extension_root', JPATH_ROOT.DS.'plugins'.DS.$row->folder.DS.$row->element);
  405. }
  406. else {
  407. // Use Legacy 1.5 plugins
  408. $this->parent->setPath('extension_root', JPATH_ROOT.DS.'plugins'.DS.$row->folder);
  409. }
  410. // Because plugins don't have their own folders we cannot use the standard method of finding an installation manifest
  411. // Since 1.6 they do, however until we move to 1.7 and remove 1.6 legacy we still need to use this method
  412. // when we get there it'll be something like "$manifest = &$this->parent->getManifest();"
  413. $manifestFile = $this->parent->getPath('extension_root').DS.$row->element.'.xml';
  414. if ( ! file_exists($manifestFile))
  415. {
  416. JError::raiseWarning(100, 'Plugin Uninstall: Manifest File invalid or not found');
  417. return false;
  418. }
  419. $xml = JFactory::getXML($manifestFile);
  420. $this->manifest = $xml;
  421. // If we cannot load the xml file return null
  422. if (!$xml)
  423. {
  424. JError::raiseWarning(100, JText::_('Plugin').' '.JText::_('Uninstall').': '.JText::_('Could not load manifest file'));
  425. return false;
  426. }
  427. /*
  428. * Check for a valid XML root tag.
  429. * @todo: Remove backwards compatability in a future version
  430. * Should be 'extension', but for backward compatability we will accept 'install'.
  431. */
  432. if ($xml->getName() != 'install' && $xml->getName() != 'extension')
  433. {
  434. JError::raiseWarning(100, JText::_('Plugin').' '.JText::_('Uninstall').': '.JText::_('Invalid manifest file'));
  435. return false;
  436. }
  437. /**
  438. * ---------------------------------------------------------------------------------------------
  439. * Installer Trigger Loading
  440. * ---------------------------------------------------------------------------------------------
  441. */
  442. // If there is an manifest class file, lets load it; we'll copy it later (don't have dest yet)
  443. $manifestScript = (string)$xml->scriptfile;
  444. if ($manifestScript)
  445. {
  446. $manifestScriptFile = $this->parent->getPath('source').DS.$manifestScript;
  447. if (is_file($manifestScriptFile)) {
  448. // load the file
  449. include_once $manifestScriptFile;
  450. }
  451. // Set the class name
  452. $classname = 'plg'.$row->folder.$row->element.'InstallerScript';
  453. if (class_exists($classname))
  454. {
  455. // create a new instance
  456. $this->parent->manifestClass = new $classname($this);
  457. // and set this so we can copy it later
  458. $this->set('manifest_script', $manifestScript);
  459. // Note: if we don't find the class, don't bother to copy the file
  460. }
  461. }
  462. // run preflight if possible (since we know we're not an update)
  463. ob_start();
  464. ob_implicit_flush(false);
  465. if ($this->parent->manifestClass && method_exists($this->parent->manifestClass,'preflight')) {
  466. $this->parent->manifestClass->preflight($this->route, $this);
  467. }
  468. $msg = ob_get_contents(); // create msg object; first use here
  469. ob_end_clean();
  470. /*
  471. * Let's run the queries for the module
  472. * If Joomla 1.5 compatible, with discreet sql files - execute appropriate
  473. * file for utf-8 support or non-utf-8 support
  474. */
  475. // try for Joomla 1.5 type queries
  476. // second argument is the utf compatible version attribute
  477. $utfresult = $this->parent->parseSQLFiles($xml->{strtolower($this->route)}->sql);
  478. if ($utfresult === false)
  479. {
  480. // Install failed, rollback changes
  481. $this->parent->abort(JText::_('Plugin').' '.JText::_('Uninstall').': '.JText::_('SQLERRORORFILE')." ".$db->stderr(true));
  482. return false;
  483. }
  484. // Start Joomla! 1.6
  485. ob_start();
  486. ob_implicit_flush(false);
  487. if ($this->parent->manifestClass && method_exists($this->parent->manifestClass,'uninstall')) {
  488. $this->parent->manifestClass->uninstall($this);
  489. }
  490. $msg = ob_get_contents(); // append messages
  491. ob_end_clean();
  492. // Remove the plugin files
  493. $this->parent->removeFiles($xml->images, -1);
  494. $this->parent->removeFiles($xml->files, -1);
  495. JFile::delete($manifestFile);
  496. // Remove all media and languages as well
  497. $this->parent->removeFiles($xml->media);
  498. $this->parent->removeFiles($xml->languages,1);
  499. // Now we will no longer need the plugin object, so lets delete it
  500. $row->delete($row->extension_id);
  501. unset ($row);
  502. // If the folder is empty, let's delete it
  503. $files = JFolder::files($this->parent->getPath('extension_root'));
  504. JFolder::delete($this->parent->getPath('extension_root'));
  505. if ($msg) {
  506. $this->parent->set('extension_message',$msg);
  507. }
  508. return $retval;
  509. }
  510. /**
  511. * Custom discover method
  512. *
  513. * @access public
  514. * @return array(JExtension) list of extensions available
  515. * @since 1.6
  516. */
  517. function discover()
  518. {
  519. $results = Array();
  520. $folder_list = JFolder::folders(JPATH_SITE.DS.'plugins');
  521. foreach ($folder_list as $folder)
  522. {
  523. $file_list = JFolder::files(JPATH_SITE.DS.'plugins'.DS.$folder,'\.xml$');
  524. foreach ($file_list as $file)
  525. {
  526. $file = JFile::stripExt($file);
  527. if ($file == 'example') continue; // ignore example plugins
  528. $extension = &JTable::getInstance('extension');
  529. $extension->set('type', 'plugin');
  530. $extension->set('client_id', 0);
  531. $extension->set('element', $file);
  532. $extension->set('folder', $folder);
  533. $extension->set('name', $file);
  534. $extension->set('state', -1);
  535. $results[] = $extension;
  536. }
  537. $folder_list = JFolder::folders(JPATH_SITE.DS.'plugins'.DS.$folder);
  538. foreach ($folder_list as $plugin_folder)
  539. {
  540. $file_list = JFolder::files(JPATH_SITE.DS.'plugins'.DS.$folder.DS.$plugin_folder,'\.xml$');
  541. foreach ($file_list as $file)
  542. {
  543. $file = JFile::stripExt($file);
  544. if ($file == 'example') continue; // ignore example plugins
  545. $extension = &JTable::getInstance('extension');
  546. $extension->set('type', 'plugin');
  547. $extension->set('client_id', 0);
  548. $extension->set('element', $file);
  549. $extension->set('folder', $folder);
  550. $extension->set('name', $file);
  551. $extension->set('state', -1);
  552. $results[] = $extension;
  553. }
  554. }
  555. }
  556. return $results;
  557. }
  558. /**
  559. * Custom discover_install method
  560. *
  561. * @access public
  562. * @param int $id The id of the extension to install (from #__discoveredextensions)
  563. * @return void
  564. * @since 1.6
  565. */
  566. function discover_install()
  567. {
  568. // Plugins use the extensions table as their primary store
  569. // Similar to modules and templates, rather easy
  570. // If its not in the extensions table we just add it
  571. $client = JApplicationHelper::getClientInfo($this->parent->extension->client_id);
  572. if (is_dir($client->path . DS . 'plugins'. DS . $this->parent->extension->folder . DS . $this->parent->extension->element)) {
  573. $manifestPath = $client->path . DS . 'plugins'. DS . $this->parent->extension->folder . DS . $this->parent->extension->element . DS . $this->parent->extension->element . '.xml';
  574. }
  575. else {
  576. $manifestPath = $client->path . DS . 'plugins'. DS . $this->parent->extension->folder . DS . $this->parent->extension->element . '.xml';
  577. }
  578. $this->parent->manifest = $this->parent->isManifest($manifestPath);
  579. $this->parent->setPath('manifest', $manifestPath);
  580. $manifest_details = JApplicationHelper::parseXMLInstallFile($this->parent->getPath('manifest'));
  581. $this->parent->extension->manifest_cache = serialize($manifest_details);
  582. $this->parent->extension->state = 0;
  583. $this->parent->extension->name = $manifest_details['name'];
  584. $this->parent->extension->enabled = 1;
  585. $this->parent->extension->params = $this->parent->getParams();
  586. if ($this->parent->extension->store()) {
  587. return $this->parent->extension->get('extension_id');
  588. }
  589. else
  590. {
  591. JError::raiseWarning(101, JText::_('Plugin').' '.JText::_('Discover Install').': '.JText::_('Failed to store extension details'));
  592. return false;
  593. }
  594. }
  595. function refreshManifestCache()
  596. {
  597. // Plugins use the extensions table as their primary store
  598. // Similar to modules and templates, rather easy
  599. // If its not in the extensions table we just add it
  600. $client = JApplicationHelper::getClientInfo($this->parent->extension->client_id);
  601. $manifestPath = $client->path . DS . 'plugins'. DS . $this->parent->extension->folder . DS . $this->parent->extension->element . '.xml';
  602. $this->parent->manifest = $this->parent->isManifest($manifestPath);
  603. $this->parent->setPath('manifest', $manifestPath);
  604. $manifest_details = JApplicationHelper::parseXMLInstallFile($this->parent->getPath('manifest'));
  605. $this->parent->extension->manifest_cache = serialize($manifest_details);
  606. $this->parent->extension->name = $manifest_details['name'];
  607. if ($this->parent->extension->store()) {
  608. return true;
  609. }
  610. else
  611. {
  612. JError::raiseWarning(101, JText::_('Plugin').' '.JText::_('Refresh Manifest Cache').': '.JText::_('Failed to store extension details'));
  613. return false;
  614. }
  615. }
  616. }