Airship\Hangar\Commands\Assemble::setupFiles PHP Method

setupFiles() protected method

Place all the files in a workspace directory to prepare for Phar assembly.
protected setupFiles ( string $workspace, array $args = [] )
$workspace string
$args array
    protected function setupFiles(string $workspace, array $args = [])
    {
        unset($args);
        $from = $this->session['dir'];
        if (\in_array('metadata', $this->session)) {
            $this->metadata = $this->session['metadata'];
        }
        \copy(\dirname(HANGAR_ROOT) . DIRECTORY_SEPARATOR . 'res' . DIRECTORY_SEPARATOR . 'index.php.tmp', $this->pharStub);
        // Let's make sure our autoRun directory exists
        \mkdir($workspace . DIRECTORY_SEPARATOR . 'autoRun', 0755);
        \file_put_contents($workspace . DIRECTORY_SEPARATOR . 'autoRun.php', '<?php' . "\n" . 'declare(strict_types=1);' . "\n");
        if (\array_key_exists('add', $this->session)) {
            foreach ($this->session['add'] as $file) {
                $this->copyFile($from, $workspace, $file);
                $this->metadata['files'][] = $file;
            }
        }
        if (\array_key_exists('autoRun', $this->session)) {
            foreach ($this->session['autoRun'] as $f => $run) {
                $this->addautoRun($run, $workspace, $f);
            }
        }
    }