php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6078 Make get_included/required_files() work even if files do not end i .php
Submitted: 2000-08-10 16:41 UTC Modified: 2000-09-17 21:43 UTC
From: marten at jerbro dot se Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Latest CVS (10/08/2000) OS: Any
Private report: No CVE-ID: None
 [2000-08-10 16:41 UTC] marten at jerbro dot se
Is it possible to make get_included_files() and get_required_files() to work even if the files included/required does not end with .php?

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-10 16:46 UTC] stas@php.net
the four characters ".php" has no magical meaning, so every function that works with files works with whatever names they have.
 [2000-08-10 16:54 UTC] marten at jerbro dot se
Sorry if my explanation was fuzzy.

What i meant is this; in the snippet below get_included_files() returns an empty array because the required files do not end in .php.

<?
require_once('global.inc');
require_once('sess.class');
require_once('banner.class');
require_once('cache.class');
require_once('template.class');

var_dump(get_required_files());
?>

From the manual page for get_required_files();
"As of PHP 4.0.1pl2 this function assumes that the required_once files end in the extension '.php', other extensions do not work."
 [2000-08-10 17:02 UTC] stas@php.net
Oh, sorry - seems that this insanity is indeed in the code. I just didn't look well enough (being sure this couldn't be there). I hope new include/require code will fix that, but in the meantime I reclassify this as a bug.
 [2000-09-17 21:43 UTC] stas@php.net
Should be fixed in latest CVS.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 22:00:02 2026 UTC