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


PHP DBQuery::addReplace方法代码示例

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


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

示例1: store

 function store()
 {
     $q = new DBQuery();
     $q->addTable('project_designer_options');
     $q->addReplace('pd_option_user', $this->pd_option_user);
     $q->addReplace('pd_option_view_project', $this->pd_option_view_project);
     $q->addReplace('pd_option_view_gantt', $this->pd_option_view_gantt);
     $q->addReplace('pd_option_view_tasks', $this->pd_option_view_tasks);
     $q->addReplace('pd_option_view_actions', $this->pd_option_view_actions);
     $q->addReplace('pd_option_view_addtasks', $this->pd_option_view_addtasks);
     $q->addReplace('pd_option_view_files', $this->pd_option_view_files);
     $q->addWhere('pd_option_user = ' . $this->pd_option_user);
     $q->exec();
 }
开发者ID:hoodoogurus,项目名称:dotprojecteap,代码行数:14,代码来源:projectdesigner.class.php

示例2: store

 public function store(CAppUI $AppUI = null)
 {
     global $AppUI;
     $q = new DBQuery();
     $q->addTable('project_designer_options');
     $q->addReplace('pd_option_user', $this->pd_option_user);
     $q->addReplace('pd_option_view_project', $this->pd_option_view_project);
     $q->addReplace('pd_option_view_gantt', $this->pd_option_view_gantt);
     $q->addReplace('pd_option_view_tasks', $this->pd_option_view_tasks);
     $q->addReplace('pd_option_view_actions', $this->pd_option_view_actions);
     $q->addReplace('pd_option_view_addtasks', $this->pd_option_view_addtasks);
     $q->addReplace('pd_option_view_files', $this->pd_option_view_files);
     $q->addWhere('pd_option_user = ' . (int) $this->pd_option_user);
     $q->exec();
 }
开发者ID:joly,项目名称:web2project,代码行数:15,代码来源:projectdesigner.class.php

示例3: updateUserSpecificTaskPriority

 function updateUserSpecificTaskPriority($user_task_priority = 0, $user_id = 0, $task_id = NULL)
 {
     $q = new DBQuery();
     // use task_id of given object if the optional parameter task_id is empty
     $task_id = empty($task_id) ? $this->task_id : $task_id;
     $q->addTable('user_tasks');
     $q->addReplace('user_id', $user_id);
     $q->addReplace('task_id', $task_id);
     $q->addReplace('user_task_priority', $user_task_priority);
     $q->exec();
     $q->clear();
 }
开发者ID:hoodoogurus,项目名称:dotprojecteap,代码行数:12,代码来源:tasks.class.php

示例4: indexStrings

 public function indexStrings()
 {
     global $AppUI, $w2Pconfig;
     $nwords_indexed = 0;
     /* Workaround for indexing large files:
      ** Based on the value defined in config data,
      ** files with file_size greater than specified limit
      ** are not indexed for searching.
      ** Negative value :<=> no filesize limit
      */
     $index_max_file_size = w2PgetConfig('index_max_file_size', 0);
     if ($index_max_file_size < 0 || $obj->file_size <= $index_max_file_size * 1024) {
         // get the parser application
         $parser = $w2Pconfig['parser_' . $this->file_type];
         if (!$parser) {
             $parser = $w2Pconfig['parser_default'];
         }
         if (!$parser) {
             return false;
         }
         // buffer the file
         $this->_filepath = W2P_BASE_DIR . '/files/' . $this->file_project . '/' . $this->file_real_filename;
         $fp = fopen($this->_filepath, 'rb');
         $x = fread($fp, $this->file_size);
         fclose($fp);
         // parse it
         $parser = $parser . ' ' . $this->_filepath;
         $pos = strpos($parser, '/pdf');
         if (false !== $pos) {
             $x = `{$parser} -`;
         } else {
             $x = `{$parser}`;
         }
         // if nothing, return
         if (strlen($x) < 1) {
             return 0;
         }
         // remove punctuation and parse the strings
         $x = str_replace(array('.', ',', '!', '@', '(', ')'), ' ', $x);
         $warr = explode(' ', $x);
         $wordarr = array();
         $nwords = count($warr);
         for ($x = 0; $x < $nwords; $x++) {
             $newword = $warr[$x];
             if (!preg_match('[[:punct:]]', $newword) && mb_strlen(mb_trim($newword)) > 2 && !preg_match('[[:digit:]]', $newword)) {
                 $wordarr[$newword] = $x;
             }
         }
         // filter out common strings
         $ignore = w2PgetSysVal('FileIndexIgnoreWords');
         $ignore = str_replace(' ,', ',', $ignore);
         $ignore = str_replace(', ', ',', $ignore);
         $ignore = explode(',', $ignore);
         foreach ($ignore as $w) {
             unset($wordarr[$w]);
         }
         $nwords_indexed = count($wordarr);
         // insert the strings into the table
         while (list($key, $val) = each($wordarr)) {
             $q = new DBQuery();
             $q->addTable('files_index');
             $q->addReplace('file_id', $this->file_id);
             $q->addReplace('word', $key);
             $q->addReplace('word_placement', $val);
             $q->exec();
             $q->clear();
         }
     }
     return $nwords_indexed;
 }
开发者ID:joly,项目名称:web2project,代码行数:70,代码来源:files.class.php

