allmega/blog

Symfony based content management system

Installs: 374

Dependents: 7

Suggesters: 0

Security: 0

Type:symfony-bundle

v1.0 2024-04-19 13:59 UTC

This package is auto-updated.

Last update: 2024-04-19 13:59:26 UTC


README

Make sure Symfony, Nodejs, Yarn, Composer is installed globally, as explained in the installation chapters of their documentations.

Create your project directory

Open a command console, enter your webroot directory and execute:

$ symfony new YOUR_PROJECT_NAME --webapp --version=lts

Install all required dependencies

Open a command console, enter your project directory and execute:

$ composer require api symfony/webpack-encore-bundle symfony/finder twig/markdown-extra twig/intl-extra symfonycasts/reset-password-bundle knplabs/knp-snappy-bundle knplabs/knp-paginator-bundle knpuniversity/oauth2-client-bundle league/commonmark league/oauth2-facebook league/oauth2-google

Install Bundle for phpunit testing

$ composer require dama/doctrine-test-bundle --dev

Install wkhtmltopdf

See instructions to install wkhtmltopdf Open the .env file and adjust path to wkhtmltopdf binary, /usr/bin etc

Applications that use Symfony Flex

Open a command console, enter your project directory and execute:

$ composer require allmega/blog

Applications that don't use Symfony Flex

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

$ composer require allmega/blog

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the config/bundles.php file of your project:

return [
    // ...
    Allmega\BlogBundle\AllmegaBlogBundle::class => ['all' => true],
];

Modify Webpack config

  • Uncomment in file webpack.config.js the line .autoProvidejQuery()
  • Add after this line .autoProvideVariables({ $: 'jquery', jQuery: 'jquery', 'window.jQuery': 'jquery' })
  • Add section for bundles and themes assets entries in ENTRY CONFIG area
    /** ALLMEGA_BEGIN_BUNDLES_ENTRIES */
    /** ALLMEGA_END_BUNDLES_ENTRIES */
    

/* ALLMEGA_BEGIN_THEME_ENTRIES / /** ALLMEGA_END_THEME_ENTRIES */


Register all bundles, that your need
------------------------------------

Open a command console, enter your project directory and execute:

$ ./bin/console allmega:bundles:register all


Add config options for tests, if needed
---------------------------------------

Create, if not exists, the file `.env.test.local` and copy-paste content 
from file `.env.local` to the created file, save and close this file

Import packages config files
----------------------------

Add following lines to `config/services.yaml`

imports:

- { resource: '@AllmegaAuthBundle/config/packages/' }
- { resource: '@AllmegaBlogBundle/config/packages/' }

Install javascript libraries
----------------------------

Open a command console, enter your project directory and execute:

$ yarn add @fortawesome/fontawesome-free jquery @popperjs/core bootstrap flatpickr $ yarn encore prod


Create database tables for CMS
----------------------------------------

Open a command console, enter your project directory and execute:

$ ./bin/console doctrine:schema:update -f --complete


Load the data for registered bundles
------------------------------------

Open a command console, enter your project directory and execute:

$ ./bin/console allmega:bundles:load all -s


Edit the "auto-scripts" section in "composer.json"
-------------------------------------------------

"auto-scripts": {

"cache:clear": "symfony-cmd",
"importmap:install": "symfony-cmd",
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd",
"doctrine:schema:update -f --complete": "symfony-cmd",
"allmega:bundles:register all --no-interaction": "symfony-cmd",
"allmega:bundles:load all": "symfony-cmd"

},


Testing
-------

Open the `phpunit.xml.dist` and add to `php` tag:

<env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled" />

Open a command console, enter your project directory and execute the 
following command:

$ ./bin/phpunit --stop-on-failure