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


PHP w2p_Database_Query::addReplace方法代码示例

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


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

示例1: store

 public function store(CAppUI $AppUI = null)
 {
     global $AppUI;
     $q = new w2p_Database_Query();
     $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();
     return true;
 }
开发者ID:eureka2,项目名称:web2project,代码行数:16,代码来源:projectdesigner.class.php

示例2: updateUserSpecificTaskPriority

 public function updateUserSpecificTaskPriority($user_task_priority = 0, $user_id = 0, $task_id = null)
 {
     $q = new w2p_Database_Query();
     // 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:eureka2,项目名称:web2project,代码行数:12,代码来源:tasks.class.php

示例3: elseif

     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($AppUI);
             $q = new w2p_Database_Query();
             $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($AppUI);
             $q = new w2p_Database_Query();
             $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:eureka2,项目名称:web2project,代码行数:31,代码来源:do_task_bulk_aed.php

示例4: indexStrings

 public function indexStrings()
 {
     global $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 ($this->file_size > 0 && ($index_max_file_size < 0 || (int) $this->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;
         if (file_exists($this->_filepath)) {
             $fp = fopen($this->_filepath, 'rb');
             $x = fread($fp, $this->file_size);
             fclose($fp);
             // parse it
             $parser = $parser . ' ' . $this->_filepath;
             $pos = strpos($parser, '/pdf');
             /*
              * TODO: I *really* hate using error surpression here and I would
              *   normally just detect if safe_mode is on and if it was, skip
              *   this call. Unfortunately, safe_mode has been deprecated in
              *   5.3 and will be removed in 5.4
              */
             if (false !== $pos) {
                 $x = @shell_exec(`{$parser} -`);
             } else {
                 $x = @shell_exec(`{$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('[!"#$%&\'()*+,\\-./:;<=>?@[\\\\]^_`{|}~]', $newword) && mb_strlen(mb_trim($newword)) > 2 && !preg_match('[0-9]', $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 w2p_Database_Query();
                 $q->addTable('files_index');
                 $q->addReplace('file_id', $this->file_id);
                 $q->addReplace('word', $key);
                 $q->addReplace('word_placement', $val);
                 $q->exec();
                 $q->clear();
             }
         } else {
             //TODO: if the file doesn't exist.. should we delete the db record?
         }
     }
     $q = new w2p_Database_Query();
     $q->addTable('files');
     $q->addUpdate('file_indexed', 1);
     $q->addWhere('file_id = ' . $this->file_id);
     $q->exec();
     return $nwords_indexed;
 }
开发者ID:,项目名称:,代码行数:85,代码来源:


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