Skip to content

Commit

Permalink
Merge remote branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
eddieajau committed Jun 20, 2011
2 parents d45810b + fcd513b commit 69c4da7
Show file tree
Hide file tree
Showing 133 changed files with 6,546 additions and 2,823 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tests/test_application/cache
2 changes: 1 addition & 1 deletion libraries/joomla/access/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ public static function getAuthorisedViewLevels($userId)
// Build the base query.
$query = $db->getQuery(true);
$query->select('id, rules');
$query->from('`#__viewlevels`');
$query->from($query->qn('#__viewlevels'));

// Set the query for execution.
$db->setQuery((string) $query);
Expand Down
22 changes: 12 additions & 10 deletions libraries/joomla/application/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ public function close($code = 0)
*
* @return void Calls exit().
*
* @see JApplication::enqueueMessage()
* @see JApplication::enqueueMessage()
* @since 11.1
*/
public function redirect($url, $msg='', $msgType='message', $moved = false)
Expand Down Expand Up @@ -911,9 +911,10 @@ protected function _createSession($name)
if ($time % 2) {
// 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 `#__session`' .
' WHERE `time` < '.(int) ($time - $session->getExpire())
'DELETE FROM '.$query->qn('#__session') .
' WHERE '.$query->qn('time').' < '.(int) ($time - $session->getExpire())
);
$db->query();
}
Expand Down Expand Up @@ -945,25 +946,26 @@ public function checkSession()
$session = JFactory::getSession();
$user = JFactory::getUser();

$query = $db->getQuery(true);
$db->setQuery(
'SELECT `session_id`' .
' FROM `#__session`' .
' WHERE `session_id` = '.$db->quote($session->getId()), 0, 1
'SELECT '.$query->qn('session_id') .
' FROM '.$query->qn('#__session') .
' WHERE '.$query->qn('session_id').' = '.$query->q($session->getId()), 0, 1
);
$exists = $db->loadResult();

// If the session record doesn't exist initialise it.
if (!$exists) {
if ($session->isNew()) {
$db->setQuery(
'INSERT INTO `#__session` (`session_id`, `client_id`, `time`)' .
' VALUES ('.$db->quote($session->getId()).', '.(int) $this->getClientId().', '.(int) time().')'
'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().')'
);
}
else {
$db->setQuery(
'INSERT INTO `#__session` (`session_id`, `client_id`, `guest`, `time`, `userid`, `username`)' .
' VALUES ('.$db->quote($session->getId()).', '.(int) $this->getClientId().', '.(int) $user->get('guest').', '.(int) $session->get('session.timer.start').', '.(int) $user->get('id').', '.$db->quote($user->get('username')).')'
'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')).')'
);
}

Expand Down
4 changes: 2 additions & 2 deletions libraries/joomla/application/cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ public function loadConfiguration($data)
/**
* Write a string to standard output.
*
* @param string $text The text to display.
* @param bool $nl True to append a new line at the end of the output string.
* @param string $text The text to display.
* @param boolean $nl True to append a new line at the end of the output string.
*
* @return void
*
Expand Down
17 changes: 10 additions & 7 deletions libraries/joomla/application/cli/daemon.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,22 @@ class JDaemon extends JCli
);

/**
* @var bool True if the daemon is in the process of exiting.
* Exiting status
* @var boolean True if the daemon is in the process of exiting.
* @since 11.1
*/
protected $exiting = false;

/**
* @var integer The process id of the daemon.
* The process id of the daemon.
* @var integer
* @since 11.1
*/
protected $processId = 0;

