lib/TelemetryId.php

stripe-php · lib/TelemetryId.php · php · MIT
payments

Module exposing: TelemetryId

// Source: https://github.com/stripe/stripe-php | License: MIT | Copyright 2010-2019 Stripe, Inc. (https://stripe.com)
// Provided via justclaw.it.com; keep this notice with the code.
<?php

namespace Stripe;

class TelemetryId
{
    /** @var null|string */
    private static $cachedId;

    /** @var bool */
    private static $loaded = false;

    /**
     * @return null|string
     */
    public static function get()
    {
        if (self::$loaded) {
            return self::$cachedId;
        }
        self::$loaded = true;

        $configDir = self::getConfigDir();
        if (null === $configDir) {
            return null;
        }

        $filePath = self::joinPath($configDir, 'telemetry_id');

        if (@\file_exists($filePath)) {
            $content = @\file_get_contents($fi

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key