Lajdák Marek
Lajdák Marek

Reputation: 3089

How get file contents via Filesystem Component in Symfony 4?

How can i get file contents via Symfony Filesystem component?

I was looked for copy and mirror methods - but they needs string as path as parameters...

In php is alternative, native function file_get_contents().

Is there some method to get content via component? Or i sohould use native php function?

Or something i can't see?

Upvotes: 5

Views: 7988

Answers (1)

Vladimir Tarkhanov
Vladimir Tarkhanov

Reputation: 140

The Filesystem component provides the ability to work with files, but not their contents. With this component you can create, delete, move and do some checks of filesystem. If you want read content just use a native php functions or other components.

Upvotes: 2

Related Questions