Skip to content

Commit

Permalink
Uses Filesystem component for WordPress copy and rename (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer authored Sep 6, 2018
1 parent 4c4ba98 commit 5b84da1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Utils/WordPressProject.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use Symfony\Component\Console\Question\ConfirmationQuestion;
use Symfony\Component\Console\Question\Question;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Filesystem\Filesystem;

class WordPressProject extends Project
{
Expand All @@ -45,6 +46,7 @@ public function __construct(InputInterface $input, OutputInterface $output, Ques
{
$this->input = $input;
$this->output = $output;
$this->filesystem = new Filesystem();
$this->helper = $helper ?: new QuestionHelper();
}

Expand Down Expand Up @@ -158,7 +160,11 @@ public function downloadWordpress($dir = 'wordpress')

// set the wordpress dir
$this->wordPressDir = $this->getRelativeDir($dir);
rename($tmpDir . DIRECTORY_SEPARATOR . 'wordpress', $this->wordPressDir);
$this->filesystem->rename(
$tmpDir . DIRECTORY_SEPARATOR . 'wordpress',
$this->wordPressDir,
true
);
$this->report();
}

Expand All @@ -172,7 +178,7 @@ public function downloadBatcachePlugin()
);
$this->report();
$this->output->writeln('Copying drop-ins...');
copy(
$this->filesystem->copy(
$dir . '/wp-content/plugins/batcache/advanced-cache.php',
$dir . '/wp-content/advanced-cache.php'
);
Expand All @@ -188,7 +194,7 @@ public function downloadMemcachedPlugin()
);
$this->report();
$this->output->writeln('Copying drop-ins...');
copy(
$this->filesystem->copy(
$dir . '/wp-content/plugins/memcached/object-cache.php',
$dir . '/wp-content/object-cache.php'
);
Expand Down

0 comments on commit 5b84da1

Please sign in to comment.