Recoge la configuracion del dominio dado
@param string $destino
@param string $fichero
@return array
506097
protected function obtenerConfiguracionDominio($destino, $fichero){
        $yaml = new \Symfony\Component\Yaml\Parser();
        $valor = $yaml->parse(file_get_contents($fichero)); 
        $parametros = $valor['ldapPM'];
        if ($parametros['solo_default']) {
            // TODO: Implementar esto
        }else{
            return $parametros['servidores'][$destino]['configuracion'];
        }
    }
829378
public static function resolvetoFIDtoURI(int $fid) {

        if (!is_integer($fid)) {
            return null;
        }
        /* @var \Drupal\file\FileInterface $file */
        $file = \Drupal::entityTypeManager()->getStorage('file')->load($fid);
        return $file;
    }
181287
final function ii() {return [
		DfOP::COUNTRY => $this->country()
		,OP::CC_EXP_MONTH => $this->_c->expMonth()
		,OP::CC_EXP_YEAR => $this->_c->expYear()
		,OP::CC_LAST_4 => $this->_c->last4()
		,OP::CC_OWNER => $this->_c->owner()
		,OP::CC_TYPE => $this->_c->brand()
	];}
154831
public function conectar($destino, $usuario, $password = false) {
        parent::conectar($destino, $usuario, $password);
        $this->destino = $destino;
        $this->usuario = $usuario;
        $this->password = $password;
        $this->objeto = 'objetosLdap';
    }
749134
public function add($uri, $title, $descr = false)
    {
        $this->_breadcrumbs[] = [
            'uri'   => $uri,
            'title' => $title,
            'descr' => $descr,
        ];
    }
