-
Notifications
You must be signed in to change notification settings - Fork 2
/
cron.php
executable file
·33 lines (28 loc) · 992 Bytes
/
cron.php
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
<?php
// dependencies
require_once 'inventory.php';
require_once 'shipments.php';
require_once 'orders.php';
// if a value was not passed, exit gracefully
if (!isset($argv[1])) {
fwrite(STDOUT, "FILE NOT SPECIFIED. EXITING SCRIPT.\n");
exit(0);
}
// sync inventory from ftp to magento
if (isset($argv[1]) && $argv[1] === 'inventory') {
fwrite(STDOUT, "++ INITIALIZE INVENTORY SYNC \n");
Inventory::sync();
//mail(ADMIN_EMAIL, 'INVENTORY SYNC COMPLETE', 'INVENTORY SYNC COMPLETE');
}
// sync shipments from ftp to magento
if (isset($argv[1]) && $argv[1] === 'shipments') {
fwrite(STDOUT, "++ INITIALIZE SHIPMENTS SYNC \n");
Shipments::sync();
//mail(ADMIN_EMAIL, 'SHIPMENTS IMPORT COMPLETE', 'SHIPMENTS IMPORT COMPLETE');
}
// export orders from magento to ftp
if (isset($argv[1]) && $argv[1] === 'orders') {
fwrite(STDOUT, "++ INITIALIZE ORDERS EXPORT \n");
Orders::export();
//mail(ADMIN_EMAIL, 'ORDERS EXPORT COMPLETE', 'ORDERS SYNC COMPLETE');
}