From a6936ba9eb19da233de1030e6aa84bbbcebfaa23 Mon Sep 17 00:00:00 2001 From: brettp Date: Tue, 7 Dec 2010 01:10:50 +0000 Subject: Removed leading _ in private var names. git-svn-id: http://code.elgg.org/elgg/trunk@7551 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/classes/ElggPluginManifest.php | 28 ++++++------- engine/classes/ElggPluginPackage.php | 74 +++++++++++++++++------------------ 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/engine/classes/ElggPluginManifest.php b/engine/classes/ElggPluginManifest.php index 01dcd1046..801769eb9 100644 --- a/engine/classes/ElggPluginManifest.php +++ b/engine/classes/ElggPluginManifest.php @@ -25,7 +25,7 @@ class ElggPluginManifest { /** * The expected structure of a requires element */ - private $_depsRequiresStructPlugin = array( + private $depsRequiresStructPlugin = array( 'type' => '', 'name' => '', 'version' => '', @@ -35,7 +35,7 @@ class ElggPluginManifest { /* * The expected structure of elgg and elgg_release requires element */ - private $_depsRequiresStructElgg = array( + private $depsRequiresStructElgg = array( 'type' => '', 'version' => '', 'comparison' => 'ge' @@ -44,7 +44,7 @@ class ElggPluginManifest { /** * The expected structure of a requires php_ini dependency element */ - private $_depsRequiresStructPhpIni = array( + private $depsRequiresStructPhpIni = array( 'type' => '', 'name' => '', 'value' => '', @@ -54,7 +54,7 @@ class ElggPluginManifest { /** * The expected structure of a requires php_extension dependency element */ - private $_depsRequiresStructPhpExtension = array( + private $depsRequiresStructPhpExtension = array( 'type' => '', 'name' => '', 'version' => '', @@ -64,7 +64,7 @@ class ElggPluginManifest { /** * The expected structure of a conflicts depedency element */ - private $_depsConflictsStruct = array( + private $depsConflictsStruct = array( 'type' => '', 'name' => '', 'version' => '', @@ -74,7 +74,7 @@ class ElggPluginManifest { /** * The expected structure of a provides dependency element. */ - private $_depsProvidesStruct = array( + private $depsProvidesStruct = array( 'type' => '', 'name' => '', 'version' => '' @@ -83,7 +83,7 @@ class ElggPluginManifest { /** * The expected structure of a screenshot element */ - private $_screenshotStruct = array( + private $screenshotStruct = array( 'description' => '', 'path' => '' ); @@ -318,7 +318,7 @@ class ElggPluginManifest { $normalized = array(); foreach ($ss as $s) { - $normalized[] = $this->buildStruct($this->_screenshotStruct, $s); + $normalized[] = $this->buildStruct($this->screenshotStruct, $s); } return $normalized; @@ -347,7 +347,7 @@ class ElggPluginManifest { $normalized = array(); foreach ($provides as $provide) { - $normalized[] = $this->buildStruct($this->_depsProvidesStruct, $provide); + $normalized[] = $this->buildStruct($this->depsProvidesStruct, $provide); } return $normalized; @@ -385,19 +385,19 @@ class ElggPluginManifest { switch ($req['type']) { case 'elgg_version': case 'elgg_release': - $struct = $this->_depsRequiresStructElgg; + $struct = $this->depsRequiresStructElgg; break; case 'plugin': - $struct = $this->_depsRequiresStructPlugin; + $struct = $this->depsRequiresStructPlugin; break; case 'php_extension': - $struct = $this->_depsRequiresStructPhpExtension; + $struct = $this->depsRequiresStructPhpExtension; break; case 'php_ini': - $struct = $this->_depsRequiresStructPhpIni; + $struct = $this->depsRequiresStructPhpIni; // also normalize boolean values if (isset($req['value'])) { @@ -474,7 +474,7 @@ class ElggPluginManifest { $normalized = array(); foreach ($conflicts as $conflict) { - $normalized[] = $this->buildStruct($this->_depsConflictsStruct, $conflict); + $normalized[] = $this->buildStruct($this->depsConflictsStruct, $conflict); } return $normalized; diff --git a/engine/classes/ElggPluginPackage.php b/engine/classes/ElggPluginPackage.php index 8bb1f2a69..4a10da43d 100644 --- a/engine/classes/ElggPluginPackage.php +++ b/engine/classes/ElggPluginPackage.php @@ -23,7 +23,7 @@ class ElggPluginPackage { * * @var array */ - private $_requiredFiles = array( + private $requiredFiles = array( 'start.php', 'manifest.xml' ); @@ -32,7 +32,7 @@ class ElggPluginPackage { * * @var array */ - private $_providesSupportedTypes = array( + private $providesSupportedTypes = array( 'plugin', 'php_extension' ); @@ -41,19 +41,19 @@ class ElggPluginPackage { * * @var array */ - private $_depsSupportedTypes = array( + private $depsSupportedTypes = array( 'elgg_version', 'elgg_release', 'php_extension', 'php_ini', 'plugin' ); /** * An invalid plugin error. */ - private $_invalidPluginError = ''; + private $invalidPluginError = ''; /** * Any dependencies messages */ - private $_depsMsgs = array(); + private $depsMsgs = array(); /** * The plugin's manifest object @@ -118,9 +118,9 @@ class ElggPluginPackage { } if ($validate && !$this->isValid()) { - if ($this->_invalidPluginError) { + if ($this->invalidPluginError) { throw new PluginException(elgg_echo('PluginException:InvalidPlugin:Details', - array($plugin, $this->_invalidPluginError))); + array($plugin, $this->invalidPluginError))); } else { throw new PluginException(elgg_echo('PluginException:InvalidPlugin', array($plugin))); } @@ -155,10 +155,10 @@ class ElggPluginPackage { // check required files. $have_req_files = true; - foreach ($this->_requiredFiles as $file) { + foreach ($this->requiredFiles as $file) { if (!is_readable($this->path . $file)) { $have_req_files = false; - $this->_invalidPluginError = + $this->invalidPluginError = elgg_echo('ElggPluginPackage:InvalidPlugin:MissingFile', array($file)); break; } @@ -170,13 +170,13 @@ class ElggPluginPackage { } // check for valid manifest. - if (!$this->_loadManifest()) { + if (!$this->loadManifest()) { $valid = false; } // can't require or conflict with yourself or something you provide. // make sure provides are all valid. - if (!$this->_isSaneDeps()) { + if (!$this->isSaneDeps()) { $valid = false; } @@ -196,15 +196,15 @@ class ElggPluginPackage { * * @return bool */ - private function _isSaneDeps() { + private function isSaneDeps() { $conflicts = $this->getManifest()->getConflicts(); $requires = $this->getManifest()->getRequires(); $provides = $this->getManifest()->getProvides(); foreach ($provides as $provide) { // only valid provide types - if (!in_array($provide['type'], $this->_providesSupportedTypes)) { - $this->_invalidPluginError = + if (!in_array($provide['type'], $this->providesSupportedTypes)) { + $this->invalidPluginError = elgg_echo('ElggPluginPackage:InvalidPlugin:InvalidProvides', array($provide['type'])); return false; } @@ -213,8 +213,8 @@ class ElggPluginPackage { $name = $provide['name']; foreach (array('conflicts', 'requires') as $dep_type) { foreach (${$dep_type} as $dep) { - if (!in_array($dep['type'], $this->_depsSupportedTypes)) { - $this->_invalidPluginError = + if (!in_array($dep['type'], $this->depsSupportedTypes)) { + $this->invalidPluginError = elgg_echo('ElggPluginPackage:InvalidPlugin:InvalidDependency', array($dep['type'])); return false; } @@ -224,7 +224,7 @@ class ElggPluginPackage { $version_compare = version_compare($provide['version'], $dep['version'], $dep['comparison']); if ($version_compare) { - $this->_invalidPluginError = + $this->invalidPluginError = elgg_echo('ElggPluginPackage:InvalidPlugin:CircularDep', array($dep['type'], $dep['name'], $this->id)); @@ -260,7 +260,7 @@ class ElggPluginPackage { */ public function getManifest() { if (!$this->manifest) { - $this->_loadManifest(); + $this->loadManifest(); } return $this->manifest; @@ -272,7 +272,7 @@ class ElggPluginPackage { * * @return bool */ - private function _loadManifest() { + private function loadManifest() { $file = $this->path . 'manifest.xml'; $this->manifest = new ElggPluginManifest($file, $this->id); @@ -315,23 +315,23 @@ class ElggPluginPackage { foreach (${$dep_type} as $dep) { switch ($dep['type']) { case 'elgg_version': - $result = $this->_checkDepElgg($dep, get_version()); + $result = $this->checkDepElgg($dep, get_version()); break; case 'elgg_release': - $result = $this->_checkDepElgg($dep, get_version(true)); + $result = $this->checkDepElgg($dep, get_version(true)); break; case 'plugin': - $result = $this->_checkDepPlugin($dep, $enabled_plugins, $inverse); + $result = $this->checkDepPlugin($dep, $enabled_plugins, $inverse); break; case 'php_extension': - $result = $this->_checkDepPhpExtension($dep); + $result = $this->checkDepPhpExtension($dep); break; case 'php_ini': - $result = $this->_checkDepPhpIni($dep); + $result = $this->checkDepPhpIni($dep); break; } @@ -371,7 +371,7 @@ class ElggPluginPackage { * @param bool $inverse Inverse the results to use as a conflicts. * @return bool */ - private function _checkDepPlugin(array $dep, array $plugins, $inverse = false) { + private function checkDepPlugin(array $dep, array $plugins, $inverse = false) { $r = elgg_check_plugins_provides('plugin', $dep['name'], $dep['version'], $dep['comparison']); if ($inverse) { @@ -389,7 +389,7 @@ class ElggPluginPackage { * @param bool $inverse Inverse the result to use as a conflicts. * @return bool */ - private function _checkDepElgg(array $dep, $elgg_version, $inverse = false) { + private function checkDepElgg(array $dep, $elgg_version, $inverse = false) { $r = version_compare($elgg_version, $dep['version'], $dep['comparison']); if ($inverse) { @@ -407,7 +407,7 @@ class ElggPluginPackage { * @param array $dep An Elgg manifest.xml deps array * @return bool */ - private function _checkDepPhpExtension(array $dep) { + private function checkDepPhpExtension(array $dep) { $name = $dep['name']; $version = $dep['version']; $comparison = $dep['comparison']; @@ -436,7 +436,7 @@ class ElggPluginPackage { * @param array $dep An Elgg manifest.xml deps array * @return bool */ - private function _checkDepPhpIni($dep) { + private function checkDepPhpIni($dep) { $name = $dep['name']; $value = $dep['value']; $comparison = $dep['comparison']; @@ -487,23 +487,23 @@ class ElggPluginPackage { foreach ($requires as $require) { switch ($require['type']) { case 'elgg_version': - $result = $this->_checkRequiresElgg($require, get_version()); + $result = $this->checkRequiresElgg($require, get_version()); break; case 'elgg_release': - $result = $this->_checkRequiresElgg($require, get_version(true)); + $result = $this->checkRequiresElgg($require, get_version(true)); break; case 'plugin': - $result = $this->_checkDepsPlugin($require, $enabled_plugins); + $result = $this->checkDepsPlugin($require, $enabled_plugins); break; case 'php_extension': - $result = $this->_checkRequiresPhpExtension($require); + $result = $this->checkRequiresPhpExtension($require); break; case 'php_ini': - $result = $this->_checkRequiresPhpIni($require); + $result = $this->checkRequiresPhpIni($require); break; default: @@ -542,7 +542,7 @@ class ElggPluginPackage { * @param array $plugins A list of plugins as returned by get_installed_plugins(); * @return array */ - private function _checkRequiresPlugin(array $require, array $plugins = array()) { + private function checkRequiresPlugin(array $require, array $plugins = array()) { $status = true; $message = ''; @@ -613,7 +613,7 @@ class ElggPluginPackage { * @param array $elgg_version An Elgg version (either YYYYMMDDXX or X.Y.Z) * @return array */ - private function _checkRequiresElgg(array $require, $elgg_version) { + private function checkRequiresElgg(array $require, $elgg_version) { $status = true; $message = ''; $version = $require['version']; @@ -639,7 +639,7 @@ class ElggPluginPackage { * @param array $require An Elgg manifest.xml deps array * @return array */ - private function _checkRequiresPhpExtension($require) { + private function checkRequiresPhpExtension($require) { $status = true; $message = ''; @@ -702,7 +702,7 @@ class ElggPluginPackage { * @param array $require An Elgg manifest.xml requires array * @return array */ - private function _checkRequiresPhpIni($require) { + private function checkRequiresPhpIni($require) { $status = true; $message = ''; -- cgit v1.2.3