@param  string $file_path

@return void
191710
public function incrementNonMixedCount($file_path)
    {
        if (!$this->count_mixed) {
            return;
        }

        if (!isset($this->mixed_counts[$file_path])) {
            $this->mixed_counts[$file_path] = [0, 0];
        }

        ++$this->mixed_counts[$file_path][1];
    }
450723
public function check($path)
    {
        foreach ($this->getFiles($path) as $file) {
            $this->checkFile($file);
        }
    }
57245
public function findAsset($file_path)
    {
        $real_path = $this->findRealPath($file_path);
        if ($real_path) {
            return trim(FilesystemHelper::resolveRelatedPath($this->web_root_path, $real_path), '/');
        }
        return null;
    }
426391
protected function load(string $path): void
    {
        $namespace = $this->app->getNamespace();

        /** @var SplFileInfo[] $files */
        $files = (new Finder)->in($path)->files();

        foreach ($files as $file) {
            $file = $namespace.str_replace(
                    ['/', '.php'],
                    ['\\', ''],
                    Str::after($file->getPathname(), app_path().DIRECTORY_SEPARATOR)
                );

            if (is_subclass_of($file, Intent::class) && !(new ReflectionClass($file))->isAbstract()) {
                $this->app['conversation']->registerIntent($file);
            }
        }
    }
578254
protected function is_valid_image_file($file_path) {
        if (!preg_match($this->options['image_file_types'], $file_path)) {
            return false;
        }
        if (function_exists('exif_imagetype')) {
            $contents = file_get_contents($file_path);
            // create data:// wrapper is the only way to apply exif_imagetype() to string
            $data = 'data://image/jpeg;base64,' . base64_encode($contents);
            $image_type = exif_imagetype($data);
            $this->exif_image_objects[$file_path] = array(
                'type' => $image_type,
                'data' => @exif_read_data($data),
            );
            unset($contents);
            return $image_type;
        }
        $image_info = $this->get_image_size($file_path);
        return $image_info && $image_info[0] && $image_info[1];
    }
41781
protected function get_file_info($relative_path) {
        $fullpath = $this->getFullPath($relative_path);
        $pathInfo = pathinfo($fullpath);
        $filemtime = filemtime($fullpath);

        // check if file is readable
        $is_readable = $this->has_system_permission($fullpath, ['r']);
        // check if file is writable
        $is_writable = $this->has_system_permission($fullpath, ['w']);

        if (is_dir($fullpath)) {
            $model = $this->folder_model;
        } else {
            $model = $this->file_model;
            $model['attributes']['extension'] = isset($pathInfo['extension']) ? $pathInfo['extension'] : '';

            if ($is_readable) {
                $model['attributes']['size'] = $this->get_real_filesize($fullpath);

                if ($this->is_image_file($fullpath)) {
                    if ($model['attributes']['size']) {
                        list($width, $height, $type, $attr) = getimagesize($fullpath);
                    } else {
                        list($width, $height) = [0, 0];
                    }

                    $model['attributes']['width'] = $width;
                    $model['attributes']['height'] = $height;
                }
            }
        }

        $model['id'] = $relative_path;
        $model['attributes']['name'] = $pathInfo['basename'];
        $model['attributes']['path'] = $this->getDynamicPath($fullpath);
        $model['attributes']['readable'] = (int) $is_readable;
        $model['attributes']['writable'] = (int) $is_writable;
        $model['attributes']['timestamp'] = $filemtime;
        $model['attributes']['modified'] = $this->formatDate($filemtime);
        //$model['attributes']['created'] = $model['attributes']['modified']; // PHP cannot get create timestamp
        return $model;
    }
122852
public static function encodePath($file_path)
    {
        if (self::chkChinese($file_path) && self::isWin()) {
            $file_path = iconv('utf-8', 'gbk', $file_path);
        }
        return $file_path;
    }
354348
public static function delete($file_path)
    {
        $result = false;
        if (self::fileExists($file_path)) {
            $result = unlink($file_path);
        }
        return $result;
    }
