Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
stefanak-michal committed Jul 15, 2024
1 parent 438c021 commit 5e7e3a3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Bolt.php
Original file line number Diff line number Diff line change
@@ -27,7 +27,6 @@ final class Bolt
public function __construct(private IConnection $connection)
{
$_ENV['TEMP_DIR'] = getenv('TEMP') ?: getenv('TMPDIR') ?: (dirname(__DIR__) . DIRECTORY_SEPARATOR . 'temp');
var_dump($_ENV['TEMP_DIR']);
if (!file_exists($_ENV['TEMP_DIR'])) {
mkdir($_ENV['TEMP_DIR'], recursive: true);
}
@@ -48,12 +47,11 @@ private function track(): void
$time = intval(explode('.', basename($file))[1]);
if ($time < strtotime('today')) {
$count = file_get_contents($file);
unlink($file);

$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api-eu.mixpanel.com/import?strict=0&project_id=3355308',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_RETURNTRANSFER => false,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => $this->connection->getTimeout(),
@@ -77,7 +75,10 @@ private function track(): void
'authorization: Basic MDJhYjRiOWE2YTM4MThmNWFlZDEzYjNiMmE5M2MxNzQ6',
],
]);
curl_exec($curl);

if (curl_exec($curl)) {
unlink($file);
}
curl_close($curl);
}
}

0 comments on commit 5e7e3a3

Please sign in to comment.