Project

General

Profile

Revision 10

Added by Manuela about 5 years ago

CoreAutoloader::doRegister() regex creation fixed and made translations of namespaces more flexible
initialize:: set namespace translation of 'acp' to ADMIN_DIRECTORY

View differences:

branches/main/admin/interface/version.php
48 48

  
49 49
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
50 50
if(!defined('VERSION')) { define('VERSION', '2.10.1-dev'); }
51
if(!defined('REVISION')) { define('REVISION', '9'); }
51
if(!defined('REVISION')) { define('REVISION', '10'); }
52 52
if(!defined('SP')) { define('SP', ''); }
53 53

  
branches/main/framework/CoreAutoloader.php
31 31
 * @description  xxx
32 32
 */
33 33
//declare(strict_types = 1);
34
declare(encoding = 'UTF-8');
34
//declare(encoding = 'UTF-8');
35 35

  
36 36
namespace bin;
37 37

  
......
87 87
/**
88 88
 * register this autoloader
89 89
 */
90
    public static function doRegister()
90
    public static function doRegister(array $aAdditionalTranslations = null)
91 91
    {
92
        if (!is_null($aAdditionalTranslations)) {
93
            foreach ($aAdditionalTranslations as $sKey=>$sValue) {
94
                self::$aTransNs[$sKey] = $sValue;
95
            }
96
        }
92 97
        self::$sInstallPath = \rtrim(\str_replace('\\', '/', \dirname(__DIR__)), '/').'/';
93 98
        foreach (self::$aTransNs as $sPattern => $sReplacement) {
94
            self::$aPatterns[]     = '@^'.$sPattern.'@su';
95
            self::$aReplacements[] = $sReplacement;
99
            self::$aPatterns[]     = '@^('.$sPattern.'/)@su';
100
            self::$aReplacements[] = $sReplacement.'/';
96 101
        }
97 102
        \spl_autoload_register([__CLASS__, 'autoLoad']);
98 103
    }
branches/main/framework/initialize.php
316 316
    if (!class_exists('\bin\CoreAutoloader')) {
317 317
        include __DIR__.'/CoreAutoloader.php';
318 318
    }
319
    \bin\CoreAutoloader::doRegister();
319
    \bin\CoreAutoloader::doRegister(['acp' => ADMIN_DIRECTORY]);
320 320

  
321 321
if (class_exists('database')) {
322 322
    // sanitize $_SERVER['HTTP_REFERER']

Also available in: Unified diff