1037457
protected function Topo($i)
    {
        $this->Image($this->boleto[$i]->getLogoBanco(), 20, ($this->GetY() - 2), 28);
        $this->Cell(29, 6, '', 'B');
        $this->SetFont('', 'B', 13);
        $this->Cell(15, 6, $this->boleto[$i]->getCodigoBancoComDv(), 'LBR', 0, 'C');
        $this->SetFont('', 'B', 10);
        $this->Cell(0, 6, $this->boleto[$i]->getLinhaDigitavel(), 'B', 1, 'R');

        $this->SetFont($this->PadraoFont, '', $this->fdes);
        $this->Cell(75, $this->desc, $this->_('Beneficiário'), 'TLR');
        $this->Cell(35, $this->desc, $this->_('Agencia/Codigo do beneficiário'), 'TR');
        $this->Cell(10, $this->desc, $this->_('Espécie'), 'TR');
        $this->Cell(15, $this->desc, $this->_('Quantidade'), 'TR');
        $this->Cell(35, $this->desc, $this->_('Nosso Numero'), 'TR', 1);

        $this->SetFont($this->PadraoFont, 'B', $this->fcel);

        $this->textFitCell(75, $this->cell, $this->_($this->boleto[$i]->getBeneficiario()->getNome()), 'LR', 0, 'L');

        $this->Cell(35, $this->cell, $this->_($this->boleto[$i]->getAgenciaCodigoBeneficiario()), 'R');
        $this->Cell(10, $this->cell, $this->_('R$'), 'R');
        $this->Cell(15, $this->cell, $this->_(''), 'R');
        $this->Cell(35, $this->cell, $this->_($this->boleto[$i]->getNossoNumeroBoleto()), 'R', 1, 'R');

        $this->SetFont($this->PadraoFont, '', $this->fdes);
        $this->Cell(50, $this->desc, $this->_('Número do Documento'), 'TLR');
        $this->Cell(40, $this->desc, $this->_('CPF/CNPJ'), 'TR');
        $this->Cell(30, $this->desc, $this->_('Vencimento'), 'TR');
        $this->Cell(50, $this->desc, $this->_('Valor do Documento'), 'TR', 1);

        $this->SetFont($this->PadraoFont, 'B', $this->fcel);
        $this->Cell(50, $this->cell, $this->_($this->boleto[$i]->getNumeroDocumento()), 'LR');
        $this->Cell(40, $this->cell, $this->_($this->boleto[$i]->getBeneficiario()->getDocumento(), '##.###.###/####-##'), 'R');
        $this->Cell(30, $this->cell, $this->_($this->boleto[$i]->getDataVencimento()->format('d/m/Y')), 'R');
        $this->Cell(50, $this->cell, $this->_(Util::nReal($this->boleto[$i]->getValor())), 'R', 1, 'R');

        $this->SetFont($this->PadraoFont, '', $this->fdes);
        $this->Cell(30, $this->desc, $this->_('(-) Descontos/Abatimentos'), 'TLR');
        $this->Cell(30, $this->desc, $this->_('(-) Outras Deduções'), 'TR');
        $this->Cell(30, $this->desc, $this->_('(+) Mora Multa'), 'TR');
        $this->Cell(30, $this->desc, $this->_('(+) Acréscimos'), 'TR');
        $this->Cell(50, $this->desc, $this->_('(=) Valor Cobrado'), 'TR', 1);

        $this->SetFont($this->PadraoFont, 'B', $this->fcel);
        $this->Cell(30, $this->cell, $this->_(''), 'LR');
        $this->Cell(30, $this->cell, $this->_(''), 'R');
        $this->Cell(30, $this->cell, $this->_(''), 'R');
        $this->Cell(30, $this->cell, $this->_(''), 'R');
        $this->Cell(50, $this->cell, $this->_(''), 'R', 1, 'R');

        $this->SetFont($this->PadraoFont, '', $this->fdes);
        $this->Cell(0, $this->desc, $this->_('Pagador'), 'TLR', 1);

        $this->SetFont($this->PadraoFont, 'B', $this->fcel);
        $this->Cell(0, $this->cell, $this->_($this->boleto[$i]->getPagador()->getNomeDocumento()), 'BLR', 1);

        $this->SetFont($this->PadraoFont, '', $this->fdes);
        $this->Cell(100, $this->desc, $this->_('Demonstrativo'), 0, 0, 'L');
        $this->Cell(0, $this->desc, $this->_('Autenticação mecânica'), 0, 1, 'R');
        $this->Ln(2);

        $pulaLinha = 26;

        $this->SetFont($this->PadraoFont, 'B', $this->fcel);
        if (count($this->boleto[$i]->getDescricaoDemonstrativo()) > 0) {
            $pulaLinha = $this->listaLinhas($this->boleto[$i]->getDescricaoDemonstrativo(), $pulaLinha);
        }

        $this->traco('Corte na linha pontilhada', $pulaLinha, 10);

        return $this;
    }
900362
protected function parseProperties($propertiesDefinition, &$loadedDependencies = array()){
        $parseProperties= array();
        foreach ($propertiesDefinition as $key => $definition) {
            $property= NULL;
            if(isset($definition['ref'])){
                //Conseguimos la dependencia
                $property= $this->getDependency($definition['ref'], $loadedDependencies);
            }else{
                //Casteo el valor al tipo indicado
                $property= $definition['value'];
                if($definition['value'] != 'array'){
                    settype($property, $definition['type']);
                }
            }
            $parseProperties[$key]= $property;
        }
        return $parseProperties;
    }
1206899
def ler_configuracao
      #@artigo.merge!(YAML.load(ler_arquivo(Formatafacil::Tarefa.arquivo_configuracao)))
      #converte_parametros_para_boolean

      #@modelo = @artigo['modelo']
      if File.exist?(@arquivo_abstract) then
        @artigo['abstract'] = ler_arquivo(@arquivo_abstract)
        @artigo.merge!(ler_metadados_do_arquivo(@arquivo_abstract))
      end
      if File.exist?(@arquivo_resumo) then
        @artigo['resumo'] = ler_arquivo(@arquivo_resumo)
      end
      @artigo['bibliografia'] = ler_arquivo(@arquivo_bibliografia) if File.exist?(@arquivo_bibliografia)

      #unifica_metadados

    end
