本文整理汇总了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;
}