adds condition to Parsedown include

This commit is contained in:
buttle 2021-07-30 00:27:26 +02:00
parent e7a3707799
commit 7ce33f02ff
1 changed files with 12 additions and 4 deletions

View File

@ -12,15 +12,23 @@ use Omeka\Stdlib\ErrorStore;
use Laminas\Form\FormElementManager; use Laminas\Form\FormElementManager;
use TechDocument\Form\TechDocumentBlockForm; use TechDocument\Form\TechDocumentBlockForm;
//require_once(dirname(__DIR__, 3) . '/vendor/erusev/parsedown/Parsedown.php'); //require_once(dirname(__DIR__, 3) . '/vendor/erusev/parsedown/Parsedown.php');
//require_once(dirname(__DIR__, 3) . '/vendor/mpdf/mpdf/src/Mpdf.php'); //require_once(dirname(__DIR__, 3) . '/vendor/mpdf/mpdf/src/Mpdf.php');
require_once(dirname(__DIR__, 3) . '/vendor/autoload.php');
use Parsedown;
//use Module\vendor\parsedown\Parsedown; //use Module\vendor\parsedown\Parsedown;
//use Module\vendor\mpdf\Mpdf; //use Module\vendor\mpdf\Mpdf;
$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;
class TechDocument extends AbstractBlockLayout class TechDocument extends AbstractBlockLayout
{ {