From: konrad Date: Tue, 25 May 2010 17:57:05 +0000 (+0000) Subject: move to new autoload mechanism X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=ae3bac79aa3d66b2596b6ae196b9d795e3dd09e0;p=web%2Fkonrad%2Fsmoke.git move to new autoload mechanism some minor fixes git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@476 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- diff --git a/www/inc/classes/autoload.php b/www/inc/classes/autoload.php index 826fa0c..650654d 100644 --- a/www/inc/classes/autoload.php +++ b/www/inc/classes/autoload.php @@ -10,17 +10,17 @@ // Copyright: See README/COPYING files that come with this distribution // // -include('./inc/classes/event.php'); -include('./inc/classes/room.php'); -include("./inc/classes/random.php"); -include("./inc/classes/order.php"); -include("./inc/classes/ticket.php"); -include("./inc/classes/voucher.php"); -include("./inc/classes/cart.php"); -include('./inc/classes/error.php'); -include('./inc/classes/language_manager.php'); -include('./inc/classes/parser.php'); -include('./inc/classes/config_manager.php'); -include('./inc/classes/customer.php'); -include('./inc/classes/websession.php'); +include_once('./inc/classes/event.php'); +include_once('./inc/classes/room.php'); +include_once("./inc/classes/random.php"); +include_once("./inc/classes/order.php"); +include_once("./inc/classes/ticket.php"); +include_once("./inc/classes/voucher.php"); +include_once("./inc/classes/cart.php"); +include_once('./inc/classes/error.php'); +include_once('./inc/classes/language_manager.php'); +include_once('./inc/classes/parser.php'); +include_once('./inc/classes/config_manager.php'); +include_once('./inc/classes/customer.php'); +include_once('./inc/classes/websession.php'); ?> \ No newline at end of file diff --git a/www/inc/db/autoload.php b/www/inc/db/autoload.php index acbc856..5f60b49 100644 --- a/www/inc/db/autoload.php +++ b/www/inc/db/autoload.php @@ -10,8 +10,8 @@ // Copyright: See README/COPYING files that come with this distribution // // -$AUTOCLASS["BarcodeTable"]='./inc/db/barcodetable.php'; -$AUTOCLASS["DBUpgrade"]='./inc/db/dbupgrade.php'; +wob_autoclass("BarcodeTable",'./inc/db/barcodetable.php'); +wob_autoclass("DBUpgrade",'./inc/db/dbupgrade.php'); include('./inc/db/db_scheme.php'); ?> \ No newline at end of file diff --git a/www/inc/loader.php b/www/inc/loader.php index 9fd54ad..00a6026 100644 --- a/www/inc/loader.php +++ b/www/inc/loader.php @@ -1,6 +1,4 @@ tryConnect(); //move on in loader_nonadmin.php (or admin.php) +include("./inc/machine/autoload.php"); ?> \ No newline at end of file diff --git a/www/inc/loader_nonadmin.php b/www/inc/loader_nonadmin.php index 67a3aa8..71b3c51 100644 --- a/www/inc/loader_nonadmin.php +++ b/www/inc/loader_nonadmin.php @@ -2,8 +2,7 @@ //check database if(!$db->canUseDb()) die("Database is not correctly configured. Giving up."); -//load class-files -include('./inc/classes/autoload.php'); -include("./inc/machine/autoload.php"); +//TODO: convert random into class and move to framework +include_once('./inc/classes/random.php'); ?> \ No newline at end of file diff --git a/www/inc/machine/autoload.php b/www/inc/machine/autoload.php index 8461d74..169a8cb 100644 --- a/www/inc/machine/autoload.php +++ b/www/inc/machine/autoload.php @@ -11,10 +11,10 @@ // // -$AUTOCLASS["Session"]="./inc/machine/session.php"; -$AUTOCLASS["Host"]="./inc/machine/host.php"; -$AUTOCLASS["Template"]="./inc/machine/template.php"; -$AUTOCLASS["Version"]="./inc/machine/version.php"; -$AUTOCLASS["Translation"]="./inc/machine/translation.php"; -$AUTOCLASS["MachineUser"]="./inc/machine/muser.php"; +wob_autoclass("Session","./inc/machine/session.php"); +wob_autoclass("Host","./inc/machine/host.php"); +wob_autoclass("Template","./inc/machine/template.php"); +wob_autoclass("Version","./inc/machine/version.php"); +wob_autoclass("Translation","./inc/machine/translation.php"); +wob_autoclass("MachineUser","./inc/machine/muser.php"); ?> \ No newline at end of file diff --git a/www/inc/rendering/autoload.php b/www/inc/rendering/autoload.php index 71172b2..3458417 100644 --- a/www/inc/rendering/autoload.php +++ b/www/inc/rendering/autoload.php @@ -9,6 +9,6 @@ // +---------------------------------------------------------------------- // $d=dirname(__FILE__); -$AUTOCLASS["EventRender"]=$d.'/event_listing.php'; +wob_autoclass("EventRender",$d.'/event_listing.php'); ?> diff --git a/www/inc/wext/autoload.php b/www/inc/wext/autoload.php index 4ccd728..5ecc9a8 100644 --- a/www/inc/wext/autoload.php +++ b/www/inc/wext/autoload.php @@ -11,20 +11,20 @@ // // -$AUTOCLASS["WOArtist"]="inc/wext/artist.php"; -$AUTOCLASS["WOCartOrder"]="inc/wext/cart.php"; -$AUTOCLASS["WOCustomer"]="inc/wext/customer.php"; -$AUTOCLASS["WOEventPrice"]="inc/wext/event.php"; -$AUTOCLASS["WOEvent"]="inc/wext/event.php"; -$AUTOCLASS["WOFlag"]="inc/wext/flag.php"; -$AUTOCLASS["WOOrder"]="inc/wext/order.php"; -$AUTOCLASS["WOOrderInfo"]="inc/wext/order.php"; -$AUTOCLASS["WOPriceCategory"]="inc/wext/price.php"; -$AUTOCLASS["WORole"]="inc/wext/role.php"; -$AUTOCLASS["WORoom"]="inc/wext/room.php"; -$AUTOCLASS["WOShipping"]="inc/wext/shipping.php"; -$AUTOCLASS["WOTemplate"]="inc/wext/template.php"; -$AUTOCLASS["WOTicket"]="inc/wext/ticket.php"; +wob_autoclass("WOArtist","inc/wext/artist.php"); +wob_autoclass("WOCartOrder","inc/wext/cart.php"); +wob_autoclass("WOCustomer","inc/wext/customer.php"); +wob_autoclass("WOEventPrice","inc/wext/event.php"); +wob_autoclass("WOEvent","inc/wext/event.php"); +wob_autoclass("WOFlag","inc/wext/flag.php"); +wob_autoclass("WOOrder","inc/wext/order.php"); +wob_autoclass("WOOrderInfo","inc/wext/order.php"); +wob_autoclass("WOPriceCategory","inc/wext/price.php"); +wob_autoclass("WORole","inc/wext/role.php"); +wob_autoclass("WORoom","inc/wext/room.php"); +wob_autoclass("WOShipping","inc/wext/shipping.php"); +wob_autoclass("WOTemplate","inc/wext/template.php"); +wob_autoclass("WOTicket","inc/wext/ticket.php"); -$AUTOCLASS["MSmokeTransaction"]="inc/wext/transaction.php"; +wob_autoclass("MSmokeTransaction","inc/wext/transaction.php"); ?> \ No newline at end of file diff --git a/www/inc/wext/event.php b/www/inc/wext/event.php index 9575af2..133a903 100644 --- a/www/inc/wext/event.php +++ b/www/inc/wext/event.php @@ -25,7 +25,9 @@ class WOEventPrice extends WOEventPriceAbstract { global $db; $res=$db->select("ticket","status", "eventid=".$db->escapeInt($this->prop_eventid)." AND pricecategoryid=".$db->escapeInt($this->prop_pricecategoryid)); +// print("!!!hallo:");var_dump($res);print($db->lastError()); $cnt=0; + if($res!==false) foreach($res as $r) if($r["status"] & WTticket::MaskBlock) $cnt++; @@ -41,6 +43,7 @@ class WOEvent extends WOEventAbstract global $db; $res=$db->select("ticket","status", "eventid=".$db->escapeInt($this->prop_id)); $cnt=0; + if($res!==false) foreach($res as $r) if($r["status"] == WTticket::Ordered || $r["status"] == WTticket::Used) $cnt++; diff --git a/www/index.php b/www/index.php index 1d80a91..64a63a0 100644 --- a/www/index.php +++ b/www/index.php @@ -2,6 +2,9 @@ //basics include('inc/loader.php'); include('inc/loader_nonadmin.php'); +//load class-files; TODO: remove most of them +include('./inc/classes/autoload.php'); +//load globals include('inc/global_variables.php'); include('inc/global_functions.php'); include("inc/rendering/autoload.php"); @@ -10,7 +13,6 @@ include("inc/rendering/autoload.php"); include('inc/rendering/submit.php'); //include display scripts -// include('inc/rendering/event_listing.php'); include('inc/rendering/cart_listing.php'); include('inc/rendering/order_listing.php');