Location: PHPKode > scripts > Genghis > genghis-2.2.1/genghis.php
<?php

/**
 * Genghis v2.2.1
 *
 * The single-file MongoDB admin app
 *
 * http://genghisapp.com
 *
 * @author Justin Hileman <hide@address.com>
 */
define('GENGHIS_VERSION', "2.2.1");

class Genghis_Api extends Genghis_App { const ROUTE_PATTERN = '~^/?servers(?:/(?P<server>[^/]+)(?P<databases>/databases(?:/(?P<db>[^/]+)(?P<collections>/collections(?:/(?P<coll>[^/]+)(?P<documents>/documents(?:/(?P<id>[^/]+))?)?)?)?)?)?)?/?$~'; const GRIDFS_ROUTE = '~^/?servers/(?P<server>[^/]+)/databases/(?P<db>[^/]+)/collections/(?P<coll>[^/]+)/files(?:/(?P<id>[^/]+))?/?$~'; const CHECK_STATUS_ROUTE = '~/?check-status/?$~'; const PAGE_LIMIT = 50; protected $servers; public function __construct() { $this->servers = new Genghis_ServerCollection; } public function route($method, $path) { try { try { return $this->doRoute($method, $path); } catch (Genghis_HttpException $e) { return $this->errorResponse($e->getMessage(), $e->getStatus()); } } catch (Exception $e) { return $this->errorResponse($e->getMessage()); } } public function doRoute($method, $path) { if (preg_match(self::CHECK_STATUS_ROUTE, $path)) { return new Genghis_JsonResponse($this->checkStatusAction()); } $p = array(); if (preg_match(self::ROUTE_PATTERN, $path, $p)) { $p = array_map('urldecode', array_filter($p)); if (isset($p['id'])) { return new Genghis_JsonResponse($this->documentAction($method, $p['server'], $p['db'], $p['coll'], $p['id'])); } if (isset($p['documents'])) { return new Genghis_JsonResponse($this->documentsAction($method, $p['server'], $p['db'], $p['coll'])); } if (isset($p['coll'])) { return new Genghis_JsonResponse($this->collectionAction($method, $p['server'], $p['db'], $p['coll'])); } if (isset($p['collections'])) { return new Genghis_JsonResponse($this->collectionsAction($method, $p['server'], $p['db'])); } if (isset($p['db'])) { return new Genghis_JsonResponse($this->databaseAction($method, $p['server'], $p['db'])); } if (isset($p['databases'])) { return new Genghis_JsonResponse($this->databasesAction($method, $p['server'])); } if (isset($p['server'])) { return new Genghis_JsonResponse($this->serverAction($method, $p['server'])); } return new Genghis_JsonResponse($this->serversAction($method)); } $p = array(); if (preg_match(self::GRIDFS_ROUTE, $path, $p)) { $p = array_map('urldecode', array_filter($p)); if (isset($p['id'])) { $file = $this->fileAction($method, $p['server'], $p['db'], $p['coll'], $p['id']); return ($method === 'GET') ? new Genghis_GridFsResponse($file) : new Genghis_JsonResponse($file); } else { return new Genghis_JsonResponse($this->filesAction($method, $p['server'], $p['db'], $p['coll'])); } } throw new Genghis_HttpException(404); } protected function checkStatusAction() { $alerts = array(); if (!class_exists('Mongo', false)) { $alerts[] = array( 'level' => 'error', 'msg' => '<h4>Mongo PHP class not found.</h4> ' . 'Have you installed and enabled the <strong>PECL Mongo drivers</strong>?', ); } if (!$this->skipUpdateCheck()) { try { $latest = @file_get_contents('https://raw.github.com/bobthecow/genghis/master/VERSION'); if ($latest && version_compare($latest, GENGHIS_VERSION, '>')) { $alerts[] = array( 'level' => 'warning', 'msg' => '<h4>A Genghis update is available</h4> ' . 'You are running Genghis version <tt>' . GENGHIS_VERSION . '</tt>. ' . 'The current version is <tt>' . $latest . '</tt>. ' . 'Visit <a href="http://genghisapp.com">genghisapp.com</a> for more information.' ); } } catch (Exception $e) { } } try { $d = new DateTime; } catch (Exception $e) { $msg = $e->getMessage(); if (strpos($msg, 'date.timezone') === false) { throw $e; } $alerts[] = array( 'level' => 'warning', 'msg' => preg_replace('/^(?:(?:DateTime::__construct\(\))?: )?([^\.]+\.)/', '<h4>\1</h4> ', $msg), ); } if (get_magic_quotes_gpc()) { $alerts[] = array( 'level' => 'error', 'msg' => '<h4>Looks like you\'re rockin\' it retro style</h4>' . 'You are running PHP with <tt>magic_quotes_gpc</tt> enabled. Not only is this ' . '<a href="http://us1.php.net/manual/en/security.magicquotes.php">dangerous and ' . 'deprecated</a>, but it will keep Genghis from properly querying and saving documents. ' . 'Please <a href="http://us1.php.net/manual/en/security.magicquotes.disabling.php">disable ' . '<tt>magic_quotes_gpc</tt></a>.', ); } if (get_magic_quotes_runtime()) { $alerts[] = array( 'level' => 'error', 'msg' => '<h4>Looks like you\'re rockin\' it retro style</h4>' . 'You are running PHP with <tt>magic_quotes_runtime</tt> enabled. Not only is this ' . '<a href="http://us1.php.net/manual/en/security.magicquotes.php">dangerous and ' . 'deprecated</a>, but it will keep Genghis from properly querying and saving documents. ' . 'Please <a href="http://us1.php.net/manual/en/info.configuration.php#ini.magic-quotes-runtime">disable ' . '<tt>magic_quotes_runtime</tt></a>.', ); } return compact('alerts'); } public function documentAction($method, $server, $db, $coll, $id) { switch ($method) { case 'GET': return $this->servers[$server][$db][$coll][$id]; case 'PUT': $this->servers[$server][$db][$coll][$id] = $this->getRequestData(); return $this->servers[$server][$db][$coll][$id]; case 'DELETE': unset($this->servers[$server][$db][$coll][$id]); return array('success' => true); default: throw new Genghis_HttpException(405); } } public function documentsAction($method, $server, $db, $coll) { switch ($method) { case 'GET': $query = (string) $this->getQueryParam('q', ''); $page = (int) $this->getQueryParam('page', 1); return $this->servers[$server][$db][$coll]->findDocuments($query, $page); case 'POST': return $this->servers[$server][$db][$coll]->insert($this->getRequestData()); default: throw new Genghis_HttpException(405); } } public function collectionAction($method, $server, $db, $coll) { switch ($method) { case 'GET': return $this->servers[$server][$db][$coll]; case 'DELETE': unset($this->servers[$server][$db][$coll]); return array('success' => true); default: throw new Genghis_HttpException(405); } } public function collectionsAction($method, $server, $db) { switch ($method) { case 'GET': return $this->servers[$server][$db]->listCollections(); case 'POST': return $this->servers[$server][$db]->createCollection($this->getRequestParam('name')); default: throw new Genghis_HttpException(405); } } public function databaseAction($method, $server, $db) { switch ($method) { case 'GET': return $this->servers[$server][$db]; case 'DELETE': unset($this->servers[$server][$db]); return array('success' => true); default: throw new Genghis_HttpException(405); } } public function databasesAction($method, $server) { switch ($method) { case 'GET': return $this->servers[$server]->listDatabases(); case 'POST': return $this->servers[$server]->createDatabase($this->getRequestParam('name')); default: throw new Genghis_HttpException(405); } } public function serverAction($method, $server) { switch ($method) { case 'GET': return $this->servers[$server]; case 'DELETE': unset($this->servers[$server]); return array('success' => true); default: throw new Genghis_HttpException(405); } } public function serversAction($method) { switch ($method) { case 'GET': return $this->servers; case 'POST': $server = new Genghis_Models_Server($this->getRequestParam('name')); $this->servers[] = $server; return $server; default: throw new Genghis_HttpException(405); } } public function fileAction($method, $server, $db, $coll, $id) { switch ($method) { case 'GET': return $this->servers[$server][$db][$coll]->getFile($id); case 'DELETE': $this->servers[$server][$db][$coll]->deleteFile($id); return array('success' => true); default: throw new Genghis_HttpException(405); } } public function filesAction($method, $server, $db, $coll) { switch ($method) { case 'POST': return $this->servers[$server][$db][$coll]->putFile($this->getRequestData()); default: throw new Genghis_HttpException(405); } } protected function skipUpdateCheck() { return (isset($_ENV['GENGHIS_NO_UPDATE_CHECK']) && $_ENV['GENGHIS_NO_UPDATE_CHECK']) || (isset($_SERVER['GENGHIS_NO_UPDATE_CHECK']) && $_SERVER['GENGHIS_NO_UPDATE_CHECK']); } protected function getRequestData($gfj = true) { $data = file_get_contents('php://input'); if ($gfj) { try { $json = Genghis_Json::decode($data); } catch (Genghis_JsonException $e) { throw new Genghis_HttpException(400, 'Malformed document'); } } else { $json = json_decode($data, true); } if (empty($json)) { throw new Genghis_HttpException(400, 'Malformed document'); } return $json; } protected function getRequestParam($name) { $data = $this->getRequestData(false); if (!isset($data[$name])) { throw new HttpException(400, sprintf("'%s' must be specified", $name)); } return $data[$name]; } protected function errorResponse($msg, $status = 500) { if (empty($msg)) { $msg = Genghis_Response::getStatusText($status); } return new Genghis_JsonResponse(array('error' => $msg, 'status' => $status), $status); } }
class Genghis_App { protected $loader; protected $baseUrl; public function __construct(Genghis_AssetLoader $loader) { $this->loader = $loader; } public function run() { set_error_handler(array('Genghis_ErrorException', 'throwException')); try { $response = $this->route($this->getRequestMethod(), $this->getRequestPath()); if ($response instanceof Genghis_Response) { $response->render(); } else { throw new Genghis_HttpException(500); } } catch (Genghis_HttpException $e) { $this->errorResponse($e->getMessage(), $e->getStatus())->render(); } catch (Exception $e) { $this->errorResponse($e->getMessage())->render(); } } public function route($method, $path) { if ($this->isJsonRequest() || $this->isGridFsRequest()) { return $this->getApi()->route($method, $path); } elseif ($this->isAssetRequest($path)) { return $this->getAsset(substr($path, 8)); } else { return $this->renderTemplate('index.html.mustache'); } } protected function isJsonRequest() { if (in_array($this->getRequestMethod(), array('POST', 'PUT'))) { if (array_key_exists('HTTP_CONTENT_TYPE', $_SERVER)) { $type = $_SERVER['HTTP_CONTENT_TYPE']; } elseif (array_key_exists('CONTENT_TYPE', $_SERVER)) { $type = $_SERVER['CONTENT_TYPE']; } else { $type = 'x-www-form-urlencoded'; } } else { $type = isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : 'text/html'; } return strpos($type, 'application/json') !== false || strpos($type, 'application/javascript') !== false; } protected function isGridFsRequest() { return $this->getRequestMethod() == 'GET' && preg_match(Genghis_Api::GRIDFS_ROUTE, $this->getRequestPath()); } protected function isAssetRequest($path) { return (strpos($path, '/assets/') === 0); } protected function getBaseUrl() { if (!isset($this->baseUrl)) { $this->baseUrl = $this->prepareBaseUrl(); } return $this->baseUrl; } protected function prepareBaseUrl() { $filename = basename($_SERVER['SCRIPT_FILENAME']); foreach (array('SCRIPT_NAME', 'PHP_SELF', 'ORIG_SCRIPT_NAME') as $key) { if (isset($_SERVER[$key]) && basename($_SERVER[$key]) == $filename) { $baseUrl = $_SERVER[$key]; break; } } if (!isset($baseUrl)) { $path = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : ''; $file = isset($_SERVER['SCRIPT_FILENAME']) ? $_SERVER['SCRIPT_FILENAME'] : ''; $chunks = array_reverse(explode('/', trim($file, '/'))); $index = 0; $last = count($chunks); $baseUrl = ''; do { $seg = $chunks[$index]; $baseUrl = '/'.$seg.$baseUrl; ++$index; } while (($last > $index) && (false !== ($pos = strpos($path, $baseUrl))) && (0 != $pos)); } $requestUri = $_SERVER['REQUEST_URI']; if ($baseUrl && 0 === strpos($requestUri, $baseUrl)) { return $baseUrl; } if ($baseUrl && 0 === strpos($requestUri, dirname($baseUrl))) { return rtrim(dirname($baseUrl), '/'); } $truncatedRequestUri = $requestUri; if (($pos = strpos($requestUri, '?')) !== false) { $truncatedRequestUri = substr($requestUri, 0, $pos); } $basename = basename($baseUrl); if (empty($basename) || !strpos($truncatedRequestUri, $basename)) { return ''; } if ((strlen($requestUri) >= strlen($baseUrl)) && ((false !== ($pos = strpos($requestUri, $baseUrl))) && ($pos !== 0))) { $baseUrl = substr($requestUri, 0, $pos + strlen($baseUrl)); } return rtrim($baseUrl, '/'); } protected function getRequestMethod() { return $_SERVER['REQUEST_METHOD']; } protected function getRequestPath() { if (isset($_SERVER['PATH_INFO'])) { return $_SERVER['PATH_INFO']; } elseif (isset($_SERVER['REQUEST_URI'])) { return parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); } else { return '/'; } } protected function getQueryParams() { global $_GET; return $_GET; } protected function getQueryParam($name, $default = null) { $params = $this->getQueryParams(); if (isset($params[$name])) { return $params[$name]; } else { return $default; } } protected function renderTemplate($name, $status = 200, array $vars = array()) { $tpl = $this->loader->loadRaw($name); $defaults = array( 'base_url' => $this->getBaseUrl(), 'genghis_version' => GENGHIS_VERSION, ); return new Genghis_Response(strtr($tpl, $this->prepareVars(array_merge($defaults, $vars))), $status); } protected function prepareVars($vars) { $ret = array(); foreach ($vars as $name => $var) { $ret['{{ '.$name.' }}'] = $var; } return $ret; } protected function getAsset($name) { try { return $this->loader->load($name); } catch (InvalidArgumentException $e) { throw new Genghis_HttpException(404); } } protected function getApi() { return new Genghis_Api; } protected function errorResponse($message, $status = 500) { return $this->renderTemplate('error.html.mustache', $status, compact('message', 'status')); } }
interface Genghis_AssetLoader { public function load($name); public function loadRaw($name); }
class Genghis_AssetLoader_Inline implements Genghis_AssetLoader { private $file; private $offset; private $assets = array(); private $assetEtags = array(); public function __construct($file, $offset) { $this->file = $file; $this->offset = $offset; } public function load($name) { $data = $this->loadRaw($name); return new Genghis_AssetResponse($name, $data, array( 'Last-Modified' => gmdate('D, d M Y H:i:s', filemtime($this->file)) . ' GMT', 'Etag' => sprintf('"%s"', $this->assetEtags[$name]), )); } public function loadRaw($name) { $this->initAssets(); if (!isset($this->assets[$name])) { throw new InvalidArgumentException(sprintf("Unknown asset: '%s'", $name)); } return $this->assets[$name]; } private function initAssets() { if (empty($this->assets)) { $data = file_get_contents($this->file, false, null, $this->offset); foreach (preg_split("/^@@(?=[\w\d\.]+( [\w\d\.]+)?$)/m", $data, -1) as $asset) { if (trim($asset)) { list($line, $content) = explode("\n", $asset, 2); list($name, $etag) = explode(' ', $line, 2); $this->assets[$name] = trim($content); $this->assetEtags[$name] = $etag; } } } } }
class Genghis_AssetResponse extends Genghis_Response { protected $headers; private static $extMap = array( 'js' => 'application/x-javascript', 'json' => 'application/json', 'css' => 'text/css', 'html' => 'text/html', 'htm' => 'text/html', 'php' => 'text/html', 'txt' => 'text/plain', ); public function __construct($name, $content, $headers = array()) { parent::__construct($content); $this->name = $name; $this->headers = array_merge(array('Content-type' => $this->getContentType()), $headers); } protected function getContentType() { $parts = explode('.', $this->name); $ext = end($parts); if (isset(self::$extMap[$ext])) { return self::$extMap[$ext]; } else { return 'unknown/' . trim($ext); } } }
class Genghis_ErrorException extends ErrorException { public function __construct($message = "", $code = 0, $severity = 1, $filename = null, $lineno = null, $previous = null) { switch ($severity) { case E_WARNING: case E_CORE_WARNING: case E_COMPILE_WARNING: case E_USER_WARNING: $type = 'warning'; break; case E_STRICT: $type = 'Strict error'; break; default: $type = 'error'; break; } $message = sprintf('PHP %s:  %s', $type, $message); parent::__construct($message, $code, $severity, $filename, $lineno, $previous); } public static function throwException($errno, $errstr, $errfile, $errline) { throw new self($errstr, 0, $errno, $errfile, $errline); } }
class Genghis_GridFsResponse extends Genghis_Response { public function renderHeaders() { $this->headers['Content-type'] = 'application/octet-stream'; $this->headers['Content-Disposition'] = 'attachment'; if ($filename = $this->data->getFilename()) { $this->headers['Content-Disposition'] .= sprintf('; filename="%s"', $filename); } parent::renderHeaders(); } public function renderContent() { if (version_compare(Mongo::VERSION, '1.3.0', '>=')) { $stream = $this->data->getResource(); while (!feof($stream)) { echo fread($stream, 8192); } } else { echo $this->data->getBytes(); } } }
class Genghis_HttpException extends Exception { protected $status; public function __construct($status = 500, $msg = '') { $this->status = $status; parent::__construct(empty($msg) ? Genghis_Response::getStatusText($status) : $msg); } public function getStatus() { return $this->status; } }
class Genghis_Json { public static function encode($object) { return json_encode(self::doEncode($object)); } private static function doEncode($object) { if (is_object($object) && $object instanceof Genghis_JsonEncodable) { $object = $object->asJson(); } if (is_object($object)) { switch (get_class($object)) { case 'MongoId': return array( '$genghisType' => 'ObjectId', '$value' => (string) $object ); case 'MongoDate': return array( '$genghisType' => 'ISODate', '$value' => date(DATE_W3C, $object->sec) ); case 'MongoRegex': return array( '$genghisType' => 'RegExp', '$value' => array( '$pattern' => $object->regex, '$flags' => $object->flags ? $object->flags : null ) ); case 'MongoBinData': return array( '$genghisType' => 'BinData', '$value' => array( '$subtype' => $object->type, '$binary' => base64_encode($object->bin), ) ); } foreach ($object as $prop => $value) { $object->$prop = self::doEncode($value); } } elseif (is_array($object)) { foreach ($object as $key => $value) { $object[$key] = self::doEncode($value); } } return $object; } public static function decode($object) { if (is_string($object)) { $object = json_decode($object); if ($object === false) { throw new Genghis_JsonException; } } return self::doDecode($object); } private static function doDecode($object) { if (is_object($object)) { if ($type = self::getProp($object, 'genghisType')) { $value = self::getProp($object, 'value'); switch ($type) { case 'ObjectId': return new MongoId($value); case 'ISODate': return ($value === null) ? new MongoDate : new MongoDate(strtotime($value)); case 'RegExp': $pattern = self::getProp($value, 'pattern'); $flags = self::getProp($value, 'flags'); return new MongoRegex(sprintf('/%s/%s', $pattern, $flags)); case 'BinData': $data = base64_decode(self::getProp($value, 'binary')); $type = self::getProp($value, 'subtype'); return new MongoBinData($data, $type); } } else { foreach ($object as $prop => $value) { $object->$prop = self::doDecode($value); } } } elseif (is_array($object)) { foreach ($object as $key => $value) { $object[$key] = self::doDecode($value); } } return $object; } private static function getProp($object, $name) { $name = sprintf('$%s', $name); return isset($object->$name) ? $object->$name : null; } }
interface Genghis_JsonEncodable { public function asJson(); }
class Genghis_JsonException extends Exception { }
class Genghis_JsonRegex { public $pattern; public function __construct($pattern) { $this->pattern = $pattern; } public function __toString() { return $this->getPattern(); } }
class Genghis_JsonResponse extends Genghis_Response { public function renderHeaders() { $this->headers['Content-type'] = 'application/json'; $this->headers['Cache-Control'] = 'no-cache, must-revalidate'; $this->headers['Expires'] = 'Wed, 04 Aug 1982 00:00:00 GMT'; parent::renderHeaders(); } public function renderContent() { print(Genghis_Json::encode($this->data)); } }
class Genghis_Models_Collection implements ArrayAccess, Genghis_JsonEncodable { public $database; public $collection; public function __construct(Genghis_Models_Database $database, MongoCollection $collection) { $this->database = $database; $this->collection = $collection; } public function offsetExists($id) { try { $this->findDocument($id); } catch (Genghis_HttpException $e) { if ($e->getStatus() == 404) { return false; } else { throw $e; } } return true; } public function offsetGet($id) { return $this->findDocument($id); } public function offsetSet($id, $doc) { $this->findDocument($id); $query = array('_id' => $this->thunkMongoId($id)); try { $result = $this->collection->update($query, $doc, array('safe' => true)); } catch (MongoCursorException $e) { throw new Genghis_HttpException(400, ucfirst($e->doc['err'])); } if (!(isset($result['ok']) && $result['ok'])) { throw new Genghis_HttpException; } } public function offsetUnset($id) { $this->findDocument($id); $query = array('_id' => $this->thunkMongoId($id)); $result = $this->collection->remove($query, array('safe' => true)); if (!(isset($result['ok']) && $result['ok'])) { throw new Genghis_HttpException; } } public function getFile($id) { $mongoId = $this->thunkMongoId($id); if (!$mongoId instanceof MongoId) { throw new Genghis_HttpException(404, sprintf("GridFS file '%s' not found", $id)); } $file = $this->getGrid()->get($mongoId); if (!$file) { throw new Genghis_HttpException(404, sprintf("GridFS file '%s' not found", $id)); } return $file; } public function putFile($doc) { $grid = $this->getGrid(); if (!property_exists($doc, 'file')) { throw new Genghis_HttpException(400, 'Missing file'); } $file = $doc->file; unset($doc->file); $extra = array(); foreach ($doc as $key => $val) { if (!in_array($key, array('_id', 'filename', 'contentType', 'metadata'))) { throw new Genghis_HttpException(400, sprintf("Unexpected property: '%s'", $key)); } if ($key === 'metadata') { $encoded = json_encode($val); if ($encoded == '{}' || $encoded == '[]') { continue; } } $extra[$key] = $val; } $id = $grid->storeBytes($this->decodeFile($file), $extra); return $this->findDocument($id); } public function deleteFile($id) { $mongoId = $this->thunkMongoId($id); if (!$mongoId instanceof MongoId) { throw new Genghis_HttpException(404, sprintf("GridFS file '%s' not found", $id)); } $grid = $this->getGrid(); $file = $grid->get($mongoId); if (!$file) { throw new Genghis_HttpException(404, sprintf("GridFS file '%s' not found", $id)); } $result = $grid->delete($mongoId); if (!$result) { throw new Genghis_HttpException; } } public function findDocuments($query = null, $page = 1) { try { $query = Genghis_Json::decode($query); } catch (Genghis_JsonException $e) { throw new Genghis_HttpException(400, 'Malformed document'); } $offset = Genghis_Api::PAGE_LIMIT * ($page - 1); $cursor = $this->collection ->find($query ? $query : array()) ->limit(Genghis_Api::PAGE_LIMIT) ->skip($offset); $count = $cursor->count(); if (is_array($count) && isset($count['errmsg'])) { throw new Genghis_HttpException(400, $count['errmsg']); } $documents = array(); foreach ($cursor as $doc) { $documents[] = $doc; } return array( 'count' => $count, 'page' => $page, 'pages' => max(1, ceil($count / Genghis_Api::PAGE_LIMIT)), 'per_page' => Genghis_Api::PAGE_LIMIT, 'offset' => $offset, 'documents' => $documents, ); } public function insert($data) { try { $result = $this->collection->insert($data, array('safe' => true)); } catch (MongoCursorException $e) { throw new Genghis_HttpException(400, ucfirst($e->doc['err'])); } if (!(isset($result['ok']) && $result['ok'])) { throw new Genghis_HttpException; } return $data; } public function drop() { $this->collection->drop(); } public function asJson() { $name = $this->collection->getName(); $colls = $this->database->database->listCollections(); foreach ($colls as $coll) { if ($coll->getName() == $name) { return array( 'id' => $coll->getName(), 'name' => $coll->getName(), 'count' => $coll->count(), 'indexes' => $coll->getIndexInfo(), ); } } throw new Genghis_HttpException(404, sprintf("Collection '%s' not found in '%s'", $name, $this->database->name)); } private function thunkMongoId($id) { if ($id instanceof MongoId) { return $id; } if ($id[0] == '~') { return Genghis_Json::decode(base64_decode(substr($id, 1))); } return preg_match('/^[a-f0-9]{24}$/i', $id) ? new MongoId($id) : $id; } private function findDocument($id) { $doc = $this->collection->findOne(array('_id' => $this->thunkMongoId($id))); if (!$doc) { throw new Genghis_HttpException(404, sprintf("Document '%s' not found in '%s'", $id, $this->collection->getName())); } return $doc; } private function isGridCollection() { return preg_match('/\.files$/', $this->collection->getName()); } private function getGrid() { if (!($this->isGridCollection())) { $msg = sprintf("GridFS collection '%s' not found in '%s'", $this->collection->getName(), $this->database->name); throw new Genghis_HttpException(404, $msg); } if (!isset($this->grid)) { $prefix = preg_replace('/\.files$/', '', $this->collection->getName()); $this->grid = $this->database->database->getGridFS($prefix); } return $this->grid; } private function decodeFile($data) { $count = 0; $data = preg_replace('/^data:[^;]+;base64,/', '', $data, 1, $count); if ($count !== 1) { throw new Genghis_HttpException(400, 'File must be a base64 encoded data: URI'); } return base64_decode(str_replace(' ', '+', $data)); } }
class Genghis_Models_Database implements ArrayAccess, Genghis_JsonEncodable { public $name; public $server; public $database; private $collections = array(); private $mongoCollections; public function __construct(Genghis_Models_Server $server, MongoDB $database) { $this->server = $server; $this->database = $database; $this->name = (string) $database; } public function drop() { $this->database->drop(); } public function offsetExists($name) { return ($this->getMongoCollection($name) !== null); } public function offsetGet($name) { if (!isset($this->collections[$name])) { $coll = $this->getMongoCollection($name); if ($coll === null) { throw new Genghis_HttpException(404, sprintf("Collection '%s' not found in '%s'", $name, $this->name)); } $this->collections[$name] = new Genghis_Models_Collection($this, $coll); } return $this->collections[$name]; } public function offsetSet($name, $value) { throw new Exception; } public function offsetUnset($name) { $this[$name]->drop(); } public function getCollectionNames() { $colls = array(); foreach ($this->getMongoCollections() as $coll) { $colls[] = $coll->getName(); } return $colls; } public function listCollections() { return array_map(array($this, 'offsetGet'), $this->getCollectionNames()); } public function createCollection($name) { if (isset($this[$name])) { throw new Genghis_HttpException(400, sprintf("Collection '%s' already exists in '%s'", $name, $this->name)); } try { $this->database->createCollection($name); } catch (Exception $e) { if (strpos($e->getMessage(), 'invalid name') !== false) { throw new Genghis_HttpException(400, 'Invalid collection name'); } throw $e; } unset($this->mongoCollections); return $this[$name]; } public function asJson() { $dbs = $this->server->getConnection()->listDBs(); foreach ($dbs['databases'] as $db) { if ($db['name'] == $this->name) { $colls = $this->getCollectionNames(); return array( 'id' => $db['name'], 'name' => $db['name'], 'count' => count($colls), 'collections' => $colls, 'size' => $db['sizeOnDisk'], ); } } throw new Genghis_HttpException(404, sprintf("Database '%s' not found on '%s'", $database, $server)); } private function getMongoCollection($name) { foreach ($this->getMongoCollections() as $coll) { if ($coll->getName() === $name) { return $coll; } } } private function getMongoCollections() { if (!isset($this->mongoCollections)) { $this->mongoCollections = $this->database->listCollections(); } return $this->mongoCollections; } }
class Genghis_Models_Server implements ArrayAccess, Genghis_JsonEncodable { public $dsn; public $name; public $options; public $default; public $db; private $connection; private $databases = array(); public function __construct($dsn, $default = false) { $this->default = $default; try { $config = self::parseDsn($dsn); $this->name = $config['name']; $this->dsn = $config['dsn']; $this->options = $config['options']; if (isset($config['db'])) { $this->db = $config['db']; } } catch (Genghis_HttpException $e) { $this->name = $dsn; $this->dsn = $dsn; $this->error = $e->getMessage(); } } public function offsetExists($name) { $list = $this->listDBs(); foreach ($list['databases'] as $db) { if ($db['name'] === $name) { return true; } } return false; } public function offsetGet($name) { if (!isset($this[$name])) { throw new Genghis_HttpException(404, sprintf("Database '%s' not found on '%s'", $name, $this->name)); } if (!isset($this->databases[$name])) { $this->databases[$name] = new Genghis_Models_Database($this, $this->getConnection()->selectDB($name)); } return $this->databases[$name]; } public function getConnection() { if (!isset($this->connection)) { $this->connection = new Mongo($this->dsn, array_merge(array('timeout' => 1000), $this->options)); } return $this->connection; } public function createDatabase($name) { if (isset($this[$name])) { throw new Genghis_HttpException(400, sprintf("Database '%s' already exists on '%s'", $name, $this->name)); } try { $db = $this->connection->selectDB($name); } catch (Exception $e) { if (strpos($e->getMessage(), 'invalid name') !== false) { throw new Genghis_HttpException(400, 'Invalid database name'); } throw $e; } $db->selectCollection('__genghis_tmp_collection__')->drop(); return $this[$name]; } public function listDatabases() { $dbs = array(); $list = $this->listDBs(); foreach ($list['databases'] as $db) { $dbs[] = $this[$db['name']]; } return $dbs; } public function getDatabaseNames() { $names = array(); $list = $this->listDBs(); foreach ($list['databases'] as $db) { $names[] = $db['name']; } return $names; } public function offsetSet($name, $value) { throw new Exception; } public function offsetUnset($name) { $this[$name]->drop(); } public function asJson() { $server = array( 'id' => $this->name, 'name' => $this->name, 'editable' => !$this->default, ); if (isset($this->error)) { $server['error'] = $this->error; return $server; } try { $res = $this->listDBs(); if (isset($res['errmsg'])) { $server['error'] = sprintf("Unable to connect to Mongo server at '%s': %s", $this->name, $res['errmsg']); return $server; } $dbs = $this->getDatabaseNames(); return array_merge($server, array( 'size' => $res['totalSize'], 'count' => count($dbs), 'databases' => $dbs, )); } catch (Exception $e) { $server['error'] = sprintf("Unable to connect to Mongo server at '%s'", $this->name); return $server; } } const DSN_PATTERN = "~^(?:mongodb://)?(?:(?P<username>[^:@]+):(?P<password>[^@]+)@)?(?P<host>[^,/@:]+)(?::(?P<port>\d+))?(?:/(?P<database>[^\?]+)?(?:\?(?P<options>.*))?)?$~"; public static function parseDsn($dsn) { $chunks = array(); if (!preg_match(self::DSN_PATTERN, $dsn, $chunks)) { throw new Genghis_HttpException(400, 'Malformed server DSN'); } if (strpos($dsn, 'mongodb://') !== 0) { $dsn = 'mongodb://'.$dsn; } $options = array(); if (isset($chunks['options'])) { parse_str($chunks['options'], str_replace(';', '&', $options)); foreach ($options as $name => $value) { switch ($name) { case 'replicaSet': $options['replicaSet'] = (string) $value; break; case 'connectTimeoutMS': $options['timeout'] = intval($value); break; case 'slaveOk': case 'safe': case 'w': case 'wtimeoutMS': case 'fsync': case 'journal': case 'socketTimeoutMS': throw new Genghis_HttpException(400, 'Unsupported connection option - ' . $name); default: throw new Genghis_HttpException(400, 'Malformed server DSN: Unknown connection option - ' . $name); } } } $name = $chunks['host']; if (isset($chunks['username']) && !empty($chunks['username'])) { $name = $chunks['username'].'@'.$name; } if (isset($chunks['port']) && !empty($chunks['port'])) { $port = intval($chunks['port']); if ($port !== 27017) { $name .= ':'.$port; } } if (isset($chunks['database']) && !empty($chunks['database']) && $chunks['database'] != 'admin') { $db = $chunks['database']; $name .= '/'.$db; } $ret = compact('name', 'dsn', 'options'); if (isset($db)) { $ret['db'] = $db; } return $ret; } private function listDbs() { if (isset($this->db)) { $stats = $this->getConnection() ->selectDB($this->db) ->command(array('dbStats' => true)); return array( 'totalSize' => $stats['fileSize'], 'databases' => array(array('name' => $this->db)), ); } return $this->getConnection()->listDBs(); } }
class Genghis_RedirectResponse extends Genghis_Response { public function __construct($url, $status = 301) { parent::__construct($url, $status); } public function render() { header(sprintf('Location: %s', $this->data), $this->status); } }
class Genghis_Response { protected static $statusCodes = array( 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 204 => 'No Content', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 400 => 'Bad Request', 401 => 'Unauthorized', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 412 => 'Precondition Failed', 415 => 'Unsupported Media Type', 417 => 'Expectation Failed', 500 => 'Internal Server Error', 501 => 'Not Implemented', ); protected $data = ''; protected $status = 200; protected $headers = array(); public function __construct($data, $status = 200, $headers = array()) { $this->data = $data; $this->status = $status; $this->headers = $headers; } public function render() { $this->renderHeaders(); $this->renderContent(); } public static function getStatusText($status) { if (isset(self::$statusCodes[$status])) { return self::$statusCodes[$status]; } } protected function renderHeaders() { header(sprintf('HTTP/1.0 %s %s', $this->status, self::$statusCodes[$this->status])); foreach ($this->headers as $name => $val) { header(sprintf('%s: %s', $name, $val)); } } protected function renderContent() { print((string) $this->data); } }
class Genghis_ServerCollection implements ArrayAccess, Genghis_JsonEncodable { private $serverDsns; private $servers; private $defaultServerDsns; private $defaultServers; public function __construct(array $servers = null, array $defaultServers = null) { $this->serverDsns = $servers; $this->defaultServerDsns = $defaultServers; } public function offsetExists($name) { $this->initDsns(); return isset($this->serverDsns[$name]) || isset($this->defaultServerDsns[$name]); } public function offsetGet($name) { $this->initServers(); if (!isset($this[$name])) { throw new Genghis_HttpException(404, sprintf("Server '%s' not found", $name)); } if (!isset($this->servers[$name])) { if (isset($this->serverDsns[$name])) { $this->servers[$name] = new Genghis_Models_Server($this->serverDsns[$name]); } elseif (isset($this->defaultServerDsns[$name])) { $this->servers[$name] = new Genghis_Models_Server($this->defaultServerDsns[$name], true); } } return $this->servers[$name]; } public function offsetSet($name, $server) { $this->initServers(); if (!$server instanceof Genghis_Models_Server) { throw new Exception('Invalid Server instance'); } if (isset($this->serverDsns[$server->name])) { throw new Genghis_HttpException(400, sprintf("Server '%s' already exists", $server->name)); } $this->serverDsns[$server->name] = $server->dsn; $this->servers[$server->name] = $server; $this->saveServers(); } public function offsetUnset($name) { $this->initServers(); if (!isset($this->servers[$name])) { throw new Genghis_HttpException(404, sprintf("Server '%s' not found", $name)); } unset($this->servers[$name]); $this->saveServers(); } public function asJson() { $this->initServers(); return array_values($this->servers); } private function initDsns() { if (!isset($this->serverDsns)) { $this->serverDsns = array(); if (isset($_COOKIE['genghis_servers']) && $localDsns = $this->decodeJson($_COOKIE['genghis_servers'])) { foreach (array_map(array('Genghis_Models_Server', 'parseDsn'), $localDsns) as $info) { $this->serverDsns[$info['name']] = $info['dsn']; } } } if (!isset($this->defaultServerDsns)) { $this->defaultServerDsns = array(); $defaultDsns = array_merge( isset($_ENV['GENGHIS_SERVERS']) ? explode(';', $_ENV['GENGHIS_SERVERS']) : array(), isset($_SERVER['GENGHIS_SERVERS']) ? explode(';', $_SERVER['GENGHIS_SERVERS']) : array() ); foreach (array_map(array('Genghis_Models_Server', 'parseDsn'), $defaultDsns) as $info) { $this->defaultServerDsns[$info['name']] = $info['dsn']; } } if (empty($this->serverDsns) && empty($this->defaultServerDsns)) { $this[] = new Genghis_Models_Server('localhost:27017'); } } private function initServers() { if (!isset($this->servers)) { $this->servers = array(); $this->initDsns(); foreach (array_merge(array_keys($this->serverDsns), array_keys($this->defaultServerDsns)) as $name) { $this[$name]; } } } private function decodeJson($data) { $json = json_decode($data, true); if ($json === false && trim($data) != '') { throw new Genghis_HttpException(400, 'Malformed document'); } return $json; } private function saveServers() { $servers = array(); foreach ($this->servers as $server) { if (!$server->default) { $servers[] = $server->dsn; } } setcookie('genghis_servers', json_encode($servers), time()+60*60*24*365, '/'); } }


