lecrackffm Posted November 7, 2017 Posted November 7, 2017 Hello, i am trying to integrate a manfiest file into my PW page. But it seems like file_get_contents is disabled somehow. <?php $manifest_path = 'path/to/manifest.json'; $hashes = json_decode(file_get_contents($manifest_path), TRUE); $css_hash = $hashes['main.css']; var_dump($css_hashe); // works only outside of of processwire. ?> whats the correct way to include a file like this into PW? Thanks for your help.
dragan Posted November 7, 2017 Posted November 7, 2017 Are you sure the path is correct? What if you omit true (i.e. don't just search in include-path) and use an absolute path? PW doesn't disable this function. If you're in devmode and/or have Tracy Debugger installed, you should see some hint why it's failing. 1 1
BitPoet Posted November 7, 2017 Posted November 7, 2017 Have you tried to use an absolute path like this? <?php $manifest_path = $config->paths->templates . 'path/to/manifest.json'; // ... 1
lecrackffm Posted November 7, 2017 Author Posted November 7, 2017 Ok, i feel really stupid now.. i had a typo while trying to use the absolute path before... ($config->path->templates) Thanks for your help.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now