当前位置: 首页>>代码示例>>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;未经允许,请勿转载。