略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Yaf_Application

2024-04-24

The Yaf_Application class

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

简介

Yaf_Application为应用提供了一个辅助设施。 它提供了可重用的资源,常见的和模块化的引导类,还有依赖的检查。

注意:

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 static app(): void
public bootstrap(Yaf_Bootstrap_Abstract $bootstrap = ?): void
public__construct(mixed $config, string $envrion = ?)
public __destruct(): void
public environ(): void
public execute(callable $entry, string $...): void
public getLastErrorMsg(): string
public getLastErrorNo(): int
public getModules(): array
public run(): void
public setAppDirectory(string $directory): Yaf_Application
}

属性

config

dispatcher

_app

_modules

_running

_environ

目录

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/class.yaf-application.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3