Esempio n. 1
0
<?php

/*
  This file is part of WOT Game.

    WOT Game is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    WOT Game is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with WOT Game.  If not, see <http://www.gnu.org/licenses/>.
*/
define('INSIDE', true);
$ugamela_root_path = '../';
include $ugamela_root_path . 'extension.inc';
include $ugamela_root_path . 'common.' . $phpEx;
if (!check_user()) {
    header("Location: login.php");
    die;
}
$fileName = FileUtil::downloadFileFromHttp('http://neu.lost-worlds.de/game/index.php?page=XMLStatistics', 'statistics');
$xmlObj = new XML($fileName);
$arr = $xmlObj->xpath('./*[@userID="156"]');
var_dump($arr);
Esempio n. 2
0
 /**
  * Throw an exception if an NCIP error is found
  *
  * @param XML $response from NCIP call
  *
  * @throws ILSException
  * @return void
  */
 protected function checkResponseForError($response)
 {
     $error = $response->xpath('//ns1:Problem/ns1:ProblemDetail');
     if (!empty($error)) {
         throw new ILSException($error[0]);
     }
 }
Esempio n. 3
0
 /**
  * This function checks whether the specified token is a reserved keyword.
  *
  * @access public
  * @static
  * @param string $token                         the token to be cross-referenced
  * @return boolean                              whether the token is a reserved keyword
  *
  * @see http://www.postgresql.org/docs/7.3/static/sql-keywords-appendix.html
  */
 public static function is_keyword($token)
 {
     if (static::$xml === NULL) {
         static::$xml = XML::load('config/sql/postgresql.xml');
     }
     $token = strtoupper($token);
     $nodes = static::$xml->xpath("/sql/dialect[@name='postgresql' and @version='7.3']/keywords[keyword = '{$token}']");
     return !empty($nodes);
 }
Esempio n. 4
0
 /**
  * Loads the planet data
  */
 protected function loadPlanetData()
 {
     global $resource;
     $fileName = $this->getReport();
     if ($fileName == '') {
         return;
     }
     $xmlObj = new XML($fileName);
     // fleet
     for ($i = 200; $i < 500; ++$i) {
         if (!isset($resource[$i])) {
             continue;
         }
         $array = $xmlObj->xpath('//*[@id="' . $i . '"]');
         if (!isset($array[0][0])) {
             continue;
         }
         $this->defenderFleets[1]['fleet'][$i] = intval(str_replace(WCF::getLanguage()->get('wcf.global.thousandsSeparator'), '', $array[0][0]));
     }
     // tech
     for ($i = 109; $i <= 111; ++$i) {
         if (!isset($resource[$i])) {
             continue;
         }
         $array = $xmlObj->xpath('//*[@id="' . $i . '"]');
         if (!isset($array[0][0])) {
             continue;
         }
         $this->defenderFleets[1]['tech'][$i] = intval(str_replace(WCF::getLanguage()->get('wcf.global.thousandsSeparator'), '', $array[0][0]));
     }
     // own techs
     $this->attackerFleets[1]['tech'][109] = LWCore::getUser()->military_tech;
     $this->attackerFleets[1]['tech'][110] = LWCore::getUser()->defence_tech;
     $this->attackerFleets[1]['tech'][111] = LWCore::getUser()->shield_tech;
 }