Class Ethna_Controller

Description

コントローラクラス

  • author: Masaki Fujimoto <fujimoto@php.net>
  • todo: gatewayでswitchしてるところがダサダサ
  • access: public

Located in /class/Ethna_Controller.php (line 22)


	
			
Method Summary
 static mixed &checkActionName (string $action_name)
 static mixed &checkAppId (string $id)
 static mixed &checkViewName (string $view_name)
 static void main (string $class_name, [mixed $action_name = ""], [mixed $fallback_action_name = ""])
 static void main_CLI (string $class_name, string $action_name, [bool $enable_filter = true])
 static void main_SOAP (string $class_name, [mixed $action_name = ""], [mixed $fallback_action_name = ""])
 static void main_XMLRPC ( $class_name)
 Ethna_Controller Ethna_Controller ([ $gateway = GATEWAY_WWW])
 string actionClassToName (string $class_name)
 string actionFormToName (string $class_name)
 void ethnaManagerCheckErrorMsg ( $action_name)
 string forwardPathToName (string $forward_path)
 string getActionClassName (string $action_name)
 string getActiondir ([ $gateway = null])
 string getActionFormName (string $action_name)
 void getActionRequest (string $action, [string $type = "hidden"])
 string getAppId ()
 string getBasedir ()
 bool getCLI ()
 string getDBType ([string $db_key = null])
 string getDefaultActionClass (string $action_name, [ $gateway = null])
 string getDefaultActionPath (string $action_name)
 string getDefaultFormClass (string $action_name, [ $gateway = null])
 string getDefaultFormPath (string $action_name)
 string getDefaultForwardPath (string $forward_name)
 string getDefaultViewClass (string $forward_name, [ $gateway = null])
 string getDefaultViewPath (string $forward_name)
 string getDirectory (string $key)
 string getDSN ([string $db_key = ""])
 bool getDSN_persistent ([string $db_key = ""])
 string getErrorMessage (int $code)
 string getExt (string $key)
 void getGateway ()
 array getLanguage ()
 string getManagerClassName (string $name)
 array getManagerList ()
 string getObjectClassName (string $name)
 string getTemplatedir ()
 string getTestdir ()
 string getURL ()
 object Ethna_View &getView ()
 string getViewClassName (string $forward_name)
 string getViewdir ()
 void setCLI (bool $cli)
 void setGateway ( $gateway)
 mixed trigger ([mixed $default_action_name = ""], [mixed $fallback_action_name = ""], [bool $enable_filter = true])
 void trigger_XMLRPC ( $method,  $param)
 int _getDefaultGateway ( $gateway)
 string _getGatewayPrefix ([string $gateway = null])
 array _prepareDSN ()
 string _selectDSN (string $type, array $dsn_list)
 void _setLanguage (string $language, [string $system_encoding = null], [string $client_encoding = null])
 string _sortForward (string $action_name, string $retval)
Methods
static checkActionName (line 321)

アクション名をチェックする

  • return: true:OK Ethna_Error:NG
  • access: public
mixed &checkActionName (string $action_name)
  • string $action_name: アクション名
static checkAppId (line 298)

アプリケーションIDをチェックする

  • return: true:OK Ethna_Error:NG
  • access: public
mixed &checkAppId (string $id)
  • string $id: アプリケーションID
static checkViewName (line 339)

ビュー名をチェックする

  • return: true:OK Ethna_Error:NG
  • access: public
mixed &checkViewName (string $view_name)
  • string $view_name: ビュー名
static getInstance (line 269)

(現在アクティブな)コントローラのインスタンスを返す

  • return: コントローラのインスタンス
  • access: public
object Ethna_Controller &getInstance ()
static main (line 732)

アプリケーションのエントリポイント

  • access: public
void main (string $class_name, [mixed $action_name = ""], [mixed $fallback_action_name = ""])
  • string $class_name: アプリケーションコントローラのクラス名
  • mixed $action_name: 指定のアクション名(省略可)
  • mixed $fallback_action_name: アクションが決定できなかった場合に実行されるアクション名(省略可)
static main_CLI (line 747)

CLIアプリケーションのエントリポイント

  • access: public
