Lines Matching refs:this

64      * @var CacheParser cache file (may be not set if this is not a {@link self::isPathExecution() execution}
126 * @var bool true if this fetcher has already run
129 * the modified time is not always good, this indicator will
148 * To avoid this problem, a warning is send if the calling code does not set explicitly that this is specifically a
209 * Why ? Because the snippets advertised during this run, need to be stored
241 if (!$this->deleteRootBlockElement) {
293 $wikiPath = $this->getSourcePath()->toWikiPath();
299 $url->addQueryParameter("context-id", $this->getRequestedContextPath()->getWikiId());
310 if (isset($this->mime)) {
311 return $this->mime;
330 if (!$this->isPathExecution()) {
334 if (isset($this->processedInstructions)) {
343 $executionContext = ExecutionContext::getActualOrCreateFromEnv()->setExecutingMarkupHandler($this);
345 $useCache = $this->instructionsCache->useCache();
355 if (!$this->isPathExecution()) {
359 if ($this->hasExecuted) {
375 $depends['age'] = $this->getCacheAge();
376 if ($this->isFragment()) {
382 * We can't really use this event.
386 ->setRequestedContextPath($this->getRequestedContextPath())
387 ->setRequestedExecutingPath($this->getRequestedContextPath())
396 * We may get this error then
417 ->setExecutingMarkupHandler($this);
419 $useCache = $this->contentCache->useCache($depends);
435 $snippets = $this->getSnippets();
444 $snippetCache = $this->getSnippetCacheStore();
445 $this->outputCacheDependencies->rerouteCacheDestination($snippetCache);
465 $snippetCacheStore = $this->getSnippetCacheStore();
485 $snippetCacheFile = $this->getSnippetCacheStore()->cache;
503 if (isset($this->snippetCache)) {
504 return $this->snippetCache;
506 if ($this->isPathExecution()) {
507 throw new ExceptionRuntimeInternal("A source path should be available as this is a path execution");
517 return $this->outputCacheDependencies->getDependenciesCacheStore();
523 $cachePath = $this->outputCacheDependencies->getDependenciesCacheStore()->cache;
533 $this->processIfNeeded();
540 return $this->getContentCachePath();
546 * @return $this
552 $this->hasExecuted = true;
559 $extension = $this->getMime()->getExtension();
575 return $this;
578 $instructions = $this->getInstructions();
585 if ($this->deleteRootBlockElement) {
589 if (!isset($this->builderName)) {
590 $this->builderName = $this->getMime()->getExtension();
593 $executionContext->setExecutingMarkupHandler($this);
595 if ($this->isDocument()) {
596 $markupRenderer = MarkupRenderer::createFromMarkupInstructions($instructions, $this)
597 ->setRequestedMime($this->getMime())
598 ->setRendererName($this->builderName);
602 LogUtility::error("The renderer ({$this->builderName}) seems to have been not found");
604 $this->cacheAfterRendering = $markupRenderer->getCacheAfterRendering();
606 if (!isset($this->markupDynamicRender)) {
607 $this->markupDynamicRender = MarkupDynamicRender::create($this->builderName);
609 $output = $this->markupDynamicRender->processInstructions($instructions);
624 $this->fetchString = serialize($output);
626 $this->fetchString = $output;
634 * none if this is not a path execution
637 if (!$this->isPathExecution() || $this->mime->getExtension() === MarkupRenderer::METADATA_EXTENSION) {
638 return $this;
647 if (in_array($this->getMime()->toString(), [Mime::XHTML, Mime::HTML])) {
657 $this->storeSnippets();
661 $this->removeSnippets();
669 $this->outputCacheDependencies->storeDependencies();
670 $this->outputCacheDependencies->rerouteCacheDestination($this->contentCache);
683 io_saveFile($this->contentCache->cache, $this->fetchString);
685 return $this;
705 $extension = $this->getMime()->getExtension();
717 $requestedCache = $this->getRequestedCache();
721 $cacheAge = $this->getCacheMaxAgeInSec($requestedCache);
722 return $this->cacheAfterRendering ? $cacheAge : 0;
730 return parent::__toString() . " ({$this->getSourceName()}, {$this->getMime()->toString()})";
740 return $this;
752 $path = $this->contentCache->cache;
759 return $this->outputCacheDependencies;
770 $this->processIfNeeded();
772 if (!$this->isPathExecution()) {
773 return $this->fetchString;
782 $path = $this->getContentCachePath();
793 if (!in_array($this->getMime()->getExtension(), ["html", "xhtml"])) {
797 if ($this->getSourcePath()->toWikiPath()->getDrive() !== WikiPath::MARKUP_DRIVE) {
798 // case when this is a default page in the resource/template directory
812 $sourcePath = $this->getSourcePath();
822 return $this->requestedContextPath;
831 if (isset($this->markupSourcePath)) {
832 return $this->markupSourcePath;
834 throw new ExceptionNotFound("No source path for this markup");
844 return $this->getSourcePath();
848 * @return Path|null - utility class to get the source markup path or null (if this is a markup snippet/string rendering)
853 return $this->getSourcePath();
867 $snippets = $this->getSnippets();
888 $snippets = $this->localSnippets;
897 * can access this object via {@link ExecutionContext::getExecutingMarkupHandler()}
902 $slotId = $this->getSourcePath()->toWikiPath()->getWikiId();
925 * (ie when this is path execution)
926 * If this is not a path execution, the snippet cannot be
934 if (isset($this->parentMarkupHandler)) {
935 $this->parentMarkupHandler->addSnippet($snippet);
936 return $this;
939 if (!$this->isPathExecution()
940 && !$this->isNonPathStandaloneExecution
944 LogUtility::warning("The execution ($this) is not a path execution. The snippet $snippet will not be preserved after initial rendering. Set the execution as standalone or set a parent markup handler.");
946 if (!in_array($this->getMime()->toString(), [Mime::XHTML, Mime::HTML])) {
947 LogUtility::warning("The execution ($this) is not a HTML execution. The snippet $snippet will not be preserved because they are reserved for XHMTL execution");
951 $this->localSnippets[$snippetGuid] = $snippet;
952 return $this;
966 * The rule is this is a path execution of the {@link self::$markupSourcePath executing source path} is set.
968 * Ie this is not a path execution, if the input is:
975 if (isset($this->markupSourcePath)) {
987 if (!$this->shouldProcess()) {
988 return $this;
991 $this->process();
992 return $this;
1004 if (isset($this->requestedInstructions)) {
1006 return $this->requestedInstructions;
1022 ->setIsDocument($this->isDoc)
1023 ->setRequestedContextPath($this->getRequestedContextPath());
1024 if ($this->isPathExecution()) {
1025 $fetcherMarkupBuilder->setRequestedExecutingPath($this->getExecutingPathOrFail());
1027 $fetcherMarkupBuilder->setRequestedMarkupString($this->markupString);
1045 return $this->isDoc;
1060 return XmlDocument::createXmlDocFromMarkup($this->getFetchString());
1067 $globalSnippets = SnippetSystem::getFromContext()->getSnippetsForSlot($this->getRequestedExecutingPath()->toAbsoluteId());
1072 $allSnippets = array_merge($globalSnippets, $this->localSnippets);
1079 return $this->isDocument() === false;
1084 if (isset($this->markupString)) {
1085 return $this->markupString;
1088 $sourcePath = $this->getSourcePath();
1103 if (isset($this->contextData)) {
1104 return $this->contextData;
1106 $this->contextData = MarkupPath::createPageFromPathObject($this->getRequestedContextPath())->getMetadataForRendering();
1107 return $this->contextData;
1114 if (isset($this->toc)) {
1115 return $this->toc;
1118 return TOC::createForPage($this->getRequestedExecutingPath())->getValue();
1125 return Outline::createFromCallStack(CallStack::createFromInstructions($this->getInstructions()))->toTocDokuwikiFormat();
1132 $path = $this->instructionsCache->cache;
1138 $instructions = $this->getInstructions();
1141 $markupPath = MarkupPath::createPageFromPathObject($this->getRequestedExecutingPath());
1152 $this->processMetadataIfNotYetDone();
1153 return $this->meta;
1174 if (isset($this->meta)) {
1175 return $this;
1185 $executionContext = ExecutionContext::getActualOrCreateFromEnv()->setExecutingMarkupHandler($this);
1193 if ($this->isPathExecution()) {
1198 if (FileSystems::exists($this->getMetaPathOrFail())) {
1200 $executingPath = $this->getExecutingPathOrFail();
1208 $depends['files'][] = $this->instructionsCache->cache;
1210 $useCache = $this->metaCache->useCache($depends);
1212 $this->meta = $actualMeta;
1213 return $this;
1222 $wikiId = $this->getRequestedExecutingPath()->toWikiPath()->getWikiId();
1237 // add an extra key for the event - to tell event handlers the page whose metadata this is
1243 $instructions = $this->getInstructions();
1261 $path = $this->getRequestedExecutingPath();
1285 $this->meta = $evt->result;
1297 p_save_metadata($wikiId, $this->meta);
1298 $this->metaCache->storeCache(time());
1304 return $this;
1313 if (isset($this->metaPath)) {
1314 return $this->metaPath;
1316 throw new ExceptionNotFound("No meta path for this markup");
1329 return $this->getRequestedExecutingPath();
1345 return $this->getMetadataPath();
1354 * @return $this
1358 if (isset($this->processedInstructions)) {
1359 return $this;
1362 $markup = $this->getMarkupStringToExecute();
1364 ->setExecutingMarkupHandler($this);
1366 $markupRenderer = MarkupRenderer::createFromMarkup($markup, $this->getExecutingPathOrNull(), $this->getRequestedContextPath())
1369 if (isset($this->instructionsCache)) {
1374 $this->instructionsCache->storeCache($instructions);
1376 $this->processedInstructions = $instructions;
1377 return $this;
1387 $cache = $this->getSnippetCacheStore()->cache;
1398 return "({$this->getSourceName()}) to ({$this->builderName} - {$this->getMime()}) with context ({$this->getRequestedContextPath()->toUriString()})";
1406 if (!$this->isPathExecution()) {
1407 if (isset($this->markupString)) {
1408 $md5 = md5($this->markupString);
1410 } elseif (isset($this->requestedInstructions)) {
1419 return $this->getSourcePath()->toUriString();
1435 if (!$this->shouldInstructionProcess()) {
1437 $this->processedInstructions = $this->instructionsCache->retrieveCache();
1441 $this->processInstructions();
1444 return $this->processedInstructions;
1453 if (!isset($this->parentMarkupHandler)) {
1456 return $this->parentMarkupHandler;
1469 $this->hasExecuted = false;
1471 unset($this->contextData);
1473 $this->contextData = $row;
1475 $this->requestedInstructions = $requestedInstructions;
1476 return $this;