Questions tagged [symfony-finder]

Component of the Symfony2 PHP Framework. Finds files and directories via an intuitive fluent interface.

Component of the Symfony2 PHP Framework. Finds files and directories via an intuitive fluent interface.

The Finder is part of the Symfony full-stack framework, but it can also be used standalone even if you don't use the framework as they don't have any mandatory dependencies.

See Also:

Symfony2 Finder Component

Symfony2 Components

12 questions
7
votes
5 answers

Why I can't get Symfony Finder like a service?

I use Symfony Standard Edition and try to get Symfony Finder component like a service, but not found it. To use the Finder, I need to create it manually like: $finder = new Symfony\Component\Finder\Finder(); Why I can't get it from service…
7
votes
1 answer

Symfony Finder ignores files beginning by dot

I am using the Finder for sending spooled e-mails, but automatic name generator puts dots in the filename and sometimes they appear at the beginning of the file. It seems that the finder can't get files with that name - well those files are…
Jarda
  • 566
  • 1
  • 9
  • 33
6
votes
1 answer

Symfony Finder exclude with glob

I am trying to run PHP CS Fixer, which I believe is based on Symfony (which I am not familiar with), and having a problem with excluding some paths. My setup is below: $finder = PhpCsFixer\Finder::create() ->in(__DIR__) …
Dayo
  • 12,413
  • 5
  • 52
  • 67
6
votes
3 answers

How can I sort files by DESC order with Symfony Finder Component?

By default Symfony Finder Component sorts files by ASC order. //sorting by ASC order $finder->files()->in($this->getDumpPath())->sortByModifiedTime(); How can I sort files by DESC?
Victor Bocharsky
  • 11,930
  • 13
  • 58
  • 91
2
votes
1 answer

Symfony2 - Finder Component

I want to find specific texts in some files in a directory. I tried using Symfony Finder Component, but couldn't get the result. Here is my code below. $finder = new Finder(); $finder->in('./sample')->files()->contains('This is test'); The files…
1
vote
1 answer

Exception when directory does not exist

The issue is that if watching multiple directories via the Finder class. If one does not exist, the Finder will throw an exception and the fixer will die. $finder = Finder::create() ->in([ __DIR__ . '/web/app/mu-plugins/ys-*', …
ruckie
  • 149
  • 14
1
vote
1 answer

What is the default order of file elements in Symfony finder?

The following code returns different results in two environments (which however were supposed to be as close to one another as possible: the same PHP version, etc.) The /var/www/html/project/vendor/package/path/to/some/folder directory contains…
1
vote
2 answers

Symfony-Finder cant open dir

I try to read the dir and wanna get the last files from the current date. When I put the url in the browser I got a result of all the files, which are in the ftp-directory. So I have the proof, that the ftp-connectionparameter still works. When I…
user2632918
1
vote
1 answer

Exclude directories by missing file with Symfony Finder

Is there a way to exclude folders missing some files? E.g. I have folders like: FolderA aaa.php bbb.php ccc.php FolderB aaa.php bbb.php ccc.php FolderC aaa.php FolderD aaa.php bbb.php ccc.php I only want…
Dwza
  • 6,494
  • 6
  • 41
  • 73
1
vote
1 answer

Symfony Finder : How to sort files by size?

The Finder Symfony component is powerful, but unfortunately, you cannot sort founded files by size. See below. I think it could be helpful, for me at least.
BntMrx
  • 2,187
  • 3
  • 18
  • 29
0
votes
0 answers

Why is the inline version not throwing an exception?

I am using the symfony2/finder component to access an Amazon S3 bucket via the stream wrapper of the aws/aws-sdk-php. I was upgrading the finder component from 2.7.4 to its latest 2.7.25 version (2.7.25) via: composer require…
k0pernikus
  • 60,309
  • 67
  • 216
  • 347
0
votes
1 answer

assigning symfony2 finder class data to array

I am working with Symfony 2.6 and the application has an icons directory inside web directly. In icons directory user uploads set of icons. I need to display names of those icons in a dropdown menu on a form that the twig will display I know how…
Shairyar
  • 3,268
  • 7
  • 46
  • 86