]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Use 'dev' version on the master branch
authorArthurHoaro <arthur@hoa.ro>
Sun, 12 Mar 2017 14:02:06 +0000 (15:02 +0100)
committerArthurHoaro <arthur@hoa.ro>
Sun, 12 Mar 2017 14:05:59 +0000 (15:05 +0100)
Allowed check branches are now `latest` and `stable`.

application/ApplicationUtils.php
index.php
shaarli_version.php
tests/ApplicationUtilsTest.php

index a0f482b0b9791e0f4c1e28b5406dc4895459a239..94c490409742e053e4dc53116390362bae011f34 100644 (file)
@@ -5,7 +5,7 @@
 class ApplicationUtils
 {
     private static $GIT_URL = 'https://raw.githubusercontent.com/shaarli/Shaarli';
-    private static $GIT_BRANCHES = array('master', 'stable');
+    private static $GIT_BRANCHES = array('latest', 'stable');
     private static $VERSION_FILE = 'shaarli_version.php';
     private static $VERSION_START_TAG = '<?php /* ';
     private static $VERSION_END_TAG = ' */ ?>';
@@ -65,13 +65,10 @@ class ApplicationUtils
                                        $isLoggedIn,
                                        $branch='stable')
     {
-        if (! $isLoggedIn) {
-            // Do not check versions for visitors
-            return false;
-        }
-
-        if (empty($enableCheck)) {
-            // Do not check if the user doesn't want to
+        // Do not check versions for visitors
+        // Do not check if the user doesn't want to
+        // Do not check with dev version
+        if (! $isLoggedIn || empty($enableCheck) || $currentVersion === 'dev') {
             return false;
         }
 
index cc7f3ca3497feaf96288b61f718997eb0c3a09cf..bf35f1d43a47653232d899fde0940a682e1099c6 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,6 +1,6 @@
 <?php
 /**
- * Shaarli v0.8.3 - Shaare your links...
+ * Shaarli dev - Shaare your links...
  *
  * The personal, minimalist, super-fast, database free, bookmarking service.
  *
@@ -25,7 +25,7 @@ if (date_default_timezone_get() == '') {
 /*
  * PHP configuration
  */
-define('shaarli_version', '0.8.2');
+define('shaarli_version', 'dev');
 
 // http://server.com/x/shaarli --> /shaarli/
 define('WEB_PATH', substr($_SERVER['REQUEST_URI'], 0, 1+strrpos($_SERVER['REQUEST_URI'], '/', 0)));
index 3f79a4c608cf6ebdbb80baee552d86d423da0332..9167b43e1dd69981d28ebc514f89fe26cf981061 100644 (file)
@@ -1 +1 @@
-<?php /* 0.8.3 */ ?>
+<?php /* dev */ ?>
index ad86e21c78d8efe965ea02e940aaff8a7181b9db..ef4f46a8ea23eb4099b337110c71855bb71c7872 100644 (file)
@@ -332,4 +332,15 @@ class ApplicationUtilsTest extends PHPUnit_Framework_TestCase
             ApplicationUtils::checkResourcePermissions($conf)
         );
     }
+
+    /**
+     * Check update with 'dev' as curent version (master branch).
+     * It should always return false.
+     */
+    public function testCheckUpdateDev()
+    {
+        $this->assertFalse(
+            ApplicationUtils::checkUpdate('dev', self::$testUpdateFile, 100, true, true)
+        );
+    }
 }