Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Code style: Single comments fix

  • Loading branch information...
commit 9e9d4d9197eeac18c5c1d001b071a1d21497a6be 1 parent b015d81
@elkuku elkuku authored
Showing with 370 additions and 220 deletions.
  1. +2 −2 build/phpcs/Joomla/Sniffs/Commenting/SingleCommentSniff.php
  2. +5 −3 libraries/joomla/application/application.php
  3. +5 −3 libraries/joomla/application/module/helper.php
  4. +2 −2 libraries/joomla/cache/cache.php
  5. +5 −3 libraries/joomla/cache/storage/memcache.php
  6. +3 −2 libraries/joomla/client/ldap.php
  7. +4 −3 libraries/joomla/database/database/sqlsrv.php
  8. +10 −3 libraries/joomla/database/table/content.php
  9. +5 −3 libraries/joomla/database/tablenested.php
  10. +6 −4 libraries/joomla/document/feed/renderer/rss.php
  11. +12 −8 libraries/joomla/environment/uri.php
  12. +6 −4 libraries/joomla/filesystem/file.php
  13. +6 −4 libraries/joomla/filesystem/path.php
  14. +5 −3 libraries/joomla/form/fields/category.php
  15. +6 −4 libraries/joomla/form/form.php
  16. +5 −3 libraries/joomla/form/helper.php
  17. +14 −9 libraries/joomla/form/rules/tel.php
  18. +6 −3 libraries/joomla/form/rules/url.php
  19. +7 −5 libraries/joomla/html/html/select.php
  20. +1 −1  libraries/joomla/html/toolbar.php
  21. +16 −11 libraries/joomla/installer/adapters/component.php
  22. +6 −4 libraries/joomla/installer/adapters/file.php
  23. +5 −3 libraries/joomla/installer/adapters/language.php
  24. +5 −3 libraries/joomla/installer/adapters/library.php
  25. +28 −18 libraries/joomla/installer/adapters/module.php
  26. +13 −7 libraries/joomla/installer/adapters/package.php
  27. +35 −21 libraries/joomla/installer/adapters/plugin.php
  28. +6 −4 libraries/joomla/installer/adapters/template.php
  29. +55 −37 libraries/joomla/installer/installer.php
  30. +38 −18 libraries/joomla/language/help.php
  31. +1 −0  libraries/joomla/language/language.php
  32. +1 −1  libraries/joomla/log/loggers/formattedtext.php
  33. +5 −3 libraries/joomla/mail/helper.php
  34. +5 −3 libraries/joomla/session/session.php
  35. +7 −4 libraries/joomla/string/string.php
  36. +8 −6 libraries/joomla/updater/adapters/collection.php
  37. +5 −2 libraries/joomla/updater/adapters/extension.php
  38. +6 −3 libraries/joomla/user/user.php
  39. +10 −0 libraries/platform.php
