Note: I have a wordpress theme and am using wordpress, but purchased a shopping cart software around 2009 or so. It is likely Php 5.3. My webhost upgraded to Php 5.3 and other Php versions so my shopping cart no longer works. I am assuming the upgrade caused this to stop, but I am not positive. I was told that an update to Php was made that same month and time as when it stopped, so that is my suspicion.
To recap:
The error I get on my shopping cart link is:
Fatal error : Uncaught Error: Call to undefined method LanguageDAO::connect() in /home1/xxxxxxxx/public_html/lib/framework/LanguageDAO.class.php:25 Stack trace: #0 /home1/xxxxxxxx/public_html/lib/framework/Language.class.php(25): LanguageDAO->_getDefault() #1 /home1/xxxxxxxx/public_html/lib/framework/Language.class.php(45): Language->Language(NULL, ‘’) #2 /home1/xxxxxxxx/public_html/conf/paths.inc.php(71): Language::getInstance(NULL, ‘’) #3 /home1/xxxxxxxx/public_html/cart.php(3): require_once(’/home1/xxxxxxxx…’) #4 {main} thrown in /home1/xxxxxxxx/public_html/lib/framework/LanguageDAO.class.php on line 25
The php script in the noted folder (…lib/framework/LanguageDAO.class.php** on line 25 is:
<?php
require_once(dirname(__FILE__) . '/BaseDAO.class.php');
require_once(dirname(__FILE__) . '/BeanMapper.class.php');
class LanguageDAO extends BaseDao {
function LanguageDAO(){ }
function exists($lang){ }
function _getDefault(){
$sql = 'select '
. ' id '
. 'from '
. ' ds_languages '
. 'where '
. ' customer_default = ? '
. '';
$params[] = 'Y';
$this->connect();
$this->prepare($sql, $params);
$queryResult = $this->conn->query($sql, true);
$it = new QueryIterator($queryResult);
while ($it->hasNext()) {
$row = $it->next();
return $row['id'];
}
}
function _populate(&$lang){
$sql = 'select '
. ' code as langCode, '
. ' name as langName, '
. ' charset, '
. ' active as langActive, '
. ' customer_default as customerDefault '
. 'from '
. ' ds_languages '
. 'where '
. ' id = ? '
. '';
$params[] = $lang->getId();
$this->connect();
$this->prepare($sql, $params);
$queryResult = $this->conn->query($sql, true);
$it = new QueryIterator($queryResult);
while ($it->hasNext()) {
$row = $it->next();
BeanMapper::populateBean($lang, $row);
}
}
function update($lang){
$sql = 'update ds_languages set '
. ' code = ?, '
. ' name = ?, '
. ' active = ?, '
. ' customer_default = ? '
. 'where '
. ' id = ? '
. '';
$params[] = $lang->getLangCode();
$params[] = $lang->getLangName();
$params[] = $lang->getLangActive();
$params[] = $lang->getCustomerDefault();
$params[] = $lang->getId();
$this->connect();
$this->prepare($sql, $params);
$this->conn->query($sql);
}
function getNextId($lang){
$sql = 'select '
. ' max(id)+1 as retval '
. 'from '
. ' ds_languages '
. '';
$this->connect();
$this->prepare($sql, $params);
$queryResult = $this->conn->query($sql);
$it = new QueryIterator($queryResult);
while ($it->hasNext()) {
$row = $it->next();
return $row['retval'];
}
}
function saveNew($lang){
$sql = 'insert into ds_languages '
. ' (code, '
. ' name, '
. ' charset, '
. ' active) '
. 'values '
. ' (?, '
. ' ?, '
. ' ?, '
. ' ?) '
. '';
$params[] = $lang->getLangCode();
$params[] = $lang->getLangName();
$params[] = $lang->getCharset();
$params[] = 'Y';
$this->connect();
$this->prepare($sql, $params);
$this->conn->query($sql);
}
function getLanguageList(){
$sql = 'select '
. ' id, '
. ' code, '
. ' name as label, '
. ' active as active, '
. ' customer_default as xdefault '
. 'from '
. ' ds_languages '
. 'order by '
. ' name '
. '';
$this->connect();
$queryResult = $this->conn->query($sql, true);
$it = new QueryIterator($queryResult);
while ($it->hasNext()) {
$row = $it->next();
$id = $row['id'];
$array[$id]['id'] = $row['id'];
$array[$id]['code'] = $row['code'];
$array[$id]['name'] = $row['label'];
$array[$id]['active'] = $row['active'];
$array[$id]['default'] = $row['xdefault'];
}
return $array;
}
function getMultipleLanguageDropDown($value=null){
$sql = 'select '
. ' code, '
. ' name as label, '
. ' active '
. 'from '
. ' ds_languages '
. 'order by '
. ' label '
. '';
$this->connect();
$queryResult = $this->conn->query($sql, true);
$it = new QueryIterator($queryResult);
while ($it->hasNext()) {
$row = $it->next();
$array[$row['code']] = $row['label'];
if($row['active']){
$avalue[] = $row['code'];
}
}
Util::associativeArrayDropDown2($array, $value ? $value : $avalue);
}
function getActiveLanguages(){
$sql = 'select '
. ' id '
. 'from '
. ' ds_languages '
. 'where '
. ' active = ? '
. 'order by '
. ' customer_default desc, name '
. '';
$params[] = 'Y';
$this->connect();
$this->prepare($sql, $params);
$queryResult = $this->conn->query($sql, true);
$it = new QueryIterator($queryResult);
while ($it->hasNext()) {
$row = $it->next();
$array[] = new Language($row['id']);
}
return $array;
}
function getLanguageDropDown($value=null){
if($actives = $this->getActiveLanguages()){
foreach($actives as $active) {
$ndx = $active->getId();
$label = $active->getLangName();
$array[$ndx] = $label;
}
Util::associativeArrayDropDown($array, $value);
}
}
function delete($lang){
$sql = 'delete from '
. ' ds_languages '
. 'where '
. ' id = ? '
. '';
$params[] = $lang->getId();
$this->connect();
$this->prepare($sql, $params);
$this->conn->query($sql);
}
function getLanguageName(&$lang){
$sql = 'select '
. ' name as langName '
. 'from '
. ' ds_languages '
. 'where '
. ' code = ? '
. '';
$params[] = $lang->getLangCode();
$this->connect();
$this->prepare($sql, $params);
$queryResult = $this->conn->query($sql, true);
$it = new QueryIterator($queryResult);
while ($it->hasNext()) {
$row = $it->next();
BeanMapper::populateBean($lang, $row);
}
}
/*
* @param object $lang
* @return boolean
* @author Matt R.
*/
function existsByName($lang){
$sql = 'select ' .
' count(id) as total ' .
'from ' .
' ds_languages ' .
'where ' .
' name = ? ' .
'';
$params = array();
$params[] = $lang->getLangName();
$this->connect();
$this->prepare3($sql, $params);
$queryResult = $this->conn->query($sql);
$it = new QueryIterator($queryResult);
while($it->hasNext()){
$row = $it->next();
return ($row['total'] > 0);
}
return false;
}
}
?>