Download the PHP package sioweb/apply_environment without Composer

On this page you can find all versions of the php package sioweb/apply_environment. 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 apply_environment

Apply Environments

Es kommt vor, dass jede Environment (Live, Dev, Local, ...) andere Einstellungen benötigt. Am häufigsten sind davon die Domain- und HTTPS-Einstellungen in den Startpunkten betroffen.

Beispiele

Einstellungen

Im Verzeichnis /app/config/ muss eine Datei environments.yml erzeugt werden. Für Live, Dev und Localhost muss die Datei wie folgt aufgebaut werden:

apply_environments:
    environments:
        productive:
            prod: true
            short: intern
            title: Produktiv
        development:
            short: dev
            title: Development
        localhost:
            title: Localhost

Optionen

Option Werte Beschreibung
prod (optional) true|false Dieser Wert definiert diese Umgebung als Live-Umgebung
short (optional) (string) Dieser Wert sollte den Standard-Bezeichnungen prod / dev / localhost entsprechen, wird er leer gelassen, wird automatisch der übergeornete Schlüssel verwendet (dev entspräche im obigen Beispiel development)
title (string) Hier muss ein beschreibender Titel eingetragen werden. Das Plugin gibt die Titel in diversen Dropdowns aus

Environment per Konsole

Für automatische Builds kann es wichtig werden, die Environments per Konsole zu installieren. Im Root von Contao kann folgendes in die Konsole eingegeben werden:

vendor/bin/contao-console --env=YOUR_ENVIRONMENT sioweb:environment

Auf einigen Systemen ist PHP nicht als Alias angelegt, dann muss dieses vor den Befehl geschrieben werden:

/path/to/php vendor/bin/contao-console --env=YOUR_ENVIRONMENT sioweb:environment

Composer install/update

Die aktuelle Environment, kann auch direkt mit composer update und composer install eingespielt werden:

{
    "scripts": {
    "post-install-cmd": [
        "Contao\\ManagerBundle\\Composer\\ScriptHandler::initializeApplication",
        "Sioweb\\ApplyEnvironment\\Composer\\ApplyEnvironment::setup"
    ],
    "post-update-cmd": [
        "Contao\\ManagerBundle\\Composer\\ScriptHandler::initializeApplication",
        "Sioweb\\ApplyEnvironment\\Composer\\ApplyEnvironment::setup"
    ]
    },
}

.env

Damit die korrekte Environment eingespielt wird, muss diese im Root von Contao in einer .env-Datei hinterlegt werden:

APPLY_ENVIRONMENT='localhost'

Statt localhost, bitte die Environment angeben die ihr Wünscht, das ist wichtig, damit die korrekte Datenbank verwendet wird.

MYSQL_USER not found

Wenn die Datenbank wie folgt in der Datei /app/config/parameters_XXX.yml definiert sind, kann es passieren, dass die Konsole keinen Zugriff auf die ENV-Daten hat:

# This file has been auto-generated during installation
parameters:
    database_user: "%env(MYSQL_USER)%"
    database_password: "%env(MYSQL_PASSWORD)%"
    database_name: "%env(MYSQL_DATABASE)%"

Der Konsole müssen in diesem Fall erst die Daten übermittelt werden:

export MYSQL_DATABASE="your_database"
export MYSQL_USER="your_username"
export MYSQL_PASSWORD="your_password"

Wie werden einstellungen gespeichert?

Überall im Contao-Backend, werden alle Widgets um einen kleinen unsichtbaren Kreis erweitert. Wird die Maus über ein Eingabefeld bewegt, wird der Kreis sichtbar. Durch einen Klick öffnet sich das Menü mit den möglichen Environments / Umgebungen. Durch einen Klick auf eine Environment, wird der Eintrag in dem Eingabefeld gespeichert.

Hinweis: Das Formular muss nicht abgesendet werden, damit die Einträge gespeichert wird.

Environment einspielen

In der Systemwartung befindet sich nun ein neues Eingabefeld. Wurden die short-Einstellungen korrekt in der environments.yml notiert, wird die aktuelle Environment-Einstellung hier vorausgewählt. Dazu empfiehlt es sich, in der .htaccess die dev/localhost-Domain entsprechend auf app_dev.php oder auch app_localhost.php automatisch umzuleiten.

Durch absenden der Environment werden nun alle gespeicherten Daten aus der ausgewählten Environment eingespielt.

Wo werden die Daten gespeichert?

Die Daten werden unter /app/environments/ gespeichert.


All versions of apply_environment with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1||^8.0
sioweb/ccevent Version *
contao/core-bundle Version ~4.4||~5.0
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 sioweb/apply_environment contains the following files

Loading the files please wait ...