wp-user-avatar
Last commit date
assets
2 weeks ago
deprecated
1 year ago
languages
1 day ago
src
1 day ago
third-party
1 day ago
autoloader.php
1 year ago
changelog.txt
1 day ago
index.php
5 years ago
readme.txt
1 day ago
uninstall.php
2 years ago
wp-user-avatar.php
1 day ago
wpml-config.xml
9 months ago
autoloader.php
37 lines
| 1 | <?php |
| 2 | |
| 3 | spl_autoload_register(function ($class) { |
| 4 | |
| 5 | // project-specific namespace prefix |
| 6 | $prefix = 'ProfilePress\\Core\\'; |
| 7 | |
| 8 | // base directory for the namespace prefix |
| 9 | $base_dir = __DIR__ . '/src/'; |
| 10 | |
| 11 | // does the class use the namespace prefix? |
| 12 | $len = strlen($prefix); |
| 13 | if (strncmp($prefix, $class, $len) !== 0) { |
| 14 | // no, move to the next registered autoloader |
| 15 | return; |
| 16 | } |
| 17 | |
| 18 | // get the relative class name |
| 19 | $relative_class = substr($class, $len); |
| 20 | |
| 21 | // replace the namespace prefix with the base directory, replace namespace |
| 22 | // separators with directory separators in the relative class name, append |
| 23 | // with .php |
| 24 | $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; |
| 25 | |
| 26 | // if the file exists, require it |
| 27 | if (file_exists($file)) { |
| 28 | require $file; |
| 29 | } |
| 30 | }); |
| 31 | |
| 32 | require __DIR__ . "/src/Functions/custom-settings-api.php"; |
| 33 | require __DIR__ . "/src/Functions/GlobalFunctions.php"; |
| 34 | require __DIR__ . "/src/Functions/MSFunctions.php"; |
| 35 | require __DIR__ . "/src/Functions/PPressBFnote.php"; |
| 36 | require __DIR__ . "/src/Functions/Shogun.php"; |
| 37 | require __DIR__ . "/src/Functions/FuseWPAdminNotice.php"; |