changes to the way the system loads all the programs, loadding them automaticaly
Esse commit está contido em:
@@ -46,6 +46,18 @@ class MindProject extends VersionManager{
|
||||
return $qrs;
|
||||
}
|
||||
|
||||
public static function listProjects()
|
||||
{
|
||||
$db= new MindDB();
|
||||
$hasProject= "SELECT distinct pk_project,
|
||||
project.name as name
|
||||
from project
|
||||
where status='A'
|
||||
";
|
||||
$data= $db->query($hasProject);
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the project already exists,
|
||||
* false, otherwise
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
public static function projectList()
|
||||
{
|
||||
|
||||
return \MindProject::listProjects();
|
||||
}
|
||||
|
||||
public static function current()
|
||||
|
||||
@@ -26,8 +26,15 @@
|
||||
EOT
|
||||
);
|
||||
|
||||
$this->addRequiredArgument('projectName', 'Specify the project name, you want to use/open');
|
||||
$projectsList= \API\Project::projectList();
|
||||
foreach($projectsList as $k=>$p)
|
||||
{
|
||||
$projectsList[$k]= $p['name'];
|
||||
}
|
||||
|
||||
$this->addRequiredArgument('projectName',
|
||||
'Specify the project name, you want to use/open',
|
||||
$projectsList);
|
||||
$this->init();
|
||||
}
|
||||
|
||||
|
||||
+17
-19
@@ -9,12 +9,12 @@
|
||||
require(_MINDSRC_.'/mind3rd/API/utils/header.php');
|
||||
include(_MINDSRC_.'/mind3rd/API/utils/constants.php');
|
||||
|
||||
// Instantiating the main Mind class
|
||||
/**
|
||||
* @global Mind $_MIND This variable contains many information about the proect, the system and also have some methods an attributes to deal with such data
|
||||
*/
|
||||
$_MIND= new Mind();
|
||||
|
||||
// we will load the plugins if they are allowed
|
||||
if($_MIND->defaults['plugins']==1)
|
||||
{
|
||||
require(_MINDSRC_.'/mind3rd/API/interfaces/plugin.php');
|
||||
@@ -30,27 +30,25 @@
|
||||
$d->close();
|
||||
}
|
||||
|
||||
|
||||
// building the application
|
||||
define('SYSTEM_NAME', 'mind');
|
||||
|
||||
|
||||
$app= new Symfony\Component\Console\Application(SYSTEM_NAME);
|
||||
$app->addCommands(Array(
|
||||
new RunTest(),
|
||||
new Quit(),
|
||||
new Auth(),
|
||||
new Clear(),
|
||||
new Commit(),
|
||||
new Info(),
|
||||
new Create(),
|
||||
new Show(),
|
||||
new Analyze(),
|
||||
new SetUse(),
|
||||
new dqb(),
|
||||
new Generate(),
|
||||
new modeloTeste()
|
||||
));
|
||||
|
||||
// defining the programs/commands to be used
|
||||
$programs= Array();
|
||||
$d = dir(_MINDSRC_.'/mind3rd/API/programs');
|
||||
while(false !== ($entry = $d->read()))
|
||||
{
|
||||
if(substr($entry, 0, 1) != '.')
|
||||
{
|
||||
$entry= str_replace('.php', '', $entry);
|
||||
$programs[]= new $entry();
|
||||
}
|
||||
}
|
||||
$d->close();
|
||||
$app->addCommands($programs);
|
||||
|
||||
// starting the application
|
||||
if($_REQ['env']=='shell')
|
||||
include('shell.php');
|
||||
else
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário