当前位置: 首页>>代码示例>>PHP>>正文


PHP InstallerModel类代码示例

本文整理汇总了PHP中InstallerModel的典型用法代码示例。如果您正苦于以下问题:PHP InstallerModel类的具体用法?PHP InstallerModel怎么用?PHP InstallerModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了InstallerModel类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: register

 public function register(InputInterface $input, OutputInterface $output)
 {
     $app = Bootstrapper::getApplication($this->target_dir);
     ob_start();
     // build the record.
     $data = new \JObject();
     $data->name = $this->extension;
     $data->type = $this->type;
     $data->element = $this->extension;
     $data->client_id = $input->getOption('client_id');
     $data->enabled = $input->getOption('enabled');
     $data->position = $input->getOption('position');
     $element = $input->getOption('element');
     if (strlen($element)) {
         $data->element = $element;
     }
     // special case for plugin, naming and folder.
     if ($this->type == 'plugin') {
         // set the default folder for plugins only.
         $data->folder = $input->getOption('folder') ? $input->getOption('folder') : 'system';
         // special case for the plugins only.
         if (substr($data->element, 0, 4) == 'plg_') {
             $data->element = substr($data->element, 4);
         }
     }
     if ($this->type == 'template') {
         if (substr($data->name, 0, 4) == 'tpl_') {
             $data->name = substr($data->name, 4);
             $data->element = substr($data->element, 4);
         }
     }
     //need to be sure that a prefix is provided for components and modules
     if (($this->type == "component" || $this->type == "module") && strpos($data->element, '_') === false) {
         $prefix = array_search($this->type, $this->typeMap);
         $data->element = $prefix . $this->extension;
     }
     // get the #__extensions model and table
     require_once JPATH_ADMINISTRATOR . '/components/com_installer/models/extension.php';
     $model = new \InstallerModel();
     $table = $model->getTable('extension', 'JTable');
     // restrict on same name and type
     $unique = array('name' => $data->name, 'type' => $data->type);
     // does the extension exist?
     if (!$table->load($unique)) {
         if ($table->save($data->getProperties())) {
             if (array_key_exists($this->type, $this->exceptions)) {
                 $this->handleExceptions($output, $app, $data, $this->type);
             }
             $output->writeln("<info>Your extension registered as a '{$this->type}', with extension_id: {$table->extension_id}</info>");
         } else {
             $output->writeln("<info>" . $table->getError() . "</info>");
         }
     } else {
         $output->writeln("<error>{$this->extension} {$this->type}: That extension already exists.</error>");
     }
     ob_end_clean();
 }
开发者ID:eitamar,项目名称:joomlatools-console,代码行数:57,代码来源:Register.php

示例2:

	/**
	 * Overridden constructor
	 * @access	protected
	 */
	function __construct()
	{
		global $mainframe;

		// Call the parent constructor
		parent::__construct();
	}
开发者ID:rkern21,项目名称:videoeditor,代码行数:11,代码来源:extension.php

示例3:

 /**
  * Overridden constructor
  * @access	protected
  */
 function __construct()
 {
     global $mainframe;
     // Call the parent constructor
     parent::__construct();
     // Set state variables from the request
     $this->setState('filter.string', $mainframe->getUserStateFromRequest("com_rsgallery2_com_installer.templates.string", 'filter', '', 'string'));
 }
开发者ID:realityking,项目名称:rsgallery2,代码行数:12,代码来源:template.php

示例4:

 /**
  * Overridden constructor
  * @access	protected
  */
 function __construct()
 {
     global $mainframe;
     // Call the parent constructor
     parent::__construct();
     // Set state variables from the request
     $this->setState('filter.string', $mainframe->getUserStateFromRequest("com_installer.languages.string", 'filter', '', 'string'));
     $this->setState('filter.client', $mainframe->getUserStateFromRequest("com_installer.languages.client", 'client', -1, 'int'));
 }
开发者ID:kaantunc,项目名称:MYK-BOR,代码行数:13,代码来源:languages.php

示例5: populateState

 /**
  * Method to auto-populate the model state.
  *
  * Note. Calling getState in this method will result in recursion.
  *
  * @since	1.6
  */
 protected function populateState($ordering = null, $direction = null)
 {
     $app = JFactory::getApplication();
     $this->setState('message', $app->getUserState('com_installer.message'));
     $this->setState('extension_message', $app->getUserState('com_installer.extension_message'));
     $app->setUserState('com_installer.message', '');
     $app->setUserState('com_installer.extension_message', '');
     parent::populateState('name', 'asc');
 }
开发者ID:Joomla-on-NoSQL,项目名称:LaMojo,代码行数:16,代码来源:discover.php

