当前位置: 首页>>代码示例>>PHP>>正文


PHP Loader::library方法代码示例

本文整理汇总了PHP中Loader::library方法的典型用法代码示例。如果您正苦于以下问题:PHP Loader::library方法的具体用法?PHP Loader::library怎么用?PHP Loader::library使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Loader的用法示例。


在下文中一共展示了Loader::library方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: on_start

 public function on_start()
 {
     $this->error = Loader::helper('validation/error');
     if (USER_REGISTRATION_WITH_EMAIL_ADDRESS == true) {
         $this->set('uNameLabel', t('Email Address'));
     } else {
         $this->set('uNameLabel', t('Username'));
     }
     $txt = Loader::helper('text');
     if (strlen($_GET['uName'])) {
         // pre-populate the username if supplied, if its an email address with special characters the email needs to be urlencoded first,
         $this->set("uName", trim($txt->email($_GET['uName'])));
     }
     $languages = array();
     $locales = array();
     if (Config::get('LANGUAGE_CHOOSE_ON_LOGIN')) {
         Loader::library('3rdparty/Zend/Locale');
         Loader::library('3rdparty/Zend/Locale/Data');
         $languages = Localization::getAvailableInterfaceLanguages();
         if (count($languages) > 0) {
             array_unshift($languages, 'en_US');
         }
         $locales = array('' => t('** Default'));
         Zend_Locale_Data::setCache(Cache::getLibrary());
         foreach ($languages as $lang) {
             $loc = new Zend_Locale($lang);
             $locales[$lang] = Zend_Locale::getTranslation($loc->getLanguage(), 'language', ACTIVE_LOCALE);
         }
     }
     $this->locales = $locales;
     $this->set('locales', $locales);
     $this->openIDReturnTo = BASE_URL . View::url("/login", "complete_openid");
 }
开发者ID:ricardomccerqueira,项目名称:rcerqueira.portfolio,代码行数:33,代码来源:login.php

