src/db/Migration.php
public function fromFile ($path)
		{
			if (file_exists($path) and is_readable($path))
			{
				echo "    > loading queries from file $path ...";
				$time = microtime(true);

				$rows = file($path, FILE_SKIP_EMPTY_LINES);
				foreach ($rows as $row)
					$this->db->createCommand($row)->execute();

				echo '    > done (time: ' . sprintf('%.3f', microtime(true) - $time) . "s)\n";
			}
			else
				throw new \Exception ('Cannot open file ' . $path . ' for reading.');
		}
public function fromFile ($path)
		{
			if (file_exists($path) and is_readable($path))
			{
				echo "    > loading queries from file $path ...";
				$time = microtime(true);

				$rows = file($path, FILE_SKIP_EMPTY_LINES);
				foreach ($rows as $row)
					$this->db->createCommand($row)->execute();

				echo '    > done (time: ' . sprintf('%.3f', microtime(true) - $time) . "s)\n";
			}
			else
				throw new \Exception ('Cannot open file ' . $path . ' for reading.');
		}
public function fromFile ( $ path ) { if ( file_exists ( $ path ) and is_readable ( $ path ) ) { echo "    > loading queries from file $path ..." ; $ time = microtime ( true ) ; $ rows = file ( $ path , FILE_SKIP_EMPTY_LINES ) ; foreach ( $ rows as $ row ) $ this -> db -> createCommand ( $ row ) -> execute ( ) ; echo '    > done (time: ' . sprintf ( '%.3f' , microtime ( true ) - $ time ) . "s)\n" ; } else throw new \ Exception ( 'Cannot open file ' . $ path . ' for reading.' ) ; }
Loads queries from file and executes them. Each query should be on
new line just in case.

@param string $path Path to the file.

@throws \Exception
@throws \yii\db\Exception
Loads queries from file and executes them . Each query should be on new line just in case .