Moving features folders, enabling the ActionsByEmail rest api endpoints

This commit is contained in:
Gustavo Cruz
2015-02-19 17:54:54 -04:00
parent 382d1a57a9
commit c7a7736edf
75 changed files with 607 additions and 43 deletions

View File

@@ -328,24 +328,24 @@ class WebApplication
//if (! class_exists($namespace)) {
require_once $classFile;
//}
//echo "****".$namespace."<br>";
$this->rest->addAPIClass($namespace);
}
}
// adding features extension api classes
$featuresPath = $this->workflowDir .'engine' . DS . 'classes' . DS . 'features';
$featuresPath = $this->workflowDir .'engine' . DS . 'features';
// $apiDir - contains directory to scan classes and add them to Restler
$featureDirList = glob($featuresPath . "/*", GLOB_ONLYDIR);
foreach ($featureDirList as $directory) {
if ($directory == 'ViewContainers') {
continue;
}
$featureApiClassList = Util\Common::rglob($directory . DS . 'api' . "/*");
$featureApiClassList = Util\Common::rglob($directory . DS . 'Services' . DS . 'Api' . "/*");
foreach ($featureApiClassList as $classFile) {
if (pathinfo($classFile, PATHINFO_EXTENSION) === 'php') {
$relClassPath = str_replace('.php', '', str_replace($servicesDir, '', $classFile));
$namespace = 'Features\\'.basename($classFile, '.php');
$namespace = '\\ProcessMaker\\Services\\Api\\'.basename($classFile, '.php');
$namespace = strpos($namespace, "//") === false? $namespace: str_replace("//", '', $namespace);
require_once $classFile;
$this->rest->addAPIClass($namespace);
@@ -430,6 +430,7 @@ class WebApplication
define("PATH_XMLFORM", PATH_CORE . "xmlform" . PATH_SEP);
define("PATH_CONFIG", PATH_CORE . "config" . PATH_SEP);
define("PATH_PLUGINS", PATH_CORE . "plugins" . PATH_SEP);
define("PATH_FEATURES", PATH_CORE . "features" . PATH_SEP);
define("PATH_HTMLMAIL", PATH_CORE . "html_templates" . PATH_SEP);
define("PATH_TPL", PATH_CORE . "templates" . PATH_SEP);
define("PATH_TEST", PATH_CORE . "test" . PATH_SEP);

View File

@@ -50,6 +50,7 @@
define( 'PATH_METHODS', PATH_CORE . 'methods' . PATH_SEP );
define( 'PATH_XMLFORM', PATH_CORE . 'xmlform' . PATH_SEP );
define( 'PATH_PLUGINS', PATH_CORE . 'plugins' . PATH_SEP );
define( 'PATH_FEATURES', PATH_CORE . 'features' . PATH_SEP );
define( 'PATH_HTMLMAIL', PATH_CORE . 'html_templates' . PATH_SEP );
define( 'PATH_TPL', PATH_CORE . 'templates' . PATH_SEP );
define( 'PATH_TEST', PATH_CORE . 'test' . PATH_SEP );

View File

@@ -1,29 +0,0 @@
<?php
namespace Features\ActionsByEmail;
use Luracast\Restler\RestException;
use ProcessMaker\Services\Api;
/**
* Class Project
*
* @package Features\ActionsByEmail
* @author gustavo cruz <gustavo.cruz@colosa.com>
* @protected
*/
class ActionsByEmail extends Api
{
/**
* @url GET
*/
public function getABEList()
{
try {
$projects = array('status' => 200, 'message' => 'Hello');
return $projects;
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
}

View File

@@ -38,7 +38,7 @@ class Installer extends Controller
public function index ($httpData)
{
if ((strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') && (file_exists($this->path_shared . 'partner.info'))){
if ((strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') && (file_exists($this->path_shared . 'partner.info'))) {
$this->includeExtJS( 'installer/stopInstall');
$this->setView( 'installer/mainStopInstall' );
G::RenderPage( 'publish', 'extJs' );
@@ -776,12 +776,14 @@ class Installer extends Controller
$this->mysqlFileQuery( PATH_RBAC_HOME . 'engine/data/mysql/schema.sql' );
$this->mysqlFileQuery( PATH_RBAC_HOME . 'engine/data/mysql/insert.sql' );
$query = sprintf( "USE %s;", $wf_workpace );
$this->mysqlQuery( $query );
$this->mysqlFileQuery( PATH_HOME . 'engine/data/mysql/schema.sql' );
$this->mysqlFileQuery( PATH_HOME . 'engine/data/mysql/insert.sql' );
$this->createMysqlFeatures();
if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) {
$this->setPartner();
//$this->setConfiguration();
@@ -1624,5 +1626,31 @@ class Installer extends Controller
}
}
}
public function createMysqlFeatures()
{
foreach ($this->getFeatureList() as $feature) {
$this->mysqlFileQuery( $feature->path . '/data/schema.sql' );
$this->mysqlFileQuery( $feature->path . '/data/insert.sql' );
}
}
public function getFeatureList()
{
$invalidFolders = array('ViewContainers');
$featuresFolders = glob(PATH_FEATURES.'/*', GLOB_ONLYDIR);
$features = array();
foreach ($featuresFolders as $directory) {
$feature = new stdClass();
if (in_array($directory, $invalidFolders)) {
continue;
}
$feature->path = PATH_FEATURES . PATH_SEP . $directory;
$feature->name = $directory;
$features[] = $feature;
}
return $features;
}
}

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More