public
Last active

Joomla Namespace Compatibility Layer

  • Download Gist
namespace.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312
<?php
 
return array(
'JAccess' => 'Joomla\\Access\\Access',
'JAccessRule' => 'Joomla\\Access\\Rule',
'JAccessRules' => 'Joomla\\Access\\Rules',
'JApplicationBase' => 'Joomla\\Application\\Base',
'JApplicationCli' => 'Joomla\\Application\\Cli',
'JApplicationDaemon' => 'Joomla\\Application\\Daemon',
'JRoute' => 'Joomla\\Application\\Route',
'JRouter' => 'Joomla\\Application\\Router',
'JApplicationWeb' => 'Joomla\\Application\\Web',
'JApplicationWebClient' => 'Joomla\\Application\\Web\\Client',
'JApplicationWebRouter' => 'Joomla\\Application\\Web\\Router',
'JApplicationWebRouterBase' => 'Joomla\\Application\\Web\\Router\\Base',
'JApplicationWebRouterRest' => 'Joomla\\Application\\Web\\Router\\Rest',
'JArchive' => 'Joomla\\Archive\\Archive',
'JArchiveBzip2' => 'Joomla\\Archive\\Bzip2',
'JArchiveExtractable' => 'Joomla\\Archive\\Extractable',
'JArchiveGzip' => 'Joomla\\Archive\\Gzip',
'JArchiveTar' => 'Joomla\\Archive\\Tar',
'JArchiveZip' => 'Joomla\\Archive\\Zip',
'JAdapter' => 'Joomla\\Base\\Adapter',
'JAdapterInstance' => 'Joomla\\Base\\AdapterInstance',
'JCache' => 'Joomla\\Cache\\Cache',
'JCacheController' => 'Joomla\\Cache\\Controller',
'JCacheControllerCallback' => 'Joomla\\Cache\\Controller\\Callback',
'JCacheControllerOutput' => 'Joomla\\Cache\\Controller\\Output',
'JCacheControllerPage' => 'Joomla\\Cache\\Controller\\Page',
'JCacheControllerView' => 'Joomla\\Cache\\Controller\\View',
'JCacheStorage' => 'Joomla\\Cache\\Storage',
'JCacheStorageApc' => 'Joomla\\Cache\\Storage\\Apc',
'JCacheStorageCachelite' => 'Joomla\\Cache\\Storage\\Cachelite',
'JCacheStorageFile' => 'Joomla\\Cache\\Storage\\File',
'JCacheStorageHelper' => 'Joomla\\Cache\\Storage\\Helper',
'JCacheStorageMemcache' => 'Joomla\\Cache\\Storage\\Memcache',
'JCacheStorageMemcached' => 'Joomla\\Cache\\Storage\\Memcached',
'JCacheStorageWincache' => 'Joomla\\Cache\\Storage\\Wincache',
'JCacheStorageXcache' => 'Joomla\\Cache\\Storage\\Xcache',
'JClientFtp' => 'Joomla\\Client\\Ftp',
'JClientHelper' => 'Joomla\\Client\\Helper',
'JClientLdap' => 'Joomla\\Client\\Ldap',
'JControllerBase' => 'Joomla\\Controller\\Base',
'JController' => 'Joomla\\Controller\\Controller',
'JCryptCipher' => 'Joomla\\Crypt\\Cipher',
'JCryptCipher3DES' => 'Joomla\\Crypt\\Cipher_3des',
'JCryptCipherBlowfish' => 'Joomla\\Crypt\\Cipher_Blowfish',
'JCryptCipherMcrypt' => 'Joomla\\Crypt\\Cipher_Mcrypt',
'JCryptCipherRijndael256' => 'Joomla\\Crypt\\Cipher_Rijndael256',
'JCryptCipherSimple' => 'Joomla\\Crypt\\Cipher_Simple',
'JCrypt' => 'Joomla\\Crypt\\Crypt',
'JCryptKey' => 'Joomla\\Crypt\\Key',
'JCryptPassword' => 'Joomla\\Crypt\\Password',
'JCryptPasswordSimple' => 'Joomla\\Crypt\\Password\\Simple',
'JData' => 'Joomla\\Data\\Data',
'JDataDumpable' => 'Joomla\\Data\\Dumpable',
'JDataSet' => 'Joomla\\Data\\Set',
'JDatabase' => 'Joomla\\Database\\Database',
'JDatabaseInterface' => 'Joomla\\Database\\DatabaseInterface',
'JDatabaseDriver' => 'Joomla\\Database\\Driver',
'JDatabaseDriverMysql' => 'Joomla\\Database\\Driver\\Mysql',
'JDatabaseDriverMysqli' => 'Joomla\\Database\\Driver\\Mysqli',
'JDatabaseDriverOracle' => 'Joomla\\Database\\Driver\\Oracle',
'JDatabaseDriverPdo' => 'Joomla\\Database\\Driver\\Pdo',
'JDatabaseDriverPostgresql' => 'Joomla\\Database\\Driver\\Postgresql',
'JDatabaseDriverSqlazure' => 'Joomla\\Database\\Driver\\Sqlazure',
'JDatabaseDriverSqlite' => 'Joomla\\Database\\Driver\\Sqlite',
'JDatabaseDriverSqlsrv' => 'Joomla\\Database\\Driver\\Sqlsrv',
'JDatabaseExporter' => 'Joomla\\Database\\Exporter',
'JDatabaseExporterMysql' => 'Joomla\\Database\\Exporter\\Mysql',
'JDatabaseExporterMysqli' => 'Joomla\\Database\\Exporter\\Mysqli',
'JDatabaseExporterPostgresql' => 'Joomla\\Database\\Exporter\\Postgresql',
'JDatabaseFactory' => 'Joomla\\Database\\Factory',
'JDatabaseImporter' => 'Joomla\\Database\\Importer',
'JDatabaseImporterMysql' => 'Joomla\\Database\\Importer\\Mysql',
'JDatabaseImporterMysqli' => 'Joomla\\Database\\Importer\\Mysqli',
'JDatabaseImporterPostgresql' => 'Joomla\\Database\\Importer\\Postgresql',
'JDatabaseIterator' => 'Joomla\\Database\\DatabaseIterator',
'JDatabaseIteratorAzure' => 'Joomla\\Database\\Iterator\\Azure',
'JDatabaseIteratorMysql' => 'Joomla\\Database\\Iterator\\Mysql',
'JDatabaseIteratorMysqli' => 'Joomla\\Database\\Iterator\\Mysqli',
'JDatabaseIteratorOracle' => 'Joomla\\Database\\Iterator\\Oracle',
'JDatabaseIteratorPdo' => 'Joomla\\Database\\Iterator\\Pdo',
'JDatabaseIteratorSqlite' => 'Joomla\\Database\\Iterator\\Sqlite',
'JDatabaseIteratorSqlsrv' => 'Joomla\\Database\\Iterator\\Sqlsrv',
'JDatabaseQuery' => 'Joomla\\Database\\Query',
'JDatabaseQueryElement' => 'Joomla\\Database\\Query\\Element',
'JDatabaseQueryLimitable' => 'Joomla\\Database\\Query\\Limitable',
'JDatabaseQueryMysql' => 'Joomla\\Database\\Query\\Mysql',
'JDatabaseQueryMysqli' => 'Joomla\\Database\\Query\\Mysqli',
'JDatabaseQueryOracle' => 'Joomla\\Database\\Query\\Oracle',
'JDatabaseQueryPdo' => 'Joomla\\Database\\Query\\Pdo',
'JDatabaseQueryPostgresql' => 'Joomla\\Database\\Query\\Postgresql',
'JDatabaseQueryPreparable' => 'Joomla\\Database\\Query\\Preparable',
'JDatabaseQuerySqlAzure' => 'Joomla\\Database\\Query\\Sqlazure',
'JDatabaseQuerySqlite' => 'Joomla\\Database\\Query\\Sqlite',
'JDatabaseQuerySqlsrv' => 'Joomla\\Database\\Query\\Sqlsrv',
'JDate' => 'Joomla\\Date\\Date',
'JDocument' => 'Joomla\\Document\\Document',
'JDocumentError' => 'Joomla\\Document\\Error',
'JDocumentFeed' => 'Joomla\\Document\\Feed',
'JDocumentHtml' => 'Joomla\\Document\\Html',
'JDocumentImage' => 'Joomla\\Document\\Image',
'JDocumentJson' => 'Joomla\\Document\\Json',
'JDocumentOpensearch' => 'Joomla\\Document\\Opensearch',
'JDocumentRaw' => 'Joomla\\Document\\Raw',
'JDocumentXml' => 'Joomla\\Document\\Xml',
'JDocumentRender' => 'Joomla\\Document\\Renderer',
'JDocumentRendererAtom' => 'Joomla\\Document\\Renderer\\Atom',
'JDocumentRendererRss' => 'Joomla\\Document\\Renderer\\Rss',
'JDocumentRendererComponent' => 'Joomla\\Document\\Renderer\\Component',
'JDocumentRendererHead' => 'Joomla\\Document\\Renderer\\Head',
'JDocumentRendererMessage' => 'Joomla\\Document\\Renderer\\Message',
'JDocumentRendererModule' => 'Joomla\\Document\\Renderer\\Module',
'JDocumentRendererModules' => 'Joomla\\Document\\Renderer\\Modules',
'JBrowser' => 'Joomla\\Environment\\Browser',
'JResponse' => 'Joomla\\Environment\\Response',
'JEventDispatcher' => 'Joomla\\Event\\Dispatcher',
'JEvent' => 'Joomla\\Event\\Event',
'JFactory' => 'Joomla\\Factory',
'JFile' => 'Joomla\\Filesystem\\File',
'JFolder' => 'Joomla\\Filesystem\\Folder',
'JFilesystemHelper' => 'Joomla\\Filesystem\\Helper',
'JFilesystemPatcher' => 'Joomla\\Filesystem\\Patcher',
'JPath' => 'Joomla\\Filesystem\\Path',
'JStream' => 'Joomla\\Filesystem\\Stream',
'JStreamString' => 'Joomla\\Filesystem\\Stream\\String',
'JStringController' => 'Joomla\\Filesystem\\Support\\StringController',
'JFilterInput' => 'Joomla\\Filter\\Input',
'JFilterOutput' => 'Joomla\\Filter\\Output',
'JFormField' => 'Joomla\\Form\\Field',
'JFormFieldAccessLevel' => 'Joomla\\Form\\Field_AccessLevel',
'JFormFieldCacheHandler' => 'Joomla\\Form\\Field_CacheHandler',
'JFormFieldCalendar' => 'Joomla\\Form\\Field_Calendar',
'JFormFieldCheckbox' => 'Joomla\\Form\\Field_Checkbox',
'JFormFieldCheckboxes' => 'Joomla\\Form\\Field_Checkboxes',
'JFormFieldColor' => 'Joomla\\Form\\Field_Color',
'JFormFieldCombo' => 'Joomla\\Form\\Field_Combo',
'JFormFieldDatabaseConnection' => 'Joomla\\Form\\Field_DatabaseConnection',
'JFormFieldEMail' => 'Joomla\\Form\\Field_Email',
'JFormFieldFile' => 'Joomla\\Form\\Field_File',
'JFormFieldFileList' => 'Joomla\\Form\\Field_FileList',
'JFormFieldFolderList' => 'Joomla\\Form\\Field_FolderList',
'JFormFieldGroupedList' => 'Joomla\\Form\\Field_GroupedList',
'JFormFieldHidden' => 'Joomla\\Form\\Field_Hidden',
'JFormFieldImageList' => 'Joomla\\Form\\Field_ImageList',
'JFormFieldInteger' => 'Joomla\\Form\\Field_Integer',
'JFormFieldLanguage' => 'Joomla\\Form\\Field_Language',
'JFormFieldList' => 'Joomla\\Form\\Field_List',
'JFormFieldPassword' => 'Joomla\\Form\\Field_Password',
'JFormFieldPlugins' => 'Joomla\\Form\\Field_Plugins',
'JFormFieldRadio' => 'Joomla\\Form\\Field_Radio',
'JFormFieldRules' => 'Joomla\\Form\\Field_Rules',
'JFormFieldSessionHandler' => 'Joomla\\Form\\Field_SessionHandler',
'JFormFieldSpacer' => 'Joomla\\Form\\Field_Spacer',
'JFormFieldSQL' => 'Joomla\\Form\\Field_Sql',
'JFormFieldTel' => 'Joomla\\Form\\Field_Tel',
'JFormFieldText' => 'Joomla\\Form\\Field_Text',
'JFormFieldTextarea' => 'Joomla\\Form\\Field_Textarea',
'JFormFieldTimezone' => 'Joomla\\Form\\Field_Timezone',
'JFormFieldUrl' => 'Joomla\\Form\\Field_Url',
'JFormFieldUsergroup' => 'Joomla\\Form\\Field_Usergroup',
'JForm' => 'Joomla\\Form\\Form',
'JFormHelper' => 'Joomla\\Form\\Helper',
'JFormRule' => 'Joomla\\Form\\Rule',
'JFormRuleBoolean' => 'Joomla\\Form\\Rule\\Boolean',
'JFormRuleColor' => 'Joomla\\Form\\Rule\\Color',
'JFormRuleEmail' => 'Joomla\\Form\\Rule\\Email',
'JFormRuleEquals' => 'Joomla\\Form\\Rule\\Equals',
'JFormRuleOptions' => 'Joomla\\Form\\Rule\\Options',
'JFormRuleRules' => 'Joomla\\Form\\Rule\\Rules',
'JFormRuleTel' => 'Joomla\\Form\\Rule\\Tel',
'JFormRuleUrl' => 'Joomla\\Form\\Rule\\Url',
'JFormRuleUsername' => 'Joomla\\Form\\Rule\\Username',
'JGithubAccount' => 'Joomla\\Github\\Account',
'JGithubCommits' => 'Joomla\\Github\\Commits',
'JGithubForks' => 'Joomla\\Github\\Forks',
'JGithubGists' => 'Joomla\\Github\\Gists',
'JGithub' => 'Joomla\\Github\\Github',
'JGithubHooks' => 'Joomla\\Github\\Hooks',
'JGithubHttp' => 'Joomla\\Github\\Http',
'JGithubIssues' => 'Joomla\\Github\\Issues',
'JGithubMilestones' => 'Joomla\\Github\\Milestones',
'JGithubObject' => 'Joomla\\Github\\Object',
'JGithubPulls' => 'Joomla\\Github\\Pulls',
'JGithubRefs' => 'Joomla\\Github\\Refs',
'JGithubStatuses' => 'Joomla\\Github\\Statuses',
'JGoogleAuth' => 'Joomla\\Google\\Auth',
'JGoogleAuthOauth2' => 'Joomla\\Google\\Auth\\OAuth2',
'JGoogleData' => 'Joomla\\Google\\Data',
'JGoogleDataAdsense' => 'Joomla\\Google\\Data\\Adsense',
'JGoogleDataCalendar' => 'Joomla\\Google\\Data\\Calendar',
'JGoogleDataPicasa' => 'Joomla\\Google\\Data\\Picasa',
'JGoogleDataPicasaAlbum' => 'Joomla\\Google\\Data\\Picasa\\Album',
'JGoogleDataPicasaPhoto' => 'Joomla\\Google\\Data\\Picasa\\Photo',
'JGoogleDataPlus' => 'Joomla\\Google\\Data\\Plus',
'JGoogleDataPlusActivities' => 'Joomla\\Google\\Data\\Plus\\Activities',
'JGoogleDataPlusComments' => 'Joomla\\Google\\Data\\Plus\\Comments',
'JGoogleDataPlusPeople' => 'Joomla\\Google\\Data\\Plus\\People',
'JGoogleEmbed' => 'Joomla\\Google\\Embed',
'JGoogleEmbedAnalytics' => 'Joomla\\Google\\Embed\\Analytics',
'JGoogleEmbedMaps' => 'Joomla\\Google\\Embed\\Maps',
'JGoogle' => 'Joomla\\Google\\Google',
'JGrid' => 'Joomla\\Grid\\Grid',
'JHtmlAccess' => 'Joomla\\Html\\Access',
'JHtmlBehavior' => 'Joomla\\Html\\Behavior',
'JHtmlContent' => 'Joomla\\Html\\Content',
'JHtmlDate' => 'Joomla\\Html\\Date',
'JHtmlEmail' => 'Joomla\\Html\\Email',
'JHtmlForm' => 'Joomla\\Html\\Form',
'JHtmlGrid' => 'Joomla\\Html\\Grid',
'JHtml' => 'Joomla\\Html\\Html',
'JHtmlJGrid' => 'Joomla\\Html\\JGrid',
'JHtmlList' => 'Joomla\\Html\\Listt',
'JHtmlNumber' => 'Joomla\\Html\\Number',
'JHtmlRules' => 'Joomla\\Html\\Rules',
'JHtmlSelect' => 'Joomla\\Html\\Select',
'JHtmlSliders' => 'Joomla\\Html\\Sliders',
'JHtmlString' => 'Joomla\\Html\\String',
'JHtmlTabs' => 'Joomla\\Html\\Tabs',
'JHtmlTel' => 'Joomla\\Html\\Tel',
'JHtmlUser' => 'Joomla\\Html\\User',
'JHttpFactory' => 'Joomla\\Http\\Factory',
'JHttp' => 'Joomla\\Http\\Http',
'JHttpResponse' => 'Joomla\\Http\\Response',
'JHttpTransport' => 'Joomla\\Http\\Transport',
'JHttpTransportCurl' => 'Joomla\\Http\\Transport\\Curl',
'JHttpTransportSocket' => 'Joomla\\Http\\Transport\\Socket',
'JHttpTransportStream' => 'Joomla\\Http\\Transport\\Stream',
'JImage' => 'Joomla\\Image\\Image',
'JImageFilter' => 'Joomla\\Image\\Filter',
'JImageFilterBrightness' => 'Joomla\\Image\\Filter\\Brightness',
'JImageFilterContrast' => 'Joomla\\Image\\Filter\\Contrast',
'JImageFilterEdgedetect' => 'Joomla\\Image\\Filter\\Edgedetect',
'JImageFilterEmboss' => 'Joomla\\Image\\Filter\\Emboss',
'JImageFilterNegate' => 'Joomla\\Image\\Filter\\Grayscale',
'JImageFilterSketchy' => 'Joomla\\Image\\Filter\\Sketchy',
'JImageFilterSmooth' => 'Joomla\\Image\\Filter\\Smooth',
'JInputCli' => 'Joomla\\Input\\Cli',
'JInputCookie' => 'Joomla\\Input\\Cookie',
'JInputFiles' => 'Joomla\\Input\\Files',
'JInput' => 'Joomla\\Input\\Input',
'JInputJson' => 'Joomla\\Input\\Json',
'JKeychain' => 'Joomla\\Keychain\\Keychain',
'JLanguageHelper' => 'Joomla\\Language\\Helper',
'JLanguage' => 'Joomla\\Language\\Language',
'JLanguageStemmer' => 'Joomla\\Language\\Stemmer',
'JLanguageStemmerPorteren' => 'Joomla\\Language\\Stemmer\\Porteren',
'JText' => 'Joomla\\Language\\Text',
'JLanguageTransliterate' => 'Joomla\\Language\\Transliterate',
'JLogEntry' => 'Joomla\\Log\\Entry',
'JLog' => 'Joomla\\Log\\Log',
'JLogLogger' => 'Joomla\\Log\\Logger',
'JLogLoggerCallback' => 'Joomla\\Log\\Logger\\Callback',
'JLogLoggerDatabase' => 'Joomla\\Log\\Logger\\Database',
'JLogLoggerEcho' => 'Joomla\\Log\\Logger\\Echoo',
'JLogLoggerFormattedtext' => 'Joomla\\Log\\Logger\\Formattedtext',
'JLogLoggerMessagequeue' => 'Joomla\\Log\\Logger\\Messagequeue',
'JLogLoggerSyslog' => 'Joomla\\Log\\Logger\\Syslog',
'JLogLoggerW3c' => 'Joomla\\Log\\Logger\\W3c',
'JMailHelper' => 'Joomla\\Mail\\Helper',
'JMail' => 'Joomla\\Mail\\Mail',
'JModelBase' => 'Joomla\\Model\\Base',
'JModelDatabase' => 'Joomla\\Model\\Database',
'JModel' => 'Joomla\\Model\\Model',
'JOAuth2Client' => 'Joomla\\Oauth2\\Client',
'JObject' => 'Joomla\\Object\\Object',
'JPaginationObject' => 'Joomla\\Pagination\\Object',
'JPagination' => 'Joomla\\Pagination\\Pagination',
'JPluginHelper' => 'Joomla\\Plugin\\Helper',
'JPlugin' => 'Joomla\\Plugin\\Plugin',
'JProfiler' => 'Joomla\\Profiler\\Profiler',
'JRegistry' => 'Joomla\\Registry\\Registry',
'JRegistryFormat' => 'Joomla\\Registry\\Format',
'JRegistryFormatINI' => 'Joomla\\Registry\\Format\\Ini',
'JRegistryFormatJSON' => 'Joomla\\Registry\\Format\\Json',
'JRegistryFormatPHP' => 'Joomla\\Registry\\Format\\Php',
'JRegistryFormatXML' => 'Joomla\\Registry\\Format\\Xml',
'JSession' => 'Joomla\\Session\\Session',
'JSessionStorage' => 'Joomla\\Session\\Storage',
'JSessionStorageAPC' => 'Joomla\\Session\\Storage\\Apc',
'JSessionStorageDatabase' => 'Joomla\\Session\\Storage\\Database',
'JSessionStorageMemcache' => 'Joomla\\Session\\Storage\\Memcache',
'JSessionStorageMemcached' => 'Joomla\\Session\\Storage\\Memcached',
'JSessionStorageNone' => 'Joomla\\Session\\Storage\\None',
'JSessionStorageWincache' => 'Joomla\\Session\\Storage\\Wincache',
'JSessionStorageXcache' => 'Joomla\\Session\\Storage\\Xcache',
'JStringInflector' => 'Joomla\\String\\Inflector',
'JStringNormalise' => 'Joomla\\String\\Normalise',
'JString' => 'Joomla\\String\\String',
'JTableAsset' => 'Joomla\\Table\\Asset',
'JTableExtension' => 'Joomla\\Table\\Extension',
'JTableLanguage' => 'Joomla\\Table\\Language',
'JTableNested' => 'Joomla\\Table\\Nested',
'JTable' => 'Joomla\\Table\\Table',
'JTableUpdate' => 'Joomla\\Table\\Update',
'JTableUser' => 'Joomla\\Table\\User',
'JTableUsergroup' => 'Joomla\\Table\\Usergroup',
'JTableViewlevel' => 'Joomla\\Table\\Viewlevel',
'JUri' => 'Joomla\\Uri\\Uri',
'JURI' => 'Joomla\\Uri\\Uri',
'JAuthentication' => 'Joomla\\User\\Authentication',
'JAuthenticationResponse' => 'Joomla\\User\\AuthenticationResponse',
'JUserHelper' => 'Joomla\\User\\Helper',
'JUser' => 'Joomla\\User\\User',
'JArrayHelper' => 'Joomla\\Utilities\\ArrayHelper',
'JBuffer' => 'Joomla\\Utilities\\Buffer',
'JUtility' => 'Joomla\\Utilities\\Utility',
'JViewBase' => 'Joomla\\View\\Base',
'JViewHtml' => 'Joomla\\View\\Html',
'JView' => 'Joomla\\View\\View'
);

