phpArmory-0.3/0000755000077300007700000000000011006072604013536 5ustar marenkaymarenkayphpArmory-0.3/phpArmory.class.php0000644000077300007700000003477011006072414017346 0ustar marenkaymarenkay * @package phpArmory * @version 0.2 * */ /* $Id: phpArmory.class.php,v 0.1 2007/06/02 */ /** * phpArmory Class * * A class library to fetch and unserialize XML data from the World of Warcraft Armory website. * * @package phpArmory */ class phpArmory { /** * The URL of the Armory website * * @var string */ var $armory = "http://www.wowarmory.com/"; /** * The case sensitive name of a realm. * * @var string */ var $realm = FALSE; /** * The case sensitive name of a guild. * * @var string */ var $guild = FALSE; /** * The case sensitive name of a character. * * @var string */ var $character = FALSE; /** * The default language in which items will be fetched * * @var string */ var $language = "en"; /** * The default user agent for making HTTP requests * * @var string */ var $userAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1"; /** * The amounto of time in senconds after which to consider * a connection timed out if not data has been yet been * received. * * @var integer */ var $timeout = 30; /**#@-*/ /** * The Constructor * * This function is called when the object is created. It has * one optional parameter which sets the base url of the * Armory website that will be used to fetch the serialized * XML data. (Useful for connecting to the European Armory) * * @param string $armory URL of the Armory website */ function phpArmory($armory = NULL){ if ($armory){ $this->armory = $armory; } } /* * setLanguage * * Set the language in which items shall be fetched. * * @param string $language language to be used */ function setlang($language) { switch ($language) { case 'de': $this->language = 'de'; break; case 'es': $this->language = 'es'; break; case 'fr': $this->language = 'fr'; break; case 'uk': $this->language = 'en'; break; default: $this->language = 'en'; } } /* * getLanguage * * Returns the language in which items are fetched. * * @return string $language language used */ function getLanguage(){ return $this->language; } /** * characterFetch * * This function returns the unserialized XML data for a character * from the Armory. Both parameters are optional if their * corresponding instance variables are set. Most of the * time it is safe to assume that the realm instance * variable is set. Therefore, most of the time, the * second paramater is optional whereas the first * parameter usually needs to be defined. It is very * important to remember that both paramaters are case * sensitive. * * @return string[] An associative array * @param string $character The name of the character * @param string $realm The character's realm */ function characterFetch($character = NULL, $realm = NULL){ if(($character==NULL)&&($this->character)) $character = $this->character; if(($realm==NULL)&&($this->realm)) $realm = $this->realm; $url = $this->armory."character-%s.xml?r=".str_replace(" ", "+",$realm)."&n=".str_replace(" ", "+",$character); $result = $this->xmlToArray($this->xmlFetch(sprintf($url, "sheet"))); $pages = array("reputation", "skills", "talents"); foreach ($pages as $page) { $temp = $this->xmlToArray($this->xmlFetch(sprintf($url, $page))); unset($temp['characterinfo']['character']); $result['characterinfo'] = array_merge($result['characterinfo'], reset($temp)); } return $result; } /** * characterIconURL * * This function returns the url of a portrait icon for a * character from the Armory. * * @param string[] $info The character info array including level, gender, race, and class * @return string The URL of the icon * @author Claire Matthews */ function characterIconURL($info) { $dir = "wow" . ($info['level'] < 60 ? "-default" : ($info['level'] < 70 ? "" : "-70")); return $this->armory."images/portraits/$dir/{$info['genderid']}-{$info['raceid']}-{$info['classid']}.gif"; } /** * guildFetch * * This function returns the unserialized XML data for a Guild * from the Armory. Both parameters are optional if their * corresponding instance variables are set. Most of the * time it is safe to assume that the realm instance * variable is set. Therefore, most of the time, the * second paramater is optional whereas the first * parameter usually needs to be defined. It is very * important to remember that both paramaters are case * sensitive. * * @return string[] An associative array * @param string $guild The name of the guild * @param string $realm The guild's realm */ function guildFetch($guild = NULL, $realm = NULL){ if(($guild==NULL)&&($this->guild)) $guild = $this->guild; if(($realm==NULL)&&($this->realm)) $realm = $this->realm; $url = $this->armory."guild-info.xml?r=".str_replace(" ", "+",$realm)."&n=".str_replace(" ", "+",$guild); return $this->xmlToArray($this->xmlFetch($url)); } /** * itemFetch * * This function returns the unserialized XML data * for an item from the Armory. The itemID parameter * is required. * * @return string[] An associative array * @param integer $itemID The ID of the item */ function itemFetch($itemID){ $url = $this->armory."item-tooltip.xml?i=".$itemID; return $this->xmlToArray($this->xmlFetch($url)); } /** * itemNameFetch * * This function returns the unserialized XML data * for an item from the Armory. The item parameter * is required. The second parameter filters search * results by the specified string and is optional. * * @return string[] An associative array * @param string $item The name of the item * @param string[] $filter Associative array of search parameters * @author Thiago Melo * @author Claire Matthews */ function itemNameFetch($item, $filter = NULL) { // Fix for the "-" Minux character $item = str_replace("-", "+ ",$item); if ($this->language != 'en') { // url encode and utf8 for öäëáéíãñ characters $item = urlencode(utf8_encode($item)); } $url = $this->armory."search.xml?searchQuery=".str_replace(" ", "+",$item)."&searchType=items"; $items = $this->xmlToArray($this->xmlFetch($url)); $items = $items['armorysearch']['searchresults']['items']['item']; if (!is_array($items[0])) $items = array($items); foreach ($items as $x_item) { if ($this->language != 'en') { $x_item['name'] = utf8_decode($x_item['name']); $item = urldecode(utf8_decode($item)); } if (strtolower($x_item['name']) == strtolower($item)) { $itemID = $x_item['id']; if ($filter==NULL) { return $this->itemFetch($itemID); } elseif (is_array($filter)) { $x_item = $this->itemFetch($itemID); $tooltip = $x_item['itemtooltip']; foreach ($filter as $attrib => $x_filter) { if ($tooltip[$attrib] != $x_filter) { unset($x_item); break; } } if ($x_item) return $x_item; } } } } /** * itemIconURL * * This function returns the url of a icon * for an item from a character sheet from the armory * * @param string[] $itemRef The item icon ref from the character or item info array. * @param string[] example $itemRef = $char['characterinfo']['charactertab']['items']['item']['0']['icon']; * @param string[] example $itemRef = $item['itemtooltips']['itemtooltip']['icon']; * @return string The URL of the icon * @author Tony Gritton */ function itemIconURL($itemRef) { return $this->armory."images/icons/51x51/".$itemRef.".jpg"; } /** * xmlFetch * * This function returns the string of characters * returned from an HTTP GET request to the url * defined in the url parameter. It is interesting * to note that although the function is called * xmlFetch, the returned string may not neccesarily * be serialized XML data when the function is * called publicly. * * @todo Make the function independent of cURL * * @param string $url URL of the page to fetch data from * @param string $userAgent The user agent making the GET request * @param integer $timeout The connection timeout in seconds */ function xmlFetch($url, $userAgent = NULL, $timeout = NULL){ if(($userAgent==NULL)&&($this->userAgent)) $userAgent = $this->userAgent; if(($timeout==NULL)&&($this->timeout)) $timeout = $this->timeout; if (function_exists('curl_init')){ $ch = curl_init(); $timeout = $this->timeout; $userAgent = $this->userAgent; curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt ($ch, CURLOPT_USERAGENT, $userAgent); curl_setopt ($ch, CURLOPT_HTTPHEADER, array('Accept-language: '.$this->language)); curl_setopt ($ch, CURLOPT_HEADER, 0); curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1); $f = curl_exec($ch); curl_close($ch); } else { } return $f; } /** * xmlToArray * * This function converts an xml string to an associative array * duplicating the xml file structure. * * @param string $xmlData The XML data string to convert. * @param boolean $includeTopTag Whether or not the topmost xml tag should be included in the array. The default value for this is false. * @param boolean $lowerCaseTags Whether or not tags should be set to lower case. Default value for this parameter is true. * @return string[] An associative array * @author Colin Viebrock */ function & xmlToArray($xmlData, $includeTopTag = false, $lowerCaseTags = true){ $xmlArray = array(); $parser = xml_parser_create(); xml_parse_into_struct($parser, $xmlData, $vals, $index); xml_parser_free($parser); $temp = $depth = array(); foreach ($vals as $value) { switch ($value['type']) { case 'open': case 'complete': array_push($depth, $value['tag']); $p = join('::', $depth); if ($lowerCaseTags) { $p = strtolower($p); if (is_array($value['attributes'])) { $value['attributes'] = array_change_key_case($value['attributes']); } } $data = ( $value['attributes'] ? array($value['attributes']) : array()); $data = ( trim($value['value']) ? array_merge($data, array($value['value'])) : $data); if ($temp[$p]) $temp[$p] = array_merge($temp[$p], $data); else $temp[$p] = $data; if ($value['type']=='complete') array_pop($depth); break; case 'close': array_pop($depth); break; } } if (!$includeTopTag) unset($temp["page"]); foreach ($temp as $key => $value) { if (count($value)==1) { $value = reset($value); } $levels = explode('::', $key); $num_levels = count($levels); if ($num_levels==1) { $xmlArray[$levels[0]] = $value; } else { $pointer = &$xmlArray; for ($i=0; $i<$num_levels; $i++) { if ( !isset( $pointer[$levels[$i]] ) ) { $pointer[$levels[$i]] = array(); } $pointer = &$pointer[$levels[$i]]; } $pointer = $value; } } return ($includeTopTag ? $xmlArray : reset($xmlArray)); } /**#@-*/ } ?> phpArmory-0.3/phpArmoryCache.class.php0000644000077300007700000003135311006072604020265 0ustar marenkaymarenkay * @package phpArmory * @version 0.2 * */ /** * Include the phpArmory class to retrieve the XML from the Armory */ include('phpArmory.class.php'); class phpArmoryCache extends phpArmory { /** * Data storage format ("flat" or "mysql") * * @var string */ var $dataStore = "mysql"; /** * The path to the cache directory (must chmod 777) * * @var string */ var $dataPath = "./cache"; /** * The mysql connection string * * @var string */ var $dataConn = "mysql://user:pass@localhost/test"; /** * The mysql cache table * * @var string */ var $dataTable = "armory_cache"; /** * The time between cache updates in seconds * * @todo Make the interval able to be set for each thing (ie. update items once a week, update guilds once a day, etc..) * * @var integer */ var $updateInterval = 14400; /** * Internal cache id of the current item * * @var integer */ var $cacheID = 0; /**#@-*/ /** * The Constructor * * This function is called when the object is created. It has * three optional parameters. The first sets the base url of * the Armory website that will be used to fetch the serialized * XML data. The second sets whether data will be stored in * flat files or a mysql database. The third indicates how * long a cached XML query should be kept before updating. * * @param string $armory URL of the Armory website * @param string $dataStore "flat" or "mysql" * @param string $dataConn e.g. "mysql://username:password@localhost/database" * @param string $dataTable Name of the database table to use * @param integer $updateInterval Time (in seconds) between cache updates */ function phpArmoryCache($armory = NULL, $dataStore = NULL, $dataConn = NULL, $dataTable = NULL, $updateInterval = NULL) { if(($dataStore==NULL)&&($this->dataStore)){ $dataStore = $this->dataStore; } else { $this->dataStore = $dataStore; } if(($dataConn==NULL)&&($this->dataConn)){ $dataConn = $this->dataConn; } else { $this->dataConn = $dataConn; } if(($dataTable==NULL)&&($this->dataTable)){ $dataTable = $this->dataTable; } else { $this->dataTable = $dataTable; } switch($this->dataStore) { case 'flat': break; case 'mysql': $conn = @parse_url($this->dataConn); $this->dataConn = mysql_connect($conn['host'], $conn['user'], $conn['pass']) or die("Failed to connect to database"); mysql_select_db(str_replace('/', '', $conn['path']), $this->dataConn) or die("Unable to select database table"); $query = "CREATE TABLE IF NOT EXISTS `".$this->dataTable."` ( `cache_id` VARCHAR(100) NOT NULL DEFAULT '', `cache_time` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, `cache_xml` TEXT, PRIMARY KEY `cache_id` (`cache_id`))"; mysql_query($query, $this->dataConn) or die("Unable to create the cache table"); break; default: die("Invalid dataStore defined."); break; } $this->phpArmory($armory); } /** * characterFetch * * Attempts to fetch a cached version of the requested * character. Otherwise, it calls the parent function. * * @return string[] An associative array * @param string $character The name of the character * @param string $realm The character's realm * @author Claire Matthews */ function characterFetch($character = NULL, $realm = NULL){ if(($character==NULL)&&($this->character)) $character = $this->character; if(($realm==NULL)&&($this->realm)) $realm = $this->realm; $this->cacheID = "c".md5($character.$realm); $cached = $this->cacheFetch($this->cacheID); if (!is_array($cached)) { $cached = parent::characterFetch($character, $realm); if ( $this->cacheID ) { $scached = serialize($cached); $this->cacheSave($this->cacheID, $scached); unset($this->cacheID); } return $cached; }else{ return $cached; } } /** * guildFetch * * Attempts to fetch a cached version of the requested * guild. Otherwise, it calls the parent function. * * @return string[] An associative array * @param string $guild The name of the guild * @param string $realm The guild's realm * @author Claire Matthews */ function guildFetch($guild = NULL, $realm = NULL){ if(($guild==NULL)&&($this->guild)) $guild = $this->guild; if(($realm==NULL)&&($this->realm)) $realm = $this->realm; $this->cacheID = "g".md5($guild.$realm); $cached = $this->cacheFetch($this->cacheID); if (!is_array($cached)) { $cached = parent::guildFetch($guild, $realm); if ( $this->cacheID ) { $scached = serialize($cached); $this->cacheSave($this->cacheID, $scached); unset($this->cacheID); } return $cached; } else { return $cached; } } /** * itemFetch * * Attempts to fetch a cached version of the requested * item. Otherwise, it calls the parent function. * * @return string[] An associative array * @param integer $itemID The ID of the item * @author Claire Matthews */ function itemFetch($itemID){ $this->cacheID = "i".md5($itemID); $cached = $this->cacheFetch($this->cacheID); if (!is_array($cached)) { $cached = parent::itemFetch($itemID); if ( $this->cacheID ) { $scached = serialize($cached); $this->cacheSave($this->cacheID, $scached); unset($this->cacheID); } return $cached; }else{ return $cached; } } /** * itemNameFetch * * 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 * @author Claire Matthews */ function itemNameFetch($item, $filter = NULL) { if ($filter&&is_array($filter)) { $this->cacheID = "s".md5($item.implode('', $filter)); } else { $this->cacheID = "s".md5($item); } $cached = $this->cacheFetch($this->cacheID); if (!is_array($cached)) { $cached = parent::itemNameFetch($item, $filter); if ( $this->cacheID ) { $scached = serialize($cached); $this->cacheSave($this->cacheID, $scached); unset($this->cacheID); } return $cached; }else{ return $cached; } } /** * xmlFetch * * This fetches the XML data as normal by calling * the parent function. If a cache id is set, it will * save the XML data to the cache and then unset the id. * * @param string $url URL of the page to fetch data from * @param string $userAgent The user agent making the GET request * @param integer $timeout The connection timeout in seconds * @author Claire Matthews */ function xmlFetch($url, $userAgent = NULL, $timeout = NULL){ $xml = parent::xmlFetch($url, $userAgent, $timeout); /* disabled. * if ( $this->cacheID ) { * $this->cacheSave($this->cacheID, $xml); * unset($this->cacheID); * } */ return $xml; } /** * cacheFetch * * This function returns the unserialized XML data * for the requested cache id from the cache. It * will also remove old cached files/rows that have * not been updated since the update interval. * * @return string[] An associative array * @param string $cacheID The ID of the cached thing * @author Claire Matthews */ function cacheFetch($cacheID) { switch($this->dataStore){ case "flat": $filename = $this->dataPath."/".$cacheID; if (file_exists($filename)) { if (time()-filemtime($filename) > $this->updateInterval) { // Cache is out of date, remove the old file @unlink($filename); } else { // Return the cached XML as an array $array = unserialize(file_get_contents($filename)); return $array; } } break; case "mysql": $query = "SELECT cache_xml, UNIX_TIMESTAMP(cache_time) AS cache_time FROM `".$this->dataTable."` WHERE cache_id = '".$cacheID."'"; $result = mysql_query($query, $this->dataConn) or die("Unable to select cache from database"); if ($result && mysql_num_rows($result)) { if (time()-mysql_result($result, 0, 'cache_time') > $this->updateInterval) { $query = "DELETE FROM `".$this->dataTable."` WHERE cache_id = '".$cacheID."'"; mysql_query($query, $this->dataConn); } else { // Return the cached XML as an array return $this->xmlToArray(mysql_result($result, 0, 'cache_xml')); } } break; } } /** * cacheSave * * This function saves the given XML data to the * cache by its cache id. * * @param string $cacheID The ID of the cached thing * @param string $xml The XML info to be saved * @author Claire Matthews */ function cacheSave($cacheID, $xml) { switch($this->dataStore){ case "flat": $filename = $this->dataPath."/".$cacheID; $handle = fopen($filename, 'x') or die("Cannot open file ($filename)"); fwrite($handle, $xml) or die("Cannot write to file ($filename)"); fclose($handle); break; case "mysql": if (get_magic_quotes_gpc()) $xml = stripslashes($xml); $xml = mysql_escape_string($xml); $query = "REPLACE INTO `".$this->dataTable."` (cache_id, cache_xml) VALUES('".$cacheID."','".$xml."')"; mysql_query($query, $this->dataConn) or die("Unable to save to database " . mysql_error()); break; } } /**#@-*/ } ?> phpArmory-0.3/GPL.txt0000644000077300007700000004310310711600144014720 0ustar marenkaymarenkay GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. phpArmory-0.3/cache/0000755000077300007700000000000011006072510014575 5ustar marenkaymarenkayphpArmory-0.3/doc/0000755000077300007700000000000011010304560014275 5ustar marenkaymarenkayphpArmory-0.3/examples/0000755000077300007700000000000011006072510015350 5ustar marenkaymarenkayphpArmory-0.3/doc/errors.html0000644000077300007700000000307610711600144016511 0ustar marenkaymarenkay phpDocumentor Parser Errors and Warnings
Post-parsing

phpArmoryCache.class.php

Warnings:


Warning on line 37 - no @package tag was used in a DocBlock for class phpArmoryCache

Documentation generated on Sun, 02 Sep 2007 16:45:10 -0700 by phpDocumentor 1.4.0a2
phpArmory-0.3/doc/todolist.html0000644000077300007700000000361310711600144017033 0ustar marenkaymarenkay Todo List

Todo List

phpArmory

phpArmoryCache::$updateInterval

  • Make the interval able to be set for each thing (ie. update items once a week, update guilds once a day, etc..)

phpArmory::xmlFetch()

  • Make the function independent of cURL

Documentation generated on Sun, 02 Sep 2007 16:45:10 -0700 by phpDocumentor 1.4.0a2
phpArmory-0.3/doc/packages.html0000644000077300007700000000163211010304361016742 0ustar marenkaymarenkay phpArmory-0.3/doc/li_phpArmory.html0000644000077300007700000000377710711600144017652 0ustar marenkaymarenkay phpArmory Documentation

phpArmory Documentation

Welcome to phpArmory!

This documentation was generated by phpDocumentor v1.4.0a2

Documentation generated on Sun, 02 Sep 2007 16:45:09 -0700 by phpDocumentor 1.4.0a2
phpArmory-0.3/doc/index.html0000644000077300007700000000377710711600144016314 0ustar marenkaymarenkay phpArmory Documentation

phpArmory Documentation

Welcome to phpArmory!

This documentation was generated by phpDocumentor v1.4.0a2

Documentation generated on Sun, 02 Sep 2007 16:45:09 -0700 by phpDocumentor 1.4.0a2
phpArmory-0.3/doc/elementindex.html0000644000077300007700000002361310711600144017655 0ustar marenkaymarenkay Element Index

Index of All Elements

a c d g i p r t u x top

a

$armory
in file phpArmory.class.php, variable phpArmory::$armory
    The URL of the Armory website
armory
in file phpArmory.class.php, method phpArmory::armory()
    The Constructor
top

c

$cacheID
in file phpArmoryCache.class.php, variable phpArmoryCache::$cacheID
    Internal cache id of the current item
$character
in file phpArmory.class.php, variable phpArmory::$character
    The case sensitive name of a character.
cacheFetch
in file phpArmoryCache.class.php, method phpArmoryCache::cacheFetch()
    cacheFetch
cacheSave
in file phpArmoryCache.class.php, method phpArmoryCache::cacheSave()
    cacheSave
characterFetch
in file phpArmory.class.php, method phpArmory::characterFetch()
    characterFetch
characterFetch
in file phpArmoryCache.class.php, method phpArmoryCache::characterFetch()
    characterFetch
characterIconURL
in file phpArmory.class.php, method phpArmory::characterIconURL()
    characterIconURL
top

d

$dataConn
in file phpArmoryCache.class.php, variable phpArmoryCache::$dataConn
    The mysql connection string
$dataPath
in file phpArmoryCache.class.php, variable phpArmoryCache::$dataPath
    The path to the cache directory (must chmod 777)
$dataStore
in file phpArmoryCache.class.php, variable phpArmoryCache::$dataStore
    Data storage format ("flat" or "mysql")
$dataTable
in file phpArmoryCache.class.php, variable phpArmoryCache::$dataTable
    The mysql cache table
top

g

$guild
in file phpArmory.class.php, variable phpArmory::$guild
    The case sensitive name of a guild.
guildFetch
in file phpArmoryCache.class.php, method phpArmoryCache::guildFetch()
    guildFetch
guildFetch
in file phpArmory.class.php, method phpArmory::guildFetch()
    guildFetch
top

i

itemFetch
in file phpArmoryCache.class.php, method phpArmoryCache::itemFetch()
    itemFetch
itemFetch
in file phpArmory.class.php, method phpArmory::itemFetch()
    itemFetch
itemNameFetch
in file phpArmoryCache.class.php, method phpArmoryCache::itemNameFetch()
    itemNameFetch
itemNameFetch
in file phpArmory.class.php, method phpArmory::itemNameFetch()
    itemNameFetch
top

p

phpArmory
in file phpArmory.class.php, class phpArmory
    phpArmory Class
phpArmory.class.php
procedural page phpArmory.class.php
phpArmoryCache
in file phpArmoryCache.class.php, class phpArmoryCache
    phpArmory Class
phpArmoryCache
in file phpArmoryCache.class.php, method phpArmoryCache::phpArmoryCache()
    The Constructor
phpArmoryCache.class.php
procedural page phpArmoryCache.class.php
top

r

$realm
in file phpArmory.class.php, variable phpArmory::$realm
    The case sensitive name of a realm.
top

t

$timeout
in file phpArmory.class.php, variable phpArmory::$timeout
    The amounto of time in senconds after which to consider a connection timed out if not data has been yet been received.
top

u

$updateInterval
in file phpArmoryCache.class.php, variable phpArmoryCache::$updateInterval
    The time between cache updates in seconds
$userAgent
in file phpArmory.class.php, variable phpArmory::$userAgent
    The default user agent for making HTTP requests
top

x

xmlFetch
in file phpArmoryCache.class.php, method phpArmoryCache::xmlFetch()
    xmlFetch
xmlFetch
in file phpArmory.class.php, method phpArmory::xmlFetch()
    xmlFetch
xmlToArray
in file phpArmory.class.php, method phpArmory::xmlToArray()
    xmlToArray
xmlToArrayClose
in file phpArmory.class.php, method phpArmory::xmlToArrayClose()
    xmlToArrayClose
xmlToArrayOpen
in file phpArmory.class.php, method phpArmory::xmlToArrayOpen()
    xmlToArrayOpen

Documentation generated on Sun, 02 Sep 2007 16:45:09 -0700 by phpDocumentor 1.4.0a2
phpArmory-0.3/doc/classtrees_phpArmory.html0000644000077300007700000000310510711600144021377 0ustar marenkaymarenkay Class Trees for Package phpArmory

Class Trees for Package phpArmory


Root class phpArmory


Documentation generated on Sun, 02 Sep 2007 16:45:09 -0700 by phpDocumentor 1.4.0a2
phpArmory-0.3/doc/blank.html0000644000077300007700000000064211010304361016253 0ustar marenkaymarenkay Generated Documentation

Generated Documentation

Welcome to phpArmory!

This documentation was generated by phpDocumentor v1.4.2
phpArmory-0.3/doc/elementindex_phpArmory.html0000644000077300007700000002547110711600144021722 0ustar marenkaymarenkay Package phpArmory Element Index

Element index for package phpArmory

a c d g i p r t u x top

a

$armory
in file phpArmory.class.php, variable phpArmory::$armory
    The URL of the Armory website
armory
in file phpArmory.class.php, method phpArmory::armory()
    The Constructor
top

c

$cacheID
in file phpArmoryCache.class.php, variable phpArmoryCache::$cacheID
    Internal cache id of the current item
$character
in file phpArmory.class.php, variable phpArmory::$character
    The case sensitive name of a character.
cacheFetch
in file phpArmoryCache.class.php, method phpArmoryCache::cacheFetch()
    cacheFetch
cacheSave
in file phpArmoryCache.class.php, method phpArmoryCache::cacheSave()
    cacheSave
characterFetch
in file phpArmory.class.php, method phpArmory::characterFetch()
    characterFetch
characterFetch
in file phpArmoryCache.class.php, method phpArmoryCache::characterFetch()
    characterFetch
characterIconURL
in file phpArmory.class.php, method phpArmory::characterIconURL()
    characterIconURL
top

d

$dataConn
in file phpArmoryCache.class.php, variable phpArmoryCache::$dataConn
    The mysql connection string
$dataPath
in file phpArmoryCache.class.php, variable phpArmoryCache::$dataPath
    The path to the cache directory (must chmod 777)
$dataStore
in file phpArmoryCache.class.php, variable phpArmoryCache::$dataStore
    Data storage format ("flat" or "mysql")
$dataTable
in file phpArmoryCache.class.php, variable phpArmoryCache::$dataTable
    The mysql cache table
top

g

$guild
in file phpArmory.class.php, variable phpArmory::$guild
    The case sensitive name of a guild.
guildFetch
in file phpArmoryCache.class.php, method phpArmoryCache::guildFetch()
    guildFetch
guildFetch
in file phpArmory.class.php, method phpArmory::guildFetch()
    guildFetch
top

i

itemFetch
in file phpArmoryCache.class.php, method phpArmoryCache::itemFetch()
    itemFetch
itemFetch
in file phpArmory.class.php, method phpArmory::itemFetch()
    itemFetch
itemNameFetch
in file phpArmoryCache.class.php, method phpArmoryCache::itemNameFetch()
    itemNameFetch
itemNameFetch
in file phpArmory.class.php, method phpArmory::itemNameFetch()
    itemNameFetch
top

p

phpArmory
in file phpArmory.class.php, class phpArmory
    phpArmory Class
phpArmory.class.php
procedural page phpArmory.class.php
phpArmoryCache
in file phpArmoryCache.class.php, class phpArmoryCache
    phpArmory Class
phpArmoryCache
in file phpArmoryCache.class.php, method phpArmoryCache::phpArmoryCache()
    The Constructor
phpArmoryCache.class.php
procedural page phpArmoryCache.class.php
top

r

$realm
in file phpArmory.class.php, variable phpArmory::$realm
    The case sensitive name of a realm.
top

t

$timeout
in file phpArmory.class.php, variable phpArmory::$timeout
    The amounto of time in senconds after which to consider a connection timed out if not data has been yet been received.
top

u

$updateInterval
in file phpArmoryCache.class.php, variable phpArmoryCache::$updateInterval
    The time between cache updates in seconds
$userAgent
in file phpArmory.class.php, variable phpArmory::$userAgent
    The default user agent for making HTTP requests
top

x

xmlFetch
in file phpArmoryCache.class.php, method phpArmoryCache::xmlFetch()
    xmlFetch
xmlFetch
in file phpArmory.class.php, method phpArmory::xmlFetch()
    xmlFetch
xmlToArray
in file phpArmory.class.php, method phpArmory::xmlToArray()
    xmlToArray
xmlToArrayClose
in file phpArmory.class.php, method phpArmory::xmlToArrayClose()
    xmlToArrayClose
xmlToArrayOpen
in file phpArmory.class.php, method phpArmory::xmlToArrayOpen()
    xmlToArrayOpen

Documentation generated on Sun, 02 Sep 2007 16:45:08 -0700 by phpDocumentor 1.4.0a2
phpArmory-0.3/doc/phpArmory/0000755000077300007700000000000011010304361016255 5ustar marenkaymarenkayphpArmory-0.3/doc/media/0000755000077300007700000000000011010304361015353 5ustar marenkaymarenkayphpArmory-0.3/doc/phpArmory/phpArmoryCache.html0000644000077300007700000006642411010304361022064 0ustar marenkaymarenkay Docs For Class phpArmoryCache

Class phpArmoryCache

Description

phpArmory Class

A class library to fetch and unserialize XML data from the World of Warcraft Armory website.

Located in /phpArmoryCache.class.php (line 38)

phpArmory
   |
   --phpArmoryCache
Variable Summary
integer $cacheID
string $dataConn
string $dataPath
string $dataStore
string $dataTable
integer $updateInterval
Method Summary
phpArmoryCache phpArmoryCache ([string $armory = NULL], [string $dataStore = NULL], [string $dataConn = NULL], [string $dataTable = NULL], [integer $updateInterval = NULL])
string[] cacheFetch (string $cacheID)
void cacheSave (string $cacheID, string $xml)
string[] characterFetch ([string $character = NULL], [string $realm = NULL])
string[] guildFetch ([string $guild = NULL], [string $realm = NULL])
string[] itemFetch (integer $itemID)
string[] itemNameFetch (string $item, [string[] $filter = NULL])
void xmlFetch (string $url, [string $userAgent = NULL], [integer $timeout = NULL])
Variables
integer $cacheID = 0 (line 82)

Internal cache id of the current item

string $dataConn = "mysql://user:pass@localhost/test" (line 59)

The mysql connection string

string $dataPath = "../cache" (line 52)

The path to the cache directory (must chmod 777)

string $dataStore = "mysql" (line 45)

Data storage format ("flat" or "mysql")

string $dataTable = "armory_cache" (line 66)

The mysql cache table

integer $updateInterval = 14400 (line 75)

The time between cache updates in seconds

  • todo: Make the interval able to be set for each thing (ie. update items once a week, update guilds once a day, etc..)

Inherited Variables

Inherited from phpArmory

phpArmory::$armory
phpArmory::$character
phpArmory::$guild
phpArmory::$language
phpArmory::$realm
phpArmory::$timeout
phpArmory::$userAgent
Methods
Constructor phpArmoryCache (line 101)

The Constructor

This function is called when the object is created. It has three optional parameters. The first sets the base url of the Armory website that will be used to fetch the serialized XML data. The second sets whether data will be stored in flat files or a mysql database. The third indicates how long a cached XML query should be kept before updating.

phpArmoryCache phpArmoryCache ([string $armory = NULL], [string $dataStore = NULL], [string $dataConn = NULL], [string $dataTable = NULL], [integer $updateInterval = NULL])
  • string $armory: URL of the Armory website
  • string $dataStore: "flat" or "mysql"
  • string $dataConn: e.g. "mysql://username:password@localhost/database"
  • string $dataTable: Name of the database table to use
  • integer $updateInterval: Time (in seconds) between cache updates
cacheFetch (line 326)

cacheFetch

This function returns the unserialized XML data for the requested cache id from the cache. It will also remove old cached files/rows that have not been updated since the update interval.

string[] cacheFetch (string $cacheID)
  • string $cacheID: The ID of the cached thing
cacheSave (line 372)

cacheSave

This function saves the given XML data to the cache by its cache id.

void cacheSave (string $cacheID, string $xml)
  • string $cacheID: The ID of the cached thing
  • string $xml: The XML info to be saved
characterFetch (line 161)

characterFetch

Attempts to fetch a cached version of the requested character. Otherwise, it calls the parent function.

string[] characterFetch ([string $character = NULL], [string $realm = NULL])
  • string $character: The name of the character
  • string $realm: The character's realm

Redefinition of:
phpArmory::characterFetch()
characterFetch
guildFetch (line 196)

guildFetch

Attempts to fetch a cached version of the requested guild. Otherwise, it calls the parent function.

string[] guildFetch ([string $guild = NULL], [string $realm = NULL])
  • string $guild: The name of the guild
  • string $realm: The guild's realm

Redefinition of:
phpArmory::guildFetch()
guildFetch
itemFetch (line 230)

itemFetch

Attempts to fetch a cached version of the requested item. Otherwise, it calls the parent function.

string[] itemFetch (integer $itemID)
  • integer $itemID: The ID of the item

Redefinition of:
phpArmory::itemFetch()
itemFetch
itemNameFetch (line 262)

itemNameFetch

Attempts to fetch a cached version of the requested item search. Otherwise, it calls the parent function.

string[] itemNameFetch (string $item, [string[] $filter = NULL])
  • string $item: The name of the item
  • string[] $filter: Associative array of search parameters

Redefinition of:
phpArmory::itemNameFetch()
itemNameFetch
xmlFetch (line 299)

xmlFetch

This fetches the XML data as normal by calling the parent function. If a cache id is set, it will save the XML data to the cache and then unset the id.

void xmlFetch (string $url, [string $userAgent = NULL], [integer $timeout = NULL])
  • string $url: URL of the page to fetch data from
  • string $userAgent: The user agent making the GET request
  • integer $timeout: The connection timeout in seconds

Redefinition of:
phpArmory::xmlFetch()
xmlFetch

Inherited Methods

Inherited From phpArmory

phpArmory::phpArmory()
phpArmory::characterFetch()
phpArmory::characterIconURL()
phpArmory::getLanguage()
phpArmory::guildFetch()
phpArmory::itemFetch()
phpArmory::itemIconURL()
phpArmory::itemNameFetch()
phpArmory::setlang()
phpArmory::xmlFetch()
phpArmory::xmlToArray()

Documentation generated on Wed, 07 May 2008 12:48:17 +0200 by phpDocumentor 1.4.2

phpArmory-0.3/doc/phpArmory/phpArmory.html0000644000077300007700000007202511010304361021132 0ustar marenkaymarenkay Docs For Class phpArmory

Class phpArmory

Description

phpArmory Class

A class library to fetch and unserialize XML data from the World of Warcraft Armory website.

Located in /phpArmory.class.php (line 43)


	
			
Direct descendents
Class Description
phpArmoryCache phpArmory Class
Variable Summary
string $armory
string $character
string $guild
string $language
string $realm
integer $timeout
string $userAgent
Method Summary
phpArmory phpArmory ([string $armory = NULL])
string[] characterFetch ([string $character = NULL], [string $realm = NULL])
string characterIconURL (string[] $info)
void getLanguage ()
string[] guildFetch ([string $guild = NULL], [string $realm = NULL])
string[] itemFetch (integer $itemID)
string itemIconURL (string[] $itemRef, string[] 1, string[] 2)
string[] itemNameFetch (string $item, [string[] $filter = NULL])
void setlang ( $language)
void xmlFetch (string $url, [string $userAgent = NULL], [integer $timeout = NULL])
string[] &xmlToArray (string $xmlData, [boolean $includeTopTag = false], [boolean $lowerCaseTags = true])
Variables
string $armory = "http://www.wowarmory.com/" (line 50)

The URL of the Armory website

string $character = FALSE (line 71)

The case sensitive name of a character.

string $guild = FALSE (line 64)

The case sensitive name of a guild.

string $language = "en" (line 78)

The default language in which items will be fetched

string $realm = FALSE (line 57)

The case sensitive name of a realm.

integer $timeout = 30 (line 94)

The amounto of time in senconds after which to consider a connection timed out if not data has been yet been received.

string $userAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1" (line 85)

The default user agent for making HTTP requests

Methods
Constructor phpArmory (line 107)

The Constructor

This function is called when the object is created. It has one optional parameter which sets the base url of the Armory website that will be used to fetch the serialized XML data. (Useful for connecting to the European Armory)

phpArmory phpArmory ([string $armory = NULL])
  • string $armory: URL of the Armory website
characterFetch (line 169)

characterFetch

This function returns the unserialized XML data for a character from the Armory. Both parameters are optional if their corresponding instance variables are set. Most of the time it is safe to assume that the realm instance variable is set. Therefore, most of the time, the second paramater is optional whereas the first parameter usually needs to be defined. It is very important to remember that both paramaters are case sensitive.

  • return: An associative array
string[] characterFetch ([string $character = NULL], [string $realm = NULL])
  • string $character: The name of the character
  • string $realm: The character's realm

Redefined in descendants as:
characterIconURL (line 198)

characterIconURL

This function returns the url of a portrait icon for a character from the Armory.

string characterIconURL (string[] $info)
  • string[] $info: The character info array including level, gender, race, and class
getLanguage (line 148)
void getLanguage ()
guildFetch (line 222)

guildFetch

This function returns the unserialized XML data for a Guild from the Armory. Both parameters are optional if their corresponding instance variables are set. Most of the time it is safe to assume that the realm instance variable is set. Therefore, most of the time, the second paramater is optional whereas the first parameter usually needs to be defined. It is very important to remember that both paramaters are case sensitive.

  • return: An associative array
string[] guildFetch ([string $guild = NULL], [string $realm = NULL])
  • string $guild: The name of the guild
  • string $realm: The guild's realm

Redefined in descendants as:
itemFetch (line 242)

itemFetch

This function returns the unserialized XML data for an item from the Armory. The itemID parameter is required.

  • return: An associative array
string[] itemFetch (integer $itemID)
  • integer $itemID: The ID of the item

Redefined in descendants as:
itemIconURL (line 314)

itemIconURL

This function returns the url of a icon for an item from a character sheet from the armory

string itemIconURL (string[] $itemRef, string[] 1, string[] 2)
  • string[] $itemRef: The item icon ref from the character or item info array.
  • string[] 1: example $itemRef = $char['characterinfo']['charactertab']['items']['item']['0']['icon'];
  • string[] 2: example $itemRef = $item['itemtooltips']['itemtooltip']['icon'];
itemNameFetch (line 263)

itemNameFetch

This function returns the unserialized XML data for an item from the Armory. The item parameter is required. The second parameter filters search results by the specified string and is optional.

string[] itemNameFetch (string $item, [string[] $filter = NULL])
  • string $item: The name of the item
  • string[] $filter: Associative array of search parameters

Redefined in descendants as:
setlang (line 122)
void setlang ( $language)
  • $language
xmlFetch (line 337)

xmlFetch

This function returns the string of characters returned from an HTTP GET request to the url defined in the url parameter. It is interesting to note that although the function is called xmlFetch, the returned string may not neccesarily be serialized XML data when the function is called publicly.

  • todo: Make the function independent of cURL
void xmlFetch (string $url, [string $userAgent = NULL], [integer $timeout = NULL])
  • string $url: URL of the page to fetch data from
  • string $userAgent: The user agent making the GET request
  • integer $timeout: The connection timeout in seconds

Redefined in descendants as:
xmlToArray (line 380)

xmlToArray

This function converts an xml string to an associative array duplicating the xml file structure.

string[] &xmlToArray (string $xmlData, [boolean $includeTopTag = false], [boolean $lowerCaseTags = true])
  • string $xmlData: The XML data string to convert.
  • boolean $includeTopTag: Whether or not the topmost xml tag should be included in the array. The default value for this is false.
  • boolean $lowerCaseTags: Whether or not tags should be set to lower case. Default value for this parameter is true.

Documentation generated on Wed, 07 May 2008 12:48:17 +0200 by phpDocumentor 1.4.2

phpArmory-0.3/doc/phpArmory/_phpArmory.class.php.html0000644000077300007700000000633011010304361023157 0ustar marenkaymarenkay Docs for page phpArmory.class.php

/phpArmory.class.php

Description

Project: phpArmory: fetch and unserialize XML data from the World of Warcraft Armory website.

File: phpArmory.class.php

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

This program 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 General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

For questions, help, comments, discussion, etc., please join the phpArmory mailing list. Send a blank e-mail to smarty-general-subscribe@lists.php.net

Classes
Class Description
phpArmory phpArmory Class

Documentation generated on Wed, 07 May 2008 12:48:17 +0200 by phpDocumentor 1.4.2

phpArmory-0.3/doc/phpArmory/_phpArmoryCache.class.php.html0000644000077300007700000001021711010304361024102 0ustar marenkaymarenkay Docs for page phpArmoryCache.class.php

/phpArmoryCache.class.php

Description

Project: phpArmoryCache: Extends the phpArmory class by caching the results in files or a database.

File: phpArmoryCache.class.php

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

This program 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 General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

For questions, help, comments, discussion, etc., please join the phpArmory mailing list. Send a blank e-mail to smarty-general-subscribe@lists.php.net

Classes
Class Description
phpArmoryCache phpArmory Class
Includes
include ('phpArmory.class.php') (line 36)

Include the phpArmory class to retrieve the XML from the Armory

Documentation generated on Wed, 07 May 2008 12:48:17 +0200 by phpDocumentor 1.4.2

phpArmory-0.3/doc/phpArmory/.svn/0000755000077300007700000000000011004316304017144 5ustar marenkaymarenkayphpArmory-0.3/doc/phpArmory/.svn/entries0000444000077300007700000000151210711600237020542 0ustar marenkaymarenkay8 dir 9 https://phparmory.svn.sourceforge.net/svnroot/phparmory/trunk/phpArmory/doc/phpArmory https://phparmory.svn.sourceforge.net/svnroot/phparmory 2007-09-03T00:10:44.572278Z 7 poeticdragon svn:special svn:externals svn:needs-lock d442ef44-2732-0410-878e-c691a92a4cb8 _phpArmoryCache.class.php.html file 2007-10-30T09:59:59.000000Z 72fc4512e8c5a41ce96ab3baf6824823 2007-09-03T00:10:44.572278Z 7 poeticdragon phpArmory.html file 2007-10-30T09:59:59.000000Z 3e3c2cdf68e5a11594cd12b1a2faa97c 2007-09-03T00:10:44.572278Z 7 poeticdragon phpArmoryCache.html file 2007-10-30T09:59:59.000000Z 3fc0c02a24f31b9697f4906475bd9992 2007-09-03T00:10:44.572278Z 7 poeticdragon _phpArmory.class.php.html file 2007-10-30T09:59:59.000000Z 60a41d89952365dbc0ce98f9e306c39e 2007-09-03T00:10:44.572278Z 7 poeticdragon phpArmory-0.3/doc/phpArmory/.svn/format0000444000077300007700000000000210711600237020352 0ustar marenkaymarenkay8 phpArmory-0.3/doc/phpArmory/.svn/all-wcprops0000444000077300007700000000125410711600237021337 0ustar marenkaymarenkayK 25 svn:wc:ra_dav:version-url V 59 /svnroot/phparmory/!svn/ver/7/trunk/phpArmory/doc/phpArmory END _phpArmoryCache.class.php.html K 25 svn:wc:ra_dav:version-url V 90 /svnroot/phparmory/!svn/ver/7/trunk/phpArmory/doc/phpArmory/_phpArmoryCache.class.php.html END phpArmory.html K 25 svn:wc:ra_dav:version-url V 74 /svnroot/phparmory/!svn/ver/7/trunk/phpArmory/doc/phpArmory/phpArmory.html END phpArmoryCache.html K 25 svn:wc:ra_dav:version-url V 79 /svnroot/phparmory/!svn/ver/7/trunk/phpArmory/doc/phpArmory/phpArmoryCache.html END _phpArmory.class.php.html K 25 svn:wc:ra_dav:version-url V 85 /svnroot/phparmory/!svn/ver/7/trunk/phpArmory/doc/phpArmory/_phpArmory.class.php.html END phpArmory-0.3/doc/phpArmory/.svn/prop-base/0000755000077300007700000000000010711600237021041 5ustar marenkaymarenkayphpArmory-0.3/doc/phpArmory/.svn/props/0000755000077300007700000000000010711600237020314 5ustar marenkaymarenkayphpArmory-0.3/doc/phpArmory/.svn/text-base/0000755000077300007700000000000010711600237021045 5ustar marenkaymarenkayphpArmory-0.3/doc/phpArmory/.svn/tmp/0000755000077300007700000000000010711600237017751 5ustar marenkaymarenkayphpArmory-0.3/doc/phpArmory/.svn/text-base/phpArmory.html.svn-base0000444000077300007700000004702710711600237025441 0ustar marenkaymarenkay Docs For Class phpArmory

Class: phpArmory

Source Location: /phpArmory.class.php

Class Overview [line 43]


phpArmory Class

Author(s):

Version:

Copyright:


Child classes:

phpArmoryCache
phpArmory Class

Inherited Variables

Inherited Constants

Inherited Methods



Class Details

phpArmory Class

A class library to fetch and unserialize XML data from the World of Warcraft Armory website.

[ Top ]


Class Variables

$armory =  "http://www.wowarmory.com/"

[line 50]

The URL of the Armory website

Type: string

Overrides:

[ Top ]

$character =  FALSE

[line 71]

The case sensitive name of a character.

Type: string

Overrides:

[ Top ]

$guild =  FALSE

[line 64]

The case sensitive name of a guild.

Type: string

Overrides:

[ Top ]

$realm =  FALSE

[line 57]

The case sensitive name of a realm.

Type: string

Overrides:

[ Top ]

$timeout =  30

[line 87]

The amounto of time in senconds after which to consider a connection timed out if not data has been yet been received.

Type: integer

Overrides:

[ Top ]

$userAgent =  "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1"

[line 78]

The default user agent for making HTTP requests

Type: string

Overrides:

[ Top ]


Class Methods

armory

void armory( [string $armory = NULL])

[line 100]

The Constructor

This function is called when the object is created. It has one optional parameter which sets the base url of the Armory website that will be used to fetch the serialized XML data. (Useful for connecting to the European Armory)

Parameters:

  • string $armory - URL of the Armory website

[ Top ]

characterFetch

string[] characterFetch( [string $character = NULL], [string $realm = NULL])

[line 125]

characterFetch

This function returns the unserialized XML data for a character from the Armory. Both parameters are optional if their corresponding instance variables are set. Most of the time it is safe to assume that the realm instance variable is set. Therefore, most of the time, the second paramater is optional whereas the first parameter usually needs to be defined. It is very important to remember that both paramaters are case sensitive.

Tags:

  • return - An associative array

Overridden in child classes as:

phpArmoryCache::characterFetch()
characterFetch

Parameters:

  • string $character - The name of the character
  • string $realm - The character's realm

[ Top ]

characterIconURL

string characterIconURL( integer $level, integer $genderID, integer $raceID, integer $classID)

[line 148]

characterIconURL

This function returns the url of a portrait icon for a character from the Armory.

Tags:

Parameters:

  • integer $level - The level of the character
  • integer $genderID - The gender id of the character
  • integer $raceID - The race id of the character
  • integer $classID - The class id of the character

[ Top ]

guildFetch

string[] guildFetch( [string $guild = NULL], [string $realm = NULL])

[line 172]

guildFetch

This function returns the unserialized XML data for a Guild from the Armory. Both parameters are optional if their corresponding instance variables are set. Most of the time it is safe to assume that the realm instance variable is set. Therefore, most of the time, the second paramater is optional whereas the first parameter usually needs to be defined. It is very important to remember that both paramaters are case sensitive.

Tags:

  • return - An associative array

Overridden in child classes as:

phpArmoryCache::guildFetch()
guildFetch

Parameters:

  • string $guild - The name of the guild
  • string $realm - The guild's realm

[ Top ]

itemFetch

string[] itemFetch( integer $itemID)

[line 192]

itemFetch

This function returns the unserialized XML data for an item from the Armory. The itemID parameter is required.

Tags:

  • return - An associative array

Overridden in child classes as:

phpArmoryCache::itemFetch()
itemFetch

Parameters:

  • integer $itemID - The ID of the item

[ Top ]

itemNameFetch

string[] itemNameFetch( string $item, [string[] $filter = NULL])

[line 213]

itemNameFetch

This function returns the unserialized XML data for an item from the Armory. The item parameter is required. The second parameter filters search results by the specified string and is optional.

Tags:

Overridden in child classes as:

phpArmoryCache::itemNameFetch()
itemNameFetch

Parameters:

  • string $item - The name of the item
  • string[] $filter - Associative array of search parameters

[ Top ]

xmlFetch

void xmlFetch( string $url, [string $userAgent = NULL], [integer $timeout = NULL])

[line 264]

xmlFetch

This function returns the string of characters returned from an HTTP GET request to the url defined in the url parameter. It is interesting to note that although the function is called xmlFetch, the returned string may not neccesarily be serialized XML data when the function is called publicly.

Tags:

  • todo - Make the function independent of cURL

Overridden in child classes as:

phpArmoryCache::xmlFetch()
xmlFetch

Parameters:

  • string $url - URL of the page to fetch data from
  • string $userAgent - The user agent making the GET request
  • integer $timeout - The connection timeout in seconds

[ Top ]

xmlToArray

string[] &xmlToArray( string $xmlData, [boolean $includeTopTag = false], [boolean $lowerCaseTags = true])

[line 306]

xmlToArray

This function converts an xml string to an associative array duplicating the xml file structure.

Tags:

Parameters:

  • string $xmlData - The XML data string to convert.
  • boolean $includeTopTag - Whether or not the topmost xml tag should be included in the array. The default value for this is false.
  • boolean $lowerCaseTags - Whether or not tags should be set to lower case. Default value for this parameter is true.

[ Top ]

xmlToArrayClose

boolean xmlToArrayClose( string &$topTag, boolean &$includeTopTag, string[] &$val, boolean &$lowerCaseTags, string &$levels, string &$prevTag, boolean &$multipleData, stringp[] &$xml, string &$currTag)

[line 495]

xmlToArrayClose

Private support function for xmlToArray. Handles an xml OPEN tag.

Tags:

Parameters:

  • string &$topTag - xmlToArray topTag variable
  • boolean &$includeTopTag - xmlToArray includeTopTag variable
  • string[] &$val - xmlToArray val variable
  • string &$currTag - xmlToArray currTag variable
  • boolean &$lowerCaseTags - xmlToArray lowerCaseTags variable
  • string &$levels - xmlToArray levels variable
  • string &$prevTag - xmlToArray prevTag variable
  • boolean &$multipleData - xmlToArray multipleData variable
  • stringp[] &$xml - xmlToArray xml variable

[ Top ]

xmlToArrayOpen

boolean xmlToArrayOpen( string &$topTag, boolean &$includeTopTag, string[] &$val, boolean &$lowerCaseTags, string[] &$levels, string &$prevTag, boolean &$multipleData, string[] &$xml, string &$currTag)

[line 395]

xmlToArrayOpen

Private support function for xmlToArray. Handles an xml OPEN tag.

Tags:

Parameters:

  • string &$topTag - xmlToArray topTag variable
  • boolean &$includeTopTag - xmlToArray includeTopTag variable
  • string[] &$val - xmlToArray val variable
  • string &$currTag - xmlToArray currTag variable
  • boolean &$lowerCaseTags - xmlToArray lowerCaseTags variable
  • string[] &$levels - xmlToArray levels variable
  • string &$prevTag - xmlToArray prevTag variable
  • boolean &$multipleData - xmlToArray multipleData variable
  • string[] &$xml - xmlToArray xml variable

[ Top ]


Class Constants


Documentation generated on Sun, 02 Sep 2007 16:45:09 -0700 by phpDocumentor 1.4.0a2
phpArmory-0.3/doc/phpArmory/.svn/text-base/_phpArmory.class.php.html.svn-base0000444000077300007700000000716610711600237027472 0ustar marenkaymarenkay Docs for page phpArmory.class.php

Procedural File: phpArmory.class.php

Source Location: /phpArmory.class.php



Classes:

phpArmory
phpArmory Class

Page Details:

Project: phpArmory: fetch and unserialize XML data from the World of Warcraft Armory website.

File: phpArmory.class.php

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

This program 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 General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

For questions, help, comments, discussion, etc., please join the phpArmory mailing list. Send a blank e-mail to smarty-general-subscribe@lists.php.net

Tags:






Documentation generated on Sun, 02 Sep 2007 16:45:09 -0700 by phpDocumentor 1.4.0a2
phpArmory-0.3/doc/phpArmory/.svn/text-base/_phpArmoryCache.class.php.html.svn-base0000444000077300007700000000763210711600237030414 0ustar marenkaymarenkay Docs for page phpArmoryCache.class.php

Procedural File: phpArmoryCache.class.php

Source Location: /phpArmoryCache.class.php



Classes:

phpArmoryCache
phpArmory Class

Page Details:

Project: phpArmoryCache: Extends the phpArmory class by caching the results in files or a database.

File: phpArmoryCache.class.php

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

This program 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 General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

For questions, help, comments, discussion, etc., please join the phpArmory mailing list. Send a blank e-mail to smarty-general-subscribe@lists.php.net

Tags:


Includes:
include('phpArmory.class.php') [line 36]

Include the phpArmory class to retrieve the XML from the Armory





Documentation generated on Sun, 02 Sep 2007 16:45:09 -0700 by phpDocumentor 1.4.0a2
phpArmory-0.3/doc/phpArmory/.svn/text-base/phpArmoryCache.html.svn-base0000444000077300007700000004243310711600237026361 0ustar marenkaymarenkay Docs For Class phpArmoryCache

Class: phpArmoryCache

Source Location: /phpArmoryCache.class.php

Class Overview [line 38]

phpArmory
   |
   --phpArmoryCache

phpArmory Class

Author(s):

Version:

Copyright:


Inherited Methods



Class Details

phpArmory Class

A class library to fetch and unserialize XML data from the World of Warcraft Armory website.

[ Top ]


Class Variables

$cacheID

[line 83]

Internal cache id of the current item

Type: integer

Overrides:

[ Top ]

$dataConn =  "mysql://user:password@localhost/test"

[line 60]

The mysql connection string

Type: string

Overrides:

[ Top ]

$dataPath =  "../cache"

[line 52]

The path to the cache directory (must chmod 777)

Type: string

Overrides:

[ Top ]

$dataStore =  "mysql"

[line 45]

Data storage format ("flat" or "mysql")

Type: string

Overrides:

[ Top ]

$dataTable =  "armory_cache"

[line 67]

The mysql cache table

Type: string

Overrides:

[ Top ]

$updateInterval =  300

[line 76]

The time between cache updates in seconds

Tags:

  • todo - Make the interval able to be set for each thing (ie. update items once a week, update guilds once a day, etc..)

Type: integer

Overrides:

[ Top ]


Class Methods

phpArmoryCache

phpArmoryCache phpArmoryCache( [string $armory = NULL], [string $dataStore = NULL], [integer $updateInterval = NULL])

[line 100]

The Constructor

This function is called when the object is created. It has three optional parameters. The first sets the base url of the Armory website that will be used to fetch the serialized XML data. The second sets whether data will be stored in flat files or a mysql database. The third indicates how long a cached XML query should be kept before updating.

Parameters:

  • string $armory - URL of the Armory website
  • string $dataStore - "flat" or "mysql"
  • integer $updateInterval - Time (in seconds) between cache updates

[ Top ]

cacheFetch

string[] cacheFetch( string $cacheID)

[line 261]

cacheFetch

This function returns the unserialized XML data for the requested cache id from the cache. It will also remove old cached files/rows that have not been updated since the update interval.

Tags:

Parameters:

  • string $cacheID - The ID of the cached thing

[ Top ]

cacheSave

void cacheSave( string $cacheID, string $xml)

[line 306]

cacheSave

This function saves the given XML data to the cache by its cache id.

Tags:

Parameters:

  • string $cacheID - The ID of the cached thing
  • string $xml - The XML info to be saved

[ Top ]

characterFetch

string[] characterFetch( [string $character = NULL], [string $realm = NULL])

[line 150]

characterFetch

Attempts to fetch a cached version of the requested character. Otherwise, it calls the parent function.

Tags:

Overrides phpArmory::characterFetch() (characterFetch)

Parameters:

  • string $character - The name of the character
  • string $realm - The character's realm

[ Top ]

guildFetch

string[] guildFetch( [string $guild = NULL], [string $realm = NULL])

[line 172]

guildFetch

Attempts to fetch a cached version of the requested guild. Otherwise, it calls the parent function.

Tags:

Overrides phpArmory::guildFetch() (guildFetch)

Parameters:

  • string $guild - The name of the guild
  • string $realm - The guild's realm

[ Top ]

itemFetch

string[] itemFetch( integer $itemID)

[line 193]

itemFetch

Attempts to fetch a cached version of the requested item. Otherwise, it calls the parent function.

Tags:

Overrides phpArmory::itemFetch() (itemFetch)

Parameters:

  • integer $itemID - The ID of the item

[ Top ]

itemNameFetch

string[] itemNameFetch( string $item, [string[] $filter = NULL])

[line 212]

itemNameFetch

Attempts to fetch a cached version of the requested item search. Otherwise, it calls the parent function.

Tags:

Overrides phpArmory::itemNameFetch() (itemNameFetch)

Parameters:

  • string $item - The name of the item
  • string[] $filter - Associative array of search parameters

[ Top ]

xmlFetch

void xmlFetch( string $url, [string $userAgent = NULL], [integer $timeout = NULL])

[line 236]

xmlFetch

This fetches the XML data as normal by calling the parent function. If a cache id is set, it will save the XML data to the cache and then unset the id.

Tags:

Overrides phpArmory::xmlFetch() (xmlFetch)

Parameters:

  • string $url - URL of the page to fetch data from
  • string $userAgent - The user agent making the GET request
  • integer $timeout - The connection timeout in seconds

[ Top ]


Class Constants


Documentation generated on Sun, 02 Sep 2007 16:45:09 -0700 by phpDocumentor 1.4.0a2
phpArmory-0.3/doc/phpArmory/.svn/tmp/prop-base/0000755000077300007700000000000010711600237021641 5ustar marenkaymarenkayphpArmory-0.3/doc/phpArmory/.svn/tmp/props/0000755000077300007700000000000010711600237021114 5ustar marenkaymarenkayphpArmory-0.3/doc/phpArmory/.svn/tmp/text-base/0000755000077300007700000000000010711600237021645 5ustar marenkaymarenkayphpArmory-0.3/doc/media/style.css0000644000077300007700000001152610711600237017242 0ustar marenkaymarenkayBODY { background: #FFFFFF; font-family: Arial; margin: 0px; padding: 0px; } A { color: #CC4400; font-weight: bold; } A:Hover { color: white; background-color: #334B66; font-weight: bold; text-decoration: none; } #packageTitle { font-size: 160%; font-weight: bold; text-align: right; color: #CC6633; } #packageTitle2 { font-size: 160%; font-weight: bold; text-align: right; color: #334B66; background-color: #6699CC; } #packageLinks { background-color: #6699CC; } #header { background-color: #6699CC; border-bottom: solid #334B66 4px; } #nav { background-color: #6699CC; padding: 4px; border-right: solid #334B66 4px; } #index { padding: 18px; } hr { width: 80%; background-color: #6699CC; color: #6699CC; margin-top: 15px; margin-bottom: 15px; clear: both; } .links { text-align: left; width: 98%; margin: auto; } UL { margin: 0px; padding: 0px; padding-left: 5px; list-style-type: none; } li { text-indent: -15px; padding-bottom: 2px; padding-left: 14px; } dd { margin-bottom: .5em; } .small { font-size: 80%; } h3 { } .middleCol { margin-left: -1px; border-right: dotted gray 1px; border-left: dotted gray 1px; padding: 5px; } .leftCol { border-right: dotted gray 1px; padding: 5px; } .rightCol { margin-left: -1px; border-left: dotted gray 1px; padding: 5px; } #elementPath { font-size: 14px; font-weight: bold; color: #334B66; } .constructor { /*border: dashed #334B66 1px;*/ font-weight: bold; } #credit { text-align: center; color: #334B66; font-weight: bold; } div.contents { border: solid #334B66 1px; padding: 3px; margin-bottom: 5px; clear: all; } H1 { margin: 0px; } H2 { margin: 0px; margin-bottom: 2px; } H3 { margin: 0px; } H4 { margin: 0px; } #classTree { padding: 0px; margin: 0px; } div.indent { margin-left: 15px; } .warning { color: red; background-color: #334B66; font-weight: bold; } code { font-family: fixed; padding: 3px; color: #334B66; background-color: #dddddd; } .type { color: #334B66; } .value { color: #334B66; border: dotted #334B66 1px; } .top { color: #334B66; border-bottom: dotted #334B66 1px; padding-bottom: 4px; } .php-src, .php, .listing { font-family: fixed; padding: 3px; color: #334B66; background-color: #dddddd; font-family: 'Courier New', Courier, monospace; font-weight: normal; } DIV#nav DL { margin: 0px; padding: 0px; list-style-type: none; } div.classtree { font-size: 130%; font-weight: bold; background-color: #CC6633; border: dotted #334B66 2px; } span.linenumber,p.linenumber { font-weight: bold,italic; } span.smalllinenumber { font-weight: bold,italic; font-size: 9pt; } ul { margin-left: 0px; padding-left: 8px; } /* Syntax highlighting */ .src-code { background-color: #f5f5f5; border: 1px solid #ccc9a4; padding: 0px; margin : 0px} .src-line { font-family: 'Courier New', Courier, monospace; font-weight: normal; } /*.src-code pre { }*/ .src-comm { color: green; } .src-id { } .src-inc { color: #0000FF; } .src-key { color: #0000FF; } .src-num { color: #CC0000; } .src-str { color: #66cccc; } .src-sym { font-weight: bold; } .src-var { } .src-php { font-weight: bold; } .src-doc { color: #009999 } .src-doc-close-template { color: #0000FF } .src-doc-coretag { color: #0099FF; font-weight: bold } .src-doc-inlinetag { color: #0099FF } .src-doc-internal { color: #6699cc } .src-doc-tag { color: #0080CC } .src-doc-template { color: #0000FF } .src-doc-type { font-style: italic } .src-doc-var { font-style: italic } .tute-tag { color: #009999 } .tute-attribute-name { color: #0000FF } .tute-attribute-value { color: #0099FF } .tute-entity { font-weight: bold; } .tute-comment { font-style: italic } .tute-inline-tag { color: #636311; font-weight: bold } /* tutorial */ .authors { } .author { font-style: italic; font-weight: bold } .author-blurb { margin: .5em 0em .5em 2em; font-size: 85%; font-weight: normal; font-style: normal } .example { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; } .listing { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; white-space: nowrap; } .release-info { font-size: 85%; font-style: italic; margin: 1em 0em } .ref-title-box { } .ref-title { } .ref-purpose { font-style: italic; color: #666666 } .ref-synopsis { } .title { font-weight: bold; margin: 1em 0em 0em 0em; padding: .25em; border: 2px solid #CC6633; background-color: #6699CC } .cmd-synopsis { margin: 1em 0em } .cmd-title { font-weight: bold } .toc { margin-left: 2em; padding-left: 0em } phpArmory-0.3/doc/media/layout.css0000644000077300007700000000216210711600237017413 0ustar marenkaymarenkay#header { z-index: 100; position: absolute; top: 0px; left: 0px; width: 100%; height: 5%; } #nav { z-index: 200; position: absolute; top: 5%; left: 0px; width: 15%; height: 1600px; clip: auto; overflow: auto; } #body { position: absolute; top: 6%; left: 17%; width: 82%; } #content { clear: both; top: -1px; } #packagePosition { position: absolute; right: 5px; top: 0px; width: 35%; height: 100%; } #packageTitle { position: absolute; right: 0px; } #packageTitle2 { position: absolute; right: -3px; top: -2px; } #elementPath { position: absolute; right: 0px; bottom: 0px; } #navLinks { position: absolute; top: 0px; left: 10px; height: 100%; } .leftCol { width: auto; float: left; } .middleCol { width: auto; float: left; } .rightCol { width: auto; float: left; } #credit { margin-top: 20px; margin-bottom: 50px; } /** Fixed layout for nav on mozilla */ head:first-child+body div#header { position: fixed; } head:first-child+body div#nav { position: fixed; height: 94% } phpArmory-0.3/doc/media/banner.css0000644000077300007700000000061111010304361017330 0ustar marenkaymarenkaybody { background-color: #CCCCFF; margin: 0px; padding: 0px; } /* Banner (top bar) classes */ .banner { } .banner-menu { clear: both; padding: .5em; border-top: 2px solid #6666AA; } .banner-title { text-align: right; font-size: 20pt; font-weight: bold; margin: .2em; } .package-selector { background-color: #AAAADD; border: 1px solid black; color: yellow; } phpArmory-0.3/doc/media/stylesheet.css0000644000077300007700000001243711010304361020265 0ustar marenkaymarenkaya { color: #336699; text-decoration: none; } a:hover { color: #6699CC; text-decoration: underline; } a:active { color: #6699CC; text-decoration: underline; } body { background : #FFFFFF; } body, table { font-family: Georgia, Times New Roman, Times, serif; font-size: 10pt } p, li { line-height: 140% } a img { border: 0px; } dd { margin-left: 0px; padding-left: 1em; } /* Page layout/boxes */ .info-box {} .info-box-title { margin: 1em 0em 0em 0em; padding: .25em; font-weight: normal; font-size: 14pt; border: 2px solid #999999; background-color: #CCCCFF } .info-box-body { border: 1px solid #999999; padding: .5em; } .nav-bar { font-size: 8pt; white-space: nowrap; text-align: right; padding: .2em; margin: 0em 0em 1em 0em; } .oddrow { background-color: #F8F8F8; border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em} .evenrow { border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em} .page-body { max-width: 800px; margin: auto; } .tree dl { margin: 0px } /* Index formatting classes */ .index-item-body { margin-top: .5em; margin-bottom: .5em} .index-item-description { margin-top: .25em } .index-item-details { font-weight: normal; font-style: italic; font-size: 8pt } .index-letter-section { background-color: #EEEEEE; border: 1px dotted #999999; padding: .5em; margin-bottom: 1em} .index-letter-title { font-size: 12pt; font-weight: bold } .index-letter-menu { text-align: center; margin: 1em } .index-letter { font-size: 12pt } /* Docbook classes */ .description {} .short-description { font-weight: bold; color: #666666; } .tags { padding-left: 0em; margin-left: 3em; color: #666666; list-style-type: square; } .parameters { padding-left: 0em; margin-left: 3em; font-style: italic; list-style-type: square; } .redefinitions { font-size: 8pt; padding-left: 0em; margin-left: 2em; } .package { } .package-title { font-weight: bold; font-size: 14pt; border-bottom: 1px solid black } .package-details { font-size: 85%; } .sub-package { font-weight: bold; font-size: 120% } .tutorial { border-width: thin; border-color: #0066ff } .tutorial-nav-box { width: 100%; border: 1px solid #999999; background-color: #F8F8F8; } .nav-button-disabled { color: #999999; } .nav-button:active, .nav-button:focus, .nav-button:hover { background-color: #DDDDDD; outline: 1px solid #999999; text-decoration: none } .folder-title { font-style: italic } /* Generic formatting */ .field { font-weight: bold; } .detail { font-size: 8pt; } .notes { font-style: italic; font-size: 8pt; } .separator { background-color: #999999; height: 2px; } .warning { color: #FF6600; } .disabled { font-style: italic; color: #999999; } /* Code elements */ .line-number { } .class-table { width: 100%; } .class-table-header { border-bottom: 1px dotted #666666; text-align: left} .class-name { color: #000000; font-weight: bold; } .method-summary { padding-left: 1em; font-size: 8pt } .method-header { } .method-definition { margin-bottom: .3em } .method-title { font-weight: bold; } .method-name { font-weight: bold; } .method-signature { font-size: 85%; color: #666666; margin: .5em 0em } .method-result { font-style: italic; } .var-summary { padding-left: 1em; font-size: 8pt; } .var-header { } .var-title { margin-bottom: .3em } .var-type { font-style: italic; } .var-name { font-weight: bold; } .var-default {} .var-description { font-weight: normal; color: #000000; } .include-title { } .include-type { font-style: italic; } .include-name { font-weight: bold; } .const-title { } .const-name { font-weight: bold; } /* Syntax highlighting */ .src-code { border: 1px solid #336699; padding: 1em; background-color: #EEEEEE; } .src-line { font-family: 'Courier New', Courier, monospace; font-weight: normal; } .src-comm { color: green; } .src-id { } .src-inc { color: #0000FF; } .src-key { color: #0000FF; } .src-num { color: #CC0000; } .src-str { color: #66cccc; } .src-sym { font-weight: bold; } .src-var { } .src-php { font-weight: bold; } .src-doc { color: #009999 } .src-doc-close-template { color: #0000FF } .src-doc-coretag { color: #0099FF; font-weight: bold } .src-doc-inlinetag { color: #0099FF } .src-doc-internal { color: #6699cc } .src-doc-tag { color: #0080CC } .src-doc-template { color: #0000FF } .src-doc-type { font-style: italic } .src-doc-var { font-style: italic } .tute-tag { color: #009999 } .tute-attribute-name { color: #0000FF } .tute-attribute-value { color: #0099FF } .tute-entity { font-weight: bold; } .tute-comment { font-style: italic } .tute-inline-tag { color: #636311; font-weight: bold } /* tutorial */ .authors { } .author { font-style: italic; font-weight: bold } .author-blurb { margin: .5em 0em .5em 2em; font-size: 85%; font-weight: normal; font-style: normal } .example { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; } *[class="example"] { line-height : 0.5em } .listing { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; white-space: nowrap; } *[class="listing"] { line-height : 0.5em } .release-info { font-size: 85%; font-style: italic; margin: 1em 0em } .ref-title-box { } .ref-title { } .ref-purpose { font-style: italic; color: #666666 } .ref-synopsis { } .title { font-weight: bold; margin: 1em 0em 0em 0em; padding: .25em; border: 2px solid #999999; background-color: #CCCCFF } .cmd-synopsis { margin: 1em 0em } .cmd-title { font-weight: bold } .toc { margin-left: 2em; padding-left: 0em } phpArmory-0.3/doc/media/print.css0000644000077300007700000000044510711600237017234 0ustar marenkaymarenkayBODY { margin: 1em; } #header { } #nav { display: none; } #packagePosition { text-align: right; } #packageTitle { display: inline; margin: 5px; } #packageTitle2 { display: none; } #elementPath { display: inline; margin: 5px; } #navLinks { display: none; } phpArmory-0.3/doc/media/.svn/0000755000077300007700000000000011004316304016242 5ustar marenkaymarenkayphpArmory-0.3/doc/media/.svn/entries0000444000077300007700000000122610711600237017642 0ustar marenkaymarenkay8 dir 9 https://phparmory.svn.sourceforge.net/svnroot/phparmory/trunk/phpArmory/doc/media https://phparmory.svn.sourceforge.net/svnroot/phparmory 2007-09-03T00:10:44.572278Z 7 poeticdragon svn:special svn:externals svn:needs-lock d442ef44-2732-0410-878e-c691a92a4cb8 print.css file 2007-10-30T09:59:59.000000Z 19e7206047e4eeed44401ad1c4e7f531 2007-09-03T00:10:44.572278Z 7 poeticdragon layout.css file 2007-10-30T09:59:59.000000Z 7c33f0411a4395dadcbb9205c947ed00 2007-09-03T00:10:44.572278Z 7 poeticdragon style.css file 2007-10-30T09:59:59.000000Z 1a8d322bde172e14e72e21aafb59e98c 2007-09-03T00:10:44.572278Z 7 poeticdragon phpArmory-0.3/doc/media/.svn/format0000444000077300007700000000000210711600237017450 0ustar marenkaymarenkay8 phpArmory-0.3/doc/media/.svn/all-wcprops0000444000077300007700000000067610711600237020444 0ustar marenkaymarenkayK 25 svn:wc:ra_dav:version-url V 55 /svnroot/phparmory/!svn/ver/7/trunk/phpArmory/doc/media END print.css K 25 svn:wc:ra_dav:version-url V 65 /svnroot/phparmory/!svn/ver/7/trunk/phpArmory/doc/media/print.css END layout.css K 25 svn:wc:ra_dav:version-url V 66 /svnroot/phparmory/!svn/ver/7/trunk/phpArmory/doc/media/layout.css END style.css K 25 svn:wc:ra_dav:version-url V 65 /svnroot/phparmory/!svn/ver/7/trunk/phpArmory/doc/media/style.css END phpArmory-0.3/doc/media/.svn/prop-base/0000755000077300007700000000000010711600237020137 5ustar marenkaymarenkayphpArmory-0.3/doc/media/.svn/props/0000755000077300007700000000000010711600237017412 5ustar marenkaymarenkayphpArmory-0.3/doc/media/.svn/text-base/0000755000077300007700000000000010711600237020143 5ustar marenkaymarenkayphpArmory-0.3/doc/media/.svn/tmp/0000755000077300007700000000000010711600237017047 5ustar marenkaymarenkayphpArmory-0.3/doc/media/.svn/text-base/print.css.svn-base0000444000077300007700000000044510711600237023527 0ustar marenkaymarenkayBODY { margin: 1em; } #header { } #nav { display: none; } #packagePosition { text-align: right; } #packageTitle { display: inline; margin: 5px; } #packageTitle2 { display: none; } #elementPath { display: inline; margin: 5px; } #navLinks { display: none; } phpArmory-0.3/doc/media/.svn/text-base/layout.css.svn-base0000444000077300007700000000216210711600237023706 0ustar marenkaymarenkay#header { z-index: 100; position: absolute; top: 0px; left: 0px; width: 100%; height: 5%; } #nav { z-index: 200; position: absolute; top: 5%; left: 0px; width: 15%; height: 1600px; clip: auto; overflow: auto; } #body { position: absolute; top: 6%; left: 17%; width: 82%; } #content { clear: both; top: -1px; } #packagePosition { position: absolute; right: 5px; top: 0px; width: 35%; height: 100%; } #packageTitle { position: absolute; right: 0px; } #packageTitle2 { position: absolute; right: -3px; top: -2px; } #elementPath { position: absolute; right: 0px; bottom: 0px; } #navLinks { position: absolute; top: 0px; left: 10px; height: 100%; } .leftCol { width: auto; float: left; } .middleCol { width: auto; float: left; } .rightCol { width: auto; float: left; } #credit { margin-top: 20px; margin-bottom: 50px; } /** Fixed layout for nav on mozilla */ head:first-child+body div#header { position: fixed; } head:first-child+body div#nav { position: fixed; height: 94% } phpArmory-0.3/doc/media/.svn/text-base/style.css.svn-base0000444000077300007700000001152610711600237023535 0ustar marenkaymarenkayBODY { background: #FFFFFF; font-family: Arial; margin: 0px; padding: 0px; } A { color: #CC4400; font-weight: bold; } A:Hover { color: white; background-color: #334B66; font-weight: bold; text-decoration: none; } #packageTitle { font-size: 160%; font-weight: bold; text-align: right; color: #CC6633; } #packageTitle2 { font-size: 160%; font-weight: bold; text-align: right; color: #334B66; background-color: #6699CC; } #packageLinks { background-color: #6699CC; } #header { background-color: #6699CC; border-bottom: solid #334B66 4px; } #nav { background-color: #6699CC; padding: 4px; border-right: solid #334B66 4px; } #index { padding: 18px; } hr { width: 80%; background-color: #6699CC; color: #6699CC; margin-top: 15px; margin-bottom: 15px; clear: both; } .links { text-align: left; width: 98%; margin: auto; } UL { margin: 0px; padding: 0px; padding-left: 5px; list-style-type: none; } li { text-indent: -15px; padding-bottom: 2px; padding-left: 14px; } dd { margin-bottom: .5em; } .small { font-size: 80%; } h3 { } .middleCol { margin-left: -1px; border-right: dotted gray 1px; border-left: dotted gray 1px; padding: 5px; } .leftCol { border-right: dotted gray 1px; padding: 5px; } .rightCol { margin-left: -1px; border-left: dotted gray 1px; padding: 5px; } #elementPath { font-size: 14px; font-weight: bold; color: #334B66; } .constructor { /*border: dashed #334B66 1px;*/ font-weight: bold; } #credit { text-align: center; color: #334B66; font-weight: bold; } div.contents { border: solid #334B66 1px; padding: 3px; margin-bottom: 5px; clear: all; } H1 { margin: 0px; } H2 { margin: 0px; margin-bottom: 2px; } H3 { margin: 0px; } H4 { margin: 0px; } #classTree { padding: 0px; margin: 0px; } div.indent { margin-left: 15px; } .warning { color: red; background-color: #334B66; font-weight: bold; } code { font-family: fixed; padding: 3px; color: #334B66; background-color: #dddddd; } .type { color: #334B66; } .value { color: #334B66; border: dotted #334B66 1px; } .top { color: #334B66; border-bottom: dotted #334B66 1px; padding-bottom: 4px; } .php-src, .php, .listing { font-family: fixed; padding: 3px; color: #334B66; background-color: #dddddd; font-family: 'Courier New', Courier, monospace; font-weight: normal; } DIV#nav DL { margin: 0px; padding: 0px; list-style-type: none; } div.classtree { font-size: 130%; font-weight: bold; background-color: #CC6633; border: dotted #334B66 2px; } span.linenumber,p.linenumber { font-weight: bold,italic; } span.smalllinenumber { font-weight: bold,italic; font-size: 9pt; } ul { margin-left: 0px; padding-left: 8px; } /* Syntax highlighting */ .src-code { background-color: #f5f5f5; border: 1px solid #ccc9a4; padding: 0px; margin : 0px} .src-line { font-family: 'Courier New', Courier, monospace; font-weight: normal; } /*.src-code pre { }*/ .src-comm { color: green; } .src-id { } .src-inc { color: #0000FF; } .src-key { color: #0000FF; } .src-num { color: #CC0000; } .src-str { color: #66cccc; } .src-sym { font-weight: bold; } .src-var { } .src-php { font-weight: bold; } .src-doc { color: #009999 } .src-doc-close-template { color: #0000FF } .src-doc-coretag { color: #0099FF; font-weight: bold } .src-doc-inlinetag { color: #0099FF } .src-doc-internal { color: #6699cc } .src-doc-tag { color: #0080CC } .src-doc-template { color: #0000FF } .src-doc-type { font-style: italic } .src-doc-var { font-style: italic } .tute-tag { color: #009999 } .tute-attribute-name { color: #0000FF } .tute-attribute-value { color: #0099FF } .tute-entity { font-weight: bold; } .tute-comment { font-style: italic } .tute-inline-tag { color: #636311; font-weight: bold } /* tutorial */ .authors { } .author { font-style: italic; font-weight: bold } .author-blurb { margin: .5em 0em .5em 2em; font-size: 85%; font-weight: normal; font-style: normal } .example { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; } .listing { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; white-space: nowrap; } .release-info { font-size: 85%; font-style: italic; margin: 1em 0em } .ref-title-box { } .ref-title { } .ref-purpose { font-style: italic; color: #666666 } .ref-synopsis { } .title { font-weight: bold; margin: 1em 0em 0em 0em; padding: .25em; border: 2px solid #CC6633; background-color: #6699CC } .cmd-synopsis { margin: 1em 0em } .cmd-title { font-weight: bold } .toc { margin-left: 2em; padding-left: 0em } phpArmory-0.3/doc/media/.svn/tmp/prop-base/0000755000077300007700000000000010711600237020737 5ustar marenkaymarenkayphpArmory-0.3/doc/media/.svn/tmp/props/0000755000077300007700000000000010711600237020212 5ustar marenkaymarenkayphpArmory-0.3/doc/media/.svn/tmp/text-base/0000755000077300007700000000000010711600237020743 5ustar marenkaymarenkayphpArmory-0.3/examples/guildroster.php0000644000077300007700000000622310711600144020431 0ustar marenkaymarenkay * @package phpArmory * @version 1.0 * */ /** * Configuration * * @var string $guildName Case-sensitive name of the guild * @var string $realmName Case-sensitive name of the realm * */ $guildName = "Knights of Chaos"; $realmName = "Kul Tiras"; // Include the phpArmory class library include('../phpArmory.class.php'); // Instantiate the class library $armory = new phpArmory(); // Fetch guild information $guild = $armory->guildFetch($guildName, $realmName); // Define some variables $guildName = $guild['guildinfo']['guild']['name']; $guildMemberCount = $guild['guildinfo']['guild']['members']['membercount']; $guildCharacters = $guild['guildinfo']['guild']['members']['character']; ?> <?=$guildName;?> Roster

Roster

Members

Guild Members
Name Level Race Class Gender Rank Portrait

Data scraped from the official World of Warcraft Armory (armory;?>)

phpArmory-0.3/examples/character.php0000644000077300007700000000340610711600144020022 0ustar marenkaymarenkay * @package phpArmory * @version 1.0 * */ /** * Configuration * * @var string $charName Case-sensitive name of the character * @var string $realmName Case-sensitive name of the realm * */ $charName = "Phattangent"; $realmName = "Kul Tiras"; // Include the phpArmory class library include('../phpArmory.class.php'); // Instantiate the class library $armory = new phpArmory(); // Fetch character information $char = $armory->characterFetch($charName, $realmName); $string = print_r($char, 1); $string = str_replace(array(" ", "\n"), array(" ", "
\n"), $string); echo "\$char = ".$string; ?>