本文整理汇总了PHP中SEFTools::getDefaultParams方法的典型用法代码示例。如果您正苦于以下问题:PHP SEFTools::getDefaultParams方法的具体用法?PHP SEFTools::getDefaultParams怎么用?PHP SEFTools::getDefaultParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SEFTools
的用法示例。
在下文中一共展示了SEFTools::getDefaultParams方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
//.........这里部分代码省略.........
$query .= "WHERE update_site_id=" . $id;
$db->setQuery($query);
$cnt = $db->loadResult();
if ($cnt) {
$query = "UPDATE #__update_sites_extensions \n";
$query .= "SET extension_id=" . $ext_table->extension_id . " \n";
$query .= "WHERE update_site_id=" . $id;
} else {
$query = "INSERT INTO #__update_sites_extensions SET update_site_id=" . $id . ", extension_id=" . $ext_table->extension_id . " \n";
}
$db->setQuery($query);
$db->query();
}
}
//Add existing extensions to Joomla extensions table
$list = JFolder::files(JPATH_SITE . '/components/com_sef/sef_ext');
foreach ($list as $sef) {
if (substr($sef, -4) != '.xml') {
continue;
}
$xml_file = JPATH_SITE . '/components/com_sef/sef_ext/' . $sef;
if (file_exists($ext_update_dir . $sef)) {
$xml_file = $ext_update_dir . $sef;
}
$xml = simplexml_load_file($xml_file);
$element = $this->getElement($xml);
$query = "SELECT COUNT(*) FROM #__extensions WHERE type=" . $db->quote('sef_ext') . " AND element=" . $db->quote($element);
$db->setQuery($query);
$cnt = $db->loadResult();
if ($cnt > 0) {
continue;
}
$ext_table = JTable::getInstance('extension');
$ext_table->name = (string) $xml->name;
$ext_table->type = 'sef_ext';
$ext_table->element = $element;
$ext_table->enabled = 1;
$ext_table->protected = 0;
$ext_table->access = 1;
$ext_table->client_id = 0;
if (isset($xml->install->defaultparams)) {
$ext_table->params = SEFTools::getDefaultParams((string) $xml->install->defaultparams);
}
if (isset($xml->install->defaultfilters)) {
$ext_table->custom_data = SEFTools::getDefaultFilters((string) $xml->install->defaultfilters);
}
$ext_table->manifest_cache = json_encode(JApplicationHelper::parseXMLInstallFile($xml_file));
$ext_table->store();
$query = "INSERT INTO #__schemas SET extension_id=" . $ext_table->extension_id . ", version_id=" . $db->quote((string) $xml->version);
$db->setQuery($query);
$db->query();
if (isset($xml->updateservers->server)) {
$query = "INSERT INTO #__update_sites SET name=" . $db->quote((string) $xml->updateservers->server['name']) . ", type=" . $db->quote((string) $xml->updateservers->server['type']) . ", \n";
$query .= "location=" . $db->quote((string) $xml->updateservers->server) . ", enabled=1 \n";
$db->setQuery($query);
$db->query();
$id = $db->insertId();
$query = "INSERT INTO #__update_sites_extensions SET update_site_id=" . $id . ", extension_id=" . $ext_table->extension_id . " \n";
$db->setQuery($query);
$db->query();
}
}
$fields = $db->getTableColumns('#__sefurls');
$fields = array_keys($fields);
if (!in_array('metaauthor', $fields)) {
$query = "ALTER TABLE #__sefurls \n";
$query .= "ADD (metaauthor varchar(30) default '') \n";
$db->setQuery($query);
$db->query();
}
// 30.11.2012 dajo: Move stored configuration from params to custom_data field
$db->setQuery("UPDATE `#__extensions` SET `custom_data` = `params` WHERE `type` = 'component' AND `element` = 'com_sef' AND (`custom_data` IS NULL OR `custom_data` = '') LIMIT 1");
$db->query();
// 2.1.2013 dajo: Remove left-over file
if (JFile::exists(JPATH_ADMINISTRATOR . '/components/com_sef/tables/extension.php')) {
JFile::delete(JPATH_ADMINISTRATOR . '/components/com_sef/tables/extension.php');
}
ob_start();
$tmp_path = JFactory::getApplication()->getCfg('tmp_path');
if (JFile::exists($tmp_path . '/joomsef-configuration.php')) {
require_once $tmp_path . '/joomsef-configuration.php';
}
if (isset($artioDownloadId) && strlen($artioDownloadId)) {
$query = "SELECT location FROM #__update_sites \n";
$query .= "WHERE name=" . $db->quote('com_joomsef');
$db->setQuery($query);
$location = $db->loadResult();
if (!preg_match("/(-([A-Za-z0-9]*)).xml/", $location)) {
?>
<p class="message">
It was found, that you have an commercial version of Artio JoomSEF and you dont have migrated your download id. Please finish upgrade by clicking <a href="index.php?option=com_sef&task=finish_upgrade">here</a>
</p>
<?php
}
}
$output = ob_get_contents();
ob_end_clean();
echo $output;
return true;
}
示例2: discover_install
function discover_install()
{
$option = str_replace('ext_joomsef4_', 'com_', $this->parent->extension->element);
$manifest_path = JPATH_ROOT . '/components/com_sef/sef_ext/' . $option . '.xml';
$this->parent->manifest = $this->parent->isManifest($manifest_path);
if (!is_object($this->parent->manifest)) {
JError::raiseWarning(101, JText::_('COM_SEF_INSTALLER_ERROR_SEF_DISCOVER_STORE_DETAILS'));
return false;
}
$description = (string) $this->parent->manifest->description;
if ($description) {
$this->parent->set('message', $description);
} else {
$this->parent->set('message');
}
$this->parent->setPath('manifest', $manifest_path);
$manifest_details = JApplicationHelper::parseXMLInstallFile($this->parent->getPath('manifest'));
$this->parent->extension->manifest_cache = json_encode($manifest_details);
$this->parent->extension->state = 0;
$this->parent->extension->name = $manifest_details['name'];
$this->parent->extension->enabled = 1;
if (isset($this->manifest->install->defaultparams)) {
$this->parent->extension->params = SEFTools::getDefaultParams((string) $this->manifest->install->defaultparams);
}
if (isset($this->manigest->install->defaultfilters)) {
$this->parent->extension->custom_data = SEFTools::getDefaultFilters((string) $this->manigest->install->defaultfilters);
}
if ($this->parent->extension->store()) {
return $this->parent->extension->get('extension_id');
} else {
JError::raiseWarning(101, JText::_('COM_SEF_INSTALLER_ERROR_SEF_DISCOVER_STORE_DETAILS'));
return false;
}
$utfresult = $this->parent->parseSQLFiles($this->manifest->install->sql);
if ($utfresult === false) {
JError::raiseWarning(JText::sprintf('COM_SEF_INSTALLER_ABORT_SEF_INSTALL_SQL_ERROR', JText::_('JLIB_INSTALLER_' . $this->route), $db->stderr(true)));
return false;
}
if ($this->manifest->update) {
$this->parent->setSchemaVersion($this->manifest->update->schemas, $row->extension_id);
}
}