695464
public function entityGetAttrOptions($demAttr, $demIndexes)
    {
        $result = [];
        $alias = $demAttr[Cfg::ALIAS];
        /* parse common options */
        if (isset($demAttr[Cfg::NULLABLE])) {
            $result[MageType::OPT_NULLABLE] = $demAttr[Cfg::NULLABLE];
        }
        if (isset($demAttr[Cfg::DEFAULT_])) {
            $result[MageType::OPT_DEFAULT] = $demAttr[Cfg::DEFAULT_];
        }
        /* parse indexes to define PRIMARY option */
        foreach ($demIndexes as $ndx) {
            $ndxType = $ndx[Cfg::TYPE];
            if ($ndxType == DemType::INDEX_PRIMARY) {
                foreach ($ndx[Cfg::ALIASES] as $one) {
                    if ($alias == $one) {
                        $result[MageType::INDEX_PRIMARY] = true;
                        break;
                    }
                }
                break;
            }
        }
        /* parse type specific options */
        $type = key($demAttr[Cfg::TYPE]);
        switch ($type) {
            case DemType::A_BINARY:
                break;
            case DemType::A_BOOLEAN:
                break;
            case DemType::A_DATETIME:
                if (isset($demAttr[Cfg::DEFAULT_]) && ($demAttr[Cfg::DEFAULT_] == DemType::DEF_CURRENT)) {
                    $result[MageType::OPT_DEFAULT] = MageType::DEF_CURRENT_TIMESTAMP;
                }
                break;
            case DemType::A_INTEGER:
                if (isset($demAttr[Cfg::TYPE][DemType::A_INTEGER][Cfg::UNSIGNED])) {
                    $result[MageType::OPT_UNSIGNED] = $demAttr[Cfg::TYPE][DemType::A_INTEGER][Cfg::UNSIGNED];
                }
                if (isset($demAttr[Cfg::TYPE][DemType::A_INTEGER][Cfg::AUTOINCREMENT])) {
                    $result[MageType::OPT_AUTO_INC] = $demAttr[Cfg::TYPE][DemType::A_INTEGER][Cfg::AUTOINCREMENT];
                }
                break;
            case DemType::A_NUMERIC:
                break;
            case DemType::A_OPTION:
                break;
            case DemType::A_TEXT:
                break;
        }
        return $result;
    }
1248934
public function onInformationFollows(MultiLineResponse $response)
    {
        $lines = $response->getLines();
        $totalLines = count($lines);

        $result = [];

        for ($i = 0; $i < $totalLines; ++$i) {
            list($name, $high, $low, $status) = explode(' ', $lines[$i]);

            $result[$i] = [
                'name' => $name,
                'high' => $high,
                'low' => $low,
                'status' => $status,
            ];
        }

        return $result;
    }
133122
public static boolean esPDF(File file) {
		boolean ret = false;
		FileReader reader = null;
		try {
			reader= new FileReader(file);
			char[] buffer  = new char[4];
			reader.read(buffer, 0, 4);
			ret = ("%PDF".equals(String.valueOf(buffer)));
		} catch (FileNotFoundException e) {
			log.error("Error: no se encuentra el fichero " + file.getAbsolutePath());
		} catch (IOException e) {
			log.error("Error leyendo el fichero " + file.getAbsolutePath());
		} finally {
			try {
				reader.close();
			} catch (IOException e) {
				log.error("Error cerrando el fichero " + file.getAbsolutePath());
			}
		}
		return ret;
	}
1013789
public static function parse($optionDescription) {
        $short    = null;
        $long     = null;
        $argcount = 0;
        $value    = false;

        $exp = explode('  ', trim($optionDescription), 2);
        $options = $exp[0];
        $description = isset($exp[1]) ? $exp[1] : '';

        $options = str_replace(',', ' ', str_replace('=', ' ', $options));
        foreach (preg_split('/\s+/', $options) as $s) {
            if (strpos($s, '--')===0) {
                $long = $s;
            }
            elseif ($s && $s[0] == '-') {
                $short = $s;
            }
            else {
                $argcount = 1;
            }
        }

        if ($argcount) {
            $value = null;
            if (preg_match('@\[default: (.*)\]@i', $description, $match))
                $value = $match[1];
        }
        return new static($short, $long, $argcount, $value);
    }
