/'; $fontSize = 14; /** * ================================================================= * MAIN * ================================================================= */ $processed = 1; $good = 0; $error = 0; $no_maches = 0; $files = glob($path . '*.svg'); print 'Processing ' . count($files) . ' files.'; print '
'; print ''; flush(); ob_flush(); foreach ($files as $filename) { print ''; print ''; print ''; print ''; print ''; print ''; print ''; flush(); ob_flush(); $processed++; } print '
' . $processed . '  ' . $filename . '  '; $fileContent = file_get_contents($filename); $count = null; preg_match_all($regexExpr, $fileContent, $matches); $textItems = $matches[0]; foreach($textItems as $item) { if (strpos($item, ' style') !== false) { $item_to_replace = str_replace('style="', 'style="font-size:' . $fontSize . '; ', $item); } else { $item_to_replace = str_replace('Ok'; $good++; } else { print 'Error'; $error++; } } else { print 'No matches'; $no_maches++; } print '
'; print '
'; print 'Done.
'; $processed--; print 'Processed: ' . $processed . '
'; print 'Patched: ' . $good . '
'; print 'Failed: ' . $error . '
'; print 'No matches: ' . $no_maches . '
'; flush(); ob_flush(); ?>