diff --git a/src/Utils/WordPressProject.php b/src/Utils/WordPressProject.php index 69a94f3..89a2388 100644 --- a/src/Utils/WordPressProject.php +++ b/src/Utils/WordPressProject.php @@ -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 { @@ -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(); } @@ -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(); } @@ -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' ); @@ -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' );