changes to the help commands and how to install or uninstall the application.
Changes made on external(symfony) classes! To change the help format as needed Fixed some typing mistakes
Esse commit está contido em:
@@ -9,6 +9,7 @@
|
|||||||
$_REQ['request_method']= $_SERVER['REQUEST_METHOD'];
|
$_REQ['request_method']= $_SERVER['REQUEST_METHOD'];
|
||||||
$_REQ['env']= 'http';
|
$_REQ['env']= 'http';
|
||||||
define('_MINDSRC_', getcwd());
|
define('_MINDSRC_', getcwd());
|
||||||
|
|
||||||
switch($_REQ['request_method'])
|
switch($_REQ['request_method'])
|
||||||
{
|
{
|
||||||
case 'GET' : $_REQ['data']= $_GET;
|
case 'GET' : $_REQ['data']= $_GET;
|
||||||
|
|||||||
+20
@@ -60,6 +60,26 @@
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case '--help':
|
||||||
|
case '-h':
|
||||||
|
case '?':
|
||||||
|
case 'help':{
|
||||||
|
echo "theWebMind(or just mind):\n website: http://thewebmind.org\n Twitter: @thewebmind\n Docs: http://docs.thewebmind.org\n\n";
|
||||||
|
"The list of startup commands:\n".
|
||||||
|
" install : installs the application itself\n".
|
||||||
|
" uninstall: uninstalls the application, but do NOT remove projects,\n".
|
||||||
|
" users or history\n".
|
||||||
|
" remove : installs the application AND REMOVE every data it may\n".
|
||||||
|
" have created, including ALL projects, history and users.\n".
|
||||||
|
" --help :\n";
|
||||||
|
" -h :\n";
|
||||||
|
" help :\n";
|
||||||
|
" ? :\n";
|
||||||
|
" Shows this help content.\n\n";
|
||||||
|
echo "After installing, you can open the application by calling the 'mind' command anywhere.\n".
|
||||||
|
"You will also be able to send POST requisition to mind's server address sending the command you want to execute and its parameters.\n";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if not installing, it should be redirected to mind3rd/API/shell.php
|
// if not installing, it should be redirected to mind3rd/API/shell.php
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class En implements l10n{
|
|||||||
$this->messages['not_allowed_tip'] = "Try calling the command\n auth < login >\nA password will be required.\n";
|
$this->messages['not_allowed_tip'] = "Try calling the command\n auth < login >\nA password will be required.\n";
|
||||||
$this->messages['no_such_file'] = Mind::message("\nMain: No such command '%s'", "[Fail]", false);
|
$this->messages['no_such_file'] = Mind::message("\nMain: No such command '%s'", "[Fail]", false);
|
||||||
$this->messages['auth_fail'] = Mind::message("\nAuth: Wrong user or password", "[Fail]", false);
|
$this->messages['auth_fail'] = Mind::message("\nAuth: Wrong user or password", "[Fail]", false);
|
||||||
$this->messages['bye'] = "Logging out...\n";
|
$this->messages['bye'] = "Thank you! See you later!\nLogging out...\n";
|
||||||
$this->messages['thinking'] = "Please wait while I'm thinking...\n";
|
$this->messages['thinking'] = "Please wait while I'm thinking...\n";
|
||||||
$this->messages['invalidCreateParams'] = Mind::message("Main: Invalid parameters", "[Fail]", false);
|
$this->messages['invalidCreateParams'] = Mind::message("Main: Invalid parameters", "[Fail]", false);
|
||||||
$this->messages['invalidOption'] = Mind::message("Invalid option '%s'", '[Fail]', false);
|
$this->messages['invalidOption'] = Mind::message("Invalid option '%s'", '[Fail]', false);
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ class Application
|
|||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
* CHANGED BY FELIPENMOURA
|
||||||
|
*
|
||||||
* @param string $name The name of the application
|
* @param string $name The name of the application
|
||||||
* @param string $version The version of the application
|
* @param string $version The version of the application
|
||||||
*/
|
*/
|
||||||
@@ -84,11 +86,11 @@ class Application
|
|||||||
new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'),
|
new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'),
|
||||||
|
|
||||||
new InputOption('--help', '-h', InputOption::PARAMETER_NONE, 'Display this help message.'),
|
new InputOption('--help', '-h', InputOption::PARAMETER_NONE, 'Display this help message.'),
|
||||||
new InputOption('--quiet', '-q', InputOption::PARAMETER_NONE, 'Do not output any message.'),
|
//new InputOption('--quiet', '-q', InputOption::PARAMETER_NONE, 'Do not output any message.'),
|
||||||
new InputOption('--verbose', '-v', InputOption::PARAMETER_NONE, 'Increase verbosity of messages.'),
|
//new InputOption('--verbose', '-v', InputOption::PARAMETER_NONE, 'Increase verbosity of messages.'),
|
||||||
new InputOption('--version', '-V', InputOption::PARAMETER_NONE, 'Display this program version.'),
|
//new InputOption('--version', '-V', InputOption::PARAMETER_NONE, 'Display this program version.'),
|
||||||
new InputOption('--color', '-c', InputOption::PARAMETER_NONE, 'Force ANSI color output.'),
|
new InputOption('--color', '-c', InputOption::PARAMETER_NONE, 'Force ANSI color output.'),
|
||||||
new InputOption('--no-interaction', '-n', InputOption::PARAMETER_NONE, 'Do not ask any interactive question.'),
|
//new InputOption('--no-interaction', '-n', InputOption::PARAMETER_NONE, 'Do not ask any interactive question.'),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,13 +45,9 @@ class HelpCommand extends Command
|
|||||||
->setAliases(array('?'))
|
->setAliases(array('?'))
|
||||||
->setDescription('Displays help for a command')
|
->setDescription('Displays help for a command')
|
||||||
->setHelp(<<<EOF
|
->setHelp(<<<EOF
|
||||||
The <info>help</info> command displays help for a given command:
|
The <info>help</info> command displays help for a given command.
|
||||||
|
Use the comand <info>list</info> to see the list of commands.
|
||||||
<info>./symfony help test:all</info>
|
Use <info>command</info> <comment>--help</comment> to see details about each command.
|
||||||
|
|
||||||
You can also output the help as XML by using the <comment>--xml</comment> option:
|
|
||||||
|
|
||||||
<info>./symfony help --xml test:all</info>
|
|
||||||
EOF
|
EOF
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,15 @@ class Shell
|
|||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
$command = readline($this->application->getName().' > ');
|
$command = readline($this->application->getName().' > ');
|
||||||
|
|
||||||
|
/** changed by felipeNMoura **/
|
||||||
|
if($command == "\n" || $command == ""){
|
||||||
|
$this->output->write("");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
/** end of changes made by felipnmoura **/
|
||||||
|
|
||||||
|
|
||||||
if (false === $command)
|
if (false === $command)
|
||||||
{
|
{
|
||||||
$this->output->writeln("\n");
|
$this->output->writeln("\n");
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class Create extends MindCommand implements program
|
|||||||
->setAction('action')
|
->setAction('action')
|
||||||
->setHelp(<<<EOT
|
->setHelp(<<<EOT
|
||||||
You can create a new project by typing "create project name"
|
You can create a new project by typing "create project name"
|
||||||
You can create your users typing "create user name" and then, adding the user to any specific group.
|
You can create your users typing "create user name" and then, adding the user to any specific project.
|
||||||
You need to be a super user to perform these actions
|
You need to be a super user to perform these actions
|
||||||
EOT
|
EOT
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class Info extends MindCommand implements program
|
|||||||
{
|
{
|
||||||
$this
|
$this
|
||||||
->setCommandName('info')
|
->setCommandName('info')
|
||||||
->setDescription('Performs some tests on theWebMind')
|
->setDescription('Shows some information about this instalation')
|
||||||
->setRestrict(true)
|
->setRestrict(true)
|
||||||
->setAction('action')
|
->setAction('action')
|
||||||
->setHelp(<<<EOT
|
->setHelp(<<<EOT
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->setCommandName('install')
|
$this->setCommandName('install')
|
||||||
->setDescription("This program will be able to install components to the application.")
|
->setDescription("Adds components to the application")
|
||||||
//->setFileName('modeloTeste') // use this if your class has NOT the same name as its file
|
//->setFileName('modeloTeste') // use this if your class has NOT the same name as its file
|
||||||
->setRestrict(true)
|
->setRestrict(true)
|
||||||
->setAdminAccess()
|
->setAdminAccess()
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ EOT
|
|||||||
public function action()
|
public function action()
|
||||||
{
|
{
|
||||||
@session_destroy();
|
@session_destroy();
|
||||||
|
//\API\Program::execute('clear');
|
||||||
Mind::write('bye');
|
Mind::write('bye');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,19 @@ EOT
|
|||||||
public function action()
|
public function action()
|
||||||
{
|
{
|
||||||
GLOBAL $_MIND;
|
GLOBAL $_MIND;
|
||||||
|
/*\API\Program::execute('clear');
|
||||||
|
echo "|==> |";
|
||||||
|
sleep(1);
|
||||||
|
\API\Program::execute('clear');
|
||||||
|
echo "|========> |";
|
||||||
|
sleep(1);
|
||||||
|
\API\Program::execute('clear');
|
||||||
|
echo "|===============> |";
|
||||||
|
sleep(1);
|
||||||
|
\API\Program::execute('clear');
|
||||||
|
echo "|=========================>|\n";
|
||||||
|
sleep(1);*/
|
||||||
|
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
$this->runStep1();
|
$this->runStep1();
|
||||||
@@ -55,6 +68,11 @@ EOT
|
|||||||
echo shell_exec($_MIND->conf['phpunit-src']." "._MINDSRC_."/Tests/");
|
echo shell_exec($_MIND->conf['phpunit-src']." "._MINDSRC_."/Tests/");
|
||||||
}
|
}
|
||||||
ob_end_flush();
|
ob_end_flush();
|
||||||
|
|
||||||
|
// gotoxy
|
||||||
|
// printf("\033[2;10f");
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Arquivo executável
+54
@@ -0,0 +1,54 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of TheWebMind 3rd generation.
|
||||||
|
*
|
||||||
|
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
|
||||||
|
* @license licenses/mind3rd.license
|
||||||
|
*/
|
||||||
|
use Symfony\Component\Console\Input\InputArgument,
|
||||||
|
Symfony\Component\Console\Input\InputOption,
|
||||||
|
Symfony\Component\Console;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class represents a model for programs
|
||||||
|
*
|
||||||
|
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
|
||||||
|
*/
|
||||||
|
class helpContent extends MindCommand implements program
|
||||||
|
{
|
||||||
|
|
||||||
|
public function executableFunction()
|
||||||
|
{
|
||||||
|
echo "theWebMind(or just mind):\n website: http://thewebmind.org\n Twitter: @thewebmind\n Docs: http://docs.thewebmind.org\n\n";
|
||||||
|
"The list of startup commands:\n".
|
||||||
|
" install : installs the application itself\n".
|
||||||
|
" uninstall: uninstalls the application, but do NOT remove projects,\n".
|
||||||
|
" users or history\n".
|
||||||
|
" remove : installs the application AND REMOVE every data it may\n".
|
||||||
|
" have created, including ALL projects, history and users.\n".
|
||||||
|
" --help :\n";
|
||||||
|
" -h :\n";
|
||||||
|
" help :\n";
|
||||||
|
" ? :\n";
|
||||||
|
" Shows this help content.\n\n";
|
||||||
|
echo "After installing, you can open the application by calling the 'mind' command anywhere.\n".
|
||||||
|
"You will also be able to send POST requisition to mind's server address sending the command you want to execute and its parameters.\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->setCommandName('helps')
|
||||||
|
->setFileName('helpContent')
|
||||||
|
->setDescription("Shows the help content")
|
||||||
|
->setRestrict(false)
|
||||||
|
->setHelp("Shows the help content")
|
||||||
|
->setAction(function($class){
|
||||||
|
$class->executableFunction();
|
||||||
|
});
|
||||||
|
|
||||||
|
/*$this->addRequiredArgument('firstArgument',
|
||||||
|
'first, and required argument',
|
||||||
|
Array('X', 'Y', 'Z'));*/
|
||||||
|
$this->init();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,9 +7,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// setting the general helperSet
|
// setting the general helperSet
|
||||||
$helperSet= false;
|
$helperSet= true;
|
||||||
$helperSet= ($helperSet) ?: new Symfony\Component\Console\Helper\HelperSet();
|
/*$helperSet= ($helperSet) ?: new Symfony\Component\Console\Helper\HelperSet();
|
||||||
$app->setHelperSet($helperSet);
|
$app->setHelperSet($helperSet);*/
|
||||||
|
|
||||||
if(isset($_SERVER['argv']))
|
if(isset($_SERVER['argv']))
|
||||||
{
|
{
|
||||||
@@ -21,6 +21,8 @@
|
|||||||
/* let's load the plugins, if they are allowed */
|
/* let's load the plugins, if they are allowed */
|
||||||
Mind::$triggers= array_keys($app->getCommands());
|
Mind::$triggers= array_keys($app->getCommands());
|
||||||
|
|
||||||
|
//var_dump($app);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$sh= new Symfony\Component\Console\Shell($app);
|
$sh= new Symfony\Component\Console\Shell($app);
|
||||||
$sh->run();
|
$sh->run();
|
||||||
@@ -34,6 +36,6 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
echo " Please, follow these instructions to install it: http://goo.gl/UDrEY\n\n";
|
echo " Please, follow these instructions to install it: http://goo.gl/UDrEY\n\n";
|
||||||
echo " NOTE: Even without the readline extension, you already can use the\n";
|
echo " NOTE: Even without the readline extension, you already can use the\n";
|
||||||
echo " system via HTTP once it does not need the shell to work\n\n";
|
echo " system via HTTP once it does not need the shell to work\n\n";
|
||||||
}
|
}
|
||||||
externo
+8
-13
@@ -22,23 +22,18 @@ class UnixSetup extends Setup{
|
|||||||
*/
|
*/
|
||||||
public static function createExecFile()
|
public static function createExecFile()
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
$uriToAdd= getcwd()."/";
|
|
||||||
//echo $uriToAdd."<br/>";
|
|
||||||
///usr/local/bin:/usr/bin:/bin
|
|
||||||
//echo shell_exec('echo $PATH');
|
|
||||||
echo "<br/>";
|
|
||||||
echo getenv('PATH').PATH_SEPARATOR.$uriToAdd;
|
|
||||||
echo "<br/>";
|
|
||||||
echo shell_exec('expert PATH=$PATH'.PATH_SEPARATOR.$uriToAdd);
|
|
||||||
echo shell_exec('echo $PATH');
|
|
||||||
echo "<br/>";
|
|
||||||
*/
|
|
||||||
self::$content= '<?php
|
self::$content= '<?php
|
||||||
$_REQ= Array();
|
$_REQ= Array();
|
||||||
$_REQ["env"]= "shell";
|
$_REQ["env"]= "shell";
|
||||||
define("_MINDSRC_", "'.getcwd().'");
|
define("_MINDSRC_", "'.getcwd().'");
|
||||||
require("'.getcwd().'/mind3rd/API/utils/utils.php");';
|
|
||||||
|
|
||||||
|
if(sizeOf($_SERVER["argv"])>0 && isset($_SERVER["argv"][1])){
|
||||||
|
require("'.getcwd().'/mind");
|
||||||
|
}else{
|
||||||
|
require("'.getcwd().'/mind3rd/API/utils/utils.php");
|
||||||
|
}
|
||||||
|
';
|
||||||
|
|
||||||
echo " starting the installation...\n";
|
echo " starting the installation...\n";
|
||||||
echo " creating the file...\n";
|
echo " creating the file...\n";
|
||||||
|
|||||||
externo
+1
-1
@@ -28,7 +28,7 @@ abstract class WinSetup extends Setup{
|
|||||||
* for readline on windows! Then, on windows, the system will run
|
* for readline on windows! Then, on windows, the system will run
|
||||||
* ONLY with HTTP requisitions...sorry guys!
|
* 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">
|
// <editor-fold defaultstate="collapsed" desc="Code responsible for the instalation in windows, but is not in use by now because some of the external console components does not work on Windows!">
|
||||||
/*
|
/*
|
||||||
$runDir= str_replace('cmd.exe', '', getenv('COMSPEC'));
|
$runDir= str_replace('cmd.exe', '', getenv('COMSPEC'));
|
||||||
$phpBin= '';
|
$phpBin= '';
|
||||||
|
|||||||
Referência em uma Nova Issue
Bloquear um usuário