Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezwordparser.php
Go to the documentation of this file.
1 <?php
18 class eZWordParser
19 {
20 function parseFile( $fileName )
21 {
22 $binaryINI = eZINI::instance( 'binaryfile.ini' );
23
24 $textExtractionTool = $binaryINI->variable( 'WordHandlerSettings', 'TextExtractionTool' );
25
26 $tmpName = "var/cache/" . md5( time() ) . '.txt';
27 $handle = fopen( $tmpName, "w" );
28 fclose( $handle );
29
30 $perm = octdec( eZINI::instance()->variable( 'FileSettings', 'StorageFilePermissions' ) );
31 chmod( $tmpName, $perm );
32
33 exec( "$textExtractionTool $fileName > $tmpName", $ret );
34
35 $metaData = "";
36 if ( file_exists( $tmpName ) )
37 {
38 $fp = fopen( $tmpName, "r" );
39 $metaData = fread( $fp, filesize( $tmpName ) );
40 $metaData = strip_tags( $metaData );
41 fclose( $fp );
42 unlink( $tmpName );
43 }
44
45 return $metaData;
46 }
47 }
48
49 ?>
eZWordParser
The class eZWordParser handles parsing of Word files and returns the metadata.
Definition: ezwordparser.php:19
eZWordParser\parseFile
parseFile( $fileName)
Definition: ezwordparser.php:20
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.