-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathexportProducts.php
More file actions
42 lines (30 loc) · 905 Bytes
/
exportProducts.php
File metadata and controls
42 lines (30 loc) · 905 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
/*
* Replace with your pimcore url
*/
$baseUrl = "http://pimcore-6.local:9090";
$url = $baseUrl.'/sintra_pimcore/api/export';
$options = getopt(null, ["timestamp:","exportAll:","offset:","limit:","writeInFile:"]);
if(array_key_exists("exportAll", $options)){
$url .= "?exportAll=".$options["exportAll"];
}else{
$url .= "?exportAll=0";
}
if(array_key_exists("timestamp", $options)){
$url .= "×tamp=".$options["timestamp"];
}
if(array_key_exists("offset", $options)){
$url .= "&offset=".$options["offset"];
}
if(array_key_exists("limit", $options)){
$url .= "&limit=".$options["limit"];
}
if(array_key_exists("writeInFile", $options)){
$url .= "&writeInFile=".$options["writeInFile"];
}
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
curl_close($curl);
echo $result;