[phpheadquarters-devel] SF.net SVN: phpheadquarters:[6] trunk/phpHeadquarters
Status: Planning
Brought to you by:
gabrielevans
From: <po...@us...> - 2009-05-13 04:59:53
|
Revision: 6 http://phpheadquarters.svn.sourceforge.net/phpheadquarters/?rev=6&view=rev Author: poppins Date: 2009-05-13 04:59:45 +0000 (Wed, 13 May 2009) Log Message: ----------- added common, core, and config Added Paths: ----------- trunk/phpHeadquarters/common.php trunk/phpHeadquarters/config.sample.php trunk/phpHeadquarters/includes/core.php Added: trunk/phpHeadquarters/common.php =================================================================== --- trunk/phpHeadquarters/common.php (rev 0) +++ trunk/phpHeadquarters/common.php 2009-05-13 04:59:45 UTC (rev 6) @@ -0,0 +1,41 @@ +<?php +/** + * @version $Id$ + * @copyright Copyright (c) 2009 phpHeadquarters + * @license http://opensource.org/licenses/gpl-3.0.html GNU Public License + * @package core + */ + +/** + * @ignore + */ +if (!defined('IN_PHPHQ')) +{ + die('Access to this file is denied.'); +} + +define('PHPHQ_VERSION', '0.1.0-dev'); + +error_reporting(E_ALL | E_STRICT); + +date_default_timezone_set('UTC'); + +if (file_exists(BASEPATH . 'config.php')) +{ + require BASEPATH . 'config.php'; +} +else +{ + //config does not exist, redirect to installer + exit; +} + +phphq::load('database'); +phphq::$database->connect($db['user'], $db['pass'], $db['type'], $db['host'], $db['prefix']) or die('Unable to access database server. Please contact the webmaster.'); +//connected to database, unset $db variable for extra protection +unset($db); + +//set_error_handler('phphq_error_handler'); + + +?> \ No newline at end of file Property changes on: trunk/phpHeadquarters/common.php ___________________________________________________________________ Added: svn:keywords + Added: trunk/phpHeadquarters/config.sample.php =================================================================== --- trunk/phpHeadquarters/config.sample.php (rev 0) +++ trunk/phpHeadquarters/config.sample.php 2009-05-13 04:59:45 UTC (rev 6) @@ -0,0 +1,14 @@ +<?php + +//database username +$db['user'] = ''; +//database password +$db['pass'] = ''; +//database type (mysqli, postgre, oracle, etc.) +$db['type'] = ''; +//database host +$db['host'] = ''; +//table prefix +$db['prefix'] = ''; + +?> \ No newline at end of file Added: trunk/phpHeadquarters/includes/core.php =================================================================== --- trunk/phpHeadquarters/includes/core.php (rev 0) +++ trunk/phpHeadquarters/includes/core.php 2009-05-13 04:59:45 UTC (rev 6) @@ -0,0 +1,79 @@ +<?php +/** + * @version $Id$ + * @copyright Copyright (c) 2009 phpHeadquarters + * @license http://opensource.org/licenses/gpl-3.0.html GNU Public License + * @package core + */ + +/** + * @ignore + */ +if (!defined('IN_PHPHQ')) +{ + die('Access to this file is denied.'); +} + +/** + * phpHeadquarters lazy loading + * + * __autoload will search includes directory for file with same name + * + * @param string $class_name Class name to attempt loading. + */ +function __autoload($class_name) +{ + if (file_exists(BASEPATH . 'includes' . $class . '.php')) + { + include BASEPATH . 'includes' . $class . '.php'; + return; + } +} + +/** + * phpHeadquarters core registry + * + * @package core + */ +abstract class phphq +{ + public static $instances = array(); + + /** + * Loads the specified object. + * + * @access public + */ + public static function load() + { + } + + /** + * Unloads the specified object. + * + * @access public + */ + public static function unload($instance) + { + } + + /** + * Checks if an object is loaded. + * + * @return bool True if object is loaded otherwise, false. + * @access public + */ + public static function loaded($instance) + { + } + + /** + * Unloads all objects. + * + * @access public + */ + public static function reset() + { + } +} +?> Property changes on: trunk/phpHeadquarters/includes/core.php ___________________________________________________________________ Added: svn:keywords + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |