Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57186 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7763 invoked from network); 4 Jan 2012 16:28:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jan 2012 16:28:06 -0000 Authentication-Results: pb1.pair.com header.from=kassner@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=kassner@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.170 as permitted sender) X-PHP-List-Original-Sender: kassner@gmail.com X-Host-Fingerprint: 209.85.212.170 mail-wi0-f170.google.com Received: from [209.85.212.170] ([209.85.212.170:35037] helo=mail-wi0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EC/E9-50667-51E740F4 for ; Wed, 04 Jan 2012 11:28:06 -0500 Received: by wicr5 with SMTP id r5so11685975wic.29 for ; Wed, 04 Jan 2012 08:28:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=I1QqCoqyEy1QTLLHZxfKLs9aAsVtOBR5C2T0Rs1PUPw=; b=ZNlB1m0Twxy2E8f75bRES2MdTC45z+U7V1y3ugDnRZdU6cphpjRX4htS8WnbnKamfT RkK6DXI0UaRHTlKwdYW5fNqopm0Z1q69BBzl3NpW7zH9hoeZPSnEeDOygqsz7mcfGlvS HF0rtjVQ5RJp9y65p6HZdGNlJPKTIFC8Yja1g= Received: by 10.180.90.40 with SMTP id bt8mr124865849wib.4.1325694482527; Wed, 04 Jan 2012 08:28:02 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.112.13 with HTTP; Wed, 4 Jan 2012 08:27:41 -0800 (PST) In-Reply-To: References: Date: Wed, 4 Jan 2012 14:27:41 -0200 Message-ID: To: Keloran Cc: PHP Internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Feature Request From: kassner@gmail.com (Rafael Kassner) realpath function do this for you. It returns the absolute path, if file exists. Otherwise, returns null. On Wed, Jan 4, 2012 at 2:18 PM, Keloran wrote: > I dont seem to have the karma for doing this in RFC so ill propose it her= e, > and once karma make an RFC > > Is it possible to have a 2nd option on file_exists so that it returns the > path you specified > > --Example > $cFile =3D file_exists("/file/located/here.php", true); > > and if that exists it will return > /file/located/here.php > > instead of true > > --Reason > the reason for this is simple actually at the moment if you want to inclu= de > a file for usage but want to check it exists you have todo the following > if (file_exists("/file/located/here.php")) { > =A0$cFile =3D "/file/located/here.php"; > } > > which can if your doing lots of checking alot of extra code for no reason= , > or if you want to use variables, lots of louse variables just for somethi= ng > that could be pulled from the request --=20 Atenciosamente, Rafael Kassner