| Recommend this page to a friend! | 
|  Download | 
| Info | Documentation |  Files |  Install with Composer |  Download | Reputation | Support forum | Blog | Links | 
| Ratings | Unique User Downloads | Download Rankings | ||||
| Not yet rated by the users | Total: 73 | All time:  10,232 This week: 673  | ||||
| Version | License | PHP version | Categories | |||
| pathuri 1.0 | MIT/X Consortium ... | 5 | HTTP, PHP 5, Parsers | 
| Description | Author | |
| This package can parse and edit the URI of a site page. | 
Powerful while Remaining Simple to use library to ease URL parsing and editing in PHP.
__PathJoinedUri__
Basic Path Interfaces iPathJoinedUri
### Build object from construct ---------------------------------------------------
$joinedPath = new PathJoinUri([
    # (!) when you pass a path on construct
    #     you have to set separator
    'path' => '/var/www/html/',                        # <-----
                                                       #      |
    # path also can build upon series of array list           | same in path
    'path' => ['', 'var', 'www', 'html'],              # <-----
    #          ^ this mean absolute path starting with "/"
    # (!) in this form separator is not necessary
    # default separator is "/"
    'separator' => '/'
]);
### Build Existing Object -------------------------------------------------------
$newPath = (new PathJoinUri)->setSeparator('\\');
                                   # ^ you have to set separator before parse()
$parsedUri = $newPath->parse('\\..\\htdocs\\project\\');
         # = ['path' => ['', '..', 'htdocs', 'project']]
$newPath->fromArray($parsedUri);
## print out path
echo $newPath
    ->toString()
    .'<br/>';
# output : \..\htdocs\project
### Append/Prepend Paths --------------------------------------------------------
$joinedPath->append($newPath);
echo $joinedPath->toString().'<br/>';;
# output: /var/www/html/../htdocs/project
# normalize output
echo $joinedPath->normalize()->toString().'<br/>';;
# output: /var/www/htdocs/project
# (!) Paths starting with "../" turning path into relative on normalize
$joinedPath->prepend(new PathJoinUri(['path' => '/../relative']));
echo $joinedPath->toString().'<br/>';
# output: /../relative/var/www/htdocs/project
echo $joinedPath->normalize()->toString().'<br/>';
# output: relative/var/www/htdocs/project
|  Files (14) | 
| File | Role | Description | ||
|---|---|---|---|---|
|  Http (1 file) | ||||
|  Interfaces (5 files) | ||||
|  Psr (1 file) | ||||
|  aUri.php | Class | Class source | ||
|    composer.json | Data | Auxiliary data | ||
|    README.md | Doc. | Documentation | ||
|  UriHttp.php | Class | Class source | ||
|  UriPathName.php | Class | Class source | ||
|  UriSequence.php | Class | Class source | ||
|    _functions.php | Aux. | Auxiliary script | ||
|  Files (14) | / | Interfaces | 
| File | Role | Description | 
|---|---|---|
|  iDataQueryParams.php | Class | Class source | 
|  iUriBase.php | Class | Class source | 
|  iUriHttp.php | Class | Class source | 
|  iUriPathName.php | Class | Class source | 
|  iUriSequence.php | Class | Class source | 
| The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. | 
|  Install with Composer | 
| Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
| 100% | 
 | 
 | 
| Applications that use this package | 
 If you know an application of this package, send a message to the author to add a link here.
 If you know an application of this package, send a message to the author to add a link here.