Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 609b4dc50c
Fetching contributors…

Cannot retrieve contributors at this time

39 lines (32 sloc) 0.752 kb
<?php
require_once "phing/Task.php";
class ReplaceTask extends Task
{
protected $file;
protected $token;
protected $value;
public function setFile($file)
{
$this->file = $file;
}
public function setToken($token)
{
$this->token = $token;
}
public function setValue($value)
{
$this->value = $value;
}
public function init()
{
}
public function main()
{
if (!file_exists($this->file)) {
throw new \InvalidArgumentException("not a valid file: " . $this->file);
}
$data = file_get_contents($this->file);
$data = str_replace($this->token, $this->value, $data);
file_put_contents($this->file, $data);
}
}
Jump to Line
Something went wrong with that request. Please try again.