PluginProbe ʕ •ᴥ•ʔ
Really Simple Security – Simple and Performant Security (formerly Really Simple SSL) / 9.5.9
Really Simple Security – Simple and Performant Security (formerly Really Simple SSL) v9.5.9
9.5.11 9.5.10.1 9.5.10 trunk 9.4.0 9.4.1 9.4.2 9.4.3 9.5.0 9.5.0.1 9.5.0.2 9.5.1 9.5.2 9.5.2.2 9.5.2.3 9.5.3 9.5.3.1 9.5.3.2 9.5.4 9.5.5 9.5.6 9.5.7 9.5.8 9.5.9
really-simple-ssl / rsssl-auto-loader.php
really-simple-ssl Last commit date
assets 2 months ago core 2 months ago languages 2 months ago lets-encrypt 2 months ago lib 2 months ago mailer 2 months ago modal 2 months ago placeholders 2 months ago progress 2 months ago security 2 months ago settings 2 months ago testssl 2 months ago upgrade 2 months ago .wp-env.json 2 months ago SECURITY.md 2 months ago class-admin.php 2 months ago class-cache.php 2 months ago class-certificate.php 2 months ago class-front-end.php 2 months ago class-installer.php 2 months ago class-mixed-content-fixer.php 2 months ago class-multisite.php 2 months ago class-server.php 2 months ago class-site-health.php 2 months ago class-wp-cli.php 2 months ago compatibility.php 2 months ago force-deactivate.txt 2 months ago functions.php 2 months ago index.php 2 months ago readme.txt 2 months ago rector.php 2 months ago rlrsssl-really-simple-ssl.php 2 months ago rsssl-auto-loader.php 2 months ago sbom.json.gz 2 months ago ssl-test-page.php 2 months ago system-status.php 2 months ago uninstall.php 2 months ago upgrade.php 2 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