Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

changes to the help commands and how to install or uninstall the appl…

…ication.

Changes made on external(symfony) classes! To change the help format as needed
Fixed some typing mistakes
  • Loading branch information...
commit 3887f5746c1de896246aa7f66207ab2e7e7a5fad 1 parent 8a5dbde
@felipenmoura authored
View
1  index.php
@@ -9,6 +9,7 @@
$_REQ['request_method']= $_SERVER['REQUEST_METHOD'];
$_REQ['env']= 'http';
define('_MINDSRC_', getcwd());
+
switch($_REQ['request_method'])
{
case 'GET' : $_REQ['data']= $_GET;
View
20 mind
@@ -60,6 +60,26 @@
}
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
View
2  mind3rd/API/L10N/en.php
@@ -37,7 +37,7 @@ public function __construct()
$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['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['invalidCreateParams'] = Mind::message("Main: Invalid parameters", "[Fail]", false);
$this->messages['invalidOption'] = Mind::message("Invalid option '%s'", '[Fail]', false);
View
10 mind3rd/API/external/Symfony/Component/Console/Application.php
@@ -61,6 +61,8 @@ class Application
/**
* Constructor.
*
+ * CHANGED BY FELIPENMOURA
+ *
* @param string $name The name of the application
* @param string $version The version of the application
*/
@@ -84,11 +86,11 @@ public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN')
new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'),
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('--verbose', '-v', InputOption::PARAMETER_NONE, 'Increase verbosity of messages.'),
- new InputOption('--version', '-V', InputOption::PARAMETER_NONE, 'Display this program version.'),
+ //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('--version', '-V', InputOption::PARAMETER_NONE, 'Display this program version.'),
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.'),
));
}
View
10 mind3rd/API/external/Symfony/Component/Console/Command/HelpCommand.php
@@ -45,13 +45,9 @@ protected function configure()
->setAliases(array('?'))
->setDescription('Displays help for a command')
->setHelp(<<<EOF
-The <info>help</info> command displays help for a given command:
-
- <info>./symfony help test:all</info>
-
-You can also output the help as XML by using the <comment>--xml</comment> option:
-
- <info>./symfony help --xml test:all</info>
+The <info>help</info> command displays help for a given command.
+ Use the comand <info>list</info> to see the list of commands.
+ Use <info>command</info> <comment>--help</comment> to see details about each command.
EOF
);
}
View
10 mind3rd/API/external/Symfony/Component/Console/Shell.php
@@ -66,7 +66,15 @@ public function run()
while (true)
{
$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)
{
$this->output->writeln("\n");
View
2  mind3rd/API/programs/Create.php
@@ -31,7 +31,7 @@ public function __construct()
->setAction('action')
->setHelp(<<<EOT
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
EOT
);
View
2  mind3rd/API/programs/Info.php
@@ -18,7 +18,7 @@ public function __construct()
{
$this
->setCommandName('info')
- ->setDescription('Performs some tests on theWebMind')
+ ->setDescription('Shows some information about this instalation')
->setRestrict(true)
->setAction('action')
->setHelp(<<<EOT
View
2  mind3rd/API/programs/Install.php
@@ -53,7 +53,7 @@ public function executableFunction()
public function __construct()
{
$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
->setRestrict(true)
->setAdminAccess()
View
1  mind3rd/API/programs/Quit.php
@@ -28,6 +28,7 @@ public function __construct()
public function action()
{
@session_destroy();
+ //\API\Program::execute('clear');
Mind::write('bye');
exit;
}
View
18 mind3rd/API/programs/RunTest.php
@@ -34,6 +34,19 @@ public function __construct()
public function action()
{
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();
$this->runStep1();
@@ -55,6 +68,11 @@ public function action()
echo shell_exec($_MIND->conf['phpunit-src']." "._MINDSRC_."/Tests/");
}
ob_end_flush();
+
+ // gotoxy
+ // printf("\033[2;10f");
+
+
return true;
}
View
54 mind3rd/API/programs/helpContent.php
@@ -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();
+ }
+ }
View
12 mind3rd/API/shell.php
@@ -7,9 +7,9 @@
*/
// setting the general helperSet
- $helperSet= false;
- $helperSet= ($helperSet) ?: new Symfony\Component\Console\Helper\HelperSet();
- $app->setHelperSet($helperSet);
+ $helperSet= true;
+ /*$helperSet= ($helperSet) ?: new Symfony\Component\Console\Helper\HelperSet();
+ $app->setHelperSet($helperSet);*/
if(isset($_SERVER['argv']))
{
@@ -21,6 +21,8 @@
/* let's load the plugins, if they are allowed */
Mind::$triggers= array_keys($app->getCommands());
+ //var_dump($app);
+
try {
$sh= new Symfony\Component\Console\Shell($app);
$sh->run();
@@ -34,6 +36,6 @@
}
else
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 " system via HTTP once it does not need the shell to work\n\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";
}
View
21 mind3rd/env/setup/UnixSetup.php
@@ -22,23 +22,18 @@ class UnixSetup extends Setup{
*/
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
$_REQ= Array();
$_REQ["env"]= "shell";
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 " creating the file...\n";
View
2  mind3rd/env/setup/WinSetup.php
@@ -28,7 +28,7 @@ public function createExecFile()
* 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">
+ // <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'));
$phpBin= '';
Please sign in to comment.
Something went wrong with that request. Please try again.