/**
  * @param InputInterface $input
  * @param OutputInterface $output
  * @throws Exception
  * @returns null
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     if (!Check::fileToUrlMapping()) {
         die('ERROR: Please set a valid path in $_FILE_TO_URL_MAPPING before running the seeder' . PHP_EOL);
     }
     if (SiteTree::has_extension('SiteTreeLinkTracking')) {
         SiteTree::remove_extension('SiteTreeLinkTracking');
     }
     // Customer overrides delete to check for admin
     // major hack to enable ADMIN permissions
     // login throws cookie warning, this will hide the error message
     error_reporting(0);
     try {
         if ($admin = Member::default_admin()) {
             $admin->logIn();
         }
     } catch (Exception $e) {
     }
     error_reporting(E_ALL);
     $writer = new RecordWriter();
     if ($input->getOption('batch')) {
         $batchSize = intval($input->getOption('size'));
         $writer = new BatchedSeedWriter($batchSize);
     }
     $seeder = new Seeder($writer, new CliOutputFormatter());
     $className = $input->getOption('class');
     $key = $input->getOption('key');
     if ($input->getOption('force')) {
         $seeder->setIgnoreSeeds(true);
     }
     $seeder->seed($className, $key);
     return;
 }
 /**
  * run
  *
  * @access public
  * @return void
  */
 public function run()
 {
     parent::run();
     $routes = Route::getRoutes();
     $children = [];
     foreach ($routes as $route) {
         list($controller, $action) = explode('@', $route->getActionName());
         $parent = Resource::firstOrCreate(['name' => $controller]);
         $child = ['name' => $route->getName(), 'action' => $action, 'url' => $route->getPath(), 'parent_id' => $parent->id];
         $children[] = $child;
     }
     DB::table('resources')->insert($children);
 }
Beispiel #3
0
 public function seed($name)
 {
     $seeder = new Seeder();
     $seeder->call($name);
 }
/**
 * Create custom wp database for storing testimonials
 */
function install_db()
{
    Data::setDatabase();
    Seeder::run();
}
 public function seed($name)
 {
     $this->load->library('Seeder');
     $seeder = new Seeder();
     $seeder->call($name);
 }
Beispiel #6
0
<?php

/**************************************************************************
 MantisBT Seeder Plugin
 Copyright (c) MantisHub - Victor Boctor
 All rights reserved.
 MIT License
 **************************************************************************/
access_ensure_global_level(ADMINISTRATOR);
require_once dirname(dirname(__FILE__)) . '/core/Seeder.php';
html_page_top1();
html_meta_redirect(plugin_page('config_page'));
html_page_top2();
$f_create_issues = gpc_isset('create_issues');
$g_enable_email_notification = OFF;
$t_seeder = new Seeder();
if ($f_create_issues !== OFF) {
    $t_project_ids = $t_seeder->createProjects();
    $t_seeder->createIssues($t_project_ids);
}
echo '<div class="success-msg">';
echo lang_get('operation_successful');
echo '</div>';
html_page_bottom();
Beispiel #7
0
 public function seed()
 {
     $this->seeder->setAllServiceProvidersFrom($this->componentsBaseFolder);
     $this->composer->setEnvironment($this->environment);
     $this->seeder->seedAll();
 }
Beispiel #8
0
<?php

$Root = "../../";
include_once $Root . '../core/Ini.php';
App::run(null, $Root, false, true, false);
Seeder::ini();
echo "Le Seed a été executé";