anchorcms/anchor-cms — pull request #795 by joeinnes (2014-12-16 18:13:26+00:00)
Title: Uncaught exception when Anchor is running on a machine without internet connectivity

Fixes issue #794: uncaught exception when Anchor is running on a machine without internet connectivity.

After installing Anchor, the website loads, and the admin login interface is fine, but when I try to log into the admin panel, there's an uncaught exception error. I believe this to be due to a lack of error handling if there is no network connectivity.

This normally would not be an issue on a production box, but a dev box running in a VM or as a standalone may not have an internet connection.

Uncaught Exception

file_get_contents(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution

Origin

anchor/libraries/update.php on line 55

Trace

#0 [internal function]: System\Error::native(2, 'file_get_conten...', '/var/www/public...', 55, Array)
#1 /var/www/public/anchor/libraries/update.php(55): file_get_contents('http://anchorcm...', false, Resource id #2)
#2 /var/www/public/anchor/libraries/update.php(18): Update::touch()
#3 /var/www/public/anchor/libraries/update.php(8): Update::setup()
#4 /var/www/public/anchor/routes/admin.php(54): Update::version()
#5 [internal function]: {closure}()
#6 /var/www/public/system/route.php(152): call_user_func_array(Object(Closure), Array)
#7 /var/www/public/system/router.php(152): System\Route->run()
#8 /var/www/public/system/start.php(36): System\Router->dispatch()
#9 /var/www/public/index.php(33): require('/var/www/public...')
#10 {main}