Subversion Repositories oidplus

Rev

Rev 646 | Rev 672 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 646 Rev 661
Line 978... Line 978...
978
        }
978
        }
979
 
979
 
980
        public static function getInstallType() {
980
        public static function getInstallType() {
981
                $counter = 0;
981
                $counter = 0;
982
 
982
 
983
                if ($version_file_exists = file_exists(OIDplus::localpath().'oidplus_version.txt')) {
983
                if ($new_version_file_exists = file_exists(OIDplus::localpath().'.version.php')) {
984
                        $counter++;
984
                        $counter++;
985
                }
985
                }
-
 
986
                if ($old_version_file_exists = file_exists(OIDplus::localpath().'oidplus_version.txt')) {
-
 
987
                        $counter++;
-
 
988
                }
-
 
989
                $version_file_exists = $old_version_file_exists | $new_version_file_exists;
986
                if ($svn_dir_exists = is_dir(OIDplus::localpath().'.svn') ||
990
                if ($svn_dir_exists = is_dir(OIDplus::localpath().'.svn') ||
987
                                      is_dir(OIDplus::localpath().'../.svn')) { // in case we checked out the root instead of the "trunk"
991
                                      is_dir(OIDplus::localpath().'../.svn')) { // in case we checked out the root instead of the "trunk"
988
                        $counter++;
992
                        $counter++;
989
                }
993
                }
990
                if ($git_dir_exists = is_dir(OIDplus::localpath().'.git')) {
994
                if ($git_dir_exists = is_dir(OIDplus::localpath().'.git')) {
Line 1043... Line 1047...
1043
                        if ($ver)
1047
                        if ($ver)
1044
                                return ($cachedVersion = 'svn-'.$ver);
1048
                                return ($cachedVersion = 'svn-'.$ver);
1045
                }
1049
                }
1046
 
1050
 
1047
                if ($installType === 'svn-snapshot') {
1051
                if ($installType === 'svn-snapshot') {
-
 
1052
                        $cont = '';
1048
                        $cont = file_get_contents(OIDplus::localpath().'oidplus_version.txt');
1053
                        if (file_exists($filename = OIDplus::localpath().'oidplus_version.txt'))
-
 
1054
                                $cont = file_get_contents($filename);
-
 
1055
                        if (file_exists($filename = OIDplus::localpath().'.version.php'))
-
 
1056
                                $cont = file_get_contents($filename);
1049
                        $m = array();
1057
                        $m = array();
1050
                        if (preg_match('@Revision (\d+)@', $cont, $m)) // do not translate
1058
                        if (preg_match('@Revision (\d+)@', $cont, $m)) // do not translate
1051
                                return ($cachedVersion = 'svn-'.$m[1]); // do not translate
1059
                                return ($cachedVersion = 'svn-'.$m[1]); // do not translate
1052
                }
1060
                }
1053
 
1061