ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
AbstractAdapter.php
Go to the documentation of this file.
1 <?php
2 
4 
6 
7 abstract class AbstractAdapter implements AdapterInterface
8 {
12  protected $pathPrefix;
13 
17  protected $pathSeparator = '/';
18 
26  public function setPathPrefix($prefix)
27  {
28  $prefix = (string) $prefix;
29 
30  if ($prefix === '') {
31  $this->pathPrefix = null;
32  return;
33  }
34 
35  $this->pathPrefix = rtrim($prefix, '\\/') . $this->pathSeparator;
36  }
37 
43  public function getPathPrefix()
44  {
45  return $this->pathPrefix;
46  }
47 
55  public function applyPathPrefix($path)
56  {
57  return $this->getPathPrefix() . ltrim($path, '\\/');
58  }
59 
67  public function removePathPrefix($path)
68  {
69  return substr($path, strlen($this->getPathPrefix()));
70  }
71 }
$path
Definition: aliased.php:25
setPathPrefix($prefix)
Set the path prefix.
removePathPrefix($path)
Remove a path prefix.