-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
bugSomething isn't workingSomething isn't working
Description
| Q | A |
|---|---|
| Bug report? | yes |
| Feature request? | no |
| BC Break report? | no |
| RFC? | no |
If you're dealing with hundreds/thousands of asset documents (PDF), the asset method getLocalFile will fail ([PHP Warning: exec() unable to fork because a lot of resource streams will be processed.
Lines 59 to 60 in 5fd373a
| $cmd = sprintf('%s "%s" "%s"', $verboseCommand, $data->getLocalFile(), $tmpFile); | |
| exec($pdfToTextBin . ' ' . $cmd); |
Fetching the full path like in the example below could be a solution, but it won't work if the assets are stored on an asset storage server for example.
$tmpFile = sprintf('%s%s%s.text', $assetTmpDir, DIRECTORY_SEPARATOR, uniqid('t2p-', false));
$verboseCommand = !\Pimcore::inDebugMode() ? '-q' : '';
$cmd = sprintf('%s "%s/public/var/assets%s" "%s"', $verboseCommand, $this->projectDir, $data->getRealFullPath(), $tmpFile);
try {
exec($pdfToTextBin . ' ' . $cmd);
} catch (\Exception $e) {
return null;
}Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working