Run the database seeds.
975601
public function run()
    {
        $data = [
            'Home',
            'Mobile',
            'Office',
            'Other',
        ];

        foreach ($data as $datum) {
            \CleaniqueCoders\Profile\Models\PhoneType::create([
                'name'  => $datum,
                'label' => Str::slug($datum, '-'),
            ]);
        }
    }
805901
public function run()
    {
        $this->seed('CategoriesTableSeeder');
        $this->seed('UsersTableSeeder');
        $this->seed('PostsTableSeeder');
        $this->seed('PagesTableSeeder');
        $this->seed('SettingsTableSeeder');
        $this->seed('TranslationsTableSeeder');
    }
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");
    }
406188
public function run()
    {
        $this->call(ImageStylesTableSeeder::class);
        $this->call(PermissionsTableSeeder::class);
        $this->call(RolesTableSeeder::class);
        $this->call(UsersTableSeeder::class);
    }
982609
public function run()
    {
        Model::unguard();

        $this->call('Modules\User\Database\Seeders\PermissionPermissionTableSeeder');
        $this->call('Modules\User\Database\Seeders\RolePermissionTableSeeder');
        $this->call('Modules\User\Database\Seeders\UserPermissionTableSeeder');

        $this->call('Modules\User\Database\Seeders\RoleTableSeeder');
    }
1348880
static public function run()
  {
    foreach (self::$dbs as $db) {
      $db->execute(self::files());
    }

    foreach (self::$writers as $writer) {
      $writer->execute(self::files());
    }
  }
1326565
public function run()
    {
        Model::unguard();

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

        $this->call('Modules\Blog\Database\Seeders\CategoriesTableSeeder');
        $this->call('Modules\Blog\Database\Seeders\PostsTableSeeder');
        $this->call('Modules\Blog\Database\Seeders\CommentsTableSeeder');
        $this->call('Modules\Blog\Database\Seeders\CategoriesContentTableSeeder');
        $this->call('Modules\Blog\Database\Seeders\PostsContentTableSeeder');

        DB::statement('SET FOREIGN_KEY_CHECKS=1;');
    }
768166
public function run()
    {
        $this->seed([
            [
                'group'       => [
                    'name'        => 'Blog',
                    'slug'        => 'blog',
                    'description' => 'Blog permissions group',
                ],
                'permissions' => array_merge(
                    $this->getDashboardPermissions(),
                    $this->getPostsPermissions(),
                    $this->getCategoriesPermissions(),
                    $this->getTagsPermissions()
                ),
            ],
        ]);
    }
200356
protected function runSeeds()
	{
		foreach($this->getSeeders() as $file) {
			require_once $file;
			$className = basename($file, '.php');
			$this->runSeed($className);
		}
	}
1054617
def run():
    """"""
    _parser_options()
    set_verbose(args["verbose"])
    
    if _check_global_settings():
        _load_db()
    else:
        exit(-1)

    #Check the server configuration against the script arguments passed in.
    _setup_server()

    if args["rollback"]:
        _server_rollback()
        okay("The server rollback appears to have been successful.")
        exit(0)

    _server_enable()    
    _list_repos()
    _handle_install()
    
    #This is the workhorse once a successful installation has happened.
    _do_cron()
80371
public function run()
    {
        config()->set('gzero-core.db_transactions', false);
        $languages = Language::all()->keyBy('code');
        $users     = $this->seedUsers();
        $contents  = $this->seedContent($languages, $users);
        $this->seedBlock(BlockType::all(), $languages, $users, $contents);
        //$fileTypes    = $this->seedFileTypes();
        //$files        = $this->seedFiles($fileTypes, $languages, $users, $contents, $blocks);
        //$this->seedOptions($languages);
    }
