Darken\Config\ConfigInterface

interface

Interface for managing configuration settings in the application. This interface provides methods to retrieve essential configuration values such as root directory paths, debug modes, and folders used during the build process.

To simplify its implementation, you can use the provided ConfigHelperTrait. Example usage:

use Darken\Config\ConfigHelperTrait;

public function __construct(private readonly string $rootDirectoryPath)
{
    $this->loadEnvFile();
}

Methods

Method Details

public string getRootDirectoryPath () ConfigInterface.php#39

Get the root directory path of the application. This path serves as the base for resolving other directories and configuration values.

Example:

return $this->path($this->rootDirectoryPath);
Return string
public bool getDebugMode () ConfigInterface.php#53

Determine if the application is in debug mode. The debug mode can be enabled or disabled via the DARKEN_DEBUG environment variable.

Example:

return (bool) $this->env('DARKEN_DEBUG', false);
Return bool
public string getBuildOutputFolder () ConfigInterface.php#68

Get the output folder path for build artifacts. The folder is resolved relative to the root directory and can be customized using the DARKEN_BUILD_OUTPUT_FOLDER environment variable.

Example:

return $this->getRootDirectoryPath() . DIRECTORY_SEPARATOR . $this->env('DARKEN_BUILD_OUTPUT_FOLDER', '.build');
Return string
public string getBuildOutputNamespace () ConfigInterface.php#82

Get the namespace used for build output. The namespace can be customized using the DARKEN_BUILD_OUTPUT_NAMESPACE environment variable.

Example:

return $this->env('DARKEN_BUILD_OUTPUT_NAMESPACE', 'Build');
Return string
public array getBuildingFolders () ConfigInterface.php#99

Get a list of folders involved in the building process. This typically includes the components folder and the pages folder.

Example:

return [
    $this->getRootDirectoryPath() . DIRECTORY_SEPARATOR . 'components',
    $this->getPagesFolder(),
];
Return array