그래서 내가 메인 클래스 전 클래스를 정의PHP에서 클래스가 있는지 어떻게 확인할 수 있습니까?
function __construct(){
$this->conf = $GLOBALS['conf'];
$this->dbi = new dbinfo;
$this->modOpt = new modOptions;
$this->lang = new language;
/** Connect DB extended Class **/
parent::__construct($GLOBALS['connect']);
}
에서 구조체 기능의이 종류가 있지만,이 클래스가 포함되어 있습니다 제외한 파일의 시작에 포함되어있는 라이브러리 파일에있을 때 POST 요청 것 다음과 같이 나타납니다
그렇게if (isset($_POST['delGroup']) && isset($_SESSION['content_viewer']) && $_SESSION['content_viewer']['code'] >= 1){
include_once(realpath(dirname(__FILE__) . '/../..')."/mod/dbinfo/proc.php");
}
내가이
function __construct(){
$this->conf = $GLOBALS['conf'];
if (isset(new dbinfo))
$this->dbi = new dbinfo;
$this->modOpt = new modOptions;
$this->lang = new language;
/** Connect DB extended Class **/
parent::__construct($GLOBALS['connect']);
}
BU처럼 DBINFO 클래스 내 구조 기능에 체크를 추가하려면 이 방법을 if isset
와 함께 사용할 수 없다면 올바른 방법으로 파일에 클래스가 존재하는지 확인하는 방법을 보여주십시오. 감사
http://php.net/manual/en/function.get-declared-classes.php? –
PHP가 실제로'class_exists()'라는 함수를 가지고 있다는 사실에 아이러닉 한 것이 있습니까? http://php.net/manual/en/function.class-exists.php ... 나는 당신이 방금에 질문 제목을 타이핑했다면이 답을 얻었고 자신을 톤 질문을 쓰는 시간. –
CD001
중복 : http://stackoverflow.com/questions/29940289/check-if-a-class-exist-in-a-file –