Lines Matching defs:wiki_id
163 $wiki_id = array_shift($args);
165 $this->commandCheckout($wiki_id, $localfile);
169 $wiki_id = array_shift($args);
172 $wiki_id,
178 $wiki_id = array_shift($args);
179 $this->obtainLock($wiki_id);
180 $this->success("$wiki_id locked");
183 $wiki_id = array_shift($args);
184 $this->clearLock($wiki_id);
185 $this->success("$wiki_id unlocked");
188 $wiki_id = array_shift($args);
190 $meta = p_get_metadata($wiki_id, $key, METADATA_RENDER_UNLIMITED);
202 * @param string $wiki_id
205 protected function commandCheckout($wiki_id, $localfile)
209 $wiki_id = cleanID($wiki_id);
210 $wiki_fn = wikiFN($wiki_id);
213 $this->fatal("$wiki_id does not yet exist");
228 $this->obtainLock($wiki_id);
231 $this->clearLock($wiki_id);
235 $this->success("$wiki_id > $localfile");
242 * @param string $wiki_id
246 protected function commandCommit($localfile, $wiki_id, $message, $minor)
248 $wiki_id = cleanID($wiki_id);
263 $this->obtainLock($wiki_id);
265 saveWikiText($wiki_id, file_get_contents($localfile), $message, $minor);
267 $this->clearLock($wiki_id);
269 $this->success("$localfile > $wiki_id");
275 * @param string $wiki_id
277 protected function obtainLock($wiki_id)
279 if ($this->force) $this->deleteLock($wiki_id);
283 if (checklock($wiki_id)) {
284 $this->error("Page $wiki_id is already locked by another user");
288 lock($wiki_id);
290 if (checklock($wiki_id)) {
291 $this->error("Unable to obtain lock for $wiki_id ");
292 var_dump(checklock($wiki_id));
300 * @param string $wiki_id
302 protected function clearLock($wiki_id)
304 if ($this->force) $this->deleteLock($wiki_id);
307 if (checklock($wiki_id)) {
308 $this->error("Page $wiki_id is locked by another user");
312 unlock($wiki_id);
314 if (file_exists(wikiLockFN($wiki_id))) {
315 $this->error("Unable to clear lock for $wiki_id");
323 * @param string $wiki_id
325 protected function deleteLock($wiki_id)
327 $wikiLockFN = wikiLockFN($wiki_id);