1. Go to this page and download the library: Download bolt/pathogen library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bolt / pathogen example snippets
$atoms = $path->atoms(); // returns an array of strings
$name = $path->name(); // returns a string
$nameWithoutExtension = $path->nameWithoutExtension(); // returns a string
$namePrefix = $path->namePrefix(); // returns a string
$nameSuffix = $path->nameSuffix(); // returns a string or null
$extension = $path->extension(); // returns a string or null
useEloquent\Pathogen\AbsolutePathInterface;
useEloquent\Pathogen\PathInterface;
useEloquent\Pathogen\RelativePathInterface;
functionanyPath(PathInterface $path){
// accepts any path
}
functionabsoluteOnly(AbsolutePathInterface $path){
// accepts only absolute paths
}
functionrelativeOnly(RelativePathInterface $path){
// accepts only relative paths
}
useEloquent\Pathogen\AbsolutePath;
useEloquent\Pathogen\FileSystem\FileSystemPath;
useEloquent\Pathogen\Path;
useEloquent\Pathogen\RelativePath;
useEloquent\Pathogen\Unix\UnixPath;
useEloquent\Pathogen\Windows\AbsoluteWindowsPath;
useEloquent\Pathogen\Windows\WindowsPath;
$path = Path::fromString('/path/to/foo'); // absolute path
$path = Path::fromString('bar/baz'); // relative path
$path = AbsolutePath::fromString('/path/to/foo'); // only creates absolute paths
$path = RelativePath::fromString('bar/baz'); // only creates relative paths
$path = FileSystemPath::fromString('/path/to/foo'); // Unix path
$path = FileSystemPath::fromString('C:\path\to\foo'); // Windows path
$path = UnixPath::fromString('/path/to/foo'); // only creates Unix paths
$path = WindowsPath::fromString('C:\path\to\foo'); // only creates Windows paths
$path = AbsoluteWindowsPath::fromString('C:\path\to\foo'); // only creates absolute Windows paths
useEloquent\Pathogen\FileSystem\FileSystemPath;
$pathFoo = FileSystemPath::fromString('/path/to/foo'); // creates a Unix-style path
$pathBar = FileSystemPath::fromString('C:/path/to/bar'); // creates a Windows path
useEloquent\Pathogen\FileSystem\PlatformFileSystemPath;
// creates a path to match the current platform
$path = PlatformFileSystemPath::fromString('/path/to/foo');
$drive = $path->drive(); // returns a single-character string, or null