/** * * @param InstallForm $installForm */ protected function createDB(InstallForm $installForm) { ob_start(); $patch = Yii::getPathOfAlias('application.migrations'); $names = scandir($patch); $db = $installForm->getCDbConnection(); foreach ($names as $name) { $exp = explode('.', $name); if (sizeof($exp) === 2) { list($className, $expr) = $exp; if ($expr === 'php') { include_once $patch . DIRECTORY_SEPARATOR . $name; if (class_exists($className)) { $migration = new $className(); $migration->setDbConnection($db); $migration->up(); } } } } ob_clean(); }