/**
* @var bool True if the daemon is currently running.
* Running status
* @var boolean True if the daemon is currently running.
* @since 11.1
*/
protected $running = false;
Expand Down Expand Up @@ -144,7 +147,7 @@ public static function signal($signal)
* Check to see if the daemon is active. This does not assume that $this daemon is active, but
* only if an instance of the application is active as a daemon.
*
* @return bool True if daemon is active.
* @return boolean True if daemon is active.
*
* @since 11.1
*/
Expand Down Expand Up @@ -343,7 +346,7 @@ public function stop()
/**
* Method to change the identity of the daemon process and resources.
*
* @return bool True if identitye successfully changed
* @return boolean True if identitye successfully changed
*
* @since 11.1
* @see posix_setuid()
Expand Down Expand Up @@ -399,7 +402,7 @@ protected function changeIdentity()
/**
* Method to put the application into the background.
*
* @return bool
* @return boolean
*
* @since 11.1
* @throws ApplicationException
Expand Down Expand Up @@ -555,7 +558,7 @@ protected function setupSignalHandlers()
/**
* Method to shut down the daemon and optionally restart it.
*
* @param bool $restart True to restart the daemon on exit.
* @param boolean $restart True to restart the daemon on exit.
*
* @return void
*
Expand Down
6 changes: 3 additions & 3 deletions libraries/joomla/application/component/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -893,10 +893,10 @@ public function registerTask($task, $method)
/**
* Unregister (unmap) a task in the class.
*
* @param string $task The task.
* @param string $task The task.
*
* @return JController This object to support chaining.
* @since 11.1
* @return JController This object to support chaining.
* @since 11.1
*/
public function unregisterTask($task)
{
Expand Down
2 changes: 1 addition & 1 deletion libraries/joomla/application/component/controlleradmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class JControllerAdmin extends JController
* Constructor.
*
* @param array An optional associative array of configuration settings.
* @see JController
* @see JController
* @since 11.1
*/
public function __construct($config = array())
Expand Down
25 changes: 25 additions & 0 deletions libraries/joomla/application/component/controllerform.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,31 @@ protected function allowSave($data, $key = 'id')
}
}

/**
* Method to run batch operations.
*
* @param object $model The model of the component being processed.
*
* @return boolean True if successful, false otherwise and internal error is set.
* @since 11.1
*/
public function batch($model)
{
// Initialise variables.
$app = JFactory::getApplication();
$vars = JRequest::getVar('batch', array(), 'post', 'array');
$cid = JRequest::getVar('cid', array(), 'post', 'array');

// Attempt to run the batch operation.
if ($model->batch($vars, $cid)) {
$this->setMessage(JText::_('JLIB_APPLICATION_SUCCESS_BATCH'));
return true;
} else {
$this->setMessage(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_FAILED', $model->getError()));
return false;
}
}

/**
* Method to cancel an edit.
*
Expand Down
4 changes: 2 additions & 2 deletions libraries/joomla/application/component/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ protected static function _load($option)
$query = $db->getQuery(true);
$query->select('extension_id AS "id", element AS "option", params, enabled');
$query->from('#__extensions');
$query->where('`type` = '.$db->quote('component'));
$query->where('`element` = '.$db->quote($option));
$query->where($query->qn('type').' = '.$db->quote('component'));
$query->where($query->qn('element').' = '.$db->quote($option));
$db->setQuery($query);

$cache = JFactory::getCache('_system','callback');
Expand Down
30 changes: 15 additions & 15 deletions libraries/joomla/application/component/model.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ abstract class JModel extends JObject

/**
* @var string The event to trigger when cleaning cache.
* @since 11.1
* @since 11.1
*/
protected $event_clean_cache = null;

Expand Down Expand Up @@ -127,11 +127,11 @@ public static function addTablePath($path)
/**
* Create the filename for a resource
*
* @param string $type The resource type to create the filename for.
* @param array $parts An associative array of filename information.
* @param string $type The resource type to create the filename for.
* @param array $parts An associative array of filename information.
*
* @return string The filename
* @since 11.1
* @return string The filename
* @since 11.1
*/
protected static function _createFileName($type, $parts = array())
{
Expand Down Expand Up @@ -295,13 +295,13 @@ protected function _getListCount($query)
/**
* Method to load and return a model object.
*
* @param string $name The name of the view
* @param string $prefix The class prefix. Optional.
* @param array $config Configuration settings to pass to JTable::getInsance
* @param string $name The name of the view
* @param string $prefix The class prefix. Optional.
* @param array $config Configuration settings to pass to JTable::getInsance
*
* @return mixed Model object or boolean false if failed
* @since 11.1
* @see JTable::getInstance
* @return mixed Model object or boolean false if failed
* @since 11.1
* @see JTable::getInstance
*/
protected function _createTable($name, $prefix = 'Table', $config = array())
{
Expand Down Expand Up @@ -444,12 +444,12 @@ public function setState($property, $value = null)
/**
* Clean the cache
*
* @param string $group The cache group
* @param string $client_id The ID of the client
* @param string $group The cache group
* @param string $client_id The ID of the client
*
* @return void
*
* @since 1.6
* @since 1.6
*/
protected function cleanCache($group = null, $client_id = 0)
{
Expand All @@ -469,4 +469,4 @@ protected function cleanCache($group = null, $client_id = 0)
// Trigger the onContentCleanCache event.
$dispatcher->trigger($this->event_clean_cache, $options);
}
}
}
Loading

0 comments on commit 69c4da7

Please sign in to comment.