My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**********************************************************************//**\file
Armory XML

Description: Provides a simplified interface with which to parse
wowarmory.com XML files.
*******************************************************************************/

class armoryxml
{
# create the standard php xml data object and attach it to the cached
# version of the data (database), then pass it off to the appropriate
# specialized class for processing

# since this will be invoked by the other specialized classes, this one
# simply provides access to the common XML components and automates the
# like aspects of those classes

protected $xmldata;

# get xml data from cache
protected function get_cache($type, $name)
{
$this->xmldata = new DOMDocument();

GLOBAL $config;

if($config['cache_method'] == 'filesystem')
{
$this->xmldata->loadXML(file_get_contents(dirname(__FILE__).'/../'.$config['cache_folder'].'/'.$type.'/'.$name.'.xml'));
}
elseif($config['cache_method'] == 'database')
{
$db = new armorydb();
$db->query("SELECT cache_data FROM armory_cache WHERE cache_type = '$type' AND cache_name = '$name'");
$xml = $db->quick_result();

$this->xmldata->loadXML($xml);

unset($db);
}
}
}
?>

Change log

r16 by banzaimonkey on Oct 30, 2009   Diff
Update script ready for testing
Player data model saves to database
Minor fixes
Go to: 
Project members, sign in to write a code review

Older revisions

r14 by banzaimonkey on Oct 29, 2009   Diff
Added placeholder files for various
views
Implemented fopen fetch method
Updates to db runtime schema
Changed some config options to conform
...
r11 by banzaimonkey on Oct 27, 2009   Diff
Initial code import
All revisions of this file

File info

Size: 1289 bytes, 44 lines
Powered by Google Project Hosting