Skip to content

Commit 624c7ea

Browse files
committed
Added Composer, changed the autoloader to use Composer's instead, and installed Twig using Composer instead of directly
1 parent 449de25 commit 624c7ea

File tree

640 files changed

+1017
-182
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

640 files changed

+1017
-182
lines changed

composer.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"require": {
3+
"twig/twig": "~1.0"
4+
},
5+
"autoload": {
6+
"psr-4": {
7+
"Core\\": "Core/",
8+
"App\\": "App/"
9+
}
10+
}
11+
}

composer.lock

Lines changed: 80 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/index.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,15 @@
77
*/
88

99
/**
10-
* Twig
10+
* Composer
1111
*/
12-
require_once dirname(__DIR__) . '/vendor/Twig/lib/Twig/Autoloader.php';
13-
Twig_Autoloader::register();
12+
require '../vendor/autoload.php';
1413

1514

1615
/**
17-
* Autoloader
16+
* Twig
1817
*/
19-
spl_autoload_register(function ($class) {
20-
$root = dirname(__DIR__); // get the parent directory
21-
$file = $root . '/' . str_replace('\\', '/', $class) . '.php';
22-
if (is_readable($file)) {
23-
require $root . '/' . str_replace('\\', '/', $class) . '.php';
24-
}
25-
});
18+
Twig_Autoloader::register();
2619

2720

2821
/**

vendor/autoload.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
// autoload.php @generated by Composer
4+
5+
require_once __DIR__ . '/composer' . '/autoload_real.php';
6+
7+
return ComposerAutoloaderInit7c0baa335460178fecca298af007aa1c::getLoader();

0 commit comments

Comments
 (0)