Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Merge pull request #45 from epieterman/master
Browse files Browse the repository at this point in the history
changed logic in function boot that all config parameters can be loaded
  • Loading branch information
Sam Partington authored Jun 21, 2018
2 parents b94e75b + 7b9a973 commit ed0fb15
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions WhiteOctoberTCPDFBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ public function boot()
foreach ($config as $k => $v)
{
$constKey = strtoupper($k);

// All K_ constants are required
if (preg_match("/^k_/i", $k))

if (!defined($constKey))
{
if (!defined($constKey))
{
$value = $this->container->getParameterBag()->resolveValue($v);

$value = $this->container->getParameterBag()->resolveValue($v);

// All K_ constants are required
if (preg_match("/^k_/i", $k))
{

if (($k === 'k_path_cache' || $k === 'k_path_url_cache') && !is_dir($value)) {
$this->createDir($value);
}
Expand All @@ -45,14 +46,8 @@ public function boot()
$value .= (substr($value, -1) == '/' ? '' : '/');
}

define($constKey, $value);
}
}

// and one special value which TCPDF will use if present
if (strtolower($k) == "pdf_font_name_main" && !defined($constKey))
{
define($constKey, $v);
define($constKey, $value);
}
}
}
Expand Down

0 comments on commit ed0fb15

Please sign in to comment.