$app = new Genghis_App(new Genghis_AssetLoader_Inline(__FILE__, __COMPILER_HALT_OFFSET__));
$app->run();

__halt_compiler();

@@index.html.mustache 73de28ffe6fa3e7e3fe06de0c884ee1a
<!DOCTYPE html> <html> <head> <meta charset="utf-8"/> <title>Genghis</title> <link rel="shortcut icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAME2lDQ1BJQ0MgUHJvZmlsZQAASA2tV2dYU8kanlNSCAktEAEpoTdRepVeAyhIFWyEJCShhBAIKvayqMBaUBHBiq6K2NYCyFoQK8oi2PsGEQVlXSzYULlzKOrevfvvnueZOe95553v++abOfPMAKDSypVKM1A1ADIlubLoEH/25MQkNuUBoAJtQAcWgMHl5Uj9oqIiwL8+724BhGi8bkvY+lfZ/25Q5wtyeAAgUbA5hZ/Dy4T4KABYHU8qywWARNgznZkrJfBqiDVlMECIdxJYOITrCJwyhJsHNbHRAVCjAIBK53JlQgAYPZBn5/GE0I4KHWI7CV8sgXg8xN48EZcP8VyIx2RmZhF4D8SWKT/YEf6AudyUbza5XOE3PDQW2BM6DhTnSDO4swc//p9VZoYc5mvwMYA1PSc9Jhy+WTBvs3jcoBiItSFeKRJwIob5XdJc/+hh/oQ4lxMLsSbU3BDJQ+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YvseN2d9hso2xjiKyUInHDzyu3Rhs+cIr2Ap+w5Yqh9uQJzeJgBK2V0MXYfSwU/0YCPiuAMSrOY28eOOXx9dspCkesPddX/fgVsoRkZa2671kYE6UT/L1UUpUS3CGhxzKsn0gqy8eWZy5OgJwtckbf2G/ufLpX06BtN0xz4VGMjWYuXnfaCvwwoWEmWoDgfSy55turdE+f3b81UwAJRQ8cH6y59cmUCBRY452grvoRm6bda/+qPywpW/bToK/A3zGAg92hvS/PVy1caGts6GqeGC9Pz0pJTE7OWr1q1/mtPbSgvyhZf+6hrhmPVtec+rL0dDBbjf3wEXPiKAwefy0gq/dGyNdE5xEgrou67+9fq0fZTh08OixgIxahDKOCpwCbrB+TlX5a1WB2FafnwsSRMgiTxXh88c94+bfik6po9jhU5PgIAiYK4U29Slj+q6pzs9slzCtQJSPCiGrHk3fOGc41en7nm9OlOyKVqFG+pqsj/KTGun9wyVNdFryzJsbh66yzTOmValhK2mkRJG1Ixts6RuqPGtgmWHDh74vR1U1xI/MZJ8UziUF5QYDDdpl071hT7b9s5ma40deVjutwctSbygxHfJ1j2gc8fDlOHxaB3TflldlPjhyea0Bb+YIzZ//MnEAhApJd8e9sTy0L3LrhUp0zPVadlKnVamUIpk5KkRyrXyjAfSXnslHXSYxnzTFmCL6m4zz787/oz9Z0RsNCr/yuBQCZPUu5X161Z9nB2ekrsewTgwoDPH0bTYGvX1Vv96FihlnhiBfzWFmodU8hhquz8vAeXZqRkpKq1CtAFlN0t0YAeoHwut8tmsZonxgcGhud7jSUEcI8JCBMstAT1MLfQOOYdH+16fd7hF9oRB5duYC1dpM8M8pkhtHg5zL0PLDoOQcCLcxIH0YOxzzuZB6RxHAT/H1OHBz2Q/r/iZq+07nQhoQAAAABJRU5ErkJggg=="> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link type="text/css" rel="stylesheet" href="//fonts.googleapis.com/css?family=Rokkitt:400,700|Source+Code+Pro"> <link type="text/css" rel="stylesheet" href="{{ base_url }}/assets/style.css?v={{ genghis_version }}"> <script type="text/javascript" src="{{ base_url }}/assets/script.js?v={{ genghis_version }}"></script> <script type="text/javascript">jQuery(function() { Genghis.boot('{{ base_url }}'); });</script> </head> <body> <header class="navbar navbar-fixed-top"> <div class="navbar-inner"> <div class="container fixed"> <a class="magic brand" href="{{ base_url }}/">Genghis</a> <nav></nav> </div> </div> </header> <noscript><h1>You won&#146;t get far in life without JavaScript&hellip;</h1></noscript> <section id="genghis" class="container fluid"> <aside id="alerts"></aside> <section id="servers" class="app-section"></section> <section id="databases" class="app-section"></section> <section id="collections" class="app-section"></section> <section id="documents" class="app-section"></section> <section id="document" class="app-section"><header></header></section> <section id="error" class="app-section"></section> </section> <footer id="footer" class="container"> <p><a href="http://genghisapp.com">Genghis</a>, by <a href="http://justinhileman.info">Justin Hileman</a>.</p> <p><a class="keyboard-shortcuts" href="#">Keyboard shortcuts available <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAALCAYAAACd1bY6AAAEJGlDQ1BJQ0MgUHJvZmlsZQAAOBGFVd9v21QUPolvUqQWPyBYR4eKxa9VU1u5GxqtxgZJk6XtShal6dgqJOQ6N4mpGwfb6baqT3uBNwb8AUDZAw9IPCENBmJ72fbAtElThyqqSUh76MQPISbtBVXhu3ZiJ1PEXPX6yznfOec7517bRD1fabWaGVWIlquunc8klZOnFpSeTYrSs9RLA9Sr6U4tkcvNEi7BFffO6+EdigjL7ZHu/k72I796i9zRiSJPwG4VHX0Z+AxRzNRrtksUvwf7+Gm3BtzzHPDTNgQCqwKXfZwSeNHHJz1OIT8JjtAq6xWtCLwGPLzYZi+3YV8DGMiT4VVuG7oiZpGzrZJhcs/hL49xtzH/Dy6bdfTsXYNY+5yluWO4D4neK/ZUvok/17X0HPBLsF+vuUlhfwX4j/rSfAJ4H1H0qZJ9dN7nR19frRTeBt4Fe9FwpwtN+2p1MXscGLHR9SXrmMgjONd1ZxKzpBeA71b4tNhj6JGoyFNp4GHgwUp9qplfmnFW5oTdy7Nam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5CYII="></a></p> </footer> </body> </html>

