-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* unix 개행문자 수정
- Loading branch information
Showing
28 changed files
with
9,571 additions
and
9,571 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,60 @@ | ||
<?php | ||
/// Copyright (c) 2004-2008, Needlworks / Tatter Network Foundation | ||
/// All rights reserved. Licensed under the GPL. | ||
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT) | ||
|
||
/** | ||
This file... | ||
is executed AT FIRST. | ||
specifies the main workflow of Textcube 2.0. | ||
*/ | ||
define('TEXTCUBE_VERSION', '2.0'); | ||
define('ROOT', '.'); | ||
|
||
/// Load config.php. | ||
if (file_exists(ROOT.'/config.php')) { | ||
require_once(ROOT.'/config.php'); | ||
} else { | ||
require(ROOT.'/setup.php'); | ||
exit; | ||
} | ||
|
||
/// Initialize class loader. | ||
include(ROOT.'/framework/base.php'); | ||
include(ROOT.'/framework/settings.php'); | ||
include(ROOT.'/framework/loader.php'); | ||
$config = Config::getInstance(); | ||
|
||
// Parse and normalize URI. */ | ||
/* TODO: Unify the environment and do work-arounds. (For IIS, Apache - mod_php or fastcgi, lighttpd, and etc.) */ | ||
// Structure of fancy URL: | ||
// host + blog prefix + interface path + pagination info + extra arguments not in $_REQUEST | ||
// TODO: Apply this structure to $context->accessInfo... | ||
try { | ||
$context = Context::getInstance(); // automatic initialization via first instanciation | ||
} catch (URIError $e) { | ||
// Check existence of interface path. | ||
if ($config->service['debugmode']) | ||
echo $e; | ||
exit; | ||
} | ||
|
||
/* Special pre-handlers. (favicon.ico, index.gif) */ | ||
if ($context->accessInfo['prehandler']) { | ||
// Skip further processes such as session management. | ||
require(ROOT.'/'.$context->accessInfo['interfacePath']); | ||
exit; | ||
} | ||
|
||
/* TODO: Session management. */ | ||
|
||
// TODO: Do input validation as soon as possible? | ||
/* Load final interface handler. */ | ||
// Each interface... | ||
// validates passed arguments through IV. | ||
// specify required ACL/permissions and check them. | ||
// loads its necessary libraries, models and components. | ||
// before actual execution. | ||
require(ROOT.'/'.$context->accessInfo['interfacePath']); | ||
|
||
?> | ||
<?php | ||
/// Copyright (c) 2004-2008, Needlworks / Tatter Network Foundation | ||
/// All rights reserved. Licensed under the GPL. | ||
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT) | ||
|
||
/** | ||
This file... | ||
is executed AT FIRST. | ||
specifies the main workflow of Textcube 2.0. | ||
*/ | ||
define('TEXTCUBE_VERSION', '2.0'); | ||
define('ROOT', '.'); | ||
|
||
/// Load config.php. | ||
if (file_exists(ROOT.'/config.php')) { | ||
require_once(ROOT.'/config.php'); | ||
} else { | ||
require(ROOT.'/setup.php'); | ||
exit; | ||
} | ||
|
||
/// Initialize class loader. | ||
include(ROOT.'/framework/base.php'); | ||
include(ROOT.'/framework/settings.php'); | ||
include(ROOT.'/framework/loader.php'); | ||
$config = Config::getInstance(); | ||
|
||
// Parse and normalize URI. */ | ||
/* TODO: Unify the environment and do work-arounds. (For IIS, Apache - mod_php or fastcgi, lighttpd, and etc.) */ | ||
// Structure of fancy URL: | ||
// host + blog prefix + interface path + pagination info + extra arguments not in $_REQUEST | ||
// TODO: Apply this structure to $context->accessInfo... | ||
try { | ||
$context = Context::getInstance(); // automatic initialization via first instanciation | ||
} catch (URIError $e) { | ||
// Check existence of interface path. | ||
if ($config->service['debugmode']) | ||
echo $e; | ||
exit; | ||
} | ||
|
||
/* Special pre-handlers. (favicon.ico, index.gif) */ | ||
if ($context->accessInfo['prehandler']) { | ||
// Skip further processes such as session management. | ||
require(ROOT.'/'.$context->accessInfo['interfacePath']); | ||
exit; | ||
} | ||
|
||
/* TODO: Session management. */ | ||
|
||
// TODO: Do input validation as soon as possible? | ||
/* Load final interface handler. */ | ||
// Each interface... | ||
// validates passed arguments through IV. | ||
// specify required ACL/permissions and check them. | ||
// loads its necessary libraries, models and components. | ||
// before actual execution. | ||
require(ROOT.'/'.$context->accessInfo['interfacePath']); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
<?php | ||
/// Copyright (c) 2004-2008, Needlworks / Tatter Network Foundation | ||
/// All rights reserved. Licensed under the GPL. | ||
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT) | ||
|
||
/// Singleton implementation. | ||
abstract class Singleton { | ||
private static $instances = array(); | ||
|
||
protected function __construct() { | ||
} | ||
|
||
final protected static function _getInstance($className) { | ||
if (!array_key_exists($className, self::$instances)) { | ||
self::$instances[$className] = new $className(); | ||
} | ||
return self::$instances[$className]; | ||
} | ||
|
||
/* | ||
// You should implement this method to the final class. (An example is below.) | ||
// This is mainly because "late static bindings" is supported after PHP 5.3. | ||
public static function getInstance() { | ||
return self::_getInstance(__CLASS__); | ||
} | ||
*/ | ||
abstract public static function getInstance(); | ||
} | ||
|
||
?> | ||
<?php | ||
/// Copyright (c) 2004-2008, Needlworks / Tatter Network Foundation | ||
/// All rights reserved. Licensed under the GPL. | ||
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT) | ||
|
||
/// Singleton implementation. | ||
abstract class Singleton { | ||
private static $instances = array(); | ||
|
||
protected function __construct() { | ||
} | ||
|
||
final protected static function _getInstance($className) { | ||
if (!array_key_exists($className, self::$instances)) { | ||
self::$instances[$className] = new $className(); | ||
} | ||
return self::$instances[$className]; | ||
} | ||
|
||
/* | ||
// You should implement this method to the final class. (An example is below.) | ||
// This is mainly because "late static bindings" is supported after PHP 5.3. | ||
public static function getInstance() { | ||
return self::_getInstance(__CLASS__); | ||
} | ||
*/ | ||
abstract public static function getInstance(); | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
<?php | ||
/// Copyright (c) 2004-2008, Needlworks / Tatter Network Foundation | ||
/// All rights reserved. Licensed under the GPL. | ||
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT) | ||
|
||
interface ICache | ||
{ | ||
public function __construct($type); | ||
public function setEntry($key, $expirationDue); | ||
public function getEntry($key, $clear = false); | ||
|
||
public static function generateKey(); | ||
} | ||
?> | ||
<?php | ||
/// Copyright (c) 2004-2008, Needlworks / Tatter Network Foundation | ||
/// All rights reserved. Licensed under the GPL. | ||
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT) | ||
|
||
interface ICache | ||
{ | ||
public function __construct($type); | ||
public function setEntry($key, $expirationDue); | ||
public function getEntry($key, $clear = false); | ||
|
||
public static function generateKey(); | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
/// Copyright (c) 2004-2008, Needlworks / Tatter Network Foundation | ||
/// All rights reserved. Licensed under the GPL. | ||
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT) | ||
|
||
?> | ||
<?php | ||
/// Copyright (c) 2004-2008, Needlworks / Tatter Network Foundation | ||
/// All rights reserved. Licensed under the GPL. | ||
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT) | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
<?php | ||
/// Copyright (c) 2004-2008, Needlworks / Tatter Network Foundation | ||
/// All rights reserved. Licensed under the GPL. | ||
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT) | ||
|
||
interface IAdapter | ||
{ | ||
public function connect($server, $dbname, $userid, $password, array $options); | ||
public function disconnect(); | ||
public function beginTransaction(); | ||
public function endTransaction($apply = true); | ||
public function query($query); | ||
public static function escapeString($var); | ||
public static function escapeFieldName($var); | ||
} | ||
|
||
class DBException extends Exception {} | ||
class DBConnectionError extends DBException {} | ||
class DBQueryError extends DBException {} | ||
|
||
?> | ||
<?php | ||
/// Copyright (c) 2004-2008, Needlworks / Tatter Network Foundation | ||
/// All rights reserved. Licensed under the GPL. | ||
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT) | ||
|
||
interface IAdapter | ||
{ | ||
public function connect($server, $dbname, $userid, $password, array $options); | ||
public function disconnect(); | ||
public function beginTransaction(); | ||
public function endTransaction($apply = true); | ||
public function query($query); | ||
public static function escapeString($var); | ||
public static function escapeFieldName($var); | ||
} | ||
|
||
class DBException extends Exception {} | ||
class DBConnectionError extends DBException {} | ||
class DBQueryError extends DBException {} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
<?php | ||
/// Copyright (c) 2004-2008, Needlworks / Tatter Network Foundation | ||
/// All rights reserved. Licensed under the GPL. | ||
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT) | ||
|
||
interface IModel | ||
{ | ||
static function _createTable(); | ||
static function _dropTable(); | ||
static function _dumpTable(); | ||
|
||
public function setField($fieldName, $value); | ||
public function __set($fieldName, $value); | ||
public function getField($fieldName); | ||
public function __get($fieldName); | ||
|
||
public static function findAll(array $condition); | ||
public static function deleteAll(array $condition); | ||
public static function get($id); | ||
public static function create(array $fields); | ||
|
||
public function save(array $options); | ||
public function delete(); | ||
} | ||
?> | ||
<?php | ||
/// Copyright (c) 2004-2008, Needlworks / Tatter Network Foundation | ||
/// All rights reserved. Licensed under the GPL. | ||
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT) | ||
|
||
interface IModel | ||
{ | ||
static function _createTable(); | ||
static function _dropTable(); | ||
static function _dumpTable(); | ||
|
||
public function setField($fieldName, $value); | ||
public function __set($fieldName, $value); | ||
public function getField($fieldName); | ||
public function __get($fieldName); | ||
|
||
public static function findAll(array $condition); | ||
public static function deleteAll(array $condition); | ||
public static function get($id); | ||
public static function create(array $fields); | ||
|
||
public function save(array $options); | ||
public function delete(); | ||
} | ||
?> |
Oops, something went wrong.