Skip to content

Commit

Permalink
#1052: interface 기본 구조 잡기
Browse files Browse the repository at this point in the history
  • Loading branch information
achimnol committed Jul 7, 2008
1 parent 2199cb1 commit 20fbc1b
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 0 deletions.
14 changes: 14 additions & 0 deletions framework/cache/ICache.php
Original file line number Diff line number Diff line change
@@ -0,0 +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();
}
?>
6 changes: 6 additions & 0 deletions framework/data/Condition.php
Original file line number Diff line number Diff line change
@@ -0,0 +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)

?>
15 changes: 15 additions & 0 deletions framework/data/IAdapter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?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 IDBAdapter
{
public function connect($server, $userid, $password, array $options);
public function disconnect();
public function beginTransaction();
public function endTransaction();
public function query($query);
}

?>
25 changes: 25 additions & 0 deletions framework/data/IModel.php
Original file line number Diff line number Diff line change
@@ -0,0 +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, $value);
public function __get($fieldName, $value);

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();
}
?>
16 changes: 16 additions & 0 deletions framework/dispatcher.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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 called AT FIRST to parse URL and query strings.

/* TODO: Load config.php */

/* TODO: Unify the URI strings / workaround (IIS, Apache - mod_php or fastcgi, lighttpd, and etc.) */

/* TODO: Special pre-handlers (favicon.ico, index.gif) */

/* TODO: Load interface */

?>

0 comments on commit 20fbc1b

Please sign in to comment.