Source for file Ethna.php
Documentation is available at Ethna.php
// vim: foldmethod=marker
* @author Masaki Fujimoto <fujimoto@php.net>
* @license http://www.opensource.org/licenses/bsd-license.php The BSD License
// PEAR OS_WINDOWS constant replacement.
// PEAR の OS_WINDOWS 定数は、defined関数で
// よって require_once 'PEAR.php' とすると
// E_NOTICEが出ることから、Windows環境判定用
if (substr(PHP_OS, 0, 3) ==
'WIN'
define('ETHNA_OS_WINDOWS', true);
} elseif (!defined('ETHNA_OS_WINDOWS')) {
define('ETHNA_OS_WINDOWS', false);
// date.timezone が設定されていないと
// E_STRICT|WARNING が発生する
ini_set('date.timezone', 'Asia/Tokyo');
/** include_path separator(Windows) */
define('PATH_SEPARATOR', ';');
/** include_path separator(Unix) */
define('PATH_SEPARATOR', ':');
if (!defined('DIRECTORY_SEPARATOR')) {
/** directory separator(Windows) */
define('DIRECTORY_SEPARATOR', '\\');
define('DIRECTORY_SEPARATOR', '/');
define('ETHNA_VERSION', '2.5.0');
* PEAR非依存、かつ互換性を維持するためのもの
define('ETHNA_ERROR_DUMMY', 'dummy');
define('ETHNA_BASE', dirname(__FILE__
));
require_once ETHNA_BASE .
'/class/Ethna_ActionClass.php';
require_once ETHNA_BASE .
'/class/Ethna_ActionError.php';
require_once ETHNA_BASE .
'/class/Ethna_ActionForm.php';
require_once ETHNA_BASE .
'/class/Ethna_AppManager.php';
require_once ETHNA_BASE .
'/class/Ethna_AppObject.php';
require_once ETHNA_BASE .
'/class/Ethna_AppSQL.php';
require_once ETHNA_BASE .
'/class/Ethna_AppSearchObject.php';
require_once ETHNA_BASE .
'/class/Ethna_Backend.php';
require_once ETHNA_BASE .
'/class/Ethna_CacheManager.php';
require_once ETHNA_BASE .
'/class/Ethna_Config.php';
require_once ETHNA_BASE .
'/class/Ethna_Controller.php';
require_once ETHNA_BASE .
'/class/Ethna_ClassFactory.php';
require_once ETHNA_BASE .
'/class/Ethna_DB.php';
require_once ETHNA_BASE .
'/class/Ethna_Error.php';
require_once ETHNA_BASE .
'/class/Ethna_Filter.php';
require_once ETHNA_BASE .
'/class/Ethna_Handle.php';
require_once ETHNA_BASE .
'/class/Ethna_I18N.php';
require_once ETHNA_BASE .
'/class/Ethna_Logger.php';
require_once ETHNA_BASE .
'/class/Ethna_MailSender.php';
require_once ETHNA_BASE .
'/class/Ethna_Session.php';
require_once ETHNA_BASE .
'/class/Ethna_Generator.php';
require_once ETHNA_BASE .
'/class/Ethna_UrlHandler.php';
require_once ETHNA_BASE .
'/class/Ethna_Util.php';
require_once ETHNA_BASE .
'/class/Ethna_ViewClass.php';
require_once ETHNA_BASE .
'/class/View/Ethna_View_List.php';
require_once ETHNA_BASE .
'/class/Ethna_Plugin.php';
require_once ETHNA_BASE .
'/class/Ethna_Renderer.php';
require_once ETHNA_BASE .
'/class/CLI/Ethna_CLI_ActionClass.php';
require_once ETHNA_BASE .
'/class/SOAP/Ethna_SOAP_ActionForm.php';
require_once ETHNA_BASE .
'/class/SOAP/Ethna_SOAP_Gateway.php';
require_once ETHNA_BASE .
'/class/SOAP/Ethna_SOAP_GatewayGenerator.php';
require_once ETHNA_BASE .
'/class/SOAP/Ethna_SOAP_Util.php';
require_once ETHNA_BASE .
'/class/SOAP/Ethna_SOAP_WsdlGenerator.php';
define('VAR_TYPE_DATETIME', 4);
define('VAR_TYPE_BOOLEAN', 5);
define('FORM_TYPE_PASSWORD', 2);
define('FORM_TYPE_TEXTAREA', 3);
define('FORM_TYPE_SELECT', 4);
define('FORM_TYPE_CHECKBOX', 6);
define('FORM_TYPE_SUBMIT', 7);
define('FORM_TYPE_BUTTON', 9);
define('FORM_TYPE_HIDDEN', 10);
/** エラーコード: DBユニークキーエラー */
define('E_DB_INVALIDTYPE', 6);
/** エラーコード: セッションエラー(有効期限切れ) */
define('E_SESSION_EXPIRE', 16);
/** エラーコード: セッションエラー(IPアドレスチェックエラー) */
define('E_SESSION_IPCHECK', 17);
/** エラーコード: アクション未定義エラー */
define('E_APP_UNDEFINED_ACTION', 32);
/** エラーコード: アクションクラス未定義エラー */
define('E_APP_UNDEFINED_ACTIONCLASS', 33);
/** エラーコード: アプリケーションオブジェクトID重複エラー */
/** エラーコード: アプリケーションメソッドが存在しない */
/** エラーコード: CSV分割エラー(行継続) */
define('E_UTIL_CSV_CONTINUE', 64);
/** エラーコード: フォーム値型エラー(スカラー引数に配列指定) */
define('E_FORM_WRONGTYPE_SCALAR', 128);
/** エラーコード: フォーム値型エラー(配列引数にスカラー指定) */
define('E_FORM_WRONGTYPE_ARRAY', 129);
/** エラーコード: フォーム値型エラー(整数型) */
define('E_FORM_WRONGTYPE_INT', 130);
/** エラーコード: フォーム値型エラー(浮動小数点数型) */
define('E_FORM_WRONGTYPE_FLOAT', 131);
/** エラーコード: フォーム値型エラー(日付型) */
define('E_FORM_WRONGTYPE_DATETIME', 132);
/** エラーコード: フォーム値型エラー(BOOL型) */
define('E_FORM_WRONGTYPE_BOOLEAN', 133);
/** エラーコード: フォーム値型エラー(FILE型) */
define('E_FORM_WRONGTYPE_FILE', 134);
/** エラーコード: フォーム値必須エラー */
define('E_FORM_REQUIRED', 135);
/** エラーコード: フォーム値最小値エラー(整数型) */
define('E_FORM_MIN_INT', 136);
/** エラーコード: フォーム値最小値エラー(浮動小数点数型) */
define('E_FORM_MIN_FLOAT', 137);
/** エラーコード: フォーム値最小値エラー(文字列型) */
define('E_FORM_MIN_STRING', 138);
/** エラーコード: フォーム値最小値エラー(日付型) */
define('E_FORM_MIN_DATETIME', 139);
/** エラーコード: フォーム値最小値エラー(ファイル型) */
define('E_FORM_MIN_FILE', 140);
/** エラーコード: フォーム値最大値エラー(整数型) */
define('E_FORM_MAX_INT', 141);
/** エラーコード: フォーム値最大値エラー(浮動小数点数型) */
define('E_FORM_MAX_FLOAT', 142);
/** エラーコード: フォーム値最大値エラー(文字列型) */
define('E_FORM_MAX_STRING', 143);
/** エラーコード: フォーム値最大値エラー(日付型) */
define('E_FORM_MAX_DATETIME', 144);
/** エラーコード: フォーム値最大値エラー(ファイル型) */
define('E_FORM_MAX_FILE', 145);
/** エラーコード: フォーム値文字種(正規表現)エラー */
/** エラーコード: フォーム値数値(カスタムチェック)エラー */
define('E_FORM_INVALIDVALUE', 147);
/** エラーコード: フォーム値文字種(カスタムチェック)エラー */
define('E_FORM_INVALIDCHAR', 148);
/** エラーコード: 確認用エントリ入力エラー */
define('E_FORM_CONFIRM', 149);
/** エラーコード: キャッシュタイプ不正 */
define('E_CACHE_INVALID_TYPE', 192);
define('E_CACHE_NO_VALUE', 193);
define('E_CACHE_EXPIRED', 194);
/** エラーコード: キャッシュエラー(その他) */
define('E_CACHE_GENERAL', 195);
/** エラーコード: プラグインが見つからない */
define('E_PLUGIN_NOTFOUND', 196);
/** エラーコード: プラグインエラー(その他) */
define('E_PLUGIN_GENERAL', 197);
if (defined('E_STRICT') ==
false) {
if (defined('E_DEPRECATED') ==
false) {
/** Ethnaグローバル変数: エラーコールバック関数 */
$GLOBALS['_Ethna_error_callback_list'] =
array();
/** Ethnaグローバル変数: エラーメッセージ */
$GLOBALS['_Ethna_error_message_list'] =
array();
* @author Masaki Fujimoto <fujimoto@php.net>
* 渡されたオブジェクトが Ethna_Error オブジェクト
* またはそのサブクラスのオブジェクトかどうかチェックします。
* @param mixed $data チェックする変数
* @param mixed $msgcode チェックするエラーメッセージまたはエラーコード
* @return mixed 変数が、Ethna_Error の場合に TRUEを返します。
* 第2引数が設定された場合は、さらに 所与された $msgcode
function isError($data, $msgcode =
NULL)
} elseif ($data->getCode() ==
$msgcode) {
* Ethna_Errorオブジェクトを生成する(エラーレベル:E_USER_ERROR)
* @param string $message エラーメッセージ
* @param int $code エラーコード
$userinfo =
$userinfo[0];
* Ethna_Errorオブジェクトを生成する(エラーレベル:E_USER_WARNING)
* @param string $message エラーメッセージ
* @param int $code エラーコード
$userinfo =
$userinfo[0];
* Ethna_Errorオブジェクトを生成する(エラーレベル:E_USER_NOTICE)
* @param string $message エラーメッセージ
* @param int $code エラーコード
$userinfo =
$userinfo[0];
* エラー発生時の(フレームワークとしての)コールバック関数を設定する
* @param mixed string:コールバック関数名 array:コールバッククラス(名|オブジェクト)+メソッド名
$GLOBALS['_Ethna_error_callback_list'][] =
$callback;
* エラー発生時の(フレームワークとしての)コールバック関数をクリアする
$GLOBALS['_Ethna_error_callback_list'] =
array();
* エラー発生時の処理を行う(コールバック関数/メソッドを呼び出す)
* @param object Ethna_Error Ethna_Errorオブジェクト
for ($i =
0; $i <
count($GLOBALS['_Ethna_error_callback_list']); $i++
) {
$callback =
& $GLOBALS['_Ethna_error_callback_list'][$i];
// perform some more checks?
$object->$method($error);
Documentation generated on Fri, 11 Nov 2011 03:58:56 +0900 by phpDocumentor 1.4.3