Prechádzať zdrojové kódy

Fallback to ANONADDY_VERSION env var if empty

Will Browning 2 rokov pred
rodič
commit
19ef4ad9c4

+ 4 - 0
app/Helpers/GitVersionHelper.php

@@ -60,6 +60,10 @@ class GitVersionHelper
             chdir($dir);
             chdir($dir);
         }
         }
 
 
+        if (! $output) {
+            return str(getenv('ANONADDY_VERSION', true));
+        }
+
         return Str::of($output)->after('v')->trim();
         return Str::of($output)->after('v')->trim();
     }
     }
 }
 }

+ 6 - 5
app/Http/Controllers/Api/AppVersionController.php

@@ -9,13 +9,14 @@ class AppVersionController extends Controller
 {
 {
     public function index()
     public function index()
     {
     {
-        $parts = str(Version::version())->explode('.');
+        $ver = Version::version();
+        $parts = $ver->explode('.');
 
 
         return response()->json([
         return response()->json([
-            'version' => Version::version(),
-            'major' => (int) isset($parts[0]) ? $parts[0] : null,
-            'minor' => (int) isset($parts[1]) ? $parts[1] : null,
-            'patch' => (int) isset($parts[2]) ? $parts[2] : null,
+            'version' => $ver,
+            'major' => isset($parts[0]) && $parts[0] !== '' ? (int) $parts[0] : 0,
+            'minor' => isset($parts[1]) ? (int) $parts[1] : 0,
+            'patch' => isset($parts[2]) ? (int) $parts[2] : 0,
         ]);
         ]);
     }
     }
 }
 }

+ 23 - 19
composer.lock

