+
+ // BC layer
+
+ public function __get($name)
+ {
+ //trigger_error('getting property Response::' . $name . ' is deprecated', E_USER_DEPRECATED);
+
+ switch($name) {
+ case 'hdrs':
+ return $this->httpResponse['headers'];
+ case '_cookies':
+ return $this->httpResponse['cookies'];
+ case 'raw_data':
+ return $this->httpResponse['raw_data'];
+ default:
+ $trace = debug_backtrace();
+ trigger_error('Undefined property via __get(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING);
+ return null;
+ }
+ }
+
+ public function __set($name, $value)
+ {
+ //trigger_error('setting property Response::' . $name . ' is deprecated', E_USER_DEPRECATED);
+
+ switch($name) {
+ case 'hdrs':
+ $this->httpResponse['headers'] = $value;
+ break;
+ case '_cookies':
+ $this->httpResponse['cookies'] = $value;
+ break;
+ case 'raw_data':
+ $this->httpResponse['raw_data'] = $value;
+ break;
+ default:
+ $trace = debug_backtrace();
+ trigger_error('Undefined property via __set(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING);
+ }
+ }
+
+ public function __isset($name)
+ {
+ switch($name) {
+ case 'hdrs':
+ return isset($this->httpResponse['headers']);
+ case '_cookies':
+ return isset($this->httpResponse['cookies']);
+ case 'raw_data':
+ return isset($this->httpResponse['raw_data']);
+ default:
+ return false;
+ }
+ }
+
+ public function __unset($name)
+ {
+ switch($name) {
+ case 'hdrs':
+ unset($this->httpResponse['headers']);
+ break;
+ case '_cookies':
+ unset($this->httpResponse['cookies']);
+ break;
+ case 'raw_data':
+ unset($this->httpResponse['raw_data']);
+ break;
+ default:
+ $trace = debug_backtrace();
+ trigger_error('Undefined property via __unset(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING);
+ }
+ }