-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbootstrap.php
41 lines (31 loc) · 1.15 KB
/
bootstrap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php declare(strict_types = 1);
/**
* This file is part of the Spameri (http://www.github.com/spameri)
*
* Copyright (c) 2018 Václav Čevela ([email protected])
*
* For the full copyright and license information, please view the file license.md that was distributed with this
* source code.
*/
if (\defined('__PHPSTAN_RUNNING__')) {
return;
}
$loader = include __DIR__ . '/../vendor/autoload.php';
if ( ! $loader) {
echo 'Install Nette Tester using `composer update --dev`';
exit(1);
}
// configure environment
\Tester\Environment::setup();
\date_default_timezone_set('Europe/Prague');
\define('TEMP_DIR', __DIR__ . '/tmp/' . (isset($_SERVER['argv']) ? \md5(\serialize($_SERVER['argv'])) : \getmypid()));
Tester\Helpers::purge(\TEMP_DIR);
Tracy\Debugger::$logDirectory = \TEMP_DIR;
$ch = \curl_init();
\curl_setopt($ch, \CURLOPT_URL, \SpameriTests\Elastic\Config::CONNECTION . '/' . \SpameriTests\Elastic\Config::INDEX . '*');
\curl_setopt($ch, \CURLOPT_RETURNTRANSFER, 1);
\curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'DELETE');
\curl_setopt($ch, \CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
\curl_exec($ch);
\curl_close($ch);
return $loader;