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


PHP Factory::getDBO方法代码示例

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


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

示例1: __construct

 /**
 	Class constructor
 		@public
 	**/
 function __construct()
 {
     $this->_db =& Factory::getDBO();
     if ($args = func_get_args()) {
         $table_key = $args[0];
         $table_name = $args[1];
         $this->__initTable($table_key, $table_name);
     }
 }
开发者ID:rudenyl,项目名称:kcms,代码行数:13,代码来源:model.class.php

示例2: getWeblogId

 private function getWeblogId()
 {
     fb('ssss', FirePHP::TRACE);
     $ob = Factory::getDBO()->SimpleSelect('wb_weblogs', 'id', array("site_id" => ResponseRegistery::getInstance()->site_id))->fetch();
     fb($ob, 'admin');
     if ($ob) {
         return intval($ob->id);
     } else {
         return 0;
     }
 }
开发者ID:redknight,项目名称:frot,代码行数:11,代码来源:BlogController.php

示例3: getSiteId

 private function getSiteId($sub)
 {
     $db = Factory::getDBO();
     $sql = "SELECT\n\t\t\t\t\tsite.id as id,\n\t\t\t\t\tsite.active\n\t\t\t\tFROM ge_sites as site\n\t\t\t\tJOIN ge_subdomains as subdomain\n\t\t\t\t\tON(site.id=subdomain.site_id)\n\t\t\t\t\t\n\t\t\t\tWHERE\n\t\t\t\t\tsub_domain=" . $db->valueQuote($db->getEscaped($sub));
     $res = $db->query($sql)->fetch();
     if ($res->active == 0) {
         throw new InActiveException();
     }
     if ($res) {
         return $res->id;
     } else {
         return false;
     }
 }
开发者ID:redknight,项目名称:frot,代码行数:14,代码来源:FrotelRouter.php

示例4: saveCode

 public function saveCode()
 {
     Factory::getUser()->authorise("template", ResponseRegistery::getInstance()->site_id);
     $db = Factory::getDBO();
     $data->main = $this->input->getString('main');
     $data->id = $this->getWebLogTemplateId();
     $db->StoreObject("ge_templates", $data);
     //Messages::getInstance()->logSuccess('قالب با موفقیت ذخیره و اعمال شد');
     $msg = Messages::getInstance();
     $msg->logSuccess('قالب با موفقیت ذخیره شد');
     if ($this->compile($data->main, $data->id)) {
         $msg->logSuccess('قالب با موفقیت اعمال شد');
     } else {
         $msg->logError('در ساختار قالب خطا وجود دارد لطفا قبل از نمایش وبلاگ این خطاها را بررسی کنید');
     }
     $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/dashboard/template/show");
 }
开发者ID:redknight,项目名称:frot,代码行数:17,代码来源:DashboardTemplateService.php

示例5: findWeblogAddress

    public function findWeblogAddress()
    {
        $db = Factory::getDBO();
        $sql = 'SELECT
		    site.id,
                    sub_domain
                 FROM ge_subdomains sub
                 JOIN ge_sites as site
                    ON(sub.site_id=site.id)
                 JOIN ge_users_sites as us
                    ON(site.id=us.site_id)
                 WHERE
                    us.user_id=' . intval(Factory::getUser()->id);
        fb(Factory::getUser()->id, 'user_id');
        $sub = $db->query($sql)->fetch();
        if ($sub) {
            ResponseRegistery::getInstance()->site_id = $sub->id;
            return $sub->sub_domain;
        }
        return false;
    }
开发者ID:redknight,项目名称:frot,代码行数:21,代码来源:DashboardController.php

示例6: getItemPerPage

 private function getItemPerPage($id)
 {
     return 50;
     return Factory::getDBO()->SimpleSelect('wb_weblogs', 'post_in_page', 'id=' . $id)->fetch()->post_in_page;
 }
开发者ID:redknight,项目名称:frot,代码行数:5,代码来源:ShopService.php

示例7: disban

 public function disban()
 {
     Factory::getUser()->authorise("admin", ResponseRegistery::getInstance()->site_id);
     $site_id = $this->input->getInt('id');
     $tmp->id = $site_id;
     $tmp->active = 1;
     Factory::getDBO()->StoreObject("ge_sites", $tmp);
     Messages::getInstance()->logSuccess('سایت مورد نظر با موفقیت فعال شد');
     $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/admin/blog/show");
 }
开发者ID:redknight,项目名称:frot,代码行数:10,代码来源:AdminBlogService.php