示例5: DBQuery

     if ($upd_task->task_id) {
         //If parent is self task
         //print_r($bulk_task_dependency);die;
         if ($bulk_task_dependency == '0') {
             $upd_task->task_dynamic = 0;
             $upd_task->store();
             $q = new DBQuery();
             $q->setDelete('task_dependencies');
             $q->addWhere('dependencies_task_id=' . $upd_task->task_id);
             $q->exec();
         } elseif (!($bulk_task_dependency == $upd_task->task_id)) {
             $upd_task->task_dynamic = 31;
             $upd_task->store();
             $q = new DBQuery();
             $q->addTable('task_dependencies');
             $q->addReplace('dependencies_task_id', $upd_task->task_id);
             $q->addReplace('dependencies_req_task_id', $bulk_task_dependency);
             $q->exec();
             //Lets recalc the dependency
             $dep_task = new CTask();
             $dep_task->load($bulk_task_dependency);
             if ($dep_task->task_id) {
                 $dep_task->shiftDependentTasks();
             }
         }
     }
 }
 //Action: Modify priority
 if (isset($_POST['bulk_task_priority']) && $bulk_task_priority != '') {
     if ($upd_task->task_id) {
         $upd_task->task_priority = $bulk_task_priority;
开发者ID:hoodoogurus,项目名称:dotprojecteap,代码行数:31,代码来源:do_task_bulk_aed.php

示例6: indexStrings

 function indexStrings()
 {
     global $AppUI, $dPconfig;
     // get the parser application
     $parser = @$dPconfig['parser_' . $this->file_type];
     if (!$parser) {
         $parser = $dPconfig['parser_default'];
     }
     if (!$parser) {
         return false;
     }
     // buffer the file
     $this->_filepath = DP_BASE_DIR . '/files/' . $this->file_project . '/' . $this->file_real_filename;
     $fp = fopen($this->_filepath, "rb");
     $x = fread($fp, $this->file_size);
     fclose($fp);
     // parse it
     $parser = $parser . " " . $this->_filepath;
     $pos = strpos($parser, '/pdf');
     if (false !== $pos) {
         $x = `{$parser} -`;
     } else {
         $x = `{$parser}`;
     }
     // if nothing, return
     if (strlen($x) < 1) {
         return 0;
     }
     // remove punctuation and parse the strings
     $x = str_replace(array(".", ",", "!", "@", "(", ")"), " ", $x);
     $warr = split("[[:space:]]", $x);
     $wordarr = array();
     $nwords = count($warr);
     for ($x = 0; $x < $nwords; $x++) {
         $newword = $warr[$x];
         if (!ereg("[[:punct:]]", $newword) && strlen(trim($newword)) > 2 && !ereg("[[:digit:]]", $newword)) {
             $wordarr[] = array("word" => $newword, "wordplace" => $x);
         }
     }
     db_exec("LOCK TABLES files_index WRITE");
     // filter out common strings
     $ignore = array();
     include DP_BASE_DIR . '/modules/files/file_index_ignore.php';
     foreach ($ignore as $w) {
         unset($wordarr[$w]);
     }
     // insert the strings into the table
     while (list($key, $val) = each($wordarr)) {
         $q = new DBQuery();
         $q->addTable('files_index');
         $q->addReplace("file_id", $this->file_id);
         $q->addReplace("word", $wordarr[$key]['word']);
         $q->addReplace("word_placement", $wordarr[$key]['wordplace']);
         $q->exec();
         $q->clear();
     }
     db_exec("UNLOCK TABLES;");
     return nwords;
 }
开发者ID:magsilva,项目名称:dotproject,代码行数:59,代码来源:files.class.php

示例7: indexStrings

 function indexStrings()
 {
     global $AppUI, $dPconfig;
     // get the parser application
     $parser = @$dPconfig['parser_' . $this->file_type];
     if (!$parser) {
         $parser = $dPconfig['parser_default'];
     }
     if (!$parser) {
         return false;
     }
     // buffer the file
     $filepath = DP_BASE_DIR . '/files/' . $this->file_project . '/' . $this->file_real_filename;
     $fp = fopen($filepath, 'rb');
     $x = fread($fp, $this->file_size);
     fclose($fp);
     // parse it
     $parser = $parser . ' ' . $filepath;
     $pos = mb_strpos($parser, '/pdf');
     $x = $pos !== false ? `{$parser} -` : `{$parser}`;
     // if nothing, return
     if (mb_strlen($x) < 1) {
         return 0;
     }
     // remove punctuation and parse the strings
     $x = str_replace(array('.', ',', '!', '@', '(', ')'), ' ', $x);
     $warr = mb_split('[[:space:]]', $x);
     $wordarr = array();
     $nwords = count($warr);
     for ($x = 0; $x < $nwords; $x++) {
         $newword = $warr[$x];
         if (!ereg('[[:punct:]]', $newword) && !ereg('[[:digit:]]', $newword) && mb_strlen(trim($newword)) > 2) {
             $wordarr[] = array('word' => $newword, 'wordplace' => $x);
         }
     }
     db_exec('LOCK TABLES files_index WRITE');
     // filter out common strings
     $ignore = array();
     include_once DP_BASE_DIR . '/modules/files/file_index_ignore.php';
     foreach ($ignore as $w) {
         unset($wordarr[$w]);
     }
     // insert the strings into the table
     while (list($key, $val) = each($wordarr)) {
         $q = new DBQuery();
         $q->addTable('files_index');
         $q->addReplace('file_id', $this->file_id);
         $q->addReplace('word', $wordarr[$key]['word']);
         $q->addReplace('word_placement', $wordarr[$key]['wordplace']);
         $q->exec();
         $q->clear();
     }
     db_exec('UNLOCK TABLES;');
     return nwords;
 }
开发者ID:illuminate3,项目名称:dotproject,代码行数:55,代码来源:files.class.php


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