Patch for running RSS Factory from a terminal 6 years 1 month ago #1

  • Stuart Cardall
  • Localtime: 11:32
  • Europe/Bucharest
  • Posts: 13
Hello,

Here is a patch to fix RSS Factory when run from the command line with php:
===========================================================

--- /a/components/com_rssfactory/helpers/refresh.php
+++ /b/components/com_rssfactory/helpers/refresh.php.new
@@ -59,7 +59,14 @@

// Check for valid credentials.
$type = $app->input->getCmd('type', 'cronjob');
-$password = $app->input->getString('password');
+
+if (defined('STDIN')) {
+ // run from commandline as /path/to/refresh.php mypass
+ $password = $argv[1];
+} else {
+ // run from web as https://domain/components/com_rssfactory/helpers/refresh.php?password=mypass
+ $password = $app->input->getString('password');
+}
$valid = false;

switch ($type) {

=========================================================

When running from the command line It is better to put the php command & password into a shell script
& have the cron job call the shell script (so the password is not visible to other users).

Best Regards,

Stuart.
The administrator has disabled public write access.