Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87293 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32738 invoked from network); 25 Jul 2015 18:11:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jul 2015 18:11:53 -0000 Authentication-Results: pb1.pair.com header.from=dennis@birkholz.biz; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=dennis@birkholz.biz; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain birkholz.biz does not designate 144.76.185.252 as permitted sender) X-PHP-List-Original-Sender: dennis@birkholz.biz X-Host-Fingerprint: 144.76.185.252 mx01.nexxes.net Received: from [144.76.185.252] ([144.76.185.252:53876] helo=mx01.nexxes.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 29/70-28932-761D3B55 for ; Sat, 25 Jul 2015 14:11:52 -0400 Received: from [137.226.183.192] (ip3192.saw.rwth-aachen.de [137.226.183.192]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: db220660-p0g-1@packages.nexxes.net) by mx01.nexxes.net (Postfix) with ESMTPSA id BC370482494; Sat, 25 Jul 2015 20:11:48 +0200 (CEST) Message-ID: <55B3D164.6040408@birkholz.biz> Date: Sat, 25 Jul 2015 20:11:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Scott Arciszewski CC: PHP Internals References: <55AF84C1.8070403@fedoraproject.org> <55B3991A.4060107@birkholz.biz> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RFE to allow dirname($foo, 2) From: dennis@birkholz.biz (Dennis Birkholz) Hi, Am 25.07.2015 um 19:42 schrieb Scott Arciszewski: > On Sat, Jul 25, 2015 at 10:11 AM, Dennis Birkholz wrote: >> Hi, >> >> Am 23.07.2015 um 11:54 schrieb Josh Di Fabio: >>> Now, most often, dirname(... dirname(__DIR__) ...) is used in application entry >>> points during the bootstrapping process. In my experience, it's most commonly >>> used in order to include an autoloader or some bootstrap file which itself is >>> responsible for including the autoloader. >> >> doesn't work __DIR__.'/../../' on Windows also? Why do you need >> dirname() here? > > What's easier to read and less likely to result in bugs? > > require_once __DIR__ . '/../../../../autoload.php'; > or > require_once dirname(__FILE__, 5) . '/autoload.php'; I am not going to discuss personal preferences, but for me the first is. You require to go four Levels up and include something, that should just not be necessary with proper autoloading. Greets, Dennis