Lines Matching refs:this

83 		$this->ID = $ID;
84 $this->project_path = DOKU_DATA . implode('/', explode(":", $ID)) . '/';
85 $this->project_file = $this->project_path .
86 noNS($this->ID) . '.project';
87 $this->mutex = new Mutex($this->project_file);
88 $this->version_string = PROJECTS_VERSION;
89 $this->create();
96 $this->save_project(false);
101 if (isset($this->version_string))
102 return $this->version_string;
111 $parent = $this->parent(true);
113 @mkdir($this->project_path, PROJECTS_PERMISSIONS, true);
115 $this->modified = true;
116 $this->save_project();
119 public function path() { return $this->project_path; }
120 public function project_file() { return $this->project_file; }
121 public function name() { return $this->ID; }
125 if ($this->file($name) == NULL) return NULL;
126 return $this->ID . ":$name";
130 $parent = getNS($this->ID);
132 return self::project(getNS($this->ID), $create);
140 if (!$this->modified) return;
141 $this->modified = false;
142 file_put_contents($this->project_file, serialize($this));
150 delete_dir($this->project_path);
154 return $this->files;
158 if (!isset($this->files[$name])) return NULL;
159 return $this->files[$name];
163 return $this->errors;
167 if (isset($this->errors[$name])) return $this->errors[$name];
171 public function changed() { return $this->changed; }
175 if (!$this->remove_file_without_remake($name)) return false;
176 return $this->remake();
180 if (!$this->mutex->acquire()) return false;
181 if (isset($this->files[$name])) {
182 $this->files[$name]->delete($this->project_path);
183 unset($this->files[$name]);
185 if (isset($this->errors[$name])) unset($this->errors[$name]);
187 $key = array_search($name, $this->changed);
188 if ($key !== false) unset($this->changed[$key]);
189 $this->modified = true;
190 $this->save_project();
191 $this->mutex->release();
196 $file = $this->handle($file);
198 if (!$this->mutex->acquire()) return false;
202 if (!isset($this->files[$name]))
203 $this->files[$name] = ProjectFile::create($this, $file);
205 $old = $this->files[$name];
208 $this->mutex->release();
209 if (!$this->remove_file_without_remake($name, false)) return false;
210 return $this->update_file($file);
213 if ($old->equal($this->project_path, $file)) {
214 $this->mutex->release();
218 $old->copy($this->project_path, $file);
221 $this->modified = true;
222 $this->save_project();
223 $this->mutex->release();
224 $this->remake(array($name));
232 $handlers = $plugins->handlers($this, $file);
236 return $handler->handle($this, $file);
240 $files = array_merge($files, $this->files_need_update());
242 if (!$this->mutex->acquire()) return false;
243 $maker = new Maker($this);
244 foreach ($this->files as $name => $file)
248 $this->errors = $maker->errors();
250 foreach ($this->errors as $name => $error) {
251 $file = $this->files[$name];
253 if ($file->is_target()) $file->delete($this->path());
256 $path = $this->project_path . $name;
261 if (!isset($this->errors[$name])) {
262 if (!isset($this->files[$name])) continue;
263 $file = $this->files[$name];
265 $file->set_last_made_time($this->path());
267 $this->modified = true;
269 $this->save_project();
270 $this->mutex->release();
275 if (!$this->mutex->acquire()) return false;
276 if (($dh = opendir($this->project_path)) === false) {
277 $this->mutex->release();
282 $path = $this->project_path . $file;
284 $sub_project = self::project($this->name . ":" . $file);
288 $this->mutex->release();
293 $file = $this->file($file);
295 if ($path != $this->project_file . '.project.lock')
300 foreach ($this->files as $file)
301 if ($file->is_target()) $this->changed[] = $file->name();
302 $this->modified = true;
303 $this->save_project();
304 $this->mutex->release();
309 if (!$this->mutex->acquire()) return false;
310 @unlink($this->project_file);
311 $this->files = array();
312 $this->errors = array();
313 $this->modified = true;
314 $this->save_project(false);
315 $this->mutex->release();
316 $this->clean();
320 explode(':', $this->ID)) . '/';
327 $this->sync($file_id);
334 $this->mutex->release();
342 explode(':', $this->ID)) . '/';
344 $ID = $this->ID . ":" . $id;
359 foreach ($this->files as $name => $file)
360 if ($file->is_target() && $file->needs_update($this->path()))
367 if (($dh = opendir($this->project_path)) === false) return array();
370 $path = $this->project_path . $file;
371 if (!is_dir($path) || self::project($this->ID . ":$file", false) == NULL)