-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathUpdate.class.php
More file actions
39 lines (35 loc) · 1.41 KB
/
Update.class.php
File metadata and controls
39 lines (35 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
* モジュールアップデートクラス
* backup_uploadsにURLカラム追加(他サイトからのリストアを許可するため)
*
* @package NetCommons.components
* @author Noriko Arai,Ryuji Masukawa
* @copyright 2006-2007 NetCommons Project
* @license http://www.netcommons.org/license.txt NetCommons License
* @project NetCommons Project, supported by National Institute of Informatics
* @access public
*/
class Backup_Update extends Action
{
//使用コンポーネントを受け取るため
var $db = null;
function execute()
{
$adodb = $this->db->getAdoDbObject();
$metaColumns = $adodb->MetaColumns($this->db->getPrefix()."backup_uploads");
if(!isset($metaColumns["URL"])) {
$sql = "ALTER TABLE `".$this->db->getPrefix()."backup_uploads`
ADD `url` TEXT NOT NULL AFTER `site_id` ;";
$result = $this->db->execute($sql);
if($result === false) return false;
}
$backup_uploads = $this->db->selectExecute("backup_uploads", array("url!"=> '',"room_id>0" => null));
if($backup_uploads !== false && count($backup_uploads) > 0) {
$this->db->updateExecute("backup_uploads", array("parent_id" => _OFF), array("url!"=> '',"room_id>0" => null,"thread_num" => 2));
$this->db->updateExecute("backup_uploads", array("room_id" => _OFF), array("url!"=> '',"room_id>0" => null));
}
return true;
}
}
?>