Created
October 2, 2018 19:39
-
-
Save scofennell/01428d36182e72f5ee105bfa616c039e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function set_is_update() { | |
$fv = $this -> get_file_version(); | |
$dbv = $this -> get_database_version(); | |
// returns -1 if the first version is lower than the second, 0 if they are equal, and 1 if the second is lower. | |
$compare = version_compare( $fv, $dbv ); | |
if( $compare === 1 ) { | |
$out = TRUE; | |
$this -> update_database_version( $fv ); | |
} else { | |
$out = FALSE; | |
} | |
$this -> is_update = $out; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment