Skip to content

Installation

Intro

By default, running composer install also runs the scripts found in composer.json, in the scripts->post-install-cmd block. Alternatively, one can also run composer install --no-scripts to skip the automatic running of those scripts. Or, if skipping running is always desired, just remove the scripts->post-install-cmd block from composer.json.

Warning about PRO

⚠️ If you try to install XalokNext on an instance running in production, it's MANDATORY to run composer install --no-scripts, otherwise the post_install task drops the database!

Following, there's a description of these commands.

Wf\Bundle\CmsBaseAdminBundle\Composer\ScriptHandler::preInstall

This asks the question about what the public and admin hosts are, and writes this information to .make-config file, in the following format:

ADMIN_HOST=admin.wfcms.lo
PUBLIC_HOST=wfcms.lo

After creating this file, it runs make pre_install task.

A note on the make tasks

The Makefile file in the root of the project includes, by default, the vendor/wfcms/cms-base-admin-bundle/Wf/Bundle/CmsBaseAdminBundle/Resources/makefiles/tasks. This is where the various make tasks (both for installation, but also maintenance tasks) are defined. You should open this file and check what the various tasks are doing. Many tasks are just "shortcuts" for other tasks. For example, the definition of pre_install task:

pre_install: copy_dev_configs copy_prod_configs create_derived_dirs install_npms install-assets

The pre_install script runs the tasks defined on that line:

  • copy_dev_configs, which copies app/admin/config/config_dev.yml.dist to app/admin/config/config_dev.yml and app/public/config/config_dev.yml.dist to app/public/config/config_dev.yml
  • copy_prod_configs does the same as above, but for config_prod.yml files.
  • create_derived_dirs creates the directories that are ignored by the repository (cache/logs/uploads... they are defined in the tasks file as $DERIVED_DIRS variable). It also invokes make fix_permissions task that tries to give access to those directories both for the current user and for the webserver user
  • install_npms installs the npm packages required by different parts of the application.
  • install_assets installs the assets (third party libraries) required by the CMS

Incenteev\ParameterHandler\ScriptHandler::buildParameters

Creates the app/config/parameters/local.yml by checking the parameters defined in the app/config/parameters/local.yml.dist file and asking questions about the desired value for the given parameter in the current installation/environment (e.g. database host/username/password)

Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap

Symfony2 uses a "bootstrap" file (app/admin/bootstrap.php.cache) that includes the source code of most used classes. To generate this file manually:

php vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php app/admin

Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache

Clears the cache. To clear it manually, run

make clean

Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets

Creates the web/bundles directory and, inside it puts links to the Resources/public directories inside each bundle. To run manually:

./app/admin/console assets:install --symlink

Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile

Copies the SymfonyRequirements.php and check.php from the SensioDistributionBundle to app/admin. As these files are already included in the repository, this task can be skipped

Wf\Bundle\CmsBaseAdminBundle\Composer\ScriptHandler::postInstall

This runs two make tasks:

make post_install

  • ⚠️ rebuild_db: run this task manually if the Database doesn't exist or doesn't already contain useful data.
  • ⚠️ install_load_fixtures: loads the fixtures - drops all the data in the database and loads new data from the various Load* (e.g. LoadCategories) classes
  • link_assets: creates symlinks: web/javascripts->web/appcms/javascripts, web/stylesheets->web/bundles/appcms/css, web/images->web/bundles/appcms/images and web/javascripts/lib->web/bundles/wfcmsbaseassets/javascripts/lib. This way, the images (assets) can be accessed with the shortcut http://wfcms.lo/images/image.png instead of the "full" path http://wfcms.lo/bundles/appcms/images/image.png
  • assetic-dump: dump the Assetic assets defined in the twigs
  • bower_install: installs the bower dependencies defined in bower.json
  • compass_compile_admin_prod: compiles the CSS for the backend
  • compass_compile_public_prod: compiles the CSS for the frontend

make finish_install

Just an alias for make wf_assets - dumps all the assets required by the backend