PageRenderTime 45ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/tools/php/md5.php

https://github.com/dinotest/vanilla-test
PHP | 44 lines | 20 code | 6 blank | 18 comment | 6 complexity | 51aa7857362e31380e47d88d53da6b78 MD5 | raw file
Possible License(s): BSD-3-Clause, Apache-2.0
  1. <?
  2. /**
  3. * Description: Create vanilla files' md5 signatures;
  4. *
  5. *
  6. * Copyright 2008 Lussumo.com
  7. * This file is part of Lussumo's Software Library.
  8. * Lussumo's Software Library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
  9. * Lussumo's Software Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  10. * You should have received a copy of the GNU General Public License along with Vanilla; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  11. * The latest source code is available at www.lussumo.com
  12. * Contact Mark O'Sullivan at mark [at] lussumo [dot] com
  13. *
  14. * @author Damien Lenrun
  15. * @copyright 2008 Lussumo.com
  16. * @license http://lussumo.com/community/gpl.txt GPL 2
  17. * @package Framework
  18. * @version @@FRAMEWORK-VERSION@@
  19. */
  20. include_once 'framework/Framework.Class.IntegrityChecker.php';
  21. if (empty($argv[1])) {
  22. exit("Failed: Path to build folder required.");
  23. } else {
  24. $build = $argv[1];
  25. if (!is_dir($build)) {
  26. exit("Failed: The first argument should be a folder.");
  27. }
  28. if (!is_dir($build . '/appg')) {
  29. exit("Failed: Could not find the appg folder in the .");
  30. }
  31. }
  32. $Checker = new IntegrityChecker($build);
  33. $Result = $Checker->Save($build . '/appg/md5.csv');
  34. if (!$Result) {
  35. exit("Failed: Could not could not create the md5 signature.");
  36. } else {
  37. fwrite(STDOUT, "Signature created in $build/appg/md5.csv");
  38. }