This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merge remote branch 'joomla/master' into sniff-single-comment

Conflicts:
	libraries/joomla/base/object.php
	libraries/joomla/cache/cache.php
	libraries/joomla/database/database/sqlsrv.php
	libraries/joomla/database/table/session.php
	libraries/joomla/filesystem/folder.php
	libraries/joomla/filesystem/stream.php
	libraries/joomla/form/helper.php
	libraries/joomla/html/parameter/element.php
	libraries/joomla/html/parameter/element/editors.php
	libraries/joomla/html/parameter/element/filelist.php
	libraries/joomla/html/parameter/element/menuitem.php
	libraries/joomla/html/parameter/element/textarea.php
	libraries/joomla/html/parameter/element/usergroup.php
	libraries/joomla/html/toolbar.php
	libraries/joomla/installer/adapters/template.php
	libraries/joomla/registry/registry.php
	libraries/joomla/utilities/date.php
	libraries/joomla/utilities/simplexml.php
  • Loading branch information...
elkuku committed Jan 23, 2012
2 parents 371c471 + 78aeaf7 commit b015d81100733df6da21c8cee82a3d53050596ce
Showing with 5,083 additions and 8,910 deletions.
  1. +1 −1 build/changelog.php
  2. 0 libraries/{joomla/form/fields → cms/form/field}/helpsite.php
  3. +1 −1 libraries/{joomla/form/fields → cms/form/field}/media.php
  4. +5 −25 libraries/import.php
  5. +25 −17 libraries/joomla/application/application.php
  6. +1 −1 libraries/joomla/application/categories.php
  7. +6 −6 libraries/joomla/application/cli/daemon.php
  8. +0 −57 libraries/joomla/application/component/controller.php
  9. +9 −9 libraries/joomla/application/component/helper.php
  10. +11 −11 libraries/joomla/application/daemon.php
  11. +1 −1 libraries/joomla/application/helper.php
  12. +1 −1 libraries/joomla/application/input.php
  13. +1 −1 libraries/joomla/application/web.php
  14. +0 −20 libraries/joomla/base/object.php
  15. +1 −1 libraries/joomla/base/observable.php
  16. +6 −6 libraries/joomla/cache/cache.php
  17. +2 −2 libraries/joomla/cache/storage/file.php
  18. +5 −229 libraries/joomla/database/database.php
  19. +3 −129 libraries/joomla/database/database/mysql.php
  20. +4 −71 libraries/joomla/database/database/mysqli.php
  21. +1 −1 libraries/joomla/database/database/mysqliexporter.php
  22. +1 −1 libraries/joomla/database/database/mysqliimporter.php
  23. +1 −1 libraries/joomla/database/database/mysqliquery.php
  24. +2 −2 libraries/joomla/database/database/sqlazure.php
  25. +4 −140 libraries/joomla/database/database/sqlsrv.php
  26. +1 −134 libraries/joomla/database/table.php
  27. +0 −38 libraries/joomla/database/table/content.php
  28. +0 −7 libraries/joomla/database/table/session.php
  29. +4 −4 libraries/joomla/document/document.php
  30. +1 −1 libraries/joomla/document/opensearch/opensearch.php
  31. +0 −55 libraries/joomla/environment/request.php
  32. +6 −157 libraries/joomla/factory.php
  33. +1 −1 libraries/joomla/filesystem/archive.php
  34. +0 −1 libraries/joomla/filesystem/folder.php
  35. +1 −1 libraries/joomla/filesystem/helper.php
  36. +1 −1 libraries/joomla/filesystem/path.php
  37. +15 −62 libraries/joomla/filesystem/stream.php
  38. +0 −80 libraries/joomla/form/fields/editors.php
  39. +2 −2 libraries/joomla/form/helper.php
  40. +0 −19 libraries/joomla/html/html/behavior.php
  41. +0 −49 libraries/joomla/html/html/grid.php
  42. +0 −190 libraries/joomla/html/html/image.php
  43. +0 −97 libraries/joomla/html/html/list.php
  44. +1 −1 libraries/joomla/html/html/menu.php
  45. +0 −415 libraries/joomla/html/pane.php
  46. +0 −512 libraries/joomla/html/parameter.php
  47. +0 −159 libraries/joomla/html/parameter/element.php
  48. +0 −60 libraries/joomla/html/parameter/element/calendar.php
  49. +0 −86 libraries/joomla/html/parameter/element/category.php
  50. +0 −95 libraries/joomla/html/parameter/element/componentlayouts.php
  51. +0 −71 libraries/joomla/html/parameter/element/contentlanguages.php
  52. +0 −66 libraries/joomla/html/parameter/element/editors.php
  53. +0 −95 libraries/joomla/html/parameter/element/filelist.php
  54. +0 −85 libraries/joomla/html/parameter/element/folderlist.php
  55. +0 −64 libraries/joomla/html/parameter/element/helpsites.php
  56. +0 −76 libraries/joomla/html/parameter/element/hidden.php
  57. +0 −54 libraries/joomla/html/parameter/element/imagelist.php
  58. +0 −61 libraries/joomla/html/parameter/element/languages.php
  59. +0 −98 libraries/joomla/html/parameter/element/list.php
  60. +0 −63 libraries/joomla/html/parameter/element/menu.php
  61. +0 −149 libraries/joomla/html/parameter/element/menuitem.php
  62. +0 −98 libraries/joomla/html/parameter/element/modulelayouts.php
  63. +0 −53 libraries/joomla/html/parameter/element/password.php
  64. +0 −57 libraries/joomla/html/parameter/element/radio.php
  65. +0 −75 libraries/joomla/html/parameter/element/spacer.php
  66. +0 −79 libraries/joomla/html/parameter/element/sql.php
  67. +0 −83 libraries/joomla/html/parameter/element/templatestyle.php
  68. +0 −57 libraries/joomla/html/parameter/element/text.php
  69. +0 −57 libraries/joomla/html/parameter/element/textarea.php
  70. +0 −102 libraries/joomla/html/parameter/element/timezones.php
  71. +0 −73 libraries/joomla/html/parameter/element/usergroup.php
  72. +4 −4 libraries/joomla/html/toolbar.php
  73. +1 −1 libraries/joomla/http/transport/curl.php
  74. +7 −97 libraries/joomla/installer/adapters/component.php
  75. +1 −1 libraries/joomla/installer/adapters/file.php
  76. +2 −2 libraries/joomla/installer/adapters/language.php
  77. +3 −5 libraries/joomla/installer/adapters/library.php
  78. +6 −6 libraries/joomla/installer/adapters/module.php
  79. +8 −6 libraries/joomla/installer/adapters/package.php
  80. +5 −7 libraries/joomla/installer/adapters/plugin.php
  81. +10 −6 libraries/joomla/installer/adapters/template.php
  82. +8 −41 libraries/joomla/installer/installer.php
  83. +6 −56 libraries/joomla/language/language.php
  84. +1 −1 libraries/joomla/log/log.php
  85. +1 −1 libraries/joomla/log/loggers/w3c.php
  86. +1 −0 libraries/joomla/methods.php
  87. +1 −1 libraries/joomla/registry/format.php
  88. +1 −199 libraries/joomla/registry/registry.php
  89. +3 −3 libraries/joomla/session/session.php
  90. +1 −1 libraries/joomla/session/storage.php
  91. +23 −18 libraries/joomla/session/storage/database.php
  92. +1 −1 libraries/joomla/string/stringnormalize.php
  93. +1 −1 libraries/joomla/updater/updater.php
  94. +0 −18 libraries/joomla/user/authentication.php
  95. +1 −1 libraries/joomla/user/helper.php
  96. +7 −77 libraries/joomla/user/user.php
  97. +2 −112 libraries/joomla/utilities/date.php
  98. +0 −889 libraries/joomla/utilities/simplexml.php
  99. +0 −198 libraries/joomla/utilities/utility.php
  100. +2 −2 libraries/loader.php
  101. +1 −0 media/system/images/mooRainbow/index.html
  102. +0 −2 media/system/js/calendar-setup-uncompressed.js
  103. +0 −2 media/system/js/calendar-uncompressed.js
  104. +1 −11 tests/includes/mocks/JDatabaseMock.php
  105. +2 −2 tests/suite/{joomla/form/fields → cms/form/field}/JFormFieldHelpsiteTest.php
  106. +2 −2 tests/suite/{joomla/form/fields → cms/form/field}/JFormFieldMediaTest.php
  107. +3 −20 tests/suite/joomla/application/component/JControllerTest.php
  108. +1 −23 tests/suite/joomla/base/JObjectTest.php
  109. +1 −1 tests/suite/joomla/cache/storage/JCacheStorageMock.php
  110. +104 −77 tests/suite/joomla/database/JDatabaseTest.php
  111. +0 −20 tests/suite/joomla/database/JTableTest.php
  112. +0 −49 tests/suite/joomla/database/database/JDatabaseMySQLTest.php
  113. +0 −40 tests/suite/joomla/database/database/JDatabaseMySQLiTest.php
  114. +0 −43 tests/suite/joomla/database/stubs/nosqldriver.php
  115. +0 −10 tests/suite/joomla/database/table/JTableContentTest.php
  116. +0 −109 tests/suite/joomla/environment/JRequestCleanTest.php
  117. +233 −29 tests/suite/joomla/filesystem/JFolderTest.php
  118. +3 −3 tests/suite/joomla/form/JFormTest.php
  119. +1 −1 tests/suite/joomla/form/fields/JFormFieldDatabaseConnectionTest.php
  120. +0 −57 tests/suite/joomla/form/fields/JFormFieldEditorsTest.php
  121. +0 −50 tests/suite/joomla/html/JPaneTest.php
  122. +0 −292 tests/suite/joomla/html/JParameterTest.php
  123. +0 −10 tests/suite/joomla/html/html/JHtmlBehaviorTest.php
  124. +0 −11 tests/suite/joomla/html/html/JHtmlGridTest.php
  125. +0 −40 tests/suite/joomla/html/html/JHtmlImageTest.php
  126. +0 −33 tests/suite/joomla/html/html/JHtmlListTest.php
  127. +0 −15 tests/suite/joomla/html/jparameter.xml
  128. +280 −84 tests/suite/joomla/mail/JMailHelperTest.php
  129. +209 −164 tests/suite/joomla/mail/JMailTest.php
  130. +2 −86 tests/suite/joomla/registry/JRegistryTest.php
  131. +425 −0 tests/suite/joomla/user/JUserTest.php
  132. +3,582 −0 tests/suite/joomla/user/JUserTest.xml
  133. +1 −257 tests/suite/joomla/utilities/JDateTest.php
  134. +0 −388 tests/suite/joomla/utilities/JSimpleXMLElementTest.php
  135. +0 −237 tests/suite/joomla/utilities/JSimpleXMLTest.php
  136. +0 −410 tests/suite/joomla/utilities/JUtilityTest.php
