Skip to content

Instantly share code, notes, and snippets.

@scofennell
Created October 2, 2018 19:39
Show Gist options
  • Save scofennell/01428d36182e72f5ee105bfa616c039e to your computer and use it in GitHub Desktop.
Save scofennell/01428d36182e72f5ee105bfa616c039e to your computer and use it in GitHub Desktop.
<?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