Subversion Repositories cheapmusic

Rev

Rev 83 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 83 Rev 107
Line 7... Line 7...
7
    private static $cjaffiliate = [];
7
    private static $cjaffiliate = [];
8
    private static $walmart = [];
8
    private static $walmart = [];
9
    private static $itunes = [];
9
    private static $itunes = [];
10
    private static $amazon = [];
10
    private static $amazon = [];
11
    private static $impact = [];
11
    private static $impact = [];
-
 
12
    private static $ipapi = [];
12
 
13
 
13
    const EBAY = 0;
14
    const EBAY = 0;
14
    const DISCOGS = 1;
15
    const DISCOGS = 1;
15
    const LINKSHARE = 2;
16
    const LINKSHARE = 2;
16
    const CJAFFILIATE = 3;
17
    const CJAFFILIATE = 3;
17
    const WALMART = 4;
18
    const WALMART = 4;
18
    const ITUNES = 5;
19
    const ITUNES = 5;
19
    const AMAZON = 6;
20
    const AMAZON = 6;
20
    const IMPACT = 7;
21
    const IMPACT = 7;
-
 
22
    const IPAPI = 8;
21
 
23
 
22
    public static function getInstance() {
24
    public static function getInstance() {
23
        if (is_null(self::$instance)) {
25
        if (is_null(self::$instance)) {
24
            self::$instance = new self();
26
            self::$instance = new self();
25
        }
27
        }
Line 42... Line 44...
42
            self::$itunes = $vendorArray;
44
            self::$itunes = $vendorArray;
43
        } else if ($type == self::AMAZON) {
45
        } else if ($type == self::AMAZON) {
44
            self::$amazon = $vendorArray;
46
            self::$amazon = $vendorArray;
45
        } else if ($type == self::IMPACT) {
47
        } else if ($type == self::IMPACT) {
46
            self::$impact = $vendorArray;
48
            self::$impact = $vendorArray;
-
 
49
        } else if ($type == self::IPAPI) {
-
 
50
            self::$ipapi = $vendorArray;
47
        }
51
        }
48
    }
52
    }
49
 
53
 
50
    public function getVendor($type) {
54
    public function getVendor($type) {
51
        if ($type == self::EBAY) {
55
        if ($type == self::EBAY) {
Line 62... Line 66...
62
            return self::$itunes;
66
            return self::$itunes;
63
        } else if ($type == self::AMAZON) {
67
        } else if ($type == self::AMAZON) {
64
            return self::$amazon;
68
            return self::$amazon;
65
        } else if ($type == self::IMPACT) {
69
        } else if ($type == self::IMPACT) {
66
            return self::$impact;
70
            return self::$impact;
-
 
71
        } else if ($type == self::IPAPI) {
-
 
72
            return self::$ipapi;
67
        }
73
        }
68
 
74
 
69
        return null;
75
        return null;
70
    }
76
    }
71
    
77
    
Line 76... Line 82...
76
        $vendors->setVendor($configFile['cjaffiliate'], Vendors::CJAFFILIATE);
82
        $vendors->setVendor($configFile['cjaffiliate'], Vendors::CJAFFILIATE);
77
        $vendors->setVendor($configFile['walmart'], Vendors::WALMART);
83
        $vendors->setVendor($configFile['walmart'], Vendors::WALMART);
78
        $vendors->setVendor($configFile['itunes'], Vendors::ITUNES);
84
        $vendors->setVendor($configFile['itunes'], Vendors::ITUNES);
79
        $vendors->setVendor($configFile['amazon'], Vendors::AMAZON);
85
        $vendors->setVendor($configFile['amazon'], Vendors::AMAZON);
80
        $vendors->setVendor($configFile['impact'], Vendors::IMPACT);
86
        $vendors->setVendor($configFile['impact'], Vendors::IMPACT);
-
 
87
        $vendors->setVendor($configFile['ipapi'], Vendors::IPAPI);
81
    }
88
    }
82
}
89
}