HEX
Server: Apache/2.4.37 (CentOS Stream) OpenSSL/1.1.1k
System: Linux ysnet.com.tw 4.18.0-553.5.1.el8.x86_64 #1 SMP Tue May 21 05:46:01 UTC 2024 x86_64
User: test (521)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /var/www/test/wp-content/plugins/search-regex/search-regex-loader.php
<?php
/**
 * Legacy autoloader - retained for backward compatibility.
 *
 * This file was used in version 3.3.0 to load the plugin, but in retrospect it is better
 * to have it in the main plugin file.
 *
 * This file can safely be removed in a future major version (3.5+) after sufficient time
 * has passed for caches to be cleared.
 *
 * @deprecated 3.5.0 Use the autoloader in search-regex.php instead.
 * @package Search_Regex
 */

spl_autoload_register(
	function ( $requested_class ) {
		$prefix = 'SearchRegex\\';

		if ( strncmp( $prefix, $requested_class, strlen( $prefix ) ) !== 0 ) {
			return;
		}

		$relative_class = substr( $requested_class, strlen( $prefix ) );
		if ( $relative_class === '' ) {
			return;
		}

		$normalize = static function ( string $value ): string {
			return str_replace( '_', '-', strtolower( $value ) );
		};

		$segments = explode( '\\', $relative_class );
		$class_name = array_pop( $segments );
		$normalized_segments = array_filter(
			array_map( $normalize, $segments ),
			static fn ( $value ) => $value !== ''
		);

		$base_dir = __DIR__ . '/includes/';
		if ( count( $normalized_segments ) > 0 ) {
			$base_dir .= implode( '/', $normalized_segments ) . '/';
		}

		$path = $base_dir . 'class-' . $normalize( $class_name ) . '.php';

		if ( file_exists( $path ) ) {
			require_once $path;
		}
	}
);

require_once __DIR__ . '/build/search-regex-version.php';