OSDN Git Service

recreate UTF-8 Branch Directory
authormumumu-org <mumumu-org@2ef88817-412d-0410-a32c-8029a115e976>
Thu, 13 Dec 2007 22:10:20 +0000 (22:10 +0000)
committermumumu-org <mumumu-org@2ef88817-412d-0410-a32c-8029a115e976>
Thu, 13 Dec 2007 22:10:20 +0000 (22:10 +0000)
167 files changed:
.cvsignore [deleted file]
.ethna [deleted file]
CHANGES [deleted file]
Ethna.php [deleted file]
LICENSE [deleted file]
README [deleted file]
bin/ethna.bat [deleted file]
bin/ethna.sh [deleted file]
bin/ethna_handle.php [deleted file]
bin/ethna_make_package.php [deleted file]
bin/ethna_make_package.sh [deleted file]
bin/ethna_run_test.php [deleted file]
bin/ethna_run_test.sh [deleted file]
class/Action/Ethna_Action_Info.php [deleted file]
class/Action/Ethna_Action_UnitTest.php [deleted file]
class/CLI/Ethna_CLI_ActionClass.php [deleted file]
class/DB/Ethna_DB_ADOdb.php [deleted file]
class/DB/Ethna_DB_Creole.php [deleted file]
class/DB/Ethna_DB_PEAR.php [deleted file]
class/Ethna_ActionClass.php [deleted file]
class/Ethna_ActionError.php [deleted file]
class/Ethna_ActionForm.php [deleted file]
class/Ethna_AppManager.php [deleted file]
class/Ethna_AppObject.php [deleted file]
class/Ethna_AppSQL.php [deleted file]
class/Ethna_AppSearchObject.php [deleted file]
class/Ethna_Backend.php [deleted file]
class/Ethna_CacheManager.php [deleted file]
class/Ethna_ClassFactory.php [deleted file]
class/Ethna_Config.php [deleted file]
class/Ethna_Controller.php [deleted file]
class/Ethna_DB.php [deleted file]
class/Ethna_Error.php [deleted file]
class/Ethna_Filter.php [deleted file]
class/Ethna_Generator.php [deleted file]
class/Ethna_Handle.php [deleted file]
class/Ethna_I18N.php [deleted file]
class/Ethna_InfoManager.php [deleted file]
class/Ethna_Logger.php [deleted file]
class/Ethna_MailSender.php [deleted file]
class/Ethna_PearWrapper.php [deleted file]
class/Ethna_Plugin.php [deleted file]
class/Ethna_Renderer.php [deleted file]
class/Ethna_Session.php [deleted file]
class/Ethna_SmartyPlugin.php [deleted file]
class/Ethna_UnitTestCase.php [deleted file]
class/Ethna_UnitTestManager.php [deleted file]
class/Ethna_UnitTestReporter.php [deleted file]
class/Ethna_UrlHandler.php [deleted file]
class/Ethna_Util.php [deleted file]
class/Ethna_ViewClass.php [deleted file]
class/Plugin/Cachemanager/Ethna_Plugin_Cachemanager_Localfile.php [deleted file]
class/Plugin/Cachemanager/Ethna_Plugin_Cachemanager_Memcache.php [deleted file]
class/Plugin/Csrf/Ethna_Plugin_Csrf_Session.php [deleted file]
class/Plugin/Ethna_Plugin_Cachemanager.php [deleted file]
class/Plugin/Ethna_Plugin_Csrf.php [deleted file]
class/Plugin/Ethna_Plugin_Filter.php [deleted file]
class/Plugin/Ethna_Plugin_Generator.php [deleted file]
class/Plugin/Ethna_Plugin_Handle.php [deleted file]
class/Plugin/Ethna_Plugin_Logwriter.php [deleted file]
class/Plugin/Ethna_Plugin_Urlhandler.php [deleted file]
class/Plugin/Ethna_Plugin_Validator.php [deleted file]
class/Plugin/Generator/Ethna_Plugin_Generator_Action.php [deleted file]
class/Plugin/Generator/Ethna_Plugin_Generator_ActionTest.php [deleted file]
class/Plugin/Generator/Ethna_Plugin_Generator_AppManager.php [deleted file]
class/Plugin/Generator/Ethna_Plugin_Generator_AppObject.php [deleted file]
class/Plugin/Generator/Ethna_Plugin_Generator_EntryPoint.php [deleted file]
class/Plugin/Generator/Ethna_Plugin_Generator_Plugin.php [deleted file]
class/Plugin/Generator/Ethna_Plugin_Generator_Project.php [deleted file]
class/Plugin/Generator/Ethna_Plugin_Generator_Template.php [deleted file]
class/Plugin/Generator/Ethna_Plugin_Generator_View.php [deleted file]
class/Plugin/Generator/Ethna_Plugin_Generator_ViewTest.php [deleted file]
class/Plugin/Handle/Ethna_Plugin_Handle_AddAction.php [deleted file]
class/Plugin/Handle/Ethna_Plugin_Handle_AddActionTest.php [deleted file]
class/Plugin/Handle/Ethna_Plugin_Handle_AddAppManager.php [deleted file]
class/Plugin/Handle/Ethna_Plugin_Handle_AddAppObject.php [deleted file]
class/Plugin/Handle/Ethna_Plugin_Handle_AddEntryPoint.php [deleted file]
class/Plugin/Handle/Ethna_Plugin_Handle_AddProject.php [deleted file]
class/Plugin/Handle/Ethna_Plugin_Handle_AddTemplate.php [deleted file]
class/Plugin/Handle/Ethna_Plugin_Handle_AddView.php [deleted file]
class/Plugin/Handle/Ethna_Plugin_Handle_AddViewTest.php [deleted file]
class/Plugin/Handle/Ethna_Plugin_Handle_ChannelUpdate.php [deleted file]
class/Plugin/Handle/Ethna_Plugin_Handle_ClearCache.php [deleted file]
class/Plugin/Handle/Ethna_Plugin_Handle_InfoPlugin.php [deleted file]
class/Plugin/Handle/Ethna_Plugin_Handle_InstallPlugin.php [deleted file]
class/Plugin/Handle/Ethna_Plugin_Handle_ListPlugin.php [deleted file]
class/Plugin/Handle/Ethna_Plugin_Handle_MakePluginPackage.php [deleted file]
class/Plugin/Handle/Ethna_Plugin_Handle_PearLocal.php [deleted file]
class/Plugin/Handle/Ethna_Plugin_Handle_UninstallPlugin.php [deleted file]
class/Plugin/Handle/Ethna_Plugin_Handle_UpgradePlugin.php [deleted file]
class/Plugin/Logwriter/Ethna_Plugin_Logwriter_Alertmail.php [deleted file]
class/Plugin/Logwriter/Ethna_Plugin_Logwriter_Default.php [deleted file]
class/Plugin/Logwriter/Ethna_Plugin_Logwriter_Echo.php [deleted file]
class/Plugin/Logwriter/Ethna_Plugin_Logwriter_File.php [deleted file]
class/Plugin/Logwriter/Ethna_Plugin_Logwriter_Syslog.php [deleted file]
class/Plugin/Validator/Ethna_Plugin_Validator_Custom.php [deleted file]
class/Plugin/Validator/Ethna_Plugin_Validator_File.php [deleted file]
class/Plugin/Validator/Ethna_Plugin_Validator_Max.php [deleted file]
class/Plugin/Validator/Ethna_Plugin_Validator_Mbregexp.php [deleted file]
class/Plugin/Validator/Ethna_Plugin_Validator_Min.php [deleted file]
class/Plugin/Validator/Ethna_Plugin_Validator_Regexp.php [deleted file]
class/Plugin/Validator/Ethna_Plugin_Validator_Required.php [deleted file]
class/Plugin/Validator/Ethna_Plugin_Validator_Type.php [deleted file]
class/Renderer/Ethna_Renderer_Smarty.php [deleted file]
class/SOAP/Ethna_SOAP_ActionForm.php [deleted file]
class/SOAP/Ethna_SOAP_Gateway.php [deleted file]
class/SOAP/Ethna_SOAP_GatewayGenerator.php [deleted file]
class/SOAP/Ethna_SOAP_Util.php [deleted file]
class/SOAP/Ethna_SOAP_WsdlGenerator.php [deleted file]
class/View/Ethna_View_Info.php [deleted file]
class/View/Ethna_View_List.php [deleted file]
class/View/Ethna_View_UnitTest.php [deleted file]
misc/_ethna [deleted file]
misc/sample_package.ini [deleted file]
misc/sample_plugin.php [deleted file]
skel/app.action.default.php [deleted file]
skel/app.actionclass.php [deleted file]
skel/app.actionform.php [deleted file]
skel/app.controller.php [deleted file]
skel/app.error.php [deleted file]
skel/app.plugin.filter.default.php [deleted file]
skel/app.unittest.php [deleted file]
skel/app.url_handler.php [deleted file]
skel/app.view.default.php [deleted file]
skel/app.viewclass.php [deleted file]
skel/dot.ethna [deleted file]
skel/etc.ini.php [deleted file]
skel/skel.action.php [deleted file]
skel/skel.action_cli.php [deleted file]
skel/skel.action_test.php [deleted file]
skel/skel.action_xmlrpc.php [deleted file]
skel/skel.app_manager.php [deleted file]
skel/skel.app_object.php [deleted file]
skel/skel.entry_cli.php [deleted file]
skel/skel.entry_www.php [deleted file]
skel/skel.template.tpl [deleted file]
skel/skel.view.php [deleted file]
skel/skel.view_test.php [deleted file]
skel/template.index.tpl [deleted file]
skel/www.css.ethna.css [deleted file]
skel/www.index.php [deleted file]
skel/www.info.php [deleted file]
skel/www.unittest.php [deleted file]
skel/www.xmlrpc.php [deleted file]
test/Ethna_ActionError_Test.php [deleted file]
test/Ethna_ActionForm_Test.php [deleted file]
test/Ethna_Config_Test.php [deleted file]
test/Ethna_DB_ADOdb_Test.php [deleted file]
test/Ethna_Logger_Test.php [deleted file]
test/Ethna_Plugin_Cachemanager_Localfile_Test.php [deleted file]
test/Ethna_Plugin_Csrf_Session_Test.php [deleted file]
test/Ethna_Plugin_Logwriter_Echo_Test.php [deleted file]
test/Ethna_Plugin_Logwriter_File_Test.php [deleted file]
test/Ethna_Plugin_Validator_Custom_Test.php [deleted file]
test/Ethna_Plugin_Validator_Max_Test.php [deleted file]
test/Ethna_Plugin_Validator_Min_Test.php [deleted file]
test/Ethna_Plugin_Validator_Regexp_Test.php [deleted file]
test/Ethna_Plugin_Validator_Required_Test.php [deleted file]
test/Ethna_Plugin_Validator_Type_Test.php [deleted file]
test/Ethna_UnitTestBase.php [deleted file]
test/Ethna_UrlHandler_Test.php [deleted file]
test/Ethna_Util_Test.php [deleted file]
test/Ethna_ViewClass_Test.php [deleted file]
test/TextDetailReporter.php [deleted file]
test/run_test.stdin.txt [deleted file]
tpl/info.tpl [deleted file]
tpl/unittest.tpl [deleted file]

diff --git a/.cvsignore b/.cvsignore
deleted file mode 100644 (file)
index f1e25bb..0000000
+++ /dev/null
@@ -1 +0,0 @@
-package.xml
diff --git a/.ethna b/.ethna
deleted file mode 100644 (file)
index 52da908..0000000
--- a/.ethna
+++ /dev/null
@@ -1,3 +0,0 @@
-[repositry]
-channel_master = "pear.ethna.jp"
-channel_local = "pear.ethna.jp"
diff --git a/CHANGES b/CHANGES
deleted file mode 100644 (file)
index 7de7377..0000000
--- a/CHANGES
+++ /dev/null
@@ -1,480 +0,0 @@
-* Êѹ¹ÅÀ°ìÍ÷
-
-** 2.5.0-dev
-
-*** features
-
-- Ethna_ActionForm ¤Î¼«Æ°¸¡¾Ú°À­¤Ë "default" ¤òÄɲÃ
--- default ¤òÉÕ¤±¤¿¥Õ¥©¡¼¥àÃͤϡ¢¥¨¥é¡¼¤Î¾ì¹ç¤ËÄêµÁ¤µ¤ì¤¿ÃͤËÃÖ¤­´¹¤¨¤é¤ì¤ë¡£ActionError ¥ª¥Ö¥¸¥§¥¯¥È¤ÏÀ¸À®¤·¤Ê¤¤¡£
-
-** 2.3.2
-
-*** features
-
-- %%[breaking B.C.]%% Ethna_UrlHandler (URL¥Ï¥ó¥É¥é) ¤ò¥×¥é¥°¥¤¥ó²½
--- Ethna_Plugin_Urlhandler_Default ¤òÄɲÃ
--- %% $action_map ¤ò App_Urlhandler ¤«¤é App_Plugin_Urlhandler_Default
-¤Ë°ÜÆ°¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹ %%
--- ¤ä¤Ã¤Ñ¤êÌᤷ¤Þ¤·¤¿¡£¥×¥é¥°¥¤¥ó¤ò¸Æ¤Ó½Ð¤·¤¿¤¤¤È¤­¤ËApp_UrlHandler¥¯¥é¥¹¤Ç»ØÄꤹ¤ë¤è¤¦¤ËÊѹ¹¡£
-- ¥×¥é¥°¥¤¥ó¤Î¥¯¥é¥¹¤¬´û¤Ë¸ºß¤¹¤ë¾ì¹ç¤ÏÆÃÊ̤˥ե¡¥¤¥ë¤Î¸¡º÷¤ò¥¹¥­¥Ã¥×¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
-- Ethna_ViewClass::_getFormInput_* ¤Ç $separator ¤Î¥Ç¥Õ¥©¥ë¥È¤ò '' ¤«¤é "\n" ¤ËÊѹ¹
-- Ethna_Controller::_trigger_XMLRPC ¤Ç $GLOBALS['HTTP_RAW_POST_DATA'] ¤ò»È¤ï¤º¤Ë 'php://input' ¤ò»È¤¦¤è¤¦¤ËÊѹ¹
--- php.ini ¤ÎÀßÄ꤬ÉÔÍפˤʤê¤Þ¤·¤¿¡£
-- Ethna_MailSender
--- $type °ú¿ô¤ò $template ¤È rename ¤·¤Æ¡¢¤è¤êÀѶËŪ¤Ë¥Æ¥ó¥×¥ì¡¼¥È̾¤È²ò¼á¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
---- $def ¤òÆä˻ØÄꤷ¤Ê¤±¤ì¤Ð ViewClass ¤Î forward_name ¤ÈƱÍͤˠtemplate/ja/mail/ °Ê²¼¤«¤é¥Æ¥ó¥×¥ì¡¼¥È¤òõ¤·¤Þ¤¹¡£
--- multipart: 2 ¤Ä°Ê¾å¤ÎźÉÕ¡¢¥Õ¥¡¥¤¥ë̾¤ò»ØÄꤷ¤¿ÅºÉÕ¤ËÂбþ¤·¤Þ¤·¤¿¡£
---- ¤¿¤À¤·¥Ç¥Õ¥©¥ë¥È¤Î content-type ¤Ï application/octet-stream ¤Ç¤´¤Þ¤«¤·¤Æ¤¤¤ë¤Î¤È¡¢ÆüËܸì¥Õ¥¡¥¤¥ë̾¤¬¤Æ¤­¤È¤¦¤Ç¤¹¡£
-- Ethna_Renderer, Ethna_Renderer_Smarty
--- perform() ¤ÎÂè2°ú¿ô¤Ë $capture ¥Õ¥é¥°¤òÄɲÃ
--- true ¤Î¤È¤­¤Ï Smarty Åª¤Ë display ¤Ç¤Ê¤¯ fetch ¤Ë¤Ê¤ê¤Þ¤¹¡£
-- Ethna_Util::isRootDir() ÄɲÃ
-- ethna_make_package¤Ç.svn¤ËÂбþ
-- Ethna_Plugin_Validator_Mbregexp¡¡Äɲà(thx: mumumu)
--- mb_ereg¤ò»È¤Ã¤¿¥Þ¥ë¥Á¥Ð¥¤¥ÈÂбþÀµµ¬É½¸½¥×¥é¥°¥¤¥ó
-- Ethna_Plugin_Handle_PearLocal¡¡Äɲà
--- PEAR¥Ñ¥Ã¥±¡¼¥¸¤ò³Æ¥×¥í¥¸¥§¥¯¥ÈËè¤Ë´ÉÍý¤Ç¤­¤ë¥×¥é¥°¥¤¥ó
-- View ¤Î¥æ¥Ë¥Ã¥È¥Æ¥¹¥È¤¬¤Ç¤­¤Ê¤¯¤Ê¤Ã¤Æ¤¤¤¿¥Ð¥°¤ò½¤Àµ(thx: sfio, ethna-users:0651)
-
-*** bug fixes
-
-- raiseError()Îà¤Î°ú¿ô¤¬´Ö°ã¤Ã¤Æ¤¤¤¿¤Î¤ò½¤Àµ (thx: sfio)
-- ¥×¥é¥°¥¤¥ó¥Ñ¥Ã¥±¡¼¥¸¥¤¥ó¥¹¥È¡¼¥ë»þ¤Ë '{$application_id}' ¤¬ÃÖ´¹¤µ¤ì¤Ê¤¤¥Ð¥°¤ò½¤Àµ
-- add-template ¤¬Àµ¤·¤¯Æ°ºî¤·¤Æ¤¤¤Ê¤«¤Ã¤¿¤Î¤ò½¤Àµ
-- Ethna_ViewClass::_getFormInput_Select ¤Ç multiple ¤ò¹Íθ¤·¤Æ¤¤¤Ê¤«¤Ã¤¿¤Î¤ò½¤Àµ
-- Ethna_AppObject::_getSQL_SearchId ¤ÇµßºÑ¤Ë¤Ê¤Ã¤Æ¤Ê¤¤¥¨¥é¡¼¤Î¥¹¥­¥Ã¥×¤òºï½ü
--- Í­¸ú¤Ê key ¤¬¤Ê¤¤¤È¤­¤Ë¡¢¤É¤Á¤é¤Ë¤·¤í SQL ¥¨¥é¡¼¤Ë¤Ê¤Ã¤Æ¤¿
-- OS_WINDOWS¤ÇgetAppController()¤¬Ìµ¸Â¥ë¡¼¥×¤Ë¤Ê¤Ã¤Æ¤¤¤¿¤Î¤ò½¤Àµ
--- ¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥êȽÄê¤Ë¼ºÇÔ¤·¤Æ¤¤¤¿
-- Console_Getopt¤Ê¤É¤Î¥¢¥Ã¥×¥°¥ì¡¼¥É¤ËÂбþ
--- php4Âбþ¤ÎreferenceÊÖ¤·¤¬¤Ê¤¯¤Ê¤Ã¤Æ¤¤¤¿¤Î¤Ëȼ¤Ã¤ÆȯÀ¸¤·¤Æ¤¤¤¿notice¤ò²óÈò
-- xmlrpc¤Î¥Ñ¥é¥á¡¼¥¿¤¬ActionForm¤ËÅϤäƤ¤¤Ê¤«¤Ã¤¿¤Î¤ò½¤Àµ(#9845)
-- file_type ¤Î¸¡ºº ¤¬µ¡Ç½¤·¤Ê¤¤ÌäÂê¤ò½¤Àµ
-- MailSender¤Ç¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¤ÎµóÆ°¤ò½¤Àµ
-- MailSender¤ÎBare LF¤òCRLF¤ËÃÖ´¹(#9898, ethna-users:0588)
-- Smarty ¤Î $script ÊÑ¿ô¤ÎÃͤ¬¡¢PATH_INFO¤ÎÃͤ¬´Þ¤Þ¤ì¤ë¤ÈÀøºßŪ¤Ë¸íÆ°ºî¤¹¤ë¥Ð¥°¤ò½¤Àµ(thx: cockok, ethna-users:0687)
-
-** 2.3.1
-
-*** features
-
-- ethna¥³¥Þ¥ó¥É¤Ç@PHP-BIN@¤¬ÃÖ´¹¤µ¤ì¤º¤Ë»Ä¤Ã¤Æ¤¤¤ë¾ì¹ç(CVSÈǤò»È¤Ã¤Æ¤¤¤ë¤È¤­¤Ê¤É)¤ËÂбþ
-- ¥Ç¥Õ¥©¥ë¥È¥Æ¥ó¥×¥ì¡¼¥È¤Ë¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤ò¤³¤Ã¤½¤êÄɲÃ
-
-*** bug fixes
-
-- Mac/Windows¤Çpear·Ðͳ¤Ç¤Î¥¤¥ó¥¹¥È¡¼¥ë¤Ë¼ºÇÔ¤·¤Æ¤¤¤¿ÌäÂê¤ò²ò¾Ã
--- ¤¹¤Ù¤Æ¤Îrole¤òphp¤Ë¤·¤Æ¡¢ethna.{sh,bat}¤Î¤ßscript¤ò»ØÄê
-- Ethna_ViewClass::setPlugin() ¤Ç $plugin ¤Î¸¡¾Ú¤Ë is_callable ¤ò»ÈÍÑ (ethna-users:0507)
-- install-plugin ¤¬Àµ¤·¤¯Æ°¤¤¤Æ¤¤¤Ê¤«¤Ã¤¿¤Î¤ò½¤Àµ (#9582)
-- ethna.sh¤ÇPHP¤Î¥Ñ¥¹¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¤Î¤ò½¤Àµ(ethna-users:0508)
-- Ethna_AppObject¤Ç'key'¤Î¾ò·ï¤Ëunique_key, multiple_key¤¬Ï³¤ì¤Æ¤¤¤¿¤Î¤ò½¤Àµ
-- Ethna_ViewClass¤Ç<label id="foo">¤È¤Ê¤Ã¤Æ¤¤¤¿¤Î¤ò<label for="foo">¤Ë½¤Àµ
-
-** 2.3.0
-
-*** features
-
-- ethna¥³¥Þ¥ó¥É¤Î¥Ï¥ó¥É¥éºÆÊÔ
--- Á´ÈÌŪ¤Ëgetopt²½
---- "--basedir" ¤ÇÂоݥ¢¥×¥ê¤Î¾ì½ê¤ò»ØÄê
---- "--skelfile" ¤ÇÀ¸À®¸µ¤Î¥¹¥±¥ë¥È¥ó¥Õ¥¡¥¤¥ë¤ò»ØÄê
--- Á´¤Æ¤Îgenerator¤Ç "¥¢¥×¥ê -> EthnaËÜÂÎ" ¤Î½ç¤Ë¥¹¥±¥ë¥È¥ó¥Õ¥¡¥¤¥ë¤òõ¤¹¤è¤¦¤ËÊѹ¹
--- add-action-cli, add-action-xmlrpc¤òÇѻߡ¢add-action¤Ë "--gateway=www|cli|xmlrpc" ¤òÄɲÃ
--- add-entry-pointÄɲÃ
---- ethna add-entry-point --gateway=cli foo ¤Ç bin/foo.php, app/action/Foo.php ¤òÀ¸À®
--- pear¥³¥Þ¥ó¥É¤ò»È¤¦¥Ï¥ó¥É¥é¤Ë "--pearopt" ¤òÄɲÃ(experimental)
---- ethna install-plugin -p--alldeps -p--force foo bar ¤Î¤è¤¦¤Ë»ØÄꤹ¤ë
--- Ethna_Handle::_getopt()¤Î½ÐÎϤòÊѹ¹
-
-- miscÄɲÃ
--- plugin packager¤Î¥µ¥ó¥×¥ë
--- ¤ª¤Þ¤±: _ethna (zsh¤ÎÊä´°´Ø¿ô)
-
-- Smarty, PEAR_DB¤Îinclude¤Î¥¿¥¤¥ß¥ó¥°¤òÊѹ¹
--- É¬Í×»þ¤Ë Ethna_ClassFactory::_include() ¤ò»È¤¦¤è¤¦¤Ë¤·¤¿¡£
-
-- Ethna_AppObject¤òpostgres, sqlite¤Ë´Ê°×Âбþ
--- 1¥Æ¡¼¥Ö¥ë¤Î1¥ì¥³¡¼¥É¤¬1¥ª¥Ö¥¸¥§¥¯¥È¤ËÂбþ¤¹¤ë¤è¤¦¤Êñ½ã¤Ê¥â¥Ç¥ë¤Î¤ßÂбþ
--- ¤Þ¤Àdb type¤´¤È¤ËÄ´À°¤¬É¬Íפˤʤ뤳¤È¤¬¤¢¤ê¤Þ¤¹¡£
--- pgsql¤Çsequence¤ËÂбþ
--- ¥Æ¡¼¥Ö¥ë̾¡¢¥«¥é¥à̾¤Î¼«Æ°quote¤ËÂбþ
-
-- add-* ¥Ï¥ó¥É¥ëµ¡Ç½ÄɲÃ
--- add-template: --skelfile ¥ª¥×¥·¥ç¥ó¤ÇÀ¸À®¸µ¤Î¥¹¥±¥ë¥È¥ó¥Õ¥¡¥¤¥ë¤ò»ØÄê¤Ç¤­¤ë¤è¤¦¤Ë¤·¤¿
-
-- {form_input}¥Ø¥ë¥Ñ¡¼
--- select, radio, checkbox¤ËÂбþ
--- ÁªÂò»è¤ò¥Õ¥©¡¼¥àÄêµÁ¤Ç»ØÄê¤Ç¤­¤ë¤è¤¦¤Ë¤·¤¿(af¤Îmethod, property, manager¤Ê¤É)
--- ³°Â¦¤Î{form}¥Ö¥í¥Ã¥¯¤«¤éaction̾, defaultÃͤò¼èÆÀ¤Ç¤­¤ë¤è¤¦¤Ë¤·¤¿
--- ¥Õ¥©¡¼¥àÄêµÁ¤«¤é¤âdefaultÃͤò»ØÄê¤Ç¤­¤ë¤è¤¦¤Ë¤·¤¿
-
-- Ethna_Plugin_Handle_{Install,Upgrade}Plugin ¤Ë --state ¥ª¥×¥·¥ç¥ó¤òÄɲÃ
-- local ¤Î¥×¥é¥°¥¤¥ó¤Î prefix ¤ò App ¤ËÊѹ¹(app_id¤ÎͽÌó¸ì°·¤¤)
-
-- Ethna_Plugin_Handle_ClearCache ÄɲÃ
--- ¸½¾õ smarty, pear, cachemanager_localfile, tmp°Ê²¼ÌäÅú̵ÍѤǺï½ü¡¢¤Î¤ß¤ÎÂбþ
-- ethna_error_handler() ¤Î print ¾ò·ï¤òÊѹ¹
--- Logwriter ¥×¥é¥°¥¤¥ó²½¤Ëȼ¤¦ $has_echo ¾ò·ï¤Î¥Ð¥°¤ò½¤Àµ
--- $has_echo ¤Ë²Ã¤¨¤Æ $config->get('debug') ¤ò¸«¤ë¤è¤¦¤Ë¤·¤¿
-- Ethna_Handle ¤Ç Ethna_Controller ¤È App_Controller ¤¬¶¦Â¸¤¹¤ë¾ì¹ç¤Î°·¤¤¤¬º®Í𤷤Ƥ¤¤¿¤Î¤òÀ°Íý
-- Ethna_Hanlde ¤Ë mkdir(), chmod(), purgeDir() ¤òÄɲÃ
-- Cachemanager ¥×¥é¥°¥¤¥óÃæ¤Î PEAR::raiseError() ¤ò Ethna::raiseError() ¤ËÊѹ¹
-- Ethna_Logger ¤Ç Ethna_Config ¥ª¥Ö¥¸¥§¥¯¥È¤Î¼èÆÀ¤Ë¼ºÇÔ¤·¤¿¤È¤­¤Î½èÍý¤ò½¤Àµ
-- ethna {install,uninstall,upgrade}-plugin ¤Ç skel ¤«¤é generate ¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤Î¾å½ñ¤­³Îǧ¤òÇÑ»ß
-
-- Ethna_Plugin_Handle_ListPlugin
--- ¥Ñ¥Ã¥±¡¼¥¸´ÉÍý¤Ë·¸¤ï¤é¤º¥×¥é¥°¥¤¥ó¤Î°ìÍ÷¤òɽ¼¨
--- ¥Ñ¥Ã¥±¡¼¥¸´ÉÍý²¼¤Ë¤¢¤ë¤È¤­¤Ï¥Ñ¥Ã¥±¡¼¥¸Ì¾¤È¥Ð¡¼¥¸¥ç¥ó¤òɽ¼¨
-- Ethna_Plugin_Handle_UpgradePlugin, Ethna_Plugin_Handle_ChannelUpdate
--- ¥×¥é¥°¥¤¥ó¥Ñ¥Ã¥±¡¼¥¸¤Îupgrade, pear channel¤Îupdate¤ËÂбþ
--- http://pear.server/get/Package-1.2.3.tgz ¤Î¤è¤¦¤Êinstall, upgrade¤ËÂбþ
-- PearWrapper, Ethna_Handle¤Ç¤Î¥Ç¥Õ¥©¥ë¥È¥¿¡¼¥²¥Ã¥È(local¤«master¤«)¤òlocal¤ËÊѹ¹¡¢Åý°ì
-- Ethna_Plugin_Handle_{Install,Uninstall,Info,List}Plugin
--- master, local¤Î¥Ï¥ó¥É¥é¤òʬ¤±¤Æ¤¤¤¿¤Î¤òÅý¹ç
--- ¥À¥¦¥ó¥í¡¼¥ÉºÑ¤ß¤Î tgz ¤ËÂбþ
--- Console_GetOpt ¤Ç --channel, --basedir, --local, --master ¤Î¥ª¥×¥·¥ç¥ó¤òÄɲÃ
--- new PEAR_Error() »þ¤Î error handler ¤ò callback($ui, 'displayFatalError') ¤ËÊѹ¹
-
-- Ethna_UrlHandler¥¯¥é¥¹¤òÄɲÃ(¥¹¥Æ¥­urlÂбþ)
-- Smarty¥×¥é¥°¥¤¥ó´Ø¿ôsmarty_function_urlÄɲÃ
-- Ethna_AppObject¤«¤é¤Î¥Õ¥©¡¼¥àÄêµÁÀ¸À®¥µ¥Ý¡¼¥ÈÄɲÃ
--- [2006/08/23] ·ã¤·¤¯¦Á
-- Ethna_ClassFactory::getObject()¤Ç¥¯¥é¥¹ÄêµÁ¤Ë̵¤¤¥­¡¼¤¬ÅϤµ¤ì¤¿¾ì¹ç¤ÏEthna_AppObject()¤Î¥­¡¼¤Ç¤¢¤ë¤È²¾Äꤷ¤Æ¥ª¥Ö¥¸¥§¥¯¥ÈÀ¸À®
-- ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥¹¥±¥ë¥È¥óÀ¸À®»þ¤Ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¸ÇÍ­¤ÎActionClass, ActionForm, ViewClass¤âÀ¸À®¤¹¤ë¤è¤¦¤ËÊѹ¹
-- Ethna_SkeltonGenerator¥¯¥é¥¹¤òEthna_Generator¥¯¥é¥¹¤Ë̾¾ÎÊѹ¹
-- Ethna_SkeltonGenerator¥¯¥é¥¹¤Î³Æ¥á¥½¥Ã¥É¤ò¥×¥é¥°¥¤¥ó²½
-- Ethna_Config::get()¤Ç°ú¿ô¤ò»ØÄꤷ¤Ê¤¤¤ÈÁ´ÀßÄê¤ò³ÊǼ¤·¤¿ÇÛÎó¤òÊÖ¤¹¤è¤¦¤ËÊѹ¹
-- Ethna_ViewClass::_getTemplateEngine()¤ÇÀßÄêÃͤò³ÊǼ¤·¤¿$config¥Æ¥ó¥×¥ì¡¼¥ÈÊÑ¿ô¤òÀßÄꤹ¤ë¤è¤¦¤ËÊѹ¹
-- Ethna¤Î¥Ñ¥Ã¥±¡¼¥¸¥·¥¹¥Æ¥à¤òÄɲÃ
--- ethnaÍѤÎpear channel¤«¤é¥×¥é¥°¥¤¥ó¤Î¥Ñ¥Ã¥±¡¼¥¸¤ò¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹
--- Ethna_PearWrapper, Ethna_Plugin_Handle_{Install,Info,List,Uninstall}_Plugin_{Master,Local}¤òÄɲÃ
--- local: ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó(¥×¥í¥¸¥§¥¯¥È)¤Î¥Ç¥£¥ì¥¯¥È¥ê¡¢master: EthnaËÜÂΤΤ¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¥¤¥á¡¼¥¸¤Ç¤¹
--- PearWrapper¤Ïethna¥³¥Þ¥ó¥É(Handle)¤«¤é¸Æ¤Ó½Ð¤µ¤ì¤ë¤³¤È¤¬Á°Äó
--- Ethna_SkeltonGenerator¤Ë¤¢¤Ã¤¿¥á¥½¥Ã¥É¤òEthna_Handle¤Ë°ÜÆ°¡¢¾¯¤·ÄɲÃ
-
-- ¥¨¥é¡¼¥Ï¥ó¥É¥ê¥ó¥°Êý¿Ë¤ò¿¾¯Êѹ¹
--- @±é»»»Ò¤ò»È¤Ã¤¿¥¨¥é¡¼ÍÞÀ©¤òÇÑ»ß
-
-- [breaking B.C.] Ethna_ClassFactory¤Î¥ê¥Õ¥¡¥¯¥¿¥ê¥ó¥°
--- Ethna_Backend::getObject()¥á¥½¥Ã¥É¤òÄɲä·¤Þ¤·¤¿
--- ¤³¤ì¤Ë¤è¤ê¡¢Ethna_Controller¤Î$class¥á¥ó¥Ð¤Ë
- $class = array(
-   // ...
-   'user' => 'Some_Foo_Bar',
- ),
-¤Èµ­½Ò¤¹¤ë¤³¤È¤Ç
- $user =& $this->backend->getObject('user');
-¤È¤·¤ÆSome_Foo_Bar¥¯¥é¥¹¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ò¼èÆÀ¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹
--- ¥¯¥é¥¹ÄêµÁ¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï²¼µ­¤Î½ç¤Ç¥Õ¥¡¥¤¥ë¤òõ¤·¤Ë¹Ô¤­¤Þ¤¹(include_path)
-+++ Some_Foo_Bar.php (¤½¤Î¤Þ¤Þ)
-+++ Foo/Some_Foo_Bar.php (Ethna style)
-+++ Foo/Bar.php (Ethna & PEAR style)
-+++ Some/Foo/Bar.php (PEAR style)
--- ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Þ¥Í¡¼¥¸¥ã¤ÎÀ¸À®¤âEthna_ClassFactory¤Ç¹Ô¤ï¤ì¤Þ¤¹(Ethna_ClassFactory::getManager()¤¬Äɲ䵤ì¤Æ¤¤¤Þ¤¹)
--- ¤³¤ì¤Ëȼ¤¤¡¢¡Á2.1.x¤Ç¤Ï¥³¥ó¥È¥í¡¼¥é¥¯¥é¥¹¤Ë
- $manager = array(
-   'um' => 'User',
- );
-¤Î¤è¤¦¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¤È¡¢Ethna_ActionClass¡¢Ethna_ViewClass¡¢Ethna_AppObject¡¢Ethna_*Manager¤Ç
- $this->um
-¤È¤·¤Æ¥Þ¥Í¡¼¥¸¥ã¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Æ¤¤¤¿¤Î¤Ç¤¹¤¬¡¢¤³¤Îµ¡Ç½¤¬Çѻߤµ¤ì¤Æ¤¤¤Þ¤¹(ÉÔɾ¤Ê¤éÌᤷ¤Þ¤¹@preview2)
-- Ethna_Plugin_Logwriter_File::begin()¤Ç¥í¥°¥Õ¥¡¥¤¥ë¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤òÀßÄꤹ¤ë¤è¤¦¤ËÊѹ¹
-- ¥Ï¡¼¥É¥¿¥Ö -> ¥½¥Õ¥È¥¿¥Ö
-- test runner¤ÎÄɲÃ
-- [breaking B.C.] Ethna_Logger¥ê¥Õ¥¡¥¯¥¿¥ê¥ó¥°
--- Ethna_LogWriter¤Î¥×¥é¥°¥¤¥ó²½
--- ¥«¥ó¥Þ¶èÀÚ¤ê¤Ç¤ÎÊ£¿ô¥Õ¥¡¥·¥ê¥Æ¥£¥µ¥Ý¡¼¥È
--- _getLogWriter()¥¯¥é¥¹¤ò¥ª¡¼¥Ð¡¼¥é¥¤¥É¤·¤Æ¤¤¤ëÊý¤Ë±Æ¶Á¤¬¤¢¤ê¤Þ¤¹(2.3.0°Ê¹ß¤ÏPlugin/Logwriter°Ê²¼¤ËLogwriter¥¯¥é¥¹¤òÃÖ¤¤¤Æ¡¢¥Õ¥¡¥·¥ê¥Æ¥£¤Ç¤½¤Î̾Á°¤ò»ØÄꤹ¤ì¤ÐǤ°Õ¤ÎLogwriter¤òÄɲòÄǽ¤Ç¤¹)
-- [breaking B.C.] Ethna_RendererÄɲÃ
--- ¡Á2.1.x¤Ç¤ÏľÀÜ°·¤Ã¤¤¤Æ¤¿¥Æ¥ó¥×¥ì¡¼¥È¥¨¥ó¥¸¥ó¥ª¥Ö¥¸¥§¥¯¥È¤òEthna_Renderer¥¯¥é¥¹¤Çwrap¤·¤Þ¤·¤¿
--- Ethna_Controller::getTemplateEngine()¤Ïobsolete¤È¤Ê¤ê¤Þ¤¹¤Î¤Çº£¸å¤ÏEthna_Controller::getRenderer()¤ò¤´ÍøÍѤ¯¤À¤µ¤¤
--- Ethna_Controller::_setDefaultTemplateEngine(), Ethna_View::_setDefault(), Ethna_Controller::getTemplateEngine()¤Î°ú¿ô¡¢Ìá¤êÃͤÏ2.1.x¤Þ¤Ç¤ÎSmarty¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤Ï¤Ê¤¯Ethna_Renderer¥ª¥Ö¥¸¥§¥¯¥È¤È¤Ê¤ê¤Þ¤¹
--- ¤³¤ì¤Ëȼ¤¤¡¢Ethna_Controller::_setDefaultTemplateEngine(), Ethna_Controller::getTemplateEngine()¤òÍøÍѤ·¤Æ¤¤¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¥¢¥Ã¥×¥Ç¡¼¥È»þ¤ËEthna_Renderer::getEngine()¤òÍøÍѤ·¤Æ¸åÊý¸ß´¹À­¤ò°Ý»ý¤¹¤ë¤è¤¦¤ËÊѹ¹¤¬É¬ÍפȤʤê¤Þ¤¹
- e.g.
- $smarty =& $this->controller->getTemplateEngine();
- ¢ª
- $renderer =& $this->controller->getTemplateEngine();
- $smarty =& $renderer->getEngine();
-- ¥×¥é¥°¥¤¥ó¥·¥¹¥Æ¥àÄɲÃ(w/ Ethna_Plugin¥¯¥é¥¹)
--- Ethna_Handle, Ethna_CacheManager, Ethna_LogWriter¤ò¥×¥é¥°¥¤¥ó¥·¥¹¥Æ¥à¤Ë°Ü¹Ô
--- Ethna_ActionForm¤Î¥Ð¥ê¥Ç¡¼¥¿¤ò¥×¥é¥°¥¤¥ó¥·¥¹¥Æ¥à¤Ë°Ü¹Ô(Ethna_ActionForm::use_validator_plugin¤¬true¤Î¤È¤­¤Î¤ß)
--- see also
---- http://ethna.jp/ethna-document-dev_guide-plugin.html
---- http://ethna.jp/ethna-document-dev_guide-form-validate_with_plugin.html
-- ethna¥³¥Þ¥ó¥É¤Ë¥¢¥¯¥·¥ç¥ó̾¡¢¥Ó¥å¡¼Ì¾¤Î¥Á¥§¥Ã¥¯½èÍý¤òÄɲÃ(Ethna_Controller::checkActionName(), Ethna_Controller::checkViewName()¤òÄɲÃ)
-- Ethna_CacheManager_Memcache(¥­¥ã¥Ã¥·¥å¥Þ¥Í¡¼¥¸¥ã¤Îmemcache¥µ¥Ý¡¼¥È)ÄɲÃ
-- Ethna_Session¤Ëregenerate_id¥á¥½¥Ã¥É¤ÎÄɲÃ
-- Ethna_Plugin_Csrf(CSRFÂкö¥³¡¼¥É)ÄɲÃ
-
-
-
-*** bug fixes
-
-- [[#9009>http://sourceforge.jp/tracker/index.php?func=detail&aid=9009&group_id=1343&atid=5092]](%sÅù¤¬¤¢¤ëSQL¤òEchoLogger¤ÇDebug¤¹¤ë¤ÈWarning)
-- ¥¢¥¯¥·¥ç¥óÄêµÁ¤Îform_path¤¬Àµ¤·¤¯Æ°ºî¤·¤Æ¤¤¤Ê¤«¤Ã¤¿ÌäÂê¤ò½¤Àµ
-- ¥³¥ó¥È¥í¡¼¥é¤¬Ê£¿ô¤¢¤ë¤È¤­¤Ëset_error_handler()¤¬²¿ÅÙ¤â¼Â¹Ô¤µ¤ì¤ë¤Î¤ò²óÈò
-- CacheManager_Localfile¤Î@stat¤Ç¤ÎWARNING¤ò²óÈò
-- Ethna_Plugin_Validator_Custom¤Ç¥¨¥é¡¼¤¬2½ÅÅÐÏ¿¤µ¤ì¤Æ¤¤¤¿¤Î¤ò½¤Àµ
-- ¥×¥é¥°¥¤¥ó¤Î¿Æ¥¯¥é¥¹¤¬¤Ê¤¤¤È¤­¤Ë¥¨¥é¡¼¤Ë¤Ê¤Ã¤Æ¤¤¤¿¤Î¤ò½¤Àµ
-- Ethna_DB_PEAR, Ethna_AppObject¤ÎWARNING¤ò²óÈò([ethna-users:0383])
-- Windows¤Ç¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Î.ethna¥Õ¥¡¥¤¥ë¤¬»²¾È¤µ¤ì¤Ê¤¤ÌäÂê¤ò½¤Àµ
-- session_start¤·¤Æ¤¤¤Ê¤¤¤Èrestore¥á¥½¥Ã¥É¤¬¤¦¤Þ¤¯Æ°¤«¤Ê¤¤ÌäÂê¤ò½¤Àµ
-- ethna¥³¥Þ¥ó¥É¤Ë¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¥ª¥×¥·¥ç¥ó¤Î¤ß¤ò»ØÄꤷ¤Æµ¯Æ°¤·¤¿¾ì¹ç(ethna -h¤Ê¤É)¤ËFatal Error¤È¤Ê¤ëÌäÂê¤ò½¤Àµ
-- Ethna_Backend::getDB¤ÎNotice¥¨¥é¡¼¤ò½¤Àµ
-- ¥­¥ã¥Ã¥·¥å¥Þ¥Í¡¼¥¸¥ã¤Î¥¨¥é¡¼¥³¡¼¥É¤¬256°Ê¾å(¥¢¥×¥ê¥±¡¼¥·¥ç¥óÍÑ)¤Ë¤Ê¤Ã¤Æ¤¤¤¿ÌäÂê¤ò½¤Àµ
-- ethna add-action-test¤·¤¿¤È¤­¤Ë¥Õ¥¡¥¤¥ë¤¬app/action_cli¤ËÀ¸À®¤µ¤ì¤Æ¤·¤Þ¤¦ÌäÂê¤ò½¤Àµ
-- Ethna_SkeltonGenerator¥¯¥é¥¹¤Îtypo¤ò½¤Àµ(proejct -> project)
-- Ethna_ActionForm¤Ç¥×¥é¥°¥¤¥ó¤ò»È¤ï¤Ê¤¤¤È¤­¤Ë¥Õ¥£¥ë¥¿¤¬µ¡Ç½¤·¤Ê¤¤¥Ð¥°¤ò½¤Àµ
-
-
-** [2006/06/07] 2.1.2
-
-*** bug fixes
-
-- Ethna_Controller::getActionRequest()¥á¥½¥Ã¥É¤Î¥Ç¥Õ¥©¥ë¥È¾õÂ֤ο¶Éñ¤¤¤ò½¤Àµ
-
-
-** [2006/06/07] 2.1.1
-
-*** bug fixes
-
-- ethna.bat¤Î¥Ñ¥¹¤ò½¤Àµ
-
-** [2006/06/06] 2.1.0
-
-*** features
-
-- ethna¥³¥Þ¥ó¥É¤ÎETHNA_HOME¤ò¥¤¥ó¥¹¥È¡¼¥ë»þ¤Ë·èÄꤹ¤ë¤è¤¦¤Ë²þÁ±
-- Ethna_ActionForm::validate() ¤Ç¿¼¡¸µÇÛÎó¤¬ÅϤµ¤ì¤¿¤È¤­¤Înotice¤ò²óÈò
-- Ethna_Backend::setActionForm(), Ethna_Backend::setActionClass()¥á¥½¥Ã¥É¤òÄɲÃ
-- Ethna_Filter¤Î¥¹¥±¥ë¥È¥ó¤ËpreActionFilter()/postActionFilter()¤òÄɲÃ
-- Ethna_AppObject::_getPropDef()¤Ë¥­¥ã¥Ã¥·¥å½èÍý¤òÄɲÃ
-- Ethna_CacheManager¥¯¥é¥¹¤òÄɲÃ(w/ localfile) - from GREE:)
-- Ethna_DB::getDSN()¥á¥½¥Ã¥É¤òÄɲÃ
-- ini¥Õ¥¡¥¤¥ë¤Î¥¹¥±¥ë¥È¥ó¤Ëdsn¥µ¥ó¥×¥ëÄɲÃ
-- add-template¥³¥Þ¥ó¥ÉÄɲÃ(by nnno)
-- add-project»þ¤Î¥Ç¥Õ¥©¥ë¥È¥Æ¥ó¥×¥ì¡¼¥È¥Ç¥¶¥¤¥ó¤òÊѹ¹
-- ethna¥³¥Þ¥ó¥É¤Ë-v(--version)¥ª¥×¥·¥ç¥ó¤òÄɲÃ
-- smarty_modifier_select(), smarty_function_select()¤Î"selected"°À­¤ÎxhtmlÂбþ(selected="true")
-- {form_name}, {form_input}¥×¥é¥°¥¤¥óÄɲÃ(·ã¤·¤¯experimental¤È¤¤¤¦¤«ongoing)
-- Ethna_ViewClass¤Çhelper¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥àÂбþ
--- Ethna_ViewClass->helper_action_form = array('some_action_name' => null, ...)¤È¤¹¤ë¤È{form_name}¤È¤«¤Ç»È¤¨¤Þ¤¹
-- [breaking B.C.] Ethna_ActionClass¤Îpreforward()¥µ¥Ý¡¼¥È(¤à¤«¡¼¤·¤Î¥³¡¼¥É¤Ë¤¢¤ê¤Þ¤·¤¿¤Î¤Ç¤¹)ºï½ü
-- (¤×¤Á)¾Ê¥¨¥Í¥Ö¥í¥Ã¥¯¥×¥é¥°¥¤¥ó{form}...{/form}ÄɲÃ
--- ethna_action°ú¿ô¤âÄɲÃ(¾¡¼ê¤Ëhidden¥¿¥°À¸À®)
-- Ethna_Controller¤Ë$smarty_block_plugin¥×¥í¥Ñ¥Æ¥£¤òÄɲÃ
-- ethna¥³¥Þ¥ó¥É¤Ëadd-action-cli¤òÄɲÃ
-- [breaking B.C.] main_CLI¤Î¥¢¥¯¥·¥ç¥óÄêµÁ¥Ç¥£¥ì¥¯¥È¥ê¤òaction_cli¤ËÊѹ¹
--- controller¤Îdirectory¥×¥í¥Ñ¥Æ¥£¤Ë'bin'Í×ÁǤòÄɲÃ
-- ethna¥³¥Þ¥ó¥É¤Ëadd-app-manager¤òÄɲÃ(thanks butatic)
-- Ethna_ActionForm ¥ê¥Õ¥¡¥¯¥¿¥ê¥ó¥° (by ¤¤¤Á¤¤)
--- $this->form ¤Î¾ÊάÃÍÊäÀµ¤ò setFormVars() ¤«¤é¥³¥ó¥¹¥È¥é¥¯¥¿¤Ë°ÜÆ°
--- ¥Õ¥©¡¼¥àÃͤΥ¹¥«¥é¡¼/ÇÛÎó¥Á¥§¥Ã¥¯¤ò setFormVars() ¤Ç¤¹¤ë¤è¤¦¤ËÊѹ¹
---- vaildate() ¤¹¤ëÁ°¤Ë setFormVars() ¤Ç¥¨¥é¡¼ (handleError()) ¤¬È¯À¸¤¹¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹
--- ¥Õ¥©¡¼¥àÃͤΥ¹¥«¥é¡¼/ÇÛÎó¥Á¥§¥Ã¥¯¤Ç¥Õ¥©¡¼¥àÃÍÄêµÁ¤È°Û¤Ê¤ë¾ì¹ç¤Ï null ¤Ë¤¹¤ë
--- ¥Õ¥¡¥¤¥ë¥Ç¡¼¥¿¤ÎºÆ¹½À®¤ò¾ï¤Ë¹Ô¤¦¤è¤¦¤ËÊѹ¹
--- ¥Õ¥©¡¼¥àÃÍÄêµÁ¤¬ÇÛÎó¤Ç required, max/min ¤ÎÀßÄ꤬¤¢¤ë¾ì¹ç¤Î¥Ð¥°¤ò½¤Àµ
--- _filter_alnum_zentohan() ¤òÄɲà(mb_convert_kana($value, "a"))
-- XMLRPC¥²¡¼¥È¥¦¥§¥¤¤ËfaultCode¥µ¥Ý¡¼¥È¤òÄɲÃ
--- action¤ÇEthna_Error(¤¢¤ë¤¤¤ÏPEAR_Error)¥ª¥Ö¥¸¥§¥¯¥È¤òÊÖ¤¹¤È¥¨¥é¡¼¤òÊÖ¤»¤Þ¤¹
-- XMLRPC¥²¡¼¥È¥¦¥§¥¤¥µ¥Ý¡¼¥ÈÄɲÃ(experimental)
--- ethna add-action-xmlrpc [action]¤ÇXMLRPC¥á¥½¥Ã¥É¤òÄɲòÄǽ
--- °ú¿ô1¤Ä¤È¥Õ¥©¡¼¥àÄêµÁ1¤Ä¤¬ÄêµÁ½ç¤ËÂбþ¤·¤Þ¤¹
--- ToDo
---- ½ÐÎϥХåե¡¥Á¥§¥Ã¥¯
---- method not found¤Ê¤É¥¨¥é¡¼½èÍýÂбþ
-- Ethna_ActionForm¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿¤ÇsetFormVars()¤ò¼Â¹Ô¤·¤Ê¤¤¤è¤¦¤ËÊѹ¹
-- ¥¹¥±¥ë¥È¥ó¤Ë´Þ¤Þ¤ì¤ë'your name'¤ò¥Þ¥¯¥í({$author})¤ËÊѹ¹(~/.ethnaÂбþ)
-- ¤Ê¤²¤ä¤êÊØÍø´Ø¿ôfile_exists_ex(), is_absolute_path()¤òÄɲÃ
-- SimpleTest¤È¤ÎÏ¢·Èµ¡Ç½¤òÄɲÃ(ethna¥³¥Þ¥ó¥É¤Ëadd-action-test,add-view-test¤ÎÄɲäʤÉ)
--- SimpleTest¤Î¥¤¥ó¥¹¥È¡¼¥ë¥Á¥§¥Ã¥¯¤òÄɲÃ
-- package.xmlÀ¸À®¥¹¥¯¥ê¥×¥È²þÁ±(ethna¥³¥Þ¥ó¥É¥¤¥ó¥¹¥È¡¼¥ëÂбþ¤Ê¤É)
-- Haste_ADOdb, Haste_Creole¥Þ¡¼¥¸(from Haste Project by halt¤µ¤ó)
-- Ethna_AppObject¥¯¥é¥¹¤Î¥Æ¡¼¥Ö¥ë/¥×¥í¥Ñ¥Æ¥£ÄêµÁ¼«Æ°À¸À®¥µ¥Ý¡¼¥ÈÄɲÃ(from generate_app_object originally by °æ¾å¤µ¤ó+halt¤µ¤ó)
-- Ethna_Controller::getAppdir()¥á¥½¥Ã¥É¤òÄɲÃ
-- Ethna_Controller::getDBType()¤Î°ú¿ô¤¬null¤À¤Ã¤¿¾ì¹ç¤ËÄêµÁ°ìÍ÷¤òÊÖ¤¹¤è¤¦¤ËÊѹ¹
-- ethna¥³¥Þ¥ó¥É¥é¥¤¥ó¥Ï¥ó¥É¥é¤òÄɲÃ(+¥Ï¥ó¥É¥é¤òpluggable¤Ë+add-view¤Ç¥Æ¥ó¥×¥ì¡¼¥ÈÀ¸À®¥µ¥Ý¡¼¥È)¡Ýplease cp bin/ethna to /usr/local/bin or somewhere
- generate_project_skelton.php -> ethna add-project
- generate_action_script.php   -> ethna add-action
- generate_view_script.php     -> ethna add-view
- generate_app_object.php      -> ethna add-app-object
-- [breaking B.C.] client_type¤òÇѻߠ-> gatewayÄɲÃ
--- CLIENT_TYPEÄê¿ôÇÑ»ß
--- Ethna_Controller::getClientType(), Ethna_Controller::setClientType()ÇÑ»ß
--- Ethna_Controller::setCLI()/Ethna_Controller::getCLI() -> obsolete
--- GATEWAYÄê¿ôÄɲÃ(GATEWAY_WWW, GATEWAY_CLI, GATEWAY_XMLRPC, GATEWAY_SOAP)
--- Ethna_Controller::setGateway()/Ethna_Controller::getGateway()ÄɲÃ
--- ºî¤ê¤«¤±¤ÎAMF¥²¡¼¥È¥¦¥§¥¤¥µ¥Ý¡¼¥È¤ò(°ìö)ÇÑ»ß
-- Ethna_SkeltonGenerator::_checkAppId()¤òEthna_Controller::checkAppId()¤Ë°ÜÆ°
-- generate_app_object¤òÄɲÃ
-- ¥¯¥é¥¹¤Î¥á¥½¥Ã¥É¤âSmartyFunction¤È¤·¤ÆÅÐÏ¿¤Ç¤­¤ë¤è¤¦¤Ë½¤Àµ
-
-*** bug fixes
-
-- [[#8435>http://sourceforge.jp/tracker/index.php?func=detail&aid=8435&group_id=1343&atid=5092]](Ethna_AppObject prop_def[]['seq']¤¬Ì¤ÀßÄê)
-- [[#8079>http://sourceforge.jp/tracker/index.php?func=detail&aid=8079&group_id=1343&atid=5092]](Filter¤ÇBackend¤ò¸Æ¤Ö¤ÈActionForm¤ÎÃͤ¬¶õ¤Ë¤Ê¤ë)
-- [[#8200>http://sourceforge.jp/tracker/index.php?func=detail&aid=8200&group_id=1343&atid=5092]](PHP5.1.0°Ê¹ß¤Çaf¤Îvalidate()¤ÇÆüÉÕ¥Á¥§¥Ã¥¯¤¬¸ú¤«¤Ê¤¤)
-- [[#8179>http://sourceforge.jp/tracker/index.php?func=detail&aid=8179&group_id=1343&atid=5092]](getManager¤ÎÌá¤êÃͤ¬»²¾ÈÅϤ·¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤)
-- [[#8400>http://sourceforge.jp/tracker/index.php?func=detail&aid=8400&group_id=1343&atid=5092]](AppObject prop_def[]['form_name']¤¬NULL)
-- [[#7751>http://sourceforge.jp/tracker/index.php?func=detail&aid=7751&group_id=1343&atid=5092]](SAFE_MODE¤Çmail´Ø¿ô¤ÎÂ裵°ú¿ô¤¬¤¢¤ë¤ÈWaning)¤ò½¤Àµ
-- [[#8496>http://sourceforge.jp/tracker/index.php?func=detail&aid=8496&group_id=1343&atid=5092]](Ethna_AppObject.phpÆâ¤Îtypo)¤ò½¤Àµ
-- [[#8387>http://sourceforge.jp/tracker/index.php?func=detail&aid=8387&group_id=1343&atid=5092]](checkMailaddress¤ächeckURL¤ÇNotice)¤ò½¤Àµ
-- [[#8130>http://sourceforge.jp/tracker/index.php?func=detail&aid=8130&group_id=1343&atid=5092]](Notice¤Ä¤Ö¤·)¤ò½¤Àµ
-- typo fixed (aleady -> already)
-- [[#7717>http://sourceforge.jp/tracker/index.php?func=detail&aid=7717&group_id=1343&atid=5092]](Ethna_AppObject::add()¤ÇNotice)¤ò½¤Àµ
-- [[#7664>http://sourceforge.jp/tracker/index.php?func=detail&aid=7664&group_id=1343&atid=5092]](Ethna_AppObject¤Î¥Ð¥°)¤ò½¤Àµ
-- [[#7729>http://sourceforge.jp/tracker/index.php?func=detail&aid=7729&group_id=1343&atid=5092]](ethna_info¤¬Firefox¤À¤È¤º¤ì¤ë)¤ò½¤Àµ
-
-- (within beta) ethna_handle.php¤¬ÌµÍѤËob_end_clean()¤¹¤ëÌäÂê¤ò½¤Àµ
-- (within beta) ethna add-view¤Ç¥×¥í¥¸¥§¥¯¥È¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤷ¤¿¾ì¹ç¤ËÀµ¤·¤¯¥Õ¥¡¥¤¥ë¤¬À¸À®¤µ¤ì¤Ê¤¤ÌäÂê¤ò½¤Àµ
-- (within beta) WindowsÈǤÎethna¥³¥Þ¥ó¥É¤¬¥Ñ¥Ã¥±¡¼¥¸¤«¤é¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¾ì¹ç¼Â¹Ô¤Ç¤­¤Ê¤¤ÌäÂê¤ò½¤Àµ
-- (within beta) ActionForm¤ÎÇÛÎó¤Î¥Õ¥©¡¼¥àÃͤ¬Ç˲õ¤µ¤ì¤ëÌäÂê¤ò½¤Àµ(by sfio¤µ¤ó)
-
-
-** [2006/01/29] 0.2.0
-
-*** features
-
-- Ê¸»úÎó¤Îmin/max¥¨¥é¡¼¤Î¥Ç¥Õ¥©¥ë¥È¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò½¤Àµ
-- ¥Õ¥©¡¼¥àÃÍÄêµÁ¤Ë¥«¥¹¥¿¥à¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òÄêµÁ¤Ç¤­¤ë¤è¤¦¤ËÊѹ¹
-- Ethna_Controller::main_CLI()¥á¥½¥Ã¥É¤Ë¥Õ¥£¥ë¥¿¤ò̵¸ú²½¤µ¤»¤ë¥ª¥×¥·¥ç¥ó¤òÄɲÃ
-- Ethna_ActionForm¥¯¥é¥¹¤Î¥Õ¥©¡¼¥àÃÍÄêµÁ¤ò¥À¥¤¥Ê¥ß¥Ã¥¯¤ËÊѹ¹½ÐÍè¤ë¤è¤¦¤Ë½¤Àµ
-- Ethna_ActionForm¥¯¥é¥¹¤Î¥Õ¥©¡¼¥àÃÍÄêµÁ¤Ë¥Æ¥ó¥×¥ì¡¼¥Èµ¡Ç½¤òÄɲÃ
-- Ethna_Backend::getActionClasss()¥á¥½¥Ã¥É¤ÎÄɲÃ(¼Â¹ÔÃæ¤Î¥¢¥¯¥·¥ç¥ó¥¯¥é¥¹¤ò¼èÆÀ)
-- ~/.ethna¥Õ¥¡¥¤¥ë¤Ë¤è¤ë¥æ¡¼¥¶ÄêµÁ¥¹¥±¥ë¥È¥ó¥Þ¥¯¥í¤ÎÄɲÃ
-- smarty_function_select¤Ë$empty°ú¿ô¤òÄɲÃ
-- mb_*¤ÎÊÑ´¹¸µ¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤ò¡¢EUC-JP¸ÇÄ꤫¤éÆâÉô¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤ËÊѹ¹
-- Ethna_Backend::begin()¡¢Ethna_Backend::commit()¡¢Ethna_Backend::rollback()¤òÇÑ»ß
-- Ethna_Controller::getDB()¤òEthna_Controller::getDBType()¤ËÊѹ¹
-- Ethna_DB¥¯¥é¥¹¤òÃê¾Ý¥¯¥é¥¹(°·¤¤)¤È¤·¤Æ¿·¤¿¤ËEthna_DB¥¯¥é¥¹¤ò¼ÂÁõ¤·¤¿Ethna_DB_PEAR¥¯¥é¥¹¤òÄɲÃ
-- Ethna_LogWriter¥¯¥é¥¹¤òÃê¾Ý¥¯¥é¥¹(°·¤¤)¤È¤·¤Æ¿·¤¿¤ËEthna_LogWriter¥¯¥é¥¹¤ò¼ÂÁõ¤·¤¿Ethna_LogWriter_Echo¡¢Ethna_LogWriter_File¡¢Ethna_LogWriter_Syslog¥¯¥é¥¹¤òÄɲÃ
-- log_facility¤¬null¤Î¾ì¹ç¤Î¥í¥°½ÐÎÏ¥¯¥é¥¹¤òEthna_LogWriter_Echo¤«¤éEthna_LogWriter¤ËÊѹ¹(¥í¥°½ÐÎϤʤ·)
-- log_facility¤Ë¥¯¥é¥¹Ì¾¤ò½ñ¤¤¤¿¾ì¹ç¤Ï¤½¤Î¥¯¥é¥¹¤ò¥í¥°½ÐÎÏ¥¯¥é¥¹¤È¤·¤ÆÍøÍѤ¹¤ë¤è¤¦¤ËÊѹ¹
-- Ethna_Filter::preFilter()¡¢Ethna_Filter::postFilter()¤¬Ethna_Error¥ª¥Ö¥¸¥§¥¯¥È¤òÊÖ¤·¤¿¾ì¹ç¤Ï¼Â¹Ô¤òÃæ»ß¤¹¤ë¤è¤¦¤ËÊѹ¹
-- Ethna_InfoManager¤ÎÀßÄêɽ¼¨¹àÌܤòÄɲÃ
-- Ethna_ActionForm::isForceValidatePlus()¡¢Ethna_ActionForm::setForceValidatePlus()¥á¥½¥Ã¥É¤È¡¢$force_validate_plus¥á¥ó¥Ð¤òÄɲÃ($force_validate_plus¤òtrue¤ËÀßÄꤹ¤ë¤È¡¢Ä̾︡¾Ú¤Ç¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ç¤â_validatePlus()¥á¥½¥Ã¥É¤¬¼Â¹Ô¤µ¤ì¤ë¡Ý¥Ç¥Õ¥©¥ë¥È:false)
-- ¥Õ¥©¡¼¥àÃÍÄêµÁ¤Îcustom°À­¤Ë¥«¥ó¥Þ¶èÀÚ¤ê¤Ç¤ÎÊ£¿ô¥á¥½¥Ã¥É¥µ¥Ý¡¼¥È¤òÄɲÃ
-
-*** bug fixes
-
-- htmlspecialchars¤ËENT_QUOTES¥ª¥×¥·¥ç¥ó¤òÄɲÃ
-- Ethna_AppSQL¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿¥á¥½¥Ã¥É̾¤ò½¤Àµ
-- [[#7659>http://sourceforge.jp/tracker/index.php?func=detail&aid=7659&group_id=1343&atid=5092]](Ethna_Config.php¤ÇNotice¥¨¥é¡¼)¤ò½¤Àµ
-- Ethna_SOAP_ActionForm.php¤Îtypo¤ò½¤Àµ
-- [[#6616>http://sourceforge.jp/tracker/index.php?func=detail&aid=6616&group_id=1343&atid=5092]](¥»¥Ã¥·¥ç¥ó¤ËObject¤ò³ÊǼ¤Ç¤­¤Ê¤¤)¤ò½¤Àµ
-- [[#7640>https://sourceforge.jp/tracker/index.php?func=detail&aid=7640&group_id=1343&atid=5092]](µ¡¼ï°Í¸ʸ»ú¤Î¥Á¥§¥Ã¥¯¤Ç¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤¬É½¼¨¤µ¤ì¤Ê¤¤¡£)¤ò½¤Àµ
-- [[#6566>https://sourceforge.jp/tracker/index.php?func=detail&aid=6566&group_id=1343&atid=5092]](skel.action.php¤Î¥µ¥ó¥×¥ë¤Çtypo)¤ò½¤Àµ
-- [[#7451>https://sourceforge.jp/tracker/index.php?func=detail&aid=7451&group_id=1343&atid=5092]](PHP 5.0.5Âбþ)¤ò½¤Àµ
-- .museumÂбþ
-- Ethna_Backend¥¯¥é¥¹¤Î¥¯¥é¥¹¥á¥ó¥Ð¿½ÅÄêµÁ¤ò½¤Àµ
-- BASEÄê¿ô¤Î±Æ¶Á¤Ç¥³¥ó¥È¥í¡¼¥é¤Î·Ñ¾µ¤¬º¤Æñ¤ÊÌäÂê¤ò½¤Àµ
-- Windows´Ä¶­¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤LOG_LOCALÄê¿ô¤òɾ²Á¤·¤Æ¤·¤Þ¤¦ÌäÂê¤ò½¤Àµ
-- [[#6423>http://sourceforge.jp/tracker/index.php?func=detail&aid=6423&group_id=1343&atid=5092]](php-4.4.0¤ÇÂçÎ̤Υ¨¥é¡¼¤Î¸å¡¢Segv(11))¤ò½¤Àµ(patch by ramsy¤µ¤ó)
-- [[#6074>http://sourceforge.jp/tracker/index.php?func=detail&aid=6074&group_id=1343&atid=5092]](generate_project_skelton.php¤ÎÆ°ºî°Û¾ï)¤ò½¤Àµ
-- safe_mode=on¤Î¾ì¹ç¤Ëuid/gid warning¤¬È¯À¸¤¹¤ë(²ÄǽÀ­¤Î¤¢¤ë)ÌäÂê¤ò½¤Àµ
-- ÉÔÍפʻ²¾ÈÅϤ·¤òºï½ü
-- ¤½¤Î¾ºÙ¤«¤Ê½¤Àµ(elseif -> else ifÅù)
-- PATH_SEPARATOR/DIRECTORY_SEPARATOR¤¬Ì¤ÄêµÁ¤Î¾ì¹ç(PHP 4.1.xÅù)¤ÎÌäÂê¤ò½¤Àµ
-- smarty_modifier_wordwrap_i18n()¤Î²þ¹ÔÂбþ
-- ¥æ¡¼¥¶ÄêµÁ¥Õ¥©¡¼¥à¸¡¾Ú¥á¥½¥Ã¥É¤¬¸Æ¤Ó½Ð¤µ¤ì¤Ê¤¤(¤³¤È¤¬¤¢¤ë)ÌäÂê¤ò½¤Àµ
-- ¥Þ¥ë¥Á¥«¥é¥à¥×¥é¥¤¥Þ¥ê¥­¡¼ÍøÍÑ»þ¤Ë¥ª¥Ö¥¸¥§¥¯¥È¤ÎÀµÅöÀ­¤¬Àµ¤·¤¯È½Ê̤Ǥ­¤Ê¤¤ÌäÂê¤ò½¤Àµ
-- Ethna_AppObject¤ÎJOIN¸¡º÷¤¬SQL¥¨¥é¡¼¤Ë¤Ê¤ë¡Ê¤³¤È¤¬¤¢¤ë¡ËÌäÂê¤ò½¤Àµ
-- ¥»¥Ã¥·¥ç¥ó¤òÉüµ¢¤µ¤»¤ë¥¿¥¤¥ß¥ó¥°¤òÃÙ±ä(̵¸Â¥ë¡¼¥×¤¹¤ëÌäÂê¤ò½¤Àµ)
-- Ethna_MalSender¤«¤émail()´Ø¿ô¤Ë¥ª¥×¥·¥ç¥ó¤òÅϤ»¤ë¤è¤¦¤Ë½¤Àµ
-- Ethna_View_List::_fixNameObject¤ËÂоݥª¥Ö¥¸¥§¥¯¥È¤âÅϤ¹¤è¤¦¤Ë½¤Àµ
-
-
-** [2005/03/02] 0.1.5
-
-*** features
-
-- Ethna_Controller::getCLI()(CLI¤Ç¼Â¹ÔÃ椫¤É¤¦¤«¤òÊÖ¤¹¥á¥½¥Ã¥É)¤òÄɲÃ
-- ethna_error_handler¤¬php.ini¤ÎÀßÄê¤Ë±þ¤¸¤ÆPHP¥í¥°¤â½ÐÎϤ¹¤ë¤è¤¦¤ËÊѹ¹
-- Smarty¥×¥é¥°¥¤¥ó(truncate_i18n)¤òÄɲÃ
-- Ethna_AppObject/Ethna_AppManager¤Ë¥­¥ã¥Ã¥·¥åµ¡¹½¤òÄɲÃ(experimental)
-- ¥á¡¼¥ë¥Æ¥ó¥×¥ì¡¼¥È¥¨¥ó¥¸¥ó¤Î¥Õ¥Ã¥¯¥á¥½¥Ã¥É¤òÄɲÃ
-- MIME¥¨¥ó¥³¡¼¥ÉÍѥ桼¥Æ¥£¥ê¥Æ¥£¥á¥½¥Ã¥É¤òÄɲÃ
-- include_path¤Î¥»¥Ñ¥ì¡¼¥¿¤Îwin32Âбþ
-
-*** bug fixes
-
-- ethna_error_handler¤Îtypo¤ò½¤Àµ
-- Ethna_Session¥¯¥é¥¹¤Ç¥í¥°¤¬Àµ¤·¤¯½ÐÎϤµ¤ì¤Ê¤¤ÌäÂê¤ò½¤Àµ
-
-
-** [2005/01/14] 0.1.4
-
-*** features
-
-- Ethna_AppObject¤ÇJOIN¤·¤¿¾ì¹ç¤Ë¡¢(²Äǽ¤Ê¤é)¥×¥é¥¤¥Þ¥ê¥­¡¼¤ÇGROUP BY¤¹¤ë¤è¤¦¤ËÊѹ¹
-
-*** bug fixes
-
-- __ethna_info__¤¬Á´¤¯Æ°ºî¤·¤Ê¤¤ÌäÂê¤ò½¤Àµ:(
-
-
-** [2005/01/13] 0.1.3
-
-*** features
-
-- Ethna_AppSearchObject¤ÎÊ£¹ç¾ò·ïÂбþ
-- Ethna_ClassFactory¥¯¥é¥¹¤òÄɲÃ
-- Ethna_Controller¤Îbackend, i18n, session, action_error¥á¥ó¥Ð¤òÇÑ»ß
-- Ethna_Controller::getClass()¥á¥½¥Ã¥É¤òÇÑ»ß
-- Ethna_ActionClass¤Ëauthenticate¥á¥½¥Ã¥É¤òÄɲÃ
-- preActionFilter/postActionFilter¤òÄɲÃ(experimental)
-- Ethna_View_List(¥ê¥¹¥Èɽ¼¨Íѥӥ塼´ðÄ쥯¥é¥¹)¤Î¥½¡¼¥ÈÂбþ
-- ÁȤ߹þ¤ßSmarty´Ø¿ôis_error()¤òÄɲÃ
-- Ethna_ActionForm::handleError¤ÎÂè2°ú¿ô¤òÇÑ»ß
-- Ethna_ActionForm::_handleError¤òpublic¥á¥½¥Ã¥É¤ËÊѹ¹(Ethna_ActionForm::handleError¤Ë̾¾ÎÊѹ¹)
-- Ethna_ActionForm::getDef¥á¥½¥Ã¥É¤Ë°ú¿ô¤òÄɲÃ(¾Êά²Ä)
-
-*** bug fixes
-
-- ¥Õ¥©¡¼¥àÄêµÁ¤ËÇÛÎó¤ò»ØÄꤷ¤Æ¤¤¤¿¾ì¹ç¤Î¥«¥¹¥¿¥à¥Á¥§¥Ã¥¯¥á¥½¥Ã¥É¤Î¸Æ¤Ó½Ð¤·¤¬Àµ¤·¤¯¹Ô¤ï¤ì¤Ê¤¤ÌäÂê¤ò½¤Àµ
-- ¥Õ¥©¡¼¥àÄêµÁ¤ËÇÛÎó¤ò»ØÄꤷ¤Æ¤¤¤¿¾ì¹ç¤Îɬ¿Ü¥Á¥§¥Ã¥¯¤¬Àµ¤·¤¯¹Ô¤ï¤ì¤Ê¤¤ÌäÂê¤ò½¤Àµ
-- __ethna_info__¤¬¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤ËÄêµÁ¤µ¤ì¤¿¥¢¥¯¥·¥ç¥ó¤òÀµ¤·¤¯¼èÆÀ¤Ç¤­¤Ê¤¤ÌäÂê¤ò½¤Àµ
-- VAR_TYPE_FILE¤Î¾ì¹ç¤Ïregexp°À­¤¬Ìµ¸ú¤Ë¤Ê¤ë¤è¤¦¤Ë½¤Àµ
-
-
-** [2004/12/23] 0.1.2
-
-*** features
-
-- __ethna_info__¥¢¥¯¥·¥ç¥ó¤òÄɲÃ
-- class_path, form_path, view_path°À­¤Î¥Õ¥ë¥Ñ¥¹»ØÄꥵ¥Ý¡¼¥È¤òÄɲÃ
-- ¥¹¥¯¥ê¥×¥È¤ò1¥Õ¥¡¥¤¥ë¤Ë¤Þ¤È¤á¤ë¥Ä¡¼¥ë(bin/unify_script.php)¤òÄɲÃ
-
-*** bug fixes
-
-- ¥×¥í¥¸¥§¥¯¥È¥¹¥±¥ë¥È¥óÀ¸À®»þ¤Ë¥¢¥×¥ê¥±¡¼¥·¥ç¥óID¤Îʸ»ú¼ï/ͽÌó¸ì¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤è¤¦¤Ë½¤Àµ
-- 'form_name'¤ò»ØÄꤹ¤ë¤È̵ÍѤ˷ٹð¤¬È¯À¸¤¹¤ëÌäÂê¤ò½¤Àµ
-- ÀäÂХѥ¹È½Äê¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à°Í¸¤ò½¤Àµ(WindowsÂбþ²þÁ±)
-- VAR_TYPE_INT¤ÈVAR_TYPE_FLOAT¤ÎÄêµÁÃͤ¬½ÅÊ£¤·¤Æ¤¤¤¿ÌäÂê¤ò½¤Àµ
-- SOAP/Mobile(AU)¤Ç¥¢¥¯¥·¥ç¥ó¥¹¥¯¥ê¥×¥È¤Î¥Ñ¥¹¤¬Àµ¤·¤¯¼èÆÀ¤Ç¤­¤Ê¤¤ÌäÂê¤ò½¤Àµ
-- Ethna_Util::getRandom()¤Çmt_srand()¤·¤Ä¤Ärand()¤ò¸Æ¤ó¤Ç¤¤¤¿²Õ½ê¤òmt_rand()¤ò¸Æ¤Ó½Ð¤¹¤è¤¦¤Ë½¤Àµ
-- CHANGES¤Î¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°½¤Àµ(ISO-2022-JP -> EUC-JP)
-- ¥Õ¥ì¡¼¥à¥ï¡¼¥¯¤¬È¯¹Ô¤¹¤ëSQLʸ¤Ë°ìÉô»Ä¤Ã¤Æ¤¤¤¿¥»¥ß¥³¥í¥ó¤òºï½ü
-- ¥¨¥ó¥È¥ê¥Ý¥¤¥ó¥È(index.php)¤Ëµ­½Ò¤µ¤ì¤¿¥Ç¥Õ¥©¥ë¥È¥¢¥¯¥·¥ç¥ó̾¤Î1Í×ÁÇÌܤ˥¢¥¹¥¿¥ê¥¹¥¯¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ë¤È¡¢Àµ¤·¤¯Æ°ºî¤·¤Ê¤¤(¤«¤â¤·¤ì¤Ê¤¤)ÌäÂê¤ò½¤Àµ~
-Îã(¤³¤ó¤Ê¾ì¹ç):
- <?php
- include_once('../../app/Sample_Controller.php');
- Sample_Controller::Main('Sample_Controller', array(
-  'login*',
- ));
- ?>
-
-
-** [2004/12/10] 0.1.1
-
-*** bug fixes
-
-- ¥Ó¥å¡¼¥ª¥Ö¥¸¥§¥¯¥È¤Îpreforward()¤¬¸Æ¤Ð¤ì¤Ê¤¤¤³¤È¤¬¤¢¤ëÌäÂê¤ò½¤Àµ
-- ¥¢¥¯¥·¥ç¥ó/¥Ó¥å¡¼¤Î¥¹¥±¥ë¥È¥óÀ¸À®»þ¤Ë¥Õ¥¡¥¤¥ë¤ò¾å½ñ¤­¤·¤Ê¤¤¤è¤¦¤Ë½¤Àµ
-- ¥Ó¥å¡¼¤Î¥¹¥±¥ë¥È¥ó¤Ç¥¯¥é¥¹Ì¾¤¬Àµ¤·¤¯ÃÖ´¹¤µ¤ì¤Ê¤¤ÌäÂê¤ò½¤Àµ
-
-** [2004/12/09] 0.1.0
-
-- ½é´ü¥ê¥ê¡¼¥¹
-
diff --git a/Ethna.php b/Ethna.php
deleted file mode 100644 (file)
index 83258d5..0000000
--- a/Ethna.php
+++ /dev/null
@@ -1,426 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-/** Ethna depends on PEAR */
-require_once 'PEAR.php';
-
-if (!defined('PATH_SEPARATOR')) {
-    if (OS_WINDOWS) {
-        /** include_path separator(Windows) */
-        define('PATH_SEPARATOR', ';');
-    } else {
-        /** include_path separator(Unix) */
-        define('PATH_SEPARATOR', ':');
-    }
-}
-if (!defined('DIRECTORY_SEPARATOR')) {
-    if (OS_WINDOWS) {
-        /** directory separator(Windows) */
-        define('DIRECTORY_SEPARATOR', '\\');
-    } else {
-        /** separator(Unix) */
-        define('DIRECTORY_SEPARATOR', '/');
-    }
-}
-
-/** ¥Ð¡¼¥¸¥ç¥óÄêµÁ */
-define('ETHNA_VERSION', '2.3.2');
-
-/** Ethna¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥êÄêµÁ */
-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';
-
-if (extension_loaded('soap')) {
-    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('LANG_EN', 'en');
-
-/** ¥¯¥é¥¤¥¢¥ó¥È¸À¸ìÄêµÁ: ÆüËܸì */
-define('LANG_JA', 'ja');
-
-
-/** ¥²¡¼¥È¥¦¥§¥¤: WWW */
-define('GATEWAY_WWW', 1);
-
-/** ¥²¡¼¥È¥¦¥§¥¤: CLI */
-define('GATEWAY_CLI', 2);
-
-/** ¥²¡¼¥È¥¦¥§¥¤: XMLRPC */
-define('GATEWAY_XMLRPC', 3);
-
-/** ¥²¡¼¥È¥¦¥§¥¤: SOAP */
-define('GATEWAY_SOAP', 4);
-
-
-/** DB¼ïÊÌÄêµÁ: R/W */
-define('DB_TYPE_RW', 1);
-
-/** DB¼ïÊÌÄêµÁ: R/O */
-define('DB_TYPE_RO', 2);
-
-/** DB¼ïÊÌÄêµÁ: Misc  */
-define('DB_TYPE_MISC', 3);
-
-
-/** Í×ÁÇ·¿: À°¿ô */
-define('VAR_TYPE_INT', 1);
-
-/** Í×ÁÇ·¿: ÉâÆ°¾®¿ôÅÀ¿ô */
-define('VAR_TYPE_FLOAT', 2);
-
-/** Í×ÁÇ·¿: Ê¸»úÎó */
-define('VAR_TYPE_STRING', 3);
-
-/** Í×ÁÇ·¿: ÆüÉÕ */
-define('VAR_TYPE_DATETIME', 4);
-
-/** Í×ÁÇ·¿: ¿¿µ¶ÃÍ */
-define('VAR_TYPE_BOOLEAN', 5);
-
-/** Í×ÁÇ·¿: ¥Õ¥¡¥¤¥ë */
-define('VAR_TYPE_FILE', 6);
-
-
-/** ¥Õ¥©¡¼¥à·¿: text */
-define('FORM_TYPE_TEXT', 1);
-
-/** ¥Õ¥©¡¼¥à·¿: password */
-define('FORM_TYPE_PASSWORD', 2);
-
-/** ¥Õ¥©¡¼¥à·¿: textarea */
-define('FORM_TYPE_TEXTAREA', 3);
-
-/** ¥Õ¥©¡¼¥à·¿: select */
-define('FORM_TYPE_SELECT', 4);
-
-/** ¥Õ¥©¡¼¥à·¿: radio */
-define('FORM_TYPE_RADIO', 5);
-
-/** ¥Õ¥©¡¼¥à·¿: checkbox */
-define('FORM_TYPE_CHECKBOX', 6);
-
-/** ¥Õ¥©¡¼¥à·¿: button */
-define('FORM_TYPE_SUBMIT', 7);
-
-/** ¥Õ¥©¡¼¥à·¿: file */
-define('FORM_TYPE_FILE', 8);
-
-/** ¥Õ¥©¡¼¥à·¿: button */
-define('FORM_TYPE_BUTTON', 9);
-
-/** ¥Õ¥©¡¼¥à·¿: hidden */
-define('FORM_TYPE_HIDDEN', 10);
-
-
-/** ¥¨¥é¡¼¥³¡¼¥É: °ìÈÌ¥¨¥é¡¼ */
-define('E_GENERAL', 1);
-
-/** ¥¨¥é¡¼¥³¡¼¥É: DBÀܳ¥¨¥é¡¼ */
-define('E_DB_CONNECT', 2);
-
-/** ¥¨¥é¡¼¥³¡¼¥É: DBÀßÄê¤Ê¤· */
-define('E_DB_NODSN', 3);
-
-/** ¥¨¥é¡¼¥³¡¼¥É: DB¥¯¥¨¥ê¥¨¥é¡¼ */
-define('E_DB_QUERY', 4);
-
-/** ¥¨¥é¡¼¥³¡¼¥É: DB¥æ¥Ë¡¼¥¯¥­¡¼¥¨¥é¡¼ */
-define('E_DB_DUPENT', 5);
-
-/** ¥¨¥é¡¼¥³¡¼¥É: 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½ÅÊ£¥¨¥é¡¼ */
-define('E_APP_DUPENT', 34);
-
-/** ¥¨¥é¡¼¥³¡¼¥É: ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥á¥½¥Ã¥É¤¬Â¸ºß¤·¤Ê¤¤ */
-define('E_APP_NOMETHOD', 35);
-
-/** ¥¨¥é¡¼¥³¡¼¥É: ¥í¥Ã¥¯¥¨¥é¡¼ */
-define('E_APP_LOCK', 36);
-
-/** ¥¨¥é¡¼¥³¡¼¥É: Æɤ߹þ¤ß¥¨¥é¡¼ */
-define('E_APP_READ', 37);
-
-/** ¥¨¥é¡¼¥³¡¼¥É: ½ñ¤­¹þ¤ß¥¨¥é¡¼ */
-define('E_APP_WRITE', 38);
-
-/** ¥¨¥é¡¼¥³¡¼¥É: 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_REGEXP', 146);
-
-/** ¥¨¥é¡¼¥³¡¼¥É: ¥Õ¥©¡¼¥àÃÍ¿ôÃÍ(¥«¥¹¥¿¥à¥Á¥§¥Ã¥¯)¥¨¥é¡¼ */
-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) {
-    /** PHP 5¤È¤Î¸ß´¹ÊÝ»ýÄêµÁ */
-    define('E_STRICT', 2048);
-}
-
-/** Ethna¥°¥í¡¼¥Ð¥ëÊÑ¿ô: ¥¨¥é¡¼¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô */
-$GLOBALS['_Ethna_error_callback_list'] = array();
-
-/** Ethna¥°¥í¡¼¥Ð¥ëÊÑ¿ô: ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸ */
-$GLOBALS['_Ethna_error_message_list'] = array();
-
-
-// {{{ Ethna
-/**
- *  Ethna¥Õ¥ì¡¼¥à¥ï¡¼¥¯¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna extends PEAR
-{
-    /**#@+
-     *  @access private
-     */
-
-    /**#@-*/
-
-    /**
-     *  Ethna_Error¥ª¥Ö¥¸¥§¥¯¥È¤òÀ¸À®¤¹¤ë(¥¨¥é¡¼¥ì¥Ù¥ë:E_USER_ERROR)
-     *
-     *  @access public
-     *  @param  string  $message            ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸
-     *  @param  int     $code               ¥¨¥é¡¼¥³¡¼¥É
-     *  @static
-     */
-    function &raiseError($message, $code = E_GENERAL)
-    {
-        $userinfo = null;
-        if (func_num_args() > 2) {
-            $userinfo = array_slice(func_get_args(), 2);
-            if (count($userinfo) == 1 && is_array($userinfo[0])) {
-                $userinfo = $userinfo[0];
-            }
-        }
-        return PEAR::raiseError($message, $code, PEAR_ERROR_RETURN, E_USER_ERROR, $userinfo, 'Ethna_Error');
-    }
-
-    /**
-     *  Ethna_Error¥ª¥Ö¥¸¥§¥¯¥È¤òÀ¸À®¤¹¤ë(¥¨¥é¡¼¥ì¥Ù¥ë:E_USER_WARNING)
-     *
-     *  @access public
-     *  @param  string  $message            ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸
-     *  @param  int     $code               ¥¨¥é¡¼¥³¡¼¥É
-     *  @static
-     */
-    function &raiseWarning($message, $code = E_GENERAL)
-    {
-        $userinfo = null;
-        if (func_num_args() > 2) {
-            $userinfo = array_slice(func_get_args(), 2);
-            if (count($userinfo) == 1 && is_array($userinfo[0])) {
-                $userinfo = $userinfo[0];
-            }
-        }
-        return PEAR::raiseError($message, $code, PEAR_ERROR_RETURN, E_USER_WARNING, $userinfo, 'Ethna_Error');
-    }
-
-    /**
-     *  Ethna_Error¥ª¥Ö¥¸¥§¥¯¥È¤òÀ¸À®¤¹¤ë(¥¨¥é¡¼¥ì¥Ù¥ë:E_USER_NOTICE)
-     *
-     *  @access public
-     *  @param  string  $message            ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸
-     *  @param  int     $code               ¥¨¥é¡¼¥³¡¼¥É
-     *  @static
-     */
-    function &raiseNotice($message, $code = E_GENERAL)
-    {
-        $userinfo = null;
-        if (func_num_args() > 2) {
-            $userinfo = array_slice(func_get_args(), 2);
-            if (count($userinfo) == 1 && is_array($userinfo[0])) {
-                $userinfo = $userinfo[0];
-            }
-        }
-        return PEAR::raiseError($message, $code, PEAR_ERROR_RETURN, E_USER_NOTICE, $userinfo, 'Ethna_Error');
-    }
-
-    /**
-     *  ¥¨¥é¡¼È¯À¸»þ¤Î(¥Õ¥ì¡¼¥à¥ï¡¼¥¯¤È¤·¤Æ¤Î)¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤òÀßÄꤹ¤ë
-     *
-     *  @access public
-     *  @param  mixed   string:¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô̾ array:¥³¡¼¥ë¥Ð¥Ã¥¯¥¯¥é¥¹(̾|¥ª¥Ö¥¸¥§¥¯¥È)+¥á¥½¥Ã¥É̾
-     *  @static
-     */
-    function setErrorCallback($callback)
-    {
-        $GLOBALS['_Ethna_error_callback_list'][] = $callback;
-    }
-
-    /**
-     *  ¥¨¥é¡¼È¯À¸»þ¤Î(¥Õ¥ì¡¼¥à¥ï¡¼¥¯¤È¤·¤Æ¤Î)¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤ò¥¯¥ê¥¢¤¹¤ë
-     *
-     *  @access public
-     *  @static
-     */
-    function clearErrorCallback()
-    {
-        $GLOBALS['_Ethna_error_callback_list'] = array();
-    }
-
-    /**
-     *  ¥¨¥é¡¼È¯À¸»þ¤Î½èÍý¤ò¹Ô¤¦(¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô/¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹)
-     *  
-     *  @access public
-     *  @param  object  Ethna_Error     Ethna_Error¥ª¥Ö¥¸¥§¥¯¥È
-     *  @static
-     */
-    function handleError(&$error)
-    {
-        for ($i = 0; $i < count($GLOBALS['_Ethna_error_callback_list']); $i++) {
-            $callback =& $GLOBALS['_Ethna_error_callback_list'][$i];
-            if (is_array($callback) == false) {
-                call_user_func($callback, $error);
-            } else if (is_object($callback[0])) {
-                $object =& $callback[0];
-                $method = $callback[1];
-
-                // perform some more checks?
-                $object->$method($error);
-            } else {
-                call_user_func($callback, $error);
-            }
-        }
-    }
-}
-// }}}
-?>
diff --git a/LICENSE b/LICENSE
deleted file mode 100644 (file)
index ffd56fc..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,31 +0,0 @@
-The BSD License
-
-Copyright (c) 2004-2006, Masaki Fujimoto
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-  - Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer. 
-  - Redistributions in binary form must reproduce the above
-    copyright notice, this list of conditions and the following
-       disclaimer in the documentation and/or other materials provided
-       with the distribution. 
-  - Neither the name of the author nor the names of its contributors
-    may be used to endorse or promote products derived from this
-       software without specific prior written permission. 
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
diff --git a/README b/README
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/bin/ethna.bat b/bin/ethna.bat
deleted file mode 100755 (executable)
index 521dd55..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-@echo off
-
-rem
-rem   ethna.bat
-rem
-rem   simple command line gateway
-rem
-rem   $Id: ethna.bat 457 2007-02-07 11:14:39Z ichii386 $
-rem
-
-if "%OS%"=="Windows_NT" @setlocal
-
-if NOT "%PHP_PEAR_INSTALL_DIR%" == "" (
-set DEFAULT_ETHNA_HOME=%PHP_PEAR_INSTALL_DIR%\Ethna
-) ELSE (
-set DEFAULT_ETHNA_HOME=%~dp0
-)
-
-goto init
-goto cleanup
-
-:init
-
-if "%ETHNA_HOME%" == "" set ETHNA_HOME=%DEFAULT_ETHNA_HOME%
-set DEFAULT_ETHNA_HOME=
-
-if "%PHP_COMMAND%" == "" goto no_phpcommand
-if "%PHP_CLASSPATH%" == "" goto set_classpath
-
-goto run
-goto cleanup
-
-:run
-IF EXIST "@PEAR-DIR@\Ethna" (
-  %PHP_COMMAND% -d html_errors=off -qC "@PEAR-DIR@\Ethna\bin\ethna_handle.php" %1 %2 %3 %4 %5 %6 %7 %8 %9
-) ELSE (
-  %PHP_COMMAND% -d html_errors=off -qC "%ETHNA_HOME%\bin\ethna_handle.php" %1 %2 %3 %4 %5 %6 %7 %8 %9
-)
-goto cleanup
-
-:no_phpcommand
-set PHP_COMMAND=php.exe
-goto init
-
-:set_classpath
-set PHP_CLASSPATH=%ETHNA_HOME%\class
-goto init
-
-:cleanup
-if "%OS%"=="Windows_NT" @endlocal
-REM pause
diff --git a/bin/ethna.sh b/bin/ethna.sh
deleted file mode 100755 (executable)
index c48cb62..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-#
-#   ethna.sh
-#
-#   simple command line gateway
-#
-#   $Id: ethna.sh 439 2007-01-04 06:23:15Z ichii386 $
-#
-
-if test -z "$ETHNA_HOME"
-then
-    if test "@PEAR-DIR@" = '@'PEAR-DIR'@'
-    then
-        ETHNA_HOME="/usr/share/php/Ethna"
-    else
-        ETHNA_HOME="@PEAR-DIR@/Ethna"
-    fi
-fi
-
-if test -z "$PHP_COMMAND"
-then
-    if test "@PHP-BIN@" = '@'PHP-BIN'@'
-    then
-        PHP_COMMAND="php"
-    else
-        PHP_COMMAND="@PHP-BIN@/php"
-    fi
-    export PHP_COMMAND
-fi
-
-if test -z "$PHP_CLASSPATH"
-then
-    PHP_CLASSPATH="$ETHNA_HOME/class"
-    export PHP_CLASSPATH
-fi
-
-$PHP_COMMAND -d html_errors=off -qC $ETHNA_HOME/bin/ethna_handle.php $*
diff --git a/bin/ethna_handle.php b/bin/ethna_handle.php
deleted file mode 100644 (file)
index a324ee4..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-<?php
-/**
- *  ethna_handle.php
- *
- *  Ethna Handle Gateway
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-while (ob_get_level()) {
-    ob_end_clean();
-}
-
-// setup path seprator
-if (!defined('PATH_SEPARATOR')) {
-    if (OS_WINDOWS) {
-        /** include_path separator(Windows) */
-        define('PATH_SEPARATOR', ';');
-    } else {
-        /** include_path separator(Unix) */
-        define('PATH_SEPARATOR', ':');
-    }
-}
-$base = dirname(dirname(dirname(__FILE__)));
-ini_set('include_path', $base.PATH_SEPARATOR.ini_get('include_path'));
-
-require_once 'PEAR.php';
-require_once 'Console/Getopt.php';
-require_once 'Ethna/Ethna.php';
-
-// fetch arguments
-$arg_list = Console_Getopt::readPHPArgv();
-if (Ethna::isError($arg_list)) {
-    echo $arg_list->getMessage()."\n";
-    exit(2);
-}
-array_shift($arg_list);
-
-$eh =& new Ethna_Handle();
-
-list($my_arg_list, $arg_list) = _Ethna_HandleGateway_SeparateArgList($arg_list);
-$r = Console_Getopt::getopt($my_arg_list, "v", array("version"));
-if (Ethna::isError($r)) {
-    usage($eh);
-    exit(1);
-}
-
-// ad-hoc:(
-foreach ($r[0] as $opt) {
-    if ($opt[0] == "v" || $opt[0] == "--version") {
-        _Ethna_HandleGateway_ShowVersion();
-        exit(2);
-    }
-}
-
-if (count($arg_list) == 0) {
-    usage($eh);
-    exit(1);
-}
-
-$id = array_shift($arg_list);
-
-$handler =& $eh->getHandler($id);
-if (Ethna::isError($handler)) {
-    printf("no such command: %s\n\n", $id);
-    usage($eh);
-    exit(1);
-}
-
-// don't know what will happen:)
-$handler->setArgList($arg_list);
-$r = $handler->perform();
-if (Ethna::isError($r)) {
-    printf("error occured w/ command [%s]\n  -> %s\n\n", $id, $r->getMessage());
-    if ($r->getCode() == 'usage') {
-        $handler->usage();
-    }
-    exit(1);
-}
-
-/**
- *  usage
- */
-function usage(&$eh)
-{
-    $handler_list = $eh->getHandlerList();
-    printf("usage: ethna [option] [command] [args...]\n\n");
-    printf("available options are as follows:\n\n");
-    printf("  -v, --version    show version and exit\n");
-    printf("\navailable commands are as follows:\n\n");
-    foreach ($handler_list as $handler) {
-        printf("  %s -> %s\n", $handler->getId(), $handler->getDescription());
-    }
-}
-
-/**
- *  fetch options for myself
- */
-function _Ethna_HandleGateway_SeparateArgList($arg_list)
-{
-    $my_arg_list = array();
-    for ($i = 0; $i < count($arg_list); $i++) {
-        if ($arg_list[$i]{0} == '-') {
-            // assume this should be an option for myself
-            $my_arg_list[] = $arg_list[$i];
-        } else {
-            break;
-        }
-    }
-    $arg_list = array_slice($arg_list, $i);
-
-    return array($my_arg_list, $arg_list);
-}
-
-/**
- *  show version
- */
-function _Ethna_HandleGateway_ShowVersion()
-{
-    $version = <<<EOD
-Ethna %s
-
-Copyright (c) 2004-2006,
-  Masaki Fujimoto <fujimoto@php.net>
-  halt feits <halt.feits@gmail.com>
-  Takuya Ookubo <sfio@sakura.ai.to>
-  nozzzzz <nozzzzz@gmail.com>
-  cocoitiban <cocoiti@comio.info>
-
-http://ethna.jp/
-
-EOD;
-    printf($version, ETHNA_VERSION);
-}
-?>
diff --git a/bin/ethna_make_package.php b/bin/ethna_make_package.php
deleted file mode 100644 (file)
index acb935e..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-<?php
-/**
- *  ethna_make_package.php
- *
- *  package.xml generator for Ethna
- *
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-require_once 'PEAR.php';
-require_once 'Console/Getopt.php';
-require_once 'PEAR/PackageFileManager2.php';
-require_once 'PEAR/PackageFileManager/File.php';   // avoid bugs
-
-// args
-$arg_list = Console_Getopt::readPHPArgv();
-$state = "stable";
-$is_old_package = false;
-$get_version = false;
-
-$r = Console_Getopt::getopt($arg_list, "abov", array("alpha", "beta", "old-package", "version"));
-foreach ($r[0] as $opt) {
-    if ($opt[0] == "a" || $opt[0] == "--alpha") {
-        $state = "alpha";
-    }
-    if ($opt[0] == "b" || $opt[0] == "--beta") {
-        $state = "beta";
-    }
-    if ($opt[0] == "o" || $opt[0] == "--old-package") {
-        $is_old_package = true;
-    }
-    if ($opt[0] == "v" || $opt[0] == "--version") {
-        $get_version = true;
-    }
-}
-
-$description = 'Ethna Web Application Framework';
-$package = 'Ethna';
-
-// x.0.y -> beta
-// x.1.y -> stable
-$major_version = "2.3";
-$minor_version = "2";
-
-if ($state == 'alpha' || $state == 'beta') {
-    $version = $major_version . strftime('.%Y%m%d%H');
-} else {
-    $version = $major_version . "." . $minor_version;
-}
-
-if ($get_version) {
-    print $version;
-    exit();
-}
-
-$config = array(
-    'baseinstalldir' => 'Ethna',
-    'packagedirectory' => dirname(dirname(__FILE__)),
-    'filelistgenerator' => 'file',
-    'ignore' => array('CVS/', '.svn/', 'package.xml', 'ethna_make_package.php', 'ethna_make_package.sh'),
-    'changelogoldtonew' => false,
-    'exceptions' => array('README' => 'doc', 'LICENSE' => 'doc', 'CHANGES' => 'doc'),
-    'description' => $description,
-    'exceptions' => array('bin/ethna.sh' => 'script', 'bin/ethna.bat' => 'script'),
-    'installexceptions' => array('bin/ethna.sh' => '/', 'bin/ethna.bat' => '/'),
-    'installas' => array('bin/ethna.sh' => 'ethna', 'bin/ethna.bat' => 'ethna.bat'),
-);
-$packagexml = new PEAR_PackageFileManager2();
-$packagexml->setOptions($config);
-$packagexml->setPackage($package);
-$packagexml->setSummary('Ethna PHP Framework Package');
-$packagexml->setDescription($description);
-$packagexml->setChannel('pear.ethna.jp');
-$packagexml->setAPIVersion($version);
-$packagexml->setReleaseVersion($version);
-$packagexml->setReleaseStability($state);
-$packagexml->setAPIStability($state);
-$packagexml->setNotes('Ethna PHP Web Application Framework');
-$packagexml->setPackageType('php');
-
-$packagexml->addRole('*', 'php');
-
-$packagexml->setPhpDep('4.1.0');
-$packagexml->setPearinstallerDep('1.3.5');
-
-$packagexml->addMaintainer('lead', 'fujimoto' , 'Masaki Fujimoto', 'fujimoto@php.net');
-$packagexml->addMaintainer('lead', 'halt' , 'halt feits', 'halt.feits@gmail.com');
-$packagexml->addMaintainer('lead', 'cocoitiban', 'Keita Arai', 'cocoiti@comio.info');
-$packagexml->addMaintainer('lead', 'ichii386', 'ICHII Takashi', 'ichii386@schweetheart.jp');
-
-$packagexml->setLicense('The BSD License', 'http://www.opensource.org/licenses/bsd-license.php');
-
-$packagexml->addReplacement('bin/ethna.bat', 'pear-config', '@PEAR-DIR@', 'php_dir');
-$packagexml->addReplacement('bin/ethna.bat', 'pear-config', '@PHP-BIN@', 'bin_dir');
-$packagexml->addReplacement('bin/ethna.sh', 'pear-config', '@PEAR-DIR@', 'php_dir');
-$packagexml->addReplacement('bin/ethna.sh', 'pear-config', '@PHP-BIN@', 'bin_dir');
-
-$packagexml->addRelease();
-$packagexml->setOSInstallCondition('windows');
-$packagexml->addInstallAs('bin/ethna.bat', 'ethna.bat');
-$packagexml->addIgnoreToRelease('bin/ethna.sh');
-$packagexml->addRelease();
-$packagexml->addInstallAs('bin/ethna.sh', 'ethna');
-$packagexml->addIgnoreToRelease('bin/ethna.bat');
-
-$packagexml->generateContents();
-
-if ($is_old_package) {
-    $pkg =& $packagexml->exportCompatiblePackageFile1();
-    $pkg->writePackageFile();
-} else {
-    $packagexml->writePackageFile();
-}
-?>
diff --git a/bin/ethna_make_package.sh b/bin/ethna_make_package.sh
deleted file mode 100755 (executable)
index ce2bd20..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/sh
-#
-#   ethna_make_package.sh
-#
-#   ...:(
-#
-#   $Id: ethna_make_package.sh 461 2007-04-19 14:50:45Z ichii386 $
-#
-tmpdir="/tmp/ethna"
-
-if [ ! -d $tmpdir ]
-then
-    mkdir -p $tmpdir
-fi
-
-if [ "$1" = "-b" ]
-then
-    beta=$1
-fi
-
-# chdir to basedir
-cwd=`dirname $0`
-basedir="$cwd/../"
-cd $basedir
-basedir=`pwd`
-
-version=`php $basedir/bin/ethna_make_package.php $beta -v`
-targetdir="$tmpdir/Ethna-$version"
-
-rm -f $basedir/package.xml
-
-rm -fr $targetdir
-mkdir $targetdir
-cp -a . "$targetdir/"
-
-find $targetdir -name "CVS" -o -name ".svn" | xargs rm -fr
-
-# create package for php 5
-php $basedir/bin/ethna_make_package.php $beta
-cp -f $basedir/package.xml $tmpdir/
-cd $tmpdir
-tar zcvf Ethna-$version.tgz package.xml Ethna-$version
-
-cd $basedir
-php $basedir/bin/ethna_make_package.php $beta -o
-cp -f $basedir/package.xml $tmpdir/
-cd $tmpdir
-tar zcvf Ethna-$version-dev.tgz package.xml Ethna-$version
-
diff --git a/bin/ethna_run_test.php b/bin/ethna_run_test.php
deleted file mode 100644 (file)
index fd4f629..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-<?php
-/**
- *  ethna_run_test.php
- *
- *  Ethna Test Runner
- *
- *  @author     Kazuhiro Hosoi <hosoi@gree.co.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-/** ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê */
-define('BASE', dirname(dirname(__FILE__)));
-
-/** include_path¤ÎÀßÄê(¤³¤Îtest runner¤¬¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤òÄɲÃ) */
-ini_set('include_path', dirname(BASE) . PATH_SEPARATOR . ini_get('include_path'));
-
-/** Ethna´ØÏ¢¥¯¥é¥¹¤Î¥¤¥ó¥¯¥ë¡¼¥É */
-require_once 'Ethna/Ethna.php';
-
-/** SimpleTest¤Î¥¤¥ó¥¯¥ë¡¼¥É */
-require_once 'simpletest/unit_tester.php';
-require_once 'simpletest/reporter.php';
-require_once 'Ethna/test/TextDetailReporter.php';
-require_once 'Ethna/test/Ethna_UnitTestBase.php';
-
-/** ¥Æ¥¹¥È¥±¡¼¥¹¤¬¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê */
-$test_dir = ETHNA_BASE . '/test';
-
-$test = &new GroupTest('Ethna All tests');
-
-// ¥Æ¥¹¥È¥±¡¼¥¹¤Î¥Õ¥¡¥¤¥ë¥ê¥¹¥È¤ò¼èÆÀ
-require_once 'Console/Getopt.php';
-$args = Console_Getopt::readPHPArgv();
-list($args, $opts) = Console_Getopt::getopt2($args, '', array());
-array_shift($opts);
-if (count($opts) > 0) {
-    $file_list = $opts;
-} else {
-    $file_list = getFileList($test_dir);
-}
-
-// ¥Æ¥¹¥È¥±¡¼¥¹¤òÅÐÏ¿
-foreach ($file_list as $file) {
-    $test->addTestFile($file);
-}
-
-// ·ë²Ì¤ò¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ë½ÐÎÏ
-//$test->run(new TextReporter());
-$test->run(new TextDetailReporter());
-
-//{{{ getFileList
-/**
- * getFileList
- *
- * @param string $dir_path
- */
-function getFileList($dir_path)
-{
-    $file_list = array();
-
-    $dir = opendir($dir_path);
-
-    if ($dir == false) {
-        return false;
-    }
-
-    while($file_path = readdir($dir)) {
-
-        $full_path = $dir_path . '/'. $file_path;
-
-        if (is_file($full_path)){
-
-            // ¥Æ¥¹¥È¥±¡¼¥¹¤Î¥Õ¥¡¥¤¥ë¤Î¤ßÆɤ߹þ¤à
-            if (preg_match('/^(Ethna_)(.*)(_Test.php)$/',$file_path,$matches)) {
-                $file_list[] = $full_path;
-            }
-
-        // ¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤¬¤¢¤ë¾ì¹ç¤Ï¡¤ºÆµ¢Åª¤ËÆɤ߹þ¤à¡¥
-        // "."¤Ç»Ï¤Þ¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ÏÆɤ߹þ¤Þ¤Ê¤¤.
-        } else if (is_dir($full_path) && !preg_match('/^\./',$file_path,$matches)) {
-
-            $file_list = array_merge($file_list,getFileList($full_path));
-        }
-    }
-
-    closedir($dir);
-    return $file_list;
-}
-//}}}
-?>
diff --git a/bin/ethna_run_test.sh b/bin/ethna_run_test.sh
deleted file mode 100755 (executable)
index c614e9f..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-BIN_DIR=`dirname $0`
-ETHNA_DIR="$BIN_DIR/.."
-TEST_DIR="$ETHNA_DIR/test"
-TEST_RUNNER="$BIN_DIR/ethna_run_test.php"
-
-php $TEST_RUNNER $* < $TEST_DIR/run_test.stdin.txt
diff --git a/class/Action/Ethna_Action_Info.php b/class/Action/Ethna_Action_Info.php
deleted file mode 100644 (file)
index 8c04063..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Action_Info.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Form_Info
-/**
- *  __ethna_info__¥Õ¥©¡¼¥à¤Î¼ÂÁõ
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Form_Info extends Ethna_ActionForm
-{
-    /**
-     *  @access private
-     *  @var    array   ¥Õ¥©¡¼¥àÃÍÄêµÁ
-     */
-    var $form = array(
-    );
-}
-// }}}
-
-// {{{ Ethna_Action_Info
-/**
- *  __ethna_info__¥¢¥¯¥·¥ç¥ó¤Î¼ÂÁõ
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Action_Info extends Ethna_ActionClass
-{
-    /**
-     *  __ethna_info__¥¢¥¯¥·¥ç¥ó¤ÎÁ°½èÍý
-     *
-     *  @access public
-     *  @return string      ForwardÀè(Àµ¾ï½ªÎ»¤Ê¤énull)
-     */
-    function prepare()
-    {
-        return null;
-    }
-
-    /**
-     *  __ethna_info__¥¢¥¯¥·¥ç¥ó¤Î¼ÂÁõ
-     *
-     *  @access public
-     *  @return string  Á«°Ü̾
-     */
-    function perform()
-    {
-        return '__ethna_info__';
-    }
-}
-// }}}
-?>
diff --git a/class/Action/Ethna_Action_UnitTest.php b/class/Action/Ethna_Action_UnitTest.php
deleted file mode 100644 (file)
index 3879a94..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php
-/**
- *  Ethna_Action_UnitTest.php
- *
- *  @author     Takuya Ookubo <sfio@sakura.ai.to>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-/**
- *  __ethna_unittest__¥Õ¥©¡¼¥à¤Î¼ÂÁõ
- *
- *  @author     Takuya Ookubo <sfio@sakura.ai.to>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Form_UnitTest extends Ethna_ActionForm
-{
-    /**
-     *  @access private
-     *  @var    array   ¥Õ¥©¡¼¥àÃÍÄêµÁ
-     */
-    var $form = array(
-    );
-}
-
-/**
- *  __ethna_unittest__¥¢¥¯¥·¥ç¥ó¤Î¼ÂÁõ
- *
- *  @author     Takuya Ookubo <sfio@sakura.ai.to>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Action_UnitTest extends Ethna_ActionClass
-{
-    /**
-     *  __ethna_unittest__¥¢¥¯¥·¥ç¥ó¤ÎÁ°½èÍý
-     *
-     *  @access public
-     *  @return string      ForwardÀè(Àµ¾ï½ªÎ»¤Ê¤énull)
-     */
-    function prepare()
-    {
-        return null;
-    }
-
-    /**
-     *  __ethna_unittest__¥¢¥¯¥·¥ç¥ó¤Î¼ÂÁõ
-     *
-     *  @access public
-     *  @return string  Á«°Ü̾
-     */
-    function perform()
-    {
-        return '__ethna_unittest__';
-    }
-}
-?>
diff --git a/class/CLI/Ethna_CLI_ActionClass.php b/class/CLI/Ethna_CLI_ActionClass.php
deleted file mode 100644 (file)
index 5d83581..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  action_class.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_CLI_ActionClass
-/**
- *  ¥³¥Þ¥ó¥É¥é¥¤¥óaction¼Â¹Ô¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- *  @obsolete
- */
-class Ethna_CLI_ActionClass extends Ethna_ActionClass
-{
-    /**
-     *  action½èÍý
-     *
-     *  @access public
-     */
-    function Perform()
-    {
-        parent::Perform();
-        $_SERVER['REMOTE_ADDR'] = "0.0.0.0";
-        $_SERVER['HTTP_USER_AGENT'] = "";
-    }
-}
-// }}}
-?>
diff --git a/class/DB/Ethna_DB_ADOdb.php b/class/DB/Ethna_DB_ADOdb.php
deleted file mode 100644 (file)
index 0468851..0000000
+++ /dev/null
@@ -1,426 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_DB_ADOdb.php
- *
- *  @package    Ethna
- *  @author     halt feits <halt.feits@gmail.com>
- *  @version    $Id$
- */
-
-/**
- * ADOdb config setting
- */
-define('ADODB_OUTP', 'sprintf'); //disable output error
-
-require_once 'adodb/adodb.inc.php';
-
-/**
- *  Ethna_DB_ADOdb
- *
- *  Ethna¤Î¥Õ¥ì¡¼¥à¥ï¡¼¥¯¤ÇADOdb¥ª¥Ö¥¸¥§¥¯¥È¤ò°·¤¦¤¿¤á¤ÎÃê¾Ý¥¯¥é¥¹
- *
- *  @package    Ethna
- *  @author     halt feits <halt.feits@gmail.com>
- *  @access     public
- */
-class Ethna_DB_ADOdb extends Ethna_DB
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    object  DB              DB¥ª¥Ö¥¸¥§¥¯¥È */
-    var $db;
-
-    /** @var    string   dsn */
-    var $dsn;
-
-    /**#@-*/
-
-
-    /**
-     *  ¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Controller    &$controller    ¥³¥ó¥È¥í¡¼¥é¥ª¥Ö¥¸¥§¥¯¥È
-     *  @param  string  $dsn                                DSN
-     *  @param  bool    $persistent                         »ý³ÀܳÀßÄê
-     */
-    function Ethna_DB_ADOdb(&$controller, $dsn, $persistent)
-    {
-        parent::Ethna_DB($controller, $dsn, $persistent);
-
-        $this->logger =& $controller->getLogger();
-    }
-
-    //{{{ connect
-    /**
-     *  DB¤ËÀܳ¤¹¤ë
-     *
-     *  @access public
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function connect()
-    {
-        $dsn = $this->parseDSN($this->dsn);
-        
-        if ($dsn['phptype'] == 'sqlite') {
-            $path = $dsn['database'];
-            $this->db = ADONewConnection("sqlite");
-            $this->db->Connect($path);
-        } else {
-            $this->db = ADONewConnection($this->dsn);
-        }
-
-        if ( $this->db ) {
-            $this->db->SetFetchMode(ADODB_FETCH_ASSOC);
-            return true;
-        } else {
-            return false;
-        }    
-    }
-    //}}}
-
-    //{{{ disconnect
-    /**
-     *  DBÀܳ¤òÀÚÃǤ¹¤ë
-     *
-     *  @access public
-     */
-    function disconnect()
-    {
-        //$this->db->close();
-        return 0;
-    }
-    //}}}
-
-    //{{{ isValid
-    /**
-     *  DBÀܳ¾õÂÖ¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @return bool    true:Àµ¾ï(ÀܳºÑ¤ß) false:¥¨¥é¡¼/̤Àܳ
-     */
-    function isValid()
-    {
-        if ( is_object($this->db) ) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-    //}}}
-
-    //{{{ begin
-    /**
-     *  DB¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤ò³«»Ï¤¹¤ë
-     *
-     *  @access public
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function begin()
-    {
-        return $this->db->BeginTrans();
-    }
-    //}}}
-
-    //{{{ rollback
-    /**
-     *  DB¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤òÃæÃǤ¹¤ë
-     *
-     *  @access public
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function rollback()
-    {
-        $this->db->RollbackTrans();
-        return 0;
-    }
-    //}}}
-
-    //{{{ commit
-    /**
-     *  DB¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤ò½ªÎ»¤¹¤ë
-     *
-     *  @access public
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function commit()
-    {
-        $this->db->CommitTrans();
-        return 0;
-    }
-    //}}}
-
-    //{{{ query
-    /**
-     *  ¥¯¥¨¥ê¤òȯ¹Ô¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $query  SQLʸ
-     *  @return mixed   DB_Result:·ë²Ì¥ª¥Ö¥¸¥§¥¯¥È Ethna_Error:¥¨¥é¡¼
-     */
-    function &query($query, $inputarr = false)
-    {
-        return $this->_query($query, $inputarr);
-    }
-    //}}}
-    
-    //{{{ _query
-    /**
-     *  ¥¯¥¨¥ê¤òȯ¹Ô¤¹¤ë
-     *
-     *  @access private
-     *  @param  string  $query  SQLʸ
-     *  @return mixed   DB_Result:·ë²Ì¥ª¥Ö¥¸¥§¥¯¥È Ethna_Error:¥¨¥é¡¼
-     */
-    function &_query($query, $inputarr = false)
-    {
-        $this->logger->log(LOG_DEBUG, $query);
-        $r =& $this->db->execute($query, $inputarr);
-
-        if ($r === false) {
-
-            $error = Ethna::raiseError('¥¨¥é¡¼ SQL[%s] CODE[%d] MESSAGE[%s]',
-                E_DB_QUERY,
-                $query,
-                $this->db->ErrorNo(),
-                $this->db->ErrorMsg());
-
-            return $error;
-
-        }
-
-        return $r;
-    }
-    //}}}
-
-    //{{{ getAll
-    /**
-     * getAll
-     *
-     * @access public
-     */
-    function getAll($query, $inputarr = false)
-    {
-        $this->db->SetFetchMode(ADODB_FETCH_ASSOC);
-        return $this->db->getAll($query, $inputarr);
-    }
-    //}}}
-
-    //{{{ getOne
-    function getOne($query, $inputarr = false)
-    {
-        return $this->db->GetOne($query, $inputarr);
-    }
-    //}}}
-
-    //{{{ getRow
-    function getRow($query, $inputarr = false)
-    {
-        return $this->db->GetRow($query, $inputarr);
-    }
-    //}}}
-
-    //{{{ getCol
-    function getCol($query, $inputarr = false)
-    {
-        return $this->db->GetCol($query, $inputarr);
-    }
-    //}}}
-
-    //{{{ execute
-    function execute($query, $inputarr = false)
-    {
-        return $this->db->Execute($query, $inputarr);
-    }
-    //}}}
-
-    //{{{ replace
-    function replace($table, $arrFields, $keyCols, $autoQuote = false)
-    {
-        return $this->db->Replace($table, $arrFields, $keyCols, $autoQuote);
-    }
-    //}}}
-
-    //{{{ autoExecute
-    function autoExecute($table, $fields, $mode, $where = false, $forceUpdate = true, $magicq = false)
-    {
-        return $this->db->AutoExecute($table, $fields, $mode, $where, $forceUpdate, $magicq);
-    }
-    //}}}
-    
-    //{{{ pageExecute
-    /**
-     * pageExecute
-     *
-     * @param string $query
-     * @param string $nrows
-     * @param integer $page
-     * @param array $inputarr
-     */
-    function pageExecute($query, $nrows, $page, $inputarr = false)
-    {
-        return $this->db->PageExecute($query, $nrows, $page, $inputarr);
-    }
-    //}}}
-
-    // {{{ parseDSN()
-
-    /**
-     * Parse a data source name
-     *
-     * Additional keys can be added by appending a URI query string to the
-     * end of the DSN.
-     *
-     * The format of the supplied DSN is in its fullest form:
-     * <code>
-     *  phptype(dbsyntax)://username:password@protocol+hostspec/database?option=8&another=true
-     * </code>
-     *
-     * Most variations are allowed:
-     * <code>
-     *  phptype://username:password@protocol+hostspec:110//usr/db_file.db?mode=0644
-     *  phptype://username:password@hostspec/database_name
-     *  phptype://username:password@hostspec
-     *  phptype://username@hostspec
-     *  phptype://hostspec/database
-     *  phptype://hostspec
-     *  phptype(dbsyntax)
-     *  phptype
-     * </code>
-     *
-     * @param string $dsn Data Source Name to be parsed
-     *
-     * @return array an associative array with the following keys:
-     *  + phptype:  Database backend used in PHP (mysql, odbc etc.)
-     *  + dbsyntax: Database used with regards to SQL syntax etc.
-     *  + protocol: Communication protocol to use (tcp, unix etc.)
-     *  + hostspec: Host specification (hostname[:port])
-     *  + database: Database to use on the DBMS server
-     *  + username: User name for login
-     *  + password: Password for login
-     */
-    function parseDSN($dsn)
-    {
-        $parsed = array(
-            'phptype'  => false,
-            'dbsyntax' => false,
-            'username' => false,
-            'password' => false,
-            'protocol' => false,
-            'hostspec' => false,
-            'port'     => false,
-            'socket'   => false,
-            'database' => false,
-        );
-
-        if (is_array($dsn)) {
-            $dsn = array_merge($parsed, $dsn);
-            if (!$dsn['dbsyntax']) {
-                $dsn['dbsyntax'] = $dsn['phptype'];
-            }
-            return $dsn;
-        }
-
-        // Find phptype and dbsyntax
-        if (($pos = strpos($dsn, '://')) !== false) {
-            $str = substr($dsn, 0, $pos);
-            $dsn = substr($dsn, $pos + 3);
-        } else {
-            $str = $dsn;
-            $dsn = null;
-        }
-
-        // Get phptype and dbsyntax
-        // $str => phptype(dbsyntax)
-        if (preg_match('|^(.+?)\((.*?)\)$|', $str, $arr)) {
-            $parsed['phptype']  = $arr[1];
-            $parsed['dbsyntax'] = !$arr[2] ? $arr[1] : $arr[2];
-        } else {
-            $parsed['phptype']  = $str;
-            $parsed['dbsyntax'] = $str;
-        }
-
-        if (!count($dsn)) {
-            return $parsed;
-        }
-
-        // Get (if found): username and password
-        // $dsn => username:password@protocol+hostspec/database
-        if (($at = strrpos($dsn, '@')) !== false) {
-            $str = substr($dsn, 0, $at);
-            $dsn = substr($dsn, $at + 1);
-            if (($pos = strpos($str, ':')) !== false) {
-                $parsed['username'] = rawurldecode(substr($str, 0, $pos));
-                $parsed['password'] = rawurldecode(substr($str, $pos + 1));
-            } else {
-                $parsed['username'] = rawurldecode($str);
-            }
-        }
-
-        // Find protocol and hostspec
-        if (preg_match('|^([^(]+)\((.*?)\)/?(.*?)$|', $dsn, $match)) {
-            // $dsn => proto(proto_opts)/database
-            $proto      = $match[1];
-            $proto_opts = $match[2] ? $match[2] : false;
-            $dsn        = $match[3];
-        } else {
-            // $dsn => protocol+hostspec/database (old format)
-            if (strpos($dsn, '+') !== false) {
-                list($proto, $dsn) = explode('+', $dsn, 2);
-            }
-            if (strpos($dsn, '/') !== false) {
-                list($proto_opts, $dsn) = explode('/', $dsn, 2);
-            } else {
-                $proto_opts = $dsn;
-                $dsn        = null;
-            }
-        }
-
-        // process the different protocol options
-        $parsed['protocol'] = (!empty($proto)) ? $proto : 'tcp';
-        $proto_opts         = rawurldecode($proto_opts);
-        if ($parsed['protocol'] == 'tcp') {
-            if (strpos($proto_opts, ':') !== false) {
-                list($parsed['hostspec'], $parsed['port']) = explode(':', $proto_opts);
-            } else {
-                $parsed['hostspec'] = $proto_opts;
-            }
-        } elseif ($parsed['protocol'] == 'unix') {
-            $parsed['socket'] = $proto_opts;
-        }
-
-        // Get dabase if any
-        // $dsn => database
-        if ($dsn) {
-            if (($pos = strpos($dsn, '?')) === false) {
-                // /database
-                $parsed['database'] = rawurldecode($dsn);
-            } else {
-                // /database?param1=value1&param2=value2
-                $parsed['database'] = rawurldecode(substr($dsn, 0, $pos));
-                $dsn                = substr($dsn, $pos + 1);
-                if (strpos($dsn, '&') !== false) {
-                    $opts = explode('&', $dsn);
-                } else { // database?param1=value1
-                    $opts = array($dsn);
-                }
-                foreach ($opts as $opt) {
-                    list($key, $value) = explode('=', $opt);
-                    if (!isset($parsed[$key])) {
-                        // don't allow params overwrite
-                        $parsed[$key] = rawurldecode($value);
-                    }
-                }
-            }
-        }
-
-        return $parsed;
-    }
-
-    // }}}
-}
-
-?>
diff --git a/class/DB/Ethna_DB_Creole.php b/class/DB/Ethna_DB_Creole.php
deleted file mode 100644 (file)
index ac9b5d4..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_DB_Creole.php
- *
- *  @package    Ethna
- *  @author     halt feits <halt.feits@gmail.com>
- *  @version    $Id$
- */
-
-require_once 'creole/Creole.php';
-
-/**
- *  EthnaÍÑDBÃê¾Ý¥¯¥é¥¹
- *
- *  Ethna¤Î¥Õ¥ì¡¼¥à¥ï¡¼¥¯¤ÇDB¥ª¥Ö¥¸¥§¥¯¥È¤ò°·¤¦¤¿¤á¤ÎÃê¾Ý¥¯¥é¥¹
- *  (¤Î¤Ä¤â¤ê...¤¢¤¡¤¹¤Ð¤é¤·¤­PHP 4)
- *
- *  @package    Ethna
- *  @author     halt feits <halt.feits@gmail.com>
- *  @access     public
- */
-class Ethna_DB_Creole extends Ethna_DB
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    object  DB              DB¥ª¥Ö¥¸¥§¥¯¥È */
-    var $db;
-
-    /** @var    string   dsn */
-    var $dsn;
-
-    /**#@-*/
-
-
-    /**
-     *  ¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Controller    &$controller    ¥³¥ó¥È¥í¡¼¥é¥ª¥Ö¥¸¥§¥¯¥È
-     *  @param  string  $dsn                                DSN
-     *  @param  bool    $persistent                         »ý³ÀܳÀßÄê
-     */
-    function Ethna_DB_Creole(&$controller, $dsn, $persistent)
-    {
-        parent::Ethna_DB($controller, $dsn, $persistent);
-    }
-
-    /**
-     *  DB¤ËÀܳ¤¹¤ë
-     *
-     *  @access public
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function connect()
-    {
-        $this->db = Creole::getConnection($this->dsn);
-        return 0;
-    }
-
-    /**
-     *  DBÀܳ¤òÀÚÃǤ¹¤ë
-     *
-     *  @access public
-     */
-    function disconnect()
-    {
-        $this->db->close();
-        return 0;
-    }
-
-    /**
-     *  DBÀܳ¾õÂÖ¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @return bool    true:Àµ¾ï(ÀܳºÑ¤ß) false:¥¨¥é¡¼/̤Àܳ
-     */
-    function isValid()
-    {
-        if ( is_object($this->db) ) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    /**
-     *  DB¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤ò³«»Ï¤¹¤ë
-     *
-     *  @access public
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function begin()
-    {
-        return 0;
-    }
-
-    /**
-     *  DB¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤òÃæÃǤ¹¤ë
-     *
-     *  @access public
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function rollback()
-    {
-        $this->db->rollback();
-        return 0;
-    }
-
-    /**
-     *  DB¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤ò½ªÎ»¤¹¤ë
-     *
-     *  @access public
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function commit()
-    {
-        $this->db->commit();
-        return 0;
-    }
-
-    /**
-     *
-     * PrepareStatement
-     *
-     * @return  Object
-     * @access  public
-     */
-    function prepareStatement($sql)
-    {
-        return $this->db->prepareStatement($sql);
-    }
-}
-?>
diff --git a/class/DB/Ethna_DB_PEAR.php b/class/DB/Ethna_DB_PEAR.php
deleted file mode 100644 (file)
index 22cb26c..0000000
+++ /dev/null
@@ -1,540 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_DB_PEAR.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-require_once 'DB.php';
-
-// {{{ Ethna_DB_PEAR
-/**
- *  Ethna_DB¥¯¥é¥¹¤Î¼ÂÁõ(PEARÈÇ)
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_DB_PEAR extends Ethna_DB
-{
-    // {{{ properties
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    object  DB              PEAR DB¥ª¥Ö¥¸¥§¥¯¥È */
-    var $db;
-
-    /** @var    array   ¥È¥é¥ó¥¶¥¯¥·¥ç¥ó´ÉÍý¥¹¥¿¥Ã¥¯ */
-    var $transaction = array();
-
-
-    /** @var    object  Ethna_Logger    ¥í¥°¥ª¥Ö¥¸¥§¥¯¥È */
-    var $logger;
-
-    /** @var    object  Ethna_AppSQL    SQL¥ª¥Ö¥¸¥§¥¯¥È */
-    var $sql;
-
-    /** @var    string  DB¥¿¥¤¥×(mysql, pgsql...) */
-    var $type;
-
-    /** @var    string  DSN */
-    var $dsn;
-
-    /** @var    array   DSN (DB::parseDSN()¤ÎÊÖ¤êÃÍ) */
-    var $dsninfo;
-
-    /** @var    bool    »ý³Àܳ¥Õ¥é¥° */
-    var $persistent;
-
-    /**#@-*/
-    // }}}
-
-    // {{{ Ethna_DB¥¯¥é¥¹¤Î¼ÂÁõ
-    // {{{ Ethna_DB_PEAR
-    /**
-     *  Ethna_DB_PEAR¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Controller    &$controller    ¥³¥ó¥È¥í¡¼¥é¥ª¥Ö¥¸¥§¥¯¥È
-     *  @param  string  $dsn                                DSN
-     *  @param  bool    $persistent                         »ý³ÀܳÀßÄê
-     */
-    function Ethna_DB_PEAR(&$controller, $dsn, $persistent)
-    {
-        parent::Ethna_DB($controller, $dsn, $persistent);
-
-        $this->db = null;
-        $this->logger =& $controller->getLogger();
-        $this->sql =& $controller->getSQL();
-
-        $this->dsninfo = DB::parseDSN($dsn);
-        $this->dsninfo['new_link'] = true;
-        $this->type = $this->dsninfo['phptype'];
-    }
-    // }}}
-
-    // {{{ connect
-    /**
-     *  DB¤ËÀܳ¤¹¤ë
-     *
-     *  @access public
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function connect()
-    {
-        $this->db =& DB::connect($this->dsninfo, $this->persistent);
-        if (DB::isError($this->db)) {
-            $error = Ethna::raiseError('DBÀܳ¥¨¥é¡¼: %s',
-                E_DB_CONNECT,
-                $this->db->getUserInfo());
-            $error->addUserInfo($this->db);
-            $this->db = null;
-            return $error;
-        }
-
-        return 0;
-    }
-    // }}}
-
-    // {{{ disconnect
-    /**
-     *  DBÀܳ¤òÀÚÃǤ¹¤ë
-     *
-     *  @access public
-     */
-    function disconnect()
-    {
-        if ($this->isValid() == false) {
-            return;
-        }
-        $this->db->disconnect();
-    }
-    // }}}
-
-    // {{{ isValid
-    /**
-     *  DBÀܳ¾õÂÖ¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @return bool    true:Àµ¾ï false:¥¨¥é¡¼
-     */
-    function isValid()
-    {
-        if (is_null($this->db)
-            || is_resource($this->db->connection) == false) {
-            return false;
-        } else {
-            return true;
-        }
-    }
-    // }}}
-
-    // {{{ begin
-    /**
-     *  DB¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤ò³«»Ï¤¹¤ë
-     *
-     *  @access public
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function begin()
-    {
-        if (count($this->transaction) > 0) {
-            $this->transaction[] = true;
-            return 0;
-        }
-
-        $r = $this->query('BEGIN;');
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-        $this->transaction[] = true;
-
-        return 0;
-    }
-    // }}}
-
-    // {{{ rollback
-    /**
-     *  DB¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤òÃæÃǤ¹¤ë
-     *
-     *  @access public
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function rollback()
-    {
-        if (count($this->transaction) == 0) {
-            return 0;
-        }
-
-        // ¥í¡¼¥ë¥Ð¥Ã¥¯»þ¤Ï¥¹¥¿¥Ã¥¯¿ô¤Ë´Ø¤ï¤é¤º¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤ò¥¯¥ê¥¢¤¹¤ë
-        $r = $this->query('ROLLBACK;');
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-        $this->transaction = array();
-
-        return 0;
-    }
-    // }}}
-
-    // {{{ commit
-    /**
-     *  DB¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤ò½ªÎ»¤¹¤ë
-     *
-     *  @access public
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function commit()
-    {
-        if (count($this->transaction) == 0) {
-            return 0;
-        } else if (count($this->transaction) > 1) {
-            array_pop($this->transaction);
-            return 0;
-        }
-
-        $r = $this->query('COMMIT;');
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-        array_pop($this->transaction);
-
-        return 0;
-    }
-    // }}}
-
-    // {{{ getMetaData
-    /**
-     *  ¥Æ¡¼¥Ö¥ëÄêµÁ¾ðÊó¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $table  ¥Æ¡¼¥Ö¥ë̾
-     *  @return mixed   array: PEAR::DB¤Ë½à¤¸¤¿¥á¥¿¥Ç¡¼¥¿ Ethna_Error::¥¨¥é¡¼
-     */
-    function &getMetaData($table)
-    {
-        $def =& $this->db->tableInfo($table);
-        if (is_array($def) === false) {
-            return $def;
-        }
-
-        foreach (array_keys($def) as $k) {
-            $def[$k] = array_map('strtolower', $def[$k]);
-
-            // type
-            $type_map = array(
-                'int'       => array(
-                    'int', 'integer', '^int\(?[0-9]\+', '^serial', '[a-z]+int$',
-                ),
-                'boolean'   => array(
-                    'bit', 'bool', 'boolean',
-                ),
-                'datetime'  => array(
-                    'timestamp', 'datetime',
-                ),
-            );
-            foreach ($type_map as $convert_to => $regex) {
-                foreach ($regex as $r) {
-                    if (preg_match('/'.$r.'/', $def[$k]['type'])) {
-                        $def[$k]['type'] = $convert_to;
-                        break 2;
-                    }
-                }
-            }
-
-            // flags
-            $def[$k]['flags'] = explode(' ', $def[$k]['flags']);
-            switch ($this->type) {
-            case 'mysql':
-                // auto_increment ¤¬¤¢¤ì¤Ð sequence
-                if (in_array('auto_increment', $def[$k]['flags'])) {
-                    $def[$k]['flags'][] = 'sequence';
-                }
-                break;
-            case 'pgsql':
-                // nextval ¤¬¤¢¤ì¤Ð sequence
-                foreach ($def[$k]['flags'] as $f) {
-                    if (strpos($f, 'nextval') !== false) {
-                        $def[$k]['flags'][] = 'sequence';
-                        break;
-                    }
-                }
-                break;
-            case 'sqlite':
-                // integer, primary key ¤Ê¤é¤Ð auto_increment ¤òÄɲÃ
-                if ($def[$k]['type'] == 'int'
-                    && in_array('primary_key', $def[$k]['flags'])) {
-                    $def[$k]['flags'][] = 'sequence';
-                }
-                break;
-            }
-        }
-
-        return $def;
-    }
-    // }}}
-    // }}}
-
-    // {{{ Ethna_AppObjectÏ¢·È¤Î¤¿¤á¤Î¼ÂÁõ
-    // {{{ getType
-    /**
-     *  DB¥¿¥¤¥×¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @return string  DB¥¿¥¤¥×
-     */
-    function getType()
-    {
-        return $this->type;
-    }
-    // }}}
-
-    // {{{ query
-    /**
-     *  ¥¯¥¨¥ê¤òȯ¹Ô¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $query  SQLʸ
-     *  @return mixed   DB_Result:·ë²Ì¥ª¥Ö¥¸¥§¥¯¥È Ethna_Error:¥¨¥é¡¼
-     */
-    function &query($query)
-    {
-        return $this->_query($query);
-    }
-    // }}}
-
-    // {{{ getNextId
-    /**
-     *  Ä¾¸å¤ÎINSERT¤Ë»È¤¦ID¤ò¼èÆÀ¤¹¤ë
-     *  (pgsql¤Î¤ßÂбþ)
-     *
-     *  @access public
-     *  @return mixed   int
-     */
-    function getNextId($table_name, $field_name)
-    {
-        if ($this->isValid() == false) {
-            return null;
-        } else if ($this->type == 'pgsql') {
-            $seq_name = sprintf('%s_%s', $table_name, $field_name);
-            $ret = $this->db->nextId($seq_name);
-            return $ret;
-        }
-
-        return null;
-    }
-    // }}}
-
-    // {{{ getInsertId
-    /**
-     *  Ä¾Á°¤ÎINSERT¤Ë¤è¤ëID¤ò¼èÆÀ¤¹¤ë
-     *  (mysql, sqlite¤Î¤ßÂбþ)
-     *
-     *  @access public
-     *  @return mixed   int:ľ¶á¤ÎINSERT¤Ë¤è¤êÀ¸À®¤µ¤ì¤¿ID null:̤¥µ¥Ý¡¼¥È
-     */
-    function getInsertId()
-    {
-        if ($this->isValid() == false) {
-            return null;
-        } else if ($this->type == 'mysql') {
-            return mysql_insert_id($this->db->connection);
-        } else if ($this->type == 'sqlite') {
-            return sqlite_last_insert_rowid($this->db->connection);
-        }
-
-        return null;
-    }
-    // }}}
-
-    // {{{ fetchRow
-    /**
-     *  DB_Result::fetchRow()¤Î·ë²Ì¤òÀ°·Á¤·¤ÆÊÖ¤¹
-     *
-     *  @access public
-     *  @return int     ¹¹¿·¹Ô¿ô
-     */
-    function &fetchRow(&$res, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum = null)
-    {
-        $row =& $res->fetchRow($fetchmode, $rownum);
-        if (is_array($row) === false) {
-            return $row;
-        }
-
-        if ($this->type === 'sqlite') {
-            // "table"."column" -> column
-            foreach ($row as $k => $v) {
-                unset($row[$k]);
-                if (($f = strstr($k, '.')) !== false) {
-                    $k = substr($f, 1);
-                }
-                if ($k{0} === '"' && $k{strlen($k)-1} === '"') {
-                    $k = substr($k, 1, -1);
-                }
-                $row[$k] = $v;
-            }
-        }
-
-        return $row;
-    }
-    // }}}
-
-    // {{{ affectedRows
-    /**
-     *  Ä¾¶á¤Î¥¯¥¨¥ê¤Ë¤è¤ë¹¹¿·¹Ô¿ô¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return int     ¹¹¿·¹Ô¿ô
-     */
-    function affectedRows()
-    {
-        return $this->db->affectedRows();
-    }
-    // }}}
-
-    // {{{ quoteIdentifier
-    /**
-     *  db¤Îtype¤Ë±þ¤¸¤Æ¼±Ê̻Ҥòquote¤¹¤ë
-     *  (ÇÛÎó¤Î¾ì¹ç¤Ï³ÆÍ×ÁǤòquote)
-     *
-     *  @access protected
-     *  @param  mixed   $identifier array or string
-     */
-    function quoteIdentifier($identifier)
-    {
-        if (is_array($identifier)) {
-            foreach (array_keys($identifier) as $key) {
-                $identifier[$key] = $this->quoteIdentifier($identifier[$key]);
-            }
-            return $identifier;
-        }
-            
-        switch ($this->type) {
-        case 'mysql':
-            $ret = '`' . $identifier . '`';
-            break;
-        case 'pgsql':
-        case 'sqlite':
-        default:
-            $ret = '"' . $identifier . '"';
-            break;
-        }
-        return $ret;
-    }
-    // }}}
-    // }}}
-
-    // {{{ Ethna_DB_PEARÆȼ«¤Î¼ÂÁõ
-    // {{{ sqlquery
-    /**
-     *  SQLʸ»ØÄꥯ¥¨¥ê¤òȯ¹Ô¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $sqlid      SQL-ID(+°ú¿ô)
-     *  @return mixed   DB_Result:·ë²Ì¥ª¥Ö¥¸¥§¥¯¥È Ethna_Error:¥¨¥é¡¼
-     */
-    function &sqlquery($sqlid)
-    {
-        $args = func_get_args();
-        array_shift($args);
-        $query = $this->sql->get($sqlid, $args);
-
-        return $this->_query($query);
-    }
-    // }}}
-
-    // {{{ sql
-    /**
-     *  SQLʸ¤ò¼èÆÀ¤¹¤ë
-     *  
-     *  @access public
-     *  @param  string  $sqlid      SQL-ID
-     *  @return string  SQLʸ
-     */
-    function sql($sqlid)
-    {
-        $args = func_get_args();
-        array_shift($args);
-        $query = $this->sql->get($sqlid, $args);
-
-        return $query;
-    }
-    // }}}
-
-    // {{{ lock
-    /**
-     *  ¥Æ¡¼¥Ö¥ë¤ò¥í¥Ã¥¯¤¹¤ë
-     *
-     *  @access public
-     *  @param  mixed   ¥í¥Ã¥¯Âоݥơ¼¥Ö¥ë̾
-     *  @return mixed   DB_Result:·ë²Ì¥ª¥Ö¥¸¥§¥¯¥È Ethna_Error:¥¨¥é¡¼
-     */
-    function lock($tables)
-    {
-        $this->message = null;
-
-        $sql = "";
-        foreach (to_array($tables) as $table) {
-            if ($sql != "") {
-                $sql .= ", ";
-            }
-            $sql .= "$table WRITE";
-        }
-
-        return $this->query("LOCK TABLES $sql");
-    }
-    // }}}
-
-    // {{{ unlock
-    /**
-     *  ¥Æ¡¼¥Ö¥ë¤Î¥í¥Ã¥¯¤ò²òÊü¤¹¤ë
-     *
-     *  @access public
-     *  @return mixed   DB_Result:·ë²Ì¥ª¥Ö¥¸¥§¥¯¥È Ethna_Error:¥¨¥é¡¼
-     */
-    function unlock()
-    {
-        $this->message = null;
-        return $this->query("UNLOCK TABLES");
-    }
-    // }}}
-
-    // {{{ _query
-    /**
-     *  ¥¯¥¨¥ê¤òȯ¹Ô¤¹¤ë
-     *
-     *  @access private
-     *  @param  string  $query  SQLʸ
-     *  @return mixed   DB_Result:·ë²Ì¥ª¥Ö¥¸¥§¥¯¥È Ethna_Error:¥¨¥é¡¼
-     */
-    function &_query($query)
-    {
-        $this->logger->log(LOG_DEBUG, "$query");
-        $r =& $this->db->query($query);
-        if (DB::isError($r)) {
-            if ($r->getCode() == DB_ERROR_ALREADY_EXISTS) {
-                $error = Ethna::raiseNotice('¥æ¥Ë¡¼¥¯À©Ì󥨥顼 SQL[%s]',
-                    E_DB_DUPENT,
-                    $query,
-                    $this->db->errorNative(),
-                    $r->getUserInfo());
-            } else {
-                $error = Ethna::raiseError('¥¯¥¨¥ê¥¨¥é¡¼ SQL[%s] CODE[%d] MESSAGE[%s]',
-                    E_DB_QUERY,
-                    $query,
-                    $this->db->errorNative(),
-                    $r->getUserInfo());
-            }
-            return $error;
-        }
-        return $r;
-    }
-    // }}}
-    // }}}
-}
-// }}}
-?>
diff --git a/class/Ethna_ActionClass.php b/class/Ethna_ActionClass.php
deleted file mode 100644 (file)
index 20d09e5..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_ActionClass.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_ActionClass
-/**
- *  action¼Â¹Ô¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_ActionClass
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    object  Ethna_Backend       backend¥ª¥Ö¥¸¥§¥¯¥È */
-    var $backend;
-
-    /** @var    object  Ethna_Config        ÀßÄꥪ¥Ö¥¸¥§¥¯¥È    */
-    var $config;
-
-    /** @var    object  Ethna_I18N          i18n¥ª¥Ö¥¸¥§¥¯¥È */
-    var $i18n;
-
-    /** @var    object  Ethna_ActionError   ¥¢¥¯¥·¥ç¥ó¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È */
-    var $action_error;
-
-    /** @var    object  Ethna_ActionError   ¥¢¥¯¥·¥ç¥ó¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È(¾Êά·Á) */
-    var $ae;
-
-    /** @var    object  Ethna_ActionForm    ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È */
-    var $action_form;
-
-    /** @var    object  Ethna_ActionForm    ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È(¾Êά·Á) */
-    var $af;
-
-    /** @var    object  Ethna_Session       ¥»¥Ã¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È */
-    var $session;
-
-    /** @var    object  Ethna_Plugin        ¥×¥é¥°¥¤¥ó¥ª¥Ö¥¸¥§¥¯¥È */
-    var $plugin;
-
-    /**#@-*/
-
-    /**
-     *  Ethna_ActionClass¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Backend   $backend    backend¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function Ethna_ActionClass(&$backend)
-    {
-        $c =& $backend->getController();
-        $this->backend =& $backend;
-        $this->config =& $this->backend->getConfig();
-        $this->i18n =& $this->backend->getI18N();
-
-        $this->action_error =& $this->backend->getActionError();
-        $this->ae =& $this->action_error;
-
-        $this->action_form =& $this->backend->getActionForm();
-        $this->af =& $this->action_form;
-
-        $this->session =& $this->backend->getSession();
-        $this->plugin =& $this->backend->getPlugin();
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¼Â¹ÔÁ°¤Îǧ¾Ú½èÍý¤ò¹Ô¤¦
-     *
-     *  @access public
-     *  @return string  Á«°Ü̾(null¤Ê¤éÀµ¾ï½ªÎ», false¤Ê¤é½èÍý½ªÎ»)
-     */
-    function authenticate()
-    {
-        return null;
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¼Â¹ÔÁ°¤Î½èÍý(¥Õ¥©¡¼¥àÃÍ¥Á¥§¥Ã¥¯Åù)¤ò¹Ô¤¦
-     *
-     *  @access public
-     *  @return string  Á«°Ü̾(null¤Ê¤éÀµ¾ï½ªÎ», false¤Ê¤é½èÍý½ªÎ»)
-     */
-    function prepare()
-    {
-        return null;
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¼Â¹Ô
-     *
-     *  @access public
-     *  @return string  Á«°Ü̾(null¤Ê¤éÁ«°Ü¤Ï¹Ô¤ï¤Ê¤¤)
-     */
-    function perform()
-    {
-        return null;
-    }
-}
-// }}}
-?>
diff --git a/class/Ethna_ActionError.php b/class/Ethna_ActionError.php
deleted file mode 100644 (file)
index c60aabb..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_ActionError.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_ActionError
-/**
- *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥¨¥é¡¼´ÉÍý¥¯¥é¥¹
- *
- *  @access     public
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @package    Ethna
- *  @todo   ÇÛÎó¥Õ¥©¡¼¥à¤ò°·¤¨¤ë¤è¤¦¤Ë¤¹¤ë
- */
-class Ethna_ActionError
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    array   ¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È¤Î°ìÍ÷ */
-    var $error_list = array();
-
-    /** @var    object  Ethna_ActionForm    ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È */
-    var $action_form = null;
-
-    /** @var    object  Ethna_Logger        ¥í¥°¥ª¥Ö¥¸¥§¥¯¥È */
-    var $logger = null;
-    /**#@-*/
-
-    /**
-     *  Ethna_ActionError¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     */
-    function Ethna_ActionError()
-    {
-    }
-
-    /**
-     *  ¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È¤òÀ¸À®/Äɲ乤ë
-     *
-     *  @access public
-     *  @param  string  $name       ¥¨¥é¡¼¤ÎȯÀ¸¤·¤¿¥Õ¥©¡¼¥à¹àÌÜ̾(ÉÔÍפʤénull)
-     *  @param  string  $message    ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸
-     *  @param  int     $code       ¥¨¥é¡¼¥³¡¼¥É
-     *  @return Ethna_Error ¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &add($name, $message, $code = null)
-    {
-        if (func_num_args() > 3) {
-            $userinfo = array_slice(func_get_args(), 3);
-            $error =& Ethna::raiseNotice($message, $code, $userinfo);
-        } else {
-            $error =& Ethna::raiseNotice($message, $code);
-        }
-        $this->addObject($name, $error);
-        return $error;
-    }
-
-    /**
-     *  Ethna_Error¥ª¥Ö¥¸¥§¥¯¥È¤òÄɲ乤ë
-     *
-     *  @access public
-     *  @param  string              $name   ¥¨¥é¡¼¤ËÂбþ¤¹¤ë¥Õ¥©¡¼¥à¹àÌÜ̾(ÉÔÍפʤénull)
-     *  @param  object  Ethna_Error $error  ¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function addObject($name, &$error)
-    {
-        $elt = array();
-        $elt['name'] = $name;
-        $elt['object'] =& $error;
-        $this->error_list[] = $elt;
-
-        // ¥í¥°½ÐÎÏ(Êä­)
-        $af =& $this->_getActionForm();
-        $logger =& $this->_getLogger();
-        $logger->log(LOG_NOTICE, '{form} -> [%s]', $this->action_form->getName($name));
-    }
-
-    /**
-     *  ¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È¤Î¿ô¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @return int     ¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È¤Î¿ô
-     */
-    function count()
-    {
-        return count($this->error_list);
-    }
-
-    /**
-     *  ¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È¤Î¿ô¤òÊÖ¤¹(count()¥á¥½¥Ã¥É¤Î¥¨¥¤¥ê¥¢¥¹)
-     *
-     *  @access public
-     *  @return int     ¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È¤Î¿ô
-     */
-    function length()
-    {
-        return count($this->error_list);
-    }
-
-    /**
-     *  ÅÐÏ¿¤µ¤ì¤¿¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È¤òºï½ü¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $name   ¥Õ¥©¡¼¥à¹àÌÜ̾
-     */
-    function remove($name)
-    {
-        foreach ($this->error_list as $idx => $obj) {
-            $obj_name = $obj['name'];
-            if (strncasecmp($name, $obj_name, 255) == 0) { 
-                unset($this->error_list[$idx]);
-            }
-        }
-    }
-
-    /**
-     *  ÅÐÏ¿¤µ¤ì¤¿¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È¤òÁ´¤Æºï½ü¤¹¤ë
-     *
-     *  @access public
-     */
-    function clear()
-    {
-        $this->error_list = array();
-    }
-
-    /**
-     *  »ØÄꤵ¤ì¤¿¥Õ¥©¡¼¥à¹àÌܤ˥¨¥é¡¼¤¬È¯À¸¤·¤Æ¤¤¤ë¤«¤É¤¦¤«¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @param  string  $name   ¥Õ¥©¡¼¥à¹àÌÜ̾
-     *  @return bool    true:¥¨¥é¡¼¤¬È¯À¸¤·¤Æ¤¤¤ë false:¥¨¥é¡¼¤¬È¯À¸¤·¤Æ¤¤¤Ê¤¤
-     */
-    function isError($name)
-    {
-        foreach ($this->error_list as $error) {
-            if (strcasecmp($error['name'], $name) == 0) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     *  »ØÄꤵ¤ì¤¿¥Õ¥©¡¼¥à¹àÌܤËÂбþ¤¹¤ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @param  string  $name   ¥Õ¥©¡¼¥à¹àÌÜ̾
-     *  @return string  ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸(¥¨¥é¡¼¤¬Ìµ¤¤¾ì¹ç¤Ïnull)
-     */
-    function getMessage($name)
-    {
-        foreach ($this->error_list as $error) {
-            if (strcasecmp($error['name'], $name) == 0) {
-                return $this->_getMessage($error);
-            }
-        }
-        return null;
-    }
-
-    /**
-     *  ¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È¤òÇÛÎó¤Ë¤·¤ÆÊÖ¤¹
-     *
-     *  @access public
-     *  @return array   ¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È¤ÎÇÛÎó
-     */
-    function getErrorList()
-    {
-        return $this->error_list;
-    }
-
-    /**
-     *  ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òÇÛÎó¤Ë¤·¤ÆÊÖ¤¹
-     *
-     *  @access public
-     *  @return array   ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ÎÇÛÎó
-     */
-    function getMessageList()
-    {
-        $message_list = array();
-
-        foreach ($this->error_list as $error) {
-            $message_list[] = $this->_getMessage($error);
-        }
-        return $message_list;
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @param  array   ¥¨¥é¡¼¥¨¥ó¥È¥ê
-     *  @return string  ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸
-     */
-    function _getMessage(&$error)
-    {
-        $af =& $this->_getActionForm();
-        $form_name = $af->getName($error['name']);
-        return str_replace("{form}", $form_name, $error['object']->getMessage());
-    }
-
-    /**
-     *  Ethna_ActionForm¥ª¥Ö¥¸¥§¥¯¥È¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @return object  Ethna_ActionForm
-     */
-    function &_getActionForm()
-    {
-        if (is_null($this->action_form)) {
-            $controller =& Ethna_Controller::getInstance();
-            $this->action_form =& $controller->getActionForm();
-        }
-        return $this->action_form;
-    }
-
-    /**
-     *  Ethna_Logger¥ª¥Ö¥¸¥§¥¯¥È¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @return object  Ethna_Logger
-     */
-    function &_getLogger()
-    {
-        if (is_null($this->logger)) {
-            $controller =& Ethna_Controller::getInstance();
-            $this->logger =& $controller->getLogger();
-        }
-        return $this->logger;
-    }
-}
-// }}}
-?>
diff --git a/class/Ethna_ActionForm.php b/class/Ethna_ActionForm.php
deleted file mode 100644 (file)
index 847b152..0000000
+++ /dev/null
@@ -1,1476 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_ActionForm.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-/** Äê·¿¥Õ¥£¥ë¥¿: È¾³ÑÆþÎÏ */
-define('FILTER_HW', 'numeric_zentohan,alphabet_zentohan,ltrim,rtrim,ntrim');
-
-/** Äê·¿¥Õ¥£¥ë¥¿: Á´³ÑÆþÎÏ */
-define('FILTER_FW', 'kana_hantozen,ntrim');
-
-
-// {{{ Ethna_ActionForm
-/**
- *  ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_ActionForm
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    array   ¥Õ¥©¡¼¥àÃÍÄêµÁ(¥Ç¥Õ¥©¥ë¥È) */
-    var $form_template = array();
-
-    /** @var    array   ¥Õ¥©¡¼¥àÃÍÄêµÁ */
-    var $form = array();
-
-    /** @var    array   ¥Õ¥©¡¼¥àÃÍ */
-    var $form_vars = array();
-
-    /** @var    array   ¥¢¥×¥ê¥±¡¼¥·¥ç¥óÀßÄêÃÍ */
-    var $app_vars = array();
-
-    /** @var    array   ¥¢¥×¥ê¥±¡¼¥·¥ç¥óÀßÄêÃÍ(¼«Æ°¥¨¥¹¥±¡¼¥×¤Ê¤·) */
-    var $app_ne_vars = array();
-
-    /** @var    object  Ethna_Backend       ¥Ð¥Ã¥¯¥¨¥ó¥É¥ª¥Ö¥¸¥§¥¯¥È */
-    var $backend;
-
-    /** @var    object  Ethna_ActionError   ¥¢¥¯¥·¥ç¥ó¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È */
-    var $action_error;
-
-    /** @var    object  Ethna_ActionError   ¥¢¥¯¥·¥ç¥ó¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È(¾Êά·Á) */
-    var $ae;
-
-    /** @var    object  Ethna_I18N  i18n¥ª¥Ö¥¸¥§¥¯¥È */
-    var $i18n;
-
-    /** @var    object  Ethna_Logger    ¥í¥°¥ª¥Ö¥¸¥§¥¯¥È */
-    var $logger;
-
-    /** @var    object  Ethna_Plugin    ¥×¥é¥°¥¤¥ó¥ª¥Ö¥¸¥§¥¯¥È */
-    var $plugin;
-
-    /** @var    array   ¥Õ¥©¡¼¥àÄêµÁÍ×ÁÇ */
-    var $def = array('name', 'required', 'max', 'min', 'regexp', 'custom',
-                     'filter', 'form_type', 'type');
-
-    /** @var    array   ¥Õ¥©¡¼¥àÄêµÁ¤Î¤¦¤ÁÈó¥×¥é¥°¥¤¥óÍ×ÁǤȤߤʤ¹prefix */
-    var $def_noplugin = array('type', 'form', 'name', 'plugin', 'filter',
-                              'option', 'default');
-
-    /** @var    bool    ¥Ð¥ê¥Ç¡¼¥¿¤Ë¥×¥é¥°¥¤¥ó¤ò»È¤¦¥Õ¥é¥° */
-    var $use_validator_plugin = false;
-
-    /** @var    bool    Äɲø¡¾Ú¶¯À©¥Õ¥é¥° */
-    var $force_validate_plus = false;
-
-    /** @var    array   ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È(helper) */
-    var $helper_app_object = array();
-
-    /** @var    array   ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È(helper)¤ÇÍøÍѤ·¤Ê¤¤¥Õ¥©¡¼¥à̾ */
-    var $helper_skip_form = array();
-
-    /**#@-*/
-
-    /**
-     *  Ethna_ActionForm¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Controller    &$controller    controller¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function Ethna_ActionForm(&$controller)
-    {
-        $this->backend =& $controller->getBackend();
-        $this->action_error =& $controller->getActionError();
-        $this->ae =& $this->action_error;
-        $this->i18n =& $controller->getI18N();
-        $this->logger =& $controller->getLogger();
-        $this->plugin =& $controller->getPlugin();
-
-        if (isset($_SERVER['REQUEST_METHOD']) == false) {
-            return;
-        }
-
-        // ¥Õ¥©¡¼¥àÃͥƥó¥×¥ì¡¼¥È¤Î¹¹¿·
-        $this->form_template = $this->_setFormTemplate($this->form_template);
-
-        // ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È(helper)¤ÎÀ¸À®
-        foreach ($this->helper_app_object as $key => $value) {
-            if (is_object($value)) {
-                continue;
-            }
-            $this->helper_app_object[$key] =& $this->_getHelperAppObject($key);
-        }
-
-        // ¥Õ¥©¡¼¥àÃÍÄêµÁ¤ÎÀßÄê
-        $this->_setFormDef_Helper();
-        $this->_setFormDef();
-
-        // ¾ÊάÃÍÊäÀµ
-        foreach ($this->form as $name => $value) {
-            foreach ($this->def as $k) {
-                if (isset($value[$k]) == false) {
-                    $this->form[$name][$k] = null;
-                }
-            }
-        }
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃͤΥ¢¥¯¥»¥µ(R)
-     *
-     *  @access public
-     *  @param  string  $name   ¥Õ¥©¡¼¥àÃͤÎ̾¾Î
-     *  @return mixed   ¥Õ¥©¡¼¥àÃÍ
-     */
-    function get($name)
-    {
-        if (isset($this->form_vars[$name])) {
-            return $this->form_vars[$name];
-        }
-        return null;
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃÍÄêµÁ¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $name   ¼èÆÀ¤¹¤ë¥Õ¥©¡¼¥à̾(null¤Ê¤éÁ´¤Æ¤ÎÄêµÁ¤ò¼èÆÀ)
-     *  @return array   ¥Õ¥©¡¼¥àÃÍÄêµÁ
-     */
-    function getDef($name = null)
-    {
-        if (is_null($name)) {
-            return $this->form;
-        }
-
-        if (array_key_exists($name, $this->form) == false) {
-            return null;
-        } else {
-            return $this->form[$name];
-        }
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥à¹àÌÜɽ¼¨Ì¾¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $name   ¥Õ¥©¡¼¥àÃͤÎ̾¾Î
-     *  @return mixed   ¥Õ¥©¡¼¥àÃͤÎɽ¼¨Ì¾
-     */
-    function getName($name)
-    {
-        if (isset($this->form[$name]) == false) {
-            return null;
-        }
-        if (isset($this->form[$name]['name'])
-            && $this->form[$name]['name'] != null) {
-            return $this->form[$name]['name'];
-        }
-
-        // try message catalog
-        return $this->i18n->get($name);
-    }
-
-    /**
-     *  ¥æ¡¼¥¶¤«¤éÁ÷¿®¤µ¤ì¤¿¥Õ¥©¡¼¥àÃͤò¥Õ¥©¡¼¥àÃÍÄêµÁ¤Ë½¾¤Ã¤Æ¥¤¥ó¥Ý¡¼¥È¤¹¤ë
-     *
-     *  @access public
-     *  @todo   Â¿¼¡¸µ¤ÎÇÛÎó¤Ø¤ÎÂбþ
-     */
-    function setFormVars()
-    {
-        if (isset($_SERVER['REQUEST_METHOD']) == false) {
-            return;
-        } else if (strcasecmp($_SERVER['REQUEST_METHOD'], 'post') == 0) {
-            $http_vars =& $_POST;
-        } else {
-            $http_vars =& $_GET;
-        }
-
-        foreach ($this->form as $name => $def) {
-            $type = is_array($def['type']) ? $def['type'][0] : $def['type'];
-            if ($type == VAR_TYPE_FILE) {
-                // ¥Õ¥¡¥¤¥ë¤Î¾ì¹ç
-
-                // ÃͤÎ̵ͭ¤Î¸¡ºº
-                if (isset($_FILES[$name]) == false || is_null($_FILES[$name])) {
-                    $this->form_vars[$name] = null;
-                    continue;
-                }
-
-                // ÇÛÎó¹½Â¤¤Î¸¡ºº
-                if (is_array($def['type'])) {
-                    if (is_array($_FILES[$name]['tmp_name']) == false) {
-                        $this->handleError($name, E_FORM_WRONGTYPE_ARRAY);
-                        $this->form_vars[$name] = null;
-                        continue;
-                    }
-                } else {
-                    if (is_array($_FILES[$name]['tmp_name'])) {
-                        $this->handleError($name, E_FORM_WRONGTYPE_SCALAR);
-                        $this->form_vars[$name] = null;
-                        continue;
-                    }
-                }
-
-                $files = null;
-                if (is_array($def['type'])) {
-                    $files = array();
-                    // ¥Õ¥¡¥¤¥ë¥Ç¡¼¥¿¤òºÆ¹½À®
-                    foreach (array_keys($_FILES[$name]['name']) as $key) {
-                        $files[$key] = array();
-                        $files[$key]['name'] = $_FILES[$name]['name'][$key];
-                        $files[$key]['type'] = $_FILES[$name]['type'][$key];
-                        $files[$key]['size'] = $_FILES[$name]['size'][$key];
-                        $files[$key]['tmp_name'] = $_FILES[$name]['tmp_name'][$key];
-                        if (isset($_FILES[$name]['error']) == false) {
-                            // PHP 4.2.0 °ÊÁ°
-                            $files[$key]['error'] = 0;
-                        } else {
-                            $files[$key]['error'] = $_FILES[$name]['error'][$key];
-                        }
-                    }
-                } else {
-                    $files = $_FILES[$name];
-                    if (isset($files['error']) == false) {
-                        $files['error'] = 0;
-                    }
-                }
-
-                // ÃͤΥ¤¥ó¥Ý¡¼¥È
-                $this->form_vars[$name] = $files;
-
-            } else {
-                // ¥Õ¥¡¥¤¥ë°Ê³°¤Î¾ì¹ç
-
-                // ÃͤÎ̵ͭ¤Î¸¡ºº
-                if (isset($http_vars[$name]) == false
-                    || is_null($http_vars[$name])) {
-                    $this->form_vars[$name] = null;
-                    if (isset($http_vars["{$name}_x"])
-                        && isset($http_vars["{$name}_y"])) {
-                        // °ÊÁ°¤Î»ÅÍͤ˹ç¤ï¤»¤ë
-                        $this->form_vars[$name] = $http_vars["{$name}_x"];
-                    }
-                    continue;
-                }
-
-                // ÇÛÎó¹½Â¤¤Î¸¡ºº
-                if (is_array($def['type'])) {
-                    if (is_array($http_vars[$name]) == false) {
-                        // ¸·Ì©¤Ë¤Ï¡¢¤³¤ÎÇÛÎó¤Î³ÆÍ×ÁǤϥ¹¥«¥é¡¼¤Ç¤¢¤ë¤Ù¤­
-                        $this->handleError($name, E_FORM_WRONGTYPE_ARRAY);
-                        $this->form_vars[$name] = null;
-                        continue;
-                    }
-                } else {
-                    if (is_array($http_vars[$name])) {
-                        $this->handleError($name, E_FORM_WRONGTYPE_SCALAR);
-                        $this->form_vars[$name] = null;
-                        continue;
-                    }
-                }
-
-                // ÃͤΥ¤¥ó¥Ý¡¼¥È
-                $this->form_vars[$name] = $http_vars[$name];
-            }
-        }
-    }
-
-    /**
-     *  ¥æ¡¼¥¶¤«¤éÁ÷¿®¤µ¤ì¤¿¥Õ¥©¡¼¥àÃͤò¥¯¥ê¥¢¤¹¤ë
-     *
-     *  @access public
-     */
-    function clearFormVars()
-    {
-        $this->form_vars = array();
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃͤؤΥ¢¥¯¥»¥µ(W)
-     *
-     *  @access public
-     *  @param  string  $name   ¥Õ¥©¡¼¥àÃͤÎ̾¾Î
-     *  @param  string  $value  ÀßÄꤹ¤ëÃÍ
-     */
-    function set($name, $value)
-    {
-        $this->form_vars[$name] = $value;
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃÍÄêµÁ¤òÀßÄꤹ¤ë
-     *
-     *  @access public
-     *  @param  string  $name   ÀßÄꤹ¤ë¥Õ¥©¡¼¥à̾(null¤Ê¤éÁ´¤Æ¤ÎÄêµÁ¤òÀßÄê)
-     *  @param  array   $value  ÀßÄꤹ¤ë¥Õ¥©¡¼¥àÃÍÄêµÁ
-     *  @return array   ¥Õ¥©¡¼¥àÃÍÄêµÁ
-     */
-    function setDef($name, $value)
-    {
-        if (is_null($name)) {
-            $this->form = $value;
-        }
-
-        $this->form[$name] = $value;
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃͤòÇÛÎó¤Ë¤·¤ÆÊÖ¤¹
-     *
-     *  @access public
-     *  @param  bool    $escape HTML¥¨¥¹¥±¡¼¥×¥Õ¥é¥°(true:¥¨¥¹¥±¡¼¥×¤¹¤ë)
-     *  @return array   ¥Õ¥©¡¼¥àÃͤò³ÊǼ¤·¤¿ÇÛÎó
-     */
-    function &getArray($escape = true)
-    {
-        $retval = array();
-
-        $this->_getArray($this->form_vars, $retval, $escape);
-
-        return $retval;
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥óÀßÄêÃͤΥ¢¥¯¥»¥µ(R)
-     *
-     *  @access public
-     *  @param  string  $name   ¥­¡¼
-     *  @return mixed   ¥¢¥×¥ê¥±¡¼¥·¥ç¥óÀßÄêÃÍ
-     */
-    function getApp($name)
-    {
-        if (isset($this->app_vars[$name]) == false) {
-            return null;
-        }
-        return $this->app_vars[$name];
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥óÀßÄêÃͤΥ¢¥¯¥»¥µ(W)
-     *
-     *  @access public
-     *  @param  string  $name   ¥­¡¼
-     *  @param  mixed   $value  ÃÍ
-     */
-    function setApp($name, $value)
-    {
-        $this->app_vars[$name] = $value;
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥óÀßÄêÃͤòÇÛÎó¤Ë¤·¤ÆÊÖ¤¹
-     *
-     *  @access public
-     *  @param  boolean $escape HTML¥¨¥¹¥±¡¼¥×¥Õ¥é¥°(true:¥¨¥¹¥±¡¼¥×¤¹¤ë)
-     *  @return array   ¥Õ¥©¡¼¥àÃͤò³ÊǼ¤·¤¿ÇÛÎó
-     */
-    function &getAppArray($escape = true)
-    {
-        $retval = array();
-
-        $this->_getArray($this->app_vars, $retval, $escape);
-
-        return $retval;
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥óÀßÄêÃÍ(¼«Æ°¥¨¥¹¥±¡¼¥×¤Ê¤·)¤Î¥¢¥¯¥»¥µ(R)
-     *
-     *  @access public
-     *  @param  string  $name   ¥­¡¼
-     *  @return mixed   ¥¢¥×¥ê¥±¡¼¥·¥ç¥óÀßÄêÃÍ
-     */
-    function getAppNE($name)
-    {
-        if (isset($this->app_ne_vars[$name]) == false) {
-            return null;
-        }
-        return $this->app_ne_vars[$name];
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥óÀßÄêÃÍ(¼«Æ°¥¨¥¹¥±¡¼¥×¤Ê¤·)¤Î¥¢¥¯¥»¥µ(W)
-     *
-     *  @access public
-     *  @param  string  $name   ¥­¡¼
-     *  @param  mixed   $value  ÃÍ
-     */
-    function setAppNE($name, $value)
-    {
-        $this->app_ne_vars[$name] = $value;
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥óÀßÄêÃÍ(¼«Æ°¥¨¥¹¥±¡¼¥×¤Ê¤·)¤òÇÛÎó¤Ë¤·¤ÆÊÖ¤¹
-     *
-     *  @access public
-     *  @param  boolean $escape HTML¥¨¥¹¥±¡¼¥×¥Õ¥é¥°(true:¥¨¥¹¥±¡¼¥×¤¹¤ë)
-     *  @return array   ¥Õ¥©¡¼¥àÃͤò³ÊǼ¤·¤¿ÇÛÎó
-     */
-    function &getAppNEArray($escape = false)
-    {
-        $retval = array();
-
-        $this->_getArray($this->app_ne_vars, $retval, $escape);
-
-        return $retval;
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥à¤òÇÛÎó¤Ë¤·¤ÆÊÖ¤¹(ÆâÉô½èÍý)
-     *
-     *  @access private
-     *  @param  array   &$vars      ¥Õ¥©¡¼¥à(Åù)¤ÎÇÛÎó
-     *  @param  array   &$retval    ÇÛÎó¤Ø¤ÎÊÑ´¹·ë²Ì
-     *  @param  bool    $escape     HTML¥¨¥¹¥±¡¼¥×¥Õ¥é¥°(true:¥¨¥¹¥±¡¼¥×¤¹¤ë)
-     */
-    function _getArray(&$vars, &$retval, $escape)
-    {
-        foreach (array_keys($vars) as $name) {
-            if (is_array($vars[$name])) {
-                $retval[$name] = array();
-                $this->_getArray($vars[$name], $retval[$name], $escape);
-            } else {
-                $retval[$name] = $escape
-                    ? htmlspecialchars($vars[$name], ENT_QUOTES) : $vars[$name];
-            }
-        }
-    }
-
-    /**
-     *  Äɲø¡¾Ú¶¯À©¥Õ¥é¥°¤ò¼èÆÀ¤¹¤ë
-     *  (Ä̾︡¾Ú¤Ç¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ç¤â_validatePlus()¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë)
-     *  @access public
-     *  @return bool    true:Äɲø¡¾Ú¶¯À© false:Äɲø¡¾ÚÈó¶¯À©
-     */
-    function isForceValidatePlus()
-    {
-        return $this->force_validate_plus;
-    }
-
-    /**
-     *  Äɲø¡¾Ú¶¯À©¥Õ¥é¥°¤òÀßÄꤹ¤ë
-     *
-     *  @access public
-     *  @param  $force_validate_plus    Äɲø¡¾Ú¶¯À©¥Õ¥é¥°
-     */
-    function setForceValidatePlus($force_validate_plus)
-    {
-        $this->force_validate_plus = $force_validate_plus;
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃ͸¡¾Ú¥á¥½¥Ã¥É
-     *
-     *  @access public
-     *  @return int     È¯À¸¤·¤¿¥¨¥é¡¼¤Î¿ô
-     */
-    function validate()
-    {
-        foreach ($this->form as $name => $def) {
-            // ¥×¥é¥°¥¤¥ó¤ò»È¤¦¾ì¹ç¤Î hook
-            if ((isset($def['plugin']) && $def['plugin'])
-                || (isset($def['plugin']) == false
-                    && isset($this->use_validator_plugin)
-                    && $this->use_validator_plugin == true)) {
-                $this->_validateWithPlugin($name);
-                continue;
-            }
-
-            // type ¤ò·èÄê
-            $type = is_array($def['type']) ? $def['type'][0] : $def['type'];
-
-            // filter¤òÀè¤ËÄ̤¹ (ÄêµÁ¤è¤ê¤âÁ÷¤é¤ì¤Æ¤­¤¿Ãͤι½Â¤¤òÍ¥Àè)
-            if ($type != VAR_TYPE_FILE) {
-                if (is_array($this->form_vars[$name])) {
-                    foreach (array_keys($this->form_vars[$name]) as $k) {
-                        $this->form_vars[$name][$k]
-                            = $this->_filter($this->form_vars[$name][$k], $def['filter']);
-                    }
-                } else {
-                    $this->form_vars[$name]
-                        = $this->_filter($this->form_vars[$name], $def['filter']);
-                }
-            }
-
-            // ÇÛÎó¤Ç¥é¥Ã¥×¤¹¤ë
-            if (is_null($this->form_vars[$name])) {
-                $form_vars = array();
-            } else if (is_array($def['type'])) {
-                if (is_array($this->form_vars[$name])) {
-                    $form_vars = $this->form_vars[$name];
-                } else {
-                    // ÇÛÎó¥Õ¥©¡¼¥à¤Ç null ¤¬ filter ¤Ë¤è¤Ã¤ÆÃͤò»ý¤Ã¤¿¤È¤­
-                    $form_vars = array($this->form_vars[$name]);
-                }
-            } else {
-                $form_vars = array($this->form_vars[$name]);
-            }
-
-            // ¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤ÏÇÛÎó¤Ç1¤Ävalid¤Ê¤érequired¾ò·ï¤ò¥¯¥ê¥¢¤¹¤ë
-            $valid_keys = array();
-            $required_num = max(1, $type == VAR_TYPE_FILE ? 1 : count($form_vars));
-            if (isset($def['required_num'])) {
-                $required_num = intval($def['required_num']);
-            }
-
-            foreach (array_keys($form_vars) as $key) {
-                // Ãͤ¬¶õ¤«¥Á¥§¥Ã¥¯
-                if ($type == VAR_TYPE_FILE) {
-                    if ($form_vars[$key]['size'] == 0
-                        || is_uploaded_file($form_vars[$key]['tmp_name']) == false) {
-                        continue;
-                    }
-                } else {
-                    if (is_scalar($form_vars[$key]) == false
-                        || strlen($form_vars[$key]) == 0) {
-                        continue;
-                    }
-                }
-
-                // valid_keys ¤ËÄɲÃ
-                $valid_keys[] = $key;
-
-                // _validate
-                $this->_validate($name, $form_vars[$key], $def);
-            }
-
-            // required ¤ÎȽÄê
-            if ($def['required'] && (count($valid_keys) < $required_num)) {
-                $this->handleError($name, E_FORM_REQUIRED);
-                continue;
-            }
-
-            // ¥«¥¹¥¿¥à¥á¥½¥Ã¥É¤Î¼Â¹Ô
-            if ($def['custom'] != null && is_array($def['type'])) {
-                $this->_validateCustom($def['custom'], $name);
-            }
-        }
-
-        if ($this->ae->count() == 0 || $this->isForceValidatePlus()) {
-            // Äɲø¡¾Ú¥á¥½¥Ã¥É
-            $this->_validatePlus();
-        }
-
-        //    default ¥¿¥¤¥×¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ì¤Ð¡¢
-        //    formÃͤò¤½¤ÎÃͤǽñ¤­´¹¤¨¡¢¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È¤ò½üµî
-        foreach ($this->form as $name => $def) {
-
-            //    FILE TYPE will be ignored.
-            $type = is_array($def['type']) ? $def['type'][0] : $def['type'];
-            if ($type == VAR_TYPE_FILE) {
-                continue;
-            }
-
-            if (isset($def['default'])) {
-                $this->form_vars[$name] = $def['default'];
-                $this->ae->remove($name);
-            }
-        }
-
-        return $this->ae->count();
-    }
-
-    /**
-     *  ¥×¥é¥°¥¤¥ó¤ò»È¤Ã¤¿¥Õ¥©¡¼¥àÃ͸¡¾Ú¥á¥½¥Ã¥É
-     *
-     *  @access private
-     *  @param  string  $form_name  ¥Õ¥©¡¼¥à¤Î̾Á°
-     *  @todo   validate¤Ïplugin¤À¤±¤Ë¤·¤¿¤¤
-     *  @todo   ae Â¦¤Ë $key ¤òÍ¿¤¨¤é¤ì¤ë¤è¤¦¤Ë¤¹¤ë
-     */
-    function _validateWithPlugin($form_name)
-    {
-        // (pre) filter
-        if ($this->form[$form_name]['type'] != VAR_TYPE_FILE) {
-            if (is_array($this->form[$form_name]['type']) == false) {
-                $this->form_vars[$form_name]
-                    = $this->_filter($this->form_vars[$form_name],
-                                     $this->form[$form_name]['filter']);
-            } else if ($this->form_vars[$form_name] != null) {
-                foreach (array_keys($this->form_vars[$form_name]) as $key) {
-                    $this->form_vars[$form_name][$key]
-                        = $this->_filter($this->form_vars[$form_name][$key],
-                                         $this->form[$form_name]['filter']);
-                }
-            }
-        }
-
-        $form_vars = $this->form_vars[$form_name];
-        $plugin = $this->_getPluginDef($form_name);
-
-        // type ¤Î¥Á¥§¥Ã¥¯¤ò½èÍý¤ÎºÇ½é¤ËÄɲÃ
-        $plugin = array_merge(array('type' => array()), $plugin);
-        if (is_array($this->form[$form_name]['type'])) {
-            $plugin['type']['type'] = $this->form[$form_name]['type'][0];
-        } else {
-            $plugin['type']['type'] = $this->form[$form_name]['type'];
-        }
-        if (isset($this->form[$form_name]['type_error'])) {
-            $plugin['type']['error'] = $this->form[$form_name]['type_error'];
-        }
-
-        // ¥¹¥«¥é¡¼¤Î¾ì¹ç
-        if (is_array($this->form[$form_name]['type']) == false) {
-            foreach (array_keys($plugin) as $name) {
-                // break: ÌÀ¼¨¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¤¥¨¥é¡¼¤¬µ¯¤­¤¿¤évalidate¤ò·Ñ³¤·¤Ê¤¤
-                $break = isset($plugin[$name]['break']) == false
-                               || $plugin[$name]['break'];
-
-                // ¥×¥é¥°¥¤¥ó¼èÆÀ
-                unset($v);
-                $v =& $this->plugin->getPlugin('Validator',
-                                               ucfirst(strtolower($name)));
-                if (Ethna::isError($v)) {
-                    continue;
-                }
-
-                // ¥Ð¥ê¥Ç¡¼¥·¥ç¥ó¼Â¹Ô
-                unset($r);
-                $r =& $v->validate($form_name, $form_vars, $plugin[$name]);
-
-                // ¥¨¥é¡¼½èÍý
-                if ($r !== true) {
-                    if (Ethna::isError($r)) {
-                        $this->ae->addObject($form_name, $r);
-                    }
-                    if ($break) {
-                        break;
-                    }
-                }
-            }
-            return;
-        }
-
-        // ÇÛÎó¤Î¾ì¹ç
-
-        // break »Ø¼¨ÍѤΠkey list
-        $valid_keys = is_array($form_vars) ? array_keys($form_vars) : array();
-
-        foreach (array_keys($plugin) as $name) {
-            // break: ÌÀ¼¨¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¤¥¨¥é¡¼¤¬µ¯¤­¤¿¤évalidate¤ò·Ñ³¤·¤Ê¤¤
-            $break = isset($plugin[$name]['break']) == false
-                           || $plugin[$name]['break'];
-
-            // ¥×¥é¥°¥¤¥ó¼èÆÀ
-            unset($v);
-            $v =& $this->plugin->getPlugin('Validator', ucfirst(strtolower($name)));
-            if (Ethna::isError($v)) {
-                continue;
-            }
-
-            // ÇÛÎóÁ´ÂΤò¼õ¤±¼è¤ë¥×¥é¥°¥¤¥ó¤Î¾ì¹ç
-            if (isset($v->accept_array) && $v->accept_array == true) {
-                // ¥Ð¥ê¥Ç¡¼¥·¥ç¥ó¼Â¹Ô
-                unset($r);
-                $r =& $v->validate($form_name, $form_vars, $plugin[$name]);
-
-                // ¥¨¥é¡¼½èÍý
-                if (Ethna::isError($r)) {
-                    $this->ae->addObject($form_name, $r);
-                    if ($break) {
-                        break;
-                    }
-                }
-                continue;
-            }
-
-            // ÇÛÎó¤Î³ÆÍ×ÁǤËÂФ·¤Æ¼Â¹Ô
-            foreach ($valid_keys as $key) {
-                // ¥Ð¥ê¥Ç¡¼¥·¥ç¥ó¼Â¹Ô
-                unset($r);
-                $r =& $v->validate($form_name, $form_vars[$key], $plugin[$name]);
-
-                // ¥¨¥é¡¼½èÍý
-                if (Ethna::isError($r)) {
-                    $this->ae->addObject($form_name, $r);
-                    if ($break) {
-                        unset($valid_keys[$key]);
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     *  ¥Á¥§¥Ã¥¯¥á¥½¥Ã¥É(´ðÄ쥯¥é¥¹)
-     *
-     *  @access public
-     *  @param  string  $name   ¥Õ¥©¡¼¥à¹àÌÜ̾
-     *  @return array   ¥Á¥§¥Ã¥¯ÂоݤΥե©¡¼¥àÃÍ(¥¨¥é¡¼¤¬Ìµ¤¤¾ì¹ç¤Ïnull)
-     */
-    function check($name)
-    {
-        if (is_null($this->form_vars[$name]) || $this->form_vars[$name] === "") {
-            return null;
-        }
-
-        // Ethna_Backend¤ÎÀßÄê
-        $c =& Ethna_Controller::getInstance();
-        $this->backend =& $c->getBackend();
-
-        return to_array($this->form_vars[$name]);
-    }
-
-    /**
-     *  ¥Á¥§¥Ã¥¯¥á¥½¥Ã¥É: µ¡¼ï°Í¸ʸ»ú
-     *
-     *  @access public
-     *  @param  string  $name   ¥Õ¥©¡¼¥à¹àÌÜ̾
-     *  @return object  Ethna_Error ¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È(¥¨¥é¡¼¤¬Ìµ¤¤¾ì¹ç¤Ïnull)
-     */
-    function &checkVendorChar($name)
-    {
-        $null = null;
-        $string = $this->form_vars[$name];
-
-        for ($i = 0; $i < strlen($string); $i++) {
-            /* JIS13¶è¤Î¤ß¥Á¥§¥Ã¥¯ */
-            $c = ord($string{$i});
-            if ($c < 0x80) {
-                /* ASCII */
-            } else if ($c == 0x8e) {
-                /* È¾³Ñ¥«¥Ê */
-                $i++;
-            } else if ($c == 0x8f) {
-                /* JIS X 0212 */
-                $i += 2;
-            } else if ($c == 0xad || ($c >= 0xf9 && $c <= 0xfc)) {
-                /* IBM³Èĥʸ»ú / NECÁªÄêIBM³Èĥʸ»ú */
-                return $this->ae->add($name,
-                    '{form}¤Ëµ¡¼ï°Í¸ʸ»ú¤¬ÆþÎϤµ¤ì¤Æ¤¤¤Þ¤¹', E_FORM_INVALIDCHAR);
-            } else {
-                $i++;
-            }
-        }
-
-        return $null;
-    }
-
-    /**
-     *  ¥Á¥§¥Ã¥¯¥á¥½¥Ã¥É: boolÃÍ
-     *
-     *  @access public
-     *  @param  string  $name   ¥Õ¥©¡¼¥à¹àÌÜ̾
-     *  @return object  Ethna_Error ¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È(¥¨¥é¡¼¤¬Ìµ¤¤¾ì¹ç¤Ïnull)
-     */
-    function &checkBoolean($name)
-    {
-        $null = null;
-        $form_vars = $this->check($name);
-
-        if ($form_vars == null) {
-            return $null;
-        }
-
-        foreach ($form_vars as $v) {
-            if ($v === "") {
-                continue;
-            }
-            if ($v != "0" && $v != "1") {
-                return $this->ae->add($name,
-                    '{form}¤òÀµ¤·¤¯ÆþÎϤ·¤Æ¤¯¤À¤µ¤¤', E_FORM_INVALIDCHAR);
-            }
-        }
-
-        return $null;
-    }
-
-    /**
-     *  ¥Á¥§¥Ã¥¯¥á¥½¥Ã¥É: ¥á¡¼¥ë¥¢¥É¥ì¥¹
-     *
-     *  @access public
-     *  @param  string  $name   ¥Õ¥©¡¼¥à¹àÌÜ̾
-     *  @return object  Ethna_Error ¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È(¥¨¥é¡¼¤¬Ìµ¤¤¾ì¹ç¤Ïnull)
-     */
-    function &checkMailaddress($name)
-    {
-        $null = null;
-        $form_vars = $this->check($name);
-
-        if ($form_vars == null) {
-            return $null;
-        }
-
-        foreach ($form_vars as $v) {
-            if ($v === "") {
-                continue;
-            }
-            if (Ethna_Util::checkMailaddress($v) == false) {
-                return $this->ae->add($name,
-                    '{form}¤òÀµ¤·¤¯ÆþÎϤ·¤Æ¤¯¤À¤µ¤¤', E_FORM_INVALIDCHAR);
-            }
-        }
-
-        return $null;
-    }
-
-    /**
-     *  ¥Á¥§¥Ã¥¯¥á¥½¥Ã¥É: URL
-     *
-     *  @access public
-     *  @param  string  $name   ¥Õ¥©¡¼¥à¹àÌÜ̾
-     *  @return object  Ethna_Error ¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È(¥¨¥é¡¼¤¬Ìµ¤¤¾ì¹ç¤Ïnull)
-     */
-    function &checkURL($name)
-    {
-        $null = null;
-        $form_vars = $this->check($name);
-
-        if ($form_vars == null) {
-            return $null;
-        }
-
-        foreach ($form_vars as $v) {
-            if ($v === "") {
-                continue;
-            }
-            if (preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/)/', $v) == 0) {
-                return $this->ae->add($name,
-                    '{form}¤òÀµ¤·¤¯ÆþÎϤ·¤Æ¤¯¤À¤µ¤¤', E_FORM_INVALIDCHAR);
-            }
-        }
-
-        return $null;
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃͤòhidden¥¿¥°¤È¤·¤ÆÊÖ¤¹
-     *
-     *  @access public
-     *  @param  array   $include_list   ÇÛÎ󤬻ØÄꤵ¤ì¤¿¾ì¹ç¡¢¤½¤ÎÇÛÎó¤Ë´Þ¤Þ¤ì¤ë¥Õ¥©¡¼¥à¹àÌܤΤߤ¬ÂоݤȤʤë
-     *  @param  array   $exclude_list   ÇÛÎ󤬻ØÄꤵ¤ì¤¿¾ì¹ç¡¢¤½¤ÎÇÛÎó¤Ë´Þ¤Þ¤ì¤Ê¤¤¥Õ¥©¡¼¥à¹àÌܤΤߤ¬ÂоݤȤʤë
-     *  @return string  hidden¥¿¥°¤È¤·¤Æµ­½Ò¤µ¤ì¤¿HTML
-     */
-    function getHiddenVars($include_list = null, $exclude_list = null)
-    {
-        $hidden_vars = "";
-        foreach ($this->form as $key => $value) {
-            if (is_array($include_list) == true
-                && in_array($key, $include_list) == false) {
-                continue;
-            }
-            if (is_array($exclude_list) == true
-                && in_array($key, $exclude_list) == true) {
-                continue;
-            }
-            
-            $type = is_array($value['type']) ? $value['type'][0] : $value['type'];
-            if ($type == VAR_TYPE_FILE) {
-                continue;
-            }
-
-            $form_value = $this->form_vars[$key];
-            if (is_array($value['type'])) {
-                $form_array = true;
-            } else {
-                $form_value = array($form_value);
-                $form_array = false;
-            }
-
-            if (is_null($this->form_vars[$key])) {
-                // ¥Õ¥©¡¼¥àÃͤ¬Á÷¤é¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¤½¤â¤½¤âhidden¥¿¥°¤ò½ÐÎϤ·¤Ê¤¤
-                continue;
-            }
-
-            foreach ($form_value as $k => $v) {
-                if ($form_array) {
-                    $form_name = "$key" . "[$k]";
-                } else {
-                    $form_name = $key;
-                }
-                $hidden_vars .=
-                    sprintf("<input type=\"hidden\" name=\"%s\" value=\"%s\" />\n",
-                    $form_name, htmlspecialchars($v, ENT_QUOTES));
-            }
-        }
-        return $hidden_vars;
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃ͸¡¾Ú¤Î¥¨¥é¡¼½èÍý¤ò¹Ô¤¦
-     *
-     *  @access public
-     *  @param  string      $name   ¥Õ¥©¡¼¥à¹àÌÜ̾
-     *  @param  int         $code   ¥¨¥é¡¼¥³¡¼¥É
-     */
-    function handleError($name, $code)
-    {
-        $def = $this->getDef($name);
-
-        // ¥æ¡¼¥¶ÄêµÁ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸
-        $code_map = array(
-            E_FORM_REQUIRED     => 'required_error',
-            E_FORM_WRONGTYPE_SCALAR => 'type_error',
-            E_FORM_WRONGTYPE_ARRAY  => 'type_error',
-            E_FORM_WRONGTYPE_INT    => 'type_error',
-            E_FORM_WRONGTYPE_FLOAT  => 'type_error',
-            E_FORM_WRONGTYPE_DATETIME   => 'type_error',
-            E_FORM_WRONGTYPE_BOOLEAN    => 'type_error',
-            E_FORM_MIN_INT      => 'min_error',
-            E_FORM_MIN_FLOAT    => 'min_error',
-            E_FORM_MIN_DATETIME => 'min_error',
-            E_FORM_MIN_FILE     => 'min_error',
-            E_FORM_MIN_STRING   => 'min_error',
-            E_FORM_MAX_INT      => 'max_error',
-            E_FORM_MAX_FLOAT    => 'max_error',
-            E_FORM_MAX_DATETIME => 'max_error',
-            E_FORM_MAX_FILE     => 'max_error',
-            E_FORM_MAX_STRING   => 'max_error',
-            E_FORM_REGEXP       => 'regexp_error',
-        );
-        if (array_key_exists($code_map[$code], $def)) {
-            $this->ae->add($name, $def[$code_map[$code]], $code);
-            return;
-        }
-
-        if ($code == E_FORM_REQUIRED) {
-            switch ($def['form_type']) {
-            case FORM_TYPE_TEXT:
-            case FORM_TYPE_PASSWORD:
-            case FORM_TYPE_TEXTAREA:
-            case FORM_TYPE_SUBMIT:
-                $message = "{form}¤òÆþÎϤ·¤Æ²¼¤µ¤¤";
-                break;
-            case FORM_TYPE_SELECT:
-            case FORM_TYPE_RADIO:
-            case FORM_TYPE_CHECKBOX:
-            case FORM_TYPE_FILE:
-                $message = "{form}¤òÁªÂò¤·¤Æ²¼¤µ¤¤";
-                break;
-            default:
-                $message = "{form}¤òÆþÎϤ·¤Æ²¼¤µ¤¤";
-                break;
-            }
-        } else if ($code == E_FORM_WRONGTYPE_SCALAR) {
-            $message = "{form}¤Ë¤Ï¥¹¥«¥é¡¼ÃͤòÆþÎϤ·¤Æ²¼¤µ¤¤";
-        } else if ($code == E_FORM_WRONGTYPE_ARRAY) {
-            $message = "{form}¤Ë¤ÏÇÛÎó¤òÆþÎϤ·¤Æ²¼¤µ¤¤";
-        } else if ($code == E_FORM_WRONGTYPE_INT) {
-            $message = "{form}¤Ë¤Ï¿ô»ú(À°¿ô)¤òÆþÎϤ·¤Æ²¼¤µ¤¤";
-        } else if ($code == E_FORM_WRONGTYPE_FLOAT) {
-            $message = "{form}¤Ë¤Ï¿ô»ú(¾®¿ô)¤òÆþÎϤ·¤Æ²¼¤µ¤¤";
-        } else if ($code == E_FORM_WRONGTYPE_DATETIME) {
-            $message = "{form}¤Ë¤ÏÆüÉÕ¤òÆþÎϤ·¤Æ²¼¤µ¤¤";
-        } else if ($code == E_FORM_WRONGTYPE_BOOLEAN) {
-            $message = "{form}¤Ë¤Ï1¤Þ¤¿¤Ï0¤Î¤ßÆþÎϤǤ­¤Þ¤¹";
-        } else if ($code == E_FORM_MIN_INT) {
-            $this->ae->add($name,
-                "{form}¤Ë¤Ï%d°Ê¾å¤Î¿ô»ú(À°¿ô)¤òÆþÎϤ·¤Æ²¼¤µ¤¤",
-                $code, $def['min']);
-            return;
-        } else if ($code == E_FORM_MIN_FLOAT) {
-            $this->ae->add($name,
-                "{form}¤Ë¤Ï%f°Ê¾å¤Î¿ô»ú(¾®¿ô)¤òÆþÎϤ·¤Æ²¼¤µ¤¤",
-                $code, $def['min']);
-            return;
-        } else if ($code == E_FORM_MIN_DATETIME) {
-            $this->ae->add($name,
-                "{form}¤Ë¤Ï%s°Ê¹ß¤ÎÆüÉÕ¤òÆþÎϤ·¤Æ²¼¤µ¤¤",
-                $code, $def['min']);
-            return;
-        } else if ($code == E_FORM_MIN_FILE) {
-            $this->ae->add($name,
-                "{form}¤Ë¤Ï%dKB°Ê¾å¤Î¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Æ²¼¤µ¤¤",
-                $code, $def['min']);
-            return;
-        } else if ($code == E_FORM_MIN_STRING) {
-            $this->ae->add($name,
-                "{form}¤Ë¤ÏÁ´³Ñ%dʸ»ú°Ê¾å(Ⱦ³Ñ%dʸ»ú°Ê¾å)ÆþÎϤ·¤Æ²¼¤µ¤¤",
-                $code, intval($def['min']/2), $def['min']);
-            return;
-        } else if ($code == E_FORM_MAX_INT) {
-            $this->ae->add($name,
-                "{form}¤Ë¤Ï%d°Ê²¼¤Î¿ô»ú(À°¿ô)¤òÆþÎϤ·¤Æ²¼¤µ¤¤",
-                $code, $def['max']);
-            return;
-        } else if ($code == E_FORM_MAX_FLOAT) {
-            $this->ae->add($name,
-                "{form}¤Ë¤Ï%f°Ê²¼¤Î¿ô»ú(¾®¿ô)¤òÆþÎϤ·¤Æ²¼¤µ¤¤",
-                $code, $def['max']);
-            return;
-        } else if ($code == E_FORM_MAX_DATETIME) {
-            $this->ae->add($name,
-                "{form}¤Ë¤Ï%s°ÊÁ°¤ÎÆüÉÕ¤òÆþÎϤ·¤Æ²¼¤µ¤¤",
-                $code, $def['max']);
-            return;
-        } else if ($code == E_FORM_MAX_FILE) {
-            $this->ae->add($name,
-                "{form}¤Ë¤Ï%dKB°Ê²¼¤Î¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Æ²¼¤µ¤¤",
-                $code, $def['max']);
-            return;
-        } else if ($code == E_FORM_MAX_STRING) {
-            $this->ae->add($name,
-                "{form}¤ÏÁ´³Ñ%dʸ»ú°Ê²¼(Ⱦ³Ñ%dʸ»ú°Ê²¼)¤ÇÆþÎϤ·¤Æ²¼¤µ¤¤",
-                $code, intval($def['max']/2), $def['max']);
-            return;
-        } else if ($code == E_FORM_REGEXP) {
-            $message = "{form}¤òÀµ¤·¤¯ÆþÎϤ·¤Æ¤¯¤À¤µ¤¤";
-        }
-
-        $this->ae->add($name, $message, $code);
-    }
-
-    /**
-     *  ¥æ¡¼¥¶ÄêµÁ¸¡¾Ú¥á¥½¥Ã¥É(¥Õ¥©¡¼¥àÃÍ´Ö¤ÎÏ¢·È¥Á¥§¥Ã¥¯Åù)
-     *
-     *  @access protected
-     */
-    function _validatePlus()
-    {
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃ͸¡¾Ú¥á¥½¥Ã¥É(¼ÂÂÎ)
-     *
-     *  @access private
-     *  @param  string  $name       ¥Õ¥©¡¼¥à¹àÌÜ̾
-     *  @param  mixed   $var        ¥Õ¥©¡¼¥àÃÍ(ÇÛÎó¤Ç¤¢¤ì¤Ð¸Ä¡¹¤ÎÃæ¿È)
-     *  @param  array   $def        ¥Õ¥©¡¼¥àÃÍÄêµÁ
-     *  @param  bool    $test       ¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥ÈÅÐÏ¿¥Õ¥é¥°(true:ÅÐÏ¿¤·¤Ê¤¤)
-     *  @return bool    true:Àµ¾ï½ªÎ» false:¥¨¥é¡¼
-     */
-    function _validate($name, $var, $def, $test = false)
-    {
-        $type = is_array($def['type']) ? $def['type'][0] : $def['type'];
-
-        // type
-        if ($type == VAR_TYPE_INT) {
-            if (!preg_match('/^-?\d+$/', $var)) {
-                if ($test == false) {
-                    $this->handleError($name, E_FORM_WRONGTYPE_INT);
-                }
-                return false;
-            }
-        } else if ($type == VAR_TYPE_FLOAT) {
-            if (!preg_match('/^-?\d+$/', $var)
-                && !preg_match('/^-?\d+\.\d+$/', $var)) {
-                if ($test == false) {
-                    $this->handleError($name, E_FORM_WRONGTYPE_FLOAT);
-                }
-                return false;
-            }
-        } else if ($type == VAR_TYPE_DATETIME) {
-            $r = strtotime($var);
-            if ($r == -1 || $r === false) {
-                if ($test == false) {
-                    $this->handleError($name, E_FORM_WRONGTYPE_DATETIME);
-                }
-                return false;
-            }
-        } else if ($type == VAR_TYPE_BOOLEAN) {
-            if ($var != "1" && $var != "0") {
-                if ($test == false) {
-                    $this->handleError($name, E_FORM_WRONGTYPE_BOOLEAN);
-                }
-                return false;
-            }
-        } else if ($type == VAR_TYPE_STRING) {
-            // nothing to do
-        } else if ($type == VAR_TYPE_FILE) {
-            // nothing to do
-        }
-
-        // min
-        if ($type == VAR_TYPE_INT) {
-            if (!is_null($def['min']) && $var < $def['min']) {
-                if ($test == false) {
-                    $this->handleError($name, E_FORM_MIN_INT);
-                }
-                return false;
-            }
-        } else if ($type == VAR_TYPE_FLOAT) {
-            if (!is_null($def['min']) && $var < $def['min']) {
-                if ($test == false) {
-                    $this->handleError($name, E_FORM_MIN_FLOAT);
-                }
-                return false;
-            }
-        } else if ($type == VAR_TYPE_DATETIME) {
-            if (!is_null($def['min'])) {
-                $t_min = strtotime($def['min']);
-                $t_var = strtotime($var);
-                if ($t_var < $t_min) {
-                    if ($test == false) {
-                        $this->handleError($name, E_FORM_MIN_DATETIME);
-                    }
-                }
-                return false;
-            }
-        } else if ($type == VAR_TYPE_FILE) {
-            if (!is_null($def['min'])) {
-                $st = stat($var['tmp_name']);
-                if ($st[7] < $def['min'] * 1024) {
-                    if ($test == false) {
-                        $this->handleError($name, E_FORM_MIN_FILE);
-                    }
-                    return false;
-                }
-            }
-        } else {
-            if (!is_null($def['min']) && strlen($var) < $def['min']) {
-                if ($test == false) {
-                    $this->handleError($name, E_FORM_MIN_STRING);
-                }
-                return false;
-            }
-        }
-
-        // max
-        if ($type == VAR_TYPE_INT) {
-            if (!is_null($def['max']) && $var > $def['max']) {
-                if ($test == false) {
-                    $this->handleError($name, E_FORM_MAX_INT);
-                }
-                return false;
-            }
-        } else if ($type == VAR_TYPE_FLOAT) {
-            if (!is_null($def['max']) && $var > $def['max']) {
-                if ($test == false) {
-                    $this->handleError($name, E_FORM_MAX_FLOAT);
-                }
-                return false;
-            }
-        } else if ($type == VAR_TYPE_DATETIME) {
-            if (!is_null($def['max'])) {
-                $t_min = strtotime($def['max']);
-                $t_var = strtotime($var);
-                if ($t_var > $t_min) {
-                    if ($test == false) {
-                        $this->handleError($name, E_FORM_MAX_DATETIME);
-                    }
-                }
-                return false;
-            }
-        } else if ($type == VAR_TYPE_FILE) {
-            if (!is_null($def['max'])) {
-                $st = stat($var['tmp_name']);
-                if ($st[7] > $def['max'] * 1024) {
-                    if ($test == false) {
-                        $this->handleError($name, E_FORM_MAX_FILE);
-                    }
-                    return false;
-                }
-            }
-        } else {
-            if (!is_null($def['max']) && strlen($var) > $def['max']) {
-                if ($test == false) {
-                    $this->handleError($name, E_FORM_MAX_STRING);
-                }
-                return false;
-            }
-        }
-
-        // regexp
-        if ($type != VAR_TYPE_FILE && $def['regexp'] != null && strlen($var) > 0
-            && preg_match($def['regexp'], $var) == 0) {
-            if ($test == false) {
-                $this->handleError($name, E_FORM_REGEXP);
-            }
-            return false;
-        }
-
-        // custom (TODO: respect $test flag)
-        if ($def['custom'] != null) {
-            if (isset($this->form[$name]['type'])
-                && is_array($this->form[$name]['type']) == false) {
-                $this->_validateCustom($def['custom'], $name);
-            } else {
-                // ÇÛÎó»ØÄê¤Î¾ì¹ç¤ÏÁ´Í×ÁÇ°ì³ç¤Ç¥«¥¹¥¿¥à¥á¥½¥Ã¥É¤ò¼Â¹Ô¤¹¤ë¤¿¤á¥¹¥­¥Ã¥×
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     *  ¥«¥¹¥¿¥à¥Á¥§¥Ã¥¯¥á¥½¥Ã¥É¤ò¼Â¹Ô¤¹¤ë
-     *
-     *  @access protected
-     *  @param  string  $method_list    ¥«¥¹¥¿¥à¥á¥½¥Ã¥É̾(¥«¥ó¥Þ¶èÀÚ¤ê)
-     *  @param  string  $name           ¥Õ¥©¡¼¥à¹àÌÜ̾
-     */
-    function _validateCustom($method_list, $name)
-    {
-        $method_list = preg_split('/\s*,\s*/', $method_list,
-                                  -1, PREG_SPLIT_NO_EMPTY);
-        if (is_array($method_list) == false) {
-            return;
-        }
-        foreach ($method_list as $method) {
-            $this->$method($name);
-        }
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃͤËÊÑ´¹¥Õ¥£¥ë¥¿¤òŬÍѤ¹¤ë
-     *
-     *  @access private
-     *  @param  mixed   $value  ¥Õ¥©¡¼¥àÃÍ
-     *  @param  int     $filter ¥Õ¥£¥ë¥¿ÄêµÁ
-     *  @return mixed   ÊÑ´¹·ë²Ì
-     */
-    function _filter($value, $filter)
-    {
-        if (is_null($filter)) {
-            return $value;
-        }
-
-        foreach (preg_split('/\s*,\s*/', $filter) as $f) {
-            $method = sprintf('_filter_%s', $f);
-            if (method_exists($this, $method) == false) {
-                $this->logger->log(LOG_WARNING,
-                    'filter method is not defined [%s]', $method);
-                continue;
-            }
-            $value = $this->$method($value);
-        }
-
-        return $value;
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃÍÊÑ´¹¥Õ¥£¥ë¥¿: Á´³Ñ±Ñ¿ô»ú->Ⱦ³Ñ±Ñ¿ô»ú
-     *
-     *  @access protected
-     *  @param  mixed   $value  ¥Õ¥©¡¼¥àÃÍ
-     *  @return mixed   ÊÑ´¹·ë²Ì
-     */
-    function _filter_alnum_zentohan($value)
-    {
-        return mb_convert_kana($value, "a");
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃÍÊÑ´¹¥Õ¥£¥ë¥¿: Á´³Ñ¿ô»ú->Ⱦ³Ñ¿ô»ú
-     *
-     *  @access protected
-     *  @param  mixed   $value  ¥Õ¥©¡¼¥àÃÍ
-     *  @return mixed   ÊÑ´¹·ë²Ì
-     */
-    function _filter_numeric_zentohan($value)
-    {
-        return mb_convert_kana($value, "n");
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃÍÊÑ´¹¥Õ¥£¥ë¥¿: Á´³Ñ±Ñ»ú->Ⱦ³Ñ±Ñ»ú
-     *
-     *  @access protected
-     *  @param  mixed   $value  ¥Õ¥©¡¼¥àÃÍ
-     *  @return mixed   ÊÑ´¹·ë²Ì
-     */
-    function _filter_alphabet_zentohan($value)
-    {
-        return mb_convert_kana($value, "r");
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃÍÊÑ´¹¥Õ¥£¥ë¥¿: º¸¶õÇòºï½ü
-     *
-     *  @access protected
-     *  @param  mixed   $value  ¥Õ¥©¡¼¥àÃÍ
-     *  @return mixed   ÊÑ´¹·ë²Ì
-     */
-    function _filter_ltrim($value)
-    {
-        return ltrim($value);
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃÍÊÑ´¹¥Õ¥£¥ë¥¿: ±¦¶õÇòºï½ü
-     *
-     *  @access protected
-     *  @param  mixed   $value  ¥Õ¥©¡¼¥àÃÍ
-     *  @return mixed   ÊÑ´¹·ë²Ì
-     */
-    function _filter_rtrim($value)
-    {
-        return rtrim($value);
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃÍÊÑ´¹¥Õ¥£¥ë¥¿: NULL(0x00)ºï½ü
-     *
-     *  @access protected
-     *  @param  mixed   $value  ¥Õ¥©¡¼¥àÃÍ
-     *  @return mixed   ÊÑ´¹·ë²Ì
-     */
-    function _filter_ntrim($value)
-    {
-        return str_replace("\x00", "", $value);
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃÍÊÑ´¹¥Õ¥£¥ë¥¿: È¾³Ñ¥«¥Ê->Á´³Ñ¥«¥Ê
-     *
-     *  @access protected
-     *  @param  mixed   $value  ¥Õ¥©¡¼¥àÃÍ
-     *  @return mixed   ÊÑ´¹·ë²Ì
-     */
-    function _filter_kana_hantozen($value)
-    {
-        return mb_convert_kana($value, "K");
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃÍÄêµÁ¥Æ¥ó¥×¥ì¡¼¥È¤òÀßÄꤹ¤ë
-     *
-     *  @access protected
-     *  @param  array   $form_template  ¥Õ¥©¡¼¥àÃͥƥó¥×¥ì¡¼¥È
-     *  @return array   ¥Õ¥©¡¼¥àÃͥƥó¥×¥ì¡¼¥È
-     */
-    function _setFormTemplate($form_template)
-    {
-        return $form_template;
-    }
-
-    /**
-     *  ¥Ø¥ë¥Ñ¥ª¥Ö¥¸¥§¥¯¥È·Ðͳ¤Ç¤Î¥Õ¥©¡¼¥àÃÍÄêµÁ¤òÀßÄꤹ¤ë
-     *
-     *  @access protected
-     */
-    function _setFormDef_Helper()
-    {
-        foreach (array_keys($this->helper_app_object) as $key) {
-            $object =& $this->helper_app_object[$key];
-            $prop_def = $object->getDef();
-
-            foreach ($prop_def as $key => $value) {
-                // 1. override form_template
-                $form_key = isset($value['form_name']) ? $value['form_name'] : $key;
-
-                if (isset($this->form_template[$form_key]) == false) {
-                    $this->form_template[$form_key] = array();
-                }
-
-                $this->form_template[$form_key]['type'] = $value['type'];
-                if (isset($value['required'])) {
-                    $this->form_template[$form_key]['required'] = $value['required'];
-                }
-
-                if ($value['type'] == VAR_TYPE_STRING && isset($value['length'])) {
-                    $this->form_template[$form_key]['max'] = $value['length'];
-                }
-
-                // 2. then activate form
-                if (in_array($key, $this->helper_skip_form) == false) {
-                    if (isset($this->form[$key]) == false) {
-                        $this->form[$key] = array();
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃÍÄêµÁ¤òÀßÄꤹ¤ë
-     *
-     *  @access protected
-     */
-    function _setFormDef()
-    {
-        foreach ($this->form as $key => $value) {
-            if (array_key_exists($key, $this->form_template)
-                && is_array($this->form_template)) {
-                foreach ($this->form_template[$key] as $def_key => $def_value) {
-                    if (array_key_exists($def_key, $value) == false) {
-                        $this->form[$key][$def_key] = $def_value;
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃÍÄêµÁ¤«¤é¥×¥é¥°¥¤¥ó¤ÎÄêµÁ¥ê¥¹¥È¤òʬΥ¤¹¤ë
-     *
-     *  @access protected
-     *  @param  string  $form_name   ¥×¥é¥°¥¤¥ó¤ÎÄêµÁ¥ê¥¹¥È¤ò¼èÆÀ¤¹¤ë¥Õ¥©¡¼¥à¤Î̾Á°
-     */
-    function _getPluginDef($form_name)
-    {
-        //  $def = array(
-        //               'name'         => 'number',
-        //               'max'          => 10,
-        //               'max_error'    => 'too large!',
-        //               'min'          => 5,
-        //               'min_error'    => 'too small!',
-        //              );
-        //
-        // as plugin parameters:
-        //
-        //  $plugin_def = array(
-        //                      'max' => array('max' => 10, 'error' => 'too large!'),
-        //                      'min' => array('min' => 5, 'error' => 'too small!'),
-        //                     );
-
-        $def = $this->getDef($form_name);
-        $plugin = array();
-        foreach (array_keys($def) as $key) {
-            // Ì¤ÄêµÁÍ×ÁǤò¥¹¥­¥Ã¥×
-            if ($def[$key] === null) {
-                continue;
-            }
-
-            // ¥×¥é¥°¥¤¥ó̾¤È¥Ñ¥é¥á¡¼¥¿Ì¾¤Ëʬ³ä
-            $snippet = explode('_', $key, 2);
-            $name = $snippet[0];
-
-            // Èó¥×¥é¥°¥¤¥óÍ×ÁǤò¥¹¥­¥Ã¥×
-            if (in_array($name, $this->def_noplugin)) {
-                continue;
-            }
-
-            if (count($snippet) == 1) {
-                // ¥×¥é¥°¥¤¥ó̾¤À¤±¤À¤Ã¤¿¾ì¹ç
-                if (is_array($def[$key])) {
-                    // ¥×¥é¥°¥¤¥ó¥Ñ¥é¥á¡¼¥¿¤¬¤¢¤é¤«¤¸¤áÇÛÎó¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë(¤È¤ß¤Ê¤¹)
-                    $tmp = $def[$key];
-                } else {
-                    $tmp = array($name => $def[$key]);
-                }
-            } else {
-                // plugin_param ¤Î¾ì¹ç
-                $tmp = array($snippet[1] => $def[$key]);
-            }
-
-            // merge
-            if (isset($plugin[$name]) == false) {
-                $plugin[$name] = array();
-            }
-            $plugin[$name] = array_merge($plugin[$name], $tmp);
-        }
-
-        return $plugin;
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È(helper)¤òÀ¸À®¤¹¤ë
-     *
-     *  @access protected
-     */
-    function &_getHelperAppObject($key)
-    {
-        $app_object =& $this->backend->getObject($key);
-        return $app_object;
-    }
-}
-// }}}
-?>
diff --git a/class/Ethna_AppManager.php b/class/Ethna_AppManager.php
deleted file mode 100644 (file)
index 8d109ca..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_AppManager.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-/** ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¾õÂÖ: »ÈÍѲÄǽ */
-define('OBJECT_STATE_ACTIVE', 0);
-/** ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¾õÂÖ: »ÈÍÑÉԲĠ*/
-define('OBJECT_STATE_INACTIVE', 100);
-
-
-/** ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¥½¡¼¥È¥Õ¥é¥°: ¾º½ç */
-define('OBJECT_SORT_ASC', 0);
-/** ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¥½¡¼¥È¥Õ¥é¥°: ¹ß½ç */
-define('OBJECT_SORT_DESC', 1);
-
-
-/** ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¥¤¥ó¥Ý¡¼¥È¥ª¥×¥·¥ç¥ó: NULL¥×¥í¥Ñ¥Æ¥£ÌµÊÑ´¹ */
-define('OBJECT_IMPORT_IGNORE_NULL', 1);
-
-/** ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¥¤¥ó¥Ý¡¼¥È¥ª¥×¥·¥ç¥ó: NULL¥×¥í¥Ñ¥Æ¥£¢ª¶õʸ»úÎóÊÑ´¹ */
-define('OBJECT_IMPORT_CONVERT_NULL', 2);
-
-
-// {{{ Ethna_AppManager
-/**
- *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Þ¥Í¡¼¥¸¥ã¤Î¥Ù¡¼¥¹¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_AppManager
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    object  Ethna_Backend       backend¥ª¥Ö¥¸¥§¥¯¥È */
-    var $backend;
-
-    /** @var    object  Ethna_Config        ÀßÄꥪ¥Ö¥¸¥§¥¯¥È */
-    var $config;
-
-    /**  @var    object  Ethna_DB      DB¥ª¥Ö¥¸¥§¥¯¥È */
-    var $db;
-
-    /** @var    object  Ethna_I18N          i18n¥ª¥Ö¥¸¥§¥¯¥È */
-    var $i18n;
-
-    /** @var    object  Ethna_ActionForm    ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È */
-    var $action_form;
-
-    /** @var    object  Ethna_ActionForm    ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È(¾Êά·Á) */
-    var $af;
-
-    /** @var    object  Ethna_Session       ¥»¥Ã¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È */
-    var $session;
-
-    /**#@-*/
-
-    /**
-     *  Ethna_AppManager¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Backend   &$backend   backend¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function Ethna_AppManager(&$backend)
-    {
-        // ´ðËÜ¥ª¥Ö¥¸¥§¥¯¥È¤ÎÀßÄê
-        $this->backend =& $backend;
-        $this->config =& $backend->getConfig();
-        $this->i18n =& $backend->getI18N();
-        $this->action_form =& $backend->getActionForm();
-        $this->af =& $this->action_form;
-        $this->session =& $backend->getSession();
-
-        $db_list = $backend->getDBList();
-        if (Ethna::isError($db_list) == false) {
-            foreach ($db_list as $elt) {
-                $varname = $elt['varname'];
-                $this->$varname =& $elt['db'];
-            }
-        }
-    }
-
-    /**
-     *  Â°À­¤Î°ìÍ÷¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @param  string  $attr_name  Â°À­¤Î̾Á°(ÊÑ¿ô̾)
-     *  @return array   Â°À­ÃÍ°ìÍ÷
-     */
-    function getAttrList($attr_name)
-    {
-        $varname = $attr_name . "_list";
-        return $this->$varname;
-    }
-
-    /**
-     *  Â°À­¤Îɽ¼¨Ì¾¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @param  string  $attr_name  Â°À­¤Î̾Á°(ÊÑ¿ô̾)
-     *  @param  mixed   $id         Â°À­ID
-     *  @return string  Â°À­¤Îɽ¼¨Ì¾
-     */
-    function getAttrName($attr_name, $id)
-    {
-        $varname = $attr_name . "_list";
-        if (is_array($this->$varname) == false) {
-            return null;
-        }
-        $list =& $this->$varname;
-        if (isset($list[$id]) == false) {
-            return null;
-        }
-        return $list[$id]['name'];
-    }
-
-    /**
-     *  Â°À­¤Îɽ¼¨Ì¾(¾ÜºÙ)¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @param  string  $attr_name  Â°À­¤Î̾Á°(ÊÑ¿ô̾)
-     *  @param  mixed   $id         Â°À­ID
-     *  @return string  Â°À­¤Î¾ÜºÙɽ¼¨Ì¾
-     */
-    function getAttrLongName($attr_name, $id)
-    {
-        $varname = $attr_name . "_list";
-        if (is_array($this->$varname) == false) {
-            return null;
-        }
-        $list =& $this->$varname;
-        if (isset($list[$id]['long_name']) == false) {
-            return null;
-        }
-
-        return $list[$id]['long_name'];
-    }
-
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¤Î°ìÍ÷¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @param  string  $class  Ethna_AppObject¤Î·Ñ¾µ¥¯¥é¥¹Ì¾
-     *  @param  array   $filter     ¸¡º÷¾ò·ï
-     *  @param  array   $order      ¸¡º÷·ë²Ì¥½¡¼¥È¾ò·ï
-     *  @param  int     $offset     ¸¡º÷·ë²Ì¼èÆÀ¥ª¥Õ¥»¥Ã¥È
-     *  @param  int     $count      ¸¡º÷·ë²Ì¼èÆÀ¿ô
-     *  @return mixed   array(0 => ¸¡º÷¾ò·ï¤Ë¥Þ¥Ã¥Á¤·¤¿·ï¿ô, 1 => $offset, $count¤Ë¤è¤ê»ØÄꤵ¤ì¤¿·ï¿ô¤Î¥ª¥Ö¥¸¥§¥¯¥ÈID°ìÍ÷) Ethna_Error:¥¨¥é¡¼
-     *  @todo   ¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹Âкö(1¥ª¥Ö¥¸¥§¥¯¥È¤ÎÀêÍ­¥á¥â¥ê¤¬Â¿¤¤¾ì¹ç)
-     */
-    function getObjectList($class, $filter = null,
-                           $order = null, $offset = null, $count = null)
-    {
-        global $_ETHNA_APP_MANAGER_OL_CACHE;
-
-        $object_list = array();
-        $class_name = sprintf("%s_%s", $this->backend->getAppId(), $class);
-
-        // ¥­¥ã¥Ã¥·¥å¥Á¥§¥Ã¥¯
-        $cache_class = strtolower($class_name);
-        if (is_array($_ETHNA_APP_MANAGER_OL_CACHE) == false
-            || array_key_exists($cache_class, $_ETHNA_APP_MANAGER_OL_CACHE) == false) {
-            $_ETHNA_APP_MANAGER_OL_CACHE[$cache_class] = array();
-        }
-        $cache_key = serialize(array($filter, $order, $offset, $count));
-        if (array_key_exists($cache_key, $_ETHNA_APP_MANAGER_OL_CACHE[$cache_class])) {
-            list($length, $prop_list)
-                = $_ETHNA_APP_MANAGER_OL_CACHE[$cache_class][$cache_key];
-        } else {
-            // ¥­¥ã¥Ã¥·¥å¹¹¿·
-            $tmp =& new $class_name($this->backend);
-            list($length, $prop_list)
-                = $tmp->searchProp(null, $filter, $order, $offset, $count);
-            $_ETHNA_APP_MANAGER_OL_CACHE[$cache_class][$cache_key]
-                = array($length, $prop_list);
-        }
-
-        foreach ($prop_list as $prop) {
-            $object =& new $class_name($this->backend, null, null, $prop);
-            $object_list[] = $object;
-        }
-
-        return array($length, $object_list);
-    }
-
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¥×¥í¥Ñ¥Æ¥£¤Î°ìÍ÷¤òÊÖ¤¹
-     *
-     *  getObjectList()¥á¥½¥Ã¥É¤Ï¾ò·ï¤Ë¥Þ¥Ã¥Á¤¹¤ëID¤ò¸µ¤ËEthna_AppObject¤òÀ¸À®¤¹¤ë
-     *  ¤¿¤á¥³¥¹¥È¤¬¤«¤«¤ë¡£¤³¤Á¤é¤Ï¥×¥í¥Ñ¥Æ¥£¤Î¤ß¤òSELECT¤¹¤ë¤Î¤ÇÄ㥳¥¹¥È¤Ç¥Ç¡¼¥¿
-     *  ¤ò¼èÆÀ¤¹¤ë¤³¤È¤¬²Äǽ¡£
-     *
-     *  @access public
-     *  @param  string  $class      Ethna_AppObject¤Î·Ñ¾µ¥¯¥é¥¹Ì¾
-     *  @param  array   $keys       ¼èÆÀ¤¹¤ë¥×¥í¥Ñ¥Æ¥£°ìÍ÷(null¤Ê¤éÁ´¤Æ)
-     *  @param  array   $filter     ¸¡º÷¾ò·ï
-     *  @param  array   $order      ¸¡º÷·ë²Ì¥½¡¼¥È¾ò·ï
-     *  @param  int     $offset     ¸¡º÷·ë²Ì¼èÆÀ¥ª¥Õ¥»¥Ã¥È
-     *  @param  int     $count      ¸¡º÷·ë²Ì¼èÆÀ¿ô
-     *  @return mixed   array(0 => ¸¡º÷¾ò·ï¤Ë¥Þ¥Ã¥Á¤·¤¿·ï¿ô,
-     *                        1 => $offset, $count¤Ë¤è¤ê»ØÄꤵ¤ì¤¿·ï¿ô¤Î¥×¥í¥Ñ¥Æ¥£°ìÍ÷)
-     *                  Ethna_Error:¥¨¥é¡¼
-     */
-    function getObjectPropList($class, $keys = null, $filter = null,
-                               $order = null, $offset = null, $count = null)
-    {
-        global $_ETHNA_APP_MANAGER_OPL_CACHE;
-
-        $prop_list = array();
-        $class_name = sprintf("%s_%s", $this->backend->getAppId(), $class);
-
-        // ¥­¥ã¥Ã¥·¥å¥Á¥§¥Ã¥¯
-        $cache_class = strtolower($class_name);
-        if (is_array($_ETHNA_APP_MANAGER_OPL_CACHE) == false
-            || array_key_exists($cache_class, $_ETHNA_APP_MANAGER_OPL_CACHE) == false) {
-            $_ETHNA_APP_MANAGER_OPL_CACHE[$cache_class] = array();
-        }
-        $cache_key = serialize(array($filter, $order, $offset, $count));
-        if (array_key_exists($cache_key, $_ETHNA_APP_MANAGER_OPL_CACHE[$cache_class])) {
-            // skip
-        } else {
-            // ¥­¥ã¥Ã¥·¥å¹¹¿·
-            $tmp =& new $class_name($this->backend);
-            $_ETHNA_APP_MANAGER_OPL_CACHE[$cache_class][$cache_key]
-                = $tmp->searchProp($keys, $filter, $order, $offset, $count);
-        }
-
-        return $_ETHNA_APP_MANAGER_OPL_CACHE[$cache_class][$cache_key];
-    }
-
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¥×¥í¥Ñ¥Æ¥£¤òÊÖ¤¹
-     *
-     *  getObjectPropList()¥á¥½¥Ã¥É¤Î´Ê°×ÈǤǡ¢$filter¤Ë¤è¤ê·ë²Ì¤¬1¥¨¥ó¥È¥ê¤Ë
-     *  À©¸Â¤µ¤ì¤ë¾ì¹ç(¥×¥é¥¤¥Þ¥ê¥­¡¼¤Ç¤Î¸¡º÷Åù)¤ËÍøÍѤ¹¤ë
-     *
-     *  @access public
-     *  @param  string  $class      Ethna_AppObject¤Î·Ñ¾µ¥¯¥é¥¹Ì¾
-     *  @param  array   $keys       ¼èÆÀ¤¹¤ë¥×¥í¥Ñ¥Æ¥£°ìÍ÷
-     *  @param  array   $filter     ¸¡º÷¾ò·ï
-     *  @return mixed   array:¥×¥í¥Ñ¥Æ¥£°ìÍ÷ null:¥¨¥ó¥È¥ê¤Ê¤· Ethna_Error:¥¨¥é¡¼
-     */
-    function getObjectProp($class, $keys = null, $filter = null)
-    {
-        global $_ETHNA_APP_MANAGER_OP_CACHE;
-
-        $prop_list = array();
-        $class_name = sprintf("%s_%s", $this->backend->getAppId(), $class);
-
-        // ¥­¥ã¥Ã¥·¥å¥Á¥§¥Ã¥¯
-        $cache_class = strtolower($class_name);
-        if (is_array($_ETHNA_APP_MANAGER_OP_CACHE) == false
-            || array_key_exists($cache_class, $_ETHNA_APP_MANAGER_OP_CACHE) == false) {
-            $_ETHNA_APP_MANAGER_OP_CACHE[$cache_class] = array();
-        }
-        $cache_key = serialize(array($filter));
-        if (array_key_exists($cache_key, $_ETHNA_APP_MANAGER_OP_CACHE[$cache_class])) {
-            // skip
-        } else {
-            // ¥­¥ã¥Ã¥·¥å¹¹¿·
-            $tmp =& new $class_name($this->backend);
-            list(, $prop) = $tmp->searchProp($keys, $filter);
-            $_ETHNA_APP_MANAGER_OP_CACHE[$cache_class][$cache_key]
-                = count($prop) > 0 ? $prop[0] : null;
-        }
-
-        return $_ETHNA_APP_MANAGER_OP_CACHE[$cache_class][$cache_key];
-    }
-}
-// }}}
-?>
diff --git a/class/Ethna_AppObject.php b/class/Ethna_AppObject.php
deleted file mode 100644 (file)
index 1c02c6f..0000000
+++ /dev/null
@@ -1,1596 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_AppObject.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_AppObject
-/**
- *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¤Î¥Ù¡¼¥¹¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- *  @todo       Ê£¿ô¥Æ¡¼¥Ö¥ë¤ÎÂбþ
- */
-class Ethna_AppObject
-{
-    // {{{ properties
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    object  Ethna_Backend       backend¥ª¥Ö¥¸¥§¥¯¥È */
-    var $backend;
-
-    /** @var    object  Ethna_Config        ÀßÄꥪ¥Ö¥¸¥§¥¯¥È */
-    var $config;
-
-    /** @var    object  Ethna_I18N          i18n¥ª¥Ö¥¸¥§¥¯¥È */
-    var $i18n;
-
-    /** @var    object  Ethna_ActionForm    ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È */
-    var $action_form;
-
-    /** @var    object  Ethna_ActionForm    ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È(¾Êά·Á) */
-    var $af;
-
-    /** @var    object  Ethna_Session       ¥»¥Ã¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È */
-    var $session;
-
-    /** @var    string  DBÄêµÁ¥×¥ì¥Õ¥£¥¯¥¹ */
-    var $db_prefix = null;
-
-    /** @var    array   ¥Æ¡¼¥Ö¥ëÄêµÁ */
-    var $table_def = null;
-
-    /** @var    array   ¥×¥í¥Ñ¥Æ¥£ÄêµÁ */
-    var $prop_def = null;
-
-    /** @var    array   ¥×¥í¥Ñ¥Æ¥£ */
-    var $prop = null;
-
-    /** @var    array   ¥×¥í¥Ñ¥Æ¥£(¥Ð¥Ã¥¯¥¢¥Ã¥×) */
-    var $prop_backup = null;
-
-    /** @var    int     ¥×¥í¥Ñ¥Æ¥£ÄêµÁ¥­¥ã¥Ã¥·¥åÍ­¸ú´ü´Ö(sec) */
-    var $prop_def_cache_lifetime = 86400;
-
-    /** @var    array   ¥×¥é¥¤¥Þ¥ê¥­¡¼ÄêµÁ */
-    var $id_def = null;
-
-    /** @var    int     ¥ª¥Ö¥¸¥§¥¯¥ÈID */
-    var $id = null;
-
-    /**#@-*/
-    // }}}
-
-    // {{{ Ethna_AppObject
-    /**
-     *  Ethna_AppObject¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Backend   &$backend   Ethna_Backend¥ª¥Ö¥¸¥§¥¯¥È
-     *  @param  mixed   $key_type   ¸¡º÷¥­¡¼Ì¾
-     *  @param  mixed   $key        ¸¡º÷¥­¡¼
-     *  @param  array   $prop       ¥×¥í¥Ñ¥Æ¥£°ìÍ÷
-     *  @return mixed   0:Àµ¾ï½ªÎ» -1:¥­¡¼/¥×¥í¥Ñ¥Æ¥£Ì¤»ØÄê Ethna_Error:¥¨¥é¡¼
-     */
-    function Ethna_AppObject(&$backend, $key_type = null, $key = null, $prop = null)
-    {
-        $this->backend =& $backend;
-        $this->config =& $backend->getConfig();
-        $this->action_form =& $backend->getActionForm();
-        $this->af =& $this->action_form;
-        $this->session =& $backend->getSession();
-        $ctl =& $backend->getController();
-
-        // DB¥ª¥Ö¥¸¥§¥¯¥È¤ÎÀßÄê
-        $db_list = $this->_getDBList();
-        if (Ethna::isError($db_list)) {
-            return $db_list;
-        } else if (is_null($db_list['rw'])) {
-            return Ethna::raiseError(
-                "Ethna_AppObject¤òÍøÍѤ¹¤ë¤Ë¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹ÀßÄ꤬ɬÍפǤ¹",
-                E_DB_NODSN);
-        }
-        $this->my_db_rw =& $db_list['rw'];
-        $this->my_db_ro =& $db_list['ro'];
-        // XXX: app obj¤Ïdb type¤òÃΤé¤Ê¤¯¤Æ¤âÆ°¤¯¤Ù¤­
-        $this->my_db_type = $this->my_db_rw->getType();
-
-        // ¥×¥í¥Ñ¥Æ¥£ÄêµÁ¼«Æ°¼èÆÀ
-        if (is_null($this->table_def)) {
-            $this->table_def = $this->_getTableDef();
-        }
-        if (is_string($this->table_def)) {
-            $this->table_def = array($this->table_def => array('primary' => true));
-        }
-        if (is_null($this->prop_def)) {
-            $this->prop_def = $this->_getPropDef();
-        }
-
-        // ¥×¥í¥Ñ¥Æ¥£ÄêµÁ¤Îɬ¿Ü¥­¡¼¤òÊä´°
-        foreach (array_keys($this->prop_def) as $k) {
-            if (isset($this->prop_def[$k]['primary']) == false) {
-                $this->prop_def[$k]['primary'] = false;
-            }
-        }
-
-        // ¥ª¥Ö¥¸¥§¥¯¥È¤Î¥×¥é¥¤¥Þ¥ê¥­¡¼ÄêµÁ¹½ÃÛ
-        foreach ($this->prop_def as $k => $v) {
-            if ($v['primary'] == false) {
-                continue;
-            }
-            if (is_null($this->id_def)) {
-                $this->id_def = $k;
-            } else if (is_array($this->id_def)) {
-                $this->id_def[] = $k;
-            } else {
-                $this->id_def = array($this->id_def, $k);
-            }
-        }
-        
-        // ¥­¡¼ÂÅÅöÀ­¥Á¥§¥Ã¥¯
-        if (is_null($key_type) && is_null($key) && is_null($prop)) {
-            // perhaps for adding object
-            return 0;
-        }
-
-        // ¥×¥í¥Ñ¥Æ¥£ÀßÄê
-        if (is_null($prop)) {
-            $this->_setPropByDB($key_type, $key);
-        } else {
-            $this->_setPropByValue($prop);
-        }
-
-        $this->prop_backup = $this->prop;
-
-        if (is_array($this->id_def)) {
-            $this->id = array();
-            foreach ($this->id_def as $k) {
-                $this->id[] = $this->prop[$k];
-            }
-        } else {
-            $this->id = $this->prop[$this->id_def];
-        }
-
-        return 0;
-    }
-    // }}}
-
-    // {{{ isValid
-    /**
-     *  Í­¸ú¤Ê¥ª¥Ö¥¸¥§¥¯¥È¤«¤É¤¦¤«¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @return bool    true:Í­¸ú false:̵¸ú
-     */
-    function isValid()
-    {
-        if (is_array($this->id)) {
-            return is_null($this->id[0]) ? false : true;
-        } else {
-            return is_null($this->id) ? false : true;
-        }
-    }
-    // }}}
-
-    // {{{ isActive
-    /**
-     *  ¥¢¥¯¥Æ¥£¥Ö¤Ê¥ª¥Ö¥¸¥§¥¯¥È¤«¤É¤¦¤«¤òÊÖ¤¹
-     *
-     *  isValid()¥á¥½¥Ã¥É¤Ï¥ª¥Ö¥¸¥§¥¯¥È¼«ÂΤ¬Í­¸ú¤«¤É¤¦¤«¤òȽÄꤹ¤ë¤Î¤ËÂФ·
-     *  isActive()¤Ï¥ª¥Ö¥¸¥§¥¯¥È¤¬¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤È¤·¤ÆÍ­¸ú¤«¤É¤¦¤«¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @return bool    true:¥¢¥¯¥Æ¥£¥Ö false:Èó¥¢¥¯¥Æ¥£¥Ö
-     */
-    function isActive()
-    {
-        if ($this->isValid() == false) {
-            return false;
-        }
-        return $this->prop['state'] == OBJECT_STATE_ACTIVE ? true : false;
-    }
-    // }}}
-
-    // {{{ getDef
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¤Î¥×¥í¥Ñ¥Æ¥£ÄêµÁ¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @return array   ¥ª¥Ö¥¸¥§¥¯¥È¤Î¥×¥í¥Ñ¥Æ¥£ÄêµÁ
-     */
-    function getDef()
-    {
-        return $this->prop_def;
-    }
-    // }}}
-
-    // {{{ getIdDef
-    /**
-     *  ¥×¥é¥¤¥Þ¥ê¥­¡¼ÄêµÁ¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @return mixed   ¥×¥é¥¤¥Þ¥ê¥­¡¼¤È¤Ê¤ë¥×¥í¥Ñ¥Æ¥£Ì¾
-     */
-    function getIdDef()
-    {
-        return $this->id_def;
-    }
-    // }}}
-
-    // {{{ getId
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥ÈID¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @return mixed   ¥ª¥Ö¥¸¥§¥¯¥ÈID
-     */
-    function getId()
-    {
-        return $this->id;
-    }
-    // }}}
-
-    // {{{ get
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¥×¥í¥Ñ¥Æ¥£¤Ø¤Î¥¢¥¯¥»¥µ(R)
-     *
-     *  @access public
-     *  @param  string  $key    ¥×¥í¥Ñ¥Æ¥£Ì¾
-     *  @return mixed   ¥×¥í¥Ñ¥Æ¥£
-     */
-    function get($key)
-    {
-        if (isset($this->prop_def[$key]) == false) {
-            trigger_error(sprintf("Unknown property [%s]", $key), E_USER_ERROR);
-            return null;
-        }
-        if (isset($this->prop[$key])) {
-            return $this->prop[$key];
-        }
-        return null;
-    }
-    // }}}
-
-    // {{{ getName
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¥×¥í¥Ñ¥Æ¥£É½¼¨Ì¾¤Ø¤Î¥¢¥¯¥»¥µ
-     *
-     *  @access public
-     *  @param  string  $key    ¥×¥í¥Ñ¥Æ¥£Ì¾
-     *  @return string  ¥×¥í¥Ñ¥Æ¥£¤Îɽ¼¨Ì¾
-     */
-    function getName($key)
-    {
-        return $this->get($key);
-    }
-    // }}}
-
-    // {{{ getLongName
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¥×¥í¥Ñ¥Æ¥£É½¼¨Ì¾(¾ÜºÙ)¤Ø¤Î¥¢¥¯¥»¥µ
-     *
-     *  @access public
-     *  @param  string  $key    ¥×¥í¥Ñ¥Æ¥£Ì¾
-     *  @return string  ¥×¥í¥Ñ¥Æ¥£¤Îɽ¼¨Ì¾(¾ÜºÙ)
-     */
-    function getLongName($key)
-    {
-        return $this->get($key);
-    }
-    // }}}
-
-    // {{{ getNameObject
-    /**
-     *  ¥×¥í¥Ñ¥Æ¥£É½¼¨Ì¾¤ò³ÊǼ¤·¤¿Ï¢ÁÛÇÛÎó¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return array   ¥×¥í¥Ñ¥Æ¥£É½¼¨Ì¾¤ò³ÊǼ¤·¤¿Ï¢ÁÛÇÛÎó
-     */
-    function getNameObject()
-    {
-        $object = array();
-
-        foreach ($this->prop_def as $key => $elt) {
-            $object[$elt['form_name']] = $this->getName($key);
-        }
-
-        return $object;
-    }
-    // }}}
-
-    // {{{ set
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¥×¥í¥Ñ¥Æ¥£¤Ø¤Î¥¢¥¯¥»¥µ(W)
-     *
-     *  @access public
-     *  @param  string  $key    ¥×¥í¥Ñ¥Æ¥£Ì¾
-     *  @param  string  $value  ¥×¥í¥Ñ¥Æ¥£ÃÍ
-     */
-    function set($key, $value)
-    {
-        if (isset($this->prop_def[$key]) == false) {
-            trigger_error(sprintf("Unknown property [%s]", $key), E_USER_ERROR);
-            return null;
-        }
-        $this->prop[$key] = $value;
-    }
-    // }}}
-
-    // {{{ dump
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¥×¥í¥Ñ¥Æ¥£¤ò»ØÄê¤Î·Á¼°¤Ç¥À¥ó¥×¤¹¤ë(¸½ºß¤ÏCSV·Á¼°¤Î¤ß¥µ¥Ý¡¼¥È)
-     *
-     *  @access public
-     *  @param  string  $type   ¥À¥ó¥×·Á¼°("csv"...)
-     *  @return string  ¥À¥ó¥×·ë²Ì(¥¨¥é¡¼¤Î¾ì¹ç¤Ïnull)
-     */
-    function dump($type = "csv")
-    {
-        $method = "_dump_$type";
-        if (method_exists($this, $method) == false) {
-            return Ethna::raiseError("¥á¥½¥Ã¥É̤ÄêµÁ[%s]", E_APP_NOMETHOD, $method);
-        }
-
-        return $this->$method();
-    }
-    // }}}
-
-    // {{{ importForm
-    /**
-     *  ¥Õ¥©¡¼¥àÃͤ«¤é¥ª¥Ö¥¸¥§¥¯¥È¥×¥í¥Ñ¥Æ¥£¤ò¥¤¥ó¥Ý¡¼¥È¤¹¤ë
-     *
-     *  @access public
-     *  @param  int     $option ¥¤¥ó¥Ý¡¼¥È¥ª¥×¥·¥ç¥ó(OBJECT_IMPORT_IGNORE_NULL,...)
-     */
-    function importForm($option = null)
-    {
-        foreach ($this->getDef() as $k => $def) {
-            $value = $this->af->get($def['form_name']);
-            if (is_null($value)) {
-                // ¥Õ¥©¡¼¥à¤«¤éÃͤ¬Á÷¿®¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Î¿¶Éñ¤¤
-                if ($option == OBJECT_IMPORT_IGNORE_NULL) {
-                    // null¤Ï¥¹¥­¥Ã¥×
-                    continue;
-                } else if ($option == OBJECT_IMPORT_CONVERT_NULL) {
-                    // ¶õʸ»úÎó¤ËÊÑ´¹
-                    $value = '';
-                }
-            }
-            $this->set($k, $value);
-        }
-    }
-    // }}}
-
-    // {{{ exportForm
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¥×¥í¥Ñ¥Æ¥£¤ò¥Õ¥©¡¼¥àÃͤ˥¨¥¯¥¹¥Ý¡¼¥È¤¹¤ë
-     *
-     *  @access public
-     */
-    function exportForm()
-    {
-        foreach ($this->getDef() as $k => $def) {
-            $this->af->set($def['form_name'], $this->get($k));
-        }
-    }
-    // }}}
-
-    // {{{ add
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¤òÄɲ乤ë
-     *
-     *  @access public
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function add()
-    {
-        // next id¤Î¼èÆÀ: (pgsql¤Î¾ì¹ç¤Î¤ß)
-        // ¼èÆÀ¤Ç¤­¤¿¾ì¹ç¤Ï¤³¤Îid¤ò»È¤¦
-        foreach (to_array($this->id_def) as $id_def) {
-            if (isset($this->prop_def[$id_def]['seq'])
-                && $this->prop_def[$id_def]['seq']) {
-                // NOTE: ¤³¤Îapp object°Ê³°¤«¤éinsert¤¬¤Ê¤¤¤³¤È¤¬Á°Äó
-                $next_id = $this->my_db_rw->getNextId(
-                    $this->prop_def[$id_def]['table'], $id_def);
-                if ($next_id !== null && $next_id >= 0) {
-                    $this->prop[$id_def] = $next_id;
-                }
-                break;
-            }
-        }
-
-        $sql = $this->_getSQL_Add();
-        for ($i = 0; $i < 4; $i++) {
-            $r =& $this->my_db_rw->query($sql);
-            if (Ethna::isError($r)) {
-                if ($r->getCode() == E_DB_DUPENT) {
-                    // ½ÅÊ£¥¨¥é¡¼¥­¡¼¤ÎȽÊÌ
-                    $duplicate_key_list = $this->_getDuplicateKeyList();
-                    if (Ethna::isError($duplicate_key_list)) {
-                        return $duplicate_key_list;
-                    }
-                    if (is_array($duplicate_key_list)
-                        && count($duplicate_key_list) > 0) {
-                        foreach ($duplicate_key_list as $k) {
-                            return Ethna::raiseNotice('½ÅÊ£¥¨¥é¡¼[%s]',
-                                                      E_APP_DUPENT, $k);
-                        }
-                    }
-                } else {
-                    return $r;
-                }
-            } else {
-                break;
-            }
-        }
-        if ($i == 4) {
-            // cannot be reached
-            return Ethna::raiseError('½ÅÊ£¥¨¥é¡¼¥­¡¼È½ÊÌ¥¨¥é¡¼', E_GENERAL);
-        }
-
-        // last insert id¤Î¼èÆÀ: (mysql, sqlite¤Î¤ß)
-        // primary key ¤Î 'seq' ¥Õ¥é¥°¤¬¤¢¤ë(ºÇ½é¤Î)¥×¥í¥Ñ¥Æ¥£¤ËÆþ¤ì¤ë
-        $insert_id = $this->my_db_rw->getInsertId(); 
-        if ($insert_id !== null && $insert_id >= 0) {
-            foreach (to_array($this->id_def) as $id_def) {
-                if (isset($this->prop_def[$id_def]['seq'])
-                    && $this->prop_def[$id_def]['seq']) {
-                    $this->prop[$id_def] = $insert_id;
-                    break;
-                }
-            }
-        }
-
-        // ID¤ÎÀßÄê
-        if (is_array($this->id_def)) {
-            $this->id = array();
-            foreach ($this->id_def as $k) {
-                $this->id[] = $this->prop[$k];
-            }
-        } else if (isset($this->prop[$this->id_def])) {
-            $this->id = $this->prop[$this->id_def];
-        } else {
-            trigger_error("primary key is missing", E_USER_ERROR);
-        }
-
-        // ¥Ð¥Ã¥¯¥¢¥Ã¥×/¥­¥ã¥Ã¥·¥å¹¹¿·
-        $this->prop_backup = $this->prop;
-        $this->_clearPropCache();
-
-        return 0;
-    }
-    // }}}
-
-    // {{{ update
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¤ò¹¹¿·¤¹¤ë
-     *
-     *  @access public
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function update()
-    {
-        $sql = $this->_getSQL_Update();
-        for ($i = 0; $i < 4; $i++) {
-            $r =& $this->my_db_rw->query($sql);
-            if (Ethna::isError($r)) {
-                if ($r->getCode() == E_DB_DUPENT) {
-                    // ½ÅÊ£¥¨¥é¡¼¥­¡¼¤ÎȽÊÌ
-                    $duplicate_key_list = $this->_getDuplicateKeyList();
-                    if (Ethna::isError($duplicate_key_list)) {
-                        return $duplicate_key_list;
-                    }
-                    if (is_array($duplicate_key_list)
-                        && count($duplicate_key_list) > 0) {
-                        foreach ($duplicate_key_list as $k) {
-                            return Ethna::raiseNotice('½ÅÊ£¥¨¥é¡¼[%s]',
-                                                      E_APP_DUPENT, $k);
-                        }
-                    }
-                } else {
-                    return $r;
-                }
-            } else {
-                break;
-            }
-        }
-        if ($i == 4) {
-            // cannot be reached
-            return Ethna::raiseError('½ÅÊ£¥¨¥é¡¼¥­¡¼È½ÊÌ¥¨¥é¡¼', E_GENERAL);
-        }
-
-        $affected_rows = $this->my_db_rw->affectedRows();
-        if ($affected_rows <= 0) {
-            $this->backend->log(LOG_DEBUG, "update query with 0 updated rows");
-        }
-
-        // ¥Ð¥Ã¥¯¥¢¥Ã¥×/¥­¥ã¥Ã¥·¥å¹¹¿·
-        $this->prop_backup = $this->prop;
-        $this->_clearPropCache();
-
-        return 0;
-    }
-    // }}}
-
-    // {{{ replace
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¤òÃÖ´¹¤¹¤ë
-     *
-     *  MySQL¤ÎREPLACEʸ¤ËÁêÅö¤¹¤ëÆ°ºî¤ò¹Ô¤¦(add()¤Ç½ÅÊ£¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤é
-     *  update()¤ò¹Ô¤¦)
-     *
-     *  @access public
-     *  @return mixed   0:Àµ¾ï½ªÎ» >0:¥ª¥Ö¥¸¥§¥¯¥ÈID(Äɲûþ) Ethna_Error:¥¨¥é¡¼
-     */
-    function replace()
-    {
-        $sql = $this->_getSQL_Select($this->getIdDef(), $this->getId());
-
-        for ($i = 0; $i < 3; $i++) {
-            $r = $this->my_db_rw->query($sql);
-            if (Ethna::isError($r)) {
-                return $r;
-            }
-            $n = $r->numRows();
-
-            if ($n > 0) {
-                $r = $this->update();
-                return $r;
-            } else {
-                $r = $this->add();
-                if (Ethna::isError($r) == false) {
-                    return $r;
-                } else if ($r->getCode() != E_APP_DUPENT) {
-                    return $r;
-                }
-            }
-        }
-        
-        return $r;
-    }
-    // }}}
-
-    // {{{ remove
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¤òºï½ü¤¹¤ë
-     *
-     *  @access public
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function remove()
-    {
-        $sql = $this->_getSQL_Remove();
-        $r =& $this->my_db_rw->query($sql);
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-
-        // ¥×¥í¥Ñ¥Æ¥£/¥Ð¥Ã¥¯¥¢¥Ã¥×/¥­¥ã¥Ã¥·¥å¥¯¥ê¥¢
-        $this->id = $this->prop = $this->prop_backup = null;
-        $this->_clearPropCache();
-
-        return 0;
-    }
-    // }}}
-
-    // {{{ searchId
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥ÈID¤ò¸¡º÷¤¹¤ë
-     *
-     *  @access public
-     *  @param  array   $filter     ¸¡º÷¾ò·ï
-     *  @param  array   $order      ¸¡º÷·ë²Ì¥½¡¼¥È¾ò·ï
-     *  @param  int     $offset     ¸¡º÷·ë²Ì¼èÆÀ¥ª¥Õ¥»¥Ã¥È
-     *  @param  int     $count      ¸¡º÷·ë²Ì¼èÆÀ¿ô
-     *  @return mixed   array(0 => ¸¡º÷¾ò·ï¤Ë¥Þ¥Ã¥Á¤·¤¿·ï¿ô,
-     *                  1 => $offset, $count¤Ë¤è¤ê»ØÄꤵ¤ì¤¿·ï¿ô¤Î¥ª¥Ö¥¸¥§¥¯¥ÈID°ìÍ÷)
-     *                  Ethna_Error:¥¨¥é¡¼
-     */
-    function searchId($filter = null, $order = null, $offset = null, $count = null)
-    {
-        if (is_null($offset) == false || is_null($count) == false) {
-            $sql = $this->_getSQL_SearchLength($filter);
-            $r =& $this->my_db_ro->query($sql);
-            if (Ethna::isError($r)) {
-                return $r;
-            }
-            $row = $this->my_db_ro->fetchRow($r, DB_FETCHMODE_ASSOC);
-            $length = $row['id_count'];
-        } else {
-            $length = null;
-        }
-
-        $id_list = array();
-        $sql = $this->_getSQL_SearchId($filter, $order, $offset, $count);
-        $r =& $this->my_db_ro->query($sql);
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-        $n = $r->numRows();
-        for ($i = 0; $i < $n; $i++) {
-            $row = $this->my_db_ro->fetchRow($r, DB_FETCHMODE_ASSOC);
-
-            // ¥×¥é¥¤¥Þ¥ê¥­¡¼¤¬1¥«¥é¥à¤Ê¤é¥¹¥«¥é¡¼ÃͤËÊÑ´¹
-            if (is_array($this->id_def) == false) {
-                $row = $row[$this->id_def];
-            }
-            $id_list[] = $row;
-        }
-        if (is_null($length)) {
-            $length = count($id_list);
-        }
-
-        return array($length, $id_list);
-    }
-    // }}}
-
-    // {{{ searchProp
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¥×¥í¥Ñ¥Æ¥£¤ò¸¡º÷¤¹¤ë
-     *
-     *  @access public
-     *  @param  array   $keys       ¼èÆÀ¤¹¤ë¥×¥í¥Ñ¥Æ¥£
-     *  @param  array   $filter     ¸¡º÷¾ò·ï
-     *  @param  array   $order      ¸¡º÷·ë²Ì¥½¡¼¥È¾ò·ï
-     *  @param  int     $offset     ¸¡º÷·ë²Ì¼èÆÀ¥ª¥Õ¥»¥Ã¥È
-     *  @param  int     $count      ¸¡º÷·ë²Ì¼èÆÀ¿ô
-     *  @return mixed   array(0 => ¸¡º÷¾ò·ï¤Ë¥Þ¥Ã¥Á¤·¤¿·ï¿ô,
-     *                  1 => $offset, $count¤Ë¤è¤ê»ØÄꤵ¤ì¤¿·ï¿ô¤Î¥ª¥Ö¥¸¥§¥¯¥È¥×¥í¥Ñ¥Æ¥£°ìÍ÷)
-     *                  Ethna_Error:¥¨¥é¡¼
-     */
-    function searchProp($keys = null, $filter = null, $order = null,
-                        $offset = null, $count = null)
-    {
-        if (is_null($offset) == false || is_null($count) == false) {
-            $sql = $this->_getSQL_SearchLength($filter);
-            $r =& $this->my_db_ro->query($sql);
-            if (Ethna::isError($r)) {
-                return $r;
-            }
-            $row = $this->my_db_ro->fetchRow($r, DB_FETCHMODE_ASSOC);
-            $length = $row['id_count'];
-        } else {
-            $length = null;
-        }
-
-        $prop_list = array();
-        $sql = $this->_getSQL_SearchProp($keys, $filter, $order, $offset, $count);
-        $r =& $this->my_db_ro->query($sql);
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-        $n = $r->numRows();
-        for ($i = 0; $i < $n; $i++) {
-            $row = $this->my_db_ro->fetchRow($r, DB_FETCHMODE_ASSOC);
-            $prop_list[] = $row;
-        }
-        if (is_null($length)) {
-            $length = count($prop_list);
-        }
-
-        return array($length, $prop_list);
-    }
-    // }}}
-
-    // {{{ _setDefault
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Ç¥Õ¥©¥ë¥È¥×¥í¥Ñ¥Æ¥£¤òÀßÄꤹ¤ë
-     *
-     *  ¥³¥ó¥¹¥È¥é¥¯¥¿¤Ë¤è¤ê»ØÄꤵ¤ì¤¿¥­¡¼¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤¬¤Ê¤«¤Ã¤¿¾ì¹ç¤Î
-     *  ¥Ç¥Õ¥©¥ë¥È¥×¥í¥Ñ¥Æ¥£¤ò¤³¤³¤ÇÀßÄꤹ¤ë¤³¤È¤¬½ÐÍè¤ë
-     *
-     *  @access protected
-     *  @param  mixed   $key_type   ¸¡º÷¥­¡¼Ì¾
-     *  @param  mixed   $key        ¸¡º÷¥­¡¼
-     *  @return int     0:Àµ¾ï½ªÎ»
-     */
-    function _setDefault($key_type, $key)
-    {
-        return 0;
-    }
-    // }}}
-
-    // {{{ _setPropByDB
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¥×¥í¥Ñ¥Æ¥£¤òDB¤«¤é¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @param  mixed   $key_type   ¸¡º÷¥­¡¼Ì¾
-     *  @param  mixed   $key        ¸¡º÷¥­¡¼
-     */
-    function _setPropByDB($key_type, $key)
-    {
-        global $_ETHNA_APP_OBJECT_CACHE;
-
-        $key_type = to_array($key_type);
-        $key = to_array($key);
-        if (count($key_type) != count($key)) {
-            trigger_error(sprintf("Unmatched key_type & key length [%d-%d]",
-                          count($key_type), count($key)), E_USER_ERROR);
-            return;
-        }
-        foreach ($key_type as $elt) {
-            if (isset($this->prop_def[$elt]) == false) {
-                trigger_error("Invalid key_type [$elt]", E_USER_ERROR);
-                return;
-            }
-        }
-
-        // ¥­¥ã¥Ã¥·¥å¥Á¥§¥Ã¥¯
-        $class_name = strtolower(get_class($this));
-        if (is_array($_ETHNA_APP_OBJECT_CACHE) == false
-            || array_key_exists($class_name, $_ETHNA_APP_OBJECT_CACHE) == false) {
-            $_ETHNA_APP_OBJECT_CACHE[$class_name] = array();
-        }
-        $cache_key = serialize(array($key_type, $key));
-        if (array_key_exists($cache_key, $_ETHNA_APP_OBJECT_CACHE[$class_name])) {
-            $this->prop = $_ETHNA_APP_OBJECT_CACHE[$class_name][$cache_key];
-            return;
-        }
-
-        // SQLʸ¹½ÃÛ
-        $sql = $this->_getSQL_Select($key_type, $key);
-
-        // ¥×¥í¥Ñ¥Æ¥£¼èÆÀ
-        $r =& $this->my_db_ro->query($sql);
-        if (Ethna::isError($r)) {
-            return;
-        }
-        $n = $r->numRows();
-        if ($n == 0) {
-            // try default
-            if ($this->_setDefault($key_type, $key) == false) {
-                // nop
-            }
-            return;
-        } else if ($n > 1) {
-            trigger_error("Invalid key (multiple rows found) [$key]", E_USER_ERROR);
-            return;
-        }
-        $this->prop = $this->my_db_ro->fetchRow($r, DB_FETCHMODE_ASSOC);
-
-        // ¥­¥ã¥Ã¥·¥å¥¢¥Ã¥×¥Ç¡¼¥È
-        $_ETHNA_APP_OBJECT_CACHE[$class_name][$cache_key] = $this->prop;
-    }
-    // }}}
-
-    // {{{ _setPropByValue
-    /**
-     *  ¥³¥ó¥¹¥È¥é¥¯¥¿¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥Ñ¥Æ¥£¤òÀßÄꤹ¤ë
-     *
-     *  @access private
-     *  @param  array   $prop   ¥×¥í¥Ñ¥Æ¥£°ìÍ÷
-     */
-    function _setPropByValue($prop)
-    {
-        $def = $this->getDef();
-        foreach ($def as $key => $value) {
-            if ($value['primary'] && isset($prop[$key]) == false) {
-                // ¥×¥é¥¤¥Þ¥ê¥­¡¼¤Ï¾ÊάÉÔ²Ä
-                trigger_error("primary key is not identical", E_USER_ERROR);
-            }
-            $this->prop[$key] = $prop[$key];
-        }
-    }
-    // }}}
-
-    // {{{ _getPrimaryTable
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¤Î¥×¥é¥¤¥Þ¥ê¥Æ¡¼¥Ö¥ë¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @return string  ¥ª¥Ö¥¸¥§¥¯¥È¤Î¥×¥é¥¤¥Þ¥ê¥Æ¡¼¥Ö¥ë̾
-     */
-    function _getPrimaryTable()
-    {
-        $tables = array_keys($this->table_def);
-        $table = $tables[0];
-        
-        return $table;
-    }
-    // }}}
-
-    // {{{ _getDuplicateKeyList
-    /**
-     *  ½ÅÊ£¥­¡¼¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @return mixed   0:½ÅÊ£¤Ê¤· Ethna_Error:¥¨¥é¡¼ array:½ÅÊ£¥­¡¼¤Î¥×¥í¥Ñ¥Æ¥£Ì¾°ìÍ÷
-     */
-    function _getDuplicateKeyList()
-    {
-        $duplicate_key_list = array();
-
-        // ¸½ºßÀßÄꤵ¤ì¤Æ¤¤¤ë¥×¥é¥¤¥Þ¥ê¥­¡¼¤ËNULL¤¬´Þ¤Þ¤ì¤ë¾ì¹ç¤Ï¸¡º÷¤·¤Ê¤¤
-        $check_pkey = true;
-        foreach (to_array($this->id_def) as $k) {
-            if (isset($this->prop[$k]) == false || is_null($this->prop[$k])) {
-                $check_pkey = false;
-                break;
-            }
-        }
-
-        // ¥×¥é¥¤¥Þ¥ê¥­¡¼¤Ïmulti columns¤Ë¤Ê¤êÆÀ¤ë¤Î¤ÇÊÌ°·¤¤
-        if ($check_pkey) {
-            $sql = $this->_getSQL_Duplicate($this->id_def);
-            $r =& $this->my_db_rw->query($sql);
-            if (Ethna::isError($r)) {
-                return $r;
-            } else if ($r->numRows() > 0) {
-                // we can overwrite $key_list here
-                $duplicate_key_list = to_array($this->id_def);
-            }
-        }
-
-        // ¥æ¥Ë¡¼¥¯¥­¡¼
-        foreach ($this->prop_def as $k => $v) {
-            if ($v['primary'] == true || $v['key'] == false) {
-                continue;
-            }
-            $sql = $this->_getSQL_Duplicate($k);
-            $r =& $this->my_db_rw->query($sql);
-            if (Ethna::isError($r)) {
-                return $r;
-            } else if ($r->NumRows() > 0) {
-                $duplicate_key_list[] = $k;
-            }
-        }
-
-        if (count($duplicate_key_list) > 0) {
-            return $duplicate_key_list;
-        } else {
-            return 0;
-        }
-    }
-    // }}}
-
-    // {{{ _getSQL_Select
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¥×¥í¥Ñ¥Æ¥£¤ò¼èÆÀ¤¹¤ëSQLʸ¤ò¹½ÃÛ¤¹¤ë
-     *
-     *  @access private
-     *  @param  array   $key_type   ¥­¡¼¤È¤Ê¤ë¥×¥í¥Ñ¥Æ¥£Ì¾°ìÍ÷
-     *  @param  array   $key        $key_type¤ËÂбþ¤¹¤ë¥­¡¼°ìÍ÷
-     *  @return string  SELECTʸ
-     */
-    function _getSQL_Select($key_type, $key)
-    {
-        $key_type = to_array($key_type);
-        if (is_null($key)) {
-            // add()Á°
-            $key = array();
-            for ($i = 0; $i < count($key_type); $i++) {
-                $key[$i] = null;
-            }
-        } else {
-            $key = to_array($key);
-        }
-
-        // SQL¥¨¥¹¥±¡¼¥×
-        Ethna_AppSQL::escapeSQL($key, $this->my_db_type);
-
-        $tables = implode(',',
-            $this->my_db_ro->quoteIdentifier(array_keys($this->table_def)));
-        $columns = implode(',',
-            $this->my_db_ro->quoteIdentifier(array_keys($this->prop_def)));
-
-        // ¸¡º÷¾ò·ï
-        $condition = null;
-        for ($i = 0; $i < count($key_type); $i++) {
-            if (is_null($condition)) {
-                $condition = "WHERE ";
-            } else {
-                $condition .= " AND ";
-            }
-            $condition .= Ethna_AppSQL::getCondition(
-                $this->my_db_ro->quoteIdentifier($key_type[$i]), $key[$i]);
-        }
-
-        $sql = "SELECT $columns FROM $tables $condition";
-
-        return $sql;
-    }
-    // }}}
-
-    // {{{ _getSQL_Add
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¤ÈÄɲ乤ëSQLʸ¤ò¹½ÃÛ¤¹¤ë
-     *
-     *  @access private
-     *  @return string  ¥ª¥Ö¥¸¥§¥¯¥È¤òÄɲ乤뤿¤á¤ÎINSERTʸ
-     */
-    function _getSQL_Add()
-    {
-        $tables = implode(',',
-            $this->my_db_rw->quoteIdentifier(array_keys($this->table_def)));
-
-        $key_list = array();
-        $set_list = array();
-        $prop_arg_list = $this->prop;
-
-        Ethna_AppSQL::escapeSQL($prop_arg_list, $this->my_db_type);
-        foreach ($this->prop_def as $k => $v) {
-            if (isset($prop_arg_list[$k]) == false) {
-                continue;
-            }
-            $key_list[] = $this->my_db_rw->quoteIdentifier($k);
-            $set_list[] = $prop_arg_list[$k];
-        }
-
-        $key_list = implode(', ', $key_list);
-        $set_list = implode(', ', $set_list);
-        $sql = "INSERT INTO $tables ($key_list) VALUES ($set_list)";
-
-        return $sql;
-    }
-    // }}}
-
-    // {{{ _getSQL_Update
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¥×¥í¥Ñ¥Æ¥£¤ò¹¹¿·¤¹¤ëSQLʸ¤ò¹½ÃÛ¤¹¤ë
-     *
-     *  @access private
-     *  @return ¥ª¥Ö¥¸¥§¥¯¥È¥×¥í¥Ñ¥Æ¥£¤ò¹¹¿·¤¹¤ë¤¿¤á¤ÎUPDATEʸ
-     */
-    function _getSQL_Update()
-    {
-        $tables = implode(',',
-            $this->my_db_rw->quoteIdentifier(array_keys($this->table_def)));
-
-        // SET¶ç¹½ÃÛ
-        $set_list = "";
-        $prop_arg_list = $this->prop;
-        Ethna_AppSQL::escapeSQL($prop_arg_list, $this->my_db_type);
-        foreach ($this->prop_def as $k => $v) {
-            if ($set_list != "") {
-                $set_list .= ",";
-            }
-            $set_list .= sprintf("%s=%s",
-                                 $this->my_db_rw->quoteIdentifier($k),
-                                 $prop_arg_list[$k]);
-        }
-
-        // ¸¡º÷¾ò·ï(primary key)
-        $condition = null;
-        foreach (to_array($this->id_def) as $k) {
-            if (is_null($condition)) {
-                $condition = "WHERE ";
-            } else {
-                $condition .= " AND ";
-            }
-            $v = $this->prop_backup[$k];    // equals to $this->id
-            Ethna_AppSQL::escapeSQL($v, $this->my_db_type);
-            $condition .= Ethna_AppSQL::getCondition(
-                $this->my_db_rw->quoteIdentifier($k), $v);
-        }
-
-        $sql = "UPDATE $tables SET $set_list $condition";
-
-        return $sql;
-    }
-    // }}}
-
-    // {{{ _getSQL_Remove
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¤òºï½ü¤¹¤ëSQLʸ¤ò¹½ÃÛ¤¹¤ë
-     *
-     *  @access private
-     *  @return string  ¥ª¥Ö¥¸¥§¥¯¥È¤òºï½ü¤¹¤ë¤¿¤á¤ÎDELETEʸ
-     */
-    function _getSQL_Remove()
-    {
-        $tables = implode(',',
-            $this->my_db_rw->quoteIdentifier(array_keys($this->table_def)));
-
-        // ¸¡º÷¾ò·ï(primary key)
-        $condition = null;
-        foreach (to_array($this->id_def) as $k) {
-            if (is_null($condition)) {
-                $condition = "WHERE ";
-            } else {
-                $condition .= " AND ";
-            }
-            $v = $this->prop_backup[$k];    // equals to $this->id
-            Ethna_AppSQL::escapeSQL($v, $this->my_db_type);
-            $condition .= Ethna_AppSQL::getCondition(
-                $this->my_db_rw->quoteIdentifier($k), $v);
-        }
-        if (is_null($condition)) {
-            trigger_error("DELETE with no conditon", E_USER_ERROR);
-            return null;
-        }
-
-        $sql = "DELETE FROM $tables $condition";
-
-        return $sql;
-    }
-    // }}}
-
-    // {{{ _getSQL_Duplicate
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¥×¥í¥Ñ¥Æ¥£¤Î¥æ¥Ë¡¼¥¯¥Á¥§¥Ã¥¯¤ò¹Ô¤¦SQLʸ¤ò¹½ÃÛ¤¹¤ë
-     *
-     *  @access private
-     *  @param  mixed   $key    ¥æ¥Ë¡¼¥¯¥Á¥§¥Ã¥¯¤ò¹Ô¤¦¥×¥í¥Ñ¥Æ¥£Ì¾
-     *  @return string  ¥æ¥Ë¡¼¥¯¥Á¥§¥Ã¥¯¤ò¹Ô¤¦¤¿¤á¤ÎSELECTʸ
-     */
-    function _getSQL_Duplicate($key)
-    {
-        $tables = implode(',',
-            $this->my_db_ro->quoteIdentifier(array_keys($this->table_def)));
-        $columns = implode(',',
-            $this->my_db_ro->quoteIdentifier(array_keys($this->prop_def)));
-
-        $condition = null;
-        // ¸¡º÷¾ò·ï(¸½ºßÀßÄꤵ¤ì¤Æ¤¤¤ë¥×¥é¥¤¥Þ¥ê¥­¡¼¤Ï¸¡º÷Âоݤ«¤é½ü¤¯)
-        if (is_null($this->id) == false) {
-            $primary_value = to_array($this->getId());
-            $n = 0;
-            foreach (to_array($this->id_def) as $k) {
-                if (is_null($condition)) {
-                    $condition = "WHERE ";
-                } else {
-                    $condition .= " AND ";
-                }
-                $value = $primary_value[$n];
-                Ethna_AppSQL::escapeSQL($value, $this->my_db_type);
-                $condition .= Ethna_AppSQL::getCondition(
-                    $this->my_db_ro->quoteIdentifier($k), $value, OBJECT_CONDITION_NE);
-                $n++;
-            }
-        }
-
-        foreach (to_array($key) as $k) {
-            if (is_null($condition)) {
-                $condition = "WHERE ";
-            } else {
-                $condition .= " AND ";
-            }
-            $v = $this->prop[$k];
-            Ethna_AppSQL::escapeSQL($v, $this->my_db_type);
-            $condition .= Ethna_AppSQL::getCondition(
-                $this->my_db_ro->quoteIdentifier($k), $v);
-        }
-
-        $sql = "SELECT $columns FROM $tables $condition";
-
-        return $sql;
-    }
-    // }}}
-
-    // {{{ _getSQL_SearchLength
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¸¡º÷Áí¿ô(offset, count½ü³°)¤ò¼èÆÀ¤¹¤ëSQLʸ¤ò¹½ÃÛ¤¹¤ë
-     *
-     *  @access private
-     *  @param  array   $filter     ¸¡º÷¾ò·ï
-     *  @return string  ¸¡º÷Áí¿ô¤ò¼èÆÀ¤¹¤ë¤¿¤á¤ÎSELECTʸ
-     *  @todo   my_db_type¤Î»²¾È¤òÇÑ»ß
-     */
-    function _getSQL_SearchLength($filter)
-    {
-        // ¥Æ¡¼¥Ö¥ë
-        $tables = implode(',',
-            $this->my_db_ro->quoteIdentifier(array_keys($this->table_def)));
-        if ($this->_isAdditionalField($filter)) {
-            $tables .= " " . $this->_SQLPlugin_SearchTable();
-        }
-
-        $id_def = to_array($this->id_def);
-        $column_id = $this->my_db_ro->quoteIdentifier($this->_getPrimaryTable())
-            . "." . $this->my_db_ro->quoteIdentifier($id_def[0]);
-        $id_count = $this->my_db_ro->quoteIdentifier('id_count');
-        $condition = $this->_getSQL_SearchCondition($filter);
-
-        if ($this->my_db_type === 'sqlite') {
-            $sql = "SELECT COUNT(*) AS $id_count FROM "
-                . " (SELECT DISTINCT $column_id FROM $tables $condition)";
-        } else {
-            $sql = "SELECT COUNT(DISTINCT $column_id) AS $id_count "
-                . "FROM $tables $condition";
-        }
-
-        return $sql;
-    }
-    // }}}
-
-    // {{{ _getSQL_SearchId
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥ÈID¸¡º÷¤ò¹Ô¤¦SQLʸ¤ò¹½ÃÛ¤¹¤ë
-     *
-     *  @access private
-     *  @param  array   $filter     ¸¡º÷¾ò·ï
-     *  @param  array   $order      ¸¡º÷·ë²Ì¥½¡¼¥È¾ò·ï
-     *  @param  int     $offset     ¸¡º÷·ë²Ì¼èÆÀ¥ª¥Õ¥»¥Ã¥È
-     *  @param  int     $count      ¸¡º÷·ë²Ì¼èÆÀ¿ô
-     *  @return string  ¥ª¥Ö¥¸¥§¥¯¥È¸¡º÷¤ò¹Ô¤¦SELECTʸ
-     */
-    function _getSQL_SearchId($filter, $order, $offset, $count)
-    {
-        // ¥Æ¡¼¥Ö¥ë
-        $tables = implode(',',
-            $this->my_db_ro->quoteIdentifier(array_keys($this->table_def)));
-        if ($this->_isAdditionalField($filter)
-            || $this->_isAdditionalField($order)) {
-            $tables .= " " . $this->_SQLPlugin_SearchTable();
-        }
-
-        $column_id = "";
-        foreach (to_array($this->id_def) as $id) {
-            if ($column_id != "") {
-                $column_id .= ",";
-            }
-            $column_id .= $this->my_db_ro->quoteIdentifier($this->_getPrimaryTable())
-                . "." . $this->my_db_ro->quoteIdentifier($id);
-        }
-        $condition = $this->_getSQL_SearchCondition($filter);
-
-        $sort = "";
-        if (is_array($order)) {
-            foreach ($order as $k => $v) {
-                if ($sort == "") {
-                    $sort = "ORDER BY ";
-                } else {
-                    $sort .= ", ";
-                }
-                $sort .= sprintf("%s %s", $this->my_db_ro->quoteIdentifier($k),
-                                 $v == OBJECT_SORT_ASC ? "ASC" : "DESC");
-            }
-        }
-
-        $limit = "";
-        if (is_null($count) == false) {
-            $limit = sprintf("LIMIT %d", $count);
-            if (is_null($offset) == false) {
-                $limit .= sprintf(" OFFSET %d", $offset);
-            }
-        }
-
-        $sql = "SELECT DISTINCT $column_id FROM $tables $condition $sort $limit";
-
-        return $sql;
-    }
-    // }}}
-
-    // {{{ _getSQL_SearchProp
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¥×¥í¥Ñ¥Æ¥£¸¡º÷¤ò¹Ô¤¦SQLʸ¤ò¹½ÃÛ¤¹¤ë
-     *
-     *  @access private
-     *  @param  array   $keys       ¼èÆÀ¥×¥í¥Ñ¥Æ¥£°ìÍ÷
-     *  @param  array   $filter     ¸¡º÷¾ò·ï
-     *  @param  array   $order      ¸¡º÷·ë²Ì¥½¡¼¥È¾ò·ï
-     *  @param  int     $offset     ¸¡º÷·ë²Ì¼èÆÀ¥ª¥Õ¥»¥Ã¥È
-     *  @param  int     $count      ¸¡º÷·ë²Ì¼èÆÀ¿ô
-     *  @return string  ¥ª¥Ö¥¸¥§¥¯¥È¸¡º÷¤ò¹Ô¤¦SELECTʸ
-     */
-    function _getSQL_SearchProp($keys, $filter, $order, $offset, $count)
-    {
-        // ¥Æ¡¼¥Ö¥ë
-        $tables = implode(',',
-            $this->my_db_ro->quoteIdentifier(array_keys($this->table_def)));
-        if ($this->_isAdditionalField($filter)
-            || $this->_isAdditionalField($order)) {
-            $tables .= " " . $this->_SQLPlugin_SearchTable();
-        }
-        $p_table = $this->_getPrimaryTable();
-
-        // ¸¡º÷ÍÑÄɲåץí¥Ñ¥Æ¥£
-        if ($this->_isAdditionalField($filter)
-            || $this->_isAdditionalField($order)) {
-            $search_prop_def = $this->_SQLPlugin_SearchPropDef();
-        } else {
-            $search_prop_def = array();
-        }
-        $def = array_merge($this->getDef(), $search_prop_def);
-
-        // ¥«¥é¥à
-        $column = "";
-        $keys = $keys === null ? array_keys($def) : to_array($keys);
-        foreach ($keys as $key) {
-            if ($column != "") {
-                $column .= ", ";
-            }
-            $t = isset($def[$key]['table']) ? $def[$key]['table'] : $p_table;
-            $column .= sprintf("%s.%s",
-                               $this->my_db_ro->quoteIdentifier($t),
-                               $this->my_db_ro->quoteIdentifier($key));
-        }
-
-        // WHERE ¤Î¾ò·ï
-        $condition = $this->_getSQL_SearchCondition($filter);
-
-        // ORDER BY
-        $sort = "";
-        if (is_array($order)) {
-            foreach ($order as $k => $v) {
-                if ($sort == "") {
-                    $sort = "ORDER BY ";
-                } else {
-                    $sort .= ", ";
-                }
-                $sort .= sprintf("%s %s",
-                                 $this->my_db_ro->quoteIdentifier($k),
-                                 $v == OBJECT_SORT_ASC ? "ASC" : "DESC");
-            }
-        }
-
-        // LIMIT, OFFSET
-        $limit = "";
-        if (is_null($count) == false) {
-            $limit = sprintf("LIMIT %d", $count);
-            if (is_null($offset) == false) {
-                $limit .= sprintf(" OFFSET %d", $offset);
-            }
-        }
-
-        $sql = "SELECT $column FROM $tables $condition $sort $limit";
-
-        return $sql;
-    }
-    // }}}
-
-    // {{{ _getSQL_SearchCondition
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¸¡º÷SQL¤Î¾ò·ïʸ¤ò¹½ÃÛ¤¹¤ë
-     *
-     *  @access private
-     *  @param  array   $filter     ¸¡º÷¾ò·ï
-     *  @return string  ¥ª¥Ö¥¸¥§¥¯¥È¸¡º÷¤Î¾ò·ïʸ(¥¨¥é¡¼¤Ê¤énull)
-     */
-    function _getSQL_SearchCondition($filter)
-    {
-        if (is_array($filter) == false) {
-            return "";
-        }
-
-        $p_table = $this->_getPrimaryTable();
-
-        // ¸¡º÷ÍÑÄɲåץí¥Ñ¥Æ¥£
-        if ($this->_isAdditionalField($filter)) {
-            $search_prop_def = $this->_SQLPlugin_SearchPropDef();
-        } else {
-            $search_prop_def = array();
-        }
-        $prop_def = array_merge($this->prop_def, $search_prop_def);
-
-        $condition = null;
-        foreach ($filter as $k => $v) {
-            if (isset($prop_def[$k]) == false) {
-                trigger_error(sprintf("Unknown property [%s]", $k), E_USER_ERROR);
-                return null;
-            }
-
-            if (is_null($condition)) {
-                $condition = "WHERE ";
-            } else {
-                $condition .= " AND ";
-            }
-
-            $t = isset($prop_def[$k]['table']) ? $prop_def[$k]['table'] : $p_table;
-
-            if (is_object($v)) {
-                // Ethna_AppSearchObject¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç
-                $condition .= $v->toString(
-                    $this->my_db_ro->quoteIdentifier($t)
-                    .'.'. $this->my_db_ro->quoteIdentifier($k));
-            } else if (is_array($v) && count($v) > 0 && is_object($v[0])) {
-                // Ethna_AppSearchObject¤¬ÇÛÎó¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç
-                $n = 0;
-                foreach ($v as $so) {
-                    if ($n > 0) {
-                        $condition .= " AND ";
-                    }
-                    $condition .= $so->toString(
-                        $this->my_db_ro->quoteIdentifier($t)
-                        .'.'. $this->my_db_ro->quoteIdentifier($k));
-                    $n++;
-                }
-            } else if ($prop_def[$k]['type'] == VAR_TYPE_STRING) {
-                // ¾Êά·Á(ʸ»úÎó)
-                Ethna_AppSQL::escapeSQL($v, $this->my_db_type);
-                $condition .= Ethna_AppSQL::getCondition(
-                    $this->my_db_ro->quoteIdentifier($t)
-                    .'.'. $this->my_db_ro->quoteIdentifier($k),
-                    $v, OBJECT_CONDITION_LIKE);
-            } else {
-                // ¾Êά·Á(¿ôÃÍ)
-                Ethna_AppSQL::escapeSQL($v, $this->my_db_type);
-                $condition .= Ethna_AppSQL::getCondition(
-                    $this->my_db_ro->quoteIdentifier($t)
-                    .'.'. $this->my_db_ro->quoteIdentifier($k),
-                    $v, OBJECT_CONDITION_EQ);
-            }
-        }
-
-        return $condition;
-    }
-    // }}}
-
-    // {{{ _SQLPlugin_SearchTable
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¸¡º÷SQL¥×¥é¥°¥¤¥ó(Äɲåơ¼¥Ö¥ë)
-     *
-     *  sample:
-     *  <code>
-     *  return " LEFT JOIN bar_tbl ON foo_tbl.user_id=bar_tbl.user_id";
-     *  </code>
-     *
-     *  @access protected
-     *  @return string  ¥Æ¡¼¥Ö¥ëJOIN¤ÎSQLʸ
-     */
-    function _SQLPlugin_SearchTable()
-    {
-        return "";
-    }
-    // }}}
-
-    // {{{ _SQLPlugin_SearchPropDef
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¸¡º÷SQL¥×¥é¥°¥¤¥ó(Äɲþò·ïÄêµÁ)
-     *
-     *  sample:
-     *  <code>
-     *  $search_prop_def = array(
-     *    'group_id' => array(
-     *      'primary' => true, 'key' => true, 'type' => VAR_TYPE_INT,
-     *      'form_name' => 'group_id', 'table' => 'group_user_tbl',
-     *    ),
-     *  );
-     *  return $search_prop_def;
-     *  </code>
-     *
-     *  @access protected
-     *  @return array   Äɲþò·ïÄêµÁ
-     */
-    function _SQLPlugin_SearchPropDef()
-    {
-        return array();
-    }
-    // }}}
-
-    // {{{ _dump_csv
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¥×¥í¥Ñ¥Æ¥£¤òCSV·Á¼°¤Ç¥À¥ó¥×¤¹¤ë
-     *
-     *  @access protected
-     *  @return string  ¥À¥ó¥×·ë²Ì
-     */
-    function _dump_csv()
-    {
-        $dump = "";
-
-        $n = 0;
-        foreach ($this->getDef() as $k => $def) {
-            if ($n > 0) {
-                $dump .= ",";
-            }
-            $dump .= Ethna_Util::escapeCSV($this->getName($k));
-            $n++;
-        }
-
-        return $dump;
-    }
-    // }}}
-
-    // {{{ _isAdditionalField
-    /**
-     *  (¸¡º÷¾ò·ï|¥½¡¼¥È¾ò·ï)¥Õ¥£¡¼¥ë¥É¤ËÄɲåե£¡¼¥ë¥É¤¬´Þ¤Þ¤ì¤ë¤«¤É¤¦¤«¤òÊÖ¤¹
-     *
-     *  @access private
-     *  @param  array   $field  (¸¡º÷¾ò·ï|¥½¡¼¥È¾ò·ï)ÄêµÁ
-     *  @return bool    true:´Þ¤Þ¤ì¤ë false:´Þ¤Þ¤ì¤Ê¤¤
-     */
-    function _isAdditionalField($field)
-    {
-        if (is_array($field) == false) {
-            return false;
-        }
-
-        $def = $this->getDef();
-        foreach ($field as $key => $value) {
-            if (array_key_exists($key, $def) == false) {
-                return true;
-            }
-            if (is_object($value)) {
-                // Ethna_AppSearchObject
-                if ($value->isTarget($key)) {
-                    return true;
-                }
-            }
-        }
-        return false;
-    }
-    // }}}
-
-    // {{{ _clearPropCache
-    /**
-     *  ¥­¥ã¥Ã¥·¥å¥Ç¡¼¥¿¤òºï½ü¤¹¤ë
-     *
-     *  @access private
-     */
-    function _clearPropCache()
-    {
-        $class_name = strtolower(get_class($this));
-        foreach (array('_ETHNA_APP_OBJECT_CACHE',
-                       '_ETHNA_APP_MANAGER_OL_CACHE',
-                       '_ETHNA_APP_MANAGER_OPL_CACHE',
-                       '_ETHNA_APP_MANAGER_OP_CACHE') as $key) {
-            if (array_key_exists($key, $GLOBALS)
-                && array_key_exists($class_name, $GLOBALS[$key])) {
-                unset($GLOBALS[$key][$class_name]);
-            }
-        }
-    }
-    // }}}
-
-    // {{{ _getDBList
-    /**
-     *  DB¥ª¥Ö¥¸¥§¥¯¥È(read only/read-write)¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access protected
-     *  @return array   array('ro' => {read only db object}, 'rw' => {read-write db object})
-     */
-    function _getDBList()
-    {
-        $r = array('ro' => null, 'rw' => null);
-
-        $db_list = $this->backend->getDBList();
-        if (Ethna::isError($db_list)) {
-            return $r;
-        }
-        foreach ($db_list as $elt) {
-            if ($this->db_prefix) {
-                // ÆÃÄê¤Î¥×¥ì¥Õ¥£¥¯¥¹¤¬»ØÄꤵ¤ì¤¿DBÀܳ¤òÍøÍÑ
-                // (¥Æ¡¼¥Ö¥ë¤´¤È¤ËDB¤¬°Û¤Ê¤ë¾ì¹ç¤Ê¤É)
-                if (strncmp($this->db_prefix,
-                            $elt['key'],
-                            strlen($this->db_prefix)) != 0) {
-                    continue;
-                }
-            }
-
-            $varname = $elt['varname'];
-
-            // for B.C.
-            $this->$varname =& $elt['db'];
-
-            if ($elt['type'] == DB_TYPE_RW) {
-                $r['rw'] =& $elt['db'];
-            } else if ($elt['type'] == DB_TYPE_RO) {
-                $r['ro'] =& $elt['db'];
-            }
-        }
-        if ($r['ro'] == null && $r['rw'] != null) {
-            $r['ro'] =& $r['rw'];
-        }
-
-        return $r;
-    }
-    // }}}
-
-    // {{{ _getTableDef
-    /**
-     *  ¥Æ¡¼¥Ö¥ëÄêµÁ¤ò¼èÆÀ¤¹¤ë
-     *
-     *  (¥¯¥é¥¹Ì¾¢ª¥Æ¡¼¥Ö¥ë̾¤Î¥ë¡¼¥ë¤òÊѤ¨¤¿¤¤¾ì¹ç¤Ï
-     *  ¤³¤Î¥á¥½¥Ã¥É¤ò¥ª¡¼¥Ð¡¼¥é¥¤¥É¤·¤Þ¤¹)
-     *
-     *  @access protected
-     *  @return array   ¥Æ¡¼¥Ö¥ëÄêµÁ
-     */
-    function _getTableDef()
-    {
-        $class_name = get_class($this);
-        if (preg_match('/(\w+)_(.*)/', $class_name, $match) == 0) {
-            return null;
-        }
-        $table = $match[2];
-
-        // PHP 4¤Ï¾ï¤Ë¾®Ê¸»ú¤òÊÖ¤¹...¤Î¤ÇPHP 5ÀìÍÑ
-        $table = preg_replace('/^([A-Z])/e', "strtolower('\$1')", $table);
-        $table = preg_replace('/([A-Z])/e', "'_' . strtolower('\$1')", $table);
-
-        return array($table => array('primary' => true));
-    }
-    // }}}
-
-    // {{{ _getPropDef
-    /**
-     *  ¥×¥í¥Ñ¥Æ¥£ÄêµÁ¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access protected
-     *  @return array   ¥×¥í¥Ñ¥Æ¥£ÄêµÁ
-     */
-    function _getPropDef()
-    {
-        if (is_null($this->table_def)) {
-            return null;
-        }
-        foreach ($this->table_def as $table_name => $table_attr) {
-            // use 1st one
-            break;
-        }
-
-        $cache_manager =& Ethna_CacheManager::getInstance('localfile');
-        $cache_manager->setNamespace('ethna_app_object');
-        $cache_key = md5($this->my_db_ro->getDSN() . '-' . $table_name);
-
-        if ($cache_manager->isCached($cache_key, $this->prop_def_cache_lifetime)) {
-            $prop_def = $cache_manager->get($cache_key,
-                                            $this->prop_def_cache_lifetime);
-            if (Ethna::isError($prop_def) == false) {
-                return $prop_def;
-            }
-        }
-
-        $r = $this->my_db_ro->getMetaData($table_name);
-        if(Ethna::isError($r)){
-            return null;
-        }
-
-        $prop_def = array();
-        foreach ($r as $i => $field_def) {
-            $primary  = in_array('primary_key', $field_def['flags']);
-            $seq      = in_array('sequence',    $field_def['flags']);
-            $required = in_array('not_null',    $field_def['flags']);
-            $key      = in_array('primary_key', $field_def['flags'])
-                        || in_array('multiple_key', $field_def['flags'])
-                        || in_array('unique_key', $field_def['flags']);
-
-            switch ($field_def['type']) {
-            case 'int':
-                $type = VAR_TYPE_INT;
-                break;
-            case 'boolean':
-                $type = VAR_TYPE_BOOLEAN;
-                break;
-            case 'datetime':
-                $type = VAR_TYPE_DATETIME;
-                break;
-            default:
-                $type = VAR_TYPE_STRING;
-                break;
-            }
-
-            $prop_def[$field_def['name']] = array(
-                'primary'   => $primary,
-                'seq'       => $seq,
-                'key'       => $key,
-                'type'      => $type,
-                'required'  => $required,
-                'length'    => $field_def['len'],
-                'form_name' => $this->_fieldNameToFormName($field_def),
-                'table'     => $table_name,
-            );
-        }
-        
-        $cache_manager->set($cache_key, $prop_def);
-
-        return $prop_def;
-    }
-    // }}}
-
-    // {{{ _fieldNameToFormName
-    /**
-     *  ¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥£¡¼¥ë¥É̾¤ËÂбþ¤¹¤ë¥Õ¥©¡¼¥à̾¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access protected
-     */
-    function _fieldNameToFormName($field_def)
-    {
-        return $field_def['name'];
-    }
-    // }}}
-}
-// }}}
-?>
diff --git a/class/Ethna_AppSQL.php b/class/Ethna_AppSQL.php
deleted file mode 100644 (file)
index 826da27..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_AppSQL.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_AppSQL
-/**
- *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥óSQL¥Ù¡¼¥¹¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_AppSQL
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    object  Ethna_Controller    controller¥ª¥Ö¥¸¥§¥¯¥È */
-    var $controller;
-
-    /**#@-*/
-
-    /**
-     *  Ethna_AppSQL¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Controller    &$controller    controller¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function Ethna_AppSQL(&$controller)
-    {
-        $this->controller =& $controller;
-    }
-
-    /**
-     *  Å¬Àڤ˥¨¥¹¥±¡¼¥×¤µ¤ì¤¿SQLʸ¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @param  string  $sqlfunc    SQLʸ¼ïÊÌ̾
-     *  @param  array   $args       °ú¿ô°ìÍ÷
-     *  @return string  ¥¨¥¹¥±¡¼¥×¤µ¤ì¤¿SQLʸ
-     */
-    function get($sqlid, $args)
-    {
-        Ethna_AppSQL::escapeSQL($args);
-
-        return call_user_func_array(array(&$this, $sqlid), $args);
-    }
-
-    /**
-     *  SQL°ú¿ô¤ò¥¨¥¹¥±¡¼¥×¤¹¤ë
-     *
-     *  @access public
-     *  @param  mixed   &$var   ¥¨¥¹¥±¡¼¥×¤¹¤ëÃÍ
-     *  @static
-     */
-    function escapeSQL(&$var, $type = null)
-    {
-        if (!is_array($var)) {
-            if (is_null($var)) {
-                $var = 'NULL';
-            } else {
-                if ($type === 'sqlite') {
-                    $var = "'" . sqlite_escape_string($var) . "'";
-                } else {
-                    $var = "'" . addslashes($var) . "'";
-                }
-            }
-            return;
-        }
-        foreach (array_keys($var) as $key) {
-            Ethna_AppSQL::escapeSQL($var[$key], $type);
-        }
-    }
-
-    /**
-     *  escapeSQL¤Ç¥¨¥¹¥±¡¼¥×¤µ¤ì¤¿Ê¸»úÎó¤òunescape¤¹¤ë
-     *
-     *  @access public
-     *  @param  mixed   &$var   ¥¨¥¹¥±¡¼¥×¤òÉüµ¢¤¹¤ëÃÍ
-     *  @static
-     */
-    function unescapeSQL(&$var, $type = null)
-    {
-        if (!is_array($var)) {
-            if ($var == 'NULL') {
-                return;
-            }
-            $var = substr($var, 1, strlen($var)-2);
-            $var = stripslashes($var);
-            return;
-        }
-        foreach (array_keys($var) as $key) {
-            Ethna_AppSQL::unescapeSQL($var[$key], $type);
-        }
-    }
-
-    /**
-     *  WHERE¾ò·ïʸ¤òÀ¸À®¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $field      ¸¡º÷ÂоݤΥե£¡¼¥ë¥É
-     *  @param  mixed   $value      ¸¡º÷ÃÍ
-     *  @param  int     $condition  ¸¡º÷¾ò·ï(OBJECT_CONDITION_NE,...)
-     *  @return string  ¸¡º÷¾ò·ïʸ
-     *  @static
-     */
-    function getCondition($field, $value, $condition = OBJECT_CONDITION_EQ)
-    {
-        switch ($condition) {
-        case OBJECT_CONDITION_EQ:
-            $op = "="; break;
-        case OBJECT_CONDITION_NE:
-            $op = "!="; break;
-        case OBJECT_CONDITION_LIKE:
-            $op = "LIKE"; break;
-        case OBJECT_CONDITION_GT:
-            $op = ">"; break;
-        case OBJECT_CONDITION_LT:
-            $op = "<"; break;
-        case OBJECT_CONDITION_GE:
-            $op = ">="; break;
-        case OBJECT_CONDITION_LE:
-            $op = "<="; break;
-        }
-
-        // default operand
-        $operand = $value;
-
-        if (is_array($value)) {
-            if (count($value) > 0) {
-                switch ($condition) {
-                case OBJECT_CONDITION_EQ:
-                    $op = "IN"; break;
-                case OBJECT_CONDITION_NE:
-                    $op = "NOT IN"; break;
-                }
-                $operand = sprintf("(%s)", implode(',', $value));
-            } else {
-                // always be false
-                $op = "=";
-                $operand = "NULL";
-            }
-        } else {
-            if ($value == 'NULL') {
-                switch ($condition) {
-                case OBJECT_CONDITION_EQ:
-                    $op = "IS"; break;
-                case OBJECT_CONDITION_NE:
-                    $op = "IS NOT"; break;
-                }
-            }
-            if ($condition == OBJECT_CONDITION_LIKE) {
-                Ethna_AppSQL::unescapeSQL($value);
-                $value = '%' . str_replace('%', '\\%', $value) . '%';
-                Ethna_AppSQL::escapeSQL($value);
-                $operand = $value;
-            }
-        }
-        return "$field $op $operand";
-    }
-}
-// }}}
-?>
diff --git a/class/Ethna_AppSearchObject.php b/class/Ethna_AppSearchObject.php
deleted file mode 100644 (file)
index 7e74739..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_AppSearchObject.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-/** ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¸¡º÷¾ò·ï: != */
-define('OBJECT_CONDITION_NE', 0);
-
-/** ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¸¡º÷¾ò·ï: == */
-define('OBJECT_CONDITION_EQ', 1);
-
-/** ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¸¡º÷¾ò·ï: LIKE */
-define('OBJECT_CONDITION_LIKE', 2);
-
-/** ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¸¡º÷¾ò·ï: > */
-define('OBJECT_CONDITION_GT', 3);
-
-/** ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¸¡º÷¾ò·ï: < */
-define('OBJECT_CONDITION_LT', 4);
-
-/** ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¸¡º÷¾ò·ï: >= */
-define('OBJECT_CONDITION_GE', 5);
-
-/** ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¸¡º÷¾ò·ï: <= */
-define('OBJECT_CONDITION_LE', 6);
-
-/** ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¸¡º÷¾ò·ï: AND */
-define('OBJECT_CONDITION_AND', 7);
-
-/** ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¸¡º÷¾ò·ï: OR */
-define('OBJECT_CONDITION_OR', 8);
-
-
-
-// {{{ Ethna_AppSearchObject
-/**
- *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¸¡º÷¾ò·ï¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_AppSearchObject
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    string  ¸¡º÷ÃÍ */
-    var $value;
-
-    /** @var    int     ¸¡º÷¾ò·ï */
-    var $condition;
-
-    /**
-     *  @var    array   Äɲø¡º÷¾ò·ï¤òÊÝ»ý¤·¤¿Ethna_AppSearchObject¤Î°ìÍ÷
-     */
-    var $object_list = array();
-
-    /**#@-*/
-
-
-    /**
-     *  Ethna_AppSearchObject¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  string  $value      ¸¡º÷ÃÍ
-     *  @param  int     $condition  ¸¡º÷¾ò·ï(OBJECT_CONDITION_NE,...)
-     */
-    function Ethna_AppSearchObject($value, $condition)
-    {
-        $this->value = $value;
-        $this->condition = $condition;
-    }
-
-    /**
-     *  ¸¡º÷¾ò·ï¤òOR/AND¤ÇÄɲ乤ë
-     *
-     *  @access public
-     *  @param  string                          $name           ¸¡º÷Âоݥ«¥é¥à̾
-     *  @param  object  Ethna_AppSearchObject   $search_object  Äɲ乤븡º÷¾ò·ï
-     *  @param  int                             $condition      Äɲþò·ï(OR/AND)
-     */
-    function addObject($name, $search_object, $condition)
-    {
-        $tmp = array();
-        $tmp['name'] = $name;
-        $tmp['object'] =& $search_object;
-        $tmp['condition'] = $condition;
-        $this->object_list[] = $tmp;
-    }
-
-    /**
-     *  »ØÄꤵ¤ì¤¿¥Õ¥£¡¼¥ë¥É¤¬¸¡º÷ÂоݤȤʤäƤ¤¤ë¤«¤É¤¦¤«¤òÊÖ¤¹
-     *
-     *  @access public
-     */
-    function isTarget($field)
-    {
-        foreach ($this->object_list as $object) {
-            if ($object['name'] == $field) {
-                return true;
-            }
-            if (is_object($object['object'])) {
-                $r = $object['object']->isTarget($field);
-                if ($r) {
-                    return true;
-                }
-            }
-        }
-        return false;
-    }
-
-    /**
-     *  ¸¡º÷¾ò·ïSQLʸ¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @param  string  ¸¡º÷Âоݥ«¥é¥à̾
-     *  @return SQLʸ
-     */
-    function toString($column)
-    {
-        $condition = "(";
-        $tmp_value = $this->value;
-        Ethna_AppSQL::escapeSQL($tmp_value);
-        $condition .= Ethna_AppSQL::getCondition("$column", $tmp_value, $this->condition);
-
-        foreach ($this->object_list as $elt) {
-            if ($elt['condition'] == OBJECT_CONDITION_OR) {
-                $condition .= " OR ";
-            } else {
-                $condition .= " AND ";
-            }
-            $condition .= $elt['object']->toString($elt['name']);
-        }
-
-        return $condition . ")";
-    }
-}
-// }}}
-?>
diff --git a/class/Ethna_Backend.php b/class/Ethna_Backend.php
deleted file mode 100644 (file)
index 8af426b..0000000
+++ /dev/null
@@ -1,493 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Backend.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Backend
-/**
- *  ¥Ð¥Ã¥¯¥¨¥ó¥É½èÍý¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Backend
-{
-    /**#@+
-     *  @access     private
-     */
-
-    /** @var    object  Ethna_Controller    controller¥ª¥Ö¥¸¥§¥¯¥È */
-    var $controller;
-
-    /** @var    object  Ethna_Controller    controller¥ª¥Ö¥¸¥§¥¯¥È($controller¤Î¾Êά·Á) */
-    var $ctl;
-
-    /** @var    object  Ethna_ClassFactory  ¥¯¥é¥¹¥Õ¥¡¥¯¥È¥ê¥ª¥Ö¥¸¥§¥¯¥È */
-    var $class_factory;
-
-    /** @var    object  Ethna_Config        ÀßÄꥪ¥Ö¥¸¥§¥¯¥È */
-    var $config;
-
-    /** @var    object  Ethna_I18N          i18n¥ª¥Ö¥¸¥§¥¯¥È */
-    var $i18n;
-
-    /** @var    object  Ethna_ActionError   ¥¢¥¯¥·¥ç¥ó¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È */
-    var $action_error;
-
-    /** @var    object  Ethna_ActionError   ¥¢¥¯¥·¥ç¥ó¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È($action_error¤Î¾Êά·Á) */
-    var $ae;
-
-    /** @var    object  Ethna_ActionForm    ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È */
-    var $action_form;
-
-    /** @var    object  Ethna_ActionForm    ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È($action_form¤Î¾Êά·Á) */
-    var $af;
-
-    /** @var    object  Ethna_ActionClass   ¥¢¥¯¥·¥ç¥ó¥¯¥é¥¹¥ª¥Ö¥¸¥§¥¯¥È */
-    var $action_class;
-
-    /** @var    object  Ethna_ActionClass   ¥¢¥¯¥·¥ç¥ó¥¯¥é¥¹¥ª¥Ö¥¸¥§¥¯¥È($action_class¤Î¾Êά·Á) */
-    var $ac;
-
-    /** @var    object  Ethna_Session       ¥»¥Ã¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È */
-    var $session;
-
-    /** @var    object  Ethna_Plugin        ¥×¥é¥°¥¤¥ó¥ª¥Ö¥¸¥§¥¯¥È */
-    var $plugin;
-
-    /** @var    array   Ethna_DB¥ª¥Ö¥¸¥§¥¯¥È¤ò³ÊǼ¤·¤¿ÇÛÎó */
-    var $db_list;
-
-    /** @var    object  Ethna_Logger        ¥í¥°¥ª¥Ö¥¸¥§¥¯¥È */
-    var $logger;
-
-    /**#@-*/
-
-
-    /**
-     *  Ethna_Backend¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Controller    &$controller    ¥³¥ó¥È¥í¡¼¥é¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function Ethna_Backend(&$controller)
-    {
-        // ¥ª¥Ö¥¸¥§¥¯¥È¤ÎÀßÄê
-        $this->controller =& $controller;
-        $this->ctl =& $this->controller;
-
-        $this->class_factory =& $controller->getClassFactory();
-
-        $this->config =& $controller->getConfig();
-        $this->i18n =& $controller->getI18N();
-
-        $this->action_error =& $controller->getActionError();
-        $this->ae =& $this->action_error;
-        $this->action_form =& $controller->getActionForm();
-        $this->af =& $this->action_form;
-        $this->action_class = null;
-        $this->ac =& $this->action_class;
-
-        $this->session =& $this->controller->getSession();
-        $this->plugin =& $this->controller->getPlugin();
-        $this->db_list = array();
-        $this->logger =& $this->controller->getLogger();
-    }
-
-    /**
-     *  controller¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥¢¥¯¥»¥µ(R)
-     *
-     *  @access public
-     *  @return object  Ethna_Controller    controller¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &getController()
-    {
-        return $this->controller;
-    }
-
-    /**
-     *  ÀßÄꥪ¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥¢¥¯¥»¥µ(R)
-     *
-     *  @access public
-     *  @return object  Ethna_Config        ÀßÄꥪ¥Ö¥¸¥§¥¯¥È
-     */
-    function &getConfig()
-    {
-        return $this->config;
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥óID¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @return string  ¥¢¥×¥ê¥±¡¼¥·¥ç¥óID
-     */
-    function getAppId()
-    {
-        return $this->controller->getAppId();
-    }
-
-    /**
-     *  I18N¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥¯¥»¥µ(R)
-     *
-     *  @access public
-     *  @return object  Ethna_I18N  i18n¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &getI18N()
-    {
-        return $this->i18n;
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥¯¥»¥µ(R)
-     *
-     *  @access public
-     *  @return object  Ethna_ActionError   ¥¢¥¯¥·¥ç¥ó¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &getActionError()
-    {
-        return $this->action_error;
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥¯¥»¥µ(R)
-     *
-     *  @access public
-     *  @return object  Ethna_ActionForm    ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &getActionForm()
-    {
-        return $this->action_form;
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥¯¥»¥µ(W)
-     *
-     *  @access public
-     */
-    function setActionForm(&$action_form)
-    {
-        $this->action_form =& $action_form;
-        $this->af =& $action_form;
-    }
-
-    /**
-     *  ¼Â¹ÔÃæ¤Î¥¢¥¯¥·¥ç¥ó¥¯¥é¥¹¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥¯¥»¥µ(R)
-     *
-     *  @access public
-     *  @return mixed   Ethna_ActionClass:¥¢¥¯¥·¥ç¥ó¥¯¥é¥¹ null:¥¢¥¯¥·¥ç¥ó¥¯¥é¥¹Ì¤Äê
-     */
-    function &getActionClass()
-    {
-        return $this->action_class;
-    }
-
-    /**
-     *  ¼Â¹ÔÃæ¤Î¥¢¥¯¥·¥ç¥ó¥¯¥é¥¹¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥¯¥»¥µ(W)
-     *
-     *  @access public
-     */
-    function setActionClass(&$action_class)
-    {
-        $this->action_class =& $action_class;
-        $this->ac =& $action_class;
-    }
-
-    /**
-     *  ¥í¥°¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥¯¥»¥µ(R)
-     *
-     *  @access public
-     *  @return object  Ethna_Logger    ¥í¥°¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &getLogger()
-    {
-        return $this->logger;
-    }
-
-    /**
-     *  ¥»¥Ã¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥¯¥»¥µ(R)
-     *
-     *  @access public
-     *  @return object  Ethna_Session   ¥»¥Ã¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &getSession()
-    {
-        return $this->session;
-    }
-
-    /**
-     *  ¥×¥é¥°¥¤¥ó¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥¯¥»¥µ(R)
-     *
-     *  @access public
-     *  @return object  Ethna_Plugin    ¥×¥é¥°¥¤¥ó¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &getPlugin()
-    {
-        return $this->plugin;
-    }
-
-    /**
-     *  ¥Þ¥Í¡¼¥¸¥ã¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥¢¥¯¥»¥µ(R)
-     *
-     *  @access public
-     *  @return object  Ethna_AppManager    ¥Þ¥Í¡¼¥¸¥ã¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &getManager($type, $weak = false)
-    {
-        $_ret_object =& $this->class_factory->getManager($type, $weak);
-        return $_ret_object;
-    }
-
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥¢¥¯¥»¥µ(R)
-     *
-     *  @access public
-     *  @return mixed   $key¤ËÂбþ¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È(or null)
-     */
-    function &getObject($key)
-    {
-        $arg_list = func_get_args();
-        array_shift($arg_list);
-        $_ret_object =& $this->class_factory->getObject($key, $arg_list);
-        return $_ret_object;
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return string  ¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Ñ¥¹Ì¾
-     */
-    function getBasedir()
-    {
-        return $this->controller->getBasedir();
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥Æ¥ó¥×¥ì¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return string  ¥Æ¥ó¥×¥ì¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Ñ¥¹Ì¾
-     */
-    function getTemplatedir()
-    {
-        return $this->controller->getTemplatedir();
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÎÀßÄê¥Ç¥£¥ì¥¯¥È¥ê¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return string  ÀßÄê¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Ñ¥¹Ì¾
-     */
-    function getEtcdir()
-    {
-        return $this->controller->getDirectory('etc');
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥Æ¥ó¥Ý¥é¥ê¥Ç¥£¥ì¥¯¥È¥ê¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return string  ¥Æ¥ó¥Ý¥é¥ê¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Ñ¥¹Ì¾
-     */
-    function getTmpdir()
-    {
-        return $this->controller->getDirectory('tmp');
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë³ÈÄ¥»Ò¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return string  ¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤Î³ÈÄ¥»Ò
-     */
-    function getTemplateext()
-    {
-        return $this->controller->getExt('tpl');
-    }
-
-    /**
-     *  ¥í¥°¤ò½ÐÎϤ¹¤ë
-     *
-     *  @access public
-     *  @param  int     $level      ¥í¥°¥ì¥Ù¥ë(LOG_DEBUG, LOG_NOTICE...)
-     *  @param  string  $message    ¥í¥°¥á¥Ã¥»¡¼¥¸(printf·Á¼°)
-     */
-    function log($level, $message)
-    {
-        $args = func_get_args();
-        if (count($args) > 2) {
-            array_splice($args, 0, 2);
-            $message = vsprintf($message, $args);
-        }
-        $this->logger->log($level, $message);
-    }
-
-    /**
-     *  ¥Ð¥Ã¥¯¥¨¥ó¥É½èÍý¤ò¼Â¹Ô¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $action_name    ¼Â¹Ô¤¹¤ë¥¢¥¯¥·¥ç¥ó¤Î̾¾Î
-     *  @return mixed   (string):Forward̾(null¤Ê¤éforward¤·¤Ê¤¤) Ethna_Error:¥¨¥é¡¼
-     */
-    function perform($action_name)
-    {
-        $forward_name = null;
-
-        $action_class_name = $this->controller->getActionClassName($action_name);
-        $this->action_class =& new $action_class_name($this);
-        $this->ac =& $this->action_class;
-
-        // ¥¢¥¯¥·¥ç¥ó¤Î¼Â¹Ô
-        $forward_name = $this->ac->authenticate();
-        if ($forward_name === false) {
-            return null;
-        } else if ($forward_name !== null) {
-            return $forward_name;
-        }
-
-        $forward_name = $this->ac->prepare();
-        if ($forward_name === false) {
-            return null;
-        } else if ($forward_name !== null) {
-            return $forward_name;
-        }
-
-        $forward_name = $this->ac->perform();
-
-        return $forward_name;
-    }
-
-    /**
-     *  DB¥ª¥Ö¥¸¥§¥¯¥È¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @param  string  $db_key DB¥­¡¼
-     *  @return mixed   Ethna_DB:DB¥ª¥Ö¥¸¥§¥¯¥È null:DSNÀßÄê¤Ê¤· Ethna_Error:¥¨¥é¡¼
-     *  @todo   ¤³¤ÎÃæ¤Çnew¤·¤Ê¤¤¤Çclass factory¤òÍøÍѤ¹¤ë
-     */
-    function &getDB($db_key = "")
-    {
-        $null = null;
-        $db_varname =& $this->_getDBVarname($db_key);
-
-        if (Ethna::isError($db_varname)) {
-            return $db_varname;
-        }
-
-        if (isset($this->db_list[$db_varname]) && $this->db_list[$db_varname] != null) {
-            return $this->db_list[$db_varname];
-        }
-
-        $dsn = $this->controller->getDSN($db_key);
-
-        if ($dsn == "") {
-            // DBÀܳÉÔÍ×
-            return $null;
-        }
-
-        $dsn_persistent = $this->controller->getDSN_persistent($db_key);
-
-        $class_factory =& $this->controller->getClassFactory();
-        $db_class_name = $class_factory->getObjectName('db');
-        
-        // BC: Ethna_DB -> Ethna_DB_PEAR
-        if ($db_class_name == 'Ethna_DB') {
-            $db_class_name = 'Ethna_DB_PEAR';
-        }
-        if (class_exists($db_class_name) === false) {
-            $class_factory->_include($db_class_name);
-        }
-
-        $this->db_list[$db_varname] =& new $db_class_name($this->controller, $dsn, $dsn_persistent);
-        $r = $this->db_list[$db_varname]->connect();
-        if (Ethna::isError($r)) {
-            $this->db_list[$db_varname] = null;
-            return $r;
-        }
-
-        register_shutdown_function(array(&$this, 'shutdownDB'));
-
-        return $this->db_list[$db_varname];
-    }
-
-    /**
-     *  DB¥ª¥Ö¥¸¥§¥¯¥È(Á´¤Æ)¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return mixed   array:Ethna_DB¥ª¥Ö¥¸¥§¥¯¥È¤Î°ìÍ÷ Ethan_Error:(¤¤¤º¤ì¤«°ì¤Ä°Ê¾å¤ÎÀܳ¤Ç)¥¨¥é¡¼
-     */
-    function getDBList()
-    {
-        $r = array();
-        $db_define_list = $this->controller->getDBType();
-        foreach ($db_define_list as $db_key => $db_type) {
-            $db =& $this->getDB($db_key);
-            if (Ethna::isError($db)) {
-                return $r;
-            }
-            $elt = array();
-            $elt['db'] =& $db;
-            $elt['key'] = $db_key;
-            $elt['type'] = $db_type;
-            $elt['varname'] = "db";
-            if ($db_key != "") {
-                $elt['varname'] = sprintf("db_%s", strtolower($db_key));
-            }
-            $r[] = $elt;
-        }
-        return $r;
-    }
-
-    /**
-     *  DB¥³¥Í¥¯¥·¥ç¥ó¤òÀÚÃǤ¹¤ë
-     *
-     *  @access public
-     */
-    function shutdownDB()
-    {
-        foreach (array_keys($this->db_list) as $key) {
-            if ($this->db_list[$key] != null && $this->db_list[$key]->isValid()) {
-                $this->db_list[$key]->disconnect();
-                unset($this->db_list[$key]);
-            }
-        }
-    }
-
-    /**
-     *  »ØÄꤵ¤ì¤¿DB¥­¡¼¤ËÂбþ¤¹¤ë(Åö³ºDB¥ª¥Ö¥¸¥§¥¯¥È¤ò³ÊǼ¤¹¤ë¤¿¤á¤Î)¥á¥ó¥ÐÊÑ¿ô̾¤ò¼èÆÀ¤¹¤ë
-     *
-     *  ÀµÄ¾¤â¤¦Íפé¤Ê¤¤¤Î¤Ç¤¹¤¬¡¢¸åÊý¸ß´¹À­°Ý»ý¤Î¤¿¤á¤Ë°ì±þ»Ä¤·¤Æ¤¢¤ë¾õÂ֤Ǥ¹
-     *  (Ethna_AppManager¥¯¥é¥¹¤Ê¤É¤Ç¡¢$this->db¤È¤«¤·¤Æ¤¤¤ë²Õ½ê¤¬¾¯¤Ê¤«¤é¤º¤¢
-     *  ¤ë¤Î¤Ç)
-     *
-     *  @access private
-     *  @param  string  $db_key DB¥­¡¼
-     *  @return mixed   string:¥á¥ó¥ÐÊÑ¿ô̾ Ethna_Error:ÉÔÀµ¤ÊDB¼ïÊÌ
-     */
-    function &_getDBVarname($db_key = "")
-    {
-        $r = $this->controller->getDBType($db_key);
-        if (is_null($r)) {
-            return Ethna::raiseError("̤ÄêµÁ¤ÎDB¼ïÊÌ[%s]", E_DB_INVALIDTYPE, $db_key);
-        }
-
-        if ($db_key == "") {
-            $db_varname = "";
-        } else {
-            $db_varname = sprintf("%s", strtolower($db_key));
-        }
-
-        return $db_varname;
-    }
-}
-// }}}
-?>
diff --git a/class/Ethna_CacheManager.php b/class/Ethna_CacheManager.php
deleted file mode 100644 (file)
index 5c58685..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-// vim: foldmethod=marker tabstop=4 shiftwidth=4 autoindent
-/**
- *  Ethna_CacheManager.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-/**
- *  ¥­¥ã¥Ã¥·¥å¥Þ¥Í¡¼¥¸¥ã¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_CacheManager
-{
-    /**
-     *  Cachemaanger ¥×¥é¥°¥¤¥ó¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @param  string  $type   ¥­¥ã¥Ã¥·¥å¥¿¥¤¥×('localfile', 'memcache'...)
-     *  @return object  Ethna_Plugin_CacheMaanger   Cachemanager ¥×¥é¥°¥¤¥ó¤Î¥¤¥ó¥¹¥¿¥ó¥¹
-     *  @access public
-     */
-    function &getInstance($type)
-    {
-        $controller =& Ethna_Controller::getInstance();
-        $plugin =& $controller->getPlugin();
-
-        $cache_manager =& $plugin->getPlugin('Cachemanager', ucfirst($type));
-
-        return $cache_manager;
-    }
-}
-?>
diff --git a/class/Ethna_ClassFactory.php b/class/Ethna_ClassFactory.php
deleted file mode 100644 (file)
index ea73541..0000000
+++ /dev/null
@@ -1,385 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_ClassFactory.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_ClassFactory
-/**
- *  Ethna¥Õ¥ì¡¼¥à¥ï¡¼¥¯¤Î¥ª¥Ö¥¸¥§¥¯¥ÈÀ¸À®¥²¡¼¥È¥¦¥§¥¤
- *
- *  DI¥³¥ó¥Æ¥Ê¤«¡¢¤È¤¤¤¦¤³¤È¤â¹Í¤¨¤Þ¤·¤¿¤¬Ethna¤Ç¤Ï¤³¤ÎÄøÅÙ¤Îñ½ã¤Ê¤â¤Î¤Ë
- *  Î±¤á¤Æ¤ª¤­¤Þ¤¹¡£¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ì¥Ù¥ëDI¤·¤¿¤¤¾ì¹ç¤Ï¥Õ¥£¥ë¥¿¥Á¥§¥¤¥ó¤ò
- *  »È¤Ã¤Æ¼Â¸½¤¹¤ë¤³¤È¤â½ÐÍè¤Þ¤¹¡£
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_ClassFactory
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    object  Ethna_Controller    controller¥ª¥Ö¥¸¥§¥¯¥È */
-    var $controller;
-
-    /** @var    object  Ethna_Controller    controller¥ª¥Ö¥¸¥§¥¯¥È(¾Êά·Á) */
-    var $ctl;
-    
-    /** @var    array   ¥¯¥é¥¹ÄêµÁ */
-    var $class = array();
-
-    /** @var    array   À¸À®ºÑ¤ß¥ª¥Ö¥¸¥§¥¯¥È¥­¥ã¥Ã¥·¥å */
-    var $object = array();
-
-    /** @var    array   À¸À®ºÑ¤ß¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Þ¥Í¡¼¥¸¥ã¥ª¥Ö¥¸¥§¥¯¥È¥­¥ã¥Ã¥·¥å */
-    var $manager = array();
-
-    /** @var    array   ¥á¥½¥Ã¥É°ìÍ÷¥­¥ã¥Ã¥·¥å */
-    var $method_list = array();
-
-    /**#@-*/
-
-
-    /**
-     *  Ethna_ClassFactory¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Controller    &$controller    controller¥ª¥Ö¥¸¥§¥¯¥È
-     *  @param  array                       $class          ¥¯¥é¥¹ÄêµÁ
-     */
-    function Ethna_ClassFactory(&$controller, $class)
-    {
-        $this->controller =& $controller;
-        $this->ctl =& $controller;
-        $this->class = $class;
-    }
-
-    /**
-     *  type¤ËÂбþ¤¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Þ¥Í¡¼¥¸¥ã¥ª¥Ö¥¸¥§¥¯¥È¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @return object  Ethna_AppManager    ¥Þ¥Í¡¼¥¸¥ã¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &getManager($type, $weak = false)
-    {
-        $obj = null;
-
-        // check if object class exists
-        $obj_class_name = $this->controller->getObjectClassName($type);
-        if (class_exists($obj_class_name) === false) {
-            // try include.
-            $this->_include($obj_class_name);
-        }
-
-        // check if manager class exists
-        $class_name = $this->controller->getManagerClassName($type);
-        if (class_exists($class_name) === false
-            && $this->_include($class_name) === false) {
-            return $obj;
-        }
-
-        if (isset($this->method_list[$class_name]) == false) {
-            $this->method_list[$class_name] = get_class_methods($class_name);
-            for ($i = 0; $i < count($this->method_list[$class_name]); $i++) {
-                $this->method_list[$class_name][$i] = strtolower($this->method_list[$class_name][$i]);
-            }
-        }
-
-        // see if this should be singlton or not
-        if ($this->_isCacheAvailable($class_name, $this->method_list[$class_name], $weak)) {
-            if (isset($this->manager[$type]) && is_object($this->manager[$type])) {
-                return $this->manager[$type];
-            }
-        }
-
-        // see if we have helper methods
-        if (in_array("getinstance", $this->method_list[$class_name])) {
-            $obj =& call_user_func(array($class_name, 'getInstance'));
-        } else {
-            $backend =& $this->controller->getBackend();
-            $obj =& new $class_name($backend);
-        }
-
-        if (isset($this->manager[$type]) == false || is_object($this->manager[$type]) == false) {
-            $this->manager[$type] =& $obj;
-        }
-
-        return $obj;
-    }
-
-    /**
-     *  ¥¯¥é¥¹¥­¡¼¤ËÂбþ¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤òÊÖ¤¹/¥¯¥é¥¹¥­¡¼¤¬Ì¤ÄêµÁ¤Î¾ì¹ç¤ÏAppObject¤òõ¤¹
-     *
-     *  @access public
-     *  @param  string  $key    ¥¯¥é¥¹¥­¡¼
-     *  @param  bool    $weak   ¥ª¥Ö¥¸¥§¥¯¥È¤¬Ì¤À¸À®¤Î¾ì¹ç¤Î¶¯À©À¸À®¥Õ¥é¥°(default: false)
-     *  @return object  À¸À®¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È(¥¨¥é¡¼¤Ê¤énull)
-     */
-    function &getObject($key, $ext = false)
-    {
-        $object = null;
-
-        $ext = to_array($ext);
-        if (isset($this->class[$key]) == false) {
-            // app object
-            $class_name = $this->controller->getObjectClassName($key);
-            $ext = array_pad($ext, 3, null);
-            list($key_type, $key_value, $prop) = $ext;
-        } else {
-            // ethna classes
-            $class_name = $this->class[$key];
-            $ext = array_pad($ext, 1, null);
-            list($weak) = $ext;
-        }
-
-        // try to include if not defined
-        if (class_exists($class_name) == false) {
-            if ($this->_include($class_name) == false) {
-                return $object;
-            }
-        }
-
-        // handle app object first
-        if (isset($this->class[$key]) == false) {
-            $backend =& $this->controller->getBackend();
-            $object =& new $class_name($backend, $key_type, $key_value, $prop);
-            return $object;
-        }
-
-        if (isset($this->method_list[$class_name]) == false) {
-            $this->method_list[$class_name] = get_class_methods($class_name);
-            for ($i = 0; $i < count($this->method_list[$class_name]); $i++) {
-                $this->method_list[$class_name][$i] = strtolower($this->method_list[$class_name][$i]);
-            }
-        }
-
-        // see if this should be singlton or not
-        if ($this->_isCacheAvailable($class_name, $this->method_list[$class_name], $weak)) {
-            if (isset($this->object[$key]) && is_object($this->object[$key])) {
-                return $this->object[$key];
-            }
-        }
-
-        // see if we have helper methods
-        $method = sprintf('_getObject_%s', ucfirst($key));
-        if (method_exists($this, $method)) {
-            $object =& $this->$method($class_name);
-        } else if (in_array("getinstance", $this->method_list[$class_name])) {
-            $object =& call_user_func(array($class_name, 'getInstance'));
-        } else {
-            $object =& new $class_name();
-        }
-
-        if (isset($this->object[$key]) == false || is_object($this->object[$key]) == false) {
-            $this->object[$key] =& $object;
-        }
-
-        return $object;
-    }
-
-    /**
-     *  ¥¯¥é¥¹¥­¡¼¤ËÂбþ¤¹¤ë¥¯¥é¥¹Ì¾¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @param  string  $key    ¥¯¥é¥¹¥­¡¼
-     *  @return string  ¥¯¥é¥¹Ì¾
-     */
-    function getObjectName($key)
-    {
-        if (isset($this->class[$key]) == false) {
-            return null;
-        }
-
-        return $this->class[$key];
-    }
-
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥ÈÀ¸À®¥á¥½¥Ã¥É(backend)
-     *
-     *  @access protected
-     *  @param  string  $class_name     ¥¯¥é¥¹Ì¾
-     *  @return object  À¸À®¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È(¥¨¥é¡¼¤Ê¤énull)
-     */
-    function &_getObject_Backend($class_name)
-    {
-        $_ret_object =& new $class_name($this->ctl);
-        return $_ret_object;
-    }
-
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥ÈÀ¸À®¥á¥½¥Ã¥É(config)
-     *
-     *  @access protected
-     *  @param  string  $class_name     ¥¯¥é¥¹Ì¾
-     *  @return object  À¸À®¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È(¥¨¥é¡¼¤Ê¤énull)
-     */
-    function &_getObject_Config($class_name)
-    {
-        $_ret_object =& new $class_name($this->ctl);
-        return $_ret_object;
-    }
-
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥ÈÀ¸À®¥á¥½¥Ã¥É(i18n)
-     *
-     *  @access protected
-     *  @param  string  $class_name     ¥¯¥é¥¹Ì¾
-     *  @return object  À¸À®¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È(¥¨¥é¡¼¤Ê¤énull)
-     */
-    function &_getObject_I18n($class_name)
-    {
-        $_ret_object =& new $class_name($this->ctl->getDirectory('locale'), $this->ctl->getAppId());
-        return $_ret_object;
-    }
-
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥ÈÀ¸À®¥á¥½¥Ã¥É(logger)
-     *
-     *  @access protected
-     *  @param  string  $class_name     ¥¯¥é¥¹Ì¾
-     *  @return object  À¸À®¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È(¥¨¥é¡¼¤Ê¤énull)
-     */
-    function &_getObject_Logger($class_name)
-    {
-        $_ret_object =& new $class_name($this->ctl);
-        return $_ret_object;
-    }
-
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥ÈÀ¸À®¥á¥½¥Ã¥É(plugin)
-     *
-     *  @access protected
-     *  @param  string  $class_name     ¥¯¥é¥¹Ì¾
-     *  @return object  À¸À®¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È(¥¨¥é¡¼¤Ê¤énull)
-     */
-    function &_getObject_Plugin($class_name)
-    {
-        $_ret_object =& new $class_name($this->ctl);
-        return $_ret_object;
-    }
-
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥ÈÀ¸À®¥á¥½¥Ã¥É(renderer)
-     *
-     *  @access protected
-     *  @param  string  $class_name     ¥¯¥é¥¹Ì¾
-     *  @return object  À¸À®¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È(¥¨¥é¡¼¤Ê¤énull)
-     */
-    function &_getObject_Renderer($class_name)
-    {
-        $_ret_object =& new $class_name($this->ctl);
-        return $_ret_object;
-    }
-
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥ÈÀ¸À®¥á¥½¥Ã¥É(session)
-     *
-     *  @access protected
-     *  @param  string  $class_name     ¥¯¥é¥¹Ì¾
-     *  @return object  À¸À®¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È(¥¨¥é¡¼¤Ê¤énull)
-     */
-    function &_getObject_Session($class_name)
-    {
-        $_ret_object =& new $class_name($this->ctl->getAppId(), $this->ctl->getDirectory('tmp'), $this->ctl->getLogger());
-        return $_ret_object;
-    }
-
-    /**
-     *  ¥ª¥Ö¥¸¥§¥¯¥ÈÀ¸À®¥á¥½¥Ã¥É(sql)
-     *
-     *  @access protected
-     *  @param  string  $class_name     ¥¯¥é¥¹Ì¾
-     *  @return object  À¸À®¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È(¥¨¥é¡¼¤Ê¤énull)
-     */
-    function &_getObject_Sql($class_name)
-    {
-        $_ret_object =& new $class_name($this->ctl);
-        return $_ret_object;
-    }
-
-    /**
-     *  »ØÄꤵ¤ì¤¿¥¯¥é¥¹¤«¤éÁÛÄꤵ¤ì¤ë¥Õ¥¡¥¤¥ë¤òinclude¤¹¤ë
-     *
-     *  @access protected
-     */
-    function _include($class_name)
-    {
-        $file = sprintf("%s.%s", $class_name, $this->controller->getExt('php'));
-        if (file_exists_ex($file)) {
-            include_once $file;
-            return true;
-        }
-
-        if (preg_match('/^(\w+?)_(.*)/', $class_name, $match)) {
-            // try ethna app style
-            // App_Foo_Bar_Baz -> Foo/Bar/App_Foo_Bar_Baz.php
-            $tmp = explode("_", $match[2]);
-            $tmp[count($tmp)-1] = $class_name;
-            $file = sprintf('%s.%s',
-                            implode(DIRECTORY_SEPARATOR, $tmp),
-                            $this->controller->getExt('php'));
-            if (file_exists_ex($file)) {
-                include_once $file;
-                return true;
-            }
-
-            // try ethna app & pear mixed style
-            // App_Foo_Bar_Baz -> Foo/Bar/Baz.php
-            $file = sprintf('%s.%s',
-                            str_replace('_', DIRECTORY_SEPARATOR, $match[2]),
-                            $this->controller->getExt('php'));
-            if (file_exists_ex($file)) {
-                include_once $file;
-                return true;
-            }
-
-            // try ethna master style
-            // Ethna_Foo_Bar -> class/Ethna/Foo/Ethna_Foo_Bar.php
-            array_unshift($tmp, 'Ethna', 'class');
-            $file = sprintf('%s.%s',
-                            implode(DIRECTORY_SEPARATOR, $tmp),
-                            $this->controller->getExt('php'));
-            if (file_exists_ex($file)) {
-                include_once $file;
-                return true;
-            }
-
-            // try pear style
-            // Foo_Bar_Baz -> Foo/Bar/Baz.php
-            $file = sprintf('%s.%s',
-                            str_replace('_', DIRECTORY_SEPARATOR, $class_name),
-                            $this->controller->getExt('php'));
-            if (file_exists_ex($file)) {
-                include_once $file;
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     *  »ØÄꤵ¤ì¤¿¥¯¥é¥¹¤¬¥­¥ã¥Ã¥·¥å¤òÍøÍѲÄǽ¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë
-     *
-     *  @access protected
-     */
-    function _isCacheAvailable($class_name, $method_list, $weak)
-    {
-        // if we have getInstance(), use this anyway
-        if (in_array('getinstance', $method_list)) {
-            return false;
-        }
-
-        // if not, see if weak or not
-        return $weak ? false : true;
-    }
-}
-// }}}
-?>
diff --git a/class/Ethna_Config.php b/class/Ethna_Config.php
deleted file mode 100644 (file)
index b84a502..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Config.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Config
-/**
- *  ÀßÄꥯ¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Config
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    object  Ethna_Controller    controller¥ª¥Ö¥¸¥§¥¯¥È */
-    var $controller;
-    
-    /** @var    array   ÀßÄêÆâÍÆ */
-    var $config = null;
-
-    /**#@-*/
-
-
-    /**
-     *  Ethna_Config¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Controller    &$controller    controller¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function Ethna_Config(&$controller)
-    {
-        $this->controller =& $controller;
-
-        // ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß
-        $r = $this->_getConfig();
-        if (Ethna::isError($r)) {
-            // ¤³¤Î»þÅÀ¤Ç¤ÏloggingÅù¤Ï½ÐÍè¤Ê¤¤(Logger¥ª¥Ö¥¸¥§¥¯¥È¤¬À¸À®¤µ¤ì¤Æ¤¤¤Ê¤¤)
-            $fp = fopen("php://stderr", "r");
-            fputs($fp, sprintf("error occured while reading config file(s) [%s]\n"), $r->getInfo(0));
-            fclose($fp);
-            $this->controller->fatal();
-        }
-    }
-
-    /**
-     *  ÀßÄêÃͤؤΥ¢¥¯¥»¥µ(R)
-     *
-     *  @access public
-     *  @param  string  $key    ÀßÄê¹àÌÜ̾
-     *  @return string  ÀßÄêÃÍ
-     */
-    function get($key = null)
-    {
-        if (is_null($key)) {
-            return $this->config;
-        }
-        if (isset($this->config[$key]) == false) {
-            return null;
-        }
-        return $this->config[$key];
-    }
-
-    /**
-     *  ÀßÄêÃͤؤΥ¢¥¯¥»¥µ(W)
-     *
-     *  @access public
-     *  @param  string  $key    ÀßÄê¹àÌÜ̾
-     *  @param  string  $value  ÀßÄêÃÍ
-     */
-    function set($key, $value)
-    {
-        $this->config[$key] = $value;
-    }
-
-    /**
-     *  ÀßÄê¥Õ¥¡¥¤¥ë¤ò¹¹¿·¤¹¤ë
-     *
-     *  @access public
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function update()
-    {
-        return $this->_setConfig();
-    }
-
-    /**
-     *  ÀßÄê¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤à
-     *
-     *  @access private
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function _getConfig()
-    {
-        $config = array();
-        $file = $this->_getConfigFile();
-        if (file_exists($file)) {
-            $lh = Ethna_Util::lockFile($file, 'r');
-            if (Ethna::isError($lh)) {
-                return $lh;
-            }
-
-            include($file);
-
-            Ethna_Util::unlockFile($lh);
-        }
-
-        // ¥Ç¥Õ¥©¥ë¥ÈÃÍÀßÄê
-        if (isset($_SERVER['HTTP_HOST']) && isset($config['url']) == false) {
-            $config['url'] = sprintf("http://%s", $_SERVER['HTTP_HOST']);
-        }
-        if (isset($config['dsn']) == false) {
-            $config['dsn'] = "";
-        }
-        if (isset($config['log_facility']) == false) {
-            $config['log_facility'] = "";
-        }
-        if (isset($config['log_level']) == false) {
-            $config['log_level'] = "";
-        }
-        if (isset($config['log_option']) == false) {
-            $config['log_option'] = "";
-        }
-
-        $this->config = $config;
-
-        return 0;
-    }
-
-    /**
-     *  ÀßÄê¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤à
-     *
-     *  @access private
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function _setConfig()
-    {
-        $file = $this->_getConfigFile();
-
-        $lh = Ethna_Util::lockFile($file, 'w');
-        if (Ethna::isError($lh)) {
-            return $lh;
-        }
-
-        $fp = fopen($file, 'w');
-        if ($fp == null) {
-            return Ethna::raiseError("¥Õ¥¡¥¤¥ë½ñ¤­¹þ¤ß¥¨¥é¡¼[%s]", E_APP_WRITE, $file);
-        }
-        fwrite($fp, "<?php\n");
-        fwrite($fp, sprintf("/*\n * %s\n *\n * update: %s\n */\n", basename($file), strftime('%Y/%m/%d %H:%M:%S')));
-        fwrite($fp, "\$config = array(\n");
-        foreach ($this->config as $key => $value) {
-            $this->_setConfigValue($fp, $key, $value, 0);
-        }
-        fwrite($fp, ");\n?>\n");
-        fclose($fp);
-
-        Ethna_Util::unlockFile($lh);
-
-        return 0;
-    }
-
-    /**
-     *  ÀßÄê¥Õ¥¡¥¤¥ë¤ËÀßÄêÃͤò½ñ¤­¹þ¤à
-     *
-     *  @access private
-     */
-    function _setConfigValue($fp, $key, $value, $level)
-    {
-        fputs($fp, sprintf("%s'%s' => ", str_repeat("    ", $level+1), $key));
-        if (is_array($value)) {
-            fputs($fp, sprintf("array(\n"));
-            foreach ($value as $k => $v) {
-                $this->_setConfigValue($fp, $k, $v, $level+1);
-            }
-            fputs($fp, sprintf("%s),\n", str_repeat("    ", $level+1)));
-        } else {
-            fputs($fp, sprintf("'%s',\n", $value));
-        }
-    }
-
-    /**
-     *  ÀßÄê¥Õ¥¡¥¤¥ë̾¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @return string  ÀßÄê¥Õ¥¡¥¤¥ë¤Ø¤Î¥Õ¥ë¥Ñ¥¹Ì¾
-     */
-    function _getConfigFile()
-    {
-        return $this->controller->getDirectory('etc') . '/' . strtolower($this->controller->getAppId()) . '-ini.php';
-    }
-}
-// }}}
-?>
diff --git a/class/Ethna_Controller.php b/class/Ethna_Controller.php
deleted file mode 100644 (file)
index be5e30a..0000000
+++ /dev/null
@@ -1,2125 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Controller.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Controller
-/**
- *  ¥³¥ó¥È¥í¡¼¥é¥¯¥é¥¹
- *
- *  @todo       gateway¤Çswitch¤·¤Æ¤ë¤È¤³¤í¤¬¥À¥µ¥À¥µ
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Controller
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    string      ¥¢¥×¥ê¥±¡¼¥·¥ç¥óID */
-    var $appid = 'ETHNA';
-
-    /** @var    string      ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê */
-    var $base = '';
-
-    /** @var    string      ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Ù¡¼¥¹URL */
-    var $url = '';
-
-    /** @var    string      ¥¢¥×¥ê¥±¡¼¥·¥ç¥óDSN(Data Source Name) */
-    var $dsn;
-
-    /** @var    array       ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Ç¥£¥ì¥¯¥È¥ê */
-    var $directory = array();
-
-    /** @var    array       ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Ç¥£¥ì¥¯¥È¥ê(¥Ç¥Õ¥©¥ë¥È) */
-    var $directory_default = array(
-        'action'        => 'app/action',
-        'action_cli'    => 'app/action_cli',
-        'action_xmlrpc' => 'app/action_xmlrpc',
-        'app'           => 'app',
-        'plugin'        => 'app/plugin',
-        'bin'           => 'bin',
-        'etc'           => 'etc',
-        'filter'        => 'app/filter',
-        'locale'        => 'locale',
-        'log'           => 'log',
-        'plugins'       => array(),
-        'template'      => 'template',
-        'template_c'    => 'tmp',
-        'tmp'           => 'tmp',
-        'view'          => 'app/view',
-        'www'           => 'www',
-    );
-
-    /** @var    array       DB¥¢¥¯¥»¥¹ÄêµÁ */
-    var $db = array(
-        ''              => DB_TYPE_RW,
-    );
-
-    /** @var    array       ³ÈÄ¥»ÒÀßÄê */
-    var $ext = array(
-        'php'           => 'php',
-        'tpl'           => 'tpl',
-    );
-
-    /** @var    array       ¥¯¥é¥¹ÀßÄê */
-    var $class = array();
-
-    /** @var    array       ¥¯¥é¥¹ÀßÄê(¥Ç¥Õ¥©¥ë¥È) */
-    var $class_default = array(
-        'class'         => 'Ethna_ClassFactory',
-        'backend'       => 'Ethna_Backend',
-        'config'        => 'Ethna_Config',
-        'db'            => 'Ethna_DB',
-        'error'         => 'Ethna_ActionError',
-        'form'          => 'Ethna_ActionForm',
-        'i18n'          => 'Ethna_I18N',
-        'logger'        => 'Ethna_Logger',
-        'plugin'        => 'Ethna_Plugin',
-        'renderer'      => 'Ethna_Renderer_Smarty',
-        'session'       => 'Ethna_Session',
-        'sql'           => 'Ethna_AppSQL',
-        'view'          => 'Ethna_ViewClass',
-        'url_handler'   => 'Ethna_UrlHandler',
-    );
-
-    /** @var    array       ¸¡º÷ÂоݤȤʤë¥×¥é¥°¥¤¥ó¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥óID¤Î¥ê¥¹¥È */
-    var $plugin_search_appids;
-
-    /** @var    array       ¥Õ¥£¥ë¥¿ÀßÄê */
-    var $filter = array(
-    );
-
-    /** @var    string      »ÈÍѸÀ¸ìÀßÄê */
-    var $language;
-
-    /** @var    string      ¥·¥¹¥Æ¥à¦¥¨¥ó¥³¡¼¥Ç¥£¥ó¥° */
-    var $system_encoding;
-
-    /** @var    string      ¥¯¥é¥¤¥¢¥ó¥È¦¥¨¥ó¥³¡¼¥Ç¥£¥ó¥° */
-    var $client_encoding;
-
-    /** @var    string  ¸½ºß¼Â¹ÔÃæ¤Î¥¢¥¯¥·¥ç¥ó̾ */
-    var $action_name;
-
-    /** @var    string  ¸½ºß¼Â¹ÔÃæ¤ÎXMLRPC¥á¥½¥Ã¥É̾ */
-    var $xmlrpc_method_name;
-
-    /** @var    array   forwardÄêµÁ */
-    var $forward = array();
-
-    /** @var    array   actionÄêµÁ */
-    var $action = array();
-
-    /** @var    array   action(CLI)ÄêµÁ */
-    var $action_cli = array();
-
-    /** @var    array   action(XMLRPC)ÄêµÁ */
-    var $action_xmlrpc = array();
-
-    /** @var    array   ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Þ¥Í¡¼¥¸¥ãÄêµÁ */
-    var $manager = array();
-
-    /** @var    object  ¥ì¥ó¥À¥é¡¼ */
-    var $renderer = null;
-
-    /** @var    array   smarty modifierÄêµÁ */
-    var $smarty_modifier_plugin = array();
-
-    /** @var    array   smarty functionÄêµÁ */
-    var $smarty_function_plugin = array();
-
-    /** @var    array   smarty blockÄêµÁ */
-    var $smarty_block_plugin = array();
-
-    /** @var    array   smarty prefilterÄêµÁ */
-    var $smarty_prefilter_plugin = array();
-
-    /** @var    array   smarty postfilterÄêµÁ */
-    var $smarty_postfilter_plugin = array();
-
-    /** @var    array   smarty outputfilterÄêµÁ */
-    var $smarty_outputfilter_plugin = array();
-
-
-    /** @var    array   ¥Õ¥£¥ë¥¿¡¼¥Á¥§¥¤¥ó(Ethna_Filter¥ª¥Ö¥¸¥§¥¯¥È¤ÎÇÛÎó) */
-    var $filter_chain = array();
-
-    /** @var    object  Ethna_ClassFactory  ¥¯¥é¥¹¥Õ¥¡¥¯¥È¥ê¥ª¥Ö¥¸¥§¥¯¥È */
-    var $class_factory = null;
-
-    /** @var    object  Ethna_ActionForm    ¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È */
-    var $action_form = null;
-
-    /** @var    object  Ethna_View          ¥Ó¥å¡¼¥ª¥Ö¥¸¥§¥¯¥È */
-    var $view = null;
-
-    /** @var    object  Ethna_Config        ÀßÄꥪ¥Ö¥¸¥§¥¯¥È */
-    var $config = null;
-
-    /** @var    object  Ethna_Logger        ¥í¥°¥ª¥Ö¥¸¥§¥¯¥È */
-    var $logger = null;
-
-    /** @var    object  Ethna_Plugin        ¥×¥é¥°¥¤¥ó¥ª¥Ö¥¸¥§¥¯¥È */
-    var $plugin = null;
-
-    /** @var    string  ¥ê¥¯¥¨¥¹¥È¤Î¥²¡¼¥È¥¦¥§¥¤(www/cli/rest/xmlrpc/soap...) */
-    var $gateway = GATEWAY_WWW;
-
-    /**#@-*/
-
-
-    /**
-     *  Ethna_Controller¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access     public
-     */
-    function Ethna_Controller($gateway = GATEWAY_WWW)
-    {
-        $GLOBALS['_Ethna_controller'] =& $this;
-        if ($this->base === "") {
-            // Ethna¥³¥Þ¥ó¥É¤Ê¤É¤ÇBASE¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤¬¤¢¤ë
-            if (defined('BASE')) {
-                $this->base = BASE;
-            }
-        }
-
-        $this->gateway = $gateway;
-
-        // ¥¯¥é¥¹ÀßÄê¤Î̤ÄêµÁÃͤòÊä´°
-        foreach ($this->class_default as $key => $val) {
-            if (isset($this->class[$key]) == false) {
-                $this->class[$key] = $val;
-            }
-        }
-
-        // ¥Ç¥£¥ì¥¯¥È¥êÀßÄê¤Î̤ÄêµÁÃͤòÊä´°
-        foreach ($this->directory_default as $key => $val) {
-            if (isset($this->directory[$key]) == false) {
-                $this->directory[$key] = $val;
-            }
-        }
-
-        // ¥¯¥é¥¹¥Õ¥¡¥¯¥È¥ê¥ª¥Ö¥¸¥§¥¯¥È¤ÎÀ¸À®
-        $class_factory = $this->class['class'];
-        $this->class_factory =& new $class_factory($this, $this->class);
-
-        // ¥¨¥é¡¼¥Ï¥ó¥É¥é¤ÎÀßÄê
-        Ethna::setErrorCallback(array(&$this, 'handleError'));
-
-        // ¥Ç¥£¥ì¥¯¥È¥ê̾¤ÎÀßÄê(ÁêÂХѥ¹->ÀäÂХѥ¹)
-        foreach ($this->directory as $key => $value) {
-            if ($key == 'plugins') {
-                // Smarty¥×¥é¥°¥¤¥ó¥Ç¥£¥ì¥¯¥È¥ê¤ÏÇÛÎó¤Ç»ØÄꤹ¤ë
-                $tmp = array();
-                foreach (to_array($value) as $elt) {
-                    if (Ethna_Util::isAbsolute($elt) == false) {
-                        $tmp[] = $this->base . (empty($this->base) ? '' : '/') . $elt;
-                    }
-                }
-                $this->directory[$key] = $tmp;
-            } else {
-                if (Ethna_Util::isAbsolute($value) == false) {
-                    $this->directory[$key] = $this->base . (empty($this->base) ? '' : '/') . $value;
-                }
-            }
-        }
-
-        // ½é´üÀßÄê
-        list($this->language, $this->system_encoding, $this->client_encoding) = $this->_getDefaultLanguage();
-
-        $this->config =& $this->getConfig();
-        $this->dsn = $this->_prepareDSN();
-        $this->url = $this->config->get('url');
-
-        // ¥×¥é¥°¥¤¥ó¥ª¥Ö¥¸¥§¥¯¥È¤ÎÍÑ°Õ
-        $this->plugin =& $this->getPlugin();
-
-        //// assert (experimental)
-        //if ($this->config->get('debug') === false) {
-        //    ini_set('assert.active', 0);
-        //}
-
-        // ¥í¥°½ÐÎϳ«»Ï
-        $this->logger =& $this->getLogger();
-        $this->plugin->setLogger($this->logger);
-        $this->logger->begin();
-
-        // Ethna¥Þ¥Í¡¼¥¸¥ãÀßÄê
-        $this->_activateEthnaManager();
-    }
-
-    /**
-     *  (¸½ºß¥¢¥¯¥Æ¥£¥Ö¤Ê)¥³¥ó¥È¥í¡¼¥é¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @return object  Ethna_Controller    ¥³¥ó¥È¥í¡¼¥é¤Î¥¤¥ó¥¹¥¿¥ó¥¹
-     *  @static
-     */
-    function &getInstance()
-    {
-        if (isset($GLOBALS['_Ethna_controller'])) {
-            return $GLOBALS['_Ethna_controller'];
-        } else {
-            $_ret_object = null;
-            return $_ret_object;
-        }
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥óID¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @return string  ¥¢¥×¥ê¥±¡¼¥·¥ç¥óID
-     */
-    function getAppId()
-    {
-        return ucfirst(strtolower($this->appid));
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥óID¤ò¥Á¥§¥Ã¥¯¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $id     ¥¢¥×¥ê¥±¡¼¥·¥ç¥óID
-     *  @return mixed   true:OK Ethna_Error:NG
-     *  @static
-     */
-    function &checkAppId($id)
-    {
-        $true = true;
-        if (strcasecmp($id, 'ethna') === 0
-            || strcasecmp($id, 'app') === 0) {
-            return Ethna::raiseError("Application Id [$id] is reserved\n");
-        }
-        if (preg_match('/^[0-9a-zA-Z]+$/', $id) === 0) {
-            return Ethna::raiseError(
-                "Only Numeric(0-9) and Alphabetical(A-Z) is allowed for Application Id\n"
-            );
-        }
-        return $true;
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó̾¤ò¥Á¥§¥Ã¥¯¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $action_name    ¥¢¥¯¥·¥ç¥ó̾
-     *  @return mixed   true:OK Ethna_Error:NG
-     *  @static
-     */
-    function &checkActionName($action_name)
-    {
-        $true = true;
-        if (preg_match('/^[a-zA-Z\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/',
-                       $action_name) === 0) {
-            return Ethna::raiseError("invalid action name [$action_name]");
-        }
-        return $true;
-    }
-
-    /**
-     *  ¥Ó¥å¡¼Ì¾¤ò¥Á¥§¥Ã¥¯¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $view_name    ¥Ó¥å¡¼Ì¾
-     *  @return mixed   true:OK Ethna_Error:NG
-     *  @static
-     */
-    function &checkViewName($view_name)
-    {
-        $true = true;
-        if (preg_match('/^[a-zA-Z\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/',
-                       $view_name) === 0) {
-            return Ethna::raiseError("invalid view name [$view_name]");
-        }
-        return $true;
-    }
-
-    /**
-     *  DSN¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @param  string  $db_key DB¥­¡¼
-     *  @return string  DSN
-     */
-    function getDSN($db_key = "")
-    {
-        if (isset($this->dsn[$db_key]) == false) {
-            return null;
-        }
-        return $this->dsn[$db_key];
-    }
-
-    /**
-     *  DSN¤Î»ý³ÀܳÀßÄê¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @param  string  $db_key DB¥­¡¼
-     *  @return bool    true:persistent false:non-persistent(¤¢¤ë¤¤¤ÏÀßÄê̵¤·)
-     */
-    function getDSN_persistent($db_key = "")
-    {
-        $key = sprintf("dsn%s_persistent", $db_key == "" ? "" : "_$db_key");
-
-        $dsn_persistent = $this->config->get($key);
-        if (is_null($dsn_persistent)) {
-            return false;
-        }
-        return $dsn_persistent;
-    }
-
-    /**
-     *  DBÀßÄê¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @param  string  $db_key DB¥­¡¼("", "r", "rw", "default", "blog_r"...)
-     *  @return string  $db_key¤ËÂбþ¤¹¤ëDB¼ïÊÌÄêµÁ(ÀßÄ̵꤬¤¤¾ì¹ç¤Ïnull)
-     */
-    function getDBType($db_key = null)
-    {
-        if (is_null($db_key)) {
-            // °ìÍ÷¤òÊÖ¤¹
-            return $this->db;
-        }
-
-        if (isset($this->db[$db_key]) == false) {
-            return null;
-        }
-        return $this->db[$db_key];
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Ù¡¼¥¹URL¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @return string  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Ù¡¼¥¹URL
-     */
-    function getURL()
-    {
-        return $this->url;
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @return string  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê
-     */
-    function getBasedir()
-    {
-        return $this->base;
-    }
-
-    /**
-     *  ¥¯¥é¥¤¥¢¥ó¥È¥¿¥¤¥×/¸À¸ì¤«¤é¥Æ¥ó¥×¥ì¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê̾¤ò·èÄꤹ¤ë
-     *
-     *  @access public
-     *  @return string  ¥Æ¥ó¥×¥ì¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê
-     */
-    function getTemplatedir()
-    {
-        $template = $this->getDirectory('template');
-
-        // ¸À¸ìÊ̥ǥ£¥ì¥¯¥È¥ê
-        if (file_exists($template . '/' . $this->language)) {
-            $template .= '/' . $this->language;
-        }
-
-        return $template;
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¥Ç¥£¥ì¥¯¥È¥ê̾¤ò·èÄꤹ¤ë
-     *
-     *  @access public
-     *  @return string  ¥¢¥¯¥·¥ç¥ó¥Ç¥£¥ì¥¯¥È¥ê
-     */
-    function getActiondir($gateway = null)
-    {
-        $key = 'action';
-        $gateway = is_null($gateway) ? $this->getGateway() : $gateway;
-        switch ($gateway) {
-        case GATEWAY_WWW:
-            $key = 'action';
-            break;
-        case GATEWAY_CLI:
-            $key = 'action_cli';
-            break;
-        case GATEWAY_XMLRPC:
-            $key = 'action_xmlrpc';
-            break;
-        }
-
-        return (empty($this->directory[$key]) ? ($this->base . (empty($this->base) ? '' : '/')) : ($this->directory[$key] . "/"));
-    }
-
-    /**
-     *  ¥Ó¥å¡¼¥Ç¥£¥ì¥¯¥È¥ê̾¤ò·èÄꤹ¤ë
-     *
-     *  @access public
-     *  @return string  ¥¢¥¯¥·¥ç¥ó¥Ç¥£¥ì¥¯¥È¥ê
-     */
-    function getViewdir()
-    {
-        return (empty($this->directory['view']) ? ($this->base . (empty($this->base) ? '' : '/')) : ($this->directory['view'] . "/"));
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Ç¥£¥ì¥¯¥È¥êÀßÄê¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @param  string  $key    ¥Ç¥£¥ì¥¯¥È¥ê¥¿¥¤¥×("tmp", "template"...)
-     *  @return string  $key¤ËÂбþ¤·¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Ç¥£¥ì¥¯¥È¥ê(ÀßÄ̵꤬¤¤¾ì¹ç¤Ïnull)
-     */
-    function getDirectory($key)
-    {
-        // for B.C.
-        if ($key == 'app' && isset($this->directory[$key]) == false) {
-            return BASE . '/app';
-        }
-
-        if (isset($this->directory[$key]) == false) {
-            return null;
-        }
-        return $this->directory[$key];
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó³ÈÄ¥»ÒÀßÄê¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @param  string  $key    ³ÈÄ¥»Ò¥¿¥¤¥×("php", "tpl"...)
-     *  @return string  $key¤ËÂбþ¤·¤¿³ÈÄ¥»Ò(ÀßÄ̵꤬¤¤¾ì¹ç¤Ïnull)
-     */
-    function getExt($key)
-    {
-        if (isset($this->ext[$key]) == false) {
-            return null;
-        }
-        return $this->ext[$key];
-    }
-
-    /**
-     *  ¥¯¥é¥¹¥Õ¥¡¥¯¥È¥ê¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥¯¥»¥µ(R)
-     *
-     *  @access public
-     *  @return object  Ethna_ClassFactory  ¥¯¥é¥¹¥Õ¥¡¥¯¥È¥ê¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &getClassFactory()
-    {
-        return $this->class_factory;
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥¯¥»¥µ
-     *
-     *  @access public
-     *  @return object  Ethna_ActionError   ¥¢¥¯¥·¥ç¥ó¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &getActionError()
-    {
-        return $this->class_factory->getObject('error');
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥¯¥»¥µ
-     *
-     *  @access public
-     *  @return object  Ethna_ActionForm    ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &getActionForm()
-    {
-        // ÌÀ¼¨Åª¤Ë¥¯¥é¥¹¥Õ¥¡¥¯¥È¥ê¤òÍøÍѤ·¤Æ¤¤¤Ê¤¤
-        return $this->action_form;
-    }
-
-    /**
-     *  ¥Ó¥å¡¼¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥¯¥»¥µ
-     *
-     *  @access public
-     *  @return object  Ethna_View          ¥Ó¥å¡¼¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &getView()
-    {
-        // ÌÀ¼¨Åª¤Ë¥¯¥é¥¹¥Õ¥¡¥¯¥È¥ê¤òÍøÍѤ·¤Æ¤¤¤Ê¤¤
-        return $this->view;
-    }
-
-    /**
-     *  backend¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥¯¥»¥µ
-     *
-     *  @access public
-     *  @return object  Ethna_Backend   backend¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &getBackend()
-    {
-        return $this->class_factory->getObject('backend');
-    }
-
-    /**
-     *  ÀßÄꥪ¥Ö¥¸¥§¥¯¥È¤Î¥¢¥¯¥»¥µ
-     *
-     *  @access public
-     *  @return object  Ethna_Config    ÀßÄꥪ¥Ö¥¸¥§¥¯¥È
-     */
-    function &getConfig()
-    {
-        return $this->class_factory->getObject('config');
-    }
-
-    /**
-     *  i18n¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥¯¥»¥µ(R)
-     *
-     *  @access public
-     *  @return object  Ethna_I18N  i18n¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &getI18N()
-    {
-        return $this->class_factory->getObject('i18n');
-    }
-
-    /**
-     *  ¥í¥°¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥¯¥»¥µ
-     *
-     *  @access public
-     *  @return object  Ethna_Logger        ¥í¥°¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &getLogger()
-    {
-        return $this->class_factory->getObject('logger');
-    }
-
-    /**
-     *  ¥»¥Ã¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥¯¥»¥µ
-     *
-     *  @access public
-     *  @return object  Ethna_Session       ¥»¥Ã¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &getSession()
-    {
-        return $this->class_factory->getObject('session');
-    }
-
-    /**
-     *  SQL¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥¯¥»¥µ
-     *
-     *  @access public
-     *  @return object  Ethna_AppSQL    SQL¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &getSQL()
-    {
-        return $this->class_factory->getObject('sql');
-    }
-
-    /**
-     *  ¥×¥é¥°¥¤¥ó¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥¯¥»¥µ
-     *
-     *  @access public
-     *  @return object  Ethna_Plugin    ¥×¥é¥°¥¤¥ó¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &getPlugin()
-    {
-        return $this->class_factory->getObject('plugin');
-    }
-
-    /**
-     *  URL¥Ï¥ó¥É¥é¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥¯¥»¥µ
-     *
-     *  @access public
-     *  @return object  Ethna_UrlHandler    URL¥Ï¥ó¥É¥é¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &getUrlHandler()
-    {
-        return $this->class_factory->getObject('url_handler');
-    }
-
-    /**
-     *  ¥Þ¥Í¡¼¥¸¥ã°ìÍ÷¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @return array   ¥Þ¥Í¡¼¥¸¥ã°ìÍ÷
-     *  @obsolete
-     */
-    function getManagerList()
-    {
-        return $this->manager;
-    }
-
-    /**
-     *  ¼Â¹ÔÃæ¤Î¥¢¥¯¥·¥ç¥ó̾¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @return string  ¼Â¹ÔÃæ¤Î¥¢¥¯¥·¥ç¥ó̾
-     */
-    function getCurrentActionName()
-    {
-        return $this->action_name;
-    }
-
-    /**
-     *  ¼Â¹ÔÃæ¤ÎXMLRPC¥á¥½¥Ã¥É̾¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @return string  ¼Â¹ÔÃæ¤ÎXMLRPC¥á¥½¥Ã¥É̾
-     */
-    function getXmlrpcMethodName()
-    {
-        return $this->xmlrpc_method_name;
-    }
-
-    /**
-     *  »ÈÍѸÀ¸ì¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return array   »ÈÍѸÀ¸ì,¥·¥¹¥Æ¥à¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°Ì¾,¥¯¥é¥¤¥¢¥ó¥È¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°Ì¾
-     */
-    function getLanguage()
-    {
-        return array($this->language, $this->system_encoding, $this->client_encoding);
-    }
-
-    /**
-     *  ¥²¡¼¥È¥¦¥§¥¤¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     */
-    function getGateway()
-    {
-        return $this->gateway;
-    }
-
-    /**
-     *  ¥²¡¼¥È¥¦¥§¥¤¥â¡¼¥É¤òÀßÄꤹ¤ë
-     *
-     *  @access public
-     */
-    function setGateway($gateway)
-    {
-        $this->gateway = $gateway;
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥¨¥ó¥È¥ê¥Ý¥¤¥ó¥È
-     *
-     *  @access public
-     *  @param  string  $class_name     ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥³¥ó¥È¥í¡¼¥é¤Î¥¯¥é¥¹Ì¾
-     *  @param  mixed   $action_name    »ØÄê¤Î¥¢¥¯¥·¥ç¥ó̾(¾Êά²Ä)
-     *  @param  mixed   $fallback_action_name   ¥¢¥¯¥·¥ç¥ó¤¬·èÄê¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¼Â¹Ô¤µ¤ì¤ë¥¢¥¯¥·¥ç¥ó̾(¾Êά²Ä)
-     *  @static
-     */
-    function main($class_name, $action_name = "", $fallback_action_name = "")
-    {
-        $c =& new $class_name;
-        $c->trigger($action_name, $fallback_action_name);
-    }
-
-    /**
-     *  CLI¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥¨¥ó¥È¥ê¥Ý¥¤¥ó¥È
-     *
-     *  @access public
-     *  @param  string  $class_name     ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥³¥ó¥È¥í¡¼¥é¤Î¥¯¥é¥¹Ì¾
-     *  @param  string  $action_name    ¼Â¹Ô¤¹¤ë¥¢¥¯¥·¥ç¥ó̾
-     *  @param  bool    $enable_filter  ¥Õ¥£¥ë¥¿¥Á¥§¥¤¥ó¤òÍ­¸ú¤Ë¤¹¤ë¤«¤É¤¦¤«
-     *  @static
-     */
-    function main_CLI($class_name, $action_name, $enable_filter = true)
-    {
-        $c =& new $class_name(GATEWAY_CLI);
-        $c->action_cli[$action_name] = array();
-        $c->trigger($action_name, "", $enable_filter);
-    }
-
-    /**
-     *  XMLRPC¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥¨¥ó¥È¥ê¥Ý¥¤¥ó¥È
-     *
-     *  @access public
-     *  @static
-     */
-    function main_XMLRPC($class_name)
-    {
-        if (extension_loaded('xmlrpc') == false) {
-            die("xmlrpc extension is required to enable this gateway");
-        }
-
-        $c =& new $class_name(GATEWAY_XMLRPC);
-        $c->trigger("", "", false);
-    }
-
-    /**
-     *  SOAP¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥¨¥ó¥È¥ê¥Ý¥¤¥ó¥È
-     *
-     *  @access public
-     *  @param  string  $class_name     ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥³¥ó¥È¥í¡¼¥é¤Î¥¯¥é¥¹Ì¾
-     *  @param  mixed   $action_name    »ØÄê¤Î¥¢¥¯¥·¥ç¥ó̾(¾Êά²Ä)
-     *  @param  mixed   $fallback_action_name   ¥¢¥¯¥·¥ç¥ó¤¬·èÄê¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¼Â¹Ô¤µ¤ì¤ë¥¢¥¯¥·¥ç¥ó̾(¾Êά²Ä)
-     *  @static
-     */
-    function main_SOAP($class_name, $action_name = "", $fallback_action_name = "")
-    {
-        $c =& new $class_name(GATEWAY_SOAP);
-        $c->trigger($action_name, $fallback_action_name);
-    }
-
-    /**
-     *  ¥Õ¥ì¡¼¥à¥ï¡¼¥¯¤Î½èÍý¤ò³«»Ï¤¹¤ë
-     *
-     *  @access public
-     *  @param  mixed   $default_action_name    »ØÄê¤Î¥¢¥¯¥·¥ç¥ó̾
-     *  @param  mixed   $fallback_action_name   ¥¢¥¯¥·¥ç¥ó̾¤¬·èÄê¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¼Â¹Ô¤µ¤ì¤ë¥¢¥¯¥·¥ç¥ó̾
-     *  @param  bool    $enable_filter  ¥Õ¥£¥ë¥¿¥Á¥§¥¤¥ó¤òÍ­¸ú¤Ë¤¹¤ë¤«¤É¤¦¤«
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function trigger($default_action_name = "", $fallback_action_name = "", $enable_filter = true)
-    {
-        // ¥Õ¥£¥ë¥¿¡¼¤ÎÀ¸À®
-        if ($enable_filter) {
-            $this->_createFilterChain();
-        }
-
-        // ¼Â¹ÔÁ°¥Õ¥£¥ë¥¿
-        for ($i = 0; $i < count($this->filter_chain); $i++) {
-            $r = $this->filter_chain[$i]->preFilter();
-            if (Ethna::isError($r)) {
-                return $r;
-            }
-        }
-
-        // trigger
-        switch ($this->getGateway()) {
-        case GATEWAY_WWW:
-            $this->_trigger_WWW($default_action_name, $fallback_action_name);
-            break;
-        case GATEWAY_CLI:
-            $this->_trigger_CLI($default_action_name);
-            break;
-        case GATEWAY_XMLRPC:
-            $this->_trigger_XMLRPC();
-            break;
-        case GATEWAY_SOAP:
-            $this->_trigger_SOAP();
-            break;
-        }
-
-        // ¼Â¹Ô¸å¥Õ¥£¥ë¥¿
-        for ($i = count($this->filter_chain) - 1; $i >= 0; $i--) {
-            $r = $this->filter_chain[$i]->postFilter();
-            if (Ethna::isError($r)) {
-                return $r;
-            }
-        }
-    }
-
-    /**
-     *  ¥Õ¥ì¡¼¥à¥ï¡¼¥¯¤Î½èÍý¤ò¼Â¹Ô¤¹¤ë(WWW)
-     *
-     *  °ú¿ô$default_action_name¤ËÇÛÎ󤬻ØÄꤵ¤ì¤¿¾ì¹ç¡¢¤½¤ÎÇÛÎó¤Ç»ØÄꤵ¤ì¤¿
-     *  ¥¢¥¯¥·¥ç¥ó°Ê³°¤Ï¼õ¤±ÉÕ¤±¤Ê¤¤(»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¥¢¥¯¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤¿
-     *  ¾ì¹ç¡¢ÇÛÎó¤ÎÀèƬ¤Ç»ØÄꤵ¤ì¤¿¥¢¥¯¥·¥ç¥ó¤¬¼Â¹Ô¤µ¤ì¤ë)
-     *
-     *  @access private
-     *  @param  mixed   $default_action_name    »ØÄê¤Î¥¢¥¯¥·¥ç¥ó̾
-     *  @param  mixed   $fallback_action_name   ¥¢¥¯¥·¥ç¥ó̾¤¬·èÄê¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¼Â¹Ô¤µ¤ì¤ë¥¢¥¯¥·¥ç¥ó̾
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function _trigger_WWW($default_action_name = "", $fallback_action_name = "")
-    {
-        // ¥¢¥¯¥·¥ç¥ó̾¤Î¼èÆÀ
-        $action_name = $this->_getActionName($default_action_name, $fallback_action_name);
-
-        // ¥¢¥¯¥·¥ç¥óÄêµÁ¤Î¼èÆÀ
-        $action_obj =& $this->_getAction($action_name);
-        if (is_null($action_obj)) {
-            if ($fallback_action_name != "") {
-                $this->logger->log(LOG_DEBUG, 'undefined action [%s] -> try fallback action [%s]', $action_name, $fallback_action_name);
-                $action_obj =& $this->_getAction($fallback_action_name);
-            }
-            if (is_null($action_obj)) {
-                return Ethna::raiseError("undefined action [%s]", E_APP_UNDEFINED_ACTION, $action_name);
-            } else {
-                $action_name = $fallback_action_name;
-            }
-        }
-
-        // ¥¢¥¯¥·¥ç¥ó¼Â¹ÔÁ°¥Õ¥£¥ë¥¿
-        for ($i = 0; $i < count($this->filter_chain); $i++) {
-            $r = $this->filter_chain[$i]->preActionFilter($action_name);
-            if ($r != null) {
-                $this->logger->log(LOG_DEBUG, 'action [%s] -> [%s] by %s', $action_name, $r, get_class($this->filter_chain[$i]));
-                $action_name = $r;
-            }
-        }
-        $this->action_name = $action_name;
-
-        // ¸À¸ìÀßÄê
-        $this->_setLanguage($this->language, $this->system_encoding, $this->client_encoding);
-
-        // ¥ª¥Ö¥¸¥§¥¯¥ÈÀ¸À®
-        $backend =& $this->getBackend();
-
-        $form_name = $this->getActionFormName($action_name);
-        $this->action_form =& new $form_name($this);
-        $this->action_form->setFormVars();
-
-        // ¥Ð¥Ã¥¯¥¨¥ó¥É½èÍý¼Â¹Ô
-        $backend->setActionForm($this->action_form);
-
-        $session =& $this->getSession();
-        $session->restore();
-        $forward_name = $backend->perform($action_name);
-
-        // ¥¢¥¯¥·¥ç¥ó¼Â¹Ô¸å¥Õ¥£¥ë¥¿
-        for ($i = count($this->filter_chain) - 1; $i >= 0; $i--) {
-            $r = $this->filter_chain[$i]->postActionFilter($action_name, $forward_name);
-            if ($r != null) {
-                $this->logger->log(LOG_DEBUG, 'forward [%s] -> [%s] by %s', $forward_name, $r, get_class($this->filter_chain[$i]));
-                $forward_name = $r;
-            }
-        }
-
-        // ¥³¥ó¥È¥í¡¼¥é¤ÇÁ«°ÜÀè¤ò·èÄꤹ¤ë(¥ª¥×¥·¥ç¥ó)
-        $forward_name = $this->_sortForward($action_name, $forward_name);
-
-        if ($forward_name != null) {
-            $view_class_name = $this->getViewClassName($forward_name);
-            $this->view =& new $view_class_name($backend, $forward_name, $this->_getForwardPath($forward_name));
-            $this->view->preforward();
-            $this->view->forward();
-        }
-
-        return 0;
-    }
-
-    /**
-     *  ¥Õ¥ì¡¼¥à¥ï¡¼¥¯¤Î½èÍý¤ò¼Â¹Ô¤¹¤ë(CLI)
-     *
-     *  @access private
-     *  @param  mixed   $default_action_name    »ØÄê¤Î¥¢¥¯¥·¥ç¥ó̾
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function _trigger_CLI($default_action_name = "")
-    {
-        return $this->_trigger_WWW($default_action_name);
-    }
-
-    /**
-     *  ¥Õ¥ì¡¼¥à¥ï¡¼¥¯¤Î½èÍý¤ò¼Â¹Ô¤¹¤ë(XMLRPC)
-     *
-     *  @access private
-     *  @param  mixed   $action_name    »ØÄê¤Î¥¢¥¯¥·¥ç¥ó̾
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function _trigger_XMLRPC($action_name = "")
-    {
-        // prepare xmlrpc server
-        $xmlrpc_gateway_method_name = "_Ethna_XmlrpcGateway";
-        $xmlrpc_server = xmlrpc_server_create();
-
-        $method = null;
-        $param = xmlrpc_decode_request(file_get_contents('php://input'), $method);
-        $this->xmlrpc_method_name = $method;
-
-        $request = xmlrpc_encode_request(
-            $xmlrpc_gateway_method_name,
-            $param,
-            array(
-                'output_type'   => 'xml',
-                'verbosity'     => 'pretty',
-                'escaping'      => array('markup'),
-                'version'       => 'xmlrpc',
-                'encoding'      => 'utf-8'
-            )
-        ); 
-
-        xmlrpc_server_register_method(
-            $xmlrpc_server,
-            $xmlrpc_gateway_method_name,
-            $xmlrpc_gateway_method_name
-        );
-
-        // send request
-        $r = xmlrpc_server_call_method(
-            $xmlrpc_server,
-            $request,
-            null,
-            array(
-                'output_type'   => 'xml',
-                'verbosity'     => 'pretty',
-                'escaping'      => array('markup'),
-                'version'       => 'xmlrpc',
-                'encoding'      => 'utf-8'
-            )
-        );
-
-        header('Content-Length: ' . strlen($r));
-        header('Content-Type: text/xml; charset=UTF-8');
-        print $r;
-    }
-
-    /**
-     *  _trigger_XMLRPC¤Î¥³¡¼¥ë¥Ð¥Ã¥¯¥á¥½¥Ã¥É
-     *
-     *  @access public
-     */
-    function trigger_XMLRPC($method, $param)
-    {
-        // ¥¢¥¯¥·¥ç¥óÄêµÁ¤Î¼èÆÀ
-        $action_obj =& $this->_getAction($method);
-        if (is_null($action_obj)) {
-            return Ethna::raiseError("undefined xmlrpc method [%s]", E_APP_UNDEFINED_ACTION, $method);
-        }
-
-        // ¥ª¥Ö¥¸¥§¥¯¥ÈÀ¸À®
-        $backend =& $this->getBackend();
-
-        $form_name = $this->getActionFormName($method);
-        $this->action_form =& new $form_name($this);
-        $def = $this->action_form->getDef();
-        $n = 0;
-        foreach ($def as $key => $value) {
-            if (isset($param[$n]) == false) {
-                $this->action_form->set($key, null);
-            } else {
-                $this->action_form->set($key, $param[$n]);
-            }
-            $n++;
-        }
-
-        // ¥Ð¥Ã¥¯¥¨¥ó¥É½èÍý¼Â¹Ô
-        $backend->setActionForm($this->action_form);
-
-        $session =& $this->getSession();
-        $session->restore();
-        $r = $backend->perform($method);
-
-        return $r;
-    }
-
-    /**
-     *  SOAP¥Õ¥ì¡¼¥à¥ï¡¼¥¯¤Î½èÍý¤ò¼Â¹Ô¤¹¤ë
-     *
-     *  @access private
-     */
-    function _trigger_SOAP()
-    {
-        // SOAP¥¨¥ó¥È¥ê¥¯¥é¥¹
-        $gg =& new Ethna_SOAP_GatewayGenerator();
-        $script = $gg->generate();
-        eval($script);
-
-        // SOAP¥ê¥¯¥¨¥¹¥È½èÍý
-        $server =& new SoapServer(null, array('uri' => $this->config->get('url')));
-        $server->setClass($gg->getClassName());
-        $server->handle();
-    }
-
-    /**
-     *  ¥¨¥é¡¼¥Ï¥ó¥É¥é
-     *
-     *  ¥¨¥é¡¼È¯À¸»þ¤ÎÄɲýèÍý¤ò¹Ô¤¤¤¿¤¤¾ì¹ç¤Ï¤³¤Î¥á¥½¥Ã¥É¤ò¥ª¡¼¥Ð¡¼¥é¥¤¥É¤¹¤ë
-     *  (¥¢¥é¡¼¥È¥á¡¼¥ëÁ÷¿®Åù¡Ý¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥í¥°½ÐÎÏ»þ¤Ë¥¢¥é¡¼¥È¥á¡¼¥ë
-     *  ¤¬Á÷¿®¤µ¤ì¤ë¤¬¡¢¥¨¥é¡¼È¯À¸»þ¤ËÊ̤˥¢¥é¡¼¥È¥á¡¼¥ë¤ò¤³¤³¤ÇÁ÷¿®
-     *  ¤µ¤»¤ë¤³¤È¤â²Äǽ)
-     *
-     *  @access public
-     *  @param  object  Ethna_Error     ¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function handleError(&$error)
-    {
-        // ¥í¥°½ÐÎÏ
-        list ($log_level, $dummy) = $this->logger->errorLevelToLogLevel($error->getLevel());
-        $message = $error->getMessage();
-        $this->logger->log($log_level, sprintf("%s [ERROR CODE(%d)]", $message, $error->getCode()));
-    }
-
-    /**
-     *  ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @param  int     $code       ¥¨¥é¡¼¥³¡¼¥É
-     *  @return string  ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸
-     */
-    function getErrorMessage($code)
-    {
-        $message_list =& $GLOBALS['_Ethna_error_message_list'];
-        for ($i = count($message_list)-1; $i >= 0; $i--) {
-            if (array_key_exists($code, $message_list[$i])) {
-                return $message_list[$i][$code];
-            }
-        }
-        return null;
-    }
-
-    /**
-     *  ¼Â¹Ô¤¹¤ë¥¢¥¯¥·¥ç¥ó̾¤òÊÖ¤¹
-     *
-     *  @access private
-     *  @param  mixed   $default_action_name    »ØÄê¤Î¥¢¥¯¥·¥ç¥ó̾
-     *  @return string  ¼Â¹Ô¤¹¤ë¥¢¥¯¥·¥ç¥ó̾
-     */
-    function _getActionName($default_action_name, $fallback_action_name)
-    {
-        // ¥Õ¥©¡¼¥à¤«¤éÍ׵ᤵ¤ì¤¿¥¢¥¯¥·¥ç¥ó̾¤ò¼èÆÀ¤¹¤ë
-        $form_action_name = $this->_getActionName_Form();
-        $form_action_name = preg_replace('/[^a-z0-9\-_]+/i', '', $form_action_name);
-        $this->logger->log(LOG_DEBUG, 'form_action_name[%s]', $form_action_name);
-
-        // Ethna¥Þ¥Í¡¼¥¸¥ã¤Ø¤Î¥Õ¥©¡¼¥à¤«¤é¤Î¥ê¥¯¥¨¥¹¥È¤ÏµñÈÝ
-        if ($form_action_name == "__ethna_info__" ||
-            $form_action_name == "__ethna_unittest__") {
-            $form_action_name = "";
-        }
-
-        // ¥Õ¥©¡¼¥à¤«¤é¤Î»ØÄ̵꤬¤¤¾ì¹ç¤Ï¥¨¥ó¥È¥ê¥Ý¥¤¥ó¥È¤Ë»ØÄꤵ¤ì¤¿¥Ç¥Õ¥©¥ë¥ÈÃͤòÍøÍѤ¹¤ë
-        if ($form_action_name == "" && count($default_action_name) > 0) {
-            $tmp = is_array($default_action_name) ? $default_action_name[0] : $default_action_name;
-            if ($tmp{strlen($tmp)-1} == '*') {
-                $tmp = substr($tmp, 0, -1);
-            }
-            $this->logger->log(LOG_DEBUG, '-> default_action_name[%s]', $tmp);
-            $action_name = $tmp;
-        } else {
-            $action_name = $form_action_name;
-        }
-
-        // ¥¨¥ó¥È¥ê¥Ý¥¤¥ó¥È¤ËÇÛÎ󤬻ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï»ØÄê°Ê³°¤Î¥¢¥¯¥·¥ç¥ó̾¤ÏµñÈݤ¹¤ë
-        if (is_array($default_action_name)) {
-            if ($this->_isAcceptableActionName($action_name, $default_action_name) == false) {
-                // »ØÄê°Ê³°¤Î¥¢¥¯¥·¥ç¥ó̾¤Ç¹ç¤Ã¤¿¾ì¹ç¤Ï$fallback_action_name(or ¥Ç¥Õ¥©¥ë¥È)
-                $tmp = $fallback_action_name != "" ? $fallback_action_name : $default_action_name[0];
-                if ($tmp{strlen($tmp)-1} == '*') {
-                    $tmp = substr($tmp, 0, -1);
-                }
-                $this->logger->log(LOG_DEBUG, '-> fallback_action_name[%s]', $tmp);
-                $action_name = $tmp;
-            }
-        }
-
-        $this->logger->log(LOG_DEBUG, '<<< action_name[%s] >>>', $action_name);
-
-        return $action_name;
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥à¤Ë¤è¤êÍ׵ᤵ¤ì¤¿¥¢¥¯¥·¥ç¥ó̾¤òÊÖ¤¹
-     *
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÎÀ­¼Á¤Ë±þ¤¸¤Æ¤³¤Î¥á¥½¥Ã¥É¤ò¥ª¡¼¥Ð¡¼¥é¥¤¥É¤·¤Æ²¼¤µ¤¤¡£
-     *  ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï"action_"¤Ç»Ï¤Þ¤ë¥Õ¥©¡¼¥àÃͤÎ"action_"¤ÎÉôʬ¤ò½ü¤¤¤¿¤â¤Î
-     *  ("action_sample"¤Ê¤é"sample")¤¬¥¢¥¯¥·¥ç¥ó̾¤È¤·¤Æ°·¤ï¤ì¤Þ¤¹
-     *
-     *  @access protected
-     *  @return string  ¥Õ¥©¡¼¥à¤Ë¤è¤êÍ׵ᤵ¤ì¤¿¥¢¥¯¥·¥ç¥ó̾
-     */
-    function _getActionName_Form()
-    {
-        if (isset($_SERVER['REQUEST_METHOD']) == false) {
-            return null;
-        }
-
-        $url_handler =& $this->getUrlHandler();
-        if ($_SERVER['REQUEST_METHOD'] == "GET") {
-            $tmp_vars = $_GET;
-        } else if ($_SERVER['REQUEST_METHOD'] == "POST") {
-            $tmp_vars = $_POST;
-        }
-
-        if (empty($_SERVER['URL_HANDLER']) == false) {
-            $tmp_vars['__url_handler__'] = $_SERVER['URL_HANDLER'];
-            $tmp_vars['__url_info__'] = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : null;
-            $tmp_vars = $url_handler->requestToAction($tmp_vars);
-
-            if ($_SERVER['REQUEST_METHOD'] == "GET") {
-                $_GET = array_merge($_GET, $tmp_vars);
-            } else if ($_SERVER['REQUEST_METHOD'] == "POST") {
-                $_POST = array_merge($_POST, $tmp_vars);
-            }
-            $_REQUEST = array_merge($_REQUEST, $tmp_vars);
-        }
-
-        if (strcasecmp($_SERVER['REQUEST_METHOD'], 'post') == 0) {
-            $http_vars =& $_POST;
-        } else {
-            $http_vars =& $_GET;
-        }
-
-        // ¥Õ¥©¡¼¥àÃͤ«¤é¥ê¥¯¥¨¥¹¥È¤µ¤ì¤¿¥¢¥¯¥·¥ç¥ó̾¤ò¼èÆÀ¤¹¤ë
-        $action_name = $sub_action_name = null;
-        foreach ($http_vars as $name => $value) {
-            if ($value == "" || strncmp($name, 'action_', 7) != 0) {
-                continue;
-            }
-
-            $tmp = substr($name, 7);
-
-            // type="image"Âбþ
-            if (preg_match('/_x$/', $name) || preg_match('/_y$/', $name)) {
-                $tmp = substr($tmp, 0, strlen($tmp)-2);
-            }
-
-            // value="dummy"¤È¤Ê¤Ã¤Æ¤¤¤ë¤â¤Î¤ÏÍ¥ÀèÅÙ¤ò²¼¤²¤ë
-            if ($value == "dummy") {
-                $sub_action_name = $tmp;
-            } else {
-                $action_name = $tmp;
-            }
-        }
-        if ($action_name == null) {
-            $action_name = $sub_action_name;
-        }
-
-        return $action_name;
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó̾¤ò»ØÄꤹ¤ë¥¯¥¨¥ê/HTML¤òÀ¸À®¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $action action to request
-     *  @param  string  $type   hidden, url...
-     *  @todo   consider gateway
-     */
-    function getActionRequest($action, $type = "hidden")
-    {
-        $s = null; 
-        if ($type == "hidden") {
-            $s = sprintf('<input type="hidden" name="action_%s" value="true">', htmlspecialchars($action, ENT_QUOTES));
-        } else if ($type == "url") {
-            $s = sprintf('action_%s=true', urlencode($action));
-        }
-        return $s;
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥à¤Ë¤è¤êÍ׵ᤵ¤ì¤¿¥¢¥¯¥·¥ç¥ó̾¤ËÂбþ¤¹¤ëÄêµÁ¤òÊÖ¤¹
-     *
-     *  @access private
-     *  @param  string  $action_name    ¥¢¥¯¥·¥ç¥ó̾
-     *  @return array   ¥¢¥¯¥·¥ç¥óÄêµÁ
-     */
-    function &_getAction($action_name, $gateway = null)
-    {
-        $action = array();
-        $gateway = is_null($gateway) ? $this->getGateway() : $gateway;
-        switch ($gateway) {
-        case GATEWAY_WWW:
-            $action =& $this->action;
-            break;
-        case GATEWAY_CLI:
-            $action =& $this->action_cli;
-            break;
-        case GATEWAY_XMLRPC:
-            $action =& $this->action_xmlrpc;
-            break;
-        }
-
-        $action_obj = array();
-        if (isset($action[$action_name])) {
-            $action_obj = $action[$action_name];
-            if (isset($action_obj['inspect']) && $action_obj['inspect']) {
-                return $action_obj;
-            }
-        } else {
-            $this->logger->log(LOG_DEBUG, "action [%s] is not defined -> try default", $action_name);
-        }
-
-        // ¥¢¥¯¥·¥ç¥ó¥¹¥¯¥ê¥×¥È¤Î¥¤¥ó¥¯¥ë¡¼¥É
-        $this->_includeActionScript($action_obj, $action_name);
-
-        // ¾ÊάÃͤÎÊäÀµ
-        if (isset($action_obj['class_name']) == false) {
-            $action_obj['class_name'] = $this->getDefaultActionClass($action_name);
-        }
-
-        if (isset($action_obj['form_name']) == false) {
-            $action_obj['form_name'] = $this->getDefaultFormClass($action_name);
-        } else if (class_exists($action_obj['form_name']) == false) {
-            // ÌÀ¼¨»ØÄꤵ¤ì¤¿¥Õ¥©¡¼¥à¥¯¥é¥¹¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï·Ù¹ð
-            $this->logger->log(LOG_WARNING, 'stated form class is not defined [%s]', $action_obj['form_name']);
-        }
-
-        // É¬Í×¾ò·ï¤Î³Îǧ
-        if (class_exists($action_obj['class_name']) == false) {
-            $this->logger->log(LOG_NOTICE, 'action class is not defined [%s]', $action_obj['class_name']);
-            $_ret_object = null;
-            return $_ret_object;
-        }
-        if (class_exists($action_obj['form_name']) == false) {
-            // ¥Õ¥©¡¼¥à¥¯¥é¥¹¤Ï̤ÄêµÁ¤Ç¤âÎɤ¤
-            $class_name = $this->class_factory->getObjectName('form');
-            $this->logger->log(LOG_DEBUG, 'form class is not defined [%s] -> falling back to default [%s]', $action_obj['form_name'], $class_name);
-            $action_obj['form_name'] = $class_name;
-        }
-
-        $action_obj['inspect'] = true;
-        $action[$action_name] = $action_obj;
-        return $action[$action_name];
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó̾¤È¥¢¥¯¥·¥ç¥ó¥¯¥é¥¹¤«¤é¤ÎÌá¤êÃͤ˴ð¤Å¤¤¤ÆÁ«°ÜÀè¤ò·èÄꤹ¤ë
-     *
-     *  @access protected
-     *  @param  string  $action_name    ¥¢¥¯¥·¥ç¥ó̾
-     *  @param  string  $retval         ¥¢¥¯¥·¥ç¥ó¥¯¥é¥¹¤«¤é¤ÎÌá¤êÃÍ
-     *  @return string  Á«°ÜÀè
-     */
-    function _sortForward($action_name, $retval)
-    {
-        return $retval;
-    }
-
-    /**
-     *  ¥Õ¥£¥ë¥¿¥Á¥§¥¤¥ó¤òÀ¸À®¤¹¤ë
-     *
-     *  @access private
-     */
-    function _createFilterChain()
-    {
-        $this->filter_chain = array();
-        foreach ($this->filter as $filter) {
-            //¥Ð¡¼¥¸¥ç¥ó0.2.0°ÊÁ°¤Î¥Õ¥£¥ë¥¿·²¤«¤éõ¤¹
-            $file = sprintf("%s/%s.%s", $this->getDirectory('filter'), $filter,$this->getExt('php'));
-            if (file_exists($file)) {
-                include_once $file;
-                if (class_exists($filter)) {
-                    $this->filter_chain[] =& new $filter($this);
-                }
-            } else {  //¥×¥é¥°¥¤¥ó¤«¤éõ¤¹¡¥
-                $filter_plugin =& $this->plugin->getPlugin('Filter', $filter);
-                if (Ethna::isError($filter_plugin)) {
-                    continue;
-                }
-
-                $this->filter_chain[] =& $filter_plugin;
-            }
-        }
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó̾¤¬¼Â¹Ôµö²Ä¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤«¤É¤¦¤«¤òÊÖ¤¹
-     *
-     *  @access private
-     *  @param  string  $action_name            ¥ê¥¯¥¨¥¹¥È¤µ¤ì¤¿¥¢¥¯¥·¥ç¥ó̾
-     *  @param  array   $default_action_name    µö²Ä¤µ¤ì¤Æ¤¤¤ë¥¢¥¯¥·¥ç¥ó̾
-     *  @return bool    true:µö²Ä false:ÉÔµö²Ä
-     */
-    function _isAcceptableActionName($action_name, $default_action_name)
-    {
-        foreach (to_array($default_action_name) as $name) {
-            if ($action_name == $name) {
-                return true;
-            } else if ($name{strlen($name)-1} == '*') {
-                if (strncmp($action_name, substr($name, 0, -1), strlen($name)-1) == 0) {
-                    return true;
-                }
-            }
-        }
-        return false;
-    }
-
-    /**
-     *  »ØÄꤵ¤ì¤¿¥¢¥¯¥·¥ç¥ó¤Î¥Õ¥©¡¼¥à¥¯¥é¥¹Ì¾¤òÊÖ¤¹(¥ª¥Ö¥¸¥§¥¯¥È¤ÎÀ¸À®¤Ï¹Ô¤ï¤Ê¤¤)
-     *
-     *  @access public
-     *  @param  string  $action_name    ¥¢¥¯¥·¥ç¥ó̾
-     *  @return string  ¥¢¥¯¥·¥ç¥ó¤Î¥Õ¥©¡¼¥à¥¯¥é¥¹Ì¾
-     */
-    function getActionFormName($action_name)
-    {
-        $action_obj =& $this->_getAction($action_name);
-        if (is_null($action_obj)) {
-            return null;
-        }
-
-        return $action_obj['form_name'];
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¤ËÂбþ¤¹¤ë¥Õ¥©¡¼¥à¥¯¥é¥¹Ì¾¤¬¾Êά¤µ¤ì¤¿¾ì¹ç¤Î¥Ç¥Õ¥©¥ë¥È¥¯¥é¥¹Ì¾¤òÊÖ¤¹
-     *
-     *  ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï[¥×¥í¥¸¥§¥¯¥ÈID]_Form_[¥¢¥¯¥·¥ç¥ó̾]¤È¤Ê¤ë¤Î¤Ç¹¥¤ß±þ¤¸¤Æ¥ª¡¼¥Ð¥é¥¤¥É¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $action_name    ¥¢¥¯¥·¥ç¥ó̾
-     *  @return string  ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à̾
-     */
-    function getDefaultFormClass($action_name, $gateway = null)
-    {
-        $gateway_prefix = $this->_getGatewayPrefix($gateway);
-
-        $postfix = preg_replace('/_(.)/e', "strtoupper('\$1')", ucfirst($action_name));
-        $r = sprintf("%s_%sForm_%s", $this->getAppId(), $gateway_prefix ? $gateway_prefix . "_" : "", $postfix);
-        $this->logger->log(LOG_DEBUG, "default action class [%s]", $r);
-
-        return $r;
-    }
-
-    /**
-     *  getDefaultFormClass()¤Ç¼èÆÀ¤·¤¿¥¯¥é¥¹Ì¾¤«¤é¥¢¥¯¥·¥ç¥ó̾¤ò¼èÆÀ¤¹¤ë
-     *
-     *  getDefaultFormClass()¤ò¥ª¡¼¥Ð¡¼¥é¥¤¥É¤·¤¿¾ì¹ç¡¢¤³¤Á¤é¤â¹ç¤ï¤»¤Æ¥ª¡¼¥Ð¡¼¥é¥¤¥É
-     *  ¤¹¤ë¤³¤È¤ò¿ä¾©(ɬ¿Ü¤Ç¤Ï¤Ê¤¤)
-     *
-     *  @access public
-     *  @param  string  $class_name     ¥Õ¥©¡¼¥à¥¯¥é¥¹Ì¾
-     *  @return string  ¥¢¥¯¥·¥ç¥ó̾
-     */
-    function actionFormToName($class_name)
-    {
-        $prefix = sprintf("%s_Form_", $this->getAppId());
-        if (preg_match("/$prefix(.*)/", $class_name, $match) == 0) {
-            // ÉÔÌÀ¤Ê¥¯¥é¥¹Ì¾
-            return null;
-        }
-        $target = $match[1];
-
-        $action_name = substr(preg_replace('/([A-Z])/e', "'_' . strtolower('\$1')", $target), 1);
-
-        return $action_name;
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¤ËÂбþ¤¹¤ë¥Õ¥©¡¼¥à¥Ñ¥¹Ì¾¤¬¾Êά¤µ¤ì¤¿¾ì¹ç¤Î¥Ç¥Õ¥©¥ë¥È¥Ñ¥¹Ì¾¤òÊÖ¤¹
-     *
-     *  ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï_getDefaultActionPath()¤ÈƱ¤¸·ë²Ì¤òÊÖ¤¹(1¥Õ¥¡¥¤¥ë¤Ë
-     *  ¥¢¥¯¥·¥ç¥ó¥¯¥é¥¹¤È¥Õ¥©¡¼¥à¥¯¥é¥¹¤¬µ­½Ò¤µ¤ì¤ë)¤Î¤Ç¡¢¹¥¤ß¤Ë±þ¤¸¤Æ
-     *  ¥ª¡¼¥Ð¡¼¥é¥¤¥É¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $action_name    ¥¢¥¯¥·¥ç¥ó̾
-     *  @return string  form class¤¬ÄêµÁ¤µ¤ì¤ë¥¹¥¯¥ê¥×¥È¤Î¥Ñ¥¹Ì¾
-     */
-    function getDefaultFormPath($action_name)
-    {
-        return $this->getDefaultActionPath($action_name);
-    }
-
-    /**
-     *  »ØÄꤵ¤ì¤¿¥¢¥¯¥·¥ç¥ó¤Î¥¯¥é¥¹Ì¾¤òÊÖ¤¹(¥ª¥Ö¥¸¥§¥¯¥È¤ÎÀ¸À®¤Ï¹Ô¤ï¤Ê¤¤)
-     *
-     *  @access public
-     *  @param  string  $action_name    ¥¢¥¯¥·¥ç¥ó¤Î̾¾Î
-     *  @return string  ¥¢¥¯¥·¥ç¥ó¤Î¥¯¥é¥¹Ì¾
-     */
-    function getActionClassName($action_name)
-    {
-        $action_obj =& $this->_getAction($action_name);
-        if ($action_obj == null) {
-            return null;
-        }
-
-        return $action_obj['class_name'];
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¤ËÂбþ¤¹¤ë¥¢¥¯¥·¥ç¥ó¥¯¥é¥¹Ì¾¤¬¾Êά¤µ¤ì¤¿¾ì¹ç¤Î¥Ç¥Õ¥©¥ë¥È¥¯¥é¥¹Ì¾¤òÊÖ¤¹
-     *
-     *  ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï[¥×¥í¥¸¥§¥¯¥ÈID]_Action_[¥¢¥¯¥·¥ç¥ó̾]¤È¤Ê¤ë¤Î¤Ç¹¥¤ß±þ¤¸¤Æ¥ª¡¼¥Ð¥é¥¤¥É¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $action_name    ¥¢¥¯¥·¥ç¥ó̾
-     *  @return string  ¥¢¥¯¥·¥ç¥ó¥¯¥é¥¹Ì¾
-     */
-    function getDefaultActionClass($action_name, $gateway = null)
-    {
-        $gateway_prefix = $this->_getGatewayPrefix($gateway);
-
-        $postfix = preg_replace('/_(.)/e', "strtoupper('\$1')", ucfirst($action_name));
-        $r = sprintf("%s_%sAction_%s", $this->getAppId(), $gateway_prefix ? $gateway_prefix . "_" : "", $postfix);
-        $this->logger->log(LOG_DEBUG, "default action class [%s]", $r);
-
-        return $r;
-    }
-
-    /**
-     *  getDefaultActionClass()¤Ç¼èÆÀ¤·¤¿¥¯¥é¥¹Ì¾¤«¤é¥¢¥¯¥·¥ç¥ó̾¤ò¼èÆÀ¤¹¤ë
-     *
-     *  getDefaultActionClass()¤ò¥ª¡¼¥Ð¡¼¥é¥¤¥É¤·¤¿¾ì¹ç¡¢¤³¤Á¤é¤â¹ç¤ï¤»¤Æ¥ª¡¼¥Ð¡¼¥é¥¤¥É
-     *  ¤¹¤ë¤³¤È¤ò¿ä¾©(ɬ¿Ü¤Ç¤Ï¤Ê¤¤)
-     *
-     *  @access public
-     *  @param  string  $class_name     ¥¢¥¯¥·¥ç¥ó¥¯¥é¥¹Ì¾
-     *  @return string  ¥¢¥¯¥·¥ç¥ó̾
-     */
-    function actionClassToName($class_name)
-    {
-        $prefix = sprintf("%s_Action_", $this->getAppId());
-        if (preg_match("/$prefix(.*)/", $class_name, $match) == 0) {
-            // ÉÔÌÀ¤Ê¥¯¥é¥¹Ì¾
-            return null;
-        }
-        $target = $match[1];
-
-        $action_name = substr(preg_replace('/([A-Z])/e', "'_' . strtolower('\$1')", $target), 1);
-
-        return $action_name;
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¤ËÂбþ¤¹¤ë¥¢¥¯¥·¥ç¥ó¥Ñ¥¹Ì¾¤¬¾Êά¤µ¤ì¤¿¾ì¹ç¤Î¥Ç¥Õ¥©¥ë¥È¥Ñ¥¹Ì¾¤òÊÖ¤¹
-     *
-     *  ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï"foo_bar" -> "/Foo/Bar.php"¤È¤Ê¤ë¤Î¤Ç¹¥¤ß±þ¤¸¤Æ¥ª¡¼¥Ð¡¼¥é¥¤¥É¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $action_name    ¥¢¥¯¥·¥ç¥ó̾
-     *  @return string  ¥¢¥¯¥·¥ç¥ó¥¯¥é¥¹¤¬ÄêµÁ¤µ¤ì¤ë¥¹¥¯¥ê¥×¥È¤Î¥Ñ¥¹Ì¾
-     */
-    function getDefaultActionPath($action_name)
-    {
-        $r = preg_replace('/_(.)/e', "'/' . strtoupper('\$1')", ucfirst($action_name)) . '.' . $this->getExt('php');
-        $this->logger->log(LOG_DEBUG, "default action path [%s]", $r);
-
-        return $r;
-    }
-
-    /**
-     *  »ØÄꤵ¤ì¤¿Á«°Ü̾¤ËÂбþ¤¹¤ë¥Ó¥å¡¼¥¯¥é¥¹Ì¾¤òÊÖ¤¹(¥ª¥Ö¥¸¥§¥¯¥È¤ÎÀ¸À®¤Ï¹Ô¤ï¤Ê¤¤)
-     *
-     *  @access public
-     *  @param  string  $forward_name   Á«°ÜÀè¤Î̾¾Î
-     *  @return string  view class¤Î¥¯¥é¥¹Ì¾
-     */
-    function getViewClassName($forward_name)
-    {
-        if ($forward_name == null) {
-            return null;
-        }
-
-        if (isset($this->forward[$forward_name])) {
-            $forward_obj = $this->forward[$forward_name];
-        } else {
-            $forward_obj = array();
-        }
-
-        if (isset($forward_obj['view_name'])) {
-            $class_name = $forward_obj['view_name'];
-            if (class_exists($class_name)) {
-                return $class_name;
-            }
-        } else {
-            $class_name = null;
-        }
-
-        // view¤Î¥¤¥ó¥¯¥ë¡¼¥É
-        $this->_includeViewScript($forward_obj, $forward_name);
-
-        if (is_null($class_name) == false && class_exists($class_name)) {
-            return $class_name;
-        } else if (is_null($class_name) == false) {
-            $this->logger->log(LOG_WARNING, 'stated view class is not defined [%s] -> try default', $class_name);
-        }
-
-        $class_name = $this->getDefaultViewClass($forward_name);
-        if (class_exists($class_name)) {
-            return $class_name;
-        } else {
-            $class_name = $this->class_factory->getObjectName('view');
-            $this->logger->log(LOG_DEBUG, 'view class is not defined for [%s] -> use default [%s]', $forward_name, $class_name);
-            return $class_name;
-        }
-    }
-
-    /**
-     *  Á«°Ü̾¤ËÂбþ¤¹¤ë¥Ó¥å¡¼¥¯¥é¥¹Ì¾¤¬¾Êά¤µ¤ì¤¿¾ì¹ç¤Î¥Ç¥Õ¥©¥ë¥È¥¯¥é¥¹Ì¾¤òÊÖ¤¹
-     *
-     *  ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï[¥×¥í¥¸¥§¥¯¥ÈID]_View_[Á«°Ü̾]¤È¤Ê¤ë¤Î¤Ç¹¥¤ß±þ¤¸¤Æ¥ª¡¼¥Ð¥é¥¤¥É¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $forward_name   forward̾
-     *  @return string  view class¥¯¥é¥¹Ì¾
-     */
-    function getDefaultViewClass($forward_name, $gateway = null)
-    {
-        $gateway_prefix = $this->_getGatewayPrefix($gateway);
-
-        $postfix = preg_replace('/_(.)/e', "strtoupper('\$1')", ucfirst($forward_name));
-        $r = sprintf("%s_%sView_%s", $this->getAppId(), $gateway_prefix ? $gateway_prefix . "_" : "", $postfix);
-        $this->logger->log(LOG_DEBUG, "default view class [%s]", $r);
-
-        return $r;
-    }
-
-    /**
-     *  Á«°Ü̾¤ËÂбþ¤¹¤ë¥Ó¥å¡¼¥Ñ¥¹Ì¾¤¬¾Êά¤µ¤ì¤¿¾ì¹ç¤Î¥Ç¥Õ¥©¥ë¥È¥Ñ¥¹Ì¾¤òÊÖ¤¹
-     *
-     *  ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï"foo_bar" -> "/Foo/Bar.php"¤È¤Ê¤ë¤Î¤Ç¹¥¤ß±þ¤¸¤Æ¥ª¡¼¥Ð¡¼¥é¥¤¥É¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $forward_name   forward̾
-     *  @return string  view class¤¬ÄêµÁ¤µ¤ì¤ë¥¹¥¯¥ê¥×¥È¤Î¥Ñ¥¹Ì¾
-     */
-    function getDefaultViewPath($forward_name)
-    {
-        $r = preg_replace('/_(.)/e', "'/' . strtoupper('\$1')", ucfirst($forward_name)) . '.' . $this->getExt('php');
-        $this->logger->log(LOG_DEBUG, "default view path [%s]", $r);
-
-        return $r;
-    }
-
-    /**
-     *  Á«°Ü̾¤ËÂбþ¤¹¤ë¥Æ¥ó¥×¥ì¡¼¥È¥Ñ¥¹Ì¾¤¬¾Êά¤µ¤ì¤¿¾ì¹ç¤Î¥Ç¥Õ¥©¥ë¥È¥Ñ¥¹Ì¾¤òÊÖ¤¹
-     *
-     *  ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï"foo_bar"¤È¤¤¤¦forward̾¤¬"foo/bar" + ¥Æ¥ó¥×¥ì¡¼¥È³ÈÄ¥»Ò¤È¤Ê¤ë
-     *  ¤Î¤Ç¹¥¤ß±þ¤¸¤Æ¥ª¡¼¥Ð¥é¥¤¥É¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $forward_name   forward̾
-     *  @return string  forward¥Ñ¥¹Ì¾
-     */
-    function getDefaultForwardPath($forward_name)
-    {
-        return str_replace('_', '/', $forward_name) . '.' . $this->ext['tpl'];
-    }
-    
-    /**
-     *  ¥Æ¥ó¥×¥ì¡¼¥È¥Ñ¥¹Ì¾¤«¤éÁ«°Ü̾¤ò¼èÆÀ¤¹¤ë
-     *
-     *  getDefaultForwardPath()¤ò¥ª¡¼¥Ð¡¼¥é¥¤¥É¤·¤¿¾ì¹ç¡¢¤³¤Á¤é¤â¹ç¤ï¤»¤Æ¥ª¡¼¥Ð¡¼¥é¥¤¥É
-     *  ¤¹¤ë¤³¤È¤ò¿ä¾©(ɬ¿Ü¤Ç¤Ï¤Ê¤¤)
-     *
-     *  @access public
-     *  @param  string  $forward_path   ¥Æ¥ó¥×¥ì¡¼¥È¥Ñ¥¹Ì¾
-     *  @return string  Á«°Ü̾
-     */
-    function forwardPathToName($forward_path)
-    {
-        $forward_path = preg_replace('/^\/+/', '', $forward_path);
-        $forward_path = preg_replace(sprintf('/\.%s$/', $this->getExt('tpl')), '', $forward_path);
-
-        return str_replace('/', '_', $forward_path);
-    }
-
-    /**
-     *  Á«°Ü̾¤«¤é¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹Ì¾¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @param  string  $forward_name   forward̾
-     *  @return string  ¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹Ì¾
-     */
-    function _getForwardPath($forward_name)
-    {
-        $forward_obj = null;
-
-        if (isset($this->forward[$forward_name]) == false) {
-            // try default
-            $this->forward[$forward_name] = array();
-        }
-        $forward_obj =& $this->forward[$forward_name];
-        if (isset($forward_obj['forward_path']) == false) {
-            // ¾ÊάÃÍÊäÀµ
-            $forward_obj['forward_path'] = $this->getDefaultForwardPath($forward_name);
-        }
-
-        return $forward_obj['forward_path'];
-    }
-
-    /**
-     *  ¥ì¥ó¥À¥é¤ò¼èÆÀ¤¹¤ë(getTemplateEngine()¤Ï¤½¤Î¤¦¤ÁÇѻߤµ¤ìgetRenderer()¤ËÅý¹ç¤µ¤ì¤ëͽÄê)
-     *
-     *  @access public
-     *  @return object  Ethna_Renderer  ¥ì¥ó¥À¥é¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &getRenderer()
-    {
-        $_ret_object =& $this->getTemplateEngine();
-        return $_ret_object;
-    }
-
-    /**
-     *  ¥Æ¥ó¥×¥ì¡¼¥È¥¨¥ó¥¸¥ó¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return object  Ethna_Renderer  ¥ì¥ó¥À¥é¥ª¥Ö¥¸¥§¥¯¥È
-     *  @obsolete
-     */
-    function &getTemplateEngine()
-    {
-        if (is_object($this->renderer)) {
-            return $this->renderer;
-        }
-        
-        $this->renderer =& $this->class_factory->getObject('renderer');
-       
-        // {{{ for B.C.
-        if (strtolower(get_class($this->renderer)) == "ethna_renderer_smarty") {
-            // user defined modifiers
-            foreach ($this->smarty_modifier_plugin as $modifier) {
-                $name = str_replace('smarty_modifier_', '', $modifier);
-                $this->renderer->setPlugin($name,'modifier', $modifier);
-            }
-
-            // user defined functions
-            foreach ($this->smarty_function_plugin as $function) {
-                if (!is_array($function)) {
-                    $name = str_replace('smarty_function_', '', $function);
-                    $this->renderer->setPlugin($name, 'function', $function);
-                } else {
-                    $this->renderer->setPlugin($function[1], 'function', $function);
-                }
-            }
-
-            // user defined blocks
-            foreach ($this->smarty_block_plugin as $block) {
-                if (!is_array($block)) {
-                    $name = str_replace('smarty_block_', '', $block);
-                    $this->renderer->setPlugin($name,'block', $block);
-                } else {
-                    $this->renderer->setPlugin($block[1],'block', $block);
-                }
-            }
-
-            // user defined prefilters
-            foreach ($this->smarty_prefilter_plugin as $prefilter) {
-                if (!is_array($prefilter)) {
-                    $name = str_replace('smarty_prefilter_', '', $prefilter);
-                    $this->renderer->setPlugin($name,'prefilter', $prefilter);
-                } else {
-                    $this->renderer->setPlugin($prefilter[1],'prefilter', $prefilter);
-                }
-            }
-
-            // user defined postfilters
-            foreach ($this->smarty_postfilter_plugin as $postfilter) {
-                if (!is_array($postfilter)) {
-                    $name = str_replace('smarty_postfilter_', '', $postfilter);
-                    $this->renderer->setPlugin($name,'postfilter', $postfilter);
-                } else {
-                    $this->renderer->setPlugin($postfilter[1],'postfilter', $postfilter);
-                }
-            }
-
-            // user defined outputfilters
-            foreach ($this->smarty_outputfilter_plugin as $outputfilter) {
-                if (!is_array($outputfilter)) {
-                    $name = str_replace('smarty_outputfilter_', '', $outputfilter);
-                    $this->renderer->setPlugin($name,'outputfilter', $outputfilter);
-                } else {
-                    $this->renderer->setPlugin($outputfilter[1],'outputfilter', $outputfilter);
-                }
-            }
-        }
-
-        //¥Æ¥ó¥×¥ì¡¼¥È¥¨¥ó¥¸¥ó¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÀßÄê
-        $this->_setDefaultTemplateEngine($this->renderer);
-        // }}}
-
-        return $this->renderer;
-    }
-
-    /**
-     *  ¥Æ¥ó¥×¥ì¡¼¥È¥¨¥ó¥¸¥ó¤Î¥Ç¥Õ¥©¥ë¥È¾õÂÖ¤òÀßÄꤹ¤ë
-     *
-     *  @access protected
-     *  @param  object  Ethna_Renderer  ¥ì¥ó¥À¥é¥ª¥Ö¥¸¥§¥¯¥È
-     *  @obsolete
-     */
-    function _setDefaultTemplateEngine(&$renderer)
-    {
-    }
-
-    /**
-     *  »ÈÍѸÀ¸ì¤òÀßÄꤹ¤ë
-     *
-     *  ¾­Íè¤Ø¤Î³ÈÄ¥¤Î¤¿¤á¤Î¤ß¤Ë¸ºß¤·¤Æ¤¤¤Þ¤¹¡£¸½ºß¤ÏÆä˥ª¡¼¥Ð¡¼¥é¥¤¥É¤ÎɬÍפϤ¢¤ê¤Þ¤»¤ó¡£
-     *
-     *  @access protected
-     *  @param  string  $language           ¸À¸ìÄêµÁ(LANG_JA, LANG_EN...)
-     *  @param  string  $system_encoding    ¥·¥¹¥Æ¥à¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°Ì¾
-     *  @param  string  $client_encoding    ¥¯¥é¥¤¥¢¥ó¥È¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°
-     */
-    function _setLanguage($language, $system_encoding = null, $client_encoding = null)
-    {
-        $this->language = $language;
-        $this->system_encoding = $system_encoding;
-        $this->client_encoding = $client_encoding;
-
-        $i18n =& $this->getI18N();
-        $i18n->setLanguage($language, $system_encoding, $client_encoding);
-    }
-
-    /**
-     *  ¥Ç¥Õ¥©¥ë¥È¾õÂ֤ǤλÈÍѸÀ¸ì¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access protected
-     *  @return array   »ÈÍѸÀ¸ì,¥·¥¹¥Æ¥à¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°Ì¾,¥¯¥é¥¤¥¢¥ó¥È¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°Ì¾
-     */
-    function _getDefaultLanguage()
-    {
-        return array(LANG_JA, null, null);
-    }
-
-    /**
-     *  ¥Ç¥Õ¥©¥ë¥È¾õÂ֤ǤΥ²¡¼¥È¥¦¥§¥¤¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access protected
-     *  @return int     ¥²¡¼¥È¥¦¥§¥¤ÄêµÁ(GATEWAY_WWW, GATEWAY_CLI...)
-     */
-    function _getDefaultGateway($gateway)
-    {
-        if (is_null($GLOBALS['_Ethna_gateway']) == false) {
-            return $GLOBALS['_Ethna_gateway'];
-        }
-        return GATEWAY_WWW;
-    }
-
-    /**
-     *  ¥²¡¼¥È¥¦¥§¥¤¤ËÂбþ¤·¤¿¥¯¥é¥¹Ì¾¤Î¥×¥ì¥Õ¥£¥¯¥¹¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $gateway    ¥²¡¼¥È¥¦¥§¥¤
-     *  @return string  ¥²¡¼¥È¥¦¥§¥¤¥¯¥é¥¹¥×¥ì¥Õ¥£¥¯¥¹
-     */
-    function _getGatewayPrefix($gateway = null)
-    {
-        $gateway = is_null($gateway) ? $this->getGateway() : $gateway;
-        switch ($gateway) {
-        case GATEWAY_WWW:
-            $prefix = '';
-            break;
-        case GATEWAY_CLI:
-            $prefix = 'Cli';
-            break;
-        case GATEWAY_XMLRPC:
-            $prefix = 'Xmlrpc';
-            break;
-        default:
-            $prefix = '';
-            break;
-        }
-
-        return $prefix;
-    }
-
-    /**
-     *  ¥Þ¥Í¡¼¥¸¥ã¥¯¥é¥¹Ì¾¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $name   ¥Þ¥Í¡¼¥¸¥ã¥­¡¼
-     *  @return string  ¥Þ¥Í¡¼¥¸¥ã¥¯¥é¥¹Ì¾
-     */
-    function getManagerClassName($name)
-    {
-        return sprintf('%s_%sManager', $this->getAppId(), ucfirst($name));
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¥¯¥é¥¹Ì¾¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $name   ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¥­¡¼
-     *  @return string  ¥Þ¥Í¡¼¥¸¥ã¥¯¥é¥¹Ì¾
-     */
-    function getObjectClassName($name)
-    {
-        $name = preg_replace('/_(.)/e', "strtoupper('\$1')", ucfirst($name));
-        return sprintf('%s_%s', $this->getAppId(), $name);
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¥¹¥¯¥ê¥×¥È¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë
-     *
-     *  ¤¿¤À¤·¡¢¥¤¥ó¥¯¥ë¡¼¥É¤·¤¿¥Õ¥¡¥¤¥ë¤Ë¥¯¥é¥¹¤¬Àµ¤·¤¯ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤ÏÊݾڤ·¤Ê¤¤
-     *
-     *  @access private
-     *  @param  array   $action_obj     ¥¢¥¯¥·¥ç¥óÄêµÁ
-     *  @param  string  $action_name    ¥¢¥¯¥·¥ç¥ó̾
-     */
-    function _includeActionScript($action_obj, $action_name)
-    {
-        $class_path = $form_path = null;
-
-        $action_dir = $this->getActiondir();
-
-        // class_path°À­¥Á¥§¥Ã¥¯
-        if (isset($action_obj['class_path'])) {
-            // ¥Õ¥ë¥Ñ¥¹»ØÄꥵ¥Ý¡¼¥È
-            $tmp_path = $action_obj['class_path'];
-            if (Ethna_Util::isAbsolute($tmp_path) == false) {
-                $tmp_path = $action_dir . $tmp_path;
-            }
-
-            if (file_exists($tmp_path) == false) {
-                $this->logger->log(LOG_WARNING, 'class_path file not found [%s] -> try default', $tmp_path);
-            } else {
-                include_once $tmp_path;
-                $class_path = $tmp_path;
-            }
-        }
-
-        // ¥Ç¥Õ¥©¥ë¥È¥Á¥§¥Ã¥¯
-        if (is_null($class_path)) {
-            $class_path = $this->getDefaultActionPath($action_name);
-            if (file_exists($action_dir . $class_path)) {
-                include_once $action_dir . $class_path;
-            } else {
-                $this->logger->log(LOG_DEBUG, 'default action file not found [%s] -> try all files', $class_path);
-                $class_path = null;
-            }
-        }
-        
-        // Á´¥Õ¥¡¥¤¥ë¥¤¥ó¥¯¥ë¡¼¥É
-        if (is_null($class_path)) {
-            $this->_includeDirectory($this->getActiondir());
-            return;
-        }
-
-        // form_path°À­¥Á¥§¥Ã¥¯
-        if (isset($action_obj['form_path'])) {
-            // ¥Õ¥ë¥Ñ¥¹»ØÄꥵ¥Ý¡¼¥È
-            $tmp_path = $action_obj['form_path'];
-            if (Ethna_Util::isAbsolute($tmp_path) == false) {
-                $tmp_path = $action_dir . $tmp_path;
-            }
-
-            if ($tmp_path == $class_path) {
-                return;
-            }
-            if (file_exists($tmp_path) == false) {
-                $this->logger->log(LOG_WARNING, 'form_path file not found [%s] -> try default', $tmp_path);
-            } else {
-                include_once $tmp_path;
-                $form_path = $tmp_path;
-            }
-        }
-
-        // ¥Ç¥Õ¥©¥ë¥È¥Á¥§¥Ã¥¯
-        if (is_null($form_path)) {
-            $form_path = $this->getDefaultFormPath($action_name);
-            if ($form_path == $class_path) {
-                return;
-            }
-            if (file_exists($action_dir . $form_path)) {
-                include_once $action_dir . $form_path;
-            } else {
-                $this->logger->log(LOG_DEBUG, 'default form file not found [%s] -> maybe falling back to default form class', $form_path);
-            }
-        }
-    }
-
-    /**
-     *  ¥Ó¥å¡¼¥¹¥¯¥ê¥×¥È¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë
-     *
-     *  ¤¿¤À¤·¡¢¥¤¥ó¥¯¥ë¡¼¥É¤·¤¿¥Õ¥¡¥¤¥ë¤Ë¥¯¥é¥¹¤¬Àµ¤·¤¯ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤ÏÊݾڤ·¤Ê¤¤
-     *
-     *  @access private
-     *  @param  array   $forward_obj    Á«°ÜÄêµÁ
-     *  @param  string  $forward_name   Á«°Ü̾
-     */
-    function _includeViewScript($forward_obj, $forward_name)
-    {
-        $view_dir = $this->getViewdir();
-
-        // view_path°À­¥Á¥§¥Ã¥¯
-        if (isset($forward_obj['view_path'])) {
-            // ¥Õ¥ë¥Ñ¥¹»ØÄꥵ¥Ý¡¼¥È
-            $tmp_path = $forward_obj['view_path'];
-            if (Ethna_Util::isAbsolute($tmp_path) == false) {
-                $tmp_path = $view_dir . $tmp_path;
-            }
-
-            if (file_exists($tmp_path) == false) {
-                $this->logger->log(LOG_WARNING, 'view_path file not found [%s] -> try default', $tmp_path);
-            } else {
-                include_once $tmp_path;
-                return;
-            }
-        }
-
-        // ¥Ç¥Õ¥©¥ë¥È¥Á¥§¥Ã¥¯
-        $view_path = $this->getDefaultViewPath($forward_name);
-        if (file_exists($view_dir . $view_path)) {
-            include_once $view_dir . $view_path;
-            return;
-        } else {
-            $this->logger->log(LOG_DEBUG, 'default view file not found [%s]', $view_path);
-            $view_path = null;
-        }
-    }
-
-    /**
-     *  ¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤ÎÁ´¤Æ¤Î¥¹¥¯¥ê¥×¥È¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë
-     *
-     *  @access private
-     */
-    function _includeDirectory($dir)
-    {
-        $ext = "." . $this->ext['php'];
-        $ext_len = strlen($ext);
-
-        if (is_dir($dir) == false) {
-            return;
-        }
-
-        $dh = opendir($dir);
-        if ($dh) {
-            while (($file = readdir($dh)) !== false) {
-                if ($file != '.' && $file != '..' && is_dir("$dir/$file")) {
-                    $this->_includeDirectory("$dir/$file");
-                }
-                if (substr($file, -$ext_len, $ext_len) != $ext) {
-                    continue;
-                }
-                include_once $dir . '/' . $file;
-            }
-        }
-        closedir($dh);
-    }
-
-    /**
-     *  ÀßÄê¥Õ¥¡¥¤¥ë¤ÎDSNÄêµÁ¤«¤é»ÈÍѤ¹¤ë¥Ç¡¼¥¿¤òºÆ¹½ÃÛ¤¹¤ë(¥¹¥ì¡¼¥Ö¥¢¥¯¥»¥¹Ê¬´ôÅù)
-     *
-     *  DSN¤ÎÄêµÁÊýË¡(¥Ç¥Õ¥©¥ë¥È:ÀßÄê¥Õ¥¡¥¤¥ë)¤òÊѤ¨¤¿¤¤¾ì¹ç¤Ï¤³¤³¤ò¥ª¡¼¥Ð¡¼¥é¥¤¥É¤¹¤ë
-     *
-     *  @access protected
-     *  @return array   DSNÄêµÁ(array('DB¥­¡¼1' => 'dsn1', 'DB¥­¡¼2' => 'dsn2', ...))
-     */
-    function _prepareDSN()
-    {
-        $r = array();
-
-        foreach ($this->db as $key => $value) {
-            $config_key = "dsn";
-            if ($key != "") {
-                $config_key .= "_$key";
-            }
-            $dsn = $this->config->get($config_key);
-            if (is_array($dsn)) {
-                // ¼ïÊÌ1¤Ä¤Ë¤Ä¤­Ê£¿ôDSN¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¥¢¥¯¥»¥¹Ê¬´ô
-                $dsn = $this->_selectDSN($key, $dsn);
-            }
-            $r[$key] = $dsn;
-        }
-        return $r;
-    }
-
-    /**
-     *  DSN¤Î¥¢¥¯¥»¥¹Ê¬´ô¤ò¹Ô¤¦
-     *  
-     *  ¥¹¥ì¡¼¥Ö¥µ¡¼¥Ð¤Ø¤Î¿¶Ê¬¤±½èÍý(¥Ç¥Õ¥©¥ë¥È:¥é¥ó¥À¥à)¤òÊѹ¹¤·¤¿¤¤¾ì¹ç¤Ï¤³¤Î¥á¥½¥Ã¥É¤ò¥ª¡¼¥Ð¡¼¥é¥¤¥É¤¹¤ë
-     *
-     *  @access protected
-     *  @param  string  $type       DB¼ïÊÌ
-     *  @param  array   $dsn_list   DSN°ìÍ÷
-     *  @return string  ÁªÂò¤µ¤ì¤¿DSN
-     */
-    function _selectDSN($type, $dsn_list)
-    {
-        if (is_array($dsn_list) == false) {
-            return $dsn_list;
-        }
-
-        // ¥Ç¥Õ¥©¥ë¥È:¥é¥ó¥À¥à
-        list($usec, $sec) = explode(' ', microtime());
-        mt_srand($sec + ((float) $usec * 100000));
-        $n = mt_rand(0, count($dsn_list)-1);
-        
-        return $dsn_list[$n];
-    }
-
-    /**
-     *  Ethna¥Þ¥Í¡¼¥¸¥ã¤òÀßÄꤹ¤ë
-     *
-     *  ÉÔÍפʾì¹ç¤Ï¶õ¤Î¥á¥½¥Ã¥É¤È¤·¤Æ¥ª¡¼¥Ð¡¼¥é¥¤¥É¤·¤Æ¤â¤è¤¤
-     *
-     *  @access protected
-     */
-    function _activateEthnaManager()
-    {
-        if ($this->config->get('debug') == false) {
-            return;
-        }
-
-        require_once ETHNA_BASE . '/class/Ethna_InfoManager.php';
-        
-        // see if we have simpletest
-        if (file_exists_ex('simpletest/unit_tester.php', true)) {
-            require_once ETHNA_BASE . '/class/Ethna_UnitTestManager.php';
-        }
-
-        // actionÀßÄê
-        $this->action['__ethna_info__'] = array(
-            'form_name' =>  'Ethna_Form_Info',
-            'form_path' =>  sprintf('%s/class/Action/Ethna_Action_Info.php', ETHNA_BASE),
-            'class_name' => 'Ethna_Action_Info',
-            'class_path' => sprintf('%s/class/Action/Ethna_Action_Info.php', ETHNA_BASE),
-        );
-
-        // forwardÀßÄê
-        $this->forward['__ethna_info__'] = array(
-            'forward_path'  => sprintf('%s/tpl/info.tpl', ETHNA_BASE),
-            'view_name'     => 'Ethna_View_Info',
-            'view_path'     => sprintf('%s/class/View/Ethna_View_Info.php', ETHNA_BASE),
-        );
-        
-        
-        // actionÀßÄê
-        $this->action['__ethna_unittest__'] = array(
-            'form_name' =>  'Ethna_Form_UnitTest',
-            'form_path' =>  sprintf('%s/class/Action/Ethna_Action_UnitTest.php', ETHNA_BASE),
-            'class_name' => 'Ethna_Action_UnitTest',
-            'class_path' => sprintf('%s/class/Action/Ethna_Action_UnitTest.php', ETHNA_BASE),
-        );
-
-        // forwardÀßÄê
-        $this->forward['__ethna_unittest__'] = array(
-            'forward_path'  => sprintf('%s/tpl/unittest.tpl', ETHNA_BASE),
-            'view_name'     => 'Ethna_View_UnitTest',
-            'view_path'     => sprintf('%s/class/View/Ethna_View_UnitTest.php', ETHNA_BASE),
-        );
-
-    }
-
-    /**
-     *  CLI¼Â¹ÔÃæ¥Õ¥é¥°¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return bool    CLI¼Â¹ÔÃæ¥Õ¥é¥°
-     *  @obsolete
-     */
-    function getCLI()
-    {
-        return $this->gateway == GATEWAY_CLI ? true : false;
-    }
-
-    /**
-     *  CLI¼Â¹ÔÃæ¥Õ¥é¥°¤òÀßÄꤹ¤ë
-     *
-     *  @access public
-     *  @param  bool    CLI¼Â¹ÔÃæ¥Õ¥é¥°
-     *  @obsolete
-     */
-    function setCLI($cli)
-    {
-        $this->gateway = $cli ? GATEWAY_CLI : $this->_getDefaultGateway();
-    }
-}
-// }}}
-
-/**
- *  XMLRPC¥²¡¼¥È¥¦¥§¥¤¤Î¥¹¥¿¥Ö¥¯¥é¥¹
- *
- *  @access     public
- */
-function _Ethna_XmlrpcGateway($method_stub, $param)
-{
-    $ctl =& Ethna_Controller::getInstance();
-    $method = $ctl->getXmlrpcMethodName();
-    $r = $ctl->trigger_XMLRPC($method, $param);
-    if (Ethna::isError($r)) {
-        return array(
-            'faultCode' => $r->getCode(),
-            'faultString' => $r->getMessage(),
-        );
-    }
-    return $r;
-}
-?>
diff --git a/class/Ethna_DB.php b/class/Ethna_DB.php
deleted file mode 100644 (file)
index 0dd725b..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_DB.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_DB
-/**
- *  EthnaÍÑDBÃê¾Ý¥¯¥é¥¹
- *
- *  Ethna¤Î¥Õ¥ì¡¼¥à¥ï¡¼¥¯¤ÇDB¥ª¥Ö¥¸¥§¥¯¥È¤ò°·¤¦¤¿¤á¤ÎÃê¾Ý¥¯¥é¥¹
- *  (¤Î¤Ä¤â¤ê...¤¢¤¡¤¹¤Ð¤é¤·¤­PHP 4)
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_DB
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    object  DB              DB¥ª¥Ö¥¸¥§¥¯¥È */
-    var $db;
-
-    /** @var    array   ¥È¥é¥ó¥¶¥¯¥·¥ç¥ó´ÉÍý¥¹¥¿¥Ã¥¯ */
-    var $transaction = array();
-
-    /**#@-*/
-
-
-    /**
-     *  Ethna_DB¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Controller    &$controller    ¥³¥ó¥È¥í¡¼¥é¥ª¥Ö¥¸¥§¥¯¥È
-     *  @param  string  $dsn                                DSN
-     *  @param  bool    $persistent                         »ý³ÀܳÀßÄê
-     */
-    function Ethna_DB(&$controller, $dsn, $persistent)
-    {
-        $this->dsn = $dsn;
-        $this->persistent = $persistent;
-    }
-
-    /**
-     *  DB¤ËÀܳ¤¹¤ë
-     *
-     *  @access public
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function connect()
-    {
-    }
-
-    /**
-     *  DBÀܳ¤òÀÚÃǤ¹¤ë
-     *
-     *  @access public
-     */
-    function disconnect()
-    {
-    }
-
-    /**
-     *  DBÀܳ¾õÂÖ¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @return bool    true:Àµ¾ï(ÀܳºÑ¤ß) false:¥¨¥é¡¼/̤Àܳ
-     */
-    function isValid()
-    {
-    }
-
-    /**
-     *  DB¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤ò³«»Ï¤¹¤ë
-     *
-     *  @access public
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function begin()
-    {
-    }
-
-    /**
-     *  DB¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤òÃæÃǤ¹¤ë
-     *
-     *  @access public
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function rollback()
-    {
-    }
-
-    /**
-     *  DB¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤ò½ªÎ»¤¹¤ë
-     *
-     *  @access public
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function commit()
-    {
-    }
-
-    /**
-     *  ¥Æ¡¼¥Ö¥ëÄêµÁ¾ðÊó¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return mixed   array: PEAR::DB¤Ë½à¤¸¤¿¥á¥¿¥Ç¡¼¥¿ Ethna_Error::¥¨¥é¡¼
-     */
-    function getMetaData()
-    {
-    }
-
-    /**
-     *  DSN¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return string  DSN
-     */
-    function getDSN()
-    {
-        return $this->dsn;
-    }
-}
-// }}}
-?>
diff --git a/class/Ethna_Error.php b/class/Ethna_Error.php
deleted file mode 100644 (file)
index a24857c..0000000
+++ /dev/null
@@ -1,227 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Error.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ ethna_error_handler
-/**
- *  ¥¨¥é¡¼¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô
- *
- *  @param  int     $errno      ¥¨¥é¡¼¥ì¥Ù¥ë
- *  @param  string  $errstr     ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸
- *  @param  string  $errfile    ¥¨¥é¡¼È¯À¸²Õ½ê¤Î¥Õ¥¡¥¤¥ë̾
- *  @param  string  $errline    ¥¨¥é¡¼È¯À¸²Õ½ê¤Î¹ÔÈÖ¹æ
- */
-function ethna_error_handler($errno, $errstr, $errfile, $errline)
-{
-    if ($errno === E_STRICT || ($errno & error_reporting()) === 0) {
-        return;
-    }
-
-    list($level, $name) = Ethna_Logger::errorLevelToLogLevel($errno);
-    switch ($errno) {
-    case E_ERROR:
-    case E_CORE_ERROR:
-    case E_COMPILE_ERROR:
-    case E_USER_ERROR:
-        $php_errno = 'Fatal error'; break;
-    case E_WARNING:
-    case E_CORE_WARNING:
-    case E_COMPILE_WARNING:
-    case E_USER_WARNING:
-        $php_errno = 'Warning'; break;
-    case E_PARSE:
-        $php_errno = 'Parse error'; break;
-    case E_NOTICE:
-    case E_USER_NOTICE:
-    case E_STRICT:
-        $php_errno = 'Notice'; break;
-    default:
-        $php_errno = 'Unknown error'; break;
-    }
-    $php_errstr = sprintf('PHP %s: %s in %s on line %d',
-                          $php_errno, $errstr, $errfile, $errline);
-
-    // error_log()
-    if (ini_get('log_errors')) {
-        $locale = setlocale(LC_TIME, 0);
-        setlocale(LC_TIME, 'C');
-        error_log($php_errstr, 0);
-        setlocale(LC_TIME, $locale);
-    }
-
-    // $logger->log()
-    $c =& Ethna_Controller::getInstance();
-    if ($c !== null) {
-        $logger =& $c->getLogger();
-        $logger->log($level, sprintf("[PHP] %s: %s in %s on line %d",
-                                     $name, $errstr, $errfile, $errline));
-    }
-
-    // printf()
-    if (ini_get('display_errors')) {
-        $is_debug = true;
-        $has_echo = false;
-        if ($c !== null) {
-            $config =& $c->getConfig();
-            $is_debug = $config->get('debug');
-            $facility = $logger->getLogFacility();
-            $has_echo = is_array($facility)
-                        ? in_array('echo', $facility) : $facility === 'echo';
-        }
-        if ($is_debug == true && $has_echo === false) {
-            if ($c !== null && $c->getGateway() === GATEWAY_WWW) {
-                $format = "<b>%s</b>: %s in <b>%s</b> on line <b>%d</b><br />\n";
-            } else {
-                $format = "%s: %s in %s on line %d\n";
-            }
-            printf($format, $php_errno, $errstr, $errfile, $errline);
-        }
-    }
-}
-set_error_handler('ethna_error_handler');
-// }}}
-
-// {{{ Ethna_Error
-/**
- *  ¥¨¥é¡¼¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Error extends PEAR_Error
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    object  Ethna_I18N  i18n¥ª¥Ö¥¸¥§¥¯¥È */
-    var $i18n;
-
-    /** @var    object  Ethna_Logger    logger¥ª¥Ö¥¸¥§¥¯¥È */
-    var $logger;
-
-    /**#@-*/
-
-    /**
-     *  Ethna_Error¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  int     $level              ¥¨¥é¡¼¥ì¥Ù¥ë
-     *  @param  string  $message            ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸
-     *  @param  int     $code               ¥¨¥é¡¼¥³¡¼¥É
-     *  @param  array   $userinfo           ¥¨¥é¡¼ÄɲþðÊó(¥¨¥é¡¼¥³¡¼¥É°Ê¹ß¤ÎÁ´¤Æ¤Î°ú¿ô)
-     */
-    function Ethna_Error($message = null, $code = null, $mode = null, $options = null)
-    {
-        $controller =& Ethna_Controller::getInstance();
-        if ($controller !== null) {
-            $this->i18n =& $controller->getI18N();
-        }
-
-        // $options°Ê¹ß¤Î°ú¿ô->$userinfo
-        if (func_num_args() > 4) {
-            $userinfo = array_slice(func_get_args(), 4);
-            if (count($userinfo) == 1) {
-                if (is_array($userinfo[0])) {
-                    $userinfo = $userinfo[0];
-                } else if (is_null($userinfo[0])) {
-                    $userinfo = array();
-                }
-            }
-        } else {
-            $userinfo = array();
-        }
-
-        // ¥á¥Ã¥»¡¼¥¸ÊäÀµ½èÍý
-        if (is_null($message)) {
-            // $code¤«¤é¥á¥Ã¥»¡¼¥¸¤ò¼èÆÀ¤¹¤ë
-            $message = $controller->getErrorMessage($code);
-            if (is_null($message)) {
-                $message = 'unknown error';
-            }
-        }
-
-        parent::PEAR_Error($message, $code, $mode, $options, $userinfo);
-
-        // Ethna¥Õ¥ì¡¼¥à¥ï¡¼¥¯¤Î¥¨¥é¡¼¥Ï¥ó¥É¥é(PEAR_Error¤Î¥³¡¼¥ë¥Ð¥Ã¥¯¤È¤Ï°Û¤Ê¤ë)
-        Ethna::handleError($this);
-    }
-
-    /**
-     *  level¤Ø¤Î¥¢¥¯¥»¥µ(R)
-     *
-     *  @access public
-     *  @return int     ¥¨¥é¡¼¥ì¥Ù¥ë
-     */
-    function getLevel()
-    {
-        return $this->level;
-    }
-
-    /**
-     *  message¤Ø¤Î¥¢¥¯¥»¥µ(R)
-     *
-     *  PEAR_Error::getMessage()¤ò¥ª¡¼¥Ð¡¼¥é¥¤¥É¤·¤Æ°Ê²¼¤Î½èÍý¤ò¹Ô¤¦
-     *  - ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Îi18n½èÍý
-     *  - $userinfo¤È¤·¤ÆÅϤµ¤ì¤¿¥Ç¡¼¥¿¤Ë¤è¤ëvsprintf()½èÍý
-     *
-     *  @access public
-     *  @return string  ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸
-     */
-    function getMessage()
-    {
-        $tmp_message = $this->i18n ? $this->i18n->get($this->message) : $this->message;
-        $tmp_userinfo = to_array($this->userinfo);
-        $tmp_message_arg_list = array();
-        for ($i = 0; $i < count($tmp_userinfo); $i++) {
-            $tmp_message_arg_list[] = $this->i18n ? $this->i18n->get($tmp_userinfo[$i]) : $tmp_userinfo[$i];
-        }
-        return vsprintf($tmp_message, $tmp_message_arg_list);
-    }
-
-    /**
-     *  ¥¨¥é¡¼ÄɲþðÊó¤Ø¤Î¥¢¥¯¥»¥µ(R)
-     *
-     *  PEAR_Error::getUserInfo()¤ò¥ª¡¼¥Ð¡¼¥é¥¤¥É¤·¤Æ¡¢ÇÛÎó¤Î¸Ä¡¹¤Î
-     *  ¥¨¥ó¥È¥ê¤Ø¤Î¥¢¥¯¥»¥¹¤ò¥µ¥Ý¡¼¥È
-     *
-     *  @access public
-     *  @param  int     $n      ¥¨¥é¡¼ÄɲþðÊó¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹(¾Êά²Ä)
-     *  @return mixed   message°ú¿ô
-     */
-    function getUserInfo($n = null)
-    {
-        if (is_null($n)) {
-            return $this->userinfo;
-        }
-
-        if (isset($this->userinfo[$n])) {
-            return $this->userinfo[$n];
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     *  ¥¨¥é¡¼ÄɲþðÊó¤Ø¤Î¥¢¥¯¥»¥µ(W)
-     *
-     *  PEAR_Error::addUserInfo()¤ò¥ª¡¼¥Ð¡¼¥é¥¤¥É
-     *
-     *  @access public
-     *  @param  string  $info   Äɲ乤륨¥é¡¼¾ðÊó
-     */
-    function addUserInfo($info)
-    {
-        $this->userinfo[] = $info;
-    }
-}
-// }}}
-?>
diff --git a/class/Ethna_Filter.php b/class/Ethna_Filter.php
deleted file mode 100644 (file)
index 87d8201..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Filter.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Filter
-/**
- *  ¥Õ¥ì¡¼¥à¥ï¡¼¥¯¤Î¥Õ¥£¥ë¥¿´ðÄ쥯¥é¥¹
- *
- *  Mojavi¤Î¿¿»÷¤Ç¤¹¡Ê¤­¤Ã¤Ñ¤ê¡Ë¡£¥¢¥¯¥·¥ç¥ó¼Â¹ÔÁ°¤Ë³Æ¼ï½èÍý¤ò¹Ô¤¦¤³¤È¤¬
- *  ½ÐÍè¤Þ¤¹¡£
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- *  @obsolete
- */
-class Ethna_Filter
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    object  Ethna_Controller    controller¥ª¥Ö¥¸¥§¥¯¥È */
-    var $controller;
-
-    /** @var    object  Ethna_Controller    controller¥ª¥Ö¥¸¥§¥¯¥È($controller¤Î¾Êά·Á) */
-    var $ctl;
-
-    /** @var    object  Ethna_Config        ÀßÄꥪ¥Ö¥¸¥§¥¯¥È */
-    var $config;
-
-    /** @var    object  Ethna_Logger        ¥í¥°¥ª¥Ö¥¸¥§¥¯¥È */
-    var $logger;
-
-    /**#@-*/
-
-
-    /**
-     *  Ethna_Filter¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Controller    &$controller    ¥³¥ó¥È¥í¡¼¥é¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function Ethna_Filter(&$controller)
-    {
-        // ¥ª¥Ö¥¸¥§¥¯¥È¤ÎÀßÄê
-        $this->controller =& $controller;
-        $this->ctl =& $this->controller;
-
-        $this->config =& $controller->getConfig();
-        $this->logger =& $this->controller->getLogger();
-    }
-
-    /**
-     *  ¼Â¹ÔÁ°¥Õ¥£¥ë¥¿
-     *
-     *  @access public
-     *  @return Ethna_Error:¼Â¹ÔÃæ»ß any:Àµ¾ï½ªÎ»
-     */
-    function preFilter()
-    {
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¼Â¹ÔÁ°¥Õ¥£¥ë¥¿
-     *
-     *  @access public
-     *  @param  string  $action_name    ¼Â¹Ô¤µ¤ì¤ë¥¢¥¯¥·¥ç¥ó̾
-     *  @return string  null:Àµ¾ï½ªÎ» (string):¼Â¹Ô¤¹¤ë¥¢¥¯¥·¥ç¥ó̾¤òÊѹ¹
-     */
-    function preActionFilter($action_name)
-    {
-        return null;
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¼Â¹Ô¸å¥Õ¥£¥ë¥¿
-     *
-     *  @access public
-     *  @param  string  $action_name    ¼Â¹Ô¤µ¤ì¤¿¥¢¥¯¥·¥ç¥ó̾
-     *  @param  string  $forward_name   ¼Â¹Ô¤µ¤ì¤¿¥¢¥¯¥·¥ç¥ó¤«¤é¤ÎÌá¤êÃÍ
-     *  @return string  null:Àµ¾ï½ªÎ» (string):Á«°Ü̾¤òÊѹ¹
-     */
-    function postActionFilter($action_name, $forward_name)
-    {
-        return null;
-    }
-
-    /**
-     *  ¼Â¹Ô¸å¥Õ¥£¥ë¥¿
-     *
-     *  @access public
-     *  @return Ethna_Error:¼Â¹ÔÃæ»ß any:Àµ¾ï½ªÎ»
-     */
-    function postFilter()
-    {
-    }
-}
-// }}}
-?>
diff --git a/class/Ethna_Generator.php b/class/Ethna_Generator.php
deleted file mode 100644 (file)
index 353f970..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Generator.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Generator
-/**
- *  ¥¹¥±¥ë¥È¥óÀ¸À®¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Generator
-{
-    /**
-     *  ¥¹¥±¥ë¥È¥ó¤òÀ¸À®¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $type       À¸À®¤¹¤ëÂоÝ
-     *  @param  string  $app_dir    ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥Ç¥£¥ì¥¯¥È¥ê
-     *                              (null¤Î¤È¤­¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤òÆÃÄꤷ¤Ê¤¤)
-     *  @param  mixed   residue     ¥×¥é¥°¥¤¥ó¤Îgenerate()¤Ë¤½¤Î¤Þ¤ÞÅϤ¹
-     *  @static
-     */
-    function &generate()
-    {
-        $arg_list   = func_get_args();
-        $type       = array_shift($arg_list);
-        $app_dir    = array_shift($arg_list);
-
-        if ($app_dir === null) {
-            $ctl =& Ethna_Handle::getEthnaController();
-        } else {
-            $ctl =& Ethna_Handle::getAppController($app_dir);
-        }
-        if (Ethna::isError($ctl)) {
-            return $ctl;
-        }
-
-        $plugin_manager =& $ctl->getPlugin();
-        if (Ethna::isError($plugin_manager)) {
-            return $plugin_manager;
-        }
-
-        $generator =& $plugin_manager->getPlugin('Generator', $type);
-        if (Ethna::isError($generator)) {
-            return $generator;
-        }
-        
-        // °ú¿ô¤Ï¥×¥é¥°¥¤¥ó°Í¸¤È¤¹¤ë
-        $ret = call_user_func_array(array(&$generator, 'generate'), $arg_list);
-        return $ret;
-    }
-
-    /**
-     *  ¥¹¥±¥ë¥È¥ó¤òºï½ü¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $type       À¸À®¤¹¤ëÂоÝ
-     *  @param  string  $app_dir    ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥Ç¥£¥ì¥¯¥È¥ê
-     *                              (null¤Î¤È¤­¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤òÆÃÄꤷ¤Ê¤¤)
-     *  @param  mixed   residue     ¥×¥é¥°¥¤¥ó¤Îremove()¤Ë¤½¤Î¤Þ¤ÞÅϤ¹
-     *  @static
-     */
-    function &remove()
-    {
-        $arg_list   = func_get_args();
-        $type       = array_shift($arg_list);
-        $app_dir    = array_shift($arg_list);
-
-        if ($app_dir === null) {
-            $ctl =& Ethna_Handle::getEthnaController();
-        } else {
-            $ctl =& Ethna_Handle::getAppController($app_dir);
-        }
-        if (Ethna::isError($ctl)) {
-            return $ctl;
-        }
-
-        $plugin_manager =& $ctl->getPlugin();
-        if (Ethna::isError($plugin_manager)) {
-            return $plugin_manager;
-        }
-
-        $generator =& $plugin_manager->getPlugin('Generator', $type);
-        if (Ethna::isError($generator)) {
-            return $generator;
-        }
-        
-        // °ú¿ô¤Ï¥×¥é¥°¥¤¥ó°Í¸¤È¤¹¤ë
-        $ret = call_user_func_array(array(&$generator, 'remove'), $arg_list);
-        return $ret;
-    }
-}
-// }}}
-?>
diff --git a/class/Ethna_Handle.php b/class/Ethna_Handle.php
deleted file mode 100644 (file)
index c9b11ad..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Handle.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Handle
-/**
- *  Manager class of Ethna (Command Line) Handlers
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Handle
-{
-    /**#@+
-     *  @access     private
-     */
-
-    /** @var    object  Ethna_Controller    controller¥ª¥Ö¥¸¥§¥¯¥È */
-    var $controller;
-
-    /** @var    object  Ethna_Controller    controller¥ª¥Ö¥¸¥§¥¯¥È($controller¤Î¾Êά·Á) */
-    var $ctl;
-
-    /** @var    object  Ethna_Pluguin       plugin¥ª¥Ö¥¸¥§¥¯¥È */
-    var $plugin;
-
-    /**#@-*/
-
-    // {{{ constructor
-    /**
-     *  Ethna_Handle constructor (stub for php4)
-     *
-     *  @access public
-     */
-    function Ethna_Handle()
-    {
-        $this->controller =& new Ethna_Controller(GATEWAY_CLI);
-        Ethna::clearErrorCallback();
-        Ethna::setErrorCallback(array('Ethna_Handle', 'handleError'));
-
-        $this->ctl =& $this->controller;
-        $this->plugin =& $this->controller->getPlugin();
-    }
-    // }}}
-
-    // {{{ getHandler
-    /**
-     *  get handler object
-     *
-     *  @access public
-     */
-    function &getHandler($id)
-    {
-        $name = preg_replace('/\-(.)/e', "strtoupper('\$1')", ucfirst($id));
-        $handler =& $this->plugin->getPlugin('Handle', $name);
-        if (Ethna::isError($handler)) {
-            return $handler;
-        }
-
-        return $handler;
-    }
-    // }}}
-
-    // {{{ getHandlerList
-    /**
-     *  get an object list of all available handlers
-     *
-     *  @access public
-     */
-    function getHandlerList()
-    {
-        $handler_list = $this->plugin->getPluginList('Handle');
-        usort($handler_list, array($this, "_handler_sort_callback"));
-
-        return $handler_list;
-    }
-
-    /**
-     *  sort callback method
-     */
-    function _handler_sort_callback($a, $b)
-    {
-        return strcmp($a->getId(), $b->getId());
-    }
-    // }}}
-
-    // {{{ getEthnaController
-    /**
-     *  Ethna_Controller¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤ò¼èÆÀ¤¹¤ë
-     *  (Ethna_Handler¤Îʸ̮¤Ç¸Æ¤Ó½Ð¤µ¤ì¤ë¤³¤È¤¬Á°Äó)
-     *
-     *  @access public
-     *  @static
-     */
-    function &getEthnaController()
-    {
-        return Ethna_Controller::getInstance();
-    }
-    // }}}
-
-    // {{{ getAppController
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥³¥ó¥È¥í¡¼¥é¥Õ¥¡¥¤¥ë/¥¯¥é¥¹¤ò¸¡º÷¤¹¤ë
-     *
-     *  @access public
-     *  @static
-     */
-    function &getAppController($app_dir = null)
-    {
-        static $app_controller = array();
-
-        if (isset($app_controller[$app_dir])) {
-            return $app_controller[$app_dir];
-        } else if ($app_dir === null) {
-            return Ethna::raiseError('$app_dir not specified.');
-        }
-
-        $ini_file = null;
-        while (is_dir($app_dir)) {
-            if (is_file("$app_dir/.ethna")) {
-                $ini_file = "$app_dir/.ethna";
-                break;
-            }
-            $app_dir = dirname($app_dir);
-            if (Ethna_Util::isRootDir($app_dir)) {
-                break;
-            }
-        }
-
-        if ($ini_file === null) {
-            return Ethna::raiseError('no .ethna file found');
-        }
-        
-        $macro = parse_ini_file($ini_file);
-        if (isset($macro['controller_file']) == false
-            || isset($macro['controller_class']) == false) {
-            return Ethna::raiseError('invalid .ethna file');
-        }
-        $file = $macro['controller_file'];
-        $class = $macro['controller_class'];
-
-        $controller_file = "$app_dir/$file";
-        if (is_file($controller_file) == false) {
-            return Ethna::raiseError("no such file $controller_file");
-        }
-
-        include_once $controller_file;
-        if (class_exists($class) == false) {
-            return Ethna::raiseError("no such class $class");
-        }
-
-        $global_controller =& $GLOBALS['_Ethna_controller'];
-        $app_controller[$app_dir] =& new $class(GATEWAY_CLI);
-        $GLOBALS['_Ethna_controller'] =& $global_controller;
-        Ethna::clearErrorCallback();
-        Ethna::setErrorCallback(array('Ethna_Handle', 'handleError'));
-
-        return $app_controller[$app_dir];
-    }
-    // }}}
-
-    // {{{ getMasterSetting
-    /**
-     *  Ethna ËÜÂΤÎÀßÄê¤ò¼èÆÀ¤¹¤ë (ethna¥³¥Þ¥ó¥ÉÍÑ)
-     *
-     *  @param  $section    ini ¥Õ¥¡¥¤¥ë¤Î section
-     *  @access public
-     */
-    function &getMasterSetting($section = null)
-    {
-        static $setting = null;
-        if ($setting === null) {
-            $ini_file = ETHNA_BASE . "/.ethna";
-            if (is_file($ini_file) && is_readable($ini_file)) {
-                $setting = parse_ini_file($ini_file, true);
-            } else {
-                $setting = array();
-            }
-        }
-
-        if ($section === null) {
-            return $setting;
-        } else if (array_key_exists($section, $setting)) {
-            return $setting[$section];
-        } else {
-            $array = array();
-            return $array;
-        }
-    }
-    // }}}
-
-    // {{{ handleError
-    /**
-     *  Ethna ¥³¥Þ¥ó¥É¤Ç¤Î¥¨¥é¡¼¥Ï¥ó¥É¥ê¥ó¥°
-     */
-    function handleError(&$eobj)
-    {
-        // do nothing.
-    }
-    // }}}
-}
-// }}}
-?>
diff --git a/class/Ethna_I18N.php b/class/Ethna_I18N.php
deleted file mode 100644 (file)
index 8c11f1f..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_I18N.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_I18N
-/**
- *  i18n´ØÏ¢¤Î½èÍý¤ò¹Ô¤¦¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_I18N
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    bool    gettext¥Õ¥é¥° */
-    var $have_gettext;
-
-    /** @var    string  ¥í¥±¡¼¥ë¥Ç¥£¥ì¥¯¥È¥ê */
-    var $locale_dir;
-
-    /** @var    string  ¥¢¥×¥ê¥±¡¼¥·¥ç¥óID */
-    var $appid;
-
-    /** @var    string  ¥·¥¹¥Æ¥à¦¥¨¥ó¥³¡¼¥Ç¥£¥ó¥° */
-    var $systemencoding;
-
-    /** @var    string  ¥¯¥é¥¤¥¢¥ó¥È¦¥¨¥ó¥³¡¼¥Ç¥£¥ó¥° */
-    var $clientencoding;
-
-    /**#@-*/
-
-    /**
-     *  Ethna_I18N¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  string  $locale_dir ¥í¥±¡¼¥ë¥Ç¥£¥ì¥¯¥È¥ê
-     *  @param  string  $appid      ¥¢¥×¥ê¥±¡¼¥·¥ç¥óID
-     */
-    function Ethna_I18N($locale_dir, $appid)
-    {
-        $this->locale_dir = $locale_dir;
-        $this->appid = strtoupper($appid);
-        $this->have_gettext = extension_loaded("gettext") ? true : false;
-
-        $this->setLanguage(LANG_JA);
-    }
-
-    /**
-     *  ¥í¥±¡¼¥ë¤òÀßÄꤹ¤ë
-     *
-     *  @access public
-     *  @param  string  $language       ¸À¸ìÄêµÁ
-     *  @param  string  $systemencoding ¥·¥¹¥Æ¥à¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°Ì¾
-     *  @param  string  $clientencoding ¥¯¥é¥¤¥¢¥ó¥È¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°Ì¾
-     *  @return string  ¸À¸ì¤ËÂбþ¤·¤ÆÀßÄꤵ¤ì¤¿¥í¥±¡¼¥ë̾
-     */
-    function setLanguage($language, $systemencoding = null, $clientencoding = null)
-    {
-        switch ($language) {
-        case LANG_EN:
-            $locale = "en_US";
-            break;
-        case LANG_JA:
-            $locale = "ja_JP";
-            break;
-        default:
-            $locale = "ja_JP";
-            break;
-        }
-        setlocale(LC_ALL, $locale);
-        if ($this->have_gettext) {
-            bindtextdomain($this->appid, $this->locale_dir);
-            textdomain($this->appid);
-        }
-
-        $this->systemencoding = $systemencoding;
-        $this->clientencoding = $clientencoding;
-
-        return $locale;
-    }
-
-    /**
-     *  ¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤«¤é¥í¥±¡¼¥ë¤ËŬ¹ç¤¹¤ë¥á¥Ã¥»¡¼¥¸¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $message    ¥á¥Ã¥»¡¼¥¸
-     *  @return string  ¥í¥±¡¼¥ë¤ËŬ¹ç¤¹¤ë¥á¥Ã¥»¡¼¥¸
-     */
-    function get($message)
-    {
-        if ($this->have_gettext) {
-            return gettext($message);
-        } else {
-            return $message;
-        }
-    }
-}
-// }}}
-?>
diff --git a/class/Ethna_InfoManager.php b/class/Ethna_InfoManager.php
deleted file mode 100644 (file)
index 7bed536..0000000
+++ /dev/null
@@ -1,733 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_InfoManager.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_InfoManager
-/**
- *  Ethna¥Þ¥Í¡¼¥¸¥ã¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_InfoManager extends Ethna_AppManager
-{
-    /**#@+
-     *  @access private
-     */
-    
-    /** @var    object  Ethna_Controller    ¥³¥ó¥È¥í¡¼¥é¥ª¥Ö¥¸¥§¥¯¥È */
-    var $ctl;
-
-    /** @var    object  Ethna_ClassFactory  ¥¯¥é¥¹¥Õ¥¡¥¯¥È¥ê¥ª¥Ö¥¸¥§¥¯¥È */
-    var $class_factory;
-
-    /** @var    array   ¥¢¥¯¥·¥ç¥ó¥¹¥¯¥ê¥×¥È²òÀÏ·ë²Ì¥­¥ã¥Ã¥·¥å¥Õ¥¡¥¤¥ë */
-    var $cache_class_list_file;
-
-    /** @var    array   ¥¢¥¯¥·¥ç¥ó¥¹¥¯¥ê¥×¥È²òÀÏ·ë²Ì¥­¥ã¥Ã¥·¥å */
-    var $cache_class_list;
-
-    /** @var    array   [°À­]DB¥¿¥¤¥×°ìÍ÷ */
-    var $db_type_list = array(
-        DB_TYPE_RW      => array('name' => 'DB_TYPE_RW'),
-        DB_TYPE_RO      => array('name' => 'DB_TYPE_RO'),
-        DB_TYPE_MISC    => array('name' => 'DB_TYPE_MISC'),
-    );
-
-    /** @var    array   [°À­]¥Õ¥©¡¼¥à·¿°ìÍ÷ */
-    var $form_type_list = array(
-        FORM_TYPE_TEXT      => array('name' => '¥Æ¥­¥¹¥È¥Ü¥Ã¥¯¥¹'),
-        FORM_TYPE_PASSWORD  => array('name' => '¥Ñ¥¹¥ï¡¼¥É'),
-        FORM_TYPE_TEXTAREA  => array('name' => '¥Æ¥­¥¹¥È¥¨¥ê¥¢'),
-        FORM_TYPE_SELECT    => array('name' => '¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹'),
-        FORM_TYPE_RADIO     => array('name' => '¥é¥¸¥ª¥Ü¥¿¥ó'),
-        FORM_TYPE_CHECKBOX  => array('name' => '¥Á¥§¥Ã¥¯¥Ü¥Ã¥¯¥¹'),
-        FORM_TYPE_SUBMIT    => array('name' => '¥Õ¥©¡¼¥àÁ÷¿®¥Ü¥¿¥ó'),
-        FORM_TYPE_FILE      => array('name' => '¥Õ¥¡¥¤¥ë'),
-    );
-
-    /** @var    array   [°À­]ÊÑ¿ô·¿°ìÍ÷ */
-    var $var_type_list = array(
-        VAR_TYPE_INT        => array('name' => 'À°¿ô'),
-        VAR_TYPE_FLOAT      => array('name' => 'ÉâÆ°¾®¿ôÅÀ¿ô'),
-        VAR_TYPE_STRING     => array('name' => 'ʸ»úÎó'),
-        VAR_TYPE_DATETIME   => array('name' => 'ÆüÉÕ'),
-        VAR_TYPE_BOOLEAN    => array('name' => '¿¿µ¶ÃÍ'),
-        VAR_TYPE_FILE       => array('name' => '¥Õ¥¡¥¤¥ë'),
-    );
-
-    /**#@-*/
-
-    /**
-     *  Ethna_InfoManager¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Backend   &$backend   Ethna_Backend¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function Ethna_InfoManager(&$backend)
-    {
-        parent::Ethna_AppManager($backend);
-        $this->ctl =& Ethna_Controller::getInstance();
-        $this->class_factory =& $this->ctl->getClassFactory();
-
-        // ¥¢¥¯¥·¥ç¥ó¥¹¥¯¥ê¥×¥È²òÀÏ·ë²Ì¥­¥ã¥Ã¥·¥å¼èÆÀ
-        $this->cache_class_list_file = sprintf('%s/ethna_info_class_list', $this->ctl->getDirectory('tmp'));
-        if (file_exists($this->cache_class_list_file) && filesize($this->cache_class_list_file) > 0) {
-            $fp = fopen($this->cache_class_list_file, 'r');
-            $s = fread($fp, filesize($this->cache_class_list_file));
-            fclose($fp);
-            $this->cache_class_list = unserialize($s);
-        }
-    }
-
-    /**
-     *  ÄêµÁºÑ¤ß¥¢¥¯¥·¥ç¥ó°ìÍ÷¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return array   ¥¢¥¯¥·¥ç¥ó°ìÍ÷
-     */
-    function getActionList()
-    {
-        $r = array();
-
-        // ¥¢¥¯¥·¥ç¥ó¥¹¥¯¥ê¥×¥È¤ò²òÀϤ¹¤ë
-        $class_list = $this->_analyzeActionList();
-
-        // ¥¢¥¯¥·¥ç¥óÄêµÁ¥¨¥ó¥È¥ê°ìÍ÷
-        list($manifest_action_list, $manifest_class_list) = $this->_getActionList_Manifest($class_list);
-
-        // ¥¢¥¯¥·¥ç¥óÄêµÁ¾Êά¥¨¥ó¥È¥ê°ìÍ÷
-        $implicit_action_list = $this->_getActionList_Implicit($class_list, $manifest_action_list, $manifest_class_list);
-
-        $r = array_merge($manifest_action_list, $implicit_action_list);
-        ksort($r);
-
-        // ¥¢¥¯¥·¥ç¥óÄêµÁ¾ðÊóÊä´°
-        $r = $this->_addActionList($r);
-
-        return $r;
-    }
-
-    /**
-     *  ÄêµÁºÑ¤ßÁ«°ÜÀè°ìÍ÷¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return array   Á«°ÜÀè°ìÍ÷
-     */
-    function getForwardList()
-    {
-        $r = array();
-
-        // ¥Æ¥ó¥×¥ì¡¼¥È/¥Ó¥å¡¼¥¹¥¯¥ê¥×¥È¤ò²òÀϤ¹¤ë
-        $forward_list = $this->_analyzeForwardList();
-
-        // ¥Ó¥å¡¼ÄêµÁ¥¨¥ó¥È¥ê°ìÍ÷
-        $manifest_forward_list = $this->_getForwardList_Manifest();
-
-        // ¥Ó¥å¡¼ÄêµÁ¾Êά¥¨¥ó¥È¥ê°ìÍ÷
-        $implicit_forward_list = $this->_getForwardList_Implicit($forward_list, $manifest_forward_list);
-
-        $r = array_merge($manifest_forward_list, $implicit_forward_list);
-        ksort($r);
-
-        return $r;
-    }
-
-    /**
-     *  ¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Î¥¢¥¯¥·¥ç¥ó¥¹¥¯¥ê¥×¥È¤ò²òÀϤ¹¤ë
-     *
-     *  @access private
-     *  @param  string  $action_dir     ²òÀÏÂоݤΥǥ£¥ì¥¯¥È¥ê
-     *  @return array   ¥¢¥¯¥·¥ç¥ó¥¯¥é¥¹ÄêµÁ°ìÍ÷
-     */
-    function _analyzeActionList($action_dir = null)
-    {
-        $r = array();
-        $cache_update = false;
-
-        if (is_null($action_dir)) {
-            $cache_update = true;
-            $action_dir = $this->ctl->getActiondir();
-        }
-        $prefix_len = strlen($this->ctl->getActiondir());
-
-        $child_dir_list = array();
-
-        $dh = opendir($action_dir);
-        if ($dh == false) {
-            return;
-        }
-
-        $ext = $this->ctl->getExt('php');
-        while (($file = readdir($dh)) !== false) {
-            if ($file == "." || $file == "..") {
-                continue;
-            }
-            $file = $action_dir . $file;
-
-            if (is_dir($file)) {
-                $child_dir_list[] = $file;
-                continue;
-            }
-
-            if (preg_match("/\.$ext\$/", $file) == 0) {
-                continue;
-            }
-
-            $key = substr($file, $prefix_len);
-            
-            // ¥­¥ã¥Ã¥·¥å¥Á¥§¥Ã¥¯
-            include_once $file;
-            if ($this->cache_class_list[$key]['.mtime'] >= filemtime($file)) {
-                $class_list = $this->cache_class_list[$key];
-            } else {
-                $class_list = $this->_analyzeActionScript($file);
-            }
-            if (is_null($class_list) == false) {
-                $r[$key] = $class_list;
-            }
-        }
-
-        closedir($dh);
-
-        foreach ($child_dir_list as $child_dir) {
-            $tmp = $this->_analyzeActionList($child_dir . "/");
-            $r = array_merge($r, $tmp);
-        }
-
-        if ($cache_update) {
-            // ¥­¥ã¥Ã¥·¥å¥Õ¥¡¥¤¥ë¹¹¿·
-            $fp = fopen($this->cache_class_list_file, 'w');
-            fwrite($fp, serialize($r));
-            fclose($fp);
-        }
-
-        return $r;
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¥¹¥¯¥ê¥×¥È¤ò²òÀϤ¹¤ë
-     *
-     *  @access private
-     *  @param  string  $script ¥Õ¥¡¥¤¥ë̾
-     *  @return array   ¥¢¥¯¥·¥ç¥ó¥¯¥é¥¹ÄêµÁ°ìÍ÷
-     */
-    function _analyzeActionScript($script)
-    {
-        $class_list = array();
-        $class_list['.mtime'] = filemtime($script);
-
-        $source = "";
-        $fp = fopen($script, 'r');
-        if ($fp == false) {
-            return null;
-        }
-        while (feof($fp) == false) {
-            $source .= fgets($fp, 8192);
-        }
-        fclose($fp);
-
-        // ¥È¡¼¥¯¥ó¤Ëʬ³ä¤·¤Æ¥¯¥é¥¹ÄêµÁ¾ðÊó¤ò¼èÆÀ
-        $token_list = token_get_all($source);
-        $state = 'T_OUT';
-        $nest = 0;
-        $method_nest = 0;
-        $current = null;
-        for ($i = 0; $i < count($token_list); $i++) {
-            $token = $token_list[$i];
-
-            if (is_string($token)) {
-                if ($token == '{') {
-                    $nest++;
-                } else if ($token == '}') {
-                    $nest--;
-                    if ($state == 'T_PREPARE' || $state == 'T_PERFORM') {
-                        if ($nest == $method_nest) {
-                            $state = 'T_ACTION_CLASS';
-                        }
-                    } else if ($nest == 0) {
-                        $state = 'T_OUT';
-                    }
-                }
-                continue;
-            }
-
-            if ($token[0] == T_CLASS) {
-                // ¥¯¥é¥¹ÄêµÁ³«»Ï
-                $i += 2;
-                $class_name = $token_list[$i][1];       // should be T_STRING
-                if ($this->_isSubclassOf($class_name, 'Ethna_ActionClass')) {
-                    $state = 'T_ACTION_CLASS';
-                    $current = $class_name;
-                    $class_list[$current] = array('type' => 'action_class');
-                } else if ($this->_isSubclassOf($class_name, 'Ethna_ActionForm')) {
-                    $state = 'T_ACTION_FORM';
-                    $current = $class_name;
-                    $class_list[$current] = array('type' => 'action_form');
-                }
-                $nest = 0;  // for safe
-            } else if ($token[0] == T_COMMENT && strncmp($token[1], "/**", 3) == 0 && is_array($token_list[$i+2]) && $token_list[$i+2][0] == T_CLASS) {
-                // DocComment for class
-            } else if ($state == 'T_ACTION_CLASS' && $token[0] == T_FUNCTION) {
-                $i += 2;
-                $method_name = $token_list[$i][1];
-                if (strcasecmp($method_name, 'prepare') == 0) {
-                    $state = 'T_PREPARE';
-                    $method_nest = $nest;
-                } else if (strcasecmp($method_name, 'perform') == 0) {
-                    $state = 'T_PERFORM';
-                    $method_nest = $nest;
-                }
-            } else if (($state == 'T_PREPARE' || $state == 'T_PERFORM') && $token[0] == T_RETURN) {
-                $s = "";
-                $n = 2;
-                while ($token_list[$i+$n] !== ";") {
-                    $s .= is_string($token_list[$i+$n]) ? $token_list[$i+$n] : $token_list[$i+$n][1];
-                    $n++;
-                }
-                $key = $state == 'T_PREPARE' ? 'prepare' : 'perform';
-                $class_list[$current]['return'][$key][] = $s;
-            }
-        }
-
-        if (count($class_list) == 0) {
-            return null;
-        }
-        return $class_list;
-    }
-
-    /**
-     *  »ØÄꤵ¤ì¤¿¥¯¥é¥¹Ì¾¤ò·Ñ¾µ¤·¤Æ¤¤¤ë¤«¤É¤¦¤«¤òÊÖ¤¹
-     *
-     *  @access private
-     *  @param  string  $class_name     ¥Á¥§¥Ã¥¯ÂоݤΥ¯¥é¥¹Ì¾
-     *  @param  string  $parent_name    ¿Æ¥¯¥é¥¹Ì¾
-     *  @return bool    true:·Ñ¾µ¤·¤Æ¤¤¤ë false:¤¤¤Ê¤¤
-     */
-    function _isSubclassOf($class_name, $parent_name)
-    {
-        while ($tmp = get_parent_class($class_name)) {
-            if (strcasecmp($tmp, $parent_name) == 0) {
-                return true;
-            }
-            $class_name = $tmp;
-        }
-        return false;
-    }
-
-    /**
-     *  ¥³¥ó¥È¥í¡¼¥é¤ËÌÀ¼¨Åª¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥¢¥¯¥·¥ç¥ó°ìÍ÷¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @param  array   ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥¯¥é¥¹°ìÍ÷
-     *  @return array   array(¥¢¥¯¥·¥ç¥ó°ìÍ÷, ¥¯¥é¥¹°ìÍ÷)
-     */
-    function _getActionList_Manifest($class_list)
-    {
-        $manifest_action_list = array();
-        $manifest_class_list = array();
-        foreach ($this->ctl->action as $action_name => $action) {
-            if ($action_name == '__ethna_info__') {
-                continue;
-            }
-            $action = $this->ctl->_getAction($action_name);
-
-            $elt = array();
-            // _analyzeActionList()¤Ç¼èÆÀ¤·¤¿¥¯¥é¥¹ÄêµÁ¥Ç¡¼¥¿¤«¤éÂбþ´Ø·¸¤ò¼èÆÀ
-            foreach ($class_list as $file => $elts) {
-                foreach ($elts as $class_name => $def) {
-                    if ($def['type'] == 'action_class' && strcasecmp($class_name, $action['class_name']) == 0) {
-                        $elt['action_class'] = $class_name;
-                        $elt['action_class_file'] = $file;
-                        $elt['action_class_info'] = $def;
-                    } else if ($def['type'] == 'action_form' && strcasecmp($class_name, $action['form_name']) == 0) {
-                        $elt['action_form'] = $class_name;
-                        $elt['action_form_file'] = $file;
-                        $elt['action_form_info'] = $def;
-                    }
-                }
-            }
-
-            // Ì¤ÄêµÁ¥Á¥§¥Ã¥¯
-            if (isset($elt['action_class']) == false) {
-                $elt['action_class'] = $action['class_name'];
-                if (class_exists($action['class_name']) == false) {
-                    $elt['action_class_info'] = array('undef' => true);
-                }
-            }
-            if (isset($elt['action_form']) == false && $action['form_name'] != 'Ethna_ActionForm') {
-                $elt['action_form'] = $action['form_name'];
-                if (class_exists($action['form_name']) == false) {
-                    $elt['action_form_info'] = array('undef' => true);
-                }
-            }
-            $manifest_action_list[$action_name] = $elt;
-            $manifest_class_list[] = strtolower($elt['action_class']);
-        }
-
-        return array($manifest_action_list, $manifest_class_list);
-    }
-
-    /**
-     *  °ÅÌÛ¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥¢¥¯¥·¥ç¥ó°ìÍ÷¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @param  array   $class_list             ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥¯¥é¥¹°ìÍ÷
-     *  @param  array   $manifest_action_list   ÌÀ¼¨Åª¤ËÄêµÁºÑ¤ß¤Î¥¢¥¯¥·¥ç¥ó°ìÍ÷
-     *  @param  array   $manifest_class_list    ÌÀ¼¨Åª¤ËÄêµÁºÑ¤ß¤Î¥¯¥é¥¹°ìÍ÷
-     *  @return array   array:¥¢¥¯¥·¥ç¥ó°ìÍ÷
-     */
-    function _getActionList_Implicit($class_list, $manifest_action_list, $manifest_class_list)
-    {
-        $implicit_action_list = array();
-
-        foreach ($class_list as $file => $elts) {
-            foreach ($elts as $class_name => $def) {
-                if (in_array(strtolower($class_name), $manifest_class_list)) {
-                    continue;
-                }
-
-                // ¥¯¥é¥¹Ì¾¤«¤é¥¢¥¯¥·¥ç¥ó̾¤ò¼èÆÀ
-                if ($def['type'] == 'action_class') {
-                    $action_name = $this->ctl->actionClassToName($class_name);
-                    if (array_key_exists($action_name, $manifest_action_list)) {
-                        continue;
-                    }
-                    $implicit_action_list[$action_name]['action_class'] = $class_name;
-                    $implicit_action_list[$action_name]['action_class_file'] = $file;
-                    $implicit_action_list[$action_name]['action_class_info'] = $def;
-                } else if ($def['type'] == 'action_form') {
-                    $action_name = $this->ctl->actionFormToName($class_name);
-                    if (array_key_exists($action_name, $manifest_action_list)) {
-                        continue;
-                    }
-                    $implicit_action_list[$action_name]['action_form'] = $class_name;
-                    $implicit_action_list[$action_name]['action_form_file'] = $file;
-                    $implicit_action_list[$action_name]['action_form_info'] = $def;
-                } else {
-                    continue;
-                }
-            }
-        }
-
-        return $implicit_action_list;
-    }
-    
-    /**
-     *  ¥¢¥¯¥·¥ç¥óÄêµÁ°ìÍ÷¤òÊä´°¤¹¤ë
-     *
-     *  @access private
-     *  @param  array   $action_list    ¼èÆÀ¤·¤¿¥¢¥¯¥·¥ç¥ó°ìÍ÷
-     *  @return array   ½¤Àµ¸å¤Î¥¢¥¯¥·¥ç¥ó°ìÍ÷
-     */
-    function _addActionList($action_list)
-    {
-        foreach ($action_list as $action_name => $action) {
-            // ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¤Ë¥Õ¥©¡¼¥àÄêµÁ¾ðÊó¤òÄɲÃ
-            $form_name = $action['action_form'];
-            if (class_exists($form_name) == false) {
-                continue;
-            }
-            $af =& new $form_name($this->ctl);
-
-            $form = array();
-            foreach ($af->getDef() as $name => $def) {
-                $form[$name]['required'] = $def['required'] ? 'true' : 'false';
-                foreach (array('name', 'max', 'min', 'regexp', 'custom') as $key) {
-                    $form[$name][$key] = $def[$key];
-                }
-                $form[$name]['filter'] = str_replace(",", "\n", $def['filter']);
-                $form[$name]['form_type'] = $this->getAttrName('form_type', $def['form_type']);
-                $form[$name]['type_is_array'] = is_array($def['type']);
-                $form[$name]['type'] = $this->getAttrName('var_type', is_array($def['type']) ? $def['type'][0] : $def['type']);
-            }
-            $action['action_form_info']['form'] = $form;
-            $action_list[$action_name] = $action;
-        }
-
-        return $action_list;
-    }
-
-    /**
-     *  ¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Î¥Æ¥ó¥×¥ì¡¼¥È¤ò²òÀϤ¹¤ë
-     *
-     *  @access private
-     *  @param  string  $action_dir     ²òÀÏÂоݤΥǥ£¥ì¥¯¥È¥ê
-     *  @return array   Á«°ÜÄêµÁ°ìÍ÷
-     */
-    function _analyzeForwardList($template_dir = null)
-    {
-        $r = array();
-
-        if (is_null($template_dir)) {
-            $template_dir = $this->ctl->getTemplatedir();
-        }
-        $prefix_len = strlen($this->ctl->getTemplatedir());
-
-        $child_dir_list = array();
-
-        $dh = opendir($template_dir);
-        if ($dh == false) {
-            return;
-        }
-
-        $ext = $this->ctl->getExt('tpl');
-        while (($file = readdir($dh)) !== false) {
-            if ($file == "." || $file == "..") {
-                continue;
-            }
-            $file = $template_dir . '/' . $file;
-
-            if (is_dir($file)) {
-                $child_dir_list[] = $file;
-                continue;
-            }
-
-            if (preg_match("/\.$ext\$/", $file) == 0) {
-                continue;
-            }
-
-            $tpl = substr($file, $prefix_len);
-            $r[] = $this->ctl->forwardPathToName($tpl);
-        }
-
-        closedir($dh);
-
-        foreach ($child_dir_list as $child_dir) {
-            $tmp = $this->_analyzeForwardList($child_dir);
-            $r = array_merge($r, $tmp);
-        }
-
-        return $r;
-    }
-
-    /**
-     *  ¥³¥ó¥È¥í¡¼¥é¤ËÌÀ¼¨Åª¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ëÁ«°ÜÀè°ìÍ÷¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @return array   ¥Ó¥å¡¼°ìÍ÷
-     */
-    function _getForwardList_Manifest()
-    {
-        $manifest_forward_list = array();
-        foreach ($this->ctl->forward as $forward_name => $forward) {
-            if ($forward_name == '__ethna_info__') {
-                continue;
-            }
-
-            $elt = array();
-            $elt['template_file'] = $this->ctl->_getForwardPath($forward_name);
-            if (file_exists(sprintf("%s/%s", $this->ctl->getTemplatedir(), $elt['template_file'])) == false) {
-                $elt['template_file_info'] = array('undef' => true);
-            }
-
-            $elt['view_class'] = $this->ctl->getViewClassName($forward_name);
-            if ($elt['view_class'] == 'Ethna_ViewClass') {
-                $elt['view_class'] = null;
-            } else if (class_exists($elt['view_class']) == false) {
-                $elt['view_class_info'] = array('undef' => true);
-            }
-
-            if (isset($forward['view_path']) && $forward['view_path']) {
-                $elt['view_path'] = $forward['view_path'];
-            } else if ($this->_isSubclassOf($elt['view_class'], 'Ethna_ViewClass')) {
-                $elt['view_class_file'] = $this->ctl->getDefaultViewPath($forward_name);
-            } else {
-                foreach ($this->cache_class_list as $file => $elts) {
-                    foreach ($elts as $name => $def) {
-                        if (strcasecmp($elt['view_class'], $name) == 0) {
-                            $elt['view_class_file'] = $file;
-                            break 2;
-                        }
-                    }
-                }
-            }
-
-            $manifest_forward_list[$forward_name] = $elt;
-        }
-
-        return $manifest_forward_list;
-    }
-
-    /**
-     *  °ÅÌÛ¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥Ó¥å¡¼°ìÍ÷¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @param  array   $forward_list           ÄêµÁ¤µ¤ì¤Æ¤¤¤ëÁ«°Ü̾°ìÍ÷
-     *  @param  array   $manifest_forward_list  ÌÀ¼¨Åª¤ËÄêµÁºÑ¤ß¤Î¥Ó¥å¡¼°ìÍ÷
-     *  @return array   array:¥Ó¥å¡¼°ìÍ÷
-     */
-    function _getForwardList_Implicit($forward_list, $manifest_forward_list)
-    {
-        $implicit_forward_list = array();
-        $manifest_forward_name_list = array_keys($manifest_forward_list);
-
-        foreach ($forward_list as $forward_name) {
-            if (in_array($forward_name, $manifest_forward_name_list)) {
-                continue;
-            }
-
-            $elt = array();
-            $elt['template_file'] = $this->ctl->_getForwardPath($forward_name);
-            $elt['view_class'] = $this->ctl->getViewClassName($forward_name);
-            if ($elt['view_class'] == 'Ethna_ViewClass') {
-                $elt['view_class'] = null;
-            } else if (class_exists($elt['view_class']) == false) {
-                $elt['view_class'] = null;
-            } else {
-                $elt['view_class_file'] = $this->ctl->getDefaultViewPath($forward_name);
-            }
-
-            $implicit_forward_list[$forward_name] = $elt;
-        }
-
-        return $implicit_forward_list;
-    }
-
-    /**
-     *  Ethna¤ÎÀßÄê°ìÍ÷¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return array   ÀßÄê°ìÍ÷¤ò³ÊǼ¤·¤¿ÇÛÎó
-     *  @todo   respect access controll
-     */
-    function getConfiguration()
-    {
-        $r = array();
-
-        // core
-        $elts = array();
-        $elts['¥¢¥×¥ê¥±¡¼¥·¥ç¥óID'] = $this->ctl->getAppId();
-        $elts['¥¢¥×¥ê¥±¡¼¥·¥ç¥óURL'] = $this->ctl->getURL();
-        $elts['Ethna¥Ð¡¼¥¸¥ç¥ó'] = ETHNA_VERSION;
-        $elts['Ethna¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê'] = ETHNA_BASE;
-        $r['Core'] = $elts;
-
-        // class
-        $elts = array();
-        $elts['¥Ð¥Ã¥¯¥¨¥ó¥É'] = $this->class_factory->getObjectName('backend');
-        $elts['¥¯¥é¥¹¥Õ¥¡¥¯¥È¥ê'] = $this->class_factory->getObjectName('class');
-        $elts['ÀßÄê'] = $this->class_factory->getObjectName('config');
-        $elts['DB'] = $this->class_factory->getObjectName('db');
-        $elts['¥¨¥é¡¼'] = $this->class_factory->getObjectName('error');
-        $elts['¥Õ¥©¡¼¥à'] = $this->class_factory->getObjectName('form');
-        $elts['¥í¥°'] = $this->class_factory->getObjectName('logger');
-        $elts['i18n'] = $this->class_factory->getObjectName('i18n');
-        $elts['¥×¥é¥°¥¤¥ó'] = $this->class_factory->getObjectName('plugin');
-        $elts['¥»¥Ã¥·¥ç¥ó'] = $this->class_factory->getObjectName('session');
-        $elts['SQL'] = $this->class_factory->getObjectName('sql');
-        $elts['¥Ó¥å¡¼'] = $this->class_factory->getObjectName('view');
-        $r['¥¯¥é¥¹'] = $elts;
-
-        // DB
-        $elts = array();
-        $db_list = array();
-        foreach ($this->ctl->db as $key => $db) {
-            if ($key == "") {
-                $tmp = '$db';
-            } else {
-                $tmp = sprintf('$db_%s', $key);
-            }
-            $elts[$tmp] = $this->getAttrName('db_type', $db);
-            $db_list[$key] = $tmp;
-        }
-        $r['DB¥¿¥¤¥×'] = $elts;
-
-        // DSN
-        $elts = array();
-        foreach ($db_list as $key => $name) {
-            $config_key = "dsn";
-            if ($key != "") {
-                $config_key .= "_$key";
-            }
-            $dsn = $this->config->get($config_key);
-            if ($dsn) {
-                $elts[$name] = implode("\n", to_array($dsn));
-            }
-        }
-        $r['DSN'] = $elts;
-
-        // directory
-        $elts = array();
-        $elts['¥¢¥×¥ê¥±¡¼¥·¥ç¥ó'] = $this->ctl->getBasedir();
-        $elts['¥¢¥¯¥·¥ç¥ó'] = $this->ctl->getActiondir();
-        $elts['¥Ó¥å¡¼'] = $this->ctl->getViewdir();
-        $elts['¥Õ¥£¥ë¥¿'] = $this->ctl->getDirectory('filter');
-        $elts['¥×¥é¥°¥¤¥ó'] = $this->ctl->getDirectory('plugin');
-        $elts['¥Æ¥ó¥×¥ì¡¼¥È'] = $this->ctl->getTemplatedir();
-        $elts['¥Æ¥ó¥×¥ì¡¼¥È¥­¥ã¥Ã¥·¥å'] = $this->ctl->getDirectory('template_c');
-        $elts['Smarty¥×¥é¥°¥¤¥ó'] = implode(',', $this->ctl->getDirectory('plugins'));
-        $elts['ÀßÄê¥Õ¥¡¥¤¥ë'] = $this->ctl->getDirectory('etc');
-        $elts['¥í¥±¡¼¥ë'] = $this->ctl->getDirectory('locale');
-        $elts['¥í¥°'] = $this->ctl->getDirectory('log');
-        $elts['°ì»þ¥Õ¥¡¥¤¥ë'] = $this->ctl->getDirectory('tmp');
-        $r['¥Ç¥£¥ì¥¯¥È¥ê'] = $elts;
-
-        // ext
-        $elts = array();
-        $elts['¥Æ¥ó¥×¥ì¡¼¥È'] = $this->ctl->getExt('tpl');
-        $elts['PHP¥¹¥¯¥ê¥×¥È'] = $this->ctl->getExt('php');
-        $r['³ÈÄ¥»Ò'] = $elts;
-
-        // filter
-        $elts = array();
-        $n = 1;
-        foreach ($this->ctl->filter as $filter) {
-            $key = sprintf("¥Õ¥£¥ë¥¿(%d)", $n);
-            if (class_exists($filter)) {
-                $elts[$key] = $filter;
-                $n++;
-            }
-        }
-        $r['¥Õ¥£¥ë¥¿'] = $elts;
-
-        // manager
-        $elts = array();
-        foreach ($this->ctl->getManagerList() as $key => $manager) {
-            $name = sprintf('$%s', $key);
-            $elts[$name] = $this->ctl->getManagerClassName($manager);
-        }
-        $r['¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Þ¥Í¡¼¥¸¥ã'] = $elts;
-
-        return $r;
-    }
-
-    /**
-     *  ¥×¥é¥°¥¤¥ó¤Î°ìÍ÷¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return array   ÀßÄê°ìÍ÷¤ò³ÊǼ¤·¤¿ÇÛÎó
-     *  @todo   respect access controll
-     */
-    function getPluginList()
-    {
-        $r = array();
-        $plugin = $this->ctl->getPlugin();
-        foreach ($plugin->searchAllPluginType() as $type) {
-            $plugin->searchAllPluginSrc($type);
-            if (isset($plugin->src_registry[$type])) {
-                $elts = array();
-                foreach ($plugin->src_registry[$type] as $name => $src) {
-                    if (empty($src)) {
-                        continue;
-                    }
-                    $elts[$name] = $src[2];
-                }
-                ksort($elts);
-                $r[$type] = $elts;
-            }
-        }
-        ksort($r);
-        return $r;
-    }
-}
-// }}}
-?>
diff --git a/class/Ethna_Logger.php b/class/Ethna_Logger.php
deleted file mode 100644 (file)
index 9cc307d..0000000
+++ /dev/null
@@ -1,569 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Logger.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-/**
- *  ³ÈÄ¥¥í¥°¥×¥í¥Ñ¥Æ¥£: ¥Õ¥¡¥¤¥ë½ÐÎÏ
- */
-define('LOG_FILE', 1 << 16);
-
-/**
- *  ³ÈÄ¥¥í¥°¥×¥í¥Ñ¥Æ¥£: É¸½à½ÐÎÏ
- */
-define('LOG_ECHO', 1 << 17);
-
-// {{{ Ethna_Logger
-/**
- *  ¥í¥°´ÉÍý¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Logger extends Ethna_AppManager
-{
-    // {{{ properties
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    array   ¥í¥°¥Õ¥¡¥·¥ê¥Æ¥£°ìÍ÷ */
-    var $log_facility_list = array(
-        'auth'      => array('name' => 'LOG_AUTH'),
-        'cron'      => array('name' => 'LOG_CRON'),
-        'daemon'    => array('name' => 'LOG_DAEMON'),
-        'kern'      => array('name' => 'LOG_KERN'),
-        'lpr'       => array('name' => 'LOG_LPR'),
-        'mail'      => array('name' => 'LOG_MAIL'),
-        'news'      => array('name' => 'LOG_NEWS'),
-        'syslog'    => array('name' => 'LOG_SYSLOG'),
-        'user'      => array('name' => 'LOG_USER'),
-        'uucp'      => array('name' => 'LOG_UUCP'),
-        'file'      => array('name' => 'LOG_FILE'),
-        'echo'      => array('name' => 'LOG_ECHO'),
-    );
-
-    /** @var    array   ¥í¥°¥ì¥Ù¥ë°ìÍ÷ */
-    var $log_level_list = array(
-        'emerg'     => array('name' => 'LOG_EMERG',     'value' => 7),
-        'alert'     => array('name' => 'LOG_ALERT',     'value' => 6),
-        'crit'      => array('name' => 'LOG_CRIT',      'value' => 5),
-        'err'       => array('name' => 'LOG_ERR',       'value' => 4),
-        'warning'   => array('name' => 'LOG_WARNING',   'value' => 3),
-        'notice'    => array('name' => 'LOG_NOTICE',    'value' => 2),
-        'info'      => array('name' => 'LOG_INFO',      'value' => 1),
-        'debug'     => array('name' => 'LOG_DEBUG',     'value' => 0),
-    );
-
-    /** @var    object  Ethna_Controller    controller¥ª¥Ö¥¸¥§¥¯¥È */
-    var $controller;
-
-    /** @var    object  Ethna_Controller    controller¥ª¥Ö¥¸¥§¥¯¥È($controller¤Î¾Êά·Á) */
-    var $ctl;
-
-    /** @var    array   ¥í¥°¥Õ¥¡¥·¥ê¥Æ¥£ */
-    var $facility = array();
-
-    /** @var    array   ¥í¥°¥ì¥Ù¥ë */
-    var $level = array();
-
-    /** @var    array   ¥í¥°¥ª¥×¥·¥ç¥ó */
-    var $option = array();
-
-    /** @var    array   ¥á¥Ã¥»¡¼¥¸¥Õ¥£¥ë¥¿(½ÐÎÏ) */
-    var $message_filter_do = array();
-
-    /** @var    array   ¥á¥Ã¥»¡¼¥¸¥Õ¥£¥ë¥¿(̵»ë) */
-    var $message_filter_ignore = array();
-
-    /** @var    int     ¥¢¥é¡¼¥È¥ì¥Ù¥ë */
-    var $alert_level;
-
-    /** @var    string  ¥¢¥é¡¼¥È¥á¡¼¥ë¥¢¥É¥ì¥¹ */
-    var $alert_mailaddress;
-
-    /** @var    array   Ethna_LogWriter ¥í¥°½ÐÎÏ¥ª¥Ö¥¸¥§¥¯¥È */
-    var $writer = array();
-
-    /** @var    bool    ¥í¥°½ÐÎϳ«»Ï¥Õ¥é¥° */
-    var $is_begin = false;
-
-    /** @var    array   ¥í¥°¥¹¥¿¥Ã¥¯(begin()Á°¤Ëlog()¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¤Î¥¹¥¿¥Ã¥¯) */
-    var $log_stack = array();
-
-    /**#@-*/
-    // }}}
-    
-    // {{{ Ethna_Logger
-    /**
-     *  Ethna_Logger¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Controller    $controller controller¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function Ethna_Logger(&$controller)
-    {
-        $this->controller =& $controller;
-        $this->ctl =& $this->controller;
-        $config =& $controller->getConfig();
-
-        // ¥í¥°¥Õ¥¡¥·¥ê¥Æ¥£¥Æ¡¼¥Ö¥ëÊä´°(LOCAL0¡ÁLOCAL8)
-        for ($i = 0; $i < 8; $i++) {
-            if (defined("LOG_LOCAL$i")) {
-                $this->log_facility_list["local$i"] = array('name' => "LOG_LOCAL$i");
-            }
-        }
-
-        $config_log = $config->get('log');
-
-        // ¥í¥°¥Õ¥¡¥·¥ê¥Æ¥£
-        if (is_array($config_log)) {
-            $this->facility = array_keys($config_log);
-        } else {
-            $this->facility = $this->_parseLogFacility($config->get('log_facility'));
-        }
-
-        foreach ($this->facility as $f) {
-            // ¥í¥°¥ì¥Ù¥ë
-            if (isset($config_log[$f]['level'])) {
-                $this->level[$f] = $this->_parseLogLevel($config_log[$f]['level']);
-            } else if (($level = $config->get("log_level_$f")) !== null) {
-                $this->level[$f] = $this->_parseLogLevel($level);
-            } else if (($level = $config->get("log_level")) !== null) {
-                $this->level[$f] = $this->_parseLogLevel($level);
-            } else {
-                $this->level[$f] = LOG_WARNING;
-            }
-
-            // ¥á¥Ã¥»¡¼¥¸¥Õ¥£¥ë¥¿(filter_do)
-            if (isset($config_log[$f]['filter_do'])) {
-                $this->message_filter_do[$f] = $config_log[$f]['filter_do'];
-            } else if (($filter = $config->get("log_filter_do_$f")) !== null) {
-                $this->message_filter_do[$f] = $filter;
-            } else if (($filter = $config->get("log_filter_do")) !== null) {
-                $this->message_filter_do[$f] = $filter;
-            } else {
-                $this->message_filter_do[$f] = '';
-            }
-
-            // ¥á¥Ã¥»¡¼¥¸¥Õ¥£¥ë¥¿(filter_ignore)
-            if (isset($config_log[$f]['filter_ignore'])) {
-                $this->message_filter_ignore[$f] = $config_log[$f]['filter_ignore'];
-            } else if (($filter = $config->get("log_filter_ignore_$f")) !== null) {
-                $this->message_filter_ignore[$f] = $filter;
-            } else if (($filter = $config->get("log_filter_ignore")) !== null) {
-                $this->message_filter_ignore[$f] = $filter;
-            } else {
-                $this->message_filter_ignore[$f] = '';
-            }
-
-            // ¤½¤Î¤¿¥ª¥×¥·¥ç¥ó (unset¤Ï¤»¤º¤Ë¤½¤Î¤Þ¤ÞÅϤ¹)
-            if (isset($config_log[$f])) {
-                $this->option[$f] = $config_log[$f];
-            } else {
-                $this->option[$f] = array();
-            }
-
-            // 'option' ¤Ë¤è¤ë¥ª¥×¥·¥ç¥ó»ØÄê (for B.C.)
-            if (isset($config_log[$f]['option'])) {
-                $option = $this->_parseLogOption($config_log[$f]['option']);
-            } else if (($option = $config->get("log_option_$f")) !== null) {
-                $option = $this->_parseLogOption($option);
-            } else if (($option = $config->get("log_option")) !== null) {
-                $option = $this->_parseLogOption($option);
-            }
-            if ($option !== null) {
-                $this->option[$f] = array_merge($this->option[$f], $option);
-            }
-        }
-
-        // ¥¢¥é¡¼¥È¥ª¥×¥·¥ç¥ó
-        $this->alert_level =
-            $this->_parseLogLevel($config->get('log_alert_level'));
-        $this->alert_mailaddress
-            = preg_split('/\s*,\s*/', $config->get('log_alert_mailaddress'));
-    }
-    // }}}
-
-    // {{{ getLogFacility
-    /**
-     *  ¥í¥°¥Õ¥¡¥·¥ê¥Æ¥£¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return mixed   ¥í¥°¥Õ¥¡¥·¥ê¥Æ¥£(¥Õ¥¡¥·¥ê¥Æ¥£¤¬1¤Ä°Ê²¼¤Ê¤éscalar¡¢
-     *                  2¤Ä°Ê¾å¤Ê¤éÇÛÎó¤òÊÖ¤¹ for B.C.)
-     */
-    function getLogFacility()
-    {
-        if (is_array($this->facility)) {
-            if (count($this->facility) == 0) {
-                return null;
-            } else if (count($this->facility) == 1) {
-                return $this->facility[0];
-            }
-        }
-        return $this->facility;
-    }
-    // }}}
-
-    // {{{ errorLevelToLogLevel
-    /**
-     *  PHP¥¨¥é¡¼¥ì¥Ù¥ë¤ò¥í¥°¥ì¥Ù¥ë¤ËÊÑ´¹¤¹¤ë
-     *
-     *  @access public
-     *  @param  int     $errno  PHP¥¨¥é¡¼¥ì¥Ù¥ë
-     *  @return array   ¥í¥°¥ì¥Ù¥ë(LOG_NOTICE,...), ¥¨¥é¡¼¥ì¥Ù¥ëɽ¼¨Ì¾("E_NOTICE"...)
-     *  @static
-     */
-    function errorLevelToLogLevel($errno)
-    {
-        switch ($errno) {
-        case E_ERROR:           $code = "E_ERROR"; $level = LOG_ERR; break;
-        case E_WARNING:         $code = "E_WARNING"; $level = LOG_WARNING; break;
-        case E_PARSE:           $code = "E_PARSE"; $level = LOG_CRIT; break;
-        case E_NOTICE:          $code = "E_NOTICE"; $level = LOG_NOTICE; break;
-        case E_USER_ERROR:      $code = "E_USER_ERROR"; $level = LOG_ERR; break;
-        case E_USER_WARNING:    $code = "E_USER_WARNING"; $level = LOG_WARNING; break;
-        case E_USER_NOTICE:     $code = "E_USER_NOTICE"; $level = LOG_NOTICE; break;
-        case E_STRICT:          $code = "E_STRICT"; $level = LOG_NOTICE; return;
-        default:                $code = "E_UNKNOWN"; $level = LOG_DEBUG; break;
-        }
-        return array($level, $code);
-    }
-    // }}}
-
-    // {{{ begin
-    /**
-     *  ¥í¥°½ÐÎϤò³«»Ï¤¹¤ë
-     *
-     *  @access public
-     */
-    function begin()
-    {
-        // LogWriter¥¯¥é¥¹¤ÎÀ¸À®
-        foreach ($this->facility as $f) {
-            $this->writer[$f] =& $this->_getLogWriter($this->option[$f], $f);
-            if (Ethna::isError($this->writer[$f])) {
-                // use default
-                $this->writer[$f] =& $this->_getLogWriter($this->option[$f],
-                                                          "default");
-            }
-        }
-
-        foreach (array_keys($this->writer) as $key) {
-            $this->writer[$key]->begin();
-        }
-        
-        $this->is_begin = true;
-
-        // begin()°ÊÁ°¤Îlog()¤ò½èÍý
-        if (count($this->log_stack) > 0) {
-            // copy and clear for recursive calls
-            $tmp_stack = $this->log_stack;
-            $this->log_stack = array();
-
-            while (count($tmp_stack) > 0) {
-                $log = array_shift($tmp_stack);
-                $this->log($log[0], $log[1]);
-            }
-        }
-    }
-    // }}}
-
-    // {{{ log
-    /**
-     *  ¥í¥°¤ò½ÐÎϤ¹¤ë
-     *
-     *  @access public
-     *  @param  int     $level      ¥í¥°¥ì¥Ù¥ë(LOG_DEBUG, LOG_NOTICE...)
-     *  @param  string  $message    ¥í¥°¥á¥Ã¥»¡¼¥¸(+°ú¿ô)
-     */
-    function log($level, $message)
-    {
-        if ($this->is_begin == false) {
-            $args = func_get_args();
-            if (count($args) > 2) {
-                array_splice($args, 0, 2);
-                $message = vsprintf($message, $args);
-            }
-            $this->log_stack[] = array($level, $message);
-            return;
-        }
-
-        foreach (array_keys($this->writer) as $key) {
-            // ¥í¥°¥á¥Ã¥»¡¼¥¸¥Õ¥£¥ë¥¿(¥ì¥Ù¥ë¥Õ¥£¥ë¥¿¤ËÍ¥À褹¤ë)
-            $r = $this->_evalMessageMask($this->message_filter_do[$key], $message);
-            if (is_null($r)) {
-                $r = $this->_evalMessageMask($this->message_filter_ignore[$key],
-                                             $message);
-                if ($r) {
-                    continue;
-                }
-            }
-
-            // ¥í¥°¥ì¥Ù¥ë¥Õ¥£¥ë¥¿
-            if ($this->_evalLevelMask($this->level[$key], $level)) {
-                continue;
-            }
-
-            // ¥í¥°½ÐÎÏ
-            $args = func_get_args();
-            if (count($args) > 2) {
-                array_splice($args, 0, 2);
-                $message = vsprintf($message, $args);
-            }
-            $output = $this->writer[$key]->log($level, $message);
-        }
-
-        // ¥¢¥é¡¼¥È½èÍý
-        if ($this->_evalLevelMask($this->alert_level, $level) == false) {
-            if (count($this->alert_mailaddress) > 0) {
-                $this->_alert($output);
-            }
-        }
-    }
-    // }}}
-
-    // {{{ end
-    /**
-     *  ¥í¥°½ÐÎϤò½ªÎ»¤¹¤ë
-     *
-     *  @access public
-     */
-    function end()
-    {
-        foreach (array_keys($this->writer) as $key) {
-            $this->writer[$key]->end();
-        }
-
-        $this->is_begin = false;
-    }
-    // }}}
-
-    // {{{ _getLogWriter
-    /**
-     *  LogWriter¥ª¥Ö¥¸¥§¥¯¥È¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access protected
-     *  @param  array   $option     ¥í¥°¥ª¥×¥·¥ç¥ó
-     *  @param  string  $facility   ¥í¥°¥Õ¥¡¥·¥ê¥Æ¥£
-     *  @return object  LogWriter   LogWriter¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &_getLogWriter($option, $facility = null)
-    {
-        if ($facility == null) {
-            $facility = $this->getLogFacility();
-            if (is_array($facility)) {
-                $facility = $facility[0];
-            }
-        }
-
-        if (is_null($facility)) {
-            $plugin = "default";
-        } else if (isset($this->log_facility_list[$facility])) {
-            if ($facility == "file" || $facility == "echo") {
-                $plugin = $facility;
-
-            } else {
-                $plugin = "syslog";
-            }
-        } else {
-            $plugin = $facility;
-        }
-
-        $plugin_manager =& $this->controller->getPlugin();
-        $plugin_object = $plugin_manager->getPlugin('Logwriter',
-                                                    ucfirst(strtolower($plugin)));
-        if (Ethna::isError($plugin_object)) {
-            return $plugin_object;
-        }
-
-        if (isset($option['ident']) == false) {
-            $option['ident'] = $this->controller->getAppId();
-        }
-        if (isset($option['facility']) == false) {
-            $option['facility'] = $facility;
-        }
-        $plugin_object->setOption($option);
-
-        return $plugin_object;
-    }
-    // }}}
-
-    // {{{ _alert
-    /**
-     *  ¥¢¥é¡¼¥È¥á¡¼¥ë¤òÁ÷¿®¤¹¤ë
-     *
-     *  @access protected
-     *  @param  string  $message    ¥í¥°¥á¥Ã¥»¡¼¥¸
-     *  @return int     0:Àµ¾ï½ªÎ»
-     *  @deprecated
-     */
-    function _alert($message)
-    {
-        restore_error_handler();
-
-        // ¥Ø¥Ã¥À
-        $header = "Mime-Version: 1.0\n";
-        $header .= "Content-Type: text/plain; charset=ISO-2022-JP\n";
-        $header .= "X-Alert: " . $this->controller->getAppId();
-        $subject = sprintf("[%s] alert (%s%s)\n",
-                           $this->controller->getAppId(),
-                           substr($message, 0, 12),
-                           strlen($message) > 12 ? "..." : "");
-        
-        // ËÜʸ
-        $mail = sprintf("--- [log message] ---\n%s\n\n", $message);
-        if (function_exists("debug_backtrace")) {
-            $bt = debug_backtrace();
-            $mail .= sprintf("--- [backtrace] ---\n%s\n",
-                             Ethna_Util::FormatBacktrace($bt));
-        }
-
-        foreach ($this->alert_mailaddress as $mailaddress) {
-            mail($mailaddress,
-                 $subject,
-                 mb_convert_encoding($mail, "ISO-2022-JP"),
-                 $header);
-        }
-
-        set_error_handler("ethna_error_handler");
-
-        return 0;
-    }
-    // }}}
-
-    // {{{ _evalMessageMask
-    /**
-     *  ¥í¥°¥á¥Ã¥»¡¼¥¸¤Î¥Þ¥¹¥¯¥Á¥§¥Ã¥¯¤ò¹Ô¤¦
-     *
-     *  @access private
-     *  @param  string  $filter     ¥Õ¥£¥ë¥¿
-     *  @param  string  $message    ¥í¥°¥á¥Ã¥»¡¼¥¸
-     *  @return mixed   true:match, null:skip
-     */
-    function _evalMessageMask($filter, $message)
-    {
-        $regexp = sprintf("/%s/", $filter);
-
-        if ($filter && preg_match($regexp, $message)) {
-            return true;
-        }
-
-        return null;
-    }
-    // }}}
-
-    // {{{ _evalLevelMask
-    /**
-     *  ¥í¥°¥ì¥Ù¥ë¤Î¥Þ¥¹¥¯¥Á¥§¥Ã¥¯¤ò¹Ô¤¦
-     *
-     *  @access private
-     *  @param  int     $src    ¥í¥°¥ì¥Ù¥ë¥Þ¥¹¥¯
-     *  @param  int     $dst    ¥í¥°¥ì¥Ù¥ë
-     *  @return bool    true:ïçÃͰʲ¼ false:ïçÃͰʾå
-     */
-    function _evalLevelMask($src, $dst)
-    {
-        static $log_level_table = null;
-
-        if (is_null($log_level_table)) {
-            $log_level_table = array();
-
-            // ¥í¥°¥ì¥Ù¥ë¥Æ¡¼¥Ö¥ë(µÕ°ú¤­)ºîÀ®
-            foreach ($this->log_level_list as $key => $def) {
-                if (defined($def['name']) == false) {
-                    continue;
-                }
-                $log_level_table[constant($def['name'])] = $def['value'];
-            }
-        }
-
-        // ÃΤé¤Ê¤¤¥ì¥Ù¥ë¤Ê¤é½ÐÎϤ·¤Ê¤¤
-        if (isset($log_level_table[$src]) == false
-            || isset($log_level_table[$dst]) == false) {
-            return true;
-        }
-
-        if ($log_level_table[$dst] >= $log_level_table[$src]) {
-            return false;
-        }
-
-        return true;
-    }
-    // }}}
-
-    // {{{ _parseLogOption
-    /**
-     *  ¥í¥°¥ª¥×¥·¥ç¥ó(ÀßÄê¥Õ¥¡¥¤¥ëÃÍ)¤ò²òÀϤ¹¤ë
-     *
-     *  @access private
-     *  @param  mixed   $option ¥í¥°¥ª¥×¥·¥ç¥ó(ÀßÄê¥Õ¥¡¥¤¥ëÃÍ)
-     *  @return array   ²òÀϤµ¤ì¤¿ÀßÄê¥Õ¥¡¥¤¥ëÃÍ(¥¢¥é¡¼¥ÈÄÌÃΥ᡼¥ë¥¢¥É¥ì¥¹,
-     *                  ¥¢¥é¡¼¥ÈÂÐ¾Ý¥í¥°¥ì¥Ù¥ë, ¥í¥°¥ª¥×¥·¥ç¥ó)
-     */
-    function _parseLogOption($option)
-    {
-        if (is_null($option)) {
-            return null;
-        } else if (is_array($option)) {
-            return $option;
-        }
-
-        $ret = array();
-        $elts = preg_split('/\s*,\s*/', $option);
-        foreach ($elts as $elt) {
-            if (preg_match('/^(.*?)\s*:\s*(.*)/', $elt, $match)) {
-                $ret[$match[1]] = $match[2];
-            } else {
-                $ret[$elt] = true;
-            }
-        }
-
-        return $ret;
-    }
-    // }}}
-
-    // {{{ _parseLogFacility
-    /**
-     *  ¥í¥°¥Õ¥¡¥·¥ê¥Æ¥£(ÀßÄê¥Õ¥¡¥¤¥ëÃÍ)¤ò²òÀϤ¹¤ë
-     *
-     *  @access private
-     *  @param  string  $facility   ¥í¥°¥Õ¥¡¥·¥ê¥Æ¥£(ÀßÄê¥Õ¥¡¥¤¥ëÃÍ)
-     *  @return array   ¥í¥°¥Õ¥¡¥·¥ê¥Æ¥£(LOG_LOCAL0, LOG_FILE...)¤ò³ÊǼ¤·¤¿ÇÛÎó
-     */
-    function _parseLogFacility($facility)
-    {
-        $facility_list = preg_split('/\s*,\s*/', $facility, -1, PREG_SPLIT_NO_EMPTY);
-        return $facility_list;
-    }
-    // }}}
-
-    // {{{ _parseLogLevel
-    /**
-     *  ¥í¥°¥ì¥Ù¥ë(ÀßÄê¥Õ¥¡¥¤¥ëÃÍ)¤ò²òÀϤ¹¤ë
-     *
-     *  @access private
-     *  @param  string  $level  ¥í¥°¥ì¥Ù¥ë(ÀßÄê¥Õ¥¡¥¤¥ëÃÍ)
-     *  @return int     ¥í¥°¥ì¥Ù¥ë(LOG_DEBUG, LOG_NOTICE...)
-     */
-    function _parseLogLevel($level)
-    {
-        if (isset($this->log_level_list[strtolower($level)]) == false) {
-            return null;
-        }
-        $constant_name = $this->log_level_list[strtolower($level)]['name'];
-
-        return constant($constant_name);
-    }
-    // }}}
-}
-// }}}
-?>
diff --git a/class/Ethna_MailSender.php b/class/Ethna_MailSender.php
deleted file mode 100644 (file)
index e97251d..0000000
+++ /dev/null
@@ -1,285 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_MailSender.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-/** ¥á¡¼¥ë¥Æ¥ó¥×¥ì¡¼¥È¥¿¥¤¥×: Ä¾ÀÜÁ÷¿® */
-define('MAILSENDER_TYPE_DIRECT', 0);
-
-
-// {{{ Ethna_MailSender
-/**
- *  ¥á¡¼¥ëÁ÷¿®¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_MailSender
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    array   ¥á¡¼¥ë¥Æ¥ó¥×¥ì¡¼¥ÈÄêµÁ */
-    var $def = array(
-    );
-
-    /** @var    string  ¥á¡¼¥ë¥Æ¥ó¥×¥ì¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê */
-    var $mail_dir = 'mail';
-
-    /** @var    int     Á÷¿®¥á¡¼¥ë¥¿¥¤¥× */
-    var $type;
-
-    /** @var    string  Á÷¿®¥ª¥×¥·¥ç¥ó */
-    var $option = '';
-
-    /** @var    object  Ethna_Backend   backend¥ª¥Ö¥¸¥§¥¯¥È */
-    var $backend;
-
-    /** @var    object  Ethna_Config    ÀßÄꥪ¥Ö¥¸¥§¥¯¥È */
-    var $config;
-
-    /**#@-*/
-
-    /**
-     *  Ethna_MailSender¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Backend   &$backend       backend¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function Ethna_MailSender(&$backend)
-    {
-        $this->backend =& $backend;
-        $this->config =& $this->backend->getConfig();
-    }
-
-    /**
-     *  ¥á¡¼¥ë¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ë
-     *
-     *  @access public
-     *  @param  string  $option ¥á¡¼¥ëÁ÷¿®¥ª¥×¥·¥ç¥ó
-     */
-    function setOption($option)
-    {
-        $this->option = $option;
-    }
-
-    /**
-     *  ¥á¡¼¥ë¤òÁ÷¿®¤¹¤ë
-     *
-     *  $attach ¤Î»ØÄêÊýË¡:
-     *  - ´û¸¤Î¥Õ¥¡¥¤¥ë¤òźÉÕ¤¹¤ë¤È¤­
-     *  <code>
-     *  array('filename' => '/tmp/hoge.xls', 'content-type' => 'application/vnd.ms-excel')
-     *  </code>
-     *  - Ê¸»úÎó¤Ë̾Á°¤òÉÕ¤±¤ÆźÉÕ¤¹¤ë¤È¤­
-     *  <code>
-     *  array('name' => 'foo.txt', 'content' => 'this is foo.')
-     *  </code>
-     *  'content-type' ¾Êά»þ¤Ï 'application/octet-stream' ¤È¤Ê¤ë¡£
-     *  Ê£¿ôźÉÕ¤¹¤ë¤È¤­¤Ï¾å¤ÎÇÛÎó¤òź»ú0¤«¤é»Ï¤Þ¤ë¤Õ¤Ä¤¦¤ÎÇÛÎó¤ËÆþ¤ì¤ë¡£
-     *
-     *  @access public
-     *  @param  string  $to         ¥á¡¼¥ëÁ÷¿®À襢¥É¥ì¥¹ (null¤Î¤È¤­¤ÏÁ÷¿®¤»¤º¤ËÆâÍƤò return ¤¹¤ë)
-     *  @param  string  $template   ¥á¡¼¥ë¥Æ¥ó¥×¥ì¡¼¥È̾ or ¥¿¥¤¥×
-     *  @param  array   $macro      ¥Æ¥ó¥×¥ì¡¼¥È¥Þ¥¯¥í or $template¤¬MAILSENDER_TYPE_DIRECT¤Î¤È¤­¤Ï¥á¡¼¥ëÁ÷¿®ÆâÍÆ)
-     *  @param  array   $attach     ÅºÉÕ¥Õ¥¡¥¤¥ë
-     */
-    function send($to, $template, $macro, $attach = null)
-    {
-        // ¥á¡¼¥ëÆâÍƤòºîÀ®
-        if ($template === MAILSENDER_TYPE_DIRECT) {
-            $mail = $macro;
-        } else {
-            $renderer =& $this->getTemplateEngine();
-
-            // ´ðËܾðÊóÀßÄê
-            $renderer->setProp("env_datetime", strftime('%Yǯ%m·î%dÆü %H»þ%Mʬ%SÉÃ'));
-            $renderer->setProp("env_useragent", $_SERVER["HTTP_USER_AGENT"]);
-            $renderer->setProp("env_remoteaddr", $_SERVER["REMOTE_ADDR"]);
-
-            // ¥Ç¥Õ¥©¥ë¥È¥Þ¥¯¥íÀßÄê
-            $macro = $this->_setDefaultMacro($macro);
-
-            // ¥æ¡¼¥¶ÄêµÁ¾ðÊóÀßÄê
-            if (is_array($macro)) {
-                foreach ($macro as $key => $value) {
-                    $renderer->setProp($key, $value);
-                }
-            }
-            if (isset($this->def[$template])) {
-                $template = $this->def[$template];
-            }
-            $mail = $renderer->perform(sprintf('%s/%s', $this->mail_dir, $template), true);
-        }
-        if ($to === null) {
-            return $mail;
-        }
-
-        // ¥á¡¼¥ëÆâÍƤò¥Ø¥Ã¥À¤ÈËÜʸ¤ËʬΥ
-        $mail = str_replace("\r\n", "\n", $mail);
-        list($header, $body) = $this->_parse($mail);
-
-        // ÅºÉÕ¥Õ¥¡¥¤¥ë (multipart)
-        if ($attach !== null) {
-            $attach = isset($attach[0]) ? $attach : array($attach);
-            $boundary = Ethna_Util::getRandom(); 
-            $body = "This is a multi-part message in MIME format.\n\n" .
-                "--$boundary\n" .
-                "Content-Type: text/plain; charset=iso-2022-jp\n" .
-                "Content-Transfer-Encoding: 7bit\n\n" .
-                "$body\n";
-            foreach ($attach as $part) {
-                if (isset($part['content']) === false
-                    && isset($part['filename']) && is_readable($part['filename'])) {
-                    $part['content'] = file_get_contents($part['filename']);
-                    $part['filename'] = basename($part['filename']);
-                }
-                if (isset($part['content']) === false) {
-                    continue;
-                }
-                if (isset($part['content-type']) === false) {
-                    $part['content-type'] = 'application/octet-stream';
-                }
-                if (isset($part['name']) === false) {
-                    $part['name'] = $part['filename'];
-                }
-                if (isset($part['filename']) === false) {
-                    $part['filename'] = $part['name'];
-                }
-                $part['name'] = preg_replace('/([^\x00-\x7f]+)/e',
-                    "Ethna_Util::encode_MIME('$1')", $part['name']); // XXX: rfc2231
-                $part['filename'] = preg_replace('/([^\x00-\x7f]+)/e',
-                    "Ethna_Util::encode_MIME('$1')", $part['filename']);
-
-                $body .=
-                    "--$boundary\n" .
-                    "Content-Type: " . $part['content-type'] . ";\n" .
-                        "\tname=\"" . $part['name'] . "\"\n" .
-                    "Content-Transfer-Encoding: base64\n" . 
-                    "Content-Disposition: attachment;\n" .
-                        "\tfilename=\"" . $part['filename'] . "\"\n\n";
-                $body .= chunk_split(base64_encode($part['content']));
-            }
-            $body .= "--$boundary--";
-        }
-
-        // ¥Ø¥Ã¥À
-        if (isset($header['mime-version']) === false) {
-            $header['mime-version'] = array('Mime-Version', '1.0');
-        }
-        if (isset($header['subject']) === false) {
-            $header['subject'] = array('Subject', 'no subject in original');
-        }
-        if (isset($header['content-type']) === false) {
-            $header['content-type'] = array(
-                'Content-Type',
-                $attach === null ? 'text/plain; charset=iso-2022-jp'
-                                 : "multipart/mixed; \n\tboundary=\"$boundary\"",
-            );
-        }
-
-        $header_line = "";
-        foreach ($header as $key => $value) {
-            if ($key == 'subject') {
-                // should be added by mail()
-                continue;
-            }
-            if ($header_line != "") {
-                $header_line .= "\n";
-            }
-            $header_line .= $value[0] . ": " . $value[1];
-        }
-
-        // ²þ¹Ô¥³¡¼¥É¤ò CRLF ¤Ë
-        if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
-            $body = str_replace("\n", "\r\n", $body);
-        }
-        $header_line = str_replace("\n", "\r\n", $header_line);
-
-        // Á÷¿®
-        foreach (to_array($to) as $rcpt) {
-            if (is_string($this->option)) {
-                mail($rcpt, $header['subject'][1], $body, $header_line, $this->option);
-            } else {
-                mail($rcpt, $header['subject'][1], $body, $header_line);
-            }
-        }
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¸ÇÍ­¤Î¥Þ¥¯¥í¤òÀßÄꤹ¤ë
-     *
-     *  @access protected
-     *  @param  array   $macro  ¥æ¡¼¥¶ÄêµÁ¥Þ¥¯¥í
-     *  @return array   ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¸ÇÍ­½èÍýºÑ¤ß¥Þ¥¯¥í
-     */
-    function _setDefaultMacro($macro)
-    {
-        return $macro;
-    }
-
-    /**
-     *  ¥Æ¥ó¥×¥ì¡¼¥È¥á¡¼¥ë¤Î¥Ø¥Ã¥À¾ðÊó¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @param  string  $mail   ¥á¡¼¥ë¥Æ¥ó¥×¥ì¡¼¥È
-     *  @return array   ¥Ø¥Ã¥À, ËÜʸ
-     */
-    function _parse($mail)
-    {
-        list($header_line, $body) = preg_split('/\r?\n\r?\n/', $mail, 2);
-        $header_line .= "\n";
-
-        $header_lines = explode("\n", $header_line);
-        $header = array();
-        foreach ($header_lines as $h) {
-            if (strstr($h, ':') == false) {
-                continue;
-            }
-            list($key, $value) = preg_split('/\s*:\s*/', $h, 2);
-            $i = strtolower($key);
-            $header[$i] = array();
-            $header[$i][] = $key;
-            $header[$i][] = preg_replace('/([^\x00-\x7f]+)/e', "Ethna_Util::encode_MIME('$1')", $value);
-        }
-
-        $body = mb_convert_encoding($body, "ISO-2022-JP");
-
-        return array($header, $body);
-    }
-
-    /**
-     *  ¥á¡¼¥ë¥Õ¥©¡¼¥Þ¥Ã¥ÈÍÑ¥ì¥ó¥À¥é¥ª¥Ö¥¸¥§¥¯¥È¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return object  Ethna_Renderer  ¥ì¥ó¥À¥é¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &getRenderer()
-    {
-        $_ret_object =& $this->getTemplateEngine();
-        return $_ret_object;
-    }
-
-    /**
-     *  ¥á¡¼¥ë¥Õ¥©¡¼¥Þ¥Ã¥ÈÍÑ¥ì¥ó¥À¥é¥ª¥Ö¥¸¥§¥¯¥È¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return object  Ethna_Renderer  ¥ì¥ó¥À¥é¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &getTemplateEngine()
-    {
-        $c =& $this->backend->getController();
-        $renderer =& $c->getRenderer();
-        return $renderer;
-    }
-}
-// }}}
-?>
diff --git a/class/Ethna_PearWrapper.php b/class/Ethna_PearWrapper.php
deleted file mode 100644 (file)
index 904accd..0000000
+++ /dev/null
@@ -1,676 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_PearWrapper.php
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-require_once 'PEAR.php';
-require_once 'PEAR/Config.php';
-require_once 'PEAR/Command.php';
-require_once 'PEAR/PackageFile.php';
-
-// {{{ Ethna_PearWrapper
-/**
- *  wrapper class for PEAR_Command
- *  This class should be instantiated in ethna handler.
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_PearWrapper
-{
-    // {{{ properties
-    /**#@+
-     *  @access     private
-     */
-
-    /** @var    string  channel url of ethna repositry */
-    var $channel;
-
-    /** @var    string  target, 'master' or 'local' */
-    var $target;
-
-    /** @var    object  controller object collesponding to the target */
-    var $target_ctl;
-
-    /** @var    object  PEAR_Config     PEAR_Config object */
-    var $config;
-
-    /** @var    object  PEAR_Registry   PEAR_Registry object */
-    var $registry;
-
-    /** @var    object  PEAR_Frontend   PEAR_Frontend(_CLI) object */
-    var $ui;
-
-    /** @var    array   options for pearcmd */
-    var $_pearopt;
-
-    /**#@-*/
-    // }}}
-
-    // {{{ constructor, initializer
-    /**
-     *  Ethna_PearWrapper constructor
-     *
-     *  @access public
-     */
-    function Ethna_PearWrapper()
-    {
-        $this->channel = null;
-        $this->config = null;
-        $this->registry = null;
-        $this->ui = null;
-        $this->target = null;
-        $this->target_ctl = null;
-    }
-
-    /**
-     *  setup PEAR_Config and so on.
-     *
-     *  @param  string      $target     whether 'master' or 'local'
-     *  @param  string|null $app_dir    local application directory.
-     *  @param  string|null $channel    channel for the package repository.
-     *  @return true|Ethna_Error
-     */
-    function &init($target, $app_dir = null, $channel = null)
-    {
-        $true = true;
-        if ($target == 'master') {
-            $this->target = 'master';
-        } else {
-            // default target is 'local'.
-            $this->target = 'local';
-        }
-
-        // setup PEAR_Frontend
-        PEAR_Command::setFrontendType('CLI');
-        $this->ui =& PEAR_Command::getFrontendObject();
-
-        // set PEAR's error handling
-        // TODO: if PEAR/Command/Install.php is newer than 1.117, displayError goes well.
-        PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array(&$this->ui, 'displayFatalError'));
-
-        // set channel
-        $master_setting = Ethna_Handle::getMasterSetting('repositry');
-        if ($channel !== null) {
-            $this->channel = $channel;
-        } else if (isset($master_setting["channel_{$target}"])) {
-            $this->channel = $master_setting["channel_{$target}"];
-        } else {
-            $this->channel = 'pear.ethna.jp';
-        }
-
-        // set target controller
-        if ($target == 'master') {
-            $this->target_ctl =& Ethna_Handle::getEthnaController();
-        } else {
-            $this->target_ctl =& Ethna_Handle::getAppController($app_dir);
-        }
-        if (Ethna::isError($this->target_ctl)) {
-            return $this->target_ctl;
-        }
-
-        // setup PEAR_Config
-        if ($target == 'master') {
-            $ret =& $this->_setMasterConfig();
-        } else {
-            $ret =& $this->_setLocalConfig();
-        }
-        if (Ethna::isError($ret)) {
-            return $ret;
-        }
-        $this->ui->setConfig($this->config);
-
-        // setup PEAR_Registry
-        $this->registry =& $this->config->getRegistry();
-
-        return $true;
-    }
-
-    /**
-     *  config for master.
-     *
-     *  @return true|Ethna_Error
-     *  @access private 
-     */
-    function &_setMasterConfig()
-    {
-        $true = true;
-
-        // setup config
-        $this->config =& PEAR_Config::singleton();
-
-        // setup channel
-        $reg =& $this->config->getRegistry();
-        if ($reg->channelExists($this->channel) == false) {
-            $ret =& $this->doChannelDiscover();
-            if (Ethna::isError($ret)) {
-                return $ret;
-            }
-        }
-
-        return $true;
-    }
-
-    /**
-     *  config for local.
-     *
-     *  @return true|Ethna_Error
-     *  @access private 
-     */
-    function &_setLocalConfig()
-    {
-        $true = true;
-
-        // determine dirs
-        $base = $this->target_ctl->getBaseDir();
-        $bin  = $this->target_ctl->getDirectory('bin');
-        $tmp  = $this->target_ctl->getDirectory('tmp');
-        $dirs = array(
-                'php_dir'       => "{$base}/skel",
-                'bin_dir'       => "{$bin}",
-                'cache_dir'     => "{$tmp}/.pear/cache",
-                'download_dir'  => "{$tmp}/.pear/download",
-                'temp_dir'      => "{$tmp}/.pear/temp",
-                'doc_dir'       => "{$tmp}/.pear/doc",
-                'ext_dir'       => "{$tmp}/.pear/ext",
-                'data_dir'      => "{$tmp}/.pear/data",
-                'test_dir'      => "{$tmp}/.pear/test",
-                );
-
-        // mkdir
-        foreach ($dirs as $key => $dir) {
-            if (is_dir($dir) == false) {
-                Ethna_Util::mkdir($dir, 0755);
-            }
-        }
-
-        $pearrc = "{$base}/skel/.pearrc";
-        $this->config =& PEAR_Config::singleton($pearrc);
-
-        // read local .pearrc if exists.
-        if (is_file($pearrc) && is_readable($pearrc)) {
-            $this->config->readConfigFile($pearrc);
-        }
-
-        // set dirs to config
-        foreach ($dirs as $key => $dir) {
-            $this->config->set($key, $dir);
-        }
-
-        // setup channel
-        $reg =& $this->config->getRegistry();
-        if ($reg->channelExists($this->channel) == false) {
-            $ret =& $this->doChannelDiscover();
-            if (Ethna::isError($ret)) {
-                return $ret;
-            }
-        }
-        $this->config->set('default_channel', $this->channel);
-
-        // write local .pearrc
-        $this->config->writeConfigFile();
-
-        return $true;
-    }
-    // }}}
-
-    // {{{ doClearCache
-    /**
-     *  do clear-cache
-     *
-     *  @return true|Ethna_Error
-     */
-    function &doClearCache()
-    {
-        $true = true;
-        $r =& $this->_run('clear-cache', array(), array());
-        if (PEAR::isError($r)) {
-            return $r;
-        }
-        return $true;
-    }
-    // }}}
-
-    // {{{ doChannelDiscover
-    /**
-     *  do channel-discover
-     *
-     *  @return true|Ethna_Error
-     */
-    function &doChannelDiscover()
-    {
-        $true = true;
-        $r =& $this->_run('channel-discover', array(), array($this->channel));
-        if (PEAR::isError($r)) {
-            return $r;
-        }
-        return $true;
-    }
-    // }}}
-
-    // {{{ isChannelExists
-    /**
-     *  whether channel discovered or not
-     *
-     *  @return bool
-     */
-    function isChannelExists()
-    {
-        return $this->registry->channelExists($this->channel);
-    }
-    // }}}
-
-    // {{{ doChannelUpdate
-    /**
-     *  do channel-update
-     *
-     *  @return true|Ethna_Error
-     */
-    function &doChannelUpdate()
-    {
-        $true = true;
-        if ($this->isChannelExists() == false) {
-            $r =& $this->doChannelDiscover();
-            if (PEAR::isError($r)) {
-                return $r;
-            }
-        }
-        $r =& $this->_run('channel-update', array(), array($this->channel));
-        if (PEAR::isError($r)) {
-            return $r;
-        }
-        return $true;
-    }
-    // }}}
-
-    // {{{ _doInstallOrUpgrade
-    /**
-     *  do install
-     *
-     *  @param  string  $command    'install' or 'upgrade'
-     *  @param  string  $package    package string
-     *  @return true|Ethna_Error
-     *  @access private 
-     */
-    function &_doInstallOrUpgrade($command, $package)
-    {
-        $true = true;
-        $r =& $this->_run($command, array(), array($package));
-        if (PEAR::isError($r)) {
-            return $r;
-        }
-        return $true;
-    }
-    // }}}
-        
-    // {{{ doInstall
-    /**
-     *  do install
-     *
-     *  @param  string  $pkg_name   package name.
-     *  @param  string  $state      package state.
-     *  @return true|Ethna_Error
-     */
-    function &doInstall($pkg_name, $state = null)
-    {
-        $pkg = "{$this->channel}/{$pkg_name}";
-        if ($state !== null) {
-            $pkg = "{$pkg}-{$state}";
-        }
-        $r =& $this->_doInstallOrUpgrade('install', $pkg); 
-        return $r;
-    }
-    // }}}
-
-    // {{{ doInstallFromTgz
-    /**
-     *  do install from local tgz file
-     *
-     *  @param  string  $pkg_file   package filename
-     *  @return true|Ethna_Error
-     */
-    function &doInstallFromTgz($pkg_file)
-    {
-        $r =& $this->_doInstallOrUpgrade('install', $pkg_file); 
-        return $r;
-    }
-    // }}}
-
-    // {{{ doUpgrade
-    /**
-     *  do upgrade
-     *
-     *  @param  string  $pkg_name   package name.
-     *  @param  string  $state      package state.
-     *  @return true|Ethna_Error
-     */
-    function &doUpgrade($pkg_name, $state = null)
-    {
-        $pkg = "{$this->channel}/{$pkg_name}";
-        if ($state !== null) {
-            $pkg = "{$pkg}-{$state}";
-        }
-        $r =& $this->_doInstallOrUpgrade('upgrade', $pkg);
-        return $r;
-    }
-    // }}}
-
-    // {{{ doUpgradeFromTgz
-    /**
-     *  do upgrade from local tgz file
-     *
-     *  @param  string  $pkg_file   package filename
-     *  @return true|Ethna_Error
-     */
-    function &doUpgradeFromTgz($pkg_file)
-    {
-        $r =& $this->_doInstallOrUpgrade('upgrade', $pkg_file); 
-        return $r;
-    }
-    // }}}
-
-    // {{{ isInstalled
-    /**
-     *  check package installed
-     *
-     *  @param  string  $package package name
-     *  @return bool
-     */
-    function isInstalled($package)
-    {
-        return $this->registry->packageExists($package, $this->channel);
-    }
-    // }}}
-
-    // {{{ getVersion
-    /**
-     *  get package version
-     *
-     *  @param  string  $package package name
-     *  @return string  version string
-     */
-    function getVersion($package)
-    {
-        $pobj =& $this->registry->getPackage($package, $this->channel);
-        return $pobj->getVersion();
-    }
-    // }}}
-
-    // {{{ getState
-    /**
-     *  get package version
-     *
-     *  @param  string  $package package name
-     *  @return string  version string
-     */
-    function getState($package)
-    {
-        $pobj =& $this->registry->getPackage($package, $this->channel);
-        return $pobj->getState();
-    }
-    // }}}
-
-    // {{{ doUninstall
-    /**
-     *  do uninstall (packages installed with ethna command)
-     *
-     *  @return true|Ethna_Error
-     */
-    function &doUninstall($package)
-    {
-        $true = true;
-        if ($this->isInstalled($package) == false) {
-            return Ethna::raiseNotice("{$this->channel}/{$package} is not installed.");
-        }
-        $r =& $this->_run('uninstall', array(), array("{$this->channel}/{$package}"));
-        if (PEAR::isError($r)) {
-            return $r;
-        }
-        if ($this->isInstalled($package)) {
-            return Ethna::raiseNotice("uninstall failed: {$this->channel}/{$package}");
-        }
-        return $true;
-    }
-    // }}}
-
-    // {{{ getPackageNameFromTgz
-    /**
-     *  get package info from tar/tgz file.
-     *
-     *  @param  string  $filename   package file name.
-     *  @return string  package name
-     *  @access public
-     *  @static
-     */
-    function &getPackageNameFromTgz($filename)
-    {
-        $config =& PEAR_Config::singleton();
-        $packagefile =& new PEAR_PackageFile($config);
-        $info =& $packagefile->fromTgzFile($filename, PEAR_VALIDATE_NORMAL);
-        if (Ethna::isError($info)) {
-            return $info;
-        }
-        $info_array = $info->toArray();
-        return $info_array['name'];
-    }
-    // }}}
-
-    // {{{ getCanonicalPackageName
-    /**
-     *  get canonical package name (case sensitive)
-     *
-     *  @param  string  $package    package name.
-     *  @return string  canonical name
-     *  @access public
-     */
-    function &getCanonicalPackageName($package)
-    {
-        if ($this->isInstalled($package) == false) {
-            return Ethna::raiseNotice("{$this->channel}/{$package} is not installed.");
-        }
-        $pobj =& $this->registry->getPackage($package, $this->channel);
-        $cname = $pobj->getName();
-        return $cname;
-    }
-    // }}}
-
-    // {{{ getInstalledPackageList
-    /**
-     *  get installed package list
-     *
-     *  @return array   installed package list
-     *  @access public
-     */
-    function &getInstalledPackageList()
-    {
-        $ret = array();
-        foreach ($this->registry->listPackages($this->channel) as $pkg) {
-            $ret[] = $this->getCanonicalPackageName($pkg);
-        }
-        return $ret;
-    }
-    // }}}
-
-    // {{{ doInfo
-    /**
-     *  do info (packages installed with ethna command)
-     *
-     *  @param  string  $package    package name.
-     *  @return true|Ethna_Error
-     */
-    function &doInfo($package)
-    {
-        return $this->_run('info', array(), array("{$this->channel}/{$package}"));
-    }
-    // }}}
-
-    // {{{ doRemoteInfo
-    /**
-     *  do info (packages installable with ethna command)
-     *
-     *  @param  string  $package    package name.
-     *  @return true|Ethna_Error
-     */
-    function &doRemoteInfo($package)
-    {
-        return $this->_run('remote-info', array(), array("{$this->channel}/{$package}"));
-    }
-    // }}}
-
-    // {{{ doUpgradeAll
-    /**
-     *  do upgrade-all
-     *
-     *  @return true|Ethna_Error
-     */
-    function &doUpgradeAll()
-    {
-        return $this->_run('upgrade-all', array('channel' => "{$this->channel}"), array());
-    }
-    // }}}
-
-    // {{{ doList
-    /**
-     *  do list (packages installed with ethna command)
-     *
-     *  @return true|Ethna_Error
-     */
-    function &doList()
-    {
-        return $this->_run('list', array('channel' => $this->channel), array());
-    }
-    // }}}
-
-    // {{{ doRemoteList
-    /**
-     *  do remote-list (packages installable with ethna command)
-     *
-     *  @return true|Ethna_Error
-     */
-    function &doRemoteList()
-    {
-        return $this->_run('remote-list', array('channel' => $this->channel), array());
-    }
-    // }}}
-
-    // {{{ subroutines.
-    /**
-     *  run PEAR_Command.
-     *
-     *  @param  string  $command    command name
-     *  @param  array   $options    options
-     *  @param  array   $params     parameters
-     *  @return true|Ethna_Error
-     *  @access private 
-     *  @see PEAR_Command_Common::run, etc.
-     */
-    function &_run($command, $options, $params)
-    {
-        if ($this->config === null) {
-            return Ethna::raiseError('configuration not initialized.');
-        }
-
-        $true = true;
-
-        $cmd =& PEAR_Command::factory($command, $this->config);
-        if (PEAR::isError($cmd)) {
-            return $cmd;
-        }
-
-        // pear command options
-        if (is_array($this->_pearopt) && count($this->_pearopt) > 0) {
-            $pearopts = $this->_getPearOpt($cmd, $command, $this->_pearopt);
-            $options = array_merge($pearopts, $options);
-        }
-
-        $ret = $cmd->run($command, $options, $params);
-        if (PEAR::isError($ret)) {
-            return $ret;
-        }
-
-        return $true;
-    }
-
-    /**
-     *  provide yes-or-no dialog.
-     *
-     *  @return bool
-     *  @access public
-     */
-    function confirmDialog($message, $default = 'yes')
-    {
-        $ret = $this->ui->userConfirm($message);
-        return $ret;
-    }
-
-    /**
-     *  provide table layout
-     *
-     *  @param  array   $headline   headline
-     *  @param  array   $rows       rows which have the same size as headline's.
-     *  @access public
-     */
-    function displayTable($caption, $headline, $rows)
-    {
-        // spacing
-        foreach (array_keys($headline) as $k) {
-            $headline[$k] = sprintf('% -8s', $headline[$k]);
-        }
-
-        $data = array('caption'  => $caption,
-                      'border'   => true,
-                      'headline' => $headline,
-                      'data'     => $rows);
-        $this->ui->outputData($data);
-    }
-
-    /**
-     *  (experimental)
-     *  @access public
-     */
-    function setPearOpt($pearopt)
-    {
-        $this->_pearopt = $pearopt;
-    }
-
-    /**
-     *  (experimental)
-     *  @return array
-     */
-    function _getPearOpt(&$cmd_obj, $cmd_str, $opt_array)
-    {
-        $short_args = $long_args = null;
-        PEAR_Command::getGetOptArgs($cmd_str, $short_args, $long_args);
-        $opt_arg = Console_GetOpt::getOpt2($opt_array, $short_args, $long_args);
-        if (PEAR::isError($opt_arg)) return array();
-        $opts = array();
-        foreach ($opt_arg[0] as $tmp) {
-            list($opt, $val) = $tmp;
-            if ($val === null) $val = true;
-            if (strlen($opt) == 1) {
-                $cmd_opts = $cmd_obj->getOptions($cmd_str);
-                foreach ($cmd_opts as $o => $d) {
-                    if (isset($d['shortopt']) && $d['shortopt'] == $opt) {
-                        $opts[$o] = $val;
-                    }
-                }
-            } else {
-                if (substr($opt, 0, 2) == '--') $opts[substr($opt, 2)] = $val;
-            }
-        }
-        return $opts;
-    }
-                
-
-    // }}}
-}
-// }}}
-
-?>
diff --git a/class/Ethna_Plugin.php b/class/Ethna_Plugin.php
deleted file mode 100644 (file)
index 385d59f..0000000
+++ /dev/null
@@ -1,462 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin.php
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @author     Kazuhiro Hosoi <hosoi@gree.co.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin
-/**
- *  ¥×¥é¥°¥¤¥ó¥¯¥é¥¹
- *  
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @author     Kazuhiro Hosoi <hosoi@gree.co.jp>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    object  Ethna_Controller    ¥³¥ó¥È¥í¡¼¥é¥ª¥Ö¥¸¥§¥¯¥È */
-    var $controller;
-
-    /** @var    object  Ethna_Controller    ¥³¥ó¥È¥í¡¼¥é¥ª¥Ö¥¸¥§¥¯¥È($controller¤Î¾Êά·Á) */
-    var $ctl;
-
-    /** @var    object  Ethna_Logger        ¥í¥°¥ª¥Ö¥¸¥§¥¯¥È */
-    var $logger;
-
-    /** @var    array   ¥×¥é¥°¥¤¥ó¤Î¥ª¥Ö¥¸¥§¥¯¥È(¥¤¥ó¥¹¥¿¥ó¥¹)¤òÊݸ¤¹¤ëÇÛÎó */
-    var $obj_registry = array();
-
-    /** @var    array   ¥×¥é¥°¥¤¥ó¤Î¥¯¥é¥¹Ì¾¡¢¥½¡¼¥¹¥Õ¥¡¥¤¥ë̾¤òÊݸ¤¹¤ëÇÛÎó */
-    var $src_registry = array();
-
-    /** @var    array       ¸¡º÷ÂоݤȤʤë¥×¥é¥°¥¤¥ó¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥óID¤Î¥ê¥¹¥È */
-    var $appid_list;
-
-    /**#@-*/
-
-    // {{{ ¥³¥ó¥¹¥È¥é¥¯¥¿
-    /**
-     *  Ethna_Plugin¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Controller    $controller ¥³¥ó¥È¥í¡¼¥é¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function Ethna_Plugin(&$controller)
-    {
-        $this->controller =& $controller;
-        $this->ctl =& $this->controller;
-        $this->logger = null;
-        if (isset($this->controller->plugin_search_appids)
-            && is_array($this->controller->plugin_search_appids)) {
-            $this->appid_list =& $this->controller->plugin_search_appids;
-        } else {
-            $this->appid_list = array($this->controller->getAppId(), 'Ethna');
-        }
-    }
-
-    /**
-     *  logger¤òset¤¹¤ë¡£
-     *
-     *  LogWriter¤Ïplugin¤Ê¤Î¤Ç¡¢plugin¥¤¥ó¥¹¥¿¥ó¥¹ºîÀ®»þÅÀ¤Ç¤Ï
-     *  logger¤Ë°Í¸¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¡£
-     *
-     *  @access public
-     *  @param  object  Ethna_Logger    $logger ¥í¥°¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function setLogger(&$logger)
-    {
-        if ($this->logger === null && is_object($logger)) {
-            $this->logger =& $logger;
-        }
-    }
-    // }}}
-
-    // {{{ ¥×¥é¥°¥¤¥ó¸Æ¤Ó½Ð¤·¥¤¥ó¥¿¥Õ¥§¡¼¥¹
-    /**
-     *  ¥×¥é¥°¥¤¥ó¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤ò¼èÆÀ
-     *
-     *  @access public
-     *  @param  string  $type   ¥×¥é¥°¥¤¥ó¤Î¼ïÎà
-     *  @param  string  $name   ¥×¥é¥°¥¤¥ó¤Î̾Á°
-     *  @return object  ¥×¥é¥°¥¤¥ó¤Î¥¤¥ó¥¹¥¿¥ó¥¹
-     */
-    function &getPlugin($type, $name)
-    {
-        return $this->_getPlugin($type, $name);
-    }
-
-    /**
-     *  ¤¢¤ë¼ïÎà ($type) ¤Î¥×¥é¥°¥¤¥ó ($name) ¤ÎÁ´¥ê¥¹¥È¤ò¼èÆÀ
-     *
-     *  @access public
-     *  @param  string  $type   ¥×¥é¥°¥¤¥ó¤Î¼ïÎà
-     *  @return array   ¥×¥é¥°¥¤¥ó¥ª¥Ö¥¸¥§¥¯¥È¤ÎÇÛÎó
-     */
-    function getPluginList($type)
-    {
-        $plugin_list = array();
-
-        $this->searchAllPluginSrc($type);
-        if (isset($this->src_registry[$type]) == false) {
-            return $plugin_list;
-        }
-        foreach ($this->src_registry[$type] as $name => $value) {
-            if (is_null($value)) {
-                continue;
-            }
-            $plugin_list[$name] =& $this->getPlugin($type, $name);
-        }
-        return $plugin_list;
-    }
-    // }}}
-
-    // {{{ obj_registry ¤Î¥¢¥¯¥»¥µ
-    /**
-     *  ¥×¥é¥°¥¤¥ó¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤ò¥ì¥¸¥¹¥È¥ê¤«¤é¼èÆÀ
-     *
-     *  @access private
-     *  @param  string  $type   ¥×¥é¥°¥¤¥ó¤Î¼ïÎà
-     *  @param  string  $name   ¥×¥é¥°¥¤¥ó¤Î̾Á°
-     *  @return object  ¥×¥é¥°¥¤¥ó¤Î¥¤¥ó¥¹¥¿¥ó¥¹
-     */
-    function &_getPlugin($type, $name)
-    {
-        if (isset($this->obj_registry[$type]) == false) {
-            $this->obj_registry[$type] = array();
-
-            // ¥×¥é¥°¥¤¥ó¤Î¿Æ¥¯¥é¥¹¤ò(¸ºß¤¹¤ì¤Ð)Æɤ߹þ¤ß
-            foreach ($this->appid_list as $appid) {
-                list($class, $dir, $file) = $this->getPluginNaming($type, null, $appid);
-                $this->_includePluginSrc($class, $dir, $file, true);
-            }
-        }
-
-        // key ¤¬¤Ê¤¤¤È¤­¤Ï¥×¥é¥°¥¤¥ó¤ò¥í¡¼¥É¤¹¤ë
-        if (array_key_exists($name, $this->obj_registry[$type]) == false) {
-            $this->_loadPlugin($type, $name);
-        }
-
-        // null ¤Î¤È¤­¤Ï¥í¡¼¥É¤Ë¼ºÇÔ¤·¤Æ¤¤¤ë
-        if (is_null($this->obj_registry[$type][$name])) {
-            return Ethna::raiseWarning('plugin [type=%s, name=%s] is not found',
-                E_PLUGIN_NOTFOUND, $type, $name);
-        }
-
-        // ¥×¥é¥°¥¤¥ó¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤òÊÖ¤¹
-        return $this->obj_registry[$type][$name];
-    }
-
-    /**
-     *  ¥×¥é¥°¥¤¥ó¤òinclude¤·¤Ænew¤·¡¤¥ì¥¸¥¹¥È¥ê¤ËÅÐÏ¿
-     *
-     *  @access private
-     *  @param  string  $type   ¥×¥é¥°¥¤¥ó¤Î¼ïÎà
-     *  @param  string  $name   ¥×¥é¥°¥¤¥ó¤Î̾Á°
-     */
-    function _loadPlugin($type, $name)
-    {
-        // ¥×¥é¥°¥¤¥ó¤Î¥Õ¥¡¥¤¥ë̾¤ò¼èÆÀ
-        $plugin_src = $this->_getPluginSrc($type, $name);
-        if (is_null($plugin_src)) {
-            $this->obj_registry[$type][$name] = null;
-            return;
-        }
-        list($plugin_class, $plugin_dir, $plugin_file) = $plugin_src;
-
-        // ¥×¥é¥°¥¤¥ó¤Î¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤ß
-        $r =& $this->_includePluginSrc($plugin_class, $plugin_dir, $plugin_file);
-        if (Ethna::isError($r)) {
-            $this->obj_registry[$type][$name] = null;
-            return;
-        }
-
-        // ¥×¥é¥°¥¤¥óºîÀ®
-        $instance =& new $plugin_class($this->controller, $type, $name);
-        if (is_object($instance) == false
-            || strcasecmp(get_class($instance), $plugin_class) != 0) {
-            $this->logger->log(LOG_WARNING, 'plugin [%s::%s] instantiation failed', $type, $name);
-            $this->obj_registry[$type][$name] = null;
-            return;
-        }
-        $this->obj_registry[$type][$name] =& $instance;
-    }
-
-    /**
-     *  ¥×¥é¥°¥¤¥ó¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤ò¥ì¥¸¥¹¥È¥ê¤«¤é¾Ã¤¹
-     *
-     *  @access private
-     *  @param  string  $type   ¥×¥é¥°¥¤¥ó¤Î¼ïÎà
-     *  @param  string  $name   ¥×¥é¥°¥¤¥ó¤Î̾Á°
-     */
-    function _unloadPlugin($type, $name)
-    {
-        unset($this->obj_registry[$type][$name]);
-    }
-    // }}}
-
-    // {{{ src_registry ¤Î¥¢¥¯¥»¥µ
-    /**
-     *  ¥×¥é¥°¥¤¥ó¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë̾¤È¥¯¥é¥¹Ì¾¤ò¥ì¥¸¥¹¥È¥ê¤«¤é¼èÆÀ
-     *
-     *  @access private
-     *  @param  string  $type   ¥×¥é¥°¥¤¥ó¤Î¼ïÎà
-     *  @param  string  $name   ¥×¥é¥°¥¤¥ó¤Î̾Á°
-     *  @return array   ¥½¡¼¥¹¥Õ¥¡¥¤¥ë̾¤È¥¯¥é¥¹Ì¾¤«¤é¤Ê¤ëÇÛÎó
-     */
-    function _getPluginSrc($type, $name)
-    {
-        if (isset($this->src_registry[$type]) == false) {
-            $this->src_registry[$type] = array();
-        }
-
-        // key ¤¬¤Ê¤¤¤È¤­¤Ï¥×¥é¥°¥¤¥ó¤Î¸¡º÷¤ò¤¹¤ë
-        if (array_key_exists($name, $this->src_registry[$type]) == false) {
-            $this->_searchPluginSrc($type, $name);
-        }
-
-        // ¥×¥é¥°¥¤¥ó¤Î¥½¡¼¥¹¤òÊÖ¤¹
-        return $this->src_registry[$type][$name];
-    }
-    // }}}
-
-    // {{{ ¥×¥é¥°¥¤¥ó¥Õ¥¡¥¤¥ë¸¡º÷Éôʬ
-    /**
-     *  ¥×¥é¥°¥¤¥ó¤Î¥¯¥é¥¹Ì¾¡¢¥Ç¥£¥ì¥¯¥È¥ê¡¢¥Õ¥¡¥¤¥ë̾¤ò·èÄê
-     *
-     *  @access public
-     *  @param  string  $type   ¥×¥é¥°¥¤¥ó¤Î¼ïÎà
-     *  @param  string  $name   ¥×¥é¥°¥¤¥ó¤Î̾Á° (null¤Î¤È¤­¤Ï¿Æ¥¯¥é¥¹)
-     *  @param  string  $appid  ¥¢¥×¥ê¥±¡¼¥·¥ç¥óID
-     *  @return array   ¥×¥é¥°¥¤¥ó¤Î¥¯¥é¥¹Ì¾¡¢¥Ç¥£¥ì¥¯¥È¥ê¡¢¥Õ¥¡¥¤¥ë̾¤ÎÇÛÎó
-     *  @todo   class factory¤Înaming rule¤ÈÀ°¹ç¤µ¤»¤ë
-     */
-    function getPluginNaming($type, $name, $appid)
-    {
-        if ($appid == 'Ethna') {
-            if ($name === null) {
-                $ext = 'php';
-                $dir = ETHNA_BASE . "/class/Plugin";
-                $class = "Ethna_Plugin_{$type}";
-            } else {
-                $ext = 'php';
-                $dir = ETHNA_BASE . "/class/Plugin/{$type}";
-                $class = "Ethna_Plugin_{$type}_{$name}";
-            }
-        } else {
-            if ($name === null) {
-                $ext = $this->controller->getExt('php');
-                $dir = $this->controller->getDirectory('plugin');
-                $class = "{$appid}_Plugin_{$type}";
-            } else {
-                $ext = $this->controller->getExt('php');
-                $dir = $this->controller->getDirectory('plugin') . "/{$type}";
-                $class = "{$appid}_Plugin_{$type}_{$name}";
-            }
-        }
-
-        $file  = "{$class}.{$ext}";
-        return array($class, $dir, $file);
-    }
-
-    /**
-     *  ¥×¥é¥°¥¤¥ó¤Î¥½¡¼¥¹¤ò include ¤¹¤ë
-     *
-     *  @access private
-     *  @param  string  $class  ¥¯¥é¥¹Ì¾
-     *  @param  string  $dir    ¥Ç¥£¥ì¥¯¥È¥ê̾
-     *  @param  string  $file   ¥Õ¥¡¥¤¥ë̾
-     *  @param  bool    $parent ¿Æ¥¯¥é¥¹¤«¤É¤¦¤«¤Î¥Õ¥é¥°
-     *  @return true|Ethna_Error
-     */
-    function &_includePluginSrc($class, $dir, $file, $parent = false)
-    {
-        $true = true;
-        if (class_exists($class)) {
-            return $true;
-        }
-
-        $file = $dir . '/' . $file;
-        if (file_exists($file) === false) {
-            if ($parent === false) {
-                return Ethna::raiseWarning('plugin file is not found: [%s]',
-                                           E_PLUGIN_NOTFOUND, $file);
-            } else {
-                return $true;
-            }
-        }
-
-        include_once $file;
-
-        if (class_exists($class) === false) {
-            if ($parent === false) {
-                return Ethna::raiseWarning('plugin class [%s] is not defined',
-                    E_PLUGIN_NOTFOUND, $class);
-            } else {
-                return $true;
-            }
-        }
-
-        if ($parent === false) {
-            $this->logger->log(LOG_DEBUG, 'plugin class [%s] is defined', $class);
-        }
-        return $true;
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó, Ethna ¤Î½ç¤Ç¥×¥é¥°¥¤¥ó¤Î¥½¡¼¥¹¤ò¸¡º÷¤¹¤ë
-     *
-     *  @access private
-     *  @param  string  $type   ¥×¥é¥°¥¤¥ó¤Î¼ïÎà
-     *  @param  string  $name   ¥×¥é¥°¥¤¥ó¤Î̾Á°
-     */
-    function _searchPluginSrc($type, $name)
-    {
-        // ¥³¥ó¥È¥í¡¼¥é¤Ç»ØÄꤵ¤ì¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥óID¤Î½ç¤Ë¸¡º÷
-        foreach ($this->appid_list as $appid) {
-            list($class, $dir, $file) = $this->getPluginNaming($type, $name, $appid);
-            if (class_exists($class)) {
-                // ¤¹¤Ç¤Ë¥¯¥é¥¹¤¬Â¸ºß¤¹¤ë¾ì¹ç¤ÏÆÃÊ̤˥¹¥­¥Ã¥×
-                if (isset($this->src_registry[$type]) == false) {
-                    $this->src_registry[$type] = array();
-                }
-                $this->src_registry[$type][$name] = array($class, null, null);
-                return;
-            }
-            if (file_exists("{$dir}/{$file}")) {
-                $this->logger->log(LOG_DEBUG, 'plugin file is found in search: [%s]',
-                                   "{$dir}/{$file}");
-                if (isset($this->src_registry[$type]) == false) {
-                    $this->src_registry[$type] = array();
-                }
-                $this->src_registry[$type][$name] = array($class, $dir, $file);
-                return;
-            }
-        }
-
-        // ¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç (null¤Çµ­²±¤·¤Æ¤ª¤¯)
-        $this->logger->log(LOG_WARNING, 'plugin file for [type=%s, name=%s] is not found in search', $type, $name);
-        $this->src_registry[$type][$name] = null;
-    }
-
-    /**
-     *  ¥×¥é¥°¥¤¥ó¤Î¼ïÎà ($type) ¤ò¤¹¤Ù¤Æ¸¡º÷¤¹¤ë
-     *
-     *  @access public
-     *  @return array
-     */
-    function searchAllPluginType()
-    {
-        $type_list = array();
-        foreach (array_reverse($this->appid_list) as $appid) {
-            list(, $dir, ) = $this->getPluginNaming('', null, $appid);
-            if (is_dir($dir) == false) {
-                continue;
-            }
-            $dh = opendir($dir);
-            if (is_resource($dh) == false) {
-                continue;
-            }
-            while (($type_dir = readdir($dh)) !== false) {
-                if ($type_dir{0} != '.' && is_dir("{$dir}/{$type_dir}")) {
-                    $type_list[$type_dir] = 0;
-                }
-            }
-            closedir($dh);
-        }
-        return array_keys($type_list);
-    }
-
-    /**
-     *  »ØÄꤵ¤ì¤¿ $type ¤Î¥×¥é¥°¥¤¥ó (¤Î¥½¡¼¥¹) ¤ò¤¹¤Ù¤Æ¸¡º÷¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $type   ¥×¥é¥°¥¤¥ó¤Î¼ïÎà
-     */
-    function searchAllPluginSrc($type)
-    {
-        // ¸å¤Ç¸«ÉÕ¤«¤Ã¤¿¤â¤Î¤Ç¾å½ñ¤­¤¹¤ë¤Î¤Ç $this->appid_list ¤ÎµÕ½ç¤È¤¹¤ë
-        $name_list = array();
-        foreach (array_reverse($this->appid_list) as $appid) {
-            list($class_regexp, $dir, $file_regexp) = $this->getPluginNaming($type, '([^_]+)', $appid);
-
-            //¥Ç¥£¥ì¥¯¥È¥ê¤Î¸ºß¤Î¥Á¥§¥Ã¥¯
-            if (is_dir($dir) == false) {
-                // ¥¢¥×¥ê¦¤Ç¸«ÉÕ¤«¤é¤Ê¤¤¤Î¤ÏÀµ¾ï
-                continue;
-            }
-
-            // ¥Ç¥£¥ì¥¯¥È¥ê¤ò³«¤¯
-            $dh = opendir($dir);
-            if (is_resource($dh) == false) {
-                $this->logger->log(LOG_DEBUG, 'cannot open plugin directory: [%s]', $dir);
-                continue;
-            }
-            $this->logger->log(LOG_DEBUG, 'plugin directory opened: [%s]', $dir);
-
-            // ¾ò·ï¤Ë¤¢¤¦ $name ¤ò¥ê¥¹¥È¤ËÄɲÃ
-            while (($file = readdir($dh)) !== false) {
-                if (preg_match('#^'.$file_regexp.'$#', $file, $matches)
-                    && file_exists("{$dir}/{$file}")) {
-                    $name_list[$matches[1]] = true;
-                }
-            }
-
-            closedir($dh);
-        }
-
-        foreach (array_keys($name_list) as $name) {
-            // ¾éŤÀ¤¬¤â¤¦°ìÅÙõ¤·¤Ê¤ª¤¹
-            $this->_searchPluginSrc($type, $name);
-        }
-    }
-    // }}}
-
-    // {{{ static ¤Ê include ¥á¥½¥Ã¥É
-    /**
-     *  Ethna ËÜÂÎÉÕ°¤Î¥×¥é¥°¥¤¥ó¤Î¥½¡¼¥¹¤ò include ¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $type   ¥×¥é¥°¥¤¥ó¤Î¼ïÎà
-     *  @param  string  $name   ¥×¥é¥°¥¤¥ó¤Î̾Á°
-     *  @static
-     */
-    function includeEthnaPlugin($type, $name)
-    {
-        Ethna_Plugin::includePlugin($type, $name, 'Ethna');
-    }
-
-    /**
-     *  ¥×¥é¥°¥¤¥ó¤Î¥½¡¼¥¹¤ò include ¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $type   ¥×¥é¥°¥¤¥ó¤Î¼ïÎà
-     *  @param  string  $name   ¥×¥é¥°¥¤¥ó¤Î̾Á°
-     *  @param  string  $appid  ¥¢¥×¥ê¥±¡¼¥·¥ç¥óID
-     *  @static
-     */
-    function includePlugin($type, $name, $appid = null)
-    {
-        $ctl =& Ethna_Controller::getInstance();
-        $plugin =& $ctl->getPlugin();
-
-        if ($appid === null) {
-            $appid = $ctl->getAppId();
-        }
-        list($class, $dir, $file) = $plugin->getPluginNaming($type, $name, $appid);
-        $plugin->_includePluginSrc($class, $dir, $file);
-    }
-    // }}}
-}
-// }}}
-?>
diff --git a/class/Ethna_Renderer.php b/class/Ethna_Renderer.php
deleted file mode 100644 (file)
index 3b5115f..0000000
+++ /dev/null
@@ -1,300 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Renderer.php
- *
- *  @author     Kazuhiro Hosoi <hosoi@gree.co.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Renderer
-/**
- *  ¥ì¥ó¥À¥é¥¯¥é¥¹¡ÊMojavi¤Î¤Þ¤Í¡Ë
- *
- *  @author     Kazuhiro Hosoi <hosoi@gree.co.jp>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Renderer
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    object  Ethna_Controller    controller¥ª¥Ö¥¸¥§¥¯¥È */
-    var $controller;
-
-    /** @var    object  Ethna_Controller    controller¥ª¥Ö¥¸¥§¥¯¥È($controller¤Î¾Êά·Á) */
-    var $ctl;
-
-    /** @var    string  template directory  */
-    var $template_dir;
-
-    /** @var    string  template engine */
-    var $engine;
-
-    /** @var    string  template file */
-    var $template;
-
-    /** @var    string  ¥Æ¥ó¥×¥ì¡¼¥ÈÊÑ¿ô */
-    var $prop;
-    
-    /** @var    string  ¥ì¥ó¥À¥é¥×¥é¥°¥¤¥ó(Ethna_Plugin¤È¤Ï´Ø·¸¤Ê¤·) */
-    var $plugin_registry;
-    
-    /**
-     *  Ethna_Renderer¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     */
-    function Ethna_Renderer(&$controller)
-    {
-        $this->controller =& $controller;
-        $this->ctl =& $this->controller;
-        $this->template_dir = null;
-        $this->engine = null;
-        $this->template = null;
-        $this->prop = array();
-        $this->plugin_registry = array();
-    }
-
-    /**
-     *  ¥Ó¥å¡¼¤ò½ÐÎϤ¹¤ë
-     *
-     *  @param string   $template   ¥Æ¥ó¥×¥ì¡¼¥È
-     *  @param  bool    $capture    true ¤Ê¤é¤Ð½ÐÎϤòɽ¼¨¤»¤º¤ËÊÖ¤¹
-     *
-     *  @access public
-     */
-    function perform($template = null, $capture = false)
-    {
-        if ($template == null && $this->template == null) {
-            return Ethna::raiseWarning('template is not defined');
-        }
-
-        if ($template != null) {
-            $this->template = $template;
-        }
-
-        // ¥Æ¥ó¥×¥ì¡¼¥È¤Î̵ͭ¤Î¥Á¥§¥Ã¥¯
-        if (is_readable($this->template_dir . $this->template) === false) {
-            return Ethna::raiseWarning("template is not found: " . $this->template);
-        }
-
-        if ($capture === true) {
-            ob_start();
-            include_once $this->template_dir . $this->template;
-            $captured = ob_get_contents();
-            ob_end_clean();
-            return $captured;
-        } else {
-            include_once $this->template_dir . $this->template;
-            return true;
-        }
-    }
-
-    /**
-     *  ¥Æ¥ó¥×¥ì¡¼¥È¥¨¥ó¥¸¥ó¤ò¼èÆÀ¤¹¤ë
-     * 
-     *  @return object   Template Engine.
-     * 
-     *  @access public
-     */
-    function &getEngine()
-    {
-        return $this->engine;
-    }
-
-    /**
-     *  ¥Æ¥ó¥×¥ì¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤ò¼èÆÀ¤¹¤ë
-     * 
-     *  @return string   Template Directory
-     * 
-     *  @access public
-     */
-    function getTemplateDir()
-    {
-        return $this->template_dir;
-    }
-
-    /**
-     *  ¥Æ¥ó¥×¥ì¡¼¥ÈÊÑ¿ô¤ò¼èÆÀ¤¹¤ë
-     * 
-     *  @param string $name  ÊÑ¿ô̾
-     * 
-     *  @return mixed    ÊÑ¿ô
-     * 
-     *  @access public
-     */
-    function &getProp($name)
-    {
-        if (isset($this->prop[$name])) {
-            return $this->prop[$name];
-        }
-
-        return null;
-    }
-
-    /**
-     *  ¥Æ¥ó¥×¥ì¡¼¥ÈÊÑ¿ô¤òºï½ü¤¹¤ë
-     * 
-     *  @param name    ÊÑ¿ô̾
-     * 
-     *  @access public
-     */
-    function &removeProp($name)
-    {
-        if (isset($this->prop[$name])) {
-            unset($this->prop[$name]);
-        }
-    }
-
-    /**
-     *  ¥Æ¥ó¥×¥ì¡¼¥ÈÊÑ¿ô¤ËÇÛÎó¤ò³ä¤êÅö¤Æ¤ë
-     * 
-     *  @param array $array
-     * 
-     *  @access public
-     */
-    function setPropArray($array)
-    {
-        $this->prop = array_merge($this->prop, $array);
-    }
-
-    /**
-     *  ¥Æ¥ó¥×¥ì¡¼¥ÈÊÑ¿ô¤ËÇÛÎó¤ò»²¾È¤È¤·¤Æ³ä¤êÅö¤Æ¤ë
-     * 
-     *  @param array $array
-     * 
-     *  @access public
-     */
-    function setPropArrayByRef(&$array)
-    {
-        $keys  = array_keys($array);
-        $count = sizeof($keys);
-
-        for ($i = 0; $i < $count; $i++) {
-            $this->prop[$keys[$i]] =& $array[$keys[$i]];
-        }
-    }
-
-    /**
-     * ¥Æ¥ó¥×¥ì¡¼¥ÈÊÑ¿ô¤ò³ä¤êÅö¤Æ¤ë
-     * 
-     * @param string $name ÊÑ¿ô̾
-     * @param mixed $value ÃÍ
-     * 
-     * @access public
-     */
-    function setProp($name, $value)
-    {
-        $this->prop[$name] = $value;
-    }
-
-    /**
-     *  ¥Æ¥ó¥×¥ì¡¼¥ÈÊÑ¿ô¤Ë»²¾È¤ò³ä¤êÅö¤Æ¤ë
-     * 
-     *  @param string $name ÊÑ¿ô̾
-     *  @param mixed $value ÃÍ
-     * 
-     *  @access public
-     */
-    function setPropByRef($name, &$value)
-    {
-        $this->prop[$name] =& $value;
-    }
-
-    /**
-     *  ¥Æ¥ó¥×¥ì¡¼¥È¤ò³ä¤êÅö¤Æ¤ë
-     * 
-     *  @param string $template ¥Æ¥ó¥×¥ì¡¼¥È̾
-     * 
-     *  @access public
-     */
-    function setTemplate($template)
-    {
-        $this->template = $template;
-    }
-
-    /**
-     *  ¥Æ¥ó¥×¥ì¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤ò³ä¤êÅö¤Æ¤ë
-     * 
-     *  @param string $dir ¥Ç¥£¥ì¥¯¥È¥ê̾
-     * 
-     *  @access public
-     */
-    function setTemplateDir($dir)
-    {
-        $this->template_dir = $dir;
-
-        if (substr($this->template_dir, -1) != '/') {
-            $this->template_dir .= '/';
-        }
-    }
-    
-    /**
-     *  ¥Æ¥ó¥×¥ì¡¼¥È¤Î̵ͭ¤ò¥Á¥§¥Ã¥¯¤¹¤ë
-     * 
-     *  @param string $template ¥Æ¥ó¥×¥ì¡¼¥È̾
-     * 
-     *  @access public
-     */
-    function templateExists($template)
-    {
-        if (substr($this->template_dir, -1) != '/') {
-            $this->template_dir .= '/';
-        }
-
-        return (is_readable($this->template_dir . $template));
-    }
-
-    /**
-     *  ¥×¥é¥°¥¤¥ó¤ò¥»¥Ã¥È¤¹¤ë
-     * 
-     *  @param string $name¡¡¥×¥é¥°¥¤¥ó̾
-     *  @param string $type ¥×¥é¥°¥¤¥ó¥¿¥¤¥×
-     *  @param string $plugin ¥×¥é¥°¥¤¥óËÜÂÎ
-     * 
-     *  @access public
-     */
-    function setPlugin($name, $type, $plugin)
-    {
-        $this->plugin_registry[$type][$name] = $plugin;
-    }
-
-    // {{{ proxy methods (for B.C.)
-    /**
-     *  ¥Æ¥ó¥×¥ì¡¼¥ÈÊÑ¿ô¤ò³ä¤êÅö¤Æ¤ë(¸åÊý¸ß´¹)
-     *
-     *  @access public
-     */
-    function assign($name, $value)
-    {
-        $this->setProp($name, $value);
-    }
-
-    /**
-     *  ¥Æ¥ó¥×¥ì¡¼¥ÈÊÑ¿ô¤Ë»²¾È¤ò³ä¤êÅö¤Æ¤ë(¸åÊý¸ß´¹)
-     *
-     *  @access public
-     */
-    function assign_by_ref($name, &$value)
-    {
-        $this->setPropByRef($name, $value);
-    }
-
-    /**
-     *  ¥Ó¥å¡¼¤ò½ÐÎϤ¹¤ë
-     *
-     *  @access public
-     */
-    function display($template = null)
-    {
-        return $this->perform($template);
-    }
-    // }}}
-}
-// }}}
-?>
diff --git a/class/Ethna_Session.php b/class/Ethna_Session.php
deleted file mode 100644 (file)
index 1fd9090..0000000
+++ /dev/null
@@ -1,324 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Session.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Session
-/**
- *  ¥»¥Ã¥·¥ç¥ó¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Session
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    object  Ethna_Logger    logger¥ª¥Ö¥¸¥§¥¯¥È */
-    var $logger;
-
-    /** @var    string  ¥»¥Ã¥·¥ç¥ó̾ */
-    var $session_name;
-
-    /** @var    string  ¥»¥Ã¥·¥ç¥ó¥Ç¡¼¥¿Êݸ¥Ç¥£¥ì¥¯¥È¥ê */
-    var $session_save_dir;
-
-    /** @var    bool    ¥»¥Ã¥·¥ç¥ó³«»Ï¥Õ¥é¥° */
-    var $session_start = false;
-
-    /** @var    bool    Æ¿Ì¾¥»¥Ã¥·¥ç¥ó¥Õ¥é¥° */
-    var $anonymous = false;
-
-    /**#@-*/
-
-    /**
-     *  Ethna_Session¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  string  $appid      ¥¢¥×¥ê¥±¡¼¥·¥ç¥óID(¥»¥Ã¥·¥ç¥ó̾¤È¤·¤Æ»ÈÍÑ)
-     *  @param  string  $save_dir   ¥»¥Ã¥·¥ç¥ó¥Ç¡¼¥¿¤òÊݸ¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê
-     */
-    function Ethna_Session($appid, $save_dir, $logger)
-    {
-        $this->session_name = "${appid}SESSID";
-        $this->session_save_dir = $save_dir;
-        $this->logger =& $logger;
-
-        if ($this->session_save_dir != "") {
-            session_save_path($this->session_save_dir);
-        }
-
-        session_name($this->session_name);
-        session_cache_limiter('private, must-revalidate');
-
-        $this->session_start = false;
-        if (isset($_SERVER['REQUEST_METHOD']) == false) {
-            return;
-        }
-
-        if (strcasecmp($_SERVER['REQUEST_METHOD'], 'post') == 0) {
-            $http_vars =& $_POST;
-        } else {
-            $http_vars =& $_GET;
-        }
-        if (array_key_exists($this->session_name, $http_vars)
-            && $http_vars[$this->session_name] != null) {
-            $_COOKIE[$this->session_name] = $http_vars[$this->session_name];
-        }
-    }
-
-    /**
-     *  ¥»¥Ã¥·¥ç¥ó¤òÉüµ¢¤¹¤ë
-     *
-     *  @access public
-     */
-    function restore()
-    {
-        if (!empty($_COOKIE[$this->session_name]) ||
-        (ini_get("session.use_trans_sid") == 1 &&
-        !empty($_REQUEST[$this->session_name]))
-        ) {
-            session_start();
-            $this->session_start = true;
-
-            // check session
-            if ($this->isValid() == false) {
-                setcookie($this->session_name, "", 0, "/");
-                $this->session_start = false;
-            }
-
-            // check anonymous
-            if ($this->get('__anonymous__')) {
-                $this->anonymous = true;
-            }
-        }
-    }
-
-    /**
-     *  ¥»¥Ã¥·¥ç¥ó¤ÎÀµÅöÀ­¥Á¥§¥Ã¥¯
-     *
-     *  @access public
-     *  @return bool    true:ÀµÅö¤Ê¥»¥Ã¥·¥ç¥ó false:ÉÔÅö¤Ê¥»¥Ã¥·¥ç¥ó
-     */
-    function isValid()
-    {
-        if (!$this->session_start) {
-            if (!empty($_COOKIE[$this->session_name]) || session_id() != null) {
-                setcookie($this->session_name, "", 0, "/");
-            }
-            return false;
-        }
-
-        // check remote address
-        if (!isset($_SESSION['REMOTE_ADDR'])
-            || $this->_validateRemoteAddr($_SESSION['REMOTE_ADDR'],
-                                          $_SERVER['REMOTE_ADDR']) == false) {
-            // we do not allow this
-            setcookie($this->session_name, "", 0, "/");
-            session_destroy();
-            $this->session_start = false;
-            return false;
-        }
-
-        return true;
-    }
-
-    /**
-     *  ¥»¥Ã¥·¥ç¥ó¤ò³«»Ï¤¹¤ë
-     *
-     *  @access public
-     *  @param  int     $lifetime   ¥»¥Ã¥·¥ç¥óÍ­¸ú´ü´Ö(ÉÃñ°Ì, 0¤Ê¤é¥»¥Ã¥·¥ç¥ó¥¯¥Ã¥­¡¼)
-     *  @return bool    true:Àµ¾ï½ªÎ» false:¥¨¥é¡¼
-     */
-    function start($lifetime = 0, $anonymous = false)
-    {
-        if ($this->session_start) {
-            // we need this?
-            $_SESSION['REMOTE_ADDR'] = $_SERVER['REMOTE_ADDR'];
-            $_SESSION['__anonymous__'] = $anonymous;
-            return true;
-        }
-
-        if (is_null($lifetime)) {
-            ini_set('session.use_cookies', 0);
-        } else {
-            ini_set('session.use_cookies', 1);
-        }
-
-        session_set_cookie_params($lifetime);
-        session_id(Ethna_Util::getRandom());
-        session_start();
-        $_SESSION['REMOTE_ADDR'] = $_SERVER['REMOTE_ADDR'];
-        $_SESSION['__anonymous__'] = $anonymous;
-        $this->session_start = true;
-
-        return true;
-    }
-
-    /**
-     *  ¥»¥Ã¥·¥ç¥ó¤òÇË´þ¤¹¤ë
-     *
-     *  @access public
-     *  @return bool    true:Àµ¾ï½ªÎ» false:¥¨¥é¡¼
-     */
-    function destroy()
-    {
-        if (!$this->session_start) {
-            return true;
-        }
-        
-        session_destroy();
-        $this->session_start = false;
-        setcookie($this->session_name, "", 0, "/");
-
-        return true;
-    }
-
-    /**
-     *  ¥»¥Ã¥·¥ç¥óID¤òºÆÀ¸À®¤¹¤ë
-     *
-     *  @access public
-     *  @return bool    true:Àµ¾ï½ªÎ» false:¥¨¥é¡¼
-     */
-    function regenerateId($lifetime = 0, $anonymous = false)
-    {
-        if (! $this->session_start) {
-            return false;
-        }
-       
-        $tmp = $_SESSION;
-
-        $this->destroy();
-        $this->start($lifetime, $anonymous);
-        
-        unset($tmp['REMOTE_ADDR']);
-        unset($tmp['__anonymous__']);
-        foreach ($tmp as $key => $value) {
-            $_SESSION[$key] = $value;
-        }
-
-        return true;
-    }
-
-    /**
-     *  ¥»¥Ã¥·¥ç¥óÃͤؤΥ¢¥¯¥»¥µ(R)
-     *
-     *  @access public
-     *  @param  string  $name   ¥­¡¼
-     *  @return mixed   ¼èÆÀ¤·¤¿ÃÍ(null:¥»¥Ã¥·¥ç¥ó¤¬³«»Ï¤µ¤ì¤Æ¤¤¤Ê¤¤)
-     */
-    function get($name)
-    {
-        if (!$this->session_start) {
-            return null;
-        }
-
-        if (!isset($_SESSION[$name])) {
-            return null;
-        }
-        return $_SESSION[$name];
-    }
-
-    /**
-     *  ¥»¥Ã¥·¥ç¥óÃͤؤΥ¢¥¯¥»¥µ(W)
-     *
-     *  @access public
-     *  @param  string  $name   ¥­¡¼
-     *  @param  string  $value  ÃÍ
-     *  @return bool    true:Àµ¾ï½ªÎ» false:¥¨¥é¡¼(¥»¥Ã¥·¥ç¥ó¤¬³«»Ï¤µ¤ì¤Æ¤¤¤Ê¤¤)
-     */
-    function set($name, $value)
-    {
-        if (!$this->session_start) {
-            // no way
-            return false;
-        }
-
-        $_SESSION[$name] = $value;
-
-        return true;
-    }
-
-    /**
-     *  ¥»¥Ã¥·¥ç¥ó¤ÎÃͤòÇË´þ¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $name   ¥­¡¼
-     *  @return bool    true:Àµ¾ï½ªÎ» false:¥¨¥é¡¼(¥»¥Ã¥·¥ç¥ó¤¬³«»Ï¤µ¤ì¤Æ¤¤¤Ê¤¤)
-     */
-    function remove($name)
-    {
-        if (!$this->session_start) {
-            return false;
-        }
-
-        unset($_SESSION[$name]);
-
-        return true;
-    }
-
-    /**
-     *  ¥»¥Ã¥·¥ç¥ó¤¬³«»Ï¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @param  string  $anonymous  Æ¿Ì¾¥»¥Ã¥·¥ç¥ó¤ò¡Ö³«»Ï¡×¤È¤ß¤Ê¤¹¤«¤É¤¦¤«(default: false)
-     *  @return bool    true:³«»ÏºÑ¤ß false:³«»Ï¤µ¤ì¤Æ¤¤¤Ê¤¤
-     */
-    function isStart($anonymous = false)
-    {
-        if ($anonymous) {
-            return $this->session_start;
-        } else {
-            if ($this->session_start && $this->isAnonymous() != true) {
-                return true;
-            } else {
-                return false;
-            }
-        }
-    }
-
-    /**
-     *  Æ¿Ì¾¥»¥Ã¥·¥ç¥ó¤«¤É¤¦¤«¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @return bool    true:ƿ̾¥»¥Ã¥·¥ç¥ó false:Èóƿ̾¥»¥Ã¥·¥ç¥ó/¥»¥Ã¥·¥ç¥ó³«»Ï¤µ¤ì¤Æ¤¤¤Ê¤¤
-     */
-    function isAnonymous()
-    {
-        return $this->anonymous;
-    }
-
-    /**
-     *  ¥»¥Ã¥·¥ç¥ó¤ËÊݸ¤µ¤ì¤¿IP¥¢¥É¥ì¥¹¤È¥¢¥¯¥»¥¹¸µ¤ÎIP¥¢¥É¥ì¥¹¤¬
-     *  Æ±°ì¥Í¥Ã¥È¥ï¡¼¥¯ÈϰϤ«¤É¤¦¤«¤òȽÊ̤¹¤ë(16bit mask)
-     *
-     *  @access private
-     *  @param  string  $src_ip     ¥»¥Ã¥·¥ç¥ó³«»Ï»þ¤Î¥¢¥¯¥»¥¹¸µIP¥¢¥É¥ì¥¹
-     *  @param  string  $dst_ip     ¸½ºß¤Î¥¢¥¯¥»¥¹¸µIP¥¢¥É¥ì¥¹
-     *  @return bool    true:Àµ¾ï½ªÎ» false:ÉÔÀµ¤ÊIP¥¢¥É¥ì¥¹
-     */
-    function _validateRemoteAddr($src_ip, $dst_ip)
-    {
-        $src = ip2long($src_ip);
-        $dst = ip2long($dst_ip);
-
-        if (($src & 0xffff0000) == ($dst & 0xffff0000)) {
-            return true;
-        } else {
-            $this->logger->log(LOG_NOTICE, "session IP validation failed [%s] - [%s]",
-                               $src_ip, $dst_ip);
-            return false;
-        }
-    }
-}
-// }}}
-?>
diff --git a/class/Ethna_SmartyPlugin.php b/class/Ethna_SmartyPlugin.php
deleted file mode 100644 (file)
index 9524c34..0000000
+++ /dev/null
@@ -1,831 +0,0 @@
-<?php
-/**
- *  Ethna_SmartyPlugin.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ smarty_modifier_number_format
-/**
- *  smarty modifier:number_format()
- *
- *  number_format()´Ø¿ô¤Îwrapper
- *
- *  sample:
- *  <code>
- *  {"12345"|number_format}
- *  </code>
- *  <code>
- *  12,345
- *  </code>
- *
- *  @param  string  $string ¥Õ¥©¡¼¥Þ¥Ã¥ÈÂоÝʸ»úÎó
- *  @return string  ¥Õ¥©¡¼¥Þ¥Ã¥ÈºÑ¤ßʸ»úÎó
- */
-function smarty_modifier_number_format($string)
-{
-    if ($string === "" || $string == null) {
-        return "";
-    }
-    return number_format($string);
-}
-// }}}
-
-// {{{ smarty_modifier_strftime
-/**
- *  smarty modifier:strftime()
- *
- *  strftime()´Ø¿ô¤Îwrapper
- *
- *  sample:
- *  <code>
- *  {"2004/01/01 01:01:01"|strftime:"%Yǯ%m·î%dÆü"}
- *  </code>
- *  <code>
- *  2004ǯ01·î01Æü
- *  </code>
- *
- *  @param  string  $string ¥Õ¥©¡¼¥Þ¥Ã¥ÈÂоÝʸ»úÎó
- *  @param  string  $format ½ñ¼°»ØÄêʸ»úÎó(strftime()´Ø¿ô»²¾È)
- *  @return string  ¥Õ¥©¡¼¥Þ¥Ã¥ÈºÑ¤ßʸ»úÎó
- */
-function smarty_modifier_strftime($string, $format)
-{
-    if ($string === "" || $string == null) {
-        return "";
-    }
-    return strftime($format, strtotime($string));
-}
-// }}}
-
-// {{{ smarty_modifier_count
-/**
- *  smarty modifier:count()
- *
- *  count()´Ø¿ô¤Îwrapper
- *
- *  sample:
- *  <code>
- *  $smarty->assign("array", array(1, 2, 3));
- *
- *  {$array|@count}
- *  </code>
- *  <code>
- *  3
- *  </code>
- *
- *  @param  array   $array  ÂоݤȤʤëÇÛÎó
- *  @return int     ÇÛÎó¤ÎÍ×ÁÇ¿ô
- */
-function smarty_modifier_count($array)
-{
-    return count($array);
-}
-// }}}
-
-// {{{ smarty_modifier_join
-/**
- *  smarty modifier:join()
- *
- *  join()´Ø¿ô¤Îwrapper
- *
- *  sample:
- *  <code>
- *  $smarty->assign("array", array(1, 2, 3));
- *
- *  {$array|@join:":"}
- *  </code>
- *  <code>
- *  1:2:3
- *  </code>
- *
- *  @param  array   $array  joinÂоݤÎÇÛÎó
- *  @param  string  $glue   Ï¢·ëʸ»úÎó
- *  @return string  Ï¢·ë¸å¤Îʸ»úÎó
- */
-function smarty_modifier_join($array, $glue)
-{
-    if (is_array($array) == false) {
-        return $array;
-    }
-    return implode($glue, $array);
-}
-// }}}
-
-// {{{ smarty_modifier_filter
-/**
- *  smarty modifier:filter()
- *
- *  »ØÄꤵ¤ì¤¿Ï¢ÁÛÇÛÎó¤Î¤¦¤Á$key¤Ç»ØÄꤵ¤ì¤¿Í×ÁǤΤߤòÇÛÎó¤ËºÆ¹½À®¤¹¤ë
- *
- *  sample:
- *  <code>
- *  $smarty->assign("array", array(
- *      array("foo" => 1, "bar" => 4),
- *      array("foo" => 2, "bar" => 5),
- *      array("foo" => 3, "bar" => 6),
- *  ));
- *
- *  {$array|@filter:"foo"|@join:","}
- *  </code>
- *  <code>
- *  1,2,3
- *  </code>
- *  
- *  @param  array   $array  filterÂоݤȤʤëÇÛÎó
- *  @param  string  $key    È´¤­½Ð¤·¤ÆÇÛÎó¤ò¹½À®¤¹¤ëÏ¢ÁÛÇÛÎó¤Î¥­¡¼
- *  @return array   ºÆ¹½À®¤µ¤ì¤¿ÇÛÎó
- */
-function smarty_modifier_filter($array, $key)
-{
-    if (is_array($array) == false) {
-        return $array;
-    }
-    $tmp = array();
-    foreach ($array as $v) {
-        if (isset($v[$key]) == false) {
-            continue;
-        }
-        $tmp[] = $v[$key];
-    }
-    return $tmp;
-}
-// }}}
-
-// {{{ smarty_modifier_unique
-/**
- *  smarty modifier:unique()
- *
- *  unique()´Ø¿ô¤Îwrapper
- *
- *  sample:
- *  <code>
- *  $smarty->assign("array1", array("a", "a", "b", "a", "b", "c"));
- *  $smarty->assign("array2", array(
- *      array("foo" => 1, "bar" => 4),
- *      array("foo" => 1, "bar" => 4),
- *      array("foo" => 1, "bar" => 4),
- *      array("foo" => 2, "bar" => 5),
- *      array("foo" => 3, "bar" => 6),
- *      array("foo" => 2, "bar" => 5),
- *  ));
- *
- *  {$array1|@unique}
- *  {$array2|@unique:"foo"}
- *  </code>
- *  <code>
- *  abc
- *  123
- *  </code>
- *  
- *  @param  array   $array  ½èÍýÂоݤȤʤëÇÛÎó
- *  @param  key     $key    ½èÍýÂоݤȤʤ륭¡¼(null¤Ê¤éÇÛÎóÍ×ÁÇ)
- *  @return array   ºÆ¹½À®¤µ¤ì¤¿ÇÛÎó
- */
-function smarty_modifier_unique($array, $key = null)
-{
-    if (is_array($array) == false) {
-        return $array;
-    }
-    if ($key != null) {
-        $tmp = array();
-        foreach ($array as $v) {
-            if (isset($v[$key]) == false) {
-                continue;
-            }
-            $tmp[$v[$key]] = $v;
-        }
-        return $tmp;
-    } else {
-        return array_unique($array);
-    }
-}
-// }}}
-
-// {{{ smarty_modifier_wordwrap_i18n
-/**
- *  smarty modifier:ʸ»úÎó¤Îwordwrap½èÍý
- *
- *  [¸½ºßEUC-JPÂбþ¤ÏEUC-JP¤Î¤ßÂбþ]
- *
- *  sample:
- *  <code>
- *  {"¤¢¤¤¤¦a¤¨a¤ªa¤«¤­aaa¤¯¤±¤³"|wordrap_i18n:8}
- *  </code>
- *  <code>
- *  ¤¢¤¤¤¦a
- *  ¤¨a¤ªa¤«
- *  ¤­aaa¤¯
- *  ¤±¤³
- *  </code>
- *
- *  @param  string  $string wordwrap¤¹¤ëʸ»úÎó
- *  @param  string  $break  ²þ¹Ôʸ»ú
- *  @param  int     $width  wordwrapÉý(Ⱦ³Ñ$widthʸ»ú¤Çwordwrap¤¹¤ë)
- *  @param  int     $indent ¥¤¥ó¥Ç¥ó¥ÈÉý(Ⱦ³Ñ$indentʸ»ú)
- *  @return string  wordwrap½èÍý¤µ¤ì¤¿Ê¸»úÎó
- */
-function smarty_modifier_wordwrap_i18n($string, $width, $break = "\n", $indent = 0)
-{
-    $r = "";
-    $i = "$break" . str_repeat(" ", $indent);
-    $tmp = $string;
-    do {
-        $n = strpos($tmp, $break);
-        if ($n !== false && $n < $width) {
-            $s = substr($tmp, 0, $n);
-            $r .= $s . $i;
-            $tmp = substr($tmp, strlen($s) + strlen($break));
-            continue;
-        }
-
-        $s = mb_strimwidth($tmp, 0, $width, "", "EUC-JP");
-
-        // EUC-JP¤Î¤ßÂбþ
-        $n = strlen($s);
-        if ($n >= $width && $tmp{$n} != "" && $tmp{$n} != " ") {
-            while ((ord($s{$n-1}) & 0x80) == 0) {
-                if ($s{$n-1} == " " || $n == 0) {
-                    break;
-                }
-                $n--;
-            }
-        }
-        $s = substr($s, 0, $n);
-
-        $r .= $s . $i;
-        $tmp = substr($tmp, strlen($s));
-    } while (strlen($s) > 0);
-
-    $r = preg_replace('/\s+$/', '', $r);
-
-    return $r;
-}
-// }}}
-
-// {{{ smarty_modifier_truncate_i18n
-/**
- *  smarty modifier:ʸ»úÎóÀÚ¤êµÍ¤á½èÍý(i18nÂбþ)
- *
- *  sample:
- *  <code>
- *  {"ÆüËܸì¤Ç¤¹"|truncate_i18n:5:"..."}
- *  </code>
- *  <code>
- *  ÆüËÜ...
- *  </code>
- *
- *  @param  int     $len        ºÇÂçʸ»úÉý
- *  @param  string  $postfix    ËöÈø¤ËÉղ乤ëʸ»úÎó
- */
-function smarty_modifier_truncate_i18n($string, $len = 80, $postfix = "...")
-{
-    return mb_strimwidth($string, 0, $len, $postfix);
-}
-// }}}
-
-// {{{ smarty_modifier_i18n
-/**
- *  smarty modifier:i18n¥Õ¥£¥ë¥¿
- *
- *  sample:
- *  <code>
- *  {"english"|i18n}
- *  </code>
- *  <code>
- *  ±Ñ¸ì
- *  </code>
- *
- *  @param  string  $string i18n½èÍýÂоݤÎʸ»úÎó
- *  @return string  ¥í¥±¡¼¥ë¤ËÂбþ¤·¤¿¥á¥Ã¥»¡¼¥¸
- */
-function smarty_modifier_i18n($string)
-{
-    $c =& Ethna_Controller::getInstance();
-
-    $i18n =& $c->getI18N();
-
-    return $i18n->get($string);
-}
-// }}}
-
-// {{{ smarty_modifier_checkbox
-/**
- *  smarty modifier:¥Á¥§¥Ã¥¯¥Ü¥Ã¥¯¥¹ÍÑ¥Õ¥£¥ë¥¿
- *
- *  sample:
- *  <code>
- *  <input type="checkbox" name="test" {""|checkbox}>
- *  <input type="checkbox" name="test" {"1"|checkbox}>
- *  </code>
- *  <code>
- *  <input type="checkbox" name="test">
- *  <input type="checkbox" name="test" checkbox>
- *  </code>
- *
- *  @param  string  $string ¥Á¥§¥Ã¥¯¥Ü¥Ã¥¯¥¹¤ËÅϤµ¤ì¤¿¥Õ¥©¡¼¥àÃÍ
- *  @return string  $string¤¬¶õʸ»úÎ󤢤뤤¤Ï0°Ê³°¤Î¾ì¹ç¤Ï"checked"
- */
-function smarty_modifier_checkbox($string)
-{
-    if ($string != "" && $string != 0) {
-        return "checked";
-    }
-}
-// }}}
-
-// {{{ smarty_modifier_select
-/**
- *  smarty modifier:¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹ÍÑ¥Õ¥£¥ë¥¿
- *
- *  Ã±½ã¤Ê¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹¤Î¾ì¹ç¤Ïsmarty´Ø¿ô"select"¤òÍøÍѤ¹¤ë¤³¤È¤Ç
- *  ¥¿¥°¤ò¾Êά²Äǽ
- *
- *  sample:
- *  <code>
- *  $smarty->assign("form", 1);
- *
- *  <option value="1" {$form|select:"1"}>foo</option>
- *  <option value="2" {$form|select:"2"}>bar</option>
- *  </code>
- *  <code>
- *  <option value="1" selected>foo</option>
- *  <option value="2" >bar</option>
- *  </code>
- *
- *  @param  string  $string ¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹¤ËÅϤµ¤ì¤¿¥Õ¥©¡¼¥àÃÍ
- *  @param  string  $value  <option>¥¿¥°¤Ë»ØÄꤵ¤ì¤Æ¤¤¤ëÃÍ
- *  @return string  $string¤¬$value¤Ë¥Þ¥Ã¥Á¤¹¤ë¾ì¹ç¤Ï"selected"
- */
-function smarty_modifier_select($string, $value)
-{
-    if ($string == $value) {
-        return 'selected="true"';
-    }
-}
-// }}}
-
-// {{{ smarty_modifier_form_value
-/**
- *  smarty modifier:¥Õ¥©¡¼¥àÃͽÐÎÏ¥Õ¥£¥ë¥¿
- *
- *  ¥Õ¥©¡¼¥à̾¤òÊÑ¿ô¤Ç»ØÄꤷ¤Æ¥Õ¥©¡¼¥àÃͤò¼èÆÀ¤·¤¿¤¤¾ì¹ç¤Ë»ÈÍѤ¹¤ë
- *
- *  sample:
- *  <code>
- *  $this->af->set('foo', 'bar);
- *  $smarty->assign('key', 'foo');
- *  {$key|form_value}
- *  </code>
- *  <code>
- *  bar
- *  </code>
- *
- *  @param  string  $string ¥Õ¥©¡¼¥à¹àÌÜ̾
- *  @return string  ¥Õ¥©¡¼¥àÃÍ
- */
-function smarty_modifier_form_value($string)
-{
-    $c =& Ethna_Controller::getInstance();
-    $af =& $c->getActionForm();
-
-    $elts = explode(".", $string);
-    $r = $af->get($elts[0]);
-    for ($i = 1; $i < count($elts); $i++) {
-        $r = $r[$elts[$i]];
-    }
-
-    return htmlspecialchars($r, ENT_QUOTES);
-}
-// }}}
-
-// {{{ smarty_function_is_error
-/**
- *  smarty function:»ØÄꤵ¤ì¤¿¥Õ¥©¡¼¥à¹àÌܤǥ¨¥é¡¼¤¬È¯À¸¤·¤Æ¤¤¤ë¤«¤É¤¦¤«¤òÊÖ¤¹
- *  NOTE: {if is_error('name')} ¤Ï Ethna_Util.php ¤Î is_error() ¤Ç¤¢¤Ã¤Æ¡¢
- *        smarty_function_is_error() ¤Ç¤Ï¤Ê¤¤¤³¤È¤ËÃí°Õ
- *
- *  @param  string  $name   ¥Õ¥©¡¼¥à¹àÌÜ̾
- */
-function smarty_function_is_error($params, &$smarty)
-{
-    $name = isset($params['name']) ? $params['name'] : null;
-    return is_error($name);
-}
-// }}}
-
-// {{{ smarty_function_message
-/**
- *  smarty function:»ØÄꤵ¤ì¤¿¥Õ¥©¡¼¥à¹àÌܤËÂбþ¤¹¤ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò½ÐÎϤ¹¤ë
- *
- *  sample:
- *  <code>
- *  <input type="text" name="foo">{message name="foo"}
- *  </code>
- *  <code>
- *  <input type="text" name="foo">foo¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤
- *  </code>
- *
- *  @param  string  $name   ¥Õ¥©¡¼¥à¹àÌÜ̾
- */
-function smarty_function_message($params, &$smarty)
-{
-    if (isset($params['name']) === false) {
-        return '';
-    }
-
-    $c =& Ethna_Controller::getInstance();
-    $action_error =& $c->getActionError();
-
-    $message = $action_error->getMessage($params['name']);
-    if ($message === null) {
-        return '';
-    }
-
-    $id = isset($params['id']) ? $params['id']
-        : str_replace("_", "-", "ethna-error-" . $params['name']);
-    $class = isset($params['class']) ? $params['class'] : "ethna-error";
-    return sprintf('<span class="%s" id="%s">%s</span>',
-        $class, $id, htmlspecialchars($message));
-}
-// }}}
-
-// {{{ smarty_function_uniqid
-/**
- *  smarty function:¥æ¥Ë¡¼¥¯ID¤òÀ¸À®¤¹¤ë(double post¥Á¥§¥Ã¥¯ÍÑ)
- *
- *  sample:
- *  <code>
- *  {uniqid}
- *  </code>
- *  <code>
- *  <input type="hidden" name="uniqid" value="a0f24f75e...e48864d3e">
- *  </code>
- *
- *  @param  string  $type   É½¼¨¥¿¥¤¥×("get" or "post"¡Ý¥Ç¥Õ¥©¥ë¥È="post")
- *  @see    isDuplicatePost
- */
-function smarty_function_uniqid($params, &$smarty)
-{
-    $uniqid = Ethna_Util::getRandom();
-    if (isset($params['type']) && $params['type'] == 'get') {
-        return "uniqid=$uniqid";
-    } else {
-        return "<input type=\"hidden\" name=\"uniqid\" value=\"$uniqid\" />\n";
-    }
-}
-// }}}
-
-// {{{ smarty_function_select
-/**
- *  smarty function:¥»¥ì¥¯¥È¥Õ¥£¡¼¥ë¥ÉÀ¸À®
- *
- *  @param  array   $list   ÁªÂò»è°ìÍ÷
- *  @param  string  $name   ¥Õ¥©¡¼¥à¹àÌÜ̾
- *  @param  string  $value  ¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹¤ËÅϤµ¤ì¤¿¥Õ¥©¡¼¥àÃÍ
- *  @param  string  $empty  ¶õ¥¨¥ó¥È¥ê(¡Ö---ÁªÂò¤·¤Æ²¼¤µ¤¤---¡×Åù)
- *  @deprecated
- */
-function smarty_function_select($params, &$smarty)
-{
-    extract($params);
-
-    print "<select name=\"$name\">\n";
-    if ($empty) {
-        printf("<option value=\"\">%s</option>\n", $empty);
-    }
-    foreach ($list as $id => $elt) {
-        printf("<option value=\"%s\" %s>%s</option>\n", $id, $id == $value ? 'selected="true"' : '', $elt['name']);
-    }
-    print "</select>\n";
-}
-// }}}
-
-// {{{ smarty_function_checkbox_list
-/**
- *  smarty function:¥Á¥§¥Ã¥¯¥Ü¥Ã¥¯¥¹¥Õ¥£¥ë¥¿´Ø¿ô(ÇÛÎóÂбþ)
- *
- *  @param  string  $form   ¥Á¥§¥Ã¥¯¥Ü¥Ã¥¯¥¹¤ËÅϤµ¤ì¤¿¥Õ¥©¡¼¥àÃÍ
- *  @param  string  $key    É¾²ÁÂоݤÎÇÛÎ󥤥ó¥Ç¥Ã¥¯¥¹
- *  @param  string  $value  É¾²ÁÃÍ
- *  @deprecated
- */
-function smarty_function_checkbox_list($params, &$smarty)
-{
-    extract($params);
-
-    if (isset($key) == false) {
-        $key = null;
-    }
-    if (isset($value) == false) {
-        $value = null;
-    }
-    if (isset($checked) == false) {
-        $checked = "checked";
-    }
-
-    if (is_null($key) == false) {
-        if (isset($form[$key])) {
-            if (is_null($value)) {
-                print $checked;
-            } else {
-                if (strcmp($form[$key], $value) == 0) {
-                    print $checked;
-                }
-            }
-        }
-    } else if (is_null($value) == false) {
-        if (is_array($form)) {
-            if (in_array($value, $form)) {
-                print $checked;
-            }
-        } else {
-            if (strcmp($value, $form) == 0) {
-                print $checked;
-            }
-        }
-    }
-}
-// }}}
-
-// {{{ smarty_function_url
-/**
- *  smarty function:urlÀ¸À®
- */
-function smarty_function_url($params, &$smarty)
-{
-    $action = $path = $path_key = null;
-    $query = $params;
-
-    foreach (array('action', 'anchor', 'scheme') as $key) {
-        if (isset($params[$key])) {
-            ${$key} = $params[$key];
-        } else {
-            ${$key} = null;
-        }
-        unset($query[$key]);
-    }
-
-    $c =& Ethna_Controller::getInstance();
-    $config =& $c->getConfig();
-    $url_handler =& $c->getUrlHandler();
-    list($path, $path_key) = $url_handler->actionToRequest($action, $query);
-
-    if ($path != "") {
-        if (is_array($path_key)) {
-            foreach ($path_key as $key) {
-                unset($query[$key]);
-            }
-        }
-    } else {
-        $query = $url_handler->buildActionParameter($query, $action);
-    }
-    $query = $url_handler->buildQueryParameter($query);
-
-    $url = sprintf('%s%s', $config->get('url'), $path);
-
-    if (preg_match('|^(\w+)://(.*)$|', $url, $match)) {
-        if ($scheme) {
-            $match[1] = $scheme;
-        }
-        $match[2] = preg_replace('|/+|', '/', $match[2]);
-        $url = $match[1] . '://' . $match[2];
-    }
-
-    $url .= $query ? "?$query" : "";
-    $url .= $anchor ? "#$anchor" : "";
-
-    return $url;
-}
-// }}}
-
-// {{{ smarty_function_form_name
-/**
- *  smarty function:¥Õ¥©¡¼¥àɽ¼¨Ì¾À¸À®
- *
- *  @param  string  $name   ¥Õ¥©¡¼¥à¹àÌÜ̾
- */
-function smarty_function_form_name($params, &$smarty)
-{
-    // name
-    if (isset($params['name'])) {
-        $name = $params['name'];
-        unset($params['name']);
-    } else {
-        return null;
-    }
-
-    // view object
-    $c =& Ethna_Controller::getInstance();
-    $view =& $c->getView();
-    if ($view === null) {
-        return null;
-    }
-
-    // action
-    $action = null;
-    if (isset($params['action'])) {
-        $action = $params['action'];
-        unset($params['action']);
-    } else {
-        for ($i = count($smarty->_tag_stack); $i >= 0; --$i) {
-            if ($smarty->_tag_stack[$i][0] === 'form') {
-                if (isset($smarty->_tag_stack[$i][1]['ethna_action'])) {
-                    $action = $smarty->_tag_stack[$i][1]['ethna_action'];
-                }
-                break;
-            }
-        }
-    }
-    if ($action !== null) {
-        $view->addActionFormHelper($action);
-    }
-
-    return $view->getFormName($name, $action, $params);
-}
-// }}}
-
-// {{{ smarty_function_form_submit
-/**
- *  smarty function:¥Õ¥©¡¼¥à¤Îsubmit¥Ü¥¿¥óÀ¸À®
- *
- *  @param  string  $submit   ¥Õ¥©¡¼¥à¹àÌÜ̾
- */
-function smarty_function_form_submit($params, &$smarty)
-{
-    $c =& Ethna_Controller::getInstance();
-    $view =& $c->getView();
-    if ($view === null) {
-        return null;
-    }
-    return $view->getFormSubmit($params);
-}
-// }}}
-
-// {{{ smarty_function_form_input
-/**
- *  smarty function:¥Õ¥©¡¼¥à¥¿¥°À¸À®
- *
- *  @param  string  $name   ¥Õ¥©¡¼¥à¹àÌÜ̾
- */
-function smarty_function_form_input($params, &$smarty)
-{
-    // name
-    if (isset($params['name'])) {
-        $name = $params['name'];
-        unset($params['name']);
-    } else {
-        return null;
-    }
-
-    // view object
-    $c =& Ethna_Controller::getInstance();
-    $view =& $c->getView();
-    if ($view === null) {
-        return null;
-    }
-
-    // ¸½ºß¤Î{form_input}¤ò°Ï¤àform block¤¬¤¢¤ì¤Ð¥Ñ¥é¥á¡¼¥¿¤ò¼èÆÀ¤·¤Æ¤ª¤¯
-    $block_params = null;
-    for ($i = count($smarty->_tag_stack); $i >= 0; --$i) {
-        if ($smarty->_tag_stack[$i][0] === 'form') {
-            $block_params = $smarty->_tag_stack[$i][1];
-            break;
-        }
-    }
-
-    // action
-    $action = null;
-    if (isset($params['action'])) {
-        $action = $params['action'];
-        unset($params['action']);
-    } else if (isset($block_params['ethna_action'])) {
-        $action = $block_params['ethna_action'];
-    }
-    if ($action !== null) {
-        $view->addActionFormHelper($action);
-    }
-
-    // default
-    if (isset($params['default'])) {
-        // {form_input default=...}¤¬»ØÄꤵ¤ì¤Æ¤¤¤ì¤Ð¤½¤Î¤Þ¤Þ
-
-    } else if (isset($block_params['default'])) {
-        // ³°Â¦¤Î {form default=...} ¥Ö¥í¥Ã¥¯
-        if (isset($block_params['default'][$name])) {
-            $params['default'] = $block_params['default'][$name];
-        }
-    } else {
-        // ¸½ºß¤Î¥¢¥¯¥·¥ç¥ó¤Ç¼õ¤±¼è¤Ã¤¿¥Õ¥©¡¼¥àÃÍ
-        $af =& $c->getActionForm();
-        $val = $af->get($name);
-        if ($val !== null) {
-            $params['default'] = $val;
-        }
-    }
-
-    return $view->getFormInput($name, $action, $params);
-}
-// }}}
-
-// {{{ smarty_block_form
-/**
- *  smarty block:¥Õ¥©¡¼¥à¥¿¥°½ÐÎϥץ饰¥¤¥ó
- */
-function smarty_block_form($params, $content, &$smarty, &$repeat)
-{
-    if ($repeat) {
-        // {form}: ¥Ö¥í¥Ã¥¯ÆâÉô¤Ë¿Ê¤àÁ°¤Î½èÍý
-
-        // default
-        if (isset($params['default']) === false) {
-            // »ØÄê¤Ê¤·¤Î¤È¤­¤Ï $form ¤ò»È¤¦
-            $c =& Ethna_Controller::getInstance();
-            $af =& $c->getActionForm();
-
-            // c.f. http://smarty.php.net/manual/en/plugins.block.functions.php
-            $smarty->_tag_stack[count($smarty->_tag_stack)-1][1]['default']
-                =& $af->getArray(false);
-        }
-
-        // ¤³¤³¤ÇÊÖ¤¹ÃͤϽÐÎϤµ¤ì¤Ê¤¤
-        return '';
-
-    } else {
-        // {/form}: ¥Ö¥í¥Ã¥¯Á´ÂΤò½ÐÎÏ
-
-        $c =& Ethna_Controller::getInstance();
-        $view =& $c->getView();
-        if ($view === null) {
-            return null;
-        }
-
-        // ethna_action
-        if (isset($params['ethna_action'])) {
-            $ethna_action = $params['ethna_action'];
-            unset($params['ethna_action']);
-
-            $view->addActionFormHelper($ethna_action);
-            $hidden = $c->getActionRequest($ethna_action, 'hidden');
-            $content = $hidden . $content;
-        }
-
-        // enctype ¤Îά¾ÎÂбþ
-        if (isset($params['enctype'])) {
-            if ($params['enctype'] == 'file'
-                || $params['enctype'] == 'multipart') {
-                $params['enctype'] = 'multipart/form-data';
-            } else if ($params['enctype'] == 'url') {
-                $params['enctype'] = 'application/x-www-form-urlencoded';
-            }
-        }
-
-        // default¤Ï¤â¤¦ÉÔÍ×
-        if (isset($params['default'])) {
-            unset($params['default']);
-        }
-
-        // $content¤ò°Ï¤à<form>¥Ö¥í¥Ã¥¯Á´ÂΤò½ÐÎÏ
-        return $view->getFormBlock($content, $params);
-    }
-}
-// }}}
-
-// {{{ smarty_function_csrfid
-/**
- *  smarty function: ÀµÅö¤Ê¥Ý¥¹¥È¤Ç¤¢¤ë¤³¤È¤òÊݾڤ¹¤ëID¤ò½ÐÎϤ¹¤ë
- *
- *  sample:
- *  <code>
- *  {csrfid}
- *  </code>
- *  <code>
- *  <input type="hidden" name="csrfid" value="a0f24f75e...e48864d3e">
- *  </code>
- *
- *  @param  string  $type   É½¼¨¥¿¥¤¥×("get" or "post"¡Ý¥Ç¥Õ¥©¥ë¥È="post")
- *  @see    isRequestValid
- */
-function smarty_function_csrfid($params, &$smarty)
-{
-    $c =& Ethna_Controller::getInstance();
-    $name = $c->config->get('csrf');
-    if (is_null($name)) {
-        $name = 'Session';
-    }
-    $plugin =& $c->getPlugin();
-    $csrf = $plugin->getPlugin('Csrf', $name);
-    $csrfid = $csrf->get();
-    $token_name = $csrf->getName();
-    if (isset($params['type']) && $params['type'] == 'get') {
-        return sprintf("%s=%s", $token_name, $csrfid);
-    } else {
-        return sprintf("<input type=\"hidden\" name=\"%s\" value=\"%s\" />\n", $token_name, $csrfid);
-    }
-}
-// }}}
-
-?>
diff --git a/class/Ethna_UnitTestCase.php b/class/Ethna_UnitTestCase.php
deleted file mode 100644 (file)
index 7eeef66..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-<?php
-/**
- *  Ethna_UnitTestCase.php
- *
- *  @author     Takuya Ookubo <sfio@sakura.ai.to>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-/**
- *  UnitTestCase¼Â¹Ô¥¯¥é¥¹
- *
- *  @author     Takuya Ookubo <sfio@sakura.ai.to>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_UnitTestCase extends UnitTestCase
-{
-    /** @var    object  Ethna_Backend       backend¥ª¥Ö¥¸¥§¥¯¥È */
-    var $backend;
-
-    /** @var    object  Ethna_Controller    controller¥ª¥Ö¥¸¥§¥¯¥È */
-    var $controller;
-
-    /** @var    object  Ethna_Controller    controller¥ª¥Ö¥¸¥§¥¯¥È($controller¤Î¾Êά·Á) */
-    var $ctl;
-
-    /** @var    object  Ethna_Session       ¥»¥Ã¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È */
-    var $session;
-
-    /** @var    string                      ¥¢¥¯¥·¥ç¥ó̾ */
-    var $action_name;
-
-    /** @var    object  Ethna_ActionForm    ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È */
-    var $action_form;
-
-    /** @var    object  Ethna_ActionForm    ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È($action_form¤Î¾Êά·Á) */
-    var $af;
-
-    /** @var    object  Ethna_ActionClass   ¥¢¥¯¥·¥ç¥ó¥¯¥é¥¹¥ª¥Ö¥¸¥§¥¯¥È */
-    var $action_class;
-
-    /** @var    object  Ethna_ActionClass   ¥¢¥¯¥·¥ç¥ó¥¯¥é¥¹¥ª¥Ö¥¸¥§¥¯¥È($action_class¤Î¾Êά·Á) */
-    var $ac;
-
-    /** @var    string                      ¥Ó¥å¡¼Ì¾ */
-    var $forward_name;
-
-    /** @var    object  Ethna_ViewClass     view¥¯¥é¥¹¥ª¥Ö¥¸¥§¥¯¥È */
-    var $view_class;
-
-    /** @var    object  Ethna_ViewClass     view¥¯¥é¥¹¥ª¥Ö¥¸¥§¥¯¥È($view_class¤Î¾Êά·Á) */
-    var $vc;
-
-    /**
-     *  Ethna_UnitTestCase¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Controller    &$controller    ¥³¥ó¥È¥í¡¼¥é¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function Ethna_UnitTestCase(&$controller)
-    {
-        parent::UnitTestCase();
-
-        // ¥ª¥Ö¥¸¥§¥¯¥È¤ÎÀßÄê
-        $this->controller =& $controller;
-        $this->ctl =& $this->controller;
-        $this->backend =& $this->ctl->getBackend();
-        $this->session =& $this->backend->getSession();
-
-        // ÊÑ¿ô¤Î½é´ü²½
-        $this->action_form = $this->af = null;
-        $this->action_class = $this->ac = null;
-        $this->view_class = $this->vc = null;
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¤ÎºîÀ®¤È´ØÏ¢ÉÕ¤±
-     *
-     *  @access public
-     */
-    function _createActionForm($form_name)
-    {
-        $this->action_form =& new $form_name($this->ctl);
-        $this->af =& $this->action_form;
-
-        // controler&backend¤Ëaf¤ò´ØÏ¢ÉÕ¤±
-        $this->ctl->action_name = $this->action_name;
-        $this->ctl->action_form =& $this->af;
-        $this->backend->action_form =& $this->af;
-        $this->backend->af =& $this->af;
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¤ÎºîÀ®
-     *
-     *  @access public
-     */
-    function createActionForm()
-    {
-        $form_name = $this->ctl->getActionFormName($this->action_name);
-        $this->_createActionForm($form_name);
-    }
-
-    /**
-     *  validateOneTime()
-     *
-     *  @access public
-     *  @return int $result
-     */
-    function validateOneTime()
-    {
-        if ($this->af == null) {
-            $this->createActionForm();
-        }
-
-        $result = $this->af->validate();
-        $this->af->ae->clear();
-
-        return $result;
-    }
-
-    /**
-     *  Ã±½ã¤Ê¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¤ÎºîÀ®
-     *
-     *  @access public
-     */
-    function createPlainActionForm()
-    {
-        $form_name = 'Ethna_ActionForm';
-        $this->_createActionForm($form_name);
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¤ÎºîÀ®
-     *
-     *  @access public
-     */
-    function createActionClass()
-    {
-        if ($this->af == null) {
-            $this->createActionForm();
-        }
-
-        // ¥ª¥Ö¥¸¥§¥¯¥ÈÀ¸À®
-        $action_class_name = $this->ctl->getActionClassName($this->action_name);
-        $this->action_class =& new $action_class_name($this->backend);
-        $this->ac =& $this->action_class;
-
-        // backend¤Ëac¤ò´ØÏ¢ÉÕ¤±
-        $this->backend->action_class =& $this->ac;
-        $this->backend->ac =& $this->ac;
-    }
-
-    /**
-     *  ¥Ó¥å¡¼¤ÎºîÀ®
-     *
-     *  @access public
-     */
-    function createViewClass()
-    {
-        if ($this->af == null) {
-            $this->createPlainActionForm();
-        }
-
-        // ¥ª¥Ö¥¸¥§¥¯¥ÈÀ¸À®
-        $view_class_name = $this->ctl->getViewClassName($this->forward_name);
-        $this->view_class =& new $view_class_name($this->backend, $this->forward_name, $this->ctl->_getForwardPath($this->forward_name));
-        $this->vc =& $this->view_class;
-    }
-}
-?>
diff --git a/class/Ethna_UnitTestManager.php b/class/Ethna_UnitTestManager.php
deleted file mode 100644 (file)
index 09cf136..0000000
+++ /dev/null
@@ -1,309 +0,0 @@
-<?php
-/**
- *  Ethna_UnitTestManager.php
- *
- *  @author     Takuya Ookubo <sfio@sakura.ai.to>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-require_once('simpletest/unit_tester.php');
-require_once('Ethna_UnitTestCase.php');
-require_once('Ethna_UnitTestReporter.php');
-
-/**
- *  Ethna¥æ¥Ë¥Ã¥È¥Æ¥¹¥È¥Þ¥Í¡¼¥¸¥ã¥¯¥é¥¹
- *
- *  @author     Takuya Ookubo <sfio@sakura.ai.to>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_UnitTestManager extends Ethna_AppManager
-{
-    /** @var    object  Ethna_Controller    ¥³¥ó¥È¥í¡¼¥é¥ª¥Ö¥¸¥§¥¯¥È */
-    var $ctl;
-
-    /** @var    array                       °ìÈ̥ƥ¹¥È¥±¡¼¥¹ÄêµÁ */
-    var $testcase = array();
-
-    /**
-     *  Ethna_UnitTestManager¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Backend   &$backend   Ethna_Backend¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function Ethna_UnitTestManager(&$backend)
-    {
-        parent::Ethna_AppManager($backend);
-        $this->ctl =& Ethna_Controller::getInstance();
-        $this->class_factory =& $this->ctl->getClassFactory();
-    }
-
-    /**
-     *  ÄêµÁºÑ¤ß¥¢¥¯¥·¥ç¥ó°ìÍ÷¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return array   ¥¢¥¯¥·¥ç¥ó°ìÍ÷
-     */
-    function _getActionList()
-    {
-        $im =& new Ethna_InfoManager($this->backend);
-        return $im->getActionList();
-    }
-
-    /**
-     *  ¥¯¥é¥¹Ì¾¤«¤é¥Ó¥å¡¼Ì¾¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $class_name     ¥Ó¥å¡¼¥¯¥é¥¹Ì¾
-     *  @return string  ¥¢¥¯¥·¥ç¥ó̾
-     */
-    function viewClassToName($class_name)
-    {
-        $prefix = sprintf("%s_View_", $this->ctl->getAppId());
-        if (preg_match("/$prefix(.*)/", $class_name, $match) == 0) {
-            // ÉÔÌÀ¤Ê¥¯¥é¥¹Ì¾
-            return null;
-        }
-        $target = $match[1];
-
-        $action_name = substr(preg_replace('/([A-Z])/e', "'_' . strtolower('\$1')", $target), 1);
-
-        return $action_name;
-    }
-
-    /**
-     *  »ØÄꤵ¤ì¤¿¥¯¥é¥¹Ì¾¤ò·Ñ¾µ¤·¤Æ¤¤¤ë¤«¤É¤¦¤«¤òÊÖ¤¹
-     *
-     *  @access private
-     *  @param  string  $class_name     ¥Á¥§¥Ã¥¯ÂоݤΥ¯¥é¥¹Ì¾
-     *  @param  string  $parent_name    ¿Æ¥¯¥é¥¹Ì¾
-     *  @return bool    true:·Ñ¾µ¤·¤Æ¤¤¤ë false:¤¤¤Ê¤¤
-     */
-    function _isSubclassOf($class_name, $parent_name)
-    {
-        while ($tmp = get_parent_class($class_name)) {
-            if (strcasecmp($tmp, $parent_name) == 0) {
-                return true;
-            }
-            $class_name = $tmp;
-        }
-        return false;
-    }
-
-    /**
-     *  ¥Ó¥å¡¼¥¹¥¯¥ê¥×¥È¤ò²òÀϤ¹¤ë
-     *
-     *  @access private
-     *  @param  string  $script ¥Õ¥¡¥¤¥ë̾
-     *  @return array   ¥Ó¥å¡¼¥¯¥é¥¹ÄêµÁ°ìÍ÷
-     */
-    function __analyzeViewScript($script)
-    {
-        $class_list = array();
-
-        $source = "";
-        $fp = fopen($script, 'r');
-        if ($fp == false) {
-            return null;
-        }
-        while (feof($fp) == false) {
-            $source .= fgets($fp, 8192);
-        }
-        fclose($fp);
-
-        // ¥È¡¼¥¯¥ó¤Ëʬ³ä¤·¤Æ¥¯¥é¥¹ÄêµÁ¾ðÊó¤ò¼èÆÀ
-        $token_list = token_get_all($source);
-        for ($i = 0; $i < count($token_list); $i++) {
-            $token = $token_list[$i];
-
-            if ($token[0] == T_CLASS) {
-                // ¥¯¥é¥¹ÄêµÁ³«»Ï
-                $i += 2;
-                $class_name = $token_list[$i][1];       // should be T_STRING
-                if ($this->_isSubclassOf($class_name, 'Ethna_ViewClass')) {
-                    $view_name = $this->viewClassToName($class_name);
-                    $class_list[$view_name] = array(
-                        'template_file' => $this->ctl->_getForwardPath($view_name),
-                        'view_class' => $class_name,
-                        'view_class_file' => $this->ctl->getDefaultViewPath($view_name),
-                    );
-                }
-            }
-        }
-
-        if (count($class_list) == 0) {
-            return null;
-        }
-        return $class_list;
-    }
-
-    /**
-     *  ¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Î¥Ó¥å¡¼¥¹¥¯¥ê¥×¥È¤ò²òÀϤ¹¤ë
-     *
-     *  @access private
-     *  @param  string  $action_dir     ²òÀÏÂоݤΥǥ£¥ì¥¯¥È¥ê
-     *  @return array   ¥Ó¥å¡¼¥¯¥é¥¹ÄêµÁ°ìÍ÷
-     */
-    function __analyzeViewList($view_dir = null)
-    {
-        $r = array();
-
-        if (is_null($view_dir)) {
-            $view_dir = $this->ctl->getViewdir();
-        }
-        $prefix_len = strlen($this->ctl->getViewdir());
-
-        $ext = '.' . $this->ctl->getExt('php');
-        $ext_len = strlen($ext);
-
-        $dh = opendir($view_dir);
-        if ($dh) {
-            while (($file = readdir($dh)) !== false) {
-                $path = "$view_dir/$file";
-                if ($file != '.' && $file != '..' && is_dir($path)) {
-                    $tmp = $this->__analyzeViewList($path);
-                    $r = array_merge($r, $tmp);
-                    continue;
-                }
-                if (substr($file, -$ext_len, $ext_len) != $ext) {
-                    continue;
-                }
-
-                include_once($path);
-                $class_list = $this->__analyzeViewScript($path);
-                if (is_null($class_list) == false) {
-                    $r = array_merge($r, $class_list);
-                }
-            }
-        }
-        closedir($dh);
-
-        return $r;
-    }
-
-    /**
-     *  ÄêµÁºÑ¤ß¥Ó¥å¡¼°ìÍ÷¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return array   ¥Ó¥å¡¼°ìÍ÷
-     */
-    function _getViewList()
-    {
-        $im =& new Ethna_InfoManager($this->backend);
-//        $view_class_list = array_keys($im->getForwardList());
-
-        $r = array();
-
-        // ¥Æ¥ó¥×¥ì¡¼¥È/¥Ó¥å¡¼¥¹¥¯¥ê¥×¥È¤ò²òÀϤ¹¤ë
-        $forward_list = $im->_analyzeForwardList();
-        $view_list = $this->__analyzeViewList();
-
-        // ¥Ó¥å¡¼ÄêµÁ¥¨¥ó¥È¥ê°ìÍ÷
-        $manifest_forward_list = $im->_getForwardList_Manifest($forward_list);
-
-        // ¥Ó¥å¡¼ÄêµÁ¾Êά¥¨¥ó¥È¥ê°ìÍ÷
-        $implicit_forward_list = $im->_getForwardList_Implicit($forward_list, $manifest_forward_list);
-
-        $r = array_merge($view_list, $manifest_forward_list, $implicit_forward_list);
-        ksort($r);
-
-        return $r;
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¥Æ¥¹¥È¥¯¥é¥¹¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @return array
-     */
-    function _getTestAction()
-    {
-        $action_class_list = array_keys($this->_getActionList());
-
-        // ¥Æ¥¹¥È¤Î¸ºß¤¹¤ë¥¢¥¯¥·¥ç¥ó
-        foreach ($action_class_list as $key => $action_name) {
-            $action_class = $this->ctl->getDefaultActionClass($action_name, false).'_TestCase';
-            if (!class_exists($action_class)) {
-                unset($action_class_list[$key]);
-            }
-        }
-
-        return $action_class_list;
-    }
-
-    /**
-     *  ¥Ó¥å¡¼¥Æ¥¹¥È¥¯¥é¥¹¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @return array
-     */
-    function _getTestView()
-    {
-        $view_class_list = array_keys($this->_getViewList());
-
-        // ¥Æ¥¹¥È¤Î¸ºß¤¹¤ë¥Ó¥å¡¼
-        foreach ($view_class_list as $key => $view_name) {
-            $view_class = $this->ctl->getDefaultViewClass($view_name, false).'_TestCase';
-            if (!class_exists($view_class)) {
-                unset($view_class_list[$key]);
-            }
-        }
-
-        return $view_class_list;
-    }
-
-    /**
-     *  ¥æ¥Ë¥Ã¥È¥Æ¥¹¥È¤ò¼Â¹Ô¤¹¤ë
-     *
-     *  @access private
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function run()
-    {
-        $action_class_list = $this->_getTestAction();
-        $view_class_list = $this->_getTestView();
-
-        $test =& new GroupTest("Ethna UnitTest");
-
-        // ¥¢¥¯¥·¥ç¥ó
-        foreach ($action_class_list as $action_name) {
-            $action_class = $this->ctl->getDefaultActionClass($action_name, false).'_TestCase';
-            $action_form = $this->ctl->getDefaultFormClass($action_name, false).'_TestCase';
-
-            $test->addTestCase(new $action_class($this->ctl));
-            $test->addTestCase(new $action_form($this->ctl));
-        }
-
-        // ¥Ó¥å¡¼
-        foreach ($view_class_list as $view_name) {
-            $view_class = $this->ctl->getDefaultViewClass($view_name, false).'_TestCase';
-
-            $test->addTestCase(new $view_class($this->ctl));
-        }
-
-        // °ìÈÌ
-        foreach ($this->testcase as $class_name => $file_name) {
-            $dir = $this->ctl->getBasedir().'/';
-            include_once $dir . $file_name;
-            $testcase_name = $class_name.'_TestCase';
-            $test->addTestCase(new $testcase_name($this->ctl));
-        }
-
-        // ActionForm¤Î¥Ð¥Ã¥¯¥¢¥Ã¥×
-        $af =& $this->ctl->getActionForm();
-
-        //½ÐÎϤ·¤¿¤¤·Á¼°¤Ë¤¢¤ï¤»¤ÆÀÚ¤êÂؤ¨¤ë
-        $reporter = new Ethna_UnitTestReporter();
-        $test->run($reporter);
-
-        // ActionForm¤Î¥ê¥¹¥È¥¢
-        $this->ctl->action_form =& $af;
-        $this->backend->action_form =& $af;
-        $this->backend->af =& $af;
-
-        return array($reporter->report, $reporter->result);
-    }
-}
-?>
diff --git a/class/Ethna_UnitTestReporter.php b/class/Ethna_UnitTestReporter.php
deleted file mode 100644 (file)
index 0474cad..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-<?php
-/**
- *  Ethna_UnitTestReporter.php
- *
- *  @author     Takuya Ookubo <sfio@sakura.ai.to>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-require_once 'simpletest/scorer.php';
-
-/**
- *  Ethna¥Þ¥Í¡¼¥¸¥ã¥¯¥é¥¹
- *
- *  @author     Takuya Ookubo <sfio@sakura.ai.to>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_UnitTestReporter extends SimpleReporter {
-    
-    var $_character_set;
-
-    var $report;
-    var $result;
-
-    /**
-     *  Ethna_UnitTestReporter¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  string  $character_set  ¥­¥ã¥é¥¯¥¿¥»¥Ã¥È
-     */
-    function Ethna_UnitTestReporter($character_set = 'EUC-JP')
-    {
-        $this->SimpleReporter();
-        $this->_character_set = $character_set;
-        $this->report= array();
-        $this->result= array();
-    }
-
-    /**
-     *  ·ë²Ì
-     *
-     *  @access public
-     *  @param string   $test_name  ¥Æ¥¹¥È̾¾Î
-     */
-    function paintFooter($test_name)
-    {
-        $colour = ($this->getFailCount() + $this->getExceptionCount() > 0 ? "red" : "green");
-        $this->result = array(
-            'TestCaseProgress' => $this->getTestCaseProgress(),
-            'TestCaseCount' => $this->getTestCaseCount(),
-            'PassCount' => $this->getPassCount(),
-            'FailCount' => $this->getFailCount(),
-            'ExceptionCount' => $this->getExceptionCount(),
-        );
-    }
-
-    /**
-     *  ¥Ñ¥¹
-     *
-     *  @access public
-     *¡¡@param string   $message    ¥á¥Ã¥»¡¼¥¸
-     */
-    function paintPass($message)
-    {
-        parent::paintPass($message);
-            
-        $test_list = $this->getTestList();
-        $this->report[] = array(
-            'type' => 'Pass',
-            'test' => $test_list[2],
-            'message' => $message,
-        );
-    }
-
-    /**
-     *  ¼ºÇÔ
-     *
-     *  @access public
-     *¡¡@param string   $message    ¥á¥Ã¥»¡¼¥¸
-     */
-    function paintFail($message)
-    {
-        parent::paintFail($message);
-
-        $test_list = $this->getTestList();
-        $this->report[] = array(
-            'type' => 'Fail',
-            'test' => $test_list[2],
-            'message' => $message,
-        );
-    }
-
-    /**
-     *  Îã³°
-     *
-     *  @access public
-     *¡¡@param string   $message    ¥á¥Ã¥»¡¼¥¸
-     */
-    function paintException($message)
-    {
-        parent::paintException($message);
-
-        $breadcrumb = $this->getTestList();
-        $test = $breadcrumb[2];
-        array_shift($breadcrumb);
-        $this->report[] = array(
-            'type' => 'Exception',
-            'test' => $test,
-            'breadcrumb' => $breadcrumb,
-            'message' => $message,
-        );
-    }
-
-    /**
-     *  ¥Æ¥¹¥È¥±¡¼¥¹³«»Ï
-     *
-     *  @access public
-     *  @param string   $test_name  ¥Æ¥¹¥È̾¾Î
-     */
-    function paintCaseStart($test_name)
-    {
-        parent::paintCaseStart($test_name);
-
-        $this->report[] = array(
-            'type' => 'CaseStart',
-            'test_name' => $test_name,
-        );
-    }
-
-    /**
-     *  ¥Æ¥¹¥È¥±¡¼¥¹½ªÎ»
-     *
-     *  @access public
-     *  @param string   $test_name  ¥Æ¥¹¥È̾¾Î
-     */
-    function paintCaseEnd($test_name)
-    {
-        parent::paintCaseEnd($test_name);
-
-        $this->report[] = array(
-            'type' => 'CaseEnd',
-        );
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥Þ¥Ã¥ÈºÑ¤ß¥á¥Ã¥»¡¼¥¸
-     *
-     *  @access public
-     *¡¡@param string   $message    ¥á¥Ã¥»¡¼¥¸
-     */
-    function paintFormattedMessage($message)
-    {
-        $this->report[] = array(
-            'type' => 'FormattedMessage',
-            'message' => $this->_htmlEntities($message),
-        );
-    }
-
-    /**
-     *  HTML¥¨¥ó¥Æ¥£¥Æ¥£ÊÑ´¹
-     *
-     *¡¡@access protected
-     *¡¡@param string   $message    ¥×¥ì¡¼¥ó¥Æ¥­¥¹¥È
-     *¡¡@return string              HTML¥¨¥ó¥Æ¥£¥Æ¥£ÊÑ´¹ºÑ¤ß¥á¥Ã¥»¡¼¥¸
-     */
-    function _htmlEntities($message)
-    {
-        return htmlentities($message, ENT_COMPAT, $this->_character_set);
-    }
-}
-?>
diff --git a/class/Ethna_UrlHandler.php b/class/Ethna_UrlHandler.php
deleted file mode 100644 (file)
index f4a58d3..0000000
+++ /dev/null
@@ -1,400 +0,0 @@
-<?php
-// vim: foldmethod=marker tabstop=4 shiftwidth=4 autoindent
-/**
- *  Ethna_UrlHandler.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @package    Ethna
- *  @version    $Id$
- */
-
-/**
- *  URL¥Ï¥ó¥É¥é¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_UrlHandler
-{
-    /** @var    array   ¥¢¥¯¥·¥ç¥ó¥Þ¥Ã¥Ô¥ó¥° */
-    var $action_map = array(
-        /*
-         * 'user'   => array(
-         *  'user_login' => array(
-         *      'path'          => 'login',
-         *      'path_regexp'   => false,
-         *      'path_ext'      => false,
-         *      'option'        => array(),
-         *  ),
-         * ),
-         */
-    );
-
-    /**
-     *  Ethna_UrlHandler¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     */
-    function Ethna_UrlHandler()
-    {
-    }
-
-    /**
-     *  Ethna_UrlHandler¥¯¥é¥¹¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤ò¼èÆÀ¤¹¤ë
-     *
-     *  $name ¤¬¥¯¥é¥¹Ì¾ ('_'¤ò´Þ¤à) ¤Î¾ì¹ç¤Ï¤½¤Î¥¯¥é¥¹¤ò¡¢
-     *  ¤½¤¦¤Ç¤Ê¤¤¤È¤­¤Ï¥×¥é¥°¥¤¥ó̾¤È¤ß¤Ê¤·¤Æ¥¤¥ó¥¹¥¿¥ó¥¹¤òÊÖ¤¹
-     *
-     *  @access public
-     */
-    function &getInstance($name = null)
-    {
-        static $instance = array();
-        if ($name === null) {
-            $name = __CLASS__;
-        }
-        if (isset($instance[$name])) {
-            return $instance[$name];
-        }
-
-        if (strpos($name, '_') !== false) {
-            $instance[$name] = &new $name();
-        } else {
-            // get instance with plugin
-            $ctl = &Ethna_Controller::getInstance();
-            $plugin = &$ctl->getPlugin();
-            $instance[$name] = &$plugin->getPlugin('Urlhandler', $name);
-        }
-
-        return $instance[$name];
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¤ò¥æ¡¼¥¶¥ê¥¯¥¨¥¹¥È¤ËÊÑ´¹¤¹¤ë
-     *
-     *  @access public
-     */
-    function actionToRequest($action, $param)
-    {
-        $url_handler = null;
-        $action_value = null;
-        foreach ($this->action_map as $key => $value) {
-            if (isset($value[$action])) {
-                $url_handler = $key;
-                $action_value = $value[$action];
-                break;
-            }
-        }
-        if (is_null($url_handler)) {
-            return null;
-        }
-
-        // url_handler specific path
-        $method = sprintf("_getPath_%s", ucfirst($url_handler));
-        if (method_exists($this, $method) === false) {
-            return null;
-        }
-        list($path, $path_key) = $this->$method($action, $param);
-        if ($path == "") {
-            return null;
-        }
-
-        // append action path
-        if ($action_value['path']) {
-            $path .= "/" . $action_value['path'];
-        }
-
-        // path_ext candidate list
-        if (is_array($action_value['path_regexp'])) {
-            // try most matcher
-            $tmp = array_map('count', $action_value['path_ext']);
-            arsort($tmp);
-            $path_ext_list_indices = array_keys($tmp);
-            $path_ext_list = $action_value['path_ext'];
-        } else {
-            $path_ext_list_indices = array(0);
-            $path_ext_list = array(0 => $action_value['path_ext']);
-        }
-
-        // fix path_ext to use
-        foreach ($path_ext_list_indices as $index) {
-            if (is_array($path_ext_list[$index]) === false) {
-                // no parameters needed.
-                $path_ext = $path_ext_list[$index];
-                break;
-            }
-            $path_ext_match = true;
-            foreach ($path_ext_list[$index] as $key => $value) {
-                if (isset($param[$key]) === false) {
-                    $path_ext_match = false;
-                    break;
-                }
-            }
-            if ($path_ext_match) {
-                $path_ext = $path_ext_list[$index];
-                break;
-            }
-        }
-        if (isset($path_ext) === false) {
-            return null;
-        }
-
-        // append extra parameters to path.
-        if (is_array($path_ext)) {
-            foreach ($path_ext as $key => $value) {
-                $path_key[] = $key;
-                $ext_param = $param[$key];
-
-                // output filter
-                if (isset($value['output_filter']) && $value['output_filter'] != "") {
-                    $method = $value['output_filter'];
-                    if (method_exists($this, $method)) {
-                        $ext_param = $this->$method($ext_param);
-                    }
-                }
-
-                // remove form (pre|suf)fix
-                if (isset($value['form_prefix']) && $value['form_prefix'] != "") {
-                    $s = $value['form_prefix'];
-                    if (substr($ext_param, 0, strlen($s)) == $s) {
-                        $ext_param = substr($ext_param, strlen($s));
-                    }
-                }
-                if (isset($value['form_suffix']) && $value['form_suffix'] != "") {
-                    $s = $value['form_suffix'];
-                    if (substr($ext_param, -strlen($s)) == $s) {
-                        $ext_param = substr($ext_param, 0, -strlen($s));
-                    }
-                }
-
-                // rawurlencode (url (pre|suf)fixes need not to be encoded.)
-                $ext_param = rawurlencode($ext_param);
-
-                // add url (pre|suf)fix
-                if (isset($value['url_prefix']) && $value['url_prefix'] != "") {
-                    $ext_param = $value['url_prefix'] . $ext_param;
-                }
-                if (isset($value['url_suffix']) && $value['url_suffix'] != "") {
-                    $ext_param = $ext_param . $value['url_suffix'];
-                }
-
-                $path .= '/' . $ext_param;
-            }
-        }
-
-        list($path, $is_slash) = $this->_normalizePath($path);
-        return array($path, $path_key);
-    }
-
-    /**
-     *  ¥æ¡¼¥¶¥ê¥¯¥¨¥¹¥È¤ò¥¢¥¯¥·¥ç¥ó¤ËÊÑ´¹¤¹¤ë
-     *
-     *  @access public
-     */
-    function requestToAction($http_vars)
-    {
-        if (isset($http_vars['__url_handler__']) == false
-            || isset($this->action_map[$http_vars['__url_handler__']]) == false) {
-            return array();
-        }
-
-        $url_handler = $http_vars['__url_handler__'];
-        $action_map = $this->action_map[$url_handler];
-
-        // parameter fix
-        $method = sprintf("_normalizeRequest_%s", ucfirst($url_handler));
-        if (method_exists($this, $method)) {
-            $http_vars = $this->$method($http_vars);
-        }
-
-        // normalize
-        if (isset($http_vars['__url_info__'])) {
-            $path = $http_vars['__url_info__'];
-        } else {
-            $path = "";
-        }
-        list($path, $is_slash) = $this->_normalizePath($path);
-
-        // match
-        $action = null;
-        $action_value = null;
-        $action_match = null;
-        $action_regexp_index = null;
-        foreach ($action_map as $key => $value) {
-            $match_length = strlen($value['path']);
-
-            // check necessary match
-            if (strncmp($path, $value['path'], $match_length) != 0) {
-                continue;
-            }
-
-            // try exact match
-            if ($path == $value['path']) {
-                $action = $key;
-                break;
-            }
-
-            // continue in case w/ incomplete match
-            if ($path != "" && $match_length > 0 && $path{$match_length} != "/") {
-                continue;
-            }
-            if ($is_slash && $path{strlen($path)-1} == "/") {
-                continue;
-            }
-
-            // try regexp
-            if ($value['path_regexp']) {
-                if (is_array($value['path_regexp'])) {
-                    foreach ($value['path_regexp'] as $index => $regexp) {
-                        if (preg_match($regexp, $path, $tmp)) {
-                            $action = $key;
-                            $action_match = $tmp;
-                            $action_regexp_index = $index;
-                            break;
-                        }
-                    }
-                } else {
-                    if (preg_match($value['path_regexp'], $path, $tmp)) {
-                        $action = $key;
-                        $action_match = $tmp;
-                        break;
-                    }
-                }
-            }
-        }
-        if (is_null($action)) {
-            return array();
-        }
-        $action_value = $action_map[$action];
-
-        // build parameters
-        $http_vars = $this->buildActionParameter($http_vars, $action);
-
-        // extra parameters
-        $path_ext = is_null($action_regexp_index)
-                    ? $action_value['path_ext']
-                    : $action_value['path_ext'][$action_regexp_index];
-        if (is_array($path_ext) && is_array($action_match)) {
-            $n = 1;
-            foreach ($path_ext as $key => $value) {
-                if (isset($action_match[$n]) == false) {
-                    break;
-                }
-
-                // remove url (pre|suf)fix
-                if (isset($value['url_prefix']) && $value['url_prefix'] != "") {
-                    $s = $value['url_prefix'];
-                    if (substr($action_match[$n], 0, strlen($s)) == $s) {
-                        $action_match[$n] = substr($action_match[$n], strlen($s));
-                    }
-                }
-                if (isset($value['url_suffix']) && $value['url_suffix'] != "") {
-                    $s = $value['url_suffix'];
-                    if (substr($action_match[$n], -strlen($s)) == $s) {
-                        $action_match[$n] = substr($action_match[$n], 0, -strlen($s));
-                    }
-                }
-
-                // add form (pre|suf)fix
-                if (isset($value['form_prefix']) && $value['form_prefix'] != "") {
-                    $action_match[$n] = $value['form_prefix'] . $action_match[$n];
-                }
-                if (isset($value['form_suffix']) && $value['form_suffix'] != "") {
-                    $action_match[$n] = $action_match[$n] . $value['form_suffix'];
-                }
-
-                // input filter
-                if (isset($value['input_filter']) && $value['input_filter'] != "") {
-                    $method = $value['input_filter'];
-                    if (method_exists($this, $method)) {
-                        $action_match[$n] = $this->$method($action_match[$n]);
-                    }
-                }
-
-                $http_vars[$key] = $action_match[$n];
-                $n++;
-            }
-        }
-
-        return $http_vars;
-    }
-
-    /**
-     *  ¥²¡¼¥È¥¦¥§¥¤¥Ñ¥¹¤òÀµµ¬²½¤¹¤ë
-     *
-     *  @access private
-     */
-    function _normalizePath($path)
-    {
-        if ($path == "") {
-            return array($path, false);
-        }
-
-        $is_slash = false;
-        $path = preg_replace('|/+|', '/', $path);
-
-        if ($path{0} == '/') {
-            $path = substr($path, 1);
-        }
-        if ($path{strlen($path)-1} == '/') {
-            $path = substr($path, 0, strlen($path)-1);
-            $is_slash = true;
-        }
-
-        return array($path, $is_slash);
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¤ò¥ê¥¯¥¨¥¹¥È¥Ñ¥é¥á¡¼¥¿¤ËÊÑ´¹¤¹¤ë
-     *
-     *  @access public
-     */
-    function buildActionParameter($http_vars, $action)
-    {
-        if ($action == "") {
-            return $http_vars;
-        }
-        $key = sprintf('action_%s', $action);
-        $http_vars[$key] = 'true';
-        return $http_vars;
-    }
-
-    /**
-     *  ¥Ñ¥é¥á¡¼¥¿¤òURL¤ËÊÑ´¹¤¹¤ë
-     *
-     *  @access public
-     */
-    function buildQueryParameter($query)
-    {
-        $param = '';
-
-        foreach ($query as $key => $value) {
-            if (is_array($value)) {
-                foreach ($value as $k => $v) {
-                    if (is_numeric($k)) {
-                        $k = '';
-                    }
-                    $param .= sprintf('%s=%s&',
-                                      urlencode(sprintf('%s[%s]', $key, $k)),
-                                      urlencode($v));
-                }
-            } else if (is_null($value) == false) {
-                $param .= sprintf('%s=%s&', urlencode($key), urlencode($value));
-            }
-        }
-
-        return substr($param, 0, -1);
-    }
-
-    // {{{ ¥²¡¼¥È¥¦¥§¥¤¥ê¥¯¥¨¥¹¥ÈÀµµ¬²½
-    // }}}
-
-    // {{{ ¥²¡¼¥È¥¦¥§¥¤¥Ñ¥¹À¸À®
-    // }}}
-
-    // {{{ ¥Õ¥£¥ë¥¿
-    // }}}
-}
-
-?>
diff --git a/class/Ethna_Util.php b/class/Ethna_Util.php
deleted file mode 100644 (file)
index 079413d..0000000
+++ /dev/null
@@ -1,928 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Util.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ to_array
-/**
- *  ¥°¥í¡¼¥Ð¥ë¥æ¡¼¥Æ¥£¥ê¥Æ¥£´Ø¿ô: ¥¹¥«¥é¡¼ÃͤòÍ×ÁÇ¿ô1¤ÎÇÛÎó¤È¤·¤ÆÊÖ¤¹
- *
- *  @param  mixed   $v  ÇÛÎó¤È¤·¤Æ°·¤¦ÃÍ
- *  @return array   ÇÛÎó¤ËÊÑ´¹¤µ¤ì¤¿ÃÍ
- */
-function to_array($v)
-{
-    if (is_array($v)) {
-        return $v;
-    } else {
-        return array($v);
-    }
-}
-// }}}
-
-// {{{ is_error
-/**
- *  ¥°¥í¡¼¥Ð¥ë¥æ¡¼¥Æ¥£¥ê¥Æ¥£´Ø¿ô: »ØÄꤵ¤ì¤¿¥Õ¥©¡¼¥à¹àÌܤ˥¨¥é¡¼¤¬¤¢¤ë¤«¤É¤¦¤«¤òÊÖ¤¹
- *
- *  @param  string  $name   ¥Õ¥©¡¼¥à¹àÌÜ̾
- *  @return bool    true:¥¨¥é¡¼Í­¤ê false:¥¨¥é¡¼Ìµ¤·
- */
-function is_error($name = null)
-{
-    $c =& Ethna_Controller::getInstance();
-    $action_error =& $c->getActionError();
-    if ($name !== null) {
-        return $action_error->isError($name);
-    } else {
-        return $action_error->count() > 0;
-    }
-}
-// }}}
-
-// {{{ file_exists_ex
-/**
- *  ¥°¥í¡¼¥Ð¥ë¥æ¡¼¥Æ¥£¥ê¥Æ¥£´Ø¿ô: include_path¤ò¸¡º÷¤·¤Ä¤Äfile_exists()¤¹¤ë
- *
- *  @param  string  $path               ¥Õ¥¡¥¤¥ë̾
- *  @param  bool    $use_include_path   include_path¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤«¤É¤¦¤«
- *  @return bool    true:Í­¤ê false:̵¤·
- */
-function file_exists_ex($path, $use_include_path = true)
-{
-    if ($use_include_path == false) {
-        return file_exists($path);
-    }
-
-    // check if absolute
-    if (is_absolute_path($path)) {
-        return file_exists($path);
-    }
-
-    $include_path_list = explode(PATH_SEPARATOR, get_include_path());
-    if (is_array($include_path_list) == false) {
-        return file_exists($path);
-    }
-
-    foreach ($include_path_list as $include_path) {
-        if (file_exists($include_path . DIRECTORY_SEPARATOR . $path)) {
-            return true;
-        }
-    }
-    return false;
-}
-// }}}
-
-// {{{ is_absolute_path
-/**
- *  ¥°¥í¡¼¥Ð¥ë¥æ¡¼¥Æ¥£¥ê¥Æ¥£´Ø¿ô: ÀäÂХѥ¹¤«¤É¤¦¤«¤òÊÖ¤¹
- *
- *  @param  string  $path               ¥Õ¥¡¥¤¥ë̾
- *  @return bool    true:ÀäÂРfalse:ÁêÂÐ
- */
-function is_absolute_path($path)
-{
-    if (OS_WINDOWS) {
-        if (preg_match('/^[a-z]:/i', $path) && $path{2} == DIRECTORY_SEPARATOR) {
-            return true;
-        }
-    } else {
-        if ($path{0} == DIRECTORY_SEPARATOR) {
-            return true;
-        }
-    }
-    return false;
-}
-// }}}
-
-// {{{ Ethna_Util
-/**
- *  ¥æ¡¼¥Æ¥£¥ê¥Æ¥£¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Util
-{
-    // {{{ isDuplicatePost
-    /**
-     *  POST¤Î¥æ¥Ë¡¼¥¯¥Á¥§¥Ã¥¯¤ò¹Ô¤¦
-     *
-     *  @access public
-     *  @return bool    true:2²óÌܰʹߤÎPOST false:1²óÌܤÎPOST
-     */
-    function isDuplicatePost()
-    {
-        $c =& Ethna_Controller::getInstance();
-
-        // use raw post data
-        if (isset($_POST['uniqid'])) {
-            $uniqid = $_POST['uniqid'];
-        } else if (isset($_GET['uniqid'])) {
-            $uniqid = $_GET['uniqid'];
-        } else {
-            return false;
-        }
-
-        // purge old files
-        Ethna_Util::purgeTmp("uniqid_", 60*60*1);
-
-        $filename = sprintf("%s/uniqid_%s_%s",
-                            $c->getDirectory('tmp'),
-                            $_SERVER['REMOTE_ADDR'],
-                            $uniqid);
-        if (file_exists($filename) == false) {
-            touch($filename);
-            return false;
-        }
-
-        $st = stat($filename);
-        if ($st[9] + 60*60*1 < time()) {
-            // too old
-            return false;
-        }
-
-        return true;
-    }
-    // }}}
-
-    // {{{ clearDuplicatePost
-    /**
-     *  POST¤Î¥æ¥Ë¡¼¥¯¥Á¥§¥Ã¥¯¥Õ¥é¥°¤ò¥¯¥ê¥¢¤¹¤ë
-     *
-     *  @acccess public
-     *  @return mixed   0:Àµ¾ï½ªÎ» Ethna_Error:¥¨¥é¡¼
-     */
-    function clearDuplicatePost()
-    {
-        $c =& Ethna_Controller::getInstance();
-
-        // use raw post data
-        if (isset($_POST['uniqid'])) {
-            $uniqid = $_POST['uniqid'];
-        } else {
-            return 0;
-        }
-
-        $filename = sprintf("%s/uniqid_%s_%s",
-                            $c->getDirectory('tmp'),
-                            $_SERVER['REMOTE_ADDR'],
-                            $uniqid);
-        if (file_exists($filename)) {
-            if (unlink($filename) == false) {
-                return Ethna::raiseWarning("¥Õ¥¡¥¤¥ë½ñ¤­¹þ¤ß¥¨¥é¡¼[%s]", E_APP_WRITE, $filename);
-            }
-        }
-
-        return 0;
-    }
-    // }}}
-
-    // {{{ isCsrfSafeValid
-    /**
-     *  CSRF¤ò¥Á¥§¥Ã¥¯¤¹¤ë
-     *
-     *  @access public
-     *  @return bool    true:Àµ¾ï¤ÊPOST false:ÉÔÀµ¤ÊPOST
-     */
-    function isCsrfSafe()
-    {
-        $c =& Ethna_Controller::getInstance();
-        $name = $c->config->get('csrf');
-        
-        if (is_null($name)) {
-            $name = 'Session';
-        }
-        
-        $plugin =& $c->getPlugin('Csrf', $name);
-        $csrf =& $plugin->getPlugin('Csrf', $name);
-        return $csrf->isValid();
-    }
-    // }}}
-
-    // {{{ setCsrfID
-    /**
-     *  CSRF¤ò¥Á¥§¥Ã¥¯¤¹¤ë
-     *
-     *  @access public
-     *  @return bool    true:À®¸ù
-     */
-    function setCsrfID()
-    {
-        $c =& Ethna_Controller::getInstance();
-        $name = $c->config->get('csrf');
-        
-        if (is_null($name)) {
-            $name = 'Session';
-        }
-        
-        $plugin =& $c->getPlugin('Csrf', $name);
-        $csrf =& $plugin->getPlugin('Csrf', $name);
-        return $csrf->set();
-    }
-    // }}}
-
-    // {{{ checkMailAddress
-    /**
-     *  ¥á¡¼¥ë¥¢¥É¥ì¥¹¤¬Àµ¤·¤¤¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $mailaddress    ¥Á¥§¥Ã¥¯¤¹¤ë¥á¡¼¥ë¥¢¥É¥ì¥¹
-     *  @return bool    true: Àµ¤·¤¤¥á¡¼¥ë¥¢¥É¥ì¥¹ false: ÉÔÀµ¤Ê·Á¼°
-     */
-    function checkMailAddress($mailaddress)
-    {
-        if (preg_match('/^([a-z0-9_]|\-|\.|\+)+@(([a-z0-9_]|\-)+\.)+[a-z]{2,6}$/i',
-                       $mailaddress)) {
-            return true;
-        }
-        return false;
-    }
-    // }}}
-
-    // {{{ explodeCSV
-    /**
-     *  CSV·Á¼°¤Îʸ»úÎó¤òÇÛÎó¤Ëʬ³ä¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $csv        CSV·Á¼°¤Îʸ»úÎó(1¹Ôʬ)
-     *  @param  string  $delimiter  ¥Õ¥£¡¼¥ë¥É¤Î¶èÀÚ¤êʸ»ú
-     *  @return mixed   (array):ʬ³ä·ë²Ì Ethna_Error:¥¨¥é¡¼(¹Ô·Ñ³)
-     */
-    function explodeCSV($csv, $delimiter = ",")
-    {
-        $space_list = '';
-        foreach (array(" ", "\t", "\r", "\n") as $c) {
-            if ($c != $delimiter) {
-                $space_list .= $c;
-            }
-        }
-
-        $line_end = "";
-        if (preg_match("/([$space_list]+)\$/sS", $csv, $match)) {
-            $line_end = $match[1];
-        }
-        $csv = substr($csv, 0, strlen($csv)-strlen($line_end));
-        $csv .= ' ';
-
-        $field = '';
-        $retval = array();
-
-        $index = 0;
-        $csv_len = strlen($csv);
-        do {
-            // 1. skip leading spaces
-            if (preg_match("/^([$space_list]+)/sS", substr($csv, $index), $match)) {
-                $index += strlen($match[1]);
-            }
-            if ($index >= $csv_len) {
-                break;
-            }
-
-            // 2. read field
-            if ($csv{$index} == '"') {
-                // 2A. handle quote delimited field
-                $index++;
-                while ($index < $csv_len) {
-                    if ($csv{$index} == '"') {
-                        // handle double quote
-                        if ($csv{$index+1} == '"') {
-                            $field .= $csv{$index};
-                            $index += 2;
-                        } else {
-                            // must be end of string
-                            while ($csv{$index} != $delimiter && $index < $csv_len) {
-                                $index++;
-                            }
-                            if ($csv{$index} == $delimiter) {
-                                $index++;
-                            }
-                            break;
-                        }
-                    } else {
-                        // normal character
-                        if (preg_match("/^([^\"]*)/S", substr($csv, $index), $match)) {
-                            $field .= $match[1];
-                            $index += strlen($match[1]);
-                        }
-
-                        if ($index == $csv_len) {
-                            $field = substr($field, 0, strlen($field)-1);
-                            $field .= $line_end;
-
-                            // request one more line
-                            return Ethna::raiseNotice('CSVʬ³ä¥¨¥é¡¼(¹Ô·Ñ³)', E_UTIL_CSV_CONTINUE);
-                        }
-                    }
-                }
-            } else {
-                // 2B. handle non-quoted field
-                if (preg_match("/^([^$delimiter]*)/S", substr($csv, $index), $match)) {
-                    $field .= $match[1];
-                    $index += strlen($match[1]);
-                }
-
-                // remove trailing spaces
-                $field = preg_replace("/[$space_list]+\$/S", '', $field);
-                if ($csv{$index} == $delimiter) {
-                    $index++;
-                }
-            }
-            $retval[] = $field;
-            $field = '';
-        } while ($index < $csv_len);
-
-        return $retval;
-    }
-    // }}}
-
-    // {{{ escapeCSV
-    /**
-     *  CSV¥¨¥¹¥±¡¼¥×½èÍý¤ò¹Ô¤¦
-     *
-     *  @access public
-     *  @param  string  $csv        ¥¨¥¹¥±¡¼¥×ÂоݤÎʸ»úÎó(CSV¤Î³ÆÍ×ÁÇ)
-     *  @param  bool    $escape_nl  ²þ¹Ôʸ»ú(\r/\n)¤Î¥¨¥¹¥±¡¼¥×¥Õ¥é¥°
-     *  @return string  CSV¥¨¥¹¥±¡¼¥×¤µ¤ì¤¿Ê¸»úÎó
-     */
-    function escapeCSV($csv, $escape_nl = false)
-    {
-        if (preg_match('/[,"\r\n]/', $csv)) {
-            if ($escape_nl) {
-                $csv = preg_replace('/\r/', "\\r", $csv);
-                $csv = preg_replace('/\n/', "\\n", $csv);
-            }
-            $csv = preg_replace('/"/', "\"\"", $csv);
-            $csv = "\"$csv\"";
-        }
-
-        return $csv;
-    }
-    // }}}
-
-    // {{{ escapeHtml
-    /**
-     *  ÇÛÎó¤ÎÍ×ÁǤòÁ´¤ÆHTML¥¨¥¹¥±¡¼¥×¤·¤ÆÊÖ¤¹
-     *
-     *  @access public
-     *  @param  array   $target     HTML¥¨¥¹¥±¡¼¥×ÂоݤȤʤëÇÛÎó
-     *  @return array   ¥¨¥¹¥±¡¼¥×¤µ¤ì¤¿ÇÛÎó
-     */
-    function escapeHtml($target)
-    {
-        $r = array();
-        Ethna_Util::_escapeHtml($target, $r);
-        return $r;
-    }
-
-    /**
-     *  ÇÛÎó¤ÎÍ×ÁǤòÁ´¤ÆHTML¥¨¥¹¥±¡¼¥×¤·¤ÆÊÖ¤¹
-     *
-     *  @access public
-     *  @param  mixed   $vars   HTML¥¨¥¹¥±¡¼¥×ÂоݤȤʤëÇÛÎó
-     *  @param  mixed   $retval HTML¥¨¥¹¥±¡¼¥×ÂоݤȤʤë»ÒÍ×ÁÇ
-     */
-    function _escapeHtml(&$vars, &$retval)
-    {
-        foreach (array_keys($vars) as $name) {
-            if (is_array($vars[$name])) {
-                $retval[$name] = array();
-                Ethna_Util::_escapeHtml($vars[$name], $retval[$name]);
-            } else if (!is_object($vars[$name])) {
-                $retval[$name] = htmlspecialchars($vars[$name], ENT_QUOTES);
-            }
-        }
-    }
-    // }}}
-
-    // {{{ encode_MIME
-    /**
-     *  Ê¸»úÎó¤òMIME¥¨¥ó¥³¡¼¥É¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $string     MIME¥¨¥ó¥³¡¼¥É¤¹¤ëʸ»úÎó
-     *  @return ¥¨¥ó¥³¡¼¥ÉºÑ¤ß¤Îʸ»úÎó
-     */
-    function encode_MIME($string)
-    {
-        $pos = 0;
-        $split = 36;
-        $_string = "";
-        while ($pos < mb_strlen($string))
-        {
-            $tmp = mb_strimwidth($string, $pos, $split, "");
-            $pos += mb_strlen($tmp);
-            $_string .= (($_string)? ' ' : '') . mb_encode_mimeheader($tmp, 'ISO-2022-JP');
-        }
-        return $_string;
-    }
-    // }}}
-
-    // {{{ getDirectLinkList
-    /**
-     *  GoogleÉ÷¥ê¥ó¥¯¥ê¥¹¥È¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @param  int     $total      ¸¡º÷Áí·ï¿ô
-     *  @param  int     $offset     É½¼¨¥ª¥Õ¥»¥Ã¥È
-     *  @param  int     $count      É½¼¨·ï¿ô
-     *  @return array   ¥ê¥ó¥¯¾ðÊó¤ò³ÊǼ¤·¤¿ÇÛÎó
-     */
-    function getDirectLinkList($total, $offset, $count)
-    {
-        $direct_link_list = array();
-
-        if ($total == 0) {
-            return array();
-        }
-
-        // backwards
-        $current = $offset - $count;
-        while ($current > 0) {
-            array_unshift($direct_link_list, $current);
-            $current -= $count;
-        }
-        if ($offset != 0 && $current <= 0) {
-            array_unshift($direct_link_list, 0);
-        }
-
-        // current
-        $backward_count = count($direct_link_list);
-        array_push($direct_link_list, $offset);
-
-        // forwards
-        $current = $offset + $count;
-        for ($i = 0; $i < 10; $i++) {
-            if ($current >= $total) {
-                break;
-            }
-            array_push($direct_link_list, $current);
-            $current += $count;
-        }
-        $forward_count = count($direct_link_list) - $backward_count - 1;
-
-        $backward_count -= 4;
-        if ($forward_count < 5) {
-            $backward_count -= 5 - $forward_count;
-        }
-        if ($backward_count < 0) {
-            $backward_count = 0;
-        }
-
-        // add index
-        $n = 1;
-        $r = array();
-        foreach ($direct_link_list as $direct_link) {
-            $v = array('offset' => $direct_link, 'index' => $n);
-            $r[] = $v;
-            $n++;
-        }
-
-        return array_splice($r, $backward_count, 10);
-    }
-    // }}}
-
-    // {{{ getEra
-    /**
-     *  ¸µ¹æÀ©¤Ç¤Îǯ¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @param  int     $t      unix time
-     *  @return string  ¸µ¹æ(ÉÔÌÀ¤Ê¾ì¹ç¤Ïnull)
-     */
-    function getEra($t)
-    {
-        $tm = localtime($t, true);
-        $year = $tm['tm_year'] + 1900;
-
-        if ($year >= 1989) {
-            return array('Ê¿À®', $year - 1988);
-        } else if ($year >= 1926) {
-            return array('¾¼ÏÂ', $year - 1925);
-        }
-
-        return null;
-    }
-    // }}}
-
-    // {{{ getImageExtName
-    /**
-     *  getimagesize()¤ÎÊÖ¤¹¥¤¥á¡¼¥¸¥¿¥¤¥×¤ËÂбþ¤¹¤ë³ÈÄ¥»Ò¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @param  int     $type   getimagesize()´Ø¿ô¤ÎÊÖ¤¹¥¤¥á¡¼¥¸¥¿¥¤¥×
-     *  @return string  $type¤ËÂбþ¤¹¤ë³ÈÄ¥»Ò
-     */
-    function getImageExtName($type)
-    {
-        $ext_list = array(
-            1   => 'gif',
-            2   => 'jpg',
-            3   => 'png',
-            4   => 'swf',
-            5   => 'psd',
-            6   => 'bmp',
-            7   => 'tiff',
-            8   => 'tiff',
-            9   => 'jpc',
-            10  => 'jp2',
-            11  => 'jpx',
-            12  => 'jb2',
-            13  => 'swc',
-            14  => 'iff',
-            15  => 'wbmp',
-            16  => 'xbm',
-        );
-
-        return @$ext_list[$type];
-    }
-    // }}}
-
-    // {{{ getRandom
-    /**
-     *  ¥é¥ó¥À¥à¤Ê¥Ï¥Ã¥·¥åÃͤòÀ¸À®¤¹¤ë
-     *
-     *  ·è¤·¤Æ¹â®¤Ç¤Ï¤Ê¤¤¤Î¤ÇÍðÍѤÏÈò¤±¤ë¤³¤È
-     *
-     *  @access public
-     *  @param  int     $length ¥Ï¥Ã¥·¥åÃͤÎŤµ(¡Á64)
-     *  @return string  ¥Ï¥Ã¥·¥åÃÍ
-     */
-    function getRandom($length = 64)
-    {
-        static $srand = false;
-
-        if ($srand == false) {
-            list($usec, $sec) = explode(' ', microtime());
-            mt_srand((float) $sec + ((float) $usec * 100000) + getmypid());
-            $srand = true;
-        }
-
-        $value = "";
-        for ($i = 0; $i < 2; $i++) {
-            // for Linux
-            if (file_exists('/proc/net/dev')) {
-                $rx = $tx = 0;
-                $fp = fopen('/proc/net/dev', 'r');
-                if ($fp != null) {
-                    $header = true;
-                    while (feof($fp) === false) {
-                        $s = fgets($fp, 4096);
-                        if ($header) {
-                            $header = false;
-                            continue;
-                        }
-                        $v = preg_split('/[:\s]+/', $s);
-                        if (is_array($v) && count($v) > 10) {
-                            $rx += $v[2];
-                            $tx += $v[10];
-                        }
-                    }
-                }
-                $platform_value = $rx . $tx . mt_rand() . getmypid();
-            } else {
-                $platform_value = mt_rand() . getmypid();
-            }
-            $now = strftime('%Y%m%d %T');
-            $time = gettimeofday();
-            $v = $now . $time['usec'] . $platform_value . mt_rand(0, time());
-            $value .= md5($v);
-        }
-
-        if ($length < 64) {
-            $value = substr($value, 0, $length);
-        }
-        return $value;
-    }
-    // }}}
-
-    // {{{ get2dArray
-    /**
-     *  1¼¡¸µÇÛÎó¤òm x n¤ËºÆ¹½À®¤¹¤ë
-     *
-     *  @access public
-     *  @param  array   $array  ½èÍýÂоݤÎ1¼¡¸µÇÛÎó
-     *  @param  int     $m      ¼´¤ÎÍ×ÁÇ¿ô
-     *  @param  int     $order  $m¤òX¼´¤È¸«Ðö¤¹¤«Y¼´¤È¸«Ðö¤¹¤«(0:X¼´ 1:Y¼´)
-     *  @return array   m x n¤ËºÆ¹½À®¤µ¤ì¤¿ÇÛÎó
-     */
-    function get2dArray($array, $m, $order)
-    {
-        $r = array();
-        
-        $n = intval(count($array) / $m);
-        if ((count($array) % $m) > 0) {
-            $n++;
-        }
-        for ($i = 0; $i < $n; $i++) {
-            $elts = array();
-            for ($j = 0; $j < $m; $j++) {
-                if ($order == 0) {
-                    // ²£Ê¤Ó(²£¡§$mÎó ½Ä¡§ÌµÀ©¸Â)
-                    $key = $i*$m+$j;
-                } else {
-                    // ½ÄʤÓ(²£¡§ÌµÀ©¸Â ½Ä¡§$m¹Ô)
-                    $key = $i+$n*$j;
-                }
-                if (array_key_exists($key, $array) == false) {
-                    $array[$key] = null;
-                }
-                $elts[] = $array[$key];
-            }
-            $r[] = $elts;
-        }
-
-        return $r;
-    }
-    // }}}
-
-    // {{{ isAbsolute
-    /**
-     *  ¥Ñ¥¹Ì¾¤¬ÀäÂХѥ¹¤«¤É¤¦¤«¤òÊÖ¤¹
-     *
-     *  port from File in PEAR (for BC)
-     *
-     *  @access public
-     *  @param  string  $path
-     *  @return bool    true:ÀäÂХѥ¹ false:ÁêÂХѥ¹
-     */
-    function isAbsolute($path)
-    {
-        if (preg_match("/\.\./", $path)) {
-            return false;
-        }
-
-        if (DIRECTORY_SEPARATOR == '/'
-            && (substr($path, 0, 1) == '/' || substr($path, 0, 1) == '~')) {
-            return true;
-        } else if (DIRECTORY_SEPARATOR == '\\' && preg_match('/^[a-z]:\\\/i', $path)) {
-            return true;
-        }
-
-        return false;
-    }
-    // }}}
-
-    // {{{ isRootDir
-    /**
-     *  ¥Ñ¥¹Ì¾¤¬¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤«¤É¤¦¤«¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @param  string  $path
-     *  @static
-     */
-    function isRootDir($path)
-    {
-        if ($path === DIRECTORY_SEPARATOR) {
-            // avoid stat().
-            return true;
-        }
-        if (is_dir($path) === false) {
-            return false;
-        }
-        return $path === basename($path) . DIRECTORY_SEPARATOR;
-    }
-    // }}}
-
-    // {{{ mkdir
-    /**
-     *  mkdir -p
-     *
-     *  @access public
-     *  @param  string  $dir    ºîÀ®¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê
-     *  @param  int     $mode   ¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó
-     *  @return bool    true:À®¸ù false:¼ºÇÔ
-     *  @static
-     */
-    function mkdir($dir, $mode)
-    {
-        if (file_exists($dir)) {
-            return is_dir($dir);
-        }
-
-        $parent = dirname($dir);
-        if ($dir === $parent) {
-            return true;
-        }
-
-        if (is_dir($parent) === false) {
-            if (Ethna_Util::mkdir($parent, $mode) === false) {
-                return false;
-            }
-        }
-
-        return mkdir($dir, $mode) && Ethna_Util::chmod($dir, $mode);
-    }
-    // }}}
-
-    // {{{ chmod
-    /**
-     *  ¥Õ¥¡¥¤¥ë¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤òÊѹ¹¤¹¤ë
-     */
-    function chmod($file, $mode)
-    {
-        $st = stat($file);
-        if (($st[2] & 0777) == $mode) {
-            return true;
-        }
-        return chmod($file, $mode);
-    }
-    // }}}
-
-    // {{{ purgeDir
-    /**
-     *  ¥Ç¥£¥ì¥¯¥È¥ê¤òºÆµ¢Åª¤Ëºï½ü¤¹¤ë
-     *  (ÅÓÃæ¤Ç¼ºÇÔ¤·¤Æ¤âÃæÃǤ»¤º¡¢ºï½ü¤Ç¤­¤ë¤â¤Î¤Ï¤¹¤Ù¤Æ¾Ã¤¹)
-     *
-     *  @access public
-     *  @param  string  $file   ºï½ü¤¹¤ë¥Õ¥¡¥¤¥ë¤Þ¤¿¤Ï¥Ç¥£¥ì¥¯¥È¥ê
-     *  @return bool    true:À®¸ù false:¼ºÇÔ
-     *  @static
-     */
-    function purgeDir($dir)
-    {
-        if (file_exists($dir) === false) {
-            return false;
-        }
-        if (is_dir($dir) === false) {
-            return unlink($dir);
-        }
-
-        $dh = opendir($dir);
-        if ($dh === false) {
-            return false;
-        }
-        $ret = true;
-        while (($entry = readdir($dh)) !== false) {
-            if ($entry === '.' || $entry === '..') {
-                continue;
-            }
-            $ret = $ret && Ethna_Util::purgeDir("{$dir}/{$entry}");
-        }
-        closedir($dh);
-        if ($ret) {
-            return rmdir($dir);
-        } else {
-            return false;
-        }
-    }
-    // }}}
-
-    // {{{ purgeTmp
-    /**
-     *  ¥Æ¥ó¥Ý¥é¥ê¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Õ¥¡¥¤¥ë¤òºï½ü¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $prefix     ¥Õ¥¡¥¤¥ë¤Î¥×¥ì¥Õ¥£¥¯¥¹
-     *  @param  int     $timeout    ºï½üÂоÝïçÃÍ(ÉáÝ60*60*1¤Ê¤é1»þ´Ö)
-     */
-    function purgeTmp($prefix, $timeout)
-    {
-        $c =& Ethna_Controller::getInstance();
-
-        $dh = opendir($c->getDirectory('tmp'));
-        if ($dh) {
-            while (($file = readdir($dh)) !== false) {
-                if ($file == '.' || $file == '..') {
-                    continue;
-                } else if (is_dir($c->getDirectory('tmp') . '/' . $file)) {
-                    continue;
-                } else if (strncmp($file, $prefix, strlen($prefix)) == 0) {
-                    $f = $c->getDirectory('tmp') . "/" . $file;
-                    $st = stat($f);
-                    if ($st[9] + $timeout < time()) {
-                        unlink($f);
-                    }
-                }
-            }
-            closedir($dh);
-        }
-    }
-    // }}}
-
-    // {{{ lockFile
-    /**
-     *  ¥Õ¥¡¥¤¥ë¤ò¥í¥Ã¥¯¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $file       ¥í¥Ã¥¯¤¹¤ë¥Õ¥¡¥¤¥ë̾
-     *  @param  int     $mode       ¥í¥Ã¥¯¥â¡¼¥É('r', 'rw')
-     *  @param  int     $timeout    ¥í¥Ã¥¯ÂÔ¤Á¥¿¥¤¥à¥¢¥¦¥È(ÉáÝ0¤Ê¤é̵¸Â)
-     *  @return int     ¥í¥Ã¥¯¥Ï¥ó¥É¥ë(false¤Ê¤é¥¨¥é¡¼)
-     */
-    function lockFile($file, $mode, $timeout = 0)
-    {
-        if (file_exists($file) === false) {
-            touch($file);
-        }
-        $lh = fopen($file, 'r');
-        if ($lh == null) {
-            return Ethna::raiseError("¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß¥¨¥é¡¼[%s]", E_APP_READ, $file);
-        }
-
-        $lock_mode = $mode == 'r' ? LOCK_SH : LOCK_EX;
-
-        for ($i = 0; $i < $timeout || $timeout == 0; $i++) {
-            $r = flock($lh, $lock_mode | LOCK_NB);
-            if ($r == true) {
-                break;
-            }
-            sleep(1);
-        }
-        if ($timeout > 0 && $i == $timeout) {
-            // timed out
-            return Ethna::raiseError("¥Õ¥¡¥¤¥ë¥í¥Ã¥¯¼èÆÀ¥¨¥é¡¼[%s]", E_APP_LOCK, $file);
-        }
-
-        return $lh;
-    }
-    // }}}
-
-    // {{{ unlockFile
-    /**
-     *  ¥Õ¥¡¥¤¥ë¤Î¥í¥Ã¥¯¤ò²ò½ü¤¹¤ë
-     *
-     *  @access public
-     *  @param  int     $lh     ¥í¥Ã¥¯¥Ï¥ó¥É¥ë
-     */
-    function unlockFile($lh)
-    {
-        fclose($lh);
-    }
-    // }}}
-
-    // {{{ formatBacktrace
-    /**
-     *  ¥Ð¥Ã¥¯¥È¥ì¡¼¥¹¤ò¥Õ¥©¡¼¥Þ¥Ã¥È¤·¤ÆÊÖ¤¹
-     *
-     *  @access public
-     *  @param  array   $bt     debug_backtrace()´Ø¿ô¤Ç¼èÆÀ¤·¤¿¥Ð¥Ã¥¯¥È¥ì¡¼¥¹
-     *  @return string  Ê¸»úÎó¤Ë¥Õ¥©¡¼¥Þ¥Ã¥È¤µ¤ì¤¿¥Ð¥Ã¥¯¥È¥ì¡¼¥¹
-     */
-    function formatBacktrace($bt) 
-    {
-        $r = "";
-        $i = 0;
-        foreach ($bt as $elt) {
-            $r .= sprintf("[%02d] %s:%d:%s.%s\n", $i,
-                          isset($elt['file']) ? $elt['file'] : 'unknown file',
-                          isset($elt['line']) ? $elt['line'] : 'unknown line',
-                          isset($elt['class']) ? $elt['class'] : 'global',
-                          $elt['function']);
-            $i++;
-
-            if (isset($elt['args']) == false || is_array($elt['args']) == false) {
-                continue;
-            }
-
-            // °ú¿ô¤Î¥À¥ó¥×
-            foreach ($elt['args'] as $arg) {
-                $r .= Ethna_Util::_formatBacktrace($arg);
-            }
-        }
-
-        return $r;
-    }
-
-    /**
-     *  ¥Ð¥Ã¥¯¥È¥ì¡¼¥¹°ú¿ô¤ò¥Õ¥©¡¼¥Þ¥Ã¥È¤·¤ÆÊÖ¤¹
-     *
-     *  @access private
-     *  @param  string  $arg    ¥Ð¥Ã¥¯¥È¥ì¡¼¥¹¤Î°ú¿ô
-     *  @param  int     $level  ¥Ð¥Ã¥¯¥È¥ì¡¼¥¹¤Î¥Í¥¹¥È¥ì¥Ù¥ë
-     *  @param  int     $wrap   ²þ¹Ô¥Õ¥é¥°
-     *  @return string  Ê¸»úÎó¤Ë¥Õ¥©¡¼¥Þ¥Ã¥È¤µ¤ì¤¿¥Ð¥Ã¥¯¥È¥ì¡¼¥¹
-     */
-    function _formatBacktrace($arg, $level = 0, $wrap = true)
-    {
-        $pad = str_repeat("  ", $level);
-        if (is_array($arg)) {
-            $r = sprintf("     %s[array] => (\n", $pad);
-            if ($level+1 > 4) {
-                $r .= sprintf("     %s  *too deep*\n", $pad);
-            } else {
-                foreach ($arg as $key => $elt) {
-                    $r .= Ethna_Util::_formatBacktrace($key, $level, false);
-                    $r .= " => \n";
-                    $r .= Ethna_Util::_formatBacktrace($elt, $level+1);
-                }
-            }
-            $r .= sprintf("     %s)\n", $pad);
-        } else if (is_object($arg)) {
-            $r = sprintf("     %s[object]%s%s", $pad, get_class($arg), $wrap ? "\n" : "");
-        } else {
-            $r = sprintf("     %s[%s]%s%s", $pad, gettype($arg), $arg, $wrap ? "\n" : "");
-        }
-
-        return $r;
-    }
-    // }}}
-}
-// }}}
-?>
diff --git a/class/Ethna_ViewClass.php b/class/Ethna_ViewClass.php
deleted file mode 100644 (file)
index 20c329f..0000000
+++ /dev/null
@@ -1,959 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_ViewClass.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_ViewClass
-/**
- *  view¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_ViewClass
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    object  Ethna_Backend       backend¥ª¥Ö¥¸¥§¥¯¥È */
-    var $backend;
-
-    /** @var    object  Ethna_Config        ÀßÄꥪ¥Ö¥¸¥§¥¯¥È    */
-    var $config;
-
-    /** @var    object  Ethna_I18N          i18n¥ª¥Ö¥¸¥§¥¯¥È */
-    var $i18n;
-
-    /** @var    object  Ethna_Logger    ¥í¥°¥ª¥Ö¥¸¥§¥¯¥È */
-    var $logger;
-
-    /** @var    object  Ethna_Plugin    ¥×¥é¥°¥¤¥ó¥ª¥Ö¥¸¥§¥¯¥È */
-    var $plugin;
-
-    /** @var    object  Ethna_ActionError   ¥¢¥¯¥·¥ç¥ó¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È */
-    var $action_error;
-
-    /** @var    object  Ethna_ActionError   ¥¢¥¯¥·¥ç¥ó¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È(¾Êά·Á) */
-    var $ae;
-
-    /** @var    object  Ethna_ActionForm    ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È */
-    var $action_form;
-
-    /** @var    object  Ethna_ActionForm    ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È(¾Êά·Á) */
-    var $af;
-
-    /** @var    array   ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È(helper) */
-    var $helper_action_form = array();
-
-    /** @var    array   helper¤Çhtml¤Îattribute¤Ë¤Ï¤·¤Ê¥Ñ¥é¥á¡¼¥¿¤Î°ìÍ÷ */
-    var $helper_parameter_keys = array('default', 'option', 'separator');
-
-    /** @var    object  Ethna_Session       ¥»¥Ã¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È */
-    var $session;
-
-    /** @var    string  Á«°Ü̾ */
-    var $forward_name;
-
-    /** @var    string  Á«°ÜÀè¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë̾ */
-    var $forward_path;
-
-    /**#@-*/
-
-    // {{{ Ethna_ViewClass
-    /**
-     *  Ethna_ViewClass¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Backend   $backend    backend¥ª¥Ö¥¸¥§¥¯¥È
-     *  @param  string  $forward_name   ¥Ó¥å¡¼¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤Æ¤¤¤ëÁ«°Ü̾
-     *  @param  string  $forward_path   ¥Ó¥å¡¼¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤Æ¤¤¤ë¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë̾
-     */
-    function Ethna_ViewClass(&$backend, $forward_name, $forward_path)
-    {
-        $c =& $backend->getController();
-        $this->backend =& $backend;
-        $this->config =& $this->backend->getConfig();
-        $this->i18n =& $this->backend->getI18N();
-        $this->logger =& $this->backend->getLogger();
-        $this->plugin =& $this->backend->getPlugin();
-
-        $this->action_error =& $this->backend->getActionError();
-        $this->ae =& $this->action_error;
-
-        $this->action_form =& $this->backend->getActionForm();
-        $this->af =& $this->action_form;
-
-        $this->session =& $this->backend->getSession();
-
-        $this->forward_name = $forward_name;
-        $this->forward_path = $forward_path;
-
-        foreach (array_keys($this->helper_action_form) as $action) {
-            $this->addActionFormHelper($action);
-        }
-    }
-    // }}}
-
-    // {{{ preforward
-    /**
-     *  ²èÌÌɽ¼¨Á°½èÍý
-     *
-     *  ¥Æ¥ó¥×¥ì¡¼¥È¤ËÀßÄꤹ¤ëÃͤǥ³¥ó¥Æ¥­¥¹¥È¤Ë°Í¸¤·¤Ê¤¤¤â¤Î¤Ï
-     *  ¤³¤³¤ÇÀßÄꤹ¤ë(Îã:¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹Åù)
-     *
-     *  @access public
-     */
-    function preforward()
-    {
-    }
-    // }}}
-
-    // {{{ forward
-    /**
-     *  Á«°Ü̾¤ËÂбþ¤¹¤ë²èÌ̤ò½ÐÎϤ¹¤ë
-     *
-     *  Æüì¤Ê²èÌ̤òɽ¼¨¤¹¤ë¾ì¹ç¤ò½ü¤¤¤ÆÆä˥ª¡¼¥Ð¡¼¥é¥¤¥É¤¹¤ëɬÍפÏ̵¤¤
-     *  (preforward()¤Î¤ß¥ª¡¼¥Ð¡¼¥é¥¤¥É¤¹¤ì¤ÐÎɤ¤)
-     *
-     *  @access public
-     */
-    function forward()
-    {
-        $renderer =& $this->_getRenderer();
-        $this->_setDefault($renderer);
-        $renderer->perform($this->forward_path);
-    }
-    // }}}
-
-    // {{{ addActionFormHelper
-    /**
-     *  helper¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òÀßÄꤹ¤ë
-     *
-     *  @access public
-     */
-    function addActionFormHelper($action)
-    {
-        if (isset($this->helper_action_form[$action])
-            && is_object($this->helper_action_form[$action])) {
-            return;
-        }
-
-        $ctl =& Ethna_Controller::getInstance();
-        if ($action === $ctl->getCurrentActionName()) {
-            $this->helper_action_form[$action] =& $this->af;
-            return;
-        }
-
-        $form_name = $ctl->getActionFormName($action);
-        if ($form_name === null) {
-            $this->logger->log(LOG_WARNING,
-                'action form for the action [%s] not found.', $action);
-            return;
-        }
-
-        $this->helper_action_form[$action] =& new $form_name($ctl);
-    }
-    // }}}
-
-    // {{{ clearActionFormHelper
-    /**
-     *  helper¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òºï½ü¤¹¤ë
-     *
-     *  @access public
-     */
-    function clearActionFormHelper($action)
-    {
-        unset($this->helper_action_form[$action]);
-    }
-    // }}}
-
-    // {{{ _getHelperActionForm
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È(helper)¤ò¼èÆÀ¤¹¤ë
-     *  $action === null ¤Ç $name ¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤È¤­¤Ï¡¢$name¤ÎÄêµÁ¤ò
-     *  ´Þ¤à¤â¤Î¤òõ¤¹
-     *
-     *  @access protected
-     *  @param  string  action  ¼èÆÀ¤¹¤ë¥¢¥¯¥·¥ç¥ó̾
-     *  @param  string  name    ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ò´üÂÔ¤¹¤ë¥Õ¥©¡¼¥à̾
-     *  @return object  Ethna_ActionForm¤Þ¤¿¤Ï·Ñ¾µ¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &_getHelperActionForm($action = null, $name = null)
-    {
-        // $action ¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç
-        if ($action !== null) {
-            if (isset($this->helper_action_form[$action])
-                && is_object($this->helper_action_form[$action])) {
-                return $this->helper_action_form[$action];
-            } else {
-                $this->logger->log(LOG_WARNING,
-                    'helper action form for action [%s] not found',
-                    $action);
-                return null;
-            }
-        }
-
-        // ºÇ½é¤Ë $this->af ¤òÄ´¤Ù¤ë
-        $def = $this->af->getDef($name);
-        if ($def !== null) {
-            return $this->af;
-        }
-
-        // $this->helper_action_form ¤ò½ç¤ËÄ´¤Ù¤ë
-        foreach (array_keys($this->helper_action_form) as $action) {
-            if (is_object($this->helper_action_form[$action]) === false) {
-                continue;
-            }
-            $af =& $this->helper_action_form[$action];
-            $def = $af->getDef($name);
-            if (is_null($def) === false) {
-                return $af;
-            }
-        }
-
-        // ¸«ÉÕ¤«¤é¤Ê¤«¤Ã¤¿
-        $this->logger->log(LOG_WARNING,
-            'action form defining form [%s] not found', $name);
-        return null;
-    }
-    // }}}
-
-    // {{{ getFormName
-    /**
-     *  »ØÄꤵ¤ì¤¿¥Õ¥©¡¼¥à¹àÌܤËÂбþ¤¹¤ë¥Õ¥©¡¼¥à̾(w/ ¥ì¥ó¥À¥ê¥ó¥°)¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     */
-    function getFormName($name, $action, $params)
-    {
-        $af =& $this->_getHelperActionForm($action, $name);
-        if ($af === null) {
-            return $name;
-        }
-
-        $def = $af->getDef($name);
-        if ($def === null || isset($def['name']) === false) {
-            return $name;
-        }
-
-        return $def['name'];
-    }
-    // }}}
-
-    // {{{ getFormSubmit
-    /**
-     *  submit¥Ü¥¿¥ó¤ò¼èÆÀ¤¹¤ë(Á÷¿®À襢¥¯¥·¥ç¥ó¤Ç¼õ¤±¼è¤ë¤è¤¦
-     *  ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¤È¤­¤Ë¡¢¤¿¤ó¤Ësubmit¥Ü¥¿¥ó¤òºî¤ë¤Î¤Ë»È¤¦)
-     *
-     *  @access public
-     */
-    function getFormSubmit($params)
-    {
-        if (isset($params['type']) === false) {
-            $params['type'] = 'submit';
-        }
-        return $this->_getFormInput_Html('input', $params);
-    }
-    // }}}
-
-    // {{{ getFormInput
-    /**
-     *  »ØÄꤵ¤ì¤¿¥Õ¥©¡¼¥à¹àÌܤËÂбþ¤¹¤ë¥Õ¥©¡¼¥à¥¿¥°¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @todo   JavaScriptÂбþ
-     */
-    function getFormInput($name, $action, $params)
-    {
-        $af =& $this->_getHelperActionForm($action, $name);
-        if ($af === null) {
-            return '';
-        }
-
-        $def = $af->getDef($name);
-        if ($def === null) {
-            return '';
-        }
-
-        if (isset($def['form_type']) === false) {
-            $def['form_type'] = FORM_TYPE_TEXT;
-        }
-
-        // ÇÛÎó¥Õ¥©¡¼¥à¤¬²¿²ó¸Æ¤Ð¤ì¤¿¤«¤òÊݸ¤¹¤ë¥«¥¦¥ó¥¿
-        if (isset($def['type']) && is_array($def['type'])) {
-            static $form_counter = array();
-            if (isset($form_counter[$action]) === false) {
-                $form_counter[$action] = array();
-            }
-            if (isset($form_counter[$action][$name]) === false) {
-                $form_counter[$action][$name] = 0;
-            }
-            $def['_form_counter'] = $form_counter[$action][$name]++;
-        }
-
-        switch ($def['form_type']) {
-        case FORM_TYPE_BUTTON:
-            $input = $this->_getFormInput_Button($name, $def, $params);
-            break;
-
-        case FORM_TYPE_CHECKBOX:
-            $def['option'] = $this->_getSelectorOptions($af, $def, $params);
-            $input = $this->_getFormInput_Checkbox($name, $def, $params);
-            break;
-
-        case FORM_TYPE_FILE:
-            $input = $this->_getFormInput_File($name, $def, $params);
-            break;
-
-        case FORM_TYPE_HIDDEN:
-            $input = $this->_getFormInput_Hidden($name, $def, $params);
-            break;
-
-        case FORM_TYPE_PASSWORD:
-            $input = $this->_getFormInput_Password($name, $def, $params);
-            break;
-
-        case FORM_TYPE_RADIO:
-            $def['option'] = $this->_getSelectorOptions($af, $def, $params);
-            $input = $this->_getFormInput_Radio($name, $def, $params);
-            break;
-
-        case FORM_TYPE_SELECT:
-            $def['option'] = $this->_getSelectorOptions($af, $def, $params);
-            $input = $this->_getFormInput_Select($name, $def, $params);
-            break;
-
-        case FORM_TYPE_SUBMIT:
-            $input = $this->_getFormInput_Submit($name, $def, $params);
-            break;
-
-        case FORM_TYPE_TEXTAREA:
-            $input = $this->_getFormInput_Textarea($name, $def, $params);
-            break;
-
-        case FORM_TYPE_TEXT:
-        default:
-            $input = $this->_getFormInput_Text($name, $def, $params);
-            break;
-        }
-
-        return $input;
-    }
-    // }}}
-
-    // {{{ getFormBlock
-    /**
-     *  ¥Õ¥©¡¼¥à¥¿¥°¤ò¼èÆÀ¤¹¤ë(type="form")
-     *
-     *  @access protected
-     */
-    function getFormBlock($content, $params)
-    {
-        // method
-        if (isset($params['method']) === false) {
-            $params['method'] = 'post';
-        }
-
-        return $this->_getFormInput_Html('form', $params, $content, false);
-    }
-    // }}}
-
-    // {{{ _getSelectorOptions
-    /**
-     *  select, radio, checkbox ¤ÎÁªÂò»è¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access protected
-     */
-    function _getSelectorOptions(&$af, $def, $params)
-    {
-        // $params, $def ¤Î½ç¤ÇÄ´¤Ù¤ë
-        $source = null;
-        if (isset($params['option'])) {
-            $source = $params['option'];
-        } else if (isset($def['option'])) {
-            $source = $def['option'];
-        }
-
-        // Ì¤ÄêµÁ or ÄêµÁºÑ¤ß¤Î¾ì¹ç¤Ï¤½¤Î¤Þ¤Þ
-        if ($source === null) {
-            return null;
-        } else if (is_array($source)) {
-            return $source;
-        }
-        
-        // ÁªÂò»è¤ò¼èÆÀ
-        $options = null;
-        $split = array_map("trim", explode(',', $source));
-        if (count($split) === 1) {
-            // ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¤«¤é¼èÆÀ
-            $method_or_property = $split[0];
-            if (method_exists($af, $method_or_property)) {
-                $options = $af->$method_or_property();
-            } else {
-                $options = $af->$method_or_property;
-            }
-        } else {
-            // ¥Þ¥Í¡¼¥¸¥ã¤«¤é¼èÆÀ
-            $mgr =& $this->backend->getManager($split[0]);
-            $attr_list = $mgr->getAttrList($split[1]);
-            if (is_array($attr_list)) {
-                foreach ($attr_list as $key => $val) {
-                    $options[$key] = $val['name'];
-                }
-            }
-        }
-
-        if (is_array($options) === false) {
-            $this->logger->log(LOG_WARNING,
-                'selector option is not valid. [actionform=%s, option=%s]',
-                get_class($af), $source);
-            return null;
-        }
-
-        return $options;
-    }
-    // }}}
-
-    // {{{ _getFormInput_Button
-    /**
-     *  ¥Õ¥©¡¼¥à¥¿¥°¤ò¼èÆÀ¤¹¤ë(type="button")
-     *
-     *  @access protected
-     */
-    function _getFormInput_Button($name, $def, $params)
-    {
-        $params['type'] = 'button';
-        
-        if (isset($def['type'])) {
-            $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
-        } else {
-            $params['name'] = $name;
-        }
-        if (isset($params['value']) === false) {
-            if (isset($def['name'])) {
-                $params['value'] = $def['name'];
-            }
-        }
-        if (isset($params['value']) && is_array($params['value'])) {
-            $params['value'] = $params['value'][0];
-        }
-
-        return $this->_getFormInput_Html('input', $params);
-    }
-    // }}}
-
-    // {{{ _getFormInput_Checkbox
-    /**
-     *  ¥Á¥§¥Ã¥¯¥Ü¥Ã¥¯¥¹¥¿¥°¤ò¼èÆÀ¤¹¤ë(type="check")
-     *
-     *  @access protected
-     */
-    function _getFormInput_Checkbox($name, $def, $params)
-    {
-        $params['type'] = 'checkbox';
-        if (isset($def['type'])) {
-            $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
-        } else {
-            $params['name'] = $name;
-        }
-
-        // ¥ª¥×¥·¥ç¥ó¤Î°ìÍ÷(alist)¤ò¼èÆÀ
-        if (isset($def['option']) && is_array($def['option'])) {
-            $options = $def['option'];
-        } else {
-            $options = array();
-        }
-
-        // defaultÃͤÎÀßÄê
-        if (isset($params['default'])) {
-            $current_value = $params['default'];
-        } else if (isset($def['default'])) {
-            $current_value = $def['default'];
-        } else {
-            $current_value = array();
-        }
-        $current_value = array_map('strval', to_array($current_value));
-
-        // ¥¿¥°¤Î¥»¥Ñ¥ì¡¼¥¿
-        if (isset($params['separator'])) {
-            $separator = $params['separator'];
-        } else {
-            $separator = "\n";
-        }
-
-        $ret = array();
-        $i = 1;
-        foreach ($options as $key => $value) {
-            $params['value'] = $key;
-            $params['id'] = $name . '_' . $i++;
-
-            // checked
-            if (in_array((string) $key, $current_value, true)) {
-                $params['checked'] = 'checked';
-            } else {
-                unset($params['checked']);
-            }
-
-            // <input type="checkbox" />
-            $input_tag = $this->_getFormInput_Html('input', $params);
-
-            // <label for="id">..</label>
-            $ret[] = $this->_getFormInput_Html('label', array('for' => $params['id']),
-                                               $input_tag . $value, false);
-        }
-
-        return implode($separator, $ret);
-    }
-    // }}}
-
-    // {{{ _getFormInput_File
-    /**
-     *  ¥Õ¥©¡¼¥à¥¿¥°¤ò¼èÆÀ¤¹¤ë(type="file")
-     *
-     *  @access protected
-     */
-    function _getFormInput_File($name, $def, $params)
-    {
-        $params['type'] = 'file';
-        if (isset($def['type'])) {
-            $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
-        } else {
-            $params['name'] = $name;
-        }
-        $params['value'] = '';
-
-        return $this->_getFormInput_Html('input', $params);
-    }
-    // }}}
-
-    // {{{ _getFormInput_Hidden
-    /**
-     *  ¥Õ¥©¡¼¥à¥¿¥°¤ò¼èÆÀ¤¹¤ë(type="hidden")
-     *
-     *  @access protected
-     */
-    function _getFormInput_Hidden($name, $def, $params)
-    {
-        $params['type'] = 'hidden';
-        if (isset($def['type'])) {
-            $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
-        } else {
-            $params['name'] = $name;
-        }
-
-        // value
-        $value = '';
-        if (isset($params['value'])) {
-            $value = $params['value'];
-        } else if (isset($params['default'])) {
-            $value = $params['default'];
-        } else if (isset($def['default'])) {
-            $value = $def['default'];
-        }
-        if (is_array($value)) {
-            if ($def['_form_counter'] < count($value)) {
-                $params['value'] = $value[$def['_form_counter']];
-            } else {
-                $params['value'] = '';
-            }
-        } else {
-            $params['value'] = $value;
-        }
-
-        return $this->_getFormInput_Html('input', $params);
-    }
-    // }}}
-
-    // {{{ _getFormInput_Password
-    /**
-     *  ¥Õ¥©¡¼¥à¥¿¥°¤ò¼èÆÀ¤¹¤ë(type="password")
-     *
-     *  @access protected
-     */
-    function _getFormInput_Password($name, $def, $params)
-    {
-        $params['type'] = 'password';
-        if (isset($def['type'])) {
-            $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
-        } else {
-            $params['name'] = $name;
-        }
-
-        // value
-        $value = '';
-        if (isset($params['value'])) {
-            $value = $params['value'];
-        } else if (isset($params['default'])) {
-            $value = $params['default'];
-        } else if (isset($def['default'])) {
-            $value = $def['default'];
-        }
-        if (is_array($value)) {
-            if ($def['_form_counter'] < count($value)) {
-                $params['value'] = $value[$def['_form_counter']];
-            } else {
-                $params['value'] = '';
-            }
-        } else {
-            $params['value'] = $value;
-        }
-
-        // maxlength
-        if (isset($def['max']) && $def['max']) {
-            $params['maxlength'] = $def['max'];
-        }
-
-        return $this->_getFormInput_Html('input', $params);
-    }
-    // }}}
-
-    // {{{ _getFormInput_Radio
-    /**
-     *  ¥é¥¸¥ª¥Ü¥¿¥ó¥¿¥°¤ò¼èÆÀ¤¹¤ë(type="radio")
-     *
-     *  @access protected
-     */
-    function _getFormInput_Radio($name, $def, $params)
-    {
-        $params['type'] = 'radio';
-        if (isset($def['type'])) {
-            $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
-        } else {
-            $params['name'] = $name;
-        }
-
-        // ¥ª¥×¥·¥ç¥ó¤Î°ìÍ÷(alist)¤ò¼èÆÀ
-        if (isset($def['option']) && is_array($def['option'])) {
-            $options = $def['option'];
-        } else {
-            $options = array();
-        }
-
-        // defaultÃͤÎÀßÄê
-        if (isset($params['default'])) {
-            $current_value = $params['default'];
-        } else if (isset($def['default'])) {
-            $current_value = $def['default'];
-        } else {
-            $current_value = null;
-        }
-
-        // ¥¿¥°¤Î¥»¥Ñ¥ì¡¼¥¿
-        if (isset($params['separator'])) {
-            $separator = $params['separator'];
-        } else {
-            $separator = "\n";
-        }
-
-        $ret = array();
-        $i = 1;
-        foreach ($options as $key => $value) {
-            $params['value'] = $key;
-            $params['id'] = $name . '_' . $i++;
-
-            // checked
-            if (strcmp($current_value,$key) === 0) {
-                $params['checked'] = 'checked';
-            } else {
-                unset($params['checked']);
-            }
-
-            // <input type="radio" />
-            $input_tag = $this->_getFormInput_Html('input', $params);
-
-            // <label for="id">..</label>
-            $ret[] = $this->_getFormInput_Html('label', array('for' => $params['id']),
-                                               $input_tag . $value, false);
-        }
-
-        return implode($separator, $ret);
-    }
-    // }}}
-
-    // {{{ _getFormInput_Select
-    /**
-     *  ¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹¥¿¥°¤ò¼èÆÀ¤¹¤ë(type="select")
-     *
-     *  @access protected
-     */
-    function _getFormInput_Select($name, $def, $params)
-    {
-        if (isset($def['type'])) {
-            $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
-        } else {
-            $params['name'] = $name;
-        }
-
-        // ¥ª¥×¥·¥ç¥ó¤Î°ìÍ÷(alist)¤ò¼èÆÀ
-        if (isset($def['option']) && is_array($def['option'])) {
-            $options = $def['option'];
-        } else {
-            $options = array();
-        }
-
-        // defaultÃͤÎÀßÄê
-        if (isset($params['default'])) {
-            $current_value = $params['default'];
-        } else if (isset($def['default'])) {
-            $current_value = $def['default'];
-        } else {
-            $current_value = array();
-        }
-        $current_value = array_map('strval', to_array($current_value));
-
-        // ¥¿¥°¤Î¥»¥Ñ¥ì¡¼¥¿
-        if (isset($params['separator'])) {
-            $separator = $params['separator'];
-        } else {
-            $separator = "\n";
-        }
-
-        // select¥¿¥°¤ÎÃæ¿È¤òºî¤ë
-        $contents = array();
-        $selected = false;
-        foreach ($options as $key => $value) {
-            $attr = array('value' => $key);
-            if (in_array((string) $key, $current_value, true)) {
-                $attr['selected'] = 'selected';
-                $selected = true;
-            }
-            $contents[] = $this->_getFormInput_Html('option', $attr, $value);
-        }
-
-        // ¶õ¥¨¥ó¥È¥ê
-        if (isset($params['emptyoption'])) {
-            $attr = array('value' => '');
-            if ($selected === false) {
-                $attr['selected'] = 'selected';
-            }
-            array_unshift($contents,
-                          $this->_getFormInput_Html('option',
-                                                    $attr,
-                                                    $params['emptyoption']));
-            unset($params['emptyoption']);
-        }
-
-        $element = $separator . implode($separator, $contents) . $separator;
-        return $this->_getFormInput_Html('select', $params, $element, false);
-    }
-    // }}}
-
-    // {{{ _getFormInput_Submit
-    /**
-     *  ¥Õ¥©¡¼¥à¥¿¥°¤ò¼èÆÀ¤¹¤ë(type="submit")
-     *
-     *  @access protected
-     */
-    function _getFormInput_Submit($name, $def, $params)
-    {
-        $params['type'] = 'submit';
-        if (isset($def['type'])) {
-            $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
-        } else {
-            $params['name'] = $name;
-        }
-        if (isset($params['value']) === false) {
-            if (isset($def['name'])) {
-                $params['value'] = $def['name'];
-            }
-        }
-        if (is_array($params['value'])) {
-            $params['value'] = $params['value'][0];
-        }
-
-        return $this->_getFormInput_Html('input', $params);
-    }
-    // }}}
-
-    // {{{ _getFormInput_Textarea
-    /**
-     *  ¥Õ¥©¡¼¥à¥¿¥°¤ò¼èÆÀ¤¹¤ë(textarea)
-     *
-     *  @access protected
-     */
-    function _getFormInput_Textarea($name, $def, $params)
-    {
-        if (isset($def['type'])) {
-            $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
-        } else {
-            $params['name'] = $name;
-        }
-
-        // element
-        $element = '';
-        if (isset($params['value'])) {
-            $element = $params['value'];
-            unset($params['value']);
-        } else if (isset($params['default'])) {
-            $element = $params['default'];
-        } else if (isset($def['default'])) {
-            $element = $def['default'];
-        }
-        if (is_array($element)) {
-            if ($def['_form_counter'] < count($element)) {
-                $element = $element[$def['_form_counter']];
-            } else {
-                $element = '';
-            }
-        } else {
-            $params['value'] = $element;
-        }
-
-        return $this->_getFormInput_Html('textarea', $params, $element);
-    }
-    // }}}
-
-    // {{{ _getFormInput_Text
-    /**
-     *  ¥Õ¥©¡¼¥à¥¿¥°¤ò¼èÆÀ¤¹¤ë(type="text")
-     *
-     *  @access protected
-     */
-    function _getFormInput_Text($name, $def, $params)
-    {
-        // type
-        $params['type'] = 'text';
-
-        // name
-        if (isset($def['type'])) {
-            $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
-        } else {
-            $params['name'] = $name;
-        }
-
-        // value
-        $value = '';
-        if (isset($params['value'])) {
-            $value = $params['value'];
-        } else if (isset($params['default'])) {
-            $value = $params['default'];
-        } else if (isset($def['default'])) {
-            $value = $def['default'];
-        }
-        if (is_array($value)) {
-            if ($def['_form_counter'] < count($value)) {
-                $params['value'] = $value[$def['_form_counter']];
-            } else {
-                $params['value'] = '';
-            }
-        } else {
-            $params['value'] = $value;
-        }
-
-        // maxlength
-        if (isset($def['max']) && $def['max']) {
-            $params['maxlength'] = $def['max'];
-        }
-
-        return $this->_getFormInput_Html('input', $params);
-    }
-    // }}}
-
-    // {{{ _getFormInput_Html
-    /**
-     *  HTML¥¿¥°¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access protected
-     */
-    function _getFormInput_Html($tag, $attr, $element = null, $escape_element = true)
-    {
-        // ÉÔÍפʥѥé¥á¡¼¥¿¤Ï¾Ã¤¹
-        foreach ($this->helper_parameter_keys as $key) {
-            unset($attr[$key]);
-        }
-
-        $r = "<$tag";
-
-        foreach ($attr as $key => $value) {
-            if ($value === null) {
-                $r .= sprintf(' %s', $key);
-            } else {
-                $r .= sprintf(' %s="%s"', $key, htmlspecialchars($value, ENT_QUOTES));
-            }
-        }
-
-        if ($element === null) {
-            $r .= ' />';
-        } else if ($escape_element) {
-            $r .= sprintf('>%s</%s>', htmlspecialchars($element, ENT_QUOTES), $tag);
-        } else {
-            $r .= sprintf('>%s</%s>', $element, $tag);
-        }
-
-        return $r;
-    }
-    // }}}
-
-    // {{{ _getRenderer
-    /**
-     *  ¥ì¥ó¥À¥é¥ª¥Ö¥¸¥§¥¯¥È¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access protected
-     *  @return object  Ethna_Renderer  ¥ì¥ó¥À¥é¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function &_getRenderer()
-    {
-        $_ret_object =& $this->_getTemplateEngine();
-        return $_ret_object;
-    }
-    // }}}
-
-    // {{{ _getTemplateEngine
-    /**
-     *  ¥ì¥ó¥À¥é¥ª¥Ö¥¸¥§¥¯¥È¤ò¼èÆÀ¤¹¤ë(¤½¤Î¤¦¤Á_getRenderer()¤ËÅý¹ç¤µ¤ì¤ëͽÄê)
-     *
-     *  @access protected
-     *  @return object  Ethna_Renderer  ¥ì¥ó¥À¥é¥ª¥Ö¥¸¥§¥¯¥È
-     *  @obsolete
-     */
-    function &_getTemplateEngine()
-    {
-        $c =& $this->backend->getController();
-        $renderer =& $c->getRenderer();
-
-        $form_array =& $this->af->getArray();
-        $app_array =& $this->af->getAppArray();
-        $app_ne_array =& $this->af->getAppNEArray();
-        $renderer->setPropByRef('form', $form_array);
-        $renderer->setPropByRef('app', $app_array);
-        $renderer->setPropByRef('app_ne', $app_ne_array);
-        $message_list = Ethna_Util::escapeHtml($this->ae->getMessageList());
-        $renderer->setPropByRef('errors', $message_list);
-        if (isset($_SESSION)) {
-            $tmp_session = Ethna_Util::escapeHtml($_SESSION);
-            $renderer->setPropByRef('session', $tmp_session);
-        }
-        $renderer->setProp('script',
-            htmlspecialchars(basename($_SERVER['SCRIPT_NAME']), ENT_QUOTES));
-        $renderer->setProp('request_uri',
-            isset($_SERVER['REQUEST_URI'])
-            ? htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES)
-            : '');
-        $renderer->setProp('config', $this->config->get());
-
-        return $renderer;
-    }
-    // }}}
-
-    // {{{ _setDefault
-    /**
-     *  ¶¦ÄÌÃͤòÀßÄꤹ¤ë
-     *
-     *  @access protected
-     *  @param  object  Ethna_Renderer  ¥ì¥ó¥À¥é¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function _setDefault(&$renderer)
-    {
-    }
-    // }}}
-}
-// }}}
-?>
diff --git a/class/Plugin/Cachemanager/Ethna_Plugin_Cachemanager_Localfile.php b/class/Plugin/Cachemanager/Ethna_Plugin_Cachemanager_Localfile.php
deleted file mode 100644 (file)
index 6094656..0000000
+++ /dev/null
@@ -1,273 +0,0 @@
-<?php
-// vim: foldmethod=marker tabstop=4 shiftwidth=4 autoindent
-/**
- *  Ethna_Plugin_Cachemanager_Localfile.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-/**
- *  ¥­¥ã¥Ã¥·¥å¥Þ¥Í¡¼¥¸¥ã¥¯¥é¥¹(¥í¡¼¥«¥ë¥Õ¥¡¥¤¥ë¥­¥ã¥Ã¥·¥åÈÇ)
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Cachemanager_Localfile extends Ethna_Plugin_Cachemanager
-{
-    /**#@+  @access private */
-
-    /**#@-*/
-
-    /**
-     *  ¥­¥ã¥Ã¥·¥å¤ËÀßÄꤵ¤ì¤¿Ãͤò¼èÆÀ¤¹¤ë
-     *
-     *  ¥­¥ã¥Ã¥·¥å¤ËÃͤ¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¥­¥ã¥Ã¥·¥åÃÍ
-     *  ¤¬Ìá¤êÃͤȤʤ롣¥­¥ã¥Ã¥·¥å¤ËÃͤ¬Ìµ¤¤¾ì¹ç¤älifetime
-     *  ¤ò²á¤®¤Æ¤¤¤ë¾ì¹ç¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤ÏPEAR_Error
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¤¬Ìá¤êÃͤȤʤ롣
-     *
-     *  @access public
-     *  @param  string  $key        ¥­¥ã¥Ã¥·¥å¥­¡¼
-     *  @param  int     $lifetime   ¥­¥ã¥Ã¥·¥åÍ­¸ú´ü´Ö
-     *  @param  string  $namespace  ¥­¥ã¥Ã¥·¥å¥Í¡¼¥à¥¹¥Ú¡¼¥¹
-     *  @return array   ¥­¥ã¥Ã¥·¥åÃÍ
-     */
-    function get($key, $lifetime = null, $namespace = null)
-    {
-        $namespace = is_null($namespace) ? $this->namespace : $namespace;
-        $cache_file = $this->_getCacheFile($namespace, $key);
-
-        // ¥é¥¤¥Õ¥¿¥¤¥à¥Á¥§¥Ã¥¯
-        clearstatcache();
-        if (is_readable($cache_file) === false
-            || ($st = stat($cache_file)) === false) {
-            return Ethna::raiseError('fopen failed', E_CACHE_NO_VALUE);
-        }
-        if (is_null($lifetime) == false) {
-            if (($st[9]+$lifetime) < time()) {
-                return Ethna::raiseError('fopen failed', E_CACHE_EXPIRED);
-            }
-        }
-
-        $fp = fopen($cache_file, "r");
-        if ($fp == false) {
-            return Ethna::raiseError('fopen failed', E_CACHE_NO_VALUE);
-        }
-        // ¥í¥Ã¥¯
-        $timeout = 3;
-        while ($timeout > 0) {
-            $r = flock($fp, LOCK_EX|LOCK_NB);
-            if ($r) {
-                break;
-            }
-            $timeout--;
-            sleep(1);
-        }
-        if ($timeout <= 0) {
-            fclose($fp);
-            return Ethna::raiseError('fopen failed', E_CACHE_GENERAL);
-        }
-
-        $n = 0;
-        while ($st[7] == 0) {
-            clearstatcache();
-            $st = stat($cache_file);
-            usleep(1000*1);
-            $n++;
-            if ($n > 5) {
-                break;
-            }
-        }
-
-        if ($st == false || $n > 5) {
-            fclose($fp);
-            return Ethna::raiseError('stat failed', E_CACHE_NO_VALUE);
-        }
-        $value = fread($fp, $st[7]);
-        fclose($fp);
-
-        return unserialize($value);
-    }
-
-    /**
-     *  ¥­¥ã¥Ã¥·¥å¤ÎºÇ½ª¹¹¿·Æü»þ¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $key        ¥­¥ã¥Ã¥·¥å¥­¡¼
-     *  @param  string  $namespace  ¥­¥ã¥Ã¥·¥å¥Í¡¼¥à¥¹¥Ú¡¼¥¹
-     *  @return int     ºÇ½ª¹¹¿·Æü»þ(unixtime)
-     */
-    function getLastModified($key, $namespace = null)
-    {
-        $namespace = is_null($namespace) ? $this->namespace : $namespace;
-        $cache_file = $this->_getCacheFile($namespace, $key);
-
-        clearstatcache();
-        if (is_readable($cache_file) === false
-            || ($st = stat($cache_file)) === false) {
-            return Ethna::raiseError('fopen failed', E_CACHE_NO_VALUE);
-        }
-        return $st[9];
-    }
-
-    /**
-     *  Ãͤ¬¥­¥ã¥Ã¥·¥å¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $key        ¥­¥ã¥Ã¥·¥å¥­¡¼
-     *  @param  int     $lifetime   ¥­¥ã¥Ã¥·¥åÍ­¸ú´ü´Ö
-     *  @param  string  $namespace  ¥­¥ã¥Ã¥·¥å¥Í¡¼¥à¥¹¥Ú¡¼¥¹
-     */
-    function isCached($key, $lifetime = null, $namespace = null)
-    {
-        $namespace = is_null($namespace) ? $this->namespace : $namespace;
-        $cache_file = $this->_getCacheFile($namespace, $key);
-
-        // ¥é¥¤¥Õ¥¿¥¤¥à¥Á¥§¥Ã¥¯
-        clearstatcache();
-        if (is_readable($cache_file) === false
-            || ($st = stat($cache_file)) === false) {
-            return false;
-        }
-        if (is_null($lifetime) == false) {
-            if (($st[9]+$lifetime) < time()) {
-                return false;
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     *  ¥­¥ã¥Ã¥·¥å¤ËÃͤòÀßÄꤹ¤ë
-     *
-     *  @access public
-     *  @param  string  $key        ¥­¥ã¥Ã¥·¥å¥­¡¼
-     *  @param  mixed   $value      ¥­¥ã¥Ã¥·¥åÃÍ
-     *  @param  int     $timestamp  ¥­¥ã¥Ã¥·¥åºÇ½ª¹¹¿·»þ¹ï(unixtime)
-     *  @param  string  $namespace  ¥­¥ã¥Ã¥·¥å¥Í¡¼¥à¥¹¥Ú¡¼¥¹
-     */
-    function set($key, $value, $timestamp = null, $namespace = null)
-    {
-        $namespace = is_null($namespace) ? $this->namespace : $namespace;
-        $dir = $this->_getCacheDir($namespace, $key);
-
-        // ¥­¥ã¥Ã¥·¥å¥Ç¥£¥ì¥¯¥È¥ê¥Á¥§¥Ã¥¯
-        $r = Ethna_Util::mkdir($dir, 0777);
-        if ($r == false && is_dir($dir) == false) {
-            return Ethna::raiseError('mkdir(%s) failed', E_USER_WARNING, $dir);
-        }
-
-        $cache_file = $this->_getCacheFile($namespace, $key);
-        $fp = fopen($cache_file, "a+");
-        if ($fp == false) {
-            return Ethna::raiseError('fopen failed', E_CACHE_GENERAL);
-        }
-
-        // ¥í¥Ã¥¯
-        $timeout = 3;
-        while ($timeout > 0) {
-            $r = flock($fp, LOCK_EX|LOCK_NB);
-            if ($r) {
-                break;
-            }
-            $timeout--;
-            sleep(1);
-        }
-        if ($timeout <= 0) {
-            fclose($fp);
-            return Ethna::raiseError('fopen failed', E_CACHE_GENERAL);
-        }
-        rewind($fp);
-        ftruncate($fp, 0);
-        fwrite($fp, serialize($value));
-        fclose($fp);
-        Ethna_Util::chmod($cache_file, 0666);
-
-        if (is_null($timestamp)) {
-            // this could suppress warning
-            touch($cache_file);
-        } else {
-            touch($cache_file, $timestamp);
-        }
-
-        return 0;
-    }
-
-    /**
-     *  ¥­¥ã¥Ã¥·¥åÃͤòºï½ü¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $key        ¥­¥ã¥Ã¥·¥å¥­¡¼
-     *  @param  string  $namespace  ¥­¥ã¥Ã¥·¥å¥Í¡¼¥à¥¹¥Ú¡¼¥¹
-     */
-    function clear($key, $namespace = null)
-    {
-        $namespace = is_null($namespace) ? $this->namespace : $namespace;
-        $cache_file = $this->_getCacheFile($namespace, $key);
-
-        if (file_exists($cache_file)) {
-            unlink($cache_file);
-        }
-    }
-
-    /**
-     *  ¥­¥ã¥Ã¥·¥åÂоݥǥ£¥ì¥¯¥È¥ê¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     */
-    function _getCacheDir($namespace, $key)
-    {
-        $len = strlen($key);
-        // intentionally avoid using -2 or -4
-        $dir1 = substr($key, $len-4, 2);
-        if ($len-4 < 0 || strlen($dir1) < 2) {
-            $dir1 = "__dir1";
-        }
-        $dir2 = substr($key, $len-2, 2);
-        if ($len-2 < 0 || strlen($dir2) < 2) {
-            $dir2 = "__dir2";
-        }
-
-        $map = $this->config->get('cachemanager_localfile');
-        $tmp_key = $namespace . "::" . $key;
-        // PHP°Í¸:)
-        $dir = "default";
-
-        if (is_array($map)) {
-            foreach ($map as $key => $value) {
-                if (strncmp($key, $tmp_key, strlen($key)) == 0) {
-                    $dir = $value;
-                    break;
-                }
-            }
-        }
-        
-        return sprintf("%s/cache/%s/cache_%s/%s/%s", $this->backend->getTmpdir(), $dir, $this->_escape($namespace), $this->_escape($dir1), $this->_escape($dir2));
-    }
-
-    /**
-     *  ¥­¥ã¥Ã¥·¥å¥Õ¥¡¥¤¥ë¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     */
-    function _getCacheFile($namespace, $key)
-    {
-        return sprintf("%s/%s", $this->_getCacheDir($namespace, $key), $this->_escape($key));
-    }
-
-    /**
-     *  ¥­¡¼¤ò¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÍѤ˥¨¥¹¥±¡¼¥×¤¹¤ë
-     *
-     *  @access private
-     */
-    function _escape($string)
-    {
-        return preg_replace('/([^0-9A-Za-z_])/e', "sprintf('%%%02X', ord('\$1'))", $string);
-    }
-}
-?>
diff --git a/class/Plugin/Cachemanager/Ethna_Plugin_Cachemanager_Memcache.php b/class/Plugin/Cachemanager/Ethna_Plugin_Cachemanager_Memcache.php
deleted file mode 100644 (file)
index 9e301a7..0000000
+++ /dev/null
@@ -1,356 +0,0 @@
-<?php
-// vim: foldmethod=marker tabstop=4 shiftwidth=4 autoindent
-/**
- *  Ethna_Plugin_Cachemanager_Memcache.php
- *
- *  - Point Cut¤·¤¿¤¤¤È»×¤Ã¤¿¡ª
- *  - ¥­¥ã¥Ã¥·¥å¥­¡¼¤Ë¤Ï250ʸ»ú¤Þ¤Ç¤·¤«»ÈÍѤǤ­¤Ê¤¤¤Î¤ÇÃí°Õ¤·¤Æ²¼¤µ¤¤
- *
- *  @todo   ¥Í¡¼¥à¥¹¥Ú¡¼¥¹/¥­¥ã¥Ã¥·¥å¥­¡¼Ä¹¤Î¥¨¥é¡¼¥Ï¥ó¥É¥ê¥ó¥°
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @package    Ethna
- *  @version    $Id$
- */
-
-/**
- *  ¥­¥ã¥Ã¥·¥å¥Þ¥Í¡¼¥¸¥ã¥¯¥é¥¹(memcacheÈÇ)
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Cachemanager_Memcache extends Ethna_Plugin_Cachemanager
-{
-    /**#@+  @access private */
-
-    /** @var    object  MemCache    MemCache¥ª¥Ö¥¸¥§¥¯¥È */
-    var $memcache = null;
-
-    /** @var bool °µ½Ì¥Õ¥é¥° */
-    var $compress = true;
-
-    /**#@-*/
-
-    /**
-     *  Ethna_Plugin_Cachemanager_Memcache¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     */
-    function Ethna_Plugin_Cachemanager_Memcache(&$controller)
-    {
-        parent::Ethna_Plugin_Cachemanager($controller);
-        $this->memcache_pool = array();
-    }
-
-    /**
-     *  memcache¥­¥ã¥Ã¥·¥å¥ª¥Ö¥¸¥§¥¯¥È¤òÀ¸À®¡¢¼èÆÀ¤¹¤ë
-     *
-     *  @access protected
-     */
-    function _getMemcache($cache_key, $namespace = null)
-    {
-        $retry = $this->config->get('memcache_retry');
-        if ($retry == "") {
-            $retry = 3;
-        }
-        $timeout = $this->config->get('memcache_timeout');
-        if ($timeout == "") {
-            $timeout = 3;
-        }
-        $r = false;
-
-        list($host, $port) = $this->_getMemcacheInfo($cache_key, $namespace);
-        if (isset($this->memcache_pool["$host:$port"])) {
-            // activate
-            $this->memcache = $this->memcache_pool["$host:$port"];
-            return $this->memcache;
-        }
-        $this->memcache_pool["$host:$port"] =& new MemCache();
-
-        while ($retry > 0) {
-            if ($this->config->get('memcache_use_connect')) {
-                $r = $this->memcache_pool["$host:$port"]->connect($host, $port, $timeout);
-            } else {
-                $r = $this->memcache_pool["$host:$port"]->pconnect($host, $port, $timeout);
-            }
-            if ($r) {
-                break;
-            }
-            sleep(1);
-            $retry--;
-        }
-        if ($r == false) {
-            trigger_error("memcache: connection failed");
-            $this->memcache_pool["$host:$port"] = null;
-        }
-
-        $this->memcache = $this->memcache_pool["$host:$port"];
-        return $this->memcache;
-    }
-
-    /**
-     *  memcacheÀܳ¾ðÊó¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access protected
-     *  @todo   $cache_key¤«¤é$index¤ò·è¤á¤ëÊýË¡¤òÊѹ¹¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë
-     */
-    function _getMemcacheInfo($cache_key, $namespace)
-    {
-        $namespace = is_null($namespace) ? $this->namespace : $namespace;
-
-        $memcache_info = $this->config->get('memcache');
-        $default_memcache_host = $this->config->get('memcache_host');
-        if ($default_memcache_host == "") {
-            $default_memcache_host = "localhost";
-        }
-        $default_memcache_port = $this->config->get('memcache_port');
-        if ($default_memcache_port == "") {
-            $default_memcache_port = 11211;
-        }
-        if ($memcache_info == null || isset($memcache_info[$namespace]) == false) {
-            return array($default_memcache_host, $default_memcache_port);
-        }
-
-        // namespace/cache_key¤ÇÀܳÀè¤ò·èÄê
-        $n = count($memcache_info[$namespace]);
-
-        $index = $cache_key % $n;
-        return array(
-            isset($memcache_info[$namespace][$index]['memcache_host']) ?
-                $memcache_info[$namespace][$index]['memcache_host'] :
-                'localhost',
-            isset($memcache_info[$namespace][$index]['memcache_port']) ?
-                $memcache_info[$namespace][$index]['memcache_port'] :
-                11211,
-        );
-
-        // for safe
-        return array($default_memcache_host, $default_memcache_port);
-    }
-
-    /**
-     *  ¥­¥ã¥Ã¥·¥å¤ËÀßÄꤵ¤ì¤¿Ãͤò¼èÆÀ¤¹¤ë
-     *
-     *  ¥­¥ã¥Ã¥·¥å¤ËÃͤ¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¥­¥ã¥Ã¥·¥åÃÍ
-     *  ¤¬Ìá¤êÃͤȤʤ롣¥­¥ã¥Ã¥·¥å¤ËÃͤ¬Ìµ¤¤¾ì¹ç¤älifetime
-     *  ¤ò²á¤®¤Æ¤¤¤ë¾ì¹ç¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤ÏPEAR_Error
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¤¬Ìá¤êÃͤȤʤ롣
-     *
-     *  @access public
-     *  @param  string  $key        ¥­¥ã¥Ã¥·¥å¥­¡¼
-     *  @param  int     $lifetime   ¥­¥ã¥Ã¥·¥åÍ­¸ú´ü´Ö
-     *  @param  string  $namespace  ¥­¥ã¥Ã¥·¥å¥Í¡¼¥à¥¹¥Ú¡¼¥¹
-     *  @return array   ¥­¥ã¥Ã¥·¥åÃÍ
-     */
-    function get($key, $lifetime = null, $namespace = null)
-    {
-        $this->_getMemcache($key, $namespace);
-        if ($this->memcache == null) {
-            return Ethna::raiseError('memcache server not available', E_CACHE_NO_VALUE);
-        }
-
-        $namespace = is_null($namespace) ? $this->namespace : $namespace;
-
-        $cache_key = $this->_getCacheKey($namespace, $key);
-        if ($cache_key == null) {
-            return Ethna::raiseError('invalid cache key (too long?)', E_CACHE_NO_VALUE);
-        }
-
-        $value = $this->memcache->get($cache_key);
-        if ($value == null) {
-            return Ethna::raiseError('no such cache', E_CACHE_NO_VALUE);
-        }
-        $time = $value['time'];
-        $data = $value['data'];
-
-        // ¥é¥¤¥Õ¥¿¥¤¥à¥Á¥§¥Ã¥¯
-        if (is_null($lifetime) == false) {
-            if (($time+$lifetime) < time()) {
-                return Ethna::raiseError('lifetime expired', E_CACHE_EXPIRED);
-            }
-        }
-
-        return $data;
-    }
-
-    /**
-     *  ¥­¥ã¥Ã¥·¥å¤ÎºÇ½ª¹¹¿·Æü»þ¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $key        ¥­¥ã¥Ã¥·¥å¥­¡¼
-     *  @param  string  $namespace  ¥­¥ã¥Ã¥·¥å¥Í¡¼¥à¥¹¥Ú¡¼¥¹
-     *  @return int     ºÇ½ª¹¹¿·Æü»þ(unixtime)
-     */
-    function getLastModified($key, $namespace = null)
-    {
-        $this->_getMemcache($key, $namespace);
-        if ($this->memcache == null) {
-            return Ethna::raiseError('memcache server not available', E_CACHE_NO_VALUE);
-        }
-
-        $namespace = is_null($namespace) ? $this->namespace : $namespace;
-
-        $cache_key = $this->_getCacheKey($namespace, $key);
-        if ($cache_key == null) {
-            return Ethna::raiseError('invalid cache key (too long?)', E_CACHE_NO_VALUE);
-        }
-
-        $value = $this->memcache->get($cache_key);
-
-        return $value['time'];
-    }
-
-    /**
-     *  Ãͤ¬¥­¥ã¥Ã¥·¥å¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $key        ¥­¥ã¥Ã¥·¥å¥­¡¼
-     *  @param  int     $lifetime   ¥­¥ã¥Ã¥·¥åÍ­¸ú´ü´Ö
-     *  @param  string  $namespace  ¥­¥ã¥Ã¥·¥å¥Í¡¼¥à¥¹¥Ú¡¼¥¹
-     */
-    function isCached($key, $lifetime = null, $namespace = null)
-    {
-        $r = $this->get($key, $lifetime, $namespace);
-
-        return PEAR::isError($r) ? false: true;
-    }
-
-    /**
-     *  ¥­¥ã¥Ã¥·¥å¤ËÃͤòÀßÄꤹ¤ë
-     *
-     *  @access public
-     *  @param  string  $key        ¥­¥ã¥Ã¥·¥å¥­¡¼
-     *  @param  mixed   $value      ¥­¥ã¥Ã¥·¥åÃÍ
-     *  @param  int     $timestamp  ¥­¥ã¥Ã¥·¥åºÇ½ª¹¹¿·»þ¹ï(unixtime)
-     *  @param  string  $namespace  ¥­¥ã¥Ã¥·¥å¥Í¡¼¥à¥¹¥Ú¡¼¥¹
-     */
-    function set($key, $value, $timestamp = null, $namespace = null)
-    {
-        $this->_getMemcache($key, $namespace);
-        if ($this->memcache == null) {
-            return Ethna::raiseError('memcache server not available', E_CACHE_NO_VALUE);
-        }
-
-        $namespace = is_null($namespace) ? $this->namespace : $namespace;
-
-        $cache_key = $this->_getCacheKey($namespace, $key);
-        if ($cache_key == null) {
-            return Ethna::raiseError('invalid cache key (too long?)', E_CACHE_NO_VALUE);
-        }
-
-        $time = $timestamp ? $timestamp : time();
-        $this->memcache->set($cache_key, array('time' => $time, 'data' => $value), $this->compress ? MEMCACHE_COMPRESSED : null);
-    }
-
-    /**
-     *  ¥­¥ã¥Ã¥·¥åÃͤòºï½ü¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $key        ¥­¥ã¥Ã¥·¥å¥­¡¼
-     *  @param  string  $namespace  ¥­¥ã¥Ã¥·¥å¥Í¡¼¥à¥¹¥Ú¡¼¥¹
-     */
-    function clear($key, $namespace = null)
-    {
-        $this->_getMemcache($key, $namespace);
-        if ($this->memcache == null) {
-            return Ethna::raiseError('memcache server not available', E_CACHE_NO_VALUE);
-        }
-
-        $namespace = is_null($namespace) ? $this->namespace : $namespace;
-
-        $cache_key = $this->_getCacheKey($namespace, $key);
-        if ($cache_key == null) {
-            return Ethna::raiseError('invalid cache key (too long?)', E_CACHE_NO_VALUE);
-        }
-
-        $this->memcache->delete($cache_key, -1);
-    }
-
-    /**
-     *  ¥­¥ã¥Ã¥·¥å¥Ç¡¼¥¿¤ò¥í¥Ã¥¯¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $key        ¥­¥ã¥Ã¥·¥å¥­¡¼
-     *  @param  int     $timeout    ¥í¥Ã¥¯¥¿¥¤¥à¥¢¥¦¥È
-     *  @param  string  $namespace  ¥­¥ã¥Ã¥·¥å¥Í¡¼¥à¥¹¥Ú¡¼¥¹
-     *  @return bool    true:À®¸ù false:¼ºÇÔ
-     */
-    function lock($key, $timeout = 5, $namespace = null)
-    {
-        $this->_getMemcache($key, $namespace);
-        if ($this->memcache == null) {
-            return Ethna::raiseError('memcache server not available', E_CACHE_LOCK_ERROR);
-        }
-
-        // ¥í¥Ã¥¯ÍÑ¥­¥ã¥Ã¥·¥å¥Ç¡¼¥¿¤òÍøÍѤ¹¤ë
-        $namespace = is_null($namespace) ? $this->namespace : $namespace;
-        $cache_key = "lock::" . $this->_getCacheKey($namespace, $key);
-        $lock_lifetime = 30;
-
-        do {
-            $r = $this->memcache->add($cache_key, true, false, $lock_lifetime);
-            if ($r != false) {
-                break;
-            }
-            sleep(1);
-            $timeout--;
-        } while ($timeout > 0);
-
-        if ($r == false) {
-            return Ethna::raiseError('lock timeout', E_CACHE_LOCK_TIMEOUT);
-        }
-
-        return true;
-    }
-
-    /**
-     *  ¥­¥ã¥Ã¥·¥å¥Ç¡¼¥¿¤Î¥í¥Ã¥¯¤ò²ò½ü¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $key        ¥­¥ã¥Ã¥·¥å¥­¡¼
-     *  @param  string  $namespace  ¥­¥ã¥Ã¥·¥å¥Í¡¼¥à¥¹¥Ú¡¼¥¹
-     *  @return bool    true:À®¸ù false:¼ºÇÔ
-     */
-    function unlock($key, $namespace = null)
-    {
-        $this->_getMemcache($key, $namespace);
-        if ($this->memcache == null) {
-            return Ethna::raiseError('memcache server not available', E_CACHE_LOCK_ERROR);
-        }
-
-        $namespace = is_null($namespace) ? $this->namespace : $namespace;
-        $cache_key = "lock::" . $this->_getCacheKey($namespace, $key);
-
-        $this->memcache->delete($cache_key, -1);
-    }
-
-    /**
-     *  ¥Í¡¼¥à¥¹¥Ú¡¼¥¹¤«¤é¥­¥ã¥Ã¥·¥å¥­¡¼¤òÀ¸À®¤¹¤ë
-     *
-     *  @access private
-     */
-    function _getCacheKey($namespace, $key)
-    {
-        // ¾¯¤·Íð˽¤À¤±¤É...
-        $key = str_replace(":", "_", $key);
-        $cache_key = $namespace . "::" . $key;
-        if (strlen($cache_key) > 250) {
-            return null;
-        }
-        return $cache_key;
-    }
-
-    /**
-     * °µ½Ì¥Õ¥é¥°¤òΩ¤Æ¤ë
-     *
-     * MySQL¤Ê¤É¤¤¤¯¤Ä¤«¤Î»Ò¥¯¥é¥¹¤ÇÍ­¸ú
-     * 
-     * @access public
-     * @param bool $flag ¥Õ¥é¥°
-     */
-    function setCompress($flag) {
-        $this->compress = $flag;
-    }
-}
-?>
diff --git a/class/Plugin/Csrf/Ethna_Plugin_Csrf_Session.php b/class/Plugin/Csrf/Ethna_Plugin_Csrf_Session.php
deleted file mode 100644 (file)
index adc9941..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Csrf_Session.php
- *
- *  @author     Keita Arai <cocoiti@comio.info>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Csrf_Session
-/**
- *  CSRFÂкö
- *
- *  CSRFÂкö¤ò¥È¡¼¥¯¥ó¤òÍѤ¤¤ÆÂкö¤¹¤ë¤¿¤á¤Î¥³¡¼¥É
- *
- *  @author     Keita Arai <cocoiti@comio.info>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Csrf_Session extends Ethna_Plugin_Csrf
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    object  Ethna_Session    ¥»¥Ã¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È */
-    var $session;
-    
-    /**#@-*/
-
-
-    /**
-     *  Ethna_Plugin_Csrf¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Controller    &$controller    ¥³¥ó¥È¥í¡¼¥é¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function Ethna_Plugin_Csrf_Session(&$controller)
-    {
-        parent::Ethna_Plugin_Csrf($controller);
-
-        // ¥ª¥Ö¥¸¥§¥¯¥È¤ÎÀßÄê
-        $this->session =& $this->controller->getSession();
-    }
-    
-    /**
-     *  ¥È¡¼¥¯¥ó¤òView¤È¥í¡¼¥«¥ë¥Õ¥¡¥¤¥ë¤Ë¥»¥Ã¥È¤¹¤ë
-     *
-     *  @access public
-     *  @return boolean  À®¸ù¤«¼ºÇÔ¤«
-     */
-    function set()
-    {
-        if (! $this->session->isStart()) {
-            $this->session->start();
-        }
-
-        $token = $this->session->get($this->token_name);
-        if ($token !== null) {
-            return true;
-        }
-
-        $key = $this->_generateKey();
-        $this->session->set($this->token_name, $key); 
-
-        return true;       
-    }
-
-    /**
-     *  ¥È¡¼¥¯¥óID¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return string ¥È¡¼¥¯¥óID¤òÊÖ¤¹¡£
-     */
-    function get()
-    {
-        if (! $this->session->isStart()) {
-            $this->session->start();
-        }
-        
-        return $this->session->get($this->token_name);
-    }
-
-    /**
-     *  ¥È¡¼¥¯¥óID¤òºï½ü¤¹¤ë
-     *
-     *  @access public
-     */
-    function remove()
-    {
-        if (! $this->session->isStart()) {
-            $this->session->start();
-        }
-        $this->session->remove($this->token_name);        
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Ethna_Plugin_Cachemanager.php b/class/Plugin/Ethna_Plugin_Cachemanager.php
deleted file mode 100644 (file)
index 50ba43a..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-<?php
-// vim: foldmethod=marker tabstop=4 shiftwidth=4 autoindent
-/**
- *  Ethna_Plugin_Cachemanager.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-/**
- *  ¥­¥ã¥Ã¥·¥å¥Þ¥Í¡¼¥¸¥ã¥×¥é¥°¥¤¥ó¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Cachemanager
-{
-    /**#@+  @access private */
-
-    /** @var    string  ¸½ºß¤Î¥Í¡¼¥à¥¹¥Ú¡¼¥¹ */
-    var $namespace = '';
-
-    /** @var    object  Ethna_Backend       backend¥ª¥Ö¥¸¥§¥¯¥È */
-    var $backend;
-
-    /** @var    object  Ethna_Config        ÀßÄꥪ¥Ö¥¸¥§¥¯¥È    */
-    var $config;
-
-    /**#@-*/
-
-    /**
-     *  Ethna_Plugin_Cachemanager¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     */
-    function Ethna_Plugin_Cachemanager(&$controller)
-    {
-        $this->controller =& $controller;
-        $this->backend =& $this->controller->getBackend();
-        $this->config =& $this->controller->getConfig();
-    }
-
-    /**
-     *  ¥­¥ã¥Ã¥·¥å¥Í¡¼¥à¥¹¥Ú¡¼¥¹¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return string  ¸½ºß¤Î¥­¥ã¥Ã¥·¥å¥Í¡¼¥à¥¹¥Ú¡¼¥¹
-     */
-    function getNamespace($namespace)
-    {
-        return $this->namespace;
-    }
-
-    /**
-     *  ¥­¥ã¥Ã¥·¥å¥Í¡¼¥à¥¹¥Ú¡¼¥¹¤òÀßÄꤹ¤ë
-     *
-     *  @access public
-     *  @param  string  $namespace  ¥Í¡¼¥à¥¹¥Ú¡¼¥¹
-     */
-    function setNamespace($namespace)
-    {
-        $this->namespace = $namespace;
-    }
-
-    /**
-     *  ¥­¥ã¥Ã¥·¥å¤ËÀßÄꤵ¤ì¤¿Ãͤò¼èÆÀ¤¹¤ë
-     *
-     *  ¥­¥ã¥Ã¥·¥å¤ËÃͤ¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¥­¥ã¥Ã¥·¥åÃÍ
-     *  ¤¬Ìá¤êÃͤȤʤ롣¥­¥ã¥Ã¥·¥å¤ËÃͤ¬Ìµ¤¤¾ì¹ç¤älifetime
-     *  ¤ò²á¤®¤Æ¤¤¤ë¾ì¹ç¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤ÏPEAR_Error
-     *  ¥ª¥Ö¥¸¥§¥¯¥È¤¬Ìá¤êÃͤȤʤ롣
-     *
-     *  @access public
-     *  @param  string  $key        ¥­¥ã¥Ã¥·¥å¥­¡¼
-     *  @param  int     $lifetime   ¥­¥ã¥Ã¥·¥åÍ­¸ú´ü´Ö
-     *  @param  string  $namespace  ¥­¥ã¥Ã¥·¥å¥Í¡¼¥à¥¹¥Ú¡¼¥¹
-     *  @return mixed   ¥­¥ã¥Ã¥·¥åÃÍ
-     */
-    function get($key, $lifetime = null, $namespace = null)
-    {
-    }
-
-    /**
-     *  ¥­¥ã¥Ã¥·¥å¤ÎºÇ½ª¹¹¿·Æü»þ¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $key        ¥­¥ã¥Ã¥·¥å¥­¡¼
-     *  @param  string  $namespace  ¥­¥ã¥Ã¥·¥å¥Í¡¼¥à¥¹¥Ú¡¼¥¹
-     *  @return int     ºÇ½ª¹¹¿·Æü»þ(unixtime)
-     */
-    function getLastModified($key, $namespace = null)
-    {
-    }
-
-    /**
-     *  ¥­¥ã¥Ã¥·¥å¤ËÃͤòÀßÄꤹ¤ë
-     *
-     *  @access public
-     *  @param  string  $key        ¥­¥ã¥Ã¥·¥å¥­¡¼
-     *  @param  mixed   $value      ¥­¥ã¥Ã¥·¥åÃÍ
-     *  @param  int     $timestamp  ¥­¥ã¥Ã¥·¥åºÇ½ª¹¹¿·»þ¹ï(unixtime)
-     *  @param  string  $namespace  ¥­¥ã¥Ã¥·¥å¥Í¡¼¥à¥¹¥Ú¡¼¥¹
-     */
-    function set($key, $value, $timestamp = null, $namespace = null)
-    {
-    }
-
-    /**
-     *  Ãͤ¬¥­¥ã¥Ã¥·¥å¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $key        ¥­¥ã¥Ã¥·¥å¥­¡¼
-     *  @param  int     $lifetime   ¥­¥ã¥Ã¥·¥åÍ­¸ú´ü´Ö
-     *  @param  string  $namespace  ¥­¥ã¥Ã¥·¥å¥Í¡¼¥à¥¹¥Ú¡¼¥¹
-     */
-    function isCached($key, $timestamp = null, $namespace = null)
-    {
-    }
-
-    /**
-     *  ¥­¥ã¥Ã¥·¥å¤«¤éÃͤòºï½ü¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $key        ¥­¥ã¥Ã¥·¥å¥­¡¼
-     *  @param  string  $namespace  ¥­¥ã¥Ã¥·¥å¥Í¡¼¥à¥¹¥Ú¡¼¥¹
-     */
-    function clear($key, $namespace = null)
-    {
-    }
-
-    /**
-     *  ¥­¥ã¥Ã¥·¥å¥Ç¡¼¥¿¤ò¥í¥Ã¥¯¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $key        ¥­¥ã¥Ã¥·¥å¥­¡¼
-     *  @param  int     $timeout    ¥í¥Ã¥¯¥¿¥¤¥à¥¢¥¦¥È
-     *  @param  string  $namespace  ¥­¥ã¥Ã¥·¥å¥Í¡¼¥à¥¹¥Ú¡¼¥¹
-     *  @return bool    true:À®¸ù false:¼ºÇÔ
-     */
-    function lock($key, $timeout = 5, $namespace = null)
-    {
-        return false;
-    }
-
-    /**
-     *  ¥­¥ã¥Ã¥·¥å¥Ç¡¼¥¿¤Î¥í¥Ã¥¯¤ò²ò½ü¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $key        ¥­¥ã¥Ã¥·¥å¥­¡¼
-     *  @param  string  $namespace  ¥­¥ã¥Ã¥·¥å¥Í¡¼¥à¥¹¥Ú¡¼¥¹
-     *  @return bool    true:À®¸ù false:¼ºÇÔ
-     */
-    function unlock($key, $namespace = null)
-    {
-        return false;
-    }
-
-    /**
-     * °µ½Ì¥Õ¥é¥°¤òΩ¤Æ¤ë
-     *
-     * MySQL¤Ê¤É¤¤¤¯¤Ä¤«¤Î»Ò¥¯¥é¥¹¤ÇÍ­¸ú
-     * 
-     * @access public
-     * @param bool $flag ¥Õ¥é¥°
-     */
-    function setCompress($flag) {
-        return false;
-    }
-}
-?>
diff --git a/class/Plugin/Ethna_Plugin_Csrf.php b/class/Plugin/Ethna_Plugin_Csrf.php
deleted file mode 100644 (file)
index a63fbac..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Csrf.php
- *
- *  @author     Keita Arai <cocoiti@comio.info>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Csrf
-/**
- *  CSRFÂкö´ðÄ쥯¥é¥¹
- *
- *  CSRFÂкö¤ò¥È¡¼¥¯¥ó¤òÍѤ¤¤ÆÂкö¤¹¤ë¤¿¤á¤Î¥³¡¼¥É
- *
- *  @author     Keita Arai <cocoiti@comio.info>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Csrf
-{
-    /**#@+
-     *  @access private
-     */
-
-    var $controller;
-
-    /** @var    object  Ethna_Controller    controller¥ª¥Ö¥¸¥§¥¯¥È($controller¤Î¾Êά·Á) */
-    var $ctl;
-
-    /** @var    object  Ethna_Config        ÀßÄꥪ¥Ö¥¸¥§¥¯¥È */
-    var $config;
-
-    /** @var    object  Ethna_Logger        ¥í¥°¥ª¥Ö¥¸¥§¥¯¥È */
-    var $logger;
-    
-    /** @var    string  ¶¦Í­¥È¡¼¥¯¥ó̾ */
-    var $token_name = 'ethna_csrf';
-    
-    /**#@-*/
-
-
-    /**
-     *  Ethna_Plugin_Csrf¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Controller    &$controller    ¥³¥ó¥È¥í¡¼¥é¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function Ethna_Plugin_Csrf(&$controller)
-    {
-        // ¥ª¥Ö¥¸¥§¥¯¥È¤ÎÀßÄê
-        $this->controller =& $controller;
-        $this->ctl =& $this->controller;
-
-        $this->config =& $controller->getConfig();
-        $this->logger =& $this->controller->getLogger();
-    }
-    
-    /**
-     *  ¥È¡¼¥¯¥ó¤òView¤È¥í¡¼¥«¥ë¥Õ¥¡¥¤¥ë¤Ë¥»¥Ã¥È¤¹¤ë
-     *
-     *  @access public
-     *  @return string  ¥È¡¼¥¯¥ó¤ÎKey
-     */
-    function set()
-    {
-
-    }
-
-    /**
-     *  ¥È¡¼¥¯¥óID¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return string ¥È¡¼¥¯¥óID¤òÊÖ¤¹¡£
-     */
-    function get()
-    {
-
-    }
-
-    /**
-     *  ¥È¡¼¥¯¥óID¤òºï½ü¤¹¤ë
-     *
-     *  @access public
-     *  @return string ¥È¡¼¥¯¥óID¤òÊÖ¤¹¡£
-     */
-    function remove()
-    {
-
-    }
-
-    /**
-     *  ¥È¡¼¥¯¥ó̾¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return string ¥È¡¼¥¯¥ó̾¤òÊÖ¤¹¡£
-     */
-    function getName()
-    {
-        return $this->token_name;
-    }
-
-    /**
-     *  ¥È¡¼¥¯¥óID¤ò¸¡¾Ú¤¹¤ë
-     *
-     *  @access public
-     *  @return mixed  Àµ¾ï¤Î¾ì¹ç¤Ïtrue, ÉÔÀµ¤Î¾ì¹ç¤Ïfalse
-     */
-    function isValid()
-    {
-        $token = $this->_get_token();
-
-        $local_token = $this->get();
-
-        if (is_null($local_token)) {
-            return false;
-        }
-
-        if ($token === $local_token) {
-            return true;
-        }
-
-        return false;
-    }
-
-    /**
-     *  ¥­¡¼¤òÀ¸À®¤¹¤ë
-     *
-     *  @access public
-     *  @return string  keyname
-     */
-    function _generateKey()
-    {
-        return Ethna_Util::getRandom(32);
-    }
-
-    /**
-     *  ¥ê¥¯¥¨¥¹¥È¤«¤é¥È¡¼¥¯¥óID¤È¥ê¥¯¥¨¥¹¥ÈID¤òÈ´¤­½Ð¤¹
-     *
-     *  @access public
-     *  @return mixed  Àµ¾ï¤Î¾ì¹ç¤Ï¥È¡¼¥¯¥ó̾, ÉÔÀµ¤Î¾ì¹ç¤Ïfalse
-     */
-    function _get_token()
-    {
-        $token_name = $this->getName();
-        if (strcasecmp($_SERVER['REQUEST_METHOD'], 'post') === 0) {
-            return isset($_POST[$token_name]) ? $_POST[$token_name] : null;
-        } else {
-            return isset($_GET[$token_name]) ? $_GET[$token_name] : null;
-        }
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Ethna_Plugin_Filter.php b/class/Plugin/Ethna_Plugin_Filter.php
deleted file mode 100644 (file)
index 841eee6..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Filter.php
- *
- *  @author     Kazuhiro Hosoi <hosoi@gree.co.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Filter
-/**
- *  ¥×¥é¥°¥¤¥ó¥Õ¥£¥ë¥¿´ðÄ쥯¥é¥¹
- *
- *  Plugin¼ÂÁõ¤Ë¤è¤ê¡¤Ethna_Filter¤Î¸å·Ñ¤È¤·¤Æ¡¤
- *  Ethna_Plugin_Filter¤ËÄɲä·¤Þ¤·¤¿¡¥´ðËÜŪ¤ËEthna_Filter¤ÈƱ¤¸¤Ç¤¹¡¥
- *  
- *  Mojavi¤Î¿¿»÷¤Ç¤¹¡Ê¤­¤Ã¤Ñ¤ê¡Ë¡£¥¢¥¯¥·¥ç¥ó¼Â¹ÔÁ°¤Ë³Æ¼ï½èÍý¤ò¹Ô¤¦¤³¤È¤¬
- *  ½ÐÍè¤Þ¤¹¡£
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Filter
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    object  Ethna_Controller    controller¥ª¥Ö¥¸¥§¥¯¥È */
-    var $controller;
-
-    /** @var    object  Ethna_Controller    controller¥ª¥Ö¥¸¥§¥¯¥È($controller¤Î¾Êά·Á) */
-    var $ctl;
-
-    /** @var    object  Ethna_Config        ÀßÄꥪ¥Ö¥¸¥§¥¯¥È */
-    var $config;
-
-    /** @var    object  Ethna_Logger        ¥í¥°¥ª¥Ö¥¸¥§¥¯¥È */
-    var $logger;
-
-    /**#@-*/
-
-
-    /**
-     *  Ethna_Plugin_Filter¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Controller    &$controller    ¥³¥ó¥È¥í¡¼¥é¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function Ethna_Plugin_Filter(&$controller)
-    {
-        // ¥ª¥Ö¥¸¥§¥¯¥È¤ÎÀßÄê
-        $this->controller =& $controller;
-        $this->ctl =& $this->controller;
-
-        $this->config =& $controller->getConfig();
-        $this->logger =& $this->controller->getLogger();
-    }
-
-    /**
-     *  ¼Â¹ÔÁ°¥Õ¥£¥ë¥¿
-     *
-     *  @access public
-     *  @return Ethna_Error:¼Â¹ÔÃæ»ß any:Àµ¾ï½ªÎ»
-     */
-    function preFilter()
-    {
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¼Â¹ÔÁ°¥Õ¥£¥ë¥¿
-     *
-     *  @access public
-     *  @param  string  $action_name    ¼Â¹Ô¤µ¤ì¤ë¥¢¥¯¥·¥ç¥ó̾
-     *  @return string  null:Àµ¾ï½ªÎ» (string):¼Â¹Ô¤¹¤ë¥¢¥¯¥·¥ç¥ó̾¤òÊѹ¹
-     */
-    function preActionFilter($action_name)
-    {
-        return null;
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¼Â¹Ô¸å¥Õ¥£¥ë¥¿
-     *
-     *  @access public
-     *  @param  string  $action_name    ¼Â¹Ô¤µ¤ì¤¿¥¢¥¯¥·¥ç¥ó̾
-     *  @param  string  $forward_name   ¼Â¹Ô¤µ¤ì¤¿¥¢¥¯¥·¥ç¥ó¤«¤é¤ÎÌá¤êÃÍ
-     *  @return string  null:Àµ¾ï½ªÎ» (string):Á«°Ü̾¤òÊѹ¹
-     */
-    function postActionFilter($action_name, $forward_name)
-    {
-        return null;
-    }
-
-    /**
-     *  ¼Â¹Ô¸å¥Õ¥£¥ë¥¿
-     *
-     *  @access public
-     *  @return Ethna_Error:¼Â¹ÔÃæ»ß any:Àµ¾ï½ªÎ»
-     */
-    function postFilter()
-    {
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Ethna_Plugin_Generator.php b/class/Plugin/Ethna_Plugin_Generator.php
deleted file mode 100644 (file)
index e6fa8c5..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Generator.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Generator
-/**
- *  ¥¹¥±¥ë¥È¥óÀ¸À®¥×¥é¥°¥¤¥ó
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Generator
-{
-    /** @var    object  Ethna_Controller    ¥¹¥±¥ë¥È¥óÀ¸À®¤Ë»È¤¦¥³¥ó¥È¥í¡¼¥é */
-    var $ctl;
-
-    /**
-     *  ¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     */
-    function Ethna_Plugin_Generator(&$controller, $type, $name)
-    {
-        // Ethna_Generator¤Çplugin¤ò¼èÆÀ¤¹¤ë¤È¤­¤Ë»È¤Ã¤¿¥³¥ó¥È¥í¡¼¥é
-        // ex, add-project¤Ç¤ÏEthna_Controller, app-action¤Ç¤ÏApp_Controller
-        $this->ctl =& $controller;
-    }
-
-    /**
-     *  ¥¹¥±¥ë¥È¥ó¥Õ¥¡¥¤¥ë¤ÎÀäÂХѥ¹¤ò²ò·è¤¹¤ë
-     *
-     *  @access private
-     *  @param  string  $skel   ¥¹¥±¥ë¥È¥ó¥Õ¥¡¥¤¥ë
-     */
-    function _resolveSkelfile($skel)
-    {
-        $file = realpath($skel);
-        if (file_exists($file)) {
-            return $file;
-        }
-
-        // ¥¢¥×¥ê¤Î skel ¥Ç¥£¥ì¥¯¥È¥ê
-        $base = $this->ctl->getBasedir();
-        $file = "$base/skel/$skel";
-        if (file_exists($file)) {
-            return $file;
-        }
-
-        // EthnaËÜÂΤΠskel ¥Ç¥£¥ì¥¯¥È¥ê
-        $base = dirname(dirname(dirname(__FILE__)));
-        $file = "$base/skel/$skel";
-        if (file_exists($file)) {
-            return $file;
-        }
-
-        return false;
-    }
-
-    /**
-     *  ¥¹¥±¥ë¥È¥ó¥Õ¥¡¥¤¥ë¤Ë¥Þ¥¯¥í¤òŬÍѤ·¤Æ¥Õ¥¡¥¤¥ë¤òÀ¸À®¤¹¤ë
-     *
-     *  @access private
-     *  @param  string  $skel       ¥¹¥±¥ë¥È¥ó¥Õ¥¡¥¤¥ë
-     *  @param  string  $entity     À¸À®¥Õ¥¡¥¤¥ë̾
-     *  @param  array   $macro      ÃÖ´¹¥Þ¥¯¥í
-     *  @param  bool    $overwrite  ¾å½ñ¤­¥Õ¥é¥°
-     *  @return bool    true:Àµ¾ï½ªÎ» false:¥¨¥é¡¼
-     */
-    function _generateFile($skel, $entity, $macro, $overwrite = false)
-    {
-        if (file_exists($entity)) {
-            if ($overwrite === false) {
-                printf("file [%s] already exists -> skip\n", $entity);
-                return true;
-            } else {
-                printf("file [%s] already exists, to be overwriten.\n", $entity);
-            }
-        }
-
-        $resolved = $this->_resolveSkelfile($skel);
-        if ($resolved === false) {
-            printf("skelton file [%s] not found.\n", $skel);
-            return false;
-        } else {
-            $skel = $resolved;
-        }
-
-        $rfp = fopen($skel, "r");
-        if ($rfp == null) {
-            return false;
-        }
-        $wfp = fopen($entity, "w");
-        if ($wfp == null) {
-            fclose($rfp);
-            return false;
-        }
-
-        for (;;) {
-            $s = fread($rfp, 4096);
-            if (strlen($s) == 0) {
-                break;
-            }
-
-            foreach ($macro as $k => $v) {
-                $s = preg_replace("/{\\\$$k}/", $v, $s);
-            }
-            fwrite($wfp, $s);
-        }
-
-        fclose($wfp);
-        fclose($rfp);
-
-        $st = stat($skel);
-        if (chmod($entity, $st[2]) == false) {
-            return false;
-        }
-
-        printf("file generated [%s -> %s]\n", $skel, $entity);
-
-        return true;
-    }
-
-    /**
-     *  ¥æ¡¼¥¶ÄêµÁ¤Î¥Þ¥¯¥í¤òÀßÄꤹ¤ë(~/.ethna)
-     *
-     *  @access private
-     */
-    function _getUserMacro()
-    {
-        if (isset($_SERVER['USERPROFILE']) && is_dir($_SERVER['USERPROFILE'])) {
-            $home = $_SERVER['USERPROFILE'];
-        } else {
-            $home = $_SERVER['HOME'];
-        }
-
-        if (is_file("$home/.ethna") == false) {
-            return array();
-        }
-
-        $user_macro = parse_ini_file("$home/.ethna");
-        return $user_macro;
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Ethna_Plugin_Handle.php b/class/Plugin/Ethna_Plugin_Handle.php
deleted file mode 100644 (file)
index 8dc72e0..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Handle.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-require_once 'Console/Getopt.php';
-
-// {{{ Ethna_Plugin_Handle
-/**
- *  ¥³¥Þ¥ó¥É¥é¥¤¥ó¥Ï¥ó¥É¥é¥×¥é¥°¥¤¥ó¤Î´ðÄ쥯¥é¥¹
- *  
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Handle
-{
-    /** @var    handler's id */
-    var $id;
-
-    /** @var    command line arguments */
-    var $arg_list;
-
-    /**
-     *  Ethna_Handle constructor (stub for php4)
-     *
-     *  @access public
-     */
-    function Ethna_Plugin_Handle(&$controller, $type, $name)
-    {
-        $id = $name;
-        $id = preg_replace('/^([A-Z])/e', "strtolower('\$1')", $id);
-        $id = preg_replace('/([A-Z])/e', "'-' . strtolower('\$1')", $id);
-        $this->id = $id;
-    }
-
-    /**
-     *  get handler-id
-     *
-     *  @access public
-     */
-    function getId()
-    {
-        return $this->id;
-    }
-
-    /**
-     *  get handler's description
-     *
-     *  @access public
-     */
-    function getDescription()
-    {
-        return "description of " . $this->id;
-    }
-
-    /**
-     *  get handler's usage
-     *
-     *  @access public
-     */
-    function getUsage()
-    {
-        return "usage of " . $this->id;
-    }
-
-    /**
-     *  set arguments
-     *
-     *  @access public
-     */
-    function setArgList($arg_list)
-    {
-        $this->arg_list = $arg_list;
-    }
-
-    /**
-     * easy getopt :)
-     *
-     * @param   array   $lopts  long options
-     * @return  array   list($opts, $args)
-     * @access  protected
-     */
-    function &_getopt($lopts = array())
-    {
-        // create opts
-        // ex: $lopts = array('foo', 'bar=');
-        $lopts = to_array($lopts);
-        $sopts = '';
-        $opt_def = array();
-        foreach ($lopts as $lopt) {
-            if ($lopt{strlen($lopt) - 2} === '=') {
-                $opt_def[$lopt{0}] = substr($lopt, 0, strlen($lopt) - 2);
-                $sopts .= $lopt{0} . '::';
-            } else if ($lopt{strlen($lopt) - 1} === '=') {
-                $opt_def[$lopt{0}] = substr($lopt, 0, strlen($lopt) - 1);
-                $sopts .= $lopt{0} . ':';
-            } else {
-                $opt_def[$lopt{0}] = $lopt;
-                $sopts .= $lopt{0};
-            }
-        }
-
-        // do getopt
-        // ex: $sopts = 'fb:';
-        $opts_args = Console_Getopt::getopt2($this->arg_list, $sopts, $lopts);
-        if (Ethna::isError($opts_args)) {
-            return $opts_args;
-        }
-
-        // parse opts
-        // ex: "-ff --bar=baz" gets
-        //      $opts = array('foo' => array(true, true),
-        //                    'bar' => array('baz'));
-        $opts = array();
-        foreach ($opts_args[0] as $opt) {
-            $opt[0] = $opt[0]{0} === '-' ? $opt_def[$opt[0]{2}] : $opt_def[$opt[0]{0}];
-            $opt[1] = $opt[1] === null ? true : $opt[1];
-            if (isset($opts[$opt[0]]) === false) {
-                $opts[$opt[0]] = array($opt[1]);
-            } else {
-                $opts[$opt[0]][] = $opt[1];
-            }
-        }
-        $opts_args[0] = $opts;
-
-        return $opts_args;
-    }
-
-    /**
-     *  just perform
-     *
-     *  @access public
-     */
-    function perform()
-    {
-    }
-
-    /**
-     *  show usage
-     *
-     *  @access public
-     */
-    function usage()
-    {
-        echo "usage:\n";
-        echo $this->getUsage() . "\n\n";
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Ethna_Plugin_Logwriter.php b/class/Plugin/Ethna_Plugin_Logwriter.php
deleted file mode 100644 (file)
index b3cc676..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Logwriter.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Logwriter
-/**
- *  ¥í¥°½ÐÎÏ´ðÄ쥯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Logwriter
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    string  ¥í¥°¥¢¥¤¥Ç¥ó¥Æ¥£¥Æ¥£Ê¸»úÎó */
-    var $ident;
-
-    /** @var    int     ¥í¥°¥Õ¥¡¥·¥ê¥Æ¥£ */
-    var $facility;
-
-    /** @var    int     ¥í¥°¥ª¥×¥·¥ç¥ó */
-    var $option;
-
-    /** @var    bool    ¥Ð¥Ã¥¯¥È¥ì¡¼¥¹¤¬¼èÆÀ²Äǽ¤«¤É¤¦¤« */
-    var $have_backtrace;
-
-    /** @var    array   ¥í¥°¥ì¥Ù¥ë̾¥Æ¡¼¥Ö¥ë */
-    var $level_name_table = array(
-        LOG_EMERG   => 'EMERG',
-        LOG_ALERT   => 'ALERT',
-        LOG_CRIT    => 'CRIT',
-        LOG_ERR     => 'ERR',
-        LOG_WARNING => 'WARNING',
-        LOG_NOTICE  => 'NOTICE',
-        LOG_INFO    => 'INFO',
-        LOG_DEBUG   => 'DEBUG',
-    );
-
-    /**#@-*/
-
-    /**
-     *  Ethna_Plugin_Logwriter¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  string  $log_ident      ¥í¥°¥¢¥¤¥Ç¥ó¥Æ¥£¥Æ¥£Ê¸»úÎó(¥×¥í¥»¥¹Ì¾Åù)
-     *  @param  int     $log_facility   ¥í¥°¥Õ¥¡¥·¥ê¥Æ¥£
-     *  @param  string  $log_file       ¥í¥°½ÐÎÏÀè¥Õ¥¡¥¤¥ë̾(LOG_FILE¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Î¤ß)
-     *  @param  int     $log_option     ¥í¥°¥ª¥×¥·¥ç¥ó(LOG_FILE,LOG_FUNCTION...)
-     */
-    function Ethna_Plugin_Logwriter()
-    {
-    }
-
-    /**
-     *  ¥í¥°¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ë
-     *
-     *  @access public
-     *  @param  int     $option     ¥í¥°¥ª¥×¥·¥ç¥ó(LOG_FILE,LOG_FUNCTION...)
-     */
-    function setOption($option)
-    {
-        $this->ident = $option['ident'];
-        $this->facility = $option['facility'];
-        $this->option = $option;
-        $this->have_backtrace = function_exists('debug_backtrace');
-    }
-
-    /**
-     *  ¥í¥°½ÐÎϤò³«»Ï¤¹¤ë
-     *
-     *  @access public
-     */
-    function begin()
-    {
-    }
-
-    /**
-     *  ¥í¥°¤ò½ÐÎϤ¹¤ë
-     *
-     *  @access public
-     *  @param  int     $level      ¥í¥°¥ì¥Ù¥ë(LOG_DEBUG, LOG_NOTICE...)
-     *  @param  string  $message    ¥í¥°¥á¥Ã¥»¡¼¥¸(+°ú¿ô)
-     */
-    function log($level, $message)
-    {
-    }
-
-    /**
-     *  ¥í¥°½ÐÎϤò½ªÎ»¤¹¤ë
-     *
-     *  @access public
-     */
-    function end()
-    {
-    }
-
-    /**
-     *  ¥í¥°¥¢¥¤¥Ç¥ó¥Æ¥£¥Æ¥£Ê¸»úÎó¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return string  ¥í¥°¥¢¥¤¥Ç¥ó¥Æ¥£¥Æ¥£Ê¸»úÎó
-     */
-    function getIdent()
-    {
-        return $this->ident;
-    }
-
-    /**
-     *  ¥í¥°¥ì¥Ù¥ë¤òɽ¼¨Ê¸»úÎó¤ËÊÑ´¹¤¹¤ë
-     *
-     *  @access private
-     *  @param  int     $level  ¥í¥°¥ì¥Ù¥ë(LOG_DEBUG,LOG_NOTICE...)
-     *  @return string  ¥í¥°¥ì¥Ù¥ëɽ¼¨Ê¸»úÎó(LOG_DEBUG¢ª"DEBUG")
-     */
-    function _getLogLevelName($level)
-    {
-        if (isset($this->level_name_table[$level]) == false) {
-            return null;
-        }
-        return $this->level_name_table[$level];
-    }
-
-    /**
-     *  ¥í¥°½ÐÎϲսê¤Î¾ðÊó(´Ø¿ô̾/¥Õ¥¡¥¤¥ë̾Åù)¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @return array   ¥í¥°½ÐÎϲսê¤Î¾ðÊó
-     */
-    function _getBacktrace()
-    {
-        $skip_method_list = array(
-            array('ethna', 'raise.*'),
-            array(null, 'raiseerror'),
-            array(null, 'handleerror'),
-            array('ethna_logger', null),
-            array('ethna_plugin_logwriter*', null),
-            array('ethna_error', null),
-            array('ethna_apperror', null),
-            array('ethna_actionerror', null),
-            array('ethna_backend', 'log'),
-            array(null, 'ethna_error_handler'),
-            array(null, 'trigger_error'),
-        );
-
-        if ($this->have_backtrace == false) {
-            return null;
-        }
-
-        $bt = debug_backtrace();
-        $i = 0;
-        while ($i < count($bt)) {
-            if (isset($bt[$i]['class']) == false) {
-                $bt[$i]['class'] = null;
-            }
-            $skip = false;
-
-            // ¥á¥½¥Ã¥É¥¹¥­¥Ã¥×½èÍý
-            foreach ($skip_method_list as $method) {
-                $class = $function = true;
-                if ($method[0] != null) {
-                    $class = preg_match("/$method[0]/i", $bt[$i]['class']);
-                }
-                if ($method[1] != null) {
-                    $function = preg_match("/$method[1]/i", $bt[$i]['function']);
-                }
-                if ($class && $function) {
-                    $skip = true;
-                    break;
-                }
-            }
-
-            if ($skip) {
-                $i++;
-            } else {
-                break;
-            }
-        }
-
-        $c =& Ethna_Controller::getInstance();
-        $basedir = $c->getBasedir();
-
-        $function = sprintf("%s.%s", isset($bt[$i]['class']) ? $bt[$i]['class'] : 'global', $bt[$i]['function']);
-
-        $file = $bt[$i]['file'];
-        if (strncmp($file, $basedir, strlen($basedir)) == 0) {
-            $file = substr($file, strlen($basedir));
-        }
-        if (strncmp($file, ETHNA_BASE, strlen(ETHNA_BASE)) == 0) {
-            $file = preg_replace('#^/+#', '', substr($file, strlen(ETHNA_BASE)));
-        }
-        $line = $bt[$i]['line'];
-        return array('function' => $function, 'pos' => sprintf('%s:%s', $file, $line));
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Ethna_Plugin_Urlhandler.php b/class/Plugin/Ethna_Plugin_Urlhandler.php
deleted file mode 100644 (file)
index 9b10450..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-<?php
-// vim: foldmethod=marker tabstop=4 shiftwidth=4 autoindent
-/**
- *  Ethna_Plugin_Urlhandler.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Urlhandler
-/**
- *  Urlhandler¥×¥é¥°¥¤¥ó¤Î´ðÄ쥯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Urlhandler
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    object  Ethna_Backend   backend¥ª¥Ö¥¸¥§¥¯¥È */
-    var $backend;
-
-    /** @var    object  Ethna_Logger    ¥í¥°¥ª¥Ö¥¸¥§¥¯¥È */
-    var $logger;
-
-    /**#@-*/
-
-    /**
-     *  Ethna_Plugin_Urlhandler¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Controller    $controller ¥³¥ó¥È¥í¡¼¥é¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function Ethna_Plugin_Urlhandler(&$controller)
-    {
-        $this->backend =& $controller->getBackend();
-        $this->logger =& $controller->getLogger();
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¤ò¥æ¡¼¥¶¥ê¥¯¥¨¥¹¥È¤ËÊÑ´¹¤¹¤ë
-     *
-     *  @param string $action
-     *  @param array $param
-     *  @access public
-     *  @return array array($path_string, $path_key)
-     */
-    function actionToRequest($action, $param)
-    {
-        die('override!');
-    }
-
-    /**
-     *  ¥æ¡¼¥¶¥ê¥¯¥¨¥¹¥È¤ò¥¢¥¯¥·¥ç¥ó¤ËÊÑ´¹¤¹¤ë
-     *
-     *  @param array $http_vars
-     *  @access public
-     *  @return array $http_vars with 'action_foobar' => 'true' element.
-     */
-    function requestToAction($http_vars)
-    {
-        die('override!');
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¤ò¥ê¥¯¥¨¥¹¥È¥Ñ¥é¥á¡¼¥¿¤ËÊÑ´¹¤¹¤ë
-     *
-     *  @access public
-     *  @param array $http_vars
-     *  @param string $action
-     *  @return $http_vars with 'action_foobar' element.
-     */
-    function buildActionParameter($http_vars, $action)
-    {
-        if ($action == "") {
-            return $http_vars;
-        }
-        $key = sprintf('action_%s', $action);
-        $http_vars[$key] = 'true';
-        return $http_vars;
-    }
-
-    /**
-     *  ¥Ñ¥é¥á¡¼¥¿¤òURL¤ËÊÑ´¹¤¹¤ë
-     *
-     *  @access public
-     *  @param array $query query list 
-     *  @return string query string
-     */
-    function buildQueryParameter($query)
-    {
-        $param = '';
-
-        foreach ($query as $key => $value) {
-            if (is_array($value)) {
-                foreach ($value as $k => $v) {
-                    if (is_numeric($k)) {
-                        $k = '';
-                    }
-                    $param .= sprintf('%s=%s&',
-                                      urlencode(sprintf('%s[%s]', $key, $k)),
-                                      urlencode($v));
-                }
-            } else if (is_null($value) == false) {
-                $param .= sprintf('%s=%s&', urlencode($key), urlencode($value));
-            }
-        }
-
-        return substr($param, 0, -1);
-    }
-}
-// }}}
-
-?>
diff --git a/class/Plugin/Ethna_Plugin_Validator.php b/class/Plugin/Ethna_Plugin_Validator.php
deleted file mode 100644 (file)
index 75cc045..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Validator.php
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// UPLOAD_ERR_* ¤¬Ì¤ÄêµÁ¤Î¾ì¹ç (PHP 4.3.0 °ÊÁ°)
-if (defined('UPLOAD_ERR_OK') == false) {
-    define('UPLOAD_ERR_OK', 0);
-}
-
-// {{{ Ethna_Plugin_Validator
-/**
- *  ¥Ð¥ê¥Ç¡¼¥¿¥×¥é¥°¥¤¥ó¤Î´ðÄ쥯¥é¥¹
- *  
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Validator
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    object  Ethna_Backend   backend¥ª¥Ö¥¸¥§¥¯¥È */
-    var $backend;
-
-    /** @var    object  Ethna_Logger    ¥í¥°¥ª¥Ö¥¸¥§¥¯¥È */
-    var $logger;
-
-    /** @var    object  Ethna_ActionForm    ¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È */
-    var $action_form;
-
-    /** @var    object  Ethna_ActionForm    ¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È */
-    var $af;
-
-    /** @var    bool    ÇÛÎó¤ò¼õ¤±¼è¤ë¥Ð¥ê¥Ç¡¼¥¿¤«¤É¤¦¤«¤Î¥Õ¥é¥° */
-    var $accept_array = false;
-
-    /**#@-*/
-
-    /**
-     *  ¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_Controller    $controller ¥³¥ó¥È¥í¡¼¥é¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function Ethna_Plugin_Validator(&$controller)
-    {
-        $this->backend =& $controller->getBackend();
-        $this->logger =& $controller->getLogger();
-        $this->action_form =& $controller->getActionForm();
-        $this->af =& $this->action_form;
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃ͸¡¾Ú¤Î¤¿¤á¤ËActionForm¤«¤é¸Æ¤Ó½Ð¤µ¤ì¤ë¥á¥½¥Ã¥É
-     *
-     *  @access public
-     *  @param  string  $name       ¥Õ¥©¡¼¥à¤Î̾Á°
-     *  @param  mixed   $var        ¥Õ¥©¡¼¥à¤ÎÃÍ
-     *  @param  array   $params     ¥×¥é¥°¥¤¥ó¤Î¥Ñ¥é¥á¡¼¥¿
-     */
-    function &validate($name, $var, $params)
-    {
-        die('override!');
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÄêµÁ¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $name       ¥Õ¥©¡¼¥à¤Î̾Á°
-     */
-    function getFormDef($name)
-    {
-        return $this->af->getDef($name);
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥à¤Îtype¤ò¼èÆÀ¤¹¤ë(ÇÛÎó¤Î¾ì¹ç¤ÏÃͤΤß)
-     *
-     *  @access public
-     *  @param  string  $name       ¥Õ¥©¡¼¥à¤Î̾Á°
-     */
-    function getFormType($name)
-    {
-        $def = $this->af->getDef($name);
-        if (isset($def['type'])) {
-            if (is_array($def['type'])) {
-                return $def['type'][0];
-            } else {
-                return $def['type'];
-            }
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃͤ¬¶õ¤«¤É¤¦¤«¤òȽÄê (ÇÛÎó¥Õ¥©¡¼¥à¤Î¾ì¹ç¤Ï³ÆÍ×ÁǤËÂФ·¤Æ¸Æ¤Ó½Ð¤¹)
-     *
-     *  @access protected
-     *  @param  mixed   $var       ¥Õ¥©¡¼¥à¤ÎÃÍ (ÇÛÎó¥Õ¥©¡¼¥à¤Î¾ì¹ç¤Ï³ÆÍ×ÁÇ)
-     *  @param  int     $type      ¥Õ¥©¡¼¥à¤Îtype
-     */
-    function isEmpty($var, $type)
-    {
-        if ($type == VAR_TYPE_FILE) {
-            if (isset($var['error']) == false || $var['error'] != UPLOAD_ERR_OK) {
-                return true;
-            }
-            if (isset($var['tmp_name']) == false || is_uploaded_file($var['tmp_name']) == false) {
-                return true;
-            }
-            if (isset($var['size']) == false || $var['size'] == 0) {
-                return true;
-            }
-        } else {
-            if (is_scalar($var) == false || strlen($var) == 0) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     *  true ¤ò»²¾È¤ÇÊÖ¤¹
-     *
-     *  @access protected
-     */
-    function &ok()
-    {
-        $true = true;
-        return $true;
-    }
-
-    /**
-     *  ¥¨¥é¡¼¤òÊÖ¤¹
-     *
-     *  @access protected
-     *  @param  string  $msg        ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸
-     *  @param  int     $code       ¥¨¥é¡¼¥³¡¼¥É
-     *  @param  mixed   $info       ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Ësprintf¤ÇÅϤ¹¥Ñ¥é¥á¡¼¥¿
-     */
-    function &error($msg, $code, $info = null)
-    {
-        if ($info != null) {
-            if (is_array($info)) {
-                return Ethna::raiseNotice($msg, $code, $info);
-            } else {
-                return Ethna::raiseNotice($msg, $code, array($info));
-            }
-        } else {
-            return Ethna::raiseNotice($msg, $code);
-        }
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Generator/Ethna_Plugin_Generator_Action.php b/class/Plugin/Generator/Ethna_Plugin_Generator_Action.php
deleted file mode 100644 (file)
index 48af387..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Generator_Action.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Generator_Action
-/**
- *  ¥¹¥±¥ë¥È¥óÀ¸À®¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Generator_Action extends Ethna_Plugin_Generator
-{
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¤Î¥¹¥±¥ë¥È¥ó¤òÀ¸À®¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $action_name    ¥¢¥¯¥·¥ç¥ó̾
-     *  @param  string  $skelton        ¥¹¥±¥ë¥È¥ó¥Õ¥¡¥¤¥ë̾
-     *  @param  int     $gateway        ¥²¡¼¥È¥¦¥§¥¤
-     *  @return true|Ethna_Error        true:À®¸ù Ethna_Error:¼ºÇÔ
-     */
-    function &generate($action_name, $skelton = null, $gateway = GATEWAY_WWW)
-    {
-        $action_dir = $this->ctl->getActiondir($gateway);
-        $action_class = $this->ctl->getDefaultActionClass($action_name, $gateway);
-        $action_form = $this->ctl->getDefaultFormClass($action_name, $gateway);
-        $action_path = $this->ctl->getDefaultActionPath($action_name);
-
-        // entity
-        $entity = $action_dir . $action_path;
-        Ethna_Util::mkdir(dirname($entity), 0755);
-
-        // skelton
-        if ($skelton === null) {
-            switch ($gateway) {
-            case GATEWAY_WWW:
-                $skelton = "skel.action.php";
-                break;
-            case GATEWAY_CLI:
-                $skelton = "skel.action_cli.php";
-                break;
-            case GATEWAY_XMLRPC:
-                $skelton = "skel.action_xmlrpc.php";
-                break;
-            default:
-                $err = Ethna::raiseError('unknown gateway.');
-                return $err;
-            }
-        }
-
-        // macro
-        $macro = array();
-        $macro['project_id'] = $this->ctl->getAppId();
-        $macro['action_name'] = $action_name;
-        $macro['action_class'] = $action_class;
-        $macro['action_form'] = $action_form;
-        $macro['action_path'] = $action_path;
-
-        // user macro
-        $user_macro = $this->_getUserMacro();
-        $macro = array_merge($macro, $user_macro);
-
-
-        // generate
-        if (file_exists($entity)) {
-            printf("file [%s] already exists -> skip\n", $entity);
-        } else if ($this->_generateFile($skelton, $entity, $macro) == false) {
-            printf("[warning] file creation failed [%s]\n", $entity);
-        } else {
-            printf("action script(s) successfully created [%s]\n", $entity);
-        }
-
-        $true = true;
-        return $true;
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Generator/Ethna_Plugin_Generator_ActionTest.php b/class/Plugin/Generator/Ethna_Plugin_Generator_ActionTest.php
deleted file mode 100644 (file)
index 4735360..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Generator_ActionTest.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Generator_ActionTest
-/**
- *  ¥¹¥±¥ë¥È¥óÀ¸À®¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Generator_ActionTest extends Ethna_Plugin_Generator
-{
-    /**
-     *  ¥¢¥¯¥·¥ç¥óÍѥƥ¹¥È¤Î¥¹¥±¥ë¥È¥ó¤òÀ¸À®¤¹¤ë
-     *  (¸½ºß¤Î¤È¤³¤í GATEWAY_WWW ¤Î¤ßÂбþ)
-     *
-     *  @access public
-     *  @param  string  $action_name    ¥¢¥¯¥·¥ç¥ó̾
-     *  @param  string  $skelton        ¥¹¥±¥ë¥È¥ó¥Õ¥¡¥¤¥ë̾
-     *  @param  int     $gateway        ¥²¡¼¥È¥¦¥§¥¤
-     *  @return true|Ethna_Error        true:À®¸ù Ethna_Error:¼ºÇÔ
-     */
-    function &generate($action_name, $skelton = null, $gateway = GATEWAY_WWW)
-    {
-        $action_dir = $this->ctl->getActiondir($gateway);
-        $action_class = $this->ctl->getDefaultActionClass($action_name, $gateway);
-        $action_form = $this->ctl->getDefaultFormClass($action_name, $gateway);
-        $action_path = $this->ctl->getDefaultActionPath($action_name . 'Test');
-
-        // entity
-        $entity = $action_dir . $action_path;
-        Ethna_Util::mkdir(dirname($entity), 0755);
-
-        // skelton
-        if ($skelton === null) {
-            $skelton = 'skel.action_test.php';
-        }
-
-        // macro
-        $macro = array();
-        $macro['project_id'] = $this->ctl->getAppId();
-        $macro['action_name'] = $action_name;
-        $macro['action_class'] = $action_class;
-        $macro['action_form'] = $action_form;
-        $macro['action_path'] = $action_path;
-
-        // user macro
-        $user_macro = $this->_getUserMacro();
-        $macro = array_merge($macro, $user_macro);
-
-
-        // generate
-        if (file_exists($entity)) {
-            printf("file [%s] already exists -> skip\n", $entity);
-        } else if ($this->_generateFile($skelton, $entity, $macro) == false) {
-            printf("[warning] file creation failed [%s]\n", $entity);
-        } else {
-            printf("action test(s) successfully created [%s]\n", $entity);
-        }
-
-        $true = true;
-        return $true;
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Generator/Ethna_Plugin_Generator_AppManager.php b/class/Plugin/Generator/Ethna_Plugin_Generator_AppManager.php
deleted file mode 100644 (file)
index c9903fe..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Generator_AppManager.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Generator_AppManager
-/**
- *  ¥¹¥±¥ë¥È¥óÀ¸À®¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Generator_AppManager extends Ethna_Plugin_Generator
-{
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Þ¥Í¡¼¥¸¥ã¤Î¥¹¥±¥ë¥È¥ó¤òÀ¸À®¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $manager_name    ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Þ¥Í¡¼¥¸Ì¾
-     *  @return bool    true:À®¸ù false:¼ºÇÔ
-     */
-    function generate($manager_name)
-    {
-        $manager_id = preg_replace('/_(.)/e', "strtoupper('\$1')", ucfirst($manager_name));
-
-        $app_dir = $this->ctl->getDirectory('app');
-        $app_path = ucfirst($this->ctl->getAppId()) . '_' . $manager_id .'Manager.php';
-
-        $macro = array();
-        $macro['project_id'] = $this->ctl->getAppId();
-        $macro['app_path'] = $app_path;
-        $macro['app_manager'] = ucfirst($this->ctl->getAppId()) . '_' . $manager_id;
-
-        $user_macro = $this->_getUserMacro();
-        $macro = array_merge($macro, $user_macro);
-
-        $path = "$app_dir/$app_path";
-        Ethna_Util::mkdir(dirname($path), 0755);
-        if (file_exists($path)) {
-            printf("file [%s] already exists -> skip\n", $path);
-        } else if ($this->_generateFile("skel.app_manager.php", $path, $macro) == false) {
-            printf("[warning] file creation failed [%s]\n", $path);
-        } else {
-            printf("app-manager script(s) successfully created [%s]\n", $path);
-        }
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Generator/Ethna_Plugin_Generator_AppObject.php b/class/Plugin/Generator/Ethna_Plugin_Generator_AppObject.php
deleted file mode 100644 (file)
index 66d37db..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Generator_AppObject.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Generator_AppObject
-/**
- *  ¥¹¥±¥ë¥È¥óÀ¸À®¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Generator_AppObject extends Ethna_Plugin_Generator
-{
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¹¥±¥ë¥È¥ó¤òÀ¸À®¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $table_name     ¥Æ¡¼¥Ö¥ë̾
-     *  @return bool    true:À®¸ù false:¼ºÇÔ
-     */
-    function generate($table_name)
-    {
-        $table_id = preg_replace('/_(.)/e', "strtoupper('\$1')", ucfirst($table_name));
-
-        $app_dir = $this->ctl->getDirectory('app');
-        $app_path = ucfirst($this->ctl->getAppId()) . '_' . $table_id .'.php';
-
-        $macro = array();
-        $macro['project_id'] = $this->ctl->getAppId();
-        $macro['app_path'] = $app_path;
-        $macro['app_object'] = ucfirst($this->ctl->getAppId()) . '_' . $table_id;
-
-        $user_macro = $this->_getUserMacro();
-        $macro = array_merge($macro, $user_macro);
-
-        $path = "$app_dir/$app_path";
-        Ethna_Util::mkdir(dirname($path), 0755);
-        if (file_exists($path)) {
-            printf("file [%s] already exists -> skip\n", $path);
-        } else if ($this->_generateFile("skel.app_object.php", $path, $macro) == false) {
-            printf("[warning] file creation failed [%s]\n", $path);
-        } else {
-            printf("app-object script(s) successfully created [%s]\n", $path);
-        }
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Generator/Ethna_Plugin_Generator_EntryPoint.php b/class/Plugin/Generator/Ethna_Plugin_Generator_EntryPoint.php
deleted file mode 100644 (file)
index 00567f1..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Generator_EntryPoint.php
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Generator_EntryPoint
-/**
- *  ¥¹¥±¥ë¥È¥óÀ¸À®¥¯¥é¥¹
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Generator_EntryPoint extends Ethna_Plugin_Generator
-{
-    /**
-     *  ¥¨¥ó¥È¥ê¥Ý¥¤¥ó¥È¤Î¥¹¥±¥ë¥È¥ó¤òÀ¸À®¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $skelton    ¥¹¥±¥ë¥È¥ó¥Õ¥¡¥¤¥ë̾
-     *  @param  int     $gateway    ¥²¡¼¥È¥¦¥§¥¤
-     *  @return true|Ethna_Error    true:À®¸ù Ethna_Error:¼ºÇÔ
-     */
-    function &generate($action_name, $skelton = null, $gateway = GATEWAY_WWW)
-    {
-        $true = true;
-
-        // entity
-        switch ($gateway) {
-        case GATEWAY_WWW:
-            $entity = sprintf("%s/%s.%s", $this->ctl->getDirectory('www'),
-                              $action_name, $this->ctl->getExt('php'));
-            break;
-        case GATEWAY_CLI:
-            $entity = sprintf("%s/%s.%s", $this->ctl->getDirectory('bin'),
-                              $action_name, $this->ctl->getExt('php'));
-            break;
-        default:
-            $ret =& Ethna::raiseError(
-                'add-entry-point accepts only GATEWAY_WWW or GATEWAY_CLI.');
-            return $ret;
-        }
-
-        // skelton
-        if ($skelton === null) {
-            switch ($gateway) {
-            case GATEWAY_WWW:
-                $skelton = 'skel.entry_www.php';
-                break;
-            case GATEWAY_CLI:
-                $skelton = 'skel.entry_cli.php';
-                break;
-            }
-        }
-        if (file_exists($entity)) {
-            printf("file [%s] already exists -> skip\n", $entity);
-            return $true;
-        }
-
-        // macro
-        $macro = array();
-        $macro['project_id'] = $this->ctl->getAppId();
-        $macro['action_name'] = $action_name;
-        $macro['dir_app'] = $this->ctl->getDirectory('app');
-
-        // user macro
-        $user_macro = $this->_getUserMacro();
-        $macro = array_merge($macro, $user_macro);
-
-        // generate
-        $ret = $this->_generateFile($skelton, $entity, $macro);
-        if ($ret) {
-            printf("action script(s) successfully created [%s]\n", $entity);
-        } else {
-            printf("[warning] file creation failed [%s]\n", $entity);
-            return $true; // XXX: error handling
-        }
-
-        // chmod
-        if ($gateway === GATEWAY_CLI) {
-            // is needed?
-            //$ret = Ethna_Util::chmod($entity, 0777);
-        }
-            
-
-        return $true;
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Generator/Ethna_Plugin_Generator_Plugin.php b/class/Plugin/Generator/Ethna_Plugin_Generator_Plugin.php
deleted file mode 100644 (file)
index a604ef6..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Generator_Plugin.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Generator_Plugin
-/**
- *  ¥¹¥±¥ë¥È¥óÀ¸À®¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Generator_Plugin extends Ethna_Plugin_Generator
-{
-    /**
-     *  ¥×¥é¥°¥¤¥ó¤òÀ¸À®¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $type       ¥×¥é¥°¥¤¥ó¤Î$type
-     *  @param  string  $name       ¥×¥é¥°¥¤¥ó¤Î$name
-     *  @param  bool    $overwrite  ¾å½ñ¤­¥ª¥×¥·¥ç¥ó
-     *  @return bool    true:À®¸ù false:¼ºÇÔ
-     */
-    function generate($type, $name, $overwrite = false)
-    {
-        $appid = $this->ctl->getAppId();
-        $plugin =& $this->ctl->getPlugin();
-
-        list($class, $plugin_dir, $plugin_path) = $plugin->getPluginNaming($type, $name, $appid);
-
-        $macro = array();
-        $macro['project_id'] = $appid;
-        $macro['application_id'] = $appid;
-        $user_macro = $this->_getUserMacro();
-        $macro = array_merge($macro, $user_macro);
-
-        Ethna_Util::mkdir(dirname("$plugin_dir/$plugin_path"), 0755);
-
-        if ($this->_generateFile("skel.plugin.{$type}_{$name}.php", "$plugin_dir/$plugin_path", $macro, $overwrite) == false) {
-            printf("[warning] file creation failed [%s]\n", "$plugin_dir/$plugin_path");
-        } else {
-            printf("plugin script(s) successfully created [%s]\n", "$plugin_dir/$plugin_path");
-        }
-    }
-
-    /**
-     *  ¥×¥é¥°¥¤¥ó¤ò¾Ã¤¹
-     *
-     *  @access public
-     *  @param  string  $type       ¥×¥é¥°¥¤¥ó¤Î$type
-     *  @param  string  $name       ¥×¥é¥°¥¤¥ó¤Î$name
-     *  @return bool    true:À®¸ù false:¼ºÇÔ
-     */
-    function remove($type, $name)
-    {
-        $appid = $this->ctl->getAppId();
-        $plugin =& $this->ctl->getPlugin();
-
-        list($class, $plugin_dir, $plugin_path) = $plugin->getPluginNaming($type, $name, $appid);
-
-        $macro = array();
-        $macro['project_id'] = $appid;
-        $user_macro = $this->_getUserMacro();
-        $macro = array_merge($macro, $user_macro);
-
-        if (file_exists("$plugin_dir/$plugin_path")) {
-            unlink("$plugin_dir/$plugin_path");
-            printf("file [%s] successfully unlinked\n", "$plugin_dir/$plugin_path");
-        } else {
-            printf("file [%s] not found\n", "$plugin_dir/$plugin_path");
-        }
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Generator/Ethna_Plugin_Generator_Project.php b/class/Plugin/Generator/Ethna_Plugin_Generator_Project.php
deleted file mode 100644 (file)
index 56699fb..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Generator_Project.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Generator_Project
-/**
- *  ¥¹¥±¥ë¥È¥óÀ¸À®¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Generator_Project extends Ethna_Plugin_Generator
-{
-    /**
-     *  ¥×¥í¥¸¥§¥¯¥È¥¹¥±¥ë¥È¥ó¤òÀ¸À®¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $id         ¥×¥í¥¸¥§¥¯¥ÈID
-     *  @param  string  $basedir    ¥×¥í¥¸¥§¥¯¥È¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê
-     *  @return bool    true:À®¸ù false:¼ºÇÔ
-     */
-    function generate($id, $basedir)
-    {
-        $dir_list = array(
-            array("app", 0755),
-            array("app/action", 0755),
-            array("app/action_cli", 0755),
-            array("app/action_xmlrpc", 0755),
-            array("app/filter", 0755),
-            array("app/plugin", 0755),
-            array("app/plugin/Filter", 0755),
-            array("app/plugin/Validator", 0755),
-            array("app/view", 0755),
-            array("bin", 0755),
-            array("etc", 0755),
-            array("lib", 0755),
-            array("locale", 0755),
-            array("locale/ja", 0755),
-            array("locale/ja/LC_MESSAGES", 0755),
-            array("log", 0777),
-            array("schema", 0755),
-            array("skel", 0755),
-            array("template", 0755),
-            array("template/ja", 0755),
-            array("tmp", 0777),
-            array("www", 0755),
-            array("www/css", 0755),
-            array("www/js", 0755),
-        );
-
-        // double check.
-        $id = strtolower($id);
-        $r = Ethna_Controller::checkAppId($id);
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-
-        $basedir = sprintf("%s/%s", $basedir, $id);
-
-        // ¥Ç¥£¥ì¥¯¥È¥êºîÀ®
-        if (is_dir($basedir) == false) {
-            // confirm
-            printf("creating directory ($basedir) [y/n]: ");
-            flush();
-            $fp = fopen("php://stdin", "r");
-            $r = trim(fgets($fp, 128));
-            fclose($fp);
-            if (strtolower($r) != 'y') {
-                return Ethna::raiseError('aborted by user');
-            }
-
-            if (mkdir($basedir, 0775) == false) {
-                return Ethna::raiseError('directory creation failed');
-            }
-        }
-        foreach ($dir_list as $dir) {
-            $mode = $dir[1];
-            $dir = $dir[0];
-            $target = "$basedir/$dir";
-            if (is_dir($target)) {
-                printf("%s already exists -> skipping...\n", $target);
-                continue;
-            }
-            if (mkdir($target, $mode) == false) {
-                return Ethna::raiseError('directory creation failed');
-            } else {
-                printf("project sub directory created [%s]\n", $target);
-            }
-            if (chmod($target, $mode) == false) {
-                return Ethna::raiseError('chmod failed');
-            }
-        }
-
-        // ¥¹¥±¥ë¥È¥ó¥Õ¥¡¥¤¥ëºîÀ®
-        $macro['ethna_version'] = ETHNA_VERSION;
-        $macro['application_id'] = strtoupper($id);
-        $macro['project_id'] = ucfirst($id);
-        $macro['project_prefix'] = $id;
-        $macro['basedir'] = realpath($basedir);
-
-        $macro['action_class'] = '{$action_class}';
-        $macro['action_form'] = '{$action_form}';
-        $macro['action_name'] = '{$action_name}';
-        $macro['action_path'] = '{$action_path}';
-        $macro['forward_name'] = '{$forward_name}';
-        $macro['view_name'] = '{$view_name}';
-        $macro['view_path'] = '{$view_path}';
-
-        $user_macro = $this->_getUserMacro();
-        $default_macro = $macro;
-        $macro = array_merge($macro, $user_macro);
-
-        // the longest if? :)
-        if ($this->_generateFile("www.index.php", "$basedir/www/index.php", $macro) == false ||
-            $this->_generateFile("www.info.php", "$basedir/www/info.php", $macro) == false ||
-            $this->_generateFile("www.unittest.php", "$basedir/www/unittest.php", $macro) == false ||
-            $this->_generateFile("www.xmlrpc.php", "$basedir/www/xmlrpc.php", $macro) == false ||
-            $this->_generateFile("www.css.ethna.css", "$basedir/www/css/ethna.css", $macro) == false ||
-            $this->_generateFile("dot.ethna", "$basedir/.ethna", $macro) == false ||
-            $this->_generateFile("app.controller.php", sprintf("$basedir/app/%s_Controller.php", $macro['project_id']), $macro) == false ||
-            $this->_generateFile("app.error.php", sprintf("$basedir/app/%s_Error.php", $macro['project_id']), $macro) == false ||
-            $this->_generateFile("app.actionclass.php", sprintf("$basedir/app/%s_ActionClass.php", $macro['project_id']), $macro) == false ||
-            $this->_generateFile("app.actionform.php", sprintf("$basedir/app/%s_ActionForm.php", $macro['project_id']), $macro) == false ||
-            $this->_generateFile("app.viewclass.php", sprintf("$basedir/app/%s_ViewClass.php", $macro['project_id']), $macro) == false ||
-            $this->_generateFile("app.action.default.php", "$basedir/app/action/Index.php", $macro) == false ||
-            $this->_generateFile("app.plugin.filter.default.php", sprintf("$basedir/app/plugin/Filter/%s_Plugin_Filter_ExecutionTime.php", $macro['project_id']), $macro) == false ||
-            $this->_generateFile("app.view.default.php", "$basedir/app/view/Index.php", $macro) == false ||
-            $this->_generateFile("app.unittest.php", sprintf("$basedir/app/%s_UnitTestManager.php", $macro['project_id']), $macro) == false ||
-            $this->_generateFile("app.url_handler.php", sprintf("$basedir/app/%s_UrlHandler.php", $macro['project_id']), $macro) == false ||
-            $this->_generateFile("etc.ini.php", sprintf("$basedir/etc/%s-ini.php", $macro['project_prefix']), $macro) == false ||
-            $this->_generateFile("skel.action.php", sprintf("$basedir/skel/skel.action.php"), $default_macro) == false ||
-            $this->_generateFile("skel.action_cli.php", sprintf("$basedir/skel/skel.action_cli.php"), $default_macro) == false ||
-            $this->_generateFile("skel.action_test.php", sprintf("$basedir/skel/skel.action_test.php"), $default_macro) == false ||
-            $this->_generateFile("skel.app_object.php", sprintf("$basedir/skel/skel.app_object.php"), $default_macro) == false ||
-            $this->_generateFile("skel.entry_www.php", sprintf("$basedir/skel/skel.entry_www.php"), $default_macro) == false ||
-            $this->_generateFile("skel.entry_cli.php", sprintf("$basedir/skel/skel.entry_cli.php"), $default_macro) == false ||
-            $this->_generateFile("skel.view.php", sprintf("$basedir/skel/skel.view.php"), $default_macro) == false ||
-            $this->_generateFile("skel.template.tpl", sprintf("$basedir/skel/skel.template.tpl"), $default_macro) == false ||
-            $this->_generateFile("skel.view_test.php", sprintf("$basedir/skel/skel.view_test.php"), $default_macro) == false ||
-            $this->_generateFile("template.index.tpl", sprintf("$basedir/template/ja/index.tpl"), $default_macro) == false) {
-            return Ethna::raiseError('generating files failed');
-        }
-
-        return true;
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Generator/Ethna_Plugin_Generator_Template.php b/class/Plugin/Generator/Ethna_Plugin_Generator_Template.php
deleted file mode 100644 (file)
index 8b32aee..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Generator_Template.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Generator_Template
-/**
- *  ¥¹¥±¥ë¥È¥óÀ¸À®¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Generator_Template extends Ethna_Plugin_Generator
-{
-    /**
-     *  ¥Æ¥ó¥×¥ì¡¼¥È¤Î¥¹¥±¥ë¥È¥ó¤òÀ¸À®¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $forward_name   ¥Æ¥ó¥×¥ì¡¼¥È̾
-     *  @param  string  $skelton        ¥¹¥±¥ë¥È¥ó¥Õ¥¡¥¤¥ë̾
-     *  @return true|Ethna_Error        true:À®¸ù Ethna_Error:¼ºÇÔ
-     */
-    function &generate($forward_name, $skelton = null)
-    {
-        $tpl_dir = $this->ctl->getTemplatedir();
-        if ($tpl_dir{strlen($tpl_dir)-1} != '/') {
-            $tpl_dir .= '/';
-        }
-        $tpl_path = $this->ctl->getDefaultForwardPath($forward_name);
-
-        // entity
-        $entity = $tpl_dir . $tpl_path;
-        Ethna_Util::mkdir(dirname($entity), 0755);
-
-        // skelton
-        if ($skelton === null) {
-            $skelton = 'skel.template.tpl';
-        }
-
-        // macro
-        $macro = array();
-        // add '_' for tpl and no user macro for tpl
-        $macro['_project_id'] = $this->ctl->getAppId();
-
-
-        // generate
-        if (file_exists($entity)) {
-            printf("file [%s] already exists -> skip\n", $entity);
-        } else if ($this->_generateFile($skelton, $entity, $macro) == false) {
-            printf("[warning] file creation failed [%s]\n", $entity);
-        } else {
-            printf("template file(s) successfully created [%s]\n", $entity);
-        }
-
-        $true = true;
-        return $true;
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Generator/Ethna_Plugin_Generator_View.php b/class/Plugin/Generator/Ethna_Plugin_Generator_View.php
deleted file mode 100644 (file)
index 54178ca..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Generator_View.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Generator_View
-/**
- *  ¥¹¥±¥ë¥È¥óÀ¸À®¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Generator_View extends Ethna_Plugin_Generator
-{
-    /**
-     *  ¥Ó¥å¡¼¤Î¥¹¥±¥ë¥È¥ó¤òÀ¸À®¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $forward_name   ¥Ó¥å¡¼Ì¾
-     *  @param  string  $skelton        ¥¹¥±¥ë¥È¥ó¥Õ¥¡¥¤¥ë̾
-     *  @return true|Ethna_Error        true:À®¸ù Ethna_Error:¼ºÇÔ
-     */
-    function &generate($forward_name, $skelton = null, $gateway = GATEWAY_WWW)
-    {
-        $view_dir = $this->ctl->getViewdir();
-        $view_class = $this->ctl->getDefaultViewClass($forward_name, $gateway);
-        $view_path = $this->ctl->getDefaultViewPath($forward_name);
-
-        // entity
-        $entity = $view_dir . $view_path;
-        Ethna_Util::mkdir(dirname($entity), 0755);
-
-        // skelton
-        if ($skelton === null) {
-            $skelton = 'skel.view.php';
-        }
-
-        // macro
-        $macro = array();
-        $macro['project_id'] = $this->ctl->getAppId();
-        $macro['forward_name'] = $forward_name;
-        $macro['view_class'] = $view_class;
-        $macro['view_path'] = $view_path;
-
-        // user macro
-        $user_macro = $this->_getUserMacro();
-        $macro = array_merge($macro, $user_macro);
-
-
-        // generate
-        if (file_exists($entity)) {
-            printf("file [%s] already exists -> skip\n", $entity);
-        } else if ($this->_generateFile($skelton, $entity, $macro) == false) {
-            printf("[warning] file creation failed [%s]\n", $entity);
-        } else {
-            printf("view script(s) successfully created [%s]\n", $entity);
-        }
-
-        $true = true;
-        return $true;
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Generator/Ethna_Plugin_Generator_ViewTest.php b/class/Plugin/Generator/Ethna_Plugin_Generator_ViewTest.php
deleted file mode 100644 (file)
index cfc7cb8..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Generator_ViewTest.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Generator_ViewTest
-/**
- *  ¥¹¥±¥ë¥È¥óÀ¸À®¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Generator_ViewTest extends Ethna_Plugin_Generator
-{
-    /**
-     *  ¥Ó¥å¡¼Íѥƥ¹¥È¤Î¥¹¥±¥ë¥È¥ó¤òÀ¸À®¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $forward_name   ¥Ó¥å¡¼Ì¾
-     *  @param  string  $skelton        ¥¹¥±¥ë¥È¥ó¥Õ¥¡¥¤¥ë̾
-     *  @return true|Ethna_Error        true:À®¸ù Ethna_Error:¼ºÇÔ
-     */
-    function &generate($forward_name, $skelton = null, $gateway = GATEWAY_WWW)
-    {
-        $view_dir = $this->ctl->getViewdir();
-        $view_class = $this->ctl->getDefaultViewClass($forward_name, $gateway);
-        $view_path = $this->ctl->getDefaultViewPath($forward_name . 'Test');
-
-        // entity
-        $entity = $view_dir . $view_path;
-        Ethna_Util::mkdir(dirname($entity), 0755);
-
-        // skelton
-        if ($skelton === null) {
-            $skelton = 'skel.view_test.php';
-        }
-
-        // macro
-        $macro = array();
-        $macro['project_id'] = $this->ctl->getAppId();
-        $macro['forward_name'] = $forward_name;
-        $macro['view_class'] = $view_class;
-        $macro['view_path'] = $view_path;
-
-        // user macro
-        $user_macro = $this->_getUserMacro();
-        $macro = array_merge($macro, $user_macro);
-
-
-        // generate
-        if (file_exists($entity)) {
-            printf("file [%s] already exists -> skip\n", $entity);
-        } else if ($this->_generateFile($skelton, $entity, $macro) == false) {
-            printf("[warning] file creation failed [%s]\n", $entity);
-        } else {
-            printf("view test(s) successfully created [%s]\n", $entity);
-        }
-
-        $true = true;
-        return $true;
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Handle/Ethna_Plugin_Handle_AddAction.php b/class/Plugin/Handle/Ethna_Plugin_Handle_AddAction.php
deleted file mode 100644 (file)
index 5217054..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Handle_AddAction.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Handle_AddAction
-/**
- *  add-action handler
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Handle_AddAction extends Ethna_Plugin_Handle
-{
-    /**
-     *  add action
-     *
-     *  @access public
-     */
-    function perform()
-    {
-        $r =& $this->_getopt(array('basedir=', 'skelfile=', 'gateway='));
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-        list($opt_list, $arg_list) = $r;
-
-        // action_name
-        $action_name = array_shift($arg_list);
-        if ($action_name == null) {
-            return Ethna::raiseError('action name isn\'t set.', 'usage');
-        }
-        $r =& Ethna_Controller::checkActionName($action_name);
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-
-        $ret =& $this->_perform('Action', $action_name, $opt_list);
-        return $ret;
-    }
-
-    /**
-     *  @access protected
-     */
-    function &_perform($target, $target_name, $opt_list)
-    {
-        // basedir
-        if (isset($opt_list['basedir'])) {
-            $basedir = realpath(end($opt_list['basedir']));
-        } else {
-            $basedir = getcwd();
-        }
-
-        // skelfile
-        if (isset($opt_list['skelfile'])) {
-            $skelfile = end($opt_list['skelfile']);
-        } else {
-            $skelfile = null;
-        }
-        
-        // gateway
-        if (isset($opt_list['gateway'])) {
-            $gateway = 'GATEWAY_' . strtoupper(end($opt_list['gateway']));
-            if (defined($gateway)) {
-                $gateway = constant($gateway);
-            } else {
-                return Ethna::raiseError('unknown gateway', 'usage');
-            }
-        } else {
-            $gateway = GATEWAY_WWW;
-        }
-        
-        $r =& Ethna_Generator::generate($target, $basedir,
-                                        $target_name, $skelfile, $gateway);
-        if (Ethna::isError($r)) {
-            printf("error occurred while generating skelton. please see also following error message(s)\n\n");
-            return $r;
-        }
-
-        $true = true;
-        return $true;
-    }
-
-    /**
-     *  get handler's description
-     *
-     *  @access public
-     */
-    function getDescription()
-    {
-        return <<<EOS
-add new action to project:
-    {$this->id} [-b|--basedir=dir] [-s|--skelfile=file] [-g|--gateway=www|cli|xmlrpc] [action]
-
-EOS;
-    }
-
-    /**
-     *  @access public
-     */
-    function getUsage()
-    {
-        return <<<EOS
-ethna {$this->id} [-b|--basedir=dir] [-s|--skelfile=file] [-g|--gateway=www|cli|xmlrpc] [action]
-EOS;
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Handle/Ethna_Plugin_Handle_AddActionTest.php b/class/Plugin/Handle/Ethna_Plugin_Handle_AddActionTest.php
deleted file mode 100644 (file)
index b27f1e6..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-<?php
-/**
- *  Ethna_Plugin_Handle_AddActionTest.php
- *
- *  @author     halt feits <halt.feits@gmail.com>
- *  @package    Ethna
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @version    $Id$
- */
-
-require_once ETHNA_BASE . '/class/Plugin/Handle/Ethna_Plugin_Handle_AddAction.php';
-
-// {{{ Ethna_Plugin_Handle_AddActionTest
-/**
- *  add-action-test handler
- *
- *  @author     halt feits <halt.feits@gmail.com>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Handle_AddActionTest extends Ethna_Plugin_Handle_AddAction
-{
-    /**
-     *  add action test
-     *
-     *  @access public
-     */
-    function perform()
-    {
-        $r =& $this->_getopt(array('basedir=', 'skelfile='));
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-        list($opt_list, $arg_list) = $r;
-
-        // action_name
-        $action_name = array_shift($arg_list);
-        if ($action_name == null) {
-            return Ethna::raiseError('action name isn\'t set.', 'usage');
-        }
-        $r =& Ethna_Controller::checkActionName($action_name);
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-
-        $ret =& $this->_perform('ActionTest', $action_name, $opt_list);
-        return $ret;
-    }
-
-    /**
-     *  get handler's description
-     *
-     *  @access public
-     */
-    function getDescription()
-    {
-        return <<<EOS
-add new action test to project:
-    {$this->id} [-b|--basedir=dir] [-s|--skelfile=file] [action]
-
-EOS;
-    }
-
-    /**
-     *  @access public
-     */
-    function getUsage()
-    {
-        return <<<EOS
-ethna {$this->id} [-b|--basedir=dir] [-s|--skelfile=file] [action]
-EOS;
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Handle/Ethna_Plugin_Handle_AddAppManager.php b/class/Plugin/Handle/Ethna_Plugin_Handle_AddAppManager.php
deleted file mode 100644 (file)
index c94a343..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-<?php
-/**
- *  Ethna_Plugin_Handle_AddAppManager.php
- *
- *  @author     nozzzzz <nozzzzz@gmail.com>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-require_once ETHNA_BASE . '/class/Plugin/Handle/Ethna_Plugin_Handle_AddAppObject.php';
-
-// {{{ Ethna_Plugin_Handle_AddAppManager
-/**
- *  add-app-manager handler
- *
- *  @author     nozzzzz <nozzzzz@gmail.com>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Handle_AddAppManager extends Ethna_Plugin_Handle_AddAppObject
-{
-    /**
-     *  add app-manager
-     *
-     *  @access public
-     */
-    function perform()
-    {
-        return $this->_perform('AppManager');
-    }
-
-    /**
-     *  get handler's description
-     *
-     *  @access public
-     */
-    function getDescription()
-    {
-        return <<<EOS
-add new app-manager to project:
-    {$this->id} [-b|--basedir=dir] [app-manager name]
-
-EOS;
-    }
-
-    /**
-     *  get usage
-     *
-     *  @access public
-     */
-    function getUsage()
-    {
-        return <<<EOS
-ethna {$this->id} [-b|--basedir=dir] [app-manager name]
-EOS;
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Handle/Ethna_Plugin_Handle_AddAppObject.php b/class/Plugin/Handle/Ethna_Plugin_Handle_AddAppObject.php
deleted file mode 100644 (file)
index 2236de9..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Handle_AddAppObject.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Handle_AddAppObject
-/**
- *  add-app-object handler
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Handle_AddAppObject extends Ethna_Plugin_Handle
-{
-    /**
-     *  add app-object
-     *
-     *  @access public
-     */
-    function perform()
-    {
-        return $this->_perform('AppObject');
-    }
-
-    /**
-     *  @access protected
-     */
-    function _perform($target)
-    {
-        $r =& $this->_getopt(array('basedir='));
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-        list($opt_list, $arg_list) = $r;
-
-        // table_name
-        $table_name = array_shift($arg_list);
-        if ($table_name == null) {
-            return Ethna::raiseError('table name isn\'t set.', 'usage');
-        }
-
-        // basedir
-        if (isset($opt_list['basedir'])) {
-            $basedir = realpath(end($opt_list['basedir']));
-        } else {
-            $basedir = getcwd();
-        }
-
-        $r =& Ethna_Generator::generate($target, $basedir, $table_name);
-        if (Ethna::isError($r)) {
-            printf("error occurred while generating skelton. please see also following error message(s)\n\n");
-            return $r;
-        }
-
-        return true;
-    }
-
-    /**
-     *  get handler's description
-     *
-     *  @access public
-     */
-    function getDescription()
-    {
-        return <<<EOS
-add new app-object to project:
-    {$this->id} [-b|--basedir=dir] [table name]
-
-EOS;
-    }
-
-    /**
-     *  get usage
-     *
-     *  @access public
-     */
-    function getUsage()
-    {
-        return <<<EOS
-ethna {$this->id} [-b|--basedir=dir] [table name]
-EOS;
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Handle/Ethna_Plugin_Handle_AddEntryPoint.php b/class/Plugin/Handle/Ethna_Plugin_Handle_AddEntryPoint.php
deleted file mode 100644 (file)
index 298e212..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Handle_AddEntryPoint.php
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-require_once ETHNA_BASE . '/class/Plugin/Handle/Ethna_Plugin_Handle_AddAction.php';
-
-// {{{ Ethna_Plugin_Handle_AddEntryPoint
-/**
- *  add-action handler
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Handle_AddEntryPoint extends Ethna_Plugin_Handle_AddAction
-{
-    /**
-     *  add action entry point
-     *
-     *  @access public
-     */
-    function perform()
-    {
-        $r =& $this->_getopt(array('basedir=', 'skelfile=', 'gateway='));
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-        list($opt_list, $arg_list) = $r;
-
-        // action_name
-        $action_name = array_shift($arg_list);
-        if ($action_name == null) {
-            return Ethna::raiseError('action name isn\'t set.', 'usage');
-        }
-        $r =& Ethna_Controller::checkActionName($action_name);
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-
-        // add entry point
-        $ret =& $this->_perform('EntryPoint', $action_name, $opt_list);
-        if (Ethna::isError($ret) || $ret === false) { 
-            return $ret;
-        }
-
-        // add action (no effects if already exists.)
-        $ret =& $this->_perform('Action', $action_name, $opt_list);
-        if (Ethna::isError($ret) || $ret === false) { 
-            return $ret;
-        }
-
-        return true;
-
-    }
-
-    /**
-     *  get handler's description
-     *
-     *  @access public
-     */
-    function getDescription()
-    {
-        return <<<EOS
-add new action and its entry point to project:
-    {$this->id} [-b|--basedir=dir] [-s|--skelfile=file] [-g|--gateway=www|cli] [action]
-
-EOS;
-    }
-
-    /**
-     *  @access public
-     */
-    function getUsage()
-    {
-        return <<<EOS
-ethna {$this->id} [-b|--basedir=dir] [-s|--skelfile=file] [-g|--gateway=www|cli] [action]
-EOS;
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Handle/Ethna_Plugin_Handle_AddProject.php b/class/Plugin/Handle/Ethna_Plugin_Handle_AddProject.php
deleted file mode 100644 (file)
index 14a478f..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Handle_AddProject.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Handle_AddProject
-/**
- *  add-project handler
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Handle_AddProject extends Ethna_Plugin_Handle
-{
-    /**
-     *  add project:)
-     *
-     *  @access public
-     */
-    function perform()
-    {
-        $r = $this->_getopt(array('basedir='));
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-        list($opt_list, $arg_list) = $r;
-
-        // app_id
-        $app_id = array_shift($arg_list);
-        if ($app_id == null) {
-            return Ethna::raiseError('project id isn\'t set.', 'usage');
-        }
-        $r = Ethna_Controller::checkAppId($app_id);
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-
-        // basedir
-        if (isset($opt_list['basedir'])) {
-            $basedir = realpath(end($opt_list['basedir']));
-        } else {
-            $basedir = getcwd();
-        }
-
-        $r = Ethna_Generator::generate('Project', null, $app_id, $basedir);
-        if (Ethna::isError($r)) {
-            printf("error occurred while generating skelton. please see also error messages given above\n\n");
-            return $r;
-        }
-
-        printf("\nproject skelton for [%s] is successfully generated at [%s]\n\n", $app_id, $basedir);
-        return true;
-    }
-
-    /**
-     *  get handler's description
-     *
-     *  @access public
-     */
-    function getDescription()
-    {
-        return <<<EOS
-add new project:
-    {$this->id} [-b|--basedir=dir] [project-id]
-
-EOS;
-    }
-
-    /**
-     *  get usage
-     *
-     *  @access public
-     */
-    function getUsage()
-    {
-        return <<<EOS
-ethna {$this->id} [-b|--basedir=dir] [project-id]
-EOS;
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Handle/Ethna_Plugin_Handle_AddTemplate.php b/class/Plugin/Handle/Ethna_Plugin_Handle_AddTemplate.php
deleted file mode 100644 (file)
index 31f7999..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Handle_AddTemplate.php
- *
- *  @author     nnno <nnno@nnno.jp> 
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- */
-
-require_once ETHNA_BASE . '/class/Plugin/Handle/Ethna_Plugin_Handle_AddAction.php';
-
-// {{{ Ethna_Plugin_Handle_AddTemplate
-/**
- *  add-template handler
- *
- *  @author     nnno <nnno@nnno.jp>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Handle_AddTemplate extends Ethna_Plugin_Handle_AddAction
-{
-    /**
-     *  add template 
-     *
-     *  @access public
-     */
-    function perform()
-    {
-        $r =& $this->_getopt(array('basedir=', 'skelfile='));
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-        list($opt_list, $arg_list) = $r;
-
-        // template
-        $template = array_shift($arg_list);
-        if ($template == null) {
-            return Ethna::raiseError('template name isn\'t set.', 'usage');
-        }
-        $r =& Ethna_Controller::checkViewName($template); // XXX: use checkViewName().
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-
-        // add template
-        $ret =& $this->_perform('Template', $template, $opt_list);
-
-        return $ret;
-    }
-
-    /**
-     *  get handler's description
-     *
-     *  @access public
-     */
-    function getDescription()
-    {
-        return <<<EOS
-add new template to project:
-    {$this->id} [-b|--basedir=dir] [-s|--skelfile=file] [template]
-
-EOS;
-    }
-
-    /**
-     *  @access public
-     */
-    function getUsage()
-    {
-        return <<<EOS
-ethna {$this->id} [-b|--basedir=dir] [-s|--skelfile=file] [template]
-EOS;
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Handle/Ethna_Plugin_Handle_AddView.php b/class/Plugin/Handle/Ethna_Plugin_Handle_AddView.php
deleted file mode 100644 (file)
index 6e85074..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Handle_AddView.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-require_once ETHNA_BASE . '/class/Plugin/Handle/Ethna_Plugin_Handle_AddAction.php';
-
-// {{{ Ethna_Plugin_Handle_AddView
-/**
- *  add-view handler
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Handle_AddView extends Ethna_Plugin_Handle_AddAction
-{
-    /**
-     *  add view
-     *
-     *  @access public
-     */
-    function perform()
-    {
-        $r =& $this->_getopt(array('basedir=', 'skelfile=', 'template'));
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-        list($opt_list, $arg_list) = $r;
-
-        // view_name
-        $view_name = array_shift($arg_list);
-        if ($view_name == null) {
-            return Ethna::raiseError('view name isn\'t set.', 'usage');
-        }
-        $r =& Ethna_Controller::checkViewName($view_name);
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-
-        // add view
-        $ret =& $this->_perform('View', $view_name, $opt_list);
-        if (Ethna::isError($ret) || $ret === false) { 
-            return $ret;
-        }
-
-        // add template
-        if (isset($opt_list['template'])) {
-            $ret =& $this->_perform('Template', $view_name, $opt_list);
-            if (Ethna::isError($ret) || $ret === false) { 
-                return $ret;
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     *  get handler's description
-     *
-     *  @access public
-     */
-    function getDescription()
-    {
-        return <<<EOS
-add new view to project:
-    {$this->id} [-b|--basedir=dir] [-s|--skelfile=file] [-t|--template] [view]
-
-EOS;
-    }
-
-    /**
-     *  @access public
-     */
-    function getUsage()
-    {
-        return <<<EOS
-ethna {$this->id} [-b|--basedir=dir] [-s|--skelfile=file] [-t|--template] [view]
-EOS;
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Handle/Ethna_Plugin_Handle_AddViewTest.php b/class/Plugin/Handle/Ethna_Plugin_Handle_AddViewTest.php
deleted file mode 100644 (file)
index a7cc597..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-<?php
-/**
- *  Ethna_Plugin_Handle_AddViewTest.php
- *
- *  @author     halt feits <halt.feits@gmail.com>
- *  @package    Ethna
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @version    $Id$
- */
-
-require_once ETHNA_BASE . '/class/Plugin/Handle/Ethna_Plugin_Handle_AddView.php';
-
-// {{{ Ethna_Plugin_Handle_AddViewTest
-/**
- *  add-view-test handler
- *
- *  @author     halt feits <halt.feits@gmail.com>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Handle_AddViewTest extends Ethna_Plugin_Handle_AddView
-{
-    /**
-     *  add view test
-     *
-     *  @access public
-     */
-    function perform()
-    {
-        $r =& $this->_getopt(array('basedir=', 'skelfile='));
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-        list($opt_list, $arg_list) = $r;
-
-        // view_name
-        $view_name = array_shift($arg_list);
-        if ($view_name == null) {
-            return Ethna::raiseError('view name isn\'t set.', 'usage');
-        }
-        $r =& Ethna_Controller::checkViewName($view_name);
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-
-        $ret =& $this->_perform('ViewTest', $view_name, $opt_list);
-        return $ret;
-    }
-
-    /**
-     *  get handler's description
-     *
-     *  @access public
-     */
-    function getDescription()
-    {
-        return <<<EOS
-add new view test to project:
-    {$this->id} [-b|--basedir=dir] [-s|--skelfile=file] [view]
-
-EOS;
-    }
-
-    /**
-     *  @access public
-     */
-    function getUsage()
-    {
-        return <<<EOS
-ethna {$this->id} [-b|--basedir=dir] [-s|--skelfile=file] [view]
-EOS;
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Handle/Ethna_Plugin_Handle_ChannelUpdate.php b/class/Plugin/Handle/Ethna_Plugin_Handle_ChannelUpdate.php
deleted file mode 100644 (file)
index a0dc044..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Handle_ChannelUpdate.php
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-require_once ETHNA_BASE . '/class/Ethna_PearWrapper.php';
-
-// {{{ Ethna_Plugin_Handle_ChannelUpdate
-/**
- *  info-plugin handler
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Handle_ChannelUpdate extends Ethna_Plugin_Handle
-{
-    // {{{ _parseArgList()
-    /**
-     * @access private
-     */
-    function &_parseArgList()
-    {
-        $r =& $this->_getopt(array('local', 'master', 'basedir=',
-                                   'channel=', 'pearopt='));
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-        list($opt_list, $arg_list) = $r;
-        $ret = array();
-
-        // options
-        $ret['target'] = isset($opt_list['master']) ? 'master' : 'local';
-        if (isset($opt_list['basedir'])) {
-            $ret['basedir'] = end($opt_list['basedir']);
-        }
-        if (isset($opt_list['channel'])) {
-            $ret['channel'] = end($opt_list['channel']);
-        }
-
-        return $ret;
-    }
-    // }}}
-
-    // {{{ perform()
-    /**
-     *  @access public
-     */
-    function perform()
-    {
-        $args =& $this->_parseArgList();
-        if (Ethna::isError($args)) {
-            return $args;
-        }
-
-        $pear =& new Ethna_PearWrapper();
-        if (isset($args['pearopt'])) {
-            $pear->setPearOpt($args['pearopt']);
-        }
-
-        $target = isset($args['target']) ? $args['target'] : null;
-        $channel = isset($args['channel']) ? $args['channel'] : null;
-        $basedir = isset($args['basedir']) ? realpath($args['basedir']) : getcwd();
-
-        $r =& $pear->init($target, $basedir, $channel);
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-
-        $r =& $pear->doClearCache();
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-
-        $r =& $pear->doChannelUpdate();
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-
-        return true;
-    }
-    // }}}
-
-    // {{{ getDescription()
-    /**
-     *  @access public
-     */
-    function getDescription()
-    {
-        return <<<EOS
-update package repositry channel:
-    {$this->id} [-c|--channel=channel] [-b|--basedir=dir] [-l|--local] [-m|--master]
-
-EOS;
-    }
-    // }}}
-
-    // {{{ getUsage()
-    /**
-     *  @access public
-     */
-    function getUsage()
-    {
-        return <<<EOS
-ethna {$this->id} [-c|--channel=channel] [-b|--basedir=dir] [-l|--local] [-m|--master] [type name]
-EOS;
-    }
-    // }}}
-}
-// }}}
-?>
diff --git a/class/Plugin/Handle/Ethna_Plugin_Handle_ClearCache.php b/class/Plugin/Handle/Ethna_Plugin_Handle_ClearCache.php
deleted file mode 100644 (file)
index f79caa8..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Handle_ClearCache.php
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-require_once ETHNA_BASE . '/class/Ethna_PearWrapper.php';
-
-// {{{ Ethna_Plugin_Handle_ClearCache
-/**
- *  clear-cache handler
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Handle_ClearCache extends Ethna_Plugin_Handle
-{
-    /**
-     *  clear cache files.
-     *
-     *  @access public
-     *  @todo   implement Ethna_Renderer::clear_cache();
-     *  @todo   implement Ethna_Plugin_Cachemanager::clear_cache();
-     *  @todo   avoid echo, printf
-     */
-    function perform()
-    {
-        $r =& $this->_getopt(array('basedir=', 
-                                   'any-tmp-files', 'smarty', 'pear', 'cachemanager'));
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-        list($args,) = $r;
-
-        $basedir = isset($args['basedir']) ? realpath(end($args['basedir'])) : getcwd();
-        $controller =& Ethna_Handle::getAppController($basedir);
-        if (Ethna::isError($controller)) {
-            return $controller;
-        }
-        $tmp_dir = $controller->getDirectory('tmp');
-
-        if (isset($args['smarty']) || isset($args['any-tmp-files'])) {
-            echo "cleaning smarty caches, compiled templates...";
-            $renderer =& $controller->getRenderer();
-            if (strtolower(get_class($renderer)) == "ethna_renderer_smarty") {
-                $renderer->engine->clear_all_cache();
-                $renderer->engine->clear_compiled_tpl();
-            }
-            echo " done\n";
-        }
-
-        if (isset($args['cachemanager']) || isset($args['any-tmp-files'])) {
-            echo "cleaning Ethna_Plugin_Cachemanager caches...";
-            $cache_dir = sprintf("%s/cache", $tmp_dir);
-            Ethna_Util::purgeDir($cache_dir);
-            echo " done\n";
-        }
-
-        if (isset($args['pear']) || isset($args['any-tmp-files'])) {
-            echo "cleaning pear caches...";
-            ob_start();
-            $pear =& new Ethna_PearWrapper();
-            $r =& $pear->init('local', $basedir); 
-            if (Ethna::isError($r)) {
-                echo ob_get_clean();
-                return $r;
-            }
-            $r =& $pear->doClearCache();
-            if (Ethna::isError($r)) {
-                echo ob_get_clean();
-                return $r;
-            }
-            ob_get_clean();
-            echo " done\n";
-        }
-
-        if (isset($args['any-tmp-files'])) {
-            echo "cleaning tmp dirs...";
-            // purge only entries in tmp.
-            if ($dh = opendir($tmp_dir)) {
-                while (($entry = readdir($dh)) !== false) {
-                    if ($entry === '.' || $entry === '..') {
-                        continue;
-                    }
-                    Ethna_Util::purgeDir("{$tmp_dir}/{$entry}");
-                }
-                closedir($dh);
-            }
-            echo " done\n";
-        }
-
-        return true;
-    }
-
-    // {{{ getDescription()
-    /**
-     *  @access public
-     */
-    function getDescription()
-    {
-        return <<<EOS
-clear project's cache files:
-    {$this->id} [-b|--basedir=dir] [-a|--any-tmp-files] [-s|--smarty] [-p|--pear] [-c|--cachemanager]
-
-EOS;
-    }
-    // }}}
-
-    // {{{ getUsage()
-    /**
-     *  @access public
-     */
-    function getUsage()
-    {
-        return <<<EOS
-ethna {$this->id} [-b|--basedir=dir] [-a|--any-tmp-files] [-s|--smarty] [-p|--pear] [-c|--cachemanager]
-EOS;
-    }
-    // }}}
-}
-// }}}
-?>
diff --git a/class/Plugin/Handle/Ethna_Plugin_Handle_InfoPlugin.php b/class/Plugin/Handle/Ethna_Plugin_Handle_InfoPlugin.php
deleted file mode 100644 (file)
index 59be104..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Handle_InfoPlugin.php
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-require_once ETHNA_BASE . '/class/Ethna_PearWrapper.php';
-
-// {{{ Ethna_Plugin_Handle_InfoPlugin
-/**
- *  info-plugin handler
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Handle_InfoPlugin extends Ethna_Plugin_Handle
-{
-    // {{{ _parseArgList()
-    /**
-     * @access private
-     */
-    function &_parseArgList()
-    {
-        $r =& $this->_getopt(array('local', 'master',
-                                   'basedir=', 'channel=', 'pearopt='));
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-        list($opt_list, $arg_list) = $r;
-        $ret = array();
-
-        // options
-        $ret['target'] = isset($opt_list['master']) ? 'master' : 'local';
-        if (isset($opt_list['basedir'])) {
-            $ret['basedir'] = end($opt_list['basedir']);
-        }
-        if (isset($opt_list['channel'])) {
-            $ret['channel'] = end($opt_list['channel']);
-        }
-
-        // arguments
-        if (count($arg_list) == 2) {
-            $ret['type'] = $arg_list[0];
-            $ret['name'] = $arg_list[1];
-        }
-
-        return $ret;
-    }
-    // }}}
-
-    // {{{ perform()
-    /**
-     *  @access public
-     */
-    function perform()
-    {
-        $args =& $this->_parseArgList();
-        if (Ethna::isError($args)) {
-            return $args;
-        }
-
-        $pear =& new Ethna_PearWrapper();
-        if (isset($args['pearopt'])) {
-            $pear->setPearOpt($args['pearopt']);
-        }
-
-        if (isset($args['type']) && isset($args['name'])) {
-            $target = isset($args['target']) ? $args['target'] : null;
-            $channel = isset($args['channel']) ? $args['channel'] : null;
-            $basedir = isset($args['basedir']) ? realpath($args['basedir']) : getcwd();
-            if ($target == 'master') {
-                $pkg_name = sprintf('Ethna_Plugin_%s_%s', $args['type'], $args['name']);
-            } else {
-                $pkg_name = sprintf('App_Plugin_%s_%s', $args['type'], $args['name']);
-            }
-
-            $r =& $pear->init($target, $basedir, $channel);
-            if (Ethna::isError($r)) {
-                return $r;
-            }
-            $r =& $pear->doInfo($pkg_name);
-            if (Ethna::isError($r)) {
-                return $r;
-            }
-
-        } else {
-            return Ethna::raiseError('invalid arguments', 'usage');
-        }
-
-        return true;
-    }
-    // }}}
-
-    // {{{ getDescription()
-    /**
-     *  @access public
-     */
-    function getDescription()
-    {
-        return <<<EOS
-show plugin information:
-    {$this->id} [-c|--channel=channel] [-b|--basedir=dir] [-l|--local] [-m|--master] [type name]
-
-EOS;
-    }
-    // }}}
-
-    // {{{ getUsage()
-    /**
-     *  @access public
-     */
-    function getUsage()
-    {
-        return <<<EOS
-ethna {$this->id} [-c|--channel=channel] [-b|--basedir=dir] [-l|--local] [-m|--master] [type name]
-EOS;
-    }
-    // }}}
-}
-// }}}
-?>
diff --git a/class/Plugin/Handle/Ethna_Plugin_Handle_InstallPlugin.php b/class/Plugin/Handle/Ethna_Plugin_Handle_InstallPlugin.php
deleted file mode 100644 (file)
index 6d2cb6f..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Handle_InstallPlugin.php
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-require_once ETHNA_BASE . '/class/Ethna_PearWrapper.php';
-
-// {{{ Ethna_Plugin_Handle_InstallPlugin
-/**
- *  install-plugin handler
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Handle_InstallPlugin extends Ethna_Plugin_Handle
-{
-    // {{{ _parseArgList()
-    /**
-     * @access private
-     */
-    function &_parseArgList()
-    {
-        $r =& $this->_getopt(array('local', 'master', 'state=',
-                                   'basedir=', 'channel=', 'pearopt='));
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-        list($opt_list, $arg_list) = $r;
-        $ret = array();
-
-        // options
-        $ret['target'] = isset($opt_list['master']) ? 'master' : 'local';
-        if (isset($opt_list['basedir'])) {
-            $ret['basedir'] = end($opt_list['basedir']);
-        }
-        if (isset($opt_list['channel'])) {
-            $ret['channel'] = end($opt_list['channel']);
-        }
-        if (isset($opt_list['state'])) {
-            $ret['state'] = end($opt_list['state']);
-        }
-        if (isset($opt_list['pearopt'])) {
-            $ret['pearopt'] = $opt_list['pearopt'];
-        }
-
-        // arguments
-        if (count($arg_list) == 2) {
-            $ret['type'] = $arg_list[0];
-            $ret['name'] = $arg_list[1];
-        } else if (count($arg_list) == 1) {
-            $ret['pkg_file_or_url'] = $arg_list[0];
-        }
-
-        return $ret;
-    }
-    // }}}
-
-    // {{{ perform()
-    /**
-     *  @access public
-     *  @todo   deal with the package including some plugins.
-     */
-    function perform()
-    {
-        $args =& $this->_parseArgList();
-        if (Ethna::isError($args)) {
-            return $args;
-        }
-
-        $pear =& new Ethna_PearWrapper();
-        if (isset($args['pearopt'])) {
-            $pear->setPearOpt($args['pearopt']);
-        }
-
-        if (isset($args['pkg_file_or_url'])) {
-            // install from local tgz.
-            $pkg_file_or_url = $args['pkg_file_or_url'];
-            $pkg_name =& Ethna_PearWrapper::getPackageNameFromTgz($pkg_file_or_url);
-            if (Ethna::isError($pkg_name)) {
-                return $pkg_name;
-            }
-            list($appid,, $ctype, $cname) = explode('_', $pkg_name, 4);
-            $target = isset($args['target']) ? $args['target'] : null;
-            if ($target == 'master') {
-                if ($appid != 'Ethna') {
-                    return Ethna::raiseError("this package is not for master.");
-                }
-            } else {
-                if ($appid == 'Ethna') {
-                    return Ethna::raiseError("this package is not for local.");
-                }
-            }
-            $channel = isset($args['channel']) ? $args['channel'] : null;
-            $basedir = isset($args['basedir']) ? realpath($args['basedir']) : getcwd();
-
-            $r =& $pear->init($target, $basedir, $channel);
-            if (Ethna::isError($r)) {
-                return $r;
-            }
-            $r =& $pear->doInstallFromTgz($pkg_file_or_url, $pkg_name);
-            if (Ethna::isError($r)) {
-                return $r;
-            }
-
-        } else if (isset($args['type']) && isset($args['name'])) {
-            // install from repository.
-            $target = isset($args['target']) ? $args['target'] : null;
-            $channel = isset($args['channel']) ? $args['channel'] : null;
-            $basedir = isset($args['basedir']) ? realpath($args['basedir']) : getcwd();
-            $state = isset($args['state']) ? $args['state'] : null;
-            if ($target == 'master') {
-                $pkg_name = sprintf('Ethna_Plugin_%s_%s', $args['type'], $args['name']);
-            } else {
-                $pkg_name = sprintf('App_Plugin_%s_%s', $args['type'], $args['name']);
-            }
-
-            $r =& $pear->init($target, $basedir, $channel);
-            if (Ethna::isError($r)) {
-                return $r;
-            }
-            $r =& $pear->doInstall($pkg_name, $state);
-            if (Ethna::isError($r)) {
-                return $r;
-            }
-
-            $pkg_name = $pear->getCanonicalPackageName($pkg_name);
-            if (Ethna::isError($pkg_name)) {
-                return $pkg_name;
-            }
-
-        } else {
-            return Ethna::raiseError('invalid number of arguments', 'usage');
-        }
-
-        if ($target != 'master') {
-            list(,, $ctype, $cname) = explode('_', $pkg_name, 4);
-            $r = Ethna_Generator::generate('Plugin', $basedir, $ctype, $cname, true);
-            if (Ethna::isError($r)) {
-                return $r;
-            }
-        }
-
-        return true;
-    }
-    // }}}
-
-    // {{{ getDescription()
-    /**
-     *  @access public
-     */
-    function getDescription()
-    {
-        return <<<EOS
-install plugin:
-    {$this->id} [-c|--channel=channel] [-b|--basedir=dir] [-l|--local] [-m|--master] [type name|packagefile|packageurl]
-
-EOS;
-    }
-    // }}}
-
-    // {{{
-    /**
-     *  @access public
-     */
-    function getUsage()
-    {
-        return <<<EOS
-ethna {$this->id} [-c|--channel=channel] [-b|--basedir=dir] [-l|--local] [-m|--master] [type name|packagefile|packageurl]
-EOS;
-    }
-    // }}}
-}
-// }}}
-?>
diff --git a/class/Plugin/Handle/Ethna_Plugin_Handle_ListPlugin.php b/class/Plugin/Handle/Ethna_Plugin_Handle_ListPlugin.php
deleted file mode 100644 (file)
index 8e44244..0000000
+++ /dev/null
@@ -1,243 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Handle_ListPlugin.php
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-require_once ETHNA_BASE . '/class/Ethna_PearWrapper.php';
-
-// {{{ Ethna_Plugin_Handle_ListPlugin
-/**
- *  list-plugin handler
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Handle_ListPlugin extends Ethna_Plugin_Handle
-{
-    // {{{ perform()
-    /**
-     *  @access public
-     */
-    function perform()
-    {
-        $r =& $this->_getopt(array('local', 'master',  'type=',
-                                   'basedir=', 'channel=', 'verbose'));
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-        list($args,) = $r;
-
-        $target = isset($args['master']) ? 'master' : 'local';
-        $channel = isset($args['channel']) ? end($args['channel']) : null;
-        $basedir = isset($args['basedir']) ? realpath(end($args['basedir'])) : getcwd();
-        $verbose = isset($args['verbose']);
-        $type = isset($args['type']) ? end($args['type']) : null;
-
-        // prepare PearWrapper object.
-        $pear =& new Ethna_PearWrapper();
-        $r =& $pear->init($target, $basedir, $channel);
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-
-        // get plugin list.
-        $plugins_found = $this->_getFoundPluginList($pear, $type);
-        if (Ethna::isError($plugins_found)) {
-            return $plugins_found;
-        }
-        $plugins_installed = $this->_getInstalledPluginList($pear, $type);
-        if (Ethna::isError($plugins_installed)) {
-            return $plugins_installed;
-        }
-
-        // create table data.
-        $data = array();
-        $class_list = array_merge(array_keys($plugins_found), array_keys($plugins_installed));
-        sort($class_list);
-        $class_list = array_unique($class_list);
-        foreach ($class_list as $class_name) {
-            $tmp = array();
-
-            // check found plugin.
-            if (isset($plugins_found[$class_name])) {
-                list($type, $name) = $plugins_found[$class_name];
-                $tmp[0] = $type;
-                $tmp[1] = $name;
-                $tmp[2] = $class_name;
-                $tmp[3] = '-';
-                if ($verbose) {
-                    $tmp[4] = '-';
-                    $tmp[5] = '-';
-                }
-            }
-
-            // check installed plugin.
-            if (isset($plugins_installed[$class_name])) {
-                list($type, $name, $pkg_name, $pkg_version, $pkg_state)
-                    = $plugins_installed[$class_name];
-                if (isset($tmp[0])) {
-                    $tmp[3] = $pkg_name;
-                    if ($verbose) {
-                        $tmp[4] = $pkg_version;
-                        $tmp[5] = $pkg_state;
-                    }
-                } else {
-                    // this plugin is only in skelton
-                    $tmp[0] = $type;
-                    $tmp[1] = $name;
-                    $tmp[2] = '-';
-                    $tmp[3] = $pkg_name;
-                    if ($verbose) {
-                        $tmp[4] = $pkg_version;
-                        $tmp[5] = $pkg_state;
-                    }
-                }
-            }
-
-            if (isset($tmp[0])) {
-                $data[] = $tmp;
-            }
-        }
-
-        usort($data, array(&$this, '_sort'));
-        if ($verbose) {
-            $pear->displayTable('installed plugins',
-                array('type', 'name', 'class', 'package', 'version', 'state'),
-                $data);
-        } else {
-            $pear->displayTable('installed plugins',
-                array('type', 'name', 'class', 'package'),
-                $data);
-        }
-        return true;
-    }
-    // }}}
-
-    // {{{ _getInstalledPluginList()
-    /**
-     *  get a list of plugins under pear installation management.
-     *
-     *  @param  object  $pear   Ethna_PearWrapper object.
-     *  @param  string  $_type   plugin type
-     *  @return array   package list
-     *  @access private
-     *  @todo   deal with the package including some plugins.
-     */
-    function &_getInstalledPluginList(&$pear, $_type = null)
-    {
-        $pkg_list =& $pear->getInstalledPackageList();
-        if (Ethna::isError($pkg_list)) {
-            return $pkg_list;
-        }
-
-        $ret = array();
-
-        $plugin =& $pear->target_ctl->getPlugin();
-        $appid = $pear->target_ctl->getAppId();
-        $test_prefix = $pear->target == 'master' ? 'Ethna' : 'App';
-
-        foreach ($pkg_list as $pkg_name) {
-            list($prefix,, $type, $name) = explode('_', $pkg_name, 4);
-            if (($_type === null || $_type == $type) && $prefix == $test_prefix) {
-                list($class_name,,) = $plugin->getPluginNaming($type, $name, $appid);
-                $pkg_version = $pear->getVersion($pkg_name);
-                $pkg_state = $pear->getState($pkg_name);
-                $ret[$class_name] = array($type, $name, $pkg_name,
-                                          $pkg_version, $pkg_state);
-            }
-        }
-        return $ret;
-    }
-    // }}}
-
-    // {{{ _getFoundPluginList()
-    /**
-     *  get a list of plugins found from controller.
-     *  (a local plugin might be installed but still in only skelton.)
-     *
-     *  @param  object  $pear   Ethna_PearWrapper object.
-     *  @param  string  $_type   plugin type
-     *  @return array   package list
-     *  @access private
-     */
-    function &_getFoundPluginList(&$pear, $_type = null)
-    {
-        $ret = array();
-
-        $plugin =& $pear->target_ctl->getPlugin();
-        $type_list = $_type === null ? $plugin->searchAllPluginType() : array($_type);
-
-        foreach ($type_list as $type) {
-            $plugin->searchAllPluginSrc($type);
-            if (isset($plugin->src_registry[$type]) === false) {
-                continue;
-            }
-            foreach ($plugin->src_registry[$type] as $name => $src) {
-                if (empty($src)) {
-                    continue;
-                }
-                list($appid,, $type, $name) = explode('_', $src[0], 4);
-                if (($pear->target == 'master' && $appid == 'Ethna') || $appid != 'Ethna') {
-                    // XXX: src is private! ([0] is class name)
-                    $ret[$src[0]] = array($type, $name);
-                }
-            }
-        }
-        return $ret;
-    }
-    // }}}
-
-    // {{{ _sort
-    /**
-     *  sort callback method
-     */
-    function _sort($a, $b)
-    {
-        $cmp_type = strcmp($a[0], $b[0]);
-        if ($cmp_type !== 0) {
-            return $cmp_type;
-        }
-        $cmp_name = strcmp($a[1], $b[1]);
-        if ($cmp_name !== 0) {
-            return $cmp_name;
-        }
-        return 0;
-    }
-    // }}}
-
-    // {{{ getDescription()
-    /**
-     *  @access public
-     */
-    function getDescription()
-    {
-        return <<<EOS
-list local or master plugins. if type (case sensitive) not specified, list all plugins:
-    {$this->id} [-c|--channel=channel] [-b|--basedir=dir] [-l|--local] [-m|--master] [-t|--type=type] [-v|--verbose]
-
-EOS;
-    }
-    // }}}
-
-    // {{{ getUsage()
-    /**
-     *  @access public
-     */
-    function getUsage()
-    {
-        return <<<EOS
-ethna {$this->id} [-c|--channel=channel] [-b|--basedir=dir] [-l|--local] [-m|--master] [-t|--type=type] [-v|--verbose]
-EOS;
-    }
-    // }}}
-}
-// }}}
-
-?>
diff --git a/class/Plugin/Handle/Ethna_Plugin_Handle_MakePluginPackage.php b/class/Plugin/Handle/Ethna_Plugin_Handle_MakePluginPackage.php
deleted file mode 100644 (file)
index 38f6cc7..0000000
+++ /dev/null
@@ -1,299 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Handle_MakePluginPackage.php
- *
- *  please go to http://ethna.jp/ethna-document-dev_guide-pearchannel.html
- *  for more info.
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-require_once ETHNA_BASE . '/class/Ethna_PearWrapper.php';
-
-// {{{ Ethna_Plugin_Handle_MakePluginPackage
-/**
- *  make-plugin-package handler.
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Handle_MakePluginPackage extends Ethna_Plugin_Handle
-{
-    // {{{ perform()
-    /**
-     * @access public
-     */
-    function perform()
-    {
-        require_once 'PEAR/PackageFileManager.php';
-        require_once 'PEAR/PackageFileManager2.php';
-        require_once 'PEAR/PackageFileManager/File.php';
-
-        // °ú¿ô¤Îɾ²Á
-        $args =& $this->_parseArgList();
-        if (Ethna::isError($args)) {
-            return $args;
-        }
-        list($ini, $skelfile, $workdir) = $args;
-
-        // ¥Ñ¥Ã¥±¡¼¥¸¤òºî¤ë¥×¥é¥°¥¤¥ó¤Î target
-        $targets = array();
-        if ($ini['plugin']['master'] == true) {
-            $targets[] = 'master';
-        }
-        if ($ini['plugin']['local'] == true) {
-            $targets[] = 'local';
-        }
-
-        // ÀßÄêÍѤÎÇÛÎó¤òÍÑ°Õ
-        $setting = array();
-
-        // {{{ master ¤È local ¤Ç¶¦Ä̤ÎÀßÄê
-        // ¥×¥é¥°¥¤¥ó̾
-        $ptype = $ini['plugin']['type'];
-        $pname = $ini['plugin']['name'];
-
-        // ¥Ñ¥Ã¥±¡¼¥¸¤ÎÀâÌÀ
-        $setting['channel']     = $ini['package']['channel'];
-        $setting['summary']     = $ini['package']['summary'];
-        $setting['description'] = $ini['package']['description'];
-
-        // ¥ê¥ê¡¼¥¹¤ÎÀâÌÀ
-        $setting['version']     = $ini['release']['version'];
-        $setting['state']       = $ini['release']['state'];
-        $setting['notes']       = $ini['release']['notes'];
-
-        // ¥á¥ó¥Æ¥Ê
-        $mnts = $ini['maintainers'];
-        for ($i = 1; ; $i++) {
-            if (isset($mnts["name$i"]) == false
-                || isset($mnts["user$i"]) == false
-                || isset($mnts["email$i"]) == false) {
-                break;
-            }
-            $setting['maintainers'][] = array(
-                'user'   => $mnts["user$i"],
-                'name'   => $mnts["name$i"],
-                'email'  => $mnts["email$i"],
-                'role'   => isset($mnts["role$i"]) ? $mnts["role$i"] : 'lead',
-                'active' => isset($mnts["active$i"]) ? $mnts["active$i"] == true: 'yes',
-                );
-        }
-
-        // ¥é¥¤¥»¥ó¥¹
-        $setting['license']['name'] = $ini['license']['name'];
-        if (isset($ini['license']['uri'])) {
-            $setting['license']['uri'] = $ini['license']['uri'];
-        }
-        // }}}
-
-        // ¤Þ¤ë¤Þ¤ë¥³¥Ô¡¼ :-p
-        $setting = array('master' => $setting, 'local' => $setting);
-
-        // {{{ master ¤È local ¤Ç°Û¤Ê¤ëÉôʬ
-        // ¥Ñ¥Ã¥±¡¼¥¸Ì¾
-        $setting['master']['pkgname'] = "Ethna_Plugin_{$ptype}_{$pname}";
-        $setting['local'] ['pkgname'] = "App_Plugin_{$ptype}_{$pname}";
-
-        // ¥×¥é¥°¥¤¥ó¤Î¥Õ¥¡¥¤¥ë̾
-        $setting['master']['filename'] = "Ethna_Plugin_{$ptype}_{$pname}.php";
-        $setting['local'] ['filename'] = "skel.plugin.{$ptype}_{$pname}.php";
-
-        // ÆþÎÏ¥Õ¥¡¥¤¥ë¤ÎÃÖ´¹¥Þ¥¯¥í
-        $setting['master']['macro'] = array(
-            // package »þ¤ËÃÖ´¹
-            'application_id'    => 'Ethna',
-            'project_id'        => 'Ethna',
-            );
-        $setting['local']['macro'] = array(
-            // install »þ¤ËÃÖ´¹
-            );
-
-        // setOptins($config) »þ¤Ë merge ¤¹¤ëÀßÄê
-        $setting['master']['config'] = array(
-            'baseinstalldir' => "Ethna/class/Plugin/{$ptype}",
-            );
-        $setting['local']['config'] = array(
-            'baseinstalldir' => '.',
-            );
-
-        // Ç¤°Õ¤Ë $packagexml->doSomething() ¤¹¤ë¤¿¤á¤Î callback
-        $setting['master']['callback'] = array(
-            'addPackageDepWithChannel'
-                => array('optional', 'ethna', 'pear.ethna.jp', '2.3.0'),
-            );
-        $setting['local']['callback'] = array(
-            // local ÍѤΥѥ屡¼¥¸¤ò master ¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤»¤Ê¤¤¤¿¤á¤Î conflict
-            'addConflictingPackageDepWithChannel'
-                => array('pear', 'pear.php.net'),
-            );
-        // }}}
-
-
-        // ¥Ñ¥Ã¥±¡¼¥¸ºîÀ®
-        $this->pear =& new Ethna_PearWrapper();
-        $this->pear->init('master');
-        foreach ($targets as $target) {
-            $this->_makePackage($skelfile, $setting[$target], "$workdir/$target");
-        }
-    }
-    // }}}
-
-    // {{{ _makePackage()
-    /**
-     * @access private
-     */
-    function &_makePackage($skelfile, $setting, $workdir)
-    {
-        if (Ethna_Util::mkdir($workdir, 0755) === false) {
-            return Ethna::raiseError("failed making working dir: $workdir.");
-        }
-
-        // ¥×¥é¥°¥¤¥ó¤Î¸µ¥Õ¥¡¥¤¥ë¤òºîÀ®
-        $rfp = fopen($skelfile, "r");
-        if ($rfp == false) {
-            return Ethna::raiseError("failed open skelton file: $skelfile.");
-        }
-        $outputfile = $setting['filename'];
-        $wfp = fopen("$workdir/$outputfile", "w");
-        if ($rfp == false) {
-            fclose($rfp);
-            return Ethna::raiseError("failed creating working file: $outputfile.");
-        }
-        for (;;) {
-            $s = fread($rfp, 4096);
-            if (strlen($s) == 0) {
-                break;
-            }
-            foreach ($setting['macro'] as $k => $v) {
-                $s = preg_replace("/{\\\$$k}/", $v, $s);
-            }
-            fwrite($wfp, $s);
-        }
-        fclose($wfp);
-        fclose($rfp);
-
-        // package.xml ¤òºî¤ë
-        $pkgconfig = array(
-            'packagedirectory' => $workdir,
-            'outputdirectory' => $workdir,
-            'ignore' => array('CVS/', '.cvsignore', '.svn/',
-                              'package.xml', 'package.ini', $setting['pkgname'].'-*.tgz'),
-            'filelistgenerator' => 'file',
-            'changelogoldtonew' => false,
-            );
-
-        $packagexml =& new PEAR_PackageFileManager2();
-
-        $pkgconfig = array_merge($pkgconfig, $setting['config']);
-        $packagexml->setOptions($pkgconfig);
-
-        $packagexml->setPackage($setting['pkgname']);
-        $packagexml->setSummary($setting['summary']);
-        $packagexml->setNotes($setting['notes']);
-        $packagexml->setDescription($setting['description']);
-        $packagexml->setChannel($setting['channel']);
-        $packagexml->setAPIVersion($setting['version']);
-        $packagexml->setReleaseVersion($setting['version']);
-        $packagexml->setReleaseStability($setting['state']);
-        $packagexml->setAPIStability($setting['state']);
-        $packagexml->setPackageType('php');
-        foreach ($setting['maintainers'] as $m) {
-            $packagexml->addMaintainer($m['role'], $m['user'], $m['name'],
-                                       $m['email'], $m['active']);
-        }
-        $packagexml->setLicense($setting['license']['name'],
-                                $setting['license']['uri']);
-
-        $packagexml->addRole('css', 'php');
-        $packagexml->addRole('tpl', 'php');
-        $packagexml->addRole('ethna', 'php');
-        $packagexml->addRole('sh', 'script');
-        $packagexml->addRole('bat', 'script');
-
-        $packagexml->setPhpDep('4.1.0');
-        $packagexml->setPearinstallerDep('1.3.5');
-
-        $packagexml->generateContents();
-
-        foreach ($setting['callback'] as $method => $params) {
-            $r = call_user_func_array(array(&$packagexml, $method), $params);
-        }
-
-        $r = $packagexml->writePackageFile();
-        if (PEAR::isError($r)) {
-            return Ethna::raiseError($r->getMessage, $r->getCode());
-        }
-
-        // package ¤òºî¤ë
-        $r = $this->pear->_run('package', array(), array("$workdir/package.xml"));
-        if (PEAR::isError($r)) {
-            return Ethna::raiseError($r->getMessage, $r->getCode());
-        }
-
-        if (Ethna_Util::purgeDir($workdir) === false) {
-            return Ethna::raiseError("failed cleaning up working dir: $workdir.");
-        }
-    }
-    // }}}
-
-    // {{{ _parseArgList()
-    /**
-     * @access private
-     */
-    function &_parseArgList()
-    {
-        $r =& $this->_getopt(array('inifile=', 'skelfile=', 'workdir='));
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-        list($opt_list, $arg_list) = $r;
-
-        // inifile
-        if (isset($opt_list['inifile'])
-            && is_readable(end($opt_list['inifile']))) {
-            $ini = parse_ini_file(end($opt_list['inifile']), true);
-        } else {
-            return Ethna::raiseError('give a valid inifile.');
-        }
-
-        // skelfile
-        if (isset($opt_list['skelfile'])
-            && is_readable(end($opt_list['skelfile']))) {
-            $skelfile = end($opt_list['skelfile']);
-        } else {
-            return Ethna::raiseError('give a valid filename of plugin skelton file.');
-        }
-
-        // workdir
-        if (isset($opt_list['workdir'])) {
-            $workdir = end($opt_list['workdir']);
-        } else {
-            $workdir = getcwd();
-        }
-
-        return array($ini, $skelfile, $workdir);
-    }
-    // }}}
-
-    // {{{ getDescription()
-    /**
-     *  @access public
-     */
-    function getDescription()
-    {
-        return <<<EOS
-make plugin package:
-    {$this->id} [-i|--inifile=file] [-s|--skelfile=file] [-w|--workdir=dir]
-
-EOS;
-    }
-    // }}}
-}
-// }}}
-?>
diff --git a/class/Plugin/Handle/Ethna_Plugin_Handle_PearLocal.php b/class/Plugin/Handle/Ethna_Plugin_Handle_PearLocal.php
deleted file mode 100644 (file)
index 3c60088..0000000
+++ /dev/null
@@ -1,256 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Handle_PearLocal.php
- *
- *  @author     Yoshinari Takaoka <takaoka@beatcraft.com>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-require_once 'PEAR/Config.php';
-require_once ETHNA_BASE . '/class/Ethna_PearWrapper.php';
-
-// {{{ Ethna_PearConfig_Local
-/**
- *  Special Class for Pear Install Handler.
- *  This class should be instantiated by ONLY Ethna_Plugin_Handle_PearLocal.
- *
- *  @author     Yoshinari Takaoka <takaoka@beatcraft.com>
- *  @access     private
- *  @package    Ethna
- */
-class Ethna_PearConfig_Local extends Ethna_PearWrapper 
-{
-
-    // {{{ _setLocalConfig 
-    /**
-     *  config for local.
-     *
-     *  @return true|Ethna_Error
-     *  @access private 
-     */
-    function &_setLocalConfig()
-    {
-        $true = true;
-
-        // determine dirs
-        $base = $this->target_ctl->getBaseDir();
-        $bin  = $this->target_ctl->getDirectory('bin');
-        $tmp  = $this->target_ctl->getDirectory('tmp');
-        $dirs = array(
-                'php_dir'       => "{$base}/lib",
-                'bin_dir'       => "{$base}/bin",
-                'cache_dir'     => "{$tmp}/.pear/cache",
-                'download_dir'  => "{$tmp}/.pear/download",
-                'temp_dir'      => "{$tmp}/.pear/temp",
-                'doc_dir'       => "{$tmp}/.pear/doc",
-                'ext_dir'       => "{$tmp}/.pear/ext",
-                'data_dir'      => "{$tmp}/.pear/data",
-                'test_dir'      => "{$tmp}/.pear/test",
-                );
-
-        $default_pearrc = "{$base}"
-                        . DIRECTORY_SEPARATOR
-                        . "lib"
-                        . DIRECTORY_SEPARATOR
-                        . "pear.conf";
-        $app_config = $this->target_ctl->getConfig();
-        $app_pearrc = $app_config->get('app_pear_local_config');
-        $pearrc = (empty($app_pearrc))
-                ? $default_pearrc
-                : "{$base}/$app_pearrc";
-        $this->conf_file = $pearrc;
-        $this->config =& PEAR_Config::singleton($pearrc);
-
-        // read local .pearrc if exists.
-        if (is_file($pearrc) && is_readable($pearrc)) {
-            $this->config->readConfigFile($pearrc);
-        }
-
-        // set dirs to config
-        foreach ($dirs as $key => $dir) {
-            $_dir = $this->config->get($key, 'user');
-            if (!isset($_dir)) {
-                if (is_dir($dir) == false) {
-                    Ethna_Util::mkdir($dir, 0755);
-                }
-                $this->config->set($key, $dir);
-            }
-        }
-
-        if ($this->channel == 'dummy') {
-            $default_channel = $this->config->get('default_channel', 'user');
-            $this->channel = (empty($default_channel))
-                           ? 'pear.php.net'
-                           : $default_channel;
-        }
-
-        // setup channel
-        $reg =& $this->config->getRegistry();
-        if ($reg->channelExists($this->channel) == false) {
-            $ret =& $this->doChannelDiscover();
-            if (Ethna::isError($ret)) {
-                return $ret;
-            }
-        }
-        $this->config->set('default_channel', $this->channel);
-
-        // write local .pearrc
-        $this->config->writeConfigFile($pearrc);
-
-        return $true;
-    }
-    // }}}
-
-    // {{{ getConfFile 
-    /**
-     *    return local config filename.
-     */
-     function getConfFile()
-     {
-         return $this->conf_file;
-
-     }
-     // }}}
-}
-// }}}
-
-// {{{ Ethna_Plugin_Handle_PearLocal
-/**
- *  pear package install handler
- *
- *  @author     Yoshinari Takaoka <takaoka@beatcraft.com>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Handle_PearLocal extends Ethna_Plugin_Handle
-{
-    // {{{ _parseArgList() 
-    /**
-     * @access private
-     */
-    function &_parseArgList()
-    {
-        $r =& $this->_getopt(array('basedir=', 'channel='));
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-
-        list($opt_list, $arg_list) = $r;
-        $ret = array();
-
-        // options
-        if (isset($opt_list['basedir'])) {
-            $ret['basedir'] = end($opt_list['basedir']);
-        }
-        if (isset($opt_list['channel'])) {
-            $ret['channel'] = end($opt_list['channel']);
-        }
-
-        // arguments
-        $ret['pear_args'] = $arg_list;
-
-        return $ret;
-    }
-    // }}}
-
-    // {{{ perform()
-    /**
-     *  @access public
-     *  @todo   deal with the package including some plugins.
-     */
-    function perform()
-    {
-        $true = true;
-
-        //   check arguments.
-        $args =& $this->_parseArgList();
-        if (Ethna::isError($args)) {
-            return Ethna::raiseError(
-                $args->getMessage(),
-                'usage'
-            );
-        }
-
-        $basedir = isset($args['basedir']) ? realpath($args['basedir']) : getcwd();
-        $channel = isset($args['channel']) ? $args['channel'] : 'dummy';
-
-        $pear_local =& new Ethna_PearConfig_Local();
-        $r =& $pear_local->init('local', $basedir, $channel);
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-
-        //    build command string.
-        $pear_cmds = $args['pear_args'];
-        $pear_bin = (OS_WINDOWS)
-                  ? getenv('PHP_PEAR_BIN_DIR') . DIRECTORY_SEPARATOR . 'pear.bat'
-                  : (PHP_BINDIR . DIRECTORY_SEPARATOR . 'pear');
-        $local_conf_file = $pear_local->getConfFile();
-        array_unshift(
-            $pear_cmds,
-            $pear_bin,
-            '-c',
-            $local_conf_file
-        );
-        if (OS_WINDOWS) {
-            foreach($pear_cmds as $key => $value) {
-                $pear_cmds[$key] = (strpos($value, ' ') !== false)
-                                 ? ('"' . $value . '"')
-                                 : $value;
-            }
-        }
-        $command_str = implode(' ', $pear_cmds);
-
-        //   finally exec pear command.
-        if (OS_WINDOWS) {
-            $tmp_dir_name ="ethna_tmp_dir";
-            Ethna_Util::mkdir($tmp_dir_name, 0777);
-            $tmpnam = tempnam($tmp_dir_name, "temp") .'.bat';
-            $fp = fopen($tmpnam, 'w');
-            fwrite($fp, "@echo off\r\n");
-            fwrite($fp, $command_str . " 2>&1");
-            fclose ($fp);
-            system($tmpnam);
-            Ethna_Util::purgeDir($tmp_dir_name);
-        } else {
-            system($command_str);
-        }
-
-        return $true;
-    }
-    // }}}
-
-    // {{{ getDescription()
-    /**
-     *  @access public
-     */
-    function getDescription()
-    {
-        return <<<EOS
-install pear package to {base_dir}/lib, {base_dir}/bin ... :
-    {$this->id} [-c|--channel=channel] [-b|--basedir=dir] [pear command ...]
-    for more pear command information, see "pear help"
-
-EOS;
-    }
-    // }}}
-
-    // {{{ getUsage()
-    /**
-     *  @access public
-     */
-    function getUsage()
-    {
-        return <<<EOS
-ethna {$this->id} [-c|--channel=channel] [-b|--basedir=dir] [pear command ...]
-    for more pear command information, see "pear help"
-
-EOS;
-    }
-    // }}}
-}
-// }}}
-?>
diff --git a/class/Plugin/Handle/Ethna_Plugin_Handle_UninstallPlugin.php b/class/Plugin/Handle/Ethna_Plugin_Handle_UninstallPlugin.php
deleted file mode 100644 (file)
index 4a392ac..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Handle_UninstallPlugin.php
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-require_once ETHNA_BASE . '/class/Ethna_PearWrapper.php';
-
-// {{{ Ethna_Plugin_Handle_UninstallPlugin
-/**
- *  install-plugin handler
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Handle_UninstallPlugin extends Ethna_Plugin_Handle
-{
-    // {{{ _parseArgList()
-    /**
-     * @access private
-     */
-    function &_parseArgList()
-    {
-        $r =& $this->_getopt(array('local', 'master', 'basedir=',
-                                   'channel=', 'pearopt='));
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-        list($opt_list, $arg_list) = $r;
-        $ret = array();
-
-        // options
-        $ret['target'] = isset($opt_list['master']) ? 'master' : 'local';
-        if (isset($opt_list['basedir'])) {
-            $ret['basedir'] = end($opt_list['basedir']);
-        }
-        if (isset($opt_list['channel'])) {
-            $ret['channel'] = end($opt_list['channel']);
-        }
-
-        // arguments
-        if (count($arg_list) == 2) {
-            $ret['type'] = $arg_list[0];
-            $ret['name'] = $arg_list[1];
-        }
-
-        return $ret;
-    }
-    // }}}
-
-    // {{{ perform()
-    /**
-     *  @access public
-     *  @todo   deal with the package including some plugins.
-     */
-    function perform()
-    {
-        $args =& $this->_parseArgList();
-        if (Ethna::isError($args)) {
-            return $args;
-        }
-
-        $pear =& new Ethna_PearWrapper();
-        if (isset($args['pearopt'])) {
-            $pear->setPearOpt($args['pearopt']);
-        }
-
-        if (isset($args['type']) && isset($args['name'])) {
-            // install from repository.
-            $target = isset($args['target']) ? $args['target'] : null;
-            $channel = isset($args['channel']) ? $args['channel'] : null;
-            $basedir = isset($args['basedir']) ? realpath($args['basedir']) : getcwd();
-            if ($target == 'master') {
-                $pkg_name = sprintf('Ethna_Plugin_%s_%s', $args['type'], $args['name']);
-            } else {
-                $pkg_name = sprintf('App_Plugin_%s_%s', $args['type'], $args['name']);
-            }
-
-            $r =& $pear->init($target, $basedir, $channel);
-            if (Ethna::isError($r)) {
-                return $r;
-            }
-            $pkg_name = $pear->getCanonicalPackageName($pkg_name);
-            if (Ethna::isError($pkg_name)) {
-                return $pkg_name;
-            }
-            $r =& $pear->doUninstall($pkg_name);
-            if (Ethna::isError($r)) {
-                return $r;
-            }
-
-        } else {
-            return Ethna::raiseError('invalid number of arguments', 'usage');
-        }
-
-        if ($target != 'master') {
-            list(,, $ctype, $cname) = explode('_', $pkg_name, 4);
-            $r = Ethna_Generator::remove('Plugin', $basedir, $ctype, $cname);
-            if (Ethna::isError($r)) {
-                return $r;
-            }
-        }
-
-        return true;
-    }
-    // }}}
-
-    // {{{ getDescription()
-    /**
-     *  @access public
-     */
-    function getDescription()
-    {
-        return <<<EOS
-uninstall plugin:
-    {$this->id} [-c|--channel=channel] [-b|--basedir=dir] [-l|--local] [-m|--master] [type name]
-
-EOS;
-    }
-    // }}}
-
-    // {{{
-    /**
-     *  @access public
-     */
-    function getUsage()
-    {
-        return <<<EOS
-ethna {$this->id} [-c|--channel=channel] [-b|--basedir=dir] [-l|--local] [-m|--master] [type name]
-EOS;
-    }
-    // }}}
-}
-// }}}
-?>
diff --git a/class/Plugin/Handle/Ethna_Plugin_Handle_UpgradePlugin.php b/class/Plugin/Handle/Ethna_Plugin_Handle_UpgradePlugin.php
deleted file mode 100644 (file)
index ab1ad73..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Handle_UpgradePlugin.php
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-require_once ETHNA_BASE . '/class/Ethna_PearWrapper.php';
-
-// {{{ Ethna_Plugin_Handle_UpgradePlugin
-/**
- *  install-plugin handler
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Handle_UpgradePlugin extends Ethna_Plugin_Handle
-{
-    // {{{ _parseArgList()
-    /**
-     * @access private
-     */
-    function &_parseArgList()
-    {
-        $r =& $this->_getopt(array('local', 'master', 'state=',
-                                   'basedir=', 'channel=', 'pearopt='));
-        if (Ethna::isError($r)) {
-            return $r;
-        }
-        list($opt_list, $arg_list) = $r;
-        $ret = array();
-
-        // options
-        $ret['target'] = isset($opt_list['master']) ? 'master' : 'local';
-        if (isset($opt_list['basedir'])) {
-            $ret['basedir'] = end($opt_list['basedir']);
-        }
-        if (isset($opt_list['channel'])) {
-            $ret['channel'] = end($opt_list['channel']);
-        }
-        if (isset($opt_list['state'])) {
-            $ret['state'] = end($opt_list['state']);
-        }
-
-        // arguments
-        if (count($arg_list) == 2) {
-            $ret['type'] = $arg_list[0];
-            $ret['name'] = $arg_list[1];
-        } else if (count($arg_list) == 1) {
-            $ret['pkg_file_or_url'] = $arg_list[0];
-        }
-
-        return $ret;
-    }
-    // }}}
-
-    // {{{ perform()
-    /**
-     *  @access public
-     *  @todo   deal with the package including some plugins.
-     */
-    function perform()
-    {
-        $args =& $this->_parseArgList();
-        if (Ethna::isError($args)) {
-            return $args;
-        }
-
-        $pear =& new Ethna_PearWrapper();
-        if (isset($args['pearopt'])) {
-            $pear->setPearOpt($args['pearopt']);
-        }
-
-        if (isset($args['pkg_file_or_url'])) {
-            // install from local tgz.
-            $pkg_file_or_url = $args['pkg_file_or_url'];
-            $pkg_name =& Ethna_PearWrapper::getPackageNameFromTgz($pkg_file_or_url);
-            if (Ethna::isError($pkg_name)) {
-                return $pkg_name;
-            }
-            list($appid,, $ctype, $cname) = explode('_', $pkg_name, 4);
-            $target = $appid == 'Ethna' ? 'master' : 'local';
-            $channel = isset($args['channel']) ? $args['channel'] : null;
-            $basedir = isset($args['basedir']) ? realpath($args['basedir']) : getcwd();
-
-            $r =& $pear->init($target, $basedir, $channel);
-            if (Ethna::isError($r)) {
-                return $r;
-            }
-            $r =& $pear->doUpgradeFromTgz($pkg_file_or_url, $pkg_name);
-            if (Ethna::isError($r)) {
-                return $r;
-            }
-
-        } else if (isset($args['type']) && isset($args['name'])) {
-            // install from repository.
-            $target = isset($args['target']) ? $args['target'] : null;
-            $channel = isset($args['channel']) ? $args['channel'] : null;
-            $basedir = isset($args['basedir']) ? realpath($args['basedir']) : getcwd();
-            $state = isset($args['state']) ? $args['state'] : null;
-            if ($target == 'master') {
-                $pkg_name = sprintf('Ethna_Plugin_%s_%s', $args['type'], $args['name']);
-            } else {
-                $pkg_name = sprintf('App_Plugin_%s_%s', $args['type'], $args['name']);
-            }
-
-            $r =& $pear->init($target, $basedir, $channel);
-            if (Ethna::isError($r)) {
-                return $r;
-            }
-            $r =& $pear->doUpgrade($pkg_name, $state);
-            if (Ethna::isError($r)) {
-                return $r;
-            }
-
-            $pkg_name = $pear->getCanonicalPackageName($pkg_name);
-            if (Ethna::isError($pkg_name)) {
-                return $pkg_name;
-            }
-
-        } else {
-            return Ethna::raiseError('invalid number of arguments', 'usage');
-        }
-
-        if ($target != 'master') {
-            list(,, $ctype, $cname) = explode('_', $pkg_name, 4);
-            $r = Ethna_Generator::generate('Plugin', $basedir, $ctype, $cname, true);
-            if (Ethna::isError($r)) {
-                return $r;
-            }
-        }
-
-        return true;
-    }
-    // }}}
-
-    // {{{ getDescription()
-    /**
-     *  @access public
-     */
-    function getDescription()
-    {
-        return <<<EOS
-upgrade plugin:
-    {$this->id} [-c|--channel=channel] [-b|--basedir=dir] [-l|--local] [-m|--master] [type name|packagefile|packageurl]
-
-EOS;
-    }
-    // }}}
-
-    // {{{
-    /**
-     *  @access public
-     */
-    function getUsage()
-    {
-        return <<<EOS
-ethna {$this->id} [-c|--channel=channel] [-b|--basedir=dir] [-l|--local] [-m|--master] [type name|packagefile|packageurl]
-EOS;
-    }
-    // }}}
-}
-// }}}
-?>
diff --git a/class/Plugin/Logwriter/Ethna_Plugin_Logwriter_Alertmail.php b/class/Plugin/Logwriter/Ethna_Plugin_Logwriter_Alertmail.php
deleted file mode 100644 (file)
index c2343e0..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Logwriter_Alertmail.php
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Logwriter_Alertmail
-/**
- *  ¥í¥°½ÐÎÏ¥¯¥é¥¹(¥¢¥é¡¼¥È¥á¡¼¥ë)
- *  Ethna_Logger ¤Ë¤¢¤ë _alert() ¤ò¥×¥é¥°¥¤¥ó¤Ë¤·¤¿¤À¤±¤Ç¤¹¡£
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Logwriter_Alertmail extends Ethna_Plugin_Logwriter
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    array   ¥¢¥é¡¼¥ÈÁ÷¿®Àè¥á¡¼¥ë¥¢¥É¥ì¥¹ */
-    var $mailaddress = array();
-
-    /**#@-*/
-
-    /**
-     *  ¥í¥°¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ë
-     *
-     *  @access public
-     *  @param  int     $option     ¥í¥°¥ª¥×¥·¥ç¥ó(LOG_FILE,LOG_FUNCTION...)
-     */
-    function setOption($option)
-    {
-        parent::setOption($option);
-        
-        if (isset($option['mailaddress'])) {
-            $this->mailaddress = preg_split('/\s*,\s*/',
-                                            $option['mailaddress'],
-                                            -1, PREG_SPLIT_NO_EMPTY);
-        }
-    }
-
-    /**
-     *  ¥í¥°¤ò½ÐÎϤ¹¤ë
-     *
-     *  @access public
-     *  @param  int     $level      ¥í¥°¥ì¥Ù¥ë(LOG_DEBUG, LOG_NOTICE...)
-     *  @param  string  $message    ¥í¥°¥á¥Ã¥»¡¼¥¸(+°ú¿ô)
-     */
-    function log($level, $message)
-    {
-        if (count($this->mailaddress) == 0) {
-            return;
-        }
-
-        $prefix = $this->ident;
-        if (array_key_exists("pid", $this->option)) {
-            $prefix .= sprintf('[%d]', getmypid());
-        }
-        $prefix .= sprintf('(%s): ', $this->_getLogLevelName($level));
-        if (array_key_exists("function", $this->option) ||
-            array_key_exists("pos", $this->option)) {
-            $tmp = "";
-            $bt = $this->_getBacktrace();
-            if ($bt && $bt['function']
-                && array_key_exists("function", $this->option) ) {
-                $tmp .= $bt['function'];
-            }
-            if ($bt && array_key_exists("pos", $this->option) && $bt['pos']) {
-                $tmp .= $tmp ? sprintf('(%s)', $bt['pos']) : $bt['pos'];
-            }
-            if ($tmp) {
-                $prefix .= $tmp . ": ";
-            }
-        }
-
-        $this->_alert($prefix . $message . "\n");
-
-        return $prefix . $message;
-    }
-
-    /**
-     *  ¥á¡¼¥ë¤òÁ÷¿®¤¹¤ë
-     *
-     *  @access protected
-     *  @param  string  $message    ¥í¥°¥á¥Ã¥»¡¼¥¸
-     */
-    function _alert($message)
-    {
-        restore_error_handler();
-
-        $c =& Ethna_Controller::getInstance();
-        $appid = $c->getAppId();
-
-        $header = "Mime-Version: 1.0\n";
-        $header .= "Content-Type: text/plain; charset=ISO-2022-JP\n";
-        $header .= "X-Alert: " . $appid;
-        $subject = sprintf("[%s] alert (%s%s)\n", $appid,
-                           substr($message, 0, 12),
-                           strlen($message) > 12 ? "..." : "");
-
-        $message = sprintf("--- [log message] ---\n%s\n\n", $message);
-        if (function_exists("debug_backtrace")) {
-            $bt = debug_backtrace();
-            $message .= sprintf("--- [backtrace] ---\n%s\n", Ethna_Util::FormatBacktrace($bt));
-        }
-        
-        foreach ($this->mailaddress as $address) {
-            mail($address,
-                 $subject,
-                 mb_convert_encoding($message, "ISO-2022-JP"),
-                 $header);
-        }
-
-        set_error_handler("ethna_error_handler");
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Logwriter/Ethna_Plugin_Logwriter_Default.php b/class/Plugin/Logwriter/Ethna_Plugin_Logwriter_Default.php
deleted file mode 100644 (file)
index c2c0237..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Logwriter_Default.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Logwriter_Default
-/**
- *  ¥í¥°½ÐÎÏ´ðÄ쥯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Logwriter_Default extends Ethna_Plugin_Logwriter
-{
-}
-// }}}
-?>
diff --git a/class/Plugin/Logwriter/Ethna_Plugin_Logwriter_Echo.php b/class/Plugin/Logwriter/Ethna_Plugin_Logwriter_Echo.php
deleted file mode 100644 (file)
index f69d93a..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Logwriter_Echo.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Logwriter_Echo
-/**
- *  ¥í¥°½ÐÎÏ´ðÄ쥯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Logwriter_Echo extends Ethna_Plugin_Logwriter
-{
-    /**#@+
-     *  @access private
-     */
-
-    /**#@-*/
-
-    /**
-     *  ¥í¥°¤ò½ÐÎϤ¹¤ë
-     *
-     *  @access public
-     *  @param  int     $level      ¥í¥°¥ì¥Ù¥ë(LOG_DEBUG, LOG_NOTICE...)
-     *  @param  string  $message    ¥í¥°¥á¥Ã¥»¡¼¥¸(+°ú¿ô)
-     */
-    function log($level, $message)
-    {
-        $c =& Ethna_Controller::getInstance();
-
-        $prefix = $this->ident;
-        if (array_key_exists("pid", $this->option)) {
-            $prefix .= sprintf('[%d]', getmypid());
-        }
-        $prefix .= sprintf($c->getGateway() != GATEWAY_WWW ? '(%s): ' : '(<b>%s</b>): ',
-            $this->_getLogLevelName($level)
-        );
-        if (array_key_exists("function", $this->option) ||
-            array_key_exists("pos", $this->option)) {
-            $tmp = "";
-            $bt = $this->_getBacktrace();
-            if ($bt && array_key_exists("function", $this->option) && $bt['function']) {
-                $tmp .= $bt['function'];
-            }
-            if ($bt && array_key_exists("pos", $this->option) && $bt['pos']) {
-                $tmp .= $tmp ? sprintf('(%s)', $bt['pos']) : $bt['pos'];
-            }
-            if ($tmp) {
-                $prefix .= $tmp . ": ";
-            }
-        }
-
-        $br = $c->getGateway() != GATEWAY_WWW ? "" : "<br />";
-        echo($prefix . $message . $br . "\n");
-
-        return $prefix . $message;
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Logwriter/Ethna_Plugin_Logwriter_File.php b/class/Plugin/Logwriter/Ethna_Plugin_Logwriter_File.php
deleted file mode 100644 (file)
index f05e0da..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Logwriter_File.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Logwriter_File
-/**
- *  ¥í¥°½ÐÎÏ¥¯¥é¥¹(File)
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Logwriter_File extends Ethna_Plugin_Logwriter
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    int     ¥í¥°¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥ë */
-    var $fp;
-
-    /** @var    int     ¥í¥°¥Õ¥¡¥¤¥ë¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó */
-    var $mode = 0666;
-
-    /**#@-*/
-
-    /**
-     *  Ethna_Plugin_Logwriter_File¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     */
-    function Ethna_Plugin_Logwriter_File()
-    {
-        $this->fp = null;
-    }
-
-    /**
-     *  ¥í¥°¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ë
-     *
-     *  @access public
-     *  @param  int     $option     ¥í¥°¥ª¥×¥·¥ç¥ó(LOG_FILE,LOG_FUNCTION...)
-     */
-    function setOption($option)
-    {
-        parent::setOption($option);
-        
-        if (isset($option['file'])) {
-            $this->file = $option['file'];
-        } else {
-            $this->file = $this->_getLogFile();
-        }
-
-        if (isset($option['mode'])) {
-            $this->mode = $option['mode'];
-        }
-    }
-
-    /**
-     *  ¥í¥°½ÐÎϤò³«»Ï¤¹¤ë
-     *
-     *  @access public
-     */
-    function begin()
-    {
-        $this->fp = fopen($this->file, 'a');
-        $st = fstat($this->fp);
-        if (function_exists("posix_getuid") && posix_getuid() == $st[4]) {
-            chmod($this->file, intval($this->mode, 8));
-        }
-    }
-
-    /**
-     *  ¥í¥°¤ò½ÐÎϤ¹¤ë
-     *
-     *  @access public
-     *  @param  int     $level      ¥í¥°¥ì¥Ù¥ë(LOG_DEBUG, LOG_NOTICE...)
-     *  @param  string  $message    ¥í¥°¥á¥Ã¥»¡¼¥¸(+°ú¿ô)
-     */
-    function log($level, $message)
-    {
-        if ($this->fp == null) {
-            return;
-        }
-
-        $prefix = strftime('%Y/%m/%d %H:%M:%S ') . $this->ident;
-        if (array_key_exists("pid", $this->option)) {
-            $prefix .= sprintf('[%d]', getmypid());
-        }
-        $prefix .= sprintf('(%s): ', $this->_getLogLevelName($level));
-        if (array_key_exists("function", $this->option) ||
-            array_key_exists("pos", $this->option)) {
-            $tmp = "";
-            $bt = $this->_getBacktrace();
-            if ($bt && array_key_exists("function", $this->option) && $bt['function']) {
-                $tmp .= $bt['function'];
-            }
-            if ($bt && array_key_exists("pos", $this->option) && $bt['pos']) {
-                $tmp .= $tmp ? sprintf('(%s)', $bt['pos']) : $bt['pos'];
-            }
-            if ($tmp) {
-                $prefix .= $tmp . ": ";
-            }
-        }
-        fwrite($this->fp, $prefix . $message . "\n");
-
-        return $prefix . $message;
-    }
-
-    /**
-     *  ¥í¥°½ÐÎϤò½ªÎ»¤¹¤ë
-     *
-     *  @access public
-     */
-    function end()
-    {
-        if ($this->fp) {
-            fclose($this->fp);
-            $this->fp = null;
-        }
-    }
-
-    /**
-     *  ¥í¥°¥Õ¥¡¥¤¥ë¤Î½ñ¤­½Ð¤·Àè¤ò¼èÆÀ¤¹¤ë(¥í¥°¥Õ¥¡¥·¥ê¥Æ¥£¤Ë
-     *  LOG_FILE¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Î¤ßÍ­¸ú)
-     *
-     *  ¥í¥°¥Õ¥¡¥¤¥ë¤Î½ñ¤­½Ð¤·Àè¤òÊѹ¹¤·¤¿¤¤¾ì¹ç¤Ï¤³¤Î¥á¥½¥Ã¥É¤ò
-     *  ¥ª¡¼¥Ð¡¼¥é¥¤¥É¤·¤Þ¤¹
-     *
-     *  @access protected
-     *  @return string  ¥í¥°¥Õ¥¡¥¤¥ë¤Î½ñ¤­½Ð¤·Àè
-     */
-    function _getLogFile()
-    {
-        $controller =& Ethna_Controller::getInstance();
-
-        if (array_key_exists("dir", $this->option)) {
-            $dir = $this->option['dir'];
-        } else {
-            $dir = $controller->getDirectory('log');
-        }
-
-        return sprintf('%s/%s.log',
-            $dir,
-            strtolower($controller->getAppid())
-        );
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Logwriter/Ethna_Plugin_Logwriter_Syslog.php b/class/Plugin/Logwriter/Ethna_Plugin_Logwriter_Syslog.php
deleted file mode 100644 (file)
index b25b88c..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Logwriter_Syslog.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Logwriter_Syslog
-/**
- *  ¥í¥°½ÐÎÏ¥¯¥é¥¹(Syslog)
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Logwriter_Syslog extends Ethna_Plugin_Logwriter
-{
-    /**
-     *  ¥í¥°½ÐÎϤò³«»Ï¤¹¤ë
-     *
-     *  @access public
-     */
-    function begin()
-    {
-        // syslogÍÑ¥ª¥×¥·¥ç¥ó¤Î¤ß¤ò»ØÄê
-        if (array_key_exists("pid", $this->option)) {
-            $option = $this->option & (LOG_PID);
-        }
-        openlog($this->ident, $option, $this->facility);
-    }
-
-    /**
-     *  ¥í¥°¤ò½ÐÎϤ¹¤ë
-     *
-     *  @access public
-     *  @param  int     $level      ¥í¥°¥ì¥Ù¥ë(LOG_DEBUG, LOG_NOTICE...)
-     *  @param  string  $message    ¥í¥°¥á¥Ã¥»¡¼¥¸(+°ú¿ô)
-     */
-    function log($level, $message)
-    {
-        $prefix = sprintf('%s: ', $this->_getLogLevelName($level));
-        if (array_key_exists("function", $this->option) ||
-            array_key_exists("pos", $this->option)) {
-            $tmp = "";
-            $bt = $this->_getBacktrace();
-            if ($bt && array_key_exists("function", $this->option) && $bt['function']) {
-                $tmp .= $bt['function'];
-            }
-            if ($bt && array_key_exists("pos", $this->option) && $bt['pos']) {
-                $tmp .= $tmp ? sprintf('(%s)', $bt['pos']) : $bt['pos'];
-            }
-            if ($tmp) {
-                $prefix .= $tmp . ": ";
-            }
-        }
-        syslog($level, $prefix . $message);
-
-        return $prefix . $message;
-    }
-
-    /**
-     *  ¥í¥°½ÐÎϤò½ªÎ»¤¹¤ë
-     *
-     *  @access public
-     */
-    function end()
-    {
-        closelog();
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Validator/Ethna_Plugin_Validator_Custom.php b/class/Plugin/Validator/Ethna_Plugin_Validator_Custom.php
deleted file mode 100644 (file)
index 344a946..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Validator_Custom.php
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Validator_Custom
-/**
- *  custom¥Ð¥ê¥Ç¡¼¥¿¤Î¥é¥Ã¥Ñ¡¼¥×¥é¥°¥¤¥ó
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Validator_Custom extends Ethna_Plugin_Validator
-{
-    /** @var    bool    ÇÛÎó¤ò¼õ¤±¼è¤ë¤«¥Õ¥é¥° */
-    var $accept_array = true;
-
-    /**
-     *  custom¥Ð¥ê¥Ç¡¼¥¿¤Î¥é¥Ã¥Ñ¡¼
-     *
-     *  @access public
-     *  @param  string  $name       ¥Õ¥©¡¼¥à¤Î̾Á°
-     *  @param  mixed   $var        ¥Õ¥©¡¼¥à¤ÎÃÍ
-     *  @param  array   $params     ¥×¥é¥°¥¤¥ó¤Î¥Ñ¥é¥á¡¼¥¿
-     */
-    function &validate($name, $var, $params)
-    {
-        $true = true;
-        $false = false;
-
-        $method_list = preg_split('/\s*,\s*/', $params['custom'], -1, PREG_SPLIT_NO_EMPTY);
-        if (is_array($method_list) == false) {
-            return $true;
-        }
-
-        foreach ($method_list as $method) {
-            if (method_exists($this->af, $method)) {
-                $ret =& $this->af->$method($name);
-                if (Ethna::isError($ret)) {
-                    // ¤³¤Î¥¨¥é¡¼¤Ï¤¹¤Ç¤Ë af::checkSomething() ¤Ç ae::add()
-                    // ¤·¤Æ¤¢¤ë
-                    return $false;
-                }
-            }
-        }
-
-        return $true;
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Validator/Ethna_Plugin_Validator_File.php b/class/Plugin/Validator/Ethna_Plugin_Validator_File.php
deleted file mode 100644 (file)
index 1d21e84..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Validator_File.php
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// UPLOAD_ERR_* ¤¬Ì¤ÄêµÁ¤Î¾ì¹ç
-if (defined('UPLOAD_ERR_OK') == false) { // PHP 4.3.0
-    define('UPLOAD_ERR_OK', 0);
-}
-if (defined('UPLOAD_ERR_INI_SIZE') == false) { // PHP 4.3.0
-    define('UPLOAD_ERR_INI_SIZE', 1);
-}
-if (defined('UPLOAD_ERR_FORM_SIZE') == false) { // PHP 4.3.0
-    define('UPLOAD_ERR_FORM_SIZE', 2);
-}
-if (defined('UPLOAD_ERR_PARTIAL') == false) { // PHP 4.3.0
-    define('UPLOAD_ERR_PARTIAL', 3);
-}
-if (defined('UPLOAD_ERR_NO_FILE') == false) { // PHP 4.3.0
-    define('UPLOAD_ERR_NO_FILE', 4);
-}
-if (defined('UPLOAD_ERR_NO_TMP_DIR') == false) { // PHP 4.3.10, 5.0.3
-    define('UPLOAD_ERR_NO_TMP_DIR', 6);
-}
-if (defined('UPLOAD_ERR_CANT_WRITE') == false) { // PHP 5.1.0
-    define('UPLOAD_ERR_CANT_WRITE', 7);
-}
-
-// {{{ Ethna_Plugin_Validator_File
-/**
- *  ¥Õ¥¡¥¤¥ë¥Á¥§¥Ã¥¯¥×¥é¥°¥¤¥ó
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Validator_File extends Ethna_Plugin_Validator
-{
-    /** @var    bool    ÇÛÎó¤ò¼õ¤±¼è¤ë¤«¥Õ¥é¥° */
-    var $accept_array = false;
-
-    /**
-     *  ¥¢¥Ã¥×¥í¡¼¥É¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¥Á¥§¥Ã¥¯¤ò¹Ô¤¦
-     *  XXX: ¥×¥é¥°¥¤¥ó¤Î¥¨¥é¡¼¥³¡¼¥É¤ò½¤Àµ¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $name       ¥Õ¥©¡¼¥à¤Î̾Á°
-     *  @param  mixed   $var        ¥Õ¥©¡¼¥à¤ÎÃÍ
-     *  @param  array   $params     ¥×¥é¥°¥¤¥ó¤Î¥Ñ¥é¥á¡¼¥¿
-     */
-    function &validate($name, $var, $params)
-    {
-        $true = true;
-        if ($this->getFormType($name) != VAR_TYPE_FILE) {
-            return $true;
-        }
-
-        // ¤½¤â¤½¤â¥¢¥Ã¥×¥í¡¼¥É¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¥¹¥­¥Ã¥×
-        if ($var['error'] == UPLOAD_ERR_NO_FILE) {
-            return $true;
-        }
-
-
-        // ¥¨¥é¡¼¥³¡¼¥É¤Î¸¡ºº
-        $msg = '';
-        switch ($var['error']) {
-        case UPLOAD_ERR_INI_SIZE: 
-            $msg = '¥¢¥Ã¥×¥í¡¼¥É¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï¡¢php.ini ¤Î upload_max_filesize ¥Ç¥£¥ì¥¯¥Æ¥£¥Ö¤ÎÃͤòĶ¤¨¤Æ¤¤¤Þ¤¹¡£';
-            break;
-        case UPLOAD_ERR_FORM_SIZE:
-            $msg = '¥¢¥Ã¥×¥í¡¼¥É¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï¡¢HTML ¥Õ¥©¡¼¥à¤Ç»ØÄꤵ¤ì¤¿ MAX_FILE_SIZE ¤òĶ¤¨¤Æ¤¤¤Þ¤¹¡£';
-            break;
-        case UPLOAD_ERR_PARTIAL:
-            $msg= '¥¢¥Ã¥×¥í¡¼¥É¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï°ìÉô¤Î¤ß¤·¤«¥¢¥Ã¥×¥í¡¼¥É¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£';
-            break;
-        case UPLOAD_ERR_NO_FILE:
-            $msg = '¥Õ¥¡¥¤¥ë¤Ï¥¢¥Ã¥×¥í¡¼¥É¤µ¤ì¤Þ¤»¤ó¤Ç¤·¤¿¡£';
-            break;
-        case UPLOAD_ERR_NO_TMP_DIR:
-            $msg = '¥Æ¥ó¥Ý¥é¥ê¥Õ¥©¥ë¥À¤¬¤¢¤ê¤Þ¤»¤ó¡£';
-            break;
-        case UPLOAD_ERR_CANT_WRITE:
-            $msg= '¥Ç¥£¥¹¥¯¤Ø¤Î½ñ¤­¹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£';
-            break;
-        }
-        if ($msg != '') {
-            if (isset($params['error'])) {
-                $msg = $params['error'];
-            }
-            return Ethna::raiseNotice($msg, E_FORM_WRONGTYPE_FILE);
-        }
-
-
-        // tmp_name ¤Î¸¡ºº
-        if (isset($var['tmp_name']) == false || is_uploaded_file($var['tmp_name']) == false) {
-            if (isset($params['error'])) {
-                $msg = $params['error'];
-            } else {
-                $msg = 'tmp_name ¤¬ÉÔÀµ¤Ç¤¹¡£';
-            }
-            return Ethna::raiseNotice($msg, E_FORM_WRONGTYPE_FILE);
-        }
-
-
-        // size ¤Î¸¡ºº
-        if (isset($params['size_max'])) {
-            $st = stat($var['tmp_name']);
-            if ($st[7] > $this->_getSizeAsBytes($params['size_max'])) {
-                if (isset($params['error'])) {
-                    $msg = $params['error'];
-                } else {
-                    $msg = '¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤Ï%s°Ê²¼¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£';
-                }
-                return Ethna::raiseNotice($msg, E_FORM_WRONGTYPE_FILE, array($params['size_max']));
-            }
-        }
-        if (isset($params['size_min'])) {
-            $st = stat($var['tmp_name']);
-            if ($st[7] < $this->_getSizeAsBytes($params['size_min'])) {
-                if (isset($params['error'])) {
-                    $msg = $params['error'];
-                } else {
-                    $msg = '¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤Ï%s°Ê¾å¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£';
-                }
-                return Ethna::raiseNotice($msg, E_FORM_WRONGTYPE_FILE, array($params['size_min']));
-            }
-        }
-
-
-        // type ¤Î¸¡ºº
-        if (isset($params['type'])) {
-            $type_list = to_array($params['type']);
-            $posted_mime = explode('/', $var['type'], 2);
-            foreach ($type_list as $type) {
-                $wanted_mime = explode('/', $type, 2);
-                $test = (count($wanted_mime) == 1)
-                        ? (strcasecmp($wanted_mime[0], $posted_mime[0]) == 0)
-                : (strcasecmp($type, $var['type']) == 0);  
-                if ($test == true) {
-                    break;
-                }
-            }
-            if ($test == false) {
-                if (isset($params['error'])) {
-                    $msg = $params['error'];
-                } else {
-                    $msg = '¥Õ¥¡¥¤¥ë¥¿¥¤¥×¤¬Àµ¤·¤¯¤¢¤ê¤Þ¤»¤ó¡£';
-                }
-                return Ethna::raiseNotice($msg, E_FORM_WRONGTYPE_FILE);
-            }
-        }
-
-        // name(¥Õ¥¡¥¤¥ë̾)¤Î¸¡ºº
-        if (isset($params['name'])) {
-            $test = ($params['name']{0} == '/')
-                ? preg_match($params['name'], $var['name'])
-                : (strcmp($params['name'], $var['name']) == 0);
-            if ($test == false) {
-                if (isset($params['error'])) {
-                    $msg = $params['error'];
-                } else {
-                    $msg = '¥Õ¥¡¥¤¥ë̾¤¬Àµ¤·¤¯¤¢¤ê¤Þ¤»¤ó¡£';
-                }
-                return Ethna::raiseNotice($msg, E_FORM_WRONGTYPE_FILE);
-            }
-        }
-
-        return $true;
-    }
-
-
-    function _getSizeAsBytes($size)
-    {
-        $unit = 1;
-        if (preg_match('/^([0-9]+)([mk])?(b(ytes?)?)?$/i', trim($size), $matches)) {
-            if (isset($matches[1])) {
-                $size = $matches[1];
-            }
-            if (isset($matches[2])) {
-                if (strtolower($matches[2]) === 'm') {
-                    $unit = 1048576;
-                } else if (strtolower($matches[2]) === 'k') {
-                    $unit = 1024;
-                }
-            }
-        }
-        return intval($matches[1]) * $unit;
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Validator/Ethna_Plugin_Validator_Max.php b/class/Plugin/Validator/Ethna_Plugin_Validator_Max.php
deleted file mode 100644 (file)
index bfbd8ca..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Validator_Max.php
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Validator_Max
-/**
- *  ºÇÂçÃÍ¥Á¥§¥Ã¥¯¥×¥é¥°¥¤¥ó
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Validator_Max extends Ethna_Plugin_Validator
-{
-    /** @var    bool    ÇÛÎó¤ò¼õ¤±¼è¤ë¤«¥Õ¥é¥° */
-    var $accept_array = false;
-
-    /**
-     *  ºÇÂçÃͤΥÁ¥§¥Ã¥¯¤ò¹Ô¤¦
-     *
-     *  @access public
-     *  @param  string  $name       ¥Õ¥©¡¼¥à¤Î̾Á°
-     *  @param  mixed   $var        ¥Õ¥©¡¼¥à¤ÎÃÍ
-     *  @param  array   $params     ¥×¥é¥°¥¤¥ó¤Î¥Ñ¥é¥á¡¼¥¿
-     */
-    function &validate($name, $var, $params)
-    {
-        $true = true;
-        $type = $this->getFormType($name);
-        if (isset($params['max']) == false || $this->isEmpty($var, $type)) {
-            return $true;
-        }
-
-        switch ($type) {
-            case VAR_TYPE_INT:
-                if ($var > $params['max']) {
-                    if (isset($params['error'])) {
-                        $msg = $params['error'];
-                    } else {
-                        $msg = "{form}¤Ë¤Ï%d°Ê²¼¤Î¿ô»ú(À°¿ô)¤òÆþÎϤ·¤Æ²¼¤µ¤¤";
-                    }
-                    return Ethna::raiseNotice($msg, E_FORM_MAX_INT, array($params['max']));
-                }
-                break;
-
-            case VAR_TYPE_FLOAT:
-                if ($var > $params['max']) {
-                    if (isset($params['error'])) {
-                        $msg = $params['error'];
-                    } else {
-                        $msg = "{form}¤Ë¤Ï%f°Ê²¼¤Î¿ô»ú(¾®¿ô)¤òÆþÎϤ·¤Æ²¼¤µ¤¤";
-                    }
-                    return Ethna::raiseNotice($msg, E_FORM_MAX_FLOAT, array($params['max']));
-                }
-                break;
-
-            case VAR_TYPE_DATETIME:
-                $t_max = strtotime($params['max']);
-                $t_var = strtotime($var);
-                if ($t_var > $t_max) {
-                    if (isset($params['error'])) {
-                        $msg = $params['error'];
-                    } else {
-                        $msg = "{form}¤Ë¤Ï%s°ÊÁ°¤ÎÆüÉÕ¤òÆþÎϤ·¤Æ²¼¤µ¤¤";
-                    }
-                    return Ethna::raiseNotice($msg, E_FORM_MAX_DATETIME, array($params['max']));
-                }
-                break;
-
-            case VAR_TYPE_FILE:
-                $st = stat($var['tmp_name']);
-                if ($st[7] > $params['max'] * 1024) {
-                    if (isset($params['error'])) {
-                        $msg = $params['error'];
-                    } else {
-                        $msg = "{form}¤Ë¤Ï%dKB°Ê²¼¤Î¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Æ²¼¤µ¤¤";
-                    }
-                    return Ethna::raiseNotice($msg, E_FORM_MAX_FILE, array($params['max']));
-                }
-                break;
-
-            case VAR_TYPE_STRING:
-                if (strlen($var) > $params['max']) {
-                    if (isset($params['error'])) {
-                        $msg = $params['error'];
-                    } else {
-                        $msg = "{form}¤ÏÁ´³Ñ%dʸ»ú°Ê²¼(Ⱦ³Ñ%dʸ»ú°Ê²¼)¤ÇÆþÎϤ·¤Æ²¼¤µ¤¤";
-                    }
-                    return Ethna::raiseNotice($msg, E_FORM_MAX_STRING,
-                            array(intval($params['max']/2), $params['max']));
-                }
-                break;
-        }
-
-        return $true;
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Validator/Ethna_Plugin_Validator_Mbregexp.php b/class/Plugin/Validator/Ethna_Plugin_Validator_Mbregexp.php
deleted file mode 100644 (file)
index 093e25c..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-// {{{ Ethna_Plugin_Validator_Mbegexp
-/**
- *  ¥Þ¥ë¥Á¥Ð¥¤¥ÈÂбþÀµµ¬É½¸½¤Ë¤è¤ë¥Ð¥ê¥Ç¡¼¥¿¥×¥é¥°¥¤¥ó
- *
- *  @author     Yoshinari Takaoka <takaoka@beatcraft.com>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Validator_Mbregexp extends Ethna_Plugin_Validator
-{
-    /** @var    bool    ÇÛÎó¤ò¼õ¤±¼è¤ë¤«¥Õ¥é¥° */
-    var $accept_array = false;
-
-    /**
-     *  Àµµ¬É½¸½¤Ë¤è¤ë¥Õ¥©¡¼¥àÃͤΥÁ¥§¥Ã¥¯¤ò¹Ô¤¦(¥Þ¥ë¥Á¥Ð¥¤¥ÈÂбþ¡Ë
-     *
-     *  @access public
-     *  @param  string  $name       ¥Õ¥©¡¼¥à¤Î̾Á°
-     *  @param  mixed   $var        ¥Õ¥©¡¼¥à¤ÎÃÍ
-     *  @param  array   $params     ¥×¥é¥°¥¤¥ó¤Î¥Ñ¥é¥á¡¼¥¿
-     */
-    function &validate($name, $var, $params)
-    {
-        $true = true;
-        $type = $this->getFormType($name);
-        if (isset($params['mbregexp']) == false
-            || $type == VAR_TYPE_FILE || $this->isEmpty($var, $type)) {
-            return $true;
-        }
-
-        $encoding = (isset($params['encoding']))
-                  ? $params['encoding']
-                  : 'EUC-JP';
-        mb_regex_encoding($encoding);
-
-        if (mb_ereg($params['mbregexp'], $var) !== 1) {
-            if (isset($params['error'])) {
-                $msg = $params['error'];
-            } else {
-                $msg = "{form}¤òÀµ¤·¤¯ÆþÎϤ·¤Æ¤¯¤À¤µ¤¤";
-            }
-            return Ethna::raiseNotice($msg, E_FORM_REGEXP);
-        }
-
-        return $true;
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Validator/Ethna_Plugin_Validator_Min.php b/class/Plugin/Validator/Ethna_Plugin_Validator_Min.php
deleted file mode 100644 (file)
index 2b53648..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Validator_Min.php
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Validator_Min
-/**
- *  ºÇ¾®ÃÍ¥Á¥§¥Ã¥¯¥×¥é¥°¥¤¥ó
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Validator_Min extends Ethna_Plugin_Validator
-{
-    /** @var    bool    ÇÛÎó¤ò¼õ¤±¼è¤ë¤«¥Õ¥é¥° */
-    var $accept_array = false;
-
-    /**
-     *  ºÇ¾®ÃͤΥÁ¥§¥Ã¥¯¤ò¹Ô¤¦
-     *
-     *  @access public
-     *  @param  string  $name       ¥Õ¥©¡¼¥à¤Î̾Á°
-     *  @param  mixed   $var        ¥Õ¥©¡¼¥à¤ÎÃÍ
-     *  @param  array   $params     ¥×¥é¥°¥¤¥ó¤Î¥Ñ¥é¥á¡¼¥¿
-     */
-    function &validate($name, $var, $params)
-    {
-        $true = true;
-        $type = $this->getFormType($name);
-        if (isset($params['min']) == false || $this->isEmpty($var, $type)) {
-            return $true;
-        }
-
-        switch ($type) {
-            case VAR_TYPE_INT:
-                if ($var < $params['min']) {
-                    if (isset($params['error'])) {
-                        $msg = $params['error'];
-                    } else {
-                        $msg = "{form}¤Ë¤Ï%d°Ê¾å¤Î¿ô»ú(À°¿ô)¤òÆþÎϤ·¤Æ²¼¤µ¤¤";
-                    }
-                    return Ethna::raiseNotice($msg, E_FORM_MIN_INT, array($params['min']));
-                }
-                break;
-
-            case VAR_TYPE_FLOAT:
-                if ($var < $params['min']) {
-                    if (isset($params['error'])) {
-                        $msg = $params['error'];
-                    } else {
-                        $msg = "{form}¤Ë¤Ï%f°Ê¾å¤Î¿ô»ú(¾®¿ô)¤òÆþÎϤ·¤Æ²¼¤µ¤¤";
-                    }
-                    return Ethna::raiseNotice($msg, E_FORM_MIN_FLOAT, array($params['min']));
-                }
-                break;
-
-            case VAR_TYPE_DATETIME:
-                $t_min = strtotime($params['min']);
-                $t_var = strtotime($var);
-                if ($t_var < $t_min) {
-                    if (isset($params['error'])) {
-                        $msg = $params['error'];
-                    } else {
-                        $msg = "{form}¤Ë¤Ï%s°Ê¹ß¤ÎÆüÉÕ¤òÆþÎϤ·¤Æ²¼¤µ¤¤";
-                    }
-                    return Ethna::raiseNotice($msg, E_FORM_MIN_DATETIME, array($params['min']));
-                }
-                break;
-
-            case VAR_TYPE_FILE:
-                $st = stat($var['tmp_name']);
-                if ($st[7] < $params['min'] * 1024) {
-                    if (isset($params['error'])) {
-                        $msg = $params['error'];
-                    } else {
-                        $msg = "{form}¤Ë¤Ï%dKB°Ê¾å¤Î¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Æ²¼¤µ¤¤";
-                    }
-                    return Ethna::raiseNotice($msg, E_FORM_MIN_FILE, array($params['min']));
-                }
-                break;
-
-            case VAR_TYPE_STRING:
-                if (strlen($var) < $params['min']) {
-                    if (isset($params['error'])) {
-                        $msg = $params['error'];
-                    } else {
-                        $msg = "{form}¤ÏÁ´³Ñ%dʸ»ú°Ê¾å(Ⱦ³Ñ%dʸ»ú°Ê¾å)¤ÇÆþÎϤ·¤Æ²¼¤µ¤¤";
-                    }
-                    return Ethna::raiseNotice($msg, E_FORM_MIN_STRING,
-                            array(intval($params['min']/2), $params['min']));
-                }
-                break;
-        }
-
-        return $true;
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Validator/Ethna_Plugin_Validator_Regexp.php b/class/Plugin/Validator/Ethna_Plugin_Validator_Regexp.php
deleted file mode 100644 (file)
index a19e037..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Validator_Regexp.php
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Validator_Regexp
-/**
- *  Àµµ¬É½¸½¤Ë¤è¤ë¥Ð¥ê¥Ç¡¼¥¿¥×¥é¥°¥¤¥ó
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Validator_Regexp extends Ethna_Plugin_Validator
-{
-    /** @var    bool    ÇÛÎó¤ò¼õ¤±¼è¤ë¤«¥Õ¥é¥° */
-    var $accept_array = false;
-
-    /**
-     *  Àµµ¬É½¸½¤Ë¤è¤ë¥Õ¥©¡¼¥àÃͤΥÁ¥§¥Ã¥¯¤ò¹Ô¤¦
-     *
-     *  @access public
-     *  @param  string  $name       ¥Õ¥©¡¼¥à¤Î̾Á°
-     *  @param  mixed   $var        ¥Õ¥©¡¼¥à¤ÎÃÍ
-     *  @param  array   $params     ¥×¥é¥°¥¤¥ó¤Î¥Ñ¥é¥á¡¼¥¿
-     */
-    function &validate($name, $var, $params)
-    {
-        $true = true;
-        $type = $this->getFormType($name);
-        if (isset($params['regexp']) == false
-            || $type == VAR_TYPE_FILE || $this->isEmpty($var, $type)) {
-            return $true;
-        }
-
-        if (preg_match($params['regexp'], $var) == 0) {
-            if (isset($params['error'])) {
-                $msg = $params['error'];
-            } else {
-                $msg = "{form}¤òÀµ¤·¤¯ÆþÎϤ·¤Æ¤¯¤À¤µ¤¤";
-            }
-            return Ethna::raiseNotice($msg, E_FORM_REGEXP);
-        }
-
-        return $true;
-    }
-}
-// }}}
-?>
diff --git a/class/Plugin/Validator/Ethna_Plugin_Validator_Required.php b/class/Plugin/Validator/Ethna_Plugin_Validator_Required.php
deleted file mode 100644 (file)
index 4a09db9..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Validator_Required.php
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Validator_Required
-/**
- *  É¬¿Ü¥Õ¥©¡¼¥à¤Î¸¡¾Ú¥×¥é¥°¥¤¥ó
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Validator_Required extends Ethna_Plugin_Validator
-{
-    /** @var    bool    ÇÛÎó¤ò¼õ¤±¼è¤ë¤«¥Õ¥é¥° */
-    var $accept_array = true;
-
-    /**
-     *  ¥Õ¥©¡¼¥à¤ËÃͤ¬ÆþÎϤµ¤ì¤Æ¤¤¤ë¤«¤ò¸¡¾Ú¤¹¤ë
-     *
-     *  ÇÛÎó¤Î¾ì¹ç¤Ï¡¢ÆþÎϤµ¤ì¤ë¤Ù¤­ key ¤Î¥ê¥¹¥È¡¢
-     *  ¤¢¤ë¤¤¤Ï key ¤Î¿ô¤ò»ØÄê¤Ç¤­¤Þ¤¹
-     *
-     *  @access public
-     *  @param  string  $name       ¥Õ¥©¡¼¥à¤Î̾Á°
-     *  @param  mixed   $var        ¥Õ¥©¡¼¥à¤ÎÃÍ
-     *  @param  array   $params     ¥×¥é¥°¥¤¥ó¤Î¥Ñ¥é¥á¡¼¥¿
-     */
-    function &validate($name, $var, $params)
-    {
-        $true = true;
-        if (isset($params['required']) && $params['required'] == false) {
-            return $true;
-        }
-        $form_def = $this->getFormDef($name);
-
-        // ÁªÂò·¿¤Î¥Õ¥©¡¼¥à¤«¤É¤¦¤«
-        switch ($form_def['form_type']) {
-        case FORM_TYPE_SELECT:
-        case FORM_TYPE_RADIO:
-        case FORM_TYPE_CHECKBOX:
-        case FORM_TYPE_FILE:
-            $choice = true;
-            break;
-        default:
-            $choice = false;
-        }
-
-        // ¥¹¥«¥é¡¼¤Î¾ì¹ç
-        if (is_array($form_def['type']) == false) {
-            if ($this->isEmpty($var, $this->getFormType($name))) {
-                if (isset($params['error'])) {
-                    $msg = $params['error'];
-                } else if ($choice) {
-                    $msg = '{form}¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤Þ¤»¤ó';
-                } else {
-                    $msg = '{form}¤¬ÆþÎϤµ¤ì¤Æ¤¤¤Þ¤»¤ó';
-                }
-                return Ethna::raiseNotice($msg, E_FORM_REQUIRED);
-            } else {
-                return $true;
-            }
-        }
-                
-        // ÇÛÎó¤Î¾ì¹ç
-        $valid_keys = array();
-        if ($var != null) {
-            foreach (array_keys($var) as $key) {
-                if ($this->isEmpty($var[$key], $form_def['type']) == false) {
-                    $valid_keys[] = $key;
-                }
-            }
-        }
-
-        // required_key ¤Î¥Á¥§¥Ã¥¯
-        if (isset($params['key'])) {
-            $invalid_keys = array_diff(to_array($params['key']), $valid_keys);
-            if (count($invalid_keys) > 0) {
-                if (isset($params['error'])) {
-                    $msg = $params['error'];
-                } else if ($choice) {
-                    $msg = '{form}¤ÎɬÍפʹàÌܤ¬ÁªÂò¤µ¤ì¤Æ¤¤¤Þ¤»¤ó';
-                } else {
-                    $msg = '{form}¤ÎɬÍפʹàÌܤ¬ÆþÎϤµ¤ì¤Æ¤¤¤Þ¤»¤ó';
-                }
-                return Ethna::raiseNotice($msg, E_FORM_REQUIRED);
-            }
-        }
-
-        // required_num ¤Î¥Á¥§¥Ã¥¯
-        if (isset($params['num'])) {
-            if (count($valid_keys) < intval($params['num'])) {
-                if (isset($params['error'])) {
-                    $msg = $params['error'];
-                } else if ($choice) {
-                    $msg = '{form}¤¬É¬Íפʿô¤Þ¤ÇÁªÂò¤µ¤ì¤Æ¤¤¤Þ¤»¤ó';
-                } else {
-                    $msg = '{form}¤¬É¬Íפʿô¤Þ¤ÇÆþÎϤµ¤ì¤Æ¤¤¤Þ¤»¤ó';
-                }
-                return Ethna::raiseNotice($msg, E_FORM_REQUIRED);
-            }
-        }
-
-        // ¤È¤¯¤Ë»ØÄ꤬¤Ê¤¤¤È¤­: ¥Õ¥©¡¼¥à¤ËÍ¿¤¨¤é¤ì¤¿Á´Í×ÁÇ
-        if (isset($params['key']) == false && isset($params['num']) == false) {
-            if (count($valid_keys) == 0 || count($valid_keys) != count($var)) {
-                if (isset($params['error'])) {
-                    $msg = $params['error'];
-                } else if ($choice) {
-                    $msg = '{form}¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤Þ¤»¤ó';
-                } else {
-                    $msg = '{form}¤¬ÆþÎϤµ¤ì¤Æ¤¤¤Þ¤»¤ó';
-                }
-                return Ethna::raiseNotice($msg, E_FORM_REQUIRED);
-            }
-        }
-
-        return $true;
-    }
-
-}
-// }}}
-?>
diff --git a/class/Plugin/Validator/Ethna_Plugin_Validator_Type.php b/class/Plugin/Validator/Ethna_Plugin_Validator_Type.php
deleted file mode 100644 (file)
index 36f9b84..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Plugin_Validator_Type.php
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_Plugin_Validator_Type
-/**
- *  ¥¿¥¤¥×¥Á¥§¥Ã¥¯¥×¥é¥°¥¤¥ó
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Plugin_Validator_Type extends Ethna_Plugin_Validator
-{
-    /** @var    bool    ÇÛÎó¤ò¼õ¤±¼è¤ë¤«¥Õ¥é¥° */
-    var $accept_array = false;
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃͤη¿¥Á¥§¥Ã¥¯¤ò¹Ô¤¦
-     *
-     *  @access public
-     *  @param  string  $name       ¥Õ¥©¡¼¥à¤Î̾Á°
-     *  @param  mixed   $var        ¥Õ¥©¡¼¥à¤ÎÃÍ
-     *  @param  array   $params     ¥×¥é¥°¥¤¥ó¤Î¥Ñ¥é¥á¡¼¥¿
-     */
-    function &validate($name, $var, $params)
-    {
-        $true = true;
-        $type = $params['type'];
-        if ($type == VAR_TYPE_FILE || $this->isEmpty($var, $type)) {
-            return $true;
-        }
-
-        foreach (array_keys(to_array($var)) as $key) {
-            switch ($type) {
-                case VAR_TYPE_INT:
-                    if (!preg_match('/^-?\d+$/', $var)) {
-                        if (isset($params['error'])) {
-                            $msg = $params['error'];
-                        } else {
-                            $msg = "{form}¤Ë¤Ï¿ô»ú(À°¿ô)¤òÆþÎϤ·¤Æ²¼¤µ¤¤";
-                        }
-                        return Ethna::raiseNotice($msg, E_FORM_WRONGTYPE_INT);
-                    }
-                    break;
-
-                case VAR_TYPE_FLOAT:
-                    if (!preg_match('/^-?\d+$/', $var) && !preg_match('/^-?\d+\.\d+$/', $var)) {
-                        if (isset($params['error'])) {
-                            $msg = $params['error'];
-                        } else {
-                            $msg = "{form}¤Ë¤Ï¿ô»ú(¾®¿ô)¤òÆþÎϤ·¤Æ²¼¤µ¤¤";
-                        }
-                        return Ethna::raiseNotice($msg, E_FORM_WRONGTYPE_FLOAT);
-                    }
-                    break;
-
-                case VAR_TYPE_BOOLEAN:
-                    if ($var != "1" && $var != "0") {
-                        if (isset($params['error'])) {
-                            $msg = $params['error'];
-                        } else {
-                            $msg = "{form}¤Ë¤Ï1¤Þ¤¿¤Ï0¤Î¤ßÆþÎϤǤ­¤Þ¤¹";
-                        }
-                        return Ethna::raiseNotice($msg, E_FORM_WRONGTYPE_BOOLEAN);
-                    }
-                    break;
-
-                case VAR_TYPE_DATETIME:
-                    $r = strtotime($var);
-                    if ($r == -1 || $r === false) {
-                        if (isset($params['error'])) {
-                            $msg = $params['error'];
-                        } else {
-                            $msg = "{form}¤Ë¤ÏÆüÉÕ¤òÆþÎϤ·¤Æ²¼¤µ¤¤";
-                        }
-                        return Ethna::raiseNotice($msg, E_FORM_WRONGTYPE_DATETIME);
-                    }
-                    break;
-            }
-        }
-
-        return $true;
-    }
-}
-// }}}
-?>
diff --git a/class/Renderer/Ethna_Renderer_Smarty.php b/class/Renderer/Ethna_Renderer_Smarty.php
deleted file mode 100644 (file)
index deae30e..0000000
+++ /dev/null
@@ -1,247 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_Renderer_Smarty.php
- *
- *  @author     Kazuhiro Hosoi <hosoi@gree.co.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-require_once 'Smarty/Smarty.class.php';
-require_once ETHNA_BASE . '/class/Ethna_SmartyPlugin.php';
-
-// {{{ Ethna_Renderer_Smarty
-/**
- *  Smarty¥ì¥ó¥À¥é¥¯¥é¥¹¡ÊMojavi¤Î¤Þ¤Í¡Ë
- *
- *  @author     Kazuhiro Hosoi <hosoi@gree.co.jp>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Renderer_Smarty extends Ethna_Renderer
-{
-    /** @var    string compile directory  */
-    var $compile_dir;
-    
-    /**
-     *  Ethna_Renderer_Smarty¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     */
-    function Ethna_Renderer_Smarty(&$controller)
-    {
-        parent::Ethna_Renderer($controller);
-        
-        $this->engine =& new Smarty;
-        
-        $template_dir = $controller->getTemplatedir();
-        $compile_dir = $controller->getDirectory('template_c');
-
-        $this->setTemplateDir($template_dir);
-        $this->compile_dir = $compile_dir;
-        $this->engine->template_dir = $this->template_dir;
-        $this->engine->compile_dir = $this->compile_dir;
-        $this->engine->compile_id = md5($this->template_dir);
-
-        // °ì±þ¤¬¤ó¤Ð¤Ã¤Æ¤ß¤ë
-        if (is_dir($this->engine->compile_dir) === false) {
-            Ethna_Util::mkdir($this->engine->compile_dir, 0755);
-        }
-
-        $this->engine->plugins_dir = array_merge(array(SMARTY_DIR . 'plugins'),
-                                                 $controller->getDirectory('plugins'));
-
-        $this->_setDefaultPlugin();
-    }
-    
-    /**
-     *  ¥Ç¥Õ¥©¥ë¥È¤ÎÀßÄê.
-     *
-     *  @access public
-     */
-    function _setDefaultPlugin()
-    {
-        // default modifiers
-        $this->setPlugin('number_format','modifier','smarty_modifier_number_format');
-        $this->setPlugin('strftime','modifier','smarty_modifier_strftime');
-        $this->setPlugin('count','modifier','smarty_modifier_count');
-        $this->setPlugin('join','modifier','smarty_modifier_join');
-        $this->setPlugin('filter','modifier', 'smarty_modifier_filter');
-        $this->setPlugin('unique','modifier','smarty_modifier_unique');
-        $this->setPlugin('wordwrap_i18n','modifier','smarty_modifier_wordwrap_i18n');
-        $this->setPlugin('truncate_i18n','modifier','smarty_modifier_truncate_i18n');
-        $this->setPlugin('i18n','modifier','smarty_modifier_i18n');
-        $this->setPlugin('checkbox','modifier','smarty_modifier_checkbox');
-        $this->setPlugin('select','modifier','smarty_modifier_select');
-        $this->setPlugin('form_value','modifier','smarty_modifier_form_value');
-
-        // default functions
-        $this->setPlugin('is_error','function','smarty_function_is_error');
-        $this->setPlugin('message','function','smarty_function_message');
-        $this->setPlugin('uniqid','function','smarty_function_uniqid');
-        $this->setPlugin('select','function','smarty_function_select');
-        $this->setPlugin('checkbox_list','function','smarty_function_checkbox_list');
-        $this->setPlugin('form_name','function','smarty_function_form_name');
-        $this->setPlugin('form_input','function','smarty_function_form_input');
-        $this->setPlugin('form_submit','function','smarty_function_form_submit');
-        $this->setPlugin('url','function','smarty_function_url');
-        $this->setPlugin('csrfid','function','smarty_function_csrfid');
-
-        // default blocks
-        $this->setPlugin('form','block','smarty_block_form');       
-    }
-
-    /**
-     *  ¥Ó¥å¡¼¤ò½ÐÎϤ¹¤ë
-     *
-     *  @param  string  $template   ¥Æ¥ó¥×¥ì¡¼¥È̾
-     *  @param  bool    $capture    true ¤Ê¤é¤Ð½ÐÎϤòɽ¼¨¤»¤º¤ËÊÖ¤¹
-     *
-     *  @access public
-     */
-    function perform($template = null, $capture = false)
-    {
-        if ($template === null && $this->template === null) {
-            return Ethna::raiseWarning('template is not defined');
-        }
-
-        if ($template !== null) {
-            $this->template = $template;
-        }
-
-        if ((is_absolute_path($this->template) && is_readable($this->template))
-            || is_readable($this->template_dir . $this->template)) {
-                if ($capture === true) {
-                    $captured = $this->engine->fetch($this->template);
-                    return $captured;
-                } else {
-                    $this->engine->display($this->template);
-                }
-        } else {
-            return Ethna::raiseWarning('template not found ' . $this->template);
-        }
-    }
-    
-    /**
-     * ¥Æ¥ó¥×¥ì¡¼¥ÈÊÑ¿ô¤ò¼èÆÀ¤¹¤ë
-     * 
-     *  @param string $name  ÊÑ¿ô̾
-     *
-     *  @return mixed¡¡ÊÑ¿ô
-     *
-     *  @access public
-     */
-    function &getProp($name = null)
-    {
-        $property =& $this->engine->get_template_vars($name);
-
-        if ($property !== null) {
-            return $property;
-        }
-        return null;
-    }
-
-    /**
-     *  ¥Æ¥ó¥×¥ì¡¼¥ÈÊÑ¿ô¤òºï½ü¤¹¤ë
-     * 
-     *  @param name    ÊÑ¿ô̾
-     * 
-     *  @access public
-     */
-    function removeProp($name)
-    {
-        $this->engine->clear_assign($name);
-    }
-
-    /**
-     *  ¥Æ¥ó¥×¥ì¡¼¥ÈÊÑ¿ô¤ËÇÛÎó¤ò³ä¤êÅö¤Æ¤ë
-     * 
-     *  @param array $array
-     * 
-     *  @access public
-     */
-    function setPropArray($array)
-    {
-        $this->engine->assign($array);
-    }
-
-    /**
-     *  ¥Æ¥ó¥×¥ì¡¼¥ÈÊÑ¿ô¤ËÇÛÎó¤ò»²¾È¤È¤·¤Æ³ä¤êÅö¤Æ¤ë
-     * 
-     *  @param array $array
-     * 
-     *  @access public
-     */
-    function setPropArrayByRef(&$array)
-    {
-        $this->engine->assign_by_ref($array);
-    }
-
-    /**
-     *  ¥Æ¥ó¥×¥ì¡¼¥ÈÊÑ¿ô¤ò³ä¤êÅö¤Æ¤ë
-     * 
-     *  @param string $name ÊÑ¿ô̾
-     *  @param mixed $value ÃÍ
-     * 
-     *  @access public
-     */
-    function setProp($name, $value)
-    {
-        $this->engine->assign($name, $value);
-    }
-
-    /**
-     *  ¥Æ¥ó¥×¥ì¡¼¥ÈÊÑ¿ô¤Ë»²¾È¤ò³ä¤êÅö¤Æ¤ë
-     * 
-     *  @param string $name ÊÑ¿ô̾
-     *  @param mixed $value ÃÍ
-     * 
-     *  @access public
-     */
-    function setPropByRef($name, &$value)
-    {
-        $this->engine->assign_by_ref($name, $value);
-    }
-
-    /**
-     *  ¥×¥é¥°¥¤¥ó¤ò¥»¥Ã¥È¤¹¤ë
-     * 
-     *  @param string $name¡¡¥×¥é¥°¥¤¥ó̾
-     *  @param string $type ¥×¥é¥°¥¤¥ó¥¿¥¤¥×
-     *  @param mixed $plugin ¥×¥é¥°¥¤¥óËÜÂÎ
-     * 
-     *  @access public
-     */
-    function setPlugin($name, $type, $plugin) 
-    {
-        //¥×¥é¥°¥¤¥ó´Ø¿ô¤Î̵ͭ¤ò¥Á¥§¥Ã¥¯
-        if (is_callable($plugin) === false) {
-            return Ethna::raiseWarning('Does not exists.');
-        }
-
-        //¥×¥é¥°¥¤¥ó¤Î¼ïÎà¤ò¥Á¥§¥Ã¥¯
-        $register_method = 'register_' . $type;
-        if (method_exists($this->engine, $register_method) === false) {
-            return Ethna::raiseWarning('This plugin type does not exist');
-        }
-
-        // ¥Õ¥£¥ë¥¿¤Ï̾Á°¤Ê¤·¤ÇÅÐÏ¿
-        if ($type === 'prefilter' || $type === 'postfilter' || $type === 'outputfilter') {
-            parent::setPlugin($name, $type, $plugin);
-            $this->engine->$register_method($plugin);
-            return;
-        }
-        
-        // ¥×¥é¥°¥¤¥ó¤Î̾Á°¤ò¥Á¥§¥Ã¥¯
-        if ($name === '') {
-            return Ethna::raiseWarning('Please set plugin name');
-        }
-       
-        // ¥×¥é¥°¥¤¥ó¤òÅÐÏ¿¤¹¤ë
-        parent::setPlugin($name, $type, $plugin);
-        $this->engine->$register_method($name, $plugin);
-    }
-}
-// }}}
-?>
diff --git a/class/SOAP/Ethna_SOAP_ActionForm.php b/class/SOAP/Ethna_SOAP_ActionForm.php
deleted file mode 100644 (file)
index 92913ca..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_SOAP_ActionForm.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_SOAP_ActionForm
-/**
- *  SOAP¥Õ¥©¡¼¥à¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_SOAP_ActionForm extends Ethna_ActionForm
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    array   °ú¿ôÄêµÁ */
-    var $arg = array();
-
-    /** @var    array   Ìá¤êÃÍÄêµÁ */
-    var $retval = array();
-
-    /**#@-*/
-
-    /**
-     *  Ethna_SOAP_ActionForm¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     *  @param  object  Ethna_ActionError   $action_error   ¥¢¥¯¥·¥ç¥ó¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function Ethna_SOAP_ActionForm(&$action_error)
-    {
-        $this->form =& $this->arg;
-
-        parent::Ethna_ActionForm($action_error);
-    }
-}
-// }}}
-?>
diff --git a/class/SOAP/Ethna_SOAP_Gateway.php b/class/SOAP/Ethna_SOAP_Gateway.php
deleted file mode 100644 (file)
index ceba908..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_SOAP_Gateway.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_SOAP_Gateway
-/**
- *  SOAP¥²¡¼¥È¥¦¥§¥¤¤Î´ðÄ쥯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_SOAP_Gateway
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    object  Ethna_Controller    controller¥ª¥Ö¥¸¥§¥¯¥È */
-    var $controller;
-
-    /**#@-*/
-
-    /**
-     *  Ethna_SOAP_Gateway¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     */
-    function Ethna_SOAP_Gateway()
-    {
-        $this->controller =& Ethna_Controller::getInstance();
-    }
-
-    /**
-     *  SOAP¥¢¥¯¥·¥ç¥ó¤ò¼Â¹Ô¤¹¤ë
-     *
-     *  @access public
-     */
-    function dispatch()
-    {
-        $this->controller->trigger();
-    }
-
-    /**
-     *  ¥¢¥×¥ê¥±¡¼¥·¥ç¥óÀßÄêÃÍ°ìÍ÷¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return array   ¥¢¥×¥ê¥±¡¼¥·¥ç¥óÀßÄêÃÍ°ìÍ÷
-     */
-    function &getApp()
-    {
-        $action_form =& $this->controller->getActionForm();
-        return $action_form->app_vars;
-    }
-
-    /**
-     *  ¥¨¥é¡¼¥³¡¼¥É¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return int     ¥¨¥é¡¼¥³¡¼¥É(null¤Ê¤é¥¨¥é¡¼Ìµ¤·)
-     */
-    function getErrorCode()
-    {
-        $action_error =& $this->controller->getActionError();
-        if ($action_error->count() == 0) {
-            return null;
-        }
-        
-        // ºÇ½é¤Î1¤Ä¤òÊÖ¤¹
-        $error_list = $action_error->getErrorList();
-        $error =& $error_list[0];
-
-        return $error->getCode();
-    }
-
-    /**
-     *  ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return string  ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸(null¤Ê¤é¥¨¥é¡¼Ìµ¤·)
-     */
-    function getErrorMessage()
-    {
-        $action_error =& $this->controller->getActionError();
-        if ($action_error->count() == 0) {
-            return null;
-        }
-
-        // ºÇ½é¤Î1¤Ä¤òÊÖ¤¹
-        $message_list = $action_error->getMessageList();
-        $message = $message_list[0];
-
-        return $message;
-    }
-}
-// }}}
-?>
diff --git a/class/SOAP/Ethna_SOAP_GatewayGenerator.php b/class/SOAP/Ethna_SOAP_GatewayGenerator.php
deleted file mode 100644 (file)
index f25d404..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_SOAP_GatewayGenerator.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_SOAP_GatewayGenerator
-/**
- *  »ØÄꤵ¤ì¤¿¥³¥ó¥È¥í¡¼¥é¤ËÂбþ¤¹¤ë¥²¡¼¥È¥¦¥§¥¤¥¯¥é¥¹¥³¡¼¥É¤òÀ¸À®¤¹¤ë¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna   
- */
-class Ethna_SOAP_GatewayGenerator
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    object  Ethna_Controller    controller¥ª¥Ö¥¸¥§¥¯¥È */
-    var $controller;
-
-    /** @var    object  Ethna_Config        ÀßÄꥪ¥Ö¥¸¥§¥¯¥È */
-    var $config;
-
-    /** @var    object  Ethna_ActionError   ¥¢¥¯¥·¥ç¥ó¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È */
-    var $action_error;
-
-    /** @var    object  Ethna_ActionError   ¥¢¥¯¥·¥ç¥ó¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È(¾Êά·Á) */
-    var $ae;
-
-    /** @var    string      ¥²¡¼¥È¥¦¥§¥¤¥¯¥é¥¹¥³¡¼¥É */
-    var $gateway;
-
-    /** @var    string      ¥²¡¼¥È¥¦¥§¥¤¥¯¥é¥¹¼±ÊÌ̾ */
-    var $name;
-
-    /** @var    string      ¥²¡¼¥È¥¦¥§¥¤¥¯¥é¥¹¥Í¡¼¥à¥¹¥Ú¡¼¥¹ */
-    var $namespace;
-
-    /**#@-*/
-
-    /**
-     *  Ethna_SOAP_GatewayGenerator¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     *
-     *  @access public
-     */
-    function Ethna_SOAP_GatewayGenerator()
-    {
-        $this->controller =& Ethna_Controller::getInstance();
-        $this->config =& $this->controller->getConfig();
-        $this->action_error = null;
-        $this->ae =& $this->action_error;
-        $this->gateway = "";
-        $this->name = $this->controller->getAppId();
-        $this->namespace = $this->_getNameSpace();
-    }
-
-    /**
-     *  ¥²¡¼¥È¥¦¥§¥¤¥¯¥é¥¹¥³¡¼¥É¤òÀ¸À®¤¹¤ë
-     *
-     *  @access public
-     *  @return string  ¥²¡¼¥È¥¦¥§¥¯¥é¥¹¥³¡¼¥É
-     */
-    function generate()
-    {
-        $prev_type = $this->controller->getClientType();
-        $this->controller->setClientType(CLIENT_TYPE_SOAP);
-
-        $this->gateway .= $this->_getHeader();
-        $this->gateway .= $this->_getEntry();
-        $this->gateway .= $this->_getFooter();
-
-        $this->controller->setClientType($prev_type);
-
-        return $this->gateway;
-    }
-
-    /**
-     *  ¥²¡¼¥È¥¦¥§¥¤¥¯¥é¥¹¤Î¥¯¥é¥¹Ì¾¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     *  @return string  ¥²¡¼¥È¥¦¥§¥¤¥¯¥é¥¹¤Î¥¯¥é¥¹Ì¾
-     */
-    function getClassName()
-    {
-        return sprintf("Ethna_SOAP_%sGateway", $this->name);
-    }
-
-    /**
-     *  ¥²¡¼¥È¥¦¥§¥¤¥¯¥é¥¹¥³¡¼¥É(¥Ø¥Ã¥ÀÉôʬ)¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @return string  ¥²¡¼¥È¥¦¥§¥¤¥¯¥é¥¹¥³¡¼¥É(¥Ø¥Ã¥ÀÉôʬ)
-     */
-    function _getHeader()
-    {
-        $header = sprintf("class Ethna_SOAP_%sGateway extends Ethna_SOAP_Gateway {\n", $this->name);
-
-        return $header;
-    }
-
-    /**
-     *  ¥²¡¼¥È¥¦¥§¥¤¥¯¥é¥¹¥³¡¼¥É(¥á¥½¥Ã¥É¥¨¥ó¥È¥êÉôʬ)¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @return string  ¥²¡¼¥È¥¦¥§¥¤¥¯¥é¥¹¥³¡¼¥É(¥á¥½¥Ã¥É¥¨¥ó¥È¥êÉôʬ)
-     */
-    function _getEntry()
-    {
-        $entry = "";
-        foreach ($this->controller->soap_action as $k => $v) {
-            $action_form_name = $this->controller->getActionFormName($k);
-            $form =& new $action_form_name($this->controller);
-            $arg_list = array_keys($form->form);
-
-            $entry .= "  function $k(";
-            for ($i = 0; $i < count($arg_list); $i++) {
-                if ($i > 0) {
-                    $entry .= ", ";
-                }
-                $entry .= "\$" . $arg_list[$i];
-            }
-            $entry .= ") {\n";
-
-            $entry .= "    \$_SERVER['REQUEST_METHOD'] = 'post';\n";
-            $entry .= "    \$_POST['action_$k'] = 'dummy';\n";
-            foreach ($arg_list as $arg) {
-                $entry .= "    \$_POST['$arg'] = \$$arg;\n";
-            }
-            
-            $entry .= "    \$this->dispatch();\n";
-
-            $entry .= "    \$app =& \$this->getApp();\n";
-            $entry .= "    \$errorcode = \$this->getErrorCode();\n";
-            $entry .= "    \$errormessage = \$this->getErrorMessage();\n";
-            $entry .= "    \$retval = array();\n";
-            foreach ($form->retval as $k => $v) {
-                $entry .= "    \$retval['$k'] = \$app['$k'];\n";
-            }
-            $entry .= "    \$retval['errorcode'] = \$errorcode;\n";
-            $entry .= "    \$retval['errormessage'] = \$errormessage;\n";
-
-            $entry .= "    return \$retval;\n";
-            $entry .= "  }\n";
-        }
-        return $entry;
-    }
-
-    /**
-     *  ¥²¡¼¥È¥¦¥§¥¤¥¯¥é¥¹¥³¡¼¥É(¥Õ¥Ã¥¿Éôʬ)¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @return string  ¥²¡¼¥È¥¦¥§¥¤¥¯¥é¥¹¥³¡¼¥É(¥Õ¥Ã¥¿Éôʬ)
-     */
-    function _getFooter()
-    {
-        $footer = "}\n";
-
-        return $footer;
-    }
-
-    /**
-     *  ¥Í¡¼¥à¥¹¥Ú¡¼¥¹¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @return string  ¥Í¡¼¥à¥¹¥Ú¡¼¥¹
-     */
-    function _getNameSpace()
-    {
-        return sprintf("%s/%s", $this->config->get('url'), $this->name);
-    }
-}
-// }}}
-?>
diff --git a/class/SOAP/Ethna_SOAP_Util.php b/class/SOAP/Ethna_SOAP_Util.php
deleted file mode 100644 (file)
index e7bf562..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_SOAP_Util.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_SOAP_Util
-/**
- *  SOAP¥æ¡¼¥Æ¥£¥ê¥Æ¥£¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_SOAP_Util
-{
-    /**
-     *  ·¿ÄêµÁ¤¬¥ª¥Ö¥¸¥§¥¯¥È·¿¤ÎÇÛÎ󤫤ɤ¦¤«¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @param  array   $def    ·¿ÄêµÁ
-     *  @return bool    true:¥ª¥Ö¥¸¥§¥¯¥È·¿ÇÛÎó false:¤½¤ì°Ê³°¤Î·¿
-     *  @static
-     */
-    function isArrayOfObject($def)
-    {
-        if (is_array($def) == false) {
-            return false;
-        }
-        $keys = array_keys($def);
-        if (count($keys) == 1 && is_array($def[$keys[0]])) {
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     *  ·¿ÄêµÁ¤¬¥¹¥«¥é¡¼ÃͤÎÇÛÎ󤫤ɤ¦¤«¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @param  array   $def    ·¿ÄêµÁ
-     *  @return bool    true:¥¹¥«¥é¡¼·¿ÇÛÎó false:¤½¤ì°Ê³°¤Î·¿
-     *  @static
-     */
-    function isArrayOfScalar($def)
-    {
-        if (is_array($def) == false) {
-            return false;
-        }
-        $keys = array_keys($def);
-        if (count($keys) == 1 && is_array($def[$keys[0]]) == false) {
-            return true;
-        }
-    }
-
-    /**
-     *  ¥¹¥«¥é¡¼Ãͤη¿Ì¾¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @param  array   $def    ·¿ÄêµÁ
-     *  @return string  ·¿Ì¾
-     *  @static
-     */
-    function getScalarTypeName($def)
-    {
-        $name = null;
-        switch ($def) {
-        case VAR_TYPE_STRING:
-            $name = "string";
-            break;
-        case VAR_TYPE_INT:
-            $name = "int";
-            break;
-        case VAR_TYPE_FLOAT:
-            $name = "float";
-            break;
-        case VAR_TYPE_DATETIME:
-            $name = "datetime";
-            break;
-        case VAR_TYPE_BOOLEAN:
-            $name = "boolean";
-            break;
-        }
-        return $name;
-    }
-
-    /**
-     *  ÇÛÎó¤Î·¿Ì¾¤òÊÖ¤¹
-     *
-     *  @access public
-     *  @param  array   $def    ·¿ÄêµÁ
-     *  @return string  ·¿Ì¾
-     *  @static
-     */
-    function getArrayTypeName($def)
-    {
-        $name = null;
-        switch ($def) {
-        case VAR_TYPE_STRING:
-            $name = "ArrayOfString";
-            break;
-        case VAR_TYPE_INT:
-            $name = "ArrayOfInt";
-            break;
-        case VAR_TYPE_FLOAT:
-            $name = "ArrayOfFloat";
-            break;
-        case VAR_TYPE_DATETIME:
-            $name = "ArrayOfDatetime";
-            break;
-        case VAR_TYPE_BOOLEAN:
-            $name = "ArrayOfBoolean";
-            break;
-        }
-        return $name;
-    }
-
-    /**
-     *  Ìá¤êÃÍ·¿ÄêµÁ¤òÀµµ¬²½¤¹¤ë
-     *
-     *  @access public
-     *  @param  array   $retval Ìá¤êÃÍ·¿ÄêµÁ
-     *  @static
-     */
-    function fixRetval(&$retval)
-    {
-        $retval['errorcode'] = VAR_TYPE_INT;
-        $retval['errormessage'] = VAR_TYPE_STRING;
-    }
-}
-// }}}
-?>
diff --git a/class/SOAP/Ethna_SOAP_WsdlGenerator.php b/class/SOAP/Ethna_SOAP_WsdlGenerator.php
deleted file mode 100644 (file)
index 0ed6e41..0000000
+++ /dev/null
@@ -1,426 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_SOAP_WsdlGenerator.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_SOAP_WsdlGenerator
-/**
- *  »ØÄꤵ¤ì¤¿¥³¥ó¥È¥í¡¼¥é¤ËÂбþ¤¹¤ëWSDL¤òÀ¸À®¤¹¤ë¥¯¥é¥¹
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_SOAP_WsdlGenerator
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    object  Ethna_Controller    controller¥ª¥Ö¥¸¥§¥¯¥È */
-    var $controller;
-
-    /** @var    object  Ethna_Config        ÀßÄꥪ¥Ö¥¸¥§¥¯¥È */
-    var $config;
-
-    /** @var    object  Ethna_ActionError   ¥¢¥¯¥·¥ç¥ó¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È */
-    var $action_error;
-
-    /** @var    object  Ethna_ActionError   ¥¢¥¯¥·¥ç¥ó¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È(¾Êά·Á) */
-    var $ae;
-
-    /** @var    string      WSDL */
-    var $wsdl;
-
-    /** @var    string      ¥²¡¼¥È¥¦¥§¥¤¥¯¥é¥¹¥³¡¼¥É */
-    var $gateway;
-
-    /** @var    string      ¥²¡¼¥È¥¦¥§¥¤¥¯¥é¥¹¼±ÊÌ̾ */
-    var $name;
-
-    /** @var    string      ¥²¡¼¥È¥¦¥§¥¤¥¯¥é¥¹¥Í¡¼¥à¥¹¥Ú¡¼¥¹ */
-    var $namespace;
-
-    /**#@-*/
-
-    /**
-     *  Ethna_SOAP_WsdlGenerator¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
-     */
-    function Ethna_SOAP_WsdlGenerator($gateway)
-    {
-        $this->controller =& Ethna_Controller::getInstance();
-        $this->config =& $this->controller->getConfig();
-        $this->action_error = null;
-        $this->ae =& $this->action_error;
-        $this->wsdl = "";
-        $this->name = $this->controller->getAppId();
-        $this->namespace = $this->_getNameSpace();
-        $this->gateway = $gateway;
-    }
-
-    /**
-     *  WSDL¤òÀ¸À®¤¹¤ë
-     *
-     *  @access public
-     *  @return string  WSDL
-     */
-    function generate()
-    {
-        $current_type = $this->controller->getClientType();
-        $this->controller->setClientType(CLIENT_TYPE_SOAP);
-
-        $this->wsdl .= $this->_getHeader();
-        $this->wsdl .= $this->_getTypes();
-        $this->wsdl .= $this->_getMessage();
-        $this->wsdl .= $this->_getPortType();
-        $this->wsdl .= $this->_getBinding();
-        $this->wsdl .= $this->_getService();
-        $this->wsdl .= $this->_getFooter();
-
-        $this->controller->setClientType($current_type);
-
-        return $this->wsdl;
-    }
-
-    /**
-     *  WSDL(¥Ø¥Ã¥ÀÉôʬ)¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @return string  WSDL(¥Ø¥Ã¥ÀÉôʬ)
-     */
-    function _getHeader()
-    {
-        $header =<<<EOD
-<?xml version="1.0" encoding="utf-8"?>
-<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
-    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
-    xmlns:s="http://www.w3.org/2001/XMLSchema"
-    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
-    xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
-    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
-    xmlns:tns="%s"
-    targetNamespace="%s"
-    name="%s"
-    xmlns="http://schemas.xmlsoap.org/wsdl/">\n\n
-EOD;
-        return sprintf($header, $this->namespace, $this->namespace, $this->name);
-    }
-
-    /**
-     *  WSDL(·¿ÄêµÁÉôʬ)¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @return string  WSDL(·¿ÄêµÁÉôʬ)
-     */
-    function _getTypes()
-    {
-        $types = sprintf(" <types>\n  <s:schema targetNamespace=\"%s\">\n", $this->namespace);
-
-        // ´ðËÜ·¿
-        $types .=<<<EOD
-   <s:complexType name="ArrayOfInt">
-    <s:complexContent mixed="false">
-     <s:restriction base="soapenc:Array">
-      <s:attribute d7p1:arrayType="s:int[]" ref="soapenc:arrayType" xmlns:d7p1="http://schemas.xmlsoap.org/wsdl/" />
-     </s:restriction>
-    </s:complexContent>
-   </s:complexType>
-   <s:complexType name="ArrayOfString">
-    <s:complexContent mixed="false">
-     <s:restriction base="soapenc:Array">
-      <s:attribute d7p1:arrayType="s:string[]" ref="soapenc:arrayType" xmlns:d7p1="http://schemas.xmlsoap.org/wsdl/" />
-     </s:restriction>
-    </s:complexContent>
-   </s:complexType>
-   <s:complexType name="Result">
-    <s:sequence>
-     <s:element name="errormessage" type="s:string" />
-     <s:element name="errorcode" type="s:int" />
-    </s:sequence>
-   </s:complexType>\n
-EOD;
-        
-        // ¥¢¥¯¥·¥ç¥ó¸ÇÍ­
-        foreach ($this->controller->soap_action as $k => $v) {
-            $action_form_name = $this->controller->getActionFormName($k);
-            $form =& new $action_form_name($this->controller);
-            if ($form->retval == null) {
-                continue;
-            }
-
-            // ¥Ç¥Õ¥©¥ë¥È¥¨¥ó¥È¥ê¤òÄɲÃ
-            Ethna_SOAP_Util::fixRetval($form->retval);
-
-            // ¥·¥ê¥¢¥é¥¤¥º
-            $retval_name = preg_replace('/_(.)/e', "strtoupper('\$1')", ucfirst($k)) . "Result";
-            $types .= $this->_serializeTypes($form->retval, $retval_name);
-        }
-
-        return $types . "  </s:schema>\n </types>\n\n";
-    }
-
-    /**
-     *  WSDL(MessageÉôʬ)¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @return string  WSDL(MessageÉôʬ)
-     *  @todo   respect access controlls
-     */
-    function _getMessage()
-    {
-        $n = 1;
-        $message = "";
-        foreach ($this->controller->soap_action as $k => $v) {
-            $message .= $this->_serializeMessage($k, $n);
-            $n++;
-        }
-
-        return $message . "\n";
-    }
-
-    /**
-     *  WSDL(PortTypeÉôʬ)¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @return string  WSDL(PortTypeÉôʬ)
-     */
-    function _getPortType()
-    {
-        $port_type = sprintf(" <portType name=\"%sSoap\">\n", $this->name);
-
-        $n = 1;
-        foreach ($this->controller->soap_action as $k => $v) {
-            $port_type .= $this->_serializePortType($k, $n);
-            $n++;
-        }
-
-        $port_type .= " </portType>\n\n";
-
-        return $port_type;
-    }
-
-    /**
-     *  WSDL(BindingÉôʬ)¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @return string  WSDL(BindingÉôʬ)
-     */
-    function _getBinding()
-    {
-        $namespace = "urn:" . $this->name;
-        $binding = " <binding name=\"" . $this->name . "Soap\" type=\"tns:" . $this->name . "Soap\">\n";
-        $binding .= "  <soap:binding style=\"rpc\" transport=\"http://schemas.xmlsoap.org/soap/http\" />\n";
-
-        $n = 1;
-        foreach ($this->controller->soap_action as $k => $v) {
-            $binding .= "  <operation name=\"$k\">\n";
-            $binding .= "   <soap:operation soapAction=\"$k\" style=\"rpc\" />\n";
-            $binding .= "   <input name=\"${k}${n}SoapIn\">\n";
-            $binding .= "    <soap:body use=\"encoded\" namespace=\"$namespace\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\n";
-            $binding .= "   </input>\n";
-            $binding .= "   <output name=\"${k}${n}SoapOut\">\n";
-            $binding .= "    <soap:body use=\"encoded\" namespace=\"$namespace\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\n";
-            $binding .= "   </output>\n";
-            $binding .= "  </operation>\n";
-            $n++;
-        }
-        $binding .= " </binding>\n";
-
-        return $binding;
-    }
-
-    /**
-     *  WSDL(ServiceÉôʬ)¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @return string  WSDL(ServiceÉôʬ)
-     */
-    function _getService()
-    {
-        $name = $this->name;
-        $gateway= $this->gateway;
-        $service = " <service name=\"$name\">\n";
-        $service .= "  <port name=\"${name}Soap\" binding=\"tns:${name}Soap\">\n";
-        $service .= "   <soap:address location=\"$gateway\" />\n";
-        $service .= "  </port>\n";
-        $service .= " </service>\n";
-
-        return $service;
-    }
-
-    /**
-     *  WSDL(¥Õ¥Ã¥¿Éôʬ)¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @return string  WSDL(¥Õ¥Ã¥¿Éôʬ)
-     */
-    function _getFooter()
-    {
-        return "</definitions>\n";
-    }
-
-    /**
-     *  ¥Í¡¼¥à¥¹¥Ú¡¼¥¹¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @return string  ¥Í¡¼¥à¥¹¥Ú¡¼¥¹
-     */
-    function _getNameSpace()
-    {
-        return sprintf("%s/%s", $this->config->get('url'), $this->name);
-    }
-
-    /**
-     *  ·¿¤Î¥·¥ê¥¢¥é¥¤¥º
-     *
-     *  @access private
-     *  @param  array   $def    ·¿ÄêµÁ
-     *  @param  string  $name   ÊÑ¿ô̾
-     *  @return string  ¥·¥ê¥¢¥é¥¤¥º¤µ¤ì¤¿·¿ÄêµÁ
-     */
-    function _serializeTypes($def, $name)
-    {
-        if (is_array($def) == false) {
-            // nothing to do
-            return;
-        }
-
-        $types = $this->__serializeTypes($def, $name);
-
-        foreach ($def as $k => $v) {
-            if (is_array($def[$k]) == false || Ethna_SOAP_Util::isArrayOfScalar($def[$k])) {
-                continue;
-            }
-            $types .= $this->_serializeTypes($def[$k], $k);
-        }
-
-        return $types;
-    }
-
-    /**
-     *  ·¿¤Î¥·¥ê¥¢¥é¥¤¥º(¥¨¥ì¥á¥ó¥ÈÂбþ)
-     *
-     *  @access private
-     *  @param  array   $def    ·¿ÄêµÁ
-     *  @param  string  $name   ÊÑ¿ô̾
-     *  @return string  ¥·¥ê¥¢¥é¥¤¥º¤µ¤ì¤¿·¿ÄêµÁ(³ÆÍ×ÁÇ)
-     */
-    function __serializeTypes($def, $name)
-    {
-        $keys = array_keys($def);
-
-        if (Ethna_SOAP_Util::isArrayOfObject($def)) {
-            $array_name = sprintf("ArrayOf%s", $keys[0]);
-            $name = $keys[0];
-            $types = "   <s:complexType name=\"$array_name\">\n";
-            $types .= "    <s:complexContent mixed=\"false\">\n";
-            $types .= "     <s:restriction base=\"soapenc:Array\">\n";
-            $types .= "      <s:attribute d7p1:arrayType=\"tns:$name" . "[]" . "\" " .
-                "ref=\"soapenc:arrayType\" xmlns:d7p1=\"http://schemas.xmlsoap.org/wsdl/\" />\n";
-            $types .= "     </s:restriction>\n";
-            $types .= "    </s:complexContent>\n";
-            $types .= "   </s:complexType>\n";
-            return $types;
-        }
-
-        $types = "   <s:complexType name=\"$name\">\n";
-        $types .= "    <s:sequence>\n";
-        foreach ($keys as $key) {
-            if (is_array($def[$key])) {
-                $inner_keys = array_keys($def[$key]);
-                if (is_array($def[$key][$inner_keys[0]])) {
-                    $inner_name = sprintf("ArrayOf%s", $inner_keys[0]);
-                    $types .= "     <s:element name=\"$key\" type=\"tns:$inner_name\" />\n";
-                } else {
-                    $type_name = "tns:" . Ethna_SOAP_Util::getArrayTypeName($def[$key][$inner_keys[0]]);
-                    $types .= "     <s:element name=\"$key\" type=\"$type_name\" />\n";
-                }
-            } else {
-                $type_name = Ethna_SOAP_Util::getScalarTypeName($def[$key]);
-                $types .= "     <s:element name=\"$key\" type=\"s:$type_name\" />\n";
-            }
-        }
-        $types .= "    </s:sequence>\n";
-        $types .= "   </s:complexType>\n";
-
-        return $types;
-    }
-
-    /**
-     *  Message¤Î¥·¥ê¥¢¥é¥¤¥º
-     *
-     *  @access private
-     *  @param  string  $name   message̾
-     *  @param  int     $serno  messageÏ¢ÈÖ
-     *  @return string  ¥·¥ê¥¢¥é¥¤¥º¤µ¤ì¤¿message
-     */
-    function _serializeMessage($name, $serno)
-    {
-        $action_form_name = $this->controller->getActionFormName($name);
-        $form =& new $action_form_name($this->controller);
-
-        /* SoapIn */
-        $message = " <message name=\"${name}${serno}SoapIn\">\n";
-        $keys = array();
-        if (is_array($form->form)) {
-            $keys = array_keys($form->form);
-        }
-        foreach ($keys as $key) {
-            $type_id =& $form->form[$key]['type'];
-            if (is_array($type_id)) {
-                $type_keys = array_keys($type_id);
-                $type = "tns:" . Ethna_SOAP_Util::getArrayTypeName($type_id[$type_keys[0]]);
-            } else {
-                $type = "s:" . Ethna_SOAP_Util::getScalarTypeName($type_id);
-            }
-            $message .= "  <part name=\"$key\" type=\"$type\" />\n";
-        }
-        $message .= " </message>\n";
-
-        /* SoapOut */
-        $message .= " <message name=\"${name}${serno}SoapOut\">\n";
-        if ($form->retval == null) {
-            $type = "tns:Result";
-        } else {
-            $type = "tns:${name}Result";
-        }
-        $message .= "  <part name=\"result\" type=\"$type\" />\n";
-        $message .= " </message>\n";
-
-        return $message;
-    }
-
-    /**
-     *  PortType¤Î¥·¥ê¥¢¥é¥¤¥º
-     *
-     *  @access private
-     *  @param  string  $name   porttype̾
-     *  @param  int     $serno  porttypeÏ¢ÈÖ
-     *  @return string  ¥·¥ê¥¢¥é¥¤¥º¤µ¤ì¤¿porttype
-     */
-    function _serializePortType($name, $serno)
-    {
-        $action_form_name = $this->controller->getActionFormName($name);
-        $form =& new $action_form_name($this->controller);
-
-        $args = null;
-        if (is_array($form->form)) {
-            $args = implode(' ', array_keys($form->form));
-        }
-
-        $port_type = "  <operation name=\"$name\" parameterOrder=\"$args\">\n";
-        $port_type .= "   <input name=\"${name}${serno}SoapIn\" message=\"tns:${name}${serno}SoapIn\" />\n";
-        $port_type .= "   <output name=\"${name}${serno}SoapOut\" message=\"tns:${name}${serno}SoapOut\" />\n";
-        $port_type .= "  </operation>\n";
-
-        return $port_type;
-    }
-}
-// }}}
-?>
diff --git a/class/View/Ethna_View_Info.php b/class/View/Ethna_View_Info.php
deleted file mode 100644 (file)
index 04e0374..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_View_Info.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_View_Info
-/**
- *  __ethna_info__¥Ó¥å¡¼¤Î¼ÂÁõ
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_View_Info extends Ethna_ViewClass
-{
-    /**#@+
-     *  @access private
-     */
-
-    /**#@-*/
-
-    /**
-     *  Á«°ÜÁ°½èÍý
-     *
-     *  @access public
-     */
-    function preforward()
-    {
-        $ctl =& Ethna_Controller::getInstance();
-        $em =& new Ethna_InfoManager($this->backend);
-
-        // cores
-        $this->af->setApp('app_id', $ctl->getAppId());
-        $this->af->setApp('ethna_version', ETHNA_VERSION);
-
-        // actions
-        $this->af->setApp('action_list', $em->getActionList());
-
-        // views 
-        $this->af->setApp('forward_list', $em->getForwardList());
-
-        // configuration
-        $this->af->setApp('configuration', $em->getConfiguration());
-
-        // plugins
-        $this->af->setApp('plugin_list', $em->getPluginList());
-    }
-}
-// }}}
-?>
diff --git a/class/View/Ethna_View_List.php b/class/View/Ethna_View_List.php
deleted file mode 100644 (file)
index e10086c..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_View_List.php
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-// {{{ Ethna_View_List
-/**
- *  ¥ê¥¹¥È¥Ó¥å¡¼´ðÄ쥯¥é¥¹¤Î¼ÂÁõ
- *
- *  @author     Masaki Fujimoto <fujimoto@php.net>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_View_List extends Ethna_ViewClass
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    int     É½¼¨³«»Ï¥ª¥Õ¥»¥Ã¥È */
-    var $offset = 0;
-
-    /** @var    int     É½¼¨·ï¿ô */
-    var $count = 25;
-
-    /** @var    array   ¸¡º÷ÂоݹàÌÜ°ìÍ÷ */
-    var $search_list = array();
-
-    /** @var    string  ¸¡º÷¥Þ¥Í¡¼¥¸¥ã¥¯¥é¥¹Ì¾ */
-    var $manager_name = null;
-
-    /** @var    string  É½¼¨Âоݥ¯¥é¥¹Ì¾ */
-    var $class_name = null;
-
-    /**#@-*/
-
-    /**
-     *  Á«°ÜÁ°½èÍý
-     *
-     *  @access public
-     */
-    function preforward()
-    {
-        // É½¼¨¥ª¥Õ¥»¥Ã¥È/·ï¿ôÀßÄê
-        $this->offset = $this->af->get('offset');
-        if ($this->offset == "") {
-            $this->offset = 0;
-        }
-        if (intval($this->af->get('count')) > 0) {
-            $this->count = intval($this->af->get('count'));
-        }
-
-        // ¸¡º÷¾ò·ï
-        $filter = array();
-        $sort = array();
-        foreach ($this->search_list as $key) {
-            if ($this->af->get("s_$key") != "") {
-                $filter[$key] = $this->af->get("s_$key");
-            }
-            if ($this->af->get("sort") == $key) {
-                $order = $this->af->get("order") == "desc" ? OBJECT_SORT_DESC : OBJECT_SORT_ASC;
-                $sort = array(
-                    $key => $order,
-                );
-            }
-        }
-
-        // É½¼¨¹àÌÜ°ìÍ÷
-        $manager_name = $this->manager_name;
-        for ($i = 0; $i < 2; $i++) {
-            list($total, $obj_list) = $this->$manager_name->getObjectList($this->class_name, $filter, $sort, $this->offset, $this->count);
-            if (count($obj_list) == 0 && $this->offset >= $total) {
-                $this->offset = 0;
-                continue;
-            }
-            break;
-        }
-
-        $r = array();
-        foreach ($obj_list as $obj) {
-            $value = $obj->getNameObject();
-            $value = $this->_fixNameObject($value, $obj);
-            $r[] = $value;
-        }
-        $list_name = sprintf("%s_list", strtolower(preg_replace('/(.)([A-Z])/', '\\1_\\2', $this->class_name)));
-        $this->af->setApp($list_name, $r);
-
-        // ¥Ê¥Ó¥²¡¼¥·¥ç¥ó
-        $this->af->setApp('nav', $this->_getNavigation($total, $obj_list));
-        $this->af->setAppNE('query', $this->_getQueryParameter());
-
-        // ¸¡º÷¥ª¥×¥·¥ç¥ó
-        $this->_setQueryOption();
-    }
-
-    /**
-     *  É½¼¨¹àÌܤò½¤Àµ¤¹¤ë
-     *
-     *  @access protected
-     */
-    function _fixNameObject($value, $obj)
-    {
-        return $value;
-    }
-    
-    /**
-     *  ¥Ê¥Ó¥²¡¼¥·¥ç¥ó¾ðÊó¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access private
-     *  @param  int     $total      ¸¡º÷Áí·ï¿ô
-     *  @param  array   $list       ¸¡º÷·ë²Ì
-     *  @return array   ¥Ê¥Ó¥²¡¼¥·¥ç¥ó¾ðÊó¤ò³ÊǼ¤·¤¿ÇÛÎó
-     */
-    function _getNavigation($total, &$list)
-    {
-        $nav = array();
-        $nav['offset'] = $this->offset;
-        $nav['from'] = $this->offset + 1;
-        if ($total == 0) {
-            $nav['from'] = 0;
-        }
-        $nav['to'] = $this->offset + count($list);
-        $nav['total'] = $total;
-        if ($this->offset > 0) {
-            $prev_offset = $this->offset - $this->count;
-            if ($prev_offset < 0) {
-                $prev_offset = 0;
-            }
-            $nav['prev_offset'] = $prev_offset;
-        }
-        if ($this->offset + $this->count < $total) {
-            $next_offset = $this->offset + count($list);
-            $nav['next_offset'] = $next_offset;
-        }
-        $nav['direct_link_list'] = Ethna_Util::getDirectLinkList($total, $this->offset, $this->count);
-
-        return $nav;
-    }
-
-    /**
-     *  ¸¡º÷¹àÌܤòÀ¸À®¤¹¤ë
-     *
-     *  @access protected
-     */
-    function _setQueryOption()
-    {
-    }
-
-    /**
-     *  ¸¡º÷ÆâÍƤò³ÊǼ¤·¤¿GET°ú¿ô¤òÀ¸À®¤¹¤ë
-     *
-     *  @access private
-     *  @param  array   $search_list    ¸¡º÷ÂоݰìÍ÷
-     *  @return string  ¸¡º÷ÆâÍƤò³ÊǼ¤·¤¿GET°ú¿ô
-     */
-    function _getQueryParameter()
-    {
-        $query = "";
-
-        foreach ($this->search_list as $key) {
-            $value = $this->af->get("s_$key");
-            if (is_array($value)) {
-                foreach ($value as $v) {
-                    $query .= "&s_$key" . "[]=" . urlencode($v);
-                }
-            } else {
-                $query .= "&s_$key=" . urlencode($value);
-            }
-        }
-
-        return $query;
-    }
-}
-// }}}
-?>
diff --git a/class/View/Ethna_View_UnitTest.php b/class/View/Ethna_View_UnitTest.php
deleted file mode 100644 (file)
index 14d1852..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-/**
- *  Ethna_View_UnitTest.php
- *
- *  @author     Takuya Ookubo <sfio@sakura.ai.to>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Ethna
- *  @version    $Id$
- */
-
-/**
- *  __ethna_unittest__¥Ó¥å¡¼¤Î¼ÂÁõ
- *
- *  @author     Takuya Ookubo <sfio@sakura.ai.to>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_View_UnitTest extends Ethna_ViewClass
-{
-    /**
-     *  Á«°ÜÁ°½èÍý
-     *
-     *  @access public
-     */
-    function preforward()
-    {
-        // ¥¿¥¤¥à¥¢¥¦¥È¤·¤Ê¤¤¤è¤¦¤ËÊѹ¹
-        $max_execution_time = ini_get('max_execution_time');
-        set_time_limit(0);
-
-        if (!headers_sent()) {
-            // ¥­¥ã¥Ã¥·¥å¤·¤Ê¤¤
-            header("Expires: Thu, 01 Jan 1970 00:00:00 GMT");
-            header("Last-Modified: " . gmdate("D, d M Y H:i:s \G\M\T"));
-            header("Cache-Control: no-store, no-cache, must-revalidate");
-            header("Cache-Control: post-check=0, pre-check=0", false);
-            header("Pragma: no-cache");
-        }
-
-        $ctl =& Ethna_Controller::getInstance();
-
-        // cores
-        $this->af->setApp('app_id', $ctl->getAppId());
-        $this->af->setApp('ethna_version', ETHNA_VERSION);
-
-        // include
-        $file = sprintf("%s/%s_UnitTestManager.php",
-            $ctl->getDirectory('app'),
-            $ctl->getAppId());
-        include_once $file;
-
-        // run
-        $r = sprintf("%s_UnitTestManager", $ctl->getAppId());
-        $ut =& new $r($this->backend);
-        list($report, $result) = $ut->run();
-        
-        // result
-        $this->af->setApp('report', $report);
-        $this->af->setApp('result', $result);
-
-        // ¥¿¥¤¥à¥¢¥¦¥È¤ò¸µ¤ËÌ᤹
-        set_time_limit($max_execution_time);
-    }
-}
-?>
diff --git a/misc/_ethna b/misc/_ethna
deleted file mode 100644 (file)
index b8cbd71..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#compdef ethna
-
-# usage:
-#   1. copy this file to your favorite directory (ex, ~/.zshrc.d/completion)
-#   2. add below lines to your .zshrc:
-#      > fpath=(~/.zshrc.d/completion $fpath)
-#      > autoload -U compinit
-#      > compinit -u
-#   3. push [tab] when you typing ethna command's argument.
-#      % ethna add-[tab]
-#
-# note:
-#   - we tested this function only with Debian/GNU Linux.
-#   - $Id: _ethna 411 2006-11-17 02:32:32Z ichii386 $
-
-_ethna() {
-    local curcontext="$curcontext" state line expl ret=1
-
-    _arguments -C \
-        '(-v --version)'{-v,--version}'[show version]' \
-        '1:ethna command:->ethna-cmd' \
-        '*:ethna command args:->ethna-cmd-arg' \
-        && ret=0
-
-    if [[ -n "$state" ]]; then
-        case $state in
-            ethna-cmd)
-                handles=( $($service | grep '^ \+.* -> .*:$' | awk '{print $1}') )
-                _wanted ethna-cmd expl 'ethna cmd' compadd -a handles && ret=0
-            ;;
-            ethna-cmd-arg)
-                usage=$($service | grep -A 1 "^ \+$words[2] ->")
-                if [[ -n "$usage" ]]; then
-                    _wanted ethna-cmd-arg expl 'ethna cmd arg' compadd -x "$usage" && ret=0
-                else
-                    _wanted ethna-cmd-arg expl 'ethna cmd arg' compadd -x "unknown command" && ret=0
-                fi
-            ;;
-        esac    
-    fi
-
-    return ret
-}
diff --git a/misc/sample_package.ini b/misc/sample_package.ini
deleted file mode 100644 (file)
index d9fcd07..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; a sample for packager ini file.
-;;;
-;;; command line to get package tgz files:
-;;; > ethna make-plugin-package --inifile=./sample_package.ini --skelfile=./sample_plugin.php
-;;;
-;;; $Id$
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-[plugin]
-type    = Sample
-name    = Phpinfo
-master  = true
-local   = true
-
-[package]
-channel = pear.ethna.jp
-summary = "sample package for plugin packager"
-description = "This is a sample package for plugin packager."
-
-[release]
-version = 1.0.0
-state   = stable
-notes   = "initial release."
-
-[maintainers]
-role1   = lead
-name1   = ICHII Takashi
-user1   = ichii386
-email1  = ichii386@schweetheart.jp
-active1 = yes
-
-role2   = helper
-name2   = Masaki Fujimoto
-user2   = fujimoto
-email2  = fujimoto@php.net
-active2 = no
-
-[license]
-name    = The BSD License
-uri     = http://www.opensource.org/licenses/bsd-license.php
-
diff --git a/misc/sample_plugin.php b/misc/sample_plugin.php
deleted file mode 100644 (file)
index 32048f6..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  plugin sample file.
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
- *  @package    Sample
- *  @version    $Id$
- */
-
-// {{{ {$application_id}_Plugin_Sample_Phpinfo
-/**
- *  plugin sample class.
- *
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- *  @access     public
- *  @package    Sample
- */
-class {$application_id}_Plugin_Sample_Phpinfo
-{
-    // {{{ perform
-    /**
-     *  do phpinfo().
-     *
-     *  @access public
-     */
-    function perform()
-    {
-        phpinfo();
-    }
-    // }}}
-}
-// }}}
-?>
diff --git a/skel/app.action.default.php b/skel/app.action.default.php
deleted file mode 100644 (file)
index 0859c94..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-<?php
-/**
- *  Index.php
- *
- *  @author    {$author}
- *  @package   {$project_id}
- *  @version   $Id$
- */
-
-/**
- *  index¥Õ¥©¡¼¥à¤Î¼ÂÁõ
- *
- *  @author    {$author}
- *  @access    public
- *  @package   {$project_id}
- */
-
-class {$project_id}_Form_Index extends {$project_id}_ActionForm
-{
-    /** @var    bool    ¥Ð¥ê¥Ç¡¼¥¿¤Ë¥×¥é¥°¥¤¥ó¤ò»È¤¦¥Õ¥é¥° */
-    var $use_validator_plugin = false;
-
-    /**
-     *  @access   private
-     *  @var      array   ¥Õ¥©¡¼¥àÃÍÄêµÁ
-     */
-     var $form = array(
-       /*
-        *  TODO: ¤³¤Î¥¢¥¯¥·¥ç¥ó¤¬»ÈÍѤ¹¤ë¥Õ¥©¡¼¥à¤òµ­½Ò¤·¤Æ¤¯¤À¤µ¤¤
-        *
-        *  µ­½ÒÎã(type¤ò½ü¤¯Á´¤Æ¤ÎÍ×ÁǤϾÊά²Äǽ)¡§
-        *
-        *  'sample' => array(
-        *  // ¥Õ¥©¡¼¥à¤ÎÄêµÁ
-        *      'type'        => VAR_TYPE_INT,        // ÆþÎÏÃÍ·¿
-        *      'form_type'   => FORM_TYPE_TEXT,      // ¥Õ¥©¡¼¥à·¿
-        *      'name'        => '¥µ¥ó¥×¥ë',          // É½¼¨Ì¾
-        *  
-        *  // ¥Ð¥ê¥Ç¡¼¥¿(µ­½Ò½ç¤Ë¥Ð¥ê¥Ç¡¼¥¿¤¬¼Â¹Ô¤µ¤ì¤Þ¤¹)
-        *      'required'    => true,                        // É¬¿Ü¥ª¥×¥·¥ç¥ó(true/false)
-        *      'min'         => null,                        // ºÇ¾®ÃÍ
-        *      'max'         => null,                        // ºÇÂçÃÍ
-        *      'regexp'      => null,                        // Ê¸»ú¼ï»ØÄê(Àµµ¬É½¸½)
-        *
-        *  // ¥Õ¥£¥ë¥¿
-        *      'filter'      => null,                        // ÆþÎÏÃÍÊÑ´¹¥Õ¥£¥ë¥¿¥ª¥×¥·¥ç¥ó
-        *  ),
-        */
-      );
-}
-
-/**
- *  index¥¢¥¯¥·¥ç¥ó¤Î¼ÂÁõ
- *
- *  @author     {$author}
- *  @access     public
- *  @package    {$project_id}
- */
-class {$project_id}_Action_Index extends {$project_id}_ActionClass
-{
-        /**
-         *  index¥¢¥¯¥·¥ç¥ó¤ÎÁ°½èÍý
-         *
-         *  @access    public
-         *  @return    string  ForwardÀè(Àµ¾ï½ªÎ»¤Ê¤énull)
-         */
-        function prepare()
-        {
-                return null;
-        }
-
-        /**
-         *  index¥¢¥¯¥·¥ç¥ó¤Î¼ÂÁõ
-         *
-         *  @access    public
-         *  @return    string  Á«°Ü̾
-         */
-        function perform()
-        {
-                return 'index';
-        }
-}
-?>
diff --git a/skel/app.actionclass.php b/skel/app.actionclass.php
deleted file mode 100644 (file)
index 1842f7b..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  {$project_id}_ActionClass.php
- *
- *  @author     {$author}
- *  @package    {$project_id}
- *  @version    $Id$
- */
-
-// {{{ {$project_id}_ActionClass
-/**
- *  action¼Â¹Ô¥¯¥é¥¹
- *
- *  @author     {$author}
- *  @package    {$project_id}
- *  @access     public
- */
-class {$project_id}_ActionClass extends Ethna_ActionClass
-{
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¼Â¹ÔÁ°¤Îǧ¾Ú½èÍý¤ò¹Ô¤¦
-     *
-     *  @access public
-     *  @return string  Á«°Ü̾(null¤Ê¤éÀµ¾ï½ªÎ», false¤Ê¤é½èÍý½ªÎ»)
-     */
-    function authenticate()
-    {
-        return parent::authenticate();
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¼Â¹ÔÁ°¤Î½èÍý(¥Õ¥©¡¼¥àÃÍ¥Á¥§¥Ã¥¯Åù)¤ò¹Ô¤¦
-     *
-     *  @access public
-     *  @return string  Á«°Ü̾(null¤Ê¤éÀµ¾ï½ªÎ», false¤Ê¤é½èÍý½ªÎ»)
-     */
-    function prepare()
-    {
-        return parent::prepare();
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¼Â¹Ô
-     *
-     *  @access public
-     *  @return string  Á«°Ü̾(null¤Ê¤éÁ«°Ü¤Ï¹Ô¤ï¤Ê¤¤)
-     */
-    function perform()
-    {
-        return parent::perform();
-    }
-}
-// }}}
-?>
diff --git a/skel/app.actionform.php b/skel/app.actionform.php
deleted file mode 100644 (file)
index b32a987..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  {$project_id}_ActionForm.php
- *
- *  @author     {$author}
- *  @package    {$project_id}
- *  @version    $Id$
- */
-
-// {{{ {$project_id}_ActionForm
-/**
- *  ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥¯¥é¥¹
- *
- *  @author     {$author}
- *  @package    {$project_id}
- *  @access     public
- */
-class {$project_id}_ActionForm extends Ethna_ActionForm
-{
-    /**#@+
-     *  @access private
-     */
-
-    /** @var    array   ¥Õ¥©¡¼¥àÃÍÄêµÁ(¥Ç¥Õ¥©¥ë¥È) */
-    var $form_template = array();
-
-    /** @var    bool    ¥Ð¥ê¥Ç¡¼¥¿¤Ë¥×¥é¥°¥¤¥ó¤ò»È¤¦¥Õ¥é¥° */
-    var $use_validator_plugin = true;
-
-    /**#@-*/
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃ͸¡¾Ú¤Î¥¨¥é¡¼½èÍý¤ò¹Ô¤¦
-     *
-     *  @access public
-     *  @param  string      $name   ¥Õ¥©¡¼¥à¹àÌÜ̾
-     *  @param  int         $code   ¥¨¥é¡¼¥³¡¼¥É
-     */
-    function handleError($name, $code)
-    {
-        return parent::handleError($name, $code);
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃÍÄêµÁ¥Æ¥ó¥×¥ì¡¼¥È¤òÀßÄꤹ¤ë
-     *
-     *  @access protected
-     *  @param  array   $form_template  ¥Õ¥©¡¼¥àÃͥƥó¥×¥ì¡¼¥È
-     *  @return array   ¥Õ¥©¡¼¥àÃͥƥó¥×¥ì¡¼¥È
-     */
-    function _setFormTemplate($form_template)
-    {
-        return parent::_setFormTemplate($form_template);
-    }
-
-    /**
-     *  ¥Õ¥©¡¼¥àÃÍÄêµÁ¤òÀßÄꤹ¤ë
-     *
-     *  @access protected
-     */
-    function _setFormDef()
-    {
-        return parent::_setFormDef();
-    }
-
-}
-// }}}
-?>
diff --git a/skel/app.controller.php b/skel/app.controller.php
deleted file mode 100644 (file)
index b236485..0000000
+++ /dev/null
@@ -1,260 +0,0 @@
-<?php
-/**
- *  {$project_id}_Controller.php
- *
- *  @author     {$author}
- *  @package    {$project_id}
- *  @version    $Id$
- */
-
-/** ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê */
-define('BASE', dirname(dirname(__FILE__)));
-
-/** include_path¤ÎÀßÄê(¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Ç¥£¥ì¥¯¥È¥ê¤òÄɲÃ) */
-$app = BASE . "/app";
-$lib = BASE . "/lib";
-ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . implode(PATH_SEPARATOR, array($app, $lib)));
-
-
-/** ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥é¥¤¥Ö¥é¥ê¤Î¥¤¥ó¥¯¥ë¡¼¥É */
-require_once 'Ethna/Ethna.php';
-require_once '{$project_id}_Error.php';
-require_once '{$project_id}_ActionClass.php';
-require_once '{$project_id}_ActionForm.php';
-require_once '{$project_id}_ViewClass.php';
-
-/**
- *  {$project_id}¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥³¥ó¥È¥í¡¼¥éÄêµÁ
- *
- *  @author     {$author}
- *  @access     public
- *  @package    {$project_id}
- */
-class {$project_id}_Controller extends Ethna_Controller
-{
-    /**#@+
-     *  @access private
-     */
-
-    /**
-     *  @var    string  ¥¢¥×¥ê¥±¡¼¥·¥ç¥óID
-     */
-    var $appid = '{$application_id}';
-
-    /**
-     *  @var    array   forwardÄêµÁ
-     */
-    var $forward = array(
-        /*
-         *  TODO: ¤³¤³¤ËforwardÀè¤òµ­½Ò¤·¤Æ¤¯¤À¤µ¤¤
-         *
-         *  µ­½ÒÎ㡧
-         *
-         *  'index'         => array(
-         *      'view_name' => '{$project_id}_View_Index',
-         *  ),
-         */
-    );
-
-    /**
-     *  @var    array   actionÄêµÁ
-     */
-    var $action = array(
-        /*
-         *  TODO: ¤³¤³¤ËactionÄêµÁ¤òµ­½Ò¤·¤Æ¤¯¤À¤µ¤¤
-         *
-         *  µ­½ÒÎ㡧
-         *
-         *  'index'     => array(),
-         */
-    );
-
-    /**
-     *  @var    array   soap actionÄêµÁ
-     */
-    var $soap_action = array(
-        /*
-         *  TODO: ¤³¤³¤ËSOAP¥¢¥×¥ê¥±¡¼¥·¥ç¥óÍѤÎactionÄêµÁ¤ò
-         *  µ­½Ò¤·¤Æ¤¯¤À¤µ¤¤
-         *  µ­½ÒÎ㡧
-         *
-         *  'sample'            => array(),
-         */
-    );
-
-    /**
-     *  @var    array       ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Ç¥£¥ì¥¯¥È¥ê
-     */
-    var $directory = array(
-        'action'        => 'app/action',
-        'action_cli'    => 'app/action_cli',
-        'action_xmlrpc' => 'app/action_xmlrpc',
-        'app'           => 'app',
-        'plugin'        => 'app/plugin',
-        'bin'           => 'bin',
-        'etc'           => 'etc',
-        'filter'        => 'app/filter',
-        'locale'        => 'locale',
-        'log'           => 'log',
-        'plugins'       => array(),
-        'template'      => 'template',
-        'template_c'    => 'tmp',
-        'tmp'           => 'tmp',
-        'view'          => 'app/view',
-        'www'           => 'www',
-    );
-
-    /**
-     *  @var    array       DB¥¢¥¯¥»¥¹ÄêµÁ
-     */
-    var $db = array(
-        ''              => DB_TYPE_RW,
-    );
-
-    /**
-     *  @var    array       ³ÈÄ¥»ÒÀßÄê
-     */
-    var $ext = array(
-        'php'           => 'php',
-        'tpl'           => 'tpl',
-    );
-
-    /**
-     *  @var    array   ¥¯¥é¥¹ÄêµÁ
-     */
-    var $class = array(
-        /*
-         *  TODO: ÀßÄꥯ¥é¥¹¡¢¥í¥°¥¯¥é¥¹¡¢SQL¥¯¥é¥¹¤ò¥ª¡¼¥Ð¡¼¥é¥¤¥É
-         *  ¤·¤¿¾ì¹ç¤Ï²¼µ­¤Î¥¯¥é¥¹Ì¾¤ò˺¤ì¤º¤ËÊѹ¹¤·¤Æ¤¯¤À¤µ¤¤
-         */
-        'class'         => 'Ethna_ClassFactory',
-        'backend'       => 'Ethna_Backend',
-        'config'        => 'Ethna_Config',
-        'db'            => 'Ethna_DB_PEAR',
-        'error'         => 'Ethna_ActionError',
-        'form'          => '{$project_id}_ActionForm',
-        'i18n'          => 'Ethna_I18N',
-        'logger'        => 'Ethna_Logger',
-        'plugin'        => 'Ethna_Plugin',
-        'session'       => 'Ethna_Session',
-        'sql'           => 'Ethna_AppSQL',
-        'view'          => '{$project_id}_ViewClass',
-        'renderer'      => 'Ethna_Renderer_Smarty',
-        'url_handler'   => '{$project_id}_UrlHandler',
-    );
-
-    /**
-     *  @var    array       ¸¡º÷ÂоݤȤʤë¥×¥é¥°¥¤¥ó¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥óID¤Î¥ê¥¹¥È
-     */
-    var $plugin_search_appids = array(
-        /*
-         *  ¥×¥é¥°¥¤¥ó¸¡º÷»þ¤Ë¸¡º÷ÂоݤȤʤ륢¥×¥ê¥±¡¼¥·¥ç¥óID¤Î¥ê¥¹¥È¤òµ­½Ò¤·¤Þ¤¹¡£
-         *
-         *  µ­½ÒÎ㡧
-         *  Common_Plugin_Foo_Bar ¤Î¤è¤¦¤Ê̿̾¤Î¥×¥é¥°¥¤¥ó¤¬¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î
-         *  ¥×¥é¥°¥¤¥ó¥Ç¥£¥ì¥¯¥È¥ê¤Ë¸ºß¤¹¤ë¾ì¹ç¡¢°Ê²¼¤Î¤è¤¦¤Ë»ØÄꤹ¤ë¤È
-         *  Common_Plugin_Foo_Bar, {$project_id}_Plugin_Foo_Bar, Ethna_Plugin_Foo_Bar
-         *  ¤Î½ç¤Ë¥×¥é¥°¥¤¥ó¤¬¸¡º÷¤µ¤ì¤Þ¤¹¡£ 
-         *
-         *  'Common', '{$project_id}', 'Ethna',
-         */
-        '{$project_id}', 'Ethna',
-    );
-
-    /**
-     *  @var    array       ¥Õ¥£¥ë¥¿ÀßÄê
-     */
-    var $filter = array(
-        /*
-         *  TODO: ¥Õ¥£¥ë¥¿¤òÍøÍѤ¹¤ë¾ì¹ç¤Ï¤³¤³¤Ë¤½¤Î¥×¥é¥°¥¤¥ó̾¤ò
-         *  µ­½Ò¤·¤Æ¤¯¤À¤µ¤¤
-         *  (¥¯¥é¥¹Ì¾¤ò»ØÄꤹ¤ë¤Èfilter¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¥Õ¥£¥ë¥¿¥¯¥é¥¹
-         *  ¤òÆɤ߹þ¤ß¤Þ¤¹)
-         *
-         *  µ­½ÒÎ㡧
-         *
-         *  'ExecutionTime',
-         */
-    );
-
-    /**
-     *  @var    array   smarty modifierÄêµÁ
-     */
-    var $smarty_modifier_plugin = array(
-        /*
-         *  TODO: ¤³¤³¤Ë¥æ¡¼¥¶ÄêµÁ¤Îsmarty modifier°ìÍ÷¤òµ­½Ò¤·¤Æ¤¯¤À¤µ¤¤
-         *
-         *  µ­½ÒÎ㡧
-         *
-         *  'smarty_modifier_foo_bar',
-         */
-    );
-
-    /**
-     *  @var    array   smarty functionÄêµÁ
-     */
-    var $smarty_function_plugin = array(
-        /*
-         *  TODO: ¤³¤³¤Ë¥æ¡¼¥¶ÄêµÁ¤Îsmarty function°ìÍ÷¤òµ­½Ò¤·¤Æ¤¯¤À¤µ¤¤
-         *
-         *  µ­½ÒÎ㡧
-         *
-         *  'smarty_function_foo_bar',
-         */
-    );
-
-    /**
-     *  @var    array   smarty blockÄêµÁ
-     */
-    var $smarty_block_plugin = array(
-        /*
-         *  TODO: ¤³¤³¤Ë¥æ¡¼¥¶ÄêµÁ¤Îsmarty block°ìÍ÷¤òµ­½Ò¤·¤Æ¤¯¤À¤µ¤¤
-         *
-         *  µ­½ÒÎ㡧
-         *
-         *  'smarty_block_foo_bar',
-         */
-    );
-
-    /**
-     *  @var    array   smarty prefilterÄêµÁ
-     */
-    var $smarty_prefilter_plugin = array(
-        /*
-         *  TODO: ¤³¤³¤Ë¥æ¡¼¥¶ÄêµÁ¤Îsmarty prefilter°ìÍ÷¤òµ­½Ò¤·¤Æ¤¯¤À¤µ¤¤
-         *
-         *  µ­½ÒÎ㡧
-         *
-         *  'smarty_prefilter_foo_bar',
-         */
-    );
-
-    /**
-     *  @var    array   smarty postfilterÄêµÁ
-     */
-    var $smarty_postfilter_plugin = array(
-        /*
-         *  TODO: ¤³¤³¤Ë¥æ¡¼¥¶ÄêµÁ¤Îsmarty postfilter°ìÍ÷¤òµ­½Ò¤·¤Æ¤¯¤À¤µ¤¤
-         *
-         *  µ­½ÒÎ㡧
-         *
-         *  'smarty_postfilter_foo_bar',
-         */
-    );
-
-    /**
-     *  @var    array   smarty outputfilterÄêµÁ
-     */
-    var $smarty_outputfilter_plugin = array(
-        /*
-         *  TODO: ¤³¤³¤Ë¥æ¡¼¥¶ÄêµÁ¤Îsmarty outputfilter°ìÍ÷¤òµ­½Ò¤·¤Æ¤¯¤À¤µ¤¤
-         *
-         *  µ­½ÒÎ㡧
-         *
-         *  'smarty_outputfilter_foo_bar',
-         */
-    );
-
-    /**#@-*/
-}
-?>
diff --git a/skel/app.error.php b/skel/app.error.php
deleted file mode 100644 (file)
index 0677367..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-/**
- *  {$project_id}_Error.php
- *
- *  @package   {$project_id}
- *
- *  $Id$
- */
-
-/*--- ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥¨¥é¡¼ÄêµÁ ---*/
-/*
- *  TODO: ¤³¤³¤Ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥¨¥é¡¼ÄêµÁ¤òµ­½Ò¤·¤Æ¤¯¤À¤µ¤¤¡£
- *  ¤Ê¤ª¡¢255¤Þ¤Ç¤Î¥¨¥é¡¼¥³¡¼¥É¤Ï¥Õ¥ì¡¼¥à¥ï¡¼¥¯¤ÇͽÌ󤵤ì¤Æ¤¤¤Þ¤¹¤Î¤Ç
- *  ¥¨¥é¡¼¥³¡¼¥É¤Ë¤Ï256°Ê¾å¤ÎÀ°¿ô¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
- *
- *  µ­½ÒÎã:
- *  define('E_LOGIN_INVALID', 256);
- */
-?>
diff --git a/skel/app.plugin.filter.default.php b/skel/app.plugin.filter.default.php
deleted file mode 100644 (file)
index 3eabc57..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-<?php
-/**
- *  {$project_id}_Plugin_Filter_ExecutionTime.php
- *
- *  @author     {$author}
- *  @package    {$project_id}
- *  @version    $Id$
- */
-
-/**
- *  ¼Â¹Ô»þ´Ö·×¬¥Õ¥£¥ë¥¿¥×¥é¥°¥¤¥ó¤Î¼ÂÁõ
- *
- *  @author     {$author}
- *  @access     public
- *  @package    {$project_id}
- */
-class {$project_id}_Plugin_Filter_ExecutionTime extends Ethna_Plugin_Filter
-{
-    /**#@+
-     *  @access private
-     */
-
-    /**
-     *  @var    int     ³«»Ï»þ´Ö
-     */
-    var $stime;
-
-    /**#@-*/
-
-
-    /**
-     *  ¼Â¹ÔÁ°¥Õ¥£¥ë¥¿
-     *
-     *  @access public
-     */
-    function preFilter()
-    {
-        $stime = explode(' ', microtime());
-        $stime = $stime[1] + $stime[0];
-        $this->stime = $stime;
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¼Â¹ÔÁ°¥Õ¥£¥ë¥¿
-     *
-     *  @access public
-     *  @param  string  $action_name    ¼Â¹Ô¤µ¤ì¤ë¥¢¥¯¥·¥ç¥ó̾
-     *  @return string  null:Àµ¾ï½ªÎ» (string):¼Â¹Ô¤¹¤ë¥¢¥¯¥·¥ç¥ó̾¤òÊѹ¹
-     */
-    function preActionFilter($action_name)
-    {
-        return null;
-    }
-
-    /**
-     *  ¥¢¥¯¥·¥ç¥ó¼Â¹Ô¸å¥Õ¥£¥ë¥¿
-     *
-     *  @access public
-     *  @param  string  $action_name    ¼Â¹Ô¤µ¤ì¤¿¥¢¥¯¥·¥ç¥ó̾
-     *  @param  string  $forward_name   ¼Â¹Ô¤µ¤ì¤¿¥¢¥¯¥·¥ç¥ó¤«¤é¤ÎÌá¤êÃÍ
-     *  @return string  null:Àµ¾ï½ªÎ» (string):Á«°Ü̾¤òÊѹ¹
-     */
-    function postActionFilter($action_name, $forward_name)
-    {
-        return null;
-    }
-
-    /**
-     *  ¼Â¹Ô¸å¥Õ¥£¥ë¥¿
-     *
-     *  @access public
-     */
-    function postFilter()
-    {
-        $etime = explode(' ', microtime());
-        $etime = $etime[1] + $etime[0];
-        $time   = round(($etime - $this->stime), 4);
-
-        print "\n<!-- page was processed in $time seconds -->\n";
-    }
-}
-?>
diff --git a/skel/app.unittest.php b/skel/app.unittest.php
deleted file mode 100644 (file)
index 1dfe0cd..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-/**
- *  {$project_id}_UnitTestManager.php
- *
- *  @author     {$author}
- *  @package    {$project_id}
- *  @version    $Id$
- */
-
-/**
- *  {$project_id}¥æ¥Ë¥Ã¥È¥Æ¥¹¥È¥Þ¥Í¡¼¥¸¥ã¥¯¥é¥¹
- *
- *  @author     {$author}
- *  @access     public
- *  @package    {$project_id}
- */
-class {$project_id}_UnitTestManager extends Ethna_UnitTestManager
-{
-    /**
-     *  @var    array   °ìÈ̥ƥ¹¥È¥±¡¼¥¹ÄêµÁ
-     */
-    var $testcase = array(
-        /*
-         *  TODO: ¤³¤³¤Ë°ìÈ̥ƥ¹¥È¥±¡¼¥¹ÄêµÁ¤òµ­½Ò¤·¤Æ¤¯¤À¤µ¤¤
-         *
-         *  µ­½ÒÎ㡧
-         *
-         *  'util' => 'app/UtilTest.php',
-         */
-    );
-}
-?>
diff --git a/skel/app.url_handler.php b/skel/app.url_handler.php
deleted file mode 100644 (file)
index 9f31948..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-<?php
-/**
- *  {$project_id}_UrlHandler.php
- *
- *  @author     {$author}
- *  @package    {$project_id}
- *  @version    $Id$
- */
-
-/**
- *  URL¥Ï¥ó¥É¥é¥¯¥é¥¹
- *
- *  @author     {$author}
- *  @access     public
- *  @package    {$project_id}
- */
-class {$project_id}_UrlHandler extends Ethna_UrlHandler
-{
-    /** @var    array   ¥¢¥¯¥·¥ç¥ó¥Þ¥Ã¥Ô¥ó¥° */
-    var $action_map = array(
-        /*
-        'user'  => array(
-            'user_login' => array(
-                'path'          => 'login',
-                'path_regexp'   => false,
-                'path_ext'      => false,
-                'option'        => array(),
-            ),
-        ),
-         */
-    );
-
-    /**
-     *  {$project_id}_UrlHandler¥¯¥é¥¹¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     */
-    function &getInstance($class_name = null)
-    {
-        $instance =& parent::getInstance(__CLASS__);
-        return $instance;
-    }
-
-    // {{{ ¥²¡¼¥È¥¦¥§¥¤¥ê¥¯¥¨¥¹¥ÈÀµµ¬²½
-    /**
-     *  ¥ê¥¯¥¨¥¹¥ÈÀµµ¬²½(user¥²¡¼¥È¥¦¥§¥¤)
-     *
-     *  @access private
-     */
-    /*
-    function _normalizeRequest_User($http_vars)
-    {
-        return $http_vars;
-    }
-     */
-    // }}}
-
-    // {{{ ¥²¡¼¥È¥¦¥§¥¤¥Ñ¥¹À¸À®
-    /**
-     *  ¥Ñ¥¹À¸À®(user¥²¡¼¥È¥¦¥§¥¤)
-     *
-     *  @access private
-     */
-    /*
-    function _getPath_User($action, $param)
-    {
-        return array("/user", array());
-    }
-     */
-    // }}}
-
-    // {{{ ¥Õ¥£¥ë¥¿
-    // }}}
-}
-
-// vim: foldmethod=marker tabstop=4 shiftwidth=4 autoindent
-?>
diff --git a/skel/app.view.default.php b/skel/app.view.default.php
deleted file mode 100644 (file)
index d68b1d1..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-/**
- *  Index.php
- *
- *  @author     {$author}
- *  @package    {$project_id}
- *  @version    $Id$
- */
-
-/**
- *  index¥Ó¥å¡¼¤Î¼ÂÁõ
- *
- *  @author     {$author}
- *  @access     public
- *  @package    {$project_id}
- */
-class {$project_id}_View_Index extends {$project_id}_ViewClass
-{
-    /**
-     *  Á«°ÜÁ°½èÍý
-     *
-     *  @access public
-     */
-    function preforward()
-    {
-    }
-}
-?>
diff --git a/skel/app.viewclass.php b/skel/app.viewclass.php
deleted file mode 100644 (file)
index c5fa51b..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  {$project_id}_ViewClass.php
- *
- *  @author     {$author}
- *  @package    {$project_id}
- *  @version    $Id$
- */
-
-// {{{ {$project_id}_ViewClass
-/**
- *  view¥¯¥é¥¹
- *
- *  @author     {$author}
- *  @package    {$project_id}
- *  @access     public
- */
-class {$project_id}_ViewClass extends Ethna_ViewClass
-{
-    /**
-     *  ¶¦ÄÌÃͤòÀßÄꤹ¤ë
-     *
-     *  @access protected
-     *  @param  object  {$project_id}_Renderer  ¥ì¥ó¥À¥é¥ª¥Ö¥¸¥§¥¯¥È
-     */
-    function _setDefault(&$renderer)
-    {
-    }
-}
-// }}}
-?>
diff --git a/skel/dot.ethna b/skel/dot.ethna
deleted file mode 100644 (file)
index 6e182e3..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-[project]
-ethna_version = {$ethna_version}
-controller_file = "app/{$project_id}_Controller.php"
-controller_class = "{$project_id}_Controller"
diff --git a/skel/etc.ini.php b/skel/etc.ini.php
deleted file mode 100644 (file)
index 88063ac..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-<?php
-/*
- * {$project_prefix}-ini.php
- *
- * update:
- */
-$config = array(
-    // site
-    'url' => '',
-
-    // debug
-    // (to enable ethna_info and ethna_unittest, turn this true)
-    'debug' => false,
-
-    // db
-    // sample-1: single db
-    // 'dsn' => 'mysql://user:password@server/database',
-    //
-    // sample-2: single db w/ multiple users
-    // 'dsn'   => 'mysql://rw_user:password@server/database', // read-write
-    // 'dsn_r' => 'mysql://ro_user:password@server/database', // read-only
-    //
-    // sample-3: multiple db (slaves)
-    // 'dsn'   => 'mysql://rw_user:password@master/database', // read-write(master)
-    // 'dsn_r' => array(
-    //     'mysql://ro_user:password@slave1/database',         // read-only(slave)
-    //     'mysql://ro_user:password@slave2/database',         // read-only(slave)
-    // ),
-
-    // log
-    // sample-1: sigile facility
-    'log_facility'          => 'echo',
-    'log_level'             => 'warning',
-    'log_option'            => 'pid,function,pos',
-    'log_filter_do'         => '',
-    'log_filter_ignore'     => 'Undefined index.*%%.*tpl',
-    // sample-2: mulitple facility
-    //'log' => array(
-    //    'echo'  => array(
-    //        'level'         => 'warning',
-    //    ),
-    //    'file'  => array(
-    //        'level'         => 'notice',
-    //        'file'          => '/var/log/{$project_prefix}.log',
-    //        'mode'          => 0666,
-    //    ),
-    //    'alertmail'  => array(
-    //        'level'         => 'err',
-    //        'mailaddress'   => 'alert@ml.example.jp',
-    //    ),
-    //),
-    //'log_option'            => 'pid,function,pos',
-    //'log_filter_do'         => '',
-    //'log_filter_ignore'     => 'Undefined index.*%%.*tpl',
-
-    // memcache
-    // sample-1: single (or default) memcache
-    // 'memcache_host' => 'localhost',
-    // 'memcache_port' => 11211,
-    // 'memcache_use_connect' => false,
-    // 'memcache_retry' => 3,
-    // 'memcache_timeout' => 3,
-    //
-    // sample-2: multiple memcache servers (distributing w/ namespace and ids)
-    // 'memcache' => array(
-    //     'namespace1' => array(
-    //         0 => array(
-    //             'memcache_host' => 'cache1.example.com',
-    //             'memcache_port' => 11211,
-    //         ),
-    //         1 => array(
-    //             'memcache_host' => 'cache2.example.com',
-    //             'memcache_port' => 11211,
-    //         ),
-    //     ),
-    // ),
-
-    // csrf
-    // 'csrf' => 'Session',
-);
-?>
diff --git a/skel/skel.action.php b/skel/skel.action.php
deleted file mode 100644 (file)
index 2849f01..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php
-/**
- *  {$action_path}
- *
- *  @author     {$author}
- *  @package    {$project_id}
- *  @version    $Id$
- */
-
-/**
- *  {$action_name}¥Õ¥©¡¼¥à¤Î¼ÂÁõ
- *
- *  @author     {$author}
- *  @access     public
- *  @package    {$project_id}
- */
-class {$action_form} extends {$project_id}_ActionForm
-{
-    /** @var    bool    ¥Ð¥ê¥Ç¡¼¥¿¤Ë¥×¥é¥°¥¤¥ó¤ò»È¤¦¥Õ¥é¥° */
-    var $use_validator_plugin = true;
-
-    /**
-     *  @access private
-     *  @var    array   ¥Õ¥©¡¼¥àÃÍÄêµÁ
-     */
-    var $form = array(
-        /*
-        'sample' => array(
-            // ¥Õ¥©¡¼¥à¤ÎÄêµÁ
-            'type'          => VAR_TYPE_INT,    // ÆþÎÏÃÍ·¿
-            'form_type'     => FORM_TYPE_TEXT,  // ¥Õ¥©¡¼¥à·¿
-            'name'          => '¥µ¥ó¥×¥ë',      // É½¼¨Ì¾
-
-            // ¥Ð¥ê¥Ç¡¼¥¿(µ­½Ò½ç¤Ë¥Ð¥ê¥Ç¡¼¥¿¤¬¼Â¹Ô¤µ¤ì¤Þ¤¹)
-            'required'      => true,            // É¬¿Ü¥ª¥×¥·¥ç¥ó(true/false)
-            'min'           => null,            // ºÇ¾®ÃÍ
-            'max'           => null,            // ºÇÂçÃÍ
-            'regexp'        => null,            // Ê¸»ú¼ï»ØÄê(Àµµ¬É½¸½)
-
-            // ¥Õ¥£¥ë¥¿
-            'filter'        => null,            // ÆþÎÏÃÍÊÑ´¹¥Õ¥£¥ë¥¿¥ª¥×¥·¥ç¥ó
-        ),
-        */
-    );
-}
-
-/**
- *  {$action_name}¥¢¥¯¥·¥ç¥ó¤Î¼ÂÁõ
- *
- *  @author     {$author}
- *  @access     public
- *  @package    {$project_id}
- */
-class {$action_class} extends {$project_id}_ActionClass
-{
-    /**
-     *  {$action_name}¥¢¥¯¥·¥ç¥ó¤ÎÁ°½èÍý
-     *
-     *  @access public
-     *  @return string      Á«°Ü̾(Àµ¾ï½ªÎ»¤Ê¤énull, ½èÍý½ªÎ»¤Ê¤éfalse)
-     */
-    function prepare()
-    {
-        return null;
-    }
-
-    /**
-     *  {$action_name}¥¢¥¯¥·¥ç¥ó¤Î¼ÂÁõ
-     *
-     *  @access public
-     *  @return string  Á«°Ü̾
-     */
-    function perform()
-    {
-        return '{$action_name}';
-    }
-}
-?>
diff --git a/skel/skel.action_cli.php b/skel/skel.action_cli.php
deleted file mode 100644 (file)
index d12d014..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php
-/**
- *  {$action_path}
- *
- *  @author     {$author}
- *  @package    {$project_id}
- *  @version    $Id$
- */
-
-/**
- *  {$action_name}¥Õ¥©¡¼¥à¤Î¼ÂÁõ
- *
- *  @author     {$author}
- *  @access     public
- *  @package    {$project_id}
- */
-class {$action_form} extends {$project_id}_ActionForm
-{
-    /** @var    bool    ¥Ð¥ê¥Ç¡¼¥¿¤Ë¥×¥é¥°¥¤¥ó¤ò»È¤¦¥Õ¥é¥° */
-    var $use_validator_plugin = true;
-
-    /**
-     *  @access private
-     *  @var    array   ¥Õ¥©¡¼¥àÃÍÄêµÁ
-     */
-    var $form = array(
-        /*
-        'sample' => array(
-            // ¥Õ¥©¡¼¥à¤ÎÄêµÁ
-            'type'          => VAR_TYPE_INT,    // ÆþÎÏÃÍ·¿
-            'form_type'     => FORM_TYPE_TEXT,  // ¥Õ¥©¡¼¥à·¿
-            'name'          => '¥µ¥ó¥×¥ë',      // É½¼¨Ì¾
-
-            // ¥Ð¥ê¥Ç¡¼¥¿(µ­½Ò½ç¤Ë¥Ð¥ê¥Ç¡¼¥¿¤¬¼Â¹Ô¤µ¤ì¤Þ¤¹)
-            'required'      => true,            // É¬¿Ü¥ª¥×¥·¥ç¥ó(true/false)
-            'min'           => null,            // ºÇ¾®ÃÍ
-            'max'           => null,            // ºÇÂçÃÍ
-            'regexp'        => null,            // Ê¸»ú¼ï»ØÄê(Àµµ¬É½¸½)
-
-            // ¥Õ¥£¥ë¥¿
-            'filter'        => null,            // ÆþÎÏÃÍÊÑ´¹¥Õ¥£¥ë¥¿¥ª¥×¥·¥ç¥ó
-        ),
-        */
-    );
-}
-
-/**
- *  {$action_name}¥¢¥¯¥·¥ç¥ó¤Î¼ÂÁõ
- *
- *  @author     {$author}
- *  @access     public
- *  @package    {$project_id}
- */
-class {$action_class} extends {$project_id}_ActionClass
-{
-    /**
-     *  {$action_name}¥¢¥¯¥·¥ç¥ó¤ÎÁ°½èÍý
-     *
-     *  @access public
-     *  @return string      Á«°Ü̾(Àµ¾ï½ªÎ»¤Ê¤énull, ½èÍý½ªÎ»¤Ê¤éfalse)
-     */
-    function prepare()
-    {
-        return null;
-    }
-
-    /**
-     *  {$action_name}¥¢¥¯¥·¥ç¥ó¤Î¼ÂÁõ
-     *
-     *  @access public
-     *  @return string  Á«°Ü̾
-     */
-    function perform()
-    {
-        return null;
-    }
-}
-?>
diff --git a/skel/skel.action_test.php b/skel/skel.action_test.php
deleted file mode 100644 (file)
index 6a86bec..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-<?php
-/**
- *  {$action_path}
- *
- *  @author     {$author}
- *  @package    {$project_id}
- *  @version    $Id$
- */
-
-/**
- *  {$action_name}¥Õ¥©¡¼¥à¤Î¥Æ¥¹¥È¥±¡¼¥¹
- *
- *  @author     {$author}
- *  @access     public
- *  @package    {$project_id}
- */
-class {$action_form}_TestCase extends Ethna_UnitTestCase
-{
-    /**
-     *  @access private
-     *  @var    string  ¥¢¥¯¥·¥ç¥ó̾
-     */
-    var $action_name = '{$action_name}';
-
-    /**
-     *    ¥Æ¥¹¥È¤Î½é´ü²½
-     *
-     *    @access public
-     */
-    function setUp()
-    {
-        $this->createActionForm();  // ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¤ÎºîÀ®
-    }
-
-    /**
-     *    ¥Æ¥¹¥È¤Î¸å»ÏËö
-     *
-     *    @access public
-     */
-    function tearDown()
-    {
-    }
-
-    /**
-     *  {$action_name}¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¤Î¥µ¥ó¥×¥ë¥Æ¥¹¥È¥±¡¼¥¹
-     *
-     *  @access public
-     */
-    /*
-    function test_formSample()
-    {
-        // ¥Õ¥©¡¼¥à¤ÎÀßÄê
-        $this->af->set('id', 1);
-
-        // {$action_name}¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥àÃ͸¡¾Ú
-        $this->assertEqual($this->af->validate(), 0);
-    }
-    */
-}
-
-/**
- *  {$action_name}¥¢¥¯¥·¥ç¥ó¤Î¥Æ¥¹¥È¥±¡¼¥¹
- *
- *  @author     {$author}
- *  @access     public
- *  @package    {$project_id}
- */
-class {$action_class}_TestCase extends Ethna_UnitTestCase
-{
-    /**
-     *  @access private
-     *  @var    string  ¥¢¥¯¥·¥ç¥ó̾
-     */
-    var $action_name = '{$action_name}';
-
-    /**
-     *    ¥Æ¥¹¥È¤Î½é´ü²½
-     *
-     *    @access public
-     */
-    function setUp()
-    {
-        $this->createActionForm();  // ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¤ÎºîÀ®
-        $this->createActionClass(); // ¥¢¥¯¥·¥ç¥ó¥¯¥é¥¹¤ÎºîÀ®
-
-        $this->session->start();            // ¥»¥Ã¥·¥ç¥ó¤Î³«»Ï
-    }
-
-    /**
-     *    ¥Æ¥¹¥È¤Î¸å»ÏËö
-     *
-     *    @access public
-     */
-    function tearDown()
-    {
-        $this->session->destroy();      // ¥»¥Ã¥·¥ç¥ó¤ÎÇË´þ
-    }
-
-    /**
-     *  {$action_name}¥¢¥¯¥·¥ç¥ó¥¯¥é¥¹¤Î¥µ¥ó¥×¥ë¥Æ¥¹¥È¥±¡¼¥¹
-     *
-     *  @access public
-     */
-    /*
-    function test_actionSample()
-    {
-        // ¥Õ¥©¡¼¥à¤ÎÀßÄê
-        $this->af->set('id', 1);
-
-        // {$action_name}¥¢¥¯¥·¥ç¥ó¼Â¹ÔÁ°¤Îǧ¾Ú½èÍý
-        $forward_name = $this->ac->authenticate();
-        $this->assertNull($forward_name);
-
-        // {$action_name}¥¢¥¯¥·¥ç¥ó¤ÎÁ°½èÍý
-        $forward_name = $this->ac->prepare();
-        $this->assertNull($forward_name);
-
-        // {$action_name}¥¢¥¯¥·¥ç¥ó¤Î¼ÂÁõ
-        $forward_name = $this->ac->perform();
-        $this->assertEqual($forward_name, '{$action_name}');
-    }
-    */
-}
-?>
diff --git a/skel/skel.action_xmlrpc.php b/skel/skel.action_xmlrpc.php
deleted file mode 100644 (file)
index 2849f01..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php
-/**
- *  {$action_path}
- *
- *  @author     {$author}
- *  @package    {$project_id}
- *  @version    $Id$
- */
-
-/**
- *  {$action_name}¥Õ¥©¡¼¥à¤Î¼ÂÁõ
- *
- *  @author     {$author}
- *  @access     public
- *  @package    {$project_id}
- */
-class {$action_form} extends {$project_id}_ActionForm
-{
-    /** @var    bool    ¥Ð¥ê¥Ç¡¼¥¿¤Ë¥×¥é¥°¥¤¥ó¤ò»È¤¦¥Õ¥é¥° */
-    var $use_validator_plugin = true;
-
-    /**
-     *  @access private
-     *  @var    array   ¥Õ¥©¡¼¥àÃÍÄêµÁ
-     */
-    var $form = array(
-        /*
-        'sample' => array(
-            // ¥Õ¥©¡¼¥à¤ÎÄêµÁ
-            'type'          => VAR_TYPE_INT,    // ÆþÎÏÃÍ·¿
-            'form_type'     => FORM_TYPE_TEXT,  // ¥Õ¥©¡¼¥à·¿
-            'name'          => '¥µ¥ó¥×¥ë',      // É½¼¨Ì¾
-
-            // ¥Ð¥ê¥Ç¡¼¥¿(µ­½Ò½ç¤Ë¥Ð¥ê¥Ç¡¼¥¿¤¬¼Â¹Ô¤µ¤ì¤Þ¤¹)
-            'required'      => true,            // É¬¿Ü¥ª¥×¥·¥ç¥ó(true/false)
-            'min'           => null,            // ºÇ¾®ÃÍ
-            'max'           => null,            // ºÇÂçÃÍ
-            'regexp'        => null,            // Ê¸»ú¼ï»ØÄê(Àµµ¬É½¸½)
-
-            // ¥Õ¥£¥ë¥¿
-            'filter'        => null,            // ÆþÎÏÃÍÊÑ´¹¥Õ¥£¥ë¥¿¥ª¥×¥·¥ç¥ó
-        ),
-        */
-    );
-}
-
-/**
- *  {$action_name}¥¢¥¯¥·¥ç¥ó¤Î¼ÂÁõ
- *
- *  @author     {$author}
- *  @access     public
- *  @package    {$project_id}
- */
-class {$action_class} extends {$project_id}_ActionClass
-{
-    /**
-     *  {$action_name}¥¢¥¯¥·¥ç¥ó¤ÎÁ°½èÍý
-     *
-     *  @access public
-     *  @return string      Á«°Ü̾(Àµ¾ï½ªÎ»¤Ê¤énull, ½èÍý½ªÎ»¤Ê¤éfalse)
-     */
-    function prepare()
-    {
-        return null;
-    }
-
-    /**
-     *  {$action_name}¥¢¥¯¥·¥ç¥ó¤Î¼ÂÁõ
-     *
-     *  @access public
-     *  @return string  Á«°Ü̾
-     */
-    function perform()
-    {
-        return '{$action_name}';
-    }
-}
-?>
diff --git a/skel/skel.app_manager.php b/skel/skel.app_manager.php
deleted file mode 100644 (file)
index 8e09b77..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-/**
- *  {$app_path}
- *
- *  @author     {$author}
- *  @package    {$project_id}
- *  @version    $Id$
- */
-
-/**
- *  {$app_manager}Manager
- *
- *  @author     {$author}
- *  @access     public
- *  @package    {$project_id}
- */
-class {$app_manager}Manager extends Ethna_AppManager
-{
-}
-?>
diff --git a/skel/skel.app_object.php b/skel/skel.app_object.php
deleted file mode 100644 (file)
index e8dfe50..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-/**
- *  {$app_path}
- *
- *  @author     {$author}
- *  @package    {$project_id}
- *  @version    $Id$
- */
-
-/**
- *  {$app_object}Manager
- *
- *  @author     {$author}
- *  @access     public
- *  @package    {$project_id}
- */
-class {$app_object}Manager extends Ethna_AppManager
-{
-}
-
-/**
- *  {$app_object}
- *
- *  @author     {$author}
- *  @access     public
- *  @package    {$project_id}
- */
-class {$app_object} extends Ethna_AppObject
-{
-    /**
-     *  ¥×¥í¥Ñ¥Æ¥£¤Îɽ¼¨Ì¾¤ò¼èÆÀ¤¹¤ë
-     *
-     *  @access public
-     */
-    function getName($key)
-    {
-        return $this->get($key);
-    }
-}
-?>
diff --git a/skel/skel.entry_cli.php b/skel/skel.entry_cli.php
deleted file mode 100644 (file)
index 28a0f27..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-/**
- *  {$action_name}.php
- *
- *  @author     {$author}
- *  @package    {$project_id}
- *  @version    $Id$
- */
-chdir(dirname(__FILE__));
-require_once '{$dir_app}/{$project_id}_Controller.php';
-
-ini_set('max_execution_time', 0);
-
-{$project_id}_Controller::main_CLI('{$project_id}_Controller', '{$action_name}');
-?>
diff --git a/skel/skel.entry_www.php b/skel/skel.entry_www.php
deleted file mode 100644 (file)
index 3f09d72..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?php
-/**
- *  {$action_name}.php
- *
- *  @author     {$author}
- *  @package    {$project_id}
- *  @version    $Id$
- */
-require_once '{$dir_app}/{$project_id}_Controller.php';
-
-{$project_id}_Controller::main('{$project_id}_Controller', '{$action_name}');
-?>
diff --git a/skel/skel.template.tpl b/skel/skel.template.tpl
deleted file mode 100644 (file)
index 5a3663b..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-    <head>
-        <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP">
-    </head>
-    <body>
-        <h1>{$project_id}</h1>
-    </body>
-</html>
diff --git a/skel/skel.view.php b/skel/skel.view.php
deleted file mode 100644 (file)
index f5e7b46..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-/**
- *  {$view_path}
- *
- *  @author     {$author}
- *  @package    {$project_id}
- *  @version    $Id$
- */
-
-/**
- *  {$forward_name}¥Ó¥å¡¼¤Î¼ÂÁõ
- *
- *  @author     {$author}
- *  @access     public
- *  @package    {$project_id}
- */
-class {$view_class} extends {$project_id}_ViewClass
-{
-    /**
-     *  Á«°ÜÁ°½èÍý
-     *
-     *  @access public
-     */
-    function preforward()
-    {
-    }
-}
-?>
diff --git a/skel/skel.view_test.php b/skel/skel.view_test.php
deleted file mode 100644 (file)
index 7f97d15..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-<?php
-/**
- *  {$view_path}
- *
- *  @author     {$author}
- *  @package    {$project_id}
- *  @version    $Id$
- */
-
-/**
- *  {$forward_name}¥Ó¥å¡¼¤Î¼ÂÁõ
- *
- *  @author     {$author}
- *  @access     public
- *  @package    {$project_id}
- */
-class {$view_class}_TestCase extends Ethna_UnitTestCase
-{
-    /**
-     *  @access private
-     *  @var    string  ¥Ó¥å¡¼Ì¾
-     */
-    var $forward_name = '{$forward_name}';
-
-    /**
-     *    ¥Æ¥¹¥È¤Î½é´ü²½
-     *
-     *    @access public
-     */
-    function setUp()
-    {
-        $this->createPlainActionForm(); // ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¤ÎºîÀ®
-        $this->createViewClass();       // ¥Ó¥å¡¼¤ÎºîÀ®
-    }
-
-    /**
-     *    ¥Æ¥¹¥È¤Î¸å»ÏËö
-     *
-     *    @access public
-     */
-    function tearDown()
-    {
-    }
-
-    /**
-     *  {$forward_name}Á«°ÜÁ°½èÍý¤Î¥µ¥ó¥×¥ë¥Æ¥¹¥È¥±¡¼¥¹
-     *
-     *  @access public
-     */
-    /*
-    function test_viewSample()
-    {
-        // ¥Õ¥©¡¼¥à¤ÎÀßÄê
-        $this->af->set('id', 1);
-
-        // {$forward_name}Á«°ÜÁ°½èÍý
-        $this->vc->preforward();
-        $this->assertNull($this->af->get('data'));
-    }
-    */
-}
-?>
diff --git a/skel/template.index.tpl b/skel/template.index.tpl
deleted file mode 100644 (file)
index 4165af0..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=EUC-JP" />
-<link rel="stylesheet" href="{$config.url}css/ethna.css" type="text/css" />
-</head>
-<body>
-
-<div id="header">
-    <h1>{$project_id}</h1>
-</div>
-
-<div id="main">
-    <h2>Index Page</h2>
-    <p>hello, world!</p>
-</div>
-
-<div id="footer">
-    Powered By <a href="http://ethna.jp">Ethna</a>-{$smarty.const.ETHNA_VERSION}.
-</div>
-
-</body>
-</html>
diff --git a/skel/www.css.ethna.css b/skel/www.css.ethna.css
deleted file mode 100644 (file)
index b0694a1..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-body {
-    background: url("http://ethna.jp/image/pagebg.gif");
-    font-family: Arial,Verdana,Helvetica,'MS UI Gothic',sans-serif;
-    margin-left: 40px;
-    margin-right: 40px;
-}
-
-div#header {
-    margin-top: 40px;
-    margin-bottom: 1em;
-    padding: 0px 20px;
-    height: 40px;
-    background: url("http://ethna.jp/image/navbg.gif") repeat-x;
-}
-
-div#header h1 {
-    font-weight: bold;
-    background: url("http://ethna.jp/image/navlogo.gif") right no-repeat;
-}
-
-div#footer {
-    margin-bottom: 1em;
-    padding: 5px 20px;
-    background-color: #cee6e6;
-    text-align: right;
-}
-
-div#footer a {
-    color: #f35a21;
-}
-
-div#main {
-    margin-bottom: 1em;
-    padding: 10px 20px;
-    border: 1px solid #cee6e6;
-    background-color: #ffffff;
-}
-
-div#main h2 {
-    color: #00cccc;
-    border: 1px solid #cee6e6;
-    border-width: 0 0 1px 0;
-}
-
-div#main a:link {
-    color: #f35a21;
-}
-
-div#main a:visited {
-    color: #f29578;
-}
-
-span.ethna-error {
-    color: #ff0000;
-}
diff --git a/skel/www.index.php b/skel/www.index.php
deleted file mode 100644 (file)
index c968fd1..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<?php
-require_once '{$basedir}/app/{$project_id}_Controller.php';
-
-{$project_id}_Controller::main('{$project_id}_Controller', 'index');
-?>
diff --git a/skel/www.info.php b/skel/www.info.php
deleted file mode 100644 (file)
index 57e5f1c..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?php
-require_once '{$basedir}/app/{$project_id}_Controller.php';
-
-{$project_id}_Controller::main('{$project_id}_Controller', array(
-    '__ethna_info__',
-    )
-);
-?>
diff --git a/skel/www.unittest.php b/skel/www.unittest.php
deleted file mode 100644 (file)
index a401a64..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?php
-error_reporting(E_ALL);
-require_once '{$basedir}/app/{$project_id}_Controller.php';
-
-{$project_id}_Controller::main('{$project_id}_Controller', array(
-    '__ethna_unittest__',
-    )
-);
-?>
diff --git a/skel/www.xmlrpc.php b/skel/www.xmlrpc.php
deleted file mode 100644 (file)
index 9e431fb..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<?php
-require_once '{$basedir}/app/{$project_id}_Controller.php';
-
-{$project_id}_Controller::main_XMLRPC('{$project_id}_Controller');
-?>
diff --git a/test/Ethna_ActionError_Test.php b/test/Ethna_ActionError_Test.php
deleted file mode 100644 (file)
index 230a0d6..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-<?php
-/**
- *  Ethna_ActionError_Test.php
- *
- *  @author     Yoshinari Takaoka <takaoka@beatcraft.com>
- *  @version    $Id$
- */
-
-//{{{    Ethna_ActionError_Test
-/**
- *  Test Case For Ethna_ActionError
- *
- *  @access public
- */
-class Ethna_ActionError_Test extends Ethna_UnitTestBase
-{
-    var $ae;
-    var $error_obj;
-    var $error_form_name;
-    var $error_form_name1;
-    var $message;
-    var $message1;
-
-    function setUp()
-    {
-        $this->ae = new Ethna_ActionError();
-        $this->error_form_name = "hoge";
-        $this->message = "test error";    
-        $this->error_form_name1 = "tititi";
-        $this->message1 = "test error1";    
-
-        $this->error_obj = new Ethna_Error(
-                               $this->message1,
-                               E_NOTICE,
-                               E_GENERAL
-                           );
-
-        //    add dummy error object.
-        $this->ae->add($this->error_form_name,
-                       $this->message,
-                       E_GENERAL
-        );
-        $this->ae->addObject($this->error_form_name1,
-                             $this->error_obj
-        );
-    }
-
-    function test_count()
-    {
-        $this->assertEqual($this->ae->count(), 2);
-    }
-
-    function test_length()
-    {
-        $this->assertEqual($this->ae->length(), 2);
-    }
-
-    function test_iserror()
-    {
-        $this->assertTrue(
-            $this->ae->isError($this->error_form_name)
-        );
-        $this->assertTrue(
-            $this->ae->isError($this->error_form_name1)
-        );
-    }
-
-    function test_geterrorlist()
-    {
-        $this->assertTrue(
-            is_array($this->ae->getErrorList())
-        );
-    }
-
-    function test_getmessage()
-    {
-        $error_msg = $this->ae->getMessage(
-                         $this->error_form_name
-                     );
-        $error_msg1 = $this->ae->getMessage(
-                         $this->error_form_name1
-                     );
-
-        $this->assertEqual($this->message, $error_msg); 
-        $this->assertEqual($this->message1, $error_msg1); 
-    }
-
-    function test_remove()
-    {
-        $this->ae->remove($this->error_form_name);
-        
-        $this->assertTrue($this->ae->count() == 1);
-        $this->assertFalse(
-            $this->ae->isError($this->error_form_name)
-        );
-
-        $error_msg = $this->ae->getMessage(
-                         $this->error_form_name
-                     );
-        $this->assertTrue($error_msg == NULL);
-    }
-
-    function test_clear()
-    {
-        $this->ae->clear();
-        $this->assertTrue(
-            $this->ae->count() == 0
-        );
-    }
-
-}
-
-?>
diff --git a/test/Ethna_ActionForm_Test.php b/test/Ethna_ActionForm_Test.php
deleted file mode 100644 (file)
index c7daec2..0000000
+++ /dev/null
@@ -1,1083 +0,0 @@
-<?php
-// vim: foldmethod=marker
-/**
- *  Ethna_ActionForm_Test.php
- *
- *  @author     Yoshinari Takaoka <takaoka@beatcraft.com>
- *  @version    $Id$
- */
-
-// {{{ Test ActionForm Classes
-// {{{ Test_ActionForm_Integer
-/**
- *  integer type value Test ActionForm
- *
- *  @access private
- */
-class Test_ActionForm_Integer extends Ethna_ActionForm
-{
-    var $form = array(
-        
-        //
-        //   integer type.
-        //
-
-        //   integer type error
-        'integer_type_error_input' => array(
-            'required' => false,
-            'type' => VAR_TYPE_INT,
-         ),
-        //   required input
-        'integer_required_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_INT,
-         ),
-    
-        //   minimun input
-        'integer_min_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_INT,
-            'min' => 100,
-         ),
-
-         //  maximum input
-         'integer_max_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_INT,
-            'max' => 100,
-         ),
-         //  regexp input
-         'integer_regexp_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_INT,
-            'regexp' => '/^\d+$/',
-         ),
-
-    ); 
-}
-// }}}
-
-// {{{ Test_ActionForm_WithPlugin_Integer
-/**
- *  integer type value Test ActionForm
- *  with use_validator_plugin flag is on.
- *
- *  @access private
- */
-class Test_ActionForm_WithPlugin_Integer extends Test_ActionForm_Integer
-{
-    var $use_validator_plugin = true;
-}
-// }}}
-
-// {{{ Test_ActionForm_Float
-/**
- *  float value type Test ActionForm
- *
- *  @access private
- */
-class Test_ActionForm_Float extends Ethna_ActionForm
-{
-    var $form = array(
-        
-        //
-        //   float type.
-        //
-
-        //   float type error
-        'float_type_error_input' => array(
-            'required' => false,
-            'type' => VAR_TYPE_FLOAT,
-         ),
-        //   required input
-        'float_required_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_FLOAT,
-         ),
-    
-        //   minimun input
-        'float_min_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_FLOAT,
-            'min' => 100.1,
-         ),
-
-         //  maximum input
-         'float_max_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_FLOAT,
-            'max' => 100.1,
-         ),
-         //  regexp input
-         'float_regexp_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_FLOAT,
-            'regexp' => '/^\d+\.\d+$/',
-         ),
-
-    ); 
-}
-// }}}
-
-// {{{ Test_ActionForm_WithPlugin_Float
-/**
- *  float type filling default value Test ActionForm
- *  with use_validator_plugin flag is on.
- *
- *  @access private
- */
-class Test_ActionForm_WithPlugin_Float extends Test_ActionForm_Float
-{
-    var $use_validator_plugin = true;
-}
-// }}}
-
-// {{{ Test_ActionForm_String
-/**
- *  string value type Test ActionForm
- *
- *  @access private
- */
-class Test_ActionForm_String extends Ethna_ActionForm
-{
-    var $form = array(
-        
-        //
-        //   string type.
-        //
-
-        //   required input
-        'string_required_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_STRING,
-         ),
-    
-        //   minimun input(ascii)
-        'string_min_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_STRING,
-            'min' => 5,
-         ),
-
-         //  maximum input(ascii)
-         'string_max_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_STRING,
-            'max' => 5,
-         ),
-
-         //  regexp input
-         'string_regexp_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_STRING,
-            'regexp' => '/^b+$/',
-         ),
-         
-         //  minimum input(multibyte)
-        'string_min_input_multi' => array(
-            'required' => true,
-            'type' => VAR_TYPE_STRING,
-            'min' => 5,
-         ),
-
-         //  maximum input(multibyte)
-          'string_max_input_multi' => array(
-            'required' => true,
-            'type' => VAR_TYPE_STRING,
-            'max' => 5,
-         ),
-
-         //  regexp input(mutlibyte)
-         'string_regexp_input_multi' => array(
-            'required' => true,
-            'type' => VAR_TYPE_STRING,
-            'mbregexp' => '/^う+$/',
-            'mbregexp_encoding' => 'UTF-8',
-         ),
-    ); 
-}
-// }}}
-
-// {{{ Test_ActionForm_WithPlugin_String
-/**
- *  string type value Test ActionForm
- *  with use_validator_plugin flag is on.
- *
- *  @access private
- */
-class Test_ActionForm_WithPlugin_String extends Test_ActionForm_String
-{
-    var $use_validator_plugin = true;
-}
-// }}}
-
-// {{{ Test_ActionForm_Datetime
-/**
- *  datetime value type Test ActionForm
- *
- *  @access private
- */
-class Test_ActionForm_Datetime extends Ethna_ActionForm
-{
-    var $form = array(
-        
-        //
-        //   datetime type.
-        //
-
-        //   required input
-        'datetime_required_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_DATETIME,
-         ),
-    
-        //   minimun input
-        'datetime_min_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_DATETIME,
-            'min' => '2010-10-01',
-         ),
-
-         //  maximum input
-         'datetime_max_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_DATETIME,
-            'max' => '2000-01-05',
-         ),
-         //  regexp input
-         'datetime_regexp_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_DATETIME,
-            'regexp' => '/^\d{4}-\d{2}-\d{2}$/',
-         ),
-    ); 
-}
-// }}}
-
-// {{{ Test_ActionForm_Boolean
-/**
- *  boolean value type Test ActionForm
- *
- *  @access private
- */
-class Test_ActionForm_Boolean extends Ethna_ActionForm
-{
-    var $form = array(
-        
-        //
-        //   boolean type.
-        //
-
-        //   required input
-        'boolean_required_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_BOOLEAN,
-         ),
-    ); 
-}
-// }}}
-
-// {{{ Test_ActionForm_WithPlugin_Boolean
-/**
- *  boolean type filling default value Test ActionForm
- *  with use_validator_plugin flag is on.
- *
- *  @access private
- */
-class Test_ActionForm_WithPlugin_Boolean extends Test_ActionForm_Boolean
-{
-    var $use_validator_plugin = true;
-}
-// }}}
-
-// {{{ Test_ActionForm_WithPlugin_Datetime
-/**
- *  datetime type Test ActionForm
- *  with use_validator_plugin flag is on.
- *
- *  @access private
- */
-class Test_ActionForm_WithPlugin_Datetime extends Test_ActionForm_Datetime
-{
-    var $use_validator_plugin = true;
-}
-// }}}
-
-// {{{ Test_ActionForm_File
-/**
- *  file value type Test ActionForm
- *
- *  @access private
- */
-class Test_ActionForm_File extends Ethna_ActionForm
-{
-    var $form = array(
-         //
-         //  file input
-         //
-         'file_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_FILE,
-         ),
-    );
-
-}
-// }}}
-
-// {{{ Test_ActionForm_WithPlugin_File
-/**
- *  Test ActionForm
- *  with use_validator_plugin flag is on.
- *
- *  @access private
- */
-class Test_ActionForm_WithPlugin_File extends Test_ActionForm_File
-{
-    var $use_validator_plugin = true;
-}
-// }}}
-// }}}
-
-// {{{ Test Default ActionForm Classes
-// {{{ Test_Default_ActionForm_Integer
-/**
- *  integer type filling default value Test ActionForm
- *
- *  @access private
- */
-class Test_Default_ActionForm_Integer extends Ethna_ActionForm
-{
-    var $form = array(
-        
-        //
-        //   integer type.
-        //
-
-        //   integer type error
-        'integer_type_error_input' => array(
-            'required' => false,
-            'type' => VAR_TYPE_INT,
-            'default' => 99,
-         ),
-        //   required input
-        'integer_required_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_INT,
-            'default' => 100,
-         ),
-    
-        //   minimun input
-        'integer_min_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_INT,
-            'min' => 100,
-            'default' => 101,
-         ),
-
-         //  maximum input
-         'integer_max_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_INT,
-            'max' => 100,
-            'default' => 102,
-         ),
-         //  regexp input
-         'integer_regexp_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_INT,
-            'regexp' => '/^\d+$/',
-            'default' => 103,
-         ),
-
-    ); 
-}
-// }}}
-
-// {{{ Test_Default_ActionForm_WithPlugin_Integer
-/**
- *  integer type filling default value Test ActionForm
- *  with use_validator_plugin flag is on.
- *
- *  @access private
- */
-class Test_Default_ActionForm_WithPlugin_Integer extends Test_Default_ActionForm_Integer
-{
-    var $use_validator_plugin = true;
-}
-// }}}
-
-// {{{ Test_Default_ActionForm_Float
-/**
- *  default float value type Test ActionForm
- *
- *  @access private
- */
-class Test_Default_ActionForm_Float extends Ethna_ActionForm
-{
-    var $form = array(
-        
-        //
-        //   float type.
-        //
-
-        //   float type error
-        'float_type_error_input' => array(
-            'required' => false,
-            'type' => VAR_TYPE_FLOAT,
-            'default' => 99.1,
-         ),
-        //   required input
-        'float_required_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_FLOAT,
-            'default' => 100.1,
-         ),
-    
-        //   minimun input
-        'float_min_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_FLOAT,
-            'min' => 100.1,
-            'default' => 101.1,
-         ),
-
-         //  maximum input
-         'float_max_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_FLOAT,
-            'max' => 100.1,
-            'default' => 102.1,
-         ),
-         //  regexp input
-         'float_regexp_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_FLOAT,
-            'regexp' => '/^\d+\.\d+$/',
-            'default' => 103.1,
-         ),
-
-    ); 
-}
-// }}}
-
-// {{{ Test_Default_ActionForm_WithPlugin_Float
-/**
- *  float type filling default value Test ActionForm
- *  with use_validator_plugin flag is on.
- *
- *  @access private
- */
-class Test_Default_ActionForm_WithPlugin_Float extends Test_Default_ActionForm_Float
-{
-    var $use_validator_plugin = true;
-}
-// }}}
-
-// {{{ Test_Default_ActionForm_String
-/**
- *  default string value type Test ActionForm
- *
- *  @access private
- */
-class Test_Default_ActionForm_String extends Ethna_ActionForm
-{
-    var $form = array(
-        
-        //
-        //   string type.
-        //
-
-        //   required input
-        'string_required_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_STRING,
-            'default' => 'a',
-         ),
-    
-        //   minimun input
-        'string_min_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_STRING,
-            'min' => 5,
-            'default' => 'b',
-         ),
-
-         //  maximum input
-         'string_max_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_STRING,
-            'max' => 5,
-            'default' => 'c',
-         ),
-         //  regexp input
-         'string_regexp_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_STRING,
-            'regexp' => '/^b+$/',
-            'default' => 'd',
-         ),
-    ); 
-}
-// }}}
-
-// {{{ Test_Default_ActionForm_WithPlugin_String
-/**
- *  string type filling default value Test ActionForm
- *  with use_validator_plugin flag is on.
- *
- *  @access private
- */
-class Test_Default_ActionForm_WithPlugin_String extends Test_Default_ActionForm_String
-{
-    var $use_validator_plugin = true;
-}
-// }}}
-
-// {{{ Test_Default_ActionForm_Datetime
-/**
- *  default datetime value type Test ActionForm
- *
- *  @access private
- */
-class Test_Default_ActionForm_Datetime extends Ethna_ActionForm
-{
-    var $form = array(
-        
-        //
-        //   datetime type.
-        //
-
-        //   required input
-        'datetime_required_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_DATETIME,
-            'default' => '2000-01-01',
-         ),
-    
-        //   minimun input
-        'datetime_min_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_DATETIME,
-            'min' => '2010-10-01',
-            'default' => '2000-01-02',
-         ),
-
-         //  maximum input
-         'datetime_max_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_DATETIME,
-            'max' => '2000-01-05',
-            'default' => '2000-01-03',
-         ),
-         //  regexp input
-         'datetime_regexp_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_DATETIME,
-            'regexp' => '/^\d{4}-\d{2}-\d{2}$/',
-            'default' => '2000-01-04',
-         ),
-    ); 
-}
-// }}}
-
-// {{{ Test_Default_ActionForm_Boolean
-/**
- *  default boolean value type Test ActionForm
- *
- *  @access private
- */
-class Test_Default_ActionForm_Boolean extends Ethna_ActionForm
-{
-    var $form = array(
-        
-        //
-        //   boolean type.
-        //
-
-        //   required input
-        'boolean_required_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_BOOLEAN,
-            'default' => true,
-         ),
-    ); 
-}
-// }}}
-
-// {{{ Test_Default_ActionForm_WithPlugin_Boolean
-/**
- *  boolean type filling default value Test ActionForm
- *  with use_validator_plugin flag is on.
- *
- *  @access private
- */
-class Test_Default_ActionForm_WithPlugin_Boolean extends Test_Default_ActionForm_Boolean
-{
-    var $use_validator_plugin = true;
-}
-// }}}
-
-
-// {{{ Test_Default_ActionForm_WithPlugin_Datetime
-/**
- *  datetime type filling default value Test ActionForm
- *  with use_validator_plugin flag is on.
- *
- *  @access private
- */
-class Test_Default_ActionForm_WithPlugin_Datetime extends Test_Default_ActionForm_Datetime
-{
-    var $use_validator_plugin = true;
-}
-// }}}
-
-
-// {{{ Test_Default_ActionForm_File
-/**
- *  default file value type Test ActionForm
- *
- *  @access private
- */
-class Test_Default_ActionForm_File extends Ethna_ActionForm
-{
-    var $form = array(
-         //
-         //  file input
-         //  this must be ignored!
-         //
-         'file_input' => array(
-            'required' => true,
-            'type' => VAR_TYPE_FILE,
-            'default' => 'hoge',   //   this must be ignored.  
-         ),
-    );
-
-}
-// }}}
-
-// {{{ Test_Default_ActionForm_WithPlugin_File
-/**
- *  float type filling default value Test ActionForm
- *  with use_validator_plugin flag is on.
- *
- *  @access private
- */
-class Test_Default_ActionForm_WithPlugin_File extends Test_Default_ActionForm_Float
-{
-    var $use_validator_plugin = true;
-}
-// }}}
-// }}}
-
-// {{{    Ethna_ActionForm_Test
-/**
- *  Test Case For Ethna_ActionForm
- *
- *  @access public
- */
-class Ethna_ActionForm_Test extends Ethna_UnitTestBase
-{
-    var $ctl;
-
-    // {{{ setUp, tearDown
-    function setUp()
-    {
-        //    dummy AUTO GLOBAL VALUE
-        $_SERVER['REQUEST_METHOD'] = 'POST';
-
-        //    initialize controller and clear error.
-        $this->ctl =& Ethna_Controller::getInstance();
-        $ae =& $this->ctl->getActionError();
-        $ae->clear();
-    }
-
-    function tearDown()
-    {
-        unset($_SERVER['REQUEST_METHOD']);
-        unset($this->ctl);
-    }
-    // }}}
-
-    // {{{    test_Validate_Integer
-    function test_Validate_Integer()
-    {
-        //    normal test value
-        $normal_input = array(
-                        'integer_required_input' => 100,
-                        'integer_min_input' => 1000,
-                        'integer_max_input' => 10,
-                        'integer_regexp_input' => 50000,
-                      );
-
-        $this->_run('integer', $normal_input);
-
-        //    error test value
-        $error_input = array(
-                        'integer_type_error_input' => 'aaaa',
-                        'integer_required_input' => null,
-                        'integer_min_input' => -10000,
-                        'integer_max_input' => 10000,
-                        'integer_regexp_input' => 'aaa',
-                    );
-
-        $this->_run('integer', $error_input, true);
-    }
-    // }}}
-
-    // {{{    test_Validate_Float
-    function test_Validate_Float()
-    {
-        //    normal test value
-        $normal_input = array(
-                        'float_required_input' => 10.1,
-                        'float_min_input' => 10000.1,
-                        'float_max_input' => 10.1,
-                        'float_regexp_input' => 50.1,
-                      );
-
-        $this->_run('float', $normal_input);
-
-        //    error test value
-        $error_input = array(
-                        'float_type_error_input' => 'aaaa',
-                        'float_required_input' => null,
-                        'float_min_input' => -10000,
-                        'float_max_input' => 10000,
-                        'float_regexp_input' => 'aaa',
-                    );
-        $this->_run('float', $error_input, true);
-    }
-    // }}}
-
-    // {{{    test_Validate_String
-    function test_Validate_String()
-    {
-        //    normal test value
-        $normal_input = array(
-                        'string_required_input' => 'aaaa',
-                        'string_min_input' => 'aaaaaaa',
-                        'string_max_input' => 'bbb',
-                        'string_min_input_multi' => 'ああああああ',
-                        'string_max_input_multi' => 'あああ',
-                        'string_regexp_input' => 'bbb',
-                        'string_regexp_input_multi' => 'ううう',
-                    );
-        $this->_run('string', $normal_input, false);
-
-        //    error test value
-        $error_input = array(
-                        'string_required_input' => null,
-                        'string_min_input' => 'a',
-                        'string_max_input' => 'bbbbbbbbbbbbbb',
-                        'string_min_input_multi' => 'あ',
-                        'string_max_input_multi' => 'ああああああああああああ',
-                        'string_regexp_input' => 'aaa',
-                        'string_regexp_input_multi' => 'ええええ',
-                    );
-        $this->_run('string', $error_input, true);
-    }
-    // }}}
-
-    // {{{    test_Validate_DateTime
-    function test_Validate_Datetime()
-    {
-        $normal_input = array(
-                        'datetime_required_input' => '2007-04-01',
-                        'datetime_min_input' => '2030-01-01',
-                        'datetime_max_input' => '1999-01-01',
-                        'datetime_regexp_input' => '2007-11-30',
-                    );
-
-        $this->_run('datetime', $normal_input);
-
-        //    error test value
-        $error_input = array(
-                        'datetime_required_input' => null,
-                        'datetime_min_input' => '2007-01-01',
-                        'datetime_max_input' => '2007-01-01',
-                        'datetime_regexp_input' => '2007a-11-ga',
-                    );
-
-        $this->_run('datetime', $error_input, true);
-    }
-    // }}}
-
-    // {{{    test_Validate_Boolean
-    function test_Validate_Boolean()
-    {
-        $normal_input = array(
-                        'boolean_required_input' => true,
-                    );
-
-        $this->_run('boolean', $normal_input);
-
-        //    error test value
-        $error_input = array(
-                        'boolean_required_input' => null,
-                    );
-
-        $this->_run('boolean', $error_input, true);
-    }
-    // }}}
-
-    // {{{    test_Validate_Integer_Default
-    function test_Validate_Integer_Default()
-    {
-        //    test value
-        $input = array(
-                        'integer_type_error_input' => 'aaaa',
-                        'integer_required_input' => null,
-                        'integer_min_input' => -10000,
-                        'integer_max_input' => 10000,
-                        'integer_regexp_input' => 'aaa',
-                    );
-        $expected = array(
-                        'integer_type_error_input' => 99,
-                        'integer_required_input' => 100,
-                        'integer_min_input' => 101,
-                        'integer_max_input' => 102,
-                        'integer_regexp_input' => 103,
-                    );
-
-        $this->_run_default_value_test('integer', $input, $expected);
-    }
-    // }}}
-
-    // {{{    test_Validate_Float_Default
-    function test_Validate_Float_Default()
-    {
-        //    test value
-        $input = array(
-                        'float_type_error_input' => 'aaaa',
-                        'float_required_input' => null,
-                        'float_min_input' => -10000,
-                        'float_max_input' => 10000,
-                        'float_regexp_input' => 'aaa',
-                    );
-        $expected = array(
-                        'float_type_error_input' => 99.1,
-                        'float_required_input' => 100.1,
-                        'float_min_input' => 101.1,
-                        'float_max_input' => 102.1,
-                        'float_regexp_input' => 103.1,
-                    );
-
-        $this->_run_default_value_test('float', $input, $expected);
-    }
-    // }}}
-
-    // {{{    test_Validate_String_Default
-    function test_Validate_String_Default()
-    {
-        //    test value
-        $input = array(
-                        'string_required_input' => null,
-                        'string_min_input' => 'a',
-                        'string_max_input' => 'bbbbbbbbbbbbbb',
-                        'string_regexp_input' => 'aaa',
-                    );
-        $expected = array(
-                        'string_required_input' => 'a',
-                        'string_min_input' => 'b',
-                        'string_max_input' => 'c',
-                        'string_regexp_input' => 'd',
-                    );
-
-        $this->_run_default_value_test('string', $input, $expected);
-    }
-    // }}}
-
-    // {{{    test_Validate_DateTime_Default
-    function test_Validate_Datetime_Default()
-    {
-        //    test value
-        $input = array(
-                        'datetime_required_input' => null,
-                        'datetime_min_input' => '2007-01-01',
-                        'datetime_max_input' => '2007-01-01',
-                        'datetime_regexp_input' => '2007a-11-ga',
-                    );
-        $expected = array(
-                        'datetime_required_input' => '2000-01-01',
-                        'datetime_min_input' => '2000-01-02',
-                        'datetime_max_input' => '2000-01-03',
-                        'datetime_regexp_input' => '2000-01-04',
-                    );
-
-
-        $this->_run_default_value_test('datetime', $input, $expected);
-    }
-    // }}}
-
-    // {{{    test_Validate_Boolean_Default
-    function test_Validate_Boolean_Default()
-    {
-        //    test value
-        $input = array(
-                        'boolean_required_input' => null,
-                    );
-        $expected = array(
-                        'boolean_required_input' => true,
-                    );
-
-        $this->_run_default_value_test('boolean', $input, $expected);
-    }
-    // }}}
-
-    // {{{ private utility functions
-    function _run($type_name, $input, $test_error = false)
-    {
-        //    test with no plugin 
-        $this->_setInputValue($input);
-        $af = $this->_get_validated_af_normal($type_name);
-        $ae = $this->_get_action_error();
-
-        //    finally assert!
-        $this->_assert($input, $ae, $test_error);
-
-        //    test with plugin 
-        $af = $this->_get_validated_af_normal($type_name, true);
-        $ae = $this->_get_action_error();
-
-        //    finally assert!(with plugin)
-        $this->_assert($input, $ae, $test_error);
-
-        //    unset input value
-        $this-> _unsetInputValue($input);
-    }
-
-    function _run_default_value_test($type_name, $input, $expected)
-    {
-        //    test with no plugin 
-        $this->_setInputValue($expected);
-        $af = $this->_get_validated_af_default($type_name);
-        $ae = $this->_get_action_error();
-
-        //    finally assert!
-        $this->_assert_default($expected, $af, $ae);
-
-        //    test with plugin 
-        $af = $this->_get_validated_af_default($type_name, true);
-        $ae = $this->_get_action_error();
-
-        //    finally assert!(with plugin)
-        $this->_assert_default($expected, $af, $ae);
-
-        //    unset input value
-        $this-> _unsetInputValue($expected);
-    }
-
-    function _setInputValue($input)
-    {
-        foreach ($input as $key => $value) {
-            $_POST[$key] = $value;
-        }
-    }
-
-    function _unsetInputValue($input)
-    {
-        foreach ($input as $key => $value) {
-            unset($_POST[$key]);
-        }
-    }
-
-    function _get_validated_af_normal($type_name, $is_plugin = false)
-    {
-         $class_name_prefix = ($is_plugin)
-                           ? 'Test_ActionForm_WithPlugin_'
-                           : 'Test_ActionForm_';
-         $class_name = $class_name_prefix . ucfirst($type_name);
-         return $this->_get_validated_af_real($class_name, $is_plugin);
-    }
-
-    function _get_validated_af_default($type_name, $is_plugin = false)
-    {
-        $class_name_prefix = ($is_plugin)
-                           ? 'Test_Default_ActionForm_WithPlugin_'
-                           : 'Test_Default_ActionForm_';
-        $class_name = $class_name_prefix . ucfirst($type_name);
-
-        return $this->_get_validated_af_real($class_name, $is_plugin);
-   }
-
-    function _get_validated_af_real($class_name, $is_plugin = false)
-    {
-        $dummy_af = new $class_name($this->ctl);
-        $dummy_af->setFormVars();
-
-        //
-        //    run validate
-        //    we ignore return value, because it includes
-        //    input value error in other test case ...
-        //
-        $dummy_af->validate();
-        return $dummy_af;
-    }
-    
-    function _get_action_error()
-    {
-        $ae  =& $this->ctl->getActionError();
-        return $ae;
-    }
-
-    function _assert($input, $ae, $test_error = false)
-    {
-        
-        foreach($input as $key => $value)
-        {
-            $result = true;
-            if ($test_error) {
-                $result = $this->assertTrue($ae->isError($key));
-            } else {
-                $result = $this->assertFalse($ae->isError($key));
-            }
-
-            if (!$result) {
-                $this->dump("Input Key: $key "
-                          . "Input : $value "
-                          . "error_test: " . var_export($test_error, true)
-                );
-            }
-        } 
-    }
-
-    function _assert_default($expected, $af, $ae)
-    {
-        foreach($expected as $key => $value)
-        {
-            //    error must not exists
-            //    in case of filling default value.
-            $this->assertEqual($af->get($key), $value);
-
-            //    we must get default value.
-            $this->assertFalse($ae->isError($key));
-        } 
-    }
-    // }}}
-}
-// }}}
-
-?>
diff --git a/test/Ethna_Config_Test.php b/test/Ethna_Config_Test.php
deleted file mode 100644 (file)
index 1da8471..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-/**
- *  Ethna_Config_Test.php
- */
-
-/**
- *  Ethna_Config¥¯¥é¥¹¤Î¥Æ¥¹¥È¥±¡¼¥¹
- *
- *  @access public
- */
-class Ethna_Config_Test extends Ethna_UnitTestBase
-{
-    function setUp()
-    {
-        // etc¥Ç¥£¥ì¥¯¥È¥ê¤ò¾å½ñ¤­
-        $this->ctl->directory['etc'] = dirname(__FILE__);
-        $this->config = $this->ctl->getConfig();
-        $this->filename = dirname(__FILE__) . '/ethna-ini.php';
-    }
-
-    function tearDown()
-    {
-        if (file_exists($this->filename)) {
-            unlink($this->filename);
-        }
-    }
-
-    function test_getConfigFile()
-    {
-        $result = $this->config->_getConfigFile(); 
-        $this->assertEqual($result, $this->filename);
-    }
-
-    function test_update()
-    {
-        // ¤³¤Î»þÅÀ¤Ç¤Ï¤Þ¤À ethna-ini.php ¤Ï¸ºß¤·¤Ê¤¤
-        $result = $this->config->get('foo');
-        $this->assertEqual($result, null);
-
-        // Ethna_Config¥ª¥Ö¥¸¥§¥¯¥ÈÆâ¤ÎÃÍ
-        $this->config->set('foo', 'bar');
-        $result = $this->config->get('foo');
-        $this->assertEqual($result, 'bar');
-
-        // ethna-ini.php ¤¬¼«Æ°À¸À®¤µ¤ì¤ë
-        $this->config->update();
-
-        // ethna-ini.php ¤òÆɤ߹þ¤ßľ¤¹
-        $this->config->_getConfig();
-        $result = $this->config->get('foo');
-        $this->assertEqual($result, 'bar');
-
-        // Ãͤò¾å½ñ¤­
-        $this->config->set('foo', 'baz');
-        $this->config->update();
-
-        // ¤â¤¦°ìÅÙÆɤ߹þ¤ßľ¤¹
-        $this->config->_getConfig();
-        $result = $this->config->get('foo');
-        $this->assertEqual($result, 'baz');
-    }
-}
-?>
diff --git a/test/Ethna_DB_ADOdb_Test.php b/test/Ethna_DB_ADOdb_Test.php
deleted file mode 100644 (file)
index 4227bc5..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-<?php
-/**
- *  Ethna_DB_ADOdb_Test.php
- *
- *  @package Ethna
- *  @author halt feits <halt.feits@gmail.com>
- */
-
-//error_reporting(E_ALL);
-
-/**
- *  Ethna_DB_ADOdb¥¯¥é¥¹¤Î¥Æ¥¹¥È¥±¡¼¥¹
- *
- *  @package Ethna
- *  @author halt feits <halt.feits@gmail.com>
- *  @access public
- */
-class Ethna_DB_ADOdb_Test extends Ethna_UnitTestBase
-{
-    /**
-     * ADOdb Object
-     * @var     Ethna_DB_ADOdb
-     * @access  private
-     */
-    var $db;
-
-    /**
-     * database path
-     * @var     string
-     * @access  private
-     */
-    var $db_path;
-
-    /**
-     * database source name
-     * @var     string
-     * @access  private
-     */
-    var $dsn;
-
-    /**
-     * database type
-     * @var     double
-     * @access  public
-     */
-    var $db_type;
-
-    function setUp()
-    {
-        //for sqlite
-        $this->db_type = 'sqlite';
-        $this->db_path = dirname(__FILE__) . "/test.db";
-        $this->dsn = "sqlite:///" . $this->db_path;
-    }
-
-    function tearDown()
-    {
-        if ($this->db_type == 'sqlite') {
-            if (file_exists($this->db_path)) {
-                unlink($this->db_path);
-            }
-        }
-    }
-
-    function testRequire()
-    {
-        require_once 'Ethna/class/DB/Ethna_DB_ADOdb.php';
-    }
-
-    function testMakeInstance()
-    {
-        if ($this->db_type == 'sqlite') {
-            $this->assertTrue(extension_loaded('sqlite'), "this php not installed sqlite");
-        }
-
-        $this->db = new Ethna_DB_ADOdb($this->ctl, $this->dsn, false);
-        $this->assertTrue(is_object($this->db), "this->db is not object");
-        $this->assertEqual(strtolower(get_class($this->db)),
-            strtolower("Ethna_DB_ADOdb"), "this->db is not Ethna_DB_ADOdb");
-    }
-
-    function testConnect()
-    {
-        $this->assertTrue($this->db->connect(), "db connect failed");
-        $this->assertTrue(file_exists($this->db_path), "db connect failed");
-    }
-
-    function testCreateTable()
-    {
-        $sqls = array();
-        $sqls[] = "CREATE TABLE test (id INTEGER NOT NULL PRIMARY KEY, string VARCHAR);";
-        $sqls[] = "CREATE TABLE fordrop (id INTEGER NOT NULL PRIMARY KEY, string VARCHAR);";
-
-        foreach($sqls as $sql) {
-            $result = $this->db->execute($sql);
-            $this->assertTrue($result, "query execute failed [$sql]");
-        }
-    }
-
-    function testDeleteTable()
-    {
-        $sql = "DROP TABLE fordrop;";
-        $result = $this->db->execute($sql);
-        $this->assertTrue($result, "query execute failed [$sql]");
-    }
-
-    function testInsert()
-    {
-        $sqls = array();
-        $sqls[] = "INSERT INTO test (string) VALUES ('test_string');";
-        $sqls[] = "INSERT INTO test (string) VALUES ('1');";
-        $sqls[] = array(
-            'query' => 'INSERT INTO test (string) VALUES (?);',
-            'ps' => array('test_data'),
-        );
-
-        foreach ($sqls as $sql) {
-
-            if (is_string($sql)) {
-                $result = $this->db->execute($sql);
-            } else if (is_array($sql)) {
-                $result = $this->db->execute($sql['query'], $sql['ps']);
-            } else {
-                $this->fail("invalid test data");
-            }
-
-            $this->assertTrue($result, "query execute failed [$sql]");
-        }
-    }
-
-    function testAutoExecute()
-    {
-        $result = $this->db->autoExecute('test', array('string' => __LINE__), 'INSERT');
-        $this->assertTrue($result, "autoexecute failed");
-
-        $result = $this->db->autoExecute('test', array('string' => 'testAutoExecute'), 'INSERT');
-        $this->assertTrue($result, "autoexecute failed");
-
-        $result = $this->db->autoExecute('test', array('string' => 'edit_testAutoExecute_edit'), 'UPDATE', "string = 'testAutoExecute'");
-        $this->assertTrue($result, "autoexecute failed");
-    }
-
-    function testExecute()
-    {
-        $sqls = array();
-        $sqls[] = "CREATE TABLE test_execute (id INTEGER NOT NULL PRIMARY KEY, string VARCHAR);";
-
-        foreach($sqls as $sql) {
-            $result = $this->db->execute($sql);
-            $this->assertTrue($result, "query execute failed [$sql]");
-        }
-    }
-
-}
-?>
diff --git a/test/Ethna_Logger_Test.php b/test/Ethna_Logger_Test.php
deleted file mode 100644 (file)
index bc458d5..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-<?php
-/**
- *  Ethna_Logger_Test.php
- */
-
-/**
- *  Ethna_Logger¥¯¥é¥¹¤Î¥Æ¥¹¥È¥±¡¼¥¹
- *  (Logwriter¤Ç¤Ï¤Ê¤¯¡¢Logwriter¤Î¥Þ¥Í¡¼¥¸¥ã¤È¤·¤Æ¤ÎLogger¤Î¥Æ¥¹¥È)
- *
- *  @access public
- */
-class Ethna_Logger_Test extends Ethna_UnitTestBase
-{
-    function setUp()
-    {
-        // Config¥¯¥é¥¹¤òEthna_Logger_Test_Config¤ËÀßÄê
-        $this->ctl->class['config'] = 'Ethna_Logger_Test_Config';
-        $this->ctl->getConfig();
-    }
-
-    function tearDown()
-    {
-        // do nothing.
-    }
-
-    function _resetLoggerSetting($config)
-    {
-        unset($this->ctl->class_factory->object['logger']);
-        $config_obj =& $this->ctl->class_factory->object['config'];
-        $config_obj->config = $config;
-    }
-
-    /**
-     *  old style log setting.
-     */
-    function test_parseSetting_Compatible()
-    {
-        $config = array(
-            'log_facility'      => 'echo',
-            'log_level'         => 'warning',
-            'log_option'        => 'pid,function,pos',
-        );
-        $this->_resetLoggerSetting($config);
-        $this->logger =& $this->ctl->getLogger();
-
-        // facility
-        $facility = $this->logger->getLogFacility();
-        $this->assertEqual($facility, 'echo'); // not array, but string (for B.C.)
-
-        // level
-        $level_echo = $this->logger->level['echo'];
-        $this->assertEqual($level_echo, LOG_WARNING);
-
-        // option
-        $option_echo = $this->logger->option['echo'];
-        $this->assertEqual($option_echo['pid'], true);
-        $this->assertEqual($option_echo['function'], true);
-        $this->assertEqual($option_echo['pos'], true);
-    }
-
-    /**
-     *  structured style log setting.
-     */
-    function test_parseSetting_Structured()
-    {
-        $config = array(
-            'log' => array(
-                'echo'  => array(
-                    'level'         => 'warning',
-                ),
-                'file'  => array(
-                    'level'         => 'notice',
-                    'file'          => '/var/log/Ethna.log',
-                    'mode'          => 0666,
-                ),
-                'alertmail'  => array(
-                    'level'         => 'err',
-                    'mailaddress'   => 'alert@ml.example.jp',
-                ),
-            ),
-            'log_option'            => 'pid,function,pos',
-        );
-        $this->_resetLoggerSetting($config);
-        $this->logger =& $this->ctl->getLogger();
-
-        // facility
-        $facility = $this->logger->getLogFacility();
-        $this->assertEqual($facility, array('echo', 'file', 'alertmail'));
-
-        // level
-        $level_echo = $this->logger->level['echo'];
-        $this->assertEqual($level_echo, LOG_WARNING);
-        $level_file = $this->logger->level['file'];
-        $this->assertEqual($level_file, LOG_NOTICE);
-        $level_alertmail = $this->logger->level['alertmail'];
-        $this->assertEqual($level_alertmail, LOG_ERR);
-
-        // option
-        $option_echo = $this->logger->option['echo'];
-        $this->assertEqual($option_echo['pid'], true);
-        $this->assertEqual($option_echo['function'], true);
-        $this->assertEqual($option_echo['pos'], true);
-
-        $option_file = $this->logger->option['file'];
-        $this->assertEqual($option_file['pid'], true);
-        $this->assertEqual($option_file['function'], true);
-        $this->assertEqual($option_file['pos'], true);
-        $this->assertEqual($option_file['file'], '/var/log/Ethna.log');
-        $this->assertEqual($option_file['mode'], 0666);
-
-        $option_alertmail = $this->logger->option['alertmail'];
-        $this->assertEqual($option_alertmail['pid'], true);
-        $this->assertEqual($option_alertmail['function'], true);
-        $this->assertEqual($option_alertmail['pos'], true);
-        $this->assertEqual($option_alertmail['mailaddress'], 'alert@ml.example.jp');
-    }
-
-    /**
-     *  @todo   log level filter, begin(), log(), end()
-     */
-    //function test_etcetc()
-    //{
-    //    // not implemented yet.
-    //}
-}
-
-class Ethna_Logger_Test_Config extends Ethna_Config
-{
-    function Ethna_Logger_Test_Config()
-    {
-        // do nothing.
-    }
-}
-?>
diff --git a/test/Ethna_Plugin_Cachemanager_Localfile_Test.php b/test/Ethna_Plugin_Cachemanager_Localfile_Test.php
deleted file mode 100644 (file)
index f9150cf..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-<?php
-/**
- *  Ethna_Plugin_Cachemanager_Localfile_Test.php
- */
-
-/**
- *  Ethna_Plugin_Cachemanager_Localfile¥¯¥é¥¹¤Î¥Æ¥¹¥È¥±¡¼¥¹
- *
- *  @access public
- */
-class Ethna_Plugin_Cachemanager_Localfile_Test extends Ethna_UnitTestBase
-{
-    function rm($path){
-        if (is_dir($path)) {
-            if ($handle = opendir($path)) {
-                while (false !== ($file = readdir($handle))) {
-                    if ($file != "." && $file != "..") {
-                        $this->rm("$path/$file");
-                    }
-                }
-                closedir($handle);
-            }
-            if (!rmdir($path)) {
-                printf("fail rmdir[$path]\n");
-            }
-        } else {
-            if (!unlink($path)) {
-                printf("fail unlink[$path]\n");
-            }
-        }
-    }
-
-    function testCachemanagerLocalfile()
-    {
-        $ctl =& Ethna_Controller::getInstance();
-        $plugin =& $ctl->getPlugin();
-        $cm = $plugin->getPlugin('Cachemanager', 'Localfile');
-
-        // Ê¸»úÎó¤Î¥­¥ã¥Ã¥·¥å
-        $string_key = 'string_key';
-        $string_value = "cache\ncontent";
-        $cm->set($string_key, $string_value, mktime(0, 0, 0, 7, 1, 2000));
-        $cache_string = $cm->get($string_key);
-        $this->assertTrue($cm->isCached($string_key));
-        $this->assertEqual(mktime(0, 0, 0, 7, 1, 2000), $cm->getLastModified($string_key));
-        $this->assertTrue($string_value, $cache_string);
-
-        // À°¿ô¤Î¥­¥ã¥Ã¥·¥å + namespace
-        $int_key = 'int_key';
-        $int_value = 777;
-        $namespace = 'test';
-        $cm->set($int_key, $int_value, mktime(0, 0, 0, 7, 1, 2000), $namespace);
-        $cache_int = $cm->get($int_key, mktime(0, 0, 0, 7, 1, 2000), $namespace);
-        $this->assertTrue($cm->isCached($int_key, mktime(0, 0, 0, 7, 1, 2000), $namespace));
-        $this->assertTrue($int_value, $cache_int);
-
-        // ¥ª¥Ö¥¸¥§¥¯¥È¤Î¥­¥ã¥Ã¥·¥å
-        $object_key = 'object_key';
-        $object_value =& $cm;
-        $cm->set($object_key, $object_value);
-        $this->assertTrue($cm->isCached($object_key));
-        // ¥­¥ã¥Ã¥·¥å¤µ¤ì¤¿¥¤¥ó¥¹¥¿¥ó¥¹
-        $cache_object = $cm->get($object_key);
-        $this->assertTrue($string_value, $cache_object->get($string_key));
-
-        // ¥­¥ã¥Ã¥·¥å¤Î¥¯¥ê¥¢¤ò¥Æ¥¹¥È
-        $cm->clear($object_key);
-        $this->assertFalse($cm->isCached($object_key));
-
-        // ¥­¥ã¥Ã¥·¥å¤µ¤ì¤Æ¤¤¤Ê¤¤¤Î¤Ë¸Æ¤Ó½Ð¤½¤¦¤È¤·¤¿¾ì¹ç
-        $nocache_key = 'nocache_key';
-        $cm->clear($nocache_key);
-        $pear_error = $cm->get($nocache_key);
-        $this->assertEqual(E_CACHE_NO_VALUE, $pear_error->getCode());
-        $this->assertEqual('fopen failed', $pear_error->getMessage());
-
-        // ¥Õ¥¡¥¤¥ë¤ËÆɤ߹þ¤ß¸¢¸Â¤¬¤Ê¤¤¾ì¹ç
-        Ethna_Util::chmod($cm->_getCacheFile(null, $string_key), 0222);
-        $pear_error = $cm->get($string_key);
-        $this->assertEqual(E_CACHE_NO_VALUE, $pear_error->getCode());
-        $this->assertEqual('fopen failed', $pear_error->getMessage());
-        Ethna_Util::chmod($cm->_getCacheFile(null, $string_key), 0666);
-
-        // lifetimeÀÚ¤ì¤Î¾ì¹ç
-        $pear_error = $cm->get($string_key, 1);
-        $this->assertEqual(E_CACHE_EXPIRED, $pear_error->getCode());
-        $this->assertEqual('fopen failed', $pear_error->getMessage());
-
-        // ¥Ç¥£¥ì¥¯¥È¥ê̾¤ÈƱ¤¸¥Õ¥¡¥¤¥ë¤¬¤¢¤Ã¤Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬ºîÀ®¤Ç¤­¤Ê¤¤¾ì¹ç
-        $tmp_key = 'tmpkey';
-        $tmp_dirname = $cm->_getCacheDir(null, $tmp_key);
-        Ethna_Util::mkdir(dirname($tmp_dirname), 0777);
-        $tmp_file = fopen($tmp_dirname, 'w');
-        fclose($tmp_file);
-        $pear_error = $cm->set($tmp_key, $string_value);
-        $this->assertEqual(E_USER_WARNING, $pear_error->getCode());
-        $this->assertEqual("mkdir($tmp_dirname) failed", $pear_error->getMessage());
-
-        $this->rm($cm->backend->getTmpdir());
-
-    }
-}
-?>
diff --git a/test/Ethna_Plugin_Csrf_Session_Test.php b/test/Ethna_Plugin_Csrf_Session_Test.php
deleted file mode 100755 (executable)
index d57e2d7..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-<?php
-/**
- *  Ethna_Plugin_Validator_Required_Test.php
- */
-
-/**
- *  Ethna_Plugin_Validator_Required¥¯¥é¥¹¤Î¥Æ¥¹¥È¥±¡¼¥¹
- *
- *  @access public
- */
-class Ethna_Plugin_Csrf_Session_Test extends Ethna_UnitTestBase
-{
-    /**
-     * Description of the Variable
-     * @var     Ethna_Plugin_Csrf_Session
-     * @access  private
-     */
-    var $csrf;
-
-    function testMakeInstance()
-    {
-        $ctl =& Ethna_Controller::getInstance();
-        $plugin =& $ctl->getPlugin();
-        $this->csrf =& $plugin->getPlugin('Csrf', 'Session');
-        $this->assertTrue(is_object($this->csrf), 'getPlugin failed');
-        $this->csrf->session =& new Ethna_Session_Dummy($ctl->appid, '',  $ctl->getLogger());
-    }
-
-    function testGetName()
-    {
-        $this->assertTrue(strlen($this->csrf->getName()), 'token name not found');
-    }
-
-    function testCheckCsrfSession()
-    {
-        $this->assertTrue($this->csrf->set());
-        $this->csrfid = $this->csrf->get();
-    }
-
-    function testPostRequest()
-    {
-        $_SERVER['REQUEST_METHOD'] = "post";
-        $_POST[$this->csrf->getName()] = "";
-        $this->assertFalse($this->csrf->isValid());
-
-        $_POST[$this->csrf->getName()] = $this->csrfid;
-        $this->assertTrue($this->csrf->isValid());
-    }
-
-    function testGetRequest()
-    {
-        $_SERVER['REQUEST_METHOD'] = "get";
-        $_GET[$this->csrf->getName()] = "";
-        $this->assertFalse($this->csrf->isValid());
-
-        $_GET[$this->csrf->getName()] = $this->csrfid;
-        $this->assertTrue($this->csrf->isValid());
-    }
-
-}
-
-/**
- *  SessionClass¤Î_Dummy
- *
- *  @access public
- */
-// {{{ Ethna_Session
-/**
- *  ¥»¥Ã¥·¥ç¥ó¥¯¥é¥¹¤Î¥À¥ß¡¼
- *
- *  @author     Keita Arai <cocoiti@comio.info>
- *  @access     public
- *  @package    Ethna
- */
-class Ethna_Session_Dummy extends Ethna_Session
-{
-    var $dummy_session = array();
-
-
-    /**
-     *  ¥»¥Ã¥·¥ç¥ó¤òÉüµ¢¤¹¤ë
-     *
-     *  @access public
-     */
-    function restore()
-    {
-        $this->session_start = true;
-        return true;
-    }
-
-    /**
-     *  ¥»¥Ã¥·¥ç¥ó¤ÎÀµÅöÀ­¥Á¥§¥Ã¥¯
-     *
-     *  @access public
-     *  @return bool    true:ÀµÅö¤Ê¥»¥Ã¥·¥ç¥ó false:ÉÔÅö¤Ê¥»¥Ã¥·¥ç¥ó
-     */
-    function isValid()
-    {
-        return true;
-    }
-
-    /**
-     *  ¥»¥Ã¥·¥ç¥ó¤ò³«»Ï¤¹¤ë
-     *
-     *  @access public
-     *  @param  int     $lifetime   ¥»¥Ã¥·¥ç¥óÍ­¸ú´ü´Ö(ÉÃñ°Ì, 0¤Ê¤é¥»¥Ã¥·¥ç¥ó¥¯¥Ã¥­¡¼)
-     *  @return bool    true:Àµ¾ï½ªÎ» false:¥¨¥é¡¼
-     */
-    function start($lifetime = 0, $anonymous = false)
-    {
-        $_SESSION['REMOTE_ADDR'] = "DUMMY";
-        $_SESSION['__anonymous__'] = $anonymous;
-        $this->session_start = true;
-        return true;
-    }
-
-    /**
-     *  ¥»¥Ã¥·¥ç¥ó¤òÇË´þ¤¹¤ë
-     *
-     *  @access public
-     *  @return bool    true:Àµ¾ï½ªÎ» false:¥¨¥é¡¼
-     */
-    function destroy()
-    {
-        return true;
-    }
-
-    /**
-     *  ¥»¥Ã¥·¥ç¥óÃͤؤΥ¢¥¯¥»¥µ(R)
-     *
-     *  @access public
-     *  @param  string  $name   ¥­¡¼
-     *  @return mixed   ¼èÆÀ¤·¤¿ÃÍ(null:¥»¥Ã¥·¥ç¥ó¤¬³«»Ï¤µ¤ì¤Æ¤¤¤Ê¤¤)
-     */
-    function get($name)
-    {
-        if (!isset($this->dummy_session[$name])) {
-            return null;
-        }
-        return $this->dummy_session[$name];
-    }
-
-    /**
-     *  ¥»¥Ã¥·¥ç¥óÃͤؤΥ¢¥¯¥»¥µ(W)
-     *
-     *  @access public
-     *  @param  string  $name   ¥­¡¼
-     *  @param  string  $value  ÃÍ
-     *  @return bool    true:Àµ¾ï½ªÎ» false:¥¨¥é¡¼(¥»¥Ã¥·¥ç¥ó¤¬³«»Ï¤µ¤ì¤Æ¤¤¤Ê¤¤)
-     */
-    function set($name, $value)
-    {
-        if (!$this->session_start) {
-            // no way
-            return false;
-        }
-
-        $this->dummy_session[$name] = $value;
-
-        return true;
-    }
-
-    /**
-     *  ¥»¥Ã¥·¥ç¥ó¤ÎÃͤòÇË´þ¤¹¤ë
-     *
-     *  @access public
-     *  @param  string  $name   ¥­¡¼
-     *  @return bool    true:Àµ¾ï½ªÎ» false:¥¨¥é¡¼(¥»¥Ã¥·¥ç¥ó¤¬³«»Ï¤µ¤ì¤Æ¤¤¤Ê¤¤)
-     */
-    function remove($name)
-    {
-        if (!$this->session_start) {
-            return false;
-        }
-
-        unset($this->dummy_session[$name]);
-
-        return true;
-    }
-}
-// }}}
-
-?>
diff --git a/test/Ethna_Plugin_Logwriter_Echo_Test.php b/test/Ethna_Plugin_Logwriter_Echo_Test.php
deleted file mode 100644 (file)
index bbf8aa6..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-<?php
-/**
- *  Ethna_Plugin_Logwriter_Echo_Test.php
- */
-
-/**
- *  Ethna_Plugin_Logwriter_Echo¥¯¥é¥¹¤Î¥Æ¥¹¥È¥±¡¼¥¹
- *
- *  @access public
- */
-class Ethna_Plugin_Logwriter_Echo_Test extends Ethna_UnitTestBase
-{
-    var $plugin;
-    var $lw;
-
-    function setUp()
-    {
-        $this->plugin =& $this->ctl->getPlugin();
-        $this->lw = $this->plugin->getPlugin('Logwriter', 'Echo');
-
-        $option = array(
-                        'ident' => 'testident',
-                        'facility' => 'mail',
-                        );
-        $this->lw->setOption($option);
-    }
-
-    function testLogwriterEcho()
-    {
-        $message = 'comment';
-
-        $level_array = array(LOG_EMERG,
-            LOG_ALERT,
-            LOG_CRIT,
-            LOG_ERR,
-            LOG_WARNING,
-            LOG_NOTICE,
-            LOG_INFO,
-            LOG_DEBUG,);
-
-        foreach ($level_array as $level) {
-            ob_start();         // ¥³¥ó¥½¡¼¥ë¤Ø¤Î½ÐÎϤò¥­¥ã¥×¥Á¥ã³«»Ï
-
-            // ´Ø¿ô¤¬ÊÖ¤¹Ê¸»úÎó¤Ë²þ¹Ô¥¿¥°ÉÕÍ¿¤ÎÀ§Èó
-            $funcout = $this->lw->log($level, $message)
-                . sprintf("%s", $this->ctl->getGateway() != GATEWAY_WWW ? "" : "<br />");
-
-            $stdout = trim(ob_get_contents());
-            $this->assertEqual($funcout, $stdout);
-
-            ob_end_clean();     // ¥³¥ó¥½¡¼¥ë¤Ø¤Î½ÐÎϤò¥­¥ã¥×¥Á¥ã½ªÎ»
-        }
-    }
-
-    /**
-     * testBug9009
-     *
-     * @see http://sourceforge.jp/tracker/index.php?func=detail&aid=9009&group_id=1343&atid=5092
-     */
-    function testBug9009()
-    {
-        $level = LOG_WARNING;
-        $message = "SELECT * FROM item WHERE name LIKE '%salt%';";
-
-        ob_start();         // ¥³¥ó¥½¡¼¥ë¤Ø¤Î½ÐÎϤò¥­¥ã¥×¥Á¥ã³«»Ï
-
-        // ´Ø¿ô¤¬ÊÖ¤¹Ê¸»úÎó¤Ë²þ¹Ô¥¿¥°ÉÕÍ¿¤ÎÀ§Èó
-        $funcout = $this->lw->log($level, $message)
-            . sprintf("%s", $this->ctl->getGateway() != GATEWAY_WWW ? "" : "<br />");
-
-        $stdout = trim(ob_get_contents());
-        $this->assertEqual($funcout, $stdout);
-
-        ob_end_clean();     // ¥³¥ó¥½¡¼¥ë¤Ø¤Î½ÐÎϤò¥­¥ã¥×¥Á¥ã½ªÎ»
-    }
-}
-?>
diff --git a/test/Ethna_Plugin_Logwriter_File_Test.php b/test/Ethna_Plugin_Logwriter_File_Test.php
deleted file mode 100644 (file)
index 85e544a..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-<?php
-/**
- *  Ethna_Plugin_Logwriter_File_Test.php
- */
-
-/**
- *  Ethna_Plugin_Logwriter_File¥¯¥é¥¹¤Î¥Æ¥¹¥È¥±¡¼¥¹
- *
- *  @access public
- */
-class Ethna_Plugin_Logwriter_File_Test extends Ethna_UnitTestBase
-{
-    function testLogwriterFile()
-    {
-        $ctl =& Ethna_Controller::getInstance();
-        $plugin =& $ctl->getPlugin();
-        $lw = $plugin->getPlugin('Logwriter', 'File');
-
-        $option = array(
-                        'ident'    => 'hoge',
-                        'facility' => 'mail',
-                        'file'     => 'logfile',
-                        'mode'     => '0666',
-                        );
-        $lw->setOption($option);
-
-        $level = LOG_WARNING;
-        $message = 'comment';
-        $lw->begin();
-        $_before_size = filesize($option['file']);
-        $this->assertTrue(file_exists($option['file']));
-        $lw->log($level, $message);
-        $lw->end();
-        clearstatcache();
-        $_after_size = filesize($option['file']);
-        // ¥í¥°¤ò½ÐÎϤ·¤¿¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤¬Â礭¤¯¤Ê¤Ã¤¿¤³¤È¤ò³Îǧ
-        $this->assertTrue($_before_size < $_after_size);
-
-        $file = file($option['file']);
-        $line_count = count($file); // ºÇ¸å¤ËÄɵ­¤·¤¿¹ÔÈÖ¹æ
-        // Ç¯·îÆü»þʬ¤Î°ìÃס¢ÉäΥե©¡¼¥Þ¥Ã¥È¡¢ID¡¦¥í¥°¥ì¥Ù¥ë¡¦¥á¥Ã¥»¡¼¥¸¤Î°ìÃפò³Îǧ
-        $this->assertTrue(preg_match('/^'.preg_quote(strftime('%Y/%m/%d %H:%M:'), '/')
-                            .'[0-5][0-9] '
-                            .preg_quote($option['ident'].'('
-                                        .$lw->_getLogLevelName($level).'): '
-                                        .$message)
-                            .'/', trim($file[$line_count - 1])));
-
-
-        $option = array(
-                        'pid'      => true,
-                        'ident'    => 'hoge',
-                        'facility' => 'mail',
-                        'file'     => 'logfile',
-                        'mode'     => '0666',
-                        );
-        $lw->setOption($option);
-
-        $level = LOG_WARNING;
-        $message = 'comment';
-        $lw->begin();
-        $_before_size = filesize($option['file']);
-        $this->assertTrue(file_exists($option['file']));
-        $lw->log($level, $message);
-        $lw->end();
-        clearstatcache();
-        $_after_size = filesize($option['file']);
-        // ¥í¥°¤ò½ÐÎϤ·¤¿¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤¬Â礭¤¯¤Ê¤Ã¤¿¤³¤È¤ò³Îǧ
-        $this->assertTrue($_before_size < $_after_size);
-
-        $file = file($option['file']);
-        $line_count = count($file); // ºÇ¸å¤ËÄɵ­¤·¤¿¹ÔÈÖ¹æ
-        // Ç¯·îÆü»þʬ¤Î°ìÃס¢ÉäΥե©¡¼¥Þ¥Ã¥È¡¢ID¡¦PID¡¦¥í¥°¥ì¥Ù¥ë¡¦¥á¥Ã¥»¡¼¥¸¤Î°ìÃפò³Îǧ
-        $this->assertTrue(preg_match('/^'.preg_quote(strftime('%Y/%m/%d %H:%M:'), '/')
-                            .'[0-5][0-9] '
-                            .preg_quote($option['ident'].'['.getmypid().']('
-                                        .$lw->_getLogLevelName($level).'): '
-                                        .$message)
-                            .'/', trim($file[$line_count - 1])));
-
-        unlink($option['file']);
-
-    }
-}
-?>
diff --git a/test/Ethna_Plugin_Validator_Custom_Test.php b/test/Ethna_Plugin_Validator_Custom_Test.php
deleted file mode 100644 (file)
index 733e8e8..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-<?php
-/**
- *  Ethna_Plugin_Validator_Custom_Test.php
- */
-
-/**
- *  Ethna_Plugin_Validator_Custom¥¯¥é¥¹¤Î¥Æ¥¹¥È¥±¡¼¥¹
- *
- *  @access public
- */
-class Ethna_Plugin_Validator_Custom_Test extends Ethna_UnitTestBase
-{
-    function testCheckValidatorCustom()
-    {
-        $ctl =& Ethna_Controller::getInstance();
-        $plugin =& $ctl->getPlugin();
-        $vld = $plugin->getPlugin('Validator', 'Custom');
-
-
-        // mailaddress¥«¥¹¥¿¥à¥Á¥§¥Ã¥¯¤Î¥Æ¥¹¥È
-        $form_string = array(
-                             'type'          => VAR_TYPE_STRING,
-                             'required'      => true,
-                             'custom' => 'checkMailaddress',
-                             );
-        $vld->af->form_vars['namae_string'] = 'hoge@fuga.net';
-        $this->assertTrue($vld->validate('namae_string', '', $form_string));
-
-        $vld->af->form_vars['namae_string'] = '-hoge@fuga.net';
-        $this->assertTrue($vld->validate('namae_string', '', $form_string));
-
-        $vld->af->form_vars['namae_string'] = '.hoge@fuga.net';
-        $this->assertTrue($vld->validate('namae_string', '', $form_string));
-
-        $vld->af->form_vars['namae_string'] = '+hoge@fuga.net';
-        $this->assertTrue($vld->validate('namae_string', '', $form_string));
-
-        // @¤¬¤Ê¤¤
-        $vld->af->form_vars['namae_string'] = 'hogefuga.net';
-        $this->assertFalse($vld->validate('namae_string', '', $form_string));
-
-        // @¤ÎÁ°¤Ëʸ»ú¤¬¤Ê¤¤
-        $vld->af->form_vars['namae_string'] = '@hogefuga.net';
-        $this->assertFalse($vld->validate('namae_string', '', $form_string));
-
-        // @¤Î¸å¤Ëʸ»ú¤¬¤Ê¤¤
-        $vld->af->form_vars['namae_string'] = 'hogefuga.net@';
-        $this->assertFalse($vld->validate('namae_string', '', $form_string));
-
-        // ÀèƬʸ»ú¤¬µö¤µ¤ì¤Æ¤¤¤Ê¤¤
-        $vld->af->form_vars['namae_string'] = '%hoge@fuga.net';
-        $this->assertFalse($vld->validate('namae_string', '', $form_string));
-
-        // ËöÈøʸ»ú¤¬µö¤µ¤ì¤Æ¤¤¤Ê¤¤
-        $vld->af->form_vars['namae_string'] = 'hoge@fuga.net.';
-        $this->assertFalse($vld->validate('namae_string', '', $form_string));
-
-
-
-        $form_boolean = array(
-                              'type'          => VAR_TYPE_BOOLEAN,
-                              'required'      => true,
-                              'custom' => 'checkBoolean',
-                              );
-        $vld->af->form_vars['namae_boolean'] = true;
-        $this->assertTrue($vld->validate('namae_boolean', '', $form_boolean));
-
-        $vld->af->form_vars['namae_boolean'] = false;
-        $this->assertTrue($vld->validate('namae_boolean', '', $form_boolean));
-
-        $vld->af->form_vars['namae_boolean'] = '';
-        $this->assertTrue($vld->validate('namae_boolean', '', $form_boolean));
-
-        $vld->af->form_vars['namae_boolean'] = array();
-        $this->assertTrue($vld->validate('namae_boolean', '', $form_boolean));
-
-        $vld->af->form_vars['namae_boolean'] = array(true);
-        $this->assertTrue($vld->validate('namae_boolean', '', $form_boolean));
-
-        // 0,1°Ê³°¤ÎÃÍ
-        $vld->af->form_vars['namae_boolean'] = 3;
-        $this->assertFalse($vld->validate('namae_boolean', '', $form_boolean));
-
-
-
-
-        $form_url = array(
-                          'type'          => VAR_TYPE_STRING,
-                          'required'      => true,
-                          'custom' => 'checkURL',
-                          );
-        $vld->af->form_vars['namae_url'] = 'http://uga.net';
-        $this->assertTrue($vld->validate('namae_url', '', $form_url));
-
-        $vld->af->form_vars['namae_url'] = 'https://uga.net';
-        $this->assertTrue($vld->validate('namae_url', '', $form_url));
-
-        $vld->af->form_vars['namae_url'] = 'ftp://uga.net';
-        $this->assertTrue($vld->validate('namae_url', '', $form_url));
-
-        $vld->af->form_vars['namae_url'] = 'http://';
-        $this->assertTrue($vld->validate('namae_url', '', $form_url));
-
-        $vld->af->form_vars['namae_url'] = '';
-        $this->assertTrue($vld->validate('namae_url', '', $form_url));
-
-        // '/'¤¬Â­¤ê¤Ê¤¤
-        $vld->af->form_vars['namae_url'] = 'http:/';
-        $this->assertFalse($vld->validate('namae_url', '', $form_url));
-
-        // ÀÜƬ¼­¤¬¤Ê¤¤
-        $vld->af->form_vars['namae_url'] = 'hoge@fuga.net';
-        $this->assertFalse($vld->validate('namae_url', '', $form_url));
-
-
-
-
-        $form_string = array(
-                             'type'          => VAR_TYPE_STRING,
-                             'required'      => true,
-                             'custom' => 'checkVendorChar',
-                             );
-        $vld->af->form_vars['namae_string'] = 'http://uga.net';
-        $this->assertTrue($vld->validate('namae_string', '', $form_string));
-
-        $vld->af->form_vars['namae_string'] = chr(0x00);
-        $this->assertTrue($vld->validate('namae_string', '', $form_string));
-
-        $vld->af->form_vars['namae_string'] = chr(0x79);
-        $this->assertTrue($vld->validate('namae_string', '', $form_string));
-
-        $vld->af->form_vars['namae_string'] = chr(0x80);
-        $this->assertTrue($vld->validate('namae_string', '', $form_string));
-
-        $vld->af->form_vars['namae_string'] = chr(0x8e);
-        $this->assertTrue($vld->validate('namae_string', '', $form_string));
-
-        $vld->af->form_vars['namae_string'] = chr(0x8f);
-        $this->assertTrue($vld->validate('namae_string', '', $form_string));
-
-        $vld->af->form_vars['namae_string'] = chr(0xae);
-        $this->assertTrue($vld->validate('namae_string', '', $form_string));
-
-        $vld->af->form_vars['namae_string'] = chr(0xf8);
-        $this->assertTrue($vld->validate('namae_string', '', $form_string));
-
-        $vld->af->form_vars['namae_string'] = chr(0xfd);
-        $this->assertTrue($vld->validate('namae_string', '', $form_string));
-
-        /* IBM³Èĥʸ»ú / NECÁªÄêIBM³Èĥʸ»ú */
-        //$c == 0xad || ($c >= 0xf9 && $c <= 0xfc)
-        $vld->af->form_vars['namae_string'] = chr(0xad);
-        $this->assertFalse($vld->validate('namae_string', '', $form_string));
-
-        $vld->af->form_vars['namae_string'] = chr(0xf9);
-        $this->assertFalse($vld->validate('namae_string', '', $form_string));
-
-        $vld->af->form_vars['namae_string'] = chr(0xfa);
-        $this->assertFalse($vld->validate('namae_string', '', $form_string));
-
-        $vld->af->form_vars['namae_string'] = chr(0xfc);
-        $this->assertFalse($vld->validate('namae_string', '', $form_string));
-
-
-    }
-}
-?>
diff --git a/test/Ethna_Plugin_Validator_Max_Test.php b/test/Ethna_Plugin_Validator_Max_Test.php
deleted file mode 100644 (file)
index 9f719fa..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-<?php
-/**
- *  Ethna_Plugin_Validator_Max_Test.php
- */
-
-/**
- *  Ethna_Plugin_Validator_Max¥¯¥é¥¹¤Î¥Æ¥¹¥È¥±¡¼¥¹
- *
- *  @access public
- */
-class Ethna_Plugin_Validator_Max_Test extends Ethna_UnitTestBase
-{
-    function testCheckValidatorMax()
-    {
-        $ctl =& Ethna_Controller::getInstance();
-        $plugin =& $ctl->getPlugin();
-        $vld = $plugin->getPlugin('Validator', 'Max');
-
-
-        $form_int = array(
-                          'type'          => VAR_TYPE_INT,
-                          'required'      => true,
-                          'max'           => '10',
-                          'error'         => '{form}¤Ë¤Ï10°Ê²¼¤Î¿ô»ú(À°¿ô)¤òÆþÎϤ·¤Æ²¼¤µ¤¤'
-                          );
-        $vld->af->setDef('namae_int', $form_int);
-
-        $pear_error = $vld->validate('namae_int', 9, $form_int);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_int', 10, $form_int);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_int', '', $form_int);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_int', 9.5, $form_int);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        // max¤òĶ¤¨¤¿ÃÍ
-        $pear_error = $vld->validate('namae_int', 11, $form_int);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_MAX_INT,$pear_error->getCode());
-        $this->assertEqual($form_int['error'], $pear_error->getMessage());
-
-
-
-        $form_float = array(
-                            'type'          => VAR_TYPE_FLOAT,
-                            'required'      => true,
-                            'max'           => '10.000000',
-                            'error'         => '{form}¤Ë¤Ï10.000000°Ê²¼¤Î¿ô»ú(¾®¿ô)¤òÆþÎϤ·¤Æ²¼¤µ¤¤'
-                            );
-        $vld->af->setDef('namae_float', $form_float);
-
-        $pear_error = $vld->validate('namae_float', 10, $form_float);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_float', '', $form_float);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        // max¤òĶ¤¨¤¿ÃÍ
-        $pear_error = $vld->validate('namae_float', 10.11, $form_float);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_MAX_FLOAT, $pear_error->getCode());
-        $this->assertEqual($form_float['error'], $pear_error->getMessage());
-
-        // max¤òĶ¤¨¤¿ÃÍ
-        $pear_error = $vld->validate('namae_float', 11, $form_float);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_MAX_FLOAT, $pear_error->getCode());
-        $this->assertEqual($form_float['error'], $pear_error->getMessage());
-
-
-
-        $form_string = array(
-                             'type'          => VAR_TYPE_STRING,
-                             'required'      => true,
-                             'max'           => '2',
-                             'error'         => '{form}¤ÏÁ´³Ñ2ʸ»ú°Ê²¼(Ⱦ³Ñ1ʸ»ú°Ê²¼)¤ÇÆþÎϤ·¤Æ²¼¤µ¤¤'
-                             );
-        $vld->af->setDef('namae_string', $form_string);
-
-        $pear_error = $vld->validate('namae_string', '', $form_string);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_string', 'as', $form_string);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        // max¤òĶ¤¨¤¿Ê¸»úÎóĹ
-        $pear_error = $vld->validate('namae_string', 'ddd', $form_string);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_MAX_STRING, $pear_error->getCode());
-        $this->assertEqual($form_string['error'], $pear_error->getMessage());
-
-        // max¤òĶ¤¨¤¿Ê¸»úÎóĹ
-        $pear_error = $vld->validate('namae_string', 118888, $form_string);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_MAX_STRING, $pear_error->getCode());
-        $this->assertEqual($form_string['error'], $pear_error->getMessage());
-
-
-
-        $form_datetime = array(
-                               'type'          => VAR_TYPE_DATETIME,
-                               'required'      => true,
-                               'max'           => '-1 day',
-                               'error'         => '{form}¤Ë¤Ï-1 day°ÊÁ°¤ÎÆüÉÕ¤òÆþÎϤ·¤Æ²¼¤µ¤¤'
-                               );
-        $vld->af->setDef('namae_datetime', $form_datetime);
-
-        $pear_error = $vld->validate('namae_datetime', '-2 day', $form_datetime);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_datetime', '-1 day', $form_datetime);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_datetime', '', $form_datetime);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        // max¤òĶ¤¨¤¿ÆüÉÕ
-        $pear_error = $vld->validate('namae_datetime', '+3 day', $form_datetime);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_MAX_DATETIME, $pear_error->getCode());
-        $this->assertEqual($form_datetime['error'], $pear_error->getMessage());
-
-
-    }
-}
-?>
diff --git a/test/Ethna_Plugin_Validator_Min_Test.php b/test/Ethna_Plugin_Validator_Min_Test.php
deleted file mode 100644 (file)
index 2b01825..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-<?php
-/**
- *  Ethna_Plugin_Validator_Min_Test.php
- */
-
-/**
- *  Ethna_Plugin_Validator_Min¥¯¥é¥¹¤Î¥Æ¥¹¥È¥±¡¼¥¹
- *
- *  @access public
- */
-class Ethna_Plugin_Validator_Min_Test extends Ethna_UnitTestBase
-{
-    function testCheckValidatorMin()
-    {
-        $ctl =& Ethna_Controller::getInstance();
-        $plugin =& $ctl->getPlugin();
-        $vld = $plugin->getPlugin('Validator', 'Min');
-
-
-        $form_int = array(
-                          'type'          => VAR_TYPE_INT,
-                          'required'      => true,
-                          'min'           => '10',
-                          'error'         => '{form}¤Ë¤Ï10°Ê¾å¤Î¿ô»ú(À°¿ô)¤òÆþÎϤ·¤Æ²¼¤µ¤¤'
-                          );
-        $vld->af->setDef('namae_int', $form_int);
-
-        $pear_error = $vld->validate('namae_int', 12, $form_int);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_int', 10, $form_int);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_int', '', $form_int);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_int', 10.5, $form_int);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        // min¤è¤ê¾®¤µ¤¤ÃÍ
-        $pear_error = $vld->validate('namae_int', -2, $form_int);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_MIN_INT,$pear_error->getCode());
-        $this->assertEqual($form_int['error'], $pear_error->getMessage());
-
-
-
-        $form_float = array(
-                            'type'          => VAR_TYPE_FLOAT,
-                            'required'      => true,
-                            'min'           => '10.000000',
-                            'error'         => '{form}¤Ë¤Ï10.000000°Ê¾å¤Î¿ô»ú(¾®¿ô)¤òÆþÎϤ·¤Æ²¼¤µ¤¤'
-                            );
-        $vld->af->setDef('namae_float', $form_float);
-
-        $pear_error = $vld->validate('namae_float', 10.0, $form_float);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_float', '', $form_float);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        // min¤è¤ê¾®¤µ¤¤ÃÍ
-        $pear_error = $vld->validate('namae_float', 9.11, $form_float);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_MIN_FLOAT, $pear_error->getCode());
-        $this->assertEqual($form_float['error'], $pear_error->getMessage());
-
-        // min¤è¤ê¾®¤µ¤¤ÃÍ
-        $pear_error = $vld->validate('namae_float', 9, $form_float);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_MIN_FLOAT, $pear_error->getCode());
-        $this->assertEqual($form_float['error'], $pear_error->getMessage());
-
-
-
-        $form_string = array(
-                             'type'          => VAR_TYPE_STRING,
-                             'required'      => true,
-                             'min'           => '2',
-                             'error'         => '{form}¤ÏÁ´³Ñ2ʸ»ú°Ê¾å(Ⱦ³Ñ1ʸ»ú°Ê¾å)¤ÇÆþÎϤ·¤Æ²¼¤µ¤¤'
-                             );
-        $vld->af->setDef('namae_string', $form_string);
-
-        $pear_error = $vld->validate('namae_string', 'ddd', $form_string);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_string', '', $form_string);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_string', 'd', $form_string);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_MIN_STRING, $pear_error->getCode());
-        $this->assertEqual($form_string['error'], $pear_error->getMessage());
-
-        // min¤òû¤¤Ê¸»úÎóĹ
-        $pear_error = $vld->validate('namae_string', 8, $form_string);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_MIN_STRING, $pear_error->getCode());
-        $this->assertEqual($form_string['error'], $pear_error->getMessage());
-
-
-
-        $form_datetime = array(
-                               'type'          => VAR_TYPE_DATETIME,
-                               'required'      => true,
-                               'min'           => '-1 day',
-                               'error'         => '{form}¤Ë¤Ï-1 day°Ê¹ß¤ÎÆüÉÕ¤òÆþÎϤ·¤Æ²¼¤µ¤¤'
-                               );
-        $vld->af->setDef('namae_datetime', $form_datetime);
-
-        $pear_error = $vld->validate('namae_datetime', '+2 day', $form_datetime);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_datetime', '-1 day', $form_datetime);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_datetime', '', $form_datetime);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        // min¤è¤ê¸Å¤¤ÆüÉÕ
-        $pear_error = $vld->validate('namae_datetime', '-3 day', $form_datetime);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_MIN_DATETIME, $pear_error->getCode());
-        $this->assertEqual($form_datetime['error'], $pear_error->getMessage());
-
-    }
-}
-?>
diff --git a/test/Ethna_Plugin_Validator_Regexp_Test.php b/test/Ethna_Plugin_Validator_Regexp_Test.php
deleted file mode 100644 (file)
index 375cf9f..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/**
- *  Ethna_Plugin_Validator_Regexp_Test.php
- */
-
-/**
- *  Ethna_Plugin_Validator_Regexp¥¯¥é¥¹¤Î¥Æ¥¹¥È¥±¡¼¥¹
- *
- *  @access public
- */
-class Ethna_Plugin_Validator_Regexp_Test extends Ethna_UnitTestBase
-{
-    function testCheckValidatorRegexp()
-    {
-        $ctl =& Ethna_Controller::getInstance();
-        $plugin =& $ctl->getPlugin();
-        $vld = $plugin->getPlugin('Validator', 'Regexp');
-
-
-        $form_string = array(
-                             'type'          => VAR_TYPE_STRING,
-                             'required'      => true,
-                             'regexp'        => '/^[a-zA-Z]+$/',
-                             'error'         => '{form}¤òÀµ¤·¤¯ÆþÎϤ·¤Æ¤¯¤À¤µ¤¤'
-                             );
-        $vld->af->setDef('namae_string', $form_string);
-
-        $pear_error = $vld->validate('namae_string', 'fromA', $form_string);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        // µö¤µ¤ì¤Æ¤¤¤Ê¤¤Ê¸»úÎó
-        $pear_error = $vld->validate('namae_string', '7.6', $form_string);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_REGEXP, $pear_error->getCode());
-        $this->assertEqual($form_string['error'], $pear_error->getMessage());
-
-        $pear_error = $vld->validate('namae_string', '', $form_string);
-        // required¤È¤Î´Ø·¸¾å
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-    }
-}
-?>
diff --git a/test/Ethna_Plugin_Validator_Required_Test.php b/test/Ethna_Plugin_Validator_Required_Test.php
deleted file mode 100644 (file)
index d74cc2f..0000000
+++ /dev/null
@@ -1,287 +0,0 @@
-<?php
-/**
- *  Ethna_Plugin_Validator_Required_Test.php
- */
-
-/**
- *  Ethna_Plugin_Validator_Required¥¯¥é¥¹¤Î¥Æ¥¹¥È¥±¡¼¥¹
- *
- *  @access public
- */
-class Ethna_Plugin_Validator_Required_Test extends Ethna_UnitTestBase
-{
-    function testCheckValidatorRequired()
-    {
-        $ctl =& Ethna_Controller::getInstance();
-        $plugin =& $ctl->getPlugin();
-        $vld = $plugin->getPlugin('Validator', 'Required');
-
-        $form_string = array(
-                             'type'          => VAR_TYPE_STRING,
-                             'required'      => false,
-                             'form_type'     => FORM_TYPE_TEXT,
-                             );
-        $vld->af->setDef('namae_string', $form_string);
-
-        $pear_error = $vld->validate('namae_string', 10, $form_string);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_string', '', $form_string);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_string', false, $form_string);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_string', null, $form_string);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-
-        $form_string = array(
-                             'type'          => VAR_TYPE_STRING,
-                             'required'      => true,
-                             'form_type'     => FORM_TYPE_TEXT,
-                             'error'         => '¥Õ¥©¡¼¥àÃÍɬ¿Ü¥¨¥é¡¼'
-                             );
-        $vld->af->setDef('namae_string', $form_string);
-
-        $pear_error = $vld->validate('namae_string', 10, $form_string);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        // É¬¿Ü¥Õ¥©¡¼¥à¤ËÆþÎϤ¬¤Ê¤¤
-        $pear_error = $vld->validate('namae_string', '', $form_string);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_REQUIRED, $pear_error->getCode());
-        $this->assertEqual($form_string['error'], $pear_error->getMessage());
-
-        $pear_error = $vld->validate('namae_string', false, $form_string);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual($form_string['error'], $pear_error->getMessage());
-
-        $pear_error = $vld->validate('namae_string', null, $form_string);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual($form_string['error'], $pear_error->getMessage());
-
-
-
-        $form_select = array(
-                             'type'          => VAR_TYPE_STRING,
-                             'required'      => false,
-                             'form_type'     => FORM_TYPE_SELECT,
-                             'error'         => '¥Õ¥©¡¼¥àÃÍɬ¿Ü¥¨¥é¡¼'
-                             );
-        $vld->af->setDef('namae_select', $form_select);
-
-        $pear_error = $vld->validate('namae_select', 'selection', $form_select);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_select', '', $form_select);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_select', false, $form_select);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_select', null, $form_select);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-
-        $form_select = array(
-                             'type'          => VAR_TYPE_STRING,
-                             'required'      => true,
-                             'form_type'     => FORM_TYPE_SELECT,
-                             'error'         => '¥Õ¥©¡¼¥àÃÍɬ¿Ü¥¨¥é¡¼'
-                             );
-        $vld->af->setDef('namae_select', $form_select);
-
-        $pear_error = $vld->validate('namae_select', 'selection', $form_select);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        // É¬¿Ü¥Õ¥©¡¼¥à¤¬ÁªÂò¤µ¤ì¤Ê¤¤
-        $pear_error = $vld->validate('namae_select', '', $form_select);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_REQUIRED, $pear_error->getCode());
-        $this->assertEqual($form_select['error'], $pear_error->getMessage());
-
-        $pear_error = $vld->validate('namae_select', false, $form_select);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_REQUIRED, $pear_error->getCode());
-        $this->assertEqual($form_select['error'], $pear_error->getMessage());
-
-        $pear_error = $vld->validate('namae_select', null, $form_select);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_REQUIRED, $pear_error->getCode());
-        $this->assertEqual($form_select['error'], $pear_error->getMessage());
-
-
-
-        $form_radio = array(
-                            'type'          => VAR_TYPE_STRING,
-                            'required'      => false,
-                            'form_type'     => FORM_TYPE_RADIO,
-                            'error'         => '¥Õ¥©¡¼¥àÃÍɬ¿Ü¥¨¥é¡¼'
-                            );
-        $vld->af->setDef('namae_radio', $form_radio);
-
-        $pear_error = $vld->validate('namae_radio', 'radio', $form_radio);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_radio', '', $form_radio);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_radio', false, $form_radio);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_radio', null, $form_radio);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-
-        $form_radio = array(
-                            'type'          => VAR_TYPE_STRING,
-                            'required'      => true,
-                            'form_type'     => FORM_TYPE_RADIO,
-                            'error'         => '¥Õ¥©¡¼¥àÃÍɬ¿Ü¥¨¥é¡¼'
-                            );
-        $vld->af->setDef('namae_radio', $form_radio);
-
-        $pear_error = $vld->validate('namae_radio', 'radio', $form_radio);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        // É¬¿Ü¥Õ¥©¡¼¥à¤¬ÁªÂò¤µ¤ì¤Ê¤¤
-        $pear_error = $vld->validate('namae_radio', '', $form_radio);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_REQUIRED, $pear_error->getCode());
-        $this->assertEqual($form_radio['error'], $pear_error->getMessage());
-
-        $pear_error = $vld->validate('namae_radio', false, $form_radio);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_REQUIRED, $pear_error->getCode());
-        $this->assertEqual($form_radio['error'], $pear_error->getMessage());
-
-        $pear_error = $vld->validate('namae_radio', null, $form_radio);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_REQUIRED, $pear_error->getCode());
-        $this->assertEqual($form_radio['error'], $pear_error->getMessage());
-
-
-
-        $form_checkbox = array(
-                               'required'      => false,
-                               'form_type'     => FORM_TYPE_CHECKBOX,
-                               'type'          => array(VAR_TYPE_BOOLEAN),
-                               'error'         => '¥Õ¥©¡¼¥àÃÍɬ¿Ü¥¨¥é¡¼',
-                               );
-        $vld->af->setDef('namae_checkbox', $form_checkbox);
-
-        $checks = array(
-                        '1st' => 0,
-                        '2nd' => 1,
-                        '3rd' => 3,
-                        '4th' => 'value'
-                        );
-        $pear_error = $vld->validate('namae_checkbox', $checks, $form_checkbox);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $checks = array();
-        $pear_error = $vld->validate('namae_checkbox', $checks, $form_checkbox);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_checkbox', null, $form_checkbox);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_checkbox', false, $form_checkbox);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-
-        $form_checkbox = array(
-                               'required'      => true,
-                               'form_type'     => FORM_TYPE_CHECKBOX,
-                               'type'          => array(VAR_TYPE_BOOLEAN),
-                               'error'         => '¥Õ¥©¡¼¥àÃÍɬ¿Ü¥¨¥é¡¼',
-                               );
-        $vld->af->setDef('namae_checkbox', $form_checkbox);
-
-        $checks = array(
-                        '1st' => 0,
-                        '2nd' => 1,
-                        '3rd' => 3,
-                        '4th' => 'value'
-                        );
-        $pear_error = $vld->validate('namae_checkbox', $checks, $form_checkbox);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        // É¬¿Ü¥Õ¥©¡¼¥à¤¬ÁªÂò¤µ¤ì¤Ê¤¤
-        $checks = array();
-        $pear_error = $vld->validate('namae_checkbox', $checks, $form_checkbox);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_REQUIRED, $pear_error->getCode());
-        $this->assertEqual($form_checkbox['error'], $pear_error->getMessage());
-
-        $pear_error = $vld->validate('namae_checkbox', null, $form_checkbox);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_REQUIRED, $pear_error->getCode());
-        $this->assertEqual($form_checkbox['error'], $pear_error->getMessage());
-
-        $pear_error = $vld->validate('namae_checkbox', false, $form_checkbox);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_REQUIRED, $pear_error->getCode());
-        $this->assertEqual($form_checkbox['error'], $pear_error->getMessage());
-
-
-
-        $form_checkbox = array(
-                               'required'      => true,
-                               'form_type'     => FORM_TYPE_CHECKBOX,
-                               'type'          => array(VAR_TYPE_BOOLEAN),
-                               'error'         => '¥Õ¥©¡¼¥àÃÍɬ¿Ü¥¨¥é¡¼',
-                               'key'           => '4th',
-                               'num'           => 4,
-                               );
-        $vld->af->setDef('namae_checkbox', $form_checkbox);
-
-        $checks = array(
-                        '1st' => 0,
-                        '2nd' => 1,
-                        '3rd' => 3,
-                        '4th' => 'value'
-                        );
-        $pear_error = $vld->validate('namae_checkbox', $checks, $form_checkbox);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        // ²¿¤é¤«¤Î½èÍý¤Çfalse¤Ë½ñ¤­´¹¤¨¤Æ¤·¤Þ¤Ã¤¿¾ì¹ç¤Ï¥¨¥é¡¼
-        $checks = array(
-                        '1st' => 0,
-                        '2nd' => 1,
-                        '3rd' => 3,
-                        '4th' => false
-                        );
-        $pear_error = $vld->validate('namae_checkbox', $checks, $form_checkbox);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_REQUIRED, $pear_error->getCode());
-        $this->assertEqual($form_checkbox['error'], $pear_error->getMessage());
-
-        // num error
-        $checks = array(
-                        '1st' => 0,
-                        '2nd' => 1,
-                        '3rd' => 'value'
-                        );
-        $pear_error = $vld->validate('namae_checkbox', $checks, $form_checkbox);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_REQUIRED, $pear_error->getCode());
-        $this->assertEqual($form_checkbox['error'], $pear_error->getMessage());
-
-        // key error
-        $checks = array(
-                        '1st' => 0,
-                        '2nd' => 'value',
-                        '3rd' => 2,
-                        '4' => 3
-                        );
-        $pear_error = $vld->validate('namae_checkbox', $checks, $form_checkbox);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_REQUIRED, $pear_error->getCode());
-        $this->assertEqual($form_checkbox['error'], $pear_error->getMessage());
-
-
-    }
-}
-?>
diff --git a/test/Ethna_Plugin_Validator_Type_Test.php b/test/Ethna_Plugin_Validator_Type_Test.php
deleted file mode 100644 (file)
index 6db7a3b..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-<?php
-/**
- *  Ethna_Plugin_Validator_Type_Test.php
- */
-
-/**
- *  Ethna_Plugin_Validator_Type¥¯¥é¥¹¤Î¥Æ¥¹¥È¥±¡¼¥¹
- *
- *  @access public
- */
-class Ethna_Plugin_Validator_Type_Test extends Ethna_UnitTestBase
-{
-    function testCheckValidatorType()
-    {
-        $ctl =& Ethna_Controller::getInstance();
-        $plugin =& $ctl->getPlugin();
-        $vld = $plugin->getPlugin('Validator', 'Type');
-
-        $form_int = array(
-                          'type'          => VAR_TYPE_INT,
-                          'required'      => true,
-                          'error'         => '{form}¤Ë¤Ï¿ô»ú(À°¿ô)¤òÆþÎϤ·¤Æ²¼¤µ¤¤'
-                          );
-        $vld->af->setDef('namae_int', $form_int);
-
-        $pear_error = $vld->validate('namae_int', 10, $form_int);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_int', '', $form_int);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_int', '76', $form_int);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        // À°¿ô°Ê³°¤Îʸ»úÎó¤¬ÆþÎϤµ¤ì¤¿
-        $pear_error = $vld->validate('namae_int', '11asd', $form_int);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_WRONGTYPE_INT, $pear_error->getCode());
-        $this->assertEqual($form_int['error'], $pear_error->getMessage());
-
-        // À°¿ô°Ê³°¤Îʸ»úÎó¤¬ÆþÎϤµ¤ì¤¿
-        $pear_error = $vld->validate('namae_int', '7.6', $form_int);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_WRONGTYPE_INT, $pear_error->getCode());
-        $this->assertEqual($form_int['error'], $pear_error->getMessage());
-
-
-
-        $form_float = array(
-                            'type'          => VAR_TYPE_FLOAT,
-                            'required'      => true,
-                            'error'         => '{form}¤Ë¤Ï¿ô»ú(¾®¿ô)¤òÆþÎϤ·¤Æ²¼¤µ¤¤'
-                            );
-        $vld->af->setDef('namae_float', $form_float);
-
-        $pear_error = $vld->validate('namae_float', 10.1, $form_float);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_float', 10, $form_float);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_float', '', $form_float);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        // ¿ô»ú°Ê³°¤Îʸ»úÎó¤¬ÆþÎϤµ¤ì¤¿
-        $pear_error = $vld->validate('namae_float', '1-0.1', $form_float);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_WRONGTYPE_FLOAT, $pear_error->getCode());
-        $this->assertEqual($form_float['error'], $pear_error->getMessage());
-
-
-
-        $form_boolean = array(
-                             'type'          => VAR_TYPE_BOOLEAN,
-                             'required'      => true,
-                             'error'         => '{form}¤Ë¤Ï1¤Þ¤¿¤Ï0¤Î¤ßÆþÎϤǤ­¤Þ¤¹'
-                             );
-        $vld->af->setDef('namae_boolean', $form_boolean);
-
-        $pear_error = $vld->validate('namae_boolean', 1, $form_boolean);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_boolean', 0, $form_boolean);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        $pear_error = $vld->validate('namae_boolean', '', $form_boolean);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        // 0,1°Ê³°¤Îʸ»ú¤¬ÆþÎϤµ¤ì¤¿
-        $pear_error = $vld->validate('namae_boolean', 'aaa', $form_boolean);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_WRONGTYPE_BOOLEAN, $pear_error->getCode());
-        $this->assertEqual($form_boolean['error'], $pear_error->getMessage());
-
-        // 0,1°Ê³°¤Îʸ»ú¤¬ÆþÎϤµ¤ì¤¿
-        $pear_error = $vld->validate('namae_boolean', 10.1, $form_boolean);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_WRONGTYPE_BOOLEAN, $pear_error->getCode());
-        $this->assertEqual($form_boolean['error'], $pear_error->getMessage());
-
-
-
-        $form_datetime = array(
-                               'type'          => VAR_TYPE_DATETIME,
-                               'required'      => true,
-                               'error'         => '{form}¤Ë¤ÏÆüÉÕ¤òÆþÎϤ·¤Æ²¼¤µ¤¤'
-                               );
-        $vld->af->setDef('namae_datetime', $form_datetime);
-
-        // Àµ¾ï¤ÊÆüÉÕ
-        $pear_error = $vld->validate('namae_datetime', "July 1, 2000 00:00:00 UTC", $form_datetime);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-        $pear_error = $vld->validate('namae_datetime', "+89 day", $form_datetime);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        // empty ¤Ï required ¤Ç¤ä¤ë¤Î¤Ç type ¤Ç¤Ï¥Á¥§¥Ã¥¯¤·¤Ê¤¤
-        $pear_error = $vld->validate('namae_datetime', "", $form_datetime);
-        $this->assertFalse(is_a($pear_error, 'PEAR_Error'));
-
-        // ÆüÉÕ¤ËÊÑ´¹¤Ç¤­¤Ê¤¤Ê¸»úÎó¤¬ÆþÎϤµ¤ì¤¿
-        $pear_error = $vld->validate('namae_datetime', "monkey", $form_datetime);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_WRONGTYPE_DATETIME, $pear_error->getCode());
-        $this->assertEqual($form_datetime['error'], $pear_error->getMessage());
-
-        // ÆüÉÕ¤ËÊÑ´¹¤Ç¤­¤Ê¤¤Ê¸»úÎó¤¬ÆþÎϤµ¤ì¤¿
-        $pear_error = $vld->validate('namae_datetime', "--1", $form_datetime);
-        $this->assertTrue(is_a($pear_error, 'PEAR_Error'));
-        $this->assertEqual(E_FORM_WRONGTYPE_DATETIME, $pear_error->getCode());
-        $this->assertEqual($form_datetime['error'], $pear_error->getMessage());
-
-    }
-}
-?>
diff --git a/test/Ethna_UnitTestBase.php b/test/Ethna_UnitTestBase.php
deleted file mode 100644 (file)
index c4c71a2..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php
-/**
- *  Ethna_UnitTestBase.php
- *
- *  @package    Ethna
- *  @author     ICHII Takashi <ichii386@schweetheart.jp>
- */
-
-/**
- *  Ethna¤Î¥Æ¥¹¥È¥±¡¼¥¹¤Î´ðÄ쥯¥é¥¹
- */
-class Ethna_UnitTestBase extends UnitTestCase
-{
-    /** @var    object  Ethna_Backend       backend¥ª¥Ö¥¸¥§¥¯¥È */
-    var $backend;
-
-    /** @var    object  Ethna_Controller    ¥³¥ó¥È¥í¡¼¥é¥ª¥Ö¥¸¥§¥¯¥È */
-    var $controller;
-
-    /** @var    object  Ethna_Controller    ¥³¥ó¥È¥í¡¼¥é¥ª¥Ö¥¸¥§¥¯¥È($controller¤Î¾Êά·Á) */
-    var $ctl;
-
-    function Ethna_UnitTestBase($label = false)
-    {
-        parent::UnitTestCase($label);
-
-        // controller
-        $this->ctl =& Ethna_Controller::getInstance();
-        if ($this->ctl === null) {
-            $this->ctl =&  new Ethna_Controller();
-        }
-        $this->controller =& $this->ctl;
-
-        // backend
-        $this->backend =& $this->ctl->getBackend();
-
-        // actionform
-        if ($this->ctl->action_form === null) {
-            $this->ctl->action_form =& new Ethna_ActionForm($this->ctl);
-            $this->backend->setActionForm($this->ctl->action_form);
-        }
-
-        // viewclass
-        if ($this->ctl->view === null) {
-            $this->ctl->view =& new Ethna_ViewClass($this->backend, '', '');
-        }
-    }
-}
-?>
diff --git a/test/Ethna_UrlHandler_Test.php b/test/Ethna_UrlHandler_Test.php
deleted file mode 100644 (file)
index f4b9431..0000000
+++ /dev/null
@@ -1,337 +0,0 @@
-<?php
-/**
- *  Ethna_UrlHandler_Test.php
- */
-
-/**
- *  Ethna_UrlHandler¥¯¥é¥¹¤Î¥Æ¥¹¥È¥±¡¼¥¹
- *
- *  @access public
- */
-class Ethna_UrlHandler_Test extends Ethna_UnitTestBase
-{
-    var $url_handler;
-
-    function setUp()
-    {
-        $this->url_handler =& new Ethna_UrlHandler_TestClass($this);
-    }
-
-    // {{{ $_simple_map
-    var $_simple_map = array(
-        'entrypoint' => array(
-            'test_foo_bar' => array(
-                'path'          => 'foo/bar',
-                'path_regexp'   => false,
-                'path_ext'      => false,
-            ),
-        ),
-    );
-    // }}}
-
-    // {{{ $_complex_map
-    var $_complex_map = array(
-        'entrypoint' => array(
-            'test_foo_bar' => array(
-                'path'          => 'foo/bar',
-                'path_regexp'   => array(
-                    'dummy_index1' => '|foo/bar/([^/]*)$|',
-                    'dummy_index2' => '|foo/bar/([^/]*)/([^/]*)$|',
-                ),
-                'path_ext'      => array(
-                    'dummy_index1' => array(
-                        'param1'   => array(),
-                    ),
-                    'dummy_index2' => array(
-                        'param1'   => array(),
-                        'param2'   => array(),
-                    ),
-                ),
-            ),
-        ),
-    );
-    // }}}
-
-    // {{{ $_prefix_suffix_map
-    var $_prefix_suffix_map = array(
-        'entrypoint' => array(
-            'test_foo_bar' => array(
-                'path'          => 'foo/bar',
-                'path_regexp'   => '|foo/bar/(.*)$|',
-                'path_ext'      => array(
-                    'param1' => array(
-                        'url_prefix'    => 'URL-',
-                        'url_suffix'    => '-URL',
-                        'form_prefix'   => 'FORM-',
-                        'form_suffix'   => '-FORM',
-                    ),
-                ),
-            ),
-        ),
-    );
-    // }}}
-
-    // {{{ test_requestToAction_simple
-    function test_requestToAction_simple()
-    {
-        // pathinfo ¤«¤é action ¼èÆÀ
-        $http_vars = array(
-            '__url_handler__'   => 'entrypoint',      // not empty
-            '__url_info__'      => '/foo/bar',  // null or not empty
-            'param3'            => 'value3',
-        );
-
-        $this->url_handler->action_map = $this->_simple_map;
-        $injected = $this->url_handler->requestToAction($http_vars);
-
-        // action ¤ò¼õ¤±¼è¤ë
-        $diff = array_diff($injected, $http_vars);
-        $this->assertEqual(count($diff), 1);
-        $this->assertEqual($diff['action_test_foo_bar'], true);
-
-        // action ¤ò¼õ¤±¼è¤ë°Ê³°¤ÎÊѲ½¤¬¤Ê¤¤¤³¤È¤ò³Îǧ
-        $diff = array_diff($http_vars, $injected);
-        $this->assertEqual(count($diff), 0);
-
-
-        // action ¤ò¼õ¤±¼è¤ë
-        $this->url_handler->action_map = $this->_complex_map;
-        $injected = $this->url_handler->requestToAction($http_vars);
-
-        $diff = array_diff($injected, $http_vars);
-        $this->assertEqual(count($diff), 1);
-        $this->assertEqual($diff['action_test_foo_bar'], true);
-
-    }
-    // }}}
-
-    // {{{ test_requestToAction_nopathinfo
-    function test_requestToAction_nopathinfo()
-    {
-        // pathinfo ¤Ê¤·
-        $http_vars = array(
-            '__url_handler__'   => 'entrypoint',
-            '__url_info__'      => null,
-        );
-
-        $this->url_handler->action_map = $this->_complex_map;
-        $injected = $this->url_handler->requestToAction($http_vars);
-
-        // ÊѲ½¤Ê¤·
-        $diff = array_diff($injected, $http_vars);
-        $this->assertEqual(count($diff), 0);
-    }
-    // }}}
-
-    // {{{ test_requestToAction_withparams1
-    function test_requestToAction_withparams1()
-    {
-        // pathinfo ¤«¤é action ¤È¥Ñ¥é¥á¡¼¥¿¤ò¼õ¤±¼è¤ë
-        $http_vars = array(
-            '__url_handler__'   => 'entrypoint',
-            '__url_info__'      => '/foo/bar/aaa',
-        );
-
-        // °ìÃפ¹¤ë action_map ¤¬¤Ê¤¤: ¥¨¥é¡¼¤È¤·¤Æ array() ¤òÊÖ¤¹
-        $this->url_handler->action_map = $this->_simple_map;
-        $injected = $this->url_handler->requestToAction($http_vars);
-        $this->assertEqual(count($injected), 0);
-
-
-        // action ¤È¥Ñ¥é¥á¡¼¥¿ param1 ¤ò¼õ¤±¼è¤ë
-        $this->url_handler->action_map = $this->_complex_map;
-        $injected = $this->url_handler->requestToAction($http_vars);
-
-        $diff = array_diff($injected, $http_vars);
-        $this->assertEqual(count($diff), 2);
-        $this->assertEqual($diff['action_test_foo_bar'], true);
-        $this->assertEqual($diff['param1'], 'aaa');
-    }
-    // }}}
-
-    // {{{ test_requestToAction_withparams2
-    function test_requestToAction_withparams2()
-    {
-        // pathinfo ¤«¤é action ¤ÈÊ£¿ô¤Î¥Ñ¥é¥á¡¼¥¿¤ò¼õ¤±¼è¤ë
-        $http_vars = array(
-            '__url_handler__'   => 'entrypoint',
-            '__url_info__'      => '/foo/bar/aaa/bbb',
-        );
-
-        $this->url_handler->action_map = $this->_complex_map;
-        $injected = $this->url_handler->requestToAction($http_vars);
-
-        $diff = array_diff($injected, $http_vars);
-        $this->assertEqual(count($diff), 3);
-        $this->assertEqual($diff['action_test_foo_bar'], true);
-        $this->assertEqual($diff['param1'], 'aaa');
-        $this->assertEqual($diff['param2'], 'bbb');
-    }
-    // }}}
-
-    // {{{ test_requestToAction_withparams3
-    function test_requestToAction_withparams3()
-    {
-        // ÄêµÁ¤µ¤ì¤¿°Ê¾å¤Î¥Ñ¥é¥á¡¼¥¿¤¬¤¢¤ë¾ì¹ç
-        $http_vars = array(
-            '__url_handler__'   => 'entrypoint',
-            '__url_info__'      => '/foo/bar/aaa/bbb/ccc',
-        );
-
-        $this->url_handler->action_map = $this->_complex_map;
-        $injected = $this->url_handler->requestToAction($http_vars);
-        $this->assertEqual(count($injected), 0);
-    }
-    // }}}
-
-    // {{{ test_requestToAction_misc
-    function test_requestToAction_misc()
-    {
-        // Èù̯¤Ê pathinfo ¤Î¥Á¥§¥Ã¥¯
-        $http_vars = array(
-            '__url_handler__'   => 'entrypoint',
-        );
-        $this->url_handler->action_map = $this->_complex_map;
-
-        // Í¾Ê¬¤Ê slash ¤¬Á°¸å¤Ë¤Ä¤¤¤Æ¤¤¤ë
-        $http_vars['__url_info__'] = '///foo///bar///value1///';
-        $injected = $this->url_handler->requestToAction($http_vars);
-        $diff = array_diff($injected, $http_vars);
-        $this->assertEqual($diff['action_test_foo_bar'], true);
-        $this->assertEqual($diff['param1'], 'value1');
-        $this->assertFalse(isset($diff['param2']));
-
-        // path ¤¬ '/./' ¤ò´Þ¤à
-        $http_vars['__url_info__'] = '/foo/bar/./value1';
-        $injected = $this->url_handler->requestToAction($http_vars);
-        $diff = array_diff($injected, $http_vars);
-        $this->assertEqual($diff['action_test_foo_bar'], true);
-        $this->assertEqual($diff['param1'], '.');
-        $this->assertEqual($diff['param2'], 'value1');
-
-        // path ¤¬ '/../' ¤ò´Þ¤à
-        $http_vars['__url_info__'] = '/foo/bar/../baz';
-        $injected = $this->url_handler->requestToAction($http_vars);
-        $diff = array_diff($injected, $http_vars);
-        $this->assertEqual($diff['action_test_foo_bar'], true);
-        $this->assertEqual($diff['param1'], '..');
-        $this->assertEqual($diff['param2'], 'baz');
-
-        // Ä¹¤¤¥ê¥¯¥¨¥¹¥È
-        $http_vars['__url_info__'] = '/foo/bar/' . str_repeat('a', 10000);
-        $injected = $this->url_handler->requestToAction($http_vars);
-        $diff = array_diff($injected, $http_vars);
-        $this->assertEqual($diff['action_test_foo_bar'], true);
-        $this->assertTrue(isset($diff['param1']));
-        $this->assertFalse(isset($diff['param2']));
-    }
-    // }}}
-
-    // {{{ test_requestToAction_prefix_suffix
-    function test_requestToAction_prefix_suffix()
-    {
-        $http_vars = array(
-            '__url_handler__'   => 'entrypoint',
-            '__url_info__'      => '/foo/bar/URL-value1-URL',
-            'param3'            => 'value3',
-        );
-
-        $this->url_handler->action_map = $this->_prefix_suffix_map;
-        $injected = $this->url_handler->requestToAction($http_vars);
-        $diff = array_diff($injected, $http_vars);
-        $this->assertEqual($diff['action_test_foo_bar'], true);
-        $this->assertEqual($diff['param1'], 'FORM-value1-FORM');
-    }
-    // }}}
-
-    // {{{ test_actionToRequest_simple
-    function test_actionToRequest_simple()
-    {
-        $action = 'test_foo_bar';
-        $param = array(
-            'hoge' => 'fuga',
-        );
-
-        $this->url_handler->action_map = $this->_simple_map;
-        $ret = $this->url_handler->actionToRequest($action, $param);
-        $this->assertFalse(is_null($ret));
-        list($path, $path_key) = $ret;
-
-        // action "test_foo_bar" ¤ËÂбþ¤¹¤ë¤Î¤Ï "entrypoint" ¤Î "/foo/bar"
-        $this->assertEqual($path, 'entrypoint/foo/bar');
-        $this->assertTrue($path_key == array());
-    }
-    // }}}
-
-    // {{{ test_actionToRequest_unknownaction
-    function test_actionToRequest_unknownaction()
-    {
-        $action = 'test_unknown_action';
-        $param = array(
-            'hoge' => 'fuga',
-        );
-
-        $this->url_handler->action_map = $this->_simple_map;
-        $ret = $this->url_handler->actionToRequest($action, $param);
-        $this->assertTrue(is_null($ret));
-    }
-    // }}}
-
-    // {{{ test_actionToRequest_param1
-    function test_actionToRequest_param1()
-    {
-        $action = 'test_foo_bar';
-        $param = array(
-            'hoge' => 'fuga',
-            'param1' => 'value1',
-        );
-
-        $this->url_handler->action_map = $this->_complex_map;
-        list($path, $path_key) = $this->url_handler->actionToRequest($action, $param);
-        $this->assertEqual($path, 'entrypoint/foo/bar/value1');
-        $this->assertTrue($path_key == array('param1'));
-    }
-    // }}}
-
-    // {{{ test_actionToRequest_param2
-    function test_actionToRequest_param2()
-    {
-        $action = 'test_foo_bar';
-        $param = array(
-            'hoge' => 'fuga',
-            'param1' => 'value1',
-            'param2' => 'value2',
-        );
-
-        $this->url_handler->action_map = $this->_complex_map;
-        list($path, $path_key) = $this->url_handler->actionToRequest($action, $param);
-        $this->assertEqual($path, 'entrypoint/foo/bar/value1/value2');
-        $this->assertEqual($path_key, array('param1', 'param2'));
-    }
-    // }}}
-}
-
-class Ethna_UrlHandler_TestClass extends Ethna_UrlHandler
-{
-    function _getPath_Entrypoint($action, $params)
-    {
-        return array('/entrypoint', array());
-    }
-
-    function _normalizerequest_Test($http_vars)
-    {
-        return $http_vars;
-    }
-
-    function _input_filter_Test($input)
-    {
-        return strtolower($input);
-    }
-
-    function _output_filter_Test($output)
-    {
-        return strtoupper($output);
-    }
-}
-
-?>
diff --git a/test/Ethna_Util_Test.php b/test/Ethna_Util_Test.php
deleted file mode 100644 (file)
index 593dbe4..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php
-/**
- *  Ethna_Util_Test.php
- */
-
-/**
- *  Ethna_Util¥¯¥é¥¹¤Î¥Æ¥¹¥È¥±¡¼¥¹(1)
- *
- *  @access public
- */
-class Ethna_Util_Test extends Ethna_UnitTestBase
-{
-    function testIsRootDir()
-    {
-        $this->assertTrue(DIRECTORY_SEPARATOR);
-
-        $util = new Ethna_Util;
-        if (OS_WINDOWS) {
-            $this->assertTrue($util->isRootDir("C:\\"));
-            $this->assertFalse($util->isRootDir("C:\\Program Files\\hoge\\fuga.txt"));
-            $this->assertFalse($util->isRootDir("C:\\Program Files\\hoge"));
-            $this->assertFalse($util->isRootDir("C:\\hoge\\"));
-            $this->assertFalse($util->isRootDir("C:\\hoge.txt"));
-        } else {
-            $this->assertFalse($util->isRootDir("/home/ethna/test.txt"));
-            $this->assertFalse($util->isRootDir("/home/ethna/"));
-            $this->assertFalse($util->isRootDir("/home/ethna"));
-            $this->assertFalse($util->isRootDir("/test.txt"));
-        }
-    }
-
-
-    function testCheckMailAddress()
-    {
-        $fail_words = array(
-            'hogehuga.net',
-            'untarakantara',
-            'example@example',
-            'example@.com',
-            'example@example@example.com',
-        );
-
-        foreach ($fail_words as $word) {
-            $this->assertFalse(Ethna_Util::checkMailAddress($word));
-        }
-        
-        $util = new Ethna_Util;
-        $result = $util->checkMailAddress('hogefuga.net');
-        $this->assertFalse($result);
-
-        $result = $util->checkMailAddress('hoge@fuga.net');
-        $this->assertTrue($result);
-    }
-
-    function testIsAbsolute()
-    {
-        $absolute_paths = array(
-            '/root',
-            '/home/user/giza',
-        );
-
-        $invalid_params = array(
-            '',
-            false,
-            true,
-            '0x1',
-        );
-
-        foreach ($absolute_paths as $path) {
-            $this->assertTrue(Ethna_Util::isAbsolute($path));
-        }
-        
-        foreach ($invalid_params as $path) {
-            $this->assertFalse(Ethna_Util::isAbsolute($path));
-        }
-     }
-}
-?>
diff --git a/test/Ethna_ViewClass_Test.php b/test/Ethna_ViewClass_Test.php
deleted file mode 100644 (file)
index f579ae3..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-<?php
-/**
- *  Ethna_ViewClass_Test.php
- *
- *  @package Ethna
- *  @author halt feits <halt.feits@gmail.com>
- */
-
-//error_reporting(E_ALL);
-
-/**
- *  Ethna_ViewClass¥¯¥é¥¹¤Î¥Æ¥¹¥È¥±¡¼¥¹
- *
- *  @package Ethna
- *  @author halt feits <halt.feits@gmail.com>
- *  @access public
- */
-class Ethna_ViewClass_Test extends Ethna_UnitTestBase
-{
-    /**
-     * Ethna_ViewClass
-     * @var     Ethna_ViewClass
-     * @access  protected
-     */
-    var $viewclass;
-
-    /**
-     * setUp
-     *
-     * make Ethna_ViewClass class
-     *
-     * @access public
-     * @param void
-     */
-    function setUp()
-    {
-        $this->viewclass =& $this->ctl->getView();
-    }
-
-    /**
-     * test_getFormInput_Html
-     *
-     * @access public
-     * @param void
-     */
-    function test_getFormInput_Html()
-    {
-        $actual = '<input type="text" name="test" value="&lt;&amp;&gt;" />';
-
-        $test_attr = array(
-            'type' => 'text',
-            'name' => 'test',
-            'value' => '<&>',
-        );
-
-        $result = $this->viewclass->_getFormInput_Html('input', $test_attr);
-
-        $this->assertEqual($result, $actual);
-    }
-
-    function test_getFormInput_Text()
-    {
-        $name = "test_text";
-        $def = array(
-            'max' => 20,
-        );
-        $params = array();
-
-        $test_form = array(
-            'test_text' => array(
-                'name' => 'TestTestText',
-                'form_type' => FORM_TYPE_TEXT,
-                'type' => VAR_TYPE_STRING,
-            ),                    
-        );
-
-        $this->viewclass->af->setDef(null, $test_form);
-
-        $result = $this->viewclass->_getFormInput_Text($name, $def, $params);
-    }
-
-    function test_getFormInput_Textarea()
-    {
-        $name = "content";
-        $params = array();
-
-        $test_form = array(
-            $name => array(
-                'name' => 'TestTestText',
-                'form_type' => FORM_TYPE_TEXTAREA,
-                'type' => VAR_TYPE_STRING,
-                'required' => true,
-            ),                    
-        );
-
-        $this->viewclass->af->setDef(null, $test_form);
-
-        $result = $this->viewclass->getFormInput($name, null, $params);
-
-        $this->assertTrue(strpos($result, '</textarea>'), "can't find textarea endtag [{$result}]");
-    }
-
-    function test_getFormInput_Select()
-    {
-        $name = "select";
-        $params = array();
-
-        $test_form = array(
-            'select' => array(
-                'name' => 'TestTestText',
-                'form_type' => FORM_TYPE_SELECT,
-                'type' => VAR_TYPE_STRING,
-                'option' => array('a', 'b', 'c'),
-            ),
-        );
-
-        $this->viewclass->af->setDef($name, $test_form);
-
-        $result = $this->viewclass->getFormInput($name, null, $params);
-
-        $this->assertTrue(!empty($result), "selectbox make error");
-    }
-
-    function test_getFormInput_Checkbox()
-    {
-        $this->assertTrue(defined('FORM_TYPE_CHECKBOX'), 'undefined FORM_TYPE_CHECKBOX');
-
-        $name = "check";
-        $params = array();
-
-        $test_form = array(
-            $name => array(
-                'name' => 'TestTestText',
-                'form_type' => FORM_TYPE_CHECKBOX,
-                'type' => array(VAR_TYPE_INT),
-                'option' => array('a', 'b', 'c'),
-            ),
-        );
-
-        $this->viewclass->af->setDef($name, $test_form);
-
-        $result = $this->viewclass->getFormInput($name, null, $params);
-
-        $this->assertTrue(!empty($result), "checkbox make error");
-    }
-
-    function test_getFormInput_Submit()
-    {
-        $this->assertTrue(defined('FORM_TYPE_SUBMIT'), 'undefined FORM_TYPE_SUBMIT');
-
-        $name = "post";
-        $params = array();
-
-        $test_form = array(
-            $name => array(
-                'name' => 'Preview',
-                'form_type' => FORM_TYPE_SUBMIT,
-                'type' => VAR_TYPE_STRING,
-            ),
-        );
-
-        $this->viewclass->af->setDef(null, $test_form);
-
-        $result = $this->viewclass->getFormInput($name, null, $params);
-
-        $this->assertTrue(!empty($result), "submit make error");
-        $this->assertFalse(strpos($result, 'default '), "invalid attribute");
-    }
-
-    function testGetFormName()
-    {
-        $test_word = "TestTestTest";
-
-        $test_form = array(
-            'test_text' => array(
-                'name' => 'TestTestTest',
-                'form_type' => FORM_TYPE_TEXT,
-                'type' => VAR_TYPE_STRING
-            ),
-        );
-        $params = array();
-
-        $this->viewclass->af->form = $test_form;
-
-        $result = $this->viewclass->getFormName('test_text', null, $params);
-        $this->assertEqual($result, $test_word);
-    }
-
-    function test_getFormInput_Button()
-    {
-        $name = 'btn';
-        $def = array(
-            'form_type' => FORM_TYPE_BUTTON,
-            );
-        $params = array();
-
-        // value¤Ê¤·
-        $this->viewclass->af->setDef($name, $def);
-        $result = $this->viewclass->getFormInput('btn', null, $params);
-        $this->assertTrue(strpos($result, 'value') === false);
-
-        // default¤Ï»ØÄꤷ¤Æ¤â̵°ÕÌ£
-        $params['default'] = 'hoge';
-        $this->viewclass->af->setDef($name, $def);
-        $result = $this->viewclass->getFormInput('btn', null, $params);
-        $this->assertTrue(strpos($result, 'value') === false);
-
-        // value¤ò»ØÄê
-        $params['value'] = 'fuga';
-        $this->viewclass->af->setDef($name, $def);
-        $result = $this->viewclass->getFormInput('btn', null, $params);
-        $this->assertTrue(strpos($result, 'value="fuga"'));
-    }
-
-    function test_getFormInput_Checkbox2()
-    {
-        $name = 'chkbx';
-        $def = array(
-            'form_type' => FORM_TYPE_CHECKBOX,
-            'type' => array(VAR_TYPE_STRING),
-            'option' => array(1=>1, 2=>2),
-            'default' => 2,
-            );
-        $params = array('separator' => "\n");
-
-        $expected =<<<EOS
-<label for="chkbx_1"><input type="checkbox" name="chkbx[]" value="1" id="chkbx_1" />1</label>
-<label for="chkbx_2"><input type="checkbox" name="chkbx[]" value="2" id="chkbx_2" checked="checked" />2</label>
-EOS;
-
-        // def ¤Î default »ØÄê¤Ç int(2) ¤Ë check
-        $this->viewclass->af->setDef($name, $def);
-        $result = $this->viewclass->getFormInput('chkbx', null, $params);
-        $this->assertEqual($result, $expected);
-
-        // params ¤Î default »ØÄê¤Ç int(2) ¤Ë check
-        $def['default'] = 1;
-        $params['default'] = 2; // params¤¬Í¥Àè
-        $this->viewclass->af->setDef($name, $def);
-        $result = $this->viewclass->getFormInput('chkbx', null, $params);
-        $this->assertEqual($result, $expected);
-
-        // params ¤Î default »ØÄê¤Ç string(1) "2" ¤Ë check
-        $params['default'] = '2';
-        $this->viewclass->af->setDef($name, $def);
-        $result = $this->viewclass->getFormInput('chkbx', null, $params);
-        $this->assertEqual($result, $expected);
-    }
-
-    function test_default_value()
-    {
-        $name = 'testform';
-        $def = array();
-        $params = array();
-
-        // default¤âvalue¤â¤Ê¤¤¤È¤­
-        $this->viewclass->af->setDef($name, $def);
-        $result = $this->viewclass->getFormInput('testform', null, $params);
-        $this->assertTrue(strpos($result, 'value=""'));
-
-        // default¤¬¤¢¤ë¤È¤­
-        $params['default'] = 'hoge';
-        unset($params['value']);
-        $this->viewclass->af->setDef($name, $def);
-        $result = $this->viewclass->getFormInput('testform', null, $params);
-        $this->assertTrue(strpos($result, 'value="hoge"'));
-
-        // value¤¬¤¢¤ë¤È¤­
-        unset($params['default']);
-        $params['value'] = 'fuga';
-        $this->viewclass->af->setDef($name, $def);
-        $result = $this->viewclass->getFormInput('testform', null, $params);
-        $this->assertTrue(strpos($result, 'value="fuga"'));
-
-        // default, valueξÊý¤¬¤¢¤ë¤È¤­: value¤¬Í¥Àè
-        $params['default'] = 'hogefuga';
-        $params['value'] = 'foobar';
-        $this->viewclass->af->setDef($name, $def);
-        $result = $this->viewclass->getFormInput('testform', null, $params);
-        $this->assertTrue(strpos($result, 'value="foobar"'));
-    }
-}
-?>
diff --git a/test/TextDetailReporter.php b/test/TextDetailReporter.php
deleted file mode 100644 (file)
index 627150b..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-<?php
-/**
- * TextDetailReporter.php
- *
- */
-
-/**
- * TextDetailReporter
- *
- */
-class TextDetailReporter extends SimpleReporter {
-
-    /**
-     *    Does nothing yet. The first output will
-     *    be sent on the first test start.
-     *    @access public
-     */
-    function TextDetailReporter()
-    {
-        $this->SimpleReporter();
-    }
-
-    /**
-     *    Paints the title only.
-     *    @param string $test_name        Name class of test.
-     *    @access public
-     */
-    function paintHeader($test_name) {
-        if (!SimpleReporter::inCli()) {
-            header('Content-type: text/plain');
-        }
-        print "{$test_name}\n";
-        flush();
-    }
-
-    /**
-     *    Paints the end of the test with a summary of
-     *    the passes and failures.
-     *    @param string $test_name        Name class of test.
-     *    @access public
-     */
-    function paintFooter($test_name) {
-        if ($this->getFailCount() + $this->getExceptionCount() == 0) {
-            print "\nAll OK\n";
-        } else {
-            print "\nFAILURES!!!\n";
-        }
-        print "Test cases run: " . $this->getTestCaseProgress() .
-            "/" . $this->getTestCaseCount() .
-            ", Passes: " . $this->getPassCount() .
-            ", Failures: " . $this->getFailCount() .
-            ", Exceptions: " . $this->getExceptionCount() . "\n";
-    }
-
-    /**
-     *    Paints the test failure as a stack trace.
-     *    @param string $message    Failure message displayed in
-     *                              the context of the other tests.
-     *    @access public
-     */
-    function paintFail($message) {
-        parent::paintFail($message);
-        print $this->getFailCount() . ") $message\n";
-        $breadcrumb = $this->getTestList();
-        array_shift($breadcrumb);
-        print "\tin " . implode("\n\tin ", array_reverse($breadcrumb));
-        print "\n";
-    }
-
-    /**
-     *    Paints a PHP error or exception.
-     *    @param string $message        Message is ignored.
-     *    @access public
-     *    @abstract
-     */
-    function paintError($message) {
-        parent::paintError($message);
-        print "Exception " . $this->getExceptionCount() . "!\n$message\n";
-    }
-
-    /**
-     *    Paints formatted text such as dumped variables.
-     *    @param string $message        Text to show.
-     *    @access public
-     */
-    function paintFormattedMessage($message) {
-        print "$message\n";
-        flush();
-    }
-
-    function paintMethodStart($test_name)
-    {
-        //print "Start {$test_name} Test\n";
-        print "  |--- {$test_name}";
-        $this->before_fails = $this->_fails;
-    }
-
-    var $before_fails = 0;
-    
-    function paintMethodEnd($test_name)
-    {
-        //print "End {$test_name} Test\n";
-        if ($this->before_fails != $this->_fails) {
-            print " - NG";
-        } else {
-            print " - OK";
-        }
-        print "\n";
-    }
-
-    function paintCaseStart($test_name)
-    {
-        print "\n {$test_name}\n";
-        return parent::paintCaseStart($test_name);
-    }
-}
-?>
diff --git a/test/run_test.stdin.txt b/test/run_test.stdin.txt
deleted file mode 100644 (file)
index af992b3..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-y
-n
-
diff --git a/tpl/info.tpl b/tpl/info.tpl
deleted file mode 100644 (file)
index efb4593..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<html>
-    <head>
-        <meta http-equiv="content-type" content="text/html;charset=EUC-JP" />
-        <style type="text/css">
-        <!--
-        {literal}
-            body {
-                margin: auto;
-                background-color: #ffffff;
-                color: #000000;
-            }
-            body, td, th, h1, h2 {font-family: sans-serif;}
-            pre {margin: 0px; font-family: monospace;}
-            a:link {color: #000099; text-decoration: none; background-color: #ffffff;}
-            a:hover {text-decoration: underline;}
-            table { margin: auto; border-collapse: collapse;}
-            .center {text-align: center;}
-            .center table { text-align: left;}
-            .center th { text-align: center !important; }
-            td, th { border: 1px solid #000000; font-size: 75%; vertical-align: top;}
-            h1 {font-size: 150%;}
-            h2 {font-size: 125%;}
-            .p {text-align: left;}
-            .e {background-color: #ccccff; font-weight: bold; color: #000000;}
-            .h {background-color: #9999cc; font-weight: bold; color: #000000;}
-            .v {background-color: #cccccc; color: #000000;}
-            i {color: #666666; background-color: #cccccc;}
-            img {float: right; border: 0px;}
-            hr {width: 600px; background-color: #cccccc; border: 0px; height: 1px; color: #000000;}
-            .header {
-                margin: auto;
-                width:600px;
-                background-color: #9999cc;
-                padding:0.2em;
-                border:solid 1px black;
-            }
-        {/literal}
-        //-->
-        </style>
-        <title>{$app.app_id} - Ethna Info</title>
-    </head>
-    <body>
-        <div class="center">
-            <div class="header">
-                <h1>{$app.app_id}</h1>
-            </div>
-            <br />
-            <hr />
-            Contents
-            <hr />
-            <table border="0" cellpadding="3" width="600">
-                <tr>
-                    <td style="border:0px">
-                        <ul>
-                            <li><a href="#actions">Actions</a></li>
-                                <ol>
-                                {foreach from=$app.action_list key=action_name item=action}
-                                    <li><a href="#action_{$action_name}">{$action_name}</a></li>
-                                {/foreach}
-                                </ol>
-                            <li><a href="#forwards">Forwards</a></li>
-                                <ol>
-                                {foreach from=$app.forward_list key=forward_name item=forward}
-                                    <li><a href="#forward_{$forward_name}">{$forward_name}</a></li>
-                                {/foreach}
-                                </ol>
-                            <li><a href="#configuration">Configuration</a></li>
-                            <li><a href="#plugins">Plugins</a></li>
-                                <ol>
-                                {foreach from=$app.plugin_list key=plugin_type item=plugin}
-                                    <li><a href="#plugin_{$plugin_type}">{$plugin_type}</a></li>
-                                {/foreach}
-                                </ol>
-                        </ul>
-                    </td>
-                </tr>
-            </table>
-            <br />
-            <a name="actions"></a>
-            <h1>Actions</h1>
-
-            <table border="0" cellpadding="3" width="600">
-                {foreach from=$app.action_list key=action_name item=action}
-                <tr class="h">
-                    <th colspan="3"><a name="action_{$action_name}"></a>{$action_name}</th>
-                </tr>
-                <tr>
-                    <td class="e">¥¢¥¯¥·¥ç¥ó¥¯¥é¥¹</td>
-                    <td class="v" colspan="2">
-                        {$action.action_class}{if $action.action_class_info.undef}<i>(̤ÄêµÁ)</li>{/if}
-                    </td>
-                </tr>
-                <tr>
-                    <td class="e">¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à</td>
-                    <td class="v" colspan="2">{$action.action_form|default:"<i>(̤ÄêµÁ)</i>"}{if $action.action_form_info.undef}<i>(̤ÄêµÁ)</li>{/if}</td>
-                </tr>
-                <tr>
-                    {if $action.action_form_info.form|@count == 0}
-                    <td class="e">¥Õ¥©¡¼¥àÃÍ</td>
-                    {else}
-                    <td class="e" rowspan="{$action.action_form_info.form|@count}">¥Õ¥©¡¼¥àÃÍ</td>
-                    {/if}
-                    {foreach name="form" from=$action.action_form_info.form key=form_name item=form}
-                        {if !$smarty.foreach.form.first}<tr>{/if}
-                        <td class="v">{$form_name}</td>
-                        <td class="v">
-                            <table cellpadding="1">
-                                <tr>
-                                    <td style="border:0px; font-size:100%;">ɽ¼¨Ì¾</td>
-                                    <td style="border:0px; font-size:100%;">{$form.name|default:"<i>̤ÄêµÁ</i>"}</td>
-                                </tr>
-                                <tr>
-                                    <td style="border:0px; font-size:100%;">ɬ¿Ü</td>
-                                    <td style="border:0px; font-size:100%;">{$form.required|default:"false"}</td>
-                                </tr>
-                                <tr>
-                                    <td style="border:0px; font-size:100%;">ºÇÂçÃÍ</td>
-                                    <td style="border:0px; font-size:100%;">{$form.max|default:"<i>̤ÄêµÁ</i>"}</td>
-                                </tr>
-                                <tr>
-                                    <td style="border:0px; font-size:100%;">ºÇ¾®ÃÍ</td>
-                                    <td style="border:0px; font-size:100%;">{$form.min|default:"<i>̤ÄêµÁ</i>"}</td>
-                                </tr>
-                                <tr>
-                                    <td style="border:0px; font-size:100%;">Àµµ¬É½¸½</td>
-                                    <td style="border:0px; font-size:100%;">{$form.regexp|default:"<i>̤ÄêµÁ</i>"}</td>
-                                </tr>
-                                <tr>
-                                    <td style="border:0px; font-size:100%;">¥Á¥§¥Ã¥¯¥á¥½¥Ã¥É</td>
-                                    <td style="border:0px; font-size:100%;">{$form.custom|default:"<i>̤ÄêµÁ</i>"}</td>
-                                </tr>
-                                <tr>
-                                    <td style="border:0px; font-size:100%;">ÊÑ´¹¥Õ¥£¥ë¥¿</td>
-                                    <td style="border:0px; font-size:100%;">{$form.filter|default:"<i>̤ÄêµÁ</i>"|nl2br}</td>
-                                </tr>
-                                <tr>
-                                    <td style="border:0px; font-size:100%;">¥Õ¥©¡¼¥à¥¿¥¤¥×</td>
-                                    <td style="border:0px; font-size:100%;">{$form.form_type|default:"<i>̤ÄêµÁ</i>"}</td>
-                                </tr>
-                                <tr>
-                                    <td style="border:0px; font-size:100%;">¥¿¥¤¥×</td>
-                                    <td style="border:0px; font-size:100%;">{$form.type|default:"<i>̤ÄêµÁ</i>"}</td>
-                                </tr>
-                            </table>
-                        </td>
-                        {if !$smarty.foreach.form.last}</tr>{/if}
-                    {foreachelse}
-                        <td class="v" colspan="2"></td>
-                    {/foreach}
-                </tr>
-                <tr>
-                    {if $action.action_class_info.return.prepare|@count == 0}
-                    <td class="e">Á«°ÜÀè(prepare)</td>
-                    {else}
-                    <td class="e" rowspan="{$action.action_class_info.return.prepare|@count}">Á«°ÜÀè(prepare)</td>
-                    {/if}
-                    {foreach name="return_prepare" from=$action.action_class_info.return.prepare item=forward}
-                        {if !$smarty.foreach.return_prepare.first}<tr>{/if}
-                        <td class="v" colspan="2">{$forward}</td>
-                        {if !$smarty.foreach.return_prepare.last}</tr>{/if}
-                    
-                    {foreachelse}
-                        
-                        <td class="v" colspan="2"></td>
-                    
-                    {/foreach}
-                
-                </tr>
-                <tr>
-                    {if $action.action_class_info.return.perform|@count == 0}
-                    <td class="e" >Á«°ÜÀè(perform)</td>
-                    {else}
-                    <td class="e" rowspan="{$action.action_class_info.return.perform|@count}">Á«°ÜÀè(perform)</td>
-                    {/if}
-                    {foreach name="return_perform" from=$action.action_class_info.return.perform item=forward}
-                        {if !$smarty.foreach.return_perform.first}<tr>{/if}
-                        <td class="v" colspan="2">{$forward}</td>
-                        {if !$smarty.foreach.return_perform.last}</tr>{/if}
-                    {foreachelse}
-                        <td class="v" colspan="2"></td>
-                    {/foreach}
-                </tr>
-                {/foreach}
-            </table>
-            <br />
-
-            <a name="forwards"></a>
-            <h1>Forwards</h1>
-
-            <table border="0" cellpadding="3" width="600">
-                {foreach from=$app.forward_list key=forward_name item=forward}
-                <tr class="h">
-                    <th colspan="2">
-                        <a name="forward_{$forward_name}"></a>
-                        {$forward_name}
-                    </th>
-                </tr>
-                <tr>
-                    <td class="e">¥Ó¥å¡¼¥¯¥é¥¹</td>
-                    <td class="v">{$forward.view_class|default:"<i>̤ÄêµÁ</i>"}</td>
-                </tr>
-                <tr>
-                    <td class="e">¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë</td>
-                    <td class="v">{$forward.template_file}</td>
-                </tr>
-                {/foreach}
-            </table>
-            <br />
-
-            <a name="configuration"></a>
-            <h1>Configuration</h1>
-
-            <table border="0" cellpadding="3" width="600">
-            {foreach from=$app.configuration key=section_name item=section}
-                {if $section_name}
-                    <tr class="h">
-                        <th class="h" colspan="2">{$section_name}</th>
-                    </tr>
-                {/if}
-                {if count($section) == 0}
-                    <tr>
-                        <td class="v" colspan="2">N/A</td>
-                    </tr>
-                {else}
-                    {foreach from=$section key=entry_name item=entry}
-                    <tr>
-                        <td class="e">{$entry_name}</td>
-                        <td class="v">{$entry|nl2br}</td>
-                    </tr>
-                    {/foreach}
-                {/if}
-            {/foreach}
-            </table>
-
-            <br />
-
-            <a name="plugins"></a>
-            <h1>Plugins</h1>
-
-            <table border="0" cellpadding="3" width="600">
-                {foreach from=$app.plugin_list key=plugin_type item=plugin}
-                <tr class="h">
-                    <th colspan="2">
-                        <a name="plugin_{$plugin_type}"></a>
-                        {$plugin_type}
-                    </th>
-                </tr>
-                    {foreach from=$plugin key=plugin_name item=plugin_class}
-                    <tr>
-                        <td class="e">{$plugin_name}</td>
-                        <td class="v">{$plugin_class}</td>
-                    </tr>
-                    {/foreach}
-                {/foreach}
-            </table>
-            <br />
-
-            <hr />
-            powered by <a href="http://ethna.jp/">Ethna {$app.ethna_version}</a> (experimental)
-            <hr />
-        </div>
-    </body>
-</html>
diff --git a/tpl/unittest.tpl b/tpl/unittest.tpl
deleted file mode 100644 (file)
index aeb3b3e..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html lang="ja">
-<head>
-  <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP">
-  <meta http-equiv="Content-Style-Type" content="text/css">
-    <title>{$app.app_id} - Ethna UnitTest</title>
-    <style type="text/css">
-        <!--
-        {literal}
-            body {
-                margin: auto;
-                background-color: #ffffff;
-                color: #000000;
-            }
-            body, td, th, h1, h2 {font-family: sans-serif;}
-            pre {margin: 0px; font-family: monospace;}
-            a:link {color: #000099; text-decoration: none; background-color: #ffffff;}
-            a:hover {text-decoration: underline;}
-            table { margin: auto; border-collapse: collapse;}
-            .center {text-align: center;}
-            .center table { text-align: left;}
-            .center th { text-align: center !important; }
-            td, th { border: 1px solid #000000; font-size: 75%; vertical-align: top;}
-            h1 {font-size: 150%;}
-            h2 {font-size: 125%;}
-            .p {text-align: left;}
-            .e {background-color: #ccccff; font-weight: bold; color: #000000;}
-            .h {background-color: #9999cc; font-weight: bold; color: #000000;}
-            .v {background-color: #cccccc; color: #000000;}
-            .vf {background-color: #cccccc; color: red;}
-            i {color: #666666; background-color: #cccccc;}
-            img {float: right; border: 0px;}
-            hr {width: 600px; background-color: #cccccc; border: 0px; height: 1px; color: #000000;}
-            .header {
-                margin: auto;
-                width:600px;
-                background-color: #9999cc;
-                padding:0.2em;
-                border:solid 1px black;
-            }
-        {/literal}
-        //-->
-        </style>
-</head>
-  <body>
-    <div class="center">
-      <div class="header"><h1>{$app.app_id}</h1></div>
-      <h2>Report</h2>
-      <table border="0" cellpadding="2" width="600">
-      {foreach from=$app.report key="key" item="item"}
-        {if $item.type=='Pass'}
-          <tr>
-            <th class="e">{$item.test}</th>
-            <td class="v">{$item.message}</td>
-          </tr>
-        {elseif $item.type=='CaseEnd'}
-        {elseif $item.type=='CaseStart'}
-          <tr class="h">
-            <th colspan="2">{$item.test_name}</th>
-          </tr>
-        {elseif $item.type=='Exception'}
-          <tr>
-            <th class="e">{$item.test}</th>
-            <td class="vf">Exception 
-              <ul>{foreach from=$item.breadcrumb item="crumb"}<li>{$crumb}</li>{/foreach}</ul><strong>{$message|escape:"html"}</strong><br />
-            </td>
-          </tr>
-        {elseif $item.type=='Fail'}
-          <tr>
-            <th class="e">{$item.test}</th>
-            <td class="vf"><strong>Fail</strong> {$item.message}</td>
-          </tr>
-        {else}
-          <tr class="v">
-            <td colspan="2">{$item.message}</td>
-          </tr>
-        {/if} 
-      {/foreach}
-      </table>
-      <h2>Result</h2>
-      <p>
-        {$app.result.TestCaseProgress}/{$app.result.TestCaseCount} test cases complete:
-        <strong>{$app.result.PassCount}</strong> passes, 
-        <strong>{$app.result.FailCount}</strong> fails and 
-        <strong>{$app.result.ExceptionCount}</strong> exceptions.
-      </p>
-      <br />
-      <hr />
-      powered by <a href="http://ethna.jp/">Ethna {$app.ethna_version}</a> (experimental)
-      <hr />
-    </div>
-  </body>
-</html>