PHP code example of frosty22 / nette-deploy-center
1. Go to this page and download the library: Download frosty22/nette-deploy-center library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
frosty22 / nette-deploy-center example snippets
// Load Nette Framework and autoloader generated by Composer
__DIR__ . "/log";
$tempDir = __DIR__ . "/temp";
// Debugger center
$deploy = new DeployCenter\Application($logDir, $tempDir, "pass123");
$deploy->register("debug");
// Debugger maintenance support (optional)
//$deploy->setMaintenanceTemplateFile("path/to/our/template.latte"); // If we want own maintenance template
$deploy->checkMaintenance(); // Check maintenance, if in progress kill page and show maintenance template
// Configure application
$configurator = new Nette\Config\Configurator;
...
...
// Create container
$container = $configurator->createContainer();
// Debugger center - add dynamic service Maintenance, for support AlertControl (optional)
$container->addService("maintenance", $deploy->getMaintenance());
...
abstract class BasePresenter extends Nette\Application\UI\Presenter {
/**
* @return \DeployCenter\Maintenance\AlertControl
*/
protected function createComponentAlertControl()
{
$alertControl = new \DeployCenter\Maintenance\AlertControl();
$alertControl->setMaintenance($this->context->getService("maintenance"));
return $alertControl;
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.