Skip to content

Commit

Permalink
Updated autoloading
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanmaron committed Nov 3, 2010
1 parent 8617622 commit 1f244fb
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions demos/Zend/Service/LiveDocx/Bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
<?php

// Set used namespaces
use Zend\Loader\Autoloader;
use Zend\Locale\Locale;
use Zend\Registry;
use Zend\Service\LiveDocx\Helper;

// Turn up error reporting
error_reporting(E_ALL | E_STRICT);

// Set path to libraries
set_include_path(
__DIR__ . DIRECTORY_SEPARATOR . 'library' . PATH_SEPARATOR .
dirname(dirname(dirname(dirname(__DIR__)))) . DIRECTORY_SEPARATOR . 'library'
);
// Set up autoloader
$base = dirname(dirname(dirname(dirname(__DIR__))));
require_once "{$base}/library/Zend/Loader/StandardAutoloader.php";
$loader = new \Zend\Loader\StandardAutoloader();
$loader->registerNamespace('Zend', "{$base}/library/Zend");
$loader->register();

// Set autoloader to autoload libraries
require_once 'Zend/Loader/Autoloader.php';
Autoloader::getInstance();
// Include utility class
require_once "{$base}/demos/Zend/Service/LiveDocx/library/Zend/Service/LiveDocx/Helper.php";

// Set default locale
Locale::setDefault(Helper::LOCALE);
Expand All @@ -29,3 +28,5 @@
Helper::printLine(Helper::credentialsHowTo());
exit();
}

unset($base);

0 comments on commit 1f244fb

Please sign in to comment.