Skip to content

Stdlib: file_get_contents and readfile for templates/assets #62

Description

@PurHur

Problem

No file I/O builtins. Web apps read HTML templates and config files.

Goal

Read-only file access safe for compiled binaries.

Tasks

  • file_get_contents(string $path): string — VM + JIT
  • readfile for streaming static assets (optional)
  • Path restrictions: compile-time constant paths preferred; document sandbox limits for AOT
  • PHPT with fixture file in test/fixtures/

Security

Document that AOT binaries embed filesystem access—deploy carefully.

Acceptance criteria

echo file_get_contents(__DIR__.'/template.html'); works when file exists beside script.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions