Commit 46f196a0103903c3655a123e754de93ef27257b0

Authored by Gedeson Wasley
2 parents 78317a67 5b2e9494
Exists in master and in 1 other branch 3.1

Merge branch 'master' of https://github.com/lightbase/cacic

app/bootstrap.php.cache
... ... @@ -1575,14 +1575,10 @@ return null !== $this->headers->get('Vary');
1575 1575 }
1576 1576 public function getVary()
1577 1577 {
1578   -if (!$vary = $this->headers->get('Vary', null, false)) {
  1578 +if (!$vary = $this->headers->get('Vary')) {
1579 1579 return array();
1580 1580 }
1581   -$ret = array();
1582   -foreach ($vary as $item) {
1583   -$ret = array_merge($ret, preg_split('/[\s,]+/', $item));
1584   -}
1585   -return $ret;
  1581 +return is_array($vary) ? $vary : preg_split('/[\s,]+/', $vary);
1586 1582 }
1587 1583 public function setVary($headers, $replace = true)
1588 1584 {
... ... @@ -2174,11 +2170,11 @@ protected $booted;
2174 2170 protected $name;
2175 2171 protected $startTime;
2176 2172 protected $loadClassCache;
2177   -const VERSION ='2.3.12';
2178   -const VERSION_ID ='20312';
  2173 +const VERSION ='2.3.10';
  2174 +const VERSION_ID ='20310';
2179 2175 const MAJOR_VERSION ='2';
2180 2176 const MINOR_VERSION ='3';
2181   -const RELEASE_VERSION ='12';
  2177 +const RELEASE_VERSION ='10';
2182 2178 const EXTRA_VERSION ='';
2183 2179 public function __construct($environment, $debug)
2184 2180 {
... ... @@ -2544,33 +2540,21 @@ return $source;
2544 2540 $rawChunk ='';
2545 2541 $output ='';
2546 2542 $tokens = token_get_all($source);
2547   -$ignoreSpace = false;
2548 2543 for (reset($tokens); false !== $token = current($tokens); next($tokens)) {
2549 2544 if (is_string($token)) {
2550 2545 $rawChunk .= $token;
2551 2546 } elseif (T_START_HEREDOC === $token[0]) {
2552   -$output .= $rawChunk.$token[1];
  2547 +$output .= preg_replace(array('/\s+$/Sm','/\n+/S'),"\n", $rawChunk).$token[1];
2553 2548 do {
2554 2549 $token = next($tokens);
2555 2550 $output .= $token[1];
2556 2551 } while ($token[0] !== T_END_HEREDOC);
2557 2552 $rawChunk ='';
2558   -} elseif (T_WHITESPACE === $token[0]) {
2559   -if ($ignoreSpace) {
2560   -$ignoreSpace = false;
2561   -continue;
2562   -}
2563   -$rawChunk .= preg_replace(array('/\n{2,}/S'),"\n", $token[1]);
2564   -} elseif (in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) {
2565   -$ignoreSpace = true;
2566   -} else {
  2553 +} elseif (!in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) {
2567 2554 $rawChunk .= $token[1];
2568   -if (T_OPEN_TAG === $token[0]) {
2569   -$ignoreSpace = true;
2570   -}
2571 2555 }
2572 2556 }
2573   -$output .= $rawChunk;
  2557 +$output .= preg_replace(array('/\s+$/Sm','/\n+/S'),"\n", $rawChunk);
2574 2558 return $output;
2575 2559 }
2576 2560 public function serialize()
... ... @@ -2752,7 +2736,6 @@ $application->add($r->newInstance());
2752 2736 namespace Symfony\Component\Config
2753 2737 {
2754 2738 use Symfony\Component\Config\Resource\ResourceInterface;
2755   -use Symfony\Component\Filesystem\Exception\IOException;
2756 2739 use Symfony\Component\Filesystem\Filesystem;
2757 2740 class ConfigCache
2758 2741 {
... ... @@ -2790,20 +2773,11 @@ return true;
2790 2773 }
2791 2774 public function write($content, array $metadata = null)
2792 2775 {
2793   -$mode = 0666;
2794   -$umask = umask();
  2776 +$mode = 0666 & ~umask();
2795 2777 $filesystem = new Filesystem();
2796   -$filesystem->dumpFile($this->file, $content, null);
2797   -try {
2798   -$filesystem->chmod($this->file, $mode, $umask);
2799   -} catch (IOException $e) {
2800   -}
  2778 +$filesystem->dumpFile($this->file, $content, $mode);
2801 2779 if (null !== $metadata && true === $this->debug) {
2802   -$filesystem->dumpFile($this->getMetaFile(), serialize($metadata), null);
2803   -try {
2804   -$filesystem->chmod($this->getMetaFile(), $mode, $umask);
2805   -} catch (IOException $e) {
2806   -}
  2780 +$filesystem->dumpFile($this->getMetaFile(), serialize($metadata), $mode);
2807 2781 }
2808 2782 }
2809 2783 private function getMetaFile()
... ...
app/config/config.yml
... ... @@ -134,6 +134,7 @@ knp_paginator:
134 134 fm_elfinder:
135 135 locale: %locale%
136 136 editor: simple
  137 + compression: false
137 138 connector:
138 139 roots:
139 140 downloads:
... ... @@ -167,4 +168,4 @@ services:
167 168 cacic_demo.command.demo_command:
168 169 class: Cacic\CommonBundle\Command\DemoCommand
169 170 tags:
170   - - { name: console.command }
171 171 \ No newline at end of file
  172 + - { name: console.command }
... ...
composer.json
... ... @@ -24,7 +24,7 @@
24 24 ],
25 25 "require": {
26 26 "php": ">=5.3.3",
27   - "symfony/symfony": "2.3.*",
  27 + "symfony/symfony": "2.3.10",
28 28 "jquery/jquery": "1.10.*",
29 29 "doctrine/orm": ">=2.2.3,<2.4-dev",
30 30 "doctrine/doctrine-bundle": "1.2.*",
... ...
composer.lock
... ... @@ -3,7 +3,7 @@
3 3 "This file locks the dependencies of your project to a known state",
4 4 "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
5 5 ],
6   - "hash": "7b0319266c174918185313801b3e4139",
  6 + "hash": "2374f22cb735f9931567e2668cf40380",
7 7 "packages": [
8 8 {
9 9 "name": "braincrafted/bootstrap-bundle",
... ... @@ -217,7 +217,7 @@
217 217 ],
218 218 "authors": [
219 219 {
220   - "name": "Jonathan H. Wage",
  220 + "name": "Jonathan Wage",
221 221 "email": "jonwage@gmail.com",
222 222 "homepage": "http://www.jwage.com/",
223 223 "role": "Creator"
... ... @@ -292,7 +292,7 @@
292 292 ],
293 293 "authors": [
294 294 {
295   - "name": "Jonathan H. Wage",
  295 + "name": "Jonathan Wage",
296 296 "email": "jonwage@gmail.com",
297 297 "homepage": "http://www.jwage.com/",
298 298 "role": "Creator"
... ... @@ -637,9 +637,7 @@
637 637 "authors": [
638 638 {
639 639 "name": "Fabien Potencier",
640   - "email": "fabien@symfony.com",
641   - "homepage": "http://fabien.potencier.org",
642   - "role": "Lead Developer"
  640 + "email": "fabien@symfony.com"
643 641 },
644 642 {
645 643 "name": "Symfony Community",
... ... @@ -1269,7 +1267,7 @@
1269 1267 ],
1270 1268 "authors": [
1271 1269 {
1272   - "name": "Johannes M. Schmitt",
  1270 + "name": "Johannes Schmitt",
1273 1271 "email": "schmittjoh@gmail.com",
1274 1272 "homepage": "http://jmsyst.com",
1275 1273 "role": "Developer of wrapped JMSSerializerBundle"
... ... @@ -1744,7 +1742,7 @@
1744 1742 {
1745 1743 "name": "Johannes M. Schmitt",
1746 1744 "email": "schmittjoh@gmail.com",
1747   - "homepage": "https://github.com/schmittjoh",
  1745 + "homepage": "http://jmsyst.com",
1748 1746 "role": "Developer of wrapped JMSSerializerBundle"
1749 1747 }
1750 1748 ],
... ... @@ -2170,12 +2168,12 @@
2170 2168 "source": {
2171 2169 "type": "git",
2172 2170 "url": "https://github.com/lightbase/cocar.git",
2173   - "reference": "8465bec2675d2f6b96b60a9ef59a95f4c25ef54e"
  2171 + "reference": "2fc869b73608ed4d7821e7a2752cd555fc912dfd"
2174 2172 },
2175 2173 "dist": {
2176 2174 "type": "zip",
2177   - "url": "https://api.github.com/repos/lightbase/cocar/zipball/8465bec2675d2f6b96b60a9ef59a95f4c25ef54e",
2178   - "reference": "8465bec2675d2f6b96b60a9ef59a95f4c25ef54e",
  2175 + "url": "https://api.github.com/repos/lightbase/cocar/zipball/2fc869b73608ed4d7821e7a2752cd555fc912dfd",
  2176 + "reference": "2fc869b73608ed4d7821e7a2752cd555fc912dfd",
2179 2177 "shasum": ""
2180 2178 },
2181 2179 "require": {
... ... @@ -2206,7 +2204,7 @@
2206 2204 "support": {
2207 2205 "source": "https://github.com/lightbase/cocar/tree/master"
2208 2206 },
2209   - "time": "2014-03-29 05:16:50"
  2207 + "time": "2014-04-09 13:43:42"
2210 2208 },
2211 2209 {
2212 2210 "name": "monolog/monolog",
... ... @@ -2404,7 +2402,7 @@
2404 2402 ],
2405 2403 "authors": [
2406 2404 {
2407   - "name": "Johannes M. Schmitt",
  2405 + "name": "Johannes Schmitt",
2408 2406 "email": "schmittjoh@gmail.com",
2409 2407 "homepage": "http://jmsyst.com",
2410 2408 "role": "Developer of wrapped JMSSerializerBundle"
... ... @@ -2493,9 +2491,7 @@
2493 2491 "authors": [
2494 2492 {
2495 2493 "name": "Fabien Potencier",
2496   - "email": "fabien@symfony.com",
2497   - "homepage": "http://fabien.potencier.org",
2498   - "role": "Lead Developer"
  2494 + "email": "fabien@symfony.com"
2499 2495 }
2500 2496 ],
2501 2497 "description": "The base bundle for the Symfony Distributions",
... ... @@ -2542,9 +2538,7 @@
2542 2538 "authors": [
2543 2539 {
2544 2540 "name": "Fabien Potencier",
2545   - "email": "fabien@symfony.com",
2546   - "homepage": "http://fabien.potencier.org",
2547   - "role": "Lead Developer"
  2541 + "email": "fabien@symfony.com"
2548 2542 }
2549 2543 ],
2550 2544 "description": "This bundle provides a way to configure your controllers with annotations",
... ... @@ -2596,9 +2590,7 @@
2596 2590 "authors": [
2597 2591 {
2598 2592 "name": "Fabien Potencier",
2599   - "email": "fabien@symfony.com",
2600   - "homepage": "http://fabien.potencier.org",
2601   - "role": "Lead Developer"
  2593 + "email": "fabien@symfony.com"
2602 2594 }
2603 2595 ],
2604 2596 "description": "This bundle generates code for you",
... ... @@ -2861,9 +2853,7 @@
2861 2853 "authors": [
2862 2854 {
2863 2855 "name": "Fabien Potencier",
2864   - "email": "fabien@symfony.com",
2865   - "homepage": "http://fabien.potencier.org",
2866   - "role": "Lead Developer"
  2856 + "email": "fabien@symfony.com"
2867 2857 },
2868 2858 {
2869 2859 "name": "Symfony Community",
... ... @@ -2937,16 +2927,16 @@
2937 2927 },
2938 2928 {
2939 2929 "name": "symfony/symfony",
2940   - "version": "v2.3.12",
  2930 + "version": "v2.3.10",
2941 2931 "source": {
2942 2932 "type": "git",
2943 2933 "url": "https://github.com/symfony/symfony.git",
2944   - "reference": "3574df3d5e0039f3225007b8be534df5c4104503"
  2934 + "reference": "e4b9ff28b7c357971947ed12f99fbc68ff116830"
2945 2935 },
2946 2936 "dist": {
2947 2937 "type": "zip",
2948   - "url": "https://api.github.com/repos/symfony/symfony/zipball/3574df3d5e0039f3225007b8be534df5c4104503",
2949   - "reference": "3574df3d5e0039f3225007b8be534df5c4104503",
  2938 + "url": "https://api.github.com/repos/symfony/symfony/zipball/e4b9ff28b7c357971947ed12f99fbc68ff116830",
  2939 + "reference": "e4b9ff28b7c357971947ed12f99fbc68ff116830",
2950 2940 "shasum": ""
2951 2941 },
2952 2942 "require": {
... ... @@ -3043,7 +3033,7 @@
3043 3033 "keywords": [
3044 3034 "framework"
3045 3035 ],
3046   - "time": "2014-04-03 05:42:39"
  3036 + "time": "2014-02-12 08:18:23"
3047 3037 },
3048 3038 {
3049 3039 "name": "twbs/bootstrap",
... ... @@ -3122,9 +3112,7 @@
3122 3112 "authors": [
3123 3113 {
3124 3114 "name": "Fabien Potencier",
3125   - "email": "fabien@symfony.com",
3126   - "homepage": "http://fabien.potencier.org",
3127   - "role": "Lead Developer"
  3115 + "email": "fabien@symfony.com"
3128 3116 }
3129 3117 ],
3130 3118 "description": "Common additional features for Twig that do not directly belong in core",
... ...
src/Cacic/CommonBundle/Entity/ComputadorRepository.php
... ... @@ -221,7 +221,7 @@ class ComputadorRepository extends EntityRepository
221 221 /*
222 222 * Metodo responsável por inserir coletas iniciais, assim que o cacic é instalado
223 223 */
224   - public function getComputadorPreCole( Request $request , $te_so , $te_node_adress )
  224 + public function getComputadorPreCole( Request $request , $te_so , $te_node_adress, $rede, $so )
225 225 {
226 226 //recebe dados via POST, deCripata dados, e attribui a variaveis
227 227 $computer_system = OldCacicHelper::deCrypt( $request, $request->request->get('ComputerSystem'), true );
... ... @@ -232,10 +232,10 @@ class ComputadorRepository extends EntityRepository
232 232 $data = new \DateTime('NOW'); //armazena data Atual
233 233  
234 234 //vefifica se existe SO coletado se não, insere novo SO
235   - $so = $this->getEntityManager()->getRepository('CacicCommonBundle:So')->createIfNotExist( $te_so );
236   - $rede = $this->getEntityManager()->getRepository('CacicCommonBundle:Rede')->getDadosRedePreColeta( $request );
  235 + //$so = $this->getEntityManager()->getRepository('CacicCommonBundle:So')->createIfNotExist( $te_so );
  236 + //$rede = $this->getEntityManager()->getRepository('CacicCommonBundle:Rede')->getDadosRedePreColeta( $request );
237 237 $computador = $this->findOneBy( array( 'teNodeAddress'=> $te_node_adress, 'idSo'=> $so->getIdSo()) );
238   - $classes = $this->getEntityManager()->getRepository('CacicCommonBundle:Classe')->findAll();
  238 + //$classes = $this->getEntityManager()->getRepository('CacicCommonBundle:Classe')->findAll();
239 239  
240 240 //inserção de dado se for um novo computador
241 241 if( empty ( $computador ) )
... ...
src/Cacic/WSBundle/Controller/ColetaController.php
... ... @@ -360,7 +360,7 @@ class ColetaController extends Controller
360 360  
361 361 // Se não encontrar o valor, loga o erro e sai
362 362 if (is_null($classProperty) || $classProperty == "") {
363   - $logger->error("ERRO NA COLETA! Propriedade $classPropertyName não encontrada na requisição ou valor vazio");
  363 + $logger->debug("ERRO NA COLETA! Propriedade $classPropertyName não encontrada na requisição ou valor vazio");
364 364 return;
365 365 }
366 366  
... ...
src/Cacic/WSBundle/Controller/DefaultController.php
... ... @@ -74,9 +74,10 @@ class DefaultController extends Controller
74 74  
75 75 //vefifica se existe SO coletado se não, insere novo SO
76 76 $so = $this->getDoctrine()->getRepository('CacicCommonBundle:So')->createIfNotExist( $te_so );
77   - $computador = $this->getDoctrine()->getRepository('CacicCommonBundle:Computador')->getComputadorPreCole( $request, $te_so, $te_node_address );
78 77 $rede = $this->getDoctrine()->getRepository('CacicCommonBundle:Rede')->getDadosRedePreColeta( $request );
79   - $local = $this->getDoctrine()->getRepository('CacicCommonBundle:Local')->findOneBy(array( 'idLocal' => $rede->getIdLocal() ));
  78 + $computador = $this->getDoctrine()->getRepository('CacicCommonBundle:Computador')->getComputadorPreCole( $request, $te_so, $te_node_address, $rede, $so );
  79 + //$local = $this->getDoctrine()->getRepository('CacicCommonBundle:Local')->findOneBy(array( 'idLocal' => $rede->getIdLocal() ));
  80 + $local = $rede->getIdLocal();
80 81  
81 82 //Debugging do Agente
82 83 $debugging = ( TagValueHelper::getValueFromTags('DateToDebugging',$computador->getTeDebugging() ) == date("Ymd") ? $computador->getTeDebugging() :
... ... @@ -142,10 +143,11 @@ class DefaultController extends Controller
142 143 OldCacicHelper::autenticaAgente($request);
143 144  
144 145 $te_node_adress = TagValueHelper::getValueFromTags( 'MACAddress', OldCacicHelper::deCrypt( $request, $request->get('NetworkAdapterConfiguration')));
145   - $computador = $this->getDoctrine()->getRepository('CacicCommonBundle:Computador')->getComputadorPreCole( $request, $request->get( 'te_so' ),$te_node_adress );
146   - $rede = $this->getDoctrine()->getRepository('CacicCommonBundle:Rede')->getDadosRedePreColeta( $request );
147 146 $so = $this->getDoctrine()->getRepository('CacicCommonBundle:So')->findOneBy( array('teSo'=>$request->get( 'te_so' )));
148   - $local = $this->getDoctrine()->getRepository('CacicCommonBundle:Local')->findOneBy(array( 'idLocal' => $rede->getIdLocal() ));
  147 + $rede = $this->getDoctrine()->getRepository('CacicCommonBundle:Rede')->getDadosRedePreColeta( $request );
  148 + $computador = $this->getDoctrine()->getRepository('CacicCommonBundle:Computador')->getComputadorPreCole( $request, $request->get( 'te_so' ),$te_node_adress, $rede, $so );
  149 + //$local = $this->getDoctrine()->getRepository('CacicCommonBundle:Local')->findOneBy(array( 'idLocal' => $rede->getIdLocal() ));
  150 + $local = $rede->getIdLocal();
149 151 $data = new \DateTime('NOW');
150 152  
151 153 //Debugging do Agente
... ...
src/Cacic/WSBundle/Helper/TagValueHelper.php
... ... @@ -35,7 +35,7 @@ class TagValueHelper
35 35 preg_match_all("(\[" . $pStrTagLabel . "\](.+)\[\/" . $pStrTagLabel . "\])i",$pStrSource, $arrResult);
36 36  
37 37 // Garantir que o resultado contenha somente UTF-8 valido
38   - $resultado = TagValueHelper::UTF8Sanitize($arrResult[1][0]);
  38 + $resultado = TagValueHelper::UTF8Sanitize(@$arrResult[1][0]);
39 39  
40 40 return $resultado;
41 41 }
... ...