35 if (empty($sClassName)) {
36 throw new Exception(
'Class name is empty');
39 $sPath = dirname(dirname(__FILE__));
41 throw new Exception(
'Current path is empty');
44 $sFile = sprintf(
'%s%s%s.php',
45 $sPath, DIRECTORY_SEPARATOR,
46 str_replace(
'_', DIRECTORY_SEPARATOR, $sClassName)
48 if (is_file($sFile) && is_readable($sFile)) {
55 if (function_exists(
'__autoload')) {
56 spl_autoload_register(
'__autoload');
58 spl_autoload_register(
'ApnsPHP_Autoload');
void ApnsPHP_Autoload(string $sClassName)
This function is automatically called in case you are trying to use a class/interface which hasn't be...