Run the database.

@return void
323766
public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            if (Schema::hasColumn('users', 'name'))
                $table->dropColumn('name');
            $table->integer('role_id')->unsigned()->nullable();
            $table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade');
            $table->string('firstname')->default('');
            $table->string('lastname')->default('');
            $table->string('picture')->nullable();
        });
    }
605201
public function run()
    {
        try {
            factory(App\User::class)->create([
                    "name" => env('ADMIN_USER', "$USER_NAME$"),
                    "email" => env('ADMIN_EMAIL', "$USER_EMAIL"),
                    "password" => bcrypt(env('ADMIN_PWD', '123456'))]);
        } catch (\Illuminate\Database\QueryException $exception) {
        }
    }
229995
public function _run()
	{
		echo $this->_engine->get(
			$this->getTemplateFile(func_get_arg(0)),
			$this->getDataProvider(),
			$this->getCompiler()
		);
	}
368684
public function run()
    {
        Setting::truncate();

        $settings = $this->settings();
        foreach ($settings as $setting) {
            Setting::create($setting);
        }
    }
14602
final public function execute()
    {
        $platform = $this->connection->getDatabasePlatform();
        $queries  = $this->currentSchema->getMigrateToSql($this->schema, $platform);

        foreach ($queries as $query) {
            $this->connection->query($query);
        }
    }
987183
public function handle()
    {
        $connection = $this->getConnection();
        $schema = $this->getSchema($connection);
        $table = $this->getTable();

        // Check whether we just need to generate one table
        if ($table) {
            $this->models->on($connection)->create($schema, $table);
            $this->info("Check out your models for $table");
        }

        // Otherwise map the whole database
        else {
            $this->models->on($connection)->map($schema);
            $this->info("Check out your models for $schema");
        }
    }
1120166
public function run()
	{
		$this->style->getCharacter()->setIsBold(
			$this->parameter === null || (bool) $this->parameter
		);
		
		return;
	}
147488
public function run()
    {
        $sqlite = in_array(config('database.default'), ['sqlite', 'testing'], true);

        if (! $sqlite) {
            DB::statement('SET FOREIGN_KEY_CHECKS=0');
        }

        if (is_50() or is_51()) {
            Eloquent::unguard();
        }

        $faker = Faker::create();

        // Seeding authors table
        Author::truncate();

        foreach (range(1, 10) as $index) {
            Author::create([
                'name' => $faker->userName,
                'email' => $faker->safeEmail,
            ]);
        }

        $this->command->line("<info>Seeded:</info> authors table");

        // Seeding resources table
        Book::truncate();

        $authorIds = (is_50())
            ? Author::pluck('id')
            : Author::pluck('id')->toArray();

        foreach (range(1, 100) as $index) {
            Book::create([
                'title' => $faker->sentence(),
                'author_id' => $faker->randomElement($authorIds),
                'published_at' => $faker->dateTimeThisCentury,
                'description' => $faker->randomElement([$faker->paragraph(), null]),
                'out_of_print' => $faker->randomElement([true, false]),
                'created_at' => $faker->dateTimeThisYear,
            ]);
        }

        if (is_50() or is_51()) {
            Eloquent::regard();
        }

        if (! $sqlite) {
            DB::statement('SET FOREIGN_KEY_CHECKS=1');
        }

        $this->command->line("<info>Seeded:</info> books table");
    }
1168784
public static function run()
  {
    self::$instance = new self();

    self::$instance->csrfWather = new CsrfSecurity();
    self::$instance->csrfWather->methodWather();
    
    self::$instance->dotenv = new Dotenv('./');
    self::$instance->dotenv->load();

    self::$instance->db = new Db(getenv('DB_HOST'), getenv('DB_NAME'), getenv('DB_USER'), getenv('DB_PASSWORD'));
    self::$instance->db->connect();
  
    self::$instance->router = new RouterCollection();
    self::$instance->router->start();
  }
