本文整理汇总了PHP中Autoloader::directories方法的典型用法代码示例。如果您正苦于以下问题:PHP Autoloader::directories方法的具体用法?PHP Autoloader::directories怎么用?PHP Autoloader::directories使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Autoloader
的用法示例。
在下文中一共展示了Autoloader::directories方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?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));
}
}
示例2: path
| 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');
});
/*
示例3: define
* @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) . ' />';
});
示例4:
<?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();
示例5: array
<?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']);
});
示例6: testPsrDirectoriesCanBeRegistered
/**
* 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));
}
示例7:
<?php
Autoloader::directories(array(Bundle::path('openexchange') . 'classes'));
示例8: path
<?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
示例9: path
<?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();
示例10: dirname
<?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);
});
示例11: path
<?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'));
示例12:
<?php
Autoloader::namespaces(array('Authvel' => Bundle::path('authvel') . 'models'));
Autoloader::directories(array(__DIR__ . '/models'));
示例13:
<?php
Autoloader::directories(array(__DIR__ . DS . 'classes', __DIR__ . DS . 'tasks'));
示例14:
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
Autoloader::directories(array(Bundle::path('backbonemvc') . 'classes'));
示例15:
<?php
Autoloader::directories(array(__DIR__ . DS . 'classes', __DIR__ . DS . 'classes' . DS . 'generators'));