그누보드 common 찾기

작성자 정보

  • 작성자 관리자
  • 작성일

컨텐츠 정보

본문

// 그누보드 common.php 탐색

$common_path = '';
for ($i=0; $i<10; $i++) {
    if (file_exists($common_path.'common.php')) {
        include_once($common_path.'common.php');
        break;
    }
    $common_path .= '../';
}


$__paths = array(
    __DIR__ . '/../../../common.php',
    __DIR__ . '/../../../../common.php',
    __DIR__ . '/../../../../../common.php'
);
foreach($__paths as $__p) {
    if (is_file($__p)) { include_once($__p); break; }
}


$path = __DIR__;

while ($path != '/') {
    if (file_exists($path.'/common.php')) {
        include_once $path.'/common.php';
        break;
    }
    $path = dirname($path);
}

관련자료

댓글 0
등록된 댓글이 없습니다.
알림 0