ccampbell / sonic

fast, lightweight PHP 5.3 MVC framework
http://www.sonicframework.com
Apache License 2.0
63 stars 11 forks source link

Accessing Sonic public function within an external PHP file (Gearman worker) #33

Open gordyr opened 11 years ago

gordyr commented 11 years ago

Hi,

I have a particular use case where I would like to call a public function '\Sonic\Home\functionname()'

From within a gearman worker.

http://www.php.net/manual/en/book.gearman.php

These are separate individual PHP files that run in the background and respond asynchronously to tasks that are sent to them. These files are called workers and are completely independent of my actual Sonic based application. Since Object Orientated PHP has and never will be my strongpoint I am struggling to reference one of my functions within one of these workers scope. Do I need to get an app reference first? or Include a particular file? If so how?

Thanks in advance