public function export(Logger $logger = null)
    {
        foreach ($this->site->process() as $path => $content)
        {
            $dest = "{$this->path}/$path";
            $folder = substr($dest, 0, strrpos($dest, '/'));
            
            if (!is_dir($folder)) 
            {
                mkdir($folder, 0777, true);
            }
            
            if (file_put_contents($dest, $content['output']) && $logger)
            {
                $logger->log(Logger::INFO, 'Web page %s was compiled at %s', [$path, $dest]);
            }
        }
        
        return true;
    }
public function export(Logger $logger = null)
    {
        foreach ($this->site->process() as $path => $content)
        {
            $dest = "{$this->path}/$path";
            $folder = substr($dest, 0, strrpos($dest, '/'));
            
            if (!is_dir($folder)) 
            {
                mkdir($folder, 0777, true);
            }
            
            if (file_put_contents($dest, $content['output']) && $logger)
            {
                $logger->log(Logger::INFO, 'Web page %s was compiled at %s', [$path, $dest]);
            }
        }
        
        return true;
    }
public function export ( Logger $ logger = null ) { foreach ( $ this -> site -> process ( ) as $ path => $ content ) { $ dest = "{$this->path}/$path" ; $ folder = substr ( $ dest , 0 , strrpos ( $ dest , '/' ) ) ; if ( ! is_dir ( $ folder ) ) { mkdir ( $ folder , 0777 , true ) ; } if ( file_put_contents ( $ dest , $ content [ 'output' ] ) && $ logger ) { $ logger -> log ( Logger :: INFO , 'Web page %s was compiled at %s' , [ $ path , $ dest ] ) ; } } return true ; }
Export a site to build folder
Export a site to build folder