Révision 41cc1b08
Ajouté par Assos Assos il y a presque 9 ans
drupal7/sites/all/modules/feeds/includes/FeedsImporter.inc | ||
---|---|---|
54 | 54 |
} |
55 | 55 |
} |
56 | 56 |
|
57 |
/** |
|
58 |
* Remove items older than $time. |
|
59 |
* |
|
60 |
* @param $time |
|
61 |
* All items older than REQUEST_TIME - $time will be deleted. If not |
|
62 |
* given, internal processor settings will be used. |
|
63 |
* |
|
64 |
* @return |
|
65 |
* FEEDS_BATCH_COMPLETE if the expiry process finished. A decimal between |
|
66 |
* 0.0 and 0.9 periodic if expiry is still in progress. |
|
67 |
* |
|
68 |
* @throws |
|
69 |
* Throws Exception if an error occurs when expiring items. |
|
70 |
*/ |
|
71 |
public function expire($time = NULL) { |
|
72 |
return $this->processor->expire($time); |
|
73 |
} |
|
74 |
|
|
75 |
/** |
|
76 |
* Schedule all periodic tasks for this importer. |
|
77 |
*/ |
|
78 |
public function schedule() { |
|
79 |
$this->scheduleExpire(); |
|
80 |
} |
|
81 |
|
|
82 |
/** |
|
83 |
* Schedule expiry of items. |
|
84 |
*/ |
|
85 |
public function scheduleExpire() { |
|
86 |
$job = array( |
|
87 |
'type' => $this->id, |
|
88 |
'period' => 0, |
|
89 |
'periodic' => TRUE, |
|
90 |
); |
|
91 |
if (FEEDS_EXPIRE_NEVER != $this->processor->expiryTime()) { |
|
92 |
$job['period'] = 3600; |
|
93 |
JobScheduler::get('feeds_importer_expire')->set($job); |
|
94 |
} |
|
95 |
else { |
|
96 |
JobScheduler::get('feeds_importer_expire')->remove($job); |
|
97 |
} |
|
98 |
} |
|
99 |
|
|
100 | 57 |
/** |
101 | 58 |
* Report how many items *should* be created on one page load by this |
102 | 59 |
* importer. |
... | ... | |
155 | 112 |
} |
156 | 113 |
|
157 | 114 |
/** |
158 |
* Delete configuration. Removes configuration information |
|
159 |
* from database, does not delete configuration itself. |
|
115 |
* Deletes configuration. |
|
116 |
* |
|
117 |
* Removes configuration information from database, does not delete |
|
118 |
* configuration itself. |
|
160 | 119 |
*/ |
161 | 120 |
public function delete() { |
162 | 121 |
db_delete('feeds_importer') |
163 | 122 |
->condition('id', $this->id) |
164 | 123 |
->execute(); |
165 |
$job = array( |
|
166 |
'type' => $this->id, |
|
167 |
'id' => 0, |
|
168 |
); |
|
169 |
if ($this->export_type & EXPORT_IN_CODE) { |
|
170 |
feeds_reschedule($this->id); |
|
171 |
} |
|
172 |
else { |
|
173 |
JobScheduler::get('feeds_importer_expire')->remove($job); |
|
174 |
} |
|
124 |
|
|
125 |
feeds_reschedule($this->id); |
|
175 | 126 |
} |
176 | 127 |
|
177 | 128 |
/** |
... | ... | |
320 | 271 |
} |
321 | 272 |
parent::configFormSubmit($values); |
322 | 273 |
} |
274 |
|
|
275 |
/** |
|
276 |
* Implements FeedsConfigurable::dependencies(). |
|
277 |
*/ |
|
278 |
public function dependencies() { |
|
279 |
$dependencies = parent::dependencies(); |
|
280 |
foreach ($this->plugin_types as $plugin_type) { |
|
281 |
$dependencies = array_merge($dependencies, $this->$plugin_type->dependencies()); |
|
282 |
} |
|
283 |
return $dependencies; |
|
284 |
} |
|
323 | 285 |
} |
324 | 286 |
|
325 | 287 |
/** |
Formats disponibles : Unified diff
Update feeds 7.x-2.0-alpha9 -> 7.x-2.0-beta1
Install lib simplepie 1.3.1