src/Synapse/Migration/CreateMigrationCommand.php
public function execute(InputInterface $input, OutputInterface $output)
    {
        $description = $input->getArgument('description');
        $time        = date('YmdHis');
        $classname   = $this->generateClassName($time, $description);
        $filepath    = APPDIR.'/src/'.$this->namespaceToPath().$classname.'.php';

        if (! is_dir(dirname($filepath))) {
            mkdir(dirname($filepath), 0775, true);
        }

        $view = $this->newMigrationView;

        $view->description($description);
        $view->classname($classname);
        $view->timestamp($time);

        file_put_contents($filepath, (string) $view);

        $message = '  Created migration file '.$filepath;

        // Output message padded by newlines
        $output->write(['', $message, ''], true);
    }
public function execute(InputInterface $input, OutputInterface $output)
    {
        $description = $input->getArgument('description');
        $time        = date('YmdHis');
        $classname   = $this->generateClassName($time, $description);
        $filepath    = APPDIR.'/src/'.$this->namespaceToPath().$classname.'.php';

        if (! is_dir(dirname($filepath))) {
            mkdir(dirname($filepath), 0775, true);
        }

        $view = $this->newMigrationView;

        $view->description($description);
        $view->classname($classname);
        $view->timestamp($time);

        file_put_contents($filepath, (string) $view);

        $message = '  Created migration file '.$filepath;

        // Output message padded by newlines
        $output->write(['', $message, ''], true);
    }
public function execute ( InputInterface $ input , OutputInterface $ output ) { $ description = $ input -> getArgument ( 'description' ) ; $ time = date ( 'YmdHis' ) ; $ classname = $ this -> generateClassName ( $ time , $ description ) ; $ filepath = APPDIR . '/src/' . $ this -> namespaceToPath ( ) . $ classname . '.php' ; if ( ! is_dir ( dirname ( $ filepath ) ) ) { mkdir ( dirname ( $ filepath ) , 0775 , true ) ; } $ view = $ this -> newMigrationView ; $ view -> description ( $ description ) ; $ view -> classname ( $ classname ) ; $ view -> timestamp ( $ time ) ; file_put_contents ( $ filepath , ( string ) $ view ) ; $ message = '  Created migration file ' . $ filepath ; // Output message padded by newlines $ output -> write ( [ '' , $ message , '' ] , true ) ; }
Execute this console command, in order to create a new migration

@param  InputInterface  $input  Command line input interface
@param  OutputInterface $output Command line output interface
Execute this console command in order to create a new migration