本文整理汇总了PHP中app\File::testReach方法的典型用法代码示例。如果您正苦于以下问题:PHP File::testReach方法的具体用法?PHP File::testReach怎么用?PHP File::testReach使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\File
的用法示例。
在下文中一共展示了File::testReach方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleFile
private function handleFile($root_folder, $f)
{
/*
The "black" identifier is just an abstract reference, not a real file:
we skip analysis for it
*/
if ($f == 'black') {
return true;
}
/*
This is to manage eventual files embedded multiple times: we track only
one, and eventually will substitute once all occurrences in the mlt file
when required
*/
$path = $this->guessPath($root_folder, $f);
$test_count = File::where('project_id', '=', $this->project->id)->where('original_path', '=', $path)->first();
if ($test_count != null) {
$test_count->references = $test_count->references + 1;
$test_count->save();
return true;
}
$file = new File();
$file->project_id = $this->project->id;
$file->filename = basename($f);
$file->original_path = $path;
$file->references = 1;
$ret = $file->testReach();
$file->save();
return $ret;
}