AppserverIo\Appserver\Core\Api\AbstractService::realpath PHP Method

realpath() public method

Returns the absolute path to the passed directory, also working on Windows.
public realpath ( string $relativePathToAppend ) : string
$relativePathToAppend string The relativ path to return the absolute path for
return string The absolute path of the passed directory
    public function realpath($relativePathToAppend)
    {
        return $this->getBaseDirectory($this->makePathAbsolute($relativePathToAppend));
    }

Usage Example

 /**
  * Test if building the absolute path works like it should
  *
  * @return null
  */
 public function testRealpath()
 {
     $appendedDirectory = '/test/directory';
     $result = $this->service->realpath($appendedDirectory);
     $this->assertEquals('/opt/appserver/test/directory', $result);
 }