protected function modifyApplication($app, $plugin, $options)
    {
        $file = new File($app, false);
        $contents = $file->read();

        $append = "\n        \$this->addPlugin('%s', [%s]);\n";
        $insert = str_replace(', []', '', sprintf($append, $plugin, $options));

        if (!preg_match('/function bootstrap\(\)/m', $contents)) {
            $this->abort('Your Application class does not have a bootstrap() method. Please add one.');
        } else {
            $contents = preg_replace('/(function bootstrap\(\)(?:\s+)\{)/m', '$1' . $insert, $contents);
        }
        $file->write($contents);

        $this->out('');
        $this->out(sprintf('%s modified', $app));
    }
protected function modifyApplication($app, $plugin, $options)
    {
        $file = new File($app, false);
        $contents = $file->read();

        $append = "\n        \$this->addPlugin('%s', [%s]);\n";
        $insert = str_replace(', []', '', sprintf($append, $plugin, $options));

        if (!preg_match('/function bootstrap\(\)/m', $contents)) {
            $this->abort('Your Application class does not have a bootstrap() method. Please add one.');
        } else {
            $contents = preg_replace('/(function bootstrap\(\)(?:\s+)\{)/m', '$1' . $insert, $contents);
        }
        $file->write($contents);

        $this->out('');
        $this->out(sprintf('%s modified', $app));
    }
protected function modifyApplication ( $ app , $ plugin , $ options ) { $ file = new File ( $ app , false ) ; $ contents = $ file -> read ( ) ; $ append = "\n        \$this->addPlugin('%s', [%s]);\n" ; $ insert = str_replace ( ', []' , '' , sprintf ( $ append , $ plugin , $ options ) ) ; if ( ! preg_match ( '/function bootstrap\(\)/m' , $ contents ) ) { $ this -> abort ( 'Your Application class does not have a bootstrap() method. Please add one.' ) ; } else { $ contents = preg_replace ( '/(function bootstrap\(\)(?:\s+)\{)/m' , '$1' . $ insert , $ contents ) ; } $ file -> write ( $ contents ) ; $ this -> out ( '' ) ; $ this -> out ( sprintf ( '%s modified' , $ app ) ) ; }
Modify the application class

@param string $app The Application file to modify.
@param string $plugin The plugin name to add.
@param string $options The plugin options to add
@return void
Modify the application class