Example #1
0
 public function load(ObjectManager $manager)
 {
     $rede = new Rede();
     $rede->setTeIpRede('0.0.0.0');
     $rede->setTeMascaraRede('255.255.255.255');
     $rede->setTeServCacic('localhost');
     $rede->setTeServUpdates('localhost');
     $rede->setNuLimiteFtp(100);
     $rede->setCsPermitirDesativarSrcacic('S');
     $rede->setIdLocal($this->getReference('local'));
     $rede->setDownloadMethod('http');
     $manager->persist($rede);
     $manager->flush();
     // Adiciona ações que devem estar habilitadas na rede por padrão
     $col_soft = $this->getReference('col_soft');
     $col_hard = $this->getReference('col_hard');
     $col_patr = $this->getReference('col_patr');
     $acao_rede = new AcaoRede();
     $acao_rede->setAcao($col_soft);
     $acao_rede->setRede($rede);
     $manager->persist($acao_rede);
     $acao_rede = new AcaoRede();
     $acao_rede->setAcao($col_hard);
     $acao_rede->setRede($rede);
     $manager->persist($acao_rede);
     $acao_rede = new AcaoRede();
     $acao_rede->setAcao($col_patr);
     $acao_rede->setRede($rede);
     $manager->persist($acao_rede);
     $manager->flush();
 }
Example #2
0
 public function load(ObjectManager $manager)
 {
     $rede = new Rede();
     $rede->setTeIpRede('0.0.0.0');
     $rede->setTeMascaraRede('255.255.255.255');
     $rede->setTeServCacic('http://localhost');
     $rede->setTeServUpdates('http://localhost');
     $rede->setNuLimiteFtp(100);
     $rede->setCsPermitirDesativarSrcacic('S');
     $rede->setIdLocal($this->getReference('local'));
     $rede->setDownloadMethod('http');
     $manager->persist($rede);
     $manager->flush();
 }
 public function setUp()
 {
     // Carrega dados da classe de cima
     parent::setUp();
     $this->em = $this->container->get('doctrine')->getManager();
     $this->hash = file_get_contents($this->data_dir . "instala/hash.json");
     $this->erro = file_get_contents($this->data_dir . "instala/erro.json");
     $rede = new Rede();
     $rede->setTeIpRede('10.209.8.0');
     $rede->setTeMascaraRede('255.255.255.255');
     $rede->setTeServCacic('http://localhost');
     $rede->setTeServUpdates('http://localhost');
     $rede->setTePathServUpdates('/msi');
     $rede->setNuLimiteFtp(100);
     $rede->setCsPermitirDesativarSrcacic('S');
     $rede->setDownloadMethod('http');
     //$this->em->persist($rede);
     $elemento = array('nmModulo' => 'cacic-service.exe', 'teVersaoModulo' => '3.0a1', 'csTipoSo' => 'windows', 'teHash' => '79df3561f83ac86eb19e2996b17d5e31', 'tipo' => 'cacic', 'tipoSo' => 'windows', 'filepath' => 'cacic/current/windows/cacic-service.exe');
     $tipo_so = $this->em->getRepository("CacicCommonBundle:TipoSo")->findOneBy(array('tipo' => 'windows'));
     $classe = new RedeVersaoModulo(null, null, null, null, null, $rede);
     $classe->setNmModulo($elemento['nmModulo']);
     $classe->setTeVersaoModulo($elemento['teVersaoModulo']);
     $classe->setDtAtualizacao(new \DateTime());
     $classe->setCsTipoSo($elemento['csTipoSo']);
     $classe->setTeHash($elemento['teHash']);
     $classe->setTipo('cacic');
     $classe->setTipoSo($tipo_so);
     $classe->setFilepath($elemento['filepath']);
     //$this->em->persist($classe);
     //$this->em->flush();
     // Carrega parâmetros globais
     $this->rede = $rede;
     $this->modulo = $classe;
     $this->tipo_so = $tipo_so;
     // Encontra hash do último serviço
     $rede = $this->em->getRepository("CacicCommonBundle:Rede")->findOneBy(array('teIpRede' => '0.0.0.0'));
     $cacic_service = $this->em->getRepository("CacicCommonBundle:RedeVersaoModulo")->getModulo($rede->getIdRede(), 'cacic-service.exe', 'windows');
     $this->hash_service = $cacic_service[0]['teHash'];
 }