Download the PHP package netresearch/akeneo-bootstrap without Composer

On this page you can find all versions of the php package netresearch/akeneo-bootstrap. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package akeneo-bootstrap

packagist docker pulls travis


This is

  1. The composer package netresearch/akeneo-bootstrap to bootstrap Akeneo projects and configure them from other packages rather than via their own config files (better updatability).
  2. The Docker image netresearch/akeneo-app providing a ready built Akeneo PIM project, ready to run with MongoDB and optimized for best possible updatability utilizing akeneo-bootstrap.

Contents

Composer package

The common way to install Akeneo is to create a composer project from akeneo/pim-community-standard which has major drawbacks:

  1. Akeneo still didn't publish its core package to packagist which thus needs to be provided as composer repository. As the corresponding github repository has tons of branches and tags using it for composer is firstly damn slow and secondly makes composer reach the github API limits which can hardly be handled in any environment where you don't want to expose your github API key. Also there is no way for other packages to require akeneo/pim-community-dev as long as the github repository is not added in the root composer.json.
  2. composer create-project naturally creates the project once - if you want to update to a newer version of the original project there is no easy way to this with composer. Rather you'll be forced to update the copied sources following the upgrade instructions which is - at least for us - not what we would
  3. If you need to change Akeneo configs, routings or add Bundles you have to touch the code generated by composer create-project which makes updating even harder.

You could also download a ready built Akeneo project - the updating issues however remain.

This package provides a mechanism to work around the problems above:

  1. It provides the plain shell script akeneo-project to create or upgrade an Akeneo project.
  2. It provides the command line application akeneo-bootstrap which generates configuration in the project from according instructions in installed packages and sets Akeneo up for running.

It replaces incenteev/parameter-handler which is registered for composers post-install-cmd and post-update-cmd and thus is invoked automatically to generate the AppKernel, configs and routings when packages are installed (steps 1 - 4 of akeneo-bootstrap command).

akeneo-project

Use the akeneo-project script to create or upgrade an Akeneo project. It also installs netresearch/akeneo-bootstrap into the project (which automatically invokes 1 - 4 of the akeneo-bootstrap command).

Installation

The script is standalone but as it requires PHP and composer anyway you better install it with composer:

Creating a project

Up/downgrading a project

akeneo-bootstrap

