略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Yaf_Application::execute

2024-05-02

Yaf_Application::execute

(Yaf >=1.0.0)

Yaf_Application::execute运行回调函数

说明

public Yaf_Application::execute(callable $entry, string $...): void

这个方法通常用于在cron任务中运行Yaf_Application。 在cron任务中也可以使用autoloader和Bootstrap机制。

参数

entry

一个有效的回调函数

...

零个或者多个要传递给函数的参数。

返回值

范例

示例 #1 Yaf_Application::execute()example

<?php
function main($argc$argv) {
}

$config = array(
    
"application" => array(
        
"directory" => realpath(dirname(__FILE__)) . "/application",
    ),
);

/** Yaf_Application */
$application = new Yaf_Application($config);
$application->execute("main"$argc,  $argv);
?>

以上例程的输出类似于:

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

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

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