Visman 1 rok temu
rodzic
commit
59dbdd47b1

+ 1 - 9
composer.json

@@ -4,7 +4,6 @@
     "homepage": "https://forkbb.ru",
     "type": "project",
     "license": "MIT",
-    "minimum-stability": "dev",
     "authors": [
         {
             "name": "Visman",
@@ -17,12 +16,6 @@
             "ForkBB\\": "app/"
         }
     },
-    "repositories": [
-        {
-            "type": "vcs",
-            "url": "https://github.com/MioVisman/dirk"
-        }
-    ],
     "require": {
         "php": ">=8.0.0",
         "ext-mbstring": "*",
@@ -30,9 +23,8 @@
         "ext-intl" : "*",
         "ext-json": "*",
         "ext-pdo": "*",
-        "artoodetoo/dirk": "dev-visman",
         "miovisman/parserus": "^1.2.1",
-        "miovisman/normemail": "dev-master",
+        "miovisman/normemail": "^1.0.0",
         "psr/simple-cache": "^1.0.1",
         "psr/log": "^1.1.3",
         "miovisman/jevix": "^2.2.0"

+ 11 - 69
composer.lock

@@ -4,62 +4,8 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "fb119441777a90db88756c96d2e75e12",
+    "content-hash": "fc088b2693e7c23a32d1a94bf397e0d5",
     "packages": [
-        {
-            "name": "artoodetoo/dirk",
-            "version": "dev-visman",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/MioVisman/dirk.git",
-                "reference": "32ce64305c87344bf6bfc48221643d374f6aa65b"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/MioVisman/dirk/zipball/32ce64305c87344bf6bfc48221643d374f6aa65b",
-                "reference": "32ce64305c87344bf6bfc48221643d374f6aa65b",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=7.3.0"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "4.0.*"
-            },
-            "default-branch": true,
-            "type": "library",
-            "autoload": {
-                "psr-4": {
-                    "R2\\Templating\\": "src"
-                }
-            },
-            "autoload-dev": {
-                "psr-4": {
-                    "R2\\Templating\\Tests": "tests"
-                }
-            },
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "artoodetoo",
-                    "email": "i.am@artoodetoo.org"
-                }
-            ],
-            "description": "PHP template system",
-            "keywords": [
-                "dirk",
-                "package",
-                "templates",
-                "templating",
-                "views"
-            ],
-            "support": {
-                "source": "https://github.com/MioVisman/dirk/tree/visman"
-            },
-            "time": "2021-02-06T14:10:06+00:00"
-        },
         {
             "name": "miovisman/jevix",
             "version": "2.2.1",
@@ -120,7 +66,7 @@
         },
         {
             "name": "miovisman/normemail",
-            "version": "dev-master",
+            "version": "1.0.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/MioVisman/NormEmail.git",
@@ -137,7 +83,6 @@
                 "ext-mbstring": "*",
                 "php": ">=5.6.0"
             },
-            "default-branch": true,
             "type": "library",
             "autoload": {
                 "psr-4": {
@@ -171,16 +116,16 @@
         },
         {
             "name": "miovisman/parserus",
-            "version": "1.2.0",
+            "version": "1.2.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/MioVisman/Parserus.git",
-                "reference": "ed0900c73aa1685f0907d9eb0f7dafa7f85f33cc"
+                "reference": "cfb7aaf20b5250e9bdfa808a5c68425dfea3c1c9"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/MioVisman/Parserus/zipball/ed0900c73aa1685f0907d9eb0f7dafa7f85f33cc",
-                "reference": "ed0900c73aa1685f0907d9eb0f7dafa7f85f33cc",
+                "url": "https://api.github.com/repos/MioVisman/Parserus/zipball/cfb7aaf20b5250e9bdfa808a5c68425dfea3c1c9",
+                "reference": "cfb7aaf20b5250e9bdfa808a5c68425dfea3c1c9",
                 "shasum": ""
             },
             "require": {
@@ -211,9 +156,9 @@
             ],
             "support": {
                 "issues": "https://github.com/MioVisman/Parserus/issues",
-                "source": "https://github.com/MioVisman/Parserus/tree/1.2.0"
+                "source": "https://github.com/MioVisman/Parserus/tree/1.2.1"
             },
-            "time": "2022-01-08T13:04:33+00:00"
+            "time": "2023-06-17T13:00:37+00:00"
         },
         {
             "name": "psr/log",
@@ -319,15 +264,12 @@
     ],
     "packages-dev": [],
     "aliases": [],
