当前位置: 首页>>代码示例>>PHP>>正文


PHP eZExecution::cleanExit方法代码示例

本文整理汇总了PHP中eZExecution::cleanExit方法的典型用法代码示例。如果您正苦于以下问题:PHP eZExecution::cleanExit方法的具体用法?PHP eZExecution::cleanExit怎么用?PHP eZExecution::cleanExit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eZExecution的用法示例。


在下文中一共展示了eZExecution::cleanExit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: redirectToErrorPage

    public static function redirectToErrorPage()
    {
        $acessErrorPage = '/page/gift-law';

        header( 'Location: ' . $acessErrorPage );
        eZExecution::cleanExit();
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:7,代码来源:externallinkhandlerclinicalkeys.php

示例2: run

 /**
  *
  * Builds the response-data.
  *
  * @return mixed|void
  *
  */
 public function run()
 {
     $content = $this->content;
     $status = $this->options['status'];
     $options = $this->options;
     // Give response header for status code
     header('HTTP/1.1 ' . $status . ' ' . $this->codes[$status]);
     switch ($options['type']) {
         case 'json':
             $options['headers'] += array('Content-type' => 'application/json');
             $this->headers($options['headers']);
             echo json_encode($content);
             break;
         case 'jsonEncoded':
             $options['headers'] += array('Content-type' => 'application/json');
             $this->headers($options['headers']);
             return compact('content');
         case 'tpl':
             /** Default pagelayout. */
             $options += array('pagelayout' => 'pagelayout.tpl');
             return $this->renderTpl($content, $options);
         case 'text':
             return array('pagelayout' => false, 'content' => $this->content);
         case 'xml':
             $options['headers'] += array('Content-type' => 'text/xml');
             $this->headers($options['headers']);
             echo $content;
             break;
     }
     Router::handleEZXFormToken(true);
     return \eZExecution::cleanExit();
 }
开发者ID:keyteqlabs,项目名称:ezote,代码行数:39,代码来源:Response.php

示例3: handleFileDownload

 function handleFileDownload($contentObject, $contentObjectAttribute, $type, $fileInfo)
 {
     $fileName = $fileInfo['filepath'];
     $file = eZClusterFileHandler::instance($fileName);
     if ($fileName != "" and $file->exists()) {
         $fileSize = $file->size();
         if (isset($_SERVER['HTTP_RANGE']) && preg_match("/^bytes=(\\d+)-(\\d+)?\$/", trim($_SERVER['HTTP_RANGE']), $matches)) {
             $fileOffset = $matches[1];
             $contentLength = isset($matches[2]) ? $matches[2] - $matches[1] + 1 : $fileSize - $matches[1];
         } else {
             $fileOffset = 0;
             $contentLength = $fileSize;
         }
         // Figure out the time of last modification of the file right way to get the file mtime ... the
         $fileModificationTime = $file->mtime();
         // stop output buffering, and stop the session so that browsing can be continued while downloading
         eZSession::stop();
         ob_end_clean();
         eZFile::downloadHeaders($fileName, self::dispositionType($fileInfo['mime_type']) === 'attachment', false, $fileOffset, $contentLength, $fileSize);
         try {
             $file->passthrough($fileOffset, $contentLength);
         } catch (eZClusterFileHandlerNotFoundException $e) {
             eZDebug::writeError($e->getMessage, __METHOD__);
             header($_SERVER["SERVER_PROTOCOL"] . ' 500 Internal Server Error');
         } catch (eZClusterFileHandlerGeneralException $e) {
             eZDebug::writeError($e->getMessage, __METHOD__);
             header($_SERVER["SERVER_PROTOCOL"] . ' 404 Not Found');
         }
         eZExecution::cleanExit();
     }
     return eZBinaryFileHandler::RESULT_UNAVAILABLE;
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:32,代码来源:ezfilepassthroughhandler.php

示例4: create

 /**
  * Creates a new test database
  *
  * @param ezpDsn $dsn
  * @param array $sqlFiles array( array( string => string ) )
  * @param bool $removeExisting
  * @return mixed
  */
 public static function create(ezpDsn $dsn)
 {
     //oracle unit test doesn't support creating database, just use database string
     if ($dsn->parts['phptype'] === 'oracle') {
         $db = ezpDatabaseHelper::useDatabase($dsn);
         eZDBTool::cleanup($db);
         return $db;
     }
     $dsnRoot = clone $dsn;
     $dsnRoot->parts['database'] = null;
     try {
         $dbRoot = ezpDatabaseHelper::dbAsRootInstance($dsnRoot);
         if (!$dbRoot->IsConnected) {
             throw new Exception($dbRoot->ErrorMessage);
         }
     } catch (Exception $e) {
         echo $e->getMessage() . PHP_EOL;
         eZExecution::cleanExit();
     }
     if (self::exists($dbRoot, $dsn->database)) {
         $db = ezpDatabaseHelper::useDatabase($dsn);
         self::clean($db);
     } else {
         $dbRoot->createDatabase($dsn->database);
         $db = ezpDatabaseHelper::useDatabase($dsn);
     }
     return $db;
 }
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:36,代码来源:ezptestdatabasehelper.php

示例5: fill

    /**
     * @param string $clusterIdentifier
     * @throws eZDBException
     */
    public static function fill($clusterIdentifier)
    {
        $configPath = "extension/ezoscar/bin/php/seo/config.json";
        $cli = eZCLI::instance();

        $config = file_get_contents($configPath);
        if(!$config)
        {
            $cli->output("Bad filepath for config file");
            eZExecution::cleanExit();
        }

        $config = json_decode($config, true);

        $db = MMDB::instance();

        $rows = $db->arrayQuery(sprintf("SELECT * FROM mm_seo WHERE cluster_identifier = '%s'", $clusterIdentifier));
        $progressBar = new ezcConsoleProgressbar( new ezcConsoleOutput(), count($rows), array(
            'emptyChar' => ' ',
            'barChar'   => '='
        ) );
        $progressBar->start();

        foreach($rows as $row)
        {
            if(!array_key_exists($clusterIdentifier, $config))
            {
                continue;
            }

            $fq = $config[$clusterIdentifier][$row["application_identifier"]]["filters"];

            $solrBase = new eZSolrBase();
            $params = array(
                'indent'       => 'on',
                'q'            => '"'.$row['keyword'].'"',
                'fq'           => $fq,
                'start'        => 0,
                'rows'         => 0,
                'fl'           => '',
                'qt'           => 'ezpublish',
                'explainOther' => '',
                'hl.fl'        => '',
            );

            $results = $solrBase->rawSolrRequest('/select', $params);
            $num_found = $results['response']['numFound'];
            $db->query(sprintf("UPDATE mm_seo SET nb_results=%d, speciality_url='%s', keyword_url='%s' WHERE id=%d",
                $num_found,
                self::sanitize($row["speciality"]),
                self::sanitize($row["keyword"]),
                $row["id"]));

            $progressBar->advance();
        }
        $progressBar->finish();
        $cli->output();
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:62,代码来源:seoTools.php

示例6: exitError

function exitError($msg = false)
{
    $erroMsg = 'Newsletter image error ' . $_SERVER['REQUEST_URI'];
    if ($msg)
    {
        $erroMsg .= "\n$msg";
    }
    eZDebug::writeError( $erroMsg );
    header('HTTP/1.0 404 Not Found');
    eZExecution::cleanExit();
}
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:11,代码来源:image.php

示例7: contentBuildResult

    public function contentBuildResult()
    {
        $errorCode = empty( $this->errorCode ) ? '500' : $this->errorCode;
        $errorCodeList = HttpTool::$statusReason;

        $errorCodeKey   = array_key_exists( $errorCode, $errorCodeList ) ? $errorCode : '500';
        $errorMsg       = $errorCode . ' ' . $errorCodeList[$errorCodeKey];

        header( "HTTP/1.1 $errorMsg" );
        header( "Status: $errorMsg" );
        echo "ERROR: $errorMsg";

        eZExecution::cleanExit();
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:14,代码来源:applicationHttpError.php

示例8: exitWithInternalError

function exitWithInternalError( $errorText )
{
    header( $_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error' );
    //include_once( 'extension/ezjscore/classes/ezjscajaxcontent.php' );
    $contentType = ezjscAjaxContent::getHttpAccept();

    // set headers
    if ( $contentType === 'xml' )
        header('Content-Type: text/xml; charset=utf-8');
    else if ( $contentType === 'json' )
        header('Content-Type: text/javascript; charset=utf-8');

    echo ezjscAjaxContent::autoEncode( array( 'error_text' => $errorText, 'content' => '' ), $contentType );
    eZExecution::cleanExit();
}
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:15,代码来源:run.php

示例9: modify

 function modify($tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters)
 {
     $redirectUri = $namedParameters['url'];
     // if $redirectUri is not starting with scheme://
     if (!preg_match('#^\\w+://#', $redirectUri)) {
         // path to eZ Publish index
         $indexDir = eZSys::indexDir();
         /* We need to make sure we have one
            and only one slash at the concatenation point
            between $indexDir and $redirectUri. */
         $redirectUri = rtrim($indexDir, '/') . '/' . ltrim($redirectUri, '/');
     }
     // Redirect to $redirectUri by returning status code 301 and exit.
     eZHTTPTool::redirect($redirectUri, array(), 301);
     eZExecution::cleanExit();
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:16,代码来源:redirectoperator.php

示例10: downloadFile

/**
 * Passthrough file, and exit cleanly
*/
function downloadFile($filePath)
{
    if (!file_exists($filePath)) {
        header("HTTP/1.1 404 Not Found");
        eZExecution::cleanExit();
    }
    ob_clean();
    header("Pragma: public");
    header("Expires: 0");
    // set expiration time
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
    header("Content-Type: application/force-download");
    header("Content-Type: application/octet-stream");
    header("Content-Type: application/download");
    header("Content-Disposition: attachment; filename=" . basename($filePath));
    header("Content-Transfer-Encoding: binary");
    header("Content-Length: " . filesize($filePath));
    ob_end_clean();
    @readfile($filePath);
    eZExecution::cleanExit();
}
开发者ID:heliopsis,项目名称:cjw_newsletter,代码行数:24,代码来源:mailbox_item_view.php

示例11: templateOperatorDownload

function templateOperatorDownload($tpl, &$persistentData, $stepData)
{
    $singleOperator = $persistentData['single-operator'];
    $useInput = $persistentData['use-input'];
    $useOutput = $persistentData['use-output'];
    $parameterCheck = $persistentData['parameter-check'];
    $useInput = true;
    $useOutput = false;
    $parameterCheck = 2;
    $operatorName = $persistentData['name'];
    $className = $persistentData['class-name'];
    if (!$className) {
        $fullClassName = 'Template' . strtoupper($operatorName[0]) . substr($operatorName, 1) . 'Operator';
    } else {
        $fullClassName = $className;
    }
    $filename = strtolower($fullClassName) . '.php';
    $description = $persistentData['description'];
    $creator = $persistentData['creator-name'];
    $example = $persistentData['example-code'];
    $brief = '';
    $full = '';
    $lines = explode("\n", $description);
    if (count($lines) > 0) {
        $brief = $lines[0];
        $full = implode("\n", array_slice($lines, 1));
    }
    $tpl->setVariable('full_class_name', $fullClassName);
    $tpl->setVariable('class_name', $className);
    $tpl->setVariable('file_name', $filename);
    $tpl->setVariable('operator_name', $operatorName);
    $tpl->setVariable('example_code', $example);
    $tpl->setVariable('creator_name', $creator);
    $tpl->setVariable('description_brief', $brief);
    $tpl->setVariable('description_full', $full);
    $tpl->setVariable('single_operator', $singleOperator);
    $tpl->setVariable('use_input', $useInput);
    $tpl->setVariable('use_output', $useOutput);
    $tpl->setVariable('parameter_check', $parameterCheck);
    $content = $tpl->fetch('design:setup/templateoperator_code.tpl');
    $contentLength = strlen($content);
    $mimeType = 'application/octet-stream';
    $version = eZPublishSDK::version();
    header("Pragma: ");
    header("Cache-Control: ");
    header("Content-Length: {$contentLength}");
    header("Content-Type: {$mimeType}");
    header("X-Powered-By: eZ Publish {$version}");
    header("Content-Disposition: attachment; filename={$filename}");
    header("Content-Transfer-Encoding: binary");
    ob_end_clean();
    print $content;
    fflush();
    eZExecution::cleanExit();
}
开发者ID:runelangseid,项目名称:ezpublish,代码行数:55,代码来源:templateoperator.php

示例12: download

 /**
  * Prepares a file for Download and terminates the execution.
  * This method will:
  * - empty the output buffer
  * - stop buffering
  * - stop the active session (in order to allow concurrent browsing while downloading)
  *
  * @param string $file Path to the local file
  * @param bool $isAttachedDownload Determines weather to download the file as an attachment ( download popup box ) or not.
  * @param string $overrideFilename
  * @param int $startOffset Offset to start transfer from, in bytes
  * @param int $length Data size to transfer
  *
  * @return bool false if error
  */
 static function download($file, $isAttachedDownload = true, $overrideFilename = false, $startOffset = 0, $length = false)
 {
     if (!file_exists($file)) {
         return false;
     }
     ob_end_clean();
     eZSession::stop();
     self::downloadHeaders($file, $isAttachedDownload, $overrideFilename, $startOffset, $length);
     self::downloadContent($file, $startOffset, $length);
     eZExecution::cleanExit();
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:26,代码来源:ezfile.php

示例13: response

/**
 * oAuth2 response handler function. Terminates execution after sending the headers.
 *
 * @param string $httpHeader The HTTP header to be sent as a response
 * @param string $location The location to redirect to. No redirection is done if not provided.
 *
 * @return void
 */
function response($httpHeader, $location = null)
{
    header("HTTP/1.1 {$httpHeader}");
    if ($location !== null) {
        // debug stuff: echo "header( \"Location: $location\" );\n";
        header("Location: {$location}");
    }
    eZExecution::cleanExit();
}
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:17,代码来源:authorize.php

示例14: throwError

 /**
  * Throws an error message back to the user. This will stop all execution.
  *
  * @param {String} $str Message to send back to user.
  */
 function throwError($str)
 {
     echo '{"result":null,"id":null,"error":{"errstr":"' . addslashes($str) . '","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}';
     eZDB::checkTransactionCounter();
     eZExecution::cleanExit();
 }
开发者ID:patrickallaert,项目名称:ezpublish-legacy-php7,代码行数:11,代码来源:SpellChecker.php

示例15: download

 static function download($file, $isAttachedDownload = true, $overrideFilename = false)
 {
     if (file_exists($file)) {
         $mimeinfo = eZMimeType::findByURL($file);
         ob_clean();
         header('X-Powered-By: eZ Publish');
         header('Content-Length: ' . filesize($file));
         header('Content-Type: ' . $mimeinfo['name']);
         // Fixes problems with IE when opening a file directly
         header("Pragma: ");
         header("Cache-Control: ");
         /* Set cache time out to 10 minutes, this should be good enough to work
            around an IE bug */
         header("Expires: " . gmdate('D, d M Y H:i:s', time() + 600) . ' GMT');
         if ($overrideFilename) {
             $mimeinfo['filename'] = $overrideFilename;
         }
         if ($isAttachedDownload) {
             header('Content-Disposition: attachment; filename=' . $mimeinfo['filename']);
         } else {
             header('Content-Disposition: inline; filename=' . $mimeinfo['filename']);
         }
         header('Content-Transfer-Encoding: binary');
         header('Accept-Ranges: bytes');
         ob_end_clean();
         @readfile($file);
         eZExecution::cleanExit();
     } else {
         return false;
     }
 }
开发者ID:runelangseid,项目名称:ezpublish,代码行数:31,代码来源:ezfile.php


注:本文中的eZExecution::cleanExit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。