original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Export a site to build folder
docstring_tokens: Export a site to build folder