178744
public static function pathModeInfo(string $file_path): int
    {
        /* 如果不存在，则不可读、不可写、不可改 */
        if (!file_exists($file_path)) {
            return false;
        }

        $mark = 0;

        if (0 === stripos(PHP_OS, 'WIN')) {
            /* 测试文件 */
            $test_file = $file_path . '/cf_test.txt';

            /* 如果是目录 */
            if (is_dir($file_path)) {
                /* 检查目录是否可读 */
                $dir = @opendir($file_path);

                //如果目录打开失败，直接返回目录不可修改、不可写、不可读
                if ($dir === false) {
                    return $mark;
                }

                //目录可读 001，目录不可读 000
                if (@readdir($dir) !== false) {
                    $mark ^= 1;
                }

                @closedir($dir);

                /* 检查目录是否可写 */
                $fp = @fopen($test_file, 'wb');

                //如果目录中的文件创建失败，返回不可写。
                if ($fp === false) {
                    return $mark;
                }

                //目录可写可读 011，目录可写不可读 010
                if (@fwrite($fp, 'directory access testing.') !== false) {
                    $mark ^= 2;
                }

                @fclose($fp);
                @unlink($test_file);

                /* 检查目录是否可修改 */
                $fp = @fopen($test_file, 'ab+');
                if ($fp === false) {
                    return $mark;
                }

                if (@fwrite($fp, "modify test.\r\n") !== false) {
                    $mark ^= 4;
                }

                @fclose($fp);

                /* 检查目录下是否有执行rename()函数的权限 */
                if (@rename($test_file, $test_file) !== false) {
                    $mark ^= 8;
                }

                @unlink($test_file);

                /* 如果是文件 */
            } elseif (is_file($file_path)) {
                /* 以读方式打开 */
                $fp = @fopen($file_path, 'rb');
                if ($fp) {
                    $mark ^= 1; //可读 001
                }

                @fclose($fp);

                /* 试着修改文件 */
                $fp = @fopen($file_path, 'ab+');
                if ($fp && @fwrite($fp, '') !== false) {
                    $mark ^= 6; //可修改可写可读 111，不可修改可写可读011...
                }

                @fclose($fp);

                /* 检查目录下是否有执行rename()函数的权限 */
                if (@rename($test_file, $test_file) !== false) {
                    $mark ^= 8;
                }
            }
        } else {
            if (@is_readable($file_path)) {
                $mark ^= 1;
            }

            if (@is_writable($file_path)) {
                $mark ^= 14;
            }
        }

        return $mark;
    }
884654
protected function clearStatCache($all_files = false)
    {
        if(version_compare(PHP_VERSION, '5.3.0') >= 0)
        {
            if($all_files === true)
            {
                clearstatcache(true);
                return;
            }

            clearstatcache(true, $this->file_path);
            return;
        }
        clearstatcache();
    }
807534
public function insert($file_path, $file_extension) {
		$path = str_replace('/', '\\', INCLUDES_ROOT."/$file_path$file_extension");

		try {
			if (!file_exists($path)) {
				throw MvcException::InsertedFileNotFound($path);
			}

			global $mvc, $view;
			$ModuleView = 'Module\\'.Router::$route->module.'\\'.Router::$route->module.'View';
			$view = new $ModuleView();
			$mvc = new Mvc();

			include $path;
		} catch (\Exception $e) {
			(new ExceptionGenerator($e))->render();
		}
	}
1042060
public function move($file, $filePath)
	{
 		$this->buildDirectory($filePath);
 		$this->moveFile($file, $filePath);
        $this->setPermissions($filePath, $this->attachedFile->override_file_permissions);
	}
591646
public function familiar($file_path)
    {
        $dirs = explode('/', $file_path);
        $new_file_root = array_pop($dirs);
        array_unshift($dirs, reset($this->subDirs));
        
        $file = new static($this->type);
        $file->subDirs = $dirs;
        $file->fileRoot = $new_file_root;
        $file->extension = $this->extension;
        return $file;
    }
1215023
public function setPath(string $path = ''): void
    {
        $this->path = '/';
        if ($path != '') {
            $this->path .= \substr($path, 0, 1) === '/' ? \substr($path, 1) : $path;
        }
    }
380530
public static function removePath($search_path)
    {
        $index = array_search($search_path, self::$search_paths);
        if ($index !== false) {
            array_splice(self::$search_paths, $index, 1);
        }
    }
971687
public function delete($path, $_path='/') {
		if(!headers_sent())
			setcookie($path, null, -10000, $_path);
		unset($_COOKIE[$path]);
	}
574411
public function addFileToDeepScan($file_path)
    {
        $this->files_to_scan[$file_path] = $file_path;
        $this->files_to_deep_scan[$file_path] = $file_path;
    }