void main_CLI (string $class_name, string $action_name, [bool $enable_filter = true])
  • string $class_name: アプリケーションコントローラのクラス名
  • string $action_name: 実行するアクション名
  • bool $enable_filter: フィルタチェインを有効にするかどうか
static main_SOAP (line 779)

SOAPアプリケーションのエントリポイント

  • access: public
void main_SOAP (string $class_name, [mixed $action_name = ""], [mixed $fallback_action_name = ""])
  • string $class_name: アプリケーションコントローラのクラス名
  • mixed $action_name: 指定のアクション名(省略可)
  • mixed $fallback_action_name: アクションが決定できなかった場合に実行されるアクション名(省略可)
static main_XMLRPC (line 760)

XMLRPCアプリケーションのエントリポイント

  • access: public
void main_XMLRPC ( $class_name)
  • $class_name
Constructor Ethna_Controller (line 187)

Ethna_Controllerクラスのコンストラクタ

  • access: public
Ethna_Controller Ethna_Controller ([ $gateway = GATEWAY_WWW])
  • $gateway
actionClassToName (line 1468)

getDefaultActionClass()で取得したクラス名からアクション名を取得する

getDefaultActionClass()をオーバーライドした場合、こちらも合わせてオーバーライド することを推奨(必須ではない)

  • return: アクション名
  • access: public
string actionClassToName (string $class_name)
  • string $class_name: アクションクラス名
actionFormToName (line 1391)

getDefaultFormClass()で取得したクラス名からアクション名を取得する

getDefaultFormClass()をオーバーライドした場合、こちらも合わせてオーバーライド することを推奨(必須ではない)

  • return: アクション名
  • access: public
string actionFormToName (string $class_name)
  • string $class_name: フォームクラス名
ethnaManagerCheckErrorMsg (line 2120)

Ethnaマネージャが実行不能な場合のエラーメッセージを 表示する。運用上の都合でこのメッセージを出力したくない 場合は、このメソッドをオーバーライドせよ

  • access: protected
void ethnaManagerCheckErrorMsg ( $action_name)
  • $action_name
forwardPathToName (line 1608)

テンプレートパス名から遷移名を取得する

getDefaultForwardPath()をオーバーライドした場合、こちらも合わせてオーバーライド することを推奨(必須ではない)

  • return: 遷移名
  • access: public
string forwardPathToName (string $forward_path)
  • string $forward_path: テンプレートパス名
getActionClassName (line 1428)

指定されたアクションのクラス名を返す(オブジェクトの生成は行わない)

  • return: アクションのクラス名
  • access: public
string getActionClassName (string $action_name)
  • string $action_name: アクションの名称
getActiondir (line 448)

アクションディレクトリ名を決定する

  • return: アクションディレクトリ
  • access: public
string getActiondir ([ $gateway = null])
  • $gateway
getActionError (line 541)

アクションエラーオブジェクトのアクセサ

  • return: アクションエラーオブジェクト
  • access: public
object Ethna_ActionError &getActionError ()
getActionForm (line 552)

アクションフォームオブジェクトのアクセサ

  • return: アクションフォームオブジェクト
  • access: public
object Ethna_ActionForm &getActionForm ()
getActionFormName (line 1351)

指定されたアクションのフォームクラス名を返す(オブジェクトの生成は行わない)

  • return: アクションのフォームクラス名
  • access: public
string getActionFormName (string $action_name)
  • string $action_name: アクション名
getActionRequest (line 1205)

アクション名を指定するクエリ/HTMLを生成する

  • todo: consider gateway
  • access: public
void getActionRequest (string $action, [string $type = "hidden"])
  • string $action: action to request
  • string $type: hidden, url...
getAppId (line 285)

アプリケーションIDを返す

  • return: アプリケーションID
  • access: public
string getAppId ()
getBackend (line 576)

backendオブジェクトのアクセサ

  • return: backendオブジェクト
  • access: public
object Ethna_Backend &getBackend ()
getBasedir (line 419)

アプリケーションベースディレクトリを返す

  • return: アプリケーションベースディレクトリ
  • access: public
string getBasedir ()
getClassFactory (line 530)

