php - Call a function of another file using "exec" command from current file -
i have file, notification.php
, class. structure this:
class notificaiton { public function sendnotification($token,$count) { // here code sending push notification(apns) } }
normally, if want call function php file have make object of class , call method below:
$notification = new notification(); $notification->sendnotification($token,$value);
but want call in background process. used exec()
command below :
exec("/usr/bin/php /path/to/notification.php >> /path/to/log_file.log 2>&1 &");
here wonder how can call function(sendnotificaiton())
of file(notification.php)
, pass arguments parameter: $token , $count ?
please guide me on this. appreciated.
Comments
Post a Comment