|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 3 Nov 2005 04:46:10 -0000 Issue 3772
php-general-digest-help
lists.php.net
Date: Wed Nov 02 2005 - 22:46:10 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 3 Nov 2005 04:46:10 -0000 Issue 3772
Topics (messages 224977 through 225021):
Re: PHP and MSSQL on Linux
224977 by: php.swimwebs.com
224984 by: php.swimwebs.com
224986 by: Nathan Tobik
224987 by: Ben
Re: could someone remove ale0952
xasamail.com from the list.
224978 by: tg-php.gryffyndevelopment.com
224979 by: Jay Blanchard
224980 by: Manish Marathe
224985 by: Jochem Maas
224993 by: Greg Donald
DOM namespace prefix troubles
224981 by: Ace McKool
224988 by: Rob
225001 by: Ace McKool
Re: question regarding Reflection
224982 by: Manish Marathe
224983 by: Manish Marathe
224992 by: Jochem Maas
224997 by: Manish Marathe
225017 by: Curt Zirzow
Richard Lynch's Email Address ...
224989 by: Jochem Maas
224996 by: James Benson
225003 by: Jochem Maas
225014 by: Curt Zirzow
225015 by: Ligaya Turmelle
225019 by: viraj
Reset STDIN pointer
224990 by: John Nichel
224995 by: Greg Donald
225021 by: Curt Zirzow
Re: PHP web based administrator... Pyrite
224991 by: Zac Barton
Re: PHP] Richard Lynch's Email Address ...
224994 by: Greg Donald
Looking for a string function
224998 by: Phillip S. Baker
224999 by: Paul Waring
225000 by: Jay Blanchard
225002 by: James Benson
225004 by: Jochem Maas
Classes and Functions
225005 by: Unknown Unknown
225006 by: Jasper Bryant-Greene
225007 by: Manish Marathe
225008 by: Unknown Unknown
225009 by: Unknown Unknown
225016 by: Jasper Bryant-Greene
225018 by: Robert Cummings
whitch class can I read EXCEL .xls file
225010 by: shimuqiiheb.abchina.com
225011 by: bala chandar
225013 by: Manish Marathe
Re: ampersand in dom with utf-8
225012 by: jonathan
Re: proc_open, fwrite, 16384 bytes magic
225020 by: Curt Zirzow
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Thanks for your help. I'd love to hear if you have any success with the
RPMs. Something I've seen over and over again in the documentation is
the compilation of php adding "--with-mssql". My PHP info output does
not include that marker.
The output is as follows
'./configure' '--build=i386-redhat-linux' '--host=i386-redhat-linux'
'--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr'
'--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin'
'--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include'
'--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var'
'--sharedstatedir=/usr/com' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--cache-file=../config.cache'
'--with-libdir=lib' '--with-config-file-path=/etc'
'--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic'
'--disable-rpath' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin'
'--with-freetype-dir=/usr' '--with-png-dir=/usr'
'--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp'
'--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png'
'--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr'
'--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp'
'--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem'
'--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars'
'--enable-trans-sid' '--enable-yp' '--enable-wddx'
'--with-pear=/usr/share/pear' '--with-kerberos'
'--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr'
'--enable-memory-limit' '--enable-shmop' '--enable-calendar'
'--enable-dbx' '--enable-dio' '--with-mime-magic=/etc/httpd/conf/magic'
'--without-sqlite' '--with-libxml-dir=/usr' '--with-xml'
'--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd'
'--without-odbc' '--disable-dom' '--disable-dba'
Howver, under additional .ini files parsed, I see the mssql file:
/etc/php.d/ldap.ini, /etc/php.d/mssql.ini, /etc/php.d/mysql.ini,
/etc/php.d/mysqli.ini, /etc/php.d/odbc.ini
And further on down are the mssql configuration settings.
Rick Emery <rick
emery.homelinux.net> wrote on 11/02/2005, 05:19:06 PM:
> Quoting php
swimwebs.com:
>
> >
> > Yup, I thought that was the problem too but when I added my server to
> > the conf file, there was no change. When you set up your MSSQL
> > connection in fedora, did you install anything else other than MSSQL
> > and PHP-MSSQL? Or did you have to set anything in your php.ini file to
> > use the new extension?
>
> Well, I didn't have the rpms; I compiled from source. I don't have that
> box available anymore, but I've checked my notes. First, I compiled
> freetds (nothing special in the configure line), then I compiled php
> using "--with-mssql=/usr" (to point to the freetds libraries). All of
> this should have been handled within the rpms, though, and if phpinfo
> is showing the mssql extension loaded, I'm not sure why it wouldn't be
> working. I don't remember modifying php.ini at all for the mssql stuff.
>
> Hopefully over the next couple of days I'll have some time to set up a
> test box and try the rpms to which you pointed me, to see if I run into
> the same trouble.
>
> Rick
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
An interesting development. I found some reference to running my PHP
script from the command line to take Apache out of the picture. Lo and
behold, the script worked. I was able to connect to the server. So the
issue seems to be related with Apache. Any idea what I would need to do
there to make the script work via the web?
Robbert
php
swimwebs.com wrote on 11/02/2005, 05:50:01 PM:
>
> Thanks for your help. I'd love to hear if you have any success with the
> RPMs. Something I've seen over and over again in the documentation is
> the compilation of php adding "--with-mssql". My PHP info output does
> not include that marker.
>
> The output is as follows
> './configure' '--build=i386-redhat-linux' '--host=i386-redhat-linux'
> '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr'
> '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin'
> '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include'
> '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var'
> '--sharedstatedir=/usr/com' '--mandir=/usr/share/man'
> '--infodir=/usr/share/info' '--cache-file=../config.cache'
> '--with-libdir=lib' '--with-config-file-path=/etc'
> '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic'
> '--disable-rpath' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin'
> '--with-freetype-dir=/usr' '--with-png-dir=/usr'
> '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp'
> '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png'
> '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr'
> '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp'
> '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem'
> '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars'
> '--enable-trans-sid' '--enable-yp' '--enable-wddx'
> '--with-pear=/usr/share/pear' '--with-kerberos'
> '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr'
> '--enable-memory-limit' '--enable-shmop' '--enable-calendar'
> '--enable-dbx' '--enable-dio' '--with-mime-magic=/etc/httpd/conf/magic'
> '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml'
> '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd'
> '--without-odbc' '--disable-dom' '--disable-dba'
>
> Howver, under additional .ini files parsed, I see the mssql file:
> /etc/php.d/ldap.ini, /etc/php.d/mssql.ini, /etc/php.d/mysql.ini,
> /etc/php.d/mysqli.ini, /etc/php.d/odbc.ini
>
> And further on down are the mssql configuration settings.
> Rick Emery wrote on 11/02/2005, 05:19:06 PM:
> > Quoting php
swimwebs.com:
> >
> > >
> > > Yup, I thought that was the problem too but when I added my server to
> > > the conf file, there was no change. When you set up your MSSQL
> > > connection in fedora, did you install anything else other than MSSQL
> > > and PHP-MSSQL? Or did you have to set anything in your php.ini file to
> > > use the new extension?
> >
> > Well, I didn't have the rpms; I compiled from source. I don't have that
> > box available anymore, but I've checked my notes. First, I compiled
> > freetds (nothing special in the configure line), then I compiled php
> > using "--with-mssql=/usr" (to point to the freetds libraries). All of
> > this should have been handled within the rpms, though, and if phpinfo
> > is showing the mssql extension loaded, I'm not sure why it wouldn't be
> > working. I don't remember modifying php.ini at all for the mssql stuff.
> >
> > Hopefully over the next couple of days I'll have some time to set up a
> > test box and try the rpms to which you pointed me, to see if I run into
> > the same trouble.
> >
> > Rick
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Are you running apache in a sandbox, I know on OpenBSD this is the
default behavior for Apache. If this is the case then you need to copy
the required libraries inside the sandbox.
Nate Tobik
(412)661-5700 x206
VigilantMinds
-----Original Message-----
From: php
swimwebs.com [mailto:php
swimwebs.com]
Sent: Wednesday, November 02, 2005 1:30 PM
To: php-general
lists.php.net
Subject: Re: [PHP] PHP and MSSQL on Linux
An interesting development. I found some reference to running my PHP
script from the command line to take Apache out of the picture. Lo and
behold, the script worked. I was able to connect to the server. So the
issue seems to be related with Apache. Any idea what I would need to do
there to make the script work via the web?
Robbert
php
swimwebs.com wrote on 11/02/2005, 05:50:01 PM:
>
> Thanks for your help. I'd love to hear if you have any success with
the
> RPMs. Something I've seen over and over again in the documentation is
> the compilation of php adding "--with-mssql". My PHP info output does
> not include that marker.
>
> The output is as follows
> './configure' '--build=i386-redhat-linux' '--host=i386-redhat-linux'
> '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr'
> '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin'
> '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include'
> '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var'
> '--sharedstatedir=/usr/com' '--mandir=/usr/share/man'
> '--infodir=/usr/share/info' '--cache-file=../config.cache'
> '--with-libdir=lib' '--with-config-file-path=/etc'
> '--with-config-file-scan-dir=/etc/php.d' '--disable-debug'
'--with-pic'
> '--disable-rpath' '--with-bz2' '--with-curl'
'--with-exec-dir=/usr/bin'
> '--with-freetype-dir=/usr' '--with-png-dir=/usr'
> '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext'
'--with-gmp'
> '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png'
> '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr'
> '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp'
> '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem'
> '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars'
> '--enable-trans-sid' '--enable-yp' '--enable-wddx'
> '--with-pear=/usr/share/pear' '--with-kerberos'
> '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr'
> '--enable-memory-limit' '--enable-shmop' '--enable-calendar'
> '--enable-dbx' '--enable-dio'
'--with-mime-magic=/etc/httpd/conf/magic'
> '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml'
> '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd'
> '--without-odbc' '--disable-dom' '--disable-dba'
>
> Howver, under additional .ini files parsed, I see the mssql file:
> /etc/php.d/ldap.ini, /etc/php.d/mssql.ini, /etc/php.d/mysql.ini,
> /etc/php.d/mysqli.ini, /etc/php.d/odbc.ini
>
> And further on down are the mssql configuration settings.
> Rick Emery wrote on 11/02/2005, 05:19:06 PM:
> > Quoting php
swimwebs.com:
> >
> > >
> > > Yup, I thought that was the problem too but when I added my server
to
> > > the conf file, there was no change. When you set up your MSSQL
> > > connection in fedora, did you install anything else other than
MSSQL
> > > and PHP-MSSQL? Or did you have to set anything in your php.ini
file to
> > > use the new extension?
> >
> > Well, I didn't have the rpms; I compiled from source. I don't have
that
> > box available anymore, but I've checked my notes. First, I compiled
> > freetds (nothing special in the configure line), then I compiled php
> > using "--with-mssql=/usr" (to point to the freetds libraries). All
of
> > this should have been handled within the rpms, though, and if
phpinfo
> > is showing the mssql extension loaded, I'm not sure why it wouldn't
be
> > working. I don't remember modifying php.ini at all for the mssql
stuff.
> >
> > Hopefully over the next couple of days I'll have some time to set up
a
> > test box and try the rpms to which you pointed me, to see if I run
into
> > the same trouble.
> >
> > Rick
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
php
swimwebs.com said the following on 11/02/2005 10:30 AM:
> An interesting development. I found some reference to running my PHP
> script from the command line to take Apache out of the picture. Lo and
> behold, the script worked. I was able to connect to the server. So the
> issue seems to be related with Apache. Any idea what I would need to do
> there to make the script work via the web?
Are you sure that both the CLI and apache installs of PHP are using the
same php.ini? I don't know enough about CLI php to know whether it does
by default or not, but it would seem to be a good place to start looking.
- Ben
attached mail follows:
That's not a sadist.. that's a masochist. :)
I nominate Jay too. It's been a while since I've seen someone go totally insane and I think Jay is the man for the job. Congrats on your promotion(??) Jay!
-TG
= = = Original message = = =
John Nichel wrote:
> Jochem Maas wrote:
>
>> getting pretty tired of receiving 'Delivery Status Notification
>> (Failure)' mails
>> from:
>>
>> TORRE-MAIL-01.net.in.iantel.com.uy
>>
>> regarding the email addr:
>>
>> ale0952
xasamail.com
>>
>> could one of the gods please remove 'him' from the list?
>>
>> tia :-)
>>
>>
>> PS - if the owner of ale0952
xasamail.com reads this - get your
>> mail server/account fixed you ()
#%$*&!^$$%^)#$*&#&%$*#%.
>>
>
> Hmmmmm....are you saying that it would be good to have an active
> moderator on this list? ;)
only if he is truely sadistic :-)
anyone fancy giving John karma? ;-)
oh hand on ...Jay Blanchard is the one with his hands deep inside
IIS these days, sounds like a sadist if evcer I heard one.
>
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.
attached mail follows:
[snip]
That's not a sadist.. that's a masochist. :)
I nominate Jay too. It's been a while since I've seen someone go totally
insane and I think Jay is the man for the job. Congrats on your
promotion(??) Jay!
[/snip]
Thank you. I think the last time you saw someone go totally insane it WAS
me. Of course as moderator I could stick RTFM in the subject
line....hmmmmm....maybe this is a good thing.....
attached mail follows:
[snip]
That's not a sadist.. that's a masochist. :)
I nominate Jay too. It's been a while since I've seen someone go totally
insane and I think Jay is the man for the job. Congrats on your
promotion(??) Jay!
Thank you. I think the last time you saw someone go totally insane it WAS
me. Of course as moderator I could stick RTFM in the subject
line....hmmmmm....maybe this is a good thing.....
[/snip]
I second removing that address for sure.
attached mail follows:
tg-php
gryffyndevelopment.com wrote:
> That's not a sadist.. that's a masochist. :)
too right you are (I had a dumbo moment), but indeed lets not let
that get in the way of Jays promotion :-)
>
> I nominate Jay too. It's been a while since I've seen someone go totally insane and I think Jay is the man for the job. Congrats on your promotion(??) Jay!
>
> -TG
>
> = = = Original message = = =
>
> John Nichel wrote:
>
>>Jochem Maas wrote:
>>
>>
>>>getting pretty tired of receiving 'Delivery Status Notification
>>>(Failure)' mails
>>>from:
>>>
>>> TORRE-MAIL-01.net.in.iantel.com.uy
>>>
>>>regarding the email addr:
>>>
>>> ale0952
xasamail.com
>>>
>>>could one of the gods please remove 'him' from the list?
>>>
>>>tia :-)
>>>
>>>
>>>PS - if the owner of ale0952
xasamail.com reads this - get your
>>>mail server/account fixed you ()
#%$*&!^$$%^)#$*&#&%$*#%.
>>>
>>
>>Hmmmmm....are you saying that it would be good to have an active
>>moderator on this list? ;)
>
>
> only if he is truely sadistic :-)
>
> anyone fancy giving John karma? ;-)
> oh hand on ...Jay Blanchard is the one with his hands deep inside
> IIS these days, sounds like a sadist if evcer I heard one.
>
>
>
>
> ___________________________________________________________
> Sent by ePrompter, the premier email notification software.
> Free download at http://www.ePrompter.com.
>
attached mail follows:
On Wed, 2 Nov 2005, John Nichel wrote:
> Hmmmmm....are you saying that it would be good to have an active moderator on
> this list? ;)
:0
* ^From.*postmaster
mail.Antel.com.uy
/dev/null
--
Greg Donald
Zend Certified Engineer
MySQL Core Certification
http://destiney.com/
attached mail follows:
Howdy folks,
I'm using PHP 5.0.5 with the DOM enabled and I'm trying to create an XML
doc with PHP. The problem I'm having is attaching a namespace prefix to a
tag.
What I'm trying to create is something like the following:
<?xml version="1.0" encoding="UTF-8" ?>
<Notes xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:
CommonAggregateComponents-1.0">
<cac:Note />
</Notes>
I am unable to create the "<cac:Note />" element with the "cac:" namespace
prefix. Any suggestions would be appreciated!
attached mail follows:
Ace McKool wrote:
> What I'm trying to create is something like the following:
> <?xml version="1.0" encoding="UTF-8" ?>
> <Notes xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:
> CommonAggregateComponents-1.0">
> <cac:Note />
> </Notes>
> I am unable to create the "<cac:Note />" element with the "cac:" namespace
> prefix. Any suggestions would be appreciated!
>
$dom = new DOMDocument("1.0", "UTF-8");
$root = $dom->createElement('Notes');
$dom->appendChild($root);
$root->setAttributeNS("http://www.w3.org/2000/xmlns/", 'xmlns:cac',
'urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-1.0');
$child =
$dom->createElementNS('urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-1.0',
'cac:Note');
$root->appendChild($child);
Hope that helps.
Rob
attached mail follows:
Thanks Rob! That solved my probem. Thanks again!
On 11/2/05, Rob <rrichards
ctindustries.net> wrote:
>
> Ace McKool wrote:
>
> > What I'm trying to create is something like the following:
> > <?xml version="1.0" encoding="UTF-8" ?>
> > <Notes xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:
> > CommonAggregateComponents-1.0">
> > <cac:Note />
> > </Notes>
> > I am unable to create the "<cac:Note />" element with the "cac:"
> namespace
> > prefix. Any suggestions would be appreciated!
> >
>
> $dom = new DOMDocument("1.0", "UTF-8");
> $root = $dom->createElement('Notes');
> $dom->appendChild($root);
>
> $root->setAttributeNS("http://www.w3.org/2000/xmlns/", 'xmlns:cac',
>
> 'urn:oasis:names:specification:ubl:schema:xsd:
> CommonAggregateComponents-1.0');
>
> $child =
> $dom->createElementNS('urn:oasis:names:specification:ubl:schema:xsd:
> CommonAggregateComponents-1.0',
>
> 'cac:Note');
>
> $root->appendChild($child);
>
> Hope that helps.
>
> Rob
>
>
attached mail follows:
Sorry for spamming but I didn't mean to reply you privately :(
On 11/1/05, Jochem Maas <jochem
iamjochem.com> wrote:
>
> Manish Marathe wrote:
> > Hello All,
> >
> > I am developing a unit test generator for PHP. The generated tests would
> be
> > PHPUnit2 compatible and I will be using the Reflection API to generate
> the
> > tests. The tests would be generated only for classes and written on PHP
> > 5.0.3 compatible.
> >
> > My question is to use the Reflection API, I need to import the original
> > class for which I am generating tests. For example to generate a tests
> for
> > class Company which is in Company.php:
> >
> > include_once('company.php');
> >
> > $c = new ReflectionClass('Company');
> >
> > If I have to generate test for many classes at once, it would be foolish
> to
> > have them included in my file on the runtime. Am I understanding it
>
> a complex app can have 100's of classes, not usually all loaded at once
> but still.
>
> the upper limit is depends on how much memory your generation process is
> allowed
> to grow to, how often you [need to] run it, how process-intensive it is to
> run
> the generation and how big your iron is.
Well, its not me who is going to run the unit tests but it the user who is
going to. As I said I am developing an automatic unit test "generator",
which will generate tests for the user and then the user can run them. So
its totally upto the user to decide how many classes to load, how frequently
to load them.
you might consider using forking in a master process and letting a series of
> child processes each handle a chunk of all the classes to generate tests
> for,
> basically running in parallel.
>
> I don't see how you can avoid loading many classes 'at once', why do you
> think this is foolish [by definition]?
>
I am sorry if I have hurted anyone's feelings here but by foolish simply I
was pointing to the same problem you stated which is of allocating the
memory and which I definitely foresee.
Thank You any way, forking should help but my problem was, I guess I didn't
explain it well but to use the ReflectionClass like above I have to include
the class file into my script. Is it possible to keep all the class files
somewhere in the path where PHP can look for and I don't have to include in
my script.
Manish Marathe
SpikeSource, Inc.
http://developer.spikesource.com
attached mail follows:
On 11/1/05, Curt Zirzow <czirzow
gmail.com> wrote:
>
> On Tue, 01 Nov 2005 14:31:12 -0800, Manish Marathe wrote:
>
> > ...
> > My question is to use the Reflection API, I need to import the original
> > class for which I am generating tests. For example to generate a tests
> for
> > class Company which is in Company.php:
> >
> > include_once('company.php');
> >
> > $c = new ReflectionClass('Company');
> >
> > If I have to generate test for many classes at once, it would be foolish
> > to have them included in my file on the runtime. Am I understanding it
> > correctly ?
>
> Yes you are understanding correctly. You can avoid this issue by using
> the pcntl[1] tools available in php (assuming this is a *nix environment.)
> A simple usage would be something like:
>
> <?php
>
> $pid = pcntl_fork();
> if ($pid == -1) {
>
> die('could not fork');
>
> } else if ($pid) {
>
> // we are the parent
> pcntl_wait($status); //Protect against Zombie children
>
> echo 'Class is defined: ';
> var_dump(class_exists('foobar', false));
>
> } else {
>
> // we are the child
> // create a class to see if the parent sees it
> class foobar { }
>
> // do your Unit testing..
>
> }
The parent process would just iterate through all the class files
> you need to include and fork a child. Then you can include the file in
> the child process run your unit test and then exit.
>
> I use this method for any sort of long lasting script that causes a lot of
> memory or resource usage.
Wow, this certainly helps when we actually run the unit tests and I didn't
think of this earlier so my next question has been already answered by you I
guess if I understand you.
My current problem is this: Below is some chunk of the scrip I am writing to
generate test code.
include_once "Company.php";
class TestGenerator {
public function TestGenerator() {
}
public function catchReflection() {
$classInfo = new ReflectionClass('Company');
// Below here I will be getting all the information about the class
"Company" and then I will be generating a test class CompanyTest which
resides in the file CompanyTest.php.
}
}
So in this script of mine I have included the Company.php above because the
statement $classInfo = new ReflectionClass('Company'); uses it. Now this is
just an example I have taken to see how my generator works. The user would
use the TestGenerator something like this:
php TestGenerator.php myClass
Now is there a way that in my script I can let PHP look for a file
myClass.php or for that matter any php file that has myClass so that I don't
have to include it, as it is totally upto the user which file its gonna pass
to the TestGenerator.php script to generate the test code and I cannot
statically include that in my file. I believe this time I have stated my
problem clearer, earlier I did not, I apologize.
Thank You
Manish Marathe
SpikeSource, Inc.
http://developer.spikesource.com
attached mail follows:
Manish Marathe wrote:
> Sorry for spamming but I didn't mean to reply you privately :(
I did it myself by accident 2 minutes ago :-)
no probs.
...
>
> Well, its not me who is going to run the unit tests but it the user who
> is going to. As I said I am developing an automatic unit test
> "generator", which will generate tests for the user and then the user
> can run them. So its totally upto the user to decide how many classes to
> load, how frequently to load them.
I assumed as much. Its sounds very interesting!
>
> you might consider using forking in a master process and letting a
> series of
> child processes each handle a chunk of all the classes to generate
> tests for,
> basically running in parallel.
>
> I don't see how you can avoid loading many classes 'at once',
> why do you
> think this is foolish [by definition]?
>
>
> I am sorry if I have hurted anyone's feelings here but by foolish simply
au contraire. I don't think anyone was hurt.
> I was pointing to the same problem you stated which is of allocating the
> memory and which I definitely foresee.
>
> Thank You any way, forking should help but my problem was, I guess I
> didn't explain it well but to use the ReflectionClass like above I have
> to include the class file into my script. Is it possible to keep all the
> class files somewhere in the path where PHP can look for and I don't
> have to include in my script.
php.ini setting include_path - its a simple concept, /^RT(?:F)?M$/.
but your problem is more complex than that, you are building a tool that
seems to be intend to form [part of] a php development/project environment
which means essentially you need to be able to hook in arbitrary projects
into a an installed test system which consistents of your generation tool
(and other modules). I envisage a simple interface (cmdline) to register
projects ... and a search engine thats capable of finding php code (tokenizer?),
locating all class defs in registered projects - and keeping track of
located files.
now imagine a generator deamon that just sits running occasionally doing
the following (triggered by e.g.: regular-timeout, cvs commit msg, soap msg,
etc):
scan the projects for new/changed files.
examine the found files.
(re)generate tests for each changed/new class found.
the trick indeed to to take the monolithic process above
and parallelize it (made that word up, I think, heck C.S.Lewis did it).
the master deamon could track which project(s) are showing most [recent!] activity
and could for instance spawn 3 children:
1. SCANNER
2. PARSER
3. GENERATOR
each of the above spawns a child for each [active?] project (accounting for activity stats in order
they are spawned and more interestingly in the ammount of CPU you give each
process? [can you even 'nice' a child process in php? note to self: rtfm]
let all processes log/read to/from a central place (I like firebird :-)
and act accordingly...
you might consider to conditionally (no idea what conditions though!)
spawn children for handling the scanning/parsing/generation of files
in [delayed] chunks.
again central logging could allow you to control how fast children are spawned,
max memory usage, num of children.... the AUTGenerator family tree (sideways):
1. SCANNER
proj1
proj2
kid1
kid2
kid3
proj3
proj4
2. PARSER
proj1
proj2
kid1
kid2
kid3
proj3
proj4
3. GENERATOR
proj1
proj2
kid1
kid2
kid3
proj3
proj4
the master deamon could even be rigged to response to msgs
to change config values on fly.
just a thought. keep us posted :-)
anyway there is no shame in getting the CPU warm :-) if you are writing compiled code,
the continuous re-compiling ammounts to the same kind of thing, no?
>
>
> Manish Marathe
> SpikeSource, Inc.
> http://developer.spikesource.com
attached mail follows:
On 11/2/05, Jochem Maas <jochem
iamjochem.com> wrote:
>
> Manish Marathe wrote:
> > Sorry for spamming but I didn't mean to reply you privately :(
>
> I did it myself by accident 2 minutes ago :-)
> no probs.
Thanks
> I am sorry if I have hurted anyone's feelings here but by foolish simply
>
> au contraire. I don't think anyone was hurt.
:) No, I was just emotionally black-mailing but in essence, I meant
something which is not in best practices
Is it possible to keep all the
> > class files somewhere in the path where PHP can look for and I don't
> > have to include in my script.
>
> php.ini setting include_path - its a simple concept, /^RT(?:F)?M$/.
Well, I saw my php.ini earlier and I guess '.' the current directory is
included in the path, so kept the file which had a class (Company) for which
I wished to generate test cases in the same directory as my script (
TestGenerator.php) dir and then just tried to execute like:
php TestGenerator.php Company
And I didn't include Company.php in TestGenerator.php thinking that PHP will
find that class since the file is in the path.
but your problem is more complex than that, you are building a tool that
> seems to be intend to form [part of] a php development/project environment
> which means essentially you need to be able to hook in arbitrary projects
> into a an installed test system which consistents of your generation tool
> (and other modules).
No, I am keeping it very simple for the first case.
I envisage a simple interface (cmdline) to register
> projects ... and a search engine thats capable of finding php code
> (tokenizer?),
> locating all class defs in registered projects - and keeping track of
> located files.
>
> now imagine a generator deamon that just sits running occasionally doing
> the following (triggered by e.g.: regular-timeout, cvs commit msg, soap
> msg,
> etc):
>
> scan the projects for new/changed files.
> examine the found files.
> (re)generate tests for each changed/new class found.
>
> the trick indeed to to take the monolithic process above
> and parallelize it (made that word up, I think, heck C.S.Lewis did it).
>
> the master deamon could track which project(s) are showing most [recent!]
> activity
> and could for instance spawn 3 children:
>
> 1. SCANNER
> 2. PARSER
> 3. GENERATOR
>
> each of the above spawns a child for each [active?] project (accounting
> for activity stats in order
> they are spawned and more interestingly in the ammount of CPU you give
> each
> process? [can you even 'nice' a child process in php? note to self: rtfm]
>
>
This is an awesome idea although I am really a noobe and really would like
to start with a simple concept of generating unit test code only for php
files having classes, no in-line code. But your idea definitely should shape
a project developing into a practical use. Would definitely think about
that!!
attached mail follows:
On Wed, 02 Nov 2005 10:29:25 -0800, Manish Marathe wrote:
> ...
> My current problem is this: Below is some chunk of the scrip I am writing
> to generate test code.
>
> include_once "Company.php";
>
> class TestGenerator {
>
> public function TestGenerator() {
>
>
> }
> public function catchReflection() {
> ...
>
> So in this script of mine I have included the Company.php above because
> the statement $classInfo = new ReflectionClass('Company'); uses it. Now
> this is just an example I have taken to see how my generator works. The
> user would use the TestGenerator something like this:
>
> php TestGenerator.php myClass
>
> Now is there a way that in my script I can let PHP look for a file
> myClass.php or for that matter any php file that has myClass so that I
> don't have to include it, as it is totally upto the user which file its
> gonna pass to the TestGenerator.php script to generate the test code and I
I believe it was mentioned in the other thread but just have in your
script:
ini_set('include_path', '.');
And you script would do something like:
require($argv[1] . '.php'); // assuming you validated argv[1]
And then you can safely do something like:
try {
$t = new ReflectionClass($argv[1]);
}
catch(Exception $e) {
echo "Failed trying to create {$argv[1]}\n";
echo $e;
exit();
}
And the user runs the script with:
php TestGenerator.php MyClass
As long as the naming convention happens to be that the class definition
must be the same as the filename (including case and without the .php of
course) this will work. Of course you could always add another argument to
your script so they can override the default include file used:
php TestGenerator.php MyClass class.myclass.php
Where class.myclass.php is the file that defines MyClass.
HTH,
Curt.
--
http://news.zirzow.dyndns.org/
attached mail follows:
I totally agree with Richard. about the need for
a php func for checking a correct email addr.
given that php 'is all about the web', idealogically
(still?) pragmatic and dynamically typed:
is_email_addr() or is_email()
just 'belongs' with:
is_array()
is_bool()
is_callable()
is_double()
is_float()
is_int()
is_integer()
is_long()
is_null()
is_numeric()
is_object()
is_real()
is_resource()
is_scalar()
is_string()
any devs care to comment?
kind regards
attached mail follows:
Would it not be better something like valid_email()
Reason:
The is_* family check for a variable type so dont think that it really
fits into the same catagory.
James
Jochem Maas wrote:
> I totally agree with Richard. about the need for
> a php func for checking a correct email addr.
>
> given that php 'is all about the web', idealogically
> (still?) pragmatic and dynamically typed:
>
> is_email_addr() or is_email()
>
> just 'belongs' with:
>
> is_array()
> is_bool()
> is_callable()
> is_double()
> is_float()
> is_int()
> is_integer()
> is_long()
> is_null()
> is_numeric()
> is_object()
> is_real()
> is_resource()
> is_scalar()
> is_string()
>
> any devs care to comment?
>
> kind regards
attached mail follows:
James Benson wrote:
> Would it not be better something like valid_email()
>
sounds fine. call it what you like. :-)
> Reason:
> The is_* family check for a variable type so dont think that it really
> fits into the same catagory.
twas a long shot ;-)
>
>
> James
>
>
>
>
> Jochem Maas wrote:
>
>> I totally agree with Richard. about the need for
>> a php func for checking a correct email addr.
>>
>> given that php 'is all about the web', idealogically
>> (still?) pragmatic and dynamically typed:
>>
>> is_email_addr() or is_email()
>>
>> just 'belongs' with:
>>
>> is_array()
>> is_bool()
>> is_callable()
>> is_double()
>> is_float()
>> is_int()
>> is_integer()
>> is_long()
>> is_null()
>> is_numeric()
>> is_object()
>> is_real()
>> is_resource()
>> is_scalar()
>> is_string()
>>
>> any devs care to comment?
>>
>> kind regards
>
>
attached mail follows:
On Wed, 02 Nov 2005 21:19:24 +0100, Jochem Maas wrote:
> I totally agree with Richard. about the need for a php func for checking a
> correct email addr.
>
> given that php 'is all about the web', idealogically (still?) pragmatic
> and dynamically typed:
>
> is_email_addr() or is_email()
There already is:
http://php.net/imap_rfc822_parse_adrlist
http://pecl.php.net/mailparse
Curt.
--
http://news.zirzow.dyndns.org/
attached mail follows:
>There already is:
> http://php.net/imap_rfc822_parse_adrlist
>
>
quote from user contributed notes:
"| This function does NOT test the syntax of either the local part, or
the host part, it will permit illegal characters on either side."|
--
Respectfully,
Ligaya Turmelle
"Life is a game.... so have fun"
attached mail follows:
dear all,
does PHP really needs a function to validate an email address!! i
doubt. because PHP is a language which provides number of string
functions with regex capabilities to develop what ever pattern
matching you want.
second point is, different organizations have different policies on
validating email addresses, so again those developers have to mend
their own mechanisms. so everybody will not benefit this effort.
third point is, if we add another function to PHP which, bit off from
the scope of a programming language someone else will request for some
other function to validate a time format, time zone or family
name(last name)!!, it will be a real mess!!
just my two cents! if i have misinterpreted something please clear me.
thanks.
~viraj
On 11/3/05, Ligaya Turmelle <lig
maolek.com> wrote:
>
> >There already is:
> > http://php.net/imap_rfc822_parse_adrlist
> >
> >
> quote from user contributed notes:
>
> "| This function does NOT test the syntax of either the local part, or
> the host part, it will permit illegal characters on either side."|
>
> --
> Respectfully,
> Ligaya Turmelle
>
> "Life is a game.... so have fun"
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
There has to be a way to do this....reset the internal STDIN pointer to
the begining but I'll be damned if I can find it.
reset ( STDIN );
returns an error.
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
jnichel
dotcomholdingsofbuffalo.com
attached mail follows:
On Wed, 2 Nov 2005, John Nichel wrote:
> There has to be a way to do this....reset the internal STDIN pointer to the
> begining but I'll be damned if I can find it.
>
> reset ( STDIN );
>
> returns an error.
You can use rewind() on an fopen()'d php://stdin.
--
Greg Donald
Zend Certified Engineer
MySQL Core Certification
http://destiney.com/
attached mail follows:
On Wed, 02 Nov 2005 15:20:46 -0500, John Nichel wrote:
> There has to be a way to do this....reset the internal STDIN pointer to
> the begining but I'll be damned if I can find it.
>
> reset ( STDIN );
>
> returns an error.
The internal STDIN pointer? there is no such thing by the name of STDIN in
php.
According to http://php.net/reset it epxects an array not a file handle,
so the error would be expected.
I might be wrong but stdin is not seekable so i doubt it is even possble
to put the file handle back to the beginning.
What are you exactly trying to do to move the stdin pointer to the
beginning?
Curt.
--
http://news.zirzow.dyndns.org/
attached mail follows:
Hi James
Thanks for you comments, its a fair call.
All I could add at this stage is that you have to login to Pyrite to be able
to do any editing of the php.ini files and you can configure Pyrite to only
work via Locahost and not remote connections. It is also true that you do
need write permissions to the php.ini file and I would hope that Apache is
setup to use a non-root account but with privileges to write to the
php.inifile.
I could deff use an extra pair of eyes over the code to make sure the app is
as secure as humanly possible... interested?
Best
Zac
On 11/3/05, James Benson <jb
jamesbenson.co.uk> wrote:
>
> It should be fine for windows but how are you gonna save the php.ini on
> any linux box that typically (when setup correctly) requires root access
> to save the file, your opening up a security hole with something like
> that unless you tackle this issue some other way!
>
>
> James
>
>
>
>
> Zac Barton wrote:
> > Hi list
> >
> > I have been working on a free web based app that lets you update the
> > php.inifrom your browser very much like Coldfusion has.
> >
> > You can find a demo off the app at
> > http://pyrite.zacbarton.com<http://217.150.107.157/pyrite>and im
> > looking to see if anyone thinks this might be useful or share any
> > ideas/comments
> > before I take it any further.
> >
> > The demo site is pointing to a test php.ini file so feel free to play
> with
> > it.
> >
> > Regards
> > Zac
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
On Wed, 2 Nov 2005, Jochem Maas wrote:
> is_email_addr() or is_email()
>
> just 'belongs' with:
>
> is_array()
> is_bool()
> is_callable()
> is_double()
> is_float()
> is_int()
> is_integer()
> is_long()
> is_null()
> is_numeric()
> is_object()
> is_real()
> is_resource()
> is_scalar()
> is_string()
Until they add it, just use the handy-dandy Perl module:
http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html
--
Greg Donald
Zend Certified Engineer
MySQL Core Certification
http://destiney.com/
attached mail follows:
Greetigns Gents,
I seem to remember a built in php function that will take a huge block of
text.
Then just spit out X number of characters from it and follow it with an
additional string value.
But I cannot remember what it is.
I seem to remember it being something other than the substr().
I am looking to pull the first say 200 characters from an article and follow
the last character/word with something like ...
Does anyone know what I am talking about, or am I just smoking something and
my memory is going?
Blessed Be
Phillip
attached mail follows:
On Wed, Nov 02, 2005 at 02:35:47PM -0700, Phillip S. Baker wrote:
> I seem to remember a built in php function that will take a huge block of
> text.
> Then just spit out X number of characters from it and follow it with an
> additional string value.
> But I cannot remember what it is.
I don't know if there's a built-in PHP function to do what you want, but
I wrote this function for one of the sites I run that does the same
thing. Feel free to use it (or expand it to use a custom 'cut off'
string) if you want.
function crop_text($text, $max_length)
{
return strlen($text) > $max_length ? substr($text, 0,
$max_length - 3)
. '...' : $text;
}
$excerpt = crop_text($input_text, 200);
Paul
--
Rogue Tory
http://www.roguetory.org.uk
attached mail follows:
[snip]
I seem to remember a built in php function that will take a huge block of
text.
Then just spit out X number of characters from it and follow it with an
additional string value.
But I cannot remember what it is.
I seem to remember it being something other than the substr().
I am looking to pull the first say 200 characters from an article and follow
the last character/word with something like ...
Does anyone know what I am talking about, or am I just smoking something and
my memory is going?
[/snip]
Usually folks roll their own as there is no set function for this.
$myShortString = substr($string, 0, 200)."...";
will work, but you're going to cutoff in the middle of some word at the end
of the substring usually.
attached mail follows:
How about substr_replace()
http://php.net/substr_replace
Phillip S. Baker wrote:
> Greetigns Gents,
>
> I seem to remember a built in php function that will take a huge block of
> text.
> Then just spit out X number of characters from it and follow it with an
> additional string value.
> But I cannot remember what it is.
>
> I seem to remember it being something other than the substr().
>
> I am looking to pull the first say 200 characters from an article and follow
> the last character/word with something like ...
>
> Does anyone know what I am talking about, or am I just smoking something and
> my memory is going?
>
> Blessed Be
>
> Phillip
attached mail follows:
Jay Blanchard wrote:
> [snip]
> I seem to remember a built in php function that will take a huge block of
> text.
> Then just spit out X number of characters from it and follow it with an
> additional string value.
> But I cannot remember what it is.
>
> I seem to remember it being something other than the substr().
>
> I am looking to pull the first say 200 characters from an article and follow
> the last character/word with something like ...
>
> Does anyone know what I am talking about, or am I just smoking something and
> my memory is going?
> [/snip]
>
> Usually folks roll their own as there is no set function for this.
>
> $myShortString = substr($string, 0, 200)."...";
>
> will work, but you're going to cutoff in the middle of some word at the end
> of the substring usually.
and the fun really starts when the text contains html markup (or even bbcode, yuck)
that needs to end up as part of the 300 odd characters of text you want displayed
(a url is oftens 100+ chars long in itself but you don't want to count it
when determining the cutoff string offset.
>
attached mail follows:
Hi everybody i have a class that i reference with:
$DB= new DBInterface;
outside a function it works fine, but using $DB inside a function changes
the data type i think... i get an error saying i'm using a method on a
non-object...
any help appreciatted
attached mail follows:
On Wed, 2005-11-02 at 18:56 -0500, Unknown Unknown wrote:
> Hi everybody i have a class that i reference with:
> $DB= new DBInterface;
> outside a function it works fine, but using $DB inside a function changes
> the data type i think... i get an error saying i'm using a method on a
> non-object...
> any help appreciatted
If you are attempting to access the variable $DB inside the function
scope, like this:
$DB = new DBInterface;
function doSomething() {
$DB->doSomethingElse();
}
Then it will not work unless you either pass $DB to doSomething(), or
declare $DB as a global at the start of the function. Like this:
function doSomething() {
global $DB;
$DB->doSomethingElse();
}
Or access $DB through the globals superglobal. RTFM.
--
Jasper Bryant-Greene
General Manager
Album Limited
e: jasper
album.co.nz
w: http://www.album.co.nz/
b: http://jbg.name/
p: 0800 4 ALBUM (0800 425 286) or +64 21 232 3303
a: PO Box 579, Christchurch 8015, New Zealand
attached mail follows:
On 11/2/05, Unknown Unknown <phpinfolist
gmail.com> wrote:
>
> Hi everybody i have a class that i reference with:
> $DB= new DBInterface;
> outside a function it works fine, but using $DB inside a function changes
> the data type i think... i get an error saying i'm using a method on a
> non-object...
> any help appreciatted
if you mean by "inside a function", a method of your class DBInterface then
you can can use $this. Otherwise you can do something like:
$DB= new DBInterface();
and then I believe you should be able to use $DB at it is.
attached mail follows:
Ahhhh thanks, i tried that before didn't seem to work, now it works
Thanks again!
attached mail follows:
Oh thanks again
and what does RTFM mean?
attached mail follows:
On Wed, 2005-11-02 at 19:05 -0500, Unknown Unknown wrote:
> Oh thanks again
> and what does RTFM mean?
Read The [insert your favourite word beginning with F here] Manual.
--
Jasper Bryant-Greene
General Manager
Album Limited
e: jasper
album.co.nz
w: http://www.album.co.nz/
b: http://jbg.name/
p: 0800 4 ALBUM (0800 425 286) or +64 21 232 3303
a: PO Box 579, Christchurch 8015, New Zealand
attached mail follows:
On Thu, 2005-11-03 at 12:15, Jasper Bryant-Greene wrote:
> On Wed, 2005-11-02 at 19:05 -0500, Unknown Unknown wrote:
> > Oh thanks again
> > and what does RTFM mean?
>
> Read The [insert your favourite word beginning with F here] Manual.
"Fondu"?? *licks lips*
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
Dear all:
whitch class can I read EXCEL .xls file
I want to read data from a excel's .xls file on Linux use php,please tell
me way.
Thank you
¡Ô¡Þ¡Ø¡Ë¡Ë¢¡¡ü¡ý¨’¡Ñ
shimuqiiheb
abchina.com
Tel:)#!^_^*#*
!^
attached mail follows:
Hi,
On 11/3/05, shimuqiiheb
abchina.com <shimuqiiheb
abchina.com> wrote:
> Dear all:
>
> whitch class can I read EXCEL .xls file
> I want to read data from a excel's .xls file on Linux use php,please tell
> me way.
There is a phpexcelreader project going on sf.net. check out there it works fine
--
<name> balachandar muruganantham</name>
<Yahoo!> mbchandar</Yahoo!>
<Hotmail> mbchandar</Hotmail>
<blog> http://chandar.blogspot.com</blog>
<web>http://www.balachandar.net</web>
<talk> http://www.expertstalk.org</talk>
<shop>http://www.chennaishopping.com</shop>
attached mail follows:
On 11/2/05, bala chandar <mbchandar
gmail.com> wrote:
>
> Hi,
>
> On 11/3/05, shimuqiiheb
abchina.com <shimuqiiheb
abchina.com> wrote:
> > Dear all:
> >
> > whitch class can I read EXCEL .xls file
> > I want to read data from a excel's .xls file on Linux use php,please
> tell
> > me way.
>
> There is a phpexcelreader project going on sf.net <http://sf.net>. check
> out there it works fine
Or if you do not want it to be completely automatic, export the .xls file in
.csv (comma separated values) and then do the usual file read, line by line.
For each line you get use the explode() function with the delimiter you have
set and then finally you will get an array of all values per line. Loop
through this till the end of the file.
Manish Marathe
SpikeSource, Inc.
http://developer.spikesource.com
attached mail follows:
so I decided it would be best just to convert back to the original
format so for this string:
$string="braised beef shortribs with sautéed greens, pearl
onions and horseradish cream"
I do an html_entity_decode($string);
but this still gives me an error when I add it via the DOM functions
but render with the è in php. If I look at the xml in firefox on a
mac, it looks like this:
<name>braised beef shortribs with saut?ed greens, pearl onions and
horseradish cream</name>
I know that this is a basic question but how could I get this go
through?
Here is how I'm actually adding via the DOMDocument class:
$name->appendChild($dom->createTextNode
(html_entity_decode($item_row[slot])));
$item->appendChild($name);
Is there any way I could on the client side query the xml string for
the encoding to be sure that that in fact is utf-8? The first line of
the generated xml is:
<?xml version="1.0" encoding="utf-8"?>
thanks for any help.
-jonathan
On Oct 16, 2005, at 1:36 AM, ac wrote:
> try this,
> if you need more entities to be included,
> just refer to
> `http://www.w3.org/2003/entities/iso8879/isolat1.ent' or find out its
> charcode by yourself.
>
> <?xml version="1.0"?>
> <!DOCTYPE html [
> <!ENTITY egrave "è">
> <!ENTITY icirc "î">
> ]>
> <item_name>farm lettuces with reed avocado, crème
> fraîche, radish and cilantro</item_name>
>
>
> On 10/13/05, jonathan <news_php
arclocal.com> wrote:
>
>> I'm now getting this error:
>>
>> XML Parsing Error: undefined entity
>>
>> with the following entity at the first ampersand:
>> <item_name>farm lettuces with reed avocado, crème
>> fraîche, radish and cilantro</item_name>
>>
>> Why is an ampersand considered an undefined entity? The xml version
>> is: <?xml version="1.0"?>
>>
>> Any thoughts please?
>>
>> -jonathan
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>
>
> --
> all born, to be dying
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
attached mail follows:
On Wed, 02 Nov 2005 10:38:15 +0100, max wrote:
>> In this case are you sure that the file is being sent via proc_open()?
>> can you provide a simplified script that does this?
>
> Sure, here's a test script, the output from it, and a few words on the
> email I receive:
> <?php
> $descriptorspec = array(
> 0 => array("pipe", "r"),
> 1 => array("pipe", "w"),
> 2 => array("file", "/tmp/error-output.txt", "a")
> );
> $text = "";
> for ($i=0; $i<10240; $i++) $text.="1"; $text.="END\n";
> $doccmd = "/usr/bin/qmail-inject";
> $res = proc_open ($doccmd, $descriptorspec, $pipes);
> fwrite ($pipes[0],"TO: somemailaddress
some.host\n\n");
> echo fwrite ($pipes[0], $text)."\n";
> echo fwrite ($pipes[0], $text)."\n";
> fclose ($pipes[0]);
> ?>
>
> The output is:
> 10244
> 6109
>
> Now, that's not counting the first TO: plus two \n's. Altogether it
> always
> sums up to 16384 bytes.
>
> In the email I receive, it honestly shows exactly the amount of data
> fwrite() claimed to have written, and not a symbol more.
My guess is that qmail-inject has a limitation on the line length
that it can use. A couple tests I can suggest:
1. try to seperate the string with some line endings so the line sent
isnt over 16kb.
2. try to proc_open a transparent application that doesn't do any sort
sort of parsing. like '/bin/cat' and see what the output is.
HTH,
Curt.
--
http://news.zirzow.dyndns.org/
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]