Code attached in file below, JApplicationCli invocation works, JApplicationDaemon throws exception.
$ php test.php
pages: 1
$ php test.php -d
PHP Warning: pcntl_signal(): Specified handler "DaemonApplication::signal" is not callable (class 'DaemonApplication' not found) in /var/www/game.conlucra.com/public_html/libraries/src/Application/DaemonApplication.php on line 886
PHP Built On Linux ip-172-30-2-137 5.15.0-1026-aws #30-Ubuntu SMP Wed Nov 23 14:15:21 UTC 2022 x86_64
Database Type mysql
Database Version 8.0.31-0ubuntu0.22.04.1
Database Collation utf8mb4_0900_ai_ci
Database Connection Collation utf8mb4_0900_ai_ci
PHP Version 7.4.32
Web Server Apache/2.4.52 (Ubuntu)
WebServer to PHP Interface apache2handler
Joomla! Version Joomla! 3.10.11 Stable [ Daraja ] 14-August-2022 14:18 GMT
Joomla! Platform Version Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent Mozilla/5.0 (Linux; Android 10; SM-G960U1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Mobile Safari/537.36
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
Test scripttestCli.txt
Joomla 3 is now only getting security fixes
NP, I assume it doesn't work on J4 either, I'll test and submit a new bug report ...
were you able to replicate this in joomla 4?
No, I haven't had time, had to fall back on building a cli app/cron job to
get a reliable solution in place. The daemon is on the backlog, maybe after
we port the whole package to J4.
On Sat, 7 Jan 2023, 7:50 am Brian Teeman, @.***> wrote:
were you able to replicate this in joomla 4?
—
Reply to this email directly, view it on GitHub
#39533 (comment),
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABDXCQNMZOH7K34MQ3ZSZKTWREN37ANCNFSM6AAAAAATOCRUDM
.
You are receiving this because you authored the thread.Message ID:
@.***>
I just looked the code, the issue valid for both J3 and j4.
DemonApplication sets incorrect class as signal handler.
Joomla 3
joomla-cms/libraries/src/Application/DaemonApplication.php
Lines 703 to 709 in 2ca2d4e
Joomla 4
joomla-cms/libraries/src/Application/DaemonApplication.php
Lines 653 to 658 in f520c98
It should be full class name, with namespace.
Title |
|
Labels |
Added:
bug
|
Incomplete code, apologies.
This is the correct code to reproduce:
getQuery(true); $query->select('COUNT(*) AS count')->from($db->quoteName('#__content')); $db->setQuery($query); $result = $db->loadObject(); $this->out("pages: " . $result->count); } } class LaunchDaemon extends JApplicationDaemon { public $name='test'; public function doExecute() { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('COUNT(*) AS count')->from($db->quoteName('#__content')); $db->setQuery($query); $result = $db->loadObject(); $this->out("pages: " . $result->count); } } $options = getopt("d"); try { if (array_key_exists('d', $options)) JApplicationDaemon::getInstance('LaunchDaemon')->execute(); else JApplicationCli::getInstance('LaunchCLI')->execute(); } catch (Exception $e){ echo $e->getMessage() . "\n"; } ?>This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39533.