write_content() static public method

Write blob version of $obj. Returns path written to or false if write was not needed.
static public write_content ( GBContent $obj )
$obj GBContent
Beispiel #1
0
         gb::log('did force html');
     } else {
         gb::log('mime type is %s', $post->mimeType);
     }
     if (!$post->published) {
         $post->published = $post->modified;
     }
     $post->name = $post->recommendedName();
 } else {
     gb::log('already exists (OK)');
 }
 # was the state actually modified?
 if ($modified_state) {
     gb::log('write %s', r($modified_state));
     # write to work area
     gb_admin::write_content($post);
 }
 # if the post was created, reload it to find appropriate values
 if ($created) {
     $post = GBPost::findByName($post->name, 'work');
     $modified_state = array();
     foreach ($state_fields as $k => $discard) {
         if ($k === 'body') {
             $modified_state[$k] = $post->rawBody();
         } else {
             $v = $post->{$k};
             if ($v instanceof GBDateTime) {
                 $v = strval($v);
             }
             $modified_state[$k] = $v;
         }
Beispiel #2
0
 function writeExposedContent(GBExposedContent $obj)
 {
     gb_admin::write_content($obj);
     git::add($obj->name);
     if ($this->includeComments) {
         $this->writeComments($obj);
     }
     return true;
 }