Is it efficient and/or possible to use exec();
with a method of the same class? Instead of executing a file with an $argv
array, I'd like to pass variables to a method and execute it within another method:
class Foo{
private function bar($table, $column, $id){
//SQL
}
public function bar_exec($table, $column, $id){
exec($this->bar($table, $column, $id)); //this is most likely wrong
}
}
The reasoning behind this is I have a method that chews through my database and takes quite a few arguments which in turn takes about a minute to finish, so I need to run it in the background whenever a form is submitted. What's the best way to handle this?