Skip to content
Browse files

Merge branch 'feature-configuration' into develop

  • Loading branch information...
2 parents cfb6046 + a6e4b55 commit e9a8dfec6e4112a8fb3b24d98f6ce09b03735256 @zyxist zyxist committed
View
78 src/Opl/Autoloader/Command/ClassMapBuild.php
@@ -11,12 +11,14 @@
*/
namespace Opl\Autoloader\Command;
use Opl\Autoloader\Toolset\ClassMapBuilder;
+use Opl\Autoloader\Toolset\Configuration;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\Output;
use Symfony\Component\Console\Command\Command;
+use RuntimeException;
/**
* This command line interface command is responsible for building
@@ -29,12 +31,6 @@
class ClassMapBuild extends Command
{
/**
- * The class map builder.
- * @var ClassMapBuilder
- */
- protected $_builder;
-
- /**
* @see Command
*/
protected function configure()
@@ -42,25 +38,14 @@ protected function configure()
$this->ignoreValidationErrors = true;
$this->setDefinition(array(
- new InputArgument('definition', InputArgument::REQUIRED, 'The class map definition INI file'),
+ new InputArgument('configuration', InputArgument::REQUIRED, 'The Open Power Autoloader configuration'),
))
->setName('opl:autoloader:build-class-map')
->setDescription('Generates the class map for the ClassMapLoader')
->setHelp(<<<EOF
The <info>autoloader:class-map:build</info> command is responsible for building
-the class maps for the ClassMapLoader autoloader. The configuration is given as
-an INI file, where each entry represents a single top-level namespace and a path to its code:
-
- [config]
- outputFile = "./data/classMap.txt"
- extension = "./php"
-
- [namespaces]
- Opl = "../libs/"
- Foo = "../libs/"
- Bar = "../other/"
-
-It is recommended for the paths to have the trailing slashes prepended.
+the class maps for the ClassMapLoader autoloader. The configuration file is an
+XML document. Please refer to the OPA user manual to get to know more.
EOF
);
} // end configure();
@@ -70,54 +55,39 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
- $definition = $input->getArgument('definition');
- if(!$definition)
+ try
{
- $output->writeln('<error>No definition file specified!</error>');
- return;
+ $configuration = new Configuration($input->getArgument('configuration'));
}
-
- if(!file_exists($definition))
+ catch(RuntimeException $exception)
{
- $output->writeln('<error>The specified definition file does not exist!</error>');
+ $output->writeln('<error>An error occured: '.$exception->getMessage().'</error>');
+ return;
}
- $data = parse_ini_file($definition, true);
- if(!is_array($data))
+
+ if(!$configuration->hasFile('serialized-class-map'))
{
- $output->writeln('<error>Invalid INI structure in the definition file!</error>');
+ $output->writeln('<error>Serialized class map file definition is missing in the configuration file!</error>');
+ $output->writeln('Hint: add \'serialized-class-map\' file type to export-files section.');
+ return;
}
- $extension = 'php';
- $outputFile = './class-map.txt';
- if(isset($data['config']))
+ $builder = new ClassMapBuilder();
+
+ foreach($configuration->getSeparators() as $separator)
{
- if(isset($data['config']['extension']))
- {
- $extension = $data['config']['extension'];
- }
- if(isset($data['config']['outputFile']))
+ foreach($configuration->getSeparatorNamespaces($separator) as $name => $namespace)
{
- $outputFile = $data['config']['outputFile'];
+ $builder->addNamespace($name, $namespace['path'], $namespace['extension']);
}
}
-
- if(!isset($data['namespaces']))
- {
- $output->writeln('<error>No namespaces specified!</error>');
- }
-
- $this->_builder = new ClassMapBuilder();
- foreach($data['namespaces'] as $name => $path)
- {
- $this->_builder->addNamespace($name, $path, $extension);
- }
- $errors = $this->_builder->buildMap();
+ $errors = $builder->buildMap();
foreach($errors as $error)
{
- $output->writeln(preg_replace('/^(([^\:]+)\:) (.*)$/', '<error>$1</error> $3', $error));
+ $output->writeln(preg_replace('/^(([^\:]+)\:) (.*)$/', '<error>Warning: $1</error> $3', $error));
}
- file_put_contents($outputFile, serialize($this->_builder->getMap()));
- $output->writeln('<info>Map saved as:</info> '.$outputFile);
+ file_put_contents($configuration->getFile('serialized-class-map'), serialize($builder->getMap()));
+ $output->writeln('<info>Map saved as:</info> '.$configuration->getFile('serialized-class-map'));
} // end execute();
} // end ClassMapBuild;
View
26 src/Opl/Autoloader/Exception/FileFormatException.php
@@ -0,0 +1,26 @@
+<?php
+/*
+ * OPEN POWER LIBS <http://www.invenzzia.org>
+ *
+ * This file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE. It is also available through
+ * WWW at this URL: <http://www.invenzzia.org/license/new-bsd>
+ *
+ * Copyright (c) Invenzzia Group <http://www.invenzzia.org>
+ * and other contributors. See website for details.
+ */
+namespace Opl\Autoloader\Exception;
+use RuntimeException;
+
+/**
+ * This exception is thrown by the configuration parser, if the configuration
+ * file cannot be read.
+ *
+ * @author Tomasz Jędrzejewski
+ * @copyright Invenzzia Group <http://www.invenzzia.org/> and contributors.
+ * @license http://www.invenzzia.org/license/new-bsd New BSD License
+ */
+class FileFormatException extends RuntimeException
+{
+
+} // end FileFormatException;
View
282 src/Opl/Autoloader/Toolset/Configuration.php
@@ -0,0 +1,282 @@
+<?php
+/*
+ * OPEN POWER LIBS <http://www.invenzzia.org>
+ *
+ * This file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE. It is also available through
+ * WWW at this URL: <http://www.invenzzia.org/license/new-bsd>
+ *
+ * Copyright (c) Invenzzia Group <http://www.invenzzia.org>
+ * and other contributors. See website for details.
+ */
+namespace Opl\Autoloader\Toolset;
+use Opl\Autoloader\Exception\FileFormatException;
+use Opl\Autoloader\Exception\FileNotFoundException;
+use OutOfBoundsException;
+
+/**
+ * This class allows to parse the official Open Power Autoloader configuration
+ * files that are used by the CLI commands.
+ *
+ * @author Tomasz Jędrzejewski
+ * @copyright Invenzzia Group <http://www.invenzzia.org/> and contributors.
+ * @license http://www.invenzzia.org/license/new-bsd New BSD License
+ */
+class Configuration
+{
+ /**
+ * The exported PHP file header.
+ * @var string
+ */
+ protected $fileHeader;
+ /**
+ * The exported PHP file footer.
+ * @var string
+ */
+ protected $fileFooter;
+ /**
+ * The separators and their namespaces
+ * @var array[string][string]
+ */
+ protected $separators;
+ /**
+ * The list of defined export files.
+ * @var string[string]
+ */
+ protected $files;
+ /**
+ * Do we have simple namespaces only in the configuration?
+ * @var boolean
+ */
+ protected $simpleNamespacesOnly = true;
+
+ /**
+ * Imports the configuration file content into the memory.
+ *
+ * @throws FileNotFoundException
+ * @throws FileFormatException
+ * @param type $configFile
+ */
+ public function __construct($configFile)
+ {
+ libxml_use_internal_errors(true);
+ $document = \simplexml_load_file($configFile);
+ foreach (libxml_get_errors() as $error)
+ {
+ if($error->level != LIBXML_ERR_WARNING)
+ {
+ libxml_clear_errors();
+ throw new FileFormatException('An error occured while parsing \''.$configFile.'\': '.$error->message.' on line '.($error->line - 1));
+ }
+ }
+ if(!is_object($document))
+ {
+ throw new FileNotFoundException('Cannot open the file: '.$configFile);
+ }
+
+ if(isset($document->{'file-header'}))
+ {
+ $this->fileHeader = trim((string)$document->{'file-header'}).PHP_EOL;
+ }
+ else
+ {
+ $this->fileHeader = '<?php'.PHP_EOL;
+ }
+ if(isset($document->{'file-footer'}))
+ {
+ $this->fileFooter = PHP_EOL.trim((string)$document->{'file-footer'});
+ }
+
+ if(isset($document->{'export-files'}))
+ {
+ foreach($document->{'export-files'}->{'file'} as $file)
+ {
+ $this->processFileTag($file);
+ }
+ }
+ if(isset($document->separator))
+ {
+ foreach($document->separator as $separatorTag)
+ {
+ $this->processSeparatorTag($separatorTag);
+ }
+ }
+ } // end __construct();
+
+ /**
+ * Processes the <file> tag.
+ *
+ * @internal
+ * @throws FileFormatException
+ * @param SimpleXMLElement $fileTag
+ */
+ protected function processFileTag($fileTag)
+ {
+ if(!isset($fileTag['type']))
+ {
+ throw new FileFormatException('The <file> tag must have the \'type\' attribute.');
+ }
+ $this->files[(string)$fileTag['type']] = (string)$fileTag;
+ } // end processFileTag();
+
+ /**
+ * Processes the <separator> tag and its contents.
+ *
+ * @internal
+ * @throws FileFormatException
+ * @param SimpleXMLElement $separatorTag
+ */
+ protected function processSeparatorTag($separatorTag)
+ {
+ if(!isset($separatorTag['value']))
+ {
+ throw new FileFormatException('The <separator> tag must have the \'value\' attribute.');
+ }
+
+ $separatorValue = (string)$separatorTag['value'];
+ $namespaces = array();
+
+ foreach($separatorTag->{'namespace'} as $namespaceTag)
+ {
+ if(!isset($namespaceTag['name']))
+ {
+ throw new FileFormatException('The <namespace> tag must have the \'name\' attribute.');
+ }
+ $name = (string)$namespaceTag['name'];
+
+ // If the name contains the namespace separator, we cannot use GenericLoader any longer.
+ if(strpos($name, $separatorValue) !== false)
+ {
+ $this->simpleNamespacesOnly = false;
+ }
+
+ $extension = '.php';
+ if(isset($namespaceTag['extension']))
+ {
+ $extension = (string) $namespaceTag['extension'];
+ }
+
+ $path = (string)$namespaceTag;
+
+ $namespaces[$name] = array(
+ 'path' => $path,
+ 'extension' => $extension
+ );
+ }
+
+ $this->separators[$separatorValue] = $namespaces;
+ } // end processSeparatorTag();
+
+ /**
+ * Returns the list of available namespace separators.
+ *
+ * @return string[]
+ */
+ public function getSeparators()
+ {
+ return array_keys($this->separators);
+ } // end getSeparators();
+
+ /**
+ * Returns the namespaces defined for the given namespace separator. Each namespace
+ * is an array consisting of two keys: 'path' and 'extension'.
+ *
+ * @throws OutOfBoundsException
+ * @param string $separator The namespace separator
+ * @return array
+ */
+ public function getSeparatorNamespaces($separator)
+ {
+ if(!isset($this->separators[$separator]))
+ {
+ throw new OutOfBoundsException('The separator \''.$separator.' is not defined.');
+ }
+ return $this->separators[$separator];
+ } // end getSeparatorNamespaces();
+
+ /**
+ * Returns all the files defined by the configuration file. If the optional
+ * argument is set to true, the list does not contain the reserved special file
+ * types.
+ *
+ * @param boolean $filterSpecial Do we skip special file types?
+ * @return string[string]
+ */
+ public function getFiles($filterSpecial = false)
+ {
+ if(!$filterSpecial)
+ {
+ return $this->files;
+ }
+ $result = array();
+ $ignore = array('serialized-class-map', 'chdb-class-map', 'core-dump', 'core-export');
+ foreach($this->files as $name => $file)
+ {
+ if(!in_array($name, $ignore))
+ {
+ $result[$name] = $file;
+ }
+ }
+ return $result;
+ } // end getFiles();
+
+ /**
+ * Returns the file path defined for the given file type.
+ *
+ * @throws OutOfBoundsException If the type is not defined.
+ * @param string $type The type identifier.
+ * @return string
+ */
+ public function getFile($type)
+ {
+ if(!isset($this->files[$type]))
+ {
+ throw new OutOfBoundsException('The file type \''.$type.'\' is not defined.');
+ }
+ return $this->files[$type];
+ } // end getFile();
+
+ /**
+ * Checks if the given file type is defined.
+ *
+ * @param string $type The type identifier.
+ * @return boolean
+ */
+ public function hasFile($type)
+ {
+ return isset($this->files[$type]);
+ } // end hasFile();
+
+ /**
+ * Returns the stub file header with the autoloading code.
+ *
+ * @return string
+ */
+ public function getFileHeader()
+ {
+ return $this->fileHeader;
+ } // end getFileHeader();
+
+ /**
+ * Returns the stub file footer with the autoloading code.
+ *
+ * @return string
+ */
+ public function getFileFooter()
+ {
+ return $this->fileFooter;
+ } // end getFileFooter();
+
+ /**
+ * Returns true, if the configuration file defines simple namespaces only.
+ * A simple namespace does not contain the namespace separator in its name,
+ * so it can be only a top-level namespace. <tt>GenericLoader</tt> does not
+ * support complex namespaces and this is why we need this information.
+ *
+ * @return boolean
+ */
+ public function hasSimpleNamespacesOnly()
+ {
+ return $this->simpleNamespacesOnly;
+ } // end hasSimpleNamespacesOnly();
+} // end Configuration;
View
1 tests/TestSuite/Toolset/AllTests.php
@@ -17,6 +17,7 @@ public static function suite()
$suite->addTestSuite('TestSuite\\Toolset\\AbstractToolTest');
$suite->addTestSuite('TestSuite\\Toolset\\ClassMapBuilderTest');
$suite->addTestSuite('TestSuite\\Toolset\\CoreDumpTest');
+ $suite->addTestSuite('TestSuite\\Toolset\\ConfigurationTest');
return $suite;
} // end suite();
View
150 tests/TestSuite/Toolset/ConfigurationTest.php
@@ -0,0 +1,150 @@
+<?php
+/**
+ * Unit tests for Open Power Autoloader
+ *
+ * @author Tomasz "Zyx" Jędrzejewski
+ * @copyright Copyright (c) 2009-2011 Invenzzia Group
+ * @license http://www.invenzzia.org/license/new-bsd New BSD License
+ */
+namespace TestSuite\Toolset;
+use Opl\Autoloader\Toolset\Configuration;
+
+/**
+ * @covers \Opl\Autoloader\Toolset\Configuration
+ */
+class ConfigurationTest extends \PHPUnit_Framework_TestCase
+{
+ public function testLoadCorrectFile()
+ {
+ $configuration = new Configuration('./data/configs/correctConfig.xml');
+
+ $this->assertEquals('<?php
+/**
+ * The index.php beginning
+ */
+', $configuration->getFileHeader());
+ $this->assertEquals('
+$application = new Application();
+$application->start();', $configuration->getFileFooter());
+ $this->assertEquals(array('\\', '_'), $configuration->getSeparators());
+
+ $this->assertEquals(array(
+ 'serialized-class-map' => './data/classMap.txt',
+ 'chdb-class-map' => './data/classMap.chdb',
+ 'core-dump' => './data/coreDump.txt',
+ 'core-export' => './web/core.php',
+ 'index' => './web/index.php',
+ 'cli' => './cli/cli.php'
+ ), $configuration->getFiles());
+
+ $this->assertEquals(array(
+ 'Opl' => array('path' => './src/Opl', 'extension' => '.php'),
+ 'Symfony' => array('path' => './src/Symfony', 'extension' => '.php'),
+ 'Doctrine\DBAL' => array('path' => './src/DBAL', 'extension' => '.php'),
+ 'Doctrine\ORM' => array('path' => './src/ORM', 'extension' => '.php5'),
+ ), $configuration->getSeparatorNamespaces('\\'));
+ $this->assertEquals(array(
+ 'Zend' => array('path' => './src/Zend', 'extension' => '.php')
+ ), $configuration->getSeparatorNamespaces('_'));
+
+ $this->assertFalse($configuration->hasSimpleNamespacesOnly());
+ } // end testLoadCorrectFile();
+
+ public function testGetFilesCanIgnoreSpecialTypes()
+ {
+ $configuration = new Configuration('./data/configs/correctConfig.xml');
+ $this->assertEquals(array(
+ 'index' => './web/index.php',
+ 'cli' => './cli/cli.php'
+ ), $configuration->getFiles(true));
+ } // end testGetFilesCanIgnoreSpecialTypes();
+
+ /**
+ * @expectedException OutOfBoundsException
+ */
+ public function testGetSeparatorNamespacesThrowsExceptionIfSeparatorIsNotDefined()
+ {
+ $configuration = new Configuration('./data/configs/correctConfig.xml');
+
+ $this->assertEquals('array', gettype($configuration->getSeparatorNamespaces('_')));
+ $configuration->getSeparatorNamespaces('joe');
+ } // end test testGetSeparatorNamespacesThrowsExceptionIfSeparatorIsNotDefined();
+
+ public function testGetFileReturnsTheFileOfTheGivenType()
+ {
+ $configuration = new Configuration('./data/configs/correctConfig.xml');
+ $this->assertEquals('./data/classMap.txt', $configuration->getFile('serialized-class-map'));
+ $this->assertEquals('./web/index.php', $configuration->getFile('index'));
+ } // end testGetFileReturnsTheFileOfTheGivenType();
+
+ /**
+ * @expectedException OutOfBoundsException
+ */
+ public function testGetFileThrowsExceptionIfTypeIsNotDefined()
+ {
+ $configuration = new Configuration('./data/configs/correctConfig.xml');
+ $this->assertTrue($configuration->hasFile('index'));
+ $this->assertEquals('./web/index.php', $configuration->getFile('index'));
+ $this->assertFalse($configuration->hasFile('joe'));
+ $configuration->getFile('joe');
+ } // end testGetFileThrowsExceptionIfTypeIsNotDefined();
+
+ public function testLoadSimpleConfigFile()
+ {
+ $configuration = new Configuration('./data/configs/simpleConfig.xml');
+
+ $this->assertEquals(array(
+ 'Opl' => array('path' => './src/Opl', 'extension' => '.php'),
+ 'Symfony' => array('path' => './src/Symfony', 'extension' => '.php'),
+ 'Doctrine' => array('path' => './src/Doctrine', 'extension' => '.php'),
+ ), $configuration->getSeparatorNamespaces('\\'));
+ $this->assertTrue($configuration->hasSimpleNamespacesOnly());
+ } // end testLoadSimpleConfigFile();
+
+ public function testLoadNoHeadings()
+ {
+ $configuration = new Configuration('./data/configs/noHeadings.xml');
+ $this->assertEquals('<?php'.PHP_EOL, $configuration->getFileHeader());
+ $this->assertEquals(null, $configuration->getFileFooter());
+ } // end testLoadNoHeadings();
+
+ /**
+ * @expectedException Opl\Autoloader\Exception\FileNotFoundException
+ */
+ public function testExceptionIfFileDoesNotExist()
+ {
+ $configuration = new Configuration('./data/configs/doesNotExist.xml');
+ } // end testExceptionIfFileDoesNotExist();
+
+ /**
+ * @expectedException Opl\Autoloader\Exception\FileFormatException
+ */
+ public function testLoadInvalidFile()
+ {
+ $configuration = new Configuration('./data/configs/invalidFile.xml');
+ } // end testLoadInvalidFile();
+
+ /**
+ * @expectedException Opl\Autoloader\Exception\FileFormatException
+ */
+ public function testLoadMissingFileAttribute()
+ {
+ $configuration = new Configuration('./data/configs/missingFileAttribute.xml');
+ } // end testLoadMissingFileAttribute();
+
+ /**
+ * @expectedException Opl\Autoloader\Exception\FileFormatException
+ */
+ public function testLoadMissingNamespaceAttribute()
+ {
+ $configuration = new Configuration('./data/configs/missingNamespaceAttribute.xml');
+ } // end testLoadMissingNamespaceAttribute();
+
+ /**
+ * @expectedException Opl\Autoloader\Exception\FileFormatException
+ */
+ public function testLoadMissingSeparatorAttribute()
+ {
+ $configuration = new Configuration('./data/configs/missingSeparatorAttribute.xml');
+ } // end testLoadMissingSeparatorAttribute();
+} // end ConfigurationTest;
View
12 tests/data/classMap.ini
@@ -1,12 +0,0 @@
-; This is a sample class map definition for the
-; class map autoloader.
-
-[config]
-; Where the map should be stored
-outputFile = "./data/classMap.txt"
-
-; The recognized file extension
-extension = ".php"
-
-[namespaces]
-Dummy = "./data/"
View
2 tests/data/classMap.txt
@@ -1 +1 @@
-a:6:{s:29:"Dummy\DifferentNamespaceStyle";a:2:{i:0;s:5:"Dummy";i:1;s:33:"Dummy/DifferentNamespaceStyle.php";}s:32:"Dummy\Subdirectory\SubdirSupport";a:2:{i:0;s:5:"Dummy";i:1;s:36:"Dummy/Subdirectory/SubdirSupport.php";}s:30:"Dummy_Subdirectory_NoNamespace";a:2:{i:0;s:5:"Dummy";i:1;s:34:"Dummy/Subdirectory/NoNamespace.php";}s:15:"Dummy\ShortFile";a:2:{i:0;s:5:"Dummy";i:1;s:19:"Dummy/ShortFile.php";}s:21:"Dummy\AnotherLongFile";a:2:{i:0;s:5:"Dummy";i:1;s:25:"Dummy/AnotherLongFile.php";}s:14:"Dummy\LongFile";a:2:{i:0;s:5:"Dummy";i:1;s:18:"Dummy/LongFile.php";}}
+a:6:{s:14:"Dummy\LongFile";a:2:{i:0;s:5:"Dummy";i:1;s:18:"Dummy/LongFile.php";}s:32:"Dummy\Subdirectory\SubdirSupport";a:2:{i:0;s:5:"Dummy";i:1;s:36:"Dummy/Subdirectory/SubdirSupport.php";}s:30:"Dummy_Subdirectory_NoNamespace";a:2:{i:0;s:5:"Dummy";i:1;s:34:"Dummy/Subdirectory/NoNamespace.php";}s:15:"Dummy\ShortFile";a:2:{i:0;s:5:"Dummy";i:1;s:19:"Dummy/ShortFile.php";}s:29:"Dummy\DifferentNamespaceStyle";a:2:{i:0;s:5:"Dummy";i:1;s:33:"Dummy/DifferentNamespaceStyle.php";}s:21:"Dummy\AnotherLongFile";a:2:{i:0;s:5:"Dummy";i:1;s:25:"Dummy/AnotherLongFile.php";}}
View
13 tests/data/config.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<autoload>
+ <export-files>
+ <file type="serialized-class-map">./classMap.txt</file>
+ <file type="chdb-class-map">./classMap.chdb</file>
+ <file type="core-dump">./coreDump.txt</file>
+ <file type="core-export">./core.php</file>
+ </export-files>
+
+ <separator value="\">
+ <namespace name="Dummy">./</namespace>
+ </separator>
+</autoload>
View
34 tests/data/configs/correctConfig.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<autoload>
+ <file-header><![CDATA[
+<?php
+/**
+ * The index.php beginning
+ */
+]]></file-header>
+ <file-footer><![CDATA[
+$application = new Application();
+$application->start();
+ ]]></file-footer>
+
+ <export-files>
+ <file type="serialized-class-map">./data/classMap.txt</file>
+ <file type="chdb-class-map">./data/classMap.chdb</file>
+ <file type="core-dump">./data/coreDump.txt</file>
+ <file type="core-export">./web/core.php</file>
+
+ <file type="index">./web/index.php</file>
+ <file type="cli">./cli/cli.php</file>
+ </export-files>
+
+ <separator value="\">
+ <namespace name="Opl">./src/Opl</namespace>
+ <namespace name="Symfony" extension=".php">./src/Symfony</namespace>
+ <namespace name="Doctrine\DBAL">./src/DBAL</namespace>
+ <namespace name="Doctrine\ORM" extension=".php5">./src/ORM</namespace>
+ </separator>
+
+ <separator value="_">
+ <namespace name="Zend">./src/Zend</namespace>
+ </separator>
+</autoload>
View
5 tests/data/configs/invalidFile.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<autoload>
+ <!-- do not even try to "fix" this file... -->
+ <file-header>
+</autoload>
View
6 tests/data/configs/missingFileAttribute.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<autoload>
+ <export-files>
+ <file>./data/classMap.txt</file>
+ </export-files>
+</autoload>
View
19 tests/data/configs/missingNamespaceAttribute.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<autoload>
+ <export-files>
+ <file type="serialized-class-map">./data/classMap.txt</file>
+ <file type="chdb-class-map">./data/classMap.chdb</file>
+ <file type="core-dump">./data/coreDump.txt</file>
+ <file type="core-export">./web/core.php</file>
+
+ <file type="index">./web/index.php</file>
+ <file type="cli">./cli/cli.php</file>
+ </export-files>
+
+ <separator value="\">
+ <namespace>./src/Opl</namespace>
+ <namespace name="Symfony" extension=".php">./src/Symfony</namespace>
+ <namespace name="Doctrine\DBAL">./src/DBAL</namespace>
+ <namespace name="Doctrine\ORM" extension=".php5">./src/ORM</namespace>
+ </separator>
+</autoload>
View
19 tests/data/configs/missingSeparatorAttribute.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<autoload>
+ <export-files>
+ <file type="serialized-class-map">./data/classMap.txt</file>
+ <file type="chdb-class-map">./data/classMap.chdb</file>
+ <file type="core-dump">./data/coreDump.txt</file>
+ <file type="core-export">./web/core.php</file>
+
+ <file type="index">./web/index.php</file>
+ <file type="cli">./cli/cli.php</file>
+ </export-files>
+
+ <separator>
+ <namespace name="Opl">./src/Opl</namespace>
+ <namespace name="Symfony" extension=".php">./src/Symfony</namespace>
+ <namespace name="Doctrine\DBAL">./src/DBAL</namespace>
+ <namespace name="Doctrine\ORM" extension=".php5">./src/ORM</namespace>
+ </separator>
+</autoload>
View
19 tests/data/configs/noHeadings.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<autoload>
+ <export-files>
+ <file type="serialized-class-map">./data/classMap.txt</file>
+ <file type="chdb-class-map">./data/classMap.chdb</file>
+ <file type="core-dump">./data/coreDump.txt</file>
+ <file type="core-export">./web/core.php</file>
+
+ <file type="index">./web/index.php</file>
+ <file type="cli">./cli/cli.php</file>
+ </export-files>
+
+ <separator value="\">
+ <namespace name="Opl">./src/Opl</namespace>
+ <namespace name="Symfony" extension=".php">./src/Symfony</namespace>
+ <namespace name="Doctrine\DBAL">./src/DBAL</namespace>
+ <namespace name="Doctrine\ORM" extension=".php5">./src/ORM</namespace>
+ </separator>
+</autoload>
View
33 tests/data/configs/simpleConfig.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<autoload>
+ <file-header><![CDATA[
+<?php
+/**
+ * The index.php beginning
+ */
+]]></file-header>
+ <file-footer><![CDATA[
+$application = new Application();
+$application->start();
+ ]]></file-footer>
+
+ <export-files>
+ <file type="serialized-class-map">./data/classMap.txt</file>
+ <file type="chdb-class-map">./data/classMap.chdb</file>
+ <file type="core-dump">./data/coreDump.txt</file>
+ <file type="core-export">./web/core.php</file>
+
+ <file type="index">./web/index.php</file>
+ <file type="cli">./cli/cli.php</file>
+ </export-files>
+
+ <separator value="\">
+ <namespace name="Opl">./src/Opl</namespace>
+ <namespace name="Symfony">./src/Symfony</namespace>
+ <namespace name="Doctrine">./src/Doctrine</namespace>
+ </separator>
+
+ <separator value="_">
+ <namespace name="Zend">./src/Zend</namespace>
+ </separator>
+</autoload>

0 comments on commit e9a8dfe

Please sign in to comment.
Something went wrong with that request. Please try again.