$dbVersion) { printf('Executing %s...' . PHP_EOL, $upgradePath); $upgradeSql = file_get_contents($upgradePath); $queries = preg_split('/;\s*[\r\n]+/s', $upgradeSql); $queries = array_map('trim', $queries); foreach ($queries as $query) { echo $query . PHP_EOL; R::exec($query); echo PHP_EOL; } } Model_Property::set('db-version', $upgradeVersion); }