Skip to content

Commit

Permalink
Version: Don't scan the directory for versions but use the array
Browse files Browse the repository at this point in the history
Fixes gh-184
  • Loading branch information
jaspermdegroot committed Jun 30, 2014
1 parent 43037c9 commit bed0019
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion add_version.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
//Altering version.php with new key value pair for jQm, and jQuery versions
chdir( '../..' );
$contents = file_get_contents( 'version.php' );
$contents = preg_replace( "/(\\\$ALL_JQUERY_VERSIONS.*)\n.*\);/s", "$1,\n\t\"" . $jqm . "\" => \"" . $jq . "\"\n);", $contents );
$contents = preg_replace( "/(\\\$ALL_JQUERY_VERSIONS.*)\n.?\);/s", "$1,\n\t\"" . $jqm . "\" => \"" . $jq . "\"\n);", $contents, 1 );
writeFile( 'version.php', $contents );

} else {
Expand Down
18 changes: 9 additions & 9 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,15 @@ function versionCompare( $version1, $version2 ) {
}
}

$VERSION_LIST = preg_grep('/^([^.])/', scandir( "jqm" ));
$ALL_JQUERY_VERSIONS = array(
"1.0.1" => "1.6.4",
"1.1.2" => "1.7.2",
"1.2.1" => "1.8.3",
"1.3.2" => "1.9.1",
"1.4.2" => "1.10.2"
);

$VERSION_LIST = array_keys( $ALL_JQUERY_VERSIONS );

$VERSION_LIST = array_reverse( $VERSION_LIST );

Expand All @@ -55,12 +63,4 @@ function versionCompare( $version1, $version2 ) {
}
}

$ALL_JQUERY_VERSIONS = array(
"1.0.1" => "1.6.4",
"1.1.2" => "1.7.2",
"1.2.1" => "1.8.3",
"1.3.2" => "1.9.1",
"1.4.2" => "1.10.2"
);

?>

0 comments on commit bed0019

Please sign in to comment.