I have a problem with importing a vendor class in my Cakephp 1.3 project on my server.
I have just upgraded from Ubuntu 12.04 LTS server to Ubuntu 14.04 and I hit this problem: my vendor class in not imported corectly and crashes my whole project.
My error looks like this:
xmlDocument = file_get_contents($url); $this->parseXMLDocument(); } /** * parseXMLDocument method * * @access public * @return void */ function parseXMLDocument() { try { $xml = new SimpleXMLElement($this->xmlDocument); $this->date=$xml->Header->PublishingDate; foreach($xml->Body->Cube->Rate as $line) $this->currency[]=array("name"=>$line["currency"], "value"=>$line, "multiplier"=>$line["multiplier"]); } catch(Exception $e) { pr($e); } } /** * getCurs method * * get current exchange rate: example getCurs("USD") * * @access public * @return double */ function getCurs($currency) { foreach($this->currency as $line) if($line["name"]==$currency) return $line["value"]; return "Incorrect currency!"; } function getValue($currency) { foreach($this->currency as $line) if($line["name"]==$currency) return (String)$line["value"]; return "Incorrect currency!"; } }
Fatal error: Class 'cursBnrXML' not found in /var/www/html/amsrentacar/app/app_controller.php on line 875
The code above the Fatal Error is actually the content of the class that was supposed to get imported using:
App::import('Vendor', 'bnr');
$currency = new cursBnrXML("http://www.bnr.ro/nbrfxrates.xml");
This code still works on my local Ubuntu 14.04 LAMPP powered desktop, but not on the server, and I cannot understand why.
Does anyone here have any ideeas?
I really need to get this working ASAP.