[eluser]dazzer[/eluser]
I have a cron job that calls my controller ( that works only for cli requests ) every 30 minutes. The cron calls a method ( startSearch ) that calls another method from the same controller - "doSearch()".
Inside the "doSearch" method I use cURL to make a request to the twitter rest api ( deprecated version now ).
Everything is working as expected, and if there are more than 100 ( the results/page number I use when making the request ) results I will have a "nextPage" field inside the returned result.
If "nextPage" exsists, I call "$this->doSearch()" again with different parameters. The whole process works just fine, but I don't feel using recursion inside a controller like this is the right way to do this task.
So my actual question, is the recursion inside a controller a good practice ? Should I do it inside a library or something else ?
There is no use for code here because everything is working, I just have a bad feeling about the recursion.
Thank you.