Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static function autoload($class){
- $class_path = str_replace("\\", "/", $class).'.php';
- if(strpos($class, 'Proxie\\') !== false) {
- $class_path = str_replace("Proxie/",'',$class_path);
- }
- $ok = @include_once($class_path);
- if($ok){
- if(PROD_MODE){
- if(strpos($class, 'Model\\') === false){
- $f = fopen(ROOT_PATH.'system/777/autoloader/classes_cache.php',"a");
- $refl = new \ReflectionClass($class);
- $classfile = $refl->getFileName();
- $content = file_get_contents($classfile);
- $content = str_replace(array('<?php','?>'), '', $content);
- $content = str_replace('__DIR__', '"'.dirname($classfile).'"', $content);
- fwrite($f, $content);
- fclose($f);
- apc_clear_cache("user");
- apc_clear_cache("system");
- apc_clear_cache("opcode");
- }
- }
- }
- return $ok;
- }
Advertisement
Add Comment
Please, Sign In to add comment