本文整理汇总了PHP中loader函数的典型用法代码示例。如果您正苦于以下问题:PHP loader函数的具体用法?PHP loader怎么用?PHP loader使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了loader函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: factory
function factory($type, $native = null)
{
loader('dyn');
$what = ucfirst(Inflector::camelize($type . '_factory'));
$class = 'Thin\\' . $what;
if (!class_exists($class)) {
$code = 'namespace Thin; class ' . $what . ' extends DynLib {}';
eval($code);
}
return new $class($native);
}
示例2: loader
function loader($path)
{
foreach (scandir($path) as $filename) {
if ($filename === '.' || $filename === '..') {
continue;
}
$fullPath = $path . '/' . $filename;
if (is_file($fullPath)) {
require_once $fullPath;
} elseif (is_dir($fullPath)) {
loader($fullPath);
}
}
}
示例3: add
function add($filename, $patterns)
{
if (!is_string($filename)) {
throw new \Exception('$filename argument must be string');
}
if (is_string($patterns)) {
$patterns = array($patterns);
} else {
if (!is_array($patterns)) {
throw new \Exception('$patterns argument must be string or array');
}
}
$fullPath = implode('/', fromStack());
$fullFilename = empty($fullPath) ? $fullPath . '/' . $filename : $filename;
$module = new Module($filename, realpath($fullFilename), $patterns);
loader()->addModule($module);
return $module;
}
示例4: loader
<?php
/**
* Thin is a swift Framework for PHP 5.4+
*
* @package Thin
* @version 1.0
* @author Gerald Plusquellec
* @license BSD License
* @copyright 1996 - 2015 Gerald Plusquellec
* @link http://github.com/schpill/thin
*/
namespace Thin;
loader('session');
class SessionCore extends SessionLib
{
}
示例5: loader
?>
"></div>
<?/*end comments*/?>
</div>
<?/*form*/?>
<?include($_SERVER['DOCUMENT_ROOT'].'/includes/product/reviews/form.php');?>
<?/*end form*/?>
</div>
<div class="tab-content-item" id="<?php
echo $arParams['ROUTE_STORE'];
?>
">
<div class="container">
<?php
echo loader($arParams['ROUTE_STORE']);
?>
<?/*store*/?>
<div id="route-<?php
echo $arParams['ROUTE_STORE'];
?>
"></div>
<?/*end store*/?>
</div>
</div>
</div>
</div>
<?/*end more info and tabs*/?>
</div>
示例6: log_message
function log_message($level = "error", $message = "")
{
static $_log;
$_log =& loader("Log");
$_log->write_function($level, $message);
}
示例7: loader
<?php
/**
* Thin is a swift Framework for PHP 5.4+
*
* @package Thin
* @version 1.0
* @author Gerald Plusquellec
* @license BSD License
* @copyright 1996 - 2016 Gerald Plusquellec
* @link http://github.com/schpill/thin
*/
namespace Thin;
loader('pipeline');
class QueueCore extends PipelineLib
{
}
示例8: loader
<?php
/**
* Thin is a swift Framework for PHP 5.4+
*
* @package Thin
* @version 1.0
* @author Gerald Plusquellec
* @license BSD License
* @copyright 1996 - 2015 Gerald Plusquellec
* @link http://github.com/schpill/thin
*/
namespace Thin;
loader('misc');
class FluentCore extends MiscLib
{
}
示例9: loader
<?php
/**
* Thin is a swift Framework for PHP 5.4+
*
* @package Thin
* @version 1.0
* @author Gerald Plusquellec
* @license BSD License
* @copyright 1996 - 2015 Gerald Plusquellec
* @link http://github.com/schpill/thin
*/
namespace Thin;
loader('ephemere');
class CacheCore extends EphemereLib
{
}
示例10: scripts
/**
* scripts
*
* @since 1.2.1
* @deprecated 2.0.0
*
* @package Redaxscript
* @category Loader
* @author Henry Ruhs
*
* @param string $mode
*/
function scripts($mode = '')
{
if ($mode == '') {
$output = Redaxscript\Hook::trigger('script_start');
}
/* parse loader ini */
$loader_ini = parse_ini_file('templates/' . Redaxscript\Registry::get('template') . '/scripts/.loader', 1);
/* inherit from other templates */
$loader_inherit = $loader_ini['inherit'];
if ($loader_inherit) {
foreach ($loader_inherit as $key => $template) {
$loader_inherit_ini = parse_ini_file('templates/' . $template . '/scripts/.loader', 1);
$loader_ini = array_merge_recursive($loader_inherit_ini, $loader_ini);
}
}
$loader_minify = $loader_ini['settings']['minify'];
/* init mode */
if ($mode == 'init') {
$output .= '<script> /* <![cdata[ */ ' . loader('scripts', 'init') . ' /* ]]> */ </script>' . PHP_EOL;
} else {
$loader_single = $loader_ini['single'];
/* logged in */
if (LOGGED_IN == TOKEN) {
$loader_admin_single = $loader_ini['admin_single'];
}
$loader_deploy = $loader_ini['settings']['deploy'];
/* merge loader include as needed */
$loader_include = array();
if ($loader_single) {
$loader_include = array_merge($loader_include, $loader_single);
}
if ($loader_admin_single) {
$loader_include = array_merge($loader_include, $loader_admin_single);
}
/* collect output */
if ($loader_include) {
foreach ($loader_include as $value) {
$output .= '<script src="' . $value . '"></script>' . PHP_EOL;
}
}
/* type of deployment */
$output .= '<script> /* <![cdata[ */ ' . scripts_transport($loader_minify);
if ($loader_deploy == 'inline') {
$output .= loader('scripts', 'inline') . ' /* ]]> */ </script>' . PHP_EOL;
} else {
$output .= ' /* ]]> */ </script>' . PHP_EOL;
$output .= '<script src="' . REWRITE_ROUTE . 'loader/scripts"></script>' . PHP_EOL;
}
}
if ($mode == '') {
$output .= Redaxscript\Hook::trigger('script_end');
}
echo $output;
}
示例11: loader
<?php
/**
* Thin is a swift Framework for PHP 5.4+
*
* @package Thin
* @version 1.0
* @author Gerald Plusquellec
* @license BSD License
* @copyright 1996 - 2015 Gerald Plusquellec
* @link http://github.com/schpill/thin
*/
namespace Thin;
loader('redys');
class RedisCore extends RedysLib
{
}
示例12: loader
<?php
/**
* Thin is a swift Framework for PHP 5.4+
*
* @package Thin
* @version 1.0
* @author Gerald Plusquellec
* @license BSD License
* @copyright 1996 - 2013 Gerald Plusquellec
* @link http://github.com/schpill/thin
*/
namespace Thin;
loader('loop');
class PromiseLib
{
/**
* The asynchronous operation is pending.
*/
const PENDING = 0;
/**
* The asynchronous operation has completed, and has a result.
*/
const FULFILLED = 1;
/**
* The asynchronous operation has completed with an error.
*/
const REJECTED = 2;
/**
* The current state of this promise.
示例13: loader
<?php
/**
* Thin is a swift Framework for PHP 5.4+
*
* @package Thin
* @version 1.0
* @author Gerald Plusquellec
* @license BSD License
* @copyright 1996 - 2016 Gerald Plusquellec
* @link http://github.com/schpill/thin
*/
namespace Thin;
loader('app');
class ContainerCore extends AppLib
{
}
示例14: loader
<?php
/**
* Thin is a swift Framework for PHP 5.4+
*
* @package Thin
* @version 1.0
* @author Gerald Plusquellec
* @license BSD License
* @copyright 1996 - 2015 Gerald Plusquellec
* @link http://github.com/schpill/thin
*/
namespace Thin;
loader('mailer');
class MailCore extends MailerLib
{
}
示例15: loader
<?php
/**
* Thin is a swift Framework for PHP 5.4+
*
* @package Thin
* @version 1.0
* @author Gerald Plusquellec
* @license BSD License
* @copyright 1996 - 2015 Gerald Plusquellec
* @link http://github.com/schpill/thin
*/
namespace Thin;
loader('log');
class LogCore extends LogLib
{
}