本文整理汇总了PHP中Yaf_Loader类的典型用法代码示例。如果您正苦于以下问题:PHP Yaf_Loader类的具体用法?PHP Yaf_Loader怎么用?PHP Yaf_Loader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Yaf_Loader类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _initSmarty
public function _initSmarty(Yaf_Dispatcher $dispatcher)
{
/* init smarty view engine */
Yaf_Loader::import("Smarty/Adapter.php");
$smarty = new Smarty_Adapter(null, Yaf_Application::app()->getConfig()->smarty);
$dispatcher->setView($smarty);
}
开发者ID:gangjun911,项目名称:yaf-examples,代码行数:7,代码来源:Bootstrap.php
示例2: _initPlugin
function _initPlugin(Yaf_Dispatcher $dispatcher)
{
Yaf_Loader::import('vendor/autoload.php');
$dispatcher->registerPlugin(new Plugin_Init());
$dispatcher->registerPlugin(new Plugin_Smarty());
$dispatcher->registerPlugin(new LoginPlugin());
}
开发者ID:Zjmainstay,项目名称:php-doc-management,代码行数:7,代码来源:Bootstrap.php
示例3: initContext
private static function initContext()
{
// set timezone
date_default_timezone_set('PRC');
// page start time,use $_SERVER['REQUEST_TIME'] instead above PHP 5.4+
define('REQUEST_TIME_US', intval(microtime(true) * 1000000));
// ODP pre-defined
define('IS_ODP', true);
define('ROOT_PATH', realpath(dirname(__FILE__) . '/../../../'));
define('CONF_PATH', ROOT_PATH . '/conf');
define('DATA_PATH', ROOT_PATH . '/data');
define('BIN_PATH', ROOT_PATH . '/php/bin');
define('LOG_PATH', ROOT_PATH . '/log');
define('APP_PATH', ROOT_PATH . '/app');
define('TPL_PATH', ROOT_PATH . '/template');
define('LIB_PATH', ROOT_PATH . '/php/phplib');
define('WEB_ROOT', ROOT_PATH . '/webroot');
define('PHP_EXEC', BIN_PATH . '/php');
$app_name == null && ($app_name = self::getAppName()) == null && ($app_name = 'unknown-app');
define('ODP_APP', $app_name);
define('APP', ODP_APP);
$loader = \Yaf_Loader::getInstance(null, LIB_PATH);
//var_dump($loader);
define('CLIENT_IP', \Odp\Ip::getClientIp());
define('USER_IP', \Odp\Ip::getUserIp());
define('FRONTEND_IP', \Odp\Ip::getFrontendIp());
// init autoloader
// todo PSR-4 autoloader
return true;
}
开发者ID:fanscout,项目名称:omz,代码行数:30,代码来源:Init.php
示例4: initYafBySooh
/**
*
* @param \Yaf_Dispatcher $dispatcher
* @param string $jqueryVer 使用的jquery文件,默认值:jquery-1.11.2.min.js
* @return view
*/
public static function initYafBySooh($dispatcher, $jqueryVer = 'jquery-1.11.2.min.js')
{
$router = $dispatcher->getRouter();
$router->addRoute("byVar", new \Yaf_Route_Supervar(SOOH_ROUTE_VAR));
\Yaf_Loader::getInstance()->registerLocalNameSpace($GLOBALS['CONF']['localLibs']);
$req = $dispatcher->getRequest();
$tmp = $req->get('__ONLY__');
if ($tmp == 'body') {
\SoohYaf\Viewext::$bodyonly = true;
}
$tmp = trim($req->get('__VIEW__'));
//html(default),wap, json
define('VIW_INC_PATH', APP_PATH . '/application/views/_inc/');
\SoohYaf\Viewext::$jqueryVer = $jqueryVer;
if (!empty($tmp)) {
$tmp = strtolower($tmp);
\Sooh\Base\Ini::getInstance()->viewRenderType($tmp);
if ($tmp == 'jsonp') {
\Sooh\Base\Ini::getInstance()->initGobal(array('nameJsonP' => $req->get('jsonp', 'jsonp')));
}
}
// $tmp = $dispatcher->getRequest()->get('__GZIP__');
// if(!empty($tmp)){
// $tmp = strtolower ($tmp);
// if($tmp=='gzip')define("ZIP_OUTPUT",$tmp);
// }
$view = new \SoohYaf\Viewext(null);
$dispatcher->setView($view);
$dispatcher->registerPlugin(new SoohPlugin());
return $view;
}
开发者ID:hillstill,项目名称:soohyaf,代码行数:37,代码来源:SoohPlugin.php
示例5: _initDebug
/**
* 开启调试输出
* @method _initDebug
* @author NewFuture
*/
public function _initDebug()
{
if (Config::get('isdebug')) {
/*加载 PHP Console Debug模块*/
Yaf_Loader::import('PhpConsole/__autoload.php');
$connector = PhpConsole\Connector::getInstance();
if ($connector->isActiveClient()) {
Log::write('PHP Console 已经链接', 'INFO');
$handler = PhpConsole\Handler::getInstance();
$dispatcher = $connector->getDebugDispatcher();
$handler->start();
$connector->setSourcesBasePath(APP_PATH);
$connector->setServerEncoding('utf8');
$dispatcher->detectTraceAndSource = true;
//跟踪信息
if ($pwd = Config::get('debug.auth')) {
$connector->setPassword($pwd);
$evalProvider = $connector->getEvalDispatcher()->getEvalProvider();
// $evalProvider->disableFileAccessByOpenBaseDir(); // means disable functions like include(), require(), file_get_contents() & etc
// $evalProvider->addSharedVar('uri', $_SERVER['REQUEST_URI']); // so you can access $_SERVER['REQUEST_URI'] just as $uri in terminal
// $evalProvider->addSharedVarReference('post', $_POST);
$connector->startEvalRequestsListener();
}
}
PhpConsole\Helper::register();
}
}
开发者ID:derek-chow,项目名称:YunYinService,代码行数:32,代码来源:Debug.php
示例6: _initBase
/**
* 函数名称:_initBase
* 功能描述:引入基础base类
*/
public function _initBase()
{
Yaf_Loader::import(BASE_PATH . '/BaseAdminController.php');
Yaf_Loader::import(BASE_PATH . '/BaseIndexController.php');
Yaf_Loader::import(BASE_PATH . '/BaseAdminModel.php');
Yaf_Loader::import(BASE_PATH . '/BaseIndexModel.php');
}
开发者ID:qiaoweizhen,项目名称:yaf,代码行数:11,代码来源:bootstrap.php
示例7: _initRoutes
/**
* [路由设置]
*/
public function _initRoutes(Yaf_Dispatcher $dispatcher)
{
$router = $dispatcher->getRouter();
//$router->addConfig(Yaf_Registry::get('config')->routes);
Yaf_Loader::import(APP_CONFIG . '/route.php');
$router->addConfig($routeConfigs);
}
开发者ID:zhangxinvip,项目名称:YafUse,代码行数:10,代码来源:Bootstrap.php
示例8: __construct
public function __construct()
{
$config = Yaf_Application::app()->getConfig();
Yaf_Loader::import('L_Wechat');
$options = array('token' => self::WX_TOKEN, 'appid' => $config['wx_appID'], 'appsecret' => $config['wx_appsecret'], 'access_token' => $config['wx_access_token'], 'expires' => $config['wx_expires']);
$this->wxSDK = new L_Wechat($options);
}
开发者ID:GobYang,项目名称:thaidh,代码行数:7,代码来源:Com_Weixin.php
示例9: _initCore
public function _initCore()
{
define('TB_PREFIX', 'zt_');
define('APP_NAME', 'YOF-DEMO');
define('LIB_PATH', APP_PATH . '/application/library');
define('MODEL_PATH', APP_PATH . '/application/model');
define('FUNC_PATH', APP_PATH . '/application/function');
define('ADMIN_PATH', APP_PATH . '/application/modules/Admin');
// CSS, JS, IMG PATH
define('CSS_PATH', '/css');
define('JS_PATH', '/js');
define('IMG_PATH', '/img');
// Admin CSS, JS PATH
define('ADMIN_CSS_PATH', '/admin/css');
define('ADMIN_JS_PATH', '/admin/js');
Yaf_Loader::import('M_Model.pdo.php');
Yaf_Loader::import('Helper.class.php');
Helper::import('Basic');
Helper::import('Network');
Yaf_Loader::import('C_Basic.php');
Yaf_Loader::import(LIB_PATH . '/yar/Yar_Basic.php');
// header.html and left.html
define('HEADER_HTML', APP_PATH . '/public/common/header.html');
define('LEFT_HTML', APP_PATH . '/public/common/left.html');
// API KEY for api sign
define('API_KEY', 'THIS_is_OUR_API_keY');
}
开发者ID:udeth,项目名称:YOF,代码行数:27,代码来源:Bootstrap.php
示例10: init
/**
* method to control and navigate the user to the right view
*/
public function init()
{
if (APPLICATION_ENV === 'prod') {
// TODO: set the branch through config
$branch = 'production';
if (file_exists(APPLICATION_PATH . '/.git/refs/heads/' . $branch)) {
$this->commit = rtrim(file_get_contents(APPLICATION_PATH . '/.git/refs/heads/' . $branch), "\n");
} else {
$this->commit = md5(date('ymd'));
}
} else {
$this->commit = md5(time());
}
$this->baseUrl = $this->getRequest()->getBaseUri();
$this->addCss($this->baseUrl . '/css/bootstrap.min.css');
$this->addCss($this->baseUrl . '/css/bootstrap-datetimepicker.min.css');
$this->addCss($this->baseUrl . '/css/bootstrap-switch.css');
$this->addCss($this->baseUrl . '/css/bootstrap-multiselect.css');
$this->addCss($this->baseUrl . '/css/jsoneditor.css');
$this->addCss($this->baseUrl . '/css/main.css');
$this->addJs($this->baseUrl . '/js/vendor/bootstrap.min.js');
$this->addJs($this->baseUrl . '/js/plugins.js');
$this->addJs($this->baseUrl . '/js/moment.js');
$this->addJs($this->baseUrl . '/js/bootstrap-datetimepicker.min.js');
$this->addJs($this->baseUrl . '/js/jquery.jsoneditor.js');
$this->addJs($this->baseUrl . '/js/bootstrap-multiselect.js');
$this->addJs($this->baseUrl . '/js/bootstrap-switch.js');
$this->addJs($this->baseUrl . '/js/jquery.csv-0.71.min.js');
$this->addJs($this->baseUrl . '/js/main.js');
Yaf_Loader::getInstance(APPLICATION_PATH . '/application/helpers')->registerLocalNamespace('Admin');
}
开发者ID:ngchie,项目名称:system,代码行数:34,代码来源:Admin.php
示例11: _initCore
public function _initCore()
{
define('TB_PK', 'id');
// 表的主键, 用于 SelectByID 等
define('TB_PREFIX', 'zt_');
// 表前缀
define('APP_NAME', 'YOF-DEMO');
define('LIB_PATH', APP_PATH . '/application/library/');
define('MODEL_PATH', APP_PATH . '/application/model');
define('FUNC_PATH', APP_PATH . '/application/function');
define('ADMIN_PATH', APP_PATH . '/application/modules/Admin');
// CSS, JS, IMG PATH
define('CSS_PATH', '/css');
define('JS_PATH', '/js');
define('IMG_PATH', '/img');
// Admin CSS, JS PATH
define('ADMIN_CSS_PATH', '/admin/css');
define('ADMIN_JS_PATH', '/admin/js');
// 设置自动加载的目录
ini_set('yaf.library', LIB_PATH);
// 导入 F_Basic.php 与 F_Network.php
Helper::import('Basic');
Helper::import('Network');
Yaf_Loader::import('C_Basic.php');
Yaf_Loader::import(LIB_PATH . '/yar/Yar_Basic.php');
// header.html and left.html
define('HEADER_HTML', APP_PATH . '/public/common/header.html');
define('LEFT_HTML', APP_PATH . '/public/common/left.html');
// API KEY for api sign
define('API_KEY', 'THIS_is_OUR_API_keY');
}
开发者ID:xinuxZ,项目名称:YOF,代码行数:31,代码来源:Bootstrap.php
示例12: _initPlugin
public function _initPlugin(Yaf_Dispatcher $dispatcher)
{
// set include paths of the system.
set_include_path(get_include_path() . PATH_SEPARATOR . Yaf_Loader::getInstance()->getLibraryPath());
/* register a billrun plugin system from config */
$config = Yaf_Application::app()->getConfig();
if (isset($config->plugins)) {
$plugins = $config->plugins->toArray();
$dispatcher = Billrun_Dispatcher::getInstance();
foreach ($plugins as $plugin) {
Billrun_Log::getInstance()->log("Load plugin " . $plugin, Zend_log::DEBUG);
$dispatcher->attach(new $plugin());
}
}
if (isset($config->chains)) {
$chains = $config->chains->toArray();
$dispatcherChain = Billrun_Dispatcher::getInstance(array('type' => 'chain'));
foreach ($chains as $chain) {
Billrun_Log::getInstance()->log("Load plugin " . $chain, Zend_log::DEBUG);
$dispatcherChain->attach(new $chain());
}
}
// make the base action auto load (required by controllers actions)
Yaf_Loader::getInstance(APPLICATION_PATH . '/application/helpers')->registerLocalNamespace('Action');
}
开发者ID:kalburgimanjunath,项目名称:system,代码行数:25,代码来源:Bootstrap.php
示例13: __construct
public function __construct()
{
$config = Yaf_Application::app()->getConfig();
Yaf_Loader::import('L_Wechat.class.php');
$options = array('token' => $config['wx_token'], 'appid' => $config['wx_appID'], 'appsecret' => $config['wx_appSecret']);
$this->wxSDK = new L_Wechat($options);
}
开发者ID:xujunjiepk,项目名称:YOF,代码行数:7,代码来源:Com_Weixin.php
示例14: _initConfig
public function _initConfig(\Yaf_Dispatcher $dispatcher)
{
/*{{{*/
$this->config = Yaf_Application::app()->getConfig()->toArray();
Yaf_Registry::set('configarr', $this->config);
// 加载默认定义
\Yaf_Loader::import(APP_PATH . '/conf/defines.inc.php');
}
开发者ID:xujunjiepk,项目名称:yaf_base,代码行数:8,代码来源:Bootstrap.php
示例15: __construct
function __construct()
{
Yaf_Loader::import('qiniu/io.php');
Yaf_Loader::import('qiniu/rs.php');
Yaf_Loader::import('qiniu/config.php');
$this->bucket = $bucket;
$this->accessKey = $accessKey;
$this->secretKey = $secretKey;
}
开发者ID:GobYang,项目名称:thaidh,代码行数:9,代码来源:L_Qiniu.class.php
示例16: __construct
function __construct()
{
Yaf_Loader::import('qiniu/io.php');
Yaf_Loader::import('qiniu/rs.php');
$config = Yaf_Application::app()->getConfig();
$this->bucket = $config['qiniu_bucket'];
$this->accessKey = $config['qiniu_accessKey'];
$this->secretKey = $config['qiniu_secretKey'];
}
开发者ID:udeth,项目名称:YOF,代码行数:9,代码来源:L_Qiniu.class.php
示例17: autoload
public static function autoload($class)
{
if (strpos($class, 'Builder') === strlen($class) - 7) {
Yaf_Loader::import(sprintf('%s/application/views/builder/%s.php', APPLICATION_PATH, $class));
} else {
if (strpos($class, 'Halo') === 0) {
Yaf_Loader::import(sprintf('%s/library/halo/%s.php', APPLICATION_PATH, $class));
}
}
}
开发者ID:YexuanGuo,项目名称:php-cms,代码行数:10,代码来源:LocalAutoLoader.php
示例18: loadEssentials
public static function loadEssentials()
{
Yaf_Loader::import(sprintf('%s/yaf/YafController.php', LIB_PATH));
Yaf_Loader::import(sprintf('%s/yaf/YafDebug.php', LIB_PATH));
Yaf_Loader::import(sprintf('%s/yaf/YafView.php', LIB_PATH));
Yaf_Loader::import(sprintf('%s/yaf/LocalAutoLoader.php', LIB_PATH));
Yaf_Loader::import(sprintf('%s/yaf/yar.php', LIB_PATH));
Yaf_Loader::import(sprintf('%s/yaf/YafController.php', LIB_PATH));
LocalAutoLoader::register();
}
开发者ID:YexuanGuo,项目名称:php-cms,代码行数:10,代码来源:SystemConfig.php
示例19: init
/**
* initialize method for yaf controller (instead of constructor)
*/
public function init()
{
// all output will be store at class output class
$this->output = new stdClass();
$this->getView()->output = $this->output;
// set the actions autoloader
Yaf_Loader::getInstance(APPLICATION_PATH . '/application/helpers')->registerLocalNamespace("Action");
$this->setActions();
$this->setOutputMethod();
}
开发者ID:ngchie,项目名称:system,代码行数:13,代码来源:Api.php
示例20: getInstance
public static function getInstance()
{
if (!self::$instance) {
$file_system = Yaf_Registry::get('config')->file->file_system;
if (!empty($file_system) && file_exists(dirname(__FILE__) . '/' . $file_system . '.php')) {
Yaf_Loader::import(dirname(__FILE__) . '/' . $file_system . '.php');
self::$instance = new $file_system();
}
}
return self::$instance;
}
开发者ID:EGGISGOOD,项目名称:php_tool,代码行数:11,代码来源:File.php
注:本文中的Yaf_Loader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论