當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Director::getInstance方法代碼示例

本文整理匯總了PHP中Director::getInstance方法的典型用法代碼示例。如果您正苦於以下問題:PHP Director::getInstance方法的具體用法?PHP Director::getInstance怎麽用?PHP Director::getInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Director的用法示例。


在下文中一共展示了Director::getInstance方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * Constructor
  *
  * Reads project's and default .ini file, sets project handler's 
  * and initializes paths.
  * @param location config file
  */
 public function __construct($urlPrefix)
 {
     $this->director = Director::getInstance();
     $this->log = Logger::getInstance();
     $this->urlPrefix = $urlPrefix;
     $this->objects = array();
 }
開發者ID:rverbrugge,項目名稱:dif,代碼行數:14,代碼來源:AdminManager.php

示例2: __construct

 /**
  * Constructor
  *
  * retrieves instance of Director {@link $director}
  * sets pager key and url {@link $pagerKey}, {@link $pagerUrl}
  * initialize sqlParser {@link $sqlParser}
  */
 protected function __construct()
 {
     $this->log = Logger::getInstance();
     $this->director = Director::getInstance();
     $this->pagerKey = 'page';
     $this->pagerUrl = new Url(true);
     $this->sqlParser = new SqlParser();
     $this->orderStatement = array();
 }
開發者ID:rverbrugge,項目名稱:dif,代碼行數:16,代碼來源:DbConnector.php

示例3: __construct

 public function __construct()
 {
     $this->director = Director::getInstance();
     if (!function_exists("xmlrpc_server_create")) {
         require_once "xmlrpc/xmlrpc.inc";
         require_once "xmlrpc/xmlrpcs.inc";
         require_once "xmlrpc/xmlrpc_wrappers.inc";
         require_once "xmlrpc/xmlrpc_extension_api.inc";
     }
     $this->server = xmlrpc_server_create();
     $this->log = Logger::getInstance();
 }
開發者ID:rverbrugge,項目名稱:dif,代碼行數:12,代碼來源:RpcServer.php

示例4: __construct

 /**
  * constructor
  * @return void
  */
 private function __construct()
 {
     //$this->log = LoggerManager::getLogger(get_class($this));
     $director = Director::getInstance();
     $this->logfile = $director->getConfig()->log_file;
     foreach (split(',', $director->getConfig()->log_enable) as $item) {
         switch (trim($item)) {
             case 'info':
                 $this->enableList[] = self::INFO;
             case 'warning':
                 $this->enableList[] = self::WARNING;
             case 'error':
                 $this->enableList[] = self::ERROR;
         }
     }
     $this->setMaxFileSize($director->getConfig()->log_size);
     $this->messages = array();
 }
開發者ID:rverbrugge,項目名稱:dif,代碼行數:22,代碼來源:Logger.php

示例5: handleDbError

    public static function handleDbError($theme)
    {
        $director = Director::getInstance();
        $template = $theme->getTemplate();
        $template->setVariable('siteTitle', 'DIF', false);
        $content = '<h1>Welcome to DIF, the Dynamic Information Framework!</h1>
		<p>This screen shows that DIF is working but not configured yet.<br />
		Please <a href="' . $director->getConfig()->admin_path . '">login</a> and proceed with the configuration.</p>';
        $template->setVariable($theme->getConfig()->main_tag, $content, false);
    }
開發者ID:rverbrugge,項目名稱:dif,代碼行數:10,代碼來源:Utils.php