クラスファクトリオブジェクトのアクセサ(R)

  • return: クラスファクトリオブジェクト
  • access: public
object Ethna_ClassFactory &getClassFactory ()
getCLI (line 2140)

CLI実行中フラグを取得する

  • return: CLI実行中フラグ
  • access: public
bool getCLI ()
getConfig (line 587)

設定オブジェクトのアクセサ

  • return: 設定オブジェクト
  • access: public
object Ethna_Config &getConfig ()
getCurrentActionName (line 676)

実行中のアクション名を返す

  • return: 実行中のアクション名
  • access: public
string getCurrentActionName ()
getDBType (line 389)

DB設定を返す

  • access: public
string getDBType ([string $db_key = null])
  • string $db_key: DBキー("", "r", "rw", "default", "blog_r"...)
getDefaultActionClass (line 1447)

アクションに対応するアクションクラス名が省略された場合のデフォルトクラス名を返す

デフォルトでは[プロジェクトID]_Action_[アクション名]となるので好み応じてオーバライドする

  • return: アクションクラス名
  • access: public
string getDefaultActionClass (string $action_name, [ $gateway = null])
  • string $action_name: アクション名
  • $gateway
getDefaultActionPath (line 1491)

アクションに対応するアクションパス名が省略された場合のデフォルトパス名を返す

デフォルトでは"foo_bar" -> "/Foo/Bar.php"となるので好み応じてオーバーライドする

  • return: アクションクラスが定義されるスクリプトのパス名
  • access: public
string getDefaultActionPath (string $action_name)
  • string $action_name: アクション名
getDefaultFormClass (line 1370)

アクションに対応するフォームクラス名が省略された場合のデフォルトクラス名を返す

デフォルトでは[プロジェクトID]_Form_[アクション名]となるので好み応じてオーバライドする

  • return: アクションフォーム名
  • access: public
string getDefaultFormClass (string $action_name, [ $gateway = null])
  • string $action_name: アクション名
  • $gateway
getDefaultFormPath (line 1416)

アクションに対応するフォームパス名が省略された場合のデフォルトパス名を返す

デフォルトでは_getDefaultActionPath()と同じ結果を返す(1ファイルに アクションクラスとフォームクラスが記述される)ので、好みに応じて オーバーライドする

  • return: form classが定義されるスクリプトのパス名
  • access: public
string getDefaultFormPath (string $action_name)
  • string $action_name: アクション名
getDefaultForwardPath (line 1593)

遷移名に対応するテンプレートパス名が省略された場合のデフォルトパス名を返す

デフォルトでは"foo_bar"というforward名が"foo/bar" + テンプレート拡張子となる ので好み応じてオーバライドする

  • return: forwardパス名
  • access: public
string getDefaultForwardPath (string $forward_name)
  • string $forward_name: forward名
getDefaultViewClass (line 1555)

遷移名に対応するビュークラス名が省略された場合のデフォルトクラス名を返す

デフォルトでは[プロジェクトID]_View_[遷移名]となるので好み応じてオーバライドする

  • return: view classクラス名
  • access: public
string getDefaultViewClass (string $forward_name, [ $gateway = null])
  • string $forward_name: forward名
  • $gateway
getDefaultViewPath (line 1575)

遷移名に対応するビューパス名が省略された場合のデフォルトパス名を返す

デフォルトでは"foo_bar" -> "/Foo/Bar.php"となるので好み応じてオーバーライドする

  • return: view classが定義されるスクリプトのパス名
  • access: public
string getDefaultViewPath (string $forward_name)
  • string $forward_name: forward名
getDirectory (line 496)

アプリケーションディレクトリ設定を返す

  • access: public
string getDirectory (string $key)
  • string $key: ディレクトリタイプ("tmp", "template"...)
getDSN (line 356)

DSNを返す

  • return: DSN
  • access: public
string getDSN ([string $db_key = ""])
  • string $db_key: DBキー
getDSN_persistent (line 371)

DSNの持続接続設定を返す

  • return: true:persistent false:non-persistent(あるいは設定無し)
  • access: public
bool getDSN_persistent ([string $db_key = ""])
  • string $db_key: DBキー
