added button in the IDE to create demo_en project

Esse commit está contido em:
Felipe Nascimento de Moura
2011-05-04 00:51:02 -03:00
commit a802b61f60
4 arquivos alterados com 190 adições e 105 exclusões
+101 -101
Ver Arquivo
@@ -1,108 +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.
* This file is part of TheWebMind 3rd generation.
*
* @param boolean $echoes If the plugins list should be sent to the output
* @return Array
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
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');
}
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.
*
* 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
* @author felipe
*/
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();
}
}
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();
}
}
+6 -2
Ver Arquivo
@@ -13,6 +13,8 @@ namespace API;
*/
class User{
static protected $validAttrs= Array('name', 'email', 'password');
/**
* Returns an array of all registered users.
* @return Array
@@ -30,10 +32,12 @@ class User{
{
return \MindProject::projectsList();
}
/*
public static function ()
public static function set($attr, $value)
{
print_r(self::$validAttrs);
}
/*
public static function ()
{
}*/
+64
Ver Arquivo
@@ -0,0 +1,64 @@
<?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 Set extends MindCommand implements program
{
public $whose = '';
public $attribute= '';
public $value = '';
private function setUserData()
{
if($this->attribute=='pwd')
$this->value= $this->prompt('pwd', 'The new password, please', true);
\API\User::set($this->attribute, $this->value);
}
private function setProjectData()
{
echo "Project's data\n";
}
public function executableFunction()
{
if($this->whose == 'user')
{
$this->setUserData();
}else{
$this->setProjectData();
}
}
public function __construct()
{
$this->setCommandName('set')
->setDescription("Sets user's or project's data ")
->setRestrict(false)
->setHelp("You can set information about the current user or a project's data.")
->setAction('executableFunction');
$this->addRequiredArgument('whose',
'Who will suffer the update',
Array('user', 'project'));
$this->addRequiredArgument('attribute',
'The attribute you will change');
$this->addOptionalArgument('value',
'The value for that attribute(optional only for pwd');
$this->init();
}
}