コード例 #1
0
 /**
  * Тестирование правил для Variables
  *
  * @return bool
  */
 private function checkVariables($rules)
 {
     // Получаем список переменных страницы
     $variables = array();
     $url = parse_url($this->page_url);
     if (is_array($url) && !empty($url['query'])) {
         parse_str($url['query'], $variables);
     }
     if ($this->firephp) {
         $this->firephp->log($variables, 'Page Variables');
         $this->firephp->log($rules['rules'], 'Veriables Rules');
     }
     // Группируем правила по названиям переменных
     $var_rules = array();
     foreach ($rules['rules'] as $rule) {
         if (!isset($var_rules[$rule['name']])) {
             $var_rules[$rule['name']] = array();
         }
         array_push($var_rules[$rule['name']], $rule);
     }
     // Проверяем правила для каждой переменой
     foreach ($var_rules as $name => $value) {
         if (isset($variables[$name]) && !$this->compareRules($variables[$name], $value)) {
             return false;
         }
     }
     //return $this->compareRules($this->page_url, $rules['rules']);
     return true;
 }
コード例 #2
0
ファイル: Debug.php プロジェクト: m3uzz/onionfw
 /**
  *
  * @param int|string|array|object $pmVar
  *        	- Valor a ser impresso
  * @param boolean $pbForceDebug
  *        	- Se true força a impressão mesmo que no config o debug esteja
  *        	desabilitado
  * @param string $psType
  *        	- força o tipo de saída de impressão
  */
 public static function debug($pmVar, $pbForceDebug = false, $psType = null)
 {
     $laConfig = Config::getAppOptions();
     $laDebug = $laConfig['log']['debug']['PHP'];
     if (Util::toBoolean($laDebug['enable']) || $pbForceDebug) {
         $lsType = $laDebug['output'];
         if ($psType != null) {
             $lsType = $psType;
         }
         switch ($lsType) {
             case "DISPLAY":
                 echo '<pre style="margin:50px;"><code><fieldset><legend>Onion Debug:</legend>';
                 self::displayDebug($pmVar);
                 echo '</fieldset></code></pre>';
                 break;
             case "FIREBUG":
                 $loLogger = new FirePHP();
                 $loLogger->log($pmVar);
                 break;
             case "COMMENT":
                 echo "<!--";
                 self::displayDebug($pmVar);
                 echo "-->";
                 break;
             case "BUFFER":
                 $loBuffer = Session::getRegister("DEBUG");
                 $loBuffer[] = Json::encode($pmVar);
                 break;
         }
     }
 }
コード例 #3
0
 /**
  * Shows loaded extensions
  */
 protected function showLoadedExtensions()
 {
     $extensions = get_loaded_extensions();
     natcasesort($extensions);
     $this->openCat("Loaded Extensions");
     $this->firePhp->log(count($extensions) . " extensions");
     foreach ($extensions as $k => $v) {
         $this->firePhp->log($v);
     }
     $this->closeCat();
 }
コード例 #4
0
ファイル: Console.php プロジェクト: xamiro-dev/xamiro
 /**
  * log to console directly with this method passing only the first required parameter and to change
  * the log type the third parameter according to allowed log types. pass a lable for second parameter
  * to describe the message send to console.
  *
  * @error 10908
  * @param null|mixed $mixed expects the message of any type to send to console
  * @param null|string $label expects the optional label to describe the first parameter
  * @param string $type expects the log type - see log type array
  * @param array $options expects optional parameters
  * @return void
  * @throws Xapp_Error
  */
 public function log($mixed = null, $label = null, $type = 'info', array $options = array())
 {
     $type = strtolower((string) $type);
     if (array_key_exists($type, self::$_typeMap)) {
         if ($type === 'ini') {
             $this->ini($mixed, $label, $options);
         }
         if ($label !== null) {
             $label = trim(trim($label), ':') . ':';
         }
         switch ($this->_driver) {
             case 'chromephp':
                 switch ($type) {
                     case $type === 'ungroup' || $mixed === null:
                         $this->console->groupEnd();
                         break;
                     case 'group':
                         $this->console->group($mixed);
                         break;
                     case 'trace':
                         $this->console->log((string) $label, $mixed, 'info');
                         break;
                     default:
                         $this->console->log((string) $label, $mixed, self::$_typeMap[$type]);
                 }
                 break;
             case 'firephp':
                 switch ($type) {
                     case $type === 'ungroup' || $mixed === null:
                         $this->console->groupEnd();
                         break;
                     case 'group':
                         $this->console->group($mixed, $options);
                         break;
                     case 'trace':
                         $this->console->trace($label);
                         break;
                     default:
                         $this->console->{$type}($mixed, (string) $label, $options);
                 }
                 break;
         }
     } else {
         throw new Xapp_Error(xapp_sprintf(_("xapp console log type: %s not supported"), $type), 1090801);
     }
 }
