<?php Autoloader::directories(array(Bundle::path('administrator') . 'Libraries')); Autoloader::namespaces(array('Admin' => Bundle::path('administrator'))); //set the config items if a user has provided an application config foreach (Config::get('administrator::administrator', array()) as $key => $option) { if (Config::has('administrator.' . $key)) { Config::set('administrator::administrator.' . $key, Config::get('administrator.' . $key)); } }
| to path maps into the "map" function of Autoloader. Then, when you | want to use that class, just use it. It's simple! | */ Autoloader::map(array('Base_Controller' => path('app') . 'controllers/base.php')); /* |-------------------------------------------------------------------------- | Auto-Loader Directories |-------------------------------------------------------------------------- | | The Laravel auto-loader can search directories for files using the PSR-0 | naming convention. This convention basically organizes classes by using | the class namespace to indicate the directory structure. | */ Autoloader::directories(array(path('app') . 'entities', path('app') . 'services', path('app') . 'libraries')); /* |-------------------------------------------------------------------------- | Laravel View Loader |-------------------------------------------------------------------------- | | The Laravel view loader is responsible for returning the full file path | for the given bundle and view. Of course, a default implementation is | provided to load views according to typical Laravel conventions but | you may change this to customize how your views are organized. | */ Event::listen(View::loader, function ($bundle, $view) { return View::file($bundle, $view, Bundle::path($bundle) . 'views'); }); /*
* @copyright 2012 CreativityKills, LLC * @link http://github.com/CreativityKills/placeholdr/ * @version 1.0 */ /** * Placeholdr bundle root path. * * Using this value instead of Bundle::path('placeholdr') gives the developer * more options, especially when trying to rename the bundle. */ define('PLACEHOLDR', __DIR__ . DIRECTORY_SEPARATOR); /** * Add libraries folder to autoloader loading directories. * * This will tell Laravel where to look when attempting to autoload Placeholdr * classes. */ Autoloader::directories(array(PLACEHOLDR . 'libraries')); /** * Register a HTML macro for use in views. * * The Placeholdr HTML macro makes using Placeholdr within the application * views a breeze. Simple and elegant, the Laravel way ;) * * <code> * {{ HTML::placeholdr('300x300') }} * </code> */ HTML::macro('placeholdr', function ($dimension, $text = '', $attributes = array()) { return '<img src="' . URL::to_route('placeholdr', array($dimension, $text)) . '"' . HTML::attributes($attributes) . ' />'; });
<?php Autoloader::directories(array(Bundle::path('loggy') . 'classes', Bundle::path('loggy') . 'config')); /* AutoLoader::map(array( 'Remote_Logger' => Bundle::path('loggy').'classes/remote_logger.php', )); */ Loggy::init();
<?php // Set hashids configuration $config = array('salt' => 'KareLGrouP159753', 'length' => 6); // Autoload libraries folder Autoloader::directories(array(Bundle::path('hashids') . 'libraries')); Autoloader::namespaces(array('Hashids\\Libraries' => Bundle::path('hashids') . 'libraries')); // Register Hashids in the IoC container for DRY code // and Dependency Injection IoC::register('hashids', function () use($config) { return new Hashids\Libraries\hashids($config['salt'], $config['length']); });
/** * Test the Autoloader::directories method. * * @group laravel */ public function testPsrDirectoriesCanBeRegistered() { Autoloader::directories(array(path('app') . 'foo' . DS . 'bar', path('app') . 'foo' . DS . 'baz' . DS . DS)); $this->assertTrue(in_array(path('app') . 'foo' . DS . 'bar' . DS, Autoloader::$directories)); $this->assertTrue(in_array(path('app') . 'foo' . DS . 'baz' . DS, Autoloader::$directories)); }
<?php Autoloader::directories(array(Bundle::path('openexchange') . 'classes'));
<?php Autoloader::directories(array(path('bundle') . 'mockup/config', path('bundle') . 'mockup/libraries', path('bundle') . 'litmus/libraries/Api')); Autoloader::map(array('Mockup\\Util' => path('bundle') . 'mockup/libraries/Util.php', 'Litmus\\Api\\Litmus' => path('bundle') . 'litmus/libraries/Litmus/Api/Litmus.php')); // end bundle/mockup/start.php
<?php Autoloader::directories(array(Bundle::path('social') . 'inc'));
<?php /* |-------------------------------------------------------------------------- | Admin Models |-------------------------------------------------------------------------- | | Map Models using PSR-0 standard namespace. */ Autoloader::directories(array(path('bundle') . 'lara_admin/libraries')); Autoloader::namespaces(array('Admin' => Bundle::path('lara_admin') . 'models')); Autoloader::map(array('Lara_admin_Controller' => path('bundle') . '/lara_admin/controllers/lara_admin.php', 'LaraAdmin' => path('bundle') . '/lara_admin/lara_admin.php')); LaraAdmin::make();
<?php Autoloader::directories(array(Bundle::path('bob') . 'classes'));
<?php /** * Autoload Uploader namespace */ Autoloader::namespaces(array('Uploader' => Bundle::path('juploader') . 'src' . DS . 'Uploader')); // Load Interface iUploadHandler require dirname(__FILE__) . DS . 'src' . DS . 'Uploader' . DS . 'iUploadHandler.php'; Autoloader::directories(array(Bundle::path('juploader') . 'models', Bundle::path('juploader') . 'libraries')); /** * IoC Management * * You can also change the $options here * $name = (Auth::user()) ? Auth::user()->name : 'Anonymous'; * $options['upload_dir'] = path('public').'/pictures/'.$name.'/'; * $options['upload_url'] = URL::base().'/pictures/'.$name.'/'; * * However it's better to change the options per controller, like this: * $uploader = IoC::resolve('Uploader'); * $uploader * ->with_option('override_name' , 'MyFixedName') * ->with_option('script_url' , URL::to_route('dbupload')) * ->Start(); */ Laravel\IoC::register('Uploader', function () { $options = Config::get('juploader::settings'); $uploader = isset($options['UploaderClass']) ? $options['UploaderClass'] : 'Uploader\\FileUploadHandler'; $arguments = isset($options['UploaderArguments']) ? $options['UploaderArguments'] : null; $server_options = $options['Server']; return new Uploader\UploadServer($uploader, $arguments, $server_options); });
<?php /** * Author: RaymondChou * Date: 12-10-6 * File: start.php * Email: zhouyt.kai7@gmail.com */ //Turn off the profiler to prevent wrong output Config::set('application.profiler', false); Autoloader::directories(array(path('bundle') . 'rest_service_api/libraries')); require_once __DIR__ . '/libraries/markdown.php'; require_once __DIR__ . '/libraries/utility.php'; Autoloader::map(array('Api_Controller' => path('bundle') . 'rest_service_api/libraries/api_controller.php', 'Api' => path('bundle') . 'rest_service_api/libraries/api.php'));
<?php Autoloader::namespaces(array('Authvel' => Bundle::path('authvel') . 'models')); Autoloader::directories(array(__DIR__ . '/models'));
<?php Autoloader::directories(array(__DIR__ . DS . 'classes', __DIR__ . DS . 'tasks'));
<?php Autoloader::directories(array(Bundle::path('clickatell') . 'libraries'));
<?php /* * To change this template, choose Tools | Templates * and open the template in the editor. */ Autoloader::directories(array(Bundle::path('backbonemvc') . 'classes'));
<?php Autoloader::directories(array(__DIR__ . DS . 'classes', __DIR__ . DS . 'classes' . DS . 'generators'));
|-------------------------------------------------------------------------- | Auto-Loader Mappings |-------------------------------------------------------------------------- | | Laravel uses a simple array of class to path mappings to drive the class | auto-loader. This simple approach helps avoid the performance problems | of searching through directories by convention. | | Registering a mapping couldn't be easier. Just pass an array of class | to path maps into the "map" function of Autoloader. Then, when you | want to use that class, just use it. It's simple! | */ /* Autoloader::map(array( 'LaraChat\\Chat' => __DIR__.'/larachat/chat.php' )); */ /* |-------------------------------------------------------------------------- | Auto-Loader Directories |-------------------------------------------------------------------------- | | The Laravel auto-loader can search directories for files using the PSR-0 | naming convention. This convention basically organizes classes by using | the class namespace to indicate the directory structure. | */ Autoloader::directories(array()); // Autoload classes Autoloader::namespaces(array('Larachat' => __DIR__ . DS));
<?php // map redbean Autoloader::map(array('R' => Bundle::path('redbean') . 'redbean/rb.php')); // now our connector Autoloader::directories(array(Bundle::path('redbean') . 'connector')); // and connect Connector::setup();
<?php Autoloader::directories(array(Bundle::path('laraveltwittersearch') . 'classes'));
<?php // Autoloader::map(array( // 'Thrift' => Bundle::path('evernote').'src/Thrift.php', // 'TTransport' => Bundle::path('evernote').'src/transport/TTransport.php', // 'THttpClient' => Bundle::path('evernote').'src/transport/THttpClient.php', // 'TProtocol' => Bundle::path('evernote').'src/protocol/TProtocol.php', // 'TBinaryProtocol' => Bundle::path('evernote').'src/protocol/TBinaryProtocol.php', // 'Types_types' => Bundle::path('evernote').'src/packages/Types/Types_types.php', // 'UserStore' => Bundle::path('evernote').'src/packages/UserStore/UserStore.php', // 'NoteStore' => Bundle::path('evernote').'src/packages/NoteStore/NoteStore.php' // )); require_once Bundle::path('evernote') . 'src' . DS . 'Thrift.php'; require_once Bundle::path('evernote') . 'src' . DS . 'transport/TTransport.php'; require_once Bundle::path('evernote') . 'src' . DS . 'transport/THttpClient.php'; require_once Bundle::path('evernote') . 'src' . DS . 'protocol/TProtocol.php'; require_once Bundle::path('evernote') . 'src' . DS . 'protocol/TBinaryProtocol.php'; require_once Bundle::path('evernote') . 'src' . DS . 'packages/Types/Types_types.php'; require_once Bundle::path('evernote') . 'src' . DS . 'packages/UserStore/UserStore.php'; require_once Bundle::path('evernote') . 'src' . DS . 'packages/NoteStore/NoteStore.php'; Autoloader::directories(array(Bundle::path('evernote') . 'libraries', Bundle::path('evernote') . 'models')); if (!class_exists('OAuth')) { die("<span style=\"color:red\">The PHP OAuth Extension is not installed</span>"); }
| to path maps into the "map" function of Autoloader. Then, when you | want to use that class, just use it. It's simple! | */ Autoloader::map(array('Base_Controller' => path('app') . 'controllers/base.php')); /* |-------------------------------------------------------------------------- | Auto-Loader Directories |-------------------------------------------------------------------------- | | The Laravel auto-loader can search directories for files using the PSR-0 | naming convention. This convention basically organizes classes by using | the class namespace to indicate the directory structure. | */ Autoloader::directories(array(path('app') . 'models', path('app') . 'libraries')); /* |-------------------------------------------------------------------------- | Laravel View Loader |-------------------------------------------------------------------------- | | The Laravel view loader is responsible for returning the full file path | for the given bundle and view. Of course, a default implementation is | provided to load views according to typical Laravel conventions but | you may change this to customize how your views are organized. | */ Event::listen(View::loader, function ($bundle, $view) { return View::file($bundle, $view, Bundle::path($bundle) . 'views'); }); /*
<?php Autoloader::directories(array(Bundle::path('imagine') . 'src'));