Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Kohana`index.php`方法链接和仆从?_Php_Kohana_Method Chaining - Fatal编程技术网

Kohana`index.php`方法链接和仆从?

Kohana`index.php`方法链接和仆从?,php,kohana,method-chaining,Php,Kohana,Method Chaining,在Kohanaindex.php文件中,有一个子句我有两个问题: if (PHP_SAPI == 'cli') // Try and load minion { class_exists('Minion_Task') OR die('Please enable the Minion module for CLI support.'); set_exception_handler(array('Minion_Exception', 'handler')); Minion_Task::factor

在Kohana
index.php
文件中,有一个子句我有两个问题:

if (PHP_SAPI == 'cli') // Try and load minion
{
class_exists('Minion_Task') OR die('Please enable the Minion module for CLI support.');
set_exception_handler(array('Minion_Exception', 'handler'));

Minion_Task::factory(Minion_CLI::options())->execute();
}
else
{
/**
 * Execute the main request. A source of the URI can be passed, eg:  $_SERVER['PATH_INFO'].
 * If no source is specified, the URI will be automatically detected.
 */
echo Request::factory(TRUE, array(), FALSE)
    ->execute()
    ->send_headers(TRUE)
    ->body();
}
1) 什么是
仆从
? 2) 以下是什么意思

->foo()
->bar()
->...etx
这只是方法链接吗?

1)在代码的第一部分,Kohana正在检查脚本是否从命令行(CLI)运行。如果是这样,它会尝试使用仆从执行任务

Minion是通过CLI运行任务的框架

见:

以及:

2) 是的,这就是你在代码第二部分看到的方法链接。它可以很容易地重写为:

$request = Request::factory(TRUE, array(), FALSE);
$response = $request->execute();
$response->send_headers(TRUE);
echo $response->body();
1) 在该代码的第一部分中,Kohana正在检查脚本是否从命令行(CLI)运行。如果是这样,它会尝试使用仆从执行任务

Minion是通过CLI运行任务的框架

见:

以及:

2) 是的,这就是你在代码第二部分看到的方法链接。它可以很容易地重写为:

$request = Request::factory(TRUE, array(), FALSE);
$response = $request->execute();
$response->send_headers(TRUE);
echo $response->body();

1.仆从是一个忠诚于为主人服务的追随者!2.这些是对象(可能是类)中的函数。仆从是一个忠诚于为主人服务的追随者!2.这些是对象(可能是类)中的函数。请注意,
Request::execute
返回
Response
object()。因此,最好修改代码,如:
$response=$request->execute()$响应->发送_头(真)请注意,
Request::execute
返回
Response
object()。因此,最好修改代码,如:
$response=$request->execute()$响应->发送_头(真)