Esempio n. 1
0
 /**
  * Get singleton instance.
  *
  * @return Flancer32_PayPalApi_Config
  */
 public static function get()
 {
     if (is_null(self::$_instance)) {
         self::$_instance = new Flancer32_PayPalApi_Config();
     }
     return self::$_instance;
 }
 public function test_initClassLoader()
 {
     $cfg = Config::get();
     $helper = $cfg->helper();
     $this->assertTrue($helper instanceof Flancer32_PayPalApi_Helper_Data);
     $helper->initClassLoader();
     $address = new \PayPal\Api\Address();
     $this->assertTrue($address instanceof PayPal\Api\Address);
 }
Esempio n. 3
0
 /**
  * Init class loader to load PayPal classes from ./vendor/ catalog (composer scheme) or using path to SDK lib
  * directory.
  */
 public function initClassLoader()
 {
     if (!self::$_isClassLoaderProcessed) {
         self::$_isClassLoaderProcessed = true;
         $cfg = Config::get();
         $path = $cfg->sysPathToSdk();
         if ($path && is_dir($path)) {
             /* SDK should be loaded from external path */
             $this->_initClassLoaderFromCfgPath($path);
         } else {
             /* SDK should be loaded from composer's vendor directory */
             $this->_initClassLoaderFromVendor();
         }
     }
 }
 public function test_cfg()
 {
     $cfg = Config::get();
     $this->assertTrue(is_string($cfg->sysPathToSdk()));
 }