Requests::autoloader()

最后更新于:2021-11-25 22:48:00

Requests::autoloader( string$class)

Autoloader for Requests

参数

$class

(string) (Required) Class name to load

源文件

文件: gc-includes/class-requests.php

	public static function autoloader($class) {
		// Check that the class starts with "Requests"
		if (strpos($class, 'Requests') !== 0) {
			return;
		}

		$file = str_replace('_', '/', $class);
		if (file_exists(dirname(__FILE__) . '/' . $file . '.php')) {
			require_once dirname(__FILE__) . '/' . $file . '.php';
		}
	}