-
Notifications
You must be signed in to change notification settings - Fork 2
Get text from docx files #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
👋 @bbrands02
|
src/Service/FileService.php
Outdated
| $tempFilePath = tempnam(sys_get_temp_dir(), 'docx'); | ||
| if ($tempFilePath === false) { | ||
| $this->logger->error('Failed to create a temporary file '.$file->getName()); | ||
| $this->style && $this->style->error('Failed to create a temporary file '.$file->getName()); | ||
| } | ||
|
|
||
| file_put_contents($tempFilePath, $base64Decoded); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you could consider moving this to a separate function, seems to me that this will happen more often.
src/Service/FileService.php
Outdated
| $text = null; | ||
| } | ||
| break; | ||
| case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be in favor of putting everything in a case in a separate function, although I could imagine only putting the contents of try in a separate function.
8514fdb to
b683fd7
Compare
No description provided.