PluginProbe
Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification / 5.5.0
Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification v5.5.0
5.5.0 5.4.0 5.3.2 5.3.1 5.1.6 5.1.5 trunk 2.1.5 2.11 2.12 2.13 2.15 3.0.0 3.0.1 3.0.2 3.0.3 3.0.5 3.0.51 3.0.60 3.0.61 3.0.62 3.0.70 3.0.71 3.0.72 3.1.0 All 34 releases
double-opt-in / autoload.php

autoload.php in Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification 5.5.0, at autoload.php

39 lines 849 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * PSR-4 Autoloader for Double Opt-In Plugin
4 *
5 * @package Forge12\DoubleOptIn
6 * @since 4.0.0
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 spl_autoload_register( function ( $class ) {
14 // Project namespace prefixes and their base directories
15 $namespaces = [
16 'Forge12\\DoubleOptIn\\' => __DIR__ . '/src/',
17 ];
18
19 foreach ( $namespaces as $prefix => $base_dir ) {
20 // Check if the class uses this namespace prefix
21 $len = strlen( $prefix );
22 if ( strncmp( $prefix, $class, $len ) !== 0 ) {
23 continue;
24 }
25
26 // Get the relative class name
27 $relative_class = substr( $class, $len );
28
29 // Replace namespace separators with directory separators
30 $file = $base_dir . str_replace( '\\', '/', $relative_class ) . '.php';
31
32 // If the file exists, require it
33 if ( file_exists( $file ) ) {
34 require $file;
35 return;
36 }
37 }
38 } );
39