require_once INCLUDES_DIR."/class/Config.php"; # File: SQL # See Also: # require_once INCLUDES_DIR."/class/SQL.php"; # File: Model # See Also: # require_once INCLUDES_DIR."/class/Model.php"; # File: User # See Also: # require_once INCLUDES_DIR."/model/User.php"; # File: Visitor # See Also: # require_once INCLUDES_DIR."/model/Visitor.php"; # File: Post # See Also: # require_once INCLUDES_DIR."/model/Post.php"; # File: Page # See Also: # require_once INCLUDES_DIR."/model/Page.php"; # File: Group # See Also: # require_once INCLUDES_DIR."/model/Group.php"; # File: Session # See Also: # require_once INCLUDES_DIR."/class/Session.php"; # File: Flash # See Also: # require_once INCLUDES_DIR."/class/Flash.php"; # File: Theme # See Also: # require_once INCLUDES_DIR."/class/Theme.php"; # File: Trigger # See Also: # require_once INCLUDES_DIR."/class/Trigger.php"; # File: Module # See Also: # require_once INCLUDES_DIR."/class/Modules.php"; # File: Feathers # See Also: # require_once INCLUDES_DIR."/class/Feathers.php"; # File: Paginator # See Also: # require_once INCLUDES_DIR."/class/Paginator.php"; # File: Twig # Chyrp's templating engine. require_once INCLUDES_DIR."/class/Twig.php"; # File: Route # See Also: # require_once INCLUDES_DIR."/class/Route.php"; # File: Main # See Also: #
require_once INCLUDES_DIR."/controller/Main.php"; # File: Admin # See Also: # require_once INCLUDES_DIR."/controller/Admin.php"; # File: Feather # See Also: # require_once INCLUDES_DIR."/interface/Feather.php"; # Set the error handler to exit on error if this is being run from the tester. if (TESTER) set_error_handler("error_panicker"); # Redirect to the installer if there is no config. if (!file_exists(INCLUDES_DIR."/config.yaml.php")) redirect("install.php"); # Start the timer that keeps track of Chyrp's load time. timer_start(); # Load the config settings. $config = Config::current(); # Prepare the SQL interface. $sql = SQL::current(); # Set the timezone for date(), etc. set_timezone($config->timezone); # Initialize connection to SQL server. $sql->connect(); # Sanitize all input depending on magic_quotes_gpc's enabled status. sanitize_input($_GET); sanitize_input($_POST); sanitize_input($_COOKIE); sanitize_input($_REQUEST); # Begin the session. session(); # Set the locale for gettext. set_locale($config->locale); # Load the translation engine. load_translator("chyrp", INCLUDES_DIR."/locale/".$config->locale.".mo"); # Constant: PREVIEWING # Is the user previewing a theme? define('PREVIEWING', !ADMIN and !empty($_SESSION['theme'])); # Constant: THEME_DIR # Absolute path to /themes/(current/previewed theme) define('THEME_DIR', MAIN_DIR."/themes/".(PREVIEWING ? $_SESSION['theme'] : $config->theme)); # Constant: THEME_URL # URL to /themes/(current/previewed theme) define('THEME_URL', $config->chyrp_url."/themes/".(PREVIEWING ? $_SESSION['theme'] : $config->theme)); # Initialize the theme. $theme = Theme::current(); # Load the Visitor. $visitor = Visitor::current(); # Prepare the notifier. $flash = Flash::current(); # Initiate the extensions. init_extensions(); # Prepare the trigger class $trigger = Trigger::current(); # Filter the visitor immediately after the Modules are initialized. # Example usage scenario: custom auth systems (e.g. OpenID) $trigger->filter($visitor, "visitor"); # First general-purpose trigger. There are many cases you may want to use @route_init@ instead of this, however. $trigger->call("runtime"); # Set the content-type to the theme's "type" setting, or "text/html". header("Content-type: ".(INDEX ? fallback($theme->type, "text/html") : "text/html")."; charset=UTF-8");