Source for file extension.php

Documentation is available at extension.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. /**
  13.  * Extension object
  14.  *
  15.  * @package     Joomla.Libraries
  16.  * @subpackage  Installer
  17.  * @since       3.1
  18.  */
  19. class JInstallerExtension extends JObject
  20. {
  21.     /**
  22.      * Filename of the extension
  23.      *
  24.      * @var    string 
  25.      * @since  3.1
  26.      */
  27.     public $filename = '';
  28.  
  29.     /**
  30.      * Type of the extension
  31.      *
  32.      * @var    string 
  33.      * @since  3.1
  34.      */
  35.     public $type = '';
  36.  
  37.     /**
  38.      * Unique Identifier for the extension
  39.      *
  40.      * @var    string 
  41.      * @since  3.1
  42.      */
  43.     public $id = '';
  44.  
  45.     /**
  46.      * The status of the extension
  47.      *
  48.      * @var    boolean 
  49.      * @since  3.1
  50.      */
  51.     public $published = false;
  52.  
  53.     /**
  54.      * String representation of client. Valid for modules, templates and languages.
  55.      * Set by default to site.
  56.      *
  57.      * @var    string 
  58.      * @since  3.1
  59.      */
  60.     public $client = 'site';
  61.  
  62.     /**
  63.      * The group name of the plugin. Not used for other known extension types (only plugins)
  64.      *
  65.      * @var string 
  66.      * @since  3.1
  67.      */
  68.     public $group = '';
  69.  
  70.     /**
  71.      * An object representation of the manifest file stored metadata
  72.      *
  73.      * @var object 
  74.      * @since  3.1
  75.      */
  76.     public $manifest_cache = null;
  77.  
  78.     /**
  79.      * An object representation of the extension params
  80.      *
  81.      * @var    object 
  82.      * @since  3.1
  83.      */
  84.     public $params = null;
  85.  
  86.     /**
  87.      * Constructor
  88.      *
  89.      * @param   SimpleXMLElement  $element  A SimpleXMLElement from which to load data from
  90.      *
  91.      * @since  3.1
  92.      */
  93.     public function __construct(SimpleXMLElement $element null)
  94.     {
  95.         if ($element)
  96.         {
  97.             $this->type = (string) $element->attributes()->type;
  98.             $this->id = (string) $element->attributes()->id;
  99.  
  100.             switch ($this->type)
  101.             {
  102.                 case 'component':
  103.                     // By default a component doesn't have anything
  104.                     break;
  105.  
  106.                 case 'module':
  107.                 case 'template':
  108.                 case 'language':
  109.                     $this->client = (string) $element->attributes()->client;
  110.                     $tmp_client_id JApplicationHelper::getClientInfo($this->client1);
  111.  
  112.                     if ($tmp_client_id == null)
  113.                     {
  114.                         JLog::add(JText::_('JLIB_INSTALLER_ERROR_EXTENSION_INVALID_CLIENT_IDENTIFIER')JLog::WARNING'jerror');
  115.                     }
  116.                     else
  117.                     {
  118.                         $this->client_id $tmp_client_id->id;
  119.                     }
  120.                     break;
  121.  
  122.                 case 'plugin':
  123.                     $this->group = (string) $element->attributes()->group;
  124.                     break;
  125.  
  126.                 default:
  127.                     // Catch all
  128.                     // Get and set client and group if we don't recognise the extension
  129.                     if ($element->attributes()->client)
  130.                     {
  131.                         $this->client_id JApplicationHelper::getClientInfo($this->client1);
  132.                         $this->client_id $this->client_id->id;
  133.                     }
  134.                     if ($element->attributes()->group)
  135.                     {
  136.                         $this->group = (string) $element->attributes()->group;
  137.                     }
  138.                     break;
  139.             }
  140.             $this->filename = (string) $element;
  141.         }
  142.     }
  143. }
  144.  
  145. /**
  146.  * Deprecated class placeholder. You should use JInstallerExtension instead.
  147.  *
  148.  * @package     Joomla.Libraries
  149.  * @subpackage  Installer
  150.  * @since       3.1
  151.  * @deprecated  4.0
  152.  * @codeCoverageIgnore
  153.  */
  154. {
  155.     /**
  156.      * Constructor
  157.      *
  158.      * @param   SimpleXMLElement  $element  A SimpleXMLElement from which to load data from
  159.      *
  160.      * @since  3.1
  161.      */
  162.     public function __construct(SimpleXMLElement $element null)
  163.     {
  164.         parent::__construct($element);
  165.     }
  166. }

Documentation generated on Tue, 19 Nov 2013 15:02:43 +0100 by phpDocumentor 1.4.3