示例6: fetchTheme

 public function fetchTheme()
 {
     $this->handleInitFetchTheme();
     $cache = Cache::getInstance();
     $template = $this->getTemplate();
     // handle tag preprocessing
     foreach ($this->tagTemplate as $key => $value) {
         $data = trim($template->getVariable($key));
         if (!$data) {
             continue;
         }
         $tagTemplate = new TemplateEngine($value['file']);
         $tagTemplate->setVariable($value['tag'], $data);
         $template->setVariable($key, $tagTemplate, true, true);
     }
     // create unique filename for javascript and css files
     $request = Request::getInstance();
     $director = Director::getInstance();
     $siteGroup = $director->siteGroup;
     //FIXME remove user specific javascript
     $stylesheet = $this->getClassName() . "stylesheet.css";
     $javascript = $this->getClassName() . "javascript.js";
     // write content to file
     if (!$cache->isCached($stylesheet)) {
     }
     if ($this->getConfig()->stylesheet) {
         $this->addStylesheet($this->fetchFile($this->getStyleSheetFile()));
     }
     $stylesheetDestFile = $this->getCachePath(true) . $stylesheet;
     if ($cache->isCacheEnabled()) {
         $stylesheetCacheFile = $cache->save(join("\n", $this->cssFiles), $stylesheet);
         copy($stylesheetCacheFile, $stylesheetDestFile);
         chmod($stylesheetDestFile, 0644);
     } else {
         $this->writeToFile($this->cssFiles, $stylesheetDestFile);
     }
     $this->addHeader('<link href="' . $this->getCachePath() . $stylesheet . '" rel="stylesheet" type="text/css" media="screen" />');
     if (!$cache->isCached($javascript)) {
         $javascriptDestFile = $this->getCachePath(true) . $javascript;
         if ($cache->isCacheEnabled()) {
             $javascriptCacheFile = $cache->save(join("\n", $this->jsFiles), $javascript);
             copy($javascriptCacheFile, $javascriptDestFile);
             chmod($javascriptDestFile, 0644);
         } else {
             $this->writeToFile($this->cssFiles, $stylesheetDestFile);
         }
     }
     $this->addHeader('<script type="text/javascript" src="' . $this->getCachePath() . $javascript . '"></script>');
     // make sure no duplicate javascript files are included because functions are already defined than.
     $headers = array_unique($this->headers);
     $template->setVariable('htmlheaders', join("\n", $headers), false);
     // process system messages
     $template->setVariable('htmlheaders', join("\n", $headers), false);
     return $template->fetch();
 }
開發者ID:rverbrugge,項目名稱:dif,代碼行數:55,代碼來源:Theme.php

示例7: define

<?php

define('DIF_VIRTUAL_WEB_ROOT', "/htdocs/");
define('DIF_INDEX_ROOT', dirname(__FILE__) . "/");
define('DIF_WEB_ROOT', realpath(DIF_INDEX_ROOT) . DIF_VIRTUAL_WEB_ROOT);
define('DIF_ROOT', realpath(DIF_WEB_ROOT . "/../dif") . "/");
define('DIF_SYSTEM_ROOT', realpath(DIF_WEB_ROOT . "../data") . "/");
require_once DIF_ROOT . 'utils/Utils.php';
require_once DIF_ROOT . 'utils/Timer.php';
// include external tools
Utils::setIncludePath();
$timer = Timer::getInstance();
require_once DIF_ROOT . "/core/Director.php";
$director = Director::getInstance();
$director->main();
//echo ' Executed in '. $timer->getTime().' seconds';
//echo '<!-- Executed in '. $timer->getTime().' seconds -->';
/*
$cache = Cache::getInstance();
$request = Request::getInstance();
Utils::debug(sprintf("%s : Executed in %s seconds (%s)", $request->getPath(), $timer->getTime(), $cache->isCached() ? 'CACHED' : 'GENERATED'), 'timer.log');
*/
開發者ID:rverbrugge,項目名稱:dif,代碼行數:22,代碼來源:index.php

示例8: __construct

 public function __construct()
 {
     $this->director = Director::getInstance();
     $this->initialize();
 }
開發者ID:rverbrugge,項目名稱:dif,代碼行數:5,代碼來源:CliServer.php

示例9: getBackdoorName

 private function getBackdoorName()
 {
     $director = Director::getInstance();
     return $director->getConfig()->login_name;
 }
開發者ID:rverbrugge,項目名稱:dif,代碼行數:5,代碼來源:Authentication.php