getErrorMessage (line 1066)

エラーメッセージを取得する

  • return: エラーメッセージ
  • access: public
string getErrorMessage (int $code)
  • int $code: エラーコード
getExt (line 516)

アプリケーション拡張子設定を返す

  • access: public
string getExt (string $key)
  • string $key: 拡張子タイプ("php", "tpl"...)
getGateway (line 708)

ゲートウェイを取得する

  • access: public
void getGateway ()
getI18N (line 598)

i18nオブジェクトのアクセサ(R)

  • return: i18nオブジェクト
  • access: public
object Ethna_I18N &getI18N ()
getLanguage (line 698)

使用言語を取得する

  • return: 使用言語,システムエンコーディング名,クライアントエンコーディング名
  • access: public
array getLanguage ()
getLogger (line 609)

ログオブジェクトのアクセサ

  • return: ログオブジェクト
  • access: public
object Ethna_Logger &getLogger ()
getManagerClassName (line 1824)

マネージャクラス名を取得する

  • return: マネージャクラス名
  • access: public
string getManagerClassName (string $name)
  • string $name: マネージャキー
getManagerList (line 665)

マネージャ一覧を返す

  • return: マネージャ一覧
  • access: public
array getManagerList ()
getObjectClassName (line 1836)

アプリケーションオブジェクトクラス名を取得する

  • return: マネージャクラス名
  • access: public
string getObjectClassName (string $name)
  • string $name: アプリケーションオブジェクトキー
getPlugin (line 642)

プラグインオブジェクトのアクセサ

  • return: プラグインオブジェクト
  • access: public
object Ethna_Plugin &getPlugin ()
getRenderer (line 1646)

レンダラを取得する(getTemplateEngine()はそのうち廃止されgetRenderer()に統合される予定)

  • return: レンダラオブジェクト
  • access: public
object Ethna_Renderer &getRenderer ()
getSession (line 620)

セッションオブジェクトのアクセサ

  • return: セッションオブジェクト
  • access: public
object Ethna_Session &getSession ()
getSQL (line 631)

SQLオブジェクトのアクセサ

  • return: SQLオブジェクト
  • access: public
object Ethna_AppSQL &getSQL ()
getTemplatedir (line 430)

クライアントタイプ/言語からテンプレートディレクトリ名を決定する

  • return: テンプレートディレクトリ
  • access: public
string getTemplatedir ()
getTemplateEngine (line 1659)

テンプレートエンジン取得する

  • return: レンダラオブジェクト
  • access: public
object Ethna_Renderer &getTemplateEngine ()
getTestdir (line 484)

(action,view以外の)テストケースを置くディレクトリ名を決定する

  • return: テストケースを置くディレクトリ
  • access: public
string getTestdir ()
getURL (line 408)

アプリケーションベースURLを返す

  • return: アプリケーションベースURL
  • access: public
string getURL ()
getUrlHandler (line 653)

URLハンドラオブジェクトのアクセサ

  • return: URLハンドラオブジェクト
  • access: public
object Ethna_UrlHandler &getUrlHandler ()
getView (line 564)

ビューオブジェクトのアクセサ

  • return: ビューオブジェクト
  • access: public
object Ethna_View &getView ()
getViewClassName (line 1506)

指定された遷移名に対応するビュークラス名を返す(オブジェクトの生成は行わない)

  • return: view classのクラス名
  • access: public
string getViewClassName (string $forward_name)
  • string $forward_name: 遷移先の名称
getViewdir (line 473)

ビューディレクトリ名を決定する

  • return: ビューディレクトリ
  • access: public
string getViewdir ()
getXmlrpcMethodName (line 687)

実行中のXMLRPCメソッド名を返す

  • return: 実行中のXMLRPCメソッド名
  • access: public
string getXmlrpcMethodName ()
handleError (line 1051)

エラーハンドラ

エラー発生時の追加処理を行いたい場合はこのメソッドをオーバーライドする (アラートメール送信等−デフォルトではログ出力時にアラートメール が送信されるが、エラー発生時に別にアラートメールをここで送信 させることも可能)

  • access: public
