Difference between revisions of "Developers/Re-generating the environment"

From PartKeepr Wiki
Jump to: navigation, search
(Created page with "PartKeepr uses quite a few helper bundles from Symfony2: * [https://github.com/nfq-alpha/sprite-generator NFQ-Alpha Sprite Generator] creates a [https://en.wikipedia.org/wiki...")
 
(Added note about deleting web/js/compiled/ directory when prod env exists.)
 
(5 intermediate revisions by one other user not shown)
Line 1: Line 1:
PartKeepr uses quite a few helper bundles from Symfony2:
+
Re-generating the environment ensures that all caches and generated files are up to date.
  
 +
This is especially important after changes you apply to your <code>parameters.php</code> since Symfony2 caches the parameters file in the production environment.
 +
 +
The easiest method is to re-run setup; simply click '''next''' on all questions.
 +
 +
= Introduction =
 
* [https://github.com/nfq-alpha/sprite-generator NFQ-Alpha Sprite Generator] creates a [https://en.wikipedia.org/wiki/Sprite_(computer_graphics)#Sprites_by_CSS CSS sprite sheet] from individual icons
 
* [https://github.com/nfq-alpha/sprite-generator NFQ-Alpha Sprite Generator] creates a [https://en.wikipedia.org/wiki/Sprite_(computer_graphics)#Sprites_by_CSS CSS sprite sheet] from individual icons
 +
** If you add sprite sheets, you must run '''php app/console nfq:sprite:generate'''. This must be done prior '''assetic:dump'''.
 
* Doctrine Reflection Bundle generates [http://docs.sencha.com/extjs/6.0/6.0.0-classic/#!/api/Ext.data.Model ExtJS Models] from [http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/reference/basic-mapping.html Doctrine Entities]
 
* Doctrine Reflection Bundle generates [http://docs.sencha.com/extjs/6.0/6.0.0-classic/#!/api/Ext.data.Model ExtJS Models] from [http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/reference/basic-mapping.html Doctrine Entities]
 +
** If you change the Doctrine entities, you must run '''php app/console generate:extjs:entities''' to re-generate the ExtJS Models.
 
* [http://symfony.com/doc/current/cookbook/assetic/asset_management.html Assetic] combines and minifies the source JavaScript
 
* [http://symfony.com/doc/current/cookbook/assetic/asset_management.html Assetic] combines and minifies the source JavaScript
 +
** If you change JavaScript source, you must run '''php app/console assetic:dump''' to minify the JS files. Note that this should '''not''' be required if you are using the [[Developers/Getting_Started#dev_Environment|dev environment]].
 +
 +
{{note|The above commands must be ran as the user which your webserver runs as, or you have to chown the files to the correct user}}
 +
 +
{{note|If an existing production environment exists, the '''web/js/compiled/''' directory may need to be deleted prior for all changes to take effect.}}
 +
 +
= Re-generate the environment =
 +
In order to make re-generating the environment easier and consistent, you can use [https://www.phing.info/ phing]. PartKeepr provides a '''build.xml''' file. To re-generate the environment, call:
 +
 +
<pre>
 +
phing -Denv=yourenvironment regenerate-environment
 +
</pre>
  
 +
The default environment is '''prod''' if you skip '''-Denv'''.
  
If you change the Doctrine entities, you must run <pre>php app/console generate:extjs:entities</pre> to re-generate the ExtJS Models.
+
If you are running PartKeepr from an official archive release, you can simply use:
  
If you change JavaScript source, you must run <pre>php app/console assetic:dump</pre> to minify the JS files. Note that this should '''not''' be required if you are using the '''dev''' environment.
+
<pre>
 +
phing regenerate-environment
 +
</pre>

Latest revision as of 04:10, 14 May 2022

Re-generating the environment ensures that all caches and generated files are up to date.

This is especially important after changes you apply to your parameters.php since Symfony2 caches the parameters file in the production environment.

The easiest method is to re-run setup; simply click next on all questions.

Introduction

  • NFQ-Alpha Sprite Generator creates a CSS sprite sheet from individual icons
    • If you add sprite sheets, you must run php app/console nfq:sprite:generate. This must be done prior assetic:dump.
  • Doctrine Reflection Bundle generates ExtJS Models from Doctrine Entities
    • If you change the Doctrine entities, you must run php app/console generate:extjs:entities to re-generate the ExtJS Models.
  • Assetic combines and minifies the source JavaScript
    • If you change JavaScript source, you must run php app/console assetic:dump to minify the JS files. Note that this should not be required if you are using the dev environment.
The above commands must be ran as the user which your webserver runs as, or you have to chown the files to the correct user
If an existing production environment exists, the web/js/compiled/ directory may need to be deleted prior for all changes to take effect.

Re-generate the environment

In order to make re-generating the environment easier and consistent, you can use phing. PartKeepr provides a build.xml file. To re-generate the environment, call:

phing -Denv=yourenvironment regenerate-environment

The default environment is prod if you skip -Denv.

If you are running PartKeepr from an official archive release, you can simply use:

phing regenerate-environment