示例8: _loadById

 /**
 	Load module by module id
 		@private
 	**/
 private static function _loadById($id)
 {
     $db = Factory::getDBO();
     $sql = "SELECT *" . "\n FROM {TABLE_PREFIX}_modules" . "\n WHERE `id` = " . $db->Quote($id) . "\n AND `published` = '1'" . "\n ORDER BY `ordering`";
     $db->query($sql);
     return $db->fetch_object();
 }
开发者ID:rudenyl,项目名称:kcms,代码行数:11,代码来源:modulehelper.class.php

示例9: __construct

 /**
 	Constructor
 		@abstract
 	**/
 function __construct()
 {
     // init db
     $this->__db =& Factory::getDBO();
 }
开发者ID:rudenyl,项目名称:kcms,代码行数:9,代码来源:sessiondbhandler.class.php

示例10: __construct

 public function __construct()
 {
     $this->db = Factory::getDBO();
     $this->input = Request::getInstance();
     $this->reponse = Response::getInstance();
 }
开发者ID:redknight,项目名称:frot,代码行数:6,代码来源:Service.php

示例11: cleanVar

 /**
 	Simple XSS fix
 		@param $var string
 		@param $convert_to_html boolean
 		@public
 	**/
 function cleanVar($var, $convert_to_html = true)
 {
     // init db
     $db =& Factory::getDBO();
     if (get_magic_quotes_gpc()) {
         $var = stripslashes($var);
     }
     // utilize mysql string escape function
     $config =& Factory::getConfig();
     if (strpos($config->dsn, 'mysql') !== false) {
         $var = @mysql_real_escape_string($var);
     }
     if ($convert_to_html) {
         $var = htmlentities($var);
     }
     return $var;
 }
开发者ID:rudenyl,项目名称:kcms,代码行数:23,代码来源:utility.class.php

示例12: saveRedirection

 /** 
 	Save redirection uri to table
 		@param $oldurl string
 		@param $newurl string
 		@private
 	**/
 private static function saveRedirection($oldurl, $newurl)
 {
     $db = Factory::getDBO();
     // check if exists
     // pass 1
     $query = "SELECT `newurl`" . "\n FROM {TABLE_PREFIX}_redirection" . "\n WHERE `oldurl` = " . $db->Quote($oldurl);
     $db->query($query);
     $result = $db->result();
     if (!empty($result)) {
         // update on recent change
         if ($result != $newurl) {
             $query = "UPDATE {TABLE_PREFIX}_redirection" . "\n SET `newurl` = " . $db->Quote($newurl) . "\n WHERE `oldurl` = " . $db->Quote($oldurl);
             $db->query($query);
             $result = $newurl;
         }
         return $result;
     }
     // pass 2
     $query = "SELECT count(*)" . "\n FROM {TABLE_PREFIX}_redirection" . "\n WHERE `newurl` = " . $db->Quote($newurl);
     $db->query($query);
     $found = (int) $db->result();
     // increment
     if ($found) {
         $newurl = $newurl . "-{$found}";
     }
     /**/
     // 11/09/2012
     $values = array($db->Quote($newurl), $db->Quote($oldurl));
     $query = "INSERT IGNORE INTO {TABLE_PREFIX}_redirection(`newurl`,`oldurl`)" . "\n VALUES(" . implode(',', $values) . ")";
     $db->query($query);
     if ($found) {
         return $newurl;
     }
     return false;
 }
开发者ID:rudenyl,项目名称:kcms,代码行数:41,代码来源:url.class.php

示例13: __construct

 public function __construct()
 {
     $this->db = Factory::getDBO();
 }
开发者ID:redknight,项目名称:frot,代码行数:4,代码来源:DataGetway.php

示例14: _isActive

 /**
 	Check if selected language is active
 		@return boolean
 		@private
 	**/
 private static function _isActive($lang_id)
 {
     $db =& Factory::getDBO();
     $sql = "SELECT `published`" . "\n FROM {TABLE_PREFIX}_languages" . "\n WHERE `lang_code` = " . $db->Quote($lang_id);
     $db->query($sql);
     return (int) $db->result();
 }
开发者ID:rudenyl,项目名称:kcms,代码行数:12,代码来源:i18n.class.php

示例15: __construct

 /**
 	Class constructor
 		@public
 	**/
 function __construct()
 {
     $this->__dbo =& Factory::getDBO();
     $this->_build();
 }
开发者ID:rudenyl,项目名称:kcms,代码行数:9,代码来源:acl.class.php


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