Added annotations for facade clases into the API package

Esse commit está contido em:
Felipe Nascimento de Moura
2011-04-24 21:40:32 -03:00
commit 436d5e7043
6 arquivos alterados com 141 adições e 28 exclusões
+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
@@ -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 {
+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();