コード例 #1
0
ファイル: FixtureLoader.php プロジェクト: starsw001/solarium
 /**
  * @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());
 }
コード例 #2
0
 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]);
     }
 }
コード例 #3
0
ファイル: TaskCommand.php プロジェクト: jezhalford/stam
 /**
  * {@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);
 }
コード例 #4
0
ファイル: index.php プロジェクト: rmakarov94/dbk
<?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();
コード例 #5
0
<?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());
コード例 #6
0
ファイル: Manager.php プロジェクト: sickhye/php-db-migrate
 /**
  * マイグレーションの適用
  *
  * @param string $version
  */
 private function applyMigrate($version)
 {
     $fn = $this->scriptDirectory . DIRECTORY_SEPARATOR . $version;
     $this->executor->execute($fn);
 }