S
S
Sergey Korenevsky2015-11-17 17:12:44
PHP
Sergey Korenevsky, 2015-11-17 17:12:44

How to find files in a folder that do NOT contain text?

How to find files in a folder that do not contain access-blocking text?
those. you need to find files in all files with the PHP extension that do not contain the text "defined( '_JEXEC' )"
A simple Windows application is needed

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel Shorokhov, 2015-11-17
@Dier_Sergio_Great

You can try like this:

$files = null;
$status = null;
exec('grep -rL "defined(\'_JEXEC\')" /path/to/directory', $files, $status);

Then in $files you will get an array of relative paths to the required files.
Don't forget to check that $status === 0 after execution, that means the command ran successfully.
You can insert your path instead of /path/to/directory.

S
s0ci0pat, 2015-11-17
@s0ci0pat

Find which contain and exclude them from the list of all files.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question