We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd5c1ee commit b5506c8Copy full SHA for b5506c8
src/Utils/Package.php
@@ -0,0 +1,26 @@
1
+<?php
2
+
3
+namespace Leaf\Console\Utils;
4
5
+/**
6
+ * Package
7
+ * ----
8
+ * Meta info on leaf cli
9
+ */
10
+class Package
11
+{
12
+ /**
13
+ * Check if there is an update available
14
15
+ public static function updateAvailable()
16
+ {
17
+ $leafCli = json_decode(file_get_contents(dirname(dirname(__DIR__)) . "/composer.json"));
18
+ $latestLeafCli = json_decode(file_get_contents("https://repo.packagist.org/p2/leafs/cli.json"));
19
20
+ $currentVersion = $leafCli->version;
21
+ $latestVersion = $latestLeafCli->packages->{"leafs/cli"}[0]->version;
22
23
+ return ($currentVersion !== $latestVersion);
24
+ }
25
+}
26
0 commit comments