Overview
Comment: | PSR-4 autoloader, thanks to @zou |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | dev |
Files: | files | file ages | folders |
SHA1: |
6e64d1f698f7675675cf33525040a822 |
User & Date: | bohwaz on 2020-10-23 21:34:28 |
Other Links: | branch diff | manifest | tags |
Context
2020-10-24
| ||
00:36 | Implement accounting transaction search check-in: f191ca0575 user: bohwaz tags: dev | |
2020-10-23
| ||
21:34 | PSR-4 autoloader, thanks to @zou check-in: 6e64d1f698 user: bohwaz tags: dev | |
18:13 | Refactor user search before extending it to accounting check-in: 4679f7092f user: bohwaz tags: dev | |
Changes
Modified src/include/init.php from [180dd6419d] to [d7e6a63408].
︙ | ︙ | |||
60 61 62 63 64 65 66 | // Configuration par défaut, si les constantes ne sont pas définies dans config.local.php // (fallback) if (!defined('Garradin\ROOT')) { define('Garradin\ROOT', dirname(__DIR__)); } | | < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < | | < | < | 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 | // Configuration par défaut, si les constantes ne sont pas définies dans config.local.php // (fallback) if (!defined('Garradin\ROOT')) { define('Garradin\ROOT', dirname(__DIR__)); } \spl_autoload_register(function (string $classname) { $classname = ltrim($classname, '\\'); // Plugins if (substr($classname, 0, 16) == 'Garradin\\Plugin\\') { $classname = substr($classname, 16); $plugin_name = substr($classname, 0, strpos($classname, '\\')); $filename = str_replace('\\', '/', substr($classname, strpos($classname, '\\')+1)); $path = Plugin::getPath(strtolower($plugin_name)) . '/lib/' . $filename . '.php'; } else { // PSR-0 autoload $filename = str_replace('\\', '/', $classname); $path = ROOT . '/include/lib/' . $filename . '.php'; } if (file_exists($path)) { require_once $path; } }, true); if (!defined('Garradin\DATA_ROOT')) { define('Garradin\DATA_ROOT', ROOT); } if (!defined('Garradin\WWW_URI')) |
︙ | ︙ |