adjusts to 'beutify' the code from the instalation file
Esse commit está contido em:
@@ -0,0 +1 @@
|
||||
Documentation and help file, here.
|
||||
+1
-1
@@ -15,4 +15,4 @@
|
||||
default:
|
||||
$_REQ['data']= null;
|
||||
}
|
||||
include('mind3rd/API/utils.php');
|
||||
include('mind3rd/API/utils.php');
|
||||
+41
-16
@@ -21,35 +21,60 @@
|
||||
// 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')
|
||||
{
|
||||
echo ".";
|
||||
echo shell_exec("sudo touch /bin/mind; echo .");
|
||||
echo shell_exec("sudo echo '#!/usr/bin/env php' > /bin/mind; echo .");
|
||||
echo shell_exec("sudo echo '<?php' >> /bin/mind; echo .");
|
||||
|
||||
echo shell_exec("sudo echo \"".'\$_REQ= Array(); \$_REQ[\'env\']= \'shell\';'.
|
||||
" define('_MINDSRC_', '". getcwd()."'); ".
|
||||
" require('".getcwd()."/mind3rd/API/utils.php');\" >> /bin/mind; echo .");
|
||||
echo shell_exec("sudo chmod 777 /bin/mind; echo .");
|
||||
echo "starting the installation...\n";
|
||||
echo "creating the file...\n";
|
||||
echo shell_exec("sudo touch /bin/mind");
|
||||
echo "writing the header...\n";
|
||||
echo shell_exec("sudo echo '#!/usr/bin/env php' > ".
|
||||
"/bin/mind");
|
||||
echo "writing the main commands...\n";
|
||||
echo shell_exec("sudo echo '<?php ' >> /bin/mind");
|
||||
echo shell_exec("sudo echo \""."\$_REQ= Array(); ".
|
||||
"\$_REQ[\'env\']= \'shell\'; ".
|
||||
"define('_MINDSRC_', '". getcwd()."'); ".
|
||||
"require('".getcwd()."/mind3rd/API/utils.php');\"".
|
||||
">> /bin/mind;");
|
||||
echo "setting permissions...\n";
|
||||
echo shell_exec("sudo chmod 777 /bin/mind");
|
||||
}else{
|
||||
// TODO: prepare it to other operating systems
|
||||
}
|
||||
|
||||
echo "creating database...\n";
|
||||
if($db = new SQLiteDatabase('mind3rd/SQLite/mind'))
|
||||
{
|
||||
$DDL= file_get_contents('mind3rd/SQLite/ddl.sql');
|
||||
if(!$db->queryExec($DDL))
|
||||
if(!@$db->queryExec($DDL))
|
||||
{
|
||||
die($err);
|
||||
echo "Database already exists...it wont be touched\n";
|
||||
}
|
||||
$db->queryExec("INSERT into user(name, login, pwd, status, type) VALUES ('Administrator', 'admin', '".sha1('admin')."', 'A', 'A');");
|
||||
chmod('mind3rd/SQLite/mind', '777');
|
||||
echo "adding the main user...\n";
|
||||
$db->queryExec("INSERT into user(
|
||||
name,
|
||||
login,
|
||||
pwd,
|
||||
status,
|
||||
type
|
||||
)VALUES(
|
||||
'Administrator'
|
||||
'admin',
|
||||
'".sha1('admin')."',
|
||||
'A',
|
||||
'A'
|
||||
);");
|
||||
echo "setting database permissions...\n";
|
||||
echo shell_exec('sudo chmod 777 '.getcwd().'/mind3rd/SQLite/mind');
|
||||
}else{
|
||||
die($err);
|
||||
echo "SQLite Database could not be created. ".
|
||||
"Is your server working properly with SQLite?\n";
|
||||
exit;
|
||||
}
|
||||
echo "Done\n";
|
||||
echo "Finished\n";
|
||||
exit;
|
||||
}
|
||||
// if not installing, it should be redirected to mind3rd/API/shell.php
|
||||
include('location:./mind3rd/API/shell.php');
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,15 @@
|
||||
public static $content= "";
|
||||
public static $curLang= 'en';
|
||||
|
||||
/**
|
||||
* Verifies wheter the software is installed or not
|
||||
* @return boolean
|
||||
*/
|
||||
public static function isInstalled()
|
||||
{
|
||||
return file_exists('mind3rd/SQLite/mind');
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns or outputs messages using the L10N library
|
||||
* You can pass a rich string with %s, %i, etc, sending extra parameters
|
||||
|
||||
@@ -10,11 +10,12 @@
|
||||
define('_CONSOLE_LINE_LENGTH_', 80);
|
||||
require(_MINDSRC_.'/mind3rd/API/classes/Mind.php');
|
||||
|
||||
/*require(_MINDSRC_.'/mind3rd/API/interfaces/program.php');
|
||||
require(_MINDSRC_.'/mind3rd/API/classes/Mind.php');
|
||||
require(_MINDSRC_.'/mind3rd/API/classes/MindDB.php');
|
||||
require(_MINDSRC_.'/mind3rd/API/classes/MindPlugin.php');
|
||||
require(_MINDSRC_.'/mind3rd/API/classes/MindCommand.php');*/
|
||||
if(!Mind::isInstalled())
|
||||
{
|
||||
include(_MINDSRC_.'/wizard/installation-1.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once(_MINDSRC_.'/mind3rd/API/external/Symfony/Component/Console/Shell.php');
|
||||
require_once(_MINDSRC_.'/mind3rd/API/external/Symfony/Component/Console/Application.php');
|
||||
require_once(_MINDSRC_.'/mind3rd/API/external/Symfony/Component/Console/Command/Command.php');
|
||||
|
||||
Arquivo binário não exibido.
@@ -11,4 +11,6 @@ blabelaebamimi
|
||||
*/
|
||||
aluno tem pai, mãe e papagaio.
|
||||
aluno tem nome:caractere(128, obrigatório, não nulo, "josé's da conceição")
|
||||
pai tem \pilha.
|
||||
pai tem \pilha.
|
||||
mae tem nome, idade e sexo:char().
|
||||
mãe tem nome, idade e sexo.
|
||||
@@ -0,0 +1,25 @@
|
||||
You must install mind, first<br/>
|
||||
You got two options to install it.<br/>
|
||||
<ul>
|
||||
<li>
|
||||
By console:<br/>
|
||||
Execute in your console, into your mind's folder:<br/>
|
||||
<div style='border:dashed 1px #fff;
|
||||
background-color:#eef;
|
||||
padding:4px;
|
||||
margin:4px;'>
|
||||
$ sudo php mind install
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
By wizard:<br/>
|
||||
Just click the only button in this screen
|
||||
<input type="button"
|
||||
value="Install"
|
||||
onclick="self.location= 'wizard/installation-2.php';" />
|
||||
</li>
|
||||
</ul>
|
||||
<a href='docs/help/main.php?item=requirements'>See Requirements</a><br/>
|
||||
<a href='docs/help/main.php'>See help</a><br/>
|
||||
<a href='docs/help/main.php?item=faq'>See FAQ</a><br/>
|
||||
<a href='docs/help/main.php?item=discussion_group'>See discussion group</a><br/>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
//`sudo php ../mind install`;
|
||||
echo "<pre>";
|
||||
//echo shell_exec("sudo echo 10");
|
||||
echo "</pre>";
|
||||
Referência em uma Nova Issue
Bloquear um usuário