780173
private function _run(): void
  {
    // The DB and the controller exist
    if ( $this->check() && isset($this->data['type'])){
      if ( !defined('BBN_EXTERNAL_USER_ID') && defined('BBN_EXTERNAL_USER_EMAIL') ){
        define('BBN_EXTERNAL_USER_ID', $this->db->select_one('bbn_users', 'id', ['email' => BBN_EXTERNAL_USER_EMAIL]));
      }
      if ( defined('BBN_EXTERNAL_USER_ID') && class_exists('\\bbn\\appui\\history') ){
        \bbn\appui\history::set_user(BBN_EXTERNAL_USER_ID);
      }
      $type = $this->data['type'];
      // Removing file cache
      clearstatcache();
      // only 2 types: poll or cron
      if ( $type !== 'poll' ){
        $type = 'cron';
      }
      $pid = $this->get_pid_path($this->data);

      // Checking for the presence of the manual files
      if (
        !$this->is_active() ||
        (($type === 'cron') && !$this->is_cron_active()) ||
        (($type === 'poll') && !$this->is_poll_active())
      ){
        // Exiting the script if one is missing
        if ( is_file($pid) ){
          @unlink($pid);
        }
        exit("GETTING OUT of $type BECAUSE one of the manual files is missing");
      }
      // Loooking for a running PID
      if ( is_file($pid) && ($file_content = @file_get_contents($pid)) ){
        $pid_content = explode('|', $file_content);
        if ( $pid_content[1] && file_exists('/proc/'.$pid_content[0]) ){
          // If it's currently running we exit
          exit("There is already a process running with PID ".file_get_contents($pid)." in $pid");
        }
        else{
          // Otherwise we delete the PID file
          echo "DELETING FILEPID AS THE PROCESS IS DEAD ".implode(PHP_EOL, $pid_content).PHP_EOL;
          @unlink($pid);
        }
      }
      // We create the PID file corresponding to the current process
      file_put_contents($pid, getmypid().'|'.time());
      $cron =& $this;
      // Shutdown function, will be always executed, except if the server is stopped
      register_shutdown_function(function() use($cron){
        $data = $cron->get_data();
        $pid = $this->get_pid_path($data);
        $file_content = @file_get_contents($pid);
        // Write the error log if an error is present
        if ( $error = error_get_last() ){
          @file_put_contents($cron->get_error_log_path($data), \bbn\x::get_dump($error));
          if ( defined('BBN_DATA_PATH') && is_dir(BBN_DATA_PATH.'logs') ){
            bbn\x::log([$data, $error], 'cron');
          }
        }
        $ok = true;
        // We check if there is a problem with the PID file (it's only debug it shouldn't be necessary)
        if ( $file_content ){
          echo $file_content.PHP_EOL;
          $pid_content = explode('|', $file_content);
          if ( $pid_content[1] && ($pid_content[0] != getmypid()) ){
            echo 'Different processes: '.$pid_content[0].'/'.getmypid().PHP_EOL;
            $ok = false;
          }
        }
        if ( $ok && isset($data['type']) ){
          // We output the ending time (as all output will be logged in the output file
          echo 'SHUTDOWN '.date('H:i:s');
          // Removing PID file
          if ( is_file($pid) ){
            @unlink($pid);
          }
          // And relaunching the continuous tasks if we are in the poller...
          if ( ($data['type'] === 'poll') && $cron->is_poll_active() ){
            $cron->launch_poll();
          }
          else if ( !array_key_exists('id', $data) && ($data['type'] === 'cron') && $cron->is_cron_active() ){
            $cron->launch_task_system();
          }
        }
      });
      // And here we really do what we have to do
      // Poll case
      if ( $type === 'poll' ){
        $this->poll();
      }
      else if ( $type === 'cron' ){
        if ( array_key_exists('id', $this->data) ){
          echo 'Launching task...';
          $this->run_task($this->data);
        }
        else{
          $this->run_task_system();
        }
      }
    }
  }
304944
public function run()
    {
        $events = $this->dueEvents(EventReposity::getEvents());

        foreach ($events as $event) {
            $event->execute();
        }
    }
1145012
public function run()
    {
        Model::unguard();

        DB::statement('SET FOREIGN_KEY_CHECKS=0;');

        DB::table('users')->delete();

        $admin = User::create([
            'id'          => 1,
            'name'        => 'admin',
            'email'       => 'admin@vain.app',
            'password'    => bcrypt('123456'),
            'locale'      => 'en',
            'birthday_at' => '2000-01-01',
        ]);

        $fgreinus = User::create([
            'id'          => 2,
            'name'        => 'fgreinus',
            'email'       => 'florian.greinus@gmail.com',
            'password'    => bcrypt('123456'),
            'locale'      => 'de',
            'birthday_at' => '2000-01-01',
        ]);

        $voydz = User::create([
            'id'          => 3,
            'name'        => 'voydz',
            'email'       => 'voydz@hotmail.com',
            'password'    => bcrypt('123456'),
            'locale'      => 'de',
            'birthday_at' => '2000-01-01',
        ]);

        $ottowayne = User::create([
            'id'          => 4,
            'name'        => 'ottowayne',
            'email'       => 'mr.ottowayne@gmail.com',
            'password'    => bcrypt('123456'),
            'locale'      => 'de',
            'birthday_at' => '2000-01-01',
        ]);

        // add user to admin roles
        /** @var Role[] $adminRoles */
        $adminRoles = Role::where('name', 'administrator')->get();
        $admin->saveRoles($adminRoles);
        $fgreinus->saveRoles($adminRoles);
        $voydz->saveRoles($adminRoles);
        $ottowayne->saveRoles($adminRoles);

        // add all permissions to admin roles
        /** @var Permission[] $permissions */
        $permissions = Permission::all();
        foreach ($adminRoles as $role) {
            $role->savePermissions($permissions);
        }

        DB::statement('SET FOREIGN_KEY_CHECKS=1;');
    }