示例6:

 /**
  * Overridden constructor
  * @access	protected
  */
 function __construct()
 {
     global $mainframe;
     // Call the parent constructor
     parent::__construct();
     // Set state variables from the request
     $this->setState('filter.group', $mainframe->getUserStateFromRequest("com_installer.plugins.group", 'group', '', 'cmd'));
     $this->setState('filter.string', $mainframe->getUserStateFromRequest("com_installer.plugins.string", 'filter', '', 'string'));
 }
开发者ID:Fellah,项目名称:govnobaki,代码行数:13,代码来源:plugins.php

示例7: _populateState

 /**
  * Method to auto-populate the model state.
  *
  * This method should only be called once per instantiation and is designed
  * to be called on the first call to the getState() method unless the model
  * configuration flag to ignore the request is set.
  *
  * @since	1.6
  */
 protected function _populateState()
 {
     // Initialise variables.
     $app =& JFactory::getApplication('administrator');
     // Remember the 'Install from Directory' path.
     $path = $app->getUserStateFromRequest($this->_context . '.install_directory', 'install_directory', $app->getCfg('config.tmp_path'));
     $this->setState('install.directory', $path);
     parent::_populateState();
 }
开发者ID:joebushi,项目名称:joomla,代码行数:18,代码来源:install.php