@@ -1230,24 +1230,24 @@
         },
         },
         {
         {
             "name": "graham-campbell/result-type",
             "name": "graham-campbell/result-type",
-            "version": "v1.0.4",
+            "version": "v1.1.0",
             "source": {
             "source": {
                 "type": "git",
                 "type": "git",
                 "url": "https://github.com/GrahamCampbell/Result-Type.git",
                 "url": "https://github.com/GrahamCampbell/Result-Type.git",
-                "reference": "0690bde05318336c7221785f2a932467f98b64ca"
+                "reference": "a878d45c1914464426dc94da61c9e1d36ae262a8"
             },
             },
             "dist": {
             "dist": {
                 "type": "zip",
                 "type": "zip",
-                "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/0690bde05318336c7221785f2a932467f98b64ca",
-                "reference": "0690bde05318336c7221785f2a932467f98b64ca",
+                "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/a878d45c1914464426dc94da61c9e1d36ae262a8",
+                "reference": "a878d45c1914464426dc94da61c9e1d36ae262a8",
                 "shasum": ""
                 "shasum": ""
             },
             },
             "require": {
             "require": {
-                "php": "^7.0 || ^8.0",
-                "phpoption/phpoption": "^1.8"
+                "php": "^7.2.5 || ^8.0",
+                "phpoption/phpoption": "^1.9"
             },
             },
             "require-dev": {
             "require-dev": {
-                "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.19 || ^9.5.8"
+                "phpunit/phpunit": "^8.5.28 || ^9.5.21"
             },
             },
             "type": "library",
             "type": "library",
             "autoload": {
             "autoload": {
@@ -1276,7 +1276,7 @@
             ],
             ],
             "support": {
             "support": {
                 "issues": "https://github.com/GrahamCampbell/Result-Type/issues",
                 "issues": "https://github.com/GrahamCampbell/Result-Type/issues",
-                "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.0.4"
+                "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.0"
             },
             },
             "funding": [
             "funding": [
                 {
                 {
@@ -1288,7 +1288,7 @@
                     "type": "tidelift"
                     "type": "tidelift"
                 }
                 }
             ],
             ],
-            "time": "2021-11-21T21:41:47+00:00"
+            "time": "2022-07-30T15:56:11+00:00"
         },
         },
         {
         {
             "name": "guzzlehttp/guzzle",
             "name": "guzzlehttp/guzzle",
@@ -3612,29 +3612,33 @@
         },
         },
         {
         {
             "name": "phpoption/phpoption",
             "name": "phpoption/phpoption",
-            "version": "1.8.1",
+            "version": "1.9.0",
             "source": {
             "source": {
                 "type": "git",
                 "type": "git",
                 "url": "https://github.com/schmittjoh/php-option.git",
                 "url": "https://github.com/schmittjoh/php-option.git",
-                "reference": "eab7a0df01fe2344d172bff4cd6dbd3f8b84ad15"
+                "reference": "dc5ff11e274a90cc1c743f66c9ad700ce50db9ab"
             },
             },
             "dist": {
             "dist": {
                 "type": "zip",
                 "type": "zip",
-                "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/eab7a0df01fe2344d172bff4cd6dbd3f8b84ad15",
-                "reference": "eab7a0df01fe2344d172bff4cd6dbd3f8b84ad15",
+                "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/dc5ff11e274a90cc1c743f66c9ad700ce50db9ab",
+                "reference": "dc5ff11e274a90cc1c743f66c9ad700ce50db9ab",
                 "shasum": ""
                 "shasum": ""
             },
             },
             "require": {
             "require": {
-                "php": "^7.0 || ^8.0"
+                "php": "^7.2.5 || ^8.0"
             },
             },
             "require-dev": {
             "require-dev": {
-                "bamarni/composer-bin-plugin": "^1.4.1",
-                "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.19 || ^9.5.8"
+                "bamarni/composer-bin-plugin": "^1.8",
+                "phpunit/phpunit": "^8.5.28 || ^9.5.21"
             },
             },
             "type": "library",
             "type": "library",
             "extra": {
             "extra": {
+                "bamarni-bin": {
+                    "bin-links": true,
+                    "forward-command": true
+                },
                 "branch-alias": {
                 "branch-alias": {
-                    "dev-master": "1.8-dev"
+                    "dev-master": "1.9-dev"
                 }
                 }
             },
             },
             "autoload": {
             "autoload": {
@@ -3667,7 +3671,7 @@
             ],
             ],
             "support": {
             "support": {
                 "issues": "https://github.com/schmittjoh/php-option/issues",
                 "issues": "https://github.com/schmittjoh/php-option/issues",
-                "source": "https://github.com/schmittjoh/php-option/tree/1.8.1"
+                "source": "https://github.com/schmittjoh/php-option/tree/1.9.0"
             },
             },
             "funding": [
             "funding": [
                 {
                 {
@@ -3679,7 +3683,7 @@
                     "type": "tidelift"
                     "type": "tidelift"
                 }
                 }
             ],
             ],
-            "time": "2021-12-04T23:24:31+00:00"
+            "time": "2022-07-30T15:51:26+00:00"
         },
         },
         {
         {
             "name": "pragmarx/google2fa",
             "name": "pragmarx/google2fa",

+ 6 - 6
package-lock.json

@@ -1967,9 +1967,9 @@
             "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ=="
             "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ=="
         },
         },
         "node_modules/@types/node": {
         "node_modules/@types/node": {
-            "version": "18.6.2",
-            "resolved": "https://registry.npmjs.org/@types/node/-/node-18.6.2.tgz",
-            "integrity": "sha512-KcfkBq9H4PI6Vpu5B/KoPeuVDAbmi+2mDBqGPGUgoL7yXQtcWGu2vJWmmRkneWK3Rh0nIAX192Aa87AqKHYChQ=="
+            "version": "18.6.3",
+            "resolved": "https://registry.npmjs.org/@types/node/-/node-18.6.3.tgz",
+            "integrity": "sha512-6qKpDtoaYLM+5+AFChLhHermMQxc3TOEFIDzrZLPRGHPrLEwqFkkT5Kx3ju05g6X7uDPazz3jHbKPX0KzCjntg=="
         },
         },
         "node_modules/@types/parse-json": {
         "node_modules/@types/parse-json": {
             "version": "4.0.0",
             "version": "4.0.0",
@@ -10707,9 +10707,9 @@
             "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ=="
             "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ=="
         },
         },
         "@types/node": {
         "@types/node": {
-            "version": "18.6.2",
-            "resolved": "https://registry.npmjs.org/@types/node/-/node-18.6.2.tgz",
-            "integrity": "sha512-KcfkBq9H4PI6Vpu5B/KoPeuVDAbmi+2mDBqGPGUgoL7yXQtcWGu2vJWmmRkneWK3Rh0nIAX192Aa87AqKHYChQ=="
+            "version": "18.6.3",
+            "resolved": "https://registry.npmjs.org/@types/node/-/node-18.6.3.tgz",
+            "integrity": "sha512-6qKpDtoaYLM+5+AFChLhHermMQxc3TOEFIDzrZLPRGHPrLEwqFkkT5Kx3ju05g6X7uDPazz3jHbKPX0KzCjntg=="
         },
         },
         "@types/parse-json": {
         "@types/parse-json": {
             "version": "4.0.0",
             "version": "4.0.0",