Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125993 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 9B4861A00BD for ; Tue, 19 Nov 2024 13:38:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1732023662; bh=CkG+Bk053MO83ri2RUnIgZ1sTqwVBzEAeCv4AoOuSPA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=lJPy1rSyXlPXLixPvIj89Uq99MULuvBdrxiBtqh6GqL3w47xYWOCuu0Mk9WzEpDlf vTHOW9YDVPOMCYJ7RgSpRjWg76FhEqxffhVCIl9fZdWe1Q0j7XTjwWDosvRVuMTwCq Tj7SaCAR6CO2vMQyS1uy+as1kvbJTeO8xZOrEcK/g5QyxTZ8OFFVaxv3zxViJS/Rt1 RtUwwRJ0Nom2h7mzCVoXfvoiDE4hiaLO7pCgSZjukjoorWOqzcfGDNOxObB9q1WXby Wtvrx0OqgaVXWbDbkM1MvjFaUuhbB3zYUH3cjamWPl0sDz9zW5r5jTYcmHWqhjNkrR kEffU1OJNTFzA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AE8DF18006F for ; Tue, 19 Nov 2024 13:41:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DMARC_MISSING,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 19 Nov 2024 13:41:01 +0000 (UTC) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-432d86a3085so29971405e9.2 for ; Tue, 19 Nov 2024 05:38:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scriptfusion-com.20230601.gappssmtp.com; s=20230601; t=1732023501; x=1732628301; darn=lists.php.net; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=mrFyFcYrWCBSEJrqBlA+P/iJQYobcqpGJtyqEziqdfE=; b=CeH5tqQmjVmaKZvY1fTbZZk0WkDVSuR10JfyRpPLVC9kN188kIVTHq19nfp+gzb151 Mmh+YhHQ/0gyprpFQEV52BOl/EmQPWVLg53cO9Ne70dNQHfoXkOsX19Y50x7nK7IVp1s D7pEBghL/WuX1szCnvQrYJi1PHAzclUqrIOKauYyA/mZU19JkMaDEriGQR+Vhz/Rnial PLU7q20W0dmRgQFO35TKWchKhoJyhjDYmH7qXH/0dvlLyVKRLNdReeYDLAX3pH9FQqLp jScXixkZwtBtVDw9RoHQ3CkCgpfnsksk+bk4xdjMQvrHP28dolJ6A3NfaetfIX04YJx0 MCug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732023501; x=1732628301; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mrFyFcYrWCBSEJrqBlA+P/iJQYobcqpGJtyqEziqdfE=; b=tPoN6cL3TsbSAKMnigTxkNQWni8ubjjb8lWfIjnvNZMHf7wtdtp9mncAEJo3J6Jw76 SQyWcXqTs3Jb6c7oAM+LaOIH4kv2/YZGCpGWYeXWLWcTrG4YyvA8ZO9s9OAgid0LC4PJ WxO/1wl3HtyZ1Zvz3R0JgLQKFgM2V78WrK/nOqGYkOstDsf3wQKXcwpIYpPj2jEKJSD0 kM8b+X2BKnc+086weNkfX5pr2k1syPLwjgLOK1GivUJscOuLghUDri75rgBjn6VbjApR 3F0ZwZzP5HnOsj28167vFRYCvG8w3hW2ZneGpCWo3W28yuJ1W1aDvqkLDISAy/CJN5Bu Xunw== X-Gm-Message-State: AOJu0YwbGadU/HVpKWXptsA+DRs6NHiCy4RistnidXZ3iVm9rqEUaqPI UyPvSLTWg2nRYT3hWhaJ4uiscTR6vj2aaKHpv+3oWzmIoE5X5akpv8yoNNGbni1iX7sb1wkfvdz mi/k= X-Google-Smtp-Source: AGHT+IH2y0XhaUcTJoZzoBS95F9aM+kTvVt619/CGeoxWQkwmtIMHfThvcZZtlwjvetxx/Jp9QiFLA== X-Received: by 2002:a05:600c:5129:b0:431:54f3:11af with SMTP id 5b1f17b1804b1-432df78fd98mr146104565e9.31.1732023499647; Tue, 19 Nov 2024 05:38:19 -0800 (PST) Received: from ?IPV6:2a01:4b00:bf09:5101:e1b3:ea03:ba0f:bd5a? ([2a01:4b00:bf09:5101:e1b3:ea03:ba0f:bd5a]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-432da298a41sm199838445e9.38.2024.11.19.05.38.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Nov 2024 05:38:19 -0800 (PST) Message-ID: <1ccdaa01-bbe7-4ac6-a7a9-db43f9e4537b@scriptfusion.com> Date: Tue, 19 Nov 2024 13:38:18 +0000 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] Better development streamlining of the built-in server To: John D'Orazio Cc: internals@lists.php.net References: Content-Language: en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit From: bilge@scriptfusion.com (Bilge) On 19/11/2024 13:26, John D'Orazio wrote: > I don't understand why an application should not know which > environment it is running in? I don't know if this list is the place to be discussing this, but here goes: Typically you are injecting the environment name to have the application switch to a different configuration to load a whole bunch of different settings for that environment. Instead, you should be injecting all those different settings directly. The reason is because otherwise you are tightly coupling your application to a fixed number of known environments, limiting deployment options. Instead, the application should be environment agnostic, thereby enabling whomsoever deploys your application to configure as many different environment types as they wish. This best practice also avoids the temptation to code different logic paths based on the environment name (very bad). Don't worry, this is a common mistake, and even popular frameworks like Laravel and Symfony promote this anti-pattern to some degree. Cheers, Bilge