Subversion Repositories cheapmusic

Rev

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

Rev 43 Rev 49
Line 2... Line 2...
2
if (empty($argv[1]) || !file_exists($argv[1])) {
2
if (empty($argv[1]) || !file_exists($argv[1])) {
3
    echo "File argument missing", PHP_EOL;
3
    echo "File argument missing", PHP_EOL;
-
 
4
    exit(1);
4
}
5
}
5
 
6
 
6
$xml=simplexml_load_file($argv[1]) or die("Error: Cannot create xml object from file");
7
$xml=simplexml_load_file($argv[1]) or die("Error: Cannot create xml object from file");
7
 
8
 
8
foreach ($xml->{'promotion'} as $promotion) {
9
foreach ($xml->{'promotion'} as $promotion) {
Line 14... Line 15...
14
    echo "," . ($promotion->COUPONCODE != '0' ? $promotion->COUPONCODE : "");
15
    echo "," . ($promotion->COUPONCODE != '0' ? $promotion->COUPONCODE : "");
15
    echo "," . str_replace('http://', 'https://', (string)$promotion->TRACKINGURL);
16
    echo "," . str_replace('http://', 'https://', (string)$promotion->TRACKINGURL);
16
    echo "," . str_replace('http://', 'https://', (string)$promotion->IMAGEURL);
17
    echo "," . str_replace('http://', 'https://', (string)$promotion->IMAGEURL);
17
    echo PHP_EOL;
18
    echo PHP_EOL;
18
}
19
}
-
 
20
exit(0);