-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservice.inc
43 lines (33 loc) · 1.21 KB
/
service.inc
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
40
41
42
43
<?php
class StorageService {
public $service_id;
public $name;
public $class;
public $htaccess;
public $copy;
public $serve;
public $serve_secure;
public function __construct($service_id) {
$this->service_id = $service_id;
$services = storage_service_info();
foreach($services[$this->service_id] as $key => $value) {
$this->$key = $value;
}
}
public function check() {
list($module, $service) = explode(':', $this->service_id);
module_invoke($module, 'storage_service_check_' . $service);
}
public function flushServingContainer() {
$selector_subquery = db_select('storage_container');
$selector_subquery->join('storage_class_container', NULL, 'storage_container.container_id = storage_class_container.container_id');
$selector_subquery->join('storage_selector', NULL, 'storage_class_container.class_id = storage_selector.class_id');
$selector_subquery->fields('storage_selector', array('selector_id'))
->condition('storage_container.service_id', $this->service_id);
db_update('storage')
->expression('serving_container', 'NULL')
->condition('selector_id', $selector_subquery, 'IN')
->execute();
cache_clear_all();
}
}