Skip to content

Commit

Permalink
Move core extensions list to new helper class
Browse files Browse the repository at this point in the history
Move the static list of core extensions used in script.php for updating
the manifest caches to a new helper class for making it possible to be
used by other functions, too, and add a function for check if an
extension is core or not.
This provides a safe way to detect core extensions, while checking if
extension ID is greater than a certain value is not a safe way.
  • Loading branch information
richard67 committed Jun 16, 2017
1 parent 250fc2a commit 99fe52d
Show file tree
Hide file tree
Showing 2 changed files with 281 additions and 177 deletions.
178 changes: 1 addition & 177 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,183 +380,7 @@ protected function removeJedUpdateserver()
*/
protected function updateManifestCaches()
{
$extensions = array(
// Components
// `type`, `element`, `folder`, `client_id`
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('component', 'com_fields', '', 1),
array('component', 'com_associations', '', 1),

// Libraries
array('library', 'phputf8', '', 0),
array('library', 'joomla', '', 0),
array('library', 'idna_convert', '', 0),
array('library', 'fof', '', 0),
array('library', 'phpass', '', 0),

// Modules
// - Site
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),

// - Administrator
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),

// Plugins
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('plugin', 'fields', 'system', 0),
array('plugin', 'calendar', 'fields', 0),
array('plugin', 'checkboxes', 'fields', 0),
array('plugin', 'color', 'fields', 0),
array('plugin', 'editor', 'fields', 0),
array('plugin', 'imagelist', 'fields', 0),
array('plugin', 'integer', 'fields', 0),
array('plugin', 'list', 'fields', 0),
array('plugin', 'media', 'fields', 0),
array('plugin', 'radio', 'fields', 0),
array('plugin', 'sql', 'fields', 0),
array('plugin', 'text', 'fields', 0),
array('plugin', 'textarea', 'fields', 0),
array('plugin', 'url', 'fields', 0),
array('plugin', 'user', 'fields', 0),
array('plugin', 'usergrouplist', 'fields', 0),
array('plugin', 'fields', 'content', 0),
array('plugin', 'fields', 'editors-xtd', 0),

// Templates
array('template', 'beez3', '', 0),
array('template', 'hathor', '', 1),
array('template', 'protostar', '', 0),
array('template', 'isis', '', 1),

// Languages
array('language', 'en-GB', '', 0),
array('language', 'en-GB', '', 1),

// Files
array('file', 'joomla', '', 0),

// Packages
array('package', 'pkg_en-GB', '', 0),
);
$extensions = JExtensionHelper::getCoreExtensions();

// Attempt to refresh manifest caches
$db = JFactory::getDbo();
Expand Down

0 comments on commit 99fe52d

Please sign in to comment.