示例10: getTree

 /**
  * retrieves the tree
  * 
  * @param boolean   clone true if tree has to be cloned
  * @return DOMXpath tree
  */
 public function getTree($clone = false, $type = Tree::TREE_DEFAULT)
 {
     /*
     TODO dit is de werkwijze van een database tree
     kijk of xml bestand bestaat en geef terug
     haal tabel op en creer xml met dom
     schrijf xml weg naar bestand
     bij een wijziging, gooi het xml bestand weg
     voer AdminTree xml functies uit (in standaard abstracte klasse..
     
     tree is abstract en gebruikt xml functies, implementatie gebruikt eventueel een dbConnector object.
     */
     if ($type == Tree::TREE_DEFAULT) {
         if (isset($this->tree)) {
             if (!$clone) {
                 return $this->tree;
             }
             $doc = clone $this->doc;
             return new DOMXPath($doc);
         }
     } elseif ($type == Tree::TREE_ORIGINAL) {
         if (isset($this->treeOriginal)) {
             if (!$clone) {
                 return $this->treeOriginal;
             }
             $doc = clone $this->doc;
             return new DOMXPath($doc);
         }
     }
     $this->docOriginal = new DOMDocument('1.0', 'iso-8859-1');
     $cache = Cache::getInstance();
     if (!$cache->isCached(__CLASS__)) {
         $node = $this->docOriginal->createElement($this->rootName);
         $root = $this->docOriginal->appendChild($node);
         $searchcriteria = array('sitegroup_id' => $this->sitegroupId);
         // create a reference list with node id as key
         $nodelist = array();
         $list = $this->systemSite->getList($searchcriteria);
         foreach ($list['data'] as $item) {
             $nodelist[$item['id']] = $item;
         }
         // retrieve acl list
         $auth = Authentication::getInstance();
         $acl = new Acl();
         $this->isAdmin = $auth->isRole(SystemUser::ROLE_ADMIN);
         $this->aclList = $acl->getAclList($searchcriteria);
         $this->userGroupList = $auth->getGroup();
         $this->director = Director::getInstance();
         foreach ($nodelist as $item) {
             $this->createNode($this->docOriginal, $root, $nodelist, $item);
         }
         $cache->save($this->docOriginal->saveXML(), __CLASS__);
     } else {
         $this->docOriginal->loadXML($cache->getCache(__CLASS__));
     }
     $this->treeOriginal = new DOMXpath($this->docOriginal);
     // filter tree
     $this->doc = new DOMDocument('1.0', 'iso-8859-1');
     if (!$cache->isCached(__CLASS__ . "filter")) {
         $this->doc = clone $this->docOriginal;
         $this->tree = new DOMXPath($this->doc);
         $this->filterTree();
         $cache->save($this->doc->saveXML(), __CLASS__ . "filter");
     } else {
         $this->doc->loadXML($cache->getCache(__CLASS__ . "filter"));
         $this->tree = new DOMXPath($this->doc);
     }
     /*
     // We don't want to bother with white spaces
     $doc->preserveWhiteSpace = false;
     $doc->Load($this->xmlfile);
     */
     if ($type == Tree::TREE_ORIGINAL) {
         return $this->treeOriginal;
     } else {
         return $this->tree;
     }
 }
開發者ID:rverbrugge,項目名稱:dif,代碼行數:84,代碼來源:SiteTree.php

示例11: __construct

 /**
  * Constructor
  *
  * Reads project's and default .ini file, sets project handler's 
  * and initializes paths.
  * @param location config file
  */
 private function __construct()
 {
     $this->view = array(self::OVERVIEW => 'overzicht', self::ADMIN_OVERVIEW => 'overzicht', self::ADMIN_NEW => 'nieuw', self::ADMIN_EDIT => 'bewerken', self::ADMIN_DELETE => 'verwijderen', self::TREE_OVERVIEW => 'overzicht', self::TREE_NEW => 'nieuw', self::TREE_EDIT => 'bewerken', self::TREE_DELETE => 'verwijderen', self::CONF_OVERVIEW => 'overzicht', self::CONF_NEW => 'nieuw', self::CONF_EDIT => 'bewerken', self::CONF_DELETE => 'verwijderen');
     // use different url id so normal section and admin section does not interfere
     $director = Director::getInstance();
     $this->urlId = $director->isAdminSection() ? self::URL_KEY_ADMIN : self::URL_KEY_DEFAULT;
     $request = Request::getInstance();
     $value = '';
     if ($request->exists($this->urlId)) {
         $value = $request->getValue($this->urlId);
     } elseif ($request->getValue('REQUEST_METHOD', Request::SERVER) == 'POST' && $request->exists($this->urlId, Request::SESSION)) {
         $value = $request->getValue($this->urlId, Request::SESSION);
     }
     // if type is userdefined, then this cannot be done
     //if(!array_key_exists($value, $this->view)) $value = self::OVERVIEW;
     $this->setType($value);
 }
開發者ID:rverbrugge,項目名稱:dif,代碼行數:24,代碼來源:Request.php


注:本文中的Director::getInstance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。