示例2: getLibrary

 public function getLibrary()
 {
     static $cache;
     if (!isset($cache) && defined('DIR_FILES_CACHE')) {
         if (is_dir(DIR_FILES_CACHE) && is_writable(DIR_FILES_CACHE)) {
             Loader::library('3rdparty/Zend/Cache');
             $frontendOptions = array('lifetime' => CACHE_LIFETIME, 'automatic_serialization' => true, 'cache_id_prefix' => CACHE_ID);
             $backendOptions = array('read_control' => false, 'cache_dir' => DIR_FILES_CACHE, 'file_locking' => false);
             if (defined('CACHE_BACKEND_OPTIONS')) {
                 $opts = unserialize(CACHE_BACKEND_OPTIONS);
                 foreach ($opts as $k => $v) {
                     $backendOptions[$k] = $v;
                 }
             }
             if (defined('CACHE_FRONTEND_OPTIONS')) {
                 $opts = unserialize(CACHE_FRONTEND_OPTIONS);
                 foreach ($opts as $k => $v) {
                     $frontendOptions[$k] = $v;
                 }
             }
             if (!defined('CACHE_LIBRARY') || defined("CACHE_LIBRARY") && CACHE_LIBRARY == "default") {
                 define('CACHE_LIBRARY', 'File');
             }
             $customBackendNaming = false;
             if (CACHE_LIBRARY == 'Zend_Cache_Backend_ZendServer_Shmem') {
                 $customBackendNaming = true;
             }
             $cache = Zend_Cache::factory('Core', CACHE_LIBRARY, $frontendOptions, $backendOptions, false, $customBackendNaming);
         }
     }
     return $cache;
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:32,代码来源:cache.php

示例3: enableNativeMobile

	public function enableNativeMobile() {
		Loader::library('3rdparty/mobile_detect');
		$md = new Mobile_Detect();
		if ($md->isMobile()) {
			$this->addHeaderItem('<meta name="viewport" content="width=device-width,initial-scale=1"></meta>');
		}
	}
开发者ID:nveid,项目名称:concrete5,代码行数:7,代码来源:base.php

示例4: urlify

 /**
  * Takes text and returns it in the "lowercase-and-dashed-with-no-punctuation" format
  *
  * @param string $handle
  * @param string $maxlength           Max number of characters of the return value
  * @param string $locale              Language code of the language rules that should be prioritized
  * @param bool   $removeExcludedWords Set to true to remove excluded words, false to allow them.
  * @return string
  */
 public function urlify($handle, $maxlength = PAGE_PATH_SEGMENT_MAX_LENGTH, $locale = '', $removeExcludedWords = true)
 {
     $text = strtolower(str_replace(array("\r", "\n", "\t"), ' ', $this->asciify($handle, $locale)));
     if ($removeExcludedWords) {
         $excludeSeoWords = Config::get('SEO_EXCLUDE_WORDS');
         if (is_string($excludeSeoWords)) {
             if (strlen($excludeSeoWords)) {
                 $remove_list = explode(',', $excludeSeoWords);
                 $remove_list = array_map('trim', $remove_list);
                 $remove_list = array_filter($remove_list, 'strlen');
             } else {
                 $remove_list = array();
             }
         } else {
             Loader::library('3rdparty/urlify');
             $remove_list = URLify::$remove_list;
         }
         if (count($remove_list)) {
             $text = preg_replace('/\\b(' . join('|', $remove_list) . ')\\b/i', '', $text);
         }
     }
     $text = preg_replace('/[^-\\w\\s]/', '', $text);
     // remove unneeded chars
     $text = str_replace('_', ' ', $text);
     // treat underscores as spaces
     $text = preg_replace('/^\\s+|\\s+$/', '', $text);
     // trim leading/trailing spaces
     $text = preg_replace('/[-\\s]+/', '-', $text);
     // convert spaces to hyphens
     $text = strtolower($text);
     // convert to lowercase
     return trim(substr($text, 0, $maxlength), '-');
     // trim to first $maxlength chars
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:43,代码来源:text.php

示例5: view

 public function view($message = false)
 {
     if ($message) {
         switch ($message) {
             case 'reset_complete':
                 $this->set('message', t('Reserved words reset.'));
                 break;
             case 'saved':
                 $this->set('success', t('Reserved words updated.'));
                 break;
         }
     }
     Loader::library('3rdparty/urlify');
     $this->set('SEO_EXCLUDE_WORDS_ORIGINAL_ARRAY', Urlify::$remove_list);
     $excludeSeoWords = Config::get('SEO_EXCLUDE_WORDS');
     if (is_string($excludeSeoWords)) {
         if (strlen($excludeSeoWords)) {
             $remove_list = explode(',', $excludeSeoWords);
             $remove_list = array_map('trim', $remove_list);
             $remove_list = array_filter($remove_list, 'strlen');
         } else {
             $remove_list = array();
         }
     } else {
         $remove_list = Urlify::$remove_list;
     }
     $this->set('SEO_EXCLUDE_WORDS_ARRAY', $remove_list);
     $this->set('SEO_EXCLUDE_WORDS', SEO_EXCLUDE_WORDS);
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:29,代码来源:excluded.php

示例6: __construct

 /**
  * 
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     $this->loadModel('item');
     Loader::library('API', TRUE);
     Loader::library('Curl');
 }
开发者ID:khalid9th,项目名称:ocAds,代码行数:11,代码来源:cItem.php

示例7: update_favicon

	function update_favicon(){
		Loader::library('file/importer');
		if ($this->token->validate("update_favicon")) { 
		
			if(intval($this->post('remove_favicon'))==1){
				Config::save('FAVICON_FID',0);
					$this->redirect('/dashboard/system/basics/icons/', 'favicon_removed');
			} else {
				$fi = new FileImporter();
				$resp = $fi->import($_FILES['favicon_file']['tmp_name'], $_FILES['favicon_file']['name'], $fr);
				if (!($resp instanceof FileVersion)) {
					switch($resp) {
						case FileImporter::E_FILE_INVALID_EXTENSION:
							$this->error->add(t('Invalid file extension.'));
							break;
						case FileImporter::E_FILE_INVALID:
							$this->error->add(t('Invalid file.'));
							break;
						
					}
				} else {
				
					Config::save('FAVICON_FID', $resp->getFileID());
					$filepath=$resp->getPath();  
					//@copy($filepath, DIR_BASE.'/favicon.ico');
					$this->redirect('/dashboard/system/basics/icons/', 'favicon_saved');

				}
			}		
			
		}else{
			$this->set('error', array($this->token->getErrorMessage()));
		}
	}
开发者ID:nveid,项目名称:concrete5,代码行数:34,代码来源:icons.php

示例8: __construct

 function __construct()
 {
     Loader::library('controller', $this->pkgHandle);
     //Used by controllers
     Loader::library('dashboardcontroller', $this->pkgHandle);
     //Used by controllers
 }
开发者ID:hanicker,项目名称:Concrete5-EasyNews,代码行数:7,代码来源:controller.php

示例9: getMailerObject

	/**
	 * @todo documentation
	 * @return array <Zend_Mail_Transport_Smtp, Zend_Mail>
	*/
	public static function getMailerObject(){
		Loader::library('3rdparty/Zend/Mail');
		$response = array();
		$response['mail'] = new Zend_Mail(APP_CHARSET);
	
		if (MAIL_SEND_METHOD == "SMTP") {
			Loader::library('3rdparty/Zend/Mail/Transport/Smtp');
			$config = array();
			
			$username = Config::get('MAIL_SEND_METHOD_SMTP_USERNAME');
			$password = Config::get('MAIL_SEND_METHOD_SMTP_PASSWORD');
			if ($username != '') {
				$config['auth'] = 'login';
				$config['username'] = $username;
				$config['password'] = $password;
			}
			
			$port = Config::get('MAIL_SEND_METHOD_SMTP_PORT');
			if ($port != '') {
				$config['port'] = $port;
			}
			
			$encr = Config::get('MAIL_SEND_METHOD_SMTP_ENCRYPTION');
			if ($encr != '') {
				$config['ssl'] = $encr;
			}
			$transport = new Zend_Mail_Transport_Smtp(
				Config::get('MAIL_SEND_METHOD_SMTP_SERVER'), $config
			);					
			
			$response['transport'] = $transport;
		}	
		
		return $response;		
	}
开发者ID:nveid,项目名称:concrete5,代码行数:39,代码来源:mail.php

示例10: view

 public function view($updated = false)
 {
     Loader::library('database_indexed_search');
     if ($this->post('reindex')) {
         IndexedSearch::clearSearchIndex();
         $this->redirect('/dashboard/system/seo/search_index', 'index_cleared');
     } else {
         if ($updated) {
             $this->set('message', t('Search Index Preferences Updated'));
         }
         if ($this->isPost()) {
             if ($this->token->validate('update_search_index')) {
                 $areas = $this->post('arHandle');
                 if (!is_array($areas)) {
                     $areas = array();
                 }
                 Config::save('SEARCH_INDEX_AREA_LIST', serialize($areas));
                 Config::save('SEARCH_INDEX_AREA_METHOD', Loader::helper('security')->sanitizeString($this->post('SEARCH_INDEX_AREA_METHOD')));
                 $this->redirect('/dashboard/system/seo/search_index', 'updated');
             } else {
                 $this->set('error', array($this->token->getErrorMessage()));
             }
         }
         $areas = Area::getHandleList();
         $selectedAreas = array();
         $this->set('areas', $areas);
         $this->set('selectedAreas', IndexedSearch::getSavedSearchableAreas());
     }
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:29,代码来源:search_index.php

示例11: get

 public static function get($name, $additionalConfig = array())
 {
     Loader::library('3rdparty/Zend/Queue');
     $config = array('name' => $name, 'driverOptions' => array('host' => DB_SERVER, 'username' => DB_USERNAME, 'password' => DB_PASSWORD, 'dbname' => DB_DATABASE, 'type' => 'pdo_mysql'));
     $config = array_merge($config, $additionalConfig);
     return new Zend_Queue('Concrete5', $config);
 }
开发者ID:ronlobo,项目名称:concrete5,代码行数:7,代码来源:queue.php

示例12: getSessionDefaultLocale

 static function getSessionDefaultLocale()
 {
     if (isset($_REQUEST['fsenDocLang'])) {
         $doc_lang = $_REQUEST['fsenDocLang'];
         $locale = self::$mLang2LocaleMap[$doc_lang];
         if (strlen($locale)) {
             return $locale;
         }
     }
     if (isset($_SESSION['FSEInfo'])) {
         $locale = $_SESSION['FSEInfo']['def_locale'];
         if (strlen($locale)) {
             return $locale;
         }
     }
     // they have a language in a certain session going already
     if (isset($_SESSION['DEFAULT_LOCALE'])) {
         return $_SESSION['DEFAULT_LOCALE'];
     }
     // if they've specified their own default locale to remember
     if (isset($_COOKIE['DEFAULT_LOCALE'])) {
         return $_COOKIE['DEFAULT_LOCALE'];
     }
     Loader::library('3rdparty/Zend/Locale');
     $locale = new Zend_Locale();
     return (string) $locale;
 }
开发者ID:rratcliffe,项目名称:fsen,代码行数:27,代码来源:fsen_localization.php

示例13: view

 public function view()
 {
     Loader::library('update');
     $this->set('latest_version', Update::getLatestAvailableVersionNumber());
     $tp = new TaskPermission();
     $updates = 0;
     $local = array();
     $remote = array();
     if ($tp->canInstallPackages()) {
         $local = Package::getLocalUpgradeablePackages();
         $remote = Package::getRemotelyUpgradeablePackages();
     }
     // now we strip out any dupes for the total
     $updates = 0;
     $localHandles = array();
     foreach ($local as $_pkg) {
         $updates++;
         $localHandles[] = $_pkg->getPackageHandle();
     }
     foreach ($remote as $_pkg) {
         if (!in_array($_pkg->getPackageHandle(), $localHandles)) {
             $updates++;
         }
     }
     $this->set('updates', $updates);
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:26,代码来源:dashboard_app_status.php

示例14: 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

示例15: getLatestAvailableVersionNumber

	public function getLatestAvailableVersionNumber() {
		if (defined('MULTI_SITE') && MULTI_SITE == 1) {
			$updates = Update::getLocalAvailableUpdates();
			$multiSiteVersion = 0;
			foreach($updates as $up) {
				if (version_compare($up->getUpdateVersion(), $multiSiteVersion, '>')) {
					$multiSiteVersion = $up->getUpdateVersion();
				}	
			}
			Config::save('APP_VERSION_LATEST', $multiSiteVersion);
			return $multiSiteVersion;
		}
		
		$d = Loader::helper('date');
		// first, we check session
		$queryWS = false;
		Cache::disableCache();
		$vNum = Config::get('APP_VERSION_LATEST', true);
		Cache::enableCache();
		if (is_object($vNum)) {
			$seconds = strtotime($vNum->timestamp);
			$version = $vNum->value;
			if (is_object($version)) {
				$versionNum = $version->version;
			} else {
				$versionNum = $version;
			}
			$diff = time() - $seconds;
			if ($diff > APP_VERSION_LATEST_THRESHOLD) {
				// we grab a new value from the service
				$queryWS = true;
			}
		} else {
			$queryWS = true;
		}
		
		if ($queryWS) {
			Loader::library('marketplace');
			$mi = Marketplace::getInstance();
			if ($mi->isConnected()) {
				Marketplace::checkPackageUpdates();
			}
			$update = Update::getLatestAvailableUpdate();
			$versionNum = $update->version;
			
			if ($versionNum) {
				Config::save('APP_VERSION_LATEST', $versionNum);
				if (version_compare($versionNum, APP_VERSION, '>')) {
					Loader::model('system_notification');
					SystemNotification::add(SystemNotification::SN_TYPE_CORE_UPDATE, t('A new version of concrete5 is now available.'), '', $update->notes, View::url('/dashboard/system/update'));
				}		
			} else {
				// we don't know so we're going to assume we're it
				Config::save('APP_VERSION_LATEST', APP_VERSION);
			}
		}
		
		return $versionNum;
	}
开发者ID:rii-J,项目名称:concrete5-de,代码行数:59,代码来源:update.php


注:本文中的Loader::library方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。