Skip to content

Instantly share code, notes, and snippets.

@armetiz
Created December 7, 2012 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save armetiz/4232372 to your computer and use it in GitHub Desktop.
Save armetiz/4232372 to your computer and use it in GitHub Desktop.
Use file_get_contents instead of SplFileObject::fpassthru()
<?php
require 'vendor/autoload.php';
ini_set('memory_limit', '500M');
use Symfony\Component\Finder\Finder;
$finder = new Finder();
$finder->files()
->in(__DIR__ . "/../")
->name("access_proxy_log*");
$patternPodcast = "/podcasts/";
foreach ($finder as $file) {
$contents = $file->getContents();
preg_match_all($patternPodcast, $contents, $matches);
unset($contents);
unset($matches);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment