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
05a208f9
Commit
05a208f9
authored
Nov 06, 2014
by
Aaron Wells
Browse files
More versioncheck.php cleanup...
Change-Id: I68f9f7c080fbe168b5387e5dfc40321c3199e43e
parent
531b4777
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/versioncheck.php
View file @
05a208f9
...
...
@@ -33,7 +33,7 @@ $GITREV = 'HEAD';
$ERROR
=
false
;
$newconfig
=
get_mahara_version
(
$GITREV
,
'htdocs/lib/version.php'
);
if
(
substr
(
$newconfig
->
release
,
-
3
)
!
=
'dev'
)
{
if
(
substr
(
$newconfig
->
release
,
-
3
)
=
=
'dev'
)
{
$STABLEBRANCH
=
false
;
}
else
{
...
...
@@ -132,11 +132,11 @@ function get_mahara_version($gitrevision, $pathtofile) {
* @param string $upgradefile The path to the upgrade.php file
*/
function
find_upgrade_versions
(
$gitrevision
,
$upgradefile
)
{
$p
=
popen
(
"git
show
{
$gitrevision
}
--
{
$upgradefile
}
"
,
'r'
);
$p
=
popen
(
"git
diff --unified=0
{
$gitrevision
}
~
{
$gitrevision
}
--
{
$upgradefile
}
"
,
'r'
);
$upgradeversions
=
array
();
while
(
!
feof
(
$p
))
{
$buffer
=
fgets
(
$p
);
if
(
1
==
preg_match
(
'#\$oldversion.*\b(\d{10})\b#'
,
$buffer
,
$matches
))
{
if
(
1
==
preg_match
(
'#
^\+.*
\$oldversion.*\b(\d{10})\b#'
,
$buffer
,
$matches
))
{
echo
"New
{
$upgradefile
}
:
{
$matches
[
1
]
}
\n
"
;
$upgradeversions
[]
=
$matches
[
1
];
}
...
...
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