CakeFest 2024: The Official CakePHP Conference

Yaf_Application クラス

(No version information available, might only be in Git)

はじめに

Yaf_Application はアプリケーションのブートストラップ機能を提供します。 再利用可能なリソース、共有できるモジュールベースのブートストラップクラス、 そして依存関係のチェックなどです。

注意:

Yaf_Application はシングルトンパターンを実装しており、 シリアライズやアンシリアライズはできません。これは、 PHPUnit を使って Yaf 用のテストケースを書こうとしたときに問題の原因となります。

PHPUnit の @backupGlobals アノテーションを使えば グローバル変数のバックアップやりストア操作を制御できるので、 この問題に対応できます。

クラス概要

final class Yaf_Application {
/* プロパティ */
protected $config;
protected $dispatcher;
protected static $_app;
protected $_modules;
protected $_running;
protected $_environ;
/* メソッド */
public __construct(mixed $config, string $envrion = ?)
public staticapp(): mixed
public bootstrap(Yaf_Bootstrap_Abstract $bootstrap = ?): void
public environ(): void
public execute(callable $entry, string ...$args): void
public getModules(): array
public run(): void
public __destruct()
}

プロパティ

config

dispatcher

_app

_modules

_running

_environ

目次

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top