本文整理汇总了PHP中Autoloader::add_namespace方法的典型用法代码示例。如果您正苦于以下问题:PHP Autoloader::add_namespace方法的具体用法?PHP Autoloader::add_namespace怎么用?PHP Autoloader::add_namespace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Autoloader
的用法示例。
在下文中一共展示了Autoloader::add_namespace方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
<?php
// Bootstrap the framework DO NOT edit this
require COREPATH . 'bootstrap.php';
\Autoloader::add_classes(array());
// Register the autoloader
\Autoloader::register();
/**
* Your environment. Can be set to any of the following:
*
* Fuel::DEVELOPMENT
* Fuel::TEST
* Fuel::STAGING
* Fuel::PRODUCTION
*/
\Fuel::$env = isset($_SERVER['FUEL_ENV']) ? $_SERVER['FUEL_ENV'] : \Fuel::DEVELOPMENT;
// Initialize the framework with the config file.
\Fuel::init('config.php');
// Add namespace, necessary if you want the autoloader to be able to find classes
\Autoloader::add_namespace('Eshop', __DIR__ . '/classes/');
// Add as core namespace
\Autoloader::add_core_namespace('Eshop');
// Add as core namespace (classes are aliased to global, thus useable without namespace prefix)
// Set the second argument to true to prefix and be able to overwrite core classes
\Autoloader::add_core_namespace('Eshop', true);
// And add the classes, this is useful for:
// - optimization: no path searching is necessary
// - it's required to be able to use as a core namespace
// - if you want to break the autoloader's path search rules
\Autoloader::add_classes(array('Eshop\\Cart' => __DIR__ . '/classes/cart.php'));
示例2: foreach
\Fuel::init('config.php');
// Config load.
Config::load('site', 'site');
Config::load('term', 'term');
Config::load('icon', 'icon');
Config::load('page', 'page');
Config::load('template', 'template');
Config::load('exif', 'exif');
Config::load('less', 'less');
// Config of each module load.
$modules = Site_Util::get_active_modules();
foreach ($modules as $module => $path) {
if (file_exists(sprintf('%sconfig/%s.php', $path, $module))) {
Config::load(sprintf('%s::%s', $module, $module), $module);
}
}
// Config of navigation load.
Config::load('navigation', 'navigation');
if (in_array(FBD_ENVIRONMENT, array('DEVELOPMENT', 'TEST'))) {
Config::load('develop', 'develop');
}
Site_Config::regulate_configs_for_module_loaded();
// Register the autoloader for library
if (FBD_AWS_ACCESS_KEY && FBD_AWS_SECRET_KEY && FBD_AWS_S3_BUCKET) {
Autoloader::add_namespace('Aws', APPPATH . 'vendor/aws/aws-sdk-php/src/Aws', true);
}
if (conf('library.goutte.isEnabled')) {
$goutte_path = FBD_BASEPATH . 'fuel/vendor/fabpot/goutte/Goutte/';
Autoloader::add_namespace('Goutte', $goutte_path, true);
Autoloader::add_class('Client', $goutte_path . 'Client.php');
}
示例3:
<?php
/**
* Alias the Log namespace to global so we can overload the Log class
*/
Autoloader::add_core_namespace('Log');
/**
* Inform the autoloader where to find what...
*/
/**
* v1.x style classes.
*/
Autoloader::add_classes(array('Log\\Log' => __DIR__ . '/classes/log.php'));
/**
* v2.0 style classes. They are PSR-0, so we only need to define the path.
*/
Autoloader::add_namespace('Psr\\Log', __DIR__ . '/Psr/Log/', true);
Autoloader::add_namespace('Monolog', __DIR__ . '/src/Monolog/', true);
示例4: import
* @version 1.0
* @author Fuel Development Team
* @license MIT License
* @copyright 2010 - 2011 Fuel Development Team
* @link http://fuelphp.com
*/
// Load the base functions
require COREPATH . 'base.php';
// Import the core Fuel class
import('fuel');
// If the app does not have a Fuel class, then we need to alias it.
!class_exists('Fuel') and class_alias('Fuel\\Core\\Fuel', 'Fuel');
define('DS', DIRECTORY_SEPARATOR);
define('CRLF', chr(13) . chr(10));
/**
* Do we have access to mbstring?
* We need this in order to work with UTF-8 strings
*/
define('MBSTRING', function_exists('mb_get_info'));
/**
* Is mbstring enabled?
* Set the encoding to use whatever Fuel is set to use.
*/
MBSTRING and mb_internal_encoding(Fuel::$encoding);
// Is Fuel running on the command line?
Fuel::$is_cli = (bool) defined('STDIN');
// Load in the Autoloader
require COREPATH . 'classes' . DS . 'autoloader.php';
Autoloader::add_namespace('Fuel\\Core', COREPATH . 'classes/');
Autoloader::add_classes(array('Fuel\\Core\\Agent' => COREPATH . 'classes/agent.php', 'Fuel\\Core\\Arr' => COREPATH . 'classes/arr.php', 'Fuel\\Core\\Asset' => COREPATH . 'classes/asset.php', 'Fuel\\Core\\Cache' => COREPATH . 'classes/cache.php', 'Fuel\\Core\\Cache_Exception' => COREPATH . 'classes/cache/exception.php', 'Fuel\\Core\\Cache_Handler_Driver' => COREPATH . 'classes/cache/handler/driver.php', 'Fuel\\Core\\Cache_Handler_Json' => COREPATH . 'classes/cache/handler/json.php', 'Fuel\\Core\\Cache_Handler_Serialized' => COREPATH . 'classes/cache/handler/serialized.php', 'Fuel\\Core\\Cache_Handler_String' => COREPATH . 'classes/cache/handler/string.php', 'Fuel\\Core\\Cache_Storage_Driver' => COREPATH . 'classes/cache/storage/driver.php', 'Fuel\\Core\\Cache_Storage_File' => COREPATH . 'classes/cache/storage/file.php', 'Fuel\\Core\\Cache_Storage_Memcached' => COREPATH . 'classes/cache/storage/memcached.php', 'Fuel\\Core\\Cache_Storage_Redis' => COREPATH . 'classes/cache/storage/redis.php', 'Fuel\\Core\\Config' => COREPATH . 'classes/config.php', 'Fuel\\Core\\Controller' => COREPATH . 'classes/controller.php', 'Fuel\\Core\\Controller_Rest' => COREPATH . 'classes/controller/rest.php', 'Fuel\\Core\\Controller_Template' => COREPATH . 'classes/controller/template.php', 'Fuel\\Core\\Cookie' => COREPATH . 'classes/cookie.php', 'Fuel\\Core\\DB' => COREPATH . 'classes/db.php', 'Fuel\\Core\\DBUtil' => COREPATH . 'classes/dbutil.php', 'Fuel\\Core\\Database_Connection' => COREPATH . 'classes/database/connection.php', 'Fuel\\Core\\Database_Exception' => COREPATH . 'classes/database/exception.php', 'Fuel\\Core\\Database_Expression' => COREPATH . 'classes/database/expression.php', 'Fuel\\Core\\Database_Pdo_Connection' => COREPATH . 'classes/database/pdo/connection.php', 'Fuel\\Core\\Database_Query' => COREPATH . 'classes/database/query.php', 'Fuel\\Core\\Database_Query_Builder' => COREPATH . 'classes/database/query/builder.php', 'Fuel\\Core\\Database_Query_Builder_Insert' => COREPATH . 'classes/database/query/builder/insert.php', 'Fuel\\Core\\Database_Query_Builder_Delete' => COREPATH . 'classes/database/query/builder/delete.php', 'Fuel\\Core\\Database_Query_Builder_Update' => COREPATH . 'classes/database/query/builder/update.php', 'Fuel\\Core\\Database_Query_Builder_Select' => COREPATH . 'classes/database/query/builder/select.php', 'Fuel\\Core\\Database_Query_Builder_Where' => COREPATH . 'classes/database/query/builder/where.php', 'Fuel\\Core\\Database_Query_Builder_Join' => COREPATH . 'classes/database/query/builder/join.php', 'Fuel\\Core\\Database_Result' => COREPATH . 'classes/database/result.php', 'Fuel\\Core\\Database_Result_Cached' => COREPATH . 'classes/database/result/cached.php', 'Fuel\\Core\\Database_Mysql_Connection' => COREPATH . 'classes/database/mysql/connection.php', 'Fuel\\Core\\Database_MySQL_Result' => COREPATH . 'classes/database/mysql/result.php', 'Fuel\\Core\\Database_Mysqli_Connection' => COREPATH . 'classes/database/mysqli/connection.php', 'Fuel\\Core\\Database_MySQLi_Result' => COREPATH . 'classes/database/mysqli/result.php', 'Fuel\\Core\\Email' => COREPATH . 'classes/email.php', 'Fuel\\Core\\Email_Driver' => COREPATH . 'classes/email/driver.php', 'Fuel\\Core\\Email_Mail' => COREPATH . 'classes/email/mail.php', 'Fuel\\Core\\Email_Sendmail' => COREPATH . 'classes/email/sendmail.php', 'Fuel\\Core\\Email_Smtp' => COREPATH . 'classes/email/smtp.php', 'Fuel\\Core\\Fuel_Exception' => COREPATH . 'classes/fuel/exception.php', 'Fuel\\Core\\Date' => COREPATH . 'classes/date.php', 'Fuel\\Core\\Debug' => COREPATH . 'classes/debug.php', 'Fuel\\Core\\Cli' => COREPATH . 'classes/cli.php', 'Fuel\\Core\\Crypt' => COREPATH . 'classes/crypt.php', 'Fuel\\Core\\Event' => COREPATH . 'classes/event.php', 'Fuel\\Core\\Error' => COREPATH . 'classes/error.php', 'Fuel\\Core\\Format' => COREPATH . 'classes/format.php', 'Fuel\\Core\\Fieldset' => COREPATH . 'classes/fieldset.php', 'Fuel\\Core\\Fieldset_Field' => COREPATH . 'classes/fieldset/field.php', 'Fuel\\Core\\File' => COREPATH . 'classes/file.php', 'Fuel\\Core\\File_Area' => COREPATH . 'classes/file/area.php', 'Fuel\\Core\\File_Exception' => COREPATH . 'classes/file/exception.php', 'Fuel\\Core\\File_Driver_File' => COREPATH . 'classes/file/driver/file.php', 'Fuel\\Core\\File_Driver_Directory' => COREPATH . 'classes/file/driver/directory.php', 'Fuel\\Core\\Form' => COREPATH . 'classes/form.php', 'Fuel\\Core\\Ftp' => COREPATH . 'classes/ftp.php', 'Fuel\\Core\\Html' => COREPATH . 'classes/html.php', 'Fuel\\Core\\Image' => COREPATH . 'classes/image.php', 'Fuel\\Core\\Image_Driver' => COREPATH . 'classes/image/driver.php', 'Fuel\\Core\\Image_Gd' => COREPATH . 'classes/image/gd.php', 'Fuel\\Core\\Image_Imagemagick' => COREPATH . 'classes/image/imagemagick.php', 'Fuel\\Core\\Inflector' => COREPATH . 'classes/inflector.php', 'Fuel\\Core\\Input' => COREPATH . 'classes/input.php', 'Fuel\\Core\\Lang' => COREPATH . 'classes/lang.php', 'Fuel\\Core\\Log' => COREPATH . 'classes/log.php', 'Fuel\\Core\\Migrate' => COREPATH . 'classes/migrate.php', 'Fuel\\Core\\Model' => COREPATH . 'classes/model.php', 'Fuel\\Core\\Mongo_DB' => COREPATH . 'classes/mongo/db.php', 'Fuel\\Core\\Mongo_Exception' => COREPATH . 'classes/mongo/exception.php', 'Fuel\\Core\\Output' => COREPATH . 'classes/output.php', 'Fuel\\Core\\Pagination' => COREPATH . 'classes/pagination.php', 'Fuel\\Core\\Profiler' => COREPATH . 'classes/profiler.php', 'Fuel\\Core\\Request' => COREPATH . 'classes/request.php', 'Fuel\\Core\\Redis' => COREPATH . 'classes/redis.php', 'Fuel\\Core\\Redis_Exception' => COREPATH . 'classes/redis/exception.php', 'Fuel\\Core\\Response' => COREPATH . 'classes/response.php', 'Fuel\\Core\\Route' => COREPATH . 'classes/route.php', 'Fuel\\Core\\Router' => COREPATH . 'classes/router.php', 'Fuel\\Core\\Security' => COREPATH . 'classes/security.php', 'Fuel\\Core\\Session' => COREPATH . 'classes/session.php', 'Fuel\\Core\\Session_Driver' => COREPATH . 'classes/session/driver.php', 'Fuel\\Core\\Session_Db' => COREPATH . 'classes/session/db.php', 'Fuel\\Core\\Session_Cookie' => COREPATH . 'classes/session/cookie.php', 'Fuel\\Core\\Session_File' => COREPATH . 'classes/session/file.php', 'Fuel\\Core\\Session_Memcached' => COREPATH . 'classes/session/memcached.php', 'Fuel\\Core\\Session_Redis' => COREPATH . 'classes/session/redis.php', 'Fuel\\Core\\Str' => COREPATH . 'classes/str.php', 'Fuel\\Core\\TestCase' => COREPATH . 'classes/testcase.php', 'Fuel\\Core\\Uri' => COREPATH . 'classes/uri.php', 'Fuel\\Core\\Unzip' => COREPATH . 'classes/unzip.php', 'Fuel\\Core\\Upload' => COREPATH . 'classes/upload.php', 'Fuel\\Core\\Validation' => COREPATH . 'classes/validation.php', 'Fuel\\Core\\Validation_Error' => COREPATH . 'classes/validation/error.php', 'Fuel\\Core\\View' => COREPATH . 'classes/view.php', 'Fuel\\Core\\View_Exception' => COREPATH . 'classes/view/exception.php', 'Fuel\\Core\\ViewModel' => COREPATH . 'classes/viewmodel.php'));
/* End of file bootstrap.php */
示例5: setup_autoloader
function setup_autoloader()
{
Autoloader::add_namespace('Fuel\\Core', COREPATH . 'classes/');
Autoloader::add_namespace('PHPSecLib', COREPATH . 'vendor' . DS . 'phpseclib' . DS, true);
Autoloader::add_classes(array('Fuel\\Core\\Agent' => COREPATH . 'classes/agent.php', 'Fuel\\Core\\Arr' => COREPATH . 'classes/arr.php', 'Fuel\\Core\\Asset' => COREPATH . 'classes/asset.php', 'Fuel\\Core\\Asset_Instance' => COREPATH . 'classes/asset/instance.php', 'Fuel\\Core\\Cache' => COREPATH . 'classes/cache.php', 'Fuel\\Core\\CacheNotFoundException' => COREPATH . 'classes/cache/notfound.php', 'Fuel\\Core\\CacheExpiredException' => COREPATH . 'classes/cache.php', 'Fuel\\Core\\Cache_Handler_Driver' => COREPATH . 'classes/cache/handler/driver.php', 'Fuel\\Core\\Cache_Handler_Json' => COREPATH . 'classes/cache/handler/json.php', 'Fuel\\Core\\Cache_Handler_Serialized' => COREPATH . 'classes/cache/handler/serialized.php', 'Fuel\\Core\\Cache_Handler_String' => COREPATH . 'classes/cache/handler/string.php', 'Fuel\\Core\\Cache_Storage_Driver' => COREPATH . 'classes/cache/storage/driver.php', 'Fuel\\Core\\Cache_Storage_Apc' => COREPATH . 'classes/cache/storage/apc.php', 'Fuel\\Core\\Cache_Storage_File' => COREPATH . 'classes/cache/storage/file.php', 'Fuel\\Core\\Cache_Storage_Memcached' => COREPATH . 'classes/cache/storage/memcached.php', 'Fuel\\Core\\Cache_Storage_Redis' => COREPATH . 'classes/cache/storage/redis.php', 'Fuel\\Core\\Config' => COREPATH . 'classes/config.php', 'Fuel\\Core\\ConfigException' => COREPATH . 'classes/config.php', 'Fuel\\Core\\Config_File' => COREPATH . 'classes/config/file.php', 'Fuel\\Core\\Config_Ini' => COREPATH . 'classes/config/ini.php', 'Fuel\\Core\\Config_Json' => COREPATH . 'classes/config/json.php', 'Fuel\\Core\\Config_Interface' => COREPATH . 'classes/config/interface.php', 'Fuel\\Core\\Config_Php' => COREPATH . 'classes/config/php.php', 'Fuel\\Core\\Config_Yml' => COREPATH . 'classes/config/yml.php', 'Fuel\\Core\\Controller' => COREPATH . 'classes/controller.php', 'Fuel\\Core\\Controller_Rest' => COREPATH . 'classes/controller/rest.php', 'Fuel\\Core\\Controller_Template' => COREPATH . 'classes/controller/template.php', 'Fuel\\Core\\Controller_Hybrid' => COREPATH . 'classes/controller/hybrid.php', 'Fuel\\Core\\Cookie' => COREPATH . 'classes/cookie.php', 'Fuel\\Core\\DB' => COREPATH . 'classes/db.php', 'Fuel\\Core\\DBUtil' => COREPATH . 'classes/dbutil.php', 'Fuel\\Core\\Database_Connection' => COREPATH . 'classes/database/connection.php', 'Fuel\\Core\\Database_Exception' => COREPATH . 'classes/database/exception.php', 'Fuel\\Core\\Database_Expression' => COREPATH . 'classes/database/expression.php', 'Fuel\\Core\\Database_Pdo_Connection' => COREPATH . 'classes/database/pdo/connection.php', 'Fuel\\Core\\Database_Query' => COREPATH . 'classes/database/query.php', 'Fuel\\Core\\Database_Query_Builder' => COREPATH . 'classes/database/query/builder.php', 'Fuel\\Core\\Database_Query_Builder_Insert' => COREPATH . 'classes/database/query/builder/insert.php', 'Fuel\\Core\\Database_Query_Builder_Delete' => COREPATH . 'classes/database/query/builder/delete.php', 'Fuel\\Core\\Database_Query_Builder_Update' => COREPATH . 'classes/database/query/builder/update.php', 'Fuel\\Core\\Database_Query_Builder_Select' => COREPATH . 'classes/database/query/builder/select.php', 'Fuel\\Core\\Database_Query_Builder_Where' => COREPATH . 'classes/database/query/builder/where.php', 'Fuel\\Core\\Database_Query_Builder_Join' => COREPATH . 'classes/database/query/builder/join.php', 'Fuel\\Core\\Database_Result' => COREPATH . 'classes/database/result.php', 'Fuel\\Core\\Database_Result_Cached' => COREPATH . 'classes/database/result/cached.php', 'Fuel\\Core\\Database_Mysql_Connection' => COREPATH . 'classes/database/mysql/connection.php', 'Fuel\\Core\\Database_MySQL_Result' => COREPATH . 'classes/database/mysql/result.php', 'Fuel\\Core\\Database_Mysqli_Connection' => COREPATH . 'classes/database/mysqli/connection.php', 'Fuel\\Core\\Database_MySQLi_Result' => COREPATH . 'classes/database/mysqli/result.php', 'Fuel\\Core\\Fuel' => COREPATH . 'classes/fuel.php', 'Fuel\\Core\\FuelException' => COREPATH . 'classes/fuel.php', 'Fuel\\Core\\Finder' => COREPATH . 'classes/finder.php', 'Fuel\\Core\\Date' => COREPATH . 'classes/date.php', 'Fuel\\Core\\Debug' => COREPATH . 'classes/debug.php', 'Fuel\\Core\\Cli' => COREPATH . 'classes/cli.php', 'Fuel\\Core\\Crypt' => COREPATH . 'classes/crypt.php', 'Fuel\\Core\\Event' => COREPATH . 'classes/event.php', 'Fuel\\Core\\Event_Instance' => COREPATH . 'classes/event/instance.php', 'Fuel\\Core\\Error' => COREPATH . 'classes/error.php', 'Fuel\\Core\\PhpErrorException' => COREPATH . 'classes/error.php', 'Fuel\\Core\\Format' => COREPATH . 'classes/format.php', 'Fuel\\Core\\Fieldset' => COREPATH . 'classes/fieldset.php', 'Fuel\\Core\\Fieldset_Field' => COREPATH . 'classes/fieldset/field.php', 'Fuel\\Core\\File' => COREPATH . 'classes/file.php', 'Fuel\\Core\\FileAccessException' => COREPATH . 'classes/file.php', 'Fuel\\Core\\OutsideAreaException' => COREPATH . 'classes/file.php', 'Fuel\\Core\\InvalidPathException' => COREPATH . 'classes/file.php', 'Fuel\\Core\\File_Area' => COREPATH . 'classes/file/area.php', 'Fuel\\Core\\File_Handler_File' => COREPATH . 'classes/file/handler/file.php', 'Fuel\\Core\\File_Handler_Directory' => COREPATH . 'classes/file/handler/directory.php', 'Fuel\\Core\\Form' => COREPATH . 'classes/form.php', 'Fuel\\Core\\Form_Instance' => COREPATH . 'classes/form/instance.php', 'Fuel\\Core\\Ftp' => COREPATH . 'classes/ftp.php', 'Fuel\\Core\\FtpConnectionException' => COREPATH . 'classes/ftp.php', 'Fuel\\Core\\FtpFileAccessException' => COREPATH . 'classes/ftp.php', 'Fuel\\Core\\HttpException' => COREPATH . 'classes/httpexception.php', 'Fuel\\Core\\HttpNotFoundException' => COREPATH . 'classes/httpexceptions.php', 'Fuel\\Core\\HttpServerErrorException' => COREPATH . 'classes/httpexceptions.php', 'Fuel\\Core\\Html' => COREPATH . 'classes/html.php', 'Fuel\\Core\\Image' => COREPATH . 'classes/image.php', 'Fuel\\Core\\Image_Driver' => COREPATH . 'classes/image/driver.php', 'Fuel\\Core\\Image_Gd' => COREPATH . 'classes/image/gd.php', 'Fuel\\Core\\Image_Imagemagick' => COREPATH . 'classes/image/imagemagick.php', 'Fuel\\Core\\Image_Imagick' => COREPATH . 'classes/image/imagick.php', 'Fuel\\Core\\Inflector' => COREPATH . 'classes/inflector.php', 'Fuel\\Core\\Input' => COREPATH . 'classes/input.php', 'Fuel\\Core\\Lang' => COREPATH . 'classes/lang.php', 'Fuel\\Core\\LangException' => COREPATH . 'classes/lang.php', 'Fuel\\Core\\Lang_File' => COREPATH . 'classes/lang/file.php', 'Fuel\\Core\\Lang_Ini' => COREPATH . 'classes/lang/ini.php', 'Fuel\\Core\\Lang_Json' => COREPATH . 'classes/lang/json.php', 'Fuel\\Core\\Lang_Interface' => COREPATH . 'classes/lang/interface.php', 'Fuel\\Core\\Lang_Php' => COREPATH . 'classes/lang/php.php', 'Fuel\\Core\\Lang_Yml' => COREPATH . 'classes/lang/yml.php', 'Fuel\\Core\\Log' => COREPATH . 'classes/log.php', 'Fuel\\Core\\Markdown' => COREPATH . 'classes/markdown.php', 'Fuel\\Core\\Migrate' => COREPATH . 'classes/migrate.php', 'Fuel\\Core\\Model' => COREPATH . 'classes/model.php', 'Fuel\\Core\\Model_Crud' => COREPATH . 'classes/model/crud.php', 'Fuel\\Core\\Module' => COREPATH . 'classes/module.php', 'Fuel\\Core\\ModuleNotFoundException' => COREPATH . 'classes/module.php', 'Fuel\\Core\\Mongo_Db' => COREPATH . 'classes/mongo/db.php', 'Fuel\\Core\\Mongo_DbException' => COREPATH . 'classes/mongo/db.php', 'Fuel\\Core\\Output' => COREPATH . 'classes/output.php', 'Fuel\\Core\\Package' => COREPATH . 'classes/package.php', 'Fuel\\Core\\PackageNotFoundException' => COREPATH . 'classes/package.php', 'Fuel\\Core\\Pagination' => COREPATH . 'classes/pagination.php', 'Fuel\\Core\\Profiler' => COREPATH . 'classes/profiler.php', 'Fuel\\Core\\Request' => COREPATH . 'classes/request.php', 'Fuel\\Core\\Request_Driver' => COREPATH . 'classes/request/driver.php', 'Fuel\\Core\\RequestException' => COREPATH . 'classes/request/driver.php', 'Fuel\\Core\\RequestStatusException' => COREPATH . 'classes/request/driver.php', 'Fuel\\Core\\Request_Curl' => COREPATH . 'classes/request/curl.php', 'Fuel\\Core\\Request_Soap' => COREPATH . 'classes/request/soap.php', 'Fuel\\Core\\Redis' => COREPATH . 'classes/redis.php', 'Fuel\\Core\\RedisException' => COREPATH . 'classes/redis.php', 'Fuel\\Core\\Response' => COREPATH . 'classes/response.php', 'Fuel\\Core\\Route' => COREPATH . 'classes/route.php', 'Fuel\\Core\\Router' => COREPATH . 'classes/router.php', 'Fuel\\Core\\Security' => COREPATH . 'classes/security.php', 'Fuel\\Core\\Session' => COREPATH . 'classes/session.php', 'Fuel\\Core\\Session_Driver' => COREPATH . 'classes/session/driver.php', 'Fuel\\Core\\Session_Db' => COREPATH . 'classes/session/db.php', 'Fuel\\Core\\Session_Cookie' => COREPATH . 'classes/session/cookie.php', 'Fuel\\Core\\Session_File' => COREPATH . 'classes/session/file.php', 'Fuel\\Core\\Session_Memcached' => COREPATH . 'classes/session/memcached.php', 'Fuel\\Core\\Session_Redis' => COREPATH . 'classes/session/redis.php', 'Fuel\\Core\\Session_Exception' => COREPATH . 'classes/session/exception.php', 'Fuel\\Core\\Num' => COREPATH . 'classes/num.php', 'Fuel\\Core\\Str' => COREPATH . 'classes/str.php', 'Fuel\\Core\\TestCase' => COREPATH . 'classes/testcase.php', 'Fuel\\Core\\Theme' => COREPATH . 'classes/theme.php', 'Fuel\\Core\\ThemeException' => COREPATH . 'classes/theme.php', 'Fuel\\Core\\Uri' => COREPATH . 'classes/uri.php', 'Fuel\\Core\\Unzip' => COREPATH . 'classes/unzip.php', 'Fuel\\Core\\Upload' => COREPATH . 'classes/upload.php', 'Fuel\\Core\\Validation' => COREPATH . 'classes/validation.php', 'Fuel\\Core\\Validation_Error' => COREPATH . 'classes/validation/error.php', 'Fuel\\Core\\View' => COREPATH . 'classes/view.php', 'Fuel\\Core\\ViewModel' => COREPATH . 'classes/viewmodel.php'));
}
示例6:
<?php
// Add namespace, necessary if you want the autoloader to be able to find classes
Autoloader::add_namespace('curl_http_client', __DIR__ . '/classes/');
// Add as core namespace
Autoloader::add_core_namespace('curl_http_client');
// Add as core namespace (classes are aliased to global, thus useable without namespace prefix)
// Set the second argument to true to prefix and be able to overwrite core classes
Autoloader::add_core_namespace('curl_http_client', true);
// And add the classes, this is useful for:
// - optimization: no path searching is necessary
// - it's required to be able to use as a core namespace
// - if you want to break the autoloader's path search rules
Autoloader::add_classes(array('curl_http_client\\curl_http_client' => __DIR__ . '/classes/curl_http_client.php'));
示例7:
<?php
Autoloader::add_namespace('\\Social', __DIR__ . '/classes');
Autoloader::add_classes(array('Social\\Facebook' => __DIR__ . '/classes/facebook.php', 'Social\\Twitter' => __DIR__ . '/classes/twitter.php'));
示例8:
<?php
/**
* Seo Package
*
* @package Seo
* @version 0.1
* @author Hinashiki
* @license MIT License
* @copyright 2015 - Hinashiki
* @link https://github.com/hinashiki/fuelphp-seo
*/
\Autoloader::add_namespace('Seo', __DIR__ . '/classes/');
\Autoloader::add_core_namespace('Seo');
\Autoloader::add_classes(array('Seo\\Seo' => __DIR__ . '/classes/seo.php', 'Seo\\Seo_Html' => __DIR__ . '/classes/seo/html.php', 'Seo\\Route' => __DIR__ . '/classes/route.php', 'Seo\\Query' => __DIR__ . '/classes/query.php', 'Seo\\Pagination' => __DIR__ . '/classes/pagination.php'));
\Config::load('seo', true);
示例9: isset
<?php
// Bootstrap the framework DO NOT edit this
require COREPATH . 'bootstrap.php';
Autoloader::add_namespace('OAuth2', APPPATH . 'vendor' . DS . 'OAuth2');
\Autoloader::add_classes(array('QRcode' => APPPATH . 'vendor/QRcode/phpqrcode.php'));
// Register the autoloader
\Autoloader::register();
//$_SERVER['FUEL_ENV'] = Fuel::PRODUCTION;
/**
* Your environment. Can be set to any of the following:
*
* Fuel::DEVELOPMENT
* Fuel::TEST
* Fuel::STAGING
* Fuel::PRODUCTION
*/
\Fuel::$env = isset($_SERVER['FUEL_ENV']) ? $_SERVER['FUEL_ENV'] : \Fuel::DEVELOPMENT;
// Initialize the framework with the config file.
\Fuel::init('config.php');
示例10:
<?php
Autoloader::add_namespace('\\Twitter', __DIR__.'/classes');
示例11:
<?php
/**
* Queue Package
*
* @package Queue
* @version 0.2
* @author Hinashiki
* @license MIT License
* @copyright 2015 - Hinashiki
* @link https://github.com/hinashiki/fuelphp-queue
*/
\Package::load('orm');
\Autoloader::add_namespace('Queue', __DIR__ . '/classes/');
\Autoloader::add_core_namespace('Queue');
\Autoloader::add_classes(array('Queue\\Model_TaskQueue' => __DIR__ . '/classes/model/taskqueue.php'));
\Config::load('queue', true);
示例12:
<?php
/**
* Add maintenance mode
*
* @package Maintenance
* @version 0.1
* @author Hinashiki
* @license MIT License
* @copyright 2015 - Hinashiki
* @link https://github.com/hinashiki/fuelphp-maintenance
*/
\Autoloader::add_namespace('Maintenance', __DIR__ . '/classes/');
\Autoloader::add_core_namespace('Maintenance');
\Config::load('maintenance', true);
\Autoloader::add_classes(array('Maintenance\\HttpServerMaintenanceException' => __DIR__ . '/classes/httpexceptions.php', 'Maintenance\\MaintenanceMode' => __DIR__ . '/classes/maintenance.php'));
示例13: class_alias
<?php
// Load in the Autoloader
require COREPATH . 'classes' . DIRECTORY_SEPARATOR . 'autoloader.php';
class_alias('Fuel\\Core\\Autoloader', 'Autoloader');
// Bootstrap the framework DO NOT edit this
require COREPATH . 'bootstrap.php';
Autoloader::add_classes(array());
Autoloader::add_namespace('Collection', APPPATH . 'classes/collection');
// Register the autoloader
Autoloader::register();
/**
* Your environment. Can be set to any of the following:
*
* Fuel::DEVELOPMENT
* Fuel::TEST
* Fuel::STAGE
* Fuel::PRODUCTION
*/
Fuel::$env = isset($_SERVER['FUEL_ENV']) ? $_SERVER['FUEL_ENV'] : Fuel::DEVELOPMENT;
// Initialize the framework with the config file.
Fuel::init('config.php');
示例14: function
<?php
Autoloader::add_namespace('Helper', __DIR__.'/classes/');
Autoloader::add_core_namespace('Helper');
/*
* Allow users to extends Package classes from app:classes/helper/
* Class should Avoid *Helper suffix, and be namespaced in Helper.
* ie:
* namespace Helper;
* class Date extends DateHelper {}
*
*/
// convert class to procedural if asked
call_user_func(function(){
include_once __DIR__.'/config/bootstrap.php';
$boot = null;
if ($helper_bt['convert_to_procedural'] === true)
{
$boot = function($class) use($helper_bt) {
$methods = get_class_methods($class);
foreach ($methods as $method)
{
if (! in_array($method, $helper_bt['procedural_blacklist'][strtolower($class)]))
{