From 71d0a3965985fbe07312d02f573896f64c63d7fe Mon Sep 17 00:00:00 2001 From: Ronald Quenta Date: Mon, 14 Aug 2017 16:49:53 -0400 Subject: [PATCH] camel case --- storage/logs/processmaker-2017-08-14.log | 5 +++ .../ProcessMaker/Plugins/PluginRegistry.php | 26 +++++++------- workflow/engine/src/ProcessMaker/Util/Cnn.php | 36 +++++++++---------- 3 files changed, 36 insertions(+), 31 deletions(-) create mode 100644 storage/logs/processmaker-2017-08-14.log diff --git a/storage/logs/processmaker-2017-08-14.log b/storage/logs/processmaker-2017-08-14.log new file mode 100644 index 000000000..89c711a90 --- /dev/null +++ b/storage/logs/processmaker-2017-08-14.log @@ -0,0 +1,5 @@ +[2017-08-14 19:51:02] production.ERROR: exception 'pakeException' with message 'Task "create-plugin" is not defined.' in /home/ronald/Projets/html/3.2.2/thirdparty/pake/pakeApp.class.php:167 +Stack trace: +#0 /home/ronald/Projets/html/3.2.2/gulliver/bin/gulliver.php(39): pakeApp->run(NULL, NULL, false) +#1 /home/ronald/Projets/html/3.2-current/gulliver/bin/gulliver(64): include('/home/ronald/Pr...') +#2 {main} diff --git a/workflow/engine/src/ProcessMaker/Plugins/PluginRegistry.php b/workflow/engine/src/ProcessMaker/Plugins/PluginRegistry.php index 934e6914b..763f4df45 100644 --- a/workflow/engine/src/ProcessMaker/Plugins/PluginRegistry.php +++ b/workflow/engine/src/ProcessMaker/Plugins/PluginRegistry.php @@ -124,15 +124,15 @@ class PluginRegistry /** * Unregister the plugin in the class - * @param string $Namespace Name Plugin + * @param string $namespace Name Plugin * @return PluginDetail */ - public function unregisterPlugin($Namespace) + public function unregisterPlugin($namespace) { $detail = null; - if (isset($this->_aPluginDetails[$Namespace])) { - $detail = $this->_aPluginDetails[$Namespace]; - unset($this->_aPluginDetails[$Namespace]); + if (isset($this->_aPluginDetails[$namespace])) { + $detail = $this->_aPluginDetails[$namespace]; + unset($this->_aPluginDetails[$namespace]); } return $detail; } @@ -1378,15 +1378,15 @@ class PluginRegistry /** * Update the plugin attributes in all workspaces - * @param string $Workspace Name workspace - * @param string $Namespace Name of Plugin + * @param string $workspace Name workspace + * @param string $namespace Name of Plugin * @throws Exception */ - public function updatePluginAttributesInAllWorkspaces($Workspace, $Namespace) + public function updatePluginAttributesInAllWorkspaces($workspace, $namespace) { try { //Set variables - $pluginFileName = $Namespace . ".php"; + $pluginFileName = $namespace . ".php"; //Verify data if (!file_exists(PATH_PLUGINS . $pluginFileName)) { @@ -1395,15 +1395,15 @@ class PluginRegistry //remove old data plugin $pmPluginRegistry = PluginRegistry::loadSingleton(); - $pluginDetails = $pmPluginRegistry->unregisterPlugin($Namespace); + $pluginDetails = $pmPluginRegistry->unregisterPlugin($namespace); //Load plugin attributes require_once(PATH_PLUGINS . $pluginFileName); - if (is_array($pluginDetails->getWorkspaces()) && !in_array($Workspace, $pluginDetails->getWorkspaces())) { - $pmPluginRegistry->disablePlugin($Namespace); + if (is_array($pluginDetails->getWorkspaces()) && !in_array($workspace, $pluginDetails->getWorkspaces())) { + $pmPluginRegistry->disablePlugin($namespace); } - $pmPluginRegistry->savePlugin($Namespace); + $pmPluginRegistry->savePlugin($namespace); } catch (Exception $e) { throw $e; } diff --git a/workflow/engine/src/ProcessMaker/Util/Cnn.php b/workflow/engine/src/ProcessMaker/Util/Cnn.php index bf13cd3f5..ca08710b9 100644 --- a/workflow/engine/src/ProcessMaker/Util/Cnn.php +++ b/workflow/engine/src/ProcessMaker/Util/Cnn.php @@ -10,17 +10,17 @@ use Propel; */ class Cnn { - private $DBFile; - private $Workspace; + private $dbFile; + private $workspace; /** * Establishes connection for the workspace - * @param string $Workspace Name workspace + * @param string $workspace Name workspace */ - public static function connect($Workspace) + public static function connect($workspace) { $cnn = new static(); - $cnn->Workspace = $Workspace; + $cnn->workspace = $workspace; Propel::initConfiguration($cnn->buildParams()); } @@ -42,8 +42,8 @@ class Cnn */ private function readFileDBWorkspace() { - if (file_exists(PATH_DB . $this->Workspace . PATH_SEP . 'db.php')) { - $this->DBFile = file_get_contents(PATH_DB . $this->Workspace . PATH_SEP . 'db.php'); + if (file_exists(PATH_DB . $this->workspace . PATH_SEP . 'db.php')) { + $this->dbFile = file_get_contents(PATH_DB . $this->workspace . PATH_SEP . 'db.php'); return true; } return false; @@ -58,7 +58,7 @@ class Cnn $phpCode = preg_replace( '/define\s*\(\s*[\x22\x27](.*)[\x22\x27]\s*,\s*(\x22.*\x22|\x27.*\x27)\s*\)\s*;/i', '$$1 = $2;', - $this->DBFile + $this->dbFile ); $phpCode = str_replace([''], '', $phpCode); @@ -102,21 +102,21 @@ class Cnn /** * Builds the DSN string to be used by PROPEL - * @param string $Adapter - * @param string $Host - * @param string $Name - * @param string $User - * @param string $Pass + * @param string $adapter + * @param string $host + * @param string $name + * @param string $user + * @param string $pass * @return string */ - private function buildDsnString($Adapter, $Host, $Name, $User, $Pass) + private function buildDsnString($adapter, $host, $name, $user, $pass) { - $Dsn = $Adapter . "://" . $User . ":" . $Pass . "@" . $Host . "/" . $Name; - switch ($Adapter) { + $dns = $adapter . "://" . $user . ":" . $pass . "@" . $host . "/" . $name; + switch ($adapter) { case 'mysql': - $Dsn .= '?encoding=utf8'; + $dns .= '?encoding=utf8'; break; } - return $Dsn; + return $dns; } }