當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Autoloader::alias方法代碼示例

本文整理匯總了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);
}
開發者ID:SerdarSanri,項目名稱:VaneMart,代碼行數:9,代碼來源:core.php

示例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');
開發者ID:reith2004,項目名稱:components,代碼行數:16,代碼來源:start.php

示例3: testAliasesCanBeRegistered

 /**
  * Test the Autoloader::alias method.
  *
  * @group laravel
  */
 public function testAliasesCanBeRegistered()
 {
     Autoloader::alias('Foo\\Bar', 'Foo');
     $this->assertEquals('Foo\\Bar', Autoloader::$aliases['Foo']);
 }
開發者ID:gilyaev,項目名稱:framework-bench,代碼行數:10,代碼來源:autoloader.test.php

示例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');
開發者ID:reith2004,項目名稱:domain,代碼行數:30,代碼來源:start.php

示例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();
開發者ID:SerdarSanri,項目名稱:laravel-imwg,代碼行數:15,代碼來源:start.php

示例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());
開發者ID:jvillasante,項目名稱:cubanartjb,代碼行數:31,代碼來源:start.php

示例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);
    };
});
開發者ID:SerdarSanri,項目名稱:laravel-bouncer-bundle,代碼行數:11,代碼來源:start.php

示例8: path

<?php

Autoloader::map(array('Laravel\\Asset_Container' => path('sys') . 'asset.php'));
Autoloader::namespaces(array('AssetCompressor' => __DIR__));
Autoloader::alias('AssetCompressor\\Asset', 'Asset');
開發者ID:SerdarSanri,項目名稱:AssetCompressor,代碼行數:5,代碼來源:start.php

示例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');
開發者ID:reith2004,項目名稱:components,代碼行數:10,代碼來源:start.php

示例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');
開發者ID:SerdarSanri,項目名稱:DomainTools,代碼行數:26,代碼來源:start.php

示例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';
開發者ID:TahsinGokalp,項目名稱:L3-Eticaret,代碼行數:31,代碼來源:start.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();
});
開發者ID:SerdarSanri,項目名稱:linxfix,代碼行數:28,代碼來源:start.php

示例13:

<?php

Autoloader::map(array('Slugger\\Slugger' => Bundle::path('slugger') . 'slugger.php'));
Autoloader::alias('Slugger\\Slugger', 'Slugger');
開發者ID:SerdarSanri,項目名稱:laravel-slugger-bundle,代碼行數:4,代碼來源:start.php

示例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();
開發者ID:gigikiri,項目名稱:masjid-l3,代碼行數:26,代碼來源:start.php

示例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');
開發者ID:reith2004,項目名稱:components,代碼行數:15,代碼來源:start.php


注:本文中的Autoloader::alias方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。