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


PHP UpgradeHistory::retrieve方法代码示例

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


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

示例1: checkForExisting

 /**
  * Given a name check if it exists in the table
  * @param name    the unique key from the manifest
  * @param id      the id of the item you are comparing to
  * @return upgrade_history object if found, null otherwise
  */
 function checkForExisting($patch_to_check)
 {
     $uh = new UpgradeHistory();
     if ($patch_to_check != null) {
         if (empty($patch_to_check->id_name)) {
             $where = " WHERE name = '{$patch_to_check->name}' ";
         } else {
             $where = " WHERE id_name = '{$patch_to_check->id_name}' ";
         }
         if (!empty($patch_to_check->id)) {
             $where .= "  AND id != '{$patch_to_check->id}'  ";
         } else {
             $where .= "  AND id is not null  ";
         }
         $query = "SELECT id FROM " . $this->table_name . " " . $where;
         $result = $uh->db->query($query);
         if (empty($result)) {
             return null;
         }
         $row = $uh->db->fetchByAssoc($result);
         if (empty($row)) {
             return null;
         }
         if (!empty($row['id'])) {
             return $uh->retrieve($row['id']);
         }
     }
     return null;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:35,代码来源:UpgradeHistory.php

示例2: UpgradeHistory

        break;
    default:
        break;
}
switch ($mode) {
    case "Install":
        $file_action = "copied";
        // if error was encountered, script should have died before now
        $new_upgrade = new UpgradeHistory();
        //determine if this module has already been installed given the unique_key to
        //identify the module
        // $new_upgrade->checkForExisting($unique_key);
        if (!empty($previous_id)) {
            $new_upgrade->id = $previous_id;
            $uh = new UpgradeHistory();
            $uh->retrieve($previous_id);
            unlink($uh->filename);
        }
        $new_upgrade->filename = $install_file;
        $new_upgrade->md5sum = md5_file($install_file);
        $new_upgrade->type = $install_type;
        $new_upgrade->version = $version;
        $new_upgrade->status = "installed";
        $new_upgrade->name = $name;
        $new_upgrade->description = $description;
        $new_upgrade->id_name = $id_name;
        $new_upgrade->manifest = $s_manifest;
        $new_upgrade->save();
        break;
    case "Uninstall":
        $file_action = "removed";
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:UpgradeWizard_commit.php


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