public static function init(){ /** 设置自动载入函数 */ if (function_exists('spl_autoload_register')) { spl_autoload_register(array('Typecho_Common', '__autoLoad')); } else { function __autoLoad($className) { Typecho_Common::__autoLoad($className); } }}
What does the static method above mean, define a function, but not invoke it to execute? I can't read and answer.
Reply content:
public static function init(){ /** 设置自动载入函数 */ if (function_exists('spl_autoload_register')) { spl_autoload_register(array('Typecho_Common', '__autoLoad')); } else { function __autoLoad($className) { Typecho_Common::__autoLoad($className); } }}
What does the static method above mean, define a function, but not invoke it to execute? I can't read and answer.
http://php.net/manual/zh/function.autoload.php
PHP's Magic method executes this function to load a class when the loaded class does not exist.