1276552
public function render(Descriptor $descriptor) {
		$style = file_get_contents(__DIR__ . '/Assets/style.css');
		
		$styleTag = new Tag('style', $style);
		
		$topologyTag = new Tag();
		$topologyTag->addClass('topology');
		
		return $styleTag->render() . $topologyTag->render($this->renderElement($descriptor));
	}
624759
private function clause($column, $operator, $value, $scape_quote, $clause, $logicaOperator) {
      $str     = "";
      $closure = false;
      $logicaOperator = strtoupper($logicaOperator);
      $clauseUpper = strtoupper($clause);
      $clauseLower = strtolower($clause);
      $this->connection();


      if ( is_array($column) ) {
         foreach ($column as $key => $val) {
            // $this->operators
            if (preg_match('/([\.a-zA-Z0-9_-]+) *(.*)/i', $key,$match)) {
               if (trim($match[2])) {
                  $this->clause(trim($match[1]), trim($match[2]), $val, $scape_quote, $clause, $logicaOperator);
               }
               else {
                  $this->clause(trim($match[1]), $val, $value, $scape_quote, $clause, $logicaOperator);
               }
            }
         }
         return;
      }

      // si es un closure lo ejecutamos
      if ( $column===NULL )
         $column = ' NULL ' ;
      elseif ( gettype( $column )==='boolean' )
         $column = $column ? ' TRUE ' : ' FALSE ' ;
      elseif ($column instanceof \Closure) {
         // el resultado resuelto es almacenado en la variable $_ENV para luego terminar de agruparlo
         $column(new \Daniia\Daniia(true));
         if (preg_match("/^CASE/", $_ENV['daniia_daniia']->case)) {
            $str = '( '.$_ENV['daniia_daniia']->case.' '.$_ENV['daniia_daniia']->when.' '.$_ENV['daniia_daniia']->else.' END )';
            $_ENV['daniia_daniia']->case = NULL;
         }
         else {
            if ( $clauseLower==='on' ) {
               $column = $_ENV['daniia_daniia']->{$clauseLower}.")";
               $closure = TRUE;
            }
            else {
               $column = $_ENV['daniia_daniia']->get_sql();
            }
            $_ENV['daniia_daniia'] = null;
         }
      }


      // si no es un operador valido
      if ( $operator instanceof \Closure )
         list($operator, $value, $scape_quote) = ['=', $operator, $value];
      elseif ( is_array($operator) )
         list($operator, $value, $scape_quote) = ['in', $operator, $value];
      elseif ( !in_array(strtolower(trim($operator)), $this->operators, true) ) {
         list($operator, $value, $scape_quote) = ['=', $operator, $value];
         if ( $scape_quote==='' && $clauseLower==='on' ) {
            $scape_quote = FALSE;
         }
         elseif ( $scape_quote==='' && $clauseLower!=='on' ) {
            $scape_quote = TRUE;
         }
      }


      if ( $value===NULL ) {
         $scape_quote = FALSE;
         $value = ' NULL ' ;
      }
      elseif ( gettype($value)==='boolean' ) {
         $scape_quote = FALSE;
         $value = $value ? ' TRUE ' : ' FALSE ' ;
      }
      elseif ($value instanceof \Closure) {
         // el resultado resuelto es almacenado en la variable $_ENV para luego terminar de agruparlo
         $value(new \Daniia\Daniia());
         
         if (preg_match("/^CASE/", $_ENV['daniia_daniia']->case)) {
            $value = '( '.$_ENV['daniia_daniia']->case.' '.$_ENV['daniia_daniia']->when.' '.$_ENV['daniia_daniia']->else.' END )';
            $_ENV['daniia_daniia']->case = NULL;
         }
         else {
            $value = $_ENV['daniia_daniia']->get_sql();
            $_ENV['daniia_daniia'] = null;
         }
         
         $scape_quote = false;
      }
      elseif (is_array($value) && (strtolower($operator)=='between'||strtolower($operator)=='not between') ) {
         $scape_quote = FALSE;
         $value = ' '.$this->id_conn->quote($value[0]).' AND '.$this->id_conn->quote($value[1]).' ';
      }
      elseif( is_array($value) ) {
         $in = [];
         foreach($value as $val){
            if ( $val===NULL ) {
               $in[] = ' NULL ' ;
            }
            elseif ( gettype($val)==='boolean' ) {
               $in[] = $val ? ' TRUE ' : ' FALSE ' ;
            }
            else {
               $in[] = $this->id_conn->quote($val);
            }
         }
         $scape_quote = FALSE;
         $value = ' ('.implode(',',$in).') ';
      }


      if ( $this->table && !preg_match("/,/", $this->table) ) {
         $this->columns();
      }


      if(gettype( $column )==='string' || gettype( $column )==='integer' || gettype( $column )==='double') {
         if($closure || $value==='') {
            if ( @preg_match("/\( +SELECT +\* +\(/", $column) ) {
               $str = preg_replace("/\( +SELECT +\* +\(/", '(', $column);
            }
            else {
               $str = $column;
            }
         }
         else {
            if ( in_array(strtolower(trim($value)), $this->columnsData, true) ) {
               $str = $column.' '.strtoupper($operator).' '.$value." ";
            }
            else {
               $str = $column.' '.strtoupper($operator).' '.($scape_quote===true?$this->id_conn->quote($value):$value)." ";
            }
         }
      }


      if ($this->bool_group) {
         if (preg_match('/\(/', $this->{$clauseLower})) {
            $this->{$clauseLower} .= " {$logicaOperator} {$str} ";
         }
         else {
            $this->{$clauseLower} .= " ({$str} ";
         }
      }
      else {
         if (preg_match("/".$clauseUpper."/", $this->{$clauseLower})) {
            $this->{$clauseLower} .= " {$logicaOperator} {$str} ";
         }
         else {
            $this->{$clauseLower} = " {$clauseUpper} {$str} ";
         }
      }

      $this->find_first_data = FALSE;

      if ( preg_match("/^CASE/", $this->case) ) {
         $_ENV['daniia_daniia']->case = $this->case;
         $_ENV['daniia_daniia']->when = $this->when;
         $_ENV['daniia_daniia']->else = $this->else;
         $this->get_instance();
         return $str;
      }

      $this->get_instance();
      return $this;
   }
