그누보드에 compser vendor 로드하기 > 소스코드

본문 바로가기

회원로그인

회원가입

소스코드

그누보드 그누보드에 compser vendor 로드하기

페이지 정보

profile_image
작성자 최고관리자
댓글 0건 조회 72회 작성일 22-07-22 17:31

본문

그누보드설치폴더/common.php


//==============================================================================
// 공통
//------------------------------------------------------------------------------
$dbconfig_file = G5_DATA_PATH.'/'.G5_DBCONFIG_FILE;     <======== 151 라인
if (file_exists($dbconfig_file)) {
    include_once($dbconfig_file);
    include_once(G5_LIB_PATH.'/common.lib.php');    // 공통 라이브러리

   

    여기에 아래부분를 추가해준다.

//==============================================================================



아래부분 추가

//===========================================================

    // 2022.07.01 추가부분, vendor 와 /lib 폴더의 파일 include 하기
    require (G5_PATH . "/../vendor/autoload.php");

    // /lib 폴더안에 있는 파일들을 로드하기

    // 그누보드 설치폴더 : /board 일때

    // /lib/ 부분 자동로드할때, 필요없으면 지워도 됨

    $extend_file = array();
    $tmp = dir(G5_PATH . "/../lib");
    while ($entry = $tmp->read()) {
        // php 파일만 include 함
        if (preg_match("/(\.php)$/i", $entry))
        $extend_file[] = $entry;
    }

    if(!empty($extend_file) && is_array($extend_file)) {
        natsort($extend_file);

        foreach($extend_file as $file) {
            include_once(G5_PATH . "/../lib/" . $file);
        }
        unset($file);
    }
    unset($extend_file);
//=====================================================

댓글목록

등록된 댓글이 없습니다.