Merge branch 'master' of github.com:felipenmoura/theWebMind

Esse commit está contido em:
Felipe Nascimento de Moura
2011-04-26 14:29:30 -03:00
51 arquivos alterados com 415 adições e 83 exclusões
+6 -5
Ver Arquivo
@@ -1,9 +1,10 @@
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
namespace DQB;
/**
+1
Ver Arquivo
@@ -4,6 +4,7 @@
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
/**
* This is the main class
* It provides a bunch of static methods to deal with the console
+6 -1
Ver Arquivo
@@ -1,7 +1,12 @@
<?php
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
namespace scientia;
/**
* Description of Darwin
*
* @author felipe
*/
+6 -5
Ver Arquivo
@@ -1,12 +1,13 @@
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
namespace theos;
/**
* Description of DBGen
* The database Generator.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
*/
+6 -5
Ver Arquivo
@@ -1,12 +1,13 @@
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
namespace theos;
/**
* Description of Gosh
* The creator.
*
* @author felipe
*/
@@ -1,14 +1,16 @@
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
namespace theos;
/**
* Description of ProjectFileManager
* This class allows you to change, add or even remove files and directories from/to/of
* projects.
*
* @author felipe
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
*/
class ProjectFileManager {
+1 -1
Ver Arquivo
@@ -3,8 +3,8 @@
* This file is part of theWebMind 3rd generation.
* Under Cortex/Analyst structure
*
* @filesource
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
/**
* Generic methods to be used by the Normalizer.
+8 -6
Ver Arquivo
@@ -1,13 +1,15 @@
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
namespace API;
/**
* Description of FileManager
*
* A faced to make your job easier when dealing with files.
* This is just a shortcut to ProjectFileManager.
*
* @author felipe
*/
class FileManager extends \theos\ProjectFileManager{
+55 -7
Ver Arquivo
@@ -1,42 +1,75 @@
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
namespace API;
/**
* Description of Get
* 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;
if(isset($dt['data']))
$dt['data']= '';
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'];
@@ -44,15 +77,30 @@ class Get{
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();
+53 -4
Ver Arquivo
@@ -1,16 +1,25 @@
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
namespace API;
/**
* Description of Get
* This class is a facade for methods to deal with Project's data.
*
* @author felipe
*/
class Project{
/**
* Opens and load a specific project.
* Retrurns the MindProject object of the opened project, of false in case of unsuccess.
*
* @param string $projectName
* @return MindProject|false
*/
public static function openProject($projectName)
{
if(!$projectData= \Mind::hasProject($projectName))
@@ -19,36 +28,76 @@
return self::current();
}
/**
* Retrieves the list of existing projects.
*
* @return Array
*/
public static function projectList()
{
return \MindProject::listProjects();
}
/**
* Returns the current project.
* @return MindProject|false
*/
public static function current()
{
return \Mind::$project? \Mind::$project:
false;
}
/**
* Returns an array with information about the current project.
* @return Array
*/
public static function data()
{
$dt= \Mind::$currentProject;
return $dt;
}
/**
*
* 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.
*
* @param boolean $decorated
* @return Array
*/
public static function getDDLCommand($decorated=true)
{
if($decorated)
return \API\Get::DecoratedDDL();
return \API\Get::DDL();
}
/**
* Verifies whether the project exists or not.
*
* @param string $projectName
* @return boolean
*/
public static function projectExists($projectName)
{
return \MindProject::projectExists($projectName);
}
/**
* Askes the core to analyze the current project.
*
* @return boolean
*/
public static function analyze()
{
return MindProject::analyze(false);
}
/**
* Gets an array with all the source code, for the current project.
* @return Array
*/
public static function source()
{
if(sizeof(\MindProject::$sourceContent) == 0)
+16 -5
Ver Arquivo
@@ -1,20 +1,31 @@
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
namespace API;
/**
* Description of User
* A facade class to deal with user's data.
*
* @author felipe
*/
class User{
/**
* Returns an array of all registered users.
* @return Array
*/
public static function usersList()
{
return \MindUser::listUsers();
}
/**
* Gets the list of projects in which the current user is registered to work in.
* @return Array
*/
public static function projectsList()
{
return \MindProject::projectsList();
+6 -1
Ver Arquivo
@@ -1,11 +1,16 @@
<?php
/**
/**
* This file is part of TheWebMind 3rd generation.
*
* This is the server file which will receive the requisition
* All the HTTP requests are goning to reach this file, so,
* it will treat the POST data before routing the requisition
* With this, you can send by post, the program variable, saying
* the program you want to execute, and the parameters you want
* to pass
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
header('Content-type: text/html; charset=utf-8');
if(!isset($_REQ))
+19 -8
Ver Arquivo
@@ -1,15 +1,26 @@
<?php
/**
*
* @author felipe
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
/**
* Interface to be implemented by Inflect classes, for each language.
* @interface
*/
interface inflection {
public static function isFemale($string);
/**
* Verifies if a word in in its singular form
*/
public static function isSingular($string);
/**
* Turns a word into its plural form
*/
public static function toPlural($string);
/**
* Turns a word into its singular form
*/
public static function toSingular($string);
public static function toFemale($string);
public static function toMale($string);
}
?>
}
+6 -5
Ver Arquivo
@@ -1,12 +1,13 @@
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
/**
*
* @interface Interface to be used by each Neron extended class.
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
*/
interface neuron {
+5 -3
Ver Arquivo
@@ -1,7 +1,9 @@
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
/**
+6
Ver Arquivo
@@ -1,4 +1,10 @@
<?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;
+6
Ver Arquivo
@@ -1,4 +1,10 @@
<?php
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
namespace en;
/**
* This class provides a list of instructtions
+6
Ver Arquivo
@@ -1,4 +1,10 @@
<?php
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
/*
Thanks to http://www.eval.ca/articles/php-toPlural (MIT license)
http://dev.rubyonrails.org/browser/trunk/activesupport/lib/active_support/inflections.rb (MIT license)
+6
Ver Arquivo
@@ -1,4 +1,10 @@
<?php
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
namespace en;
/**
* This class should identify verbs
+6
Ver Arquivo
@@ -1,4 +1,10 @@
<?php
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
namespace pt;
+6
Ver Arquivo
@@ -1,4 +1,10 @@
<?php
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
/*
Thanks to http://www.eval.ca/articles/php-toPlural (MIT license)
http://dev.rubyonrails.org/browser/trunk/activesupport/lib/active_support/inflections.rb (MIT license)
+6
Ver Arquivo
@@ -1,4 +1,10 @@
<?php
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
namespace pt;
/**
* This class should identify verbs
@@ -1,4 +1,10 @@
<?php
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
/*
* This is an example of plugin you may create
* This plugin simply runs when the program auth is
@@ -1,4 +1,10 @@
<?php
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
/*
* This is an example of plugin you may create
* This plugin simply runs when the program auth is
+6
Ver Arquivo
@@ -1,4 +1,10 @@
<?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;
+6
Ver Arquivo
@@ -1,4 +1,10 @@
<?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;
+6
Ver Arquivo
@@ -1,4 +1,10 @@
<?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;
+6 -5
Ver Arquivo
@@ -1,9 +1,10 @@
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
* 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;
+6
Ver Arquivo
@@ -1,4 +1,10 @@
<?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;
+6 -2
Ver Arquivo
@@ -1,11 +1,15 @@
<?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;
/**
* Description of Info
*
* @author felipe
*/
class Info extends MindCommand implements program
+6
Ver Arquivo
@@ -1,4 +1,10 @@
<?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;
+6 -2
Ver Arquivo
@@ -1,6 +1,10 @@
<?php
//use Mind\Command;
/**
* 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;
+6
Ver Arquivo
@@ -1,4 +1,10 @@
<?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;
+6
Ver Arquivo
@@ -1,4 +1,10 @@
<?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;
+6
Ver Arquivo
@@ -1,4 +1,10 @@
<?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;
+4 -1
Ver Arquivo
@@ -1,6 +1,9 @@
<?php
/**
* This file is part of theWebMind.org project
* 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,
+6
Ver Arquivo
@@ -1,4 +1,10 @@
<?php
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
// setting the general helperSet
$helperSet= false;
+12 -7
Ver Arquivo
@@ -1,11 +1,16 @@
<?php
/**
* This file corresponds to the bootstrap.
* Every requisition should pass here
* This file decides which environment will be used
* and also some permissions, starting some environmental
* variables, such as language for localization
*/
/**
* This file is part of TheWebMind 3rd generation.
*
* This file corresponds to the bootstrap.
* Every requisition should pass here
* This file decides which environment will be used
* and also some permissions, starting some environmental
* variables, such as language for localization
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
require(_MINDSRC_.'/mind3rd/API/utils/header.php');
include(_MINDSRC_.'/mind3rd/API/utils/constants.php');
+6
Ver Arquivo
@@ -1,4 +1,10 @@
<?php
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
require_once(_MINDSRC_.'/mind3rd/API/external/Symfony/Component/Console/Shell.php');
require_once(_MINDSRC_.'/mind3rd/API/external/Symfony/Component/Console/Application.php');
require_once(_MINDSRC_.'/mind3rd/API/external/Symfony/Component/Console/Command/Command.php');
+7 -2
Ver Arquivo
@@ -1,9 +1,14 @@
<?php
/**
/**
* This file is part of TheWebMind 3rd generation.
*
* This file is used to define constants that may be
* used on the system
* It will have the regular expression dictionary, mainly
*/
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
// REGULAR EXPRESSIONS
define('PROP_DETAILS', "/\(.*/");
+6
Ver Arquivo
@@ -1,4 +1,10 @@
<?php
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
session_start();
define('_CONSOLE_LINE_LENGTH_', 80);
require(_MINDSRC_.'/mind3rd/API/classes/Mind.php');
+6
Ver Arquivo
@@ -1,3 +1,9 @@
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
/*######################################################
# Generated by Mind 00:09 03/27/2011 #
# Generate PostgreSQL DataBase Commands #
+5
Ver Arquivo
@@ -1,3 +1,8 @@
; This file is part of TheWebMind 3rd generation.
;
; @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
; @license licenses/mind3rd.license
;
; This file presents info about the current version of the system
; the name references to the first and original name
name=theWebMind
+5
Ver Arquivo
@@ -1,3 +1,8 @@
; This file is part of TheWebMind 3rd generation.
;
; @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
; @license licenses/mind3rd.license
;
; this file can be changed as you wish
; it should represent your preferences about how mind should behave
;
+5
Ver Arquivo
@@ -1,3 +1,8 @@
; This file is part of TheWebMind 3rd generation.
;
; @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
; @license licenses/mind3rd.license
;
; This file describes options theWebMind will use
; to set up its own environment
;
+2 -1
Ver Arquivo
@@ -1,8 +1,9 @@
<?php
/**
* This file is part of thewebmind.org project.
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
/**
* Generic instructions to install the system.
+6
Ver Arquivo
@@ -1,4 +1,10 @@
<?php
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
if(!class_exists('Setup'))
require('Setup.php');
/**
+6
Ver Arquivo
@@ -1,4 +1,10 @@
<?php
/**
* This file is part of TheWebMind 3rd generation.
*
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
* @license licenses/mind3rd.license
*/
if(!class_exists('Setup'))
require('Setup.php');
/**