示例8: populateState

 /**
  * Method to auto-populate the model state.
  *
  * Note. Calling getState in this method will result in recursion.
  *
  * @param   string  $ordering   An optional ordering field.
  * @param   string  $direction  An optional direction (asc|desc).
  *
  * @return  void
  *
  * @since   3.4
  */
 protected function populateState($ordering = 'name', $direction = 'asc')
 {
     // Load the filter state.
     $this->setState('filter.search', $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search', '', 'string'));
     $this->setState('filter.client_id', $this->getUserStateFromRequest($this->context . '.filter.client_id', 'filter_client_id', null, 'int'));
     $this->setState('filter.enabled', $this->getUserStateFromRequest($this->context . '.filter.enabled', 'filter_enabled', '', 'string'));
     $this->setState('filter.type', $this->getUserStateFromRequest($this->context . '.filter.type', 'filter_type', '', 'string'));
     $this->setState('filter.folder', $this->getUserStateFromRequest($this->context . '.filter.folder', 'filter_folder', '', 'string'));
     parent::populateState($ordering, $direction);
 }
开发者ID:Rai-Ka,项目名称:joomla-cms,代码行数:22,代码来源:updatesites.php

示例9: populateState

 /**
  * Method to auto-populate the model state.
  *
  * Note. Calling getState in this method will result in recursion.
  *
  * @param   string  $ordering   An optional ordering field.
  * @param   string  $direction  An optional direction (asc|desc).
  *
  * @return  void
  *
  * @since   1.6
  */
 protected function populateState($ordering = null, $direction = null)
 {
     $app = JFactory::getApplication();
     $this->setState('message', $app->getUserState('com_installer.message'));
     $this->setState('extension_message', $app->getUserState('com_installer.extension_message'));
     $app->setUserState('com_installer.message', '');
     $app->setUserState('com_installer.extension_message', '');
     // Prepare the utf8mb4 conversion check table
     $this->prepareUtf8mb4StatusTable();
     parent::populateState('name', 'asc');
 }
开发者ID:adjaika,项目名称:J3Base,代码行数:23,代码来源:database.php

示例10: populateState

 /**
  * Method to auto-populate the model state.
  *
  * Note. Calling getState in this method will result in recursion.
  *
  * @param   string  $ordering   An optional ordering field.
  * @param   string  $direction  An optional direction (asc|desc).
  *
  * @return  void
  *
  * @since   3.1
  */
 protected function populateState($ordering = 'name', $direction = 'asc')
 {
     $app = JFactory::getApplication();
     // Load the filter state.
     $this->setState('filter.search', $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search', '', 'string'));
     $this->setState('filter.client_id', $this->getUserStateFromRequest($this->context . '.filter.client_id', 'filter_client_id', null, 'int'));
     $this->setState('filter.type', $this->getUserStateFromRequest($this->context . '.filter.type', 'filter_type', '', 'string'));
     $this->setState('filter.folder', $this->getUserStateFromRequest($this->context . '.filter.folder', 'filter_folder', '', 'string'));
     $this->setState('message', $app->getUserState('com_installer.message'));
     $this->setState('extension_message', $app->getUserState('com_installer.extension_message'));
     $app->setUserState('com_installer.message', '');
     $app->setUserState('com_installer.extension_message', '');
     parent::populateState($ordering, $direction);
 }
开发者ID:eshiol,项目名称:joomla-cms,代码行数:26,代码来源:discover.php

示例11: populateState

 /**
  * Method to auto-populate the model state.
  *
  * Note. Calling getState in this method will result in recursion.
  *
  * @param   string  $ordering   An optional ordering field.
  * @param   string  $direction  An optional direction (asc|desc).
  *
  * @return  void
  *
  * @since   3.1
  */
 protected function populateState($ordering = null, $direction = null)
 {
     $app = JFactory::getApplication();
     // Load the filter state.
     $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
     $this->setState('filter.search', $search);
     $clientId = $this->getUserStateFromRequest($this->context . '.filter.client_id', 'filter_client_id', '');
     $this->setState('filter.client_id', $clientId);
     $categoryId = $this->getUserStateFromRequest($this->context . '.filter.type', 'filter_type', '');
     $this->setState('filter.type', $categoryId);
     $group = $this->getUserStateFromRequest($this->context . '.filter.group', 'filter_group', '');
     $this->setState('filter.group', $group);
     $this->setState('message', $app->getUserState('com_installer.message'));
     $this->setState('extension_message', $app->getUserState('com_installer.extension_message'));
     $app->setUserState('com_installer.message', '');
     $app->setUserState('com_installer.extension_message', '');
     parent::populateState('name', 'asc');
 }
开发者ID:01J,项目名称:skazkipronebo,代码行数:30,代码来源:discover.php

示例12: populateState

 /**
  * Method to auto-populate the model state.
  *
  * Note. Calling getState in this method will result in recursion.
  *
  * @since	1.6
  */
 protected function populateState($ordering = null, $direction = null)
 {
     // Initialise variables.
     $app = JFactory::getApplication();
     $filters = JRequest::getVar('filters');
     if (empty($filters)) {
         $data = $app->getUserState($this->context . '.data');
         $filters = $data['filters'];
     } else {
         $app->setUserState($this->context . '.data', array('filters' => $filters));
     }
     $this->setState('message', $app->getUserState('com_installer.message'));
     $this->setState('extension_message', $app->getUserState('com_installer.extension_message'));
     $app->setUserState('com_installer.message', '');
     $app->setUserState('com_installer.extension_message', '');
     $this->setState('filter.search', isset($filters['search']) ? $filters['search'] : '');
     $this->setState('filter.status', isset($filters['status']) ? $filters['status'] : '');
     $this->setState('filter.type', isset($filters['type']) ? $filters['type'] : '');
     $this->setState('filter.group', isset($filters['group']) ? $filters['group'] : '');
     $this->setState('filter.client_id', isset($filters['client_id']) ? $filters['client_id'] : '');
     parent::populateState('name', 'asc');
 }
开发者ID:acculitx,项目名称:fleetmatrixsite,代码行数:29,代码来源:manage.php

示例13:

 /**
  * Overridden constructor
  * @access	protected
  */
 function __construct()
 {
     // Call the parent constructor
     parent::__construct();
 }
开发者ID:sangkasi,项目名称:joomla,代码行数:9,代码来源:language.php

示例14: _getList

 /**
  * Returns an object list
  *
  * @param   string  $query       The query
  * @param   int     $limitstart  Offset
  * @param   int     $limit       The number of records
  *
  * @return  array
  *
  * @since   3.4
  */
 protected function _getList($query, $limitstart = 0, $limit = 0)
 {
     $ordering = $this->getState('list.ordering');
     $search = $this->getState('filter.search');
     // Replace slashes so preg_match will work
     $search = str_replace('/', ' ', $search);
     $db = $this->getDbo();
     if ($ordering == 'name' || !empty($search) && stripos($search, 'id:') !== 0) {
         $db->setQuery($query);
         $result = $db->loadObjectList();
         $this->translate($result);
         if (!empty($search) && stripos($search, 'id:') !== 0) {
             foreach ($result as $i => $item) {
                 if (!preg_match("/{$search}/i", $item->name) && !preg_match("/{$search}/i", $item->update_site_name)) {
                     unset($result[$i]);
                 }
             }
         }
         JArrayHelper::sortObjects($result, $this->getState('list.ordering'), $this->getState('list.direction') == 'desc' ? -1 : 1, true, true);
         $total = count($result);
         $this->cache[$this->getStoreId('getTotal')] = $total;
         if ($total < $limitstart) {
             $limitstart = 0;
             $this->setState('list.start', 0);
         }
         return array_slice($result, $limitstart, $limit ? $limit : null);
     }
     $query->order($db->quoteName($ordering) . ' ' . $this->getState('list.direction'));
     $result = parent::_getList($query, $limitstart, $limit);
     $this->translate($result);
     return $result;
 }
开发者ID:klas,项目名称:joomla-cms,代码行数:43,代码来源:updatesites.php


注:本文中的InstallerModel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。