adds consition to parsedown include

This commit is contained in:
buttle 2021-07-30 00:25:30 +02:00
parent 2a7c92e7d2
commit 402f94143a
2 changed files with 14 additions and 3 deletions

View File

@ -8,9 +8,11 @@ that does some markdown rendering.
```
cd ./modules
https://git.hangar.org/arcHIVE-tech/SimpleMDText/archive/main.zip
https://git.hangar.org/arcHIVE-tech/SimpleMarkdown-omeka-module/archive/main.zip
unzip main.zip
mv simpletext/ SimpleMDText
rm main.zip
mv simplemarkdown-omeka-module/ SimpleMDText
cd SimpleMDText
composer install
```

View File

@ -10,7 +10,16 @@ use Laminas\View\Renderer\PhpRenderer;
use Laminas\Form\FormElementManager;
use SimpleMDText\Form\SimpleMDTextBlockForm;
require_once(dirname(__DIR__, 3) . '/vendor/erusev/parsedown/Parsedown.php');
$list_of_includes = get_included_files();
$parsedown_included=false;
foreach ($list_of_includes as $file_path) {
if (false !== strpos($file_path, "Parsedown.php")) {
$parsedown_included=true;
}
}
if ($parsedown_included == false){
require_once(dirname(__DIR__, 3) . '/vendor/autoload.php');
}
use Parsedown;