Skip to content

Commit

Permalink
chore: pre-release
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricerenck committed Jun 10, 2023
1 parent 9c69baf commit 2c2176a
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 12 deletions.
12 changes: 8 additions & 4 deletions vendor/composer/ClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,8 @@ public function unregister()
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
(self::$includeFile)($file);
$includeFile = self::$includeFile;
$includeFile($file);

return true;
}
Expand Down Expand Up @@ -560,7 +561,10 @@ private function findFileWithExtension($class, $ext)
return false;
}

private static function initializeIncludeClosure(): void
/**
* @return void
*/
private static function initializeIncludeClosure()
{
if (self::$includeFile !== null) {
return;
Expand All @@ -574,8 +578,8 @@ private static function initializeIncludeClosure(): void
* @param string $file
* @return void
*/
self::$includeFile = static function($file) {
self::$includeFile = \Closure::bind(static function($file) {
include $file;
};
}, null, null);
}
}
17 changes: 12 additions & 5 deletions vendor/composer/InstalledVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true)
{
foreach (self::getInstalled() as $installed) {
if (isset($installed['versions'][$packageName])) {
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
}
}

Expand All @@ -119,7 +119,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true)
*/
public static function satisfies(VersionParser $parser, $packageName, $constraint)
{
$constraint = $parser->parseConstraints($constraint);
$constraint = $parser->parseConstraints((string) $constraint);
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));

return $provided->matches($constraint);
Expand Down Expand Up @@ -328,7 +328,9 @@ private static function getInstalled()
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) {
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
$required = require $vendorDir.'/composer/installed.php';
$installed[] = self::$installedByVendor[$vendorDir] = $required;
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
self::$installed = $installed[count($installed) - 1];
}
Expand All @@ -340,12 +342,17 @@ private static function getInstalled()
// only require the installed.php file if this file is loaded from its dumped location,
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
if (substr(__DIR__, -8, 1) !== 'C') {
self::$installed = require __DIR__ . '/installed.php';
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
$required = require __DIR__ . '/installed.php';
self::$installed = $required;
} else {
self::$installed = array();
}
}
$installed[] = self::$installed;

if (self::$installed !== array()) {
$installed[] = self::$installed;
}

return $installed;
}
Expand Down
9 changes: 9 additions & 0 deletions vendor/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,16 @@
'getid3_wtv' => $vendorDir . '/james-heinrich/getid3/getid3/module.audio-video.wtv.php',
'getid3_xz' => $vendorDir . '/james-heinrich/getid3/getid3/module.archive.xz.php',
'getid3_zip' => $vendorDir . '/james-heinrich/getid3/getid3/module.archive.zip.php',
'mauricerenck\\Podcaster\\AudioTools' => $baseDir . '/app/AudioTools.php',
'mauricerenck\\Podcaster\\Feed' => $baseDir . '/app/Feed.php',
'mauricerenck\\Podcaster\\Migrations' => $baseDir . '/app/Migrations.php',
'mauricerenck\\Podcaster\\Podcast' => $baseDir . '/app/Podcast.php',
'mauricerenck\\Podcaster\\PodcasterDatabase' => $baseDir . '/app/PodcasterDatabase.php',
'mauricerenck\\Podcaster\\PodcasterStats' => $baseDir . '/app/PodcasterStats.php',
'mauricerenck\\Podcaster\\PodcasterStatsInterface' => $baseDir . '/app/PodcasterStats.interface.php',
'mauricerenck\\Podcaster\\PodcasterStatsInterfaceBase' => $baseDir . '/app/PodcasterStats.interface.php',
'mauricerenck\\Podcaster\\PodcasterStatsMatomo' => $baseDir . '/app/PodcasterStatsMatomo.php',
'mauricerenck\\Podcaster\\PodcasterStatsMysql' => $baseDir . '/app/PodcasterStatsMysql.php',
'mauricerenck\\Podcaster\\PodcasterStatsSqlite' => $baseDir . '/app/PodcasterStatsSqlite.php',
'mauricerenck\\Podcaster\\TestCaseMocked' => $baseDir . '/app/TestCaseMocked.php',
);
9 changes: 9 additions & 0 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,17 @@ class ComposerStaticInit9574998a8d6f27428f2fc454b8cd7e84
'getid3_wtv' => __DIR__ . '/..' . '/james-heinrich/getid3/getid3/module.audio-video.wtv.php',
'getid3_xz' => __DIR__ . '/..' . '/james-heinrich/getid3/getid3/module.archive.xz.php',
'getid3_zip' => __DIR__ . '/..' . '/james-heinrich/getid3/getid3/module.archive.zip.php',
'mauricerenck\\Podcaster\\AudioTools' => __DIR__ . '/../..' . '/app/AudioTools.php',
'mauricerenck\\Podcaster\\Feed' => __DIR__ . '/../..' . '/app/Feed.php',
'mauricerenck\\Podcaster\\Migrations' => __DIR__ . '/../..' . '/app/Migrations.php',
'mauricerenck\\Podcaster\\Podcast' => __DIR__ . '/../..' . '/app/Podcast.php',
'mauricerenck\\Podcaster\\PodcasterDatabase' => __DIR__ . '/../..' . '/app/PodcasterDatabase.php',
'mauricerenck\\Podcaster\\PodcasterStats' => __DIR__ . '/../..' . '/app/PodcasterStats.php',
'mauricerenck\\Podcaster\\PodcasterStatsInterface' => __DIR__ . '/../..' . '/app/PodcasterStats.interface.php',
'mauricerenck\\Podcaster\\PodcasterStatsInterfaceBase' => __DIR__ . '/../..' . '/app/PodcasterStats.interface.php',
'mauricerenck\\Podcaster\\PodcasterStatsMatomo' => __DIR__ . '/../..' . '/app/PodcasterStatsMatomo.php',
'mauricerenck\\Podcaster\\PodcasterStatsMysql' => __DIR__ . '/../..' . '/app/PodcasterStatsMysql.php',
'mauricerenck\\Podcaster\\PodcasterStatsSqlite' => __DIR__ . '/../..' . '/app/PodcasterStatsSqlite.php',
'mauricerenck\\Podcaster\\TestCaseMocked' => __DIR__ . '/../..' . '/app/TestCaseMocked.php',
);

