2016-11-06 6 views
1

이상한 오류가 발생했습니다. 나는 아주 간단한 코드를 가지고 있지만 클래스가 발견되지 않으면 오류가 계속 발생한다.Pipedrive 클래스를 찾을 수 없습니까?

내가 점점 오전 오류가

는 는 치명적인 오류

: 클래스 'pipedriveintegrationConfig은'줄에 /home/preston/public_html/fullslate-pipedrive/index.php에없는 네 여기

은 index.php를하다 config.php를위한

require_once 'config.php'; 
require_once pipedriveintegrationConfig::PHP_LIB; 
require_once 'fullslate.php'; 
require_once 'pipedrive.php'; 
require_once 'fullslate-pipedrive.php'; 

pipedriveintegrationConfig::init(); 

if ($_SERVER['argc'] > 1) { 
    $action = $_SERVER['argv'][1]; 
} else 
if (isset($_GET['action'])) { 
    $action = $_GET['action']; 
} 


if ($action) { 
    switch($action) { 
     case 'sync-clients': 
      $client = new pipedriveintegrationFullslatePipedrive(pipedriveintegrationFullslateConfig::toArray(), pipedriveintegrationPipedriveConfig::toArray()); 
      $client->syncClients(); 
      break; 
     default: 
      throw new CustomException('Unknown command line action: ', $action); 
      break; 
    } 

} else { 

if (file_exists(__DIR__ . '/test.php')) { 
    require_once __DIR__ . '/test.php'; 
} 

} 

코드

namespace pipedriveintegration; 

class PipedriveConfig{ 
    const URL = 'https://api.pipedrive.com/v1'; 
    const API_TOKEN = 'XXXXXXXXXXXXXXXXXXXXXXX'; 

    const STAGE_ID_NEW_PROSPECT = 1; 
    const STAGE_ID_CONSULTATION_SCHEDULED = 3; 

    public static 
    function toArray() { 
     return array('url' => self::URL, 'api_token' => self::API_TOKEN, 'stage_id_new_prospect' => self::STAGE_ID_NEW_PROSPECT, 'stage_id_consultation_scheduled' => self::STAGE_ID_CONSULTATION_SCHEDULED,); 
    } 

} 

class FullslateConfig{ 
    const URL = 'https://slcguitar.fullslate.com/api'; 
    const API_TOKEN = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXx'; 
    public static 
    function toArray() { 
     return array('url' => self::URL, 'api_token' => self::API_TOKEN,); 
    } 

} 

/////////////////////////////////////////////////////////////////////////////////////////////////// 
class Config{ 

    const PHP_LIB = 'PHPLib.php'; 

    const USE_TIMESTAMP = false; 
    //'2014-12-15'; 
    public static 
    function init() { 
     APP::init(array('mode' => 'development','log' => array('level' => Log::LEVEL_ALL, 'append' => true, 'limit' => 10,), 'curl' => array('log' => false, 'retry' => 3,),'temp' => array('path' => __DIR__, 'active' => true,),)); 
    } 
} 

class PDEBUG{ 
    const USE_FIDDLER = false; 
} 

확실하지 WRO입니다 나 지금하고 있니?

답변

1

당신은에 필요한 변경해야합니다. 상수는 클래스 Config 안에 있습니다.

어떤 PHP 버전을 사용하고 있는지 알 수는 없지만 5.6에서 테스트했으며 작동합니다.

1

API 토큰을 제거하고 모든 사람에게 내 계정에 대한 액세스 권한을 부여하는 API 토큰을 게시하여 응용 프로그램에서 다시 생성하십시오. 네임 스페이스가 pipedriveintegration하지 pipedriveintegrationConfig입니다

require_once \pipedriveintegration\Config::PHP_LIB; 

: