appllying changes to the new IDE

Esse commit está contido em:
Felipe N. Moura
2012-08-26 01:50:41 -03:00
commit d780d738d8
6 arquivos alterados com 150 adições e 8 exclusões
+108
Ver Arquivo
@@ -0,0 +1,108 @@
<?php
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
namespace API;
/**
* This is a facade to help you getting generic data.
* This class offers you a bunch of "shortcuts" to many different data or results.
*
* @author felipe
*/
class Get{
/**
* Gets a list of installed plugins.
*
* @param boolean $echoes If the plugins list should be sent to the output
* @return Array
*/
public static function plugins($echoes=false)
{
return \MindPlugin::listPlugins($echoes);
}
/**
* Gets an array with all the installed lobes.
* @return Array
*/
public static function lobes()
{
return \Lobe\Neuron::listLobes();
}
/**
* Gets all the information about the current project.
* @return string
*/
public static function projectData()
{
$dt= \Mind::$currentProject;
return $dt;
}
/**
* Returns a list of identified tables for the current project.
* @return Array
*/
public static function tables()
{
return \Analyst::getUniverse();
}
/**
* Returns an array with all the DDL codes for the current project.
* @return Array
*/
public static function DDL()
{
$dbDriver= \Mind::$currentProject['database_drive'];
\DQB\QueryFactory::setUp($dbDriver);
return \DQB\QueryFactory::getCompleteQuery(false, true, 'array');
}
/**
*
* Returns an array with all the DDL codes for the current project.
* This method returns each DDL comand as a decorated command, containing HTML tags.
* @return Array
*/
public static function DecoratedDDL()
{
$dbDriver= \Mind::$currentProject['database_drive'];
\DQB\QueryFactory::setUp($dbDriver);
return \DQB\QueryFactory::getCompleteQuery(true, false, 'array');
}
/**
* Gets the currently opened project or false if none.
*
* @return \MindProject|false
*/
public static function currentProject()
{
return \Mind::$project? \Mind::$project:
false;
}
/**
* Gets an array with all the source code, for the current project.
* @return Array
*/
public static function source()
{
return \API\Project::source();
}
/**
* Gets the list of currently instaled idioms.
* @return Array
*/
public static function idioms()
{
return \Mind::getIdiomsList();
}
}
+11 -5
Ver Arquivo
@@ -20,26 +20,32 @@
}
if(!isset($_REQ['data']))
$_REQ['data']= Array();
foreach($_POST as $k=>$value)
{
$_REQ['data'][$k]= preg_replace("/['\"\\\.\/]/", '', $value);
}
if(isset($_SESSION['currentProject']))
if(isset($_SESSION['currentProject']) && $_SESSION['currentProject'])
{
$p= Array();
$p['pk_project']= $_SESSION['currentProject'];
$p['name']= $_SESSION['currentProjectName'];
Mind::openProject($p);
}
if(isset($app))
{
if(!isset($_REQ['data']) || !isset($_REQ['data']['program']))
{
Mind::write('programRequired');
return false;
if($_MIND->defaults['use_default_ide'] != false){
header('Location: '.$_MIND->defaults['use_default_ide']);
exit;
}else{
Mind::write('programRequired');
return false;
}
}
$program= $app->findCommand($_REQ['data']['program']);
$program= $program->getFileName();
+3 -1
Ver Arquivo
@@ -46,11 +46,12 @@
}
$d->close();
}
// building the application
define('SYSTEM_NAME', 'mind');
$app= new Symfony\Component\Console\Application(SYSTEM_NAME);
// defining the programs/commands to be used
$programs= Array();
$d = dir(_MINDSRC_.'/mind3rd/API/programs');
@@ -66,6 +67,7 @@
$d->close();
$app->addCommands($programs);
\MIND::$programs= $programs;
// starting the application
if($_REQ['env']=='shell'){
include(_MINDSRC_.'/mind3rd/API/shell.php');
+3 -1
Ver Arquivo
@@ -43,4 +43,6 @@ fk_prefix="fk_"
counter_col="counter"
; Varchar and Char properties should have mandatorily a size, if none is passed,
; the following value will be used as size
default_character_length=255
default_character_length=255
; should it open an IDE when HTTP requests come with no program param?
use_default_ide=ide/