Closed ghost closed 2 years ago
function applyMigrations() { $this->createMigrationsTable(); $appliedMigrations = $this->getAppliedMigrations(); $newMigrations = []; $files = scandir(Application::$ROOT_DIR . '/migrations'); $toApplyMigrations = array_diff($files, $appliedMigrations); foreach ($toApplyMigrations as $migration) { if ($migration === '.' || $migration === '..') { continue; } require_once Application::$ROOT_DIR .'./migrations/'.$migration; $className = pathinfo($migration, PATHINFO_FILENAME); echo "<pre>"; var_dump($className); echo "</pre>"; exit; $instance = new $className(); //ISSUE CREATING THIS INSTANCE!! $this->log("Applying migration $migration"); $instance->up(); $this->log("Applied migration $migration"); $newMigrations[] = $migration; echo "<pre>"; var_dump($instance); echo "</pre>"; exit; } }
Hi thecodeholic, i am having this error creating the instance for the migration class:
Fatal error: Uncaught Error: Class "m0001_initial" not found in C:\xampp\htdocs\simpleMVC\core\Database.php
would really appreciate if you could help me.
I really do appreciate your PHP tutorials, it makes me really enjoy coding PHP!
Hi thecodeholic, i am having this error creating the instance for the migration class:
would really appreciate if you could help me.
I really do appreciate your PHP tutorials, it makes me really enjoy coding PHP!