This commit is contained in:
2020-08-31 01:54:20 +08:00
parent 678fb07bd1
commit b11b132cfc
3 changed files with 24 additions and 51 deletions
+6 -6
View File
@@ -93,7 +93,7 @@ class Snowflake
{
$path = realpath(static::$service->storage);
if (!is_dir($path)) {
// mkdir($path);
mkdir($path);
}
return $path;
}
@@ -128,11 +128,11 @@ class Snowflake
public static function writeFile($fileName, $content, $is_append = FILE_APPEND)
{
return false;
// if (self::inCoroutine()) {
// return Coroutine::writeFile($fileName, $content, $is_append);
// } else {
// return file_put_contents($fileName, $content, $is_append);
// }
if (self::inCoroutine()) {
return Coroutine::writeFile($fileName, $content, $is_append);
} else {
return file_put_contents($fileName, $content, $is_append);
}
}