From 72f58bc6f5a7c73cac7590483b4deabe0dc0f8f4 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Tue, 30 May 2017 13:01:53 +0200 Subject: [PATCH] [CLEANUP] Move files out of the project root The project root directory should only contain files that are required to be on the root level, and directories. --- .travis.yml | 3 +-- config.ini.dist => Configuration/config.ini.dist | 0 .../phpunit.example.xml | 0 phplist db.mwb => Database/phplist db.mwb | Bin structure.md => Documentation/structure.md | 0 index.php => Public/index.php | 6 +++--- core/tests/PassTest.php | 2 +- 7 files changed, 5 insertions(+), 6 deletions(-) rename config.ini.dist => Configuration/config.ini.dist (100%) rename phpunit.example.xml => Configuration/phpunit.example.xml (100%) rename phplist db.mwb => Database/phplist db.mwb (100%) rename structure.md => Documentation/structure.md (100%) rename index.php => Public/index.php (87%) diff --git a/.travis.yml b/.travis.yml index 9c00b54a..681a81de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,6 @@ install: script: # Run PHP lint on all PHP files. - - find core/ -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l - - php -l index.php + - find core/ Public/ -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l # Run the unit tests. - vendor/bin/phpunit core/tests/ diff --git a/config.ini.dist b/Configuration/config.ini.dist similarity index 100% rename from config.ini.dist rename to Configuration/config.ini.dist diff --git a/phpunit.example.xml b/Configuration/phpunit.example.xml similarity index 100% rename from phpunit.example.xml rename to Configuration/phpunit.example.xml diff --git a/phplist db.mwb b/Database/phplist db.mwb similarity index 100% rename from phplist db.mwb rename to Database/phplist db.mwb diff --git a/structure.md b/Documentation/structure.md similarity index 100% rename from structure.md rename to Documentation/structure.md diff --git a/index.php b/Public/index.php similarity index 87% rename from index.php rename to Public/index.php index 1ef572d8..43a622a3 100644 --- a/index.php +++ b/Public/index.php @@ -3,14 +3,14 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; -require_once 'vendor/autoload.php'; +require_once __DIR__ . '/../vendor/autoload.php'; // Create Symfony DI service container object for use by other classes $container = new ContainerBuilder(); // Create new Symfony file loader to handle the YAML service config file $loader = new YamlFileLoader($container, new FileLocator(__DIR__)); // Load the service config file, which is in YAML format -$loader->load('core/services.yml'); +$loader->load(__DIR__ . '/../core/services.yml'); //Handle some dynamicly generated include files if (isset($_SERVER['ConfigFile']) && is_file($_SERVER['ConfigFile'])) { @@ -18,7 +18,7 @@ } elseif (isset($cline['c']) && is_file($cline['c'])) { $configfile = $cline['c']; } else { - $configfile = __DIR__ . '/config.ini'; + $configfile = __DIR__ . '/../config.ini'; } // Set service parameters for the configuration file diff --git a/core/tests/PassTest.php b/core/tests/PassTest.php index 649d07b4..975578c5 100644 --- a/core/tests/PassTest.php +++ b/core/tests/PassTest.php @@ -16,7 +16,7 @@ public function setUp() $loader = new YamlFileLoader($this->container, new FileLocator(__DIR__)); // Load the service config file, which is in YAML format $loader->load('../services.yml'); - $this->container->setParameter('config.configfile', __DIR__ . '/../../config.ini.dist'); + $this->container->setParameter('config.configfile', __DIR__ . '/../../Configuration/config.ini.dist'); // Get objects from container $this->pass = $this->container->get('Pass'); // Set default pwd for testing