The akeneo-bootstrap command is shipped with the composer package netresearch/akeneo-bootstrap which is also installed by akeneo-project. It executes the following steps:

  1. Generate the AppKernel (overriding, not replacing the original Akeneo AppKernel) with bundles required by any installed packages
  2. Generate (local) config and routing files invoking resources required by any installed packages
  3. Generate the parameters.yml from environment variables
  4. Fix PIM, ORO and Symfony requirements (adjust paths)
  5. Clear cache if required by any of the previous steps
  6. Boot the kernel
  7. Wait for the database to be up
  8. Ensure the Akeneo installation (check requirements, install / upgrade DB, dump assets)
  9. Set export/import paths
  10. Link static directories if required (Akeneo sometimes doesn't use the configured directories but fixed paths like app/logs - this step symlinks those directories to the configured ones like LOG_DIR)
  11. chown the directories required to be writable from web (see WEB_USER)

Environment variables

akeneo-bootstrap uses the following environment variables to configure Akeneo:

Variable Description Default
DATABASE_DRIVER The database driver pdo_mysql
DATABASE_HOST The database host name localhost
DATABASE_PORT The database port 3306
DATABASE_NAME Name of the database akeneo_pim
DATABASE_USER Database user name akeneo_pim
DATABASE_PASSWORD Database users password akeneo_pim
LOCALE The locale for Akeneo en
SECRET Entropy string for security related operations hash('sha256', uniquid())
PIM_CATALOG_PRODUCT_STORAGE_DRIVER Set this to doctrine/mongodb-odm when you want to use MongoDB -
MONGODB_SERVER If set (e.g. to mongodb://mongodb:27017), the DoctrineMongoDBBundle will automatically activated. -
MONGODB_DATABASE If you use MongoDb you must provide a database name, which will be used for the product collections -
CACHE_DIR Path for symfony caches /var/cache/akeneo
LOG_DIR Path for the Akeneo logs /var/log/akeneo
UPLOAD_DIR Path where uploads should be stored /var/opt/akeneo/uploads/product
CATALOG_STORAGE_DIR catalog_storage_dir /var/opt/akeneo/file_storage/catalog
ARCHIVE_DIR archive_dir /var/opt/akeneo/archive
EXPORT_PATH Set this to change the directory to where exports should go. /var/opt/akeneo/exports
IMPORT_PATH Set this to change the directory from where imports should be read. /var/opt/akeneo/imports
*_PATH Set this with the asterisk replaced by the job name in upper case (e.g. CATEGORY_IMPORT_PATH) to change the file path for a particular job (overrides EXPORT_PATH or IMPORT_PATH for this job) -
WEB_USER User name to be set as owner for directories that need to be writable by Akeneo from Web www-data.www-data
PARAMETER_* Any parameter (e.g. from pim_parameters.yml) which is NOT one of the above (f.e. PARAMETER_INSTALLER_DATA="/opt/acme/fixtures" to use another dataset -
USE_FIXTURE_PATHS Set this to use configured import and export paths from fixture files. All other configured ..._PATH will ignored. -

The configuration via environment variables was chosen because the package is primarily targeted at installations in Docker containers. If you don't use such and don't want to clutter your environment variables with the above, you could put them into an .env file and run akeneo-bootstrap and composer commands like this:

Customizing Akeneo from other packages

akeneo-bootstrap will scan all installed packages for settings in their composer.json allowing you to register Bundles, configs, routings and custom bootstrap steps to customize Akeneo like so:

After installing or updating this package akeneo-bootstrap will automatically update the Kernel and local configuration and routing files to add the configured resources.

Please note that changes to this composer.json files only take effect when the package is actually updated or installed - if you only change it in the vendor package nothing will happen.

Adding bundles

Bundles are to be registered as objects in an array in extra.netresearch/akeneo-bootstrap.bundles in your composer.json. Each of them must have a class property containing the bundle class and can have a env property containing an array of or an comma separated string with environment names:

Note that all packages are scanned for this. This allows you to require a single package in the project which requires other packages that contain such configuration as well.

Adding configs

Config files are to be registered as objects in an array in extra.netresearch/akeneo-bootstrap.config in your composer.json. Each of them must have a resource property containing the file path and can have a env property containing an array of or an comma separated string with environment names:

Adding routings

Routing files are to be registered as objects in an object in extra.netresearch/akeneo-bootstrap.routing in your composer.json. Each of them must have a resource property containing the file path and can have a env property containing an array of or an comma separated string with environment names. The keys are the keys under which they are registered in the routing_local.yml's:

Adding custom bootstraps

There are two scopes of bootstraps: generate (Akeneo/DB not necessarily initialized; invoked after composer update/install and from ./bin/akeneo-bootstrap) and boot (Akeneo/DB ready to run, invoked only from ./bin/akeneo-bootstrap right after generate). Custom bootstrap classes can be registered for each of those scopes as array of class names in extra.netresearch/akeneo-bootstrap.{SCOPE} in your composer.json. Each of those classes have to implement \Netresearch\AkeneoBootstrap\Bootstrap\BootstrapInterface.

A bootstrap could for instance look like this:

Have a look at the present bootstraps for further examples.

Docker image

The Docker image netresearch/akeneo-app is an alpine image containing an Akeneo project setup with akeneo-project in /var/www/html and the akeneo-project script itself in /opt/akeneo-bootstrap/bin/akeneo-project.

When this image is used with netresearch/akeneo-php:apache or netresearch/akeneo-php with akeneo-php-entrypoint set as entrypoint akeneo-bootstrap will automatically be invoked on container start.

Run

This image only contains source files. To run Akeneo with it, PHP, a MySQL/MariaDB database and - both optionally an Apache and a MongoDB - are required.

Akeneo has several PHP platform dependencies which is why we recommend using our Akeneo specialized PHP Docker images for that (available as PHP only and PHP+Apache).

It's best to run it using docker-compose. See here for an example.

In order to develop with Akeneo, you can additionally use this docker-compose.override.yml along with a Dockerfile like the one below.

Environment variables

As those for akeneo-bootstrap.

Customize Akeneo

This image provides a ready built Akeneo project (composer install already done) which is not meant to be customized by hacking around in its configuration and kernel - it rather uses customizable by other packages.

To install your own packages you should extend this image with a custom docker file - we suggest following multistage build file to keep the resulting image small:

GitHub

If you have any problems, questions, feature requests or simply stars to give please visit the GitHub repository.


All versions of akeneo-bootstrap with dependencies

PHP Build Version
Package Version
Requires symfony/console Version ^2.7
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package netresearch/akeneo-bootstrap contains the following files

Loading the files please wait ....