code/LivePubHelper.php
public static function include_php($filename)
    {
        // set up default template paths if needed
        if (count(self::$template_path) == 0) {
            self::init_template_paths();
        }
        
        // check all the possible paths we've accumulated		
        $tpl = false;
        foreach (self::$template_path as $path) {
            $checkPath = $path . '/' . $filename . '.php';
            
            if (file_exists($checkPath)) {
                $tpl = $checkPath;
                break;
            }
        }

        if (!$tpl) {
            throw new Exception("Unable to locate PHP template: $filename (paths=".implode(':', self::$template_path).")");
        }
        
        // load it up
        if (self::is_publishing()) {
            //return file_get_contents($tpl);
            return '<?php include "' . $tpl . '"; ?>';
        } else {
            ob_start();
            include $tpl;
            $html = ob_get_contents();
            ob_end_clean();
            //return '<!-- php template -->' . $html . '<!-- end php template -->';
            return $html;
        }
    }
public static function include_php($filename)
    {
        // set up default template paths if needed
        if (count(self::$template_path) == 0) {
            self::init_template_paths();
        }
        
        // check all the possible paths we've accumulated		
        $tpl = false;
        foreach (self::$template_path as $path) {
            $checkPath = $path . '/' . $filename . '.php';
            
            if (file_exists($checkPath)) {
                $tpl = $checkPath;
                break;
            }
        }

        if (!$tpl) {
            throw new Exception("Unable to locate PHP template: $filename (paths=".implode(':', self::$template_path).")");
        }
        
        // load it up
        if (self::is_publishing()) {
            //return file_get_contents($tpl);
            return '<?php include "' . $tpl . '"; ?>';
        } else {
            ob_start();
            include $tpl;
            $html = ob_get_contents();
            ob_end_clean();
            //return '<!-- php template -->' . $html . '<!-- end php template -->';
            return $html;
        }
    }
loads a php template from the templates/php folder (allowing for themes)
returns either the result of executing the code, or the code itself,
depending on whether we're staticpublishing or not

@param string $filename
@throws Exception
@return string