pens_server_test.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * This file is part of php-pens.
  4. *
  5. * php-pens is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * php-pens is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with php-pens. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /**
  19. * Provides a test implementation of a PENS Server.
  20. *
  21. * @author Guillaume Viguier-Just <guillaume@viguierjust.com>
  22. * @licence http://www.gnu.org/licenses/gpl.txt
  23. */
  24. require_once __DIR__ . '/pens.php';
  25. class MyPackageHandler extends PENSPackageHandler {
  26. public function processPackage($request, $path_to_package) {
  27. // Do the package processing here
  28. }
  29. }
  30. $handler = new MyPackageHandler();
  31. $handler->setSupportedPackageTypes(array("scorm-pif", "ims-qti", "aicc-pkg"));
  32. $handler->setSupportedPackageFormats(array("zip"));
  33. $server = PENSServer::singleton();
  34. $server->setPackageHandler($handler);
  35. $server->receiveCollect();