本文整理匯總了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;
}