Laravel\Envoy\TaskContainer::load PHP Method

load() public method

Load the Envoy file into the container.
public load ( string $__path, Compiler $__compiler, array $__data = [], boolean $__serversOnly = false ) : void
$__path string
$__compiler Compiler
$__data array
$__serversOnly boolean
return void
    public function load($__path, Compiler $__compiler, array $__data = [], $__serversOnly = false)
    {
        $__dir = realpath(dirname($__path));
        // First we will compiled the "Blade" Envoy file into plain PHP that we'll include
        // into the current scope so it can register tasks in this task container that
        // is also in the current scope. We will extract this other data into scope.
        $__envoyPath = $this->writeCompiledEnvoyFile($__compiler, $__path, $__serversOnly);
        $__container = $this;
        ob_start() && extract($__data);
        // Here we will include the compiled Envoy file so it can register tasks into this
        // container instance. Then we will delete the PHP version of the file because
        // it is no longer needed once we have used it to register in the container.
        include $__envoyPath;
        @unlink($__envoyPath);
        $this->replaceSubTasks();
        ob_end_clean();
    }