/** * phpArmory5 test case * * A test case to derive a new class object from the phpArmory5 class. * @package phpArmory * @subpackage tests */ // Include the phpArmory class library require_once '../phpArmory.class.php'; $areaName = 'eu'; $guildName = "Divinitas"; $guildRealmName = "Madmortem"; $sapi_type = substr(php_sapi_name(), 0, 3); // Instantiate the class library if ($armory = new phpArmory5($areaName = $areaName)) { $guildData = $armory->getGuildData($guildName, $guildRealmName); if ($sapi_type == 'cli') { var_dump($guildData); } else { // Define some variables $guildName = $guildData['guildinfo']['guild']['name']; $guildMemberCount = $guildData['guildinfo']['guild']['members']['membercount']; $guildCharacters = $guildData['guildinfo']['guild']['members']['character']; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?php echo $guildName;
/** * getItemDataByName * * Attempts to fetch a cached version of the requested * item search. Otherwise, it calls the parent function. * * @return string[] An associative array * @param string $item The name of the item * @param string[] $filter Associative array of search parameters */ public function getItemDataByName($itemName, $filter = NULL) { if ($filter && is_array($filter)) { $this->cacheID = "s" . md5($itemName . implode('', $filter)); } else { $this->cacheID = "s" . md5($itemName); } $cached = $this->cacheFetch($this->cacheID); if (!is_array($cached)) { $cached = parent::getItemDataByName($itemName, $filter); if ($this->cacheID) { $scached = serialize($cached); $this->cacheSave($this->cacheID, $scached); unset($this->cacheID); } return $cached; } else { return $cached; } }
<?php /** * phpArmory5 test case * * A test case to derive a new class object from the phpArmory5 class. * @package phpArmory * @subpackage tests */ // Include the phpArmory class library require_once '../phpArmory.class.php'; $areaName = 'us'; $characterName = "Tsigo"; $characterRealmName = "Mal'Ganis"; $sapi_type = substr(php_sapi_name(), 0, 3); // Instantiate the class library if ($armory = new phpArmory5($areaName = $areaName)) { $ach = $armory->getAchievementData($characterName, $characterRealmName, 'Dungeons & Raids'); if ($sapi_type == 'cli') { var_dump($ach); } else { $string = print_r($ach, 1); $string = str_replace(array(" ", "\n"), array(" ", "<br />\n"), $string); echo "\$character = " . $string; } } else { echo "Failed to create a phpArmory5 instance.\n"; }
<?php /** * phpArmory5 test case * * A test case to derive a new class object from the phpArmory5 class. * @package phpArmory * @subpackage tests */ // Include the phpArmory class library require_once '../phpArmory.class.php'; $areaName = 'eu'; $itemID = 19990; $sapi_type = substr(php_sapi_name(), 0, 3); // Instantiate the class library if ($armory = new phpArmory5($areaName = $areaName)) { $itemIDData = $armory->getItemData($itemID); if ($sapi_type == 'cli') { var_dump($itemIDData); } else { $string = print_r($itemIDData, 1); $string = str_replace(array(" ", "\n"), array(" ", "<br />\n"), $string); echo "\$item = " . $string; } } else { echo "Failed to create a phpArmory5 instance.\n"; }
<?php /** * phpArmory5 test case * * A test case to derive a new class object from the phpArmory5 class. * @package phpArmory * @subpackage tests */ // Include the phpArmory class library require_once '../phpArmory.class.php'; $areaName = 'eu'; $characterName = "Arkanella"; $characterRealmName = "Madmortem"; $sapi_type = substr(php_sapi_name(), 0, 3); // Instantiate the class library if ($armory = new phpArmory5($areaName = $areaName)) { $characterData = $armory->getCharacterData($characterName, $characterRealmName); if ($sapi_type == 'cli') { var_dump($characterData); } else { $string = print_r($characterData, 1); $string = str_replace(array(" ", "\n"), array(" ", "<br />\n"), $string); echo "\$character = " . $string; } } else { echo "Failed to create a phpArmory5 instance.\n"; }
<?php /** * phpArmory5 test case * * A test case to derive a new class object from the phpArmory5 class. * @package phpArmory * @subpackage tests */ // Include the phpArmory class library require_once '../phpArmory.class.php'; $areaName = 'eu'; $itemName = "Glimmering Naaru Sliver"; $sapi_type = substr(php_sapi_name(), 0, 3); // Instantiate the class library if ($armory = new phpArmory5($areaName = $areaName)) { $itemNameData = $armory->getItemDataByName($itemName); if ($sapi_type == 'cli') { var_dump($itemNameData); } else { $string = print_r($itemNameData, 1); $string = str_replace(array(" ", "\n"), array(" ", "<br />\n"), $string); echo "\$item = " . $string; } } else { echo "Failed to create a phpArmory5 instance.\n"; }
require_once ('../phpArmory.class.php'); $euArea = 'eu'; $usArea = 'us'; $itemID = 19990; $itemName = "Glimmering Naaru Sliver"; $characterName = "Arkanella"; $characterRealmName = "Madmortem"; $guildName = "Divinitas"; $guildRealmName = "Madmortem"; // Instantiate the class library if ( $armory = new phpArmory5($areaName = $usArea) ) { echo "We have created an instance of phpArmory5 with the area \"" . $usArea ."\" selected.\n"; echo "The current armory patch level is: " . $armory->getPatchLevel() . "\n"; echo "World of Warcraft provides us with " . count ($armory->getTalentData()) . " talent definitions.\n"; if ( $armory->setArea($euArea) ) { $armoryAreaData = $armory->getArea(); echo "Area used now is \"" . $armoryAreaData[0] ."\".\n"; echo "Armory site used now is \"" . $armoryAreaData[1] ."\".\n"; echo "Web site used now is \"" . $armoryAreaData[2] ."\".\n";