PHP Conference Nagoya 2025

The Yaf_Application class

(Yaf >=1.0.0)

Introdução

Yaf_Application provides a bootstrapping facility for applications which provides reusable resources, common- and module-based bootstrap classes and dependency checking.

Nota:

Yaf_Application implements the singleton pattern, and Yaf_Application can not be serialized or unserialized which will cause problem when you try to use PHPUnit to write some test case for Yaf.

You may use @backupGlobals annotation of PHPUnit to control the backup and restore operations for global variables. thus can solve this problem.

Resumo da classe

final class Yaf_Application {
/* Propriedades */
protected $config;
protected $dispatcher;
protected static $_app;
protected $_modules;
protected $_running;
protected $_environ;
/* Métodos */
public __construct(mixed $config, string $envrion = ?)
public static app(): 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()
}

Propriedades

config

dispatcher

_app

_modules

_running

_environ

Índice

adicione uma nota

Notas Enviadas por Usuários (em inglês)

Não há notas de usuários para esta página.
To Top