本文整理汇总了PHP中Loader类的典型用法代码示例。如果您正苦于以下问题:PHP Loader类的具体用法?PHP Loader怎么用?PHP Loader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Loader类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getAllowedFileExtensions
public function getAllowedFileExtensions()
{
$u = new User();
$extensions = array();
if ($u->isSuperUser()) {
$extensions = Loader::helper('concrete/file')->getAllowedFileExtensions();
return $extensions;
}
$pae = $this->getPermissionAccessObject();
if (!is_object($pae)) {
return array();
}
$accessEntities = $u->getUserAccessEntityObjects();
$accessEntities = $pae->validateAndFilterAccessEntities($accessEntities);
$list = $this->getAccessListItems(FileSetPermissionKey::ACCESS_TYPE_ALL, $accessEntities);
$list = PermissionDuration::filterByActive($list);
foreach ($list as $l) {
if ($l->getFileTypesAllowedPermission() == 'N') {
$extensions = array();
}
if ($l->getFileTypesAllowedPermission() == 'C') {
$extensions = array_unique(array_merge($extensions, $l->getFileTypesAllowedArray()));
}
if ($l->getFileTypesAllowedPermission() == 'A') {
$extensions = Loader::helper('concrete/file')->getAllowedFileExtensions();
}
}
return $extensions;
}
开发者ID:Zyqsempai,项目名称:amanet,代码行数:29,代码来源:add_file.php
示例2: __construct
function __construct($value = '', $name = null)
{
$load = new Loader();
$this->date_picker = $load->customFormComponent('/widgets/datepicker');
$this->dropdown = Loader::formComponent('dropdown');
parent::__construct('hidden', $value, $name);
}
开发者ID:RNKushwaha022,项目名称:orange-php,代码行数:7,代码来源:datetimepicker.input.php
示例3: __construct
/**
* assign the loaded class in the application to the $this var
*
*/
public function __construct()
{
$good = new Loader();
$this->load = $good->view("welcome/index.php");
print_r($this->load);
// print_r($this->load->view());
// log_message("debug","Controller class has been initialized");
}
开发者ID:bluebellnepal,项目名称:MyFrame,代码行数:12,代码来源:Controller.php
示例4: renderizarPagina
/**
*
* @param type $vista
* @param type $parametros
*/
public function renderizarPagina($vista, $parametros)
{
$path = TEMPLATEURI . TEMPLATE . '/Loader.php';
if (file_exists($path)) {
include $path;
$loader = new Loader();
$loader->cargarContenido($vista, $parametros);
$loader->rederizarPagina();
// return true;
} else {
// return false;
}
}
开发者ID:p4535992,项目名称:programate,代码行数:18,代码来源:Controller.php
示例5: load
/**
* @param string $path
* @param string $file
* @return \WCM\WPStarter\Env\Env|static
*/
public static function load($path, $file = '.env')
{
if (is_null(self::$loaded)) {
self::wpConstants();
if (!is_string($file)) {
$file = '.env';
}
$filePath = rtrim(str_replace('\\', '/', $path), '/') . '/' . $file;
$loader = new Loader($filePath, true);
$loader->load();
self::$loaded = new static($loader->allVarNames());
}
return self::$loaded;
}
开发者ID:schlessera,项目名称:wpstarter,代码行数:19,代码来源:Env.php
示例6: load
/**
* @param string $path
* @param string $file
* @return \WCM\WPStarter\Env\Env|static
*/
public static function load($path, $file = '.env')
{
if (is_null(self::$loaded)) {
self::wpConstants();
if (!is_string($file)) {
$file = '.env';
}
$filePath = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $file;
$loader = new Loader($filePath, true);
$loader->load();
self::$loaded = new static($loader->allVarNames());
}
return self::$loaded;
}
开发者ID:GaryJones,项目名称:wpstarter,代码行数:19,代码来源:Env.php
示例7: handleLogin
public static function handleLogin($urlValues)
{
Session::init();
// if user is still not logged in, then destroy session and handle user as "not logged in"
if (!isset($_SESSION['user_logged_in']) || $_SESSION['site'] != SITE) {
Session::destroy();
// route user to login page
//header('location: ' . URL . 'login');
$loader = new Loader(array('controller' => 'login', 'action' => 'index', 'path' => $urlValues));
$controller = $loader->createController();
$controller->executeAction();
break;
}
}
开发者ID:anggagewor,项目名称:PHP-movie-database,代码行数:14,代码来源:auth.php
示例8: parseRequest
/**
* Each time a page will be load, this method will be called each time
*
* TODO : How are we supposed to provide the request string like so if it is a singleton?
* Maxime Martineau
*
* @method parseRequest
* @access public
* @param string $request URL of the requested page
* @return void
* @author Quentin LOZACH
* @version 0.1
*/
public function parseRequest($request = FALSE)
{
// Load the Loader class
include BASE_PATH . '/core/loader/loader.php';
// Instanciation of the loader which will load every file on the project
$loader = new Loader();
// Are we on the index page or note ?
switch ($request) {
// We are on the index page
case FALSE:
// Load the mainController, the index method, mainView
$this->controller = "mainController";
$this->method = "index";
$this->params = NULL;
$loader->loadController($this->controller);
break;
// We are on another page so load the Controller and the model with the same name
// We are on another page so load the Controller and the model with the same name
default:
// Load the mainController, mainView and mainModel
$requestExploded = explode("/", $request);
// If the user is trying to load a file directly in the URL such as : .php, .html, .css, .js, .sql ...
$requestSecured = explode(".", $request);
// If there is only a controller with no method, raise an error with error() method
if (empty($requestExploded[1]) && !empty($requestExploded[0])) {
$this->error("empty-method");
} else {
// If requestSecured[1] is not empty the user tried to load a file in the URL
if (isset($requestSecured[1])) {
// The controller is the name of the 1st param but cleaned with the explode
$this->controller = $requestSecured[0];
} else {
// The controller is the first parameter of the URL
$this->controller = $requestExploded[0];
}
// The method is the second parameter of the URL
$this->method = $requestExploded[1];
}
// Getting parameters, so let's keep only useful informations
unset($requestExploded[0]);
unset($requestExploded[1]);
// Getting the rest of the parameters in the $_GET['request'] in the URL
if (!empty($requestExploded[2])) {
$this->params = $requestExploded;
} else {
$this->params = NULL;
}
}
}
开发者ID:prafiny,项目名称:wolf_framework,代码行数:62,代码来源:router.php
示例9: __construct
public function __construct()
{
parent::__construct();
$html = Loader::helper('html');
$this->set('av', Loader::helper('concrete/avatar'));
$this->addHeaderItem($html->javascript('swfobject.js'));
}
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:7,代码来源:avatar.php
示例10: render
/**
* Rendering method
*
* @param string $layout file name
* @param mixed $data
*
* @return Response
*/
public function render($layout, $data = array())
{
$fullpath = realpath(\Loader::get_path_views() . $layout . '.php');
$renderer = new Renderer(realpath(Service::get('config')->get('main_layout')));
$content = $renderer->render($fullpath, $data);
return new Response($content);
}
开发者ID:Roman2016,项目名称:mindk_framework,代码行数:15,代码来源:Controller.php
示例11: view
public function view($page = 0)
{
$this->set('title', t('Logs'));
$pageBase = View::url('/dashboard/reports/logs', 'view');
$paginator = Loader::helper('pagination');
$total = Log::getTotal($_REQUEST['keywords'], $_REQUEST['logType']);
$paginator->init(intval($page), $total, $pageBase . '/%pageNum%/?keywords=' . $_REQUEST['keywords'] . '&logType=' . $_REQUEST['logType'], 10);
$limit = $paginator->getLIMIT();
$types = Log::getTypeList();
$txt = Loader::helper('text');
$logTypes = array();
$logTypes[''] = '** ' . t('All');
foreach ($types as $t) {
if ($t == '') {
$logTypes[''] = '** ' . t('All');
} else {
$logTypes[$t] = $txt->unhandle($t);
}
}
$entries = Log::getList($_REQUEST['keywords'], $_REQUEST['logType'], $limit);
$this->set('keywords', $keywords);
$this->set('pageBase', $pageBase);
$this->set('entries', $entries);
$this->set('paginator', $paginator);
$this->set('logTypes', $logTypes);
}
开发者ID:VonUniGE,项目名称:concrete5-1,代码行数:26,代码来源:logs.php
示例12: __construct
public function __construct()
{
// Loader initialiseren
$this->_loader = Loader::getInstance();
// input class initialiseren
$this->_input = new Input();
}
开发者ID:liesenborghspuntkristof,项目名称:Jurassic_Terrarium,代码行数:7,代码来源:Controller.php
示例13: __construct
public function __construct()
{
parent::__construct();
$this->db = Loader::model('admin_login_log_model');
$this->admin_username = cookie('admin_username');
// 管理员COOKIE
}
开发者ID:hubs,项目名称:yuncms,代码行数:7,代码来源:LoginlogController.php
示例14: authControl
public function authControl()
{
$config = Config::getInstance();
Loader::definePathConstants();
$this->setViewTemplate(THINKUP_WEBAPP_PATH . 'plugins/facebook/view/facebook.account.index.tpl');
$this->view_mgr->addHelp('facebook', 'userguide/settings/plugins/facebook');
/** set option fields **/
// Application ID text field
$this->addPluginOption(self::FORM_TEXT_ELEMENT, array('name' => 'facebook_app_id', 'label' => 'App ID', 'size' => 18));
// add element
// set a special required message
$this->addPluginOptionRequiredMessage('facebook_app_id', 'The Facebook plugin requires a valid App ID.');
// Application Secret text field
$this->addPluginOption(self::FORM_TEXT_ELEMENT, array('name' => 'facebook_api_secret', 'label' => 'App Secret', 'size' => 37));
// add element
// set a special required message
$this->addPluginOptionRequiredMessage('facebook_api_secret', 'The Facebook plugin requires a valid App Secret.');
$max_crawl_time_label = 'Max crawl time in minutes';
$max_crawl_time = array('name' => 'max_crawl_time', 'label' => $max_crawl_time_label, 'default_value' => '20', 'advanced' => true, 'size' => 3);
$this->addPluginOption(self::FORM_TEXT_ELEMENT, $max_crawl_time);
$this->addToView('thinkup_site_url', Utils::getApplicationURL());
$facebook_plugin = new FacebookPlugin();
if ($facebook_plugin->isConfigured()) {
$this->setUpFacebookInteractions($facebook_plugin->getOptionsHash());
$this->addToView('is_configured', true);
} else {
$this->addInfoMessage('Please complete plugin setup to start using it.', 'setup');
$this->addToView('is_configured', false);
}
return $this->generateView();
}
开发者ID:dgw,项目名称:ThinkUp,代码行数:31,代码来源:class.FacebookPluginConfigurationController.php
示例15: install
public function install()
{
$pkg = parent::install();
Loader::model('single_page');
$main = SinglePage::add('/dashboard/multisite', $pkg);
$mainSites = SinglePage::add('/dashboard/multisite/sites', $pkg);
}
开发者ID:rmxdave,项目名称:multisite,代码行数:7,代码来源:controller.php
示例16: update_library
public function update_library()
{
if (Loader::helper("validation/token")->validate('update_library')) {
if ($this->post('activeLibrary')) {
$scl = SystemAntispamLibrary::getByHandle($this->post('activeLibrary'));
if (is_object($scl)) {
$scl->activate();
Config::save('ANTISPAM_NOTIFY_EMAIL', $this->post('ANTISPAM_NOTIFY_EMAIL'));
Config::save('ANTISPAM_LOG_SPAM', $this->post('ANTISPAM_LOG_SPAM'));
if ($scl->hasOptionsForm() && $this->post('ccm-submit-submit')) {
$controller = $scl->getController();
$controller->saveOptions($this->post());
}
$this->redirect('/dashboard/system/permissions/antispam', 'saved');
} else {
$this->error->add(t('Invalid anti-spam library.'));
}
} else {
SystemAntispamLibrary::deactivateAll();
}
} else {
$this->error->add(Loader::helper('validation/token')->getErrorMessage());
}
$this->view();
}
开发者ID:ricardomccerqueira,项目名称:rcerqueira.portfolio,代码行数:25,代码来源:antispam.php
示例17: save
public function save($args)
{
$db = Loader::db();
parent::save();
$db->Execute('delete from AreaPermissionBlockTypeAccessList where paID = ?', array($this->getPermissionAccessID()));
$db->Execute('delete from AreaPermissionBlockTypeAccessListCustom where paID = ?', array($this->getPermissionAccessID()));
if (is_array($args['blockTypesIncluded'])) {
foreach ($args['blockTypesIncluded'] as $peID => $permission) {
$v = array($this->getPermissionAccessID(), $peID, $permission);
$db->Execute('insert into AreaPermissionBlockTypeAccessList (paID, peID, permission) values (?, ?, ?)', $v);
}
}
if (is_array($args['blockTypesExcluded'])) {
foreach ($args['blockTypesExcluded'] as $peID => $permission) {
$v = array($this->getPermissionAccessID(), $peID, $permission);
$db->Execute('insert into AreaPermissionBlockTypeAccessList (paID, peID, permission) values (?, ?, ?)', $v);
}
}
if (is_array($args['btIDInclude'])) {
foreach ($args['btIDInclude'] as $peID => $btIDs) {
foreach ($btIDs as $btID) {
$v = array($this->getPermissionAccessID(), $peID, $btID);
$db->Execute('insert into AreaPermissionBlockTypeAccessListCustom (paID, peID, btID) values (?, ?, ?)', $v);
}
}
}
if (is_array($args['btIDExclude'])) {
foreach ($args['btIDExclude'] as $peID => $btIDs) {
foreach ($btIDs as $btID) {
$v = array($this->getPermissionAccessID(), $peID, $btID);
$db->Execute('insert into AreaPermissionBlockTypeAccessListCustom (paID, peID, btID) values (?, ?, ?)', $v);
}
}
}
}
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:35,代码来源:add_block_to_area.php
示例18: run
public function run()
{
$tables_for_optimization = array();
$count = 0;
$db = Loader::db();
$v = array();
$q = "SHOW TABLE STATUS";
$rs = $db->query($q, $v);
foreach ($rs as $table) {
if ($table["Data_free"] > 0) {
$tables_for_optimization[] = $table["Name"];
}
}
unset($rs);
foreach ($tables_for_optimization as $table) {
$db->execute("OPTIMIZE TABLE " . $table);
$count++;
}
$return_message = t("The Job was run successfully.");
if ($count > 0) {
return $return_message . " " . t("Optimized %s tables.", $count);
} else {
return $return_message . " " . t("There were no tables to optimize.");
}
}
开发者ID:katzueno,项目名称:si_mysql_optimize,代码行数:25,代码来源:si_mysql_optimize.php
示例19: __construct
/**
* Private Constructor
* @param array $vals Optional values to override file config
* @return Config
*/
private function __construct($vals = null)
{
if ($vals != null) {
$this->config = $vals;
} else {
Loader::definePathConstants();
if (file_exists(EFC_WEBAPP_PATH . 'config.inc.php')) {
require EFC_WEBAPP_PATH . 'config.inc.php';
$this->config = $EFC_CFG;
//set version info...
/*
require EFC_WEBAPP_PATH . 'install/version.php';
$this->config['EFC_VERSION'] = $EFC_VERSION;
$this->config['EFC_VERSION_REQUIRED'] =
array('php' => $EFC_VERSION_REQUIRED['php'], 'mysql' => $EFC_VERSION_REQUIRED['mysql']);
*/
} else {
throw new ConfigurationException("EFC's configuration file does not exist! " . "Try installing EFC.");
}
}
foreach (array_keys(self::$defaults) as $default) {
if (!isset($this->config[$default])) {
$this->config[$default] = self::$defaults[$default];
}
}
}
开发者ID:prabhatse,项目名称:olx_hack,代码行数:31,代码来源:class.Config.php
示例20: run
public function run() {
Cache::disableCache();
Loader::library('database_indexed_search');
$is = new IndexedSearch();
if ($_GET['force'] == 1) {
Loader::model('attribute/categories/collection');
Loader::model('attribute/categories/file');
Loader::model('attribute/categories/user');
$attributes = CollectionAttributeKey::getList();
$attributes = array_merge($attributes, FileAttributeKey::getList());
$attributes = array_merge($attributes, UserAttributeKey::getList());
foreach($attributes as $ak) {
$ak->updateSearchIndex();
}
$result = $is->reindexAll(true);
} else {
$result = $is->reindexAll();
}
if ($result->count == 0) {
return t('Indexing complete. Index is up to date');
} else {
if ($result->count == $is->searchBatchSize) {
return t('Index partially updated. %s pages indexed (maximum number.) Re-run this job to continue this process.', $result->count);
} else {
return t('Index updated. %s %s required reindexing.', $result->count, $result->count == 1 ? t('page') : t('pages'));
}
}
}
开发者ID:rii-J,项目名称:concrete5-de,代码行数:30,代码来源:index_search.php
注:本文中的Loader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论