PHPExcel
[ class tree: PHPExcel ] [ index: PHPExcel ] [ all elements ]

Source for file download.php

Documentation is available at download.php

  1. <?php
  2. /**
  3. * Script to create REGRESS package for download
  4. *
  5. @author Mike Bommarito
  6. @author Paul Meagher
  7. @version 0.3
  8. @modified Apr 2, 2006
  9. *
  10. *  Note: Script requires the PEAR Archive_Tar package be installed:
  11. *
  12. @see http://pear.php.net/package/Archive_Tar
  13. */
  14.  
  15. // name and directory of package
  16. $pkgName   "JAMA";
  17.  
  18. // root of PHP/Math build directory
  19. $buildDir  substr(dirname(__FILE__)0-strlen($pkgName));
  20.  
  21. // switch to PHP/Math build directory
  22. chdir($buildDir);
  23.  
  24. $tarName "$pkgName.tar.gz";  
  25.  
  26. $tarPath $buildDir.$pkgName."/downloads/".$tarName;
  27.  
  28. if($_GET['op'== "download"{  
  29.   
  30.     require_once('Archive/Tar.php');  
  31.     
  32.     $tar   new Archive_Tar($tarPath);
  33.  
  34.   // create $pkgName archive under $pkgName folder
  35.   $files glob("$pkgName/*.php");
  36.   $files array_merge($filesglob("$pkgName/*.TXT"));
  37.   $files array_merge($filesglob("$pkgName/docs/*.php"));
  38.   $files array_merge($filesglob("$pkgName/docs/includes/*.php"));
  39.   $files array_merge($filesglob("$pkgName/examples/*.php"));
  40.   $files array_merge($filesglob("$pkgName/tests/*.php"));  
  41.   $files array_merge($filesglob("$pkgName/utils/*.php"));    
  42.   
  43.     $tar->create($files);
  44.         
  45.     // create the download url
  46.   $webDir  substr($_SERVER['PHP_SELF']0-18);
  47.   $urlPath "http://".$_SERVER['HTTP_HOST'].$webDir."/downloads";
  48.   
  49.   // redirect to download url
  50.     header("Location: $urlPath/$tarName");
  51.  
  52. }
  53.  
  54. include_once "includes/header.php";
  55. include_once "includes/navbar.php";
  56. ?>
  57. <p>
  58. Download current version: 
  59. </p>
  60. <ul>
  61.  <li><a href='<?php echo $_SERVER['PHP_SELF']."?op=download"?>'><?php echo $tarName ?></a></li>
  62. </ul>
  63. <?php
  64. include_once "includes/footer.php";
  65. ?>

Documentation generated on Sat, 19 May 2012 14:33:57 +0200 by phpDocumentor 1.4.4