#!/usr/bin/env php array( 'type' => (version_compare(PHP_VERSION, '5.2.0', '>=') ? '' : 'ERROR:') . PHP_VERSION, 'used' => 'XS(core)', 'note' => 'PHP 5.2.0 或更高版本是必须的。', ), 'SPL 扩展' => array( 'type' => extension_loaded('spl') ? 'OK' : 'ERROR', 'used' => 'XS(core)', 'note' => 'SPL 扩展用于自动加载和对象戏法', ), 'PCRE 扩展' => array( 'type' => extension_loaded('pcre') ? 'OK' : 'ERROR', 'used' => 'XSDocument, XSSearch', 'note' => '用于字符串切割、判断', ), '编码转换' => array( 'type' => check_conv(), 'used' => 'XSDocument, XSSearch', 'note' => '用于支持非 UTF-8 字符集', ), '缓存模块' => array( 'type' => check_cache(), 'used' => 'XS', 'note' => '用于缓存项目配置文件的解析结果', ), 'JSON 扩展' => array( 'type' => extension_loaded('json') ? 'OK' : 'WARNING', 'used' => 'util.Quest, util.Indexer', 'note' => '用于读取或输出 JSON 格式的数据', ), 'XML 扩展' => array( 'type' => extension_loaded('xml') ? 'OK' : 'WARNING', 'used' => 'util.Indexer', 'note' => '用于读取导入 XML 格式的数据', ), 'MySQL 扩展' => array( 'type' => check_mysql(), 'used' => 'util.Indexer', 'note' => '用于读取导入 MySQL 的数据库', ), 'SQLite 扩展' => array( 'type' => check_sqlite(), 'used' => 'util.Indexer', 'note' => '用于读取导入 SQLite 的数据库', ), ); // output ?> Xunsearch PHP-SDK 运行需求检查 ============================== 检查内容 -------- 本程序用于确认您的服务器配置是否能满足运行 Xunsearch PHP-SDK 的要求。 它将检查服务器所运行的 PHP 版本,查看是否安装了合适的PHP扩展模块,以及 确认 php.ini 文件是否正确设置。 $val) { if (substr($val['type'], 0, 7) == 'WARNING') $num_warning++; elseif (substr($val['type'], 0, 5) == 'ERROR') $num_error++; else $num_ok++; out_line($key, $val['type'], $val['used'], $val['note']); } out_line(); ?> 检查结果 -------- 共计 项通过, 项警告, 项错误。 0): ?> 您的服务器配置不符合 Xunsearch/PHP-SDK 的最低要求。 请仔细查看上面表格中结果为 ERROR 的项目,并针对性的做出修改和调整。 您的服务器配置符合 Xunsearch/PHP-SDK 的最低要求。 0): ?> 如果您需要使用特定的功能,请关注上述的 WARNING 项。