Checks if the log save path is acceptable

@author Art <a.molcanovas@gmail.com>

@param mixed $path The log save path

@return bool
327152
private static function checkSavePath($path) {
            if (is_string($path)) {
                $dir = dirname($path);

                return file_exists($dir) && is_writeable($dir);
            } elseif (is_resource($path)) {
                return true;
            }

            return false;
        }
398094
public function isAbsolutePath($path)
    {
        if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
            if (preg_match('/^[A-Z]:\\\\/', $path)) {
                return true;
            }
        } else {
            if (substr($path, 0, 1) == DIRECTORY_SEPARATOR) {
                return true;
            }
        }

        return false;
    }
702487
public function isAbsolute($path)
    {
        $firstChar = substr($path, 0, 1);
        if ('/' === $firstChar || '\\' === $firstChar) {
            return true;
        }
        $isLetter = (
            ($firstChar >= 'A' && $firstChar <= 'Z') ||
            ($firstChar >= 'a' && $firstChar <= 'z')
        );
        $path = substr($path, 1, 2);
        return $isLetter && (':/' === $path || ':\\' === $path);
    }
643314
public function supports($path)
    {
        return is_string($path)
            && is_file($absolute = $this->findAbsolutePath($path))
            && 'yml' === pathinfo($absolute, PATHINFO_EXTENSION);
    }
844245
public function delete($path)
    {
        $bucketMgr = $this->getBucketManager();

        $error = $bucketMgr->delete($this->bucket, $path);
        if ($error !== null) {
            $this->logQiniuError($error);

            return false;
        } else {
            return true;
        }
    }
236636
public function isRelativePath(string $path): bool
    {
        $fileInfo = new MFileInfo($path);
        return $fileInfo->isAbsolute() === false;
    }
488353
public static function isAbsolute($path)
    {
        if (empty($path)) {
            return false;
        }

        return $path[0] === '/' ||
            preg_match('/^[A-Z]:\\\\/i', $path) ||
            substr($path, 0, 2) === '\\\\' ||
            self::isRegisteredStreamWrapper($path);
    }
1342256
public function has($path)
    {
        $location = $this->applyPathPrefix($path);

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

        return true;
    }
217400
protected function isNodePathAvailable(string $path): bool
    {
        $existingNodeDataArray = $this->nodeDataRepository->findByPathWithoutReduce($path, $this->context->getWorkspace());

        $nonMatchingNodeData = array_filter($existingNodeDataArray, function (NodeData $nodeData) {
            return ($nodeData->getIdentifier() !== $this->getIdentifier());
        });

        return ($nonMatchingNodeData === []);
    }
334395
public function setLogPath($path){
        if (!file_exists($path)){
            touch($path);
        }

        if (file_exists($path) && is_readable($path)){
            $this->logpath = $path;
        } else {
            throw new Exception("Log file does not exist or cannot be read! ($path)");
        }
        
    }
740724
public static function isFile(string $path) : bool
    {
        try {
            return ErrorCatcher::run(static function() use ($path) {
                return is_file($path);
            });
        } catch (\ErrorException $e) {
            throw new IoException('Error checking if ' . $path . ' is a file', 0, $e);
        }
    }
1279904
public function setPath ($path)
	{
		
		if (!is_dir ($path) && !mkdir ($path, 0755, TRUE))
		{
			return FALSE;
		}
		
		if (!is_writable ($path))
		{
			return FALSE;
		}
		
		$this->path	= $path;
		return TRUE;
		
	}
1206625
public function hasSetting($path)
    {
        $value = $this->resolvePath($path);
    
        if ($value === null) {
            return false;
        }
        
        return true;
    }
943900
public function is(string $path): bool
    {
        list($package, $route) = $this->locate($path);

        return $this->route($package)->is($route);
    }
643658
protected function checkPath($path)
    {
        // provide compatibility with objects such as \SplFileInfo
        if (is_object($path) && method_exists($path, '__toString')) {
            $path = (string) $path;
        }

        $handle = @fopen($path, 'r');

        if (false === $handle) {
            throw new InvalidArgumentException(sprintf('File %s does not exist.', $path));
        }

        fclose($handle);

        return $path.'[0]';
    }
262745
protected function checkIfPathToFileCheckPrefix(string $path): bool
    {
        if (file_exists($path) === true) {
            return substr($path, 0, 7) === 'file://';
        }

        return true;
    }
1318455
public function has($path)
    {
        try {
            $this->api->resource($path);
        } catch (Exception $e) {
            return false;
        }

        return true;
    }