Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error logs #58

Closed
fahmi182 opened this issue Jul 13, 2014 · 7 comments
Closed

Error logs #58

fahmi182 opened this issue Jul 13, 2014 · 7 comments

Comments

@fahmi182
Copy link
Contributor

Mas Dan, kalau error logs ini maksudnya apa ya?

PHP Warning:  file_put_contents() [<a href='function.file-put-contents'>function.file-put-contents</a>]: 
Filename cannot be empty in /system/includes/dispatch.php on line 312
@Kanti
Copy link
Collaborator

Kanti commented Jul 16, 2014

@fahmi182 please describe the situation then this happened.

@fahmi182
Copy link
Contributor Author

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?

@Kanti
Copy link
Collaborator

Kanti commented Jul 16, 2014

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

@fahmi182
Copy link
Contributor Author

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

@ncang
Copy link

ncang commented Jul 16, 2014

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

@fahmi182
Copy link
Contributor Author

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

@Kanti
Copy link
Collaborator

Kanti commented Jul 17, 2014

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();
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants