1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?php
-
-
-
-
-
- function migration_exists($db, $file_name) {
- $query = "SELECT COUNT(version) FROM migrations WHERE version = " . $db->quote($file_name, 'text');
- $count = $db->queryOne($query);
- if ($count == 0) {
- return false;
- }
-
- return true;
- }
-
-
- function migration_save($db, $file_name) {
- $query = "INSERT INTO migrations (version, apply_time) VALUES(" . $db->quote($file_name, 'text') . "," . $db->quote(time(), 'text') . ")";
- return $db->query($query);
- }
-
-
- function migration_get_environment_newline() {
- $new_line = '<br/>';
- if (php_sapi_name() == 'cli') {
- $new_line = PHP_EOF;
- }
- return $new_line;
- }
-
-
- function migration_message($msg) {
- $new_line = migration_get_environment_newline();
- echo $msg.$new_line;
- }
|