/** * @param string $dir * @param bool $append */ public function loadFixturesFromDir($dir, $append = true) { if (!$append) { $this->purger->purge(); } $this->loader->loadFromDirectory($dir); $this->executor->execute($this->loader->getFixtures()); }
public function __construct() { $arr = Executor::execute("df -PB 1"); foreach ($arr as $line) { $columns = preg_split("/ /", $line, -1, PREG_SPLIT_NO_EMPTY); $this->df[$columns[0]] = array("capacity" => $columns[1], "used" => $columns[2], "available" => $columns[3], "percent" => $columns[4], "path" => $columns[5]); } }
/** * {@inheretDoc} */ protected function execute(InputInterface $input, OutputInterface $output) { foreach ($this->properties as $property) { $property->setValue($input->getOption($property->getName())); } foreach ($this->properties as $property) { $property->makeReady($this, $input, $output); } $this->executor->execute($this, $input, $output); }
<?php ini_set("display_errors", "On"); error_reporting(E_ALL); function __autoload($class) { require_once "php/system/{$class}.php"; } define('DIR_HOME', __DIR__); $common = new Common(); $config = new Config($common); $common->set('config', $config); if (isset($_COOKIE['dbName'])) { $db = new DataBase($_COOKIE['dbName'], isset($_COOKIE['collName']) ? $_COOKIE['collName'] : 0); $common->set('db', $db); } $request = new Request($_GET['route'], $_SERVER['REQUEST_METHOD']); $common->set('request', $request); $response = new Response(); $common->set('response', $response); $action = new Action($request->getRoute(), $request->getType()); $request->setArgs($action->getArgs()); $executor = new Executor($common); $executor->execute($action); //var_dump($action->getClass(), $action->getMethod()); $response->output();
<?php namespace BRS\PerformanceDiff; $executor = new Executor('Testing getting a char in a string using indexing vs substrings.', 1000000, Executor::TARE | Executor::PROGRESS); $executor->setPrepCallback(function ($executor) { $string = ''; $pool = '1234567890qwertyuiopasdfghjklzxcvbnm'; while (strlen($string) > 10000) { // hint hint... $string .= $string[rand(0, strlen($pool) - 1)]; } $executor->setPayload(array(strlen($string), $string)); }); $executor->setTareFunction(function ($payload) { return rand(0, $payload[0] - 1); }); $executor->setRerun(10); $executor->addTest(new Test('Index', function ($payload) { return $payload[1][rand(0, $payload[0] - 1)]; })); $executor->addTest(new Test('Substr', function ($payload) { return substr($string, rand(0, $payload[0]), 1); })); $executor->execute(); $executor->log(basename(__FILE__) . '.' . time());
/** * マイグレーションの適用 * * @param string $version */ private function applyMigrate($version) { $fn = $this->scriptDirectory . DIRECTORY_SEPARATOR . $version; $this->executor->execute($fn); }