-
Notifications
You must be signed in to change notification settings - Fork 14
/
config.php.in
128 lines (95 loc) · 7.22 KB
/
config.php.in
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php
define('OS_FLAVOUR', file_exists('/mnt/live/lib/colibrikitlib')? 'Colibri' : 'Raspbian');
//===================================================================================================================================================
$www_path = '@WWW_PATH@';
$fabui_path = '@FABUI_PATH@';
defined('WWW_PATH') ? null : define("WWW_PATH", $www_path);
defined('FABUI_PATH') ? null : define("FABUI_PATH", $fabui_path);
defined('PYTHON_PATH') ? null : define("PYTHON_PATH", '@PYTHON_PATH@');
defined('SCRIPT_PATH') ? null : define("SCRIPT_PATH", '@SCRIPT_PATH@');
defined('TASKS_PATH') ? null : define("TASKS_PATH", '@TASKS_PATH@');
defined('RECOVERY_PATH') ? null : define("RECOVERY_PATH", '@RECOVERY_PATH@');
defined('TEMP_PATH') ? null : define("TEMP_PATH", '@TEMP_PATH@');
defined('BIGTEMP_PATH') ? null : define("BIGTEMP_PATH", '@BIGTEMP_PATH@');
defined('UPLOAD_PATH') ? null : define("UPLOAD_PATH", '@UPLOAD_PATH@');
defined('USERDATA_PATH') ? null : define("USERDATA_PATH", '@USERDATA_PATH@');
defined('LOCK_FILE') ? null : define("LOCK_FILE", TEMP_PATH.'LOCK');
defined('INI_FILE') ? null : define("INI_FILE", '@[email protected]');
defined('SERIAL_INI') ? null : define("SERIAL_INI", '@[email protected]');
//===================================================================================================================================================
/** SERIAL PORT CONSTANTS */
defined("PORT_NAME") ? null : define("PORT_NAME", '/dev/ttyAMA0'); //TODO: possibly get from env
defined("BOUD_RATE") ? null : define("BOUD_RATE", '115200'); //TODO: possibly get from env
//===================================================================================================================================================
/** DATABASE CONNECTION */
if (!defined("DB_DRIVER"))
define('DB_DRIVER', OS_FLAVOUR=='Colibri'? 'pdo:sqlite' : 'mysqli');
defined("DB_HOSTNAME") ? null : define("DB_HOSTNAME", 'localhost');
defined("DB_USERNAME") ? null : define("DB_USERNAME", 'root');
defined("DB_PASSWORD") ? null : define("DB_PASSWORD", 'fabtotum');
if (!defined("DB_DATABASE"))
define('DB_DATABASE', DB_DRIVER=='pdo:sqlite'? '/var/www/fabtotum.db' : 'fabtotum');
defined("SQL_INSTALL_DB") ? null : define("SQL_INSTALL_DB", RECOVERY_PATH.'install/sql/fabtotum.sql');
//===================================================================================================================================================
defined("CONFIG_UNITS") ? null : define("CONFIG_UNITS", FABUI_PATH.'config/config.json');
//===================================================================================================================================================
defined("MYFAB_REMOTE_VERSION_URL") ? null : define("MYFAB_REMOTE_VERSION_URL", 'http://update.fabtotum.com/FAB-UI/version.txt');
defined("MARLIN_REMOTE_VERSION_URL") ? null : define("MARLIN_REMOTE_VERSION_URL", 'http://update.fabtotum.com/MARLIN/version.txt');
//===================================================================================================================================================
defined("MYFAB_DOWNLOAD_URL") ? null : define("MYFAB_DOWNLOAD_URL", 'http://update.fabtotum.com/FAB-UI/download/');
defined("MYFAB_DOWNLOAD_FILE") ? null : define("MYFAB_DOWNLOAD_FILE", 'fabui.zip');
defined("MYFAB_UPDATE_MONITOR_FILE") ? null : define("MYFAB_UPDATE_MONITOR_FILE", TEMP_PATH.'myfab_update.json');
defined("MYFAB_DOWNLOAD_TARGET_FILE") ? null : define("MYFAB_DOWNLOAD_TARGET_FILE", TEMP_PATH);
defined("MYFAB_DOWNLOAD_EXTRACT_FOLDER") ? null : define("MYFAB_DOWNLOAD_EXTRACT_FOLDER", TEMP_PATH);
//===================================================================================================================================================
defined("MARLIN_DOWNLOAD_URL") ? null : define("MARLIN_DOWNLOAD_URL", 'http://update.fabtotum.com/MARLIN/download/');
defined("MARLIN_DOWNLOAD_FILE") ? null : define("MARLIN_DOWNLOAD_FILE", 'Marlin.cpp.hex');
defined("MARLIN_DOWNLOAD_MONITOR_FILE") ? null : define("MARLIN_DOWNLOAD_MONITOR_FILE", '/var/www/recovery/update/temp/marlin_progress.json');
defined("MARLIN_DOWNLOAD_TARGET_FILE") ? null : define("MARLIN_DOWNLOAD_TARGET_FILE", '/var/www/recovery/update/temp/');
defined("MARLIN_DOWNLOAD_EXTRACT_FOLDER") ? null : define("MARLIN_DOWNLOAD_EXTRACT_FOLDER", '/var/www/recovery/update/temp/');
//================================= SOCKET ===============
defined("SOCKET_HOST") ? null : define("SOCKET_HOST", '0.0.0.0');
defined("SOCKET_PORT") ? null : define("SOCKET_PORT", 9001);
//====================== NETWORK INTERFACES ===============
defined("NETWORK_INTERFACES") ? null : define("NETWORK_INTERFACES", '/etc/network/interfaces');
//==================================
defined("TASK_TRACE") ? null : define("TASK_TRACE", '/var/www/temp/task_trace');
defined("MACRO_TRACE") ? null : define("MACRO_TRACE", '/var/www/temp/macro_trace');
defined("TASK_NOTIFICATIONS") ? null : define("TASK_NOTIFICATIONS", '/var/www/temp/task_notifications.json');
define('FILE_READ_MODE', 0644);
define('FILE_WRITE_MODE', 0666);
define('DIR_READ_MODE', 0755);
define('DIR_WRITE_MODE', 0777);
/*
|--------------------------------------------------------------------------
| File Stream Modes
|--------------------------------------------------------------------------
|
| These modes are used when working with fopen()/popen()
|
*/
define('FOPEN_READ', 'rb');
define('FOPEN_READ_WRITE', 'r+b');
define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
define('FOPEN_WRITE_CREATE', 'ab');
define('FOPEN_READ_WRITE_CREATE', 'a+b');
define('FOPEN_WRITE_CREATE_STRICT', 'xb');
define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
if(isset($_SERVER['HTTP_HOST'])){
defined("SITE_URL") ? null : define("SITE_URL", 'http://'.$_SERVER['HTTP_HOST'].'/fabui/');
}
defined('INSTAGRAM_FEED_URL') ? null : define("INSTAGRAM_FEED_URL", 'http://www.fabtotum.com/instagram_feed.json');
defined('INSTAGRAM_HASH_URL') ? null : define("INSTAGRAM_HASH_URL", 'http://www.fabtotum.com/instagram_hash.json');
defined('INSTAGRAM_FEED_JSON') ? null : define("INSTAGRAM_FEED_JSON", TEMP_PATH.'instagram_feed.json');
defined('INSTAGRAM_HASH_JSON') ? null : define("INSTAGRAM_HASH_JSON", TEMP_PATH.'instagram_hash.json');
defined('TWITTER_FEED_URL') ? null : define("TWITTER_FEED_URL", 'http://www.fabtotum.com/twitter_feed.json');
defined('TWITTER_FEED_JSON') ? null : define("TWITTER_FEED_JSON", TEMP_PATH.'twitter.json');
defined('BLOG_FEED_URL') ? null : define("BLOG_FEED_URL", 'http://blog.fabtotum.com/feed/');
defined('BLOG_FEED_XML') ? null : define("BLOG_FEED_XML", TEMP_PATH.'blog.xml');
defined('FAQ_URL') ? null : define("FAQ_URL", 'http://www.fabtotum.com/faq_new.json');
defined('FAQ_JSON') ? null : define("FAQ_JSON", TEMP_PATH.'faq.json');
defined('WIZARD_FILE') ? null : define("WIZARD_FILE", WWW_PATH.'WIZARD');
defined('USB_SYSTEM_FILE') ? null : define("USB_SYSTEM_FILE", '/dev/sda1');
defined('USB_FOLDER') ? null : define("USB_FOLDER", '/media');
?>