Gets ProcessWire's API ready for use
상속: extends Wire
예제 #1
0
$wire = null;
/**
 * Build the ProcessWire configuration
 *
 */
$config = ProcessWireBootConfig();
/*
 * Load and execute ProcessWire
 *
 */
try {
    /*
     * Bootstrap ProcessWire's core and make the API available with $wire
     *
     */
    $wire = new ProcessWire($config);
    /*
     * Store the admin URL in the configuration
     *
     */
    if ($config->adminRootPageID) {
        $config->urls->admin = $wire->pages->get($config->adminRootPageID)->url;
    }
    /* 
     * If we're not being called from another shell script or PHP page, then run the PageView process
     *
     */
    if (isset($_SERVER['HTTP_HOST']) && realpath(__FILE__) == realpath($_SERVER['SCRIPT_FILENAME'])) {
        $process = $wire->modules->get("ProcessPageView");
        $wire->setFuel('process', $process);
        echo $process->execute();
예제 #2
0
$wire = null;
/**
 * Build the ProcessWire configuration
 *
 */
$config = ProcessWireBootConfig();
/*
 * Load and execute ProcessWire
 *
 */
try {
    /*
     * Bootstrap ProcessWire's core and make the API available with $wire or wire()
     *
     */
    $wire = new ProcessWire($config);
    $process = $wire->modules->get('ProcessPageView');
    $wire->wire('process', $process);
    echo $process->execute($internal);
    if ($internal) {
        $process->finished();
    }
} catch (Exception $e) {
    /*
     * Formulate error message and send to the error handler
     *
     */
    if ($process) {
        $process->failed($e);
    }
    $errorMessage = "Exception: " . $e->getMessage() . " (in " . $e->getFile() . " line " . $e->getLine() . ")";
예제 #3
0
$wire = null;
/**
 * Build the ProcessWire configuration
 *
 */
$config = ProcessWireBootConfig();
/*
 * Load and execute ProcessWire
 *
 */
try {
    /*
     * Bootstrap ProcessWire's core and make the API available with $wire or wire()
     *
     */
    $wire = new ProcessWire($config);
    $process = $wire->modules->get('ProcessPageView');
    $wire->wire('process', $process);
    echo $process->execute($internal);
    $internal ? $process->finished() : extract($wire->wire('all')->getArray());
} catch (Exception $e) {
    /*
     * Formulate error message and send to the error handler
     *
     */
    if ($process) {
        $process->failed($e);
    }
    $wire ? $wire->trackException($e) : $config->trackException($e);
    $errorMessage = "Exception: " . $e->getMessage() . " (in " . $e->getFile() . " line " . $e->getLine() . ")";
    if ($config->debug || $wire && $wire->user && $wire->user->isSuperuser()) {
예제 #4
0
$wire = null;
/**
 * Build the ProcessWire configuration
 *
 */
$config = ProcessWireBootConfig();
/*
 * Load and execute ProcessWire
 *
 */
try {
    /*
     * Bootstrap ProcessWire's core and make the API available with $wire or wire()
     *
     */
    $wire = new ProcessWire($config);
    $process = $wire->modules->get('ProcessPageView');
    $wire->wire('process', $process);
    echo $process->execute($internal);
    $internal ? $process->finished() : extract($wire->wire('all')->getArray());
} catch (Exception $e) {
    /*
     * Formulate error message and send to the error handler
     *
     */
    if ($process) {
        $process->failed($e);
    }
    $errorMessage = "Exception: " . $e->getMessage() . " (in " . $e->getFile() . " line " . $e->getLine() . ")";
    if ($config->debug || $wire && $wire->user && $wire->user->isSuperuser()) {
        $errorMessage .= "\n\n" . $e->getTraceAsString();