@@error.html.mustache 1a1cee9ea37368bf1001c4eb5f99b273
<!DOCTYPE html> <html> <head> <meta charset="utf-8"/> <title>Genghis &mdash; {{ status }}: {{ message }}</title> <link rel="shortcut icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAME2lDQ1BJQ0MgUHJvZmlsZQAASA2tV2dYU8kanlNSCAktEAEpoTdRepVeAyhIFWyEJCShhBAIKvayqMBaUBHBiq6K2NYCyFoQK8oi2PsGEQVlXSzYULlzKOrevfvvnueZOe95553v++abOfPMAKDSypVKM1A1ADIlubLoEH/25MQkNuUBoAJtQAcWgMHl5Uj9oqIiwL8+724BhGi8bkvY+lfZ/25Q5wtyeAAgUbA5hZ/Dy4T4KABYHU8qywWARNgznZkrJfBqiDVlMECIdxJYOITrCJwyhJsHNbHRAVCjAIBK53JlQgAYPZBn5/GE0I4KHWI7CV8sgXg8xN48EZcP8VyIx2RmZhF4D8SWKT/YEf6AudyUbza5XOE3PDQW2BM6DhTnSDO4swc//p9VZoYc5mvwMYA1PSc9Jhy+WTBvs3jcoBiItSFeKRJwIob5XdJc/+hh/oQ4lxMLsSbU3BDJQ+OGcZc8Pc4PYj3If07PCif0ME+otiRlYiTEGhCb8nICYO4JX6hLvig2YVgTwRcEBkEMVxE6WZYVPaIX5eTFjPD5+aKAiSP6NG4YMd8qUF/IlUE0GA9aJsgIIfwaQ36fNDeKiJPw1SLJmDg8FvRJqiyY0BD8J0HO4HiJ2ES5othQyMOYMbVcWSyhgWPE9FLFwRyIYWyYnUgWOsL7SjMG1zTsi8XK5NFEHkwhThVI4ogcEnwhnxtI5BbmBNsEggEXyIAApAAJ6AZsEAECQOBwzYa8BHI8kAUyYJGxVUdaSE9JbaTHpJskBenuCAd7DuuAGPAhHrL1Q3/Ix4B88Ce0KgA5I95wXdwb98QjYO0LiwPuhruPtLX01PaM4OFYhbCv7bBt/+Ho86DFLyO6GeLFshE83C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po9jhU5PgIAiYK4U29Slj+q6pzs9slzCtQJSPCiGrHk3fOGc41en7nm9OlOyKVqFG+pqsj/KTGun9wyVNdFryzJsbh66yzTOmValhK2mkRJG1Ixts6RuqPGtgmWHDh74vR1U1xI/MZJ8UziUF5QYDDdpl071hT7b9s5ma40deVjutwctSbygxHfJ1j2gc8fDlOHxaB3TflldlPjhyea0Bb+YIzZ//MnEAhApJd8e9sTy0L3LrhUp0zPVadlKnVamUIpk5KkRyrXyjAfSXnslHXSYxnzTFmCL6m4zz787/oz9Z0RsNCr/yuBQCZPUu5X161Z9nB2ekrsewTgwoDPH0bTYGvX1Vv96FihlnhiBfzWFmodU8hhquz8vAeXZqRkpKq1CtAFlN0t0YAeoHwut8tmsZonxgcGhud7jSUEcI8JCBMstAT1MLfQOOYdH+16fd7hF9oRB5duYC1dpM8M8pkhtHg5zL0PLDoOQcCLcxIH0YOxzzuZB6RxHAT/H1OHBz2Q/r/iZq+07nQhoQAAAABJRU5ErkJggg=="> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link type="text/css" rel="stylesheet" href="//fonts.googleapis.com/css?family=Rokkitt:400,700|Source+Code+Pro"> <link type="text/css" rel="stylesheet" href="{{ base_url }}/assets/style.css?v={{ genghis_version }}"> </head> <body> <header class="navbar navbar-fixed-top"> <div class="navbar-inner"> <div class="container fixed"> <a class="magic brand" href="{{ base_url }}/">Genghis</a> <nav></nav> </div> </div> </header> <header class="masthead epic error"> <div class="container"> <h1>{{ status }}: {{ message }}</h1> <p> If you think you've reached this message in error, please press <strong>0</strong> to speak with an operator. Otherwise, hang up and try again. </p> </div> </header> <section id="genghis" class="container fluid"></section> <footer id="footer" class="container"> <p><a href="http://genghisapp.com">Genghis</a>, by <a href="http://justinhileman.info">Justin Hileman</a>.</p> </footer> </body> </html>

@@style.css 9fd0cfe99570a44674d935bd2cd6411a
/**
 * Genghis v2.2.1
 *
 * The single-file MongoDB admin app
 *
 * http://genghisapp.com
 *
 * @author Justin Hileman <hide@address.com>
 */
.CodeMirror{line-height:1em;font-family:monospace;position:relative;overflow:hidden}.CodeMirror-scroll{overflow:auto;height:300px;position:relative;outline:none}.CodeMirror-scrollbar{position:absolute;right:0;top:0;overflow-x:hidden;overflow-y:scroll;z-index:5}.CodeMirror-scrollbar-inner{width:1px}.CodeMirror-scrollbar.cm-sb-overlap{position:absolute;z-index:1;float:none;right:0;min-width:12px}.CodeMirror-scrollbar.cm-sb-nonoverlap{min-width:12px}.CodeMirror-scrollbar.cm-sb-ie7{min-width:18px}.CodeMirror-gutter{position:absolute;left:0;top:0;z-index:10;background-color:#f7f7f7;border-right:1px solid #eee;min-width:2em;height:100%}.CodeMirror-gutter-text{color:#aaa;text-align:right;padding:.4em .2em .4em .4em;white-space:pre !important;cursor:default}.CodeMirror-lines{padding:.4em;white-space:pre;cursor:text}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;-o-border-radius:0;border-radius:0;border-width:0;margin:0;padding:0;background:transparent;font-family:inherit;font-size:inherit;padding:0;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;overflow:visible}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-wrap .CodeMirror-scroll{overflow-x:hidden}.CodeMirror textarea{outline:none !important}.CodeMirror pre.CodeMirror-cursor{z-index:10;position:absolute;visibility:hidden;border-left:1px solid black;border-right:none;width:0}.cm-keymap-fat-cursor pre.CodeMirror-cursor{width:auto;border:0;background:transparent;background:rgba(0,200,0,.4);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800,endColorstr=#4c00c800)}.cm-keymap-fat-cursor pre.CodeMirror-cursor:not(#nonsense_id){filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite{}.CodeMirror-focused pre.CodeMirror-cursor{visibility:visible}div.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused div.CodeMirror-selected{background:#d7d4f0}.CodeMirror-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-s-default span.cm-keyword{color:#708}.cm-s-default span.cm-atom{color:#219}.cm-s-default span.cm-number{color:#164}.cm-s-default span.cm-def{color:#00f}.cm-s-default span.cm-variable{color:#000}.cm-s-default span.cm-variable-2{color:#05a}.cm-s-default span.cm-variable-3{color:#085}.cm-s-default span.cm-property{color:#000}.cm-s-default span.cm-operator{color:#000}.cm-s-default span.cm-comment{color:#a50}.cm-s-default span.cm-string{color:#a11}.cm-s-default span.cm-string-2{color:#f50}.cm-s-default span.cm-meta{color:#555}.cm-s-default span.cm-error{color:red}.cm-s-default span.cm-qualifier{color:#555}.cm-s-default span.cm-builtin{color:#30a}.cm-s-default span.cm-bracket{color:#997}.cm-s-default span.cm-tag{color:#170}.cm-s-default span.cm-attribute{color:#00c}.cm-s-default span.cm-header{color:blue}.cm-s-default span.cm-quote{color:#090}.cm-s-default span.cm-hr{color:#999}.cm-s-default span.cm-link{color:#00c}span.cm-negative{color:#d44}span.cm-positive{color:#292}span.cm-header,span.cm-strong{font-weight:700}span.cm-em{font-style:italic}span.cm-emstrong{font-style:italic;font-weight:700}span.cm-link{text-decoration:underline}span.cm-invalidchar{color:red}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}@media print{.CodeMirror pre.CodeMirror-cursor{visibility:hidden}}kbd,.key{display:inline;display:inline-block;min-width:1em;padding:.2em .3em;font:400 .85em/1 "Lucida Grande",Lucida,Arial,sans-serif;text-align:center;text-decoration:none;-moz-border-radius:.3em;-webkit-border-radius:.3em;border-radius:.3em;border:none;cursor:default;-moz-user-select:none;-webkit-user-select:none;user-select:none}kbd[title],.key[title]{cursor:help}kbd,kbd.dark,.dark-keys kbd,.key,.key.dark,.dark-keys .key{background:#505050;background:-moz-linear-gradient(top,#3c3c3c,#505050);background:-webkit-gradient(linear,left top,left bottom,from(#3c3c3c),to(#505050));color:#fafafa;text-shadow:-1px -1px 0 #464646;-moz-box-shadow:inset 0 0 1px #969696,inset 0 -.05em .4em #505050,0 .1em 0 #1e1e1e,0 .1em .1em rgba(0,0,0,.3);-webkit-box-shadow:inset 0 0 1px #969696,inset 0 -.05em .4em #505050,0 .1em 0 #1e1e1e,0 .1em .1em rgba(0,0,0,.3);box-shadow:inset 0 0 1px #969696,inset 0 -.05em .4em #505050,0 .1em 0 #1e1e1e,0 .1em .1em rgba(0,0,0,.3)}kbd.light,.light-keys kbd,.key.light,.light-keys .key{background:#fafafa;background:-moz-linear-gradient(top,#d2d2d2,#fff);background:-webkit-gradient(linear,left top,left bottom,from(#d2d2d2),to(#fff));color:#323232;text-shadow:0 0 2px#fff;-moz-box-shadow:inset 0 0 1px#fff,inset 0 0 .4em #c8c8c8,0 .1em 0 #828282,0 .11em 0 rgba(0,0,0,.4),0 .1em .11em rgba(0,0,0,.9);-webkit-box-shadow:inset 0 0 1px#fff,inset 0 0 .4em #c8c8c8,0 .1em 0 #828282,0 .11em 0 rgba(0,0,0,.4),0 .1em .11em rgba(0,0,0,.9);box-shadow:inset 0 0 1px#fff,inset 0 0 .4em #c8c8c8,0 .1em 0 #828282,0 .11em 0 rgba(0,0,0,.4),0 .1em .11em rgba(0,0,0,.9)}html,body{background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPwAAADmBAMAAAADyPWpAAAAHlBMVEUAAAAAAAAAAAAAAAD///8AAAAAAAAAAAAAAAAAAAAzn7ZSAAAACnRSTlMEAgEFAAMGBwgJHK6+iAAAAjVJREFUeF7t3TFvEzEYh3EnUQJjoaRzCGS/ChW6UsF+pc0eCSkwVqrUwhcAPjZT38fDKzmKuBvQ858qy/bP9mT57LTcvIu8iHxZP2VVIl8Prrmj0TpyHW1OIf9zXl5eXl5eXl5+uX1Kv41gzuC7rHASnS4bzdOBlk+Rj/AMr2tMFP4lPb2OwhOg24CuWJIheXl5eXl5eXl5ef5cpbtKxoR0ktUs1JyzfYV/xTwLSUdaSfDMfsOSoC9YsgsaMbu3wX8eh5eXl5eXl5eXl+9pn/IU7pD2kfswP1B4l/U5ZfRAR53pXj5GKgl+ly3JOcevLMmQvLy8vLy8vLy8fN/YQNL+d5g/4X+F+Q3+Lv/+HmGe1Ub7LO0U/gEpW5L31JykEx2bl5eXl5eXl5eXr25w7iPsKn/AVxL8njQ+oJNZIdPspBYTqVXzonF9AGg1Di8vLy8vLy8vL89h43wdKUd8VS/byDV8Bj17jBQyZ/gMZNO4KpoUNtfpchxeXl5eXl5eXl5+S7K94pL2VLjJvsqfUpjuP9lqPv8TKckF0vSpU3v7nPGz7KLrm31kQF5eXl5eXl5eXj5/rdMdcVa5OHiruaj4/AIpVQc4/a1qDsnLy8vLy8vLy8t3UNkBZj/Ap/ZFSQPP7vuKwn92+rsEGoOXl5eXl5eXl5fPfywp/133CXzVP3z6fr5rvEo6qx/AR7JO1/D9EYtX6GhIXl5eXl5eXl5eHvM7fPUAvvEviOBn1Jwz5orPav4FxfqDRAI+1ZEAAAAASUVORK5CYII=')}.navbar-search .grippie{background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAICAYAAAA4GpVBAAAAFklEQVQIHWPYvXv3f4b/QAAiGBhwcQEh7xt/uRvGTgAAAABJRU5ErkJggg==')}.nav .dropdown,.navbar-search{background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAiCAQAAADMxIBtAAABMklEQVQoz2P4z8jA9J+JARUABdj+s2EIerI3cKEJ/2e8zyHE918AXS2njNBFsf+sqIKsfUJJUv9F0Qz4KMSh+EkNzQ3/+Vzktqv/F0IVZNsm46bzXwPdMgkB/Tdm/znQDEjT6DP7r4QqyHJZWdvmvy3Q0yjCUnoW513/i6EK8jcY1bj9N0Uz4KGWktenAHTLZDwctgShOew//2yLqNAfXiiW/eefahUf9t8dVaWcq/Pu4P/KKGF1VVvH+6c/ShD+Fyo06XL7r4emWdb2scd/PmQh9nVqjtb/zVHVCTlqbzD/L4ES9t+kuYx+maOE/X/OcrlC7f8KaJrllB5o/mdHSQ7XheUVURwN0hwotkgOxTFAQR4G8f9SaGlpM1eUILo6NnHuG7zoCYEFmBQ50GMcS6IFAAXadPqU82J+AAAAAElFTkSuQmCC')}section#servers tr.spinning td:first-child{background-image:url('data:image/gif;base64,R0lGODlhEAALAPQAAP///zMzM+Hh4dnZ2e7u7jc3NzMzM1dXV5qamn9/f8fHx05OTm5ubqGhoYKCgsrKylFRUTY2NnFxcerq6t/f3/b29l9fX+Li4vT09MTExLKystTU1PHx8QAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCwAAACwAAAAAEAALAAAFLSAgjmRpnqSgCuLKAq5AEIM4zDVw03ve27ifDgfkEYe04kDIDC5zrtYKRa2WQgAh+QQJCwAAACwAAAAAEAALAAAFJGBhGAVgnqhpHIeRvsDawqns0qeN5+y967tYLyicBYE7EYkYAgAh+QQJCwAAACwAAAAAEAALAAAFNiAgjothLOOIJAkiGgxjpGKiKMkbz7SN6zIawJcDwIK9W/HISxGBzdHTuBNOmcJVCyoUlk7CEAAh+QQJCwAAACwAAAAAEAALAAAFNSAgjqQIRRFUAo3jNGIkSdHqPI8Tz3V55zuaDacDyIQ+YrBH+hWPzJFzOQQaeavWi7oqnVIhACH5BAkLAAAALAAAAAAQAAsAAAUyICCOZGme1rJY5kRRk7hI0mJSVUXJtF3iOl7tltsBZsNfUegjAY3I5sgFY55KqdX1GgIAIfkECQsAAAAsAAAAABAACwAABTcgII5kaZ4kcV2EqLJipmnZhWGXaOOitm2aXQ4g7P2Ct2ER4AMul00kj5g0Al8tADY2y6C+4FIIACH5BAkLAAAALAAAAAAQAAsAAAUvICCOZGme5ERRk6iy7qpyHCVStA3gNa/7txxwlwv2isSacYUc+l4tADQGQ1mvpBAAIfkECQsAAAAsAAAAABAACwAABS8gII5kaZ7kRFGTqLLuqnIcJVK0DeA1r/u3HHCXC/aKxJpxhRz6Xi0ANAZDWa+kEAA7AAAAAAAAAAAA')}body > section section.spinning > header h2{background-image:url('data:image/gif;base64,R0lGODlhEAALAPQAAN7e3oiIiNHR0c3NzdbW1omJiYiIiJeXl7Ozs6enp8bGxpKSkqCgoLa2tqmpqcjIyJSUlIiIiKKiotXV1dDQ0Nra2pqamtLS0tnZ2cXFxb29vcvLy9jY2AAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCwAAACwAAAAAEAALAAAFLSAgjmRpnqSgCuLKAq5AEIM4zDVw03ve27ifDgfkEYe04kDIDC5zrtYKRa2WQgAh+QQJCwAAACwAAAAAEAALAAAFJGBhGAVgnqhpHIeRvsDawqns0qeN5+y967tYLyicBYE7EYkYAgAh+QQJCwAAACwAAAAAEAALAAAFNiAgjothLOOIJAkiGgxjpGKiKMkbz7SN6zIawJcDwIK9W/HISxGBzdHTuBNOmcJVCyoUlk7CEAAh+QQJCwAAACwAAAAAEAALAAAFNSAgjqQIRRFUAo3jNGIkSdHqPI8Tz3V55zuaDacDyIQ+YrBH+hWPzJFzOQQaeavWi7oqnVIhACH5BAkLAAAALAAAAAAQAAsAAAUyICCOZGme1rJY5kRRk7hI0mJSVUXJtF3iOl7tltsBZsNfUegjAY3I5sgFY55KqdX1GgIAIfkECQsAAAAsAAAAABAACwAABTcgII5kaZ4kcV2EqLJipmnZhWGXaOOitm2aXQ4g7P2Ct2ER4AMul00kj5g0Al8tADY2y6C+4FIIACH5BAkLAAAALAAAAAAQAAsAAAUvICCOZGme5ERRk6iy7qpyHCVStA3gNa/7txxwlwv2isSacYUc+l4tADQGQ1mvpBAAIfkECQsAAAAsAAAAABAACwAABS8gII5kaZ7kRFGTqLLuqnIcJVK0DeA1r/u3HHCXC/aKxJpxhRz6Xi0ANAZDWa+kEAA7AAAAAAAAAAAA')}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:hover,a:active{outline:0}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{max-width:100%;width:auto\9;height:auto;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#map_canvas img,.google-maps img{max-width:none}button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle}button,input{*overflow:visible;line-height:normal}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}label,select,button,input[type="button"],input[type="reset"],input[type="submit"],input[type="radio"],input[type="checkbox