Licitator 1.0
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.

66 lines
1.9 KiB

5 years ago
  1. <?php
  2. namespace Prometeo\CommandsBundle\Commands;
  3. use App\Entity\Respuestas;
  4. use App\Entity\RespuestasHistoricas;
  5. use FOS\UserBundle\Model\UserManagerInterface;
  6. use Sonata\UserBundle\GoogleAuthenticator\Helper;
  7. use Sonata\UserBundle\Model\UserInterface;
  8. use Symfony\Component\Console\Command\Command as ContainerAwareCommand;
  9. use Symfony\Component\Console\Input\InputArgument;
  10. use Symfony\Component\Console\Input\InputInterface;
  11. use Symfony\Component\Console\Input\InputOption;
  12. use Symfony\Component\Console\Output\OutputInterface;
  13. use Doctrine\ORM\EntityManagerInterface;
  14. use Zitec\RuleEngineBundle\Entity\Rule;
  15. use Symfony\Component\PropertyAccess\PropertyAccess;
  16. use Symfony\Component\DependencyInjection\ContainerInterface;
  17. class GenerateSkipper extends ContainerAwareCommand
  18. {
  19. private $em;
  20. public function __construct()
  21. {
  22. parent::__construct();
  23. //ls
  24. //$this->em = $container->get('doctrine')->getManager();
  25. }
  26. /**
  27. * {@inheritdoc}
  28. */
  29. public function configure(): void
  30. {
  31. $this->setName('prometeo:skipper:generate');
  32. $this->addArgument(
  33. 'folder',
  34. InputArgument::OPTIONAL,
  35. 'Path to folder with generates entities by default "/generatedentities"'
  36. )
  37. ->addArgument(
  38. 'prefix',
  39. InputArgument::OPTIONAL,
  40. 'By default "App.Entity"'
  41. )
  42. ;
  43. }
  44. /**
  45. * {@inheritdoc}
  46. */
  47. public function execute(InputInterface $input, OutputInterface $output): void
  48. {
  49. $folder='generatedentities';
  50. $prefix='App.Entity';
  51. if ($input->getArgument('folder')) {
  52. $folder=$input->getArgument('folder');
  53. }
  54. if ($input->getArgument('prefix')) {
  55. $prefix=$input->getArgument('prefix');
  56. }
  57. foreach (glob($folder."/*.php") as $nombre_fichero) {
  58. echo "Tamaño de $nombre_fichero " . filesize($nombre_fichero) . "\n";
  59. }
  60. }
  61. }