0
슬림 프레임 워크를 사용하고 있으며 자동 로딩 파일을 올바르게 처리하고 싶습니다. 순간 나는이 있습니다PHP Slim framework : autoload
spl_autoload_register(function($class){
$list = array(
dirname(__DIR__).'/app/'.$class.'.php',
dirname(__DIR__).'/lib/'.$class.'.php',
dirname(__DIR__).'/lib/'.$class.'.class.php',
);
foreach($list as $k => $v){if(file_exists($v)){
include $v; return true;
}}
});
을 그리고이 구조 :
lib\
Function.php
MyNamespace\
Class.php
vendor\
slim\
web\
.htaccess
index.php
그것은 작곡가를 사용하지 않고 슬림 자동로드하는 가장 좋은 방법은 무엇입니까? (서버에 Composer를 설치할 수 없거나 원하지 않는 경우)
그래, 고마워,하지만 지금은 사용되는 로더 작곡가 싶지 않아요, 슬림위한 솔루션이 있습니까? –