fix build

This commit is contained in:
Dennis Eichhorn 2021-10-11 19:20:22 +02:00
parent f43df4c7c2
commit 6338db6631
4 changed files with 19 additions and 9 deletions

View File

@ -225,6 +225,9 @@ jobs:
extensions: mbstring, gd, zip, dom, mysql, pgsql, sqlite, imap, bcmath, redis, memcached extensions: mbstring, gd, zip, dom, mysql, pgsql, sqlite, imap, bcmath, redis, memcached
ini-values: opcache.jit_buffer_size=256M, opcache.jit=1235, pcre.jit=1 ini-values: opcache.jit_buffer_size=256M, opcache.jit=1235, pcre.jit=1
- name: PHP linting - name: PHP linting
run: find ./ -type f -name '*.php' -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" ) run: |
find ./ -type f \
-not -path "./tests/Application/Testapp/*" \
-name '*.php' -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" )
- name: Php strict - name: Php strict
run: if [[ $(grep -r -L "declare(strict_types=1);" --include=*.php --exclude={*.tpl.php,*Hooks.php,*Routes.php,*SearchCommands.php} ./) -ne "" ]]; then exit 1; fi run: if [[ $(grep -r -L "declare(strict_types=1);" --include=*.php --exclude={*.tpl.php,*Hooks.php,*Routes.php,*SearchCommands.php} ./) -ne "" ]]; then exit 1; fi

View File

@ -71,7 +71,6 @@ final class ApplicationManager
private function loadInfo(string $appPath) : ApplicationInfo private function loadInfo(string $appPath) : ApplicationInfo
{ {
$path = \realpath($appPath); $path = \realpath($appPath);
if ($path === false) { if ($path === false) {
throw new PathException($appPath); throw new PathException($appPath);
} }
@ -98,7 +97,13 @@ final class ApplicationManager
$destination = \rtrim($destination, '\\/'); $destination = \rtrim($destination, '\\/');
$source = \rtrim($source, '/\\'); $source = \rtrim($source, '/\\');
if (!\is_dir($source) || ($path = \realpath($destination)) === false || !\is_file($source . '/Admin/Installer.php')) { if (!\is_dir(\dirname($destination))) {
Directory::create(\dirname($destination), 0755, true);
}
if (!\is_dir($source) || ($path = \realpath($destination)) === false
|| !\is_file($source . '/Admin/Installer.php')
) {
return false; return false;
} }

View File

@ -111,7 +111,7 @@ final class RedisCache extends ConnectionAbstract
} }
if ($expire > 0) { if ($expire > 0) {
$this->con->setEx((string) $key, $expire, $this->build($value)); $this->con->setEx((string) $key, $expire * 1000, $this->build($value));
return; return;
} }
@ -129,7 +129,7 @@ final class RedisCache extends ConnectionAbstract
} }
if ($expire > 0) { if ($expire > 0) {
return $this->con->setNx((string) $key, $this->build($value), $expire); return $this->con->setNx((string) $key, $this->build($value), $expire * 1000);
} }
return $this->con->setNx((string) $key, $this->build($value)); return $this->con->setNx((string) $key, $this->build($value));
@ -207,7 +207,7 @@ final class RedisCache extends ConnectionAbstract
$this->con->rename((string) $old, (string) $new); $this->con->rename((string) $old, (string) $new);
if ($expire > 0) { if ($expire > 0) {
$this->con->expire((string) $new, $expire); $this->con->expire((string) $new, $expire * 1000);
} }
} }
@ -264,7 +264,7 @@ final class RedisCache extends ConnectionAbstract
public function updateExpire(int | string $key, int $expire = -1) : bool public function updateExpire(int | string $key, int $expire = -1) : bool
{ {
if ($expire > 0) { if ($expire > 0) {
$this->con->expire((string) $key, $expire); $this->con->expire((string) $key, $expire * 1000);
} }
return true; return true;
@ -302,7 +302,7 @@ final class RedisCache extends ConnectionAbstract
} }
if ($this->con->exists((string) $key) > 0) { if ($this->con->exists((string) $key) > 0) {
$this->set((string) $key, $value, $expire); $this->set((string) $key, $value, $expire * 1000);
return true; return true;
} }

View File

@ -1 +1,3 @@
<?phpdeclare(strict_types=1); <?php
declare(strict_types=1);