@@ -8,7 +8,7 @@
],
"require": {
"php": ">=8.3",
- "six-shop/core": ">=0.5 <1.0",
+ "six-shop/core": ">=0.6.4 <1.0",
"topthink/think-filesystem": "^3.0"
},
"authors": [
@@ -21,7 +21,10 @@
"autoload": {
"psr-4": {
"SixShop\\Filesystem\\": "src"
- }
+ },
+ "files": [
+ "src/functions.php"
+ ]
"extra": {
"sixshop": {
@@ -0,0 +1,15 @@
+<?php
+declare(strict_types=1);
+
+namespace SixShop\Filesystem;
+/**
+ * 获取文件的URL
+ * @param string $path 文件路径
+ * @return string 文件URL
+ */
+function file_url(string $path): string
+{
+ return extension_config('filesystem', 'domain') . '/' . $path;
+}
@@ -1,15 +0,0 @@
-<?php
-declare(strict_types=1);
-
-if (!function_exists('file_url')) {
- /**
- * 获取文件的URL
- * @param string $path 文件路径
- * @return string 文件URL
- */
- function file_url(string $path): string
- {
- return extension_config('filesystem', 'domain').'/'.$path;
-}