View
@@ -11,7 +11,7 @@
define('_JEXEC', 1);
// Setup the path related constants.
-define('JPATH_BASE', dirname(__FILE__));
+define('JPATH_BASE', __DIR__);
// Bootstrap the application.
require '../libraries/import.php';
@@ -98,7 +98,7 @@ protected function getInput()
if ($this->value && file_exists(JPATH_ROOT . '/' . $this->value))
{
$folder = explode('/', $this->value);
- array_shift($folder);
+ array_diff_assoc($folder, explode('/', JComponentHelper::getParams('com_media')->get('image_path', 'images')));
array_pop($folder);
$folder = implode('/', $folder);
}
View
@@ -9,7 +9,7 @@
// Set the platform root path as a constant if necessary.
if (!defined('JPATH_PLATFORM'))
{
- define('JPATH_PLATFORM', dirname(__FILE__));
+ define('JPATH_PLATFORM', __DIR__);
}
// Set the directory separator define if necessary.
@@ -50,34 +50,14 @@ class_exists('JLoader') or die;
// Setup the autoloaders.
JLoader::setup();
-/**
- * Import the base Joomla Platform libraries.
- */
-
-// Import the factory library.
+// Import the base Joomla Platform libraries.
JLoader::import('joomla.factory');
-
-// Import the exception and error handling libraries.
JLoader::import('joomla.error.exception');
-
-/*
- * If the HTTP_HOST environment variable is set we assume a Web request and
- * thus we import the request library and most likely clean the request input.
- */
-if (isset($_SERVER['HTTP_HOST']))
-{
- JLoader::register('JRequest', JPATH_PLATFORM . '/joomla/environment/request.php');
-
- // If an application flags it doesn't want this, adhere to that.
- if (!defined('_JREQUEST_NO_CLEAN') && (bool) ini_get('register_globals'))
- {
- JRequest::clean();
- }
-}
-
-// Import the base object library.
JLoader::import('joomla.base.object');
+// Register JRequest for legacy reasons
+JLoader::register('JRequest', JPATH_PLATFORM . '/joomla/environment/request.php');
+
// Register classes that don't follow one file per class naming conventions.
JLoader::register('JText', JPATH_PLATFORM . '/joomla/methods.php');
JLoader::register('JRoute', JPATH_PLATFORM . '/joomla/methods.php');
@@ -1056,7 +1056,10 @@ protected function _createSession($name)
// The modulus introduces a little entropy, making the flushing less accurate
// but fires the query less than half the time.
$query = $db->getQuery(true);
- $db->setQuery('DELETE FROM ' . $query->qn('#__session') . ' WHERE ' . $query->qn('time') . ' < ' . (int) ($time - $session->getExpire()));
+ $query->delete($query->qn('#__session'))
+ ->where($query->qn('time') . ' < ' . $query->q((int) ($time - $session->getExpire())));
+
+ $db->setQuery($query);
$db->query();
}
@@ -1087,32 +1090,37 @@ public function checkSession()
$user = JFactory::getUser();
$query = $db->getQuery(true);
- $db->setQuery(
- 'SELECT ' . $query->qn('session_id') . ' FROM ' . $query->qn('#__session') . ' WHERE ' . $query->qn('session_id') . ' = ' .
- $query->q($session->getId()),
- 0, 1
- );
+ $query->select($query->qn('session_id'))
+ ->from($query->qn('#__session'))
+ ->where($query->qn('session_id') . ' = ' . $query->q($session->getId()));
+
+ $db->setQuery($query, 0, 1);
$exists = $db->loadResult();
// If the session record doesn't exist initialise it.
if (!$exists)
{
+ $query->clear();
if ($session->isNew())
{
- $db->setQuery(
- 'INSERT INTO ' . $query->qn('#__session') . ' (' . $query->qn('session_id') . ', ' . $query->qn('client_id') . ', ' .
- $query->qn('time') . ')' . ' VALUES (' . $query->q($session->getId()) . ', ' . (int) $this->getClientId() . ', ' .
- (int) time() . ')'
- );
+ $query->insert($query->qn('#__session'))
+ ->columns($query->qn('session_id') . ', ' . $query->qn('client_id') . ', ' . $query->qn('time'))
+ ->values($query->q($session->getId()) . ', ' . (int) $this->getClientId() . ', ' . $query->q((int) time()));
+ $db->setQuery($query);
}
else
{
- $db->setQuery(
- 'INSERT INTO ' . $query->qn('#__session') . ' (' . $query->qn('session_id') . ', ' . $query->qn('client_id') . ', ' .
- $query->qn('guest') . ', ' . $query->qn('time') . ', ' . $query->qn('userid') . ', ' . $query->qn('username') . ')' .
- ' VALUES (' . $query->q($session->getId()) . ', ' . (int) $this->getClientId() . ', ' . (int) $user->get('guest') . ', ' .
- (int) $session->get('session.timer.start') . ', ' . (int) $user->get('id') . ', ' . $query->q($user->get('username')) . ')'
- );
+ $query->insert($query->qn('#__session'))
+ ->columns(
+ $query->qn('session_id') . ', ' . $query->qn('client_id') . ', ' . $query->qn('guest') . ', ' .
+ $query->qn('time') . ', ' . $query->qn('userid') . ', ' . $query->qn('username')
+ )
+ ->values(
+ $query->q($session->getId()) . ', ' . (int) $this->getClientId() . ', ' . (int) $user->get('guest') . ', ' .
+ $query->q((int) $session->get('session.timer.start')) . ', ' . (int) $user->get('id') . ', ' . $query->q($user->get('username'))
+ );
+
+ $db->setQuery($query);
}
// If the insert failed, exit the application.
@@ -291,7 +291,7 @@ protected function _load($id)
// Right join with c for category
$query->select('c.*');
$case_when = ' CASE WHEN ';
- $case_when .= $query->charLength('c.alias');
+ $case_when .= $query->charLength('c.alias') . '!=0';
$case_when .= ' THEN ';
$c_id = $query->castAsChar('c.id');
$case_when .= $query->concatenate(array($c_id, 'c.alias'), ':');
@@ -11,12 +11,12 @@
JLog::add('JDaemon has been renamed to JApplicationDaemon.', JLog::WARNING, 'deprecated');
-/**
- * Backward Compatability Stub for JApplicationDaemon
- *
- * @package Joomla.Platform
- * @subpackage Application
- * @since 11.1
+/**
+ * Backward Compatability Stub for JApplicationDaemon
+ *
+ * @package Joomla.Platform
+ * @subpackage Application
+ * @since 11.1
*/
class JDaemon extends JApplicationDaemon
{
@@ -21,24 +21,6 @@
*/
class JController extends JObject
{
- /**
- * ACO Section for the controller.
- *
- * @var string
- * @since 11.1
- * @deprecated 12.1
- */
- protected $_acoSection;
-
- /**
- * Default ACO Section value for the controller.
- *
- * @var string
- * @since 11.1
- * @deprecated 12.1
- */
- protected $_acoSectionValue;
-
/**
* The base path of the controller
*
@@ -479,25 +461,6 @@ public function addViewPath($path)
return $this;
}
- /**
- * Authorisation check
- *
- * @param string $task The ACO Section Value to check access on
- *
- * @return boolean True if authorised
- *
- * @since 11.1
- *
- * @deprecated 12.1 Use JAuthorise
- */
- public function authorize($task)
- {
- // Deprecation warning.
- JLog::add('JController::authorize() is deprecated.', JLog::WARNING, 'deprecated');
-
- $this->authorise($task);
- }
-
/**
* Authorisation check
*
@@ -1042,26 +1005,6 @@ protected function releaseEditId($context, $id)
}
}
- /**
- * Sets the access control levels.
- *
- * @param string $section The ACO section (eg, the component).
- * @param string $value The ACO section value (if using a constant value).
- *
- * @return void
- *
- * @deprecated 12.1 Use JAccess
- * @see Jaccess
- * @since 11.1
- */
- public function setAccessControl($section, $value = null)
- {
- // Deprecation warning.
- JLog::add('JController::setAccessControl() is deprecated.', JLog::WARNING, 'deprecated');
- $this->_acoSection = $section;
- $this->_acoSectionValue = $value;
- }
-
/**
* Sets the internal message that is passed with a redirect
*
@@ -104,14 +104,14 @@ public static function getParams($option, $strict = false)
}
/**
- * Applies the global text filters to arbitrary text as per settings for current user groups
- *
- * @param text $text The string to filter
- *
- * @return string The filtered string
- *
- * @since 11.4
- */
+ * Applies the global text filters to arbitrary text as per settings for current user groups
+ *
+ * @param text $text The string to filter
+ *
+ * @return string The filtered string
+ *
+ * @since 11.4
+ */
public static function filterText($text)
{
// Filter settings
@@ -406,7 +406,7 @@ protected static function _load($option)
{
$db = JFactory::getDbo();
$query = $db->getQuery(true);
- $query->select('extension_id AS "id", element AS "option", params, enabled');
+ $query->select('extension_id AS id, element AS "option", params, enabled');
$query->from('#__extensions');
$query->where($query->qn('type') . ' = ' . $db->quote('component'));
$query->where($query->qn('element') . ' = ' . $db->quote($option));
@@ -585,12 +585,12 @@ protected function detach()
}
}
- /**
- * Method to fork the process.
- *
- * @return integer The child process id to the parent process, zero to the child process.
+ /**
+ * Method to fork the process.
+ *
+ * @return integer The child process id to the parent process, zero to the child process.
*
- * @since 11.1
+ * @since 11.1
* @throws RuntimeException
*/
protected function fork()
@@ -774,12 +774,12 @@ protected function writeProcessIdFile()
return true;
}
- /**
- * Method to handle post-fork triggering of the onFork event.
- *
- * @return void
- *
- * @since 12.1
+ /**
+ * Method to handle post-fork triggering of the onFork event.
+ *
+ * @return void
+ *
+ * @since 12.1
*/
protected function postFork()
{
@@ -270,7 +270,7 @@ public static function getPath($varname, $user_option = null)
case 'plg_xml':
// Site plugins
$j15path = '/plugins/' . $user_option . '.xml';
- $parts = explode(DS, $user_option);
+ $parts = explode(DIRECTORY_SEPARATOR, $user_option);
$j16path = '/plugins/' . $user_option . '/' . $parts[1] . '.xml';
$j15 = self::_checkPath($j15path, 0);
$j16 = self::_checkPath($j16path, 0);
@@ -9,7 +9,7 @@
defined('JPATH_PLATFORM') or die;
-JLoader::discover('JInput', dirname(__FILE__) . '/input');
+JLoader::discover('JInput', __DIR__ . '/input');
/**
* Joomla! Input Base Class
@@ -373,7 +373,7 @@ protected function render()
// Fall back to constants.
else
{
- $options['directory'] = (defined('JPATH_BASE') ? JPATH_BASE : dirname(__FILE__)) . '/themes';
+ $options['directory'] = (defined('JPATH_BASE') ? JPATH_BASE : __DIR__) . '/themes';
}
// Parse the document.
@@ -227,24 +227,4 @@ public function setError($error)
{
array_push($this->_errors, $error);
}
-
- /**
- * Converts the object to a string (the class name).
- *
- * @return string
- *
- * @since 11.1
- * @deprecated 12.1 Use magic method __toString()
- * @see __toString()
- */
- public function toString()
- {
- // @codeCoverageIgnoreStart
- // Deprecation warning.
- JLog::add('JObject::toString() is deprecated.', JLog::WARNING, 'deprecated');
-
- return $this->__toString();
-
- // @codeCoverageIgnoreEnd
- }
}
@@ -51,7 +51,7 @@ class JObservable extends JObject
* Constructor
*
* Note: Make Sure it's not directly instantiated
- *
+ *
* @deprecated 12.3
*/
public function __construct()
Oops, something went wrong.

0 comments on commit b015d81

Please sign in to comment.