Skip to content

Commit

Permalink
Merge pull request #37 from kschroeder/develop
Browse files Browse the repository at this point in the history
Changed to use the SplFileInfo realpath
  • Loading branch information
kschroeder authored Feb 22, 2017
2 parents a180872 + 34f78a5 commit d345ea8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
11 changes: 10 additions & 1 deletion assets/magium-configuration.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,16 @@
<xs:element name="configurationFiles" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="file" minOccurs="1" maxOccurs="unbounded" />
<xs:element name="file" minOccurs="1" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>
This is the fully qualified or configurationDirectories-related path for a
specific configuration file. If you are building a module that will be included
via something like Composer do not use this. Get the ConfigurationRepository
object from the Builder and add them there.
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
Expand Down
3 changes: 2 additions & 1 deletion lib/Config/BuilderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public function getPersistence()
public function getSecureBaseDirectories()
{
$cwd = getcwd();
chdir($this->baseDirectory->getPath());
$path = $this->baseDirectory->getRealPath();
chdir($path);
$config = $this->configuration->configurationDirectories;
$config = json_encode($config);
$config = json_decode($config, true);
Expand Down
2 changes: 1 addition & 1 deletion tests/Config/BuilderFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ protected function runConfigurationFiles(\SimpleXMLElement $config, array $secur
protected function getFactory(\SimpleXMLElement $config)
{
$factory = new BuilderFactory(
new \SplFileInfo(__DIR__ . '../../'),
new \SplFileInfo(__DIR__),
$config,
$this->createMock(AbstractContextConfigurationFile::class)
);
Expand Down

0 comments on commit d345ea8

Please sign in to comment.