src/Sdk/JsApiTicket.php
private function readTicket()
    {
        if (!$this->getFileSystem()->isFile($this->getTicketFilePath())) {
            return '';
        }

        $content = trim($this->getFileSystem()->get($this->getTicketFilePath()));
        $result = unserialize($content);

        if (isset($result['ticket']) && isset($result['expire']) && isset($result['time'])) {
            $expireTime = $result['time'] + $result['expire'] - self::EXPIRE_SUB_TIME;
            if ($expireTime > time()) {
                return $result['ticket'];
            }
        }

        return '';
    }
private function readTicket()
    {
        if (!$this->getFileSystem()->isFile($this->getTicketFilePath())) {
            return '';
        }

        $content = trim($this->getFileSystem()->get($this->getTicketFilePath()));
        $result = unserialize($content);

        if (isset($result['ticket']) && isset($result['expire']) && isset($result['time'])) {
            $expireTime = $result['time'] + $result['expire'] - self::EXPIRE_SUB_TIME;
            if ($expireTime > time()) {
                return $result['ticket'];
            }
        }

        return '';
    }
private function readTicket ( ) { if ( ! $ this -> getFileSystem ( ) -> isFile ( $ this -> getTicketFilePath ( ) ) ) { return '' ; } $ content = trim ( $ this -> getFileSystem ( ) -> get ( $ this -> getTicketFilePath ( ) ) ) ; $ result = unserialize ( $ content ) ; if ( isset ( $ result [ 'ticket' ] ) && isset ( $ result [ 'expire' ] ) && isset ( $ result [ 'time' ] ) ) { $ expireTime = $ result [ 'time' ] + $ result [ 'expire' ] - self :: EXPIRE_SUB_TIME ; if ( $ expireTime > time ( ) ) { return $ result [ 'ticket' ] ; } } return '' ; }
read js api ticket from file

@return string
@throws \Simple\Filesystem\FileNotFoundException
read js api ticket from file