For the above, 3 nits.

1) Add the global namespace to the old classes, ie \JDatabaseQuery - it's just provides more clarity.
2) class_alias will attempt to autoload the class being assigned an alias[the new class]. This means that running this method will load each and every one of those files, mostly for no reason. As such, add a parameter specify whether or not to autoload the new class and default it to false.
3) If for some reason someone has defined their own versions of the old classes, this code will blow up when trying to assign a second alias. As such call class_exists on the old classes before mapping them - and again add an autoload control parameter for whether or not the old class should be autoloaded if possible.
public static function setup($autoloadNew = false, $autoloadOld = false)
{
foreach(self::$classmap as $new => $old)
{
if !(class_exists($old, $autoloadOld) {
class_alias($new, $old, $autoloadNew);
}

    }
}

Gary,

Thanks for taking the time to comment. I've looked into what you've mentioned and came up with these solutions.

1) That would be fairly simple to implement. I'm not opposed, but since this is being ran within the global name space, that classes are being aliased to the global namespace already.

2) I opted to just set the third param of class_alias to false. The classes shouldn't be autoloaded unless they are being used.

3) I agree - we should call class_exists before class alias, and this should probably run through the autoloader by default. In case someone has included code to override the default class either via registerPrefix for another place to look for 'J' prefixed files, or via the JLoader::discover() method. So I defaulted it to true, with a setting.

In regards to #1, class_alias always put's the new class in the global namespace - http://www.php.net/manual/en/function.class-alias.php#105403

In regards to #2, if you try to alias a non-existant class, then a PHP Warning is produced. So we must autoload all the classes that we alias in order for this to work correctly.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.