dancryer / PHPCI

PHPCI is a free and open source continuous integration tool specifically designed for PHP.
BSD 2-Clause "Simplified" License
2.42k stars 441 forks source link

Lack of favicon causes error #71

Closed gabriel403 closed 10 years ago

gabriel403 commented 11 years ago

When running PHP with all errors on, the lack of a favicon keeps causing error messages, it also seems to stop the redirect when doing a build, I have to manually go to the build rather than being redirected.

dancryer commented 11 years ago

What kind of error messages?

gabriel403 commented 11 years ago

[Wed Jun 05 16:00:29 2013] [error] [client 10.11.12.1] PHP Fatal error: Uncaught exception 'b8\Exception\HttpException\BadRequestException' with message 'Invalid controller [\PHPCI\Controller\Favicon.icoController]: Favicon.ico does not exist.' in /code/PHPCI/vendor/block8/b8framework/b8/Application.php:87\nStack trace:\n#0 /code/PHPCI/vendor/block8/b8framework/b8/Application.php(66): b8\Application->initController()\n#1 /code/PHPCI/PHPCI/Application.php(30): b8\Application->initRequest()\n#2 /code/PHPCI/index.php(18): PHPCI\Application->handleRequest()\n#3 {main}\n thrown in /code/PHPCI/vendor/block8/b8framework/b8/Application.php on line 87

meadsteve commented 11 years ago

Maybe the b8 framework should return 404 if a controller is requested that can't be found.

I haven't thought this through fully but it seems sensible.

gabriel403 commented 11 years ago

Yeh sounds reasonable to me

if !fileExist
    send 404
else
    instanciate
gabriel403 commented 11 years ago

@dancryer think this is something you fix in the b8 framework? 404 instead of exception?

dancryer commented 11 years ago

Should be able to catch the exception in phpci::application and then update the response object response code to 404...

On Tuesday, 11 June 2013, Gabriel Baker wrote:

@dancryer https://github.com/dancryer think this is something you fix in the b8 framework? 404 instead of exception?

— Reply to this email directly or view it on GitHubhttps://github.com/Block8/PHPCI/issues/71#issuecomment-19293187 .

Dan Cryer Director Block 8 Limited

07590 698944 dan.cryer@block8.co.uk @block8digital http://www.twitter.com/block8digital

dongilbert commented 11 years ago

Maybe certain filetype requests shouldn't ever be sent to the index.php?

dancryer commented 11 years ago

That would just be a server-level config option. The easiest way to solve this one particular issue, given that it is favicons, would just be to add a favicon.

Will put something together and commit it shortly.

gabriel403 commented 11 years ago

I did add a blank favicon ages ago but think it got skipped out as part of a merge, but to me it makes more sense to 404 on an incorrect url than to throw an exception and cease execution.

dancryer commented 11 years ago

It does. :) I'll have a look at it.