當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Dataface_Table::getTableModificationTimes方法代碼示例

本文整理匯總了PHP中Dataface_Table::getTableModificationTimes方法的典型用法代碼示例。如果您正苦於以下問題:PHP Dataface_Table::getTableModificationTimes方法的具體用法?PHP Dataface_Table::getTableModificationTimes怎麽用?PHP Dataface_Table::getTableModificationTimes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Dataface_Table的用法示例。


在下文中一共展示了Dataface_Table::getTableModificationTimes方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: handle

 function handle(&$params)
 {
     session_write_close();
     set_time_limit(0);
     import('Dataface/Index.php');
     $index = new Dataface_Index();
     if (@$_POST['--build-index']) {
         if (is_array($_POST['--tables'])) {
             $tables = $_POST['--tables'];
         } else {
             if (!empty($_POST['--tables'])) {
                 $tables = array($_POST['--tables']);
             } else {
                 $tables = null;
             }
         }
         if (@$_POST['--clear']) {
             $clear = true;
         } else {
             $clear = false;
         }
         $index->buildIndex($tables, '*', $clear);
         $app =& Dataface_Application::getInstance();
         header('Location: ' . $app->url('') . '&--msg=' . urlencode('Successfully indexed database'));
         exit;
     }
     $tables = array_keys(Dataface_Table::getTableModificationTimes());
     $count = 0;
     $indexable = array();
     foreach ($tables as $key => $table) {
         if (preg_match('/^dataface__/', $table)) {
             continue;
         }
         if (preg_match('/^_/', $table)) {
             continue;
         }
         if ($index->isTableIndexable($table)) {
             $indexable[] = $table;
             //unset($tables[$key]);
         }
     }
     $tables = $indexable;
     df_display(array('tables' => $tables), 'manage_build_index.html');
 }
開發者ID:promoso,項目名稱:HVAC,代碼行數:44,代碼來源:manage_build_index.php

示例2: update

 /**
  * Checks to see if any of the dependent tables have been modified since this table
  * was last modified.  If so, it will drop the table and regenerate it.
  */
 public function update()
 {
     $mod_times = \Dataface_Table::getTableModificationTimes();
     if (!isset($mod_times[$this->tableName])) {
         $me = 0;
     } else {
         $me = $mod_times[$this->tableName];
     }
     $outOfDate = false;
     foreach ($this->dependencies as $dep) {
         if (@$mod_times[$dep] > $me) {
             $outOfDate = true;
             break;
         }
     }
     if ($outOfDate) {
         \df_q("DROP TABLE IF EXISTS `" . str_replace('`', '', $this->tableName) . "`");
         \df_q($this->sql);
         import('Dataface/IO.php');
         \Dataface_IO::touchTable($this->tableName);
     }
 }
開發者ID:minger11,項目名稱:Pipeline,代碼行數:26,代碼來源:DynamicTable.php

示例3: memcache_get

 function memcache_get($sql, $lang = null)
 {
     $app =& Dataface_Application::getInstance();
     $memcache =& $app->memcache;
     if (!@$app->_conf['cache_queries']) {
         return null;
     }
     $key = $this->memcache_get_key($sql, $lang);
     $tables = $this->getTableDependencies($sql, $lang);
     if (PEAR::isError($tables)) {
         return null;
     }
     // This is a list of the tables that would cause the cache to be invalidated.
     $modification_times = Dataface_Table::getTableModificationTimes();
     $mtime = 0;
     foreach ($tables as $table) {
         if (isset($modification_times[$table])) {
             $mtime = max($mtime, $modification_times[$table]);
         } else {
             $t =& Dataface_Table::loadTable($table);
             if (@$t->_atts['__source_tables__']) {
                 $ts = explode(',', $t->_atts['__source_tables__']);
                 foreach ($ts as $tst) {
                     if (isset($modification_times[trim($tst)])) {
                         $mtime = max($mtime, $modification_times[trim($tst)]);
                     } else {
                         $mtime = time();
                         break;
                     }
                 }
             } else {
                 //echo "$table no modified date";
                 $mtime = time();
                 break;
             }
             unset($t);
         }
     }
     // Now we will get the cached value if it is newer than $mtime
     $cache_mtime = 0;
     if ($memcache) {
         $cache_mtime = $this->memcache_mtime($key);
     } else {
         $cache_mtime = $this->fcache_mtime($key);
     }
     //echo "Cache time for ".$this->fcache_path($key)." is $cache_mtime";
     //echo "[$sql : $cache_mtime : $mtime]";
     if ($cache_mtime > $mtime) {
         if ($memcache) {
             if ($result = $memcache->get($key)) {
                 return unserialize($result);
             }
         } else {
             if (($result = $this->fcache_get($key)) !== null) {
                 return unserialize($result);
             }
         }
     }
     return null;
 }
開發者ID:Zunair,項目名稱:xataface,代碼行數:60,代碼來源:DB.php

示例4:

 /**
  * Returns an associative array of table names and their associated 
  * update times as unix timestamps.
  * eg: [Tablename] -> [Unix Timestamp]
  */
 function &getTableModificationTimes()
 {
     $mod_times =& Dataface_Table::getTableModificationTimes();
     $this->tableModificationTimes =& $mod_times;
     return $mod_times;
 }
開發者ID:promoso,項目名稱:HVAC,代碼行數:11,代碼來源:OutputCache.php


注:本文中的Dataface_Table::getTableModificationTimes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。