php-general Digest 8 Jul 2007 19:22:59 -0000 Issue 4892
Topics (messages 258466 through 258476):
Re: About DOM function in PHP
258466 by: M. Sokolewicz
258467 by: Tijnema
258471 by: Nathan Nobbe
258472 by: M. Sokolewicz
258473 by: Nathan Nobbe
How would i construct a date from year/week?
258468 by: Søren Neigaard
258469 by: Chris Boget
Re: Where does PHP look for php.ini??
258470 by: Nathan Nobbe
258474 by: Mario Guenterberg
Re: About PHP CMS
258475 by: tedd
Anyone recommend a great phpmysql knowledge base?
258476 by: Graham Anderson
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Kelvin Park wrote:
I'm getting the following fatal error message:
*Fatal error*: Cannot instantiate non-existent class: domdocument in *
/home/hosting/infotechnow_com/htdocs/admin/inventory/catalog.php* on
line *3
*
when running this code:
// Initialize new object for DOMDocument
$doc = new DOMDocument();
What's the problem?
**
You don't have the DOM extension installed (req. PHP5 in case you're not
running that either)... seems pretty obvious to me :)
www.php.net/dom
--- End Message ---
--- Begin Message ---
On 7/8/07, Kelvin Park <[EMAIL PROTECTED]> wrote:
I'm getting the following fatal error message:
*Fatal error*: Cannot instantiate non-existent class: domdocument in *
/home/hosting/infotechnow_com/htdocs/admin/inventory/catalog.php* on line *3
*
when running this code:
// Initialize new object for DOMDocument
$doc = new DOMDocument();
What's the problem?
**
Which PHP version are you using?
from the manual[1]:
"The DOM extension allows you to operate on XML documents through the
DOM API with PHP 5.
For PHP 4, use DOM XML. "
Tijnema
[1] http://www.php.net/manual/en/ref.dom.php
--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info
--- End Message ---
--- Begin Message ---
On 7/8/07, M. Sokolewicz <[EMAIL PROTECTED]> wrote:
You don't have the DOM extension installed (req. PHP5 in case you're not
There is no DOM extension it is part of the PHP5 core; this from the DOM
documantation <http://www.php.net/manual/en/ref.dom.php> in
the online handbook:
*Installation
There is no installation needed to use these functions; they are part of the
PHP core.*
This leads me to beleive OP is using PHP4. Kelvin, create a phpinfo()
script to determine
if youre running PHP4 or PHP5.
-nathan
On 7/8/07, M. Sokolewicz <[EMAIL PROTECTED]> wrote:
Kelvin Park wrote:
> I'm getting the following fatal error message:
>
> *Fatal error*: Cannot instantiate non-existent class: domdocument in *
> /home/hosting/infotechnow_com/htdocs/admin/inventory/catalog.php* on
> line *3
> *
> when running this code:
>
> // Initialize new object for DOMDocument
> $doc = new DOMDocument();
>
> What's the problem?
> **
>
You don't have the DOM extension installed (req. PHP5 in case you're not
running that either)... seems pretty obvious to me :)
www.php.net/dom
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Actually, I'll have to correct you on that.
Everything in PHP is an extension, even the standard functions (which
are part of the 'standard' extension). Some extensions are "built-in"
while others are not (ie. standard, in PHP5, the DOM module is
built-in). However, this does not mean they are also enabled! There are
hosts which build php with --disable-dom, there are also hosts which
build php with --disable-libxml thus disabling all xml-related
functionality.
- Tul
Nathan Nobbe wrote:
On 7/8/07, M. Sokolewicz <[EMAIL PROTECTED]> wrote:
You don't have the DOM extension installed (req. PHP5 in case you're not
There is no DOM extension it is part of the PHP5 core; this from the DOM
documantation <http://www.php.net/manual/en/ref.dom.php> in
the online handbook:
*Installation
There is no installation needed to use these functions; they are part of
the
PHP core.*
This leads me to beleive OP is using PHP4. Kelvin, create a phpinfo()
script to determine
if youre running PHP4 or PHP5.
-nathan
On 7/8/07, M. Sokolewicz <[EMAIL PROTECTED]> wrote:
Kelvin Park wrote:
> I'm getting the following fatal error message:
>
> *Fatal error*: Cannot instantiate non-existent class: domdocument in *
> /home/hosting/infotechnow_com/htdocs/admin/inventory/catalog.php* on
> line *3
> *
> when running this code:
>
> // Initialize new object for DOMDocument
> $doc = new DOMDocument();
>
> What's the problem?
> **
>
You don't have the DOM extension installed (req. PHP5 in case you're not
running that either)... seems pretty obvious to me :)
www.php.net/dom
--
--- End Message ---
--- Begin Message ---
My appologies M.
looking through the output of phpinfo() on a PHP5 install i have found a
line which says
dom
DOM/XML enabled
which would allude to an ability to disable it. also, i was looking at the
XSL extension and discovered
Installation
PHP 5 includes the XSL extension by default and can be enabled by adding the
argument --with-xsl[=DIR] to your configure line. DIR is the libxslt
installation directory.
so the XSL extension seems to work differently
than XML extension. both extensions are availble with the PHP5 core
but where DOM is enabled by default XSL must be explicitly enabled.
is there a portion of the documentation that you are aware of that clearly
explains this? enabling and disabling core extensions..
thanks,
-nathan
On 7/8/07, M. Sokolewicz <[EMAIL PROTECTED]> wrote:
Actually, I'll have to correct you on that.
Everything in PHP is an extension, even the standard functions (which
are part of the 'standard' extension). Some extensions are "built-in"
while others are not (ie. standard, in PHP5, the DOM module is
built-in). However, this does not mean they are also enabled! There are
hosts which build php with --disable-dom, there are also hosts which
build php with --disable-libxml thus disabling all xml-related
functionality.
- Tul
Nathan Nobbe wrote:
>> On 7/8/07, M. Sokolewicz <[EMAIL PROTECTED]> wrote:
>> You don't have the DOM extension installed (req. PHP5 in case you're
not
>
> There is no DOM extension it is part of the PHP5 core; this from the DOM
> documantation <http://www.php.net/manual/en/ref.dom.php> in
> the online handbook:
>
> *Installation
> There is no installation needed to use these functions; they are part of
> the
> PHP core.*
>
> This leads me to beleive OP is using PHP4. Kelvin, create a phpinfo()
> script to determine
> if youre running PHP4 or PHP5.
>
> -nathan
>
>
> On 7/8/07, M. Sokolewicz <[EMAIL PROTECTED]> wrote:
>>
>> Kelvin Park wrote:
>> > I'm getting the following fatal error message:
>> >
>> > *Fatal error*: Cannot instantiate non-existent class: domdocument in
*
>> > /home/hosting/infotechnow_com/htdocs/admin/inventory/catalog.php* on
>> > line *3
>> > *
>> > when running this code:
>> >
>> > // Initialize new object for DOMDocument
>> > $doc = new DOMDocument();
>> >
>> > What's the problem?
>> > **
>> >
>>
>> You don't have the DOM extension installed (req. PHP5 in case you're
not
>> running that either)... seems pretty obvious to me :)
>>
>> www.php.net/dom
>>
>> --
--- End Message ---
--- Begin Message ---
Hi wizards
Do any of you have a good solution for me here. I would like to
browse between weeks, and then based on the week and year construct a
full date on the monday of that week.
How on earth would I do this? How can I construct a date only given a
year and a week number?
I hope you guys can help me here, as I have absolutely NO idea :)
Best regards
Søren
smime.p7s
Description: S/MIME cryptographic signature
--- End Message ---
--- Begin Message ---
> How on earth would I do this? How can I
> construct a date only given a year and a
> week number?
> I hope you guys can help me here, as I
> have absolutely NO idea :)
// whatever week number you are working with; arbitrary value here
$weekNumber = 37;
// seconds * minutes * hours;
$day = 60 * 60 * 24;
// days in a week
$week = 7;
// get the unix time for Jan 1 of this year
$firstDayOfThisYear = mktime( 0, 0, 0, 1, 1, date( 'Y' ));
// calculate the unix time for the date of the week number
$weekNumberDate = $firstDayOfYear + ( $weekNumber * day * week );
// This will put you X weeks out of the day that Jan 1 fell on.
// If Jan 1 was on a Thursday, this date should also be on a Thursday.
// Using date( 'N', $weekNumberDate ), you can find out how many days
// you need to subtract to get your Monday date
echo date( 'm/d/Y', $weekNumberDate );
thnx,
Chris
--- End Message ---
--- Begin Message ---
On 7/6/07, Tijnema <[EMAIL PROTECTED]> wrote:
Completely missed it LOL, it looks for it in /usr/lib :S
Is that normal?
i beleive it depends on the OS/distribution. on gentoo php.ini is located
at
/etc/php/apache2-php5
Here is a bit of output from phpinfo() on a gentoo box of mine [w/ no
changes to php.ini]
Configuration File (php.ini) Path /etc/php/apache2-php5
Loaded Configuration File /etc/php/apache2-php5/php.ini
Scan this dir for additional .ini files /etc/php/apache2-php5/ext-active
additional .ini files parsed /etc/php/apache2-php5/ext-active/http.ini,
/etc/php/apache2-php5/ext-active/mcve.ini,
/etc/php/apache2-php5/ext-active/memcache.ini
-nathan
On 7/6/07, Tijnema <[EMAIL PROTECTED]> wrote:
On 7/7/07, Stut <[EMAIL PROTECTED]> wrote:
> Tijnema wrote:
> > I just noted that my php (CLI and Apache2 SAPI) doesn't read my
php.ini
> > in /etc
> > I have compiled php with --prefix=/usr, and my /usr/etc is symlinked
> > to /etc, but it doesn't read the php.ini file..
> > when I use the CLI with -c /etc it works fine :)
>
> php -i on the command line, or phpinfo() in a SAPI script will tell you
> where it expects to find it, as well as whether it did find it.
>
> -Stut
Completely missed it LOL, it looks for it in /usr/lib :S
Is that normal?
Tijnema
--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
On Sat, Jul 07, 2007 at 02:08:21AM +0200, Tijnema wrote:
> Hi,
>
> I just noted that my php (CLI and Apache2 SAPI) doesn't read my php.ini in
> /etc
> I have compiled php with --prefix=/usr, and my /usr/etc is symlinked
> to /etc, but it doesn't read the php.ini file..
> when I use the CLI with -c /etc it works fine :)
>
Hi...
you can use the configure parameter --with-config-file-path.
Greetings
Mario
--
-----------------------------------------------------
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel: 033876-21 966 |
| Notruf: 0173-277 33 60 |
| http://www.havelsoft.com |
| |
| Inhaber: Mario Günterberg |
| Mützlitzer Strasse 19 |
| 14715 Märkisch Luch |
-----------------------------------------------------
pgpdWCboJK91b.pgp
Description: PGP signature
--- End Message ---
--- Begin Message ---
At 8:24 PM -0400 7/7/07, Nathan Nobbe wrote:
kelvin,
here is the example:
catalog.php
<?php
$doc = new DOMDocument();
$xsl = new XSLTProcessor();
$doc->load('catalog.xsl');
$xsl->importStyleSheet($doc);
$doc->load('catalog.xml');
echo $xsl->transformToXML($doc);
?>
catalog.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="catalog.xsl"?>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
</catalog>
catalog.xsl
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th align="left">Title</th>
<th align="left">Artist</th>
</tr>
<xsl:for-each select="catalog/cd">
<tr>
<td><xsl:value-of select="title" /></td>
<td><xsl:value-of select="artist" /></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
in this example the xml data is imported from a file rather than built in
memory. also, i would like to mention that most browsers, ie, firefox and
opera namely can render the xhtml themselves given the xml and xsl files
which is something you may want to consider.
-nathan
Nice example.
Now, get it to validate and remove the styling attributes.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
Does anyone have a positive experience with an 'out of the box'
Knowledge Base system (hopefully open-source) that easily allows
developers to easily share/post/publish/document their code?
I know this question is a a bit general, but I figure a lot of you
guys are on such a system at work. Hopefully, there are some good/
flexible solutions out there that will prevent me from reinventing
the wheel.
Many thanks in advance :)
--- End Message ---