Files
Mozilla/mozilla/webtools/addons/lib/amo.class.php
mike.morgan%oregonstate.edu db730d64b0 .htaccess
added comments and config line for include_path, which is important for install
inc/finish.php, inc/init.php
    adjusted how globals were set up
    tried working with non-global db/tpl but it was not scalable so it was switched back
faq.php, index.php, developers/index.php
    smarty -> tpl
lib/addon.class.php
    proper constructor now in place
lib/amo.class.php
    object definition for all basic objects
    sets up tpl,db globals for use in all extending classes
addon.php
    home page for an addon
item.php
    too generic, nuked it


git-svn-id: svn://10.0.0.236/trunk@176188 18797224-902f-48f8-a5cc-f745e15eee43
2005-07-18 03:50:30 +00:00

42 lines
938 B
PHP

<?php
/**
* AMO master class. This class contains global application logic.
*/
class AMO_Object
{
var $wrapper;
function AMO_Object()
{
// Our DB and Smarty objects are global to save cycles.
global $db, $tpl;
// Pass by reference in order to save memory.
$this->db =& $db;
$this->tpl =& $tpl;
// Default wrapper for AMO template.
$this->wrapper = 'inc/wrappers/default.tpl';
if (DB::isError($this->db)) {
$this->tpl->assign(
array(
'content'=>'site-down.tpl',
'error'=>$this->db->error
)
);
$this->tpl->display($this->wrapper);
exit;
}
}
/**
* Close database connection and display output.
*/
function finish()
{
$this->db->disconnect();
$this->tpl->display($this->wrapper);
}
}