Naneau\Obfuscator\Console\Command\ObfuscateCommand::copyDir PHP Метод

copyDir() приватный Метод

Copy a directory
private copyDir ( string $from, string $to ) : ObfuscateCommand
$from string
$to string
Результат ObfuscateCommand
    private function copyDir($from, $to)
    {
        // FIXME implement native copy
        $output = array();
        $return = 0;
        if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
            // WINDOWS
            $command = sprintf('XCOPY "%s" "%s" /hievry', $from, $to);
        } else {
            // *NIX
            $command = sprintf('cp -rf %s %s', $from, $to);
        }
        exec($command, $output, $return);
        if ($return !== 0) {
            throw new \Exception('Could not copy directory');
        }
        return $this;
    }