2016-11-06 1 views
1

私は奇妙なエラーに直面しています。私は非常に単純なコードを持っていますが、それはクラスが見つからないというエラーを常に与えています。Pipedriveクラスが見つかりませんか?

私は取得していますエラーが

致命的なエラーです:クラス 'pipedriveintegrationConfig' 行4

に/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'; 
} 

} 

コードはWRO

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; 
} 

わからないです私は何をしていますか?

答えて

1

あなたがする必要が変更する必要があります。また、定数はクラスConfigの内部にあります。

使用しているPHPのバージョンはわかりませんが、私は5.6でこれをテストしています。

1

APIトークンを削除してアプリケーションに再作成し、アカウントにすべての人にアクセス権を付与するAPIトークンを公開してください。あなたの名前空間がpipedriveintegrationないpipedriveintegrationConfigある

require_once \pipedriveintegration\Config::PHP_LIB; 

関連する問題