-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathUps.php
More file actions
42 lines (32 loc) · 674 Bytes
/
Ups.php
File metadata and controls
42 lines (32 loc) · 674 Bytes
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
<?php
class Ups extends Base_Ups {
private $available_apis = array(
'rates' => 'Ups_Live_Rates.php'
);
public function __construct($data, $load_apis = FALSE)
{
parent::__construct($data);
$this->load();
}
public function load($apis = FALSE)
{
if(!$apis)
{
$apis = $this->available_apis;
}
foreach($apis as $obj => $file)
{
require_once($file);
$class = str_replace('.php', '', $file);
$params = array();
foreach(get_object_vars($this) as $index => $value)
{
if(!in_array($index, array('available_apis')))
{
$params[$index] = $value;
}
}
$this->$obj = new $class($params);
}
}
}