调用未定义的方法 Base::grab() [fat-free framework]
Call to undefined method Base::grab() [fat-free framework]
我正在尝试设置一个 cronjob。
我已经按照 this 教程使用 fat-free 框架配置 cronjob。
我已将 "cron.php" 文件放入 "path/to/app/lib" 文件夹中。
我的 index.php 文件是:
<?php
require __DIR__ . '/vendor/autoload.php';
$f3 = require('lib/base.php');
$cron = Cron::instance();
$cron->set('lunchAlert','GBD\Internals\Controllers\LunchController->sendAlertNotificationsUsers','* * * * *');
$f3->run();
这是我的控制器脚本:
public function sendAlertNotificationsUsers()
{
echo "hello world";
}
以下是我在 crontab 中安装作业的方式:
crontab -e
* * * * * cd /var/www/html/dev-portal-new; php index.php /cron
但是我收到了这封邮件:
PHP Fatal error: Call to undefined method Base::grab() in /var/www/html/dev-portal-new/lib/cron.php on line 110
HTTP Fatal error: Call to undefined method Base::grab() (GET /cron)
如何添加此 Base::grab() 方法?
这里有人使用无脂框架吗?很感谢任何形式的帮助。谢谢。
您显然使用的是旧版本的框架。 grab()
方法已在 3.5 版本中引入。参见 https://github.com/bcosca/fatfree-core/blob/master/CHANGELOG.md
我正在尝试设置一个 cronjob。 我已经按照 this 教程使用 fat-free 框架配置 cronjob。 我已将 "cron.php" 文件放入 "path/to/app/lib" 文件夹中。 我的 index.php 文件是:
<?php
require __DIR__ . '/vendor/autoload.php';
$f3 = require('lib/base.php');
$cron = Cron::instance();
$cron->set('lunchAlert','GBD\Internals\Controllers\LunchController->sendAlertNotificationsUsers','* * * * *');
$f3->run();
这是我的控制器脚本:
public function sendAlertNotificationsUsers()
{
echo "hello world";
}
以下是我在 crontab 中安装作业的方式:
crontab -e
* * * * * cd /var/www/html/dev-portal-new; php index.php /cron
但是我收到了这封邮件:
PHP Fatal error: Call to undefined method Base::grab() in /var/www/html/dev-portal-new/lib/cron.php on line 110
HTTP Fatal error: Call to undefined method Base::grab() (GET /cron)
如何添加此 Base::grab() 方法? 这里有人使用无脂框架吗?很感谢任何形式的帮助。谢谢。
您显然使用的是旧版本的框架。 grab()
方法已在 3.5 版本中引入。参见 https://github.com/bcosca/fatfree-core/blob/master/CHANGELOG.md