You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.9 KiB
67 lines
1.9 KiB
<?php
|
|
|
|
|
|
namespace Prometeo\CommandsBundle\Commands;
|
|
|
|
use App\Entity\Respuestas;
|
|
use App\Entity\RespuestasHistoricas;
|
|
use FOS\UserBundle\Model\UserManagerInterface;
|
|
use Sonata\UserBundle\GoogleAuthenticator\Helper;
|
|
use Sonata\UserBundle\Model\UserInterface;
|
|
use Symfony\Component\Console\Command\Command as ContainerAwareCommand;
|
|
use Symfony\Component\Console\Input\InputArgument;
|
|
use Symfony\Component\Console\Input\InputInterface;
|
|
use Symfony\Component\Console\Input\InputOption;
|
|
use Symfony\Component\Console\Output\OutputInterface;
|
|
use Doctrine\ORM\EntityManagerInterface;
|
|
use Zitec\RuleEngineBundle\Entity\Rule;
|
|
use Symfony\Component\PropertyAccess\PropertyAccess;
|
|
use Symfony\Component\DependencyInjection\ContainerInterface;
|
|
|
|
|
|
class GenerateSkipper extends ContainerAwareCommand
|
|
{
|
|
private $em;
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
//ls
|
|
//$this->em = $container->get('doctrine')->getManager();
|
|
}
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function configure(): void
|
|
{
|
|
$this->setName('prometeo:skipper:generate');
|
|
$this->addArgument(
|
|
'folder',
|
|
InputArgument::OPTIONAL,
|
|
'Path to folder with generates entities by default "/generatedentities"'
|
|
)
|
|
->addArgument(
|
|
'prefix',
|
|
InputArgument::OPTIONAL,
|
|
'By default "App.Entity"'
|
|
)
|
|
;
|
|
}
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function execute(InputInterface $input, OutputInterface $output): void
|
|
{
|
|
$folder='generatedentities';
|
|
$prefix='App.Entity';
|
|
if ($input->getArgument('folder')) {
|
|
$folder=$input->getArgument('folder');
|
|
}
|
|
if ($input->getArgument('prefix')) {
|
|
$prefix=$input->getArgument('prefix');
|
|
}
|
|
foreach (glob($folder."/*.php") as $nombre_fichero) {
|
|
echo "Tamaño de $nombre_fichero " . filesize($nombre_fichero) . "\n";
|
|
}
|
|
|
|
}
|
|
}
|