Created
December 17, 2014 06:11
-
-
Save electricjesus/81325d9aea8521e8ce70 to your computer and use it in GitHub Desktop.
Script to test for server uptime [Magento]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header("Cache-Control: no-cache, must-revalidate"); | |
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); | |
header("Content-type: application/json"); | |
require_once "app/Mage.php"; | |
Mage::app($_SERVER['MAGE_RUN_CODE'], $_SERVER['MAGE_RUN_TYPE']); | |
$resource = Mage::getSingleton('core/resource'); | |
$readConnection = $resource->getConnection('core_read'); | |
$cfg = $readConnection->getConfig(); | |
$conn = mysqli_connect($cfg['host'],$cfg['username'],$cfg['password']); | |
$connected = mysqli_ping($conn); | |
if($connected) { | |
echo "I'm OK!"; | |
} else { | |
exit(1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment