Ejemplo n.º 1
0
 /**
  * CentralData::startBody()
  * 
  * @param mixed $method
  * @return void
  */
 protected static function startBody($method)
 {
     $api_key = Config::Get('VACENTRAL_API_KEY');
     # Determine the type
     self::$type = strtolower(trim(Config::Get('VACENTRAL_DATA_FORMAT')));
     if (self::$type !== 'xml' && self::$type !== 'json') {
         self::$type = 'xml';
     }
     if (self::$type == 'xml') {
         self::$xml = new SimpleXMLElement('<vacentral/>');
     } elseif (self::$type == 'json') {
         self::$json = array();
     }
     self::$method = $method;
     self::addElement(null, 'siteurl', SITE_URL);
     self::addElement(null, 'apikey', $api_key);
     self::addElement(null, 'version', PHPVMS_VERSION);
     self::addElement(null, 'method', $method);
     if (Config::Get('VACENTRAL_DEBUG_MODE') == true) {
         self::addElement(null, 'debug', true);
     }
 }