X7ROOT File Manager
Current Path:
/home/gfecatvj/sites/realesbar/vendor/windwalker/renderer
home
/
gfecatvj
/
sites
/
realesbar
/
vendor
/
windwalker
/
renderer
/
📁
..
📄
.gitignore
(118 B)
📄
.travis.yml
(275 B)
📄
AbstractEngineRenderer.php
(789 B)
📄
AbstractRenderer.php
(3.53 KB)
📁
Blade
📄
BladeRenderer.php
(7.92 KB)
📁
Edge
📄
EdgeRenderer.php
(5.93 KB)
📄
MustacheRenderer.php
(2.67 KB)
📄
PhpRenderer.php
(5.63 KB)
📄
PlatesRenderer.php
(2.98 KB)
📄
README.md
(7.13 KB)
📄
RendererInterface.php
(619 B)
📁
Test
📁
Twig
📄
TwigRenderer.php
(5.02 KB)
📄
composer.json
(1.16 KB)
📄
phpunit.travis.xml
(1.09 KB)
Editing: AbstractRenderer.php
<?php declare(strict_types=1); /** * Part of Windwalker project. * * @copyright Copyright (C) 2019 LYRASOFT. * @license LGPL-2.0-or-later */ namespace Windwalker\Renderer; use Windwalker\Structure\Structure; /** * Class AbstractRenderer * * @property-read Structure $config Config data. * * @since 2.0 */ abstract class AbstractRenderer implements RendererInterface { /** * Property paths. * * @var \SplPriorityQueue */ protected $paths = null; /** * Property config. * * @var Structure */ protected $config = []; /** * Class init. * * @param \SplPriorityQueue $paths * @param array $config */ public function __construct($paths = null, $config = []) { $this->setPaths($paths); $this->config = new Structure($this->config); $this->config->load($config); } /** * Method to escape output. * * @param string $output The output to escape. * * @return string The escaped output. * * @see ViewInterface::escape() * @since 2.0 */ public function escape($output) { // Escape the output. return htmlspecialchars((string) $output, ENT_COMPAT, 'UTF-8'); } /** * finFile * * @param string $file * @param string $ext * * @return string */ public function findFile($file, $ext = '') { $paths = clone $this->getPaths(); $file = str_replace('.', '/', $file); $ext = $ext ? '.' . trim($ext, '.') : ''; foreach ($paths as $path) { $filePath = $path . '/' . $file . $ext; if (is_file($filePath)) { return realpath($filePath); } } return null; } /** * has * * @param string $file * @param string $ext * * @return bool * * @since 3.5.2 */ public function has(string $file, string $ext = ''): bool { return $this->findFile($file, $ext) !== null; } /** * getPaths * * @return \SplPriorityQueue */ public function getPaths() { return $this->paths; } /** * setPaths * * @param \SplPriorityQueue $paths * * @return AbstractRenderer Return self to support chaining. */ public function setPaths($paths) { if (!($paths instanceof \SplPriorityQueue)) { $priority = new \SplPriorityQueue(); foreach ((array) $paths as $i => $path) { $priority->insert($path, 100 - ($i * 10)); } $paths = $priority; } $this->paths = $paths; return $this; } /** * addPath * * @param string $path * @param integer $priority * * @return static */ public function addPath($path, $priority = 100) { $this->paths->insert($path, $priority); return $this; } /** * dumpPaths * * @return array */ public function dumpPaths() { $paths = clone $this->paths; $return = []; foreach ($paths as $path) { $return[] = $path; } return $return; } /** * __get * * @param string $name * * @return mixed */ public function __get($name) { if ($name === 'config') { return $this->$name; } throw new \UnexpectedValueException('Property ' . $name . ' not extists.'); } }
Upload File
Create Folder