batch.php 1005 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. $pubPath = realpath(dirname(__FILE__));
  3. $appPath = realpath($pubPath . '/../app');
  4. $libPath = realpath($pubPath . '/../lib');
  5. $varPath = realpath($pubPath . '/../var');
  6. set_include_path(implode(PATH_SEPARATOR, array($appPath, $libPath, get_include_path())));
  7. if (isset($_SERVER['N2N_STAGE'])) {
  8. define('N2N_STAGE', $_SERVER['N2N_STAGE']);
  9. }
  10. // require __DIR__ . '/../vendor/autoload.php';
  11. require_once '../vendor/n2n/n2n/src/app/n2n/core/TypeLoader.php';
  12. n2n\core\TypeLoader::register(true,
  13. require __DIR__ . '/../vendor/composer/autoload_psr4.php',
  14. require __DIR__ . '/../vendor/composer/autoload_classmap.php');
  15. n2n\core\N2N::initialize($pubPath, $varPath, new n2n\core\FileN2nCache());
  16. n2n\core\N2N::autoInvokeBatchJobs();
  17. n2n\core\N2N::finalize();
  18. function test($value) {
  19. if (!n2n\core\N2N::isLiveStageOn()) {
  20. echo "\r\n<pre>\r\n";
  21. var_dump($value);
  22. if (is_scalar($value)) echo "\r\n";
  23. echo "</pre>\r\n";
  24. }
  25. }
  26. // n2n\core\N2N::getPdoPool()->getPdo()->getLogger()->dump();