Created windows setup (as possible)
Esse commit está contido em:
externo
+36
-18
@@ -17,34 +17,53 @@ abstract class WinSetup extends Setup{
|
||||
*/
|
||||
public function createExecFile()
|
||||
{
|
||||
/**
|
||||
* This could be beautiful, but unfortunately, PHP has not support
|
||||
* for readline on windows! Then, on windows, the system will run
|
||||
* ONLY with HTTP requisitions...sorry guys!
|
||||
*/
|
||||
// <editor-fold defaultstate="collapsed" desc="Code responsible for the instalation in windows, but is not in use by now">
|
||||
/*
|
||||
$runDir= str_replace('cmd.exe', '', getenv('COMSPEC'));
|
||||
$phpBin= '';
|
||||
|
||||
while(!file_exists($phpBin) || basename($phpBin)!='php.exe')
|
||||
if(!isset($_SERVER))
|
||||
{
|
||||
$command= " [PROMPT] Please type the PHP bin file";
|
||||
if(file_exists('c:/wamp'))
|
||||
$command.="
|
||||
eg: \"c:/wamp/bin/php/php5.3.4/php.exe\":\n ";
|
||||
else
|
||||
echo $command.= "
|
||||
eg: \"c:/php/php.exe\":\n ";
|
||||
echo $command;
|
||||
$fp = fopen('php://stdin', 'r');
|
||||
$phpBin = trim(fgets($fp, 1024));
|
||||
while(!file_exists($phpBin) || basename($phpBin)!='php.exe')
|
||||
{
|
||||
$command= " [PROMPT] Please type the PHP bin file";
|
||||
if(file_exists('c:/wamp'))
|
||||
$command.="
|
||||
eg: \"c:/wamp/bin/php/php5.3.4/php.exe\":\n ";
|
||||
else
|
||||
echo $command.= "
|
||||
eg: \"c:/php/php.exe\":\n ";
|
||||
echo $command;
|
||||
$fp = fopen('php://stdin', 'r');
|
||||
$phpBin = trim(fgets($fp, 1024));
|
||||
}
|
||||
}elseif(!isset($_GET['phpBin']))
|
||||
{
|
||||
echo "To be used in windows, you must provide the php.exe path\n";
|
||||
echo "This file will probably be at\n";
|
||||
echo "c:/wamp/bin/php/php5.3.4/php.exe\n";
|
||||
echo "or\n";
|
||||
echo "c:/php/php.exe";
|
||||
return false;
|
||||
}
|
||||
@shell_exec("copy /y NUL ".$runDir."mind.bat >NUL");
|
||||
@shell_exec("copy /y NUL ".$runDir."mind3rd.php >NUL");
|
||||
|
||||
|
||||
|
||||
|
||||
$content= $phpBin.' '.$runDir.'mind3rd.php';
|
||||
@shell_exec('echo '.$content.' > '.$runDir.'mind.bat');
|
||||
|
||||
|
||||
$cwd= str_replace('\\', '/', getcwd());
|
||||
|
||||
|
||||
$phpContent= '$_REQ= Array(); $_REQ["env"]= "shell"; define("_MINDSRC_", "'.$cwd.'"); require("'.$cwd.'/mind3rd/API/utils.php"); ';
|
||||
@shell_exec('echo ^<?php '.$phpContent.' > '.$runDir.'mind3rd.php');
|
||||
|
||||
*/
|
||||
// </editor-fold>
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -54,8 +73,7 @@ abstract class WinSetup extends Setup{
|
||||
* It uses an inherited method, createDatabase
|
||||
*/
|
||||
public static function install(){
|
||||
parent::__construct();
|
||||
if(self::createExecFile())
|
||||
if(self::createExecFile())
|
||||
return self::createDatabase();
|
||||
return false;
|
||||
}
|
||||
|
||||
+4
-1
@@ -25,7 +25,10 @@
|
||||
echo "<p><img src='ide/images/".((Setup::$sqliteDir)? 'o':'f').".png' /> Write permissions in '".getcwd()."/mind3rd/SQLite/' to the user '".trim(shell_exec('whoami'))."'<br/>";
|
||||
echo "<p><img src='ide/images/".((Setup::$apiDir)? 'o':'f').".png' /> Write permissions in '".getcwd()."/mind3rd/API/' to the user '".trim(shell_exec('whoami'))."'<br/>";
|
||||
|
||||
|
||||
if(Setup::getSO() == 'WIN')
|
||||
{
|
||||
///////////////
|
||||
}
|
||||
|
||||
echo "<input type='button'
|
||||
value='Verify again'
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário