当前位置: 首页>>代码示例>>PHP>>正文


PHP getErrorMessage函数代码示例

本文整理汇总了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']);
     }
 }
开发者ID:znframework,项目名称:znframework,代码行数:28,代码来源:Postgres.php

示例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;
 }
开发者ID:znframework,项目名称:znframework,代码行数:28,代码来源:Redis.php

示例3: __construct

 public function __construct()
 {
     if (!isPhpVersion('5.5.0')) {
         die(getErrorMessage('Error', 'invalidVersion', ['%' => 'password_', '#' => '5.5.0']));
     }
     parent::__construct();
 }
开发者ID:znframework,项目名称:znframework,代码行数:7,代码来源:Phash.php

示例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));
     }
     // ----------------------------------------------------------------------
 }
开发者ID:Allopa,项目名称:ZN-Framework-Starter,代码行数:31,代码来源:Starting.php

示例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'));
     }
 }
开发者ID:Allopa,项目名称:ZN-Framework-Starter,代码行数:8,代码来源:SqliteDriver.php

示例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'));
     }
 }
开发者ID:bytemtek,项目名称:znframework,代码行数:8,代码来源:Ibase.php

示例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'));
     }
 }
开发者ID:bytemtek,项目名称:znframework,代码行数:8,代码来源:Cubrid.php

示例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);
 }
开发者ID:Allopa,项目名称:ZN-Framework-Starter,代码行数:9,代码来源:FbsqlDriver.php

示例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'));
     }
 }
开发者ID:bytemtek,项目名称:znframework,代码行数:9,代码来源:Sqlite3.php

示例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'));
     }
 }
开发者ID:Allopa,项目名称:ZN-Framework-Starter,代码行数:9,代码来源:OdbcDriver.php

示例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;
 }
开发者ID:znframework,项目名称:znframework,代码行数:10,代码来源:Memcache.php

示例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());
    }
}
开发者ID:AppliedSoftwareManagement-Team8,项目名称:ss-category-service,代码行数:12,代码来源:index.php

示例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;
 }
开发者ID:znframework,项目名称:znframework,代码行数:12,代码来源:Info.php

示例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));
     }
 }
开发者ID:bytemtek,项目名称:znframework,代码行数:12,代码来源:Driver.php

示例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'));
     }
 }
开发者ID:Allopa,项目名称:ZN-Framework-Starter,代码行数:13,代码来源:SqlsrvDriver.php


注:本文中的getErrorMessage函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。