We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

S3 StreamWrapper

hi;

I registred S3 on StreamWrapper in my app, but this code not work: app/config/config.php

 'viewsDir'       => 's3://dev-phalcon/my-app/',

The screen remains blank, no errors, has anyone tried to save the views in AWS S3?

Sorry for the language barrier. Thank you.

edited Sep '18

Phalcon views are using require/file_get_contents, does plain-php require/file_get_contents even loads such a source? If not then what you expect?

Hi; It works normally:

echo file_get_contents('s3://dev-phalcon/my-app/index.phtml');

viewsDir as Stream not work...

IMO this is expected.

This should work:

$data = file_get_contents('s3://bucket/key');

Whilst:

 'viewsDir'       => 's3://dev-phalcon/my-app/',

does not work as views are loaded before your Amazon S3 stream wrapper gets registered.

Try to register S3 stream wrapper somewhere before you load views (in a loader or so).