本文整理匯總了PHP中Pimcore\Config::getEnvironment方法的典型用法代碼示例。如果您正苦於以下問題:PHP Config::getEnvironment方法的具體用法?PHP Config::getEnvironment怎麽用?PHP Config::getEnvironment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Pimcore\Config
的用法示例。
在下文中一共展示了Config::getEnvironment方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: preparePdfGeneration
/**
* @param $documentId
* @param $config
* @throws \Exception
*/
public function preparePdfGeneration($documentId, $config)
{
$document = $this->getPrintDocument($documentId);
if (Model\Tool\TmpStore::get($document->getLockKey())) {
throw new \Exception("Process with given document alredy running.");
}
Model\Tool\TmpStore::add($document->getLockKey(), true);
$jobConfig = new \stdClass();
$jobConfig->documentId = $documentId;
$jobConfig->config = $config;
$this->saveJobConfigObjectFile($jobConfig);
$this->updateStatus($documentId, 0, "prepare_pdf_generation");
$args = ["-p " . $jobConfig->documentId];
$env = \Pimcore\Config::getEnvironment();
if ($env !== false) {
$args[] = "--environment=" . $env;
}
$cmd = Tool\Console::getPhpCli() . " " . realpath(PIMCORE_PATH . DIRECTORY_SEPARATOR . "cli" . DIRECTORY_SEPARATOR . "console.php") . " web2print:pdf-creation " . implode(" ", $args);
Logger::info($cmd);
if (!$config['disableBackgroundExecution']) {
Tool\Console::execInBackground($cmd, PIMCORE_LOG_DIRECTORY . DIRECTORY_SEPARATOR . "web2print-output.log");
} else {
Processor::getInstance()->startPdfGeneration($jobConfig->documentId);
}
}
示例2: buildPhpScriptCmd
/**
* @param $script
* @param $arguments
* @return string
*/
protected static function buildPhpScriptCmd($script, $arguments)
{
$phpCli = Console::getPhpCli();
$cmd = $phpCli . " " . $script;
if (Config::getEnvironment()) {
$cmd .= " --environment=" . Config::getEnvironment();
}
if (!empty($arguments)) {
$cmd .= " " . $arguments;
}
return $cmd;
}