PATH:
home
/
sparklp6
/
public_html
/
website_356c8563
/
nitropack
/
nitropack-sdk
/
NitroPack
/
SDK
<?php namespace NitroPack\SDK; /** * Class Revision * @package NitroPack\WordPress */ class ElementRevision { private $siteId; private $revisionFile; private $revisions; /** * Revision constructor. * @param $siteId * @param $dataDir */ public function __construct($siteId, $revisionFile) { $this->siteId = $siteId; $this->revisionFile = $revisionFile; $this->revisions = []; } /** * @return string */ public function get() { if (empty($this->revisions)) { $this->load(); } if (!empty($this->revisions[$this->siteId])) { return $this->revisions[$this->siteId]; } $this->save("nitro-" . substr(md5(microtime(true)), 0, 7)); return $this->revisions[$this->siteId]; } public function refresh() { $this->save(''); } private function load() { try { if (Filesystem::fileExists($this->revisionFile)) { $this->revisions = json_decode(Filesystem::fileGetContents($this->revisionFile), true); } else { $this->revisions = []; } } catch (\Exception $e) { $this->revisions = []; } } /** * @param string $revision */ private function save($revision) { $this->revisions[$this->siteId] = $revision; try { Filesystem::filePutContents($this->revisionFile, json_encode($this->revisions)); } catch (\Exception $e) { } } }
[-] Filesystem.php
[edit]
[-] ServiceDownException.php
[edit]
[-] HealthStatus.php
[edit]
[-] ConfigFetcherException.php
[edit]
[+]
Url
[-] .htaccess
[edit]
[-] EmptyConfigException.php
[edit]
[-] FileHandle.php
[edit]
[+]
Utils
[-] BacklogReplayTimeoutException.php
[edit]
[+]
Integrations
[+]
Api
[-] ChallengeProcessingException.php
[edit]
[-] Website.php
[edit]
[-] Backlog.php
[edit]
[-] ChallengeVerificationException.php
[edit]
[-] ExcludeEntry.php
[edit]
[-] Pagecache.php
[edit]
[-] IntegrationUrl.php
[edit]
[-] NoConfigException.php
[edit]
[-] Crypto.php
[edit]
[-] NitroPack.php
[edit]
[-] StorageException.php
[edit]
[-] VariationCookieException.php
[edit]
[-] ExcludeOperationType.php
[edit]
[-] DeviceType.php
[edit]
[-] Api.php
[edit]
[-] ElementRevision.php
[edit]
[-] Device.php
[edit]
[+]
..
[-] PurgeType.php
[edit]
[+]
StorageDriver
[-] WebhookException.php
[edit]