Skip to content

Commit

Permalink
Allow for numeric filenames -.-
Browse files Browse the repository at this point in the history
  • Loading branch information
SMillerDev committed Oct 31, 2016
1 parent baef0a2 commit ff57770
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/PHPDraft/In/ApibFileParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public function __construct($filename = 'index.apib')
{
$this->location = pathinfo($filename, PATHINFO_DIRNAME) . '/';

set_include_path(get_include_path().':'.$this->location);

$this->full_apib = $this->get_apib($filename);
}

Expand All @@ -49,7 +51,7 @@ function get_apib($filename)
$this->file_check($filename);
$file = file_get_contents($filename);
$matches = [];
preg_match_all('<!-- include\(([a-z_.\/]*?).apib\) -->', $file, $matches);
preg_match_all('<!-- include\(([a-z0-9_.\/]*?).apib\) -->', $file, $matches);
foreach ($matches[1] as $value) {
$file = str_replace('<!-- include(' . $value . '.apib) -->',
$this->get_apib($this->location . $value . '.apib'), $file);
Expand Down

0 comments on commit ff57770

Please sign in to comment.