really-simple-ssl
Last commit date
assets
3 months ago
core
3 months ago
languages
3 months ago
lets-encrypt
4 months ago
lib
6 months ago
mailer
7 months ago
modal
3 months ago
placeholders
9 months ago
progress
1 year ago
security
3 months ago
settings
3 months ago
testssl
5 years ago
upgrade
7 months ago
.wp-env.json
10 months ago
SECURITY.md
9 months ago
class-admin.php
3 months ago
class-cache.php
4 months ago
class-certificate.php
2 years ago
class-front-end.php
6 months ago
class-installer.php
10 months ago
class-mixed-content-fixer.php
3 years ago
class-multisite.php
4 months ago
class-server.php
4 months ago
class-site-health.php
1 year ago
class-wp-cli.php
5 months ago
compatibility.php
1 year ago
force-deactivate.txt
1 year ago
functions.php
5 months ago
index.php
2 years ago
readme.txt
3 months ago
rector.php
1 year ago
rlrsssl-really-simple-ssl.php
3 months ago
rsssl-auto-loader.php
1 year ago
sbom.json.gz
3 months ago
ssl-test-page.php
2 years ago
system-status.php
8 months ago
uninstall.php
4 months ago
upgrade.php
4 months ago
rsssl-auto-loader.php
56 lines
| 1 | <?php |
| 2 | /** |
| 3 | * This file manages to autoload of the classes in the pro folder. |
| 4 | * |
| 5 | * @package REALLY_SIMPLE_SSL |
| 6 | */ |
| 7 | spl_autoload_register( |
| 8 | static function ($the_class) { |
| 9 | // project-specific namespace prefix. |
| 10 | $prefix = 'RSSSL\\'; |
| 11 | |
| 12 | // base directory for the namespace prefix. |
| 13 | $base_dir = rsssl_path; |
| 14 | |
| 15 | // does the class use the namespace prefix? |
| 16 | $len = strlen($prefix); |
| 17 | if (0 !== strncmp($prefix, $the_class, $len)) { |
| 18 | return; |
| 19 | } |
| 20 | // get the relative class name. |
| 21 | $relative_class = substr($the_class, $len); |
| 22 | $relative_class = strtolower($relative_class); |
| 23 | // converting backslashes to slashes, underscores to hyphens. |
| 24 | $relative_class = str_replace(array('\\', '_', 'dynamictables'), array( |
| 25 | '/', |
| 26 | '-', |
| 27 | 'dynamic-tables' |
| 28 | ), $relative_class); // New Line: handle the case of 'dynamic tables' to 'dynamic-tables' This is placeholder fix for now. |
| 29 | |
| 30 | $file = $base_dir . $relative_class; // old way to form filename. |
| 31 | // $file = preg_replace('{/([^/]+)$}', '/class-$1.php', $file); // new way to form filename. |
| 32 | |
| 33 | if (strpos($relative_class, 'trait') !== false) { |
| 34 | $file = preg_replace('{/([^/]+)$}', '/trait-$1.php', $file); |
| 35 | } elseif (strpos($relative_class, 'interface') !== false) { |
| 36 | $file = preg_replace('{/([^/]+)$}', '/interface-$1.php', $file); |
| 37 | } else { |
| 38 | $file = preg_replace('{/([^/]+)$}', '/class-$1.php', $file); |
| 39 | } |
| 40 | |
| 41 | // if(str_contains(strtolower($the_class), 'trait')) { |
| 42 | // var_dump(file_exists($file)); |
| 43 | // var_dump($file); |
| 44 | // die('now'); |
| 45 | // } |
| 46 | if (class_exists($the_class)) { |
| 47 | return; |
| 48 | } |
| 49 | |
| 50 | // if the file exists, require it. |
| 51 | if (file_exists($file)) { |
| 52 | require_once $file; |
| 53 | } |
| 54 | } |
| 55 | ); |
| 56 |