Whoops! There was an error.
GuzzleHttp \ Exception \ ClientException (400)
Client error: `GET https://bitsectorcom.cdn.prismic.io/api/v2/documents/search?page=1&pageSize=20&access_token=MC5XNWZRN3lVQUFDWUF1ZDR4.O0dKH2QG77-9SO-_vSbvv70HH--_vV4677-9Zu-_ve-_ve-_ve-_vUPvv70T77-9J1zvv73vv70zTw&ref=XA6g9xIAACgAKIU6&q=%5B%5B%3Ad+%3D+at%28document.type%2C+%22coin%22%29%5D%5B%3Ad+%3D+at%28my.coin.coin_symbol%2C+%29%5D%5D` resulted in a `400 Bad Request` response: {"message":"[function at(..)] field 'my.coin.coin_symbol' expected a 'string' literal on line:1 col:64 in query '[[:d = (truncated...) GuzzleHttp\Exception\ClientException thrown with message "Client error: `GET https://bitsectorcom.cdn.prismic.io/api/v2/documents/search?page=1&pageSize=20&access_token=MC5XNWZRN3lVQUFDWUF1ZDR4.O0dKH2QG77-9SO-_vSbvv70HH--_vV4677-9Zu-_ve-_ve-_ve-_vUPvv70T77-9J1zvv73vv70zTw&ref=XA6g9xIAACgAKIU6&q=%5B%5B%3Ad+%3D+at%28document.type%2C+%22coin%22%29%5D%5B%3Ad+%3D+at%28my.coin.coin_symbol%2C+%29%5D%5D` resulted in a `400 Bad Request` response: {"message":"[function at(..)] field 'my.coin.coin_symbol' expected a 'string' literal on line:1 col:64 in query '[[:d = (truncated...) " Stacktrace: #18 GuzzleHttp\Exception\ClientException in /app/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113 #17 GuzzleHttp\Exception\RequestException:create in /app/vendor/guzzlehttp/guzzle/src/Middleware.php:66 #16 GuzzleHttp\Middleware:GuzzleHttp\{closure} in /app/vendor/guzzlehttp/promises/src/Promise.php:203 #15 GuzzleHttp\Promise\Promise:callHandler in /app/vendor/guzzlehttp/promises/src/Promise.php:156 #14 GuzzleHttp\Promise\Promise:GuzzleHttp\Promise\{closure} in /app/vendor/guzzlehttp/promises/src/TaskQueue.php:47 #13 GuzzleHttp\Promise\TaskQueue:run in /app/vendor/guzzlehttp/promises/src/Promise.php:246 #12 GuzzleHttp\Promise\Promise:invokeWaitFn in /app/vendor/guzzlehttp/promises/src/Promise.php:223 #11 GuzzleHttp\Promise\Promise:waitIfPending in /app/vendor/guzzlehttp/promises/src/Promise.php:267 #10 GuzzleHttp\Promise\Promise:invokeWaitList in /app/vendor/guzzlehttp/promises/src/Promise.php:225 #9 GuzzleHttp\Promise\Promise:waitIfPending in /app/vendor/guzzlehttp/promises/src/Promise.php:62 #8 GuzzleHttp\Promise\Promise:wait in /app/vendor/guzzlehttp/guzzle/src/Client.php:131 #7 GuzzleHttp\Client:request in /app/vendor/guzzlehttp/guzzle/src/Client.php:89 #6 GuzzleHttp\Client:__call in /app/vendor/prismic/php-sdk/src/Prismic/SearchForm.php:301 #5 Prismic\SearchForm:submit_raw in /app/vendor/prismic/php-sdk/src/Prismic/SearchForm.php:216 #4 Prismic\SearchForm:submit in /app/vendor/prismic/php-sdk/src/Prismic/Api.php:497 #3 Prismic\Api:query in /app/api/coin-prismic.php:10 #2 include in /app/pages/coin.php:4 #1 include in /app/php/page-content.php:10 #0 include in /app/index.php:28
Stack frames (19)
18
GuzzleHttp
\
Exception
\
ClientException
/
vendor
/
guzzlehttp
/
guzzle
/
src
/
Exception
/
RequestException.php
113
17
GuzzleHttp
\
Exception
\
RequestException
create
/
vendor
/
guzzlehttp
/
guzzle
/
src
/
Middleware.php
66
16
GuzzleHttp
\
Middleware
GuzzleHttp
\
{closure}
/
vendor
/
guzzlehttp
/
promises
/
src
/
Promise.php
203
15
GuzzleHttp
\
Promise
\
Promise
callHandler
/
vendor
/
guzzlehttp
/
promises
/
src
/
Promise.php
156
14
GuzzleHttp
\
Promise
\
Promise
GuzzleHttp
\
Promise
\
{closure}
/
vendor
/
guzzlehttp
/
promises
/
src
/
TaskQueue.php
47
13
GuzzleHttp
\
Promise
\
TaskQueue
run
/
vendor
/
guzzlehttp
/
promises
/
src
/
Promise.php
246
12
GuzzleHttp
\
Promise
\
Promise
invokeWaitFn
/
vendor
/
guzzlehttp
/
promises
/
src
/
Promise.php
223
11
GuzzleHttp
\
Promise
\
Promise
waitIfPending
/
vendor
/
guzzlehttp
/
promises
/
src
/
Promise.php
267
10
GuzzleHttp
\
Promise
\
Promise
invokeWaitList
/
vendor
/
guzzlehttp
/
promises
/
src
/
Promise.php
225
9
GuzzleHttp
\
Promise
\
Promise
waitIfPending
/
vendor
/
guzzlehttp
/
promises
/
src
/
Promise.php
62
8
GuzzleHttp
\
Promise
\
Promise
wait
/
vendor
/
guzzlehttp
/
guzzle
/
src
/
Client.php
131
7
GuzzleHttp
\
Client
request
/
vendor
/
guzzlehttp
/
guzzle
/
src
/
Client.php
89
6
GuzzleHttp
\
Client
__call
/
vendor
/
prismic
/
php-sdk
/
src
/
Prismic
/
SearchForm.php
301
5
Prismic
\
SearchForm
submit_raw
/
vendor
/
prismic
/
php-sdk
/
src
/
Prismic
/
SearchForm.php
216
4
Prismic
\
SearchForm
submit
/
vendor
/
prismic
/
php-sdk
/
src
/
Prismic
/
Api.php
497
3
Prismic
\
Api
query
/
api
/
coin-prismic.php
10
2
include
/
pages
/
coin.php
4
1
include
/
php
/
page-content.php
10
0
include
/
index.php
28
/
app
/
vendor
/
guzzlehttp
/
guzzle
/
src
/
Exception
/
RequestException.php
        $uri = static::obfuscateUri($uri);
 
        // Client Error: `GET /` resulted in a `404 Not Found` response:
        // <html> ... (truncated)
        $message = sprintf(
            '%s: `%s %s` resulted in a `%s %s` response',
            $label,
            $request->getMethod(),
            $uri,
            $response->getStatusCode(),
            $response->getReasonPhrase()
        );
 
        $summary = static::getResponseBodySummary($response);
 
        if ($summary !== null) {
            $message .= ":\n{$summary}\n";
        }
 
        return new $className($message, $request, $response, $previous, $ctx);
    }
 
    /**
     * Get a short summary of the response
     *
     * Will return `null` if the response is not printable.
     *
     * @param ResponseInterface $response
     *
     * @return string|null
     */
    public static function getResponseBodySummary(ResponseInterface $response)
    {
        $body = $response->getBody();
 
        if (!$body->isSeekable()) {
            return null;
        }
 
        $size = $body->getSize();
/
app
/
vendor
/
guzzlehttp
/
guzzle
/
src
/
Middleware.php
    /**
     * Middleware that throws exceptions for 4xx or 5xx responses when the
     * "http_error" request option is set to true.
     *
     * @return callable Returns a function that accepts the next handler.
     */
    public static function httpErrors()
    {
        return function (callable $handler) {
            return function ($request, array $options) use ($handler) {
                if (empty($options['http_errors'])) {
                    return $handler($request, $options);
                }
                return $handler($request, $options)->then(
                    function (ResponseInterface $response) use ($request, $handler) {
                        $code = $response->getStatusCode();
                        if ($code < 400) {
                            return $response;
                        }
                        throw RequestException::create($request, $response);
                    }
                );
            };
        };
    }
 
    /**
     * Middleware that pushes history data to an ArrayAccess container.
     *
     * @param array|\ArrayAccess $container Container to hold the history (by reference).
     *
     * @return callable Returns a function that accepts the next handler.
     * @throws \InvalidArgumentException if container is not an array or ArrayAccess.
     */
    public static function history(&$container)
    {
        if (!is_array($container) && !$container instanceof \ArrayAccess) {
            throw new \InvalidArgumentException('history container must be an array or object implementing ArrayAccess');
        }
 
/
app
/
vendor
/
guzzlehttp
/
promises
/
src
/
Promise.php
     * @param int   $index   1 (resolve) or 2 (reject).
     * @param mixed $value   Value to pass to the callback.
     * @param array $handler Array of handler data (promise and callbacks).
     *
     * @return array Returns the next group to resolve.
     */
    private static function callHandler($index, $value, array $handler)
    {
        /** @var PromiseInterface $promise */
        $promise = $handler[0];
 
        // The promise may have been cancelled or resolved before placing
        // this thunk in the queue.
        if ($promise->getState() !== self::PENDING) {
            return;
        }
 
        try {
            if (isset($handler[$index])) {
                $promise->resolve($handler[$index]($value));
            } elseif ($index === 1) {
                // Forward resolution values as-is.
                $promise->resolve($value);
            } else {
                // Forward rejections down the chain.
                $promise->reject($value);
            }
        } catch (\Throwable $reason) {
            $promise->reject($reason);
        } catch (\Exception $reason) {
            $promise->reject($reason);
        }
    }
 
    private function waitIfPending()
    {
        if ($this->state !== self::PENDING) {
            return;
        } elseif ($this->waitFn) {
            $this->invokeWaitFn();
/
app
/
vendor
/
guzzlehttp
/
promises
/
src
/
Promise.php
        // Clear out the state of the promise but stash the handlers.
        $this->state = $state;
        $this->result = $value;
        $handlers = $this->handlers;
        $this->handlers = null;
        $this->waitList = $this->waitFn = null;
        $this->cancelFn = null;
 
        if (!$handlers) {
            return;
        }
 
        // If the value was not a settled promise or a thenable, then resolve
        // it in the task queue using the correct ID.
        if (!method_exists($value, 'then')) {
            $id = $state === self::FULFILLED ? 1 : 2;
            // It's a success, so resolve the handlers in the queue.
            queue()->add(static function () use ($id, $value, $handlers) {
                foreach ($handlers as $handler) {
                    self::callHandler($id, $value, $handler);
                }
            });
        } elseif ($value instanceof Promise
            && $value->getState() === self::PENDING
        ) {
            // We can just merge our handlers onto the next promise.
            $value->handlers = array_merge($value->handlers, $handlers);
        } else {
            // Resolve the handlers when the forwarded promise is resolved.
            $value->then(
                static function ($value) use ($handlers) {
                    foreach ($handlers as $handler) {
                        self::callHandler(1, $value, $handler);
                    }
                },
                static function ($reason) use ($handlers) {
                    foreach ($handlers as $handler) {
                        self::callHandler(2, $reason, $handler);
                    }
                }
/
app
/
vendor
/
guzzlehttp
/
promises
/
src
/
TaskQueue.php
                }
            });
        }
    }
 
    public function isEmpty()
    {
        return !$this->queue;
    }
 
    public function add(callable $task)
    {
        $this->queue[] = $task;
    }
 
    public function run()
    {
        /** @var callable $task */
        while ($task = array_shift($this->queue)) {
            $task();
        }
    }
 
    /**
     * The task queue will be run and exhausted by default when the process
     * exits IFF the exit is not the result of a PHP E_ERROR error.
     *
     * You can disable running the automatic shutdown of the queue by calling
     * this function. If you disable the task queue shutdown process, then you
     * MUST either run the task queue (as a result of running your event loop
     * or manually using the run() method) or wait on each outstanding promise.
     *
     * Note: This shutdown will occur before any destructors are triggered.
     */
    public function disableShutdown()
    {
        $this->enableShutdown = false;
    }
}
 
/
app
/
vendor
/
guzzlehttp
/
promises
/
src
/
Promise.php
            // If there's not wait function, then reject the promise.
            $this->reject('Cannot wait on a promise that has '
                . 'no internal wait function. You must provide a wait '
                . 'function when constructing the promise to be able to '
                . 'wait on a promise.');
        }
 
        queue()->run();
 
        if ($this->state === self::PENDING) {
            $this->reject('Invoking the wait callback did not resolve the promise');
        }
    }
 
    private function invokeWaitFn()
    {
        try {
            $wfn = $this->waitFn;
            $this->waitFn = null;
            $wfn(true);
        } catch (\Exception $reason) {
            if ($this->state === self::PENDING) {
                // The promise has not been resolved yet, so reject the promise
                // with the exception.
                $this->reject($reason);
            } else {
                // The promise was already resolved, so there's a problem in
                // the application.
                throw $reason;
            }
        }
    }
 
    private function invokeWaitList()
    {
        $waitList = $this->waitList;
        $this->waitList = null;
 
        foreach ($waitList as $result) {
            while (true) {
/
app
/
vendor
/
guzzlehttp
/
promises
/
src
/
Promise.php
            } elseif ($index === 1) {
                // Forward resolution values as-is.
                $promise->resolve($value);
            } else {
                // Forward rejections down the chain.
                $promise->reject($value);
            }
        } catch (\Throwable $reason) {
            $promise->reject($reason);
        } catch (\Exception $reason) {
            $promise->reject($reason);
        }
    }
 
    private function waitIfPending()
    {
        if ($this->state !== self::PENDING) {
            return;
        } elseif ($this->waitFn) {
            $this->invokeWaitFn();
        } elseif ($this->waitList) {
            $this->invokeWaitList();
        } else {
            // If there's not wait function, then reject the promise.
            $this->reject('Cannot wait on a promise that has '
                . 'no internal wait function. You must provide a wait '
                . 'function when constructing the promise to be able to '
                . 'wait on a promise.');
        }
 
        queue()->run();
 
        if ($this->state === self::PENDING) {
            $this->reject('Invoking the wait callback did not resolve the promise');
        }
    }
 
    private function invokeWaitFn()
    {
        try {
/
app
/
vendor
/
guzzlehttp
/
promises
/
src
/
Promise.php
            if ($this->state === self::PENDING) {
                // The promise has not been resolved yet, so reject the promise
                // with the exception.
                $this->reject($reason);
            } else {
                // The promise was already resolved, so there's a problem in
                // the application.
                throw $reason;
            }
        }
    }
 
    private function invokeWaitList()
    {
        $waitList = $this->waitList;
        $this->waitList = null;
 
        foreach ($waitList as $result) {
            while (true) {
                $result->waitIfPending();
 
                if ($result->result instanceof Promise) {
                    $result = $result->result;
                } else {
                    if ($result->result instanceof PromiseInterface) {
                        $result->result->wait(false);
                    }
                    break;
                }
            }
        }
    }
}
 
