Yaf_Application::execute

(Yaf >=1.0.0)
Execute a callback
public void Yaf_Application::execute ( callable $entry, string $... )

This method is typically used to run Yaf_Application in a crontab work. Make the crontab work can also use the autoloader and Bootstrap mechanism.

Parameters:
entry

a valid callback

...

parameters will pass to the callback

Returns:
Examples:
Yaf_Application::execute() example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?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);
?>

The above example will output something similar to:

doc_php
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.