@param string $path

@return bool|int
340712
public function writePHPDocMethod($path = '')
    {
        if (empty($path)) {
            $path = realpath($this->rootPath . $this->DEFAULT_API_JSON_PATH);
            if (empty($path)) {
                $path = $this->rootPath . $this->DEFAULT_API_JSON_PATH;
            }
            $path = preg_replace('/\.[^.]+?$/', '.php', $path);
        }
        if (file_exists($path)) {
            rename($path, $path . '.bak');
        }

        $data = $this->methodData;
        $filterParams = ['data' => $data, 'definition' => $this->data, 'source' =>
            $this->sourceData];

        $methods = array_merge(["<?php", "/** "], $data ? : [], [" */", ""]);
        $methods = $this->applyFilter('DocMethodFinalArray', $methods, $filterParams);
        $methodText = implode("\n", $methods);
        $methodText = $this->applyFilter('DocMethodFinalText', $methodText, $filterParams);

        return file_put_contents($path, $methodText);
    }
109469
public static function size($path)
    {
        $path = ltrim(self::fullpath($path), '/');

        $ch = curl_init('file://' . $path);

        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_HEADER, true);
        curl_setopt($ch, CURLOPT_NOBODY, true);

        $headers = curl_exec($ch);
        curl_close($ch);

        $ch = null;

        if (preg_match('#content-length:(\s+?|)(\d+)#i', $headers, $matches)) {
            return $matches[2];
        }

        return false;
    }
829436
private static function isAbsolute($path)
    {
        $path = trim($path);

        if ($path === '') {
            return false;
        }

        $length = strcspn($path, '/\\');

        return $length === 0 || $path[$length - 1] === ':';
    }
803270
protected function getExistsPath($path)
    {
        $fullPath = $this->concatPaths($path);

        if (!file_exists($fullPath)) {
            $fullPath = $this->getExistsPath(pathinfo($fullPath, PATHINFO_DIRNAME));
        }

        return $fullPath;
    }
1321037
public function size( $path )
	{
		try {
			return $this->fs->size( $path );
		} catch( \Exception $e ) {
			throw new Exception( $e->getMessage(), 0, $e );
		}
	}
214530
public function hasParam($path)
    {
        $this->validatePath($path);

        $value = $this->translatePathElement($path, $this->params);

        return (null === $value) ? false : true;
    }
729560
protected static function tryDelete($path)
    {
        $success = true;

        try
        {
            if ( ! @unlink($path))
            {
                $success = false;
            }
        } catch (ErrorException $e)
        {
            $success = false;
        }

        return $success;
    }
1369380
public static function size($path)
    {
        $path = Normalize::diskFullPath($path);
        if (!self::exist($path)) {
            return 0;
        }

        $size = 0;
        try {
            foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)) as $file) {
                if ($file->getFileName() !== '..') {
                    $size += $file->getSize();
                }
            }
        } catch (\Exception $e) {
            return 0;
        }
        return $size;
    }
445678
protected function pathIsDirectory($path)
    {
        $exp = explode(DIRECTORY_SEPARATOR, $path);
        $name = end($exp);
        $exp = explode(".", $name);

        return !(count($exp) >= 2);
    }
393038
public static function getFileSize($path)
    {
        if (is_file($path)) {
            return filesize($path);
        } elseif (substr($path, 0, 6) == 'ftp://') {
            return self::getFileSizeFtp($path);
        } elseif (substr($path, 0, 4) == 'http') {
            return self::getFileSizeHttp($path);
        } else {
            return 0;
        }
    }
796198
protected function countSize($path) {
		$stat = $this->stat($path);

		if (empty($stat) || !$stat['read'] || !empty($stat['hidden'])) {
			return 'unknown';
		}
		
		if ($stat['mime'] != 'directory') {
			return $stat['size'];
		}
		
		$subdirs = $this->options['checkSubfolders'];
		$this->options['checkSubfolders'] = true;
		$result = 0;
		foreach ($this->getScandir($path) as $stat) {
			$size = $stat['mime'] == 'directory' && $stat['read'] 
				? $this->countSize($this->joinPathCE($path, $stat['name'])) 
				: (isset($stat['size']) ? intval($stat['size']) : 0);
			if ($size > 0) {
				$result += $size;
			}
		}
		$this->options['checkSubfolders'] = $subdirs;
		return $result;
	}
163487
public function getSize($path)
    {
        list($prefix, $path) = $this->getPrefixAndPath($path);

        return $this->getFilesystem($prefix)->getSize($path);
    }
1017103
public function delete($path)
    {
        $url = self::BASE_URI.$this->getPathUnderRootDrive($path);

        $response = $this->getResponse('DELETE', $url);
        $success = ($response->getStatusCode() == '204');

        return $success;
    }
339132
public static function type(string $path): string
    {
        $result = @filetype($path);
        return $result !== false ? $result : '';
    }
389216
protected function cleanPathInternal($path)
    {
        if ($this->isVirtual($path)) {
            return $this->cleanPath($path);
        }

        if ($this->hasCDBack($path)) {
            $realpath = $this->cleanPath(realpath($path));
            return $realpath ?: null;
        }

        return $this->cleanPath($path);
    }
599326
public static function exists ($path)
		{
			if (file_exists($path))
				return true;

			$c = curl_init($path);
			curl_setopt($c, CURLOPT_NOBODY, true);
			curl_setopt($c, CURLOPT_FOLLOWLOCATION, true);
			curl_exec($c);
			$code = curl_getinfo($c, CURLINFO_HTTP_CODE);
			curl_close($c);

			return ( $code == 200 );
		}
1161298
protected function checkPath($path)
    {
        if (is_dir($path)) {
            return true;
        }
        if (mkdir($path, 0755, true)) {
            return true;
        } else {
            return false;
        }
    }