100486
public function run()
    {
        $countries = @json_decode(file_get_contents(realpath(__DIR__ . '/../seeds/countries.json'), true));

        DB::table(config('countries.table_name'))->delete();

        foreach ($countries as $countryId => $country) {
            DB::table(config('countries.table_name'))->insert(array(
                'id' => $countryId,
                'capital' => $country->capital ?? null,
                'citizenship' => $country->citizenship ?? null,
                'country_code' => $country->country_code,
                'currency' => $country->currency ?? null,
                'currency_code' => $country->currency_code ?? null,
                'currency_sub_unit' => $country->currency_sub_unit ?? null,
                'currency_decimals' => $country->currency_decimals ?? null,
                'full_name' => $country->full_name ?? null,
                'iso_3166_2' => $country->iso_3166_2,
                'iso_3166_3' => $country->iso_3166_3,
                'name' => $country->name,
                'region_code' => $country->region_code,
                'sub_region_code' => $country->sub_region_code,
                'eea' => (bool) $country->eea,
                'calling_code' => $country->calling_code,
                'currency_symbol' => $country->currency_symbol ?? null,
                'flag' => $country->flag ?? null,
            ));
        }
    }
1248868
public function run()
    {
        $this->Script->startup();

        $this->Options = $this->Script->getOptions(
            "[db-host:][db-user:][db-password:][db-database:][db-type:|db-driver:][sql][clean][clean-all][conc:][php-exec:][commit-within:]",
            "",
            array(
                'db-host' => "Database host",
                'db-user' => "Database user",
                'db-password' => "Database password",
                'db-database' => "Database name",
                'db-driver' => "Database driver",
                'db-type' => "Database driver, alias for --db-driver",
                'sql' => "Display sql queries",
                'clean' =>  "Remove all search data of the current installation id before beginning indexing",
                'clean-all' => "Remove all search data for all installations",
                'conc' => 'Parallelization, number of concurent processes to use',
                'php-exec' => 'Full path to PHP executable',
                'commit-within' => 'Commit to Solr within this time in seconds (default '
                    . self::DEFAULT_COMMIT_WITHIN . ' seconds)',
            )
        );
        $this->Script->initialize();

        // check if ezfind is enabled and exit if not
        if ( ! in_array( 'ezfind', eZExtension::activeExtensions() ) )
        {
            $this->CLI->error( 'eZ Find extension is not enabled and because of that index process will fail. Please enable it and run this script again.' );
            $this->Script->shutdown( 0 );
        }

        // Fix siteaccess
        $siteAccess = $this->Options['siteaccess'] ? $this->Options['siteaccess'] : false;
        if ( $siteAccess )
        {
            $this->changeSiteAccessSetting( $siteAccess );
        }
        else
        {
            $this->CLI->warning( 'You did not specify a siteaccess. The admin siteaccess is a required option in most cases.' );
            $input = readline( 'Are you sure the default siteaccess has all available languages defined? ([y] or [q] to quit )' );
            if ( $input === 'q' )
            {
                $this->Script->shutdown( 0 );
            }
        }

        // Check that Solr server is up and running
        if ( !$this->checkSolrRunning() )
        {
            $this->Script->shutdown( 1 );
            exit();
        }

        $this->initializeDB();

        // call clean up routines which will deal with the CLI arguments themselves
        $this->cleanUp();
        $this->cleanUpAll();

        if ( isset( $this->Options['commit-within'] )
                && is_numeric( $this->Options['commit-within'] ) )
        {
            $this->commitWithin = (int)$this->Options['commit-within'];
        }


        $this->CLI->output( 'Starting object re-indexing' );

        // Get PHP executable from user.
        $this->getPHPExecutable();

        $this->runMain();
    }
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();
        }
      }
    }
  }
985751
public void run() {
    // Input step
    Database db = inputStep.getDatabase();
    hier = db.getHierarchy();

    // Algorithms - Data Mining Step
    algorithmStep.runAlgorithms(db);

    // TODO: this could be nicer
    hier.add(db, new SettingsResult(settings));

    // Evaluation
    evaluationStep.runEvaluators(hier, db);

    // Output / Visualization
    outputStep.runResultHandlers(hier, db);
  }
514180
public function run()
	{
		\Aimeos\MAdmin\Cache\Manager\Factory::create( $this->getContext() )->getCache()->cleanup();
	}
901870
public function run()
    {
        $this->call(__NAMESPACE__.'\\OptionsTableSeeder');
        $this->call(__NAMESPACE__.'\\RolesTableSeeder');
        $this->call(__NAMESPACE__.'\\PermissionsTableSeeder');
        $this->call(__NAMESPACE__.'\\UsersTableSeeder');
        $this->call(__NAMESPACE__.'\\CategoriesTableSeeder');
    }