/** * Load the information from the passed configuration file * * @param string $file The path to the configuration file * * @throws MigrationException Throws exception if configuration file was already loaded */ public function load($file) { if ($this->loaded) { throw MigrationException::configurationFileAlreadyLoaded(); } if (file_exists($path = getcwd() . '/' . $file)) { $file = $path; } $this->file = $file; $this->doLoad($file); $this->loaded = true; }
/** * Load the information from the passed configuration file * * @param string $file The path to the configuration file * * @throws MigrationException Throws exception if configuration file was already loaded */ public function load($file) { if ($this->loaded) { throw MigrationException::configurationFileAlreadyLoaded(); } if (file_exists($path = getcwd() . '/' . $file)) { $file = $path; } $this->file = $file; if (!file_exists($file)) { throw new \InvalidArgumentException('Given config file does not exist'); } $this->doLoad($file); $this->loaded = true; }