コード例 #5
0
 /**
  * Тест на протекшены
  *
  * @return boolean
  */
 protected function checkProtections()
 {
     // Проверяем цепочку протекшенов
     $check = $this->protections->isValid();
     if (!$check) {
         // Получаем cause
         $this->cause = $this->protections->getCause();
         // Получаем статус
         $this->result = $this->protections->getStatus();
         if ($this->firephp) {
             $this->firephp->log($this->cause, 'Cause');
             $this->firephp->log($this->result, 'Status');
         }
     }
     return $check;
 }
コード例 #6
0
        if (count($taxonBreedingUses) > 0) {
            $cwrConcept->setTaxonBreedingUses($taxonBreedingUses);
        }
        /*         * ** STORAGE BEHAVIOR *** */
        $storageBehaviorDAO = DAOFactory::getDAOFactory()->getStorageBehaviorDAO();
        $storageBehavior = $storageBehaviorDAO->getStorageBehavior($cwrConcept->getTaxon()->getGenus());
        if ($storageBehavior != null) {
            $cwrConcept->setStorageBehavior($storageBehavior);
        }
        /*         * ** HERBARIA *** */
        $herbariumDAO = DAOFactory::getDAOFactory()->getHerbariumDAO();
        $herbaria = $herbariumDAO->getHerbariaData($cwrConcept->getTaxon()->getID());
        if (count($herbaria) > 0) {
            $cwrConcept->getTaxon()->setHerbaria($herbaria);
        }
    }
    $firephp = new FirePHP(true);
    //TODO - Remove this variable when the development of this page finalize.
    $firephp->log($cwrConcept, 'CWR:');
    // Only for test
    $smarty->assign("taxon", $cwrConcept->getTaxon());
    $smarty->assign("mainTaxon", $mainTaxon);
    $smarty->assign("cwr", $cwrConcept);
}
// display TPL
$smarty->display("cwr-details.tpl");
// display sidebar
//get_sidebar();
//
// display footer
get_footer();
コード例 #7
0
 /**
  * Debug if debug enabled
  *
  * @param string $msg
  * @param string $label
  */
 protected function debug($msg, $label = null)
 {
     if ($this->firePhp) {
         $this->firePhp->log($msg, $label);
     }
 }
コード例 #8
0
 static function outputBrowser($type, $data)
 {
     // Browser Extensions
     if (CONSOLE_FIREPHP) {
         try {
             //if (!in_array($type, array("log", "info", "warn", "error"))) { $type = "log"; }
             //FirePHP::{$type}($data);
             switch ($type) {
                 case "log":
                     FirePHP::log($data);
                     break;
                 case "info":
                     FirePHP::info($data);
                     break;
                 case "warn":
                     FirePHP::warn($data);
                     break;
                 case "error":
                     FirePHP::error($data);
                     break;
                 default:
                     FirePHP::log($data);
                     break;
             }
         } catch (Exception $e) {
         }
     }
     if (CONSOLE_CHROMELOGGER) {
         try {
             //if (!in_array($type, array("log", "info", "warn", "error", "group", , "groupCollapsed", "groupEnd"))) { $type = "log"; }
             //ChromePhp::{$type}($data);
             switch ($type) {
                 case "log":
                     ChromePhp::log($data);
                     break;
                 case "info":
                     ChromePhp::info($data);
                     break;
                 case "warn":
                     ChromePhp::warn($data);
                     break;
                 case "error":
                     ChromePhp::error($data);
                     break;
                 case "group":
                     ChromePhp::group($data);
                     break;
                 case "groupCollapsed":
                     ChromePhp::groupCollapsed($data);
                     break;
                 case "groupEnd":
                     ChromePhp::groupEnd($data);
                     break;
                 default:
                     ChromePhp::log($data);
                     break;
             }
         } catch (Exception $e) {
         }
     }
 }
