toBlob() 공개 메소드

public toBlob ( )
예제 #1
0
파일: gb_admin.php 프로젝트: rsms/gitblog
 /** Write blob version of $obj. Returns path written to or false if write was not needed. */
 static function write_content(GBContent $obj)
 {
     # build blob
     $blob = $obj->toBlob();
     # build destination path
     $dstpath = gb::$site_dir . '/' . $obj->name;
     # assure destination dir is prepared
     $dstpathdir = dirname($dstpath);
     if (!is_dir($dstpathdir)) {
         self::mkdirs($dstpathdir);
     }
     # write
     file_put_contents($dstpath, $blob, LOCK_EX);
     @chmod($dstpath, 0664);
     return $dstpath;
 }