Gets the swagger documentation

This will fetch/write into the cache if $apiDocsCacheEnabled is set to true.

@todo Automatically refresh the cache by checking controller and models mtimes
@return array The swagger documentation structure
547574
public function actionDocumentation()
    {
        Yii::$app->response->format = Response::FORMAT_JSON;

        if ($this->apiDocsCacheEnabled) {
            $filename = str_replace('\\', '-', static::class);
            $path = Yii::getAlias($this->apiDocsCacheDirectory) . $filename . '.json';

            if (file_exists($path)) {
                $doc = file_get_contents($path);
            } else {
                $doc = $this->generator->getJson($this->version);
                // Store the credentials to disk.
                if (!is_dir(dirname($path))) {
                    mkdir(dirname($path), 0700, true);
                }
                file_put_contents($path, Json::encode($doc));
            }
        } else {
            $doc = $this->generator->getJson($this->version);
        }
        return $doc;
    }
132578
private function retrieveCachedData()
    {
        return [
            'browser' => $this->browser,
            'engine' => $this->engine,
            'os' => $this->os,
            'device' => $this->device,
            'camouflage' => $this->camouflage,
            'features' => $this->features
        ];
    }
1291768
public function getProperties()
    {
        //build URI to merge Docs
        $strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/documentProperties';

        //sign URI
        $signedURI = Utils::sign($strURI);

        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');

        $json = json_decode($responseStream);


        if ($json->Code == 200) {
            return $json->DocumentProperties->List;
        }
        
        AsposeApp::getLogger()->warning('Error occured, http 200 code was not found.', array(
            'json-code' => $json->Code,
        ));
        return false;
    }
1204121
public function toString() {
        $documentation = preg_replace_callback(
            '@\r?\n@',
            function ($matches) {
                return $matches[0] . '	 * ';
            },
            trim($this->getDescription())
        );
        if($documentation == '') {
            $documentation = $this->getName();
        }
        $buffer = '
	/**
	 * ' . $documentation . '
';
        foreach($this->getParameters() as $parameter) {
            $buffer .= $parameter->toDocTypeString($this);
        }
        if($this->getName() != '__construct') {
            $buffer .= '	 * @return ' . $this->getReturnType() . '
';
        }
        foreach($this->getThrows() as $throw) {
            $buffer .= '	 * @throws ' . $throw . '
';
        }
        $buffer .= '	 */
	' . ($this->isFinal() ? 'final ' : '') . $this->getAccess() . ' ' . ($this->isStatic() ? 'static ' : '') . 'function ' . $this->getName() . '(';
        foreach($this->getParameters() as $key => $parameter) {
            if($key != 0) {
                $buffer .= ', ';
            }
            if($parameter->isStrictType()) {
                if(!is_null($parameter->getStrictClass())) {
                    $buffer .= $parameter->getStrictClass() . ' ';
                } else {
                    $buffer .= $parameter->getType() . ' ';
                }
            }
            $buffer .= '$' . $parameter->getName();
            if(!is_null($parameter->getDefaultValue())) {
                $buffer .= '=' . $parameter->getDefaultValue();
            }
        }
        $buffer .= ') {
		' . trim($this->getContent()) . '
	}
';
        return $buffer;
    }
594787
public function getMetadata()
    {
        if ($this->cacheGenerated !== null) {
            $xml = $this->getCacheItem($this->cacheId, $this->cacheTag);
            if ($xml !== null) {
                Logger::debug($this->logLoc.'Loaded generated metadata from cache.');
                return $xml;
            }
        }

        return $this->updateCachedMetadata();
    }
619469
protected function getRelatedDocumentsForAutocompleter()
    {
        $documents = DMSDocument::get()->exclude('ID', $this->ID);
        $this->extend('updateRelatedDocumentsForAutocompleter', $documents);
        return $documents;
    }
