Пример #1
0
 /**
  * Register application namespaces
  * @return void
  */
 public static function registerNamespaces()
 {
     $classLoader = new \Symfony\Component\ClassLoader\UniversalClassLoader();
     $classLoader->registerNamespaces(array('Gedmo' => ROOT_PATH . '/vendor/doctrine-extension/lib', 'Symfony' => ROOT_PATH . '/vendor/symfony/src', 'Statme' => ROOT_PATH . '/src', 'Doctrine\\Common' => ROOT_PATH . '/vendor/doctrine-common/lib', 'Doctrine\\DBAL' => ROOT_PATH . '/vendor/doctrine-dbal/lib', 'Doctrine' => ROOT_PATH . '/vendor/doctrine-orm/lib'));
     $classLoader->register();
     return;
 }
 /**
  * @see sfPluginConfiguration
  */
 public function initialize()
 {
     // Include the Altumo loader.
     //require_once( dirname(__FILE__) . '/../lib/vendor/altumo/source/php/loader.php' );
     //set default timezone
     date_default_timezone_set('America/Los_Angeles');
     //symfony 2 autoloader (for classes with namespaces only)
     $altumo_php_source_path = __DIR__ . '/../lib/vendor/altumo/source/php';
     require_once $altumo_php_source_path . '/Utils/UniversalClassLoader.php';
     $loader = new Symfony\Component\ClassLoader\UniversalClassLoader();
     $loader->registerNamespaces(array('sfAltumoPlugin' => __DIR__ . '/../lib', 'Altumo' => $altumo_php_source_path));
     $loader->register();
     // Add altumo paths to sfConfig
     sfConfig::set('altumo_plugin_dir', realpath(dirname(__FILE__) . '/../'));
     sfConfig::set('altumo_javascript_lib_dir', sfConfig::get('altumo_plugin_dir') . '/lib/vendor/altumo/lib/javascript');
     sfConfig::set('altumo_javascript_src_dir', sfConfig::get('altumo_plugin_dir') . '/lib/vendor/altumo/source/javascript');
     /**
      * If the AWS module is enabled, set credentials for sdk
      * 
      * To enable, add a section to settings.yml, like so:
      *   sfAltumoPlugin:
      *      aws:
      *        enable: true
      *        key: "MY_AWS_KE_HERE"
      *        secret: "MY_AWS_SECRET_HERE" 
      */
     $aws_configuration = sfConfig::get('sf_sfAltumoPlugin_aws', array('enable' => false));
     if ($aws_configuration['enable']) {
         CFCredentials::set(array('default' => array('key' => $aws_configuration['key'], 'secret' => $aws_configuration['secret'], 'default_cache_config' => '', 'certificate_authority' => false), '@default' => 'default'));
     }
     // Add altumo Api Settings (Add this in your api app's config)
     //sfConfig::set( 'altumo_api_session_cookie_name',  'api_session' );
     /**
      * Execute any commands that the plugin needs when the framework loads, but
      * before an action is executed.
      * 
      * Note: this is here because it was used before to load JS and CSS, but
      * that was relocated to Frontend\Controller
      */
     /*
     $this->dispatcher->connect(
         'context.load_factories', 
         function(){
             
             // this code gets execute when the framework loads.
             
         }
     );
     */
 }
