private static function listDrivers()
 {
     $options = array();
     if (class_exists('PDO', false)) {
         foreach (Database::listDrivers() as $el) {
             $title = null;
             switch ($el) {
                 case 'sqlite':
                     $title = 'SQLite';
                     break;
                 case 'mysql':
                     $title = 'MySQL';
                     break;
             }
             if (null !== $title) {
                 $options[$el] = $title;
             }
         }
         if (empty($options)) {
             throw new Exception(t('Нет доступных драйверов PDO; рекоммендуем установить <a href=\'@url1\'>PDO_SQLite</a> (или <a href=\'@url2\'>PDO_MySQL</a>, но SQLite проще и быстрее).', array('@url1' => 'http://docs.php.net/manual/en/ref.pdo-sqlite.php', '@url2' => 'http://docs.php.net/manual/en/ref.pdo-mysql.php')));
         }
     } else {
         throw new Exception(t('Для использования Molinos.CMS нужно установить расширение <a href=\'@url\'>PDO</a>.', array('@url' => 'http://docs.php.net/manual/en/book.pdo.php')));
     }
     asort($options);
     return $options;
 }
Example #2
0
 public static function getSignature(Context $ctx = null, $full = false)
 {
     $result = array('version' => mcms::version(), 'client' => $_SERVER['REMOTE_ADDR']);
     try {
         if (null === $ctx) {
             $ctx = Context::last();
         }
         $result['at'] = $ctx->host() . $ctx->folder();
         $result['version_link'] = 'http://code.google.com/p/molinos-cms/wiki/ChangeLog_' . str_replace('.', '_', mcms::version(mcms::VERSION_STABLE));
         if ($full) {
             $options = array();
             if (count($parts = explode(':', mcms::config('db')))) {
                 if (in_array($parts[0], Database::listDrivers())) {
                     $options[] = $parts[0];
                 }
             }
             $options[] = str_replace('_provider', '', get_class(cache::getInstance()));
             $options[] = ini_get('memory_limit');
             $result['options'] = join('+', $options);
         }
     } catch (Exception $e) {
     }
     return $result;
 }