Source for file manifest.php

Documentation is available at manifest.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Libraries
  4.  * @subpackage  Installer
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE
  8.  */
  9.  
  10. defined('JPATH_PLATFORM'or die;
  11.  
  12. jimport('joomla.filesystem.file');
  13.  
  14. /**
  15.  * Joomla! Package Manifest File
  16.  *
  17.  * @package     Joomla.Libraries
  18.  * @subpackage  Installer
  19.  * @since       3.1
  20.  */
  21. abstract class JInstallerManifest
  22. {
  23.     /**
  24.      * Path to the manifest file
  25.      *
  26.      * @var    string 
  27.      * @since  3.1
  28.      */
  29.     public $manifest_file = '';
  30.  
  31.     /**
  32.      * Name of the extension
  33.      *
  34.      * @var    string 
  35.      * @since  3.1
  36.      */
  37.     public $name = '';
  38.  
  39.     /**
  40.      * Version of the extension
  41.      *
  42.      * @var    string 
  43.      * @since  3.1
  44.      */
  45.     public $version = '';
  46.  
  47.     /**
  48.      * Description of the extension
  49.      *
  50.      * @var    string 
  51.      * @since  3.1
  52.      */
  53.     public $description = '';
  54.  
  55.     /**
  56.      * Packager of the extension
  57.      *
  58.      * @var    string 
  59.      * @since  3.1
  60.      */
  61.     public $packager = '';
  62.  
  63.     /**
  64.      * Packager's URL of the extension
  65.      *
  66.      * @var    string 
  67.      * @since  3.1
  68.      */
  69.     public $packagerurl = '';
  70.  
  71.     /**
  72.      * Update site for the extension
  73.      *
  74.      * @var    string 
  75.      * @since  3.1
  76.      */
  77.     public $update = '';
  78.  
  79.     /**
  80.      * List of files in the extension
  81.      *
  82.      * @var    array 
  83.      * @since  3.1
  84.      */
  85.     public $filelist = array();
  86.  
  87.     /**
  88.      * Constructor
  89.      *
  90.      * @param   string  $xmlpath  Path to XML manifest file.
  91.      *
  92.      * @since   3.1
  93.      */
  94.     public function __construct($xmlpath '')
  95.     {
  96.         if (strlen($xmlpath))
  97.         {
  98.             $this->loadManifestFromXML($xmlpath);
  99.         }
  100.     }
  101.  
  102.     /**
  103.      * Load a manifest from a file
  104.      *
  105.      * @param   string  $xmlfile  Path to file to load
  106.      *
  107.      * @return  boolean 
  108.      *
  109.      * @since   3.1
  110.      */
  111.     public function loadManifestFromXML($xmlfile)
  112.     {
  113.         $this->manifest_file = basename($xmlfile'.xml');
  114.  
  115.         $xml simplexml_load_file($xmlfile);
  116.  
  117.         if (!$xml)
  118.         {
  119.             $this->_errors[JText::sprintf('JLIB_INSTALLER_ERROR_LOAD_XML'$xmlfile);
  120.  
  121.             return false;
  122.         }
  123.         else
  124.         {
  125.             $this->loadManifestFromData($xml);
  126.  
  127.             return true;
  128.         }
  129.     }
  130.  
  131.     /**
  132.      * Apply manifest data from a SimpleXMLElement to the object.
  133.      *
  134.      * @param   SimpleXMLElement  $xml  Data to load
  135.      *
  136.      * @return  void 
  137.      *
  138.      * @since   3.1
  139.      */
  140.     abstract protected function loadManifestFromData(SimpleXmlElement $xml);
  141. }

Documentation generated on Tue, 19 Nov 2013 15:07:35 +0100 by phpDocumentor 1.4.3