Пример #3
0
 }
 define('PEAR_ROOT_PATH', $root);
 $composerLoaderWhenInstalled = __DIR__ . '/../../../autoload.php';
 $composerLoaderWhenCloned = __DIR__ . '/../vendor/autoload.php';
 if (file_exists($composerLoaderWhenInstalled)) {
     $loader = (require_once $composerLoaderWhenInstalled);
 } else {
     if (file_exists($composerLoaderWhenCloned)) {
         $loader = (require_once $composerLoaderWhenCloned);
     } else {
         $classLoader = $root . '/symfony-class-loader/Symfony/Component/ClassLoader/UniversalClassLoader.php';
         //fallback mode, if no composer installed, try to use symfony components in src
         if (file_exists($classLoader)) {
             require_once $classLoader;
             $loader = new \Symfony\Component\ClassLoader\UniversalClassLoader();
             $loader->registerNamespaces(array('Symfony' => array($root . '/symfony-class-loader', $root . '/symfony-finder')));
             $loader->register();
         } else {
             echo "Can't find ComposerLoader.\n";
             echo "try:\n";
             echo "\tphp composer.phar update";
             exit;
         }
     }
 }
 if ($loader) {
     $prefixes = $loader->getPrefixes();
     // some old components do not use autoloader and includes symfony components directly - add them to include path
     foreach (array('Symfony', 'Symfony\\Component\\Finder') as $key) {
         if (isset($prefixes[$key])) {
             foreach ($prefixes[$key] as $path) {
Пример #4
0
if (!class_exists('PHPUnit_Framework_TestCase') || version_compare(PHPUnit_Runner_Version::id(), '3.5') < 0) {
    die('PHPUnit framework is required, at least 3.5 version');
}
if (!class_exists('PHPUnit_Framework_MockObject_MockBuilder')) {
    die('PHPUnit MockObject plugin is required, at least 1.0.8 version');
}
define('TESTS_PATH', __DIR__);
define('VENDOR_PATH', realpath(__DIR__ . '/../vendor'));
$classLoaderFile = VENDOR_PATH . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
if (!file_exists($classLoaderFile)) {
    die('cannot find vendor, run: php bin/vendors.php');
}
require_once $classLoaderFile;
$loader = new Symfony\Component\ClassLoader\UniversalClassLoader();
$loader->registerNamespaces(array('Symfony' => VENDOR_PATH, 'Doctrine\\Common' => VENDOR_PATH . '/doctrine-common/lib', 'Doctrine\\Common\\DataFixtures' => VENDOR_PATH . '/doctrine-data-fixtures/lib', 'Doctrine\\DBAL' => VENDOR_PATH . '/doctrine-dbal/lib', 'Doctrine\\ORM' => VENDOR_PATH . '/doctrine-orm/lib', 'Mockery' => VENDOR_PATH . '/Mockery/library', 'Khepin' => __DIR__));
$loader->registerPrefixes(array('Mockery' => VENDOR_PATH . '/Mockery/library'));
$loader->register();
spl_autoload_register(function ($class) {
    if (0 === strpos($class, 'Khepin\\YamlFixturesBundle\\')) {
        $path = __DIR__ . '/../' . implode('/', array_slice(explode('\\', $class), 2)) . '.php';
        if (!stream_resolve_include_path($path)) {
            return false;
        }
        require_once $path;
        return true;
    }
});
Doctrine\Common\Annotations\AnnotationRegistry::registerFile(VENDOR_PATH . '/doctrine-orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
$reader = new \Doctrine\Common\Annotations\AnnotationReader();
$reader = new \Doctrine\Common\Annotations\CachedReader($reader, new \Doctrine\Common\Cache\ArrayCache());
Пример #5
0
<?php

/**
 * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 * http://aws.amazon.com/apache2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */
Phar::mapPhar('aws.phar');
define('AWS_PHAR', true);
require_once 'phar://aws.phar/vendor/symfony/class-loader/Symfony/Component/ClassLoader/UniversalClassLoader.php';
$classLoader = new Symfony\Component\ClassLoader\UniversalClassLoader();
$classLoader->registerNamespaces(array('Aws' => 'phar://aws.phar/src', 'Guzzle' => 'phar://aws.phar/vendor/guzzle/guzzle/src', 'Symfony\\Component\\EventDispatcher' => 'phar://aws.phar/vendor/symfony/event-dispatcher', 'Doctrine' => 'phar://aws.phar/vendor/doctrine/common/lib', 'Monolog' => 'phar://aws.phar/vendor/monolog/monolog/src'));
$classLoader->register();
return $classLoader;
__halt_compiler();
Пример #6
0
<?php

/**
 * This is bootstrap for phpUnit unit tests,
 * use README.md for more details
 *
 * @author Gediminas Morkevicius <*****@*****.**>
 * @package Gedmo.Tests
 * @link http://www.gediminasm.org
 * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
if (!class_exists('PHPUnit_Framework_TestCase') || version_compare(PHPUnit_Runner_Version::id(), '3.5') < 0) {
    die('PHPUnit framework is required, at least 3.5 version');
}
if (!class_exists('PHPUnit_Framework_MockObject_MockBuilder')) {
    die('PHPUnit MockObject plugin is required, at least 1.0.8 version');
}
define('TESTS_PATH', __DIR__);
define('TESTS_TEMP_DIR', __DIR__ . '/temp');
define('VENDOR_PATH', realpath(__DIR__ . '/../vendor'));
$classLoaderFile = VENDOR_PATH . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
if (!file_exists($classLoaderFile)) {
    die('cannot find vendor, run: php bin/vendors.php');
}
require_once $classLoaderFile;
$loader = new Symfony\Component\ClassLoader\UniversalClassLoader();
$loader->registerNamespaces(array('Symfony' => VENDOR_PATH, 'Doctrine\\MongoDB' => VENDOR_PATH . '/doctrine-mongodb/lib', 'Doctrine\\ODM\\MongoDB' => VENDOR_PATH . '/doctrine-mongodb-odm/lib', 'Doctrine\\Common' => VENDOR_PATH . '/doctrine-common/lib', 'Doctrine\\DBAL' => VENDOR_PATH . '/doctrine-dbal/lib', 'Doctrine\\ORM' => VENDOR_PATH . '/doctrine-orm/lib', 'Gedmo\\Mapping\\Mock' => __DIR__, 'Gedmo' => __DIR__ . '/../lib', 'Tool' => __DIR__ . '/Gedmo', 'Translator\\Fixture' => __DIR__ . '/Gedmo', 'Translatable\\Fixture' => __DIR__ . '/Gedmo', 'Timestampable\\Fixture' => __DIR__ . '/Gedmo', 'Tree\\Fixture' => __DIR__ . '/Gedmo', 'Sluggable\\Fixture' => __DIR__ . '/Gedmo', 'Sortable\\Fixture' => __DIR__ . '/Gedmo', 'Mapping\\Fixture' => __DIR__ . '/Gedmo', 'Loggable\\Fixture' => __DIR__ . '/Gedmo', 'Wrapper\\Fixture' => __DIR__ . '/Gedmo'));
$loader->register();
Gedmo\Version::checkODMMongoDBDependencies();
Gedmo\Version::checkORMDependencies();
<?php
//set up constants
foreach ( array(
    'LIBRARY_PATH'     => realpath(dirname(__FILE__) . '/src'),
    'AUTOLOADER_PATH'  => realpath(dirname(__FILE__) . '/src/Symfony/Component/ClassLoader/UniversalClassLoader.php'),
    'APPLICATION_ENV'  => getenv('APPLICATION_ENV') ?: 'production',
    'APPLICATION_PATH' => realpath(dirname(__FILE__))
) as $key => $val) { defined($key) || define($key, $val); }

//create the include path
set_include_path(implode(PATH_SEPARATOR, array(LIBRARY_PATH, APPLICATION_PATH)));

//load autoloader
require_once AUTOLOADER_PATH;

$loader = new Symfony\Component\ClassLoader\UniversalClassLoader();

$loader->registerNamespaces(array(
    'Compredux' => LIBRARY_PATH,
    'Zend'      => LIBRARY_PATH,
));
$loader->register();
Пример #8
0
<?php

/*
 * @package    klout-sdk-php
 * @author     Mike Tougeron <*****@*****.**>
 * @copyright  Copyright (c) 2013 Mike Tougeron <*****@*****.**>
 * @license    http://opensource.org/licenses/MIT
 * @link       https://github.com/mtougeron/klout-sdk-php
 */
require_once __DIR__ . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
if (!defined('KLOUT_FILE_PREFIX')) {
    define('KLOUT_FILE_PREFIX', __DIR__);
}
$classLoader = new Symfony\Component\ClassLoader\UniversalClassLoader();
$classLoader->registerNamespaces(array('Klout' => KLOUT_FILE_PREFIX, 'Guzzle' => KLOUT_FILE_PREFIX, 'Symfony' => KLOUT_FILE_PREFIX, 'Zend' => KLOUT_FILE_PREFIX));
$classLoader->register();
return $classLoader;
<?php

/*
 * This file is part of the Doctrine Extensions Taggable package.
 * (c) 2011 Fabien Pennequin <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
if (!class_exists('Symfony\\Component\\ClassLoader\\UniversalClassLoader')) {
    require __DIR__ . '/vendor/Symfony/Component/ClassLoader/UniversalClassLoader.php';
}
$loader = new Symfony\Component\ClassLoader\UniversalClassLoader();
$loader->registerNamespaces(array('Doctrine\\Common' => __DIR__ . '/vendor/doctrine/common/lib', 'Doctrine\\DBAL' => __DIR__ . '/vendor/doctrine/dbal/lib', 'Doctrine\\ORM' => __DIR__ . '/vendor/doctrine/orm/lib', 'DoctrineExtensions\\Taggable' => __DIR__ . '/lib'));
$loader->register();
Пример #10
0
<?php

require_once "model.php";
require_once "controllers.php";
require_once "../vendor/symfony/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php";
require_once "Pagination/Manager.php";
require_once "Pagination/Helper.php";
$loader = new Symfony\Component\ClassLoader\UniversalClassLoader();
$loader->registerNamespaces(array('Symfony' => __DIR__ . '/../../vendor/symfony/symfony/src'));
$loader->register();
Пример #11
0
<?php

Phar::mapPhar();
$base = 'phar://' . __FILE__ . '/';
require_once $base . 'Symfony/Component/ClassLoader/UniversalClassLoader.php';
$classLoader = new Symfony\Component\ClassLoader\UniversalClassLoader();
$classLoader->registerNamespaces(array('Douglas' => $base));
$classLoader->register();
__halt_compiler();
Пример #12
0
}

if (!class_exists('PHPUnit_Framework_MockObject_MockBuilder')) {
    die('PHPUnit MockObject plugin is required, at least 1.0.8 version');
}

define('TESTS_PATH', __DIR__);
define('TESTS_TEMP_DIR', __DIR__.'/temp');
define('VENDOR_PATH', realpath(__DIR__ . '/../vendor'));

$classLoaderFile = VENDOR_PATH . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
if (!file_exists($classLoaderFile)) {
    die('cannot find vendor, run: php bin/vendors.php');
}
require_once $classLoaderFile;
$loader = new Symfony\Component\ClassLoader\UniversalClassLoader;
$loader->registerNamespaces(array(
    'Symfony'                    => VENDOR_PATH,
    'Doctrine\\MongoDB'          => VENDOR_PATH.'/doctrine-mongodb/lib',
    'Doctrine\\ODM\\MongoDB'     => VENDOR_PATH.'/doctrine-mongodb-odm/lib',
    'Doctrine\\Common'           => VENDOR_PATH.'/doctrine-common/lib',
    'Doctrine\\DBAL'             => VENDOR_PATH.'/doctrine-dbal/lib',
    'Doctrine\\ORM'              => VENDOR_PATH.'/doctrine-orm/lib',
    'Nacmartin\\Mapping\\Mock'       => __DIR__,
    'Nacmartin'                      => __DIR__.'/../lib',
    'Tool'                       => __DIR__.'/Nacmartin',
    // fixture namespaces
    'Historyable\\Fixture'      => __DIR__.'/Nacmartin',
));
$loader->register();
Пример #13
0
<?php

if (!class_exists('BackWPup', false)) {
    die;
}
if (!class_exists('Symfony\\Component\\ClassLoader\\UniversalClassLoader')) {
    include_once __DIR__ . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
}
$classLoader = new Symfony\Component\ClassLoader\UniversalClassLoader();
$classLoader->registerNamespaces(array('Aws\\Common' => __DIR__, 'Aws\\S3' => __DIR__, 'Guzzle' => __DIR__, 'Symfony\\Component\\EventDispatcher' => __DIR__, 'WindowsAzure' => __DIR__, 'OpenCloud' => __DIR__));
$classLoader->register();
// http://www.pear.com/ for WindowsAzure
if (!class_exists('HTTP_Request2')) {
    set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ . '/PEAR/');
}
Пример #14
0
<?php

// Search for an autoloader
if (file_exists($file = __DIR__ . '/../../autoload.php')) {
    // Composer standarmt location
    $loader = (require_once $file);
    $loader->add('Liip\\RMT\\Tests', __DIR__ . '/test');
    $loader->add('Liip', __DIR__ . '/src');
} elseif (file_exists($file = __DIR__ . '/vendor/autoload.php')) {
    // Composer when on RMT standalone install (used in travis.ci)
    $loader = (require_once $file);
    $loader->add('Liip\\RMT\\Tests', __DIR__ . '/test');
    $loader->add('Liip', __DIR__ . '/src');
} elseif (file_exists($file = __DIR__ . '/../symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php')) {
    // Symfony 2.0
    require_once $file;
    $loader = new \Symfony\Component\ClassLoader\UniversalClassLoader();
    $loader->registerNamespaces(array('Liip' => array(__DIR__ . '/src', __DIR__ . '/test'), 'Symfony' => __DIR__ . '/../symfony/src'));
    $loader->register();
} else {
    throw new \Exception("Unable to find the an autoloader");
}
Пример #15
0
<?php

if ($_ENV["SYMFONY_PATH"]) {
    $symfonyPath = $_ENV["SYMFONY_PATH"];
} else {
    $symfonyPath = __DIR__ . '/../lib';
}
require_once $symfonyPath . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
$loader = new \Symfony\Component\ClassLoader\UniversalClassLoader();
$loader->registerNamespaces(array('Symfony' => $symfonyPath, 'Goetas\\DoctrineToXsd' => __DIR__ . '/../lib'));
$loader->register();
\Goetas\DoctrineToXsd\Console\ConsoleRunner::run();
Пример #16
0
    only loading the exact files which are required. And to be honest I may as well 
    be loading the individual components with require rather than this messyness with 
    the autoloader, however i want to make sure that if symfony component dependencies change, 
    then I will be saved by the namespaces rather than loading explicit class files
*/

//bootstrap application
//include ($_SERVER['KERNEL_DIR'].'/bootstrap.php.cache');

//load autoloader
require_once $_SERVER['KERNEL_DIR'].'/../vendor/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';

$loader = new Symfony\Component\ClassLoader\UniversalClassLoader();

$loader->registerNamespaces(array(
    'Symfony' => array($_SERVER['KERNEL_DIR'].'/../vendor/symfony/src'),
));
$loader->register();


use Symfony\Component\Finder\Finder;

$posters = array();
$location = __DIR__.'/error';

if (isset($_GET['code']) && is_dir(__DIR__.'/'.$_GET['code'])) {
    $location = __DIR__.'/'.$_GET['code'];
}

$files = new Finder();
$files->files()->in($location);
Пример #17
0
<?php

/**
 * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 * http://aws.amazon.com/apache2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */
require_once __DIR__ . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
if (!defined('AWS_FILE_PREFIX')) {
    define('AWS_FILE_PREFIX', __DIR__);
}
$classLoader = new Symfony\Component\ClassLoader\UniversalClassLoader();
$classLoader->registerNamespaces(array('Aws' => AWS_FILE_PREFIX, 'Guzzle' => AWS_FILE_PREFIX, 'Symfony' => AWS_FILE_PREFIX));
$classLoader->register();
return $classLoader;
Пример #18
0
<?php

$namespaces = array('CentralApps\\Base' => __DIR__ . '/');
$loader = new \Symfony\Component\ClassLoader\UniversalClassLoader();
$loader->register();
$loader->registerNamespaces($namespaces);
Пример #19
0
<?php

/**
 * This is bootstrap for phpUnit unit tests,
 * use README.md for more details
 */
if (!class_exists('PHPUnit_Framework_TestCase') || version_compare(PHPUnit_Runner_Version::id(), '3.5') < 0) {
    die('PHPUnit framework is required, at least 3.5 version');
}
if (!class_exists('PHPUnit_Framework_MockObject_MockBuilder')) {
    die('PHPUnit MockObject plugin is required, at least 1.0.8 version');
}
define('TESTS_PATH', __DIR__);
define('VENDOR_PATH', realpath(__DIR__ . '/../vendor'));
$classLoaderFile = VENDOR_PATH . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
if (!file_exists($classLoaderFile)) {
    die('cannot find vendor, run: php bin/vendors.php');
}
require_once $classLoaderFile;
$loader = new Symfony\Component\ClassLoader\UniversalClassLoader();
$loader->registerNamespaces(array('Symfony' => VENDOR_PATH, 'Knp' => __DIR__ . '/../src', 'Test' => __DIR__, 'Doctrine\\Common' => VENDOR_PATH . '/doctrine-common/lib', 'Doctrine\\DBAL' => VENDOR_PATH . '/doctrine-dbal/lib', 'Doctrine\\ORM' => VENDOR_PATH . '/doctrine-orm/lib', 'Doctrine\\MongoDB' => VENDOR_PATH . '/doctrine-mongodb/lib', 'Doctrine\\ODM\\MongoDB' => VENDOR_PATH . '/doctrine-mongodb-odm/lib'));
$loader->register();
\Doctrine\Common\Annotations\AnnotationRegistry::registerFile(VENDOR_PATH . '/doctrine-orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
\Doctrine\Common\Annotations\AnnotationRegistry::registerFile(VENDOR_PATH . '/doctrine-mongodb-odm/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/DoctrineAnnotations.php');
$reader = new \Doctrine\Common\Annotations\AnnotationReader();
$reader = new \Doctrine\Common\Annotations\CachedReader($reader, new \Doctrine\Common\Cache\ArrayCache());
$_ENV['annotation_reader'] = $reader;
Пример #20
0
<?php

/**
 * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 * http://aws.amazon.com/apache2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */
require_once __DIR__ . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
if (!defined('AWS_FILE_PREFIX')) {
    define('AWS_FILE_PREFIX', __DIR__);
}
$classLoader = new Symfony\Component\ClassLoader\UniversalClassLoader();
$classLoader->registerNamespaces(array('Aws' => AWS_FILE_PREFIX, 'Guzzle' => AWS_FILE_PREFIX, 'Symfony' => AWS_FILE_PREFIX, 'Doctrine' => AWS_FILE_PREFIX, 'Psr' => AWS_FILE_PREFIX, 'Monolog' => AWS_FILE_PREFIX));
$classLoader->register();
return $classLoader;
Пример #21
0
<?php

require_once dirname(__FILE__) . '/../lib/vendor/Symfony/Component/ClassLoader/UniversalClassLoader.php';
/**
 * Configure the autoloader
 *
 * The Symfony ClassLoader Component is used, but could easy be substituted for
 * another autoloader.
 *
 * @link https://github.com/symfony/ClassLoader
 * @link http://symfony.com/doc/current/cookbook/tools/autoloader.html
 */
$loader = new Symfony\Component\ClassLoader\UniversalClassLoader();
// Register the location of the GitHub namespace
$loader->registerNamespaces(array('Buzz' => __DIR__ . '/../lib/vendor/Buzz/lib', 'GitHub' => __DIR__ . '/../lib'));
$loader->register();
use GitHub\API\Authentication;
use GitHub\API\User\User;
use GitHub\API\AuthenticationException;
// Lets access the User API
$user = new User();
/**
 * Perform operations that require no authentication
 */
// Get details for user 'dsyph3r'
var_dump($user->get('dsyph3r'));
// Get users 'dsyph3r' is following
var_dump($user->following('dsyph3r'));
/**
 * Perform operations that require authentication
 */
Пример #22
0
<?php

/*
 * Copyright MADE/YOUR/DAY <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
require __DIR__ . '/vendor/symfony/class-loader/Symfony/Component/ClassLoader/UniversalClassLoader.php';
$loader = new Symfony\Component\ClassLoader\UniversalClassLoader();
$loader->registerNamespaces(array('Symfony\\Component\\ClassLoader' => __DIR__ . '/vendor/symfony/class-loader', 'Symfony\\Component\\Console' => __DIR__ . '/vendor/symfony/console', 'MadeYourDay' => __DIR__ . '/src'));
$loader->register();
$cli = new MadeYourDay\SVG\IconFontGeneratorCLI();
$cli->run();
Пример #23
0
/**
* This file is part of the Altumo library.
* 
* (c) Steve Sperandeo <*****@*****.**>
* (c) Juan Jaramillo <*****@*****.**>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* This file is designed to be the one and only required include to use Altumo
* for php sources.
* 
* If you'd like to not use it because of the hard-coded timezone, you can 
* simply copy the autoloader lines into your own application.
* 
* There's no requirement to use this specific file to autoload the class paths.
* 
* Also, you can register your own namespaces by adding a second value to the
* registerNamespaces array argument. See the comments within the 
* UniversalClassLoader for addition sample usages.
* 
* @author Steve Sperandeo <*****@*****.**>
*/
//set default timezone
date_default_timezone_set('America/Los_Angeles');
//symfony 2 autoloader (for classes within namespaces)
require_once __DIR__ . '/Utils/UniversalClassLoader.php';
$loader = new Symfony\Component\ClassLoader\UniversalClassLoader();
$loader->registerNamespaces(array('Altumo' => __DIR__));
$loader->register();
<?php

/*
 * Create a console application with the Mongrate commands.
 */
if (!extension_loaded('mongo')) {
    // Instead of throwing a \RuntimeException, which isn't friendly when running the .phar file
    // for the first time when trying to get set up, exit with an error message instead.
    echo "The MongoDB extension must be installed.\n";
    echo "See https://secure.php.net/manual/en/mongo.installation.php\n";
    exit(1);
}
require_once 'vendor/autoload.php';
$loader = new \Symfony\Component\ClassLoader\UniversalClassLoader();
$loader->registerNamespaces(array('Mongrate' => 'src'));
$loader->register();
$app = new \Symfony\Component\Console\Application();
try {
    $app->add(new \Mongrate\Command\ToggleMigrationCommand());
    $app->add(new \Mongrate\Command\UpCommand());
    $app->add(new \Mongrate\Command\DownCommand());
    $app->add(new \Mongrate\Command\GenerateMigrationCommand());
    $app->add(new \Mongrate\Command\ListCommand());
    $app->add(new \Mongrate\Command\TestMigrationCommand());
    $app->add(new \Mongrate\Command\TestAllCommand());
    $app->add(new \Mongrate\Command\UpAllCommand());
} catch (\MongoConnectionException $e) {
    fwrite(STDERR, "MongoDB connection failed.\n" . $e->getMessage() . "\n");
    exit(1);
}
$app->add(new \Mongrate\Command\SelfUpdateCommand());
Пример #25
0
<?php

error_reporting(E_ALL | E_STRICT);
ini_set("display_errors", 1);
$classLoaderFile = __DIR__ . '/vendor/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
if (!file_exists($classLoaderFile)) {
    throw new \LogicException("You need to install vendors for tests to work\nPlease run ./install_vendors.sh\n");
}
require_once $classLoaderFile;
$loader = new \Symfony\Component\ClassLoader\UniversalClassLoader();
$loader->registerNamespaces(array('Symfony' => __DIR__ . '/vendor/symfony/src/', 'Sensio\\Bundle\\FrameworkExtraBundle' => __DIR__ . '/vendor/sensio-extra-bundle/', 'Doctrine\\Common' => __DIR__ . '/vendor/doctrine-common/lib/', 'Monolog' => __DIR__ . '/vendor/monolog/src/', 'Grace\\Cache' => __DIR__ . '/vendor/grace-cache/lib', 'Grace\\Tests\\Cache' => __DIR__ . '/vendor/grace-cache/lib', 'Grace\\Tests\\SQLBuilder' => __DIR__ . '/vendor/grace-dbal/lib', 'Grace\\SQLBuilder' => __DIR__ . '/vendor/grace-dbal/lib', 'Grace\\Tests\\DBAL' => __DIR__ . '/vendor/grace-dbal/lib', 'Grace\\DBAL' => __DIR__ . '/vendor/grace-dbal/lib', 'Grace\\Bundle' => __DIR__ . '/symfony-bundle/', 'Grace' => __DIR__ . '/core/'));
$loader->register();
if (file_exists(__DIR__ . '/config.php')) {
    /** @noinspection PhpIncludeInspection */
    require_once __DIR__ . '/config.php';
} else {
    require_once __DIR__ . '/config.php.dist';
}
Пример #26
0
<?php

require_once 'vendor/symfony/class-loader/Symfony/Component/ClassLoader/UniversalClassLoader.php';
if (!defined('MOJIO_FILE_PREFIX')) {
    define('MOJIO_FILE_PREFIX', 'phar://mojio.phar');
}
Phar::mapPhar('mojio.phar');
$classLoader = new Symfony\Component\ClassLoader\UniversalClassLoader();
$classLoader->registerNamespaces(array('Mojio' => MOJIO_FILE_PREFIX . '/src', 'Guzzle' => MOJIO_FILE_PREFIX . '/vendor/guzzle/guzzle/src', 'Symfony\\Component\\EventDispatcher' => MOJIO_FILE_PREFIX . '/vendor/symfony/event-dispatcher', 'Doctrine' => MOJIO_FILE_PREFIX . '/vendor/doctrine/common/lib', 'Monolog' => MOJIO_FILE_PREFIX . '/vendor/monolog/monolog/src'));
$classLoader->register();
__halt_compiler();
Пример #27
0
<?php

Phar::mapPhar('predictionio.phar');
require_once 'phar://predictionio.phar/vendor/symfony/class-loader/Symfony/Component/ClassLoader/UniversalClassLoader.php';
$classLoader = new Symfony\Component\ClassLoader\UniversalClassLoader();
$classLoader->registerNamespaces(array('PredictionIO' => 'phar://predictionio.phar/src', 'Symfony\\Component\\EventDispatcher' => 'phar://predictionio.phar/vendor/symfony/event-dispatcher', 'Guzzle' => 'phar://predictionio.phar/vendor/guzzle/guzzle/src'));
$classLoader->register();
__halt_compiler();