} if (posix_getuid() != 0) { die("Cannot be used in web server mode\n\n"); } if (preg_match("#schedule-id=([0-9]+)#", implode(" ", $argv), $re)) { $GLOBALS["SCHEDULE_ID"] = $re[1]; } include_once dirname(__FILE__) . "/ressources/class.user.inc"; include_once dirname(__FILE__) . "/ressources/class.system.network.inc"; include_once dirname(__FILE__) . "/ressources/class.os.system.inc"; include_once dirname(__FILE__) . "/ressources/class.mysql.inc"; include_once dirname(__FILE__) . "/ressources/class.templates.inc"; include_once dirname(__FILE__) . '/framework/class.unix.inc'; include_once dirname(__FILE__) . '/framework/frame.class.inc'; if ($argv[1] == "--plugins") { setPlugins(); exit; } build(); function build() { $webappFile = null; $tomcatDir = "/var/lib/tomcat6/webapps"; if (!is_dir($tomcatDir)) { echo "Starting......: " . date("H:i:s") . " C.A.S server failed `{$tomcatDir}` no such directory...\n"; return; } $unix = new unix(); $dirfiles = $unix->DirFiles("/usr/share/cas-server/modules", "cas-server-webapp-.*?\\.war"); echo "Starting......: " . date("H:i:s") . " C.A.S server checking libraries...\n"; echo "Starting......: " . date("H:i:s") . " C.A.S server TomCat webapps `{$tomcatDir}`\n";
/** *Starts Orongo! :) * @param String $paramCurrentPage the current page */ function startOrongo($paramCurrentPage = 'anonymous') { session_start(); define("ROOT", dirname(__FILE__)); define("LIB", ROOT . "/lib"); define("ADMIN", ROOT . "/orongo-admin"); define("CONFIG", ROOT . "/config.php"); define('RANK_ADMIN', 3); define('RANK_WRITER', 2); define('RANK_USER', 1); define('ARTICLE_NOT_EXIST', 2100); define('PAGE_NOT_EXIST', 3100); define('USER_NOT_EXIST', 4100); define('COMMENT_NOT_EXIST', 5100); error_reporting(E_ALL); if (file_exists("orongo-install.php")) { die("If you didn't install OrongoCMS yet, proceed to the <a href='orongo-install.php'>installer</a><br/>If you installed it, please delete orongo-install.php"); } if (!file_exists(CONFIG)) { die("config.php (" . CONFIG . ") was missing!"); } require_once CONFIG; require LIB . '/function_load.php'; try { load(LIB); } catch (Exception $e) { die($e->getMessage()); } setDatabase(new Database(CONFIG)); try { setLanguage(new Language(ADMIN . '/lang/' . Settings::getLanguageName())); } catch (Exception $e) { $msgbox = new MessageBox(); $msgbox->bindException($e); die($msgbox->getImports() . $msgbox->toHTML()); } setCurrentPage($paramCurrentPage); $style = null; try { $style = Settings::getStyle(); } catch (Exception $e) { $msgbox = new MessageBox(); $msgbox->bindException($e); die($msgbox->getImports() . $msgbox->toHTML()); } setMenu(new Menu()); setStyle($style); setDisplay(new Display($style->getStylePath())); setUser(handleSessions()); if (defined('HACK_PLUGINS') && HACK_PLUGINS == true) { Plugin::hackKeys(); } try { setPlugins(Plugin::getActivatedPlugins('orongo-admin/')); } catch (Exception $e) { $msgbox = new MessageBox(); $msgbox->bindException($e); getDisplay()->addObject($msgbox); } //getLanguage()->setTempLanguage(ADMIN . '/lang/en_US'); OrongoDefaultEventHandlers::init(); }