コード例 #9
0
array_push($priority_genera, 'Medicago');
array_push($priority_genera, 'Musa');
array_push($priority_genera, 'Ochthochloa');
array_push($priority_genera, 'Oryza');
array_push($priority_genera, 'Pennisetum');
array_push($priority_genera, 'Phaseolus');
array_push($priority_genera, 'Pisum');
array_push($priority_genera, 'Secale');
array_push($priority_genera, 'Solanum');
array_push($priority_genera, 'Sorghum');
array_push($priority_genera, 'Tornabenea');
array_push($priority_genera, 'Triticum');
array_push($priority_genera, 'Vavilovia');
array_push($priority_genera, 'Vicia');
array_push($priority_genera, 'Vigna');
$smarty->assign("priority_genera", $priority_genera);
$smarty->assign("countries", $countries);
$smarty->assign("regions", $regions);
$smarty->assign("breedingUses", $breedingUses);
$smarty->assign("concept_types", $concept_types);
$firephp = new FirePHP(true);
//TODO - Remove this variable when the development of this page finalize.
$firephp->log($breedingUses, 'USES:');
// Only for test
//$query = "SELECT DISTINCT Util_Type from Utilisation ORDER BY Util_Type ASC;";
//$uses = $db->getall($query);
//$smarty->assign("uses", $uses);
// display TPL
$smarty->display("search.tpl");
//get_sidebar();
get_footer();
コード例 #10
0
ファイル: firephp.php プロジェクト: hkilter/OpenSupplyChains
 public function log($Object, $Label = null, $Options = array())
 {
     parent::log($Object, $Label, $Options);
     return $this;
 }
コード例 #11
0
require_once WORKSPACE_DIR . 'core/dao/factories/DAOFactory.php';
$firephp = new FirePHP(true);
//TODO - Remove this variable when the development of this page finalize.
if (isset($_GET['id']) && $_GET['id'] != '') {
    $cropID = $_GET['id'];
    // Search for this gene pool. Unique ids only
    $cropID = array_unique($cropID);
    $cropID = array_values($cropID);
    $genePoolConceptDAO = DAOFactory::getDAOFactory()->getGenePoolConceptDAO();
    $genePools = array();
    $taxa = array();
    $crop_taxa = array();
    $taxons = array();
    foreach ($cropID as $cropid) {
        $genePoolConcept = $genePoolConceptDAO->getGenePoolConcept($cropid);
        $firephp->log($genePoolConcept);
        if ($genePoolConcept != null) {
            /*             * ** MAIN SYNONYMS *** */
            $taxonDAO = DAOFactory::getDAOFactory()->getTaxonDAO();
            $synonyms = $taxonDAO->getSysnonyms($cropid);
            if (count($synonyms) > 0) {
                $genePoolConcept->getMainCrop()->getTaxon()->setSynonyms($synonyms);
            }
            /*             * ** CLASSIFICATION REFERENCES *** */
            $classificationReferenceDAO = DAOFactory::getDAOFactory()->getClassificationReferenceDAO();
            $classificationReferences = $classificationReferenceDAO->getClassificationReferences($cropid);
            if (count($classificationReferences) > 0) {
                $genePoolConcept->getMainCrop()->getTaxon()->setClassificationReferences($classificationReferences);
            }
            /*             * ** TAXON GROUP CONCEPT *** */
            /* The taxon group concept can be extracted using the method getTaxonOrdereByConceptLevels()