Exemplo n.º 1
0
 public static function save_time($lca, $version, $type, $protect = false)
 {
     if (!is_bool($protect)) {
         if (!empty($protect)) {
             if (($ts_version = SucomUtil::get_option_key(NGFB_TS_NAME, $lca . '_' . $type . '_version')) !== false && version_compare($ts_version, $protect, '==')) {
                 $protect = true;
             } else {
                 $protect = false;
             }
         } else {
             $protect = true;
         }
         // just in case
     }
     if (!empty($version)) {
         SucomUtil::update_option_key(NGFB_TS_NAME, $lca . '_' . $type . '_version', $version, $protect);
     }
     SucomUtil::update_option_key(NGFB_TS_NAME, $lca . '_' . $type . '_time', time(), $protect);
 }