109713
public function run()
    {

         //Get The Models To put In Database
        $models = collect([
                    'Post' => Post::class,
                    'Tag' => Tag::class,
                    'Category' => Category::class
                     ]);

        //Each Model Got His Attribues
        $columns = collect([
               'Post' => [
                    'title' => [
                        'required|max:150',
                        'text',
                        true,
                        null
                    ],
                    'slug' => [
                        'required|unique:posts,slug',
                        'text',
                        true,
                        null
                    ],
                    'content' => [
                        'required',
                        'rich_text_box',
                        false,
                        null
                    ],
                    'description' => [
                        'required|max:250',
                        'text_area',
                        false,
                        null
                    ],
                    'featured' => [
                        null,
                        'checkbox',
                        false,
                        null
                    ],
                    'tags' => [
                        null,
                        'tags',
                        false,
                        null
                    ],
                    'category' => [
                        'required',
                        'category',
                        false,
                        null
                    ],
                    'image' => [
                        'required|mimes:jpeg,bmp,png',
                        'image',
                        true,
                        null
                    ],
                    'status' => [
                        null,
                        'status',
                        true,
                        [
                            [
                                'value' => 'PUBLISHED',
                                'option' => 'PUBLISHED'
                            ],
                            [
                                'value' => 'PENDING',
                                'option' => 'PENDING'
                            ],
                            [
                                'value' => 'DRAFT',
                                'option' => 'DRAFT'
                            ]
                        ],
                    ]
                ],
               'Tag' => [
                    'name' => [
                        'required|max:156',
                        'text',
                        true,
                        null
                    ],
                    'slug' => [
                        'required|max:100|unique:tags,slug',
                        'string',
                        true,
                        null
                    ]
                ],
               'Category' => [
                    'name' => [
                        'required|max:156',
                        'text',
                        true,
                        null
                    ],
                    'slug' => [
                        'required|max:100|unique:categories,slug',
                        'string',
                        true,
                        null
                    ]
                ]
               ]);
      $settings = collect([
        'title' => [
            'Site Title',
            'text'
        ],
        'description' => [
            'Site Description',
            'text'
        ],
        'logo' => [
            'Site Logo',
            'image'
        ],
        'google_analytics_client_id' => [
            'Google Api Id',
            'text'
        ]
      ]);


        $this->command->info('Laramin Data Seeder');

        $this->command->info('Seed Settings');
        $settings->each(function($value,$index) {
            $this->command->info('Creating Settings for '.$index);
            Settings::create([
                    'key' => $index,
                    'display_name' => $value[0],
                    'type' => $value[1],
            ]);
        });


        $models->each(function ($model, $index) use ($columns) {
            $this->command->info('Creating Data Type to '.$index);

            $res = DataType::create([
                        'name' => $index,
                        'menu' => true,
                        'model' =>  $index,
                        'slug' => strtolower($index),
                    ]);
            $id = $res->id;
            $columns->filter(function ($item, $key) use ($index, $id) {
                return $key == $index;
            })->Flatmap(function ($item, $key) use ($id) {
                return $item;
            })->each(function ($item, $key) use ($id) {
                $this->command->info('Creating Data Info '.$key.' for '.DataType::find($id)->name);

                DataInfo::create([
                        'data_types_id' => $id,
                        'column' => $key,
                        'type' => $item[1],
                        'validation' => $item[0] == null ? NULL : json_encode($item[0]),
                        'details' => $item[3] == null ? NULL : json_encode($item[3]),
                        'display' => $item[2]
                    ]);
            });
        });
    }
1351364
public function run() {
			$this->execute();

			if ($handler = $this->getFormHandler(@$_REQUEST['_form_name']))
				call_user_func($handler, $_REQUEST);
		}
51541
public function run()
    {
        $this->container->get('app')->run(
            $this->container->get('app.input'),
            $this->container->get('app.output')
        );
    }
356209
public function run()
    {
        DB::table('posts')->delete();

        $post = array(
            'title'      => 'Hello World',
            'summary'    => 'This is the first blog post.',
            'body'       => 'This is an example blog post.',
            'user_id'    => 1,
            'created_at' => new DateTime,
            'updated_at' => new DateTime
        );

        DB::table('posts')->insert($post);
    }
1334707
public function run()
    {
        session_start();
        self::$_app = $this;
        if (empty($this->_runtimePath)) {
            $this->_runtimePath = $this->_basePath . '/runtime';
        }
        $application = $this->getComponent('application');
        $application->runController();
    }