本文整理汇总了PHP中PhingFile::createNewFile方法的典型用法代码示例。如果您正苦于以下问题:PHP PhingFile::createNewFile方法的具体用法?PHP PhingFile::createNewFile怎么用?PHP PhingFile::createNewFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhingFile
的用法示例。
在下文中一共展示了PhingFile::createNewFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _touch
/**
* Does the actual work.
*/
public function _touch()
{
if ($this->file !== null) {
if (!$this->file->exists()) {
$this->log("Creating " . $this->file->__toString(), $this->verbose ? Project::MSG_INFO : Project::MSG_VERBOSE);
try {
// try to create file
$this->file->createNewFile($this->mkdirs);
} catch (IOException $ioe) {
throw new BuildException("Error creating new file " . $this->file->__toString(), $ioe, $this->location);
}
}
}
$resetMillis = false;
if ($this->millis < 0) {
$resetMillis = true;
$this->millis = Phing::currentTimeMillis();
}
if ($this->file !== null) {
$this->touchFile($this->file);
}
// deal with the filesets
foreach ($this->filesets as $fs) {
$ds = $fs->getDirectoryScanner($this->getProject());
$fromDir = $fs->getDir($this->getProject());
$srcFiles = $ds->getIncludedFiles();
$srcDirs = $ds->getIncludedDirectories();
for ($j = 0, $_j = count($srcFiles); $j < $_j; $j++) {
$this->touchFile(new PhingFile($fromDir, (string) $srcFiles[$j]));
}
for ($j = 0, $_j = count($srcDirs); $j < $_j; $j++) {
$this->touchFile(new PhingFile($fromDir, (string) $srcDirs[$j]));
}
}
if ($resetMillis) {
$this->millis = -1;
}
}