Exemple #1
0
 static function run_deferred()
 {
     try {
         # allow for self::$deferred_time_limit more seconds of processing
         global $gb_time_started;
         $time_spent = time() - $gb_time_started;
         @set_time_limit(self::$deferred_time_limit + $time_spent);
         if (headers_sent()) {
             # issue warning if output already started
             gb::log(LOG_WARNING, 'defer: output already started -- using interleaved execution');
         } else {
             # tell client the request is done
             $size = ob_get_length();
             header('Content-Length: ' . $size);
             ob_end_flush();
         }
         # flush any pending output
         flush();
         # call deferred code
         foreach (self::$deferred as $f) {
             try {
                 call_user_func_array($f[0], $f[1]);
             } catch (Exception $e) {
                 gb::log(LOG_ERR, 'deferred %s failed with %s: %s', gb_strlimit(json_encode($f), 40), get_class($e), $e->__toString());
             }
         }
     } catch (Exception $e) {
         gb::log(LOG_ERR, 'run_deferred failed with %s: %s', get_class($e), $e->__toString());
     }
 }
Exemple #2
0
" title="Edit post written by <?php 
    echo h($post->author->shortName());
    ?>
">
						<?php 
    echo h($post->title ? $post->title : '(' . substr($post->name, strlen('content/posts/')) . ')');
    ?>
					</a>
				</span>
				<span class="badge <?php 
    echo $comment->spam === true ? 'spam' : 'ham';
    ?>
">
					<?php 
    echo $comment->spam === true ? 'Spam' : 'Ham';
    ?>
				</span>
				<p class="excerpt">
					<?php 
    echo h(gb_strlimit($comment->textBody(), 300));
    ?>
				</p>
			</td>
		</tr>
	<?php 
}
?>
	</table>
</div>
<?php 
include '../_footer.php';
Exemple #3
0
					<?php 
        }
        ?>
					<?php 
        if (strpos($flags, st::UNTRACKED) !== false) {
            ?>
						<span class="badge <?php 
            echo st::UNTRACKED;
            ?>
">Untracked</span>
					<?php 
        }
        ?>
					<span class="excerpt">
						<?php 
        $s = h(gb_strlimit($post->textBody(), 80));
        echo $s ? ' – ' . $s : '';
        ?>
					</span>
				</td>
				<td class="author"><?php 
        echo h($post->author->shortName());
        ?>
</td>
				<td class="date modified type-number"><?php 
        echo h($post->modified->condensed());
        ?>
</td>
			</tr>
		<?php 
        # comment-out this to show parent (staged) versions below the dirty version