-    "minimum-stability": "dev",
-    "stability-flags": {
-        "artoodetoo/dirk": 20,
-        "miovisman/normemail": 20
-    },
+    "minimum-stability": "stable",
+    "stability-flags": [],
     "prefer-stable": false,
     "prefer-lowest": false,
     "platform": {
-        "php": ">=7.3.0",
+        "php": ">=8.0.0",
         "ext-mbstring": "*",
         "ext-fileinfo": "*",
         "ext-intl": "*",

+ 0 - 1
vendor/artoodetoo/dirk/.gitignore

@@ -1 +0,0 @@
-bootstrap.php

+ 0 - 22
vendor/artoodetoo/dirk/LICENSE

@@ -1,22 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2015 
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-

+ 0 - 123
vendor/artoodetoo/dirk/README.md

@@ -1,123 +0,0 @@
-# Dirk PHP Templates
-
-Tiny and powerfull template engine with syntax almost the same as in laravel/blade.
-
-### Installation
-
-The package can be installed via Composer by requiring the "artoodetoo/dirk" package in your project's composer.json.
-
-```json
-{
-    "require": {
-        "artoodetoo/dirk": "dev-master"
-    }
-}
-```
-
-### Usage
-
-**/views/hello.dirk.html**
-```html
-@extends('layout/main')
-
-<h1>Hello {{{ $name }}}!<h1>
-
-{{ $timestamp or 'Timestamp not defined' }}
-
-@section('sidebar')
-
-  @foreach($list as $l)
-    <p>{{ $l }} @if($l == 3) is equal 3 ! @endif</p>
-  @endforeach
-
-@endsection
-```
-
-**/views/layout/main.dirk.html**
-```html
-<!DOCTYPE html>
-<html>
-<head>
-<title>Example</title>
-</head>
-<body>
-
-<sidebar>
-
-@yield('sidebar', 'Default sidebar text')
-
-</sidebar>
-
-@yield('content')
-
-</body>
-</html>
-```
-
-**/web/index.php**
-```php
-<?php
-
-require 'vendor/autoload.php';
-
-use R2\Templating\Dirk;
-
-$view = new Dirk([
-    'views' => __DIR__.'/views',
-    'cache' => __DIR__.'/cache'
-]);
-
-$name = '<artoodetoo>';
-$list = [1, 2, 3, 4, 5];
-
-$view->render('hello', compact('name', 'list'));
-```
-
-### Feature list
-
-Echoes and comments
-  * *{{ $var }}* - Echo. NOTE: it's escaped by default, like in Laravel 5!
-  * *{!! $var !!}* - Raw echo without escaping
-  * *{{ $var or 'default' }}* - Echo content with a default value
-  * *{{{ $var }}}* - Echo escaped content
-  * *{{-- Comment --}}* - A comment (in code, not in output)
-
-Conditionals
-  * *@if(condition)* - Starts an if block
-  * *@else*
-  * *@elseif(condition)*
-  * *@endif*
-  * *@unless(condition)* - Starts an unless block
-  * *@endunless*
-  * *@isset(condition)* - Starts an isset block
-  * *@endisset*
-  * *@empty(condition)* - Starts an empty block
-  * *@endempty*
-
-Loops
-  * *@foreach($list as $key => $val)* - Starts a foreach block
-  * *@endforeach*
-  * *@forelse($list as $key => $val)* - Starts a foreach with empty block
-  * *@empty*
-  * *@endforelse*
-  * *@for($i = 0; $i < 10; $i++)* - Starts a for block
-  * *@endfor*
-  * *@while(condition)* - Starts a while block
-  * *@endwhile*
-  * Loop variables (for *@foreach* and *@forelse*):
-    * *@iteration* = *$loop->iteration*
-
-Inheritance and sections
-  * *@include(file)* - Includes another template
-  * *@extends('layout')* - Extends a template with a layout
-  * *@section('name')* - Starts a section
-  * *@endsection* - Ends section
-  * *@yield('section')* - Yields content of a section.
-  * *@show* - Ends section and yields its content
-  * *@stop* - Ends section
-  * *@append* - Ends section and appends it to existing of section of same name
-  * *@overwrite* - Ends section, overwriting previous section of same name
-
-### License
-
-The Dirk is open-source software, licensed under the [MIT license](http://opensource.org/licenses/MIT)

+ 0 - 28
vendor/artoodetoo/dirk/composer.json

@@ -1,28 +0,0 @@
-{
-    "name": "artoodetoo/dirk",
-    "description": "PHP template system",
-    "license": "MIT",
-    "keywords": ["dirk", "package", "templating", "templates", "views"],
-    "authors": [
-        {
-            "name": "artoodetoo",
-            "email": "i.am@artoodetoo.org"
-        }
-    ],
-    "require": {
-        "php": ">=7.3.0"
-    },
-    "require-dev": {
-        "phpunit/phpunit": "4.0.*"
-    },
-    "autoload": {
-        "psr-4": {
-            "R2\\Templating\\": "src"
-        }
-    },
-    "autoload-dev": {
-        "psr-4": {
-            "R2\\Templating\\Tests": "tests"
-        }
-    }
-}

+ 0 - 17
vendor/artoodetoo/dirk/phpunit.xml.dist

@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<phpunit backupGlobals="false"
-         backupStaticAttributes="false"
-         bootstrap="vendor/autoload.php"
-         colors="true"
-         convertErrorsToExceptions="true"
-         convertNoticesToExceptions="true"
-         convertWarningsToExceptions="true"
-         processIsolation="false"
-         stopOnFailure="false"
-         syntaxCheck="false">
-    <testsuites>
-        <testsuite name="Dirk Test Suite">
-            <directory suffix=".php">./tests/</directory>
-        </testsuite>
-    </testsuites>
-</phpunit>

+ 0 - 529
vendor/artoodetoo/dirk/src/Dirk.php

@@ -1,529 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace R2\Templating;
-
-use R2\Templating\PhpEngine;
-
-class Dirk extends PhpEngine
-{
-
-    protected $cache;
-    protected $echoFormat;
-
-    public function __construct(array $config = [])
-    {
-        $config = \array_replace_recursive(
-            [
-                'ext'   => '.blade.php',
-                'cache' => '.',
-                'echo'  => '\\htmlspecialchars((string) %s, \\ENT_QUOTES, \'UTF-8\')',
-            ],
-            $config
-        );
-        $this->cache      = $config['cache'] ?? '.';
-        $this->echoFormat = $config['echo']  ?? '%s';
-        parent::__construct($config);
-    }
-
-    protected $compilers = [
-        'Statements',
-        'Comments',
-        'Echos',
-    ];
-
-    protected $shortID = '';
-    protected $shortArr = [];
-
-    /**
-     * Prepare file to include
-     * @param  string $name
-     * @return string
-     */
-    protected function prepare(string $name): string
-    {
-        $name = \str_replace('.', '/', $name);
-        $tpl  = $this->views . '/' . $name . $this->ext;
-        $sha1 = \sha1($name);
-        $php  = $this->cache . '/' . $sha1 . '.php';
-
-        if (
-            ! \file_exists($php)
-            || \filemtime($tpl) > \filemtime($php)
-        ) {
-            $this->shortArr[] = $this->shortID;
-            $this->shortID    = \substr($sha1, 0, 4);
-
-            $text = \file_get_contents($tpl);
-
-            foreach ($this->compilers as $type) {
-                $text = $this->{'compile' . $type}($text);
-            }
-
-            \file_put_contents($php, $text);
-
-            $this->shortID    = \array_pop($this->shortArr);
-        }
-
-        return $php;
-    }
-
-    /**
-     * Compile Statements that start with "@"
-     *
-     * @param  string  $value
-     * @return string
-     */
-    protected function compileStatements(string $value): string
-    {
-        return \preg_replace_callback(
-            '%[ \t]*+\B@(\w+)(?: [ \t]*( \( ( (?>[^()]+) | (?2) )* \) ) )?%x',
-            function($match) {
-                if (\method_exists($this, $method = 'compile' . \ucfirst($match[1]))) {
-                    return $this->$method($match[2] ?? '');
-                } else {
-                    return $match[0];
-                }
-            },
-            $value
-        );
-    }
-
-    /**
-     * Compile comments
-     *
-     * @param  string  $value
-     * @return string
-     */
-    protected function compileComments(string $value): string
-    {
-        return \preg_replace('%\{\{--(.*?)--\}\}%s', '<?php /*$1*/ ?>', $value);
-    }
-
-    /**
-     * Compile echos
-     *
-     * @param  string  $value
-     * @return string
-     */
-    protected function compileEchos(string $value): string
-    {
-        // compile escaped echoes
-        $value = \preg_replace_callback(
-            '%\{\{\{\s*(.+?)\s*\}\}\}(\r?\n)?%s',
-            function($matches) {
-                $whitespace = empty($matches[2]) ? '' : $matches[2] . $matches[2];
-
-                return '<?= \\htmlspecialchars('
-                    . $this->compileEchoDefaults($matches[1])
-                    . ', \\ENT_QUOTES, \'UTF-8\') ?>'
-                    . $whitespace;
-            },
-            $value
-        );
-
-        // compile not escaped echoes
-        $value = \preg_replace_callback(
-            '%\{\!!\s*(.+?)\s*!!\}(\r?\n)?%s',
-            function($matches) {
-                $whitespace = empty($matches[2]) ? '' : $matches[2] . $matches[2];
-
-                return '<?= '
-                    . $this->compileEchoDefaults($matches[1])
-                    . ' ?>'
-                    . $whitespace;
-            },
-            $value
-        );
-
-        // compile regular echoes
-        $value = \preg_replace_callback(
-            '%(@)?\{\{\s*(.+?)\s*\}\}(\r?\n)?%s',
-            function($matches) {
-                $whitespace = empty($matches[3]) ? '' : $matches[3] . $matches[3];
-
-                return $matches[1]
-                    ? \substr($matches[0], 1)
-                    : '<?= '
-                        . \sprintf($this->echoFormat, $this->compileEchoDefaults($matches[2]))
-                        . ' ?>' . $whitespace;
-            },
-            $value
-        );
-
-        return $value;
-    }
-
-    /**
-     * Compile the default values for the echo statement.
-     *
-     * @param  string  $value
-     * @return string
-     */
-    public function compileEchoDefaults(string $value): string
-    {
-        return \preg_replace('%^(?=\$)(.+?)(?:\s+or\s+)(.+?)$%s', '($1 ?? $2)', $value);
-    }
-
-    /**
-     * Compile the if statements
-     *
-     * @param  string  $expression
-     * @return string
-     */
-    protected function compileIf(string $expression): string
-    {
-        if (\preg_match('%^\(\s*(\!\s*)?(\$[\w>-]+\[(?:\w+|[\'"]\w+[\'"])\])\s*\)$%', $expression, $matches)) {
-            if (empty($matches[1])) {
-                return "<?php if (! empty{$expression}): ?>";
-            } else {
-                return "<?php if (empty({$matches[2]})): ?>";
-            }
-        } else {
-            return "<?php if {$expression}: ?>";
-        }
-    }
-
-    /**
-     * Compile the else-if statements
-     *
-     * @param  string  $expression
-     * @return string
-     */
-    protected function compileElseif(string $expression): string
-    {
-        return "<?php elseif {$expression}: ?>";
-    }
-
-    /**
-     * Compile the else statements
-     *
-     * @return string
-     */
-    protected function compileElse(): string
-    {
-        return "<?php else: ?>";
-    }
-
-    /**
-     * Compile the end-if statements
-     *
-     * @return string
-     */
-    protected function compileEndif(): string
-    {
-        return "<?php endif; ?>";
-    }
-
-    /**
-     * Compile the isset statements
-     *
-     * @param  string  $expression
-     * @return string
-     */
-    protected function compileIsset(string $expression): string
-    {
-        return "<?php if (isset{$expression}): ?>";
-    }
-
-    /**
-     * Compile the end-isset statements
-     *
-     * @return string
-     */
-    protected function compileEndisset(): string
-    {
-        return "<?php endif; ?>";
-    }
-
-    /**
-     * Compile the end-empty statements
-     *
-     * @return string
-     */
-    protected function compileEndempty(): string
-    {
-        return "<?php endif; ?>";
-    }
-
-    /**
-     * Compile the unless statements
-     *
-     * @param  string  $expression
-     * @return string
-     */
-    protected function compileUnless(string $expression): string
-    {
-        return "<?php if (! $expression): ?>";
-    }
-
-    /**
-     * Compile the end unless statements
-     *
-     * @return string
-     */
-    protected function compileEndunless(): string
-    {
-        return "<?php endif; ?>";
-    }
-
-    /**
-     * Compile the for statements
-     *
-     * @param  string  $expression
-     * @return string
-     */
-    protected function compileFor(string $expression): string
-    {
-        return "<?php for {$expression}: ?>";
-    }
-
-    /**
-     * Compile the end-for statements
-     *
-     * @return string
-     */
-    protected function compileEndfor(): string
-    {
-        return "<?php endfor; ?>";
-    }
-
-    protected $loopsCounter = 0;
-
-    /**
-     * Compile the foreach statements
-     *
-     * @param  string  $expression
-     * @return string
-     */
-    protected function compileForeach(string $expression): string
-    {
-        ++$this->loopsCounter;
-
-        return "<?php \$__iter{$this->shortID}_{$this->loopsCounter} = 0; "
-             . "foreach {$expression}: "
-             . "++\$__iter{$this->shortID}_{$this->loopsCounter}; ?>";
-    }
-
-    /**
-     * Compile the end-for-each statements
-     *
-     * @return string
-     */
-    protected function compileEndforeach(): string
-    {
-        --$this->loopsCounter;
-
-        return "<?php endforeach; ?>";
-    }
-
-    protected function compileIteration(): string
-    {
-        return "((int) \$__iter{$this->shortID}_{$this->loopsCounter})";
-    }
-
-    /**
-     * Compile the forelse statements
-     *
-     * @param  string  $expression
-     * @return string
-     */
-    protected function compileForelse(string $expression): string
-    {
-        ++$this->loopsCounter;
-
-        return "<?php \$__iter{$this->shortID}_{$this->loopsCounter} = 0; "
-             . "foreach {$expression}: "
-             . "++\$__iter{$this->shortID}_{$this->loopsCounter}; ?>";
-    }
-
-    /**
-     * Compile the end-forelse statements
-     * Compile the empty statements
-     *
-     * @param  string  $expression
-     * @return string
-     */
-    protected function compileEmpty(string $expression): string
-    {
-        if (
-            isset($expression[0])
-            && '(' == $expression[0]
-        ) {
-            return "<?php if (empty{$expression}): ?>";
-        } else {
-            $s = "<?php endforeach; if (0 === \$__iter{$this->shortID}_{$this->loopsCounter}): ?>";
-
-            --$this->loopsCounter;
-
-            return $s;
-        }
-    }
-
-    /**
-     * Compile the end-forelse statements
-     *
-     * @return string
-     */
-    protected function compileEndforelse(): string
-    {
-        return "<?php endif; ?>";
-    }
-
-    /**
-     * Compile the while statements
-     *
-     * @param  string  $expression
-     * @return string
-     */
-    protected function compileWhile(string $expression): string
-    {
-        return "<?php while {$expression}: ?>";
-    }
-
-    /**
-     * Compile the end-while statements
-     *
-     * @return string
-     */
-    protected function compileEndwhile(): string
-    {
-        return "<?php endwhile; ?>";
-    }
-
-    /**
-     * Compile the extends statements
-     *
-     * @param  string  $expression
-     * @return string
-     */
-    protected function compileExtends(string $expression): string
-    {
-        if (
-            isset($expression[0])
-            && '(' == $expression[0]
-        ) {
-            $expression = \substr($expression, 1, -1);
-        }
-
-        return "<?php \$this->extend({$expression}); ?>";
-    }
-
-    /**
-     * Compile the include statements
-     *
-     * @param  string  $expression
-     * @return string
-     */
-    protected function compileInclude(string $expression): string
-    {
-        if (
-            isset($expression[0])
-            && '(' == $expression[0]
-        ) {
-            $expression = \substr($expression, 1, -1);
-        }
-
-        return "<?php include \$this->prepare({$expression}); ?>";
-    }
-
-    /**
-     * Compile the yield statements
-     *
-     * @param  string  $expression
-     * @return string
-     */
-    protected function compileYield(string $expression): string
-    {
-        return "<?= \$this->block{$expression}; ?>";
-    }
-
-    /**
-     * Compile the section statements
-     *
-     * @param  string  $expression
-     * @return string
-     */
-    protected function compileSection(string $expression): string
-    {
-        return "<?php \$this->beginBlock{$expression}; ?>";
-    }
-
-    /**
-     * Compile the end-section statements
-     *
-     * @return string
-     */
-    protected function compileEndsection(): string
-    {
-        return "<?php \$this->endBlock(); ?>";
-    }
-
-    /**
-     * Compile the show statements
-     *
-     * @return string
-     */
-    protected function compileShow(): string
-    {
-        return "<?= \$this->block(\$this->endBlock()); ?>";
-    }
-
-    /**
-     * Compile the append statements
-     *
-     * @return string
-     */
-    protected function compileAppend(): string
-    {
-        return "<?php \$this->endBlock(); ?>";
-    }
-
-    /**
-     * Compile the stop statements
-     *
-     * @return string
-     */
-    protected function compileStop(): string
-    {
-        return "<?php \$this->endBlock(); ?>";
-    }
-
-    /**
-     * Compile the overwrite statements
-     *
-     * @return string
-     */
-    protected function compileOverwrite(): string
-    {
-        return "<?php \$this->endBlock(true); ?>";
-    }
-
-    protected function compileSwitch(string $expression): string
-    {
-        return "<?php switch {$expression}: ?>";
-    }
-
-    protected function compileCase(string $expression): string
-    {
-        $expression = \substr($expression, 1, -1);
-
-        return "<?php case {$expression}: ?>";
-    }
-
-    protected function compileDefault(): string
-    {
-        return "<?php default: ?>";
-    }
-
-    protected function compileEndswitch(): string
-    {
-        return "<?php endswitch; ?>";
-    }
-
-    protected function compileBreak(): string
-    {
-        return "<?php break; ?>";
-    }
-}

+ 0 - 175
vendor/artoodetoo/dirk/src/PhpEngine.php

@@ -1,175 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace R2\Templating;
-
-class PhpEngine
-{
-    protected $composers;
-    protected $views;
-    protected $ext;
-    protected $separator;
-    protected $blocks;
-    protected $blockStack;
-    protected $templates = [];
-
-
-    /**
-     * Constructor
-     * @param array $config
-     */
-    public function __construct(array $config = [], array $composers = [])
-    {
-        $this->views      = $config['views']     ?? '.';
-        $this->ext        = $config['ext']       ?? '.php';
-        $this->separator  = $config['separator'] ?? '/';
-        $this->blocks     = [];
-        $this->blockStack = [];
-        $this->composers  = [];
-
-        foreach ($composers as $name => $composer) {
-            $this->composer($name, $composer);
-        }
-    }
-
-    /**
-     * Add view composer
-     * @param mixed $name     template name or array of names
-     * @param mixed $composer data in the same meaning as for fetch() call, or callable returning such data
-     */
-    public function composer($name, $composer): void
-    {
-        if (\is_array($name)) {
-            foreach ($name as $n) {
-                $this->composer($n, $composer);
-            }
-        } else {
-            $p = '~^'
-                . \str_replace('\*', '[^' . $this->separator . ']+', \preg_quote($name, $this->separator . '~'))
-                . '$~';
-            $this->composers[$p][] = $composer;
-        }
-    }
-
-    /**
-     * Prepare file to include
-     * @param  string $name
-     * @return string
-     */
-    protected function prepare(string $name): string
-    {
-        if ('/' !== $this->separator) {
-            $name = \str_replace($this->separator, '/', $name);
-        }
-
-        return $this->views . '/' . $name . $this->ext;
-    }
-
-
-    /**
-     * Print result of templating
-     * @param string $name
-     * @param array  $data
-     */
-    public function render(string $name, array $data = []): string
-    {
-        echo $this->fetch($name, $data);
-    }
-
-    /**
-     * Return result of templating
-     * @param  string $name
-     * @param  array  $data
-     * @return string
-     */
-    public function fetch(string $name, array $data = []): string
-    {
-        $this->templates[] = $name;
-
-        if (! empty($data)) {
-            \extract($data);
-        }
-
-        while ($_name = \array_shift($this->templates)) {
-            $this->beginBlock('content');
-
-            foreach ($this->composers as $_cname => $_cdata) {
-                if (\preg_match($_cname, $_name)) {
-                    foreach ($_cdata as $_citem) {
-                        \extract((\is_callable($_citem) ? $_citem($this) : $_citem) ?: []);
-                    }
-                }
-            }
-
-            require($this->prepare($_name));
-
-            $this->endBlock(true);
-        }
-
-        return $this->block('content');
-    }
-
-    /**
-     * Is template file exists?
-     * @param  string  $name
-     * @return bool
-     */
-    public function exists(string $name): bool
-    {
-        return \file_exists($this->prepare($name));
-    }
-
-    /**
-     * Define parent
-     * @param string $name
-     */
-    protected function extend(string $name): void
-    {
-        $this->templates[] = $name;
-    }
-
-    /**
-     * Return content of block if exists
-     * @param  string $name
-     * @param  string $default
-     * @return string
-     */
-    protected function block(string $name, string $default = ''): string
-    {
-        return \array_key_exists($name, $this->blocks)
-            ? $this->blocks[$name]
-            : $default;
-    }
-
-    /**
-     * Block begins
-     * @param string $name
-     */
-    protected function beginBlock(string $name): void
-    {
-        \array_push($this->blockStack, $name);
-        \ob_start();
-    }
-
-    /**
-     * Block ends
-     * @param boolean $overwrite
-     * @return string
-     */
-    protected function endBlock(bool $overwrite = false): string
-    {
-        $name = \array_pop($this->blockStack);
-
-        if (
-            $overwrite
-            || ! \array_key_exists($name, $this->blocks)
-        ) {
-            $this->blocks[$name] = \ob_get_clean();
-        } else {
-            $this->blocks[$name] .= \ob_get_clean();
-        }
-
-        return $name;
-    }
-}

+ 0 - 89
vendor/artoodetoo/dirk/tests/DirkTest.php

@@ -1,89 +0,0 @@
-<?php
-
-namespace R2\Templating\Tests;
-
-use R2\Templating\Dirk;
-
-class DirkTest extends \PHPUnit_Framework_TestCase
-{
-    /** @var PhpEngine */
-    protected $engine;
-    /** @var string */
-    protected $views;
-    /** @var string */
-    protected $cache;
-    /** @var string */
-    protected $ext;
-    /** @var string[] */
-    protected $templates;
-
-    protected function setUp()
-    {
-        $this->views  = sys_get_temp_dir();
-        $this->cache  = $this->views;
-        $this->ext    = '.dirk.html';
-        $this->engine = new Dirk(
-            [
-                'views' => $this->views,
-                'cache' => $this->cache,
-                'ext'   => $this->ext,
-            ]
-        );
-        $this->templates = [];
-    }
-
-    protected function tearDown()
-    {
-        foreach ($this->templates as $name) {
-            $src = $name.$this->ext;
-            $dst = md5($name).'.php';
-            unlink($this->views.'/'.$src);
-            unlink($this->views.'/'.$dst);
-        }
-        unset($this->engine, $this->templates);
-    }
-
-    protected function template($text)
-    {
-        $name = \md5(\uniqid());
-        file_put_contents($this->views.'/'.$name.$this->ext, $text);
-        $this->templates[] = $name;
-        return $name;
-    }
-
-    /**
-     * @covers R2\Templating\Dirk::render
-     */
-    public function testRender1()
-    {
-        $name1 = $this->template('Well done, {{ $grade }}!');
-        $this->engine->render($name1, ['grade' => '<b>captain</b>']);
-        $this->expectOutputString('Well done, &lt;b&gt;captain&lt;/b&gt;!');
-    }
-
-    /**
-     * @covers R2\Templating\Dirk::render
-     */
-    public function testRender2()
-    {
-        $name2 = $this->template('Well done, {!! $grade !!}!');
-        $this->engine->render($name2, ['grade' => '<b>captain</b>']);
-        $this->expectOutputString('Well done, <b>captain</b>!');
-    }
-
-    /**
-     * @covers R2\Templating\Dirk::fetch
-     */
-    public function testFetch()
-    {
-        $parentName = $this->template(
-            'The text is `@yield(\'content\')`. '.
-            '@foreach([1,2,3] as $i)'.
-            '{!! $i !!}'.
-            '@endforeach'
-        );
-        $name = $this->template("@extends('{$parentName}')-xxx-");
-        $result = $this->engine->fetch($name, []);
-        $this->assertEquals("The text is `-xxx-`. 123", $result);
-    }
-}

+ 0 - 77
vendor/artoodetoo/dirk/tests/PhpEngineTest.php

@@ -1,77 +0,0 @@
-<?php
-
-namespace R2\Templating\Tests;
-
-use R2\Templating\PhpEngine;
-
-class PhpEngineTest extends \PHPUnit_Framework_TestCase
-{
-    /** @var PhpEngine */
-    protected $engine;
-    /** @var string */
-    protected $views;
-    /** @var string */
-    protected $ext;
-    /** @var string[] */
-    protected $templates;
-
-    protected function setUp()
-    {
-        $this->views  = sys_get_temp_dir();
-        $this->ext    = '.php';
-        $this->engine = new PhpEngine(
-            [
-                'views' => $this->views,
-                'ext'   => $this->ext,
-            ]
-        );
-        $this->templates = [];
-    }
-
-    protected function tearDown()
-    {
-        foreach ($this->templates as $name) {
-            unlink($this->views.'/'.$name.$this->ext);
-        }
-        unset($this->engine, $this->templates);
-    }
-
-    protected function template($text)
-    {
-        $name = \md5(\uniqid());
-        file_put_contents($this->views.'/'.$name.$this->ext, $text);
-        $this->templates[] = $name;
-        return $name;
-    }
-
-    /**
-     * @covers R2\Templating\PhpEngine::render
-     */
-    public function testRender()
-    {
-        $name = $this->template('Well done, <?= $grade ?>!');
-        $this->engine->render($name, ['grade' => 'captain']);
-        $this->expectOutputString('Well done, captain!');
-    }
-
-    /**
-     * @covers R2\Templating\PhpEngine::fetch
-     */
-    public function testFetch()
-    {
-        $parentName = $this->template('The text is (<?= $this->block(\'content\') ?>).');
-        $name = $this->template('<?php $this->extend(\''.$parentName.'\'); ?>xxx');
-        $result = $this->engine->fetch($name, []);
-        $this->assertEquals('The text is (xxx).', $result);
-    }
-
-    /**
-     * @covers R2\Templating\PhpEngine::exists
-     */
-    public function testExists()
-    {
-        $name = $this->template('dummy');
-        $this->assertTrue($this->engine->exists($name));
-        $this->assertFalse($this->engine->exists('some-weird-name'));
-    }
-}

+ 0 - 1
vendor/composer/autoload_psr4.php

@@ -6,7 +6,6 @@ $vendorDir = dirname(dirname(__FILE__));
 $baseDir = dirname($vendorDir);
 
 return array(
-    'R2\\Templating\\' => array($vendorDir . '/artoodetoo/dirk/src'),
     'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
     'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
     'MioVisman\\NormEmail\\' => array($vendorDir . '/miovisman/normemail/src'),

+ 0 - 8
vendor/composer/autoload_static.php

@@ -7,10 +7,6 @@ namespace Composer\Autoload;
 class ComposerStaticInit90ad93c7251d4f60daa9e545879c49e7
 {
     public static $prefixLengthsPsr4 = array (
-        'R' => 
-        array (
-            'R2\\Templating\\' => 14,
-        ),
         'P' => 
         array (
             'Psr\\SimpleCache\\' => 16,
@@ -28,10 +24,6 @@ class ComposerStaticInit90ad93c7251d4f60daa9e545879c49e7
     );
 
     public static $prefixDirsPsr4 = array (
-        'R2\\Templating\\' => 
-        array (
-            0 => __DIR__ . '/..' . '/artoodetoo/dirk/src',
-        ),
         'Psr\\SimpleCache\\' => 
         array (
             0 => __DIR__ . '/..' . '/psr/simple-cache/src',

+ 13 - 66
vendor/composer/installed.json

@@ -1,62 +1,5 @@
 {
     "packages": [
-        {
-            "name": "artoodetoo/dirk",
-            "version": "dev-visman",
-            "version_normalized": "dev-visman",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/MioVisman/dirk.git",
-                "reference": "32ce64305c87344bf6bfc48221643d374f6aa65b"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/MioVisman/dirk/zipball/32ce64305c87344bf6bfc48221643d374f6aa65b",
-                "reference": "32ce64305c87344bf6bfc48221643d374f6aa65b",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=7.3.0"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "4.0.*"
-            },
-            "time": "2021-02-06T14:10:06+00:00",
-            "default-branch": true,
-            "type": "library",
-            "installation-source": "dist",
-            "autoload": {
-                "psr-4": {
-                    "R2\\Templating\\": "src"
-                }
-            },
-            "autoload-dev": {
-                "psr-4": {
-                    "R2\\Templating\\Tests": "tests"
-                }
-            },
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "artoodetoo",
-                    "email": "i.am@artoodetoo.org"
-                }
-            ],
-            "description": "PHP template system",
-            "keywords": [
-                "dirk",
-                "package",
-                "templates",
-                "templating",
-                "views"
-            ],
-            "support": {
-                "source": "https://github.com/MioVisman/dirk/tree/visman"
-            },
-            "install-path": "../artoodetoo/dirk"
-        },
         {
             "name": "miovisman/jevix",
             "version": "2.2.1",
@@ -120,8 +63,8 @@
         },
         {
             "name": "miovisman/normemail",
-            "version": "dev-master",
-            "version_normalized": "dev-master",
+            "version": "1.0.0",
+            "version_normalized": "1.0.0.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/MioVisman/NormEmail.git",
@@ -165,27 +108,31 @@
                 "email",
                 "normalization"
             ],
+            "support": {
+                "issues": "https://github.com/MioVisman/NormEmail/issues",
+                "source": "https://github.com/MioVisman/NormEmail/tree/1.0.0"
+            },
             "install-path": "../miovisman/normemail"
         },
         {
             "name": "miovisman/parserus",
-            "version": "1.2.0",
-            "version_normalized": "1.2.0.0",
+            "version": "1.2.1",
+            "version_normalized": "1.2.1.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/MioVisman/Parserus.git",
-                "reference": "ed0900c73aa1685f0907d9eb0f7dafa7f85f33cc"
+                "reference": "cfb7aaf20b5250e9bdfa808a5c68425dfea3c1c9"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/MioVisman/Parserus/zipball/ed0900c73aa1685f0907d9eb0f7dafa7f85f33cc",
-                "reference": "ed0900c73aa1685f0907d9eb0f7dafa7f85f33cc",
+                "url": "https://api.github.com/repos/MioVisman/Parserus/zipball/cfb7aaf20b5250e9bdfa808a5c68425dfea3c1c9",
+                "reference": "cfb7aaf20b5250e9bdfa808a5c68425dfea3c1c9",
                 "shasum": ""
             },
             "require": {
                 "php": ">=7.3.0"
             },
-            "time": "2022-01-08T13:04:33+00:00",
+            "time": "2023-06-17T13:00:37+00:00",
             "type": "library",
             "installation-source": "dist",
             "autoload": {
@@ -212,7 +159,7 @@
             ],
             "support": {
                 "issues": "https://github.com/MioVisman/Parserus/issues",
-                "source": "https://github.com/MioVisman/Parserus/tree/1.2.0"
+                "source": "https://github.com/MioVisman/Parserus/tree/1.2.1"
             },
             "install-path": "../miovisman/parserus"
         },

+ 6 - 19
vendor/composer/installed.php

@@ -10,17 +10,6 @@
         'dev' => true,
     ),
     'versions' => array(
-        'artoodetoo/dirk' => array(
-            'pretty_version' => 'dev-visman',
-            'version' => 'dev-visman',
-            'type' => 'library',
-            'install_path' => __DIR__ . '/../artoodetoo/dirk',
-            'aliases' => array(
-                0 => '9999999-dev',
-            ),
-            'reference' => '32ce64305c87344bf6bfc48221643d374f6aa65b',
-            'dev_requirement' => false,
-        ),
         'forkbb/forkbb' => array(
             'pretty_version' => '1.0.0+no-version-set',
             'version' => '1.0.0.0',
@@ -40,23 +29,21 @@
             'dev_requirement' => false,
         ),
         'miovisman/normemail' => array(
-            'pretty_version' => 'dev-master',
-            'version' => 'dev-master',
+            'pretty_version' => '1.0.0',
+            'version' => '1.0.0.0',
             'type' => 'library',
             'install_path' => __DIR__ . '/../miovisman/normemail',
-            'aliases' => array(
-                0 => '9999999-dev',
-            ),
+            'aliases' => array(),
             'reference' => '2e657463266b1249e97d15c6795dd14248097cb3',
             'dev_requirement' => false,
         ),
         'miovisman/parserus' => array(
-            'pretty_version' => '1.2.0',
-            'version' => '1.2.0.0',
+            'pretty_version' => '1.2.1',
+            'version' => '1.2.1.0',
             'type' => 'library',
             'install_path' => __DIR__ . '/../miovisman/parserus',
             'aliases' => array(),
-            'reference' => 'ed0900c73aa1685f0907d9eb0f7dafa7f85f33cc',
+            'reference' => 'cfb7aaf20b5250e9bdfa808a5c68425dfea3c1c9',
             'dev_requirement' => false,
         ),
         'psr/log' => array(