PayPal\Core\PPConfigManager::getConfigWithDefaults PHP Метод

getConfigWithDefaults() публичный статический Метод

use the default configuration if it is not passed in hashmap
public static getConfigWithDefaults ( $config = null )
    public static function getConfigWithDefaults($config = null)
    {
        if (!is_array(PPConfigManager::getInstance()->getConfigHashmap()) && $config == null) {
            return PPConfigManager::$defaults;
        }
        return array_merge(PPConfigManager::$defaults, $config != null ? $config : PPConfigManager::getInstance()->getConfigHashmap());
    }

Usage Example

Пример #1
0
 /**
  *
  * @param string $postData OPTIONAL post data. If null,
  * 				the class automatically reads incoming POST data
  * 				from the input stream
  */
 public function __construct($postData = '', $config = null)
 {
     $this->config = PPConfigManager::getConfigWithDefaults($config);
     if ($postData == '') {
         // reading posted data from directly from $_POST may causes serialization issues with array data in POST
         // reading raw POST data from input stream instead.
         $postData = file_get_contents('php://input');
     }
     $rawPostArray = explode('&', $postData);
     foreach ($rawPostArray as $keyValue) {
         $keyValue = explode('=', $keyValue);
         if (count($keyValue) == 2) {
             $this->ipnData[$keyValue[0]] = urldecode($keyValue[1]);
         }
     }
     //var_dump($this->ipnData);
 }
All Usage Examples Of PayPal\Core\PPConfigManager::getConfigWithDefaults