dev-develop
dev-develop
MIT
The Requires
The Development Requires
0.2.0
0.2.0.0
MIT
The Requires
The Development Requires
dev-master
9999999-dev
MIT
The Requires
The Development Requires
0.1.16
0.1.16.0
MIT
The Requires
The Development Requires
Wallogit.com
2017 © Pedro Peláez
A symfony 2 bundle to manage maintenance periods for your symfony app., (*1)
composer.json:"repositories": [
{
"type": "composer",
"url": "http://satis.united-asian.com/symfony"
},
...
]
composer.json:{
"require": {
"uam/maintenance-bundle": "dev-master",
"uam/twig-i18n-extension": "dev-master",
...
}
}
composer update to install the bundle:``` bash $ php bin/composer.phar update, (*2)
assuming composer.phar is in bin directory.
#### Enable the bundle in the app's kernel:
enable the UAMMaintenanceBundle, UAMDatatablesBundle and UAMTwigI18nBundle in app's kernel.
``` php
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new UAM\Bundle\DatatablesBundle\UAMDatatablesBundle(),
new UAM\Bundle\MaintenanceBundle\UAMMaintenanceBundle(),
new UAM\Twig\Extension\I18n\Bridge\Symfony\UAMTwigI18nBundle(),
);
}
#config.yml
assetic:
- UAMDatatablesBundle
- UAMMaintenanceBundle
installAssets script handler, then run the following command:``` bash $ php app/console assets:install, (*3)
or ``` bash $ php app/console assets:install --symlink
Run the following command to update the database schema., (*4)
$ php app/console propel:model:build
Then run the below command to generate the migration file., (*5)
$ php app/console propel:migration:generate-diff
After generating migration file open the migration file and copy the query to create uam_maintenence and uam_maintenance_i18n table and run the query., (*6)
Or, (*7)
run the command to execute generated sql., (*8)
$ php app/console propel:migration:migrate
Typically, if you have planned a maintenance operation in the near future, you want to publish a warning to your users on your app, in otder to let them know that the app will be unavailable during that time., (*9)
To do this with the UAMMaintenanceBndle, include the following code in the appropraite template of your app. If you want the warning to be displayed in all pages of your app, include this in the base template., (*10)
``` twig {% render(controller("UAMMaintenanceBundle:Maintenance:warning")) %}, (*11)
### Customizing the "Under maintenance" page #### Import routing file ``` bash uam_maintenance: resource: "@UAMMaintenanceBundle/Resources/config/routing/maintenance.yml"
override the layout.html.twig template into your app so that page/message displayed will be consistent with the style of your app., (*12)
Or you can also override the progress.html.twig template for the "Under maintenence page"., (*13)
bash
uam_maintenance_admin:
resource: "@UAMMaintenanceBundle/Resources/config/routing/admin.yml", (*14)
override the layout.html.twig template into your app so that admin pages displayed will be consistent with the style of your app., (*15)
To access the admin pages, the user must have the role ROLE_UAM_MAINTENANCE_ADMIN., (*16)
Admin pages are restricted to certain users. To access the admin pages, the user must have the role ROLE_UAM_MAINTENANCE_ADMIN., (*17)
MIT
MIT
MIT
MIT