{"id":21277986,"url":"https://github.com/b13/t3ext-environment","last_synced_at":"2025-07-11T08:32:26.553Z","repository":{"id":9607209,"uuid":"11530428","full_name":"b13/t3ext-environment","owner":"b13","description":"TYPO3 Extension: allow environment-dependent settings","archived":false,"fork":false,"pushed_at":"2020-09-25T07:13:58.000Z","size":31,"stargazers_count":12,"open_issues_count":2,"forks_count":4,"subscribers_count":16,"default_branch":"master","last_synced_at":"2023-08-21T08:08:40.983Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/b13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-19T15:06:32.000Z","updated_at":"2022-11-04T10:38:34.000Z","dependencies_parsed_at":"2022-09-17T06:41:31.630Z","dependency_job_id":null,"html_url":"https://github.com/b13/t3ext-environment","commit_stats":null,"previous_names":[],"tags_count":6,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Ft3ext-environment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Ft3ext-environment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Ft3ext-environment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Ft3ext-environment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b13","download_url":"https://codeload.github.com/b13/t3ext-environment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225708281,"owners_count":17511635,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T10:08:34.577Z","updated_at":"2024-11-21T10:08:35.079Z","avatar_url":"https://github.com/b13.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"TYPO3 Extension Environment\n===========================\n\nCreated by Benjamin Mack, b:dreizehn GmbH, in 2013.\nPublished under the MIT license.\n\nWhat does it do?\n----------------\n\nThe TYPO3 extension \"Environment\", compatible with TYPO3 CMS 4.5 until\nTYPO3 CMS 7.99.99, allows for context-specific settings, so the TYPO3\ninstallation has different options for each context. This means that all\nlogging and debugging settings can be turned on for the development\nenvironment.\n\nOf course, this extension makes most sense if you have multiple server scenarios and a local development environment.\n\n\nInstallation\n------------\n\n1) Install the extension.\n\n2) Add the following Rewrite statements to your .htaccess file after the RewriteBase\nstatement or to your Apache webserver configuration.\n\n    # Make sure the context variable is set with every http request\n    RewriteCond %{HTTP_HOST} ^(.*)staging-system\\.org$\n    RewriteRule .? - [E=TYPO3_CONTEXT:Production/Staging]\n\n    RewriteCond %{HTTP_HOST} ^(.*)development-system\\.org$\n    RewriteRule .? - [E=TYPO3_CONTEXT:Development]\n\n\n3) Add the following code to your typo3conf/AdditionalConfiguration.php for\nTYPO3 CMS \u003e= 6.0\n\n\t// load the environment / context configuration for this installation\n\tif (\\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility::isLoaded('environment')) {\n\t\tinclude('ext/environment/Includes/Bootstrap/InitializeContext.php');\n\t}\n\n3a) For installations prior to 6.0, please include this at the bottom of the localconf.php\n\n\t// load the environment / context configuration for this installation\n\tif (t3lib_extMgm::isLoaded('environment')) {\n\t\tinclude('ext/environment/Includes/Bootstrap/InitializeContext.php');\n\t}\n\n3b) For installations using TYPO3 CMS 6.2+, just add this to your typo3conf/AdditionalConfiguration.php\n\n\t// load the environment / context configuration for this installation\n\tinclude('ext/environment/Includes/Bootstrap/InitializeContext.php');\n\nAfter that, you have a PHP constant named \"TYPO3_CONTEXT\" that\nis set to the environment variable placed in your server settings.\n\n4) You can now define context-specific configurations, and create files like\n\n * typo3conf/AdditionalConfiguration.Development.php\n * typo3conf/AdditionalConfiguration.Production.php\n\nand add configuration options like different DB settings and debugging\nsettings, that get included depending on what context you have set in your\nserver settings. Examples are provided in\n[Resources/Public/Examples](https://github.com/b13/t3ext-environment/tree/master/Resources/Public/Examples).\n\nPlease make sure that the PHP files always start with the following lines\n\n\t\u003c?php\n\n\tif (!defined('TYPO3_MODE')) {\n\t\tdie('Access denied.');\n\t}\n\n\nBest practices\n--------------\n\nDevelopment Environment \"Development\"\n\n * mails should only be sent locally\n * all debug modes are set to full logging\n * caching is disabled by default\n\nIntegration Environment \"Testing/Integration\"\n\n * testing environment for unit tests etc.\n\n\"Production/Staging\" Environment\n\n * Clone of the \"Live\" server for (customer) acceptance testing\n\n\"Production\" Environment\n * \"Live\" server\n\n\n The top-level contexts, however, must be one of \"Testing\", \"Development\" and \"Production\". Of course any other sub-context name can be chosen.\n\n\nSetting the environment for scheduler tasks\n-------------------------------------------\n\nUsually the TYPO3 scheduler is called like this:\n\n/usr/bin/php5 /path/to/my/typo3/installation/typo3/cli_dispatch.phpsh scheduler\n\nthis should be modified at all times to set the environment variable\n\n/usr/bin/php5 /path/to/my/typo3/installation/typo3/cli_dispatch.phpsh scheduler --context=Production\n\n\nEnvironment-dependent TypoScript\n--------------------------------\nYou can check the environment with the following TypoScript condition.\n\n\t# disable tracking for Production/Staging environment\n\t[globalString = ENV:TYPO3_CONTEXT = Production/Staging]\n\t\tpage.20 \u003e\n\t[GLOBAL]\n\nWith TYPO3 CMS 6.2, you can use the newly defined \"applicationContext\" TypoScript condition.\n\n\nEnvironment-dependent email redirection\n---------------------------------------\nYou can redirect any outgoing email to a specific email address by setting the\nfollowing TYPO3_CONF_VARS option:\n\n$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['environment']['redirectEmails'] = 'benni@typo3.org';\n\nYou can add multiple addresses separated via comma, or in a simple array.\n\nIt makes most sense if you put this in a environment-dependent installation like\ntypo3conf/AdditionalConfiguration.Development.php and remove it in the\nProduction environment settings.\n\n\nThanks\n------\n\nBig thanks goes to:\n\n * the b13 specialists for braining and finding the optimal out-of-the-box solutions,\n * Jesus Christ who saved my life.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb13%2Ft3ext-environment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb13%2Ft3ext-environment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb13%2Ft3ext-environment/lists"}