本文整理汇总了PHP中Singleton::config方法的典型用法代码示例。如果您正苦于以下问题:PHP Singleton::config方法的具体用法?PHP Singleton::config怎么用?PHP Singleton::config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Singleton
的用法示例。
在下文中一共展示了Singleton::config方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: go
public function go()
{
header("Content-Type: text/html; charset=UTF-8");
// Import Libraries
\framework\import("org.yeager.framework.tools.password");
\framework\import("org.yeager.ui.common");
\framework\import("org.yeager.ui.koala");
\framework\import("org.yeager.ui.icons");
\framework\import("org.yeager.framework.tools.password");
\framework\import("org.yeager.framework.tools.http.redirect");
\framework\import("org.yeager.framework.tools.http.byteserve");
\framework\import("org.yeager.core.versionable");
\framework\import("org.yeager.core.tree");
\framework\import("org.yeager.core.permissions");
\framework\import("org.yeager.core.privileges");
\framework\import("org.yeager.core.propertysettings");
\framework\import("org.yeager.core.properties");
\framework\import("org.yeager.core.history");
\framework\import("org.yeager.core.jsqueue");
\framework\import("org.yeager.core.tags");
\framework\import("org.yeager.core.comments");
\framework\import("org.yeager.core.cblock");
\framework\import("org.yeager.core.cblockmgr");
\framework\import("org.yeager.core.entrymasks");
\framework\import("org.yeager.core.page");
\framework\import("org.yeager.core.pagemgr");
\framework\import("org.yeager.core.file");
\framework\import("org.yeager.core.filemgr");
\framework\import("org.yeager.core.filetypes");
\framework\import("org.yeager.core.views");
\framework\import("org.yeager.core.mailing");
\framework\import("org.yeager.core.mailingmgr");
\framework\import("org.yeager.core.templates");
\framework\import("org.yeager.core.usergroups");
\framework\import("org.yeager.core.sites");
\framework\import("org.yeager.core.languages");
\framework\import("org.yeager.core.reftracker");
\framework\import("org.yeager.core.scheduler");
\framework\import("org.yeager.core.extensionmgr");
\framework\import("org.yeager.core.extensions");
\framework\import("org.yeager.core.fileprocessor");
\framework\import("org.yeager.core.cblockprocessor");
\framework\import("org.yeager.core.emailprocessor");
\framework\import("org.yeager.core.pageprocessor");
\framework\import("org.yeager.core.user");
\framework\import("org.yeager.core.usermgr");
\framework\import("org.yeager.core.tree");
\framework\import('org.yeager.core.updater');
\framework\import('org.yeager.core.archive');
// Set UTF8 for DB
Singleton::YDB()->Execute("SET NAMES 'utf8';");
// Set ADODB-Fetchmode to ADODB_FETCH_ASSOC
Singleton::YDB()->SetFetchMode(ADODB_FETCH_ASSOC);
// Create instance of Koala class
$koala = new Koala($this->yeager);
$username = $this->session->getSessionVar("username");
$password = $this->session->getSessionVar("password");
Singleton::register("session", $this->session);
Singleton::register("request", $this->request);
Singleton::register("config", $this->config);
Singleton::register("UserMgr", new UserMgr());
Singleton::register("guiUS", $this->request->parameters['us']);
Singleton::register("guiLH", $this->request->parameters['lh']);
// Get frontend timezone
$this->frontendTimezone = (string) Singleton::config()->getVar('CONFIG/TIMEZONES/FRONTEND');
if (!$this->frontendTimezone) {
$this->frontendTimezone = 'Europe/Berlin';
}
$userID = Singleton::UserMgr()->validate($username, $password);
Singleton::register("Usergroups", new Usergroups());
if (!$userID) {
$userID = Singleton::UserMgr()->getAnonymousID();
$this->authenticated = false;
} else {
$this->authenticated = true;
if ($userID != Singleton::UserMgr()->getAnonymousID()) {
$this->session->setPSessionVar("username", $username);
$this->session->setPSessionVar("password", $password);
$this->session->setPSessionVar("userid", $userID);
$this->session->setPSessionVar("isvalidated", true);
}
if ($this->session->getSessionVar('keepLoggedIn')) {
$this->session->cookie_time = time() + 60 * 60 * 24 * 365;
} else {
$cookie_time = (int) Singleton::config()->getVar("CONFIG/SESSION/COOKIES/TIME");
$this->session->cookie_time = $cookie_time;
}
}
// write roles to sessions for cachekey
$user = new User($userID);
$roles = $user->getUsergroupIDs();
if ($userID != Singleton::UserMgr()->getAnonymousID()) {
$this->session->setPSessionVar("userroles", $roles);
$this->session->setPSessionVar("userid", $userID);
$this->session->setCookie("yg-userid", $userID);
$roleHash = "";
foreach ($roles as $r) {
$roleHash .= $r["ID"] . "x";
}
$this->session->setCookie("yg-userroles", $roleHash);
//.........这里部分代码省略.........
示例2: getFormfieldsInternal
/**
* Gets Formfields of this Cblock including content, optionally of one specific Entrymask (internal method)
*
* @param int $linkId (optional) Cblock Entrymask Link Id
* @return array Array of Formfields
*/
function getFormfieldsInternal($linkId = 0)
{
$version = (int) $this->getVersion();
$linkId = (int) $linkId;
$cbId = (int) $this->_id;
if ($this->permissions->checkInternal($this->_uid, $cbId, "RREAD")) {
if ($cbId > 0) {
$sql_where = "CBID = {$cbId} AND CBVERSION = {$version} ";
}
if ($linkId > 0) {
$linksql = "AND lnk.ID = {$linkId}";
}
$sql = "SELECT\n\t\t\t\tlnk.ID AS LINKID,\n\t\t\t\tlnk.ENTRYMASK AS ENTRYMASKID,\n\t\t\t\tctrl.CODE AS CODE,\n\t\t\t\tctrl.NAME AS ENTRYMASKNAME,\n\t\t\t\tCBID,\n\t\t\t\tCBVERSION\n\t\t\tFROM\n\t\t\t\t`yg_contentblocks_lnk_entrymasks` as lnk,\n\t\t\t\tyg_entrymasks_properties as ctrl\n\t\t\tWHERE\n\t\t\t\t({$sql_where} {$linksql}) AND\n\t\t\t\t(lnk.ENTRYMASK = ctrl.OBJECTID)\n\t\t\tORDER BY ORDERPROD;";
$ra = $this->cacheExecuteGetArray($sql);
$webroot = (string) Singleton::config()->getVar('CONFIG/DIRECTORIES/WEBROOT');
for ($l = 0; $l < count($ra); $l++) {
$sql = "SELECT\n\t\t\t\t\t\t\tl.ID AS LINKID,\n\t\t\t\t\t\t\tl.ENTRYMASK AS ENTRYMASKID,\n\t\t\t\t\t\t\tp.CODE AS CODE,\n\t\t\t\t\t\t\tp.NAME AS ENTRYMASKNAME,\n\t\t\t\t\t\t\tw.IDENTIFIER AS IDENTIFIER,\n\t\t\t\t\t\t\tf.TYPE AS TYPE,\n\t\t\t\t\t\t\tc.ID,\n\t\t\t\t\t\t\tc.FORMFIELD,\n\t\t\t\t\t\t\tc.ENTRYMASKFORMFIELD,\n\t\t\t\t\t\t\tc.LNK,\n\t\t\t\t\t\t\tc.VALUE01,\n\t\t\t\t\t\t\tc.VALUE02,\n\t\t\t\t\t\t\tc.VALUE03,\n\t\t\t\t\t\t\tc.VALUE04,\n\t\t\t\t\t\t\tc.VALUE05,\n\t\t\t\t\t\t\tc.VALUE06,\n\t\t\t\t\t\t\tc.VALUE07,\n\t\t\t\t\t\t\tc.VALUE08,\n\t\t\t\t\t\t\tw.NAME AS NAME,\n\t\t\t\t\t\t\tl.CBID AS CBID,\n\t\t\t\t\t\t\tw.PRESET AS PRESET,\n\t\t\t\t\t\t\tw.WIDTH AS WIDTH,\n\t\t\t\t\t\t\tw.MAXLENGTH AS MAXLENGTH,\n\t\t\t\t\t\t\tw.CONFIG AS CONFIG,\n\t\t\t\t\t\t\tw.CUSTOM AS CUSTOM\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\tyg_contentblocks_lnk_entrymasks_c AS c,\n\t\t\t\t\t\t\tyg_contentblocks_lnk_entrymasks AS l,\n\t\t\t\t\t\t\tyg_entrymasks_lnk_formfields as w,\n\t\t\t\t\t\t\tyg_entrymasks_properties AS p,\n\t\t\t\t\t\t\tyg_formfields as f\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t(c.LNK = ?) AND\n\t\t\t\t\t\t\t(c.LNK = l.ID) AND\n\t\t\t\t\t\t\t(c.ENTRYMASKFORMFIELD = w.ID) AND\n\t\t\t\t\t\t\t(w.ENTRYMASK = p.OBJECTID) AND\n\t\t\t\t\t\t\t(l.ENTRYMASK = p.OBJECTID) AND\n\t\t\t\t\t\t\t(c.FORMFIELD = f.ID)\n\t\t\t\t\t\tORDER BY w.ORDER ASC;";
$wc = $this->cacheExecuteGetArray($sql, $ra[$l]["LINKID"]);
for ($w = 0; $w < count($wc); $w++) {
switch ($wc[$w]['TYPE']) {
case 'TEXT':
case 'CHECKBOX':
case 'PASSWORD':
case 'DATE':
case 'DATETIME':
case 'HEADLINE':
$wc[$w]['VALUE'] = $wc[$w]['VALUE01'];
break;
case 'TEXTAREA':
case 'WYSIWYG':
$wc[$w]['VALUE'] = replaceSpecialURLs($wc[$w]['VALUE01']);
break;
case 'LINK':
$resolvedUrl = resolveSpecialURL($wc[$w]['VALUE01']);
if ($resolvedUrl) {
$wc[$w]['URL'] = $resolvedUrl;
} else {
$wc[$w]['URL'] = $wc[$w]['VALUE01'];
}
break;
case 'PAGE':
$wc[$w]['PAGE_ID'] = $wc[$w]['VALUE01'];
$wc[$w]['SITE_ID'] = $wc[$w]['VALUE02'];
$wc[$w]['URL'] = $webroot . $wc[$w]['VALUE03'];
$wc[$w]['PNAME'] = $wc[$w]['VALUE04'];
$wc[$w]['SITE_PNAME'] = $wc[$w]['VALUE05'];
break;
case 'FILE':
case 'FILEFOLDER':
$wc[$w]['FILE_ID'] = $wc[$w]['VALUE01'];
if ($wc[$w]['FILE_ID']) {
$wc[$w]['VALUE03'] = sFileMgr()->getPNameByFileId($wc[$w]['FILE_ID']);
}
$wc[$w]['URL'] = '';
if ($wc[$w]['VALUE03'] != "") {
$wc[$w]['URL'] = $webroot . 'download/' . $wc[$w]['VALUE03'];
$wc[$w]['IMAGE_URL'] = $webroot . 'image/' . $wc[$w]['VALUE03'];
$wc[$w]['PNAME'] = $wc[$w]['VALUE03'];
}
break;
case 'CO':
$wc[$w]['CBLOCK_ID'] = $wc[$w]['VALUE01'];
break;
case 'TAG':
$wc[$w]['TAG_ID'] = $wc[$w]['VALUE01'];
break;
case 'LIST':
$wc[$w]['VALUE'] = $wc[$w]['VALUE01'];
break;
}
}
}
return $wc;
} else {
return false;
}
}
示例3: explode
}
$request_path = explode('/', $request_path_string);
$mailingId = $request_path[0];
if (!is_numeric($mailingId)) {
$mailingId = sMailingMgr()->getMailingIdByPName($mailingId);
}
// Fill userinfo with data from current user
$user = new User(sUserMgr()->getCurrentUserID());
$userInfo = $user->get();
$userInfo['PROPERTIES'] = $user->properties->getValues(sUserMgr()->getCurrentUserID());
$userInfo['PROPERTIES']['FULLNAME'] = trim($userInfo['PROPERTIES']['FIRSTNAME'] . ' ' . $userInfo['PROPERTIES']['LASTNAME']);
$previewMode = true;
} else {
// Get and set frontend timezone
$this->displaymode = "live";
$frontendTimezone = (string) Singleton::config()->getVar('CONFIG/TIMEZONES/FRONTEND');
if (!$frontendTimezone) {
$frontendTimezone = 'Europe/Berlin';
}
date_default_timezone_set($frontendTimezone);
}
$mailing = $mailingMgr->getMailing($mailingId, $mailingVersion);
if (!$mailing) {
sUserMgr()->impersonate(sUserMgr()->getAdministratorID());
if ($mailingMgr->getMailing($mailingId, $mailingVersion)) {
throwErrorPage('403');
} else {
throwErrorPage('404');
}
}
// init
示例4: sConfig
function sConfig()
{
return Singleton::config();
}