void handleError (object Ethna_Error &$error)
setCLI (line 2152)

CLI実行中フラグを設定する

  • access: public
void setCLI (bool $cli)
  • bool $cli: CLI実行中フラグ
setGateway (line 718)

ゲートウェイモードを設定する

  • access: public
void setGateway ( $gateway)
  • $gateway
trigger (line 794)

フレームワークの処理を開始する

  • return: 0:正常終了 Ethna_Error:エラー
  • access: public
mixed trigger ([mixed $default_action_name = ""], [mixed $fallback_action_name = ""], [bool $enable_filter = true])
  • mixed $default_action_name: 指定のアクション名
  • mixed $fallback_action_name: アクション名が決定できなかった場合に実行されるアクション名
  • bool $enable_filter: フィルタチェインを有効にするかどうか
trigger_XMLRPC (line 988)

_trigger_XMLRPCのコールバックメソッド

  • access: public
void trigger_XMLRPC ( $method,  $param)
  • $method
  • $param
_activateEthnaManager (line 2050)

Ethnaマネージャを設定する

不要な場合は空のメソッドとしてオーバーライドしてもよい

  • access: protected
void _activateEthnaManager ()
_getActionName_Form (line 1137)

フォームにより要求されたアクション名を返す

アプリケーションの性質に応じてこのメソッドをオーバーライドして下さい。 デフォルトでは"action_"で始まるフォーム値の"action_"の部分を除いたもの ("action_sample"なら"sample")がアクション名として扱われます

  • return: フォームにより要求されたアクション名
  • access: protected
string _getActionName_Form ()
_getDefaultGateway (line 1781)

デフォルト状態でのゲートウェイを取得する

  • return: ゲートウェイ定義(GATEWAY_WWW, GATEWAY_CLI...)
  • access: protected
int _getDefaultGateway ( $gateway)
  • $gateway
_getDefaultLanguage (line 1770)

デフォルト状態での使用言語を取得する

  • return: 使用言語,システムエンコーディング名,クライアントエンコーディング名
  • access: protected
array _getDefaultLanguage ()
_getGatewayPrefix (line 1796)

ゲートウェイに対応したクラス名のプレフィクスを取得する

  • return: ゲートウェイクラスプレフィクス
  • access: public
string _getGatewayPrefix ([string $gateway = null])
  • string $gateway: ゲートウェイ
_prepareDSN (line 2000)

設定ファイルのDSN定義から使用するデータを再構築する(スレーブアクセス分岐等)

DSNの定義方法(デフォルト:設定ファイル)を変えたい場合はここをオーバーライドする

  • return: DSN定義(array('DBキー1' => 'dsn1', 'DBキー2' => 'dsn2', ...))
  • access: protected
array _prepareDSN ()
_selectDSN (line 2029)

DSNのアクセス分岐を行う

スレーブサーバへの振分け処理(デフォルト:ランダム)を変更したい場合はこのメソッドをオーバーライドする

  • return: 選択されたDSN
  • access: protected
string _selectDSN (string $type, array $dsn_list)
  • string $type: DB種別
  • array $dsn_list: DSN一覧
_setDefaultTemplateEngine (line 1740)

テンプレートエンジンのデフォルト状態を設定する

  • access: protected
void _setDefaultTemplateEngine (object Ethna_Renderer &$renderer)
_setLanguage (line 1754)

使用言語を設定する

将来への拡張のためのみに存在しています。現在は特にオーバーライドの必要はありません。

  • access: protected
void _setLanguage (string $language, [string $system_encoding = null], [string $client_encoding = null])
  • string $language: 言語定義(LANG_JA, LANG_EN...)
  • string $system_encoding: システムエンコーディング名
  • string $client_encoding: クライアントエンコーディング
_sortForward (line 1290)

アクション名とアクションクラスからの戻り値に基づいて遷移先を決定する

  • return: 遷移先
  • access: protected
string _sortForward (string $action_name, string $retval)
  • string $action_name: アクション名
  • string $retval: アクションクラスからの戻り値

Documentation generated on Thu, 08 May 2008 00:14:44 +0900 by phpDocumentor 1.4.2