From f46af0a74bc08f2be0a3294525485aacced07384 Mon Sep 17 00:00:00 2001 From: Eduardo Malherbi Date: Thu, 15 Apr 2021 11:16:13 -0300 Subject: [PATCH] update project --- src/INI.php | 51 ------------------------------------------------- src/MyMssql.ini | 7 ------- src/MyMssql.php | 19 ++---------------- 3 files changed, 2 insertions(+), 75 deletions(-) delete mode 100755 src/INI.php delete mode 100755 src/MyMssql.ini diff --git a/src/INI.php b/src/INI.php deleted file mode 100755 index d9beda0..0000000 --- a/src/INI.php +++ /dev/null @@ -1,51 +0,0 @@ - $val) { - if (is_array($val)) { - $string .= self::write_get_string($ini[$key], $prefix.$key.'.'); - } else { - $string .= $prefix.$key.' = '.str_replace(self::RETURN_NEWLINE, "\\\r\\\n", self::set_value($val)).self::RETURN_NEWLINE; - } - } - - return $string; - } - - public static function set_value($val) - { - if (true === $val) { - return 'true'; - } elseif (false === $val) { - return 'false'; - } - - return $val; - } -} diff --git a/src/MyMssql.ini b/src/MyMssql.ini deleted file mode 100755 index 22dd3ed..0000000 --- a/src/MyMssql.ini +++ /dev/null @@ -1,7 +0,0 @@ -[INI] -VERBOSE = false -ADAPTER = SQLSRV -HOSTNAME = 192.168.1.1 -USERNAME = USERNAME -PASSWORD = PASSWORD -DATABASE = DATABASE \ No newline at end of file diff --git a/src/MyMssql.php b/src/MyMssql.php index 779281e..beac304 100755 --- a/src/MyMssql.php +++ b/src/MyMssql.php @@ -41,9 +41,8 @@ public function __construct($ini = array(), $dl = '', $type = 'UTF-8') if (!empty($ini)) { $ini = $this->validateIni($ini); - // $this->setIni($ini); } - $this->ini = $ini; // $this->getIni(); + $this->ini = $ini; $this->ini = $this->validateIni($this->ini); $this->connect(); @@ -138,11 +137,6 @@ public function disconnect() public function getIni() { try { - // if (true == $this->ini['VERBOSE']) { - // $this->logger('MyMssql Get Ini'); - // } - - // return parse_ini_file($this->RT.$this->DS.'MyMssql.ini'); return $this->ini; } catch (Exception $e) { $err = $e->getMessage(); @@ -306,7 +300,7 @@ public function query($sql) $this->connect(); if ('UTF-8' != $this->type) { - $sql = iconv('UTF-8', $this->type, $sql); + $sql = @iconv('UTF-8', $this->type, $sql); } if ('SQLSRV' == $this->ini['ADAPTER']) { @@ -557,15 +551,6 @@ private function querySx($sxName, $params, $test = false, $function = 'exec') /* private */ - // private function setIni($ini = array()) - // { - // if (true == $this->ini['VERBOSE']) { - // $this->logger('MyMssql Set Ini'); - // } - - // INI::write($this->RT.$this->DS.'MyMssql.ini', array('INI' => $ini)); - // } - private function sxExist($sxName) { $sql = '';