-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae8179a
commit a46ba41
Showing
28 changed files
with
160 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,17 +6,17 @@ | |
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Input\InputOption; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
/** | ||
* | ||
* @author Al Ganiev <[email protected]> | ||
* @copyright 2013 Al Ganiev | ||
* @license http://www.opensource.org/licenses/mit-license.php MIT License | ||
*/ | ||
* @author Al Ganiev <[email protected]> | ||
* @copyright 2013 Al Ganiev | ||
* @license http://www.opensource.org/licenses/mit-license.php MIT License | ||
*/ | ||
class DumpEmoticonsCommand extends ContainerAwareCommand | ||
{ | ||
/** | ||
* @see Command | ||
*/ | ||
* @see Command | ||
*/ | ||
protected function configure() | ||
{ | ||
$this | ||
|
@@ -27,29 +27,31 @@ protected function configure() | |
} | ||
|
||
/** | ||
* Copies one folder to another | ||
* Copies one folder to another. | ||
* | ||
* @param $src | ||
* @param $dst | ||
*/ | ||
private function recurseCopy($src,$dst) | ||
private function recurseCopy($src, $dst) | ||
{ | ||
$dir = opendir($src); | ||
@mkdir($dst); | ||
while (false !== ( $file = readdir($dir)) ) { | ||
if (( $file != '.' ) && ( $file != '..' )) { | ||
if ( is_dir($src . '/' . $file) ) { | ||
$this->recurseCopy($src . '/' . $file,$dst . '/' . $file); | ||
} else { | ||
copy($src . '/' . $file,$dst . '/' . $file); | ||
} | ||
$dir = opendir($src); | ||
@mkdir($dst); | ||
while (false !== ($file = readdir($dir))) { | ||
if (($file != '.') && ($file != '..')) { | ||
if (is_dir($src.'/'.$file)) { | ||
$this->recurseCopy($src.'/'.$file, $dst.'/'.$file); | ||
} else { | ||
copy($src.'/'.$file, $dst.'/'.$file); | ||
} | ||
} | ||
closedir($dir); | ||
} | ||
closedir($dir); | ||
} | ||
|
||
/** | ||
* @param \Symfony\Component\Console\Input\InputInterface $input | ||
* @param \Symfony\Component\Console\Output\OutputInterface $output | ||
* @param \Symfony\Component\Console\Input\InputInterface $input | ||
* @param \Symfony\Component\Console\Output\OutputInterface $output | ||
* | ||
* @return int|null|void | ||
*/ | ||
protected function execute(InputInterface $input, OutputInterface $output) | ||
|
@@ -69,9 +71,8 @@ protected function execute(InputInterface $input, OutputInterface $output) | |
return $output->writeln('<error>Emoticons folder does not exist</error>'); | ||
} | ||
|
||
$this->recurseCopy($emoticonsFolder,$webFolder); | ||
$this->recurseCopy($emoticonsFolder, $webFolder); | ||
|
||
$output->writeln('<comment>Emoticons dumped succesfully</comment>'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.