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

getConfDir() public method

Return's the server's main configuration directory.
public getConfDir ( string $relativePathToAppend = '' ) : string
$relativePathToAppend string A relative path to append
return string The server's main configuration directory
    public function getConfDir($relativePathToAppend = '')
    {
        return $this->realpath($this->makePathAbsolute($this->getSystemConfiguration()->getParam(DirectoryKeys::ETC_APPSERVER) . $this->makePathAbsolute($relativePathToAppend)));
    }

Usage Example

 /**
  * Tests if getting just the configuration directory works
  *
  * @return null
  */
 public function testGetConfDirNothingToAppend()
 {
     $dir = $this->service->getConfDir();
     $this->assertEquals('/opt/appserver/etc/appserver', $dir);
     $this->assertNotEquals('/opt/appserver/etc/appserver/test/directory', $dir);
 }