function ejecutarConsulta($res = null) { try { if (count($this->validacion->getRes()) == 0) { parent::ejecutarConsulta($res); } else { $this->generaRespuestaParametros(); } } catch (Exception $e) { //TODO DEBUG DE ERRORES //echo 'Error capturado -> '.$e->getMessage(); } }
// END getStylesheetDependencies /* function: checkRecursivity() purpose: checks if a stylesheet has recursive dependencies, e.g. if "test" depends on "test" which means itself --- input: $name - name of the stylesheet $array - array containing the dependencies output: (none) */ function checkRecursivity($name, $array) { $isRecursive = 0; for ($i = 0; $i <= count($array); $i++) { if ($name == $array[$i]) { $isRecursive = 1; } } if ($isRecursive != 0) { printf('<b>CRITICAL:</b> Stylesheet for element "%s" has recursive dependencies!<br>', $name); } } } $db = new driver(); $db->setupConnection($CONFIG['DatabaseHost'], $CONFIG['DatabaseUser'], $CONFIG['DatabasePassword'], $CONFIG['DatabaseName'], $CONFIG['DatabasePort']); $XSLDepTracker = new XSLDependencyTracker($db); $deps = $XSLDepTracker->getStylesheetDependencies("test"); printf("<pre>"); printf("Stylesheet: %s\n", "test"); print_r($deps); printf("</pre");
private function loadGrid($path) { $xml = simplexml_load_file($path); foreach ($xml->driver as $driver) { $lfsname = $driver->lfsname; $name = $driver->name; $racestarted = $driver->racestarted; $racefinished = $driver->racefinished; $elo = $driver->elo; $positionString = explode("#", $driver->positions); $positions = array(); foreach ($positionString as $key => $val) { $positions[$key + 1] = $val + 0; } $newDriver = new driver($lfsname, $elo); $newDriver->setName($name); $newDriver->setPositionArray($positions); $newDriver->setRaceFinished($racefinished); $newDriver->setRaceStarted($racestarted); $this->drivers[strval($lfsname)] = $newDriver; } }
$xml2 = simplexml_load_file($_GET['histpath']); $driverarray = array(); foreach ($xml->driver as $driver) { $elo = $driver->elo; if ($_GET['sortby'] == "highestelo") { $xpath = '//driver[@lfsname="' . $driver->lfsname . '"]'; $search = $xml2->xpath($xpath); $highestElo = $search[0]; foreach ($search as $elo) { if (intval($elo) > intval($highestElo)) { $highestElo = $elo; } } $elo = $highestElo; } $tempDriver = new driver($driver->lfsname, $elo); $tempDriver->setName($driver->name); $tempDriver->setRaceFinished($driver->racefinished); $tempDriver->setRaceStarted($driver->racestarted); $tempDriver->setPositionArray(explode("#", $driver->positions)); if (isset($_GET['finishlimit'])) { if (intval($driver->racefinished) < intval($_GET['finishlimit'])) { continue; } } if (isset($_GET['startlimit'])) { if (intval($driver->racestarted) < intval($_GET['startlimit'])) { continue; } } $driverarray[] = $tempDriver;
<?php include 'standard/header.php'; ?> <!-- mainpart --> <?php include_once 'dev/driver.php'; include_once 'standard/tools.php'; if (isset($_GET['gridpath']) && isset($_GET['lfsname']) && isset($_GET['histpath'])) { $xml = simplexml_load_file($_GET['gridpath']); $lfsname = urlencode($_GET['lfsname']); $xpath = "/grid/driver[@lfsname=\"" . strval($lfsname) . "\"]"; $tempdriver = $xml->xpath($xpath); if ($tempdriver != false) { $tempdriver = $tempdriver[0]; $driver = new driver($lfsname, $tempdriver->elo); $driver->setName($tempdriver->name); $driver->setPositionArray(explode("#", $tempdriver->positions)); $driver->setRaceFinished($tempdriver->racefinished); $driver->setRaceStarted($tempdriver->racestarted); $xml = simplexml_load_file($_GET['histpath']); $xpath = '//driver[@lfsname="' . $driver->getLfsName() . '"]'; $xpath2 = '//driver[@lfsname="' . $driver->getLfsName() . '"]/..'; $search = $xml->xpath($xpath); $search2 = $xml->xpath($xpath2); $highestElo = $search[0]; $lowestElo = $search[0]; $index = 0; $indexHighest = 0; $indexLowest = 0; $eloHistoryArray = array();
/** * 更新注册表的值 * * @param $arg_key 需要更新的键名 * @param $arg_value 更新后的值 * @param $arg_expire int 有效时间(S) * @return mixed */ public function update($arg_key, $arg_value, $arg_expire = null) { return $this->_driver->update($arg_key, $arg_value, $arg_expire); }