Check a log file.

@param  string  $path
511556
private function checkLogFile($path)
    {
        $status   = true;
        $filename = basename($path);
        $message  = "The log file [$filename] is valid.";

        if ($this->isSingleLogFile($filename)) {
            $this->status = $status  = false;
            $this->messages['files'][$filename] = $message =
                "You have a single log file in your application, you should split the [$filename] into separate log files.";
        }
        elseif ($this->isInvalidLogDate($filename)) {
            $this->status = $status  = false;
            $this->messages['files'][$filename] = $message =
                "The log file [$filename] has an invalid date, the format must be like laravel-YYYY-MM-DD.log.";
        }

        $this->files[$filename] = compact('filename', 'status', 'message', 'path');
    }
197501
protected function validatePath($path)
    {
        if (empty($path)) {
            return false;
        }

        // we are always operating from root directory
        // so forbid relative paths
        if (false !== strpos($path, '..')) {
            return false;
        }

        return true;
    }
1345676
protected function ensureDirectory($path)
    {

        if ( !$this->fs->exists($path) )
        {
            $this->fs->makeDirectory($path);
        }
    }
1191429
public function assertAbsent($path)
    {
        if ($this->getConfig('disable_asserts', false) === false && $this->has($path)) {
            throw new FileExistsException($path);
        }
    }
448770
public function isString($path)
    {
        $value = $this->get($path, $this);

        return $value === $this ? false : is_string($value);
    }
265822
public static function validatePath(string $path = null): void
    {
        if (empty($path)) {
            throw new InvalidArgumentException("Cannot validate empty path");
        }

        if (!file_exists($path)) {
            throw new InvalidArgumentException("Path does not exist [$path]");
        }
        if (!is_readable($path)) {
            throw new InvalidArgumentException("Path is not readable [$path]");
        }
    }
646632
public static function isFile($path)
    {
        if (is_file($path)) {
            if (strstr(PHP_OS, 'WIN')) {
                if (basename(realpath($path)) != basename($path)) {
                    return false;
                }
            }

            return true;
        }

        return false;
    }
471543
private function checkPathPatterns($path)
    {
        foreach ($this->pathPatterns as $pattern) {
            if (preg_match('/^' . $pattern . '$/D', $path)) {
                return true;
            }
        }

        return false;
    }
930829
protected function tailLocalLogs($path)
    {
        $output = $this->output;

        $lines = $this->option('lines');

        (new Process('tail -f -n '.$lines.' '.escapeshellarg($path)))->setTimeout(null)->run(function ($type, $line) use ($output) {
            $output->write($line);
        });
    }
31342
public function checkIsHiddenPath($path)
    {
        $_clientPathParts = explode("/", trim($path, "/"));
        if ($_clientPathParts) {
            foreach ($_clientPathParts as $_part) {
                if ($this->checkIsHiddenFolder($_part)) {
                    return true;
                }
            }
        }

        return false;
    }
155122
public function checkPath($path = null)
  {
    if($path === null)
    {
      $path = $this->path;
    }

    if(strlen($path) == 0)
    {
      return TRUE;
    }

    $pattern = "/^" . $this->regex["path"] . "$/";
    $status = @preg_match($pattern, $path);

    if($status === FALSE)
    {
      throw new Exception("URI path validation failed");
    }

    return ($status == 1);
  }
180284
static function log($msg,$path = "") {
    if(empty($path)){
      $path = MF_FILES_DIR;
    }

    if(!is_string($msg)){
      $msg = print_r($msg,true);
    }

    $fp = fopen($path.'magic_fields.log', 'a+');
    $date = gmdate( 'Y-m-d H:i:s' );
    fwrite($fp, "$date - $msg\n");
    fclose($fp);
   }
317728
private function checkPath($path)
    {
        return file_exists($path) && is_readable($path) && ($resources = scandir($path)) && (count($resources) > 2);
    }
792385
private function requireFile($path)
    {
        if (file_exists($path)) {
            $this->updateLog("debug", "File {$path} exists; requiring file");

            /** @noinspection PhpIncludeInspection */
            require $path;

            $this->updateLog("info", "Completed loading {$path}");

            return true;
        } else {
            $this->updateLog("debug", "File {$path} does not exist");

            return false;
        }
    }
670936
protected static function verifyPath(string $path = ''): bool
    {
        static::init();
        $currentDir = '.'.DIRECTORY_SEPARATOR;
        return (\stripos($path, static::$documentRoot) !== false && \strpos($path, $currentDir) === false);
    }
1342256
public function has($path)
    {
        $location = $this->applyPathPrefix($path);

        try {
            $this->share->stat($location);
        } catch (NotFoundException $e) {
            return false;
        }

        return true;
    }
155979
public function check_path($path = '')
	{
		$path = ($path === '' ? Core::$tempDir . DS . 'Database' : $path);

		// Add a trailing slash to the path if needed
		$path = realpath($path)
			? rtrim(realpath($path), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR
			: rtrim($path, '/').'/';

		if ( ! is_dir($path))
		{
			if (!mkdir($path, 0777, false))
			{
				Logger::logDebug('DB cache path error: '.$path);

				// If the path is wrong we'll turn off caching
				return $this->db->cache_off();
			}
		}

		if ( ! Core::isReallyWritable($path))
		{
			Logger::logDebug('DB cache dir not writable: '.$path);

			// If the path is not really writable we'll turn off caching
			return $this->db->cache_off();
		}

		$this->db->cachedir = $path;
		return TRUE;
	}