| 88 | | if ($this->isReference()) { |
|---|
| 89 | | throw $this->noChildrenAllowed(); |
|---|
| 90 | | } |
|---|
| 91 | | return $this->addPatternToList($this->excludeList); |
|---|
| 92 | | } |
|---|
| 93 | | |
|---|
| 94 | | /** |
|---|
| 95 | | * add a name entry on the exclude files list |
|---|
| 96 | | * |
|---|
| 97 | | * @returns PatternSetNameEntry Reference to object |
|---|
| 98 | | * @throws BuildException |
|---|
| 99 | | */ |
|---|
| 100 | | |
|---|
| | 88 | if ($this->isReference()) { |
|---|
| | 89 | throw $this->noChildrenAllowed(); |
|---|
| | 90 | } |
|---|
| | 91 | return $this->addPatternToList($this->excludeList); |
|---|
| | 92 | } |
|---|
| | 93 | |
|---|
| | 94 | /** |
|---|
| | 95 | * add a name entry on the exclude files list |
|---|
| | 96 | * |
|---|
| | 97 | * @returns PatternSetNameEntry Reference to object |
|---|
| | 98 | * @throws BuildException |
|---|
| | 99 | */ |
|---|
| 119 | | if ($this->isReference()) { |
|---|
| 120 | | throw $this->tooManyAttributes(); |
|---|
| 121 | | } |
|---|
| 122 | | if ($includes !== null && strlen($includes) > 0) { |
|---|
| 123 | | $tok = strtok($includes, ", "); |
|---|
| 124 | | while ($tok !== false) { |
|---|
| 125 | | $o = $this->createInclude(); |
|---|
| 126 | | $o->setName($tok); |
|---|
| 127 | | $tok = strtok(", "); |
|---|
| 128 | | } |
|---|
| 129 | | } |
|---|
| 130 | | } |
|---|
| 131 | | |
|---|
| 132 | | |
|---|
| 133 | | /** |
|---|
| 134 | | * Sets the set of exclude patterns. Patterns may be separated by a comma |
|---|
| 135 | | * or a space. |
|---|
| 136 | | * |
|---|
| 137 | | * @param string the string containing the exclude patterns |
|---|
| 138 | | * @returns void |
|---|
| 139 | | * @throws BuildException |
|---|
| 140 | | */ |
|---|
| 141 | | |
|---|
| | 118 | if ($this->isReference()) { |
|---|
| | 119 | throw $this->tooManyAttributes(); |
|---|
| | 120 | } |
|---|
| | 121 | if ($includes !== null && strlen($includes) > 0) { |
|---|
| | 122 | $tok = strtok($includes, ", "); |
|---|
| | 123 | while ($tok !== false) { |
|---|
| | 124 | $o = $this->createInclude(); |
|---|
| | 125 | $o->setName($tok); |
|---|
| | 126 | $tok = strtok(", "); |
|---|
| | 127 | } |
|---|
| | 128 | } |
|---|
| | 129 | } |
|---|
| | 130 | |
|---|
| | 131 | |
|---|
| | 132 | /** |
|---|
| | 133 | * Sets the set of exclude patterns. Patterns may be separated by a comma |
|---|
| | 134 | * or a space. |
|---|
| | 135 | * |
|---|
| | 136 | * @param string the string containing the exclude patterns |
|---|
| | 137 | * @returns void |
|---|
| | 138 | * @throws BuildException |
|---|
| | 139 | */ |
|---|
| 143 | | if ($this->isReference()) { |
|---|
| 144 | | throw $this->tooManyAttributes(); |
|---|
| 145 | | } |
|---|
| 146 | | if ($excludes !== null && strlen($excludes) > 0) { |
|---|
| 147 | | $tok = strtok($excludes, ", "); |
|---|
| 148 | | while ($tok !== false) { |
|---|
| 149 | | $o = $this->createExclude(); |
|---|
| 150 | | $o->setName($tok); |
|---|
| 151 | | $tok = strtok(", "); |
|---|
| 152 | | } |
|---|
| 153 | | } |
|---|
| | 141 | if ($this->isReference()) { |
|---|
| | 142 | throw $this->tooManyAttributes(); |
|---|
| | 143 | } |
|---|
| | 144 | if ($excludes !== null && strlen($excludes) > 0) { |
|---|
| | 145 | $tok = strtok($excludes, ", "); |
|---|
| | 146 | while ($tok !== false) { |
|---|
| | 147 | $o = $this->createExclude(); |
|---|
| | 148 | $o->setName($tok); |
|---|
| | 149 | $tok = strtok(", "); |
|---|
| | 150 | } |
|---|
| | 151 | } |
|---|
| 173 | | if ($this->isReference()) { |
|---|
| 174 | | throw $this->tooManyAttributes(); |
|---|
| 175 | | } |
|---|
| 176 | | if ($includesFile instanceof File) { |
|---|
| 177 | | $includesFile = $includesFile->getPath(); |
|---|
| 178 | | } |
|---|
| 179 | | $o = $this->createIncludesFile(); |
|---|
| 180 | | $o->setName($includesFile); |
|---|
| | 171 | if ($this->isReference()) { |
|---|
| | 172 | throw $this->tooManyAttributes(); |
|---|
| | 173 | } |
|---|
| | 174 | if ($includesFile instanceof File) { |
|---|
| | 175 | $includesFile = $includesFile->getPath(); |
|---|
| | 176 | } |
|---|
| | 177 | $o = $this->createIncludesFile(); |
|---|
| | 178 | $o->setName($includesFile); |
|---|
| 189 | | if ($this->isReference()) { |
|---|
| 190 | | throw $this->tooManyAttributes(); |
|---|
| 191 | | } |
|---|
| 192 | | if ($excludesFile instanceof File) { |
|---|
| 193 | | $excludesFile = $excludesFile->getPath(); |
|---|
| 194 | | } |
|---|
| 195 | | $o = $this->createExcludesFile(); |
|---|
| 196 | | $o->setName($excludesFile); |
|---|
| | 187 | if ($this->isReference()) { |
|---|
| | 188 | throw $this->tooManyAttributes(); |
|---|
| | 189 | } |
|---|
| | 190 | if ($excludesFile instanceof File) { |
|---|
| | 191 | $excludesFile = $excludesFile->getPath(); |
|---|
| | 192 | } |
|---|
| | 193 | $o = $this->createExcludesFile(); |
|---|
| | 194 | $o->setName($excludesFile); |
|---|
| 205 | | $patternReader = null; |
|---|
| 206 | | try { |
|---|
| 207 | | // Get a FileReader |
|---|
| 208 | | $patternReader = new BufferedReader(new FileReader($patternfile)); |
|---|
| 209 | | |
|---|
| 210 | | // Create one NameEntry in the appropriate pattern list for each |
|---|
| 211 | | // line in the file. |
|---|
| 212 | | $line = $patternReader->readLine(); |
|---|
| 213 | | while ($line !== null) { |
|---|
| 214 | | if (!empty($line)) { |
|---|
| 215 | | $line = $p->replaceProperties($line); |
|---|
| 216 | | $this->addPatternToList($patternlist)->setName($line); |
|---|
| 217 | | } |
|---|
| 218 | | $line = $patternReader->readLine(); |
|---|
| 219 | | } |
|---|
| 220 | | |
|---|
| 221 | | } catch (IOException $ioe) { |
|---|
| 222 | | $msg = "An error occured while reading from pattern file: " . $patternfile->__toString(); |
|---|
| 223 | | if($patternReader) $patternReader->close(); |
|---|
| 224 | | throw new BuildException($msg, $ioe); |
|---|
| 225 | | } |
|---|
| 226 | | |
|---|
| 227 | | $patternReader->close(); |
|---|
| | 203 | $patternReader = null; |
|---|
| | 204 | try { |
|---|
| | 205 | // Get a FileReader |
|---|
| | 206 | $patternReader = new BufferedReader(new FileReader($patternfile)); |
|---|
| | 207 | |
|---|
| | 208 | // Create one NameEntry in the appropriate pattern list for each |
|---|
| | 209 | // line in the file. |
|---|
| | 210 | $line = $patternReader->readLine(); |
|---|
| | 211 | while ($line !== null) { |
|---|
| | 212 | if (!empty($line)) { |
|---|
| | 213 | $line = $p->replaceProperties($line); |
|---|
| | 214 | $this->addPatternToList($patternlist)->setName($line); |
|---|
| | 215 | } |
|---|
| | 216 | $line = $patternReader->readLine(); |
|---|
| | 217 | } |
|---|
| | 218 | |
|---|
| | 219 | } catch (IOException $ioe) { |
|---|
| | 220 | $msg = "An error occured while reading from pattern file: " . $patternfile->__toString(); |
|---|
| | 221 | if($patternReader) $patternReader->close(); |
|---|
| | 222 | throw new BuildException($msg, $ioe); |
|---|
| | 223 | } |
|---|
| | 224 | |
|---|
| | 225 | $patternReader->close(); |
|---|
| 233 | | if ($this->isReference()) { |
|---|
| 234 | | throw new BuildException("Cannot append to a reference"); |
|---|
| 235 | | } |
|---|
| 236 | | |
|---|
| 237 | | $incl = $other->getIncludePatterns($p); |
|---|
| 238 | | if ($incl !== null) { |
|---|
| 239 | | foreach($incl as $incl_name) { |
|---|
| 240 | | $o = $this->createInclude(); |
|---|
| 241 | | $o->setName($incl_name); |
|---|
| 242 | | } |
|---|
| 243 | | } |
|---|
| 244 | | |
|---|
| 245 | | $excl = $other->getExcludePatterns($p); |
|---|
| 246 | | if ($excl !== null) { |
|---|
| 247 | | foreach($excl as $excl_name) { |
|---|
| 248 | | $o = $this->createExclude(); |
|---|
| 249 | | $o->setName($excl_name); |
|---|
| 250 | | } |
|---|
| 251 | | } |
|---|
| | 231 | if ($this->isReference()) { |
|---|
| | 232 | throw new BuildException("Cannot append to a reference"); |
|---|
| | 233 | } |
|---|
| | 234 | |
|---|
| | 235 | $incl = $other->getIncludePatterns($p); |
|---|
| | 236 | if ($incl !== null) { |
|---|
| | 237 | foreach($incl as $incl_name) { |
|---|
| | 238 | $o = $this->createInclude(); |
|---|
| | 239 | $o->setName($incl_name); |
|---|
| | 240 | } |
|---|
| | 241 | } |
|---|
| | 242 | |
|---|
| | 243 | $excl = $other->getExcludePatterns($p); |
|---|
| | 244 | if ($excl !== null) { |
|---|
| | 245 | foreach($excl as $excl_name) { |
|---|
| | 246 | $o = $this->createExclude(); |
|---|
| | 247 | $o->setName($excl_name); |
|---|
| | 248 | } |
|---|
| | 249 | } |
|---|
| 287 | | if (!$this->checked) { |
|---|
| 288 | | $stk = array(); |
|---|
| 289 | | array_push($stk, $this); |
|---|
| 290 | | $this->dieOnCircularReference($stk, $p); |
|---|
| 291 | | } |
|---|
| 292 | | $o = $this->ref->getReferencedObject($p); |
|---|
| 293 | | if (!($o instanceof PatternSet)) { |
|---|
| 294 | | $msg = $this->ref->getRefId()." doesn't denote a patternset"; |
|---|
| 295 | | throw new BuildException($msg); |
|---|
| 296 | | } else { |
|---|
| 297 | | return $o; |
|---|
| 298 | | } |
|---|
| | 285 | if (!$this->checked) { |
|---|
| | 286 | $stk = array(); |
|---|
| | 287 | array_push($stk, $this); |
|---|
| | 288 | $this->dieOnCircularReference($stk, $p); |
|---|
| | 289 | } |
|---|
| | 290 | $o = $this->ref->getReferencedObject($p); |
|---|
| | 291 | if (!($o instanceof PatternSet)) { |
|---|
| | 292 | $msg = $this->ref->getRefId()." doesn't denote a patternset"; |
|---|
| | 293 | throw new BuildException($msg); |
|---|
| | 294 | } else { |
|---|
| | 295 | return $o; |
|---|
| | 296 | } |
|---|
| 320 | | if (!empty($this->includesFileList)) { |
|---|
| 321 | | foreach($this->includesFileList as $ne) { |
|---|
| 322 | | $fileName = (string) $ne->evalName($p); |
|---|
| 323 | | if ($fileName !== null) { |
|---|
| 324 | | $inclFile = $p->resolveFile($fileName); |
|---|
| 325 | | if (!$inclFile->exists()) { |
|---|
| 326 | | throw new BuildException("Includesfile ".$inclFile->getAbsolutePath()." not found."); |
|---|
| 327 | | } |
|---|
| 328 | | $this->readPatterns($inclFile, $this->includeList, $p); |
|---|
| 329 | | } |
|---|
| 330 | | } |
|---|
| 331 | | $this->includesFileList = array(); |
|---|
| 332 | | } |
|---|
| 333 | | |
|---|
| 334 | | if (!empty($this->excludesFileList)) { |
|---|
| 335 | | foreach($this->excludesFileList as $ne) { |
|---|
| 336 | | $fileName = (string) $ne->evalName($p); |
|---|
| 337 | | if ($fileName !== null) { |
|---|
| 338 | | $exclFile = $p->resolveFile($fileName); |
|---|
| 339 | | if (!$exclFile->exists()) { |
|---|
| 340 | | throw new BuildException("Excludesfile ".$exclFile->getAbsolutePath()." not found."); |
|---|
| 341 | | return; |
|---|
| 342 | | } |
|---|
| 343 | | $this->readPatterns($exclFile, $this->excludeList, $p); |
|---|
| 344 | | } |
|---|
| 345 | | } |
|---|
| 346 | | $this->excludesFileList = array(); |
|---|
| 347 | | } |
|---|
| | 318 | if (!empty($this->includesFileList)) { |
|---|
| | 319 | foreach($this->includesFileList as $ne) { |
|---|
| | 320 | $fileName = (string) $ne->evalName($p); |
|---|
| | 321 | if ($fileName !== null) { |
|---|
| | 322 | $inclFile = $p->resolveFile($fileName); |
|---|
| | 323 | if (!$inclFile->exists()) { |
|---|
| | 324 | throw new BuildException("Includesfile ".$inclFile->getAbsolutePath()." not found."); |
|---|
| | 325 | } |
|---|
| | 326 | $this->readPatterns($inclFile, $this->includeList, $p); |
|---|
| | 327 | } |
|---|
| | 328 | } |
|---|
| | 329 | $this->includesFileList = array(); |
|---|
| | 330 | } |
|---|
| | 331 | |
|---|
| | 332 | if (!empty($this->excludesFileList)) { |
|---|
| | 333 | foreach($this->excludesFileList as $ne) { |
|---|
| | 334 | $fileName = (string) $ne->evalName($p); |
|---|
| | 335 | if ($fileName !== null) { |
|---|
| | 336 | $exclFile = $p->resolveFile($fileName); |
|---|
| | 337 | if (!$exclFile->exists()) { |
|---|
| | 338 | throw new BuildException("Excludesfile ".$exclFile->getAbsolutePath()." not found."); |
|---|
| | 339 | return; |
|---|
| | 340 | } |
|---|
| | 341 | $this->readPatterns($exclFile, $this->excludeList, $p); |
|---|
| | 342 | } |
|---|
| | 343 | } |
|---|
| | 344 | $this->excludesFileList = array(); |
|---|
| | 345 | } |
|---|
| 352 | | |
|---|
| 353 | | // We can't compile includeList into array because, toString() does |
|---|
| 354 | | // not know about project: |
|---|
| 355 | | // |
|---|
| 356 | | // $includes = $this->makeArray($this->includeList, $this->project); |
|---|
| 357 | | // $excludes = $this->makeArray($this->excludeList, $this->project); |
|---|
| 358 | | |
|---|
| 359 | | if (empty($this->includeList)) { |
|---|
| 360 | | $includes = "empty"; |
|---|
| 361 | | } else { |
|---|
| 362 | | $includes = ""; |
|---|
| 363 | | foreach($this->includeList as $ne) { |
|---|
| 364 | | $includes .= $ne->toString() . ","; |
|---|
| 365 | | } |
|---|
| 366 | | $includes = rtrim($includes, ","); |
|---|
| 367 | | } |
|---|
| 368 | | |
|---|
| 369 | | if (empty($this->excludeList)) { |
|---|
| 370 | | $excludes = "empty"; |
|---|
| 371 | | } else { |
|---|
| 372 | | $excludes = ""; |
|---|
| 373 | | foreach($this->excludeList as $ne) { |
|---|
| 374 | | $excludes .= $ne->toString() . ","; |
|---|
| 375 | | } |
|---|
| 376 | | $excludes = rtrim($excludes, ","); |
|---|
| 377 | | } |
|---|
| 378 | | |
|---|
| 379 | | return "patternSet{ includes: $includes excludes: $excludes }"; |
|---|
| | 350 | |
|---|
| | 351 | // We can't compile includeList into array because, toString() does |
|---|
| | 352 | // not know about project: |
|---|
| | 353 | // |
|---|
| | 354 | // $includes = $this->makeArray($this->includeList, $this->project); |
|---|
| | 355 | // $excludes = $this->makeArray($this->excludeList, $this->project); |
|---|
| | 356 | |
|---|
| | 357 | if (empty($this->includeList)) { |
|---|
| | 358 | $includes = "empty"; |
|---|
| | 359 | } else { |
|---|
| | 360 | $includes = ""; |
|---|
| | 361 | foreach($this->includeList as $ne) { |
|---|
| | 362 | $includes .= $ne->toString() . ","; |
|---|
| | 363 | } |
|---|
| | 364 | $includes = rtrim($includes, ","); |
|---|
| | 365 | } |
|---|
| | 366 | |
|---|
| | 367 | if (empty($this->excludeList)) { |
|---|
| | 368 | $excludes = "empty"; |
|---|
| | 369 | } else { |
|---|
| | 370 | $excludes = ""; |
|---|
| | 371 | foreach($this->excludeList as $ne) { |
|---|
| | 372 | $excludes .= $ne->toString() . ","; |
|---|
| | 373 | } |
|---|
| | 374 | $excludes = rtrim($excludes, ","); |
|---|
| | 375 | } |
|---|
| | 376 | |
|---|
| | 377 | return "patternSet{ includes: $includes excludes: $excludes }"; |
|---|
| 394 | | private $name = null; |
|---|
| 395 | | private $ifCond = null; |
|---|
| 396 | | private $unlessCond = null; |
|---|
| 397 | | |
|---|
| 398 | | function setName($name) { |
|---|
| 399 | | $this->name = (string) $name; |
|---|
| 400 | | } |
|---|
| 401 | | |
|---|
| 402 | | |
|---|
| 403 | | function setIf($cond) { |
|---|
| 404 | | $this->ifCond = (string) $cond; |
|---|
| 405 | | } |
|---|
| 406 | | |
|---|
| 407 | | |
|---|
| 408 | | function setUnless($cond) { |
|---|
| 409 | | $this->unlessCond = (string) $cond; |
|---|
| 410 | | } |
|---|
| 411 | | |
|---|
| 412 | | |
|---|
| 413 | | function getName() { |
|---|
| 414 | | return $this->name; |
|---|
| 415 | | } |
|---|
| 416 | | |
|---|
| 417 | | |
|---|
| 418 | | function evalName($project) { |
|---|
| 419 | | return $this->valid($project) ? $this->name : null; |
|---|
| 420 | | } |
|---|
| 421 | | |
|---|
| 422 | | |
|---|
| 423 | | function valid($project) { |
|---|
| 424 | | if ($this->ifCond !== null && $project->getProperty($this->ifCond) === null) { |
|---|
| 425 | | return false; |
|---|
| 426 | | } else if ($this->unlessCond !== null && $project->getProperty($this->unlessCond) !== null) { |
|---|
| 427 | | return false; |
|---|
| 428 | | } |
|---|
| 429 | | return true; |
|---|
| 430 | | } |
|---|
| 431 | | |
|---|
| 432 | | |
|---|
| 433 | | function toString() { |
|---|
| 434 | | $buf = $this->name; |
|---|
| 435 | | if (($this->ifCond !== null) || ($this->unlessCond !== null)) { |
|---|
| 436 | | $buf .= ":"; |
|---|
| 437 | | $connector = ""; |
|---|
| 438 | | |
|---|
| 439 | | if ($this->ifCond !== null) { |
|---|
| 440 | | $buf .= "if->{$this->ifCond}"; |
|---|
| 441 | | $connector = ";"; |
|---|
| 442 | | } |
|---|
| 443 | | if ($this->unlessCond !== null) { |
|---|
| 444 | | $buf .= "$connector unless->{$this->unlessCond}"; |
|---|
| 445 | | } |
|---|
| 446 | | } |
|---|
| 447 | | return $buf; |
|---|
| 448 | | } |
|---|
| | 387 | /** |
|---|
| | 388 | * The pattern. |
|---|
| | 389 | * @var string |
|---|
| | 390 | */ |
|---|
| | 391 | private $name; |
|---|
| | 392 | |
|---|
| | 393 | /** |
|---|
| | 394 | * The if-condition property for this pattern to be applied. |
|---|
| | 395 | * @var string |
|---|
| | 396 | */ |
|---|
| | 397 | private $ifCond; |
|---|
| | 398 | |
|---|
| | 399 | /** |
|---|
| | 400 | * The unless-condition property for this pattern to be applied. |
|---|
| | 401 | * @var string |
|---|
| | 402 | */ |
|---|
| | 403 | private $unlessCond; |
|---|
| | 404 | |
|---|
| | 405 | /** |
|---|
| | 406 | * An alias for the setName() method. |
|---|
| | 407 | * @see setName() |
|---|
| | 408 | * @param string $pattern |
|---|
| | 409 | */ |
|---|
| | 410 | public function setPattern($pattern) { |
|---|
| | 411 | $this->setName($pattern); |
|---|
| | 412 | } |
|---|
| | 413 | |
|---|
| | 414 | /** |
|---|
| | 415 | * Set the pattern text. |
|---|
| | 416 | * @param string $name The pattern |
|---|
| | 417 | */ |
|---|
| | 418 | public function setName($name) { |
|---|
| | 419 | $this->name = (string) $name; |
|---|
| | 420 | } |
|---|
| | 421 | |
|---|
| | 422 | /** |
|---|
| | 423 | * Sets an if-condition property for this pattern to match. |
|---|
| | 424 | * @param string $cond |
|---|
| | 425 | */ |
|---|
| | 426 | public function setIf($cond) { |
|---|
| | 427 | $this->ifCond = (string) $cond; |
|---|
| | 428 | } |
|---|
| | 429 | |
|---|
| | 430 | |
|---|
| | 431 | /** |
|---|
| | 432 | * Sets an unless-condition property for this pattern to match. |
|---|
| | 433 | * @param string $cond |
|---|
| | 434 | */ |
|---|
| | 435 | public function setUnless($cond) { |
|---|
| | 436 | $this->unlessCond = (string) $cond; |
|---|
| | 437 | } |
|---|
| | 438 | |
|---|
| | 439 | /** |
|---|
| | 440 | * Get the pattern text. |
|---|
| | 441 | * @return string The pattern. |
|---|
| | 442 | */ |
|---|
| | 443 | public function getName() { |
|---|
| | 444 | return $this->name; |
|---|
| | 445 | } |
|---|
| | 446 | |
|---|
| | 447 | /** |
|---|
| | 448 | * Evaluates the pattern. |
|---|
| | 449 | * @return string The pattern or null if it is ruled out by a condition. |
|---|
| | 450 | */ |
|---|
| | 451 | public function evalName(Project $project) { |
|---|
| | 452 | return $this->valid($project) ? $this->name : null; |
|---|
| | 453 | } |
|---|
| | 454 | |
|---|
| | 455 | |
|---|
| | 456 | /** |
|---|
| | 457 | * Checks whether pattern should be applied based on whether the if and unless |
|---|
| | 458 | * properties are set in project. |
|---|
| | 459 | * @param Project $project |
|---|
| | 460 | * @return boolean |
|---|
| | 461 | */ |
|---|
| | 462 | public function valid(Project $project) { |
|---|
| | 463 | if ($this->ifCond !== null && $project->getProperty($this->ifCond) === null) { |
|---|
| | 464 | return false; |
|---|
| | 465 | } else if ($this->unlessCond !== null && $project->getProperty($this->unlessCond) !== null) { |
|---|
| | 466 | return false; |
|---|
| | 467 | } |
|---|
| | 468 | return true; |
|---|
| | 469 | } |
|---|
| | 470 | |
|---|
| | 471 | /** |
|---|
| | 472 | * Gets a string representation of this pattern. |
|---|
| | 473 | * @return string |
|---|
| | 474 | */ |
|---|
| | 475 | public function toString() { |
|---|
| | 476 | $buf = $this->name; |
|---|
| | 477 | if (($this->ifCond !== null) || ($this->unlessCond !== null)) { |
|---|
| | 478 | $buf .= ":"; |
|---|
| | 479 | $connector = ""; |
|---|
| | 480 | |
|---|
| | 481 | if ($this->ifCond !== null) { |
|---|
| | 482 | $buf .= "if->{$this->ifCond}"; |
|---|
| | 483 | $connector = ";"; |
|---|
| | 484 | } |
|---|
| | 485 | if ($this->unlessCond !== null) { |
|---|
| | 486 | $buf .= "$connector unless->{$this->unlessCond}"; |
|---|
| | 487 | } |
|---|
| | 488 | } |
|---|
| | 489 | return $buf; |
|---|
| | 490 | } |
|---|