GithubHelp home page GithubHelp logo

Error logs about htmly HOT 7 CLOSED

danpros avatar danpros commented on May 21, 2024
Error logs

from htmly.

Comments (7)

Kanti avatar Kanti commented on May 21, 2024

@fahmi182 please describe the situation then this happened.

from htmly.

fahmi182 avatar fahmi182 commented on May 21, 2024

Hello, sorry my previous use Indonesian.

Error.logs there after I update the latest version, and I use htmly with some modified :) . this http://www.defaka.com/
 
Do you know what this means?

from htmly.

Kanti avatar Kanti commented on May 21, 2024

I need more Information about the page you loaded. Which URL were you requesting?

from htmly.

fahmi182 avatar fahmi182 commented on May 21, 2024

i think admin page -- i have custom htmly :) here is http://www.defaka.com/sys/login

from htmly.

ncang avatar ncang commented on May 21, 2024

I think it's just because the cache file is not yet formed.

from htmly.

fahmi182 avatar fahmi182 commented on May 21, 2024
if(!login()) {
      if (!file_exists($cachefile)) {
        file_put_contents($cachefile, ob_get_contents());
      }
}

from htmly.

Kanti avatar Kanti commented on May 21, 2024

test this:

function render($view, $locals = null, $layout = null) {
    $login = login();
    if(!$login) {
        $c = str_replace('/', '#', str_replace('?', '~', $_SERVER['REQUEST_URI']));
        $dir = 'cache/page';
        $cachefile = $dir. '/' . $c . '.cache';
        if(is_dir($dir) === false) {
            mkdir($dir, 0777, true);
        }
    }

    if (is_array($locals) && count($locals)) {
        extract($locals, EXTR_SKIP);
    }

    if (($view_root = config('views.root')) == null)
        error(500, "[views.root] is not set");

    ob_start();
    include "{$view_root}/{$view}.html.php";
    content(trim(ob_get_clean()));

    if ($layout !== false) {

        if ($layout == null) {
            $layout = config('views.layout');
            $layout = ($layout == null) ? 'layout' : $layout;
        }

        $layout = "{$view_root}/{$layout}.html.php";

        header('Content-type: text/html; charset=utf-8');

        ob_start();
        require $layout;

        if(!$login) {
            if (!file_exists($cachefile)) {
                file_put_contents($cachefile, ob_get_contents());
        }
    }

    echo trim(ob_get_clean());
    } else {
        echo content();
    }
}

from htmly.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.