mysql_close(); $now = date("Y-m-d H:i:s"); echo "End CloseWeekendPromotion at {$now} .\n"; } private function CancelWeekendPromotion() { $now = date("Y-m-d H:i:s"); echo "Start CancelWeekendPromotion at {$now} .\n"; mysql_connect($this->_dbhost, $this->_username, $this->_password); @mysql_select_db($this->_dbname) or die(strftime('%c') . " Unable to select database"); mysql_query($this->_query_openweekend0); mysql_query($this->_query_closeweekend1); mysql_close(); $now = date("Y-m-d H:i:s"); echo "End CancelWeekendPromotion at {$now} .\n"; } private function getDBConfig() { $app = Mage::app('default'); $config = Mage::getConfig()->getResourceConnectionConfig("default_setup"); $dbinfo = array("host" => $config->host, "user" => $config->username, "pass" => $config->password, "dbname" => $config->dbname); var_dump($dbinfo); $this->_dbhost = $dbinfo["host"]; $this->_username = $dbinfo["user"]; $this->_password = $dbinfo["pass"]; $this->_dbname = $dbinfo["dbname"]; } } $promotion = new PromotionController(); $promotion->run();