Public Member Functions | |
load () | |
save () |
Definition at line 35 of file Curl.php.
load | ( | ) |
Implements Varien_Convert_Adapter_Interface.
Definition at line 38 of file Curl.php.
00039 { 00040 // we expect <var name="uri">http://...</var> 00041 $uri = $this->getVar('uri'); 00042 00043 // validate input parameter 00044 if (!Zend_Uri::check($uri)) { 00045 $this->addException("Expecting a valid 'uri' parameter"); 00046 } 00047 00048 // use Varien curl adapter 00049 $http = new Varien_Http_Adapter_Curl; 00050 00051 // send GET request 00052 $http->write('GET', $uri); 00053 00054 // read the remote file 00055 $data = $http->read(); 00056 00057 $data = preg_split('/^\r?$/m', $data, 2); 00058 $data = trim($data[1]); 00059 00060 // save contents into container 00061 $this->setData($data); 00062 00063 return $this; 00064 }
save | ( | ) |