本文整理匯總了PHP中JInstaller::refreshManifestCache方法的典型用法代碼示例。如果您正苦於以下問題:PHP JInstaller::refreshManifestCache方法的具體用法?PHP JInstaller::refreshManifestCache怎麽用?PHP JInstaller::refreshManifestCache使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JInstaller
的用法示例。
在下文中一共展示了JInstaller::refreshManifestCache方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: updateManifestCaches
/**
* Update the manifest caches
*
* @return void
*/
protected function updateManifestCaches()
{
$extensions = array(array('component', 'com_mailto', '', 0), array('component', 'com_wrapper', '', 0), array('component', 'com_admin', '', 1), array('component', 'com_ajax', '', 1), array('component', 'com_banners', '', 1), array('component', 'com_cache', '', 1), array('component', 'com_categories', '', 1), array('component', 'com_checkin', '', 1), array('component', 'com_contact', '', 1), array('component', 'com_cpanel', '', 1), array('component', 'com_installer', '', 1), array('component', 'com_languages', '', 1), array('component', 'com_login', '', 1), array('component', 'com_media', '', 1), array('component', 'com_menus', '', 1), array('component', 'com_messages', '', 1), array('component', 'com_modules', '', 1), array('component', 'com_newsfeeds', '', 1), array('component', 'com_plugins', '', 1), array('component', 'com_search', '', 1), array('component', 'com_templates', '', 1), array('component', 'com_content', '', 1), array('component', 'com_config', '', 1), array('component', 'com_redirect', '', 1), array('component', 'com_users', '', 1), array('component', 'com_finder', '', 1), array('component', 'com_tags', '', 1), array('component', 'com_contenthistory', '', 1), array('component', 'com_postinstall', '', 1), array('component', 'com_joomlaupdate', '', 1), array('library', 'phputf8', '', 0), array('library', 'joomla', '', 0), array('library', 'idna_convert', '', 0), array('library', 'fof', '', 0), array('library', 'phpass', '', 0), array('module', 'mod_articles_archive', '', 0), array('module', 'mod_articles_latest', '', 0), array('module', 'mod_articles_popular', '', 0), array('module', 'mod_banners', '', 0), array('module', 'mod_breadcrumbs', '', 0), array('module', 'mod_custom', '', 0), array('module', 'mod_feed', '', 0), array('module', 'mod_footer', '', 0), array('module', 'mod_login', '', 0), array('module', 'mod_menu', '', 0), array('module', 'mod_articles_news', '', 0), array('module', 'mod_random_image', '', 0), array('module', 'mod_related_items', '', 0), array('module', 'mod_search', '', 0), array('module', 'mod_stats', '', 0), array('module', 'mod_syndicate', '', 0), array('module', 'mod_users_latest', '', 0), array('module', 'mod_whosonline', '', 0), array('module', 'mod_wrapper', '', 0), array('module', 'mod_articles_category', '', 0), array('module', 'mod_articles_categories', '', 0), array('module', 'mod_languages', '', 0), array('module', 'mod_tags_popular', '', 0), array('module', 'mod_tags_similar', '', 0), array('module', 'mod_custom', '', 1), array('module', 'mod_feed', '', 1), array('module', 'mod_latest', '', 1), array('module', 'mod_logged', '', 1), array('module', 'mod_login', '', 1), array('module', 'mod_menu', '', 1), array('module', 'mod_popular', '', 1), array('module', 'mod_quickicon', '', 1), array('module', 'mod_stats_admin', '', 1), array('module', 'mod_status', '', 1), array('module', 'mod_submenu', '', 1), array('module', 'mod_title', '', 1), array('module', 'mod_toolbar', '', 1), array('module', 'mod_multilangstatus', '', 1), array('plugin', 'gmail', 'authentication', 0), array('plugin', 'joomla', 'authentication', 0), array('plugin', 'ldap', 'authentication', 0), array('plugin', 'contact', 'content', 0), array('plugin', 'emailcloak', 'content', 0), array('plugin', 'loadmodule', 'content', 0), array('plugin', 'pagebreak', 'content', 0), array('plugin', 'pagenavigation', 'content', 0), array('plugin', 'vote', 'content', 0), array('plugin', 'codemirror', 'editors', 0), array('plugin', 'none', 'editors', 0), array('plugin', 'tinymce', 'editors', 0), array('plugin', 'article', 'editors-xtd', 0), array('plugin', 'image', 'editors-xtd', 0), array('plugin', 'pagebreak', 'editors-xtd', 0), array('plugin', 'readmore', 'editors-xtd', 0), array('plugin', 'categories', 'search', 0), array('plugin', 'contacts', 'search', 0), array('plugin', 'content', 'search', 0), array('plugin', 'newsfeeds', 'search', 0), array('plugin', 'tags', 'search', 0), array('plugin', 'languagefilter', 'system', 0), array('plugin', 'p3p', 'system', 0), array('plugin', 'cache', 'system', 0), array('plugin', 'debug', 'system', 0), array('plugin', 'log', 'system', 0), array('plugin', 'redirect', 'system', 0), array('plugin', 'remember', 'system', 0), array('plugin', 'sef', 'system', 0), array('plugin', 'logout', 'system', 0), array('plugin', 'contactcreator', 'user', 0), array('plugin', 'joomla', 'user', 0), array('plugin', 'profile', 'user', 0), array('plugin', 'joomla', 'extension', 0), array('plugin', 'joomla', 'content', 0), array('plugin', 'languagecode', 'system', 0), array('plugin', 'joomlaupdate', 'quickicon', 0), array('plugin', 'extensionupdate', 'quickicon', 0), array('plugin', 'recaptcha', 'captcha', 0), array('plugin', 'categories', 'finder', 0), array('plugin', 'contacts', 'finder', 0), array('plugin', 'content', 'finder', 0), array('plugin', 'newsfeeds', 'finder', 0), array('plugin', 'tags', 'finder', 0), array('plugin', 'totp', 'twofactorauth', 0), array('plugin', 'yubikey', 'twofactorauth', 0), array('plugin', 'updatenotification', 'system', 0), array('plugin', 'module', 'editors-xtd', 0), array('plugin', 'stats', 'system', 0), array('plugin', 'packageinstaller', 'installer', 0), array('plugin', 'folderinstaller', 'installer', 0), array('plugin', 'urlinstaller', 'installer', 0), array('plugin', 'phpversioncheck', 'quickicon', 0), array('plugin', 'menu', 'editors-xtd', 0), array('plugin', 'contact', 'editors-xtd', 0), array('template', 'beez3', '', 0), array('template', 'hathor', '', 1), array('template', 'protostar', '', 0), array('template', 'isis', '', 1), array('language', 'en-GB', '', 0), array('language', 'en-GB', '', 1), array('file', 'joomla', '', 0), array('package', 'pkg_en-GB', '', 0));
// Attempt to refresh manifest caches
$db = JFactory::getDbo();
$query = $db->getQuery(true)->select('*')->from('#__extensions');
foreach ($extensions as $extension) {
$query->where('type=' . $db->quote($extension[0]) . ' AND element=' . $db->quote($extension[1]) . ' AND folder=' . $db->quote($extension[2]) . ' AND client_id=' . $extension[3], 'OR');
}
$db->setQuery($query);
try {
$extensions = $db->loadObjectList();
} catch (Exception $e) {
echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $e->getCode(), $e->getMessage()) . '<br />';
return;
}
$installer = new JInstaller();
foreach ($extensions as $extension) {
if (!$installer->refreshManifestCache($extension->extension_id)) {
echo JText::sprintf('FILES_JOOMLA_ERROR_MANIFEST', $extension->type, $extension->element, $extension->name, $extension->client_id) . '<br />';
}
}
}
示例2: updateManifestCaches
//.........這裏部分代碼省略.........
$extensions[] = array('module', 'mod_related_items', '', 0);
$extensions[] = array('module', 'mod_search', '', 0);
$extensions[] = array('module', 'mod_stats', '', 0);
$extensions[] = array('module', 'mod_syndicate', '', 0);
$extensions[] = array('module', 'mod_users_latest', '', 0);
$extensions[] = array('module', 'mod_weblinks', '', 0);
$extensions[] = array('module', 'mod_whosonline', '', 0);
$extensions[] = array('module', 'mod_wrapper', '', 0);
$extensions[] = array('module', 'mod_articles_category', '', 0);
$extensions[] = array('module', 'mod_articles_categories', '', 0);
$extensions[] = array('module', 'mod_languages', '', 0);
// Administrator
$extensions[] = array('module', 'mod_custom', '', 1);
$extensions[] = array('module', 'mod_feed', '', 1);
$extensions[] = array('module', 'mod_latest', '', 1);
$extensions[] = array('module', 'mod_logged', '', 1);
$extensions[] = array('module', 'mod_login', '', 1);
$extensions[] = array('module', 'mod_menu', '', 1);
$extensions[] = array('module', 'mod_popular', '', 1);
$extensions[] = array('module', 'mod_quickicon', '', 1);
$extensions[] = array('module', 'mod_status', '', 1);
$extensions[] = array('module', 'mod_submenu', '', 1);
$extensions[] = array('module', 'mod_title', '', 1);
$extensions[] = array('module', 'mod_toolbar', '', 1);
$extensions[] = array('module', 'mod_multilangstatus', '', 1);
// Plug-ins
$extensions[] = array('plugin', 'gmail', 'authentication', 0);
$extensions[] = array('plugin', 'joomla', 'authentication', 0);
$extensions[] = array('plugin', 'ldap', 'authentication', 0);
$extensions[] = array('plugin', 'emailcloak', 'content', 0);
$extensions[] = array('plugin', 'geshi', 'content', 0);
$extensions[] = array('plugin', 'loadmodule', 'content', 0);
$extensions[] = array('plugin', 'pagebreak', 'content', 0);
$extensions[] = array('plugin', 'pagenavigation', 'content', 0);
$extensions[] = array('plugin', 'vote', 'content', 0);
$extensions[] = array('plugin', 'codemirror', 'editors', 0);
$extensions[] = array('plugin', 'none', 'editors', 0);
$extensions[] = array('plugin', 'tinymce', 'editors', 0);
$extensions[] = array('plugin', 'article', 'editors-xtd', 0);
$extensions[] = array('plugin', 'image', 'editors-xtd', 0);
$extensions[] = array('plugin', 'pagebreak', 'editors-xtd', 0);
$extensions[] = array('plugin', 'readmore', 'editors-xtd', 0);
$extensions[] = array('plugin', 'categories', 'search', 0);
$extensions[] = array('plugin', 'contacts', 'search', 0);
$extensions[] = array('plugin', 'content', 'search', 0);
$extensions[] = array('plugin', 'newsfeeds', 'search', 0);
$extensions[] = array('plugin', 'weblinks', 'search', 0);
$extensions[] = array('plugin', 'languagefilter', 'system', 0);
$extensions[] = array('plugin', 'p3p', 'system', 0);
$extensions[] = array('plugin', 'cache', 'system', 0);
$extensions[] = array('plugin', 'debug', 'system', 0);
$extensions[] = array('plugin', 'log', 'system', 0);
$extensions[] = array('plugin', 'redirect', 'system', 0);
$extensions[] = array('plugin', 'remember', 'system', 0);
$extensions[] = array('plugin', 'sef', 'system', 0);
$extensions[] = array('plugin', 'logout', 'system', 0);
$extensions[] = array('plugin', 'contactcreator', 'user', 0);
$extensions[] = array('plugin', 'joomla', 'user', 0);
$extensions[] = array('plugin', 'profile', 'user', 0);
$extensions[] = array('plugin', 'joomla', 'extension', 0);
$extensions[] = array('plugin', 'joomla', 'content', 0);
$extensions[] = array('plugin', 'languagecode', 'system', 0);
$extensions[] = array('plugin', 'joomlaupdate', 'quickicon', 0);
$extensions[] = array('plugin', 'extensionupdate', 'quickicon', 0);
$extensions[] = array('plugin', 'recaptcha', 'captcha', 0);
// Templates
$extensions[] = array('template', 'atomic', '', 0);
$extensions[] = array('template', 'bluestork', '', 1);
$extensions[] = array('template', 'beez_20', '', 0);
$extensions[] = array('template', 'hathor', '', 1);
$extensions[] = array('template', 'beez5', '', 0);
// Languages
$extensions[] = array('language', 'en-GB', '', 0);
$extensions[] = array('language', 'en-GB', '', 1);
// Files
$extensions[] = array('file', 'joomla', '', 0);
// Packages
$extensions[] = array('package', 'pkg_joomla', '', 0);
// Attempt to refresh manifest caches
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('*');
$query->from('#__extensions');
foreach ($extensions as $extension) {
$query->where('type=' . $db->quote($extension[0]) . ' AND element=' . $db->quote($extension[1]) . ' AND folder=' . $db->quote($extension[2]) . ' AND client_id=' . $extension[3], 'OR');
}
$db->setQuery($query);
$extensions = $db->loadObjectList();
$installer = new JInstaller();
// Check for a database error.
if ($db->getErrorNum()) {
echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $db->getErrorNum(), $db->getErrorMsg()) . '<br />';
return;
}
foreach ($extensions as $extension) {
if (!$installer->refreshManifestCache($extension->extension_id)) {
echo JText::sprintf('FILES_JOOMLA_ERROR_MANIFEST', $extension->type, $extension->element, $extension->name, $extension->client_id) . '<br />';
}
}
}
示例3: updateManifestCaches
//.........這裏部分代碼省略.........
$extensions[] = array('module', 'mod_related_items', '', 0);
$extensions[] = array('module', 'mod_search', '', 0);
$extensions[] = array('module', 'mod_stats', '', 0);
$extensions[] = array('module', 'mod_syndicate', '', 0);
$extensions[] = array('module', 'mod_users_latest', '', 0);
$extensions[] = array('module', 'mod_weblinks', '', 0);
$extensions[] = array('module', 'mod_whosonline', '', 0);
$extensions[] = array('module', 'mod_wrapper', '', 0);
$extensions[] = array('module', 'mod_articles_category', '', 0);
$extensions[] = array('module', 'mod_articles_categories', '', 0);
$extensions[] = array('module', 'mod_languages', '', 0);
// Administrator
$extensions[] = array('module', 'mod_custom', '', 1);
$extensions[] = array('module', 'mod_feed', '', 1);
$extensions[] = array('module', 'mod_latest', '', 1);
$extensions[] = array('module', 'mod_logged', '', 1);
$extensions[] = array('module', 'mod_login', '', 1);
$extensions[] = array('module', 'mod_menu', '', 1);
$extensions[] = array('module', 'mod_popular', '', 1);
$extensions[] = array('module', 'mod_quickicon', '', 1);
$extensions[] = array('module', 'mod_stats_admin', '', 1);
$extensions[] = array('module', 'mod_status', '', 1);
$extensions[] = array('module', 'mod_submenu', '', 1);
$extensions[] = array('module', 'mod_title', '', 1);
$extensions[] = array('module', 'mod_toolbar', '', 1);
$extensions[] = array('module', 'mod_multilangstatus', '', 1);
// Plug-ins
$extensions[] = array('plugin', 'gmail', 'authentication', 0);
$extensions[] = array('plugin', 'joomla', 'authentication', 0);
$extensions[] = array('plugin', 'ldap', 'authentication', 0);
$extensions[] = array('plugin', 'emailcloak', 'content', 0);
$extensions[] = array('plugin', 'geshi', 'content', 0);
$extensions[] = array('plugin', 'loadmodule', 'content', 0);
$extensions[] = array('plugin', 'pagebreak', 'content', 0);
$extensions[] = array('plugin', 'pagenavigation', 'content', 0);
$extensions[] = array('plugin', 'vote', 'content', 0);
$extensions[] = array('plugin', 'codemirror', 'editors', 0);
$extensions[] = array('plugin', 'none', 'editors', 0);
$extensions[] = array('plugin', 'tinymce', 'editors', 0);
$extensions[] = array('plugin', 'article', 'editors-xtd', 0);
$extensions[] = array('plugin', 'image', 'editors-xtd', 0);
$extensions[] = array('plugin', 'pagebreak', 'editors-xtd', 0);
$extensions[] = array('plugin', 'readmore', 'editors-xtd', 0);
$extensions[] = array('plugin', 'categories', 'search', 0);
$extensions[] = array('plugin', 'contacts', 'search', 0);
$extensions[] = array('plugin', 'content', 'search', 0);
$extensions[] = array('plugin', 'newsfeeds', 'search', 0);
$extensions[] = array('plugin', 'weblinks', 'search', 0);
$extensions[] = array('plugin', 'languagefilter', 'system', 0);
$extensions[] = array('plugin', 'p3p', 'system', 0);
$extensions[] = array('plugin', 'cache', 'system', 0);
$extensions[] = array('plugin', 'debug', 'system', 0);
$extensions[] = array('plugin', 'log', 'system', 0);
$extensions[] = array('plugin', 'redirect', 'system', 0);
$extensions[] = array('plugin', 'remember', 'system', 0);
$extensions[] = array('plugin', 'sef', 'system', 0);
$extensions[] = array('plugin', 'logout', 'system', 0);
$extensions[] = array('plugin', 'contactcreator', 'user', 0);
$extensions[] = array('plugin', 'joomla', 'user', 0);
$extensions[] = array('plugin', 'profile', 'user', 0);
$extensions[] = array('plugin', 'joomla', 'extension', 0);
$extensions[] = array('plugin', 'joomla', 'content', 0);
$extensions[] = array('plugin', 'languagecode', 'system', 0);
$extensions[] = array('plugin', 'joomlaupdate', 'quickicon', 0);
$extensions[] = array('plugin', 'extensionupdate', 'quickicon', 0);
$extensions[] = array('plugin', 'recaptcha', 'captcha', 0);
// Templates
$extensions[] = array('template', 'beez3', '', 0);
$extensions[] = array('template', 'hathor', '', 1);
$extensions[] = array('template', 'protostar', '', 0);
$extensions[] = array('template', 'isis', '', 1);
// Languages
$extensions[] = array('language', 'en-GB', '', 0);
$extensions[] = array('language', 'en-GB', '', 1);
// Files
$extensions[] = array('file', 'joomla', '', 0);
// Packages
// None in core at this time
// Attempt to refresh manifest caches
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('*');
$query->from('#__extensions');
foreach ($extensions as $extension) {
$query->where('type=' . $db->quote($extension[0]) . ' AND element=' . $db->quote($extension[1]) . ' AND folder=' . $db->quote($extension[2]) . ' AND client_id=' . $extension[3], 'OR');
}
$db->setQuery($query);
$extensions = $db->loadObjectList();
$installer = new JInstaller();
// Check for a database error.
if ($db->getErrorNum()) {
echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $db->getErrorNum(), $db->getErrorMsg()) . '<br />';
return;
}
foreach ($extensions as $extension) {
if (!$installer->refreshManifestCache($extension->extension_id)) {
echo JText::sprintf('FILES_JOOMLA_ERROR_MANIFEST', $extension->type, $extension->element, $extension->name, $extension->client_id) . '<br />';
}
}
}
示例4: RegisterModules
function RegisterModules($path)
{
if (!FSFUpdater::DBIs16()) {
return "Not needed for Joomla 1.5";
}
$log = "";
$db = JFactory::getDBO();
$qry = "SELECT * FROM #__extensions WHERE element = 'mod_fsf_support'";
$db->setQuery($qry);
$rows = $db->loadObjectList();
if (count($rows) == 0) {
$filename = JPATH_SITE . DS . 'modules' . DS . 'mod_fsf_support' . DS . 'mod_fsf_support.xml';
if (file_exists($filename)) {
//echo "<pre>";
$order = 1;
$xml = simplexml_load_file($filename);
$name = $xml->name;
//echo $name."<br>";
$qry = "INSERT INTO #__extensions (name, type, element, client_id, enabled, access) VALUES ('" . FSFJ3Helper::getEscaped($db, $name) . "', 'module', 'mod_fsf_support', 0, 1, 0)";
$db->setQuery($qry);
$db->Query($qry);
//exit;
$log .= "Registering module {$name}\n";
$installer = new JInstaller();
// Check for a database error.
if ($db->getErrorNum()) {
$log .= JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $db->getErrorNum(), $db->getErrorMsg()) . '<br />';
return $log;
}
$id = $db->insertid();
if (!$installer->refreshManifestCache($id)) {
$log .= "ERROR updating manifest for {$id} - {$name} updated ok<br>";
} else {
$log .= "Manifest for {$id} - {$name} updated ok<br>";
}
} else {
$log .= "XML file missing\n";
}
} else {
$log .= "Support module already registered\n";
}
return $log;
}