protected function runSitesYmlProcess()
    {
        $sitesConf = $this->bbapp->getConfig()->getSitesConfig();

        if ($this->siteDomain === null) {
            throw new \InvalidArgumentException('This site domain is not valid (empty value)');
        }

        if (is_array($sitesConf) && array_key_exists($this->siteLabel, $sitesConf)) {
            throw new \InvalidArgumentException('This label `'.$this->siteLabel.'` already present in sites.yml');
        }

        $newSite = [
            \BackBee\Utils\StringUtils::urlize($this->siteLabel) => [
                'label'  => $this->siteLabel,
                'domain' => $this->siteDomain,
            ],
        ];

        $newSitesConf = (is_array($sitesConf)) ? array_merge($sitesConf, $newSite) : $newSite;
        file_put_contents(
                $this->bbapp->getBaseDir().DIRECTORY_SEPARATOR.'repository/Config/sites.yml',
                Yaml::dump($newSitesConf)
        );

        return $this;
    }
protected function runSitesYmlProcess()
    {
        $sitesConf = $this->bbapp->getConfig()->getSitesConfig();

        if ($this->siteDomain === null) {
            throw new \InvalidArgumentException('This site domain is not valid (empty value)');
        }

        if (is_array($sitesConf) && array_key_exists($this->siteLabel, $sitesConf)) {
            throw new \InvalidArgumentException('This label `'.$this->siteLabel.'` already present in sites.yml');
        }

        $newSite = [
            \BackBee\Utils\StringUtils::urlize($this->siteLabel) => [
                'label'  => $this->siteLabel,
                'domain' => $this->siteDomain,
            ],
        ];

        $newSitesConf = (is_array($sitesConf)) ? array_merge($sitesConf, $newSite) : $newSite;
        file_put_contents(
                $this->bbapp->getBaseDir().DIRECTORY_SEPARATOR.'repository/Config/sites.yml',
                Yaml::dump($newSitesConf)
        );

        return $this;
    }
protected function runSitesYmlProcess ( ) { $ sitesConf = $ this -> bbapp -> getConfig ( ) -> getSitesConfig ( ) ; if ( $ this -> siteDomain === null ) { throw new \ InvalidArgumentException ( 'This site domain is not valid (empty value)' ) ; } if ( is_array ( $ sitesConf ) && array_key_exists ( $ this -> siteLabel , $ sitesConf ) ) { throw new \ InvalidArgumentException ( 'This label `' . $ this -> siteLabel . '` already present in sites.yml' ) ; } $ newSite = [ \ BackBee \ Utils \ StringUtils :: urlize ( $ this -> siteLabel ) => [ 'label' => $ this -> siteLabel , 'domain' => $ this -> siteDomain , ] , ] ; $ newSitesConf = ( is_array ( $ sitesConf ) ) ? array_merge ( $ sitesConf , $ newSite ) : $ newSite ; file_put_contents ( $ this -> bbapp -> getBaseDir ( ) . DIRECTORY_SEPARATOR . 'repository/Config/sites.yml' , Yaml :: dump ( $ newSitesConf ) ) ; return $ this ; }
Create new site entry inside sites.yml file

@return CreateWebsiteCommand
Create new site entry inside sites . yml file