本文整理汇总了PHP中Autoloader::alias方法的典型用法代码示例。如果您正苦于以下问题:PHP Autoloader::alias方法的具体用法?PHP Autoloader::alias怎么用?PHP Autoloader::alias使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Autoloader
的用法示例。
在下文中一共展示了Autoloader::alias方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: aliasIn
function aliasIn($ns)
{
$overridenPlarx = \Bundle::option('vane', 'ignorePlarx');
$ns = trim($ns, '\\');
foreach ($overridenPlarx as $class) {
\Autoloader::alias("Vane\\{$class}", "{$ns}\\{$class}");
}
Plarx::supersede($ns, $overridenPlarx);
}
示例2:
<?php
/**
* Part of the Nesty bundle for Laravel.
*
* @package Nesty
* @version 1.0
* @author Cartalyst LLC
* @license MIT License
* @copyright (c) 2011 - 2012, Cartalyst LLC
* @link http://cartalyst.com
*/
// Autoload classes
Autoloader::namespaces(array('Nesty' => Bundle::path('nesty')));
// Set the global alias for Nesty
Autoloader::alias('Nesty\\Nesty', 'Nesty');
示例3: testAliasesCanBeRegistered
/**
* Test the Autoloader::alias method.
*
* @group laravel
*/
public function testAliasesCanBeRegistered()
{
Autoloader::alias('Foo\\Bar', 'Foo');
$this->assertEquals('Foo\\Bar', Autoloader::$aliases['Foo']);
}
示例4: function
if (Auth::guest()) {
return Redirect::make('', 401);
}
});
// --------------------------------------------------------------
// Setting system tables
// --------------------------------------------------------------
DBManager::$hidden = Config::get('domain::dbmanager.hidden');
$api_version = Config::get('layla.domain.api.version');
// --------------------------------------------------------------
// Map the Base Controller
// --------------------------------------------------------------
Autoloader::map(array('Domain_Base_Controller' => __DIR__ . DS . 'controllers' . DS . 'base' . EXT));
Route::filter('api_auth', function () {
if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW'])) {
//return Response::json(array(), 401);
}
//Auth::attempt();
});
Bundle::start('thirdparty_bob');
// --------------------------------------------------------------
// Load the routes
// --------------------------------------------------------------
Route::group(array('before' => 'api_auth'), function () use($api_version) {
Route::api(Config::get('routes'), 'domain', Config::get('layla.domain.url_prefix'));
});
// --------------------------------------------------------------
// Set aliases
// --------------------------------------------------------------
Autoloader::alias('Domain\\Libraries\\Response', 'Response');
示例5:
<?php
/**
* /bundles/imwg/start.php
* Imwg - Imagemanipulation with GD
*
* @package Laravel-Imwg
* @version 1.0.1
* @author Nico R <lt500r@gmail.com>
* @link https://github.com/Sentences
*/
Autoloader::namespaces(array('ImageManipulationWithGd' => __DIR__ . DS . 'classes' . DS));
Autoloader::alias('ImageManipulationWithGd\\Imwg', 'Imwg');
// Merge user configuration files
ImageManipulationWithGd\Config::merge();
示例6:
|--------------------------------------------------------------------------
| Register PSR-0 Autoloading
|--------------------------------------------------------------------------
|
| Basset uses PSR-0 autoloading to lazily load the required files when
| requested. Here we'll provide the namespaces and their corrosponding
| locations.
|
*/
Autoloader::namespaces(array('Assetic' => __DIR__ . '/vendor/assetic/src/Assetic', 'Basset' => __DIR__ . '/classes'));
/*
|--------------------------------------------------------------------------
| Basset Facade Alias
|--------------------------------------------------------------------------
|
| Alias Basset to the Basset Facade so that we can use a terser static
| syntax to access methods. Lovely.
|
*/
Autoloader::alias('Basset\\Facades\\Basset', 'Basset');
/*
|--------------------------------------------------------------------------
| Register Basset with the IoC
|--------------------------------------------------------------------------
|
| Basset is registered within the IoC container so that everything is
| somewhat testable. We'll use a facade to provide a terser static
| interface.
|
*/
IoC::instance('basset', new Basset\Basset());
示例7: function
<?php
Autoloader::namespaces(array('Bouncer' => Bundle::path('bouncer') . 'src'));
Autoloader::alias('Bouncer\\Bouncer', 'Bouncer');
IoC::register('bouncer: roles_extractor', function () {
return function ($user) {
return array_map(function ($r) {
return $r->name;
}, $user->roles);
};
});
示例8: path
<?php
Autoloader::map(array('Laravel\\Asset_Container' => path('sys') . 'asset.php'));
Autoloader::namespaces(array('AssetCompressor' => __DIR__));
Autoloader::alias('AssetCompressor\\Asset', 'Asset');
示例9:
<?php
Autoloader::namespaces(array('Layla' => __DIR__));
// --------------------------------------------------------------
// Set Aliases
// --------------------------------------------------------------
Autoloader::alias('Layla\\Notification', 'Notification');
Autoloader::alias('Layla\\HTML', 'HTML');
Autoloader::alias('Layla\\Module', 'Module');
Autoloader::alias('Layla\\Route', 'Route');
示例10:
<?php
/**
* --------------------------------------------------------------------------
* DomainTools
* --------------------------------------------------------------------------
*
* Domain Tools, a bundle for use with the Laravel Framework.
*
* @package Domain Tools
* @version 2.0.0
* @author Bruno Gaspar <brunofgaspar1@gmail.com>
* @link https://github.com/bruno-g/domaintools
*/
/*
* --------------------------------------------------------------------------
* Register some namespaces.
* --------------------------------------------------------------------------
*/
Autoloader::namespaces(array('DomainTools\\Libraries' => __DIR__ . DS . 'libraries', 'DomainTools' => __DIR__ . DS));
/*
* --------------------------------------------------------------------------
* Set the global alias.
* --------------------------------------------------------------------------
*/
Autoloader::alias('DomainTools\\DomainTools', 'DomainTools');
示例11:
/**
* --------------------------------------------------------------------------
* Cartify
* --------------------------------------------------------------------------
*
* Cartify, a shopping cart bundle for use with the Laravel Framework.
*
* @package Cartify
* @version 2.1.1
* @author Bruno Gaspar <brunofgaspar1@gmail.com>
* @link https://github.com/bruno-g/cartify
*/
/*
* --------------------------------------------------------------------------
* Register the namespaces.
* --------------------------------------------------------------------------
*/
Autoloader::namespaces(array('Cartify' => __DIR__ . DS));
/*
* --------------------------------------------------------------------------
* Set the global alias.
* --------------------------------------------------------------------------
*/
Autoloader::alias('Cartify\\Cartify', 'Cartify');
Autoloader::alias('Cartify\\CartifyException', 'CartifyException');
/*
* --------------------------------------------------------------------------
* Include our helpers file.
* --------------------------------------------------------------------------
*/
require_once __DIR__ . DS . 'helpers.php';
示例12: function
<?php
/**
* Part of the LinxFix bundle for Laravel.
*
* NOTICE OF LICENSE
*
* Licensed under the 3-clause BSD License.
*
* This source file is subject to the 3-clause BSD License that is
* bundled with this package in the LICENSE file. It is also available at
* the following URL: http://www.opensource.org/licenses/BSD-3-Clause
*
* @package LinxFix
* @version 1.0
* @author Squegg Ltd
* @license BSD License (3-clause)
* @copyright (c) 2012 - 2013, Squegg Ltd
* @link http://www.squegg.com
*/
// Autoload classes
Autoloader::namespaces(array('LinxFix' => Bundle::path('linxfix')));
// Set the global alias
Autoloader::alias('LinxFix\\LinxFix', 'LinxFix');
// Overriding the regular app 404 with LinxFix.
Event::override('404', function () {
return LinxFix::correct();
});
示例13:
<?php
Autoloader::map(array('Slugger\\Slugger' => Bundle::path('slugger') . 'slugger.php'));
Autoloader::alias('Slugger\\Slugger', 'Slugger');
示例14:
<?php
/**
* Part of the Sentry bundle for Laravel.
*
* NOTICE OF LICENSE
*
* Licensed under the 3-clause BSD License.
*
* This source file is subject to the 3-clause BSD License that is
* bundled with this package in the LICENSE file. It is also available at
* the following URL: http://www.opensource.org/licenses/BSD-3-Clause
*
* @package Sentry
* @version 1.0
* @author Cartalyst LLC
* @license BSD License (3-clause)
* @copyright (c) 2011 - 2012, Cartalyst LLC
* @link http://cartalyst.com
*/
// Autoload classes
Autoloader::namespaces(array('Sentry' => Bundle::path('sentry')));
// Set the global alias for Sentry
Autoloader::alias('Sentry\\Sentry', 'Sentry');
Autoloader::alias('Sentry\\SentryException', 'SentryException');
Sentry::_init();
示例15:
<?php
/**
* Twitter's Bootstrap for Laravel
*
* @package Bundles
* @subpackage Twitter
* @author Phill Sparks <me@phills.me.uk>
*
* @see http://github.com/sparksp/laravel-twitter
* @see http://twitter.github.com/bootstrap/
*/
Autoloader::map(array('Bootsparks\\Form' => __DIR__ . DS . 'form' . EXT, 'Bootsparks\\HTML' => __DIR__ . DS . 'html' . EXT));
Autoloader::alias('Bootsparks\\Form', 'Form');
Autoloader::alias('Bootsparks\\HTML', 'HTML');