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


PHP db_factory类代码示例

本文整理汇总了PHP中db_factory的典型用法代码示例。如果您正苦于以下问题:PHP db_factory类的具体用法?PHP db_factory怎么用?PHP db_factory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: querySelect

 static function querySelect($table_name, $field, $tablefields)
 {
     $db_factory = new db_factory();
     $fori = 0;
     $forlimit = 500;
     $sqlCount = $db_factory->get_count("select count(*) from " . $table_name);
     if (!$sqlCount) {
         return false;
     }
     $tabledump = '';
     $numfields = count($tablefields);
     while ($fori <= $sqlCount) {
         $sql = $db_factory->query("select * from " . $table_name . " limit " . $fori . "," . $forlimit);
         foreach ($sql as $r) {
             $row = array_values($r);
             $sqlmsg = $comma = '';
             for ($i = 0; $i < $numfields; $i++) {
                 $sqlmsg .= $comma . (!empty($row[$i]) && (self::strexists($tablefields[$i]['Type'], 'char') || self::strexists($tablefields[$i]['Type'], 'text')) ? '0x' . bin2hex($row[$i]) : '\'' . mysql_escape_string($row[$i]) . '\'');
                 $comma = ',';
             }
             $tabledump .= " INSERT INTO " . $table_name . "  VALUES(" . $sqlmsg . ") ;\n";
         }
         $fori += $forlimit;
     }
     return $tabledump;
 }
开发者ID:pengfeiaaa,项目名称:web,代码行数:26,代码来源:keke_backup_class.php

