| | |
| | | $this->PDO->setAttribute(PDO::ATTR_ORACLE_NULLS, PDO::NULL_TO_STRING); |
| | | |
| | | $st = $this->PDO->query('SELECT value FROM data WHERE class=\'\' AND name=\'_version\''); |
| | | if($st->rowCount > 0) { |
| | | $row = $st->fetch(PDO::FETCH_ASSOC); |
| | | $row = $st->fetch(PDO::FETCH_ASSOC); |
| | | if(is_array($row)) { |
| | | $version = (int)$row['value']; |
| | | } |
| | | else |
| | |
| | | $this->PDO->query('UPDATE data SET class=\'kino\' WHERE class=\'\' AND name=\'kino\''); |
| | | $this->PDO->query('INSERT OR REPLACE INTO data (class, name, value) VALUES (\'\', \'_version\', 1)'); |
| | | $version = 1; |
| | | } |
| | | |
| | | if($version < 3) { |
| | | $this->PDO->query('DELETE FROM data WHERE class IS NULL AND name=\'user_struct\''); |
| | | $this->PDO->query('INSERT OR REPLACE INTO data (class, name, value) VALUES (\'\', \'_version\', 3)'); |
| | | $version = 3; |
| | | } |
| | | |
| | | return; |
| | |
| | | $this->PDO->beginTransaction(); |
| | | $st = $this->PDO->prepare('INSERT OR REPLACE INTO data (class, name, value) VALUES (?, ?, ?)'); |
| | | |
| | | $st->execute(array('', '_version', 1)); |
| | | $st->execute(array('', '_version', 2)); |
| | | |
| | | foreach($files as $file) { |
| | | $data = unserialize(file_get_contents($file)); |