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


PHP eZDB::checkTransactionCounter方法代码示例

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


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

示例1: eZDateTime

        $scriptFile = $scriptDirectory . '/' . $cronScript;
        if (file_exists($scriptFile)) {
            break;
        }
    }
    if (file_exists($scriptFile)) {
        if ($index > 0) {
            $cli->output();
        }
        if (!$isQuiet) {
            $startTime = new eZDateTime();
            $cli->output('Running ' . $cli->stylize('emphasize', $scriptFile) . ' at: ' . $startTime->toString(true));
        }
        eZDebug::addTimingPoint("Script {$scriptFile} starting");
        eZRunCronjobs::runScript($cli, $scriptFile);
        eZDebug::addTimingPoint("Script {$scriptFile} done");
        ++$index;
        // The transaction check
        $transactionCounterCheck = eZDB::checkTransactionCounter();
        if (isset($transactionCounterCheck['error'])) {
            $cli->error($transactionCounterCheck['error']);
        }
        if (!$isQuiet) {
            $endTime = new eZDateTime();
            $cli->output('Completing ' . $cli->stylize('emphasize', $scriptFile) . ' at: ' . $endTime->toString(true));
            $elapsedTime = new eZTime($endTime->timeStamp() - $startTime->timeStamp());
            $cli->output('Elapsed time: ' . sprintf('%02d:%02d:%02d', $elapsedTime->hour(), $elapsedTime->minute(), $elapsedTime->second()));
        }
    }
}
$script->shutdown();
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:31,代码来源:runcronjobs.php

示例2: multipleezjscServerCalls

function multipleezjscServerCalls($calls, $contentType = 'json')
{
    $r = array();
    foreach ($calls as $key => $call) {
        $response = array('error_text' => '', 'content' => '');
        if ($call instanceof ezjscServerRouter) {
            try {
                $response['content'] = $call->call();
            } catch (Exception $e) {
                $response['error_text'] = $e->getMessage();
            }
        } else {
            $response['error_text'] = 'Not a valid ezjscServerRouter argument: "' . htmlentities($call, ENT_QUOTES) . '"';
        }
        $r[] = ezjscAjaxContent::autoEncode($response, $contentType);
    }
    return $r;
}
if ($debugOutput && ($contentType === 'xml' || $contentType === 'xhtml')) {
    echo "<!--\r\n";
    eZDebug::printReport(false, false);
    echo "\r\n-->";
} else {
    if ($debugOutput && $contentType === 'json') {
        echo "/*\r\n";
        eZDebug::printReport(false, false);
        echo "\r\n*/";
    }
}
eZDB::checkTransactionCounter();
eZExecution::cleanExit();
开发者ID:legende91,项目名称:ez,代码行数:31,代码来源:call.php

示例3: redirectTo

 /**
  * Sets the module to redirect at the end of the execution
  *
  * @param string $uri the URI to redirect to
  *
  * @see setRedirectURI(), setExitStatus()
  *
  * @return void
  */
 function redirectTo($uri)
 {
     $originalURI = $uri;
     $uri = preg_replace("#(^.*)(/+)\$#", "\$1", $uri);
     if (strlen($originalURI) != 0 and strlen($uri) == 0) {
         $uri = '/';
     }
     $urlComponents = parse_url($uri);
     // eZSys::hostname() can contain port if present.
     // So parsing it with parse_url() as well to only get host.
     $currentHostname = eZSys::hostname();
     $currentHostnameParsed = parse_url($currentHostname, PHP_URL_HOST);
     $currentHostname = $currentHostnameParsed ? $currentHostnameParsed : $currentHostname;
     if (isset($urlComponents['host']) && $urlComponents['host'] !== $currentHostname) {
         $allowedHosts = $this->getAllowedRedirectHosts();
         if (!isset($allowedHosts[$urlComponents['host']])) {
             // Non-authorized host, return only the URI (without host) + query string and fragment if present.
             eZDebug::writeError("Redirection requested on non-authorized host '{$urlComponents['host']}'");
             header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden');
             echo "Redirection requested on non-authorized host";
             eZDB::checkTransactionCounter();
             eZExecution::cleanExit();
         }
     }
     $this->RedirectURI = $uri;
     $this->setExitStatus(self::STATUS_REDIRECT);
 }
开发者ID:patrickallaert,项目名称:ezpublish-legacy-php7,代码行数:36,代码来源:ezmodule.php

示例4: shutdown

 function shutdown($exitCode = false, $exitText = false)
 {
     $cli = eZCLI::instance();
     if (class_exists('eZDB') and eZDB::hasInstance()) {
         $db = eZDB::instance(false, array('show_errors' => false));
         // Perform transaction check
         $transactionCounterCheck = eZDB::checkTransactionCounter();
         if (isset($transactionCounterCheck['error'])) {
             $cli->error($transactionCounterCheck['error']);
         }
         if ($this->UseSession and $db->isConnected()) {
             eZUser::logoutCurrent();
             eZSession::remove();
         }
     }
     $webOutput = $cli->isWebOutput();
     if ($this->UseDebugOutput or eZDebug::isDebugEnabled()) {
         if ($this->DebugMessage) {
             fputs(STDERR, $this->DebugMessage);
         }
         fputs(STDERR, eZDebug::printReport(false, $webOutput, true, $this->AllowedDebugLevels, $this->UseDebugAccumulators, $this->UseDebugTimingPoints, $this->UseIncludeFiles));
     }
     eZExecution::cleanup();
     eZExecution::setCleanExit();
     $this->setIsInitialized(false);
     if ($exitCode !== false) {
         $this->ExitCode = $exitCode;
     }
     if ($this->ExitCode !== false) {
         if ($exitText !== false) {
             $cli->output($exitText);
         }
         exit($this->ExitCode);
     }
 }
