改名
This commit is contained in:
@@ -131,16 +131,16 @@ class Snowflake
|
|||||||
/**
|
/**
|
||||||
* @param $fileName
|
* @param $fileName
|
||||||
* @param $content
|
* @param $content
|
||||||
* @param int $is_append
|
* @param null $is_append
|
||||||
* @return false|int|mixed
|
* @return false|int|mixed
|
||||||
*/
|
*/
|
||||||
public static function writeFile($fileName, $content, $is_append = FILE_APPEND)
|
public static function writeFile($fileName, $content, $is_append = null)
|
||||||
{
|
{
|
||||||
if (self::inCoroutine()) {
|
$params = [$fileName, $content];
|
||||||
return Coroutine::writeFile($fileName, $content, $is_append);
|
if ($is_append !== null) {
|
||||||
} else {
|
$params[] = $is_append;
|
||||||
return file_put_contents($fileName, $content, $is_append);
|
|
||||||
}
|
}
|
||||||
|
return !self::inCoroutine() ? file_put_contents(...$params) : Coroutine::writeFile(...$params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user