Airship\Engine\Continuum\Installers\Cabin::createEmptyFiles PHP Method

createEmptyFiles() protected method

Create empty files (motifs.json, etc.)
protected createEmptyFiles ( string $nameSpace ) : boolean
$nameSpace string
return boolean
    protected function createEmptyFiles(string $nameSpace) : bool
    {
        $dir = \implode(DIRECTORY_SEPARATOR, [ROOT, 'Cabin', $nameSpace, 'config']);
        if (!\file_exists($dir . '/content_security_policy.json')) {
            if (\file_put_contents($dir . '/content_security_policy.json', '{"inherit": true}') === false) {
                return false;
            }
        }
        if (!\file_exists($dir . '/gadgets.json')) {
            if (\file_put_contents($dir . '/gadgets.json', '[]') === false) {
                return false;
            }
        }
        if (!\file_exists($dir . '/motifs.json')) {
            if (\file_put_contents($dir . '/motifs.json', '[]') === false) {
                return false;
            }
        }
        if (!\file_exists($dir . '/twig_vars.json')) {
            if (\file_put_contents($dir . '/twig_vars.json', '[]') === false) {
                return false;
            }
        }
        if (!\is_dir(ROOT . '/Cabin/' . $nameSpace . '/Lens/motif')) {
            \mkdir(ROOT . '/Cabin/' . $nameSpace . '/Lens/motif', 0775);
        }
        return true;
    }