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

getConfdDir() public method

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

Usage Example

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