Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125996 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 EBA5C1A00BD for ; Tue, 19 Nov 2024 23:14:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1732058255; bh=8GpSrWw6KkcGev8R7I+n3zSnNYQbS/xlEsinzozbAj8=; h=Date:Subject:To:References:From:In-Reply-To:From; b=f2MMky164gufurekVLb4lvtujFI3oxtgHoxIxqY4opegoZxyRtsqn4ag8CB/18Qmw SyKt0UOBRZaqcnvWCSd+YGD/CZDjDydeQTbCkulkZlL5ZBXf3GiW/C1r7Cgfb0UFCE JSycgpu0FKzNCidiInQCSHf5OunUNqYkmEH+Dm08++GKu6cgo37xZq14UmoKjL7vNi 5KwkpKTBy2qyF/yH8iLwwMh6aky8uK4iGDBCV0vJWh9Fu1c7Ru2YiWz8BHUEuXvdwh o92l77mARKAT/Vh7qAB0vZ174EId6Iic/N1h9CXR5W5JfzX3+XvbAhz1urxYAdvUPr 8eOyRZHQWuM9A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F268D18003E for ; Tue, 19 Nov 2024 23:17:34 +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.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fout-a6-smtp.messagingengine.com (fout-a6-smtp.messagingengine.com [103.168.172.149]) (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 23:17:34 +0000 (UTC) Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfout.phl.internal (Postfix) with ESMTP id E5FBF13806C5 for ; Tue, 19 Nov 2024 18:14:53 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Tue, 19 Nov 2024 18:14:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1732058093; x=1732144493; bh=lmKEXecqE9VIXUjDtL30mYM8NszaSXxFGqNLSxWninY=; b= kViS2a2CrPNJ6uBoSG+xeIoQhqhfQ8b+M/2E7sbN6iR0Ftg+ZVSQG66LDHICA1I4 9WpIiY1vCA8VTLV1CgHG83VD6LqrQOAWBtCBMS5PH8A2cdsv8wFvIUa8c0vojO/y +YbZRHZlYIt1kqqEdeNS9hqJ/qAWoMkOKa04yTvPcqgEw8Uaccau2nLF6Pk1MYc7 hMqYoh6KOqtvvPjkXaBu411dtTeOCOEOqBFiLRf6RtdkbS06mZW4jp7bHXd04N6F 0cLwBst0tiAqpTrRmHosMlDW3bhdynO+WPQfbmF9kZShSz4LoqQcblYjNPys1cCC MpDz6m+syuvaOidhDFNs8w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1732058093; x=1732144493; bh=l mKEXecqE9VIXUjDtL30mYM8NszaSXxFGqNLSxWninY=; b=JLslzuV3Bt+ZbANhY mngBVw1SsLkzLpfbI0uz9YVZXurnFeKRYCJjWl1/df/YBLr1Soa7h6kP67TZngnk dOpnUEYTdSYBbGXMrl06eGk2DH3YHYUJvyX0QuZmn1hvofzjSmqJsMsIprnkvcDk zcEKZhYlzFyvKB5ICBPTTAQjVtSWZj4nY/nuHZkcGcfkgQSZ836xZIBRYRibGgVb fpX3VqhGZuQnS52r/deYGWnuvy0zqYnirb/Wd9VV+/YiMqzNPvHcDOSIcsDOFckY lrnX8MLoj4Tj75X+lvq3QKPdbDFXCKu/ZNZHvPeb3njuqHYg1ABfsVs2qIshs7Pw WPFvw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrfeefgddtiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuf fvfhfhjggtgfesthejredttddvjeenucfhrhhomhepfdftohifrghnucfvohhmmhhinhhs ucglkffoufhorfgnfdcuoehimhhsohhprdhphhhpsehrfigvtgdrtghordhukheqnecugg ftrfgrthhtvghrnhepfeevheelgfefheefvdetleelhedvteekkeffhfehvdeifeeivedu hfeliedtgeegnecuffhomhgrihhnpeduvdhfrggtthhorhdrnhgvthenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehimhhsohhprdhphhhpsehr figvtgdrtghordhukhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpd hrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 19 Nov 2024 18:14:53 -0500 (EST) Message-ID: <046d6f81-9981-45b7-8da5-a7fed8e11eaa@rwec.co.uk> Date: Tue, 19 Nov 2024 23:14:46 +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: internals@lists.php.net References: <1ccdaa01-bbe7-4ac6-a7a9-db43f9e4537b@scriptfusion.com> Content-Language: en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 19/11/2024 13:48, Hammed Ajao wrote: > > So if symfony and laravel do this, whose best practices are we going > by exactly, yours? One common citation for this is "The Twelve-Factor App" [https://12factor.net/], a methodology/manifesto published in 2011 by some engineers from Heroku as a way to build a particular sort of cloud-native service-based application. Coincidentally, an open-source project to update and expand on it was officially announced last week: https://12factor.net/blog/open-source-announcement The idea is that "in a twelve-factor app": - configuration comes directly from the environment; for instance, provided by the orchestration layer in a container-based deployment - it is not written to a file, but passed directly to the application as environment variables - it does not indicate a named environment, but configures the application directly When people struggled with development environments which didn't have a suitable place for these variables to come from, the ".env file" was invented - a way to emulate the environment variables that a "real" deployment would receive. This then took on a life of its own, and eventually ".env" became just another format for configuration files: instead of "development.ini" and "production.ini", you have ".env.development" and ".env.production". We came full circle, and the only thing which actually comes from the environment is a master switch to choose the file to load. Personally, I don't think there's anything wrong with the "master switch" approach for a lot of applications. Not everybody works for a company with hundreds of developers, and a dozen kubernetes clusters running A/B tests on continuously deployed code. Sometimes you really do know you have 2, or 3, or 4, environments to configure. However, I don't think the master switch is something that should be hard-coded in a server. Maybe you know that if it's running under "php -S", it's "dev mode", and it it's running under Apache, it's "live mode"; if so, you can look at PHP_SAPI / php_sapi_name(). But maybe you do run Apache on a dev server; or you have separate debug and QA modes. -- Rowan Tommins [IMSoP]