Skip to content

Commit

Permalink
Merge branch '4.4-dev' into 4.3-finder-highlighter
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackwar authored Sep 12, 2023
2 parents 983b07d + 2875f27 commit edfb611
Show file tree
Hide file tree
Showing 7 changed files with 280 additions and 256 deletions.
4 changes: 2 additions & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ steps:
- ./libraries/vendor/bin/phan

- name: npm
image: node:16-bullseye-slim
image: node:18-bullseye-slim
depends_on: [ phpcs ]
volumes:
- name: npm-cache
Expand Down Expand Up @@ -462,6 +462,6 @@ trigger:

---
kind: signature
hmac: 06ecea6156e9c3f4cbb17d5e5e876a8c2b256e0e98412ce6351c914b2adbda97
hmac: c80f54f77ce8c648018d3946dc20d86bf3491484662a0e5defd8d9453f33cd92

...
35 changes: 33 additions & 2 deletions administrator/components/com_scheduler/src/Model/TasksModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
namespace Joomla\Component\Scheduler\Administrator\Model;

use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Date\Date;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
Expand Down Expand Up @@ -366,7 +367,7 @@ protected function _getList($query, $limitstart = 0, $limit = 0): array
{
// Get stuff from the model state
$listOrder = $this->getState('list.ordering', 'a.title');
$listDirectionN = strtolower($this->getState('list.direction', 'asc')) == 'desc' ? -1 : 1;
$listDirectionN = strtolower($this->getState('list.direction', 'asc')) === 'desc' ? -1 : 1;

// Set limit parameters and get object list
$query->setLimit($limit, $limitstart);
Expand Down Expand Up @@ -395,7 +396,7 @@ static function (array $arr) {
$this->attachTaskOptions($responseList);

// If ordering by non-db fields, we need to sort here in code
if ($listOrder == 'j.type_title') {
if ($listOrder === 'j.type_title') {
$responseList = ArrayHelper::sortObjects($responseList, 'safeTypeTitle', $listDirectionN, true, false);
}

Expand Down Expand Up @@ -437,4 +438,34 @@ protected function populateState($ordering = 'a.title', $direction = 'ASC'): voi
// Call the parent method
parent::populateState($ordering, $direction);
}

/**
* Check if we have any enabled due tasks and no locked tasks.
*
* @param Date $time The next execution time to check against
*
* @return boolean
* @since __DEPLOY_VERSION__
*/
public function hasDueTasks(Date $time): bool
{
$db = $this->getDatabase();
$now = $time->toSql();

$query = $db->getQuery(true)
// Count due tasks
->select('SUM(CASE WHEN ' . $db->quoteName('a.next_execution') . ' <= :now THEN 1 ELSE 0 END) AS due_count')
// Count locked tasks
->select('SUM(CASE WHEN ' . $db->quoteName('a.locked') . ' IS NULL THEN 0 ELSE 1 END) AS locked_count')
->from($db->quoteName('#__scheduler_tasks', 'a'))
->where($db->quoteName('a.state') . ' = 1')
->bind(':now', $now);

$db->setQuery($query);

$taskDetails = $db->loadObject();

// False if we don't have due tasks, or we have locked tasks
return $taskDetails && $taskDetails->due_count && !$taskDetails->locked_count;
}
}
4 changes: 3 additions & 1 deletion build/bump.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ function usage($command)
if (file_exists($rootPath . $packageJsonFile)) {
$package = json_decode(file_get_contents($rootPath . $packageJsonFile));
$package->version = $version['release'];
file_put_contents($rootPath . $packageJsonFile, json_encode($package, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));

// @todo use a native formatter whenever https://github.com/php/php-src/issues/8864 is resolved
file_put_contents($rootPath . $packageJsonFile, str_replace(' ', ' ', json_encode($package, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)));
}

// Updates the version in readme files.
Expand Down
240 changes: 120 additions & 120 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,124 +1,124 @@
{
"name": "joomla/joomla-cms",
"type": "project",
"description": "Joomla CMS",
"keywords": [
"joomla",
"cms"
],
"homepage": "https://github.com/joomla/joomla-cms",
"license": "GPL-2.0-or-later",
"config": {
"optimize-autoloader": true,
"platform": {
"php": "7.2.5"
},
"vendor-dir": "libraries/vendor",
"github-protocols": ["https"],
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
"name": "joomla/joomla-cms",
"type": "project",
"description": "Joomla CMS",
"keywords": [
"joomla",
"cms"
],
"homepage": "https://github.com/joomla/joomla-cms",
"license": "GPL-2.0-or-later",
"config": {
"optimize-autoloader": true,
"platform": {
"php": "7.2.5"
},
"support": {
"issues": "https://issues.joomla.org/",
"irc": "irc://chat.freenode.net/joomla/",
"forum": "https://forum.joomla.org/",
"docs": "https://docs.joomla.org/"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/joomla-backports/json-api-php.git",
"no-api": true
}
],
"autoload": {
"psr-4": {
"Joomla\\CMS\\": "libraries/src/"
}
},
"autoload-dev": {
"psr-4": {
"Joomla\\Tests\\": "tests"
}
},
"require": {
"php": "^7.2.5",
"joomla/application": "^2.0.4",
"joomla/archive": "^2.0.2",
"joomla/authentication": "^2.0.1",
"joomla/console": "^2.0.1",
"joomla/crypt": "^2.0.1",
"joomla/data": "^2.0.1",
"joomla/database": "^2.1.1",
"joomla/di": "^2.0.1",
"joomla/event": "^2.0.2",
"joomla/filter": "^2.0.3",
"joomla/filesystem": "^2.0.2",
"joomla/http": "^2.0.2",
"joomla/input": "^2.0.4",
"joomla/ldap": "~2.0.0",
"joomla/oauth1": "^2.0.2",
"joomla/oauth2": "^2.0.2",
"joomla/registry": "^2.0.4",
"joomla/router": "^2.0.1",
"joomla/session": "^2.0.2",
"joomla/string": "^2.0.1",
"joomla/uri": "^2.0.4",
"joomla/utilities": "^2.0.1",
"algo26-matthias/idna-convert": "^3.1.0",
"defuse/php-encryption": "^2.4.0",
"doctrine/inflector": "^1.4.4",
"fig/link-util": "^1.1.2",
"google/recaptcha": "^1.2.4",
"laminas/laminas-diactoros": "^2.4.1",
"paragonie/sodium_compat": "^1.20",
"phpmailer/phpmailer": "^6.8.1",
"psr/link": "~1.0.0",
"symfony/console": "^5.4.28",
"symfony/error-handler": "^5.4.26",
"symfony/ldap": "^5.4.27",
"symfony/options-resolver": "^5.4.21",
"symfony/polyfill-mbstring": "^1.28.0",
"symfony/polyfill-php73": "^1.28",
"symfony/polyfill-php80": "^1.28",
"symfony/polyfill-php81": "^1.28",
"symfony/web-link": "^5.4.21",
"symfony/yaml": "^5.4.23",
"typo3/phar-stream-wrapper": "^3.1.7",
"wamania/php-stemmer": "^2.2",
"maximebf/debugbar": "dev-master",
"tobscure/json-api": "dev-joomla-backports",
"willdurand/negotiation": "^3.1.0",
"ext-json": "*",
"ext-simplexml": "*",
"psr/log": "^1.1.4",
"ext-gd": "*",
"web-auth/webauthn-lib": "2.1.*",
"composer/ca-bundle": "^1.3.7",
"dragonmantank/cron-expression": "^3.3.3",
"enshrined/svg-sanitize": "^0.15.4",
"lcobucci/jwt": "^3.4.6",
"web-token/signature-pack": "^2.2.11",
"phpseclib/bcmath_compat": "^2.0.1",
"jfcherng/php-diff": "^6.10.14",
"voku/portable-utf8": "6.0.12 as 5.4.0"
},
"require-dev": {
"phpunit/phpunit": "^8.5.33",
"friendsofphp/php-cs-fixer": "^3.4.0",
"squizlabs/php_codesniffer": "^3.7.2",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.2",
"joomla/mediawiki": "^1.0.0",
"joomla/test": "^2.0.2",
"phan/phan": "^5.4.2"
},
"replace": {
"paragonie/random_compat": "9.99.99"
},
"scripts": {
"post-install-cmd": [
"php build/update_fido_cache.php"
]
"vendor-dir": "libraries/vendor",
"github-protocols": ["https"],
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"support": {
"issues": "https://issues.joomla.org/",
"irc": "irc://chat.freenode.net/joomla/",
"forum": "https://forum.joomla.org/",
"docs": "https://docs.joomla.org/"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/joomla-backports/json-api-php.git",
"no-api": true
}
],
"autoload": {
"psr-4": {
"Joomla\\CMS\\": "libraries/src/"
}
},
"autoload-dev": {
"psr-4": {
"Joomla\\Tests\\": "tests"
}
},
"require": {
"php": "^7.2.5",
"joomla/application": "^2.0.4",
"joomla/archive": "^2.0.2",
"joomla/authentication": "^2.0.1",
"joomla/console": "^2.0.1",
"joomla/crypt": "^2.0.1",
"joomla/data": "^2.0.1",
"joomla/database": "^2.1.1",
"joomla/di": "^2.0.1",
"joomla/event": "^2.0.2",
"joomla/filter": "^2.0.3",
"joomla/filesystem": "^2.0.2",
"joomla/http": "^2.0.2",
"joomla/input": "^2.0.4",
"joomla/ldap": "~2.0.0",
"joomla/oauth1": "^2.0.2",
"joomla/oauth2": "^2.0.2",
"joomla/registry": "^2.0.4",
"joomla/router": "^2.0.1",
"joomla/session": "^2.0.2",
"joomla/string": "^2.0.1",
"joomla/uri": "^2.0.4",
"joomla/utilities": "^2.0.1",
"algo26-matthias/idna-convert": "^3.1.0",
"defuse/php-encryption": "^2.4.0",
"doctrine/inflector": "^1.4.4",
"fig/link-util": "^1.1.2",
"google/recaptcha": "^1.2.4",
"laminas/laminas-diactoros": "^2.4.1",
"paragonie/sodium_compat": "^1.20",
"phpmailer/phpmailer": "^6.8.1",
"psr/link": "~1.0.0",
"symfony/console": "^5.4.28",
"symfony/error-handler": "^5.4.26",
"symfony/ldap": "^5.4.27",
"symfony/options-resolver": "^5.4.21",
"symfony/polyfill-mbstring": "^1.28.0",
"symfony/polyfill-php73": "^1.28",
"symfony/polyfill-php80": "^1.28",
"symfony/polyfill-php81": "^1.28",
"symfony/web-link": "^5.4.21",
"symfony/yaml": "^5.4.23",
"typo3/phar-stream-wrapper": "^3.1.7",
"wamania/php-stemmer": "^2.2",
"maximebf/debugbar": "dev-master",
"tobscure/json-api": "dev-joomla-backports",
"willdurand/negotiation": "^3.1.0",
"ext-json": "*",
"ext-simplexml": "*",
"psr/log": "^1.1.4",
"ext-gd": "*",
"web-auth/webauthn-lib": "2.1.*",
"composer/ca-bundle": "^1.3.7",
"dragonmantank/cron-expression": "^3.3.3",
"enshrined/svg-sanitize": "^0.15.4",
"lcobucci/jwt": "^3.4.6",
"web-token/signature-pack": "^2.2.11",
"phpseclib/bcmath_compat": "^2.0.1",
"jfcherng/php-diff": "^6.10.14",
"voku/portable-utf8": "6.0.12 as 5.4.0"
},
"require-dev": {
"phpunit/phpunit": "^8.5.33",
"friendsofphp/php-cs-fixer": "^3.4.0",
"squizlabs/php_codesniffer": "^3.7.2",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.2",
"joomla/mediawiki": "^1.0.0",
"joomla/test": "^2.0.2",
"phan/phan": "^5.4.2"
},
"replace": {
"paragonie/random_compat": "9.99.99"
},
"scripts": {
"post-install-cmd": [
"php build/update_fido_cache.php"
]
}
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit edfb611

Please sign in to comment.