本文整理汇总了PHP中getErrorMessage函数的典型用法代码示例。如果您正苦于以下问题:PHP getErrorMessage函数的具体用法?PHP getErrorMessage怎么用?PHP getErrorMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getErrorMessage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: connect
public function connect($config = [])
{
$this->config = $config;
$dsn = 'host=' . $this->config['host'] . ' ';
if (!empty($this->config['port'])) {
$dsn .= 'port=' . $this->config['port'] . ' ';
}
if (!empty($this->config['database'])) {
$dsn .= 'dbname=' . $this->config['database'] . ' ';
}
if (!empty($this->config['user'])) {
$dsn .= 'user=' . $this->config['user'] . ' ';
}
if (!empty($this->config['password'])) {
$dsn .= 'password=' . $this->config['password'] . ' ';
}
if (!empty($this->config['dsn'])) {
$dsn = $this->config['dsn'];
}
$dsn = rtrim($dsn);
$this->connect = $this->config['pconnect'] === true ? @pg_pconnect($dsn) : @pg_connect($dsn);
if (empty($this->connect)) {
die(getErrorMessage('Database', 'connectError'));
}
if (!empty($this->config['charset'])) {
pg_set_client_encoding($this->connect, $this->config['charset']);
}
}
示例2: connect
public function connect(array $settings = NULL)
{
$config = \Config::get('IndividualStructures', 'cache')['driverSettings'];
$config = !empty($settings) ? $settings : $config['redis'];
$this->redis = new \Redis();
try {
if ($config['socketType'] === 'unix') {
$success = $this->redis->connect($config['socket']);
} else {
$success = $this->redis->connect($config['host'], $config['port'], $config['timeout']);
}
if (empty($success)) {
die(getErrorMessage('IndividualStructures', 'cache:connectionRefused', 'Connection'));
}
} catch (RedisException $e) {
die(getErrorMessage('IndividualStructures', 'cache:connectionRefused', $e->getMessage()));
}
if (isset($config['password'])) {
if (!$this->redis->auth($config['password'])) {
die(getErrorMessage('IndividualStructures', 'cache:authenticationFailed'));
}
}
$serialized = $this->redis->sMembers('ZNRedisSerialized');
if (!empty($serialized)) {
$this->serialized = array_flip($serialized);
}
return true;
}
示例3: __construct
public function __construct()
{
if (!isPhpVersion('5.5.0')) {
die(getErrorMessage('Error', 'invalidVersion', ['%' => 'password_', '#' => '5.5.0']));
}
parent::__construct();
}
示例4: run
public static function run()
{
// INI AYARLAR YAPILANDIRILIYOR...
$iniSet = Config::get('Ini', 'settings');
if (!empty($iniSet)) {
Config::iniSet($iniSet);
}
// ----------------------------------------------------------------------
// HTACCESS DOSYASI OLUŞTURULUYOR...
if (Config::get('Htaccess', 'createFile') === true) {
createHtaccessFile();
}
// ----------------------------------------------------------------------
// COMPOSER DOSYASI OLUŞTURULUYOR...
$composer = Config::get('Composer', 'autoload');
if ($composer === true) {
$path = 'vendor/autoload.php';
if (file_exists($path)) {
require_once $path;
} else {
report('Error', getMessage('Error', 'fileNotFound', $path), 'AutoloadComposer');
die(getErrorMessage('Error', 'fileNotFound', $path));
}
} elseif (file_exists($composer)) {
require_once $composer;
} elseif (!empty($composer)) {
report('Error', getMessage('Error', 'fileNotFound', $composer), 'AutoloadComposer');
die(getErrorMessage('Error', 'fileNotFound', $composer));
}
// ----------------------------------------------------------------------
}
示例5: connect
public function connect($config = array())
{
$this->config = $config;
$this->connect = $this->config['pconnect'] === true ? @sqlite_popen($this->config['database'], 0666, $error) : @sqlite_open($this->config['database'], 0666, $error);
if (!empty($error)) {
die(getErrorMessage('Database', 'mysqlConnectError'));
}
}
示例6: connect
public function connect($config = array())
{
$this->config = $config;
$this->connect = $this->config['pconnect'] === true ? @ibase_pconnect($this->config['host'] . ':' . $this->config['database'], $this->config['user'], $this->config['password'], $this->config['charset']) : @ibase_connect($this->config['host'] . ':' . $this->config['database'], $this->config['user'], $this->config['password'], $this->config['charset']);
if (empty($this->connect)) {
die(getErrorMessage('Database', 'mysqlConnectError'));
}
}
示例7: connect
public function connect($config = array())
{
$this->config = $config;
$this->connect = empty($this->config['user']) ? @cubrid_connect($this->config['host'], $this->config['port'], $this->config['database']) : @cubrid_connect($this->config['host'], $this->config['port'], $this->config['database'], $this->config['user'], $this->config['password']);
if (empty($this->connect)) {
die(getErrorMessage('Database', 'mysqlConnectError'));
}
}
示例8: connect
public function connect($config = array())
{
$this->config = $config;
$this->connect = $this->config['pconnect'] === true ? @fbsql_pconnect($this->config['host'], $this->config['user'], $this->config['password']) : @fbsql_connect($this->config['host'], $this->config['user'], $this->config['password']);
if (empty($this->connect)) {
die(getErrorMessage('Database', 'mysqlConnectError'));
}
fbsql_select_db($this->config['database'], $this->connect);
}
示例9: connect
public function connect($config = array())
{
$this->config = $config;
try {
$this->connect = !empty($this->config['password']) ? new SQLite3($this->config['database'], SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, $this->config['password']) : new SQLite3($this->config['database']);
} catch (Exception $e) {
die(getErrorMessage('Database', 'mysqlConnectError'));
}
}
示例10: connect
public function connect($config = array())
{
$this->config = $config;
$dsn = !empty($this->config['dsn']) ? $this->config['dsn'] : 'DRIVER=' . $this->config['host'] . ';SERVER=' . $this->config['server'] . ';DATABASE=' . $this->config['database'];
$this->connect = $this->config['pconnect'] === true ? @odbc_pconnect($dsn, $this->config['user'], $this->config['password']) : @odbc_connect($dsn, $this->config['user'], $this->config['password']);
if (empty($this->connect)) {
die(getErrorMessage('Database', 'mysqlConnectError'));
}
}
示例11: connect
public function connect(array $settings = NULL)
{
$config = \Config::get('IndividualStructures', 'cache')['driverSettings'];
$config = !empty($settings) ? $settings : $config['memcache'];
$connect = @memcache_add_server($config['host'], $config['port'], $config['weight']);
if (empty($connect)) {
die(getErrorMessage('IndividualStructures', 'cache:unsupported', 'Memcache'));
}
return true;
}
示例12: deleteCategoryById
function deleteCategoryById($id)
{
$app = \Slim\Slim::getInstance();
try {
$app->response->write(json_encode(CategoriesDAO::delete($id)));
return json_encode($app->response->getBody());
} catch (Exception $e) {
$app->response->setStatus(404);
$app->response->setBody(getErrorMessage($e));
return json_encode($app->response->getBody());
}
}
示例13: _is
protected function _is($type, $file)
{
$file = $this->rpath($file);
$validType = $this->methods[$type] ?? NULL;
if (!function_exists($validType) || $validType === NULL) {
die(getErrorMessage('Error', 'undefinedFunction', Classes::onlyName(get_called_class()) . '::' . $type . '()'));
}
if ($validType($file)) {
return true;
}
return false;
}
示例14: run
public function run($library = '', $driver = '')
{
$config = Config::get(ucwords(strtolower($library)));
$driver = !empty($driver) ? $driver : $config['driver'];
if (!empty($driver)) {
$drv = ucwords($driver) . 'Driver';
$var = new $drv();
return $var;
} else {
die(getErrorMessage('Error', 'driverError', $driver));
}
}
示例15: connect
public function connect($config = array())
{
$this->config = $config;
$server = !empty($this->config['server']) ? $this->config['server'] : $this->config['host'];
if (!empty($this->config['port'])) {
$server .= ', ' . $this->config['port'];
}
$connection = array('UID' => $this->config['user'], 'PWD' => $this->config['password'], 'Database' => $this->config['database'], 'ConnectionPooling' => 0, 'CharacterSet' => $this->config['charset'], 'Encrypt' => $this->config['encode'], 'ReturnDatesAsStrings' => 1);
$this->connect = @sqlsrv_connect($server, $connection);
if (empty($this->connect)) {
die(getErrorMessage('Database', 'mysqlConnectError'));
}
}