198230
public function touch($idOrDocument) 
    { 
		// All the services we need
		$main = $this->getServiceLocator()->get('neobazaar.service.main');
		$em = $main->getEntityManager();
		$documentRepository = $main->getDocumentEntityRepository();
		$document = $documentRepository->getEntity($idOrDocument);
		$document->setDateEdit(new \DateTime());
		$key = $documentRepository->getEncryptedId($document->getDocumentId());
		
		if(!$this->checkIfOwnerOrAdmin($document)) {
			throw new \Exception('Non possiedi i permessi per agire su questo documento');
		}
		
		// @todo better manage removal from cache... events?
		$cache = $this->getServiceLocator()->get('ClassifiedCache');
		if ($cache->hasItem($key)) {
			$cache->removeItem($key);
		}
		
		$cache = $this->getServiceLocator()->get('ClassifiedCacheOwnerAdmin');
		if ($cache->hasItem($key)) {
			$cache->removeItem($key);
		}
		
		$this->getEventManager()->trigger(__FUNCTION__ . '.pre', $this, array('document' => $document));
		$em->persist($document);
		$em->flush();
		$this->getEventManager()->trigger(__FUNCTION__ . '.post', $this, array('document' => $document));
		
    	return $document;
    }
640740
protected function renderBodyContent(Descriptor $descriptor) {
		$content = new Table();
		$content->addClass('topology-props');
		
		foreach ($descriptor->getProperties() as $property => $value) {
			$value = htmlspecialchars($value);
			
			if (is_numeric($property)) {
				$content[] = [$value, ''];
				continue;
			}
			
			$property  = htmlspecialchars($property);
			$content[] = [$property . ':', $value];
		}
		
		return $content->render();
	}
350912
public function getSelectLists($sKeyPrefix = null)
    {
        $aSelLists = [];
        if ($oArticle = $this->_getOrderArticle()) {
            $aSelLists = $oArticle->getSelectLists();
        }

        return $aSelLists;
    }