Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
d384c7b1
Commit
d384c7b1
authored
Nov 03, 2014
by
Aaron Wells
Browse files
Check the version number in the committed version.php, not the filesystem
Bug 1215662 Change-Id: Id9b7dbe0b14366cf5b467d83b378131b97d4ec9a
parent
78b2638d
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/versioncheck.php
View file @
d384c7b1
...
...
@@ -24,17 +24,20 @@ error_reporting(0);
define
(
'INTERNAL'
,
1
);
require
(
'htdocs/lib/version.php'
);
$newconfig
=
clone
$config
;
$newconfig
=
get_mahara_version
(
'HEAD'
);
$oldconfig
=
get_mahara_version
(
'HEAD~'
);
exec
(
'git show HEAD~:htdocs/lib/version.php'
,
$lines
,
$returnval
);
if
(
$returnval
!==
0
)
{
echo
"ERROR (test/versioncheck.php): Couldn't locate previous commit's version.php file."
;
exit
(
1
);
}
function
get_mahara_version
(
$gitversion
)
{
exec
(
"git show
{
$gitversion
}
:htdocs/lib/version.php"
,
$lines
,
$returnval
);
if
(
$returnval
!==
0
)
{
echo
"ERROR (test/versioncheck.php): Couldn't locate version.php file in
{
$gitversion
}
."
;
exit
(
1
);
}
array_shift
(
$lines
);
eval
(
implode
(
"
\n
"
,
$lines
));
$oldconfig
=
$config
;
array_shift
(
$lines
);
eval
(
implode
(
"
\n
"
,
$lines
));
return
$config
;
}
if
(
$oldconfig
->
version
!=
$newconfig
->
version
)
{
echo
"Bumping lib/version.php...
\n
"
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment