Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php declare(strict_types=1); /* * This file is a part of Sculpin. * * (c) Dragonfly..
Decoded Output download
<?php
declare(strict_types=1);
/*
* This file is a part of Sculpin.
*
* (c) Dragonfly Development Inc.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sculpin\Bundle\ThemeBundle\Command;
use Sculpin\Core\Console\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* @author Beau Simensen <[email protected]>
*/
class ListCommand extends ContainerAwareCommand
{
/**
* {@inheritdoc}
*/
protected function configure()
{
$this
->setName('theme:list')
->setDescription('List currently installed themes.')
->setHelp(<<<EOT
The <info>theme:list</info> command lists currently installed themes.
EOT
);
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$themeRegistry = $this->getContainer()->get('sculpin_theme.theme_registry');
$activeTheme = $themeRegistry->findActiveTheme();
$themes = $themeRegistry->listThemes();
foreach ($themes as $theme) {
if ($theme['name'] === $activeTheme['name']) {
$themeOutput = '<info>'.$theme['name'].'</info> *';
} else {
$themeOutput = $theme['name'];
}
if (isset($theme['parent'])) {
$themeOutput .= ' (child of '.$theme['parent'].')';
}
if (preg_match('/^(.+?)-dev$/', $theme['name'], $matches)) {
$themeOutput .= ' :: '.$matches[1].'';
}
$output->writeln($themeOutput);
}
return 0;
}
}
?>
Did this file decode correctly?
Original Code
<?php
declare(strict_types=1);
/*
* This file is a part of Sculpin.
*
* (c) Dragonfly Development Inc.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sculpin\Bundle\ThemeBundle\Command;
use Sculpin\Core\Console\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* @author Beau Simensen <[email protected]>
*/
class ListCommand extends ContainerAwareCommand
{
/**
* {@inheritdoc}
*/
protected function configure()
{
$this
->setName('theme:list')
->setDescription('List currently installed themes.')
->setHelp(<<<EOT
The <info>theme:list</info> command lists currently installed themes.
EOT
);
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$themeRegistry = $this->getContainer()->get('sculpin_theme.theme_registry');
$activeTheme = $themeRegistry->findActiveTheme();
$themes = $themeRegistry->listThemes();
foreach ($themes as $theme) {
if ($theme['name'] === $activeTheme['name']) {
$themeOutput = '<info>'.$theme['name'].'</info> *';
} else {
$themeOutput = $theme['name'];
}
if (isset($theme['parent'])) {
$themeOutput .= ' (child of '.$theme['parent'].')';
}
if (preg_match('/^(.+?)-dev$/', $theme['name'], $matches)) {
$themeOutput .= ' :: '.$matches[1].'';
}
$output->writeln($themeOutput);
}
return 0;
}
}
Function Calls
None |
Stats
MD5 | f08e140820449bd88f4feb2abb7d45d1 |
Eval Count | 0 |
Decode Time | 75 ms |