Renaming issues fixed, and also adding the Rest API class for the ActionsByEmail Enterprise Feature

This commit is contained in:
Gustavo Cruz
2015-02-18 17:31:53 -04:00
parent 550e7bcc06
commit 382d1a57a9
64 changed files with 261 additions and 2 deletions

View File

@@ -333,6 +333,26 @@ class WebApplication
}
}
// adding features extension api classes
$featuresPath = $this->workflowDir .'engine' . DS . 'classes' . 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' . "/*");
foreach ($featureApiClassList as $classFile) {
if (pathinfo($classFile, PATHINFO_EXTENSION) === 'php') {
$relClassPath = str_replace('.php', '', str_replace($servicesDir, '', $classFile));
$namespace = 'Features\\'.basename($classFile, '.php');
$namespace = strpos($namespace, "//") === false? $namespace: str_replace("//", '', $namespace);
require_once $classFile;
$this->rest->addAPIClass($namespace);
}
}
}
// adding aliases for Restler
if (array_key_exists('alias', $config)) {
foreach ($config['alias'] as $alias => $aliasData) {

View File

@@ -4,7 +4,6 @@
* Description of ActionsByEmailFeature
*
*/
namespace Features\ActionsByEnmail;
class ActionsByEmailFeature implements EnterpriseFeature
{

View File

@@ -0,0 +1,29 @@
<?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());
}
}
}

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