Ver código fonte

refactor(sixshop-filesystem): 添加 functions.php 到 autoload 文件列表
- 更新 six-shop/core 版本依赖至0.6.4

runphp 6 meses atrás
pai
commit
6c6ab907bd
3 arquivos alterados com 20 adições e 17 exclusões
  1. 5 2
      composer.json
  2. 15 0
      src/functions.php
  3. 0 15
      src/helper.php

+ 5 - 2
composer.json

@@ -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": {

+ 15 - 0
src/functions.php

@@ -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;
+}

+ 0 - 15
src/helper.php

@@ -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;
-    }
-}