#!/usr/bin/env php
<?php
if (strpos('@php_dir@', '@php_dir') === 0) {
    set_include_path(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'lib' . PATH_SEPARATOR . get_include_path());
}

/* We are heavily relying on the PEAR libraries which are not clean with regard
 * to E_STRICT. */
if (defined('E_DEPRECATED')) {
    error_reporting(E_ALL & ~E_STRICT & ~E_DEPRECATED);
} else {
    error_reporting(E_ALL & ~E_STRICT);
}
// horde-components standalone run in composer setups
$autoloaders = [
    __DIR__ . '/../config/autoload.php', // custom autoload config
    __DIR__ . '/../vendor/autoload.php', // components is root app
    __DIR__ . '/../../../vendor/autoload.php', // components is installed in a horde-deployment
    // handle "git developer install" and pear cases
    'Horde/Autoloader/Default.php'
];

foreach ($autoloaders as $autoloader) {
    if (file_exists($autoloader)) {
        require_once $autoloader;
        break;
    }
}
// in case of calling components via git-tools, this file plays no role
Horde\Components\Components::main();
