Skip to content

Third party bundles/packages

Doctrine ORM

XalokNext uses Doctrine ORM to work with entities/DB.

Doctrine Migrations

XalokNext ships with DoctrineMigrationsBundle installed and recommends use of this bundle when changes to the DB structure are needed.

The generated migration files are placed in /app/admin/DoctrineMigrations

StofDoctrineExtensionsBundle

Collection of Doctrine Extensions like Timestampable (automatically add timestamps when a document is created/updated), Sluggable (create slugs for entities), Tree (used for the Category entity) and others.

JMSSerializerBundle

Used to serialize the entities when passing them as JSON. XML format is also used for saving the Page entity in the PageVersion.

DoctrineFixturesBundle

For loading/resetting the data in the DB. XalokNext has a make task as a shorthand for reloading fixtures:

make load_fixtures

Warning: This will delete the entire content from the DB - it should only be ran in DEV or PRE environments.

Note: this command refuses to run if the ADMIN_SF_ENV variable is set to prod in .make-config. Change it to dev temporarily, before running the command. Don't forget to set it back to prod once the fixtures are reloaded.

The fixtures are loaded from /src/__PROJECT__/Bundle/CmsBundle/DataFixtures and /vendor/wfcms/cms-base-bundle/Wf/Bundle/CmsBaseBundle/DataFixtures/ORM.

The implementation of the base fixtures classes loads menu fixtures from /app/config/cms/menu_fixtures.yml and boards fixtures from /app/config/cms/board_fixtures.yml

Board and menu fixtures can be reloaded separately through the wf:cms:reload:board and wf:cms:reload:menu commands.

The implementation of the users fixtures class generates an admin user and also generates

FOSElasticaBundle

XalokNext integrates FOSElasticaBundle to ease working with ElasticSearch documents that come from the DB.

This bundle is configured in /app/config/misc/fos_elastica.yml, which by default imports the configuration file from the base /vendor/wfcms/cms-base-bundle/Wf/Bundle/CmsBaseBundle/Resources/config/third_party/fos_elastica.yml.

/app/config/misc/fos_elastica.yml can override only a part of the base config (there's no need to override the entire config, just the sections that are needed), the bundle merges the two configuration files.

AvalancheImagineBundle

XalokNext uses this bundle to generate different sizes for the images uploaded by the editors. This bundle is configured in /app/config/misc/avalanche.yml

WhiteOctoberPagerfantaBundle

For paginating through results

KnpMenuBundle

For creating/modifying/displaying menus, both in admin and in the public bundle.

Admin menus

The menus used in XalokNext's backend are created by /vendor/wfcms/cms-base-admin-bundle/Wf/Bundle/CmsBaseAdminBundle/Menu/MenuBuilder.php (wf_cms_admin.menu_builder.class parameter). This creates the main menu (method createMainMenu), the main menu for the boards editor (method createMainMenuFull) and the submenus for the Content tab (method createContentMenu) and for Advertisment admin page (method createAdvertisementSubmenu).

The three rendered at /boards is created by the class /vendor/wfcms/cms-base-admin-bundle/Wf/Bundle/CmsBaseAdminBundle/Menu/BoardMenuBuilder.php (wf_cms_admin.board.menu_builder parameter), using the createMainMenu method.

Public menus

Define a menu in the /app/config/cms/menu_fixtures.yml (the first key is the slug of the menu) file and render it using the twig function:

html
{{ wf_cms_render_menu('default-menu') }}

The HTML output of these menus can be changed by overwriting the class /vendor/wfcms/cms-base-bundle/Wf/Bundle/CmsBaseBundle/Menu/MenuRenderer.php (wf_cms.menu.renderer.class parameter).

SensioFrameworkExtraBundle

You can use the annotation provided by this bundle in the project's controllers.

VichUploaderBundle

Makes it easier to work with uploaded files in entities (save the path to an uploaded file in the DB). Configured in /app/config/misc/vich_uploader.yml

LiipCacheControlBundle

Provides the VarnishHelper class to ease purging content from Varnish. Needs to be configured in local config (for example: app/admin/config/config_prod.yml):

yaml
liip_cache_control:
    varnish:
        host: http://__PUBLIC_DOMAIN_OF_THE_PROJECT__.com
        ips: 10.36.53.40,10.36.53.29
        port: 8100

Also used to mark the HTTP cache time (used by Varnish) for responses - configured in /app/public/config/public_cache.yml

PrestaSitemapBundle

Used for the generation of the sitemap.

BCCResqueBundle

Used on the backend to queue Varnish's cache purging commands.

LiipThemeBundle (optional)

This bundle needs to be installed in the project's composer.json and enabled in /app/public/PublicKernel.php:getPublicBundles. Used to create a separate "theme" for the mobile website. Configured in /app/config/misc/liip_theme.yml

FOSUserBundle

Use to manage the backend users

LexikTranslationBundle

Provides the backend translation interface.

SonataAdminBundle and SonataDoctrineORMAdminBundle

Used to create CRUD interfaces in the backend (users, polls, ads, etc.)

CCDNUserSecurityBundle

Used to block access for a user after too many failed attempts to login. Configured by default in /vendor/wfcms/cms-base-admin-bundle/Wf/Bundle/CmsBaseAdminBundle/Resources/config/security_ccdnuser.yml

v7.3+SchebTwoFactorBundle

Add another layer of security by activating two factor authentication. Read the documentation for more info.