/
mind
executable file
·36 lines (34 loc) · 1.04 KB
/
mind
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
#!/usr/bin/env php
<?php
/**
* this file will be only accessed trhough the console
* if you pass the parameter install to it, it will
* create the SQLite database, start it, and try to
* create shortcuts, allowing the use of the comand
* mind, in your console
*/
/**
* @var _MIND
* @global mixed $_GLOBALS['_MIND'] This variable contains many information about the proect, the system and also have some methods an attributes to deal with such data
*/
$_MIND= Array();
$_MIND['env']= 'shell';
// checks if it has received any argument
if(sizeOf($_SERVER['argv'])>0)
{
// installation should create the required SQLite database and a shortcut command
if($_SERVER['argv'][1] == 'install')
{
// first, for linux and mac computers
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')
{
require('mind3rd/env/setup/UnixSetup.php');
UnixSetup::install();
}else{
WinSetup::install();
}
exit;
}
// if not installing, it should be redirected to mind3rd/API/shell.php
include('location:./mind3rd/API/shell.php');
}