View
4 build/phpcs/Joomla/Sniffs/Commenting/SingleCommentSniff.php
@@ -31,7 +31,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
* Hash comments are not allowed.
*/
- if ($comment{0} === '#')
+ if (0 === strpos($comment, '#'))
{
$phpcsFile->addError('Hash comments are prohibited; found %s'
, $stackPtr, 'HashComment', array($comment));
@@ -135,7 +135,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
if($tokens[$nextNext]['line'] == $tokens[$next]['line'] + 1)
{
// Found 3 lines of // comments - too much.
- $phpcsFile->addWarning('Please consider the /* */ style for comments that span over multiple lines.'
+ $phpcsFile->addError('Please consider the /* */ style for comments that span over multiple lines.'
, $stackPtr, 'MultiLine');
return;
View
8 libraries/joomla/application/application.php
@@ -390,9 +390,11 @@ public function redirect($url, $msg = '', $msgType = 'message', $moved = false)
$url = preg_split("/[\r\n]/", $url);
$url = $url[0];
- // If we don't start with a http we need to fix this before we proceed.
- // We could validly start with something else (e.g. ftp), though this would
- // be unlikely and isn't supported by this API.
+ /*
+ * If we don't start with a http we need to fix this before we proceed.
+ * We could validly start with something else (e.g. ftp), though this would
+ * be unlikely and isn't supported by this API.
+ */
if (!preg_match('#^http#i', $url))
{
$uri = JURI::getInstance();
View
8 libraries/joomla/application/module/helper.php
@@ -370,9 +370,11 @@ protected static function &_load()
// Only accept modules without explicit exclusions.
if (!$negHit)
{
- // Determine if this is a 1.0 style custom module (no mod_ prefix)
- // This should be eliminated when the class is refactored.
- // $module->user is deprecated.
+ /*
+ * Determine if this is a 1.0 style custom module (no mod_ prefix)
+ * This should be eliminated when the class is refactored.
+ * $module->user is deprecated.
+ */
$file = $module->module;
$custom = substr($file, 0, 4) == 'mod_' ? 0 : 1;
$module->user = $custom;
View
4 libraries/joomla/cache/cache.php
@@ -9,10 +9,10 @@
defined('JPATH_PLATFORM') or die;
-//Register the storage class with the loader
+// Register the storage class with the loader
JLoader::register('JCacheStorage', __DIR__ . '/storage.php');
-//Register the controller class with the loader
+// Register the controller class with the loader
JLoader::register('JCacheController', __DIR__ . '/controller.php');
// Almost everything must be public here to allow overloading.
View
8 libraries/joomla/cache/storage/memcache.php
@@ -71,9 +71,11 @@ protected function getConnection()
$this->_persistent = $config->get('memcache_persist', true);
$this->_compress = $config->get('memcache_compress', false) == false ? 0 : MEMCACHE_COMPRESSED;
- // This will be an array of loveliness
- // @todo: multiple servers
- // $servers = (isset($params['servers'])) ? $params['servers'] : array();
+ /*
+ * This will be an array of loveliness
+ * @todo: multiple servers
+ * $servers = (isset($params['servers'])) ? $params['servers'] : array();
+ */
$server = array();
$server['host'] = $config->get('memcache_server_host', 'localhost');
$server['port'] = $config->get('memcache_server_port', 11211);
View
5 libraries/joomla/client/ldap.php
@@ -320,9 +320,10 @@ public function search($filters, $dnoverride = null, $attributes = array())
$firstentry = @ldap_next_entry($resource, $firstentry);
}
- $result_array = @ldap_get_attributes($resource, $firstentry); // load user-specified attributes
+ // Load user-specified attributes
+ $result_array = @ldap_get_attributes($resource, $firstentry);
- // ldap returns an array of arrays, fit this into attributes result array
+ // LDAP returns an array of arrays, fit this into attributes result array
foreach ($result_array as $ki => $ai)
{
if (is_array($ai))
View
7 libraries/joomla/database/database/sqlsrv.php
@@ -508,7 +508,7 @@ public function insertObject($table, &$object, $key = null)
}
if ($k[0] == '_')
{
- // internal field
+ // Internal field
continue;
}
if ($k == $key && $key == 0)
@@ -688,6 +688,7 @@ public function query()
public function replacePrefix($sql, $prefix = '#__')
{
$tablePrefix = 'jos_';
+
// Initialize variables.
$escaped = false;
$startPos = 0;
@@ -732,7 +733,7 @@ public function replacePrefix($sql, $prefix = '#__')
break;
}
- // quote comes first, find end of quote
+ // Quote comes first, find end of quote
while (true)
{
$k = strpos($sql, $quoteChar, $j);
@@ -756,7 +757,7 @@ public function replacePrefix($sql, $prefix = '#__')
}
if ($k === false)
{
- // error in the query - no end quote; ignore it
+ // Error in the query - no end quote; ignore it
break;
}
$literal .= substr($sql, $startPos, $k - $startPos + 1);
View
13 libraries/joomla/database/table/content.php
@@ -211,9 +211,16 @@ public function check()
if (!empty($this->metakey))
{
// Only process if not empty
- $bad_characters = array("\n", "\r", "\"", "<", ">"); // array of characters to remove
- $after_clean = JString::str_ireplace($bad_characters, "", $this->metakey); // remove bad characters
- $keys = explode(',', $after_clean); // create array using commas as delimiter
+
+ // Array of characters to remove
+ $bad_characters = array("\n", "\r", "\"", "<", ">");
+
+ // Remove bad characters
+ $after_clean = JString::str_ireplace($bad_characters, "", $this->metakey);
+
+ // Create array using commas as delimiter
+ $keys = explode(',', $after_clean);
+
$clean_keys = array();
foreach ($keys as $key)
View
8 libraries/joomla/database/tablenested.php
@@ -1349,9 +1349,11 @@ public function rebuild($parentId = null, $leftId = 0, $level = 0, $path = '')
// Execute this function recursively over all children
foreach ($children as $node)
{
- // $rightId is the current right value, which is incremented on recursion return.
- // Increment the level for the children.
- // Add this item's alias to the path (but avoid a leading /)
+ /*
+ * $rightId is the current right value, which is incremented on recursion return.
+ * Increment the level for the children.
+ * Add this item's alias to the path (but avoid a leading /)
+ */
$rightId = $this->rebuild($node->{$this->_tbl_key}, $rightId, $level + 1, $path . (empty($path) ? '' : '/') . $node->alias);
// If there is an update failure, return false to break out of the recursion.
View
10 libraries/joomla/document/feed/renderer/rss.php
@@ -182,12 +182,14 @@ public function render($name = '', $params = null, $content = null)
$feed .= " <author>"
. htmlspecialchars($data->items[$i]->authorEmail . ' (' . $data->items[$i]->author . ')', ENT_COMPAT, 'UTF-8') . "</author>\n";
}
+
/*
- // On hold
- if ($data->items[$i]->source!="") {
- $data.= " <source>".htmlspecialchars($data->items[$i]->source, ENT_COMPAT, 'UTF-8')."</source>\n";
- }
+ * @todo: On hold
+ * if ($data->items[$i]->source!="") {
+ * $data.= " <source>".htmlspecialchars($data->items[$i]->source, ENT_COMPAT, 'UTF-8')."</source>\n";
+ * }
*/
+
if (empty($data->items[$i]->category) === false)
{
if (is_array($data->items[$i]->category))
View
20 libraries/joomla/environment/uri.php
@@ -162,9 +162,11 @@ public static function getInstance($uri = 'SERVER')
$https = '://';
}
- // Since we are assigning the URI from the server variables, we first need
- // to determine if we are running on apache or IIS. If PHP_SELF and REQUEST_URI
- // are present, we will assume we are running on apache.
+ /*
+ * Since we are assigning the URI from the server variables, we first need
+ * to determine if we are running on apache or IIS. If PHP_SELF and REQUEST_URI
+ * are present, we will assume we are running on apache.
+ */
if (!empty($_SERVER['PHP_SELF']) && !empty($_SERVER['REQUEST_URI']))
{
@@ -174,11 +176,13 @@ public static function getInstance($uri = 'SERVER')
}
else
{
- // Since we do not have REQUEST_URI to work with, we will assume we are
- // running on IIS and will therefore need to work some magic with the SCRIPT_NAME and
- // QUERY_STRING environment variables.
-
- // IIS uses the SCRIPT_NAME variable instead of a REQUEST_URI variable... thanks, MS
+ /*
+ * Since we do not have REQUEST_URI to work with, we will assume we are
+ * running on IIS and will therefore need to work some magic with the SCRIPT_NAME and
+ * QUERY_STRING environment variables.
+ *
+ * IIS uses the SCRIPT_NAME variable instead of a REQUEST_URI variable... thanks, MS
+ */
$theURI = 'http' . $https . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];
// If the query string exists append it to the URI string
View
10 libraries/joomla/filesystem/file.php
@@ -348,10 +348,12 @@ public static function read($filename, $incpath = false, $amount = 0, $chunksize
{
$data = '';
- // While it's:
- // 1: Not the end of the file AND
- // 2a: No Max Amount set OR
- // 2b: The length of the data is less than the max amount we want
+ /*
+ * While it's:
+ * 1: Not the end of the file AND
+ * 2a: No Max Amount set OR
+ * 2b: The length of the data is less than the max amount we want
+ */
while (!feof($fh) && (!$amount || strlen($data) < $amount))
{
$data .= fread($fh, $chunksize);
View
10 libraries/joomla/filesystem/path.php
@@ -290,10 +290,12 @@ public static function find($paths, $file)
$fullname = realpath($fullname);
}
- // The substr() check added to make sure that the realpath()
- // results in a directory registered so that
- // non-registered directories are not accessible via directory
- // traversal attempts.
+ /*
+ * The substr() check added to make sure that the realpath()
+ * results in a directory registered so that
+ * non-registered directories are not accessible via directory
+ * traversal attempts.
+ */
if (file_exists($fullname) && substr($fullname, 0, strlen($path)) == $path)
{
return $fullname;
View
8 libraries/joomla/form/fields/category.php
@@ -69,9 +69,11 @@ protected function getOptions()
foreach ($options as $i => $option)
{
- // To take save or create in a category you need to have create rights for that category
- // unless the item is already in that category.
- // Unset the option if the user isn't authorised for it. In this field assets are always categories.
+ /*
+ * To take save or create in a category you need to have create rights for that category
+ * unless the item is already in that category.
+ * Unset the option if the user isn't authorised for it. In this field assets are always categories.
+ */
if ($user->authorise('core.create', $extension . '.category.' . $option->value) != true)
{
unset($options[$i]);
View
10 libraries/joomla/form/form.php
@@ -1703,10 +1703,12 @@ protected function loadField($element, $group = null, $value = null)
$field = $this->loadFieldType('text');
}
- // Get the value for the form field if not set.
- // Default to the translated version of the 'default' attribute
- // if 'translate_default' attribute if set to 'true' or '1'
- // else the value of the 'default' attribute for the field.
+ /*
+ * Get the value for the form field if not set.
+ * Default to the translated version of the 'default' attribute
+ * if 'translate_default' attribute if set to 'true' or '1'
+ * else the value of the 'default' attribute for the field.
+ */
if ($value === null)
{
$default = (string) $element['default'];
View
8 libraries/joomla/form/helper.php
@@ -291,9 +291,11 @@ protected static function addPath($entity, $new = null)
// we can do this simple pluralisation:
$entity_plural = $entity . 's';
- // But when someday we would want to support more entities, then we should consider adding
- // an inflector class to "libraries/joomla/utilities" and use it here (or somebody can use a real inflector in his subclass).
- // see also: pluralization snippet by Paul Osman in JControllerForm's constructor.
+ /*
+ * But when someday we would want to support more entities, then we should consider adding
+ * an inflector class to "libraries/joomla/utilities" and use it here (or somebody can use a real inflector in his subclass).
+ * See also: pluralization snippet by Paul Osman in JControllerForm's constructor.
+ */
$paths[] = __DIR__ . '/' . $entity_plural;
}
View
23 libraries/joomla/form/rules/tel.php
@@ -42,13 +42,16 @@ public function test(&$element, $value, $group = null, &$input = null, &$form =
{
return true;
}
- // @see http://www.nanpa.com/
- // @see http://tools.ietf.org/html/rfc4933
- // @see http://www.itu.int/rec/T-REC-E.164/en
- // Regex by Steve Levithan
- // @see http://blog.stevenlevithan.com/archives/validate-phone-number
- // @note that valid ITU-T and EPP must begin with +.
+ /*
+ * @see http://www.nanpa.com/
+ * @see http://tools.ietf.org/html/rfc4933
+ * @see http://www.itu.int/rec/T-REC-E.164/en
+ *
+ * Regex by Steve Levithan
+ * @see http://blog.stevenlevithan.com/archives/validate-phone-number
+ * @note that valid ITU-T and EPP must begin with +.
+ */
$regexarray = array('NANP' => '/^(?:\+?1[-. ]?)?\(?([2-9][0-8][0-9])\)?[-. ]?([2-9][0-9]{2})[-. ]?([0-9]{4})$/',
'ITU-T' => '/^\+(?:[0-9] ?){6,14}[0-9]$/', 'EPP' => '/^\+[0-9]{1,3}\.[0-9]{4,14}(?:x.+)?$/');
if (isset($element['plan']))
@@ -79,9 +82,11 @@ public function test(&$element, $value, $group = null, &$input = null, &$form =
}
else
{
- // If the rule is set but no plan is selected just check that there are between
- // 7 and 15 digits inclusive and no illegal characters (but common number separators
- // are allowed).
+ /*
+ * If the rule is set but no plan is selected just check that there are between
+ * 7 and 15 digits inclusive and no illegal characters (but common number separators
+ * are allowed).
+ */
$cleanvalue = preg_replace('/[+. -(\)]/', '', $value);
$regex = '/^[0-9]{7,15}?$/';
if (preg_match($regex, $cleanvalue) == true)
View
9 libraries/joomla/form/rules/url.php
@@ -58,9 +58,12 @@ public function test(&$element, $value, $group = null, &$input = null, &$form =
$scheme = explode(',', $element['schemes']);
}
- // This rule is only for full URLs with schemes because parse_url does not parse
- // accurately without a scheme.
- // @see http://php.net/manual/en/function.parse-url.php
+
+ /*
+ * This rule is only for full URLs with schemes because parse_url does not parse
+ * accurately without a scheme.
+ * @see http://php.net/manual/en/function.parse-url.php
+ */
if (!array_key_exists('scheme', $urlParts))
{
return false;
View
12 libraries/joomla/html/html/select.php
@@ -557,11 +557,13 @@ public static function options($arr, $optKey = 'value', $optText = 'text', $sele
$text = $element;
}
- // The use of options that contain optgroup HTML elements was
- // somewhat hacked for J1.5. J1.6 introduces the grouplist() method
- // to handle this better. The old solution is retained through the
- // "groups" option, which defaults true in J1.6, but should be
- // deprecated at some point in the future.
+ /*
+ * The use of options that contain optgroup HTML elements was
+ * somewhat hacked for J1.5. J1.6 introduces the grouplist() method
+ * to handle this better. The old solution is retained through the
+ * "groups" option, which defaults true in J1.6, but should be
+ * deprecated at some point in the future.
+ */
$key = (string) $key;
if ($options['groups'] && $key == '<OPTGROUP>')
View
2  libraries/joomla/html/toolbar.php
@@ -9,7 +9,7 @@
defined('JPATH_PLATFORM') or die;
-//Register the session storage class with the loader
+// Register the session storage class with the loader
JLoader::register('JButton', __DIR__ . '/toolbar/button.php');
/**
View
27 libraries/joomla/installer/adapters/component.php
@@ -210,9 +210,11 @@ public function install()
// Look for an update function or update tag
$updateElement = $this->manifest->update;
- // Upgrade manually set or
- // Update function available or
- // Update tag detected
+ /*
+ * Upgrade manually set or
+ * Update function available or
+ * Update tag detected
+ */
if ($this->parent->isUpgrade() || ($this->parent->manifestClass && method_exists($this->parent->manifestClass, 'update'))
|| $updateElement)
@@ -1773,14 +1775,17 @@ public function discover_install()
$msg = ob_get_contents();
ob_end_clean();
- // Normally we would copy files and create directories, lets skip to the optional files
- // Note: need to dereference things!
- // Parse optional tags
- // @todo remove code: $this->parent->parseMedia($this->manifest->media);
-
- // We don't do language because 1.6 suggests moving to extension based languages
- // @todo remove code: $this->parent->parseLanguages($this->manifest->languages);
- // @todo remove code: $this->parent->parseLanguages($this->manifest->administration->languages, 1);
+ /*
+ *
+ * Normally we would copy files and create directories, lets skip to the optional files
+ * Note: need to dereference things!
+ * Parse optional tags
+ * @todo remove code: $this->parent->parseMedia($this->manifest->media);
+ *
+ * We don't do language because 1.6 suggests moving to extension based languages
+ * @todo remove code: $this->parent->parseLanguages($this->manifest->languages);
+ * @todo remove code: $this->parent->parseLanguages($this->manifest->administration->languages, 1);
+ */
/**
* ---------------------------------------------------------------------------------------------
View
10 libraries/joomla/installer/adapters/file.php
@@ -192,10 +192,12 @@ public function install()
// Get a database connector object
$db = $this->parent->getDbo();
- // Check to see if a module by the same name is already installed
- // If it is, then update the table because if the files aren't there
- // we can assume that it was (badly) uninstalled
- // If it isn't, add an entry to extensions
+ /*
+ * Check to see if a module by the same name is already installed
+ * If it is, then update the table because if the files aren't there
+ * we can assume that it was (badly) uninstalled
+ * If it isn't, add an entry to extensions
+ */
$query = $db->getQuery(true);
$query->select($query->qn('extension_id'))
->from($query->qn('#__extensions'));
View
8 libraries/joomla/installer/adapters/language.php
@@ -180,9 +180,11 @@ protected function _install($cname, $basePath, $clientId, &$element)
// Look for an update function or update tag
$updateElement = $this->manifest->update;
- // Upgrade manually set or
- // Update function available or
- // Update tag detected
+ /*
+ * Upgrade manually set or
+ * Update function available or
+ * Update tag detected
+ */
if ($this->parent->isUpgrade() || ($this->parent->manifestClass && method_exists($this->parent->manifestClass, 'update'))
|| is_a($updateElement, 'JXMLElement'))
{
View
8 libraries/joomla/installer/adapters/library.php
@@ -131,9 +131,11 @@ public function install()
}
}
- // If we created the plugin directory and will want to remove it if we
- // have to roll back the installation, let's add it to the installation
- // step stack
+ /*
+ * If we created the plugin directory and will want to remove it if we
+ * have to roll back the installation, let's add it to the installation
+ * step stack
+ */
if ($created)
{
View
46 libraries/joomla/installer/adapters/module.php
@@ -205,10 +205,12 @@ public function install()
return false;
}
- // Check to see if a module by the same name is already installed
- // If it is, then update the table because if the files aren't there
- // we can assume that it was (badly) uninstalled
- // If it isn't, add an entry to extensions
+ /*
+ * Check to see if a module by the same name is already installed
+ * If it is, then update the table because if the files aren't there
+ * we can assume that it was (badly) uninstalled
+ * If it isn't, add an entry to extensions
+ */
$query = $db->getQuery(true);
$query->select($query->qn('extension_id'))->from($query->qn('#__extensions'));
$query->where($query->qn('element') . ' = ' . $query->q($element))->where($query->qn('client_id') . ' = ' . (int) $clientId);
@@ -229,20 +231,24 @@ public function install()
$id = $db->loadResult();
- // If the module directory already exists, then we will assume that the
- // module is already installed or another module is using that
- // directory.
- // Check that this is either an issue where its not overwriting or it is
- // set to upgrade anyway
+ /*
+ * If the module directory already exists, then we will assume that the
+ * module is already installed or another module is using that
+ * directory.
+ * Check that this is either an issue where its not overwriting or it is
+ * set to upgrade anyway
+ */
if (file_exists($this->parent->getPath('extension_root')) && (!$this->parent->isOverwrite() || $this->parent->isUpgrade()))
{
// Look for an update function or update tag
$updateElement = $this->manifest->update;
- // Upgrade manually set or
- // Update function available or
- // Update tag detected
+ /*
+ * Upgrade manually set or
+ * Update function available or
+ * Update tag detected
+ */
if ($this->parent->isUpgrade() || ($this->parent->manifestClass && method_exists($this->parent->manifestClass, 'update'))
|| is_a($updateElement, 'JXMLElement'))
{
@@ -343,9 +349,11 @@ public function install()
}
}
- // Since we created the module directory and will want to remove it if
- // we have to roll back the installation, let's add it to the
- // installation step stack
+ /*
+ * Since we created the module directory and will want to remove it if
+ * we have to roll back the installation, let's add it to the
+ * installation step stack
+ */
if ($created)
{
@@ -457,9 +465,11 @@ public function install()
$module->store();
}
- // Let's run the queries for the module
- // If Joomla 1.5 compatible, with discrete sql files, execute appropriate
- // file for utf-8 support or non-utf-8 support
+ /*
+ * Let's run the queries for the module
+ * If Joomla 1.5 compatible, with discrete sql files, execute appropriate
+ * file for utf-8 support or non-utf-8 support
+ */
// Try for Joomla 1.5 type queries
// Second argument is the utf compatible version attribute
View
20 libraries/joomla/installer/adapters/package.php
@@ -113,7 +113,7 @@ public function install()
if (is_file($manifestScriptFile))
{
- // load the file
+ // Load the file
include_once $manifestScriptFile;
}
@@ -122,15 +122,17 @@ public function install()
if (class_exists($classname))
{
- // create a new instance
+ // Create a new instance
$this->parent->manifestClass = new $classname($this);
- // and set this so we can copy it later
+
+ // And set this so we can copy it later
$this->set('manifest_script', $manifestScript);
+
// Note: if we don't find the class, don't bother to copy the file
}
}
- // run preflight if possible (since we know we're not an update)
+ // Run preflight if possible (since we know we're not an update)
ob_start();
ob_implicit_flush(false);
@@ -145,7 +147,8 @@ public function install()
}
}
- $msg = ob_get_contents(); // create msg object; first use here
+ // Create msg object; first use here
+ $msg = ob_get_contents();
ob_end_clean();
// Filesystem Processing Section
@@ -260,7 +263,8 @@ public function install()
}
}
- $msg .= ob_get_contents(); // append messages
+ // Append messages
+ $msg .= ob_get_contents();
ob_end_clean();
// Lastly, we will copy the manifest file to its appropriate place.
@@ -312,7 +316,8 @@ public function install()
$this->parent->manifestClass->postflight($this->route, $this, $results);
}
- $msg .= ob_get_contents(); // append messages
+ // Append messages
+ $msg .= ob_get_contents();
ob_end_clean();
if ($msg != '')
@@ -416,6 +421,7 @@ public function uninstall($id)
{
// Create a new instance
$this->parent->manifestClass = new $classname($this);
+
// And set this so we can copy it later
$this->set('manifest_script', $manifestScript);
View
56 libraries/joomla/installer/adapters/plugin.php
@@ -207,9 +207,11 @@ public function install()
{
$updateElement = $xml->update;
- // Upgrade manually set or
- // Update function available or
- // Update tag detected
+ /*
+ * Upgrade manually set or
+ * Update function available or
+ * Update tag detected
+ */
if ($this->parent->isUpgrade() || ($this->parent->manifestClass && method_exists($this->parent->manifestClass, 'update'))
|| is_a($updateElement, 'JXMLElement'))
{
@@ -321,9 +323,11 @@ public function install()
}
}
- // If we created the plugin directory and will want to remove it if we
- // have to roll back the installation, let's add it to the installation
- // step stack
+ /*
+ * If we created the plugin directory and will want to remove it if we
+ * have to roll back the installation, let's add it to the installation
+ * step stack
+ */
if ($created)
{
@@ -429,9 +433,11 @@ public function install()
$id = $row->extension_id;
}
- // Let's run the queries for the module
- // If Joomla 1.5 compatible, with discreet sql files - execute appropriate
- // file for utf-8 support or non-utf-8 support
+ /*
+ * Let's run the queries for the module
+ * If Joomla 1.5 compatible, with discreet sql files - execute appropriate
+ * file for utf-8 support or non-utf-8 support
+ */
// Try for Joomla 1.5 type queries
// Second argument is the utf compatible version attribute
@@ -584,9 +590,11 @@ public function uninstall($id)
$this->parent->setPath('extension_root', JPATH_PLUGINS . '/' . $row->folder);
}
- // Because 1.5 plugins don't have their own folders we cannot use the standard method of finding an installation manifest
- // Since 1.6 they do, however until we move to 1.7 and remove 1.6 legacy we still need to use this method.
- // When we get there it'll be something like "$this->parent->findManifest();$manifest = $this->parent->getManifest();"
+ /*
+ * Because 1.5 plugins don't have their own folders we cannot use the standard method of finding an installation manifest
+ * Since 1.6 they do, however until we move to 1.7 and remove 1.6 legacy we still need to use this method.
+ * When we get there it'll be something like "$this->parent->findManifest();$manifest = $this->parent->getManifest();"
+ */
$manifestFile = $this->parent->getPath('extension_root') . '/' . $row->element . '.xml';
if (!file_exists($manifestFile))
@@ -664,9 +672,11 @@ public function uninstall($id)
$msg = ob_get_contents();
ob_end_clean();
- // Let's run the queries for the module
- // If Joomla 1.5 compatible, with discreet sql files - execute appropriate
- // file for utf-8 support or non-utf-8 support
+ /*
+ * Let's run the queries for the module
+ * If Joomla 1.5 compatible, with discreet sql files - execute appropriate
+ * file for utf-8 support or non-utf-8 support
+ */
// Try for Joomla 1.5 type queries
// Second argument is the utf compatible version attribute
@@ -798,9 +808,11 @@ public function discover()
*/
public function discover_install()
{
- // Plugins use the extensions table as their primary store
- // Similar to modules and templates, rather easy
- // If it's not in the extensions table we just add it
+ /*
+ * Plugins use the extensions table as their primary store
+ * Similar to modules and templates, rather easy
+ * If it's not in the extensions table we just add it
+ */
$client = JApplicationHelper::getClientInfo($this->parent->extension->client_id);
if (is_dir($client->path . '/plugins/' . $this->parent->extension->folder . '/' . $this->parent->extension->element))
{
@@ -848,9 +860,11 @@ public function discover_install()
*/
public function refreshManifestCache()
{
- // Plugins use the extensions table as their primary store
- // Similar to modules and templates, rather easy
- // If it's not in the extensions table we just add it
+ /*
+ * Plugins use the extensions table as their primary store
+ * Similar to modules and templates, rather easy
+ * If it's not in the extensions table we just add it
+ */
$client = JApplicationHelper::getClientInfo($this->parent->extension->client_id);
$manifestPath = $client->path . '/plugins/' . $this->parent->extension->folder . '/' . $this->parent->extension->element . '/'
. $this->parent->extension->element . '.xml';
View
10 libraries/joomla/installer/adapters/template.php
@@ -120,14 +120,16 @@ public function install()
// Set the template root path
$this->parent->setPath('extension_root', $basePath . '/templates/' . $element);
- // if it's on the fs...
+ // If it's on the fs...
if (file_exists($this->parent->getPath('extension_root')) && (!$this->parent->isOverwrite() || $this->parent->isUpgrade()))
{
$updateElement = $xml->update;
- // Upgrade manually set or
- // Update function available or
- // Update tag detected
+ /*
+ * Upgrade manually set or
+ * Update function available or
+ * Update tag detected
+ */
if ($this->parent->isUpgrade() || ($this->parent->manifestClass && method_exists($this->parent->manifestClass, 'update'))
|| is_a($updateElement, 'JXMLElement'))
{
View
92 libraries/joomla/installer/installer.php
@@ -1180,13 +1180,15 @@ public function parseFiles($element, $cid = 0, $oldFiles = null, $oldMD5 = null)
$destination = $this->getPath($pathname);
}
- // Here we set the folder we are going to copy the files from.
-
- // Does the element have a folder attribute?
-
- // If so this indicates that the files are in a subdirectory of the source
- // folder and we should append the folder attribute to the source path when
- // copying files.
+ /*
+ * Here we set the folder we are going to copy the files from.
+ *
+ * Does the element have a folder attribute?
+ *
+ * If so this indicates that the files are in a subdirectory of the source
+ * folder and we should append the folder attribute to the source path when
+ * copying files.
+ */
$folder = (string) $element->attributes()->folder;
@@ -1238,9 +1240,11 @@ public function parseFiles($element, $cid = 0, $oldFiles = null, $oldMD5 = null)
// Is this path a file or folder?
$path['type'] = ($file->getName() == 'folder') ? 'folder' : 'file';
- // Before we can add a file to the copyfiles array we need to ensure
- // that the folder we are copying our file to exits and if it doesn't,
- // we need to create it.
+ /*
+ * Before we can add a file to the copyfiles array we need to ensure
+ * that the folder we are copying our file to exits and if it doesn't,
+ * we need to create it.
+ */
if (basename($path['dest']) != $path['dest'])
{
@@ -1291,13 +1295,15 @@ public function parseLanguages($element, $cid = 0)
$destination = $client->path . '/language';
- // Here we set the folder we are going to copy the files from.
-
- // Does the element have a folder attribute?
-
- // If so this indicates that the files are in a subdirectory of the source
- // folder and we should append the folder attribute to the source path when
- // copying files.
+ /*
+ * Here we set the folder we are going to copy the files from.
+ *
+ * Does the element have a folder attribute?
+ *
+ * If so this indicates that the files are in a subdirectory of the source
+ * folder and we should append the folder attribute to the source path when
+ * copying files.
+ */
$folder = (string) $element->attributes()->folder;
@@ -1313,9 +1319,11 @@ public function parseLanguages($element, $cid = 0)
// Process each file in the $files array (children of $tagName).
foreach ($element->children() as $file)
{
- // Language files go in a subfolder based on the language code, ie.
- // <language tag="en-US">en-US.mycomponent.ini</language>
- // would go in the en-US subdirectory of the language folder.
+ /*
+ * Language files go in a subfolder based on the language code, ie.
+ * <language tag="en-US">en-US.mycomponent.ini</language>
+ * would go in the en-US subdirectory of the language folder.
+ */
// We will only install language files where a core language pack
// already exists.
@@ -1348,9 +1356,11 @@ public function parseLanguages($element, $cid = 0)
$path['dest'] = $destination . '/' . $file;
}
- // Before we can add a file to the copyfiles array we need to ensure
- // that the folder we are copying our file to exits and if it doesn't,
- // we need to create it.
+ /*
+ * Before we can add a file to the copyfiles array we need to ensure
+ * that the folder we are copying our file to exits and if it doesn't,
+ * we need to create it.
+ */
if (basename($path['dest']) != $path['dest'])
{
@@ -1404,10 +1414,12 @@ public function parseMedia($element, $cid = 0)
// Here we set the folder we are going to copy the files from.
- // Does the element have a folder attribute?
- // If so this indicates that the files are in a subdirectory of the source
- // folder and we should append the folder attribute to the source path when
- // copying files.
+ /*
+ * Does the element have a folder attribute?
+ * If so this indicates that the files are in a subdirectory of the source
+ * folder and we should append the folder attribute to the source path when
+ * copying files.
+ */
$folder = (string) $element->attributes()->folder;
@@ -1429,9 +1441,11 @@ public function parseMedia($element, $cid = 0)
// Is this path a file or folder?
$path['type'] = ($file->getName() == 'folder') ? 'folder' : 'file';
- // Before we can add a file to the copyfiles array we need to ensure
- // that the folder we are copying our file to exits and if it doesn't,
- // we need to create it.
+ /*
+ * Before we can add a file to the copyfiles array we need to ensure
+ * that the folder we are copying our file to exits and if it doesn't,
+ * we need to create it.
+ */
if (basename($path['dest']) != $path['dest'])
{
@@ -1519,9 +1533,11 @@ public function getParams()
*/
public function copyFiles($files, $overwrite = null)
{
- // To allow for manual override on the overwriting flag, we check to see if
- // the $overwrite flag was set and is a boolean value. If not, use the object
- // allowOverwrite flag.
+ /*
+ * To allow for manual override on the overwriting flag, we check to see if
+ * the $overwrite flag was set and is a boolean value. If not, use the object
+ * allowOverwrite flag.
+ */
if (is_null($overwrite) || !is_bool($overwrite))
{
@@ -1723,10 +1739,12 @@ public function removeFiles($element, $cid = 0)
// Process each file in the $files array (children of $tagName).
foreach ($files as $file)
{
- // If the file is a language, we must handle it differently. Language files
- // go in a subdirectory based on the language code, ie.
- // <language tag="en_US">en_US.mycomponent.ini</language>
- // would go in the en_US subdirectory of the languages directory.
+ /*
+ * If the file is a language, we must handle it differently. Language files
+ * go in a subdirectory based on the language code, ie.
+ * <language tag="en_US">en_US.mycomponent.ini</language>
+ * would go in the en_US subdirectory of the languages directory.
+ */
if ($file->getName() == 'language' && (string) $file->attributes()->tag != '')
{
View
56 libraries/joomla/language/help.php
@@ -103,26 +103,46 @@ public static function createURL($ref, $useComponent = false, $override = null,
$lang->setDebug($debug);
// Replace substitution codes in help URL.
- $search = array('{app}', // Application name (eg. 'Administrator')
- '{component}', // Component name (eg. 'com_content')
- '{keyref}', // Help screen key reference
- '{language}', // Full language code (eg. 'en-GB')
- '{langcode}', // Short language code (eg. 'en')
- '{langregion}', // Region code (eg. 'GB')
- '{major}', // Joomla major version number
- '{minor}', // Joomla minor version number
- '{maintenance}'// Joomla maintenance version number
+ $search = array(
+ // Application name (eg. 'Administrator')
+ '{app}',
+ // Component name (eg. 'com_content')
+ '{component}',
+ // Help screen key reference
+ '{keyref}',
+ // Full language code (eg. 'en-GB')
+ '{language}',
+ // Short language code (eg. 'en')
+ '{langcode}',
+ // Region code (eg. 'GB')
+ '{langregion}',
+ // Joomla major version number
+ '{major}',
+ // Joomla minor version number
+ '{minor}',
+ // Joomla maintenance version number
+ '{maintenance}'
);
- $replace = array($app->getName(), // {app}
- $component, // {component}
- $keyref, // {keyref}
- $lang->getTag(), // {language}
- $jlang[0], // {langcode}
- $jlang[1], // {langregion}
- $jver[0], // {major}
- $jver[1], // {minor}
- $jver[2]// {maintenance}
+ $replace = array(
+ // {app}
+ $app->getName(),
+ // {component}
+ $component,
+ // {keyref}
+ $keyref,
+ // {language}
+ $lang->getTag(),
+ // {langcode}
+ $jlang[0],
+ // {langregion}
+ $jlang[1],
+ // {major}
+ $jver[0],
+ // {minor}
+ $jver[1],
+ // {maintenance}
+ $jver[2]
);
// If the help file is local then check it exists.
View
1  libraries/joomla/language/language.php
@@ -871,6 +871,7 @@ protected function parse($filename)
while (!$stream->eof())
{
$line = $stream->gets();
+
// Avoid BOM error as BOM is OK when using parse_ini
if ($lineNumber == 0)
{
View
2  libraries/joomla/log/loggers/formattedtext.php
@@ -203,7 +203,7 @@ protected function generateFileHeader()
// If the no php flag is not set add the php die statement.
if (empty($this->options['text_file_no_php']))
{
- // blank line to prevent information disclose: https://bugs.php.net/bug.php?id=60677
+ // Blank line to prevent information disclose: https://bugs.php.net/bug.php?id=60677
$head[] = '#';
$head[] = '#<?php die(\'Forbidden.\'); ?>';
}
View
8 libraries/joomla/mail/helper.php
@@ -119,9 +119,11 @@ public static function isEmailAddress($email)
return false;
}
- // Check the local address
- // We're a bit more conservative about what constitutes a "legal" address, that is, A-Za-z0-9!#$%&\'*+/=?^_`{|}~-
- // Also, the last character in local cannot be a period ('.')
+ /*
+ * Check the local address
+ * We're a bit more conservative about what constitutes a "legal" address, that is, A-Za-z0-9!#$%&\'*+/=?^_`{|}~-
+ * Also, the last character in local cannot be a period ('.')
+ */
$allowed = 'A-Za-z0-9!#&*+=?_-';
$regex = "/^[$allowed][\.$allowed]{0,63}$/";
if (!preg_match($regex, $local) || substr($local, -1) == '.')
View
8 libraries/joomla/session/session.php
@@ -517,9 +517,11 @@ public function destroy()
return true;
}
- // In order to kill the session altogether, such as to log the user out, the session id
- // must also be unset. If a cookie is used to propagate the session id (default behavior),
- // then the session cookie must be deleted.
+ /*
+ * In order to kill the session altogether, such as to log the user out, the session id
+ * must also be unset. If a cookie is used to propagate the session id (default behavior),
+ * then the session cookie must be deleted.
+ */
if (isset($_COOKIE[session_name()]))
{
$config = JFactory::getConfig();
View
11 libraries/joomla/string/string.php
@@ -903,10 +903,13 @@ public static function compliant($str)
{
return true;
}
- // If even just the first character can be matched, when the /u
- // modifier is used, then it's valid UTF-8. If the UTF-8 is somehow
- // invalid, nothing at all will match, even if the string contains
- // some valid sequences
+
+ /*
+ * If even just the first character can be matched, when the /u
+ * modifier is used, then it's valid UTF-8. If the UTF-8 is somehow
+ * invalid, nothing at all will match, even if the string contains
+ * some valid sequences
+ */
return (preg_match('/^.{1}/us', $str, $ar) == 1);
}
View
14 libraries/joomla/updater/adapters/collection.php
@@ -143,12 +143,14 @@ public function _startElement($parser, $name, $attrs = array())
// Lower case and remove the exclamation mark
$product = strtolower(JFilterInput::getInstance()->clean($ver->PRODUCT, 'cmd'));
- // Set defaults, the extension file should clarify in case but it may be only available in one version
- // This allows an update site to specify a targetplatform
- // targetplatformversion can be a regexp, so 1.[56] would be valid for an extension that supports 1.5 and 1.6
- // Note: Whilst the version is a regexp here, the targetplatform is not (new extension per platform)
- // Additionally, the version is a regexp here and it may also be in an extension file if the extension is
- // compatible against multiple versions of the same platform (e.g. a library)
+ /*
+ * Set defaults, the extension file should clarify in case but it may be only available in one version
+ * This allows an update site to specify a targetplatform
+ * targetplatformversion can be a regexp, so 1.[56] would be valid for an extension that supports 1.5 and 1.6
+ * Note: Whilst the version is a regexp here, the targetplatform is not (new extension per platform)
+ * Additionally, the version is a regexp here and it may also be in an extension file if the extension is
+ * compatible against multiple versions of the same platform (e.g. a library)
+ */
if (!isset($values['targetplatform']))
{
$values['targetplatform'] = $product;
View
7 libraries/joomla/updater/adapters/extension.php
@@ -127,8 +127,11 @@ protected function _endElement($parser, $name)
protected function _characterData($parser, $data)
{
$tag = $this->_getLastTag();
- //if(!isset($this->$tag->_data)) $this->$tag->_data = '';
- //$this->$tag->_data .= $data;
+ /**
+ * @todo remove code
+ * if(!isset($this->$tag->_data)) $this->$tag->_data = '';
+ * $this->$tag->_data .= $data;
+ */
if (in_array($tag, $this->_updatecols))
{
$tag = strtolower($tag);
View
9 libraries/joomla/user/user.php
@@ -450,6 +450,7 @@ public function getParameters($loadsetupfile = false, $path = null)
JLog::add('JUser::getParameters() is deprecated.', JLog::WARNING, 'deprecated');
return $this->_params;
+
// @codeCoverageIgnoreEnd
}
@@ -799,9 +800,11 @@ public function load($id)
return false;
}
- // Set the user parameters using the default XML file. We might want to
- // extend this in the future to allow for the ability to have custom
- // user parameters, but for right now we'll leave it how it is.
+ /*
+ * Set the user parameters using the default XML file. We might want to
+ * extend this in the future to allow for the ability to have custom
+ * user parameters, but for right now we'll leave it how it is.
+ */
$this->_params->loadString($table->params);
View
10 libraries/platform.php
@@ -18,24 +18,34 @@
{
// Product name.
const PRODUCT = 'Joomla Platform';
+
// Release version.
const RELEASE = '11.4';
+
// Maintenance version.
const MAINTENANCE = '0';
+
// Development STATUS.
const STATUS = 'Stable';
+
// Build number.
const BUILD = 0;
+
// Code name.
const CODE_NAME = 'Brian Kernighan';
+
// Release date.
const RELEASE_DATE = '03-Jan-2012';
+
// Release time.
const RELEASE_TIME = '00:00';
+
// Release timezone.
const RELEASE_TIME_ZONE = 'GMT';
+
// Copyright Notice.
const COPYRIGHT = 'Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.';
+
// Link text.
const LINK_TEXT = '<a href="http://www.joomla.org">Joomla!</a> is Free Software released under the GNU General Public License.';
Please sign in to comment.
Something went wrong with that request. Please try again.