Cakephp never ending request

172 views Asked by At

I'm quite new to cakephp and trying to debug a code from someone else. The problem is I get a never ending request, despite the fact that both view and crontroller seem to run properly. I even tryed to add an exit; in both of them or even introduce a syntax error in the controller, the request never ends and the browser keeps trying to load the page endlessly.

Here is the code of the controller :

    public function categories()
{
    file_put_contents("/tmp/logfile.log",time()." categories bla\n", FILE_APPEND);
    $catData = $this->SpecificKeywordCategorie->find('all');
    $modelnameLessValues = array();
    foreach($catData as $singleCat)
    {
        $modelnameLessValues[] = $singleCat['SpecificKeywordCategorie'];
    }
    $this->set('categories',$modelnameLessValues);
    file_put_contents("/tmp/logfile.log",time()." categories end blu\n", FILE_APPEND);
}

and the view code "categories.ctp :

    <?php
    file_put_contents("/tmp/logfile.log","view json ".json_encode($categories),FILE_APPEND);
    print(json_encode($categories));
    file_put_contents("/tmp/logfile.log","view json before exit",FILE_APPEND);
    exit;
    ?>

all the file_put_contents entries are written in the logfile. but the exit seems to be ignored and if I do a request in a browser it never ends...

Same thing happens if I add a syntax error on controller or view. (of course, in this case, log entries are not written)

I know nothing about cakephp internals, but php scripts running outside it are running well on same apache instance.

Any idea where to look to find where this infinite request comes from ?

We are running cakephp 2.2.3

0

There are 0 answers