because this is called on without having the class instantiated */ function build_generic_where_clause ($the_query_string) { $where_clauses = Array(); $the_query_string = addslashes($the_query_string); array_push($where_clauses, "name like '$the_query_string%'"); $the_where = ""; foreach($where_clauses as $clause) { if($the_where != "") $the_where .= " or "; $the_where .= $clause; } return $the_where; } function is_expected_version($expected_version){ foreach($expected_version as $name=>$val){ if($this->$name != $val){ return false; } } return true; } /** * Updates the version info based on the information provided */ function mark_upgraded($name, $dbVersion, $fileVersion){ $query = "DELETE FROM versions WHERE name='$name'"; $GLOBALS['db']->query($query); $version = new Version(); $version->name = $name; $version->file_version = $fileVersion; $version->db_version = $dbVersion; $version->save(); if(isset($_SESSION['invalid_versions'][$name])) { unset($_SESSION['invalid_versions'][$name]); } } function get_profile(){ return array('name'=> $this->name, 'file_version'=> $this->file_version, 'db_version'=>$this->db_version); } } ?>