Bug 225434 - php include path should have /usr/share/php
Summary: php include path should have /usr/share/php
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: php
Version: 6
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Joe Orton
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks: 225436 225447 235461
TreeView+ depends on / blocked
 
Reported: 2007-01-30 16:34 UTC by Christopher Stone
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version: 5.1.6-3.5.fc6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-04-24 12:50:41 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Christopher Stone 2007-01-30 16:34:08 UTC
Description of problem:
There are several php packages, such as Smarty, which currently installs their
files in /usr/share/, and to include these classes in your php program you have
to actually type out the entire file path.

PHP should just include /usr/share/php in the include path.  Then packages such
as Smarty can simply install their classes in /usr/share/php/Smarty instead of
/usr/share/Smarty.

This will allow a programmer to use include_once 'Smarty/foo.php'; instead of
the full path name.

Smarty is not the only example, this issue was brought up from a package of
another php package who was wondering how to have his php class added to the
include path.

This technique is used on other distros with more PHP experience than Fedora.

Comment 1 Joe Orton 2007-01-30 16:53:08 UTC
The default compiled-in include_path is set to:

  .:/usr/share/pear

is that not working?

Comment 2 Christopher Stone 2007-01-30 17:01:51 UTC
No, other non-pear php classes currently just install their stuff in /usr/share
and expect end users to modify the include path or else type all the full path
name to a class when including it in php.

By adding /usr/share/php to the default php include path, a package such as
php-Smarty can then simply install the php class files in the
/usr/share/php/Smarty directory instead of the /usr/share/Smarty directory as it
does now.

Then with the new include_path set in place, the user can have in their php files:

include 'foo/foo.php' instead of include '/usr/share/foo/foo.php';

This will be discussed in today's Fedora packaging committee meeting.  See also:
https://www.redhat.com/archives/fedora-packaging/2007-January/msg00162.html

The meeting today will decide if this is to be added to the packging guidelines
for non-pear php classes such as php-Smarty.

Comment 3 Joe Orton 2007-01-30 17:10:36 UTC
Oh, sorry, php-vs-pear, my mistake.

This seems like a good idea; php (actually php-common) would also have to
package the directory of course.  If this is agreed by the packaging committee
I'll do it.

Comment 4 Christopher Stone 2007-01-30 17:14:52 UTC
09:04:08           spot |  First item:
09:04:09 >> OpenURL 1
09:04:09           spot | 
https://www.redhat.com/archives/fedora-packaging/2007-January/msg00162.html
09:04:32            f13 |  I'm here, just beating on the test1 RC tree
09:04:49           spot |  Basically, if you put your php Class files in
/usr/share/php, it makes life much simpler for users.
09:05:13           spot |  The proposal is that we mandate this as part of the
php guidelines
09:05:51       XulChris | this is for non-pear php classes, pear classes still
go under /usr/share/pear
09:05:57            f13 |  seems to make sense.  Are there any Core packages
that don't follow this?
09:06:15           spot |  f13: looks like php doesn't
09:06:23       XulChris | f13: php package needs to add /usr/share/php to the
default include_path,
09:06:47            f13 |  so lets get the php maintainer to put in his input
09:07:03          tibbs |  Is php-Smarty in core?
09:07:10       XulChris | Smarty is in extras
09:08:28          tibbs |  Poor Joe; we keep coming up with new PHP changes.
09:09:24           spot |  is joe back in the office?
09:09:42            f13 |  not sure
09:09:46       XulChris | i think this was discussed a long time ago when we
were doing the pear guidelines, but im not sure what became of it, i think it
got lost in
                          the discussion
09:09:59       XulChris | joe just replied to the bugzilla entry 5 minutes ago
09:10:21          tibbs |  We were waiting on some other PHP-related decision as
well.
09:10:46           spot |  Perhaps when joe adds it to the php package, we can
amend the guidelines.
09:11:04       XulChris | response from joe:
09:11:06       XulChris | This seems like a good idea; php (actually php-common)
would also have to
09:11:06       XulChris | package the directory of course.  If this is agreed by
the packaging committee
09:11:07       XulChris | I'll do it.
09:11:37       XulChris |
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=225434#c3
09:11:39            f13 |  ok, great.
09:11:56           spot |  ok, lets vote on the addition then
09:11:58          tibbs |  Yes, if he's happy then I'm happy; this makes quite
some sense.
09:12:01           spot |  +1
09:12:02          tibbs |  +1
09:12:03    abadger1999 |  +1
09:12:43  *         spot looks around
09:12:50            f13 |  +1
09:13:16          racor |  +1
09:13:27           spot |  ok, thats 5. it passes, i'll write it up.
09:13:38       XulChris | thanks guys

Cool, timing on this couldn't have been more perfect.  Above is logs from
meeting which just happened.  :)

Thanks.

Comment 5 Joe Orton 2007-01-31 12:02:29 UTC
This is done for Raw Hide, php-5.2.0-9.  Leaving this open so it gets done for
an FC6 update too.

Comment 6 Joe Orton 2007-02-21 12:16:23 UTC
The FC6 update just shipped does add /usr/share/php to the default include path
but didn't package /usr/share/php; leaving this open.

Comment 7 Joe Orton 2007-04-24 12:50:41 UTC
Fixed in -3.5.fc6; thanks for suggestion.

http://www.redhat.com/archives/fedora-package-announce/2007-April/msg00044.html


Note You need to log in before you can comment on or make changes to this bug.