PageRenderTime 57ms CodeModel.GetById 33ms RepoModel.GetById 0ms app.codeStats 0ms

/build.php

http://github.com/collegeman/coreylib
PHP | 55 lines | 12 code | 8 blank | 35 comment | 0 complexity | d78a175f10ef293272dd809b6b890810 MD5 | raw file
Possible License(s): LGPL-2.1
  1. <?php
  2. /**
  3. * Build coreylib.php from the files in src/
  4. */
  5. // use the require() statements in src/coreylib.php to build the library.
  6. $make = file_get_contents('src/coreylib.php');
  7. preg_match_all('/require\(\'(.*)\'\);/', $make, $matches);
  8. ob_start();
  9. echo "<?php
  10. /*
  11. Plugin Name: coreylib
  12. Plugin URI: http://github.com/collegeman/coreylib
  13. Description: A small PHP library for downloading, caching, and extracting data formatted as XML or JSON
  14. Version: 2.0
  15. Author: Aaron Collegeman
  16. Author URI: http://github.com/collegeman
  17. License: GPL2
  18. */
  19. /**
  20. * coreylib
  21. * Parse and cache XML and JSON.
  22. * @author Aaron Collegeman aaron@collegeman.net
  23. * @version 2.0
  24. *
  25. * Copyright (C)2008-2010 Fat Panda LLC.
  26. *
  27. * This program is free software; you can redistribute it and/or modify
  28. * it under the terms of the GNU General Public License as published by
  29. * the Free Software Foundation; either version 2 of the License, or
  30. * (at your option) any later version.
  31. *
  32. * This program is distributed in the hope that it will be useful,
  33. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  34. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  35. * GNU General Public License for more details.
  36. *
  37. * You should have received a copy of the GNU General Public License along
  38. * with this program; if not, write to the Free Software Foundation, Inc.,
  39. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  40. */
  41. ";
  42. foreach($matches[1] as $file) {
  43. echo "// src/{$file}\n";
  44. echo preg_replace('/^<\?php/i', "\n", file_get_contents("src/{$file}"));
  45. echo "\n";
  46. }
  47. file_put_contents('coreylib.php', ob_get_clean());