Skip to content

Commit

Permalink
remover o ini
Browse files Browse the repository at this point in the history
  • Loading branch information
emalherbi committed Nov 12, 2020
1 parent 1c47b09 commit 4325ebe
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,29 @@ try {
'DATABASE' => 'DATABASE',
), realpath(dirname(__FILE__)), 'UTF-8'); // Ex.: ISO-8859-1

$mssql->connect();
$mssql->connect();

$mssql->disconnect();

$result = $mssql->getAdapter();
echo '<pre>';
echo print_r($result);
echo '</pre>';
echo '</pre>';

$result = $mssql->getIni();
echo '<pre>';
echo print_r($result);
echo '</pre>';
echo '</pre>';

$result = $mssql->isConnect();
echo '<pre>';
echo print_r($result);
echo '</pre>';
echo '</pre>';

$result = $mssql->fetchOne('SELECT * FROM CLIENTES');
echo '<pre>';
echo print_r($result);
echo '</pre>';
echo '</pre>';

$result = $mssql->fetchRow('SELECT * FROM CLIENTES');
echo '<pre>';
Expand Down Expand Up @@ -111,17 +111,17 @@ try {
END");
echo '<pre>';
echo print_r($result);
echo '</pre>';
echo '</pre>';

$sql = " BEGIN DECLARE @REF INT SET @REF = NULL EXEC SX_TESTE @REF OUTPUT SELECT @REF AS REF END ";
$result = $mssql->execScript($sql);
$result = $mssql->execScript($sql);
echo '<pre>';
echo print_r($result);
echo '</pre>';

$sql = " BEGIN DECLARE @REF INT SET @REF = NULL EXEC SX_TESTE @REF OUTPUT SELECT @REF AS REF END ";
$isObject = false; // Array or Object Result
$result = $mssql->execScriptResult($sql, $isObject);
$result = $mssql->execScriptResult($sql, $isObject);
echo '<pre>';
echo print_r($result);
echo '</pre>';
Expand All @@ -133,4 +133,3 @@ try {
die(print_r($e->getMessage()));
}
```

27 changes: 14 additions & 13 deletions src/MyMssql.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ public function __construct($ini = array(), $dl = '', $type = 'UTF-8')

if (!empty($ini)) {
$ini = $this->validateIni($ini);
$this->setIni($ini);
// $this->setIni($ini);
}
$this->ini = $this->getIni();
$this->ini = $ini; // $this->getIni();
$this->ini = $this->validateIni($this->ini);

$this->connect();
Expand Down Expand Up @@ -138,11 +138,12 @@ public function disconnect()
public function getIni()
{
try {
if (true == $this->ini['VERBOSE']) {
$this->logger('MyMssql Get Ini');
}
// if (true == $this->ini['VERBOSE']) {
// $this->logger('MyMssql Get Ini');
// }

return parse_ini_file($this->RT.$this->DS.'MyMssql.ini');
// return parse_ini_file($this->RT.$this->DS.'MyMssql.ini');
return $this->ini;
} catch (Exception $e) {
$err = $e->getMessage();
$this->logger('MyMssql Get Ini '.$this->ini['ADAPTER'], $err);
Expand Down Expand Up @@ -556,14 +557,14 @@ 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');
}
// 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));
}
// INI::write($this->RT.$this->DS.'MyMssql.ini', array('INI' => $ini));
// }

private function sxExist($sxName)
{
Expand Down

0 comments on commit 4325ebe

Please sign in to comment.