Skip to content

Instantly share code, notes, and snippets.

@stof
Created July 10, 2012 23:11
Show Gist options
  • Save stof/3086842 to your computer and use it in GitHub Desktop.
Save stof/3086842 to your computer and use it in GitHub Desktop.
suggestion to use the composer autoloader for PPI
<?php
/**
* @author Paul Dragoonis <[email protected]>
* @license http://opensource.org/licenses/mit-license.php MIT
* @package PPI
* @link www.ppi.io
*/
defined('PPI_VERSION') || define('PPI_VERSION', '2.0');
defined('DS') || define('DS', DIRECTORY_SEPARATOR);
defined('PPI_PATH') || define('PPI_PATH', realpath(__DIR__) . '/');
defined('PPI_VENDOR_PATH') || define('PPI_VENDOR_PATH', dirname(PPI_PATH) . '/vendor/');
$composerPath = PPI_PATH . '/vendor/autoload.php';
if (!file_exists($composerPath)) {
die('Unable to find composer generated file at: ' . $composerPath);
}
// Composer generated file include
$loader = require 'vendor/autoload.php';
// Adding PPI autoloader so modules may add themself to the autoload process on-the-fly
PPI\Autoload::config(array(
'loader' => $loader,
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment