pickles/Pickles.php
Josh Sherman 046d265347 Added the new classes and stuff.
git-svn-id: http://svn.cleancode.org/svn/pickles@30 4d10bc64-7434-11dc-a737-d2d0f8310089
2008-07-12 23:28:44 +00:00

61 lines
1.4 KiB
PHP
Executable file

<?php
date_default_timezone_set('America/New_York');
// @todo no hard coded paths
//define('PICKLES_PATH', '/var/www/josh/common/');
define('PATH', getcwd() . '/');
function __autoload($class) {
// @todo fix the path when we move to prod
//$file = PICKLES_PATH . 'pickles_classes/' . str_replace('_', '/', $class) . '.php';
$file = PATH . '../../common/pickles_classes/' . str_replace('_', '/', $class) . '.php';
if (file_exists($file)) {
require_once $file;
}
}
class Pickles extends Object {
protected $config = null;
private $controller = null;
public function __construct($site, $controller = 'Web') {
parent::__construct();
// Load the config for the site passed in
$this->config = Config::getInstance();
$this->config->load($site);
// Generate a generic "site down" message
if ($this->config->get('disabled')) {
exit("<h2><em>{$_SERVER['SERVER_NAME']} is currently down for maintenance</em></h2>");
}
new Controller($controller);
}
}
/*
if (Config::getSession() && !isset($_SESSION)) {
session_start();
}
// Use the FCKeditor instead of textareas
// @todo add a wrapper for these two
if (Config::getFCKEditor()) {
require_once JLIB_PATH . 'common/static/fckeditor/fckeditor.php';
}
// Load up MagpieRSS is so desired
if (Config::getMagpieRSS()) {
require_once JLIB_PATH . '/var/www/josh/common/contrib/magpierss/rss_fetch.inc';
}
//Request::load();
*/
?>