mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 09:48:40 +00:00
update path fixes
This commit is contained in:
parent
5892819542
commit
3df0d1463a
|
|
@ -48,6 +48,11 @@ final class SqlServerConnection extends ConnectionAbstract
|
|||
$this->grammar = new SqlServerGrammar();
|
||||
$this->schemaGrammar = new SqlServerSchemaGrammar();
|
||||
|
||||
if (isset($dbdata['datetimeformat'])) {
|
||||
$this->grammar->setDateTimeFormat($dbdata['datetimeformat']);
|
||||
$this->schemaGrammar->setDateTimeFormat($dbdata['datetimeformat']);
|
||||
}
|
||||
|
||||
$this->dbdata = $dbdata;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -86,6 +86,28 @@ abstract class GrammarAbstract
|
|||
'MIN(',
|
||||
];
|
||||
|
||||
/**
|
||||
* Datetime format.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected string $datetimeFormat = 'Y-m-d H:i:s';
|
||||
|
||||
/**
|
||||
* Set the datetime format
|
||||
*
|
||||
* @param string $format Datetime format
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function setDateTimeFormat(string $format) : void
|
||||
{
|
||||
$this->datetimeFormat = $format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compile to query.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -340,7 +340,7 @@ class Grammar extends GrammarAbstract
|
|||
|
||||
return '(' . \rtrim($values, ', ') . ')';
|
||||
} elseif ($value instanceof \DateTime) {
|
||||
return $query->quote($value->format('Y-m-d H:i:s'));
|
||||
return $query->quote($value->format($this->datetimeFormat));
|
||||
} elseif ($value === null) {
|
||||
return 'NULL';
|
||||
} elseif (\is_bool($value)) {
|
||||
|
|
|
|||
|
|
@ -54,6 +54,9 @@ class Zip implements ArchiveInterface
|
|||
$source = $relative;
|
||||
}
|
||||
|
||||
$source = \str_replace('\\', '/', $source);
|
||||
$relative = \str_replace('\\', '/', $relative);
|
||||
|
||||
if (\is_dir($source)) {
|
||||
$files = new \RecursiveIteratorIterator(
|
||||
new \RecursiveDirectoryIterator($source),
|
||||
|
|
@ -72,7 +75,7 @@ class Zip implements ArchiveInterface
|
|||
|
||||
$absolute = \realpath($file);
|
||||
$absolute = \str_replace('\\', '/', (string) $absolute);
|
||||
$dir = \str_replace($source . '/', '', $relative . '/' . $absolute);
|
||||
$dir = \str_replace($source . '/', '', \rtrim($relative, '/\\') . '/' . \ltrim($absolute, '/\\'));
|
||||
|
||||
if (\is_dir($absolute)) {
|
||||
$zip->addEmptyDir($dir . '/');
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user