Expand Down
6 changes: 3 additions & 3 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
'dev_requirement' => false,
),
'matomo/matomo-php-tracker' => array(
'pretty_version' => '3.1.2',
'version' => '3.1.2.0',
'reference' => '78932f61692b18c6b5de923dbc3880ad3380e328',
'pretty_version' => '3.2.0',
'version' => '3.2.0.0',
'reference' => 'c9e7816d63ddf99bffb1414cfbe45f4c4edf1d4b',
'type' => 'library',
'install_path' => __DIR__ . '/../matomo/matomo-php-tracker',
'aliases' => array(),
Expand Down
33 changes: 33 additions & 0 deletions vendor/matomo/matomo-php-tracker/MatomoTracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ public function __construct($idSite, $apiUrl = '')

// Allow debug while blocking the request
$this->requestTimeout = 600;
$this->requestConnectTimeout = 300;
$this->doBulkRequests = false;
$this->storedTrackingActions = [];

Expand All @@ -172,6 +173,11 @@ public function __construct($idSite, $apiUrl = '')
$this->incomingTrackerCookies = [];
}

public function setApiUrl(string $url)
{
self::$URL = $url;
}

/**
* By default, Matomo expects utf-8 encoded values, for example
* for the page URL parameter values, Page Title, etc.
Expand Down Expand Up @@ -1692,6 +1698,32 @@ public function setRequestTimeout($timeout)
return $this;
}

/**
* Returns the maximum number of seconds the tracker will spend trying to connect to Matomo.
* Defaults to 300 seconds.
*/
public function getRequestConnectTimeout()
{
return $this->requestConnectTimeout;
}

/**
* Sets the maximum number of seconds that the tracker will spend tryint to connect to Matomo.
*
* @param int $timeout
* @return $this
* @throws Exception
*/
public function setRequestConnectTimeout($timeout)
{
if (!is_int($timeout) || $timeout < 0) {
throw new Exception("Invalid value supplied for request connect timeout: $timeout");
}

$this->requestConnectTimeout = $timeout;
return $this;
}

/**
* Sets the request method to POST, which is recommended when using setTokenAuth()
* to prevent the token from being recorded in server logs. Avoid using redirects
Expand Down Expand Up @@ -1747,6 +1779,7 @@ protected function prepareCurlOptions($url, $method, $data, $forcePostUrlEncoded
CURLOPT_USERAGENT => $this->userAgent,
CURLOPT_HEADER => true,
CURLOPT_TIMEOUT => $this->requestTimeout,
CURLOPT_CONNECTTIMEOUT => $this->requestConnectTimeout,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array(
'Accept-Language: ' . $this->acceptLanguage,
Expand Down

0 comments on commit 2c2176a

Please sign in to comment.