Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 62 lines (55 sloc) 2.081 kb
14af5e5 Vítor Brandão Add Tests\SmartyEngineTest
noisebleed authored
1 <?php
2 /**
3 * This file is part of NoiseLabs-SmartyBundle
4 *
5 * NoiseLabs-SmartyBundle is free software; you can redistribute it
6 * and/or modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 3 of the License, or (at your option) any later version.
9 *
10 * NoiseLabs-SmartyBundle is distributed in the hope that it will be
11 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with NoiseLabs-SmartyBundle; if not, see
17 * <http://www.gnu.org/licenses/>.
18 *
19 * Copyright (C) 2011 Vítor Brandão
20 *
21 * @category NoiseLabs
22 * @package SmartyBundle
23 * @author Vítor Brandão <noisebleed@noiselabs.org>
24 * @copyright (C) 2011 Vítor Brandão <noisebleed@noiselabs.org>
25 * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL-3
26 * @link http://www.noiselabs.org
27 * @since 0.1.0
28 */
29
30 $vendorDir = $_SERVER['SMARTYBUNDLE_TEST_VENDOR_DIR'];
31 require_once $vendorDir.'/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
32
33 use Symfony\Component\ClassLoader\UniversalClassLoader;
34
35 $loader = new UniversalClassLoader();
36 $loader->registerNamespaces(array(
37 'Symfony' => array($vendorDir.'/symfony/src', $vendorDir.'/bundles'),
38 'Monolog' => $vendorDir.'/monolog/src',
39 ));
40 $loader->registerPrefixes(array(
41 'Smarty_' => $vendorDir.'/smarty/libs',
42 ));
43 $loader->register();
44
45 spl_autoload_register(function($class) {
46 if (0 === strpos($class, 'NoiseLabs\\Bundle\\SmartyBundle\\')) {
47 $path = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 3)).'.php';
48 if (!stream_resolve_include_path($path)) {
49 return false;
50 }
51 require_once $path;
52 return true;
53 }
54 });
55
56 ini_set('include_path',
57 $vendorDir.'/smarty/libs'.
58 PATH_SEPARATOR.$vendorDir.
59 ini_get('include_path'));
60
61 require_once 'Smarty.class.php';
Something went wrong with that request. Please try again.