开发者ID:nlescure,项目名称:ezpublish,代码行数:35,代码来源:ezscript.php

示例5: redirect

 /**
  * Performs a redirection
  */
 protected function redirect()
 {
     $GLOBALS['eZRedirection'] = true;
     $ini = eZINI::instance();
     $automaticRedirect = true;
     if ($GLOBALS['eZDebugAllowed'] && ($redirUri = $ini->variable('DebugSettings', 'DebugRedirection')) !== 'disabled') {
         if ($redirUri == "enabled") {
             $automaticRedirect = false;
         } else {
             $uri = eZURI::instance(eZSys::requestURI());
             $uri->toBeginning();
             foreach ($ini->variableArray("DebugSettings", "DebugRedirection") as $redirUri) {
                 $redirUri = new eZURI($redirUri);
                 if ($redirUri->matchBase($uri)) {
                     $automaticRedirect = false;
                     break;
                 }
             }
         }
     }
     $redirectURI = eZSys::indexDir();
     $moduleRedirectUri = $this->module->redirectURI();
     if ($ini->variable('URLTranslator', 'Translation') === 'enabled' && eZURLAliasML::urlTranslationEnabledByUri(new eZURI($moduleRedirectUri))) {
         $translatedModuleRedirectUri = $moduleRedirectUri;
         if (eZURLAliasML::translate($translatedModuleRedirectUri, true)) {
             $moduleRedirectUri = $translatedModuleRedirectUri;
             if (strlen($moduleRedirectUri) > 0 && $moduleRedirectUri[0] !== '/') {
                 $moduleRedirectUri = '/' . $moduleRedirectUri;
             }
         }
     }
     if (preg_match('#^(\\w+:)|^//#', $moduleRedirectUri)) {
         $redirectURI = $moduleRedirectUri;
     } else {
         $leftSlash = strlen($redirectURI) > 0 && $redirectURI[strlen($redirectURI) - 1] === '/';
         $rightSlash = strlen($moduleRedirectUri) > 0 && $moduleRedirectUri[0] === '/';
         if (!$leftSlash && !$rightSlash) {
             // Both are without a slash, so add one
             $moduleRedirectUri = '/' . $moduleRedirectUri;
         } else {
             if ($leftSlash && $rightSlash) {
                 // Both are with a slash, so we remove one
                 $moduleRedirectUri = substr($moduleRedirectUri, 1);
             }
         }
         $redirectURI .= $moduleRedirectUri;
     }
     eZStaticCache::executeActions();
     eZDB::checkTransactionCounter();
     if ($automaticRedirect) {
         eZHTTPTool::redirect($redirectURI, array(), $this->module->redirectStatus());
     } else {
         // Make sure any errors or warnings are reported
         if ($ini->variable('DebugSettings', 'DisplayDebugWarnings') === 'enabled') {
             if (isset($GLOBALS['eZDebugError']) && $GLOBALS['eZDebugError']) {
                 eZAppendWarningItem(array('error' => array('type' => 'error', 'number' => 1, 'count' => $GLOBALS['eZDebugErrorCount']), 'identifier' => 'ezdebug-first-error', 'text' => ezpI18n::tr('index.php', 'Some errors occurred, see debug for more information.')));
             }
             if (isset($GLOBALS['eZDebugWarning']) && $GLOBALS['eZDebugWarning']) {
                 eZAppendWarningItem(array('error' => array('type' => 'warning', 'number' => 1, 'count' => $GLOBALS['eZDebugWarningCount']), 'identifier' => 'ezdebug-first-warning', 'text' => ezpI18n::tr('index.php', 'Some general warnings occured, see debug for more information.')));
             }
         }
         $tpl = eZTemplate::factory();
         $tpl->setVariable('site', $this->site);
         $tpl->setVariable('warning_list', !empty($this->warningList) ? $this->warningList : false);
         $tpl->setVariable('redirect_uri', eZURI::encodeURL($redirectURI));
         $templateResult = $tpl->fetch('design:redirect.tpl');
         eZDebug::addTimingPoint("Script end");
         eZDisplayResult($templateResult);
     }
     eZExecution::cleanExit();
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:74,代码来源:ezpkernelweb.php

示例6: 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

示例7: redirectTo

    /**
     * Sets the module to redirect at the end of the execution
     *
     * @param string $uri the URI to redirect to
     *
     * @see setRedirectURI(), setExitStatus()
     *
     * @return void
     */
    function redirectTo( $uri )
    {
        $originalURI = $uri;
        $uri = preg_replace( "#(^.*)(/+)$#", "\$1", $uri );
        if ( strlen( $originalURI ) != 0 and
             strlen( $uri ) == 0 )
            $uri = '/';

        $urlComponents = parse_url( $uri );
        if ( isset( $urlComponents['host'] ) && $urlComponents['host'] !== eZSys::hostname() )
        {
            $allowedHosts = $this->getAllowedRedirectHosts();
            if ( !isset( $allowedHosts[$urlComponents['host']] ) )
            {
                // Non-authorized host, return only the URI (without host) + query string and fragment if present.
                eZDebug::writeError( "Redirection requested on non-authorized host '{$urlComponents['host']}'" );
                header( $_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden' );
                echo "Redirection requested on non-authorized host";
                eZDB::checkTransactionCounter();
                eZExecution::cleanExit();
            }
        }

        $this->RedirectURI = $uri;
        $this->setExitStatus( eZModule::STATUS_REDIRECT );
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:35,代码来源:ezmodule.php


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