- A lot of bugfixes and fitting to accomodate ldap adapter
This commit is contained in:
1 parent
f14347f01d
commit
16d76470da
15 files changed
+350
-216
No files matched your search
@@ -16,4 +16,5 @@ interface AdapterInterface {
|
||||
public function setup(array $configuration) : void;
|
||||
public function escapeIdentifier(string $segment, int $type) : string;
|
||||
public function defaultEngine() : ? string;
|
||||
public function writableValue(/* mixed */ $value) /*: mixed*/;
|
||||
}
|
||||
+20
-2
@@ -5,6 +5,7 @@ namespace Ulmus\Adapter;
|
||||
use Ulmus\Common\PdoObject;
|
||||
|
||||
use Ulmus\Exception\AdapterConfigurationException;
|
||||
use Ulmus\Ulmus;
|
||||
|
||||
class MsSQL implements AdapterInterface {
|
||||
|
||||
@@ -93,7 +94,7 @@ class MsSQL implements AdapterInterface {
|
||||
$parts[] = "Encrypt=1";
|
||||
}
|
||||
|
||||
if ( $this->failoverPartner ?? false ) {
|
||||
if ( $this->failoverPartner ?? false ) {
|
||||
$parts[] = "Failover_Partner={$this->failoverPartner}";
|
||||
}
|
||||
|
||||
@@ -200,8 +201,25 @@ class MsSQL implements AdapterInterface {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function writableValue(/* mixed */ $value) /*: mixed*/
|
||||
{
|
||||
switch (true) {
|
||||
case is_object($value):
|
||||
return Ulmus::convertObject($value);
|
||||
|
||||
case is_array($value):
|
||||
return json_encode($array);
|
||||
|
||||
case is_bool($value):
|
||||
return (int) $value;
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function defaultEngine(): ? string
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ namespace Ulmus\Adapter;
|
||||
use Ulmus\Common\PdoObject;
|
||||
|
||||
use Ulmus\Exception\AdapterConfigurationException;
|
||||
use Ulmus\Ulmus;
|
||||
|
||||
class MySQL implements AdapterInterface {
|
||||
|
||||
@@ -137,6 +138,22 @@ class MySQL implements AdapterInterface {
|
||||
}
|
||||
}
|
||||
|
||||
public function writableValue(/* mixed */ $value) /*: mixed*/
|
||||
{
|
||||
switch (true) {
|
||||
case is_object($value):
|
||||
return Ulmus::convertObject($value);
|
||||
|
||||
case is_array($value):
|
||||
return json_encode($value);
|
||||
|
||||
case is_bool($value):
|
||||
return (int) $value;
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function defaultEngine(): ? string
|
||||
{
|
||||
return "InnoDB";
|
||||
|
||||
Reference in new issue
Block a user