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


PHP lmbToolkit::instance方法代码示例

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


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

示例1: sendTo

 function sendTo($recipients, $subject = null, $sender = null, $charset = 'utf-8')
 {
     $tools = lmbToolkit::instance();
     $parts = self::_parseMailpartTags($this->_renderTemplate($tools));
     if (!$sender) {
         if (isset($parts['sender'])) {
             $sender = $parts['sender'];
         } else {
             $sender = $this->getDefaultSender();
         }
     }
     if (!$subject) {
         if (!isset($parts['subject'])) {
             throw new lmbException('Subject required for mail message');
         } else {
             $subject = $parts['subject'];
         }
     }
     $html = isset($parts['html_body']) ? $parts['html_body'] : null;
     $text = isset($parts['txt_body']) ? $parts['txt_body'] : null;
     $mailer = $tools->getMailer();
     if ($text and !$html) {
         $mailer->sendPlainMail($recipients, $sender, $subject, $text, $charset);
     } elseif ($html) {
         $mailer->sendHtmlMail($recipients, $sender, $subject, $html, $text, $charset);
     } else {
         throw new lmbException('Contents required for mail message');
     }
     return $mailer;
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:30,代码来源:lmbMacroTemplateMail.class.php

示例2: _getSession

 /**
  * @return lmbSession
  */
 protected function _getSession()
 {
     if (is_null($this->_session)) {
         $this->_session = lmbToolkit::instance()->getSession();
     }
     return $this->_session;
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:10,代码来源:lmbCacheSessionConnection.class.php

示例3: setUp

 function setUp()
 {
     $this->connection = lmbToolkit::instance()->getDefaultDbConnection();
     DriverMssqlSetup($this->connection->getConnectionId());
     DriverMssqlExec($this->connection->getConnectionId(), "SET IDENTITY_INSERT founding_fathers OFF");
     parent::setUp();
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:7,代码来源:lmbMssqlInsertTest.class.php

示例4: getTree

 /**
  * @return lmbMPTree
  */
 function getTree()
 {
     if (!$this->_tree) {
         $this->_tree = lmbToolkit::instance()->getCmsTree($this->getTableName(), $this->_db_conn);
     }
     return $this->_tree;
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:10,代码来源:lmbActiveRecordTreeNode.class.php

示例5: createCacheConnectionByName

 function createCacheConnectionByName($name)
 {
     $conf = $this->toolkit->getConf('cache');
     if (!$conf->get('cache_enabled')) {
         return $this->createCacheFakeConnection();
     } else {
         try {
             $dsn = lmbToolkit::instance()->getConf('cache')->get($name . '_cache_dsn');
             if (!is_object($dsn)) {
                 $dsn = new lmbUri($dsn);
             }
             if (!($wrapper = $dsn->getQueryItem('wrapper'))) {
                 $wrapper = array();
             }
             if ($conf->get('taggable_cache_enabled', false)) {
                 $wrapper[] = 'taggable';
             }
             if ($conf->get('mint_cache_enabled', false)) {
                 $wrapper[] = 'mint';
             }
             if ($conf->get('cache_log_enabled', false)) {
                 $wrapper[] = 'logged';
             }
             $dsn->addQueryItem('wrapper', $wrapper);
             return $this->createCacheConnectionByDSN($dsn);
         } catch (Exception $e) {
             return $this->createCacheFakeConnection();
         }
     }
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:30,代码来源:lmbCacheTools.class.php

示例6: setUp

 function setUp()
 {
     parent::setUp();
     $config = new lmbSet(array('default_profile' => 'foo_profile', 'foo_profile' => array('type' => 'fckeditor', 'baz' => 42), 'bar_profile' => array('type' => 'tinymce', 'baz' => 111)));
     lmbToolkit::instance()->setConf('wysiwyg', $config);
     $this->_helper = new lmbWysiwygConfigurationHelper();
 }
开发者ID:r-kitaev,项目名称:limb,代码行数:7,代码来源:lmbWysiwygConfigurationHelperTest.class.php

示例7: _initRequestProperties

 protected function _initRequestProperties($uri_string, $get, $post, $cookies, $files)
 {
     $this->__uri = !is_null($uri_string) ? new lmbUri($uri_string) : new lmbUri($this->getRawUriString());
     $this->__get = !is_null($get) ? $get : $_GET;
     $items = $this->__uri->getQueryItems();
     foreach ($items as $k => $v) {
         $this->__get[$k] = $v;
     }
     $this->__post = !is_null($post) ? $post : $_POST;
     $this->__cookies = !is_null($cookies) ? $cookies : $_COOKIE;
     $this->__files = !is_null($files) ? $this->_parseUploadedFiles($files) : $this->_parseUploadedFiles($_FILES);
     $this->_defineRequestMethod();
     if ($this->getRequestMethod() == 'PUT') {
         $this->__put = lmbToolkit::instance()->getInputStreamParser()->parse();
     }
     if (ini_get('magic_quotes_gpc')) {
         $this->__get = $this->_stripHttpSlashes($this->__get);
         $this->__post = $this->_stripHttpSlashes($this->__post);
         $this->__put = $this->_stripHttpSlashes($this->__put);
         $this->__cookies = $this->_stripHttpSlashes($this->__cookies);
     }
     $this->__request = lmbArrayHelper::arrayMerge($this->__get, $this->__post, $this->__put, $this->__files);
     foreach ($this->__request as $k => $v) {
         if (in_array($k, $this->__reserved_attrs)) {
             continue;
         }
         $this->set($k, $v);
     }
 }
开发者ID:knevcher,项目名称:korchasa_limb,代码行数:29,代码来源:lmbHttpRequest.class.php

示例8: __construct

 function __construct($filter_name)
 {
     $this->filter_name = $filter_name;
     $this->toolkit = lmbToolkit::instance();
     $this->request = $this->toolkit->getRequest();
     $this->session = $this->toolkit->getSession();
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:7,代码来源:lmbCmsAdminFilterHelper.class.php

示例9: appendStatementTo

 function appendStatementTo(&$str, &$values = array(), $conn = null)
 {
     if (!is_object($conn)) {
         $conn = lmbToolkit::instance()->getDefaultDbConnection();
     }
     if ($this->not_all) {
         $str .= 'NOT(';
     }
     if ($this->not) {
         $str .= 'NOT(';
     }
     $this->_appendExpressionToStatement($str, $values, $conn);
     if ($this->not) {
         $str .= ')';
     }
     for ($i = 0; $i < count($this->criteria); $i++) {
         $criteria = $this->criteria[$i];
         $str .= $this->conjunctions[$i];
         if ($criteria->isComplex()) {
             $str .= '(';
         }
         $criteria->appendStatementTo($str, $values, $conn);
         if ($criteria->isComplex()) {
             $str .= ')';
         }
     }
     if ($this->not_all) {
         $str .= ')';
     }
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:30,代码来源:lmbSQLBaseCriteria.class.php

示例10: locateTemplateByAlias

 static function locateTemplateByAlias($alias)
 {
     $locator = lmbToolkit::instance()->getWactLocator();
     if ($template_path = $locator->locateSourceTemplate($alias)) {
         return $template_path;
     }
 }
开发者ID:knevcher,项目名称:limb,代码行数:7,代码来源:lmbWactView.class.php

示例11: setUp

 function setUp()
 {
     $toolkit = lmbToolkit::instance();
     $this->conn = $toolkit->getDefaultDbConnection();
     $this->db = new lmbSimpleDb($this->conn);
     $this->_cleanUp();
 }
开发者ID:knevcher,项目名称:limb,代码行数:7,代码来源:lmbSimpleDbTest.class.php

示例12: getValue

 function getValue()
 {
     $value = $this->base->getValue();
     $toolkit = lmbToolkit::instance();
     if (isset($this->parameters[0]) && $this->parameters[0]->getValue()) {
         $locale = $toolkit->getLocaleObject($this->parameters[0]->getValue());
     } else {
         $locale = $toolkit->getLocaleObject();
     }
     if (isset($this->parameters[1]) && $this->parameters[1]->getValue()) {
         $fract_digits = $this->parameters[1]->getValue();
     } else {
         $fract_digits = $locale->fract_digits;
     }
     if (isset($this->parameters[2]) && $this->parameters[2]->getValue()) {
         $decimal_symbol = $this->parameters[2]->getValue();
     } else {
         $decimal_symbol = $locale->decimal_symbol;
     }
     if (isset($this->parameters[3]) && $this->parameters[3]->getValue()) {
         $thousand_separator = $this->parameters[3]->getValue();
     } else {
         $thousand_separator = $locale->thousand_separator;
     }
     if ($this->isConstant()) {
         return number_format($value, $fract_digits, $decimal_symbol, $thousand_separator);
     } else {
         $this->raiseUnresolvedBindingError();
     }
 }
开发者ID:knevcher,项目名称:limb,代码行数:30,代码来源:number.filter.php

示例13: _getDsnForUser

 protected function _getDsnForUser($user, $password)
 {
     $this->toolkit = lmbToolkit::instance();
     $dsn_uri = clone $this->toolkit->getDefaultDbDSN()->_getUri();
     $dsn_uri->setUser($user);
     $dsn_uri->setPassword($password);
     return new lmbDbDSN($dsn_uri->toString());
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:8,代码来源:lmbPgsqlDbInfoTest.class.php

示例14: lmb_tests_teardown_db

function lmb_tests_teardown_db()
{
    $conn = lmbToolkit::instance()->getDefaultDbConnection();
    lmb_require('limb/dbal/src/lmbSimpleDb.class.php');
    $db = new lmbSimpleDb($conn);
    $db->truncateDb();
    echo "INFO: Database was cleaned up\n";
}
开发者ID:snowjobgit,项目名称:limb,代码行数:8,代码来源:init.inc.php

示例15: setUp

 function setUp()
 {
     $this->connection = lmbToolkit::instance()->getDefaultDbConnection();
     DriverLinterSetup($this->connection->getConnectionId());
     $sql = 'SELECT "id", "first" FROM founding_fathers ORDER BY "id"';
     $this->stmt = $this->connection->newStatement($sql);
     $this->cursor = $this->stmt->getRecordSet();
 }
开发者ID:knevcher,项目名称:limb,代码行数:8,代码来源:lmbLinterRecordSetTest.class.php


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