26 define(
'PWD', getcwd());
28 if (!defined(
'STDIN')) {
29 define(
'STDIN', fopen(
'php://stdin',
'r'));
31 define(
'SESSION_DISABLE_INIT', 1);
32 require(
'./lib/pkp/includes/bootstrap.inc.php');
36 if (isset($_SERVER[
'argc'])) {
37 $argc = $_SERVER[
'argc'];
38 $argv = $_SERVER[
'argv'];
55 $request = $application->getRequest();
58 import(
'classes.core.PageRouter');
60 $router->setApplication($application);
61 $request->setRouter($router);
69 if (isset($_SERVER[
'SERVER_NAME'])) {
70 die(
'This script can only be executed from the command-line');
73 $this->scriptName = isset($this->argv[0]) ? array_shift($this->argv) :
'';
75 if (isset($this->argv[0]) && $this->argv[0] ==
'-h') {