示例2: setUp

 function setUp()
 {
     $this->db =& db_factory::instance();
     $this->_clean_up();
     $this->_init_site_object();
     $this->object->set_attribute('controller_name', 'site_object_controller');
     $controller_id = site_object_controller::get_id('site_object_controller');
     $this->object->set_attribute('controller_id', $controller_id);
     debug_mock::init($this);
     $user =& user::instance();
     $user->_set_id(10);
     $tree =& tree::instance();
     $values['identifier'] = 'root';
     $values['object_id'] = 100;
     $this->root_node_id = $tree->create_root_node($values, false, true);
     $class_id = $this->object->get_class_id();
     $this->db->sql_insert('sys_site_object', array('id' => 100, 'class_id' => $class_id, 'current_version' => 1));
     $values['identifier'] = 'ru';
     $values['object_id'] = 1;
     $this->parent_node_id = $tree->create_sub_node($this->root_node_id, $values);
     $this->db->sql_insert('sys_site_object', array('id' => 1, 'class_id' => $class_id, 'current_version' => 1));
     $values['identifier'] = 'document';
     $values['object_id'] = 10;
     $this->sub_node_id = $tree->create_sub_node($this->parent_node_id, $values);
     $this->db->sql_insert('sys_site_object', array('id' => 10, 'class_id' => $class_id, 'current_version' => 1));
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:26,代码来源:site_object_manipulation_test.class.php

示例3: setUp

  function setUp()
  {
    $this->db =& db_factory :: instance();
    $this->links_manager =& new links_manager();

    $this->_clean_up();
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:links_manager_test.class.php

示例4: pub_mode_init

 function pub_mode_init($std_cache_name, $data = array())
 {
     global $kekezu;
     global $_lang;
     $release_info = $this->_std_obj->_release_info;
     switch ($this->_pub_mode) {
         case "professional":
             break;
         case "guide":
             break;
         case "onekey":
             if (!$release_info) {
                 $sql = " select model_id,task_title,task_desc,indus_id,indus_pid,\n\t\t\t\t\t\ttask_cash_coverage,start_time,end_time,contact from %switkey_task where task_id='%d' and model_id='%d'";
                 $task_info = db_factory::get_one(sprintf($sql, TABLEPRE, $data['t_id'], $this->_model_id));
                 $task_info or kekezu::show_msg($_lang['operate_notice'], $_SERVER['HTTP_REFERER'], 3, $_lang['not_exsist_relation_task_and_not_user_onekey'], "warning");
                 $release_info = $this->onekey_mode_format($task_info);
                 $allow_time = $task_info['end_time'] - $task_info['start_time'];
                 $task_day = date('Y-m-d', $allow_time + time());
                 $release_info['txt_task_day'] = $task_day;
                 $release_info['task_cash_cove'] = $task_info['task_cash_coverage'];
                 $this->save_task_obj($release_info, $std_cache_name);
             }
             break;
     }
 }
开发者ID:huangbinzd,项目名称:kppwGit,代码行数:25,代码来源:tender_release_class.php

示例5: setUp

 function setUp()
 {
     $this->db = db_factory::instance();
     debug_mock::init($this);
     $this->driver = new materialized_path_driver_test_version();
     $this->_clean_up();
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:materialized_path_driver_test.class.php

示例6: setUp

  function setUp()
  {
    parent :: setUp();

    $this->db =& db_factory :: instance();

    $tree =& tree :: instance();

    $values['identifier'] = 'root';
    $this->node_id_root = $tree->create_root_node($values, false, true);

    $values['identifier'] = 'ru';
    $values['object_id'] = 1;
    $this->node_id_ru = $tree->create_sub_node($this->node_id_root, $values);

    $values['identifier'] = 'document';
    $values['object_id'] = 10;
    $this->node_id_document = $tree->create_sub_node($this->node_id_ru, $values);

    $values['identifier'] = 'doc1';
    $values['object_id'] = 20;
    $this->node_id_doc1 = $tree->create_sub_node($this->node_id_ru, $values);

    $values['identifier'] = 'doc2';
    $values['object_id'] = 30;
    $this->node_id_doc2 = $tree->create_sub_node($this->node_id_ru, $values);
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:27,代码来源:tree_identifier_rule_test.class.php

示例7: full_text_search

	function full_text_search()
	{
		$this->db =& db_factory :: instance();
		$this->indexer =& new full_text_indexer();
		
		$this->use_boolean_mode = $this->_check_boolean_mode();
	}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:full_text_search.class.php

示例8: process_report

 public function process_report($op_result, $type)
 {
     global $_lang;
     $trans_name = $this->get_transrights_name($this->_report_type);
     $op_result = $this->op_result_format($op_result);
     if ($op_result['action']) {
         if ($op_result['product_remove'] == 1) {
             $res = db_factory::execute(sprintf(" update %switkey_service set service_status='3' where service_id='%d'", TABLEPRE, $this->_obj_info['origin_id']));
             $this->process_notify('pass', $this->_report_info, $this->_user_info, $this->_to_user_info, $op_result['process_result']);
             $this->change_status($this->_report_id, '4', $op_result, $op_result['process_result']);
             $res and kekezu::admin_show_msg($trans_name . $_lang['deal_success'], "index.php?do=trans&view=report&type={$type}", "3", '', 'success') or kekezu::admin_show_msg($trans_name . $_lang['deal_fail'], "index.php?do=trans&view=process&type={$type}&report_id=" . $this->_report_id, "3", '', 'warning');
         }
         if ($op_result['product_remove'] == 2) {
             $this->process_notify('nopass', $this->_report_info, $this->_user_info, $this->_to_user_info, $op_result['process_result']);
             $res = $this->change_status($this->_report_id, '3', $op_result, $op_result, $op_result['reply']);
             $res and kekezu::admin_show_msg($trans_name . $_lang['deal_success'], "index.php?do=trans&view=rights&type={$type}", "3", '', 'success') or kekezu::admin_show_msg($trans_name . $_lang['deal_fail'], "index.php?do=trans&view=process&type={$type}&report_id=" . $this->_report_id, "3", '', 'warning');
         }
         if ($op_result['product_remove'] == 3) {
             $this->disablePeople();
             $this->process_notify('pass', $this->_report_info, $this->_user_info, $this->_to_user_info, $op_result['process_result']);
             $res = $this->change_status($this->_report_id, '4', $op_result, $op_result['process_result']);
             $res and kekezu::admin_show_msg($trans_name . $_lang['deal_success'], "index.php?do=trans&view=rights&type={$type}", "3", '', 'success') or kekezu::admin_show_msg($trans_name . $_lang['deal_fail'], "index.php?do=trans&view=process&type={$type}&report_id=" . $this->_report_id, "3", '', 'warning');
         }
     }
 }
开发者ID:huangbinzd,项目名称:kppwGit,代码行数:25,代码来源:service_report_class.php

示例9: setUp

 function setUp()
 {
     $this->db =& db_factory::instance();
     $this->stats_uri = new stats_uri_self_test_version($this);
     $this->stats_uri->stats_uri();
     $this->_clean_up();
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:stats_uri_test.class.php

示例10: setUp

  function setUp()
  {
    $this->db =& db_factory :: instance();
    $this->db_table_test =& db_table_factory :: instance('test1');

    $this->_clean_up();
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:db_table_test.class.php

示例11: db_table

 function db_table()
 {
     $this->_db_table_name = $this->_define_db_table_name();
     $this->_columns = $this->_define_columns();
     $this->_constraints = $this->_define_constraints();
     $this->_db =& db_factory::instance();
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:db_table.class.php

示例12: setUp

 function setUp()
 {
     $this->db = db_factory::instance();
     debug_mock::init($this);
     $this->driver = new nested_sets_driver_test_version();
     $this->_clean_up();
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:nested_sets_driver_test.class.php

示例13: setUp

  function setUp()
  {
    $this->report = new stats_referers_report();
    $this->db =& db_factory :: instance();

    $this->_clean_up();
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:stats_referers_report_test.class.php

示例14: setUp

 function setUp()
 {
     $this->db =& db_factory::instance();
     $this->stats_referer = new stats_referer_self_test_version($this);
     $this->stats_referer->stats_referer();
     $this->_clean_up();
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:stats_referer_test.class.php

示例15: getwithdata

 public function getwithdata()
 {
     $connection = db_factory::factory(DB_TYPE);
     $sql = "select * from userdao order by username";
     $results = $connection->getArray($sql);
     $this->populate($results, 'user');
 }
开发者ID:andela-bmakinwa,项目名称:php_cnv_framework,代码行数:7,代码来源:userscollection.php


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