public function getGroups($aDatabase, $aPrefix, $aUser, $aPass, $aThrow) { $Connector = new Connector(SQL_HOST, $aDatabase, $aUser, $aPass, $aThrow); if ($Connector != null) { // only test if we can read the user table $TestQuery = $Connector->prepare('SELECT user_id FROM `' . $aPrefix . 'users` LIMIT 1'); $Connector->run($TestQuery, $aThrow); } return null; }
<?php /* * YesFinder v2.0 * Steven Ye * Email: steven_ye@foxmail.com * Date: 2016-6-12 */ define('YESFINDER', '2.0'); if (!file_exists('Connector.class.php')) { $data['error'] = "文件 Connector.class.php 丢失了。"; die(json_encode($data)); } require 'Connector.class.php'; $config = array('finderUrl' => './', 'BaseUrl' => 'uploads/', 'BasePath' => '../uploads/'); $connector = new Connector(); $connector->run($config);