686003
private function getCacheKey()
    {
        if ($this->requestBag->getClassData()['cacheKeyInterface']) {
            $cacheKey = $this->requestBag->getClassInstance()->getCacheKey();
        } else {
            $url = $this->httpRequest()->getCurrentUrl(true);
            $cacheKey = 'path-' . $url->getPath();
            $cacheKey .= 'query-' . $this->serialize($url->getQuery());
            $cacheKey .= 'method-' . $this->httpRequest()->getRequestMethod();
            $cacheKey .= 'post-' . $this->serialize($this->httpRequest()->getPost()->getAll());
            $cacheKey .= 'payload-' . $this->serialize($this->httpRequest()->getPayload()->getAll());
            $cacheKey .= 'version-' . $this->requestBag->getClassData()['version'];
            $cacheKey = md5($cacheKey);
        }

        return $cacheKey;
    }
1089429
public function getCachePrefix()
    {
        if ($this->cachePrefix) {
            return $this->cachePrefix;
        }

        $class = $this->getClassName();

        if (!in_array(TaggedEntityInterface::class, class_implements($class))) {
            throw new \RuntimeException(sprintf(
                'The entity %s does not implements %s, query should not be cached.',
                $class, TaggedEntityInterface::class
            ));
        }

        return $this->cachePrefix = call_user_func([$this->getClassName(), 'getEntityTagPrefix']);
    }
683026
public function getAllDocuments()
    {
        $response = $this->getViewByGet('_all_docs');
        return $this->asDocs ? $this->toDocuments($response) : $response;
    }
671546
public function getImplementedMethods() {

        $supported_methods = $this->getConfiguration()->get('supported-http-methods');

        if ( is_null($supported_methods) ) $supported_methods = self::$supported_methods;

        if ( method_exists($this, 'any') ) {

            return $supported_methods;

        }

        $implemented_methods = [];

        foreach ( $supported_methods as $method ) {

            if ( method_exists($this, strtolower($method)) ) array_push($implemented_methods, $method);

        }

        return $implemented_methods;

    }
639552
public function getCacheTag()
    {
        return $this->cacheTagPrefix .
            ($this->isAttributeChanged($this->idAttribute) ? $this->getOldAttribute($this->idAttribute) : $this->getID());
    }
1061046
public function getApiTemplateList()
    {
        $url = $this->getApiEndpoint() . self::REST_TEMPLATES;
        $this->setUrl($url)
            ->setVerb('GET');
        $response = $this->execute();

        if (isset($response->message)) {
            $message = 'GET API CONTACT LIST ' . $response->message;
            $this->helper->debug('getApiTemplateList', [$message]);
        }

        return $response;
    }
1166498
public function getCurrentDocumentSet()
    {
        if ($id = $this->getRequest()->getVar('dsid')) {
            return DMSDocumentSet::get()->byId($id);
        }
        return singleton('DMSDocumentSet');
    }
1176668
public function getAllVersions()
    {
        $versions = array();

        foreach ($this->getEntities() as $entity) {
            if ($entity->getVersion()) {
                $versions[$entity->getVersion()] = $entity->getVersion();
            } else {
                $versions['0.0'] = _t('DocumentationManifest.MASTER', 'Master');
            }
        }

        asort($versions);

        return $versions;
    }
1299624
public function getMethods()
    {
        //todo cache
        $result = array();
        foreach ($this->getReflectionClass()->getMethods() as $m)
        {
            $result[] = MethodInfo::__internal_create($this, $m);
        }
        return $result;
    }
373175
public function _GetCacheParameters()
    {
        $parameters = parent::_GetCacheParameters();
        $listState = $this->filterApi->getCacheParameter();
        $listState['is_filter_module'] = true;

        return array_merge_recursive($parameters, $listState);
    }
978065
public function getCachedContent()
    {
        if ($this->_content !== null) {
            return $this->_content;
        }

        $this->_content = false;

        if (!($this->cache instanceof CacheInterface)) {
            return $this->_content;
        }

        $key = $this->calculateKey();
        $data = $this->cache->get($key);
        if (!is_array($data) || count($data) !== 2) {
            return $this->_content;
        }

        [$this->_content, $placeholders] = $data;
        if (!is_array($placeholders) || count($placeholders) === 0) {
            return $this->_content;
        }

        $this->_content = $this->updateDynamicContent($this->_content, $placeholders, true);

        return $this->_content;
    }