/
app
/
vendor
/
guzzlehttp
/
promises
/
src
/
Promise.php
                $promise->resolve($value);
            } else {
                // Forward rejections down the chain.
                $promise->reject($value);
            }
        } catch (\Throwable $reason) {
            $promise->reject($reason);
        } catch (\Exception $reason) {
            $promise->reject($reason);
        }
    }
 
    private function waitIfPending()
    {
        if ($this->state !== self::PENDING) {
            return;
        } elseif ($this->waitFn) {
            $this->invokeWaitFn();
        } elseif ($this->waitList) {
            $this->invokeWaitList();
        } else {
            // If there's not wait function, then reject the promise.
            $this->reject('Cannot wait on a promise that has '
                . 'no internal wait function. You must provide a wait '
                . 'function when constructing the promise to be able to '
                . 'wait on a promise.');
        }
 
        queue()->run();
 
        if ($this->state === self::PENDING) {
            $this->reject('Invoking the wait callback did not resolve the promise');
        }
    }
 
    private function invokeWaitFn()
    {
        try {
            $wfn = $this->waitFn;
            $this->waitFn = null;
/
app
/
vendor
/
guzzlehttp
/
promises
/
src
/
Promise.php
        if ($this->state === self::FULFILLED) {
            return $onFulfilled
                ? promise_for($this->result)->then($onFulfilled)
                : promise_for($this->result);
        }
 
        // It's either cancelled or rejected, so return a rejected promise
        // and immediately invoke any callbacks.
        $rejection = rejection_for($this->result);
        return $onRejected ? $rejection->then(null, $onRejected) : $rejection;
    }
 
    public function otherwise(callable $onRejected)
    {
        return $this->then(null, $onRejected);
    }
 
    public function wait($unwrap = true)
    {
        $this->waitIfPending();
 
        $inner = $this->result instanceof PromiseInterface
            ? $this->result->wait($unwrap)
            : $this->result;
 
        if ($unwrap) {
            if ($this->result instanceof PromiseInterface
                || $this->state === self::FULFILLED
            ) {
                return $inner;
            } else {
                // It's rejected so "unwrap" and throw an exception.
                throw exception_for($inner);
            }
        }
    }
 
    public function getState()
    {
        return $this->state;
/
app
/
vendor
/
guzzlehttp
/
guzzle
/
src
/
Client.php
        // Remove request modifying parameter because it can be done up-front.
        $headers = isset($options['headers']) ? $options['headers'] : [];
        $body = isset($options['body']) ? $options['body'] : null;
        $version = isset($options['version']) ? $options['version'] : '1.1';
        // Merge the URI into the base URI.
        $uri = $this->buildUri($uri, $options);
        if (is_array($body)) {
            $this->invalidBody();
        }
        $request = new Psr7\Request($method, $uri, $headers, $body, $version);
        // Remove the option so that they are not doubly-applied.
        unset($options['headers'], $options['body'], $options['version']);
 
        return $this->transfer($request, $options);
    }
 
    public function request($method, $uri = '', array $options = [])
    {
        $options[RequestOptions::SYNCHRONOUS] = true;
        return $this->requestAsync($method, $uri, $options)->wait();
    }
 
    public function getConfig($option = null)
    {
        return $option === null
            ? $this->config
            : (isset($this->config[$option]) ? $this->config[$option] : null);
    }
 
    private function buildUri($uri, array $config)
    {
        // for BC we accept null which would otherwise fail in uri_for
        $uri = Psr7\uri_for($uri === null ? '' : $uri);
 
        if (isset($config['base_uri'])) {
            $uri = Psr7\UriResolver::resolve(Psr7\uri_for($config['base_uri']), $uri);
        }
 
        return $uri->getScheme() === '' && $uri->getHost() !== '' ? $uri->withScheme('http') : $uri;
    }
/
app
/
vendor
/
guzzlehttp
/
guzzle
/
src
/
Client.php
        // Convert the base_uri to a UriInterface
        if (isset($config['base_uri'])) {
            $config['base_uri'] = Psr7\uri_for($config['base_uri']);
        }
 
        $this->configureDefaults($config);
    }
 
    public function __call($method, $args)
    {
        if (count($args) < 1) {
            throw new \InvalidArgumentException('Magic request methods require a URI and optional options array');
        }
 
        $uri = $args[0];
        $opts = isset($args[1]) ? $args[1] : [];
 
        return substr($method, -5) === 'Async'
            ? $this->requestAsync(substr($method, 0, -5), $uri, $opts)
            : $this->request($method, $uri, $opts);
    }
 
    public function sendAsync(RequestInterface $request, array $options = [])
    {
        // Merge the base URI into the request URI if needed.
        $options = $this->prepareDefaults($options);
 
        return $this->transfer(
            $request->withUri($this->buildUri($request->getUri(), $options), $request->hasHeader('Host')),
            $options
        );
    }
 
    public function send(RequestInterface $request, array $options = [])
    {
        $options[RequestOptions::SYNCHRONOUS] = true;
        return $this->sendAsync($request, $options)->wait();
    }
 
    public function requestAsync($method, $uri = '', array $options = [])
/
app
/
vendor
/
prismic
/
php-sdk
/
src
/
Prismic
/
SearchForm.php
     *
     * \throws RuntimeException if the Form type is not supported
     *
     * @return the raw (unparsed) response.
     */
    private function submit_raw()
    {
        if ($this->form->getMethod() == 'GET' &&
            $this->form->getEnctype() == 'application/x-www-form-urlencoded' &&
            $this->form->getAction()
        ) {
            $url = $this->url();
            $cacheKey = $this->url();
 
            $response = $this->api->getCache()->get($cacheKey);
 
            if ($response) {
                return $response;
            } 
            $response = $this->api->getHttpClient()->get($url);
            $cacheControl = $response->getHeader('Cache-Control')[0];
            $cacheDuration = null;
            if (preg_match('/^max-age\s*=\s*(\d+)$/', $cacheControl, $groups) == 1) {
                $cacheDuration = (int) $groups[1];
            }
            $json = json_decode($response->getBody(true));
            if (!isset($json)) {
                throw new \RuntimeException("Unable to decode json response");
            }
            if ($cacheDuration !== null) {
                $expiration = $cacheDuration;
                $this->api->getCache()->set($cacheKey, $json, $expiration);
            }
            return $json;
        }
        throw new \RuntimeException("Form type not supported");
    }
 
}
 
/
app
/
vendor
/
prismic
/
php-sdk
/
src
/
Prismic
/
SearchForm.php
     *
     * @return Prismic::SearchForm a clone of the SearchForm object with the new orderings parameter added
     */
    public function orderings()
    {
        if (func_num_args() == 0) return $this;
        $orderings = "[" . join(",", array_map(function($order) { return preg_replace('/(^\[|\]$)/', '', $order); }, func_get_args())) . "]";
        return $this->set("orderings", $orderings);
    }
 
    /**
     * Submit the current API call, and unmarshalls the result into PHP objects.
     *
     * @return Prismic::Response the result of the call
     *
     * \throws RuntimeException
     */
    public function submit()
    {
        return $this->submit_raw();
    }
 
    /**
     * Get the result count for this form
     *
     * This uses a copy of the SearchForm with a page size of 1 (the smallest
     * allowed) since all we care about is one of the returned non-result
     * fields.
     *
     * @return int Total number of results
     *
     * \throws RuntimeException
     */
    public function count()
    {
        return $this->pageSize(1)->submit_raw()->total_results_size;
    }
 
    /**
     * Set the query's predicates themselves.
/
app
/
vendor
/
prismic
/
php-sdk
/
src
/
Prismic
/
Api.php
 
    /**
     * Shortcut to query on the default reference.
     * Use the reference from previews or experiment cookie, fallback to the master reference otherwise.
     *
     * @param  string|array|\Prismic\Predicate   $q         the query, as a string, predicate or array of predicates
     * @param  array                             $options   query options: pageSize, orderings, etc.
     *
     * @return Prismic::Response   the response, including documents and pagination information
     */
    public function query($q, $options = array()) {
        $ref = $this->ref();
        $form = $this->forms()->everything->ref($ref);
        if ($q != null && $q != "") {
            $form = $form->query($q);
        }
        foreach ($options as $key => $value) {
            $form = $form->set($key, $value);
        }
        return $form->submit();
    }
 
    /**
     * Return the first document matching the query
     * Use the reference from previews or experiment cookie, fallback to the master reference otherwise.
     *
     * @param  string|array|\Prismic\Predicate $q        the query, as a string, predicate or array of predicates
     * @param  array                           $options  query options: pageSize, orderings, etc.
     *
     * @return Prismic::Document     the resulting document, or null
     */
    public function queryFirst($q, $options = array()) {
        $documents = $this->query($q, $options)->results;
        if (count($documents) > 0) {
            return $documents[0];
        }
        return null;
    }
 
    /**
/
app
/
api
/
coin-prismic.php
<?php
 
$url = getenv('PRISMIC_URL');
$token = getenv('PRISMIC_TOKEN');
 
$api = Prismic\Api::get($url, $token);
 
$response = $api->query([
  Prismic\Predicates::at('document.type', 'coin'),
  Prismic\Predicates::at('my.coin.coin_symbol', $coinCode),
]);
 
$coinDoc = $response->results[0];
 
if (!empty($coinDoc)) {
  $isOriginalSummary = boolval($coinDoc->data->original_summary);
  // TODO: once content is updated, use this code
  // $titleHtml = Prismic\Dom\RichText::asHtml($coinDoc->data->title);
  $titleText = Prismic\Dom\RichText::asText($coinDoc->data->title);
  $titleHtml = "<h1>{$titleText} Price</h1>";
  $summaryHtml = Prismic\Dom\RichText::asHtml($coinDoc->data->coin_summary);
  $seoTitle = Prismic\Dom\RichText::asText($coinDoc->data->seo_title);
 
  $technicalStats = array();
  $socialStats = array();
 
  foreach ($coinDoc->data->technical_stats[0] as $key => $value) {
    $rowName = str_replace('coin_', '', $key);
    $rowName = ucwords(str_replace('_', ' ', $rowName));
    $technicalStats[$rowName] = $value;
    if (!$technicalStats[$rowName]) {
      $technicalStats[$rowName] = '-';
    }
  }
 
  foreach ($coinDoc->data->social_stats[0] as $key => $value) {
    $rowName = str_replace('coin_', '', $key);
    $rowName = ucwords(str_replace('_', ' ', $rowName));
    $socialStats[$rowName] = $value;
  }
/
app
/
pages
/
coin.php
<?php
 
  include __DIR__ . '/../api/coin-single.php';
  include __DIR__ . '/../api/coin-prismic.php';
 
?>
 
</div>
 
<div class="page-coin">
  <?php include __DIR__ . '/../php/coin-profile/main.php'; ?>
</div>
 
/
app
/
php
/
page-content.php
 
<div id="site" class="container page-<?php echo $page; ?>">
 
  <?php
    if (!empty($_GET['page'])) {
      $dir = __DIR__ . '/../pages/' . $_GET['page'] . '.php';
    } else {
      $dir = __DIR__ . '/../pages/coins.php';
    }
    include $dir;
  ?>
 
</div>
 
/
app
/
index.php
require_once __DIR__ . '/php/page-config.php';
require_once __DIR__ . '/php/page-caching.php';
require_once __DIR__ . '/php/table-pagination-logic.php';
 
?>
 
<!DOCTYPE html>
<html lang="en">
<?php include __DIR__ . '/php/header/header.php'; ?>
 
<?php
  $bodyClasses = '';
  if (isGoNative()) {
    $bodyClasses = 'gonative';
  }
?>
<body class="<?php echo $bodyClasses; ?>">
  <?php include __DIR__ . '/php/ads/premium-banner.php'; ?>
  <?php include __DIR__ . '/php/navbar.php'; ?>
  <?php include __DIR__ . '/php/page-content.php'; ?>
  <?php include __DIR__ . '/php/footer.php'; ?>
  <?php include __DIR__ . '/php/mobile-bottom-badges.php'; ?>
</body>
</html>
 

Environment & details:

Key Value
page coin
currency project-pai
empty
empty
empty
Key Value
_token 29d615f6893e7797c0183dd023fed9e1
Key Value
COMPOSER_HOME /opt/composer
HOSTNAME 1e53878ad525
APP_DIR /app
FRONT_CONTROLLER_FILE index.php
GOOGLE_CLOUD_PROJECT my-test-project-188114
MYSQL_USER root
NGINX_USER_CONF_DIR /etc/nginx/conf.d
SUPERVISOR_GROUP_NAME php-fpm
HOME /var/www
PATH /opt/php/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PHP70_DIR /opt/php70
PORT 8080
PHP_CONFIG_TEMPLATE /opt/php-configs
SHLVL 0
MYSQL_DSN mysql:dbname=coinfolio;unix_socket=/cloudsql/my-test-project-188114:us-central1:my-test-project-188114-db
SUPERVISOR_ENABLED 1
PHP71_DIR /opt/php71
COMPOSER_FLAGS --no-scripts --no-dev --prefer-dist
GAE_SERVICE default
DOCUMENT_ROOT /app
MYSQL_PASSWORD 123hej
GAE_DEPLOYMENT_ID 414589723548634548
SESSION_SAVE_PATH /tmp/sessions
DEBIAN_FRONTEND noninteractive
GAE_VERSION 20181210t133612
PHP56_DIR /opt/php56
NGINX_DIR /etc/nginx
PHP72_DIR /opt/php72
GAE_MEMORY_MB 614
APPENGINE_GOOGLEAPIS_INTERNAL_NAME /gaeapp/appengine.googleapis.internal
UPLOAD_DIR /upload
SUPERVISOR_PROCESS_NAME php-fpm
PHP_DIR /opt/php
GAE_INSTANCE aef-default-20181210t133612-xbz2
PWD /app
GCLOUD_PROJECT my-test-project-188114
WWW_HOME /var/www
USER www-data
HTTP_X_FORWARDED_FOR 18.212.93.234, 172.68.65.110, 216.239.32.21
HTTP_VIA 1.1 google
HTTP_X_APPENGINE_CITYLATLONG 39.043757,-77.487442
HTTP_X_APPENGINE_REGION va
HTTP_X_APPENGINE_COUNTRY US
HTTP_X_APPENGINE_CITY ashburn
HTTP_X_CLOUD_TRACE_CONTEXT 4eaa8cd81f74570ed4376a67685fa795/456198182653518818
HTTP_USER_AGENT CCBot/2.0 (https://commoncrawl.org/faq/)
HTTP_CF_CONNECTING_IP 18.212.93.234
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_CF_EW_VIA 15
HTTP_CF_VISITOR {"scheme":"https"}
HTTP_X_FORWARDED_PROTO http
HTTP_CF_RAY 487a9810e730c1e5-IAD
HTTP_CF_IPCOUNTRY US
HTTP_ACCEPT_ENCODING gzip
HTTP_HOST coins.live
REDIRECT_STATUS 200
HTTPS
SERVER_NAME coins.live
SERVER_PORT 8080
SERVER_ADDR 172.17.0.7
REMOTE_PORT 23534
REMOTE_ADDR
SERVER_SOFTWARE nginx/1.10.3
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_URI /index.php
REQUEST_URI /coin/project-pai/
PATH_TRANSLATED /app
PATH_INFO
SCRIPT_NAME /index.php
SCRIPT_FILENAME /app/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1544559019.6991
REQUEST_TIME 1544559019
MYSQL_HOST
MYSQL_DB coinfolio
MYSQL_UNIX_SOCKET /cloudsql/my-test-project-188114:us-central1:my-test-project-188114-db
APP_DEBUG false
PHP_ENV production
ROBOTS_INDEX yes
PRISMIC_URL https://bitsectorcom.prismic.io/api/v2
PRISMIC_TOKEN MC5XNWZRN3lVQUFDWUF1ZDR4.O0dKH2QG77-9SO-_vSbvv70HH--_vV4677-9Zu-_ve-_ve-_ve-_vUPvv70T77-9J1zvv73vv70zTw
GOOGLE_DEVELOPER_KEY AIzaSyDurFhtPPnFRdvRou2EnUptvCxMcno6Jvw
MIXPANEL_TOKEN 2d6146a7c4acd73124e2bbe6d62383c3
WP_DB_NAME coinfolio_wp
WP_DB_USERNAME root
WP_DB_PASSWORD 123hej
WP_DB_HOST :/cloudsql/my-test-project-188114:us-central1:my-test-project-188114-db
WP_DEBUG false
WP_DEBUG_LOG false
GOOGLE_AUTH_CODE
ASSETS_VERSION Ghqk6zugDBGxbZ0KXyuQnQLh3iUM3iV6
DRIP_API https://api.getdrip.com/v2/
DRIP_ACCOUNT_ID 9386918
DRIP_ACCOUNT_TOKEN 8d7e9af5f2b74a7f5533f815942b472f
SENTRY_FRONTEND false
RSS_FEED_URL https://sludgefeed.com/category/cryptocurrency/feed/
RSS_SOURCE Sludgefeed
CANNY_PRIVATE_KEY 62d0b9d9-e836-a28b-81f1-8de17d6ff0ab
Key Value
MYSQL_HOST
MYSQL_DB coinfolio
MYSQL_UNIX_SOCKET /cloudsql/my-test-project-188114:us-central1:my-test-project-188114-db
APP_DEBUG false
PHP_ENV production
ROBOTS_INDEX yes
PRISMIC_URL https://bitsectorcom.prismic.io/api/v2
PRISMIC_TOKEN MC5XNWZRN3lVQUFDWUF1ZDR4.O0dKH2QG77-9SO-_vSbvv70HH--_vV4677-9Zu-_ve-_ve-_ve-_vUPvv70T77-9J1zvv73vv70zTw
GOOGLE_DEVELOPER_KEY AIzaSyDurFhtPPnFRdvRou2EnUptvCxMcno6Jvw
MIXPANEL_TOKEN 2d6146a7c4acd73124e2bbe6d62383c3
WP_DB_NAME coinfolio_wp
WP_DB_USERNAME root
WP_DB_PASSWORD 123hej
WP_DB_HOST :/cloudsql/my-test-project-188114:us-central1:my-test-project-188114-db
WP_DEBUG false
WP_DEBUG_LOG false
GOOGLE_AUTH_CODE
ASSETS_VERSION Ghqk6zugDBGxbZ0KXyuQnQLh3iUM3iV6
DRIP_API https://api.getdrip.com/v2/
DRIP_ACCOUNT_ID 9386918
DRIP_ACCOUNT_TOKEN 8d7e9af5f2b74a7f5533f815942b472f
SENTRY_FRONTEND false
RSS_FEED_URL https://sludgefeed.com/category/cryptocurrency/feed/
RSS_SOURCE Sludgefeed
CANNY_PRIVATE_KEY 62d0b9d9-e836-a28b-81f1-8de17d6ff0ab
0. Whoops\Handler\PrettyPageHandler