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