Lines Matching refs:this

18 	public function name() { return $this->name; }
19 public function affect() { return $this->affect; }
20 public function is_target() { return $this->is_target; }
23 if (!in_array($node->name(), array_keys($this->links)))
24 $this->links[$node->name()] = $node;
28 $this->name = $name;
29 $this->is_target = $is_target;
35 if ($this->loops != NULL || $this->affect != NULL) return;
37 if (in_array($this->name, $path)) {
38 $loop = array($this->name);
44 add_error($errors, $this->name, array('loop' => $loop));
49 $path[] = $this->name;
50 foreach ($this->links as $link) {
57 $this->affect = array_keys(array_flip($affect));
58 else $this->affect = array();
62 if (!$this->valid) return;
63 $this->valid = false;
64 foreach ($this->links as $link) {
66 array('dependency' => $this->name));
72 $this->unconditional = true;
73 if ($this->is_target) return;
74 foreach ($this->links as $link) $link->mark_unconditional();
78 if ($this->ref == 0)
79 foreach ($this->links as $link) $link->ref();
80 $this->ref++;
84 foreach ($this->links as $link) {
105 $this->project = $project;
106 $this->plugins = new Plugins(PROJECTS_PLUGINS_TARGET_DIR);
107 $this->construct($project->files());
108 $this->parallel = function_exists('pcntl_fork');
111 public function errors() { return $this->errors; }
114 $handlers = $this->plugins->handlers($this->project, $file);
118 $default = $handler->handle($this->project, $file);
125 $this->nodes = array();
126 $this->intermediate_files = array();
127 $this->errors = array();
129 $this->files[$name] = &$file;
130 $this->files = $files;
133 foreach ($this->files as $name => $file) {
135 $default = $this->default_rule($file);
138 $this->add_error($name, "undefined");
141 $this->files[$name] = $file;
144 $this->nodes[$name] = new MakeNode($name, $file->is_target());
148 while ((list($name, $node) = each($this->nodes)) != false) {
149 $deps = $this->files[$name]->dependency();
151 if (!isset($this->nodes[$dep])) {
152 $missing = ProjectFile::create($this->project,
155 $default = $this->default_rule($missing);
158 $this->add_error($name, array('dependency' => $dep));
161 $this->intermediate_files[] = $dep;
162 $this->files[$dep] = $default;
164 $this->nodes[$dep] = $dep_node;
166 else $dep_node = $this->nodes[$dep];
170 foreach ($this->nodes as $node) $node->find_affected($this->errors);
172 $errors = array_intersect(array_keys($this->errors),
173 array_keys($this->nodes));
175 $this->nodes[$name]->mark_invalid($this->errors);
176 $invalid = array_keys($this->errors);
180 foreach ($this->nodes as $name => $node)
184 $deps = array_diff($this->files[$name]->dependency(), $invalid);
187 $this->nodes = $nodes;
191 $changes = array_merge($changes, $this->intermediate_files);
196 $node = $this->nodes[$change];
205 foreach ($this->nodes as $name => $node)
212 $this->make($nodes);
214 foreach ($this->errors as $name => $error)
215 if (isset($this->files[$name])) {
216 $file = $this->files[$name];
218 $file->delete($this->project->path());
225 $this->pid = array();
226 $this->running = array();
231 $node = $this->nodes[$name];
240 $file = $this->files[$name];
245 if ($this->nodes[$dep]->ref !== -1 ) {
260 $this->pid[$name] = $this->make_target($file);
261 if (!$this->parallel || count($this->pid) == MAX_PARALLEL_JOBS)
262 $this->wait($nodes);
265 if (count($this->pid) > 0)
266 $this->wait($nodes);
278 if ($this->parallel)
281 $result = current($this->pid);
284 $name = array_search($pid, $this->pid);
285 unset($this->pid[$name]);
286 $time = $this->times[$name];
287 unset($this->times[$name]);
288 $node = $this->nodes[$name];
292 $this->add_error($name, array("failure" => $result));
293 $node->mark_invalid($this->errors);
298 $time == $this->files[$name]->time($this->project->path()))
304 $this->times[$name] = $file->time($this->project->path());
307 if ($this->parallel) {
310 if ($pid == -1) $this->parallel = false;
312 if ($this->parallel && $pid > 0) return;
313 $result = $file->make($this->project->path());
314 if ($this->parallel) exit($result);
319 add_error($this->errors, $name, $error);
325 foreach ($this->nodes as $node)