php-general Digest 11 Jun 2010 19:31:21 -0000 Issue 6793

Topics (messages 306035 through 306054):

configure php 5.2.12 with-pdflib failes after upgrade from php 5.2.9
        306035 by: Merlin Morgenstern
        306045 by: Thijs Lensselink

Re: How does php server identify that the particular session belongs to 
particular user
        306036 by: Boris SABATIER
        306037 by: Ashley Sheridan
        306038 by: Ashley Sheridan
        306046 by: Shreyas
        306047 by: Ashley Sheridan
        306052 by: Shreyas

include and include_once inheritance
        306039 by: David Mehler
        306040 by: Ashley Sheridan
        306043 by: Richard Quadling
        306044 by: Richard Quadling

connect openLDAP server using LDAP (apache + windows)
        306041 by: Jérémy ESCOLANO

Using LDAPS with PHP / certificates
        306042 by: Jérémy ESCOLANO

Re: is <?= good?
        306048 by: Daevid Vincent
        306049 by: Robert Cummings
        306050 by: Robert Cummings
        306051 by: Robert Cummings
        306053 by: Ashley Sheridan

Re: Question - foreach.
        306054 by: tedd

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Hi there,

I had a working version 5.2.9 running on my suse system. Then I upgraded to 5.2.12 with the same configure command. Unfortunatelly I lost pdf creation now.

Here is what the configure output says:


Notice: Following unknown configure options were used:
--with-pdflib=/usr/local/lib
Check './configure --help' for available options

The command seems correct and used to work on .9

Does somebody know how I could fix that?

Thank you for any help!

Merlin

--- End Message ---
--- Begin Message ---
On Fri, 11 Jun 2010 09:24:09 +0200, Merlin Morgenstern
<merli...@fastmail.fm> wrote:
> Hi there,
> 
> I had a working version 5.2.9 running on my suse system. Then I upgraded

> to 5.2.12 with the same configure command. Unfortunatelly I lost pdf 
> creation now.
> 
> Here is what the configure output says:
> 
> 
> Notice: Following unknown configure options were used:
> --with-pdflib=/usr/local/lib
> Check './configure --help' for available options

pdflib has been removed from the core and is now available on pecl.php.net

> 
> The command seems correct and used to work on .9
> 
> Does somebody know how I could fix that?
> 
> Thank you for any help!
> 
> Merlin

--- End Message ---
--- Begin Message ---
Hi

A cookie with the session_id are send to the client.

Bo.


2010/6/11 Peter <pet...@egrabber.com>

> Hi All,
>
> My Question is "How does php server identify that the particular session
> belongs to particular user?"
>
> Please help me out
>
> Regards
> Peter.m
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
On Fri, 2010-06-11 at 13:01 +0530, Peter wrote:

> Hi All,
> 
> My Question is "How does php server identify that the particular session 
> belongs to particular user?"
> 
> Please help me out
> 
> Regards
> Peter.m
> 


All the session data is stored on the server either in a database, file
or memory against a unique ID value. The server handles how this is
done, and it's likely you won't ever need to get involved with changing
how it does things.

>From the client-side of things; the user agent (browser) sends this
unique ID either as part of the URL or with the headers as a post
variable, which is why you may see a PHP_SESSION_ID (or something
similar) index in the $_REQUEST array when you use session_start() in
your scripts.

Has this helped?

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
On Fri, 2010-06-11 at 15:13 +0530, Peter wrote:

> Hi Ashley,
> 
> Thanks for your answer.
> 
> When too many users log in at the same time, the server gets loaded
> with multiple sessions  files that leads to complexity and crashes the
> server. In such cases how do we handle this ?
> 
> Thanks in advance
> 
> Peter
> 
> 
> Ashley Sheridan wrote: 
> 
> > On Fri, 2010-06-11 at 13:01 +0530, Peter wrote:
> > 
> >   
> > 
> > > Hi All,
> > > 
> > > My Question is "How does php server identify that the particular session 
> > > belongs to particular user?"
> > > 
> > > Please help me out
> > > 
> > > Regards
> > > Peter.m
> > > 
> > >     
> > 
> > 
> > 
> > All the session data is stored on the server either in a database, file
> > or memory against a unique ID value. The server handles how this is
> > done, and it's likely you won't ever need to get involved with changing
> > how it does things.
> > 
> > >From the client-side of things; the user agent (browser) sends this
> > unique ID either as part of the URL or with the headers as a post
> > variable, which is why you may see a PHP_SESSION_ID (or something
> > similar) index in the $_REQUEST array when you use session_start() in
> > your scripts.
> > 
> > Has this helped?
> > 
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> > 
> > 
> > 
> >   


I don't think it's the sessions that are crashing your server, it's more
than likely something else. What is the server load when you notice the
crashes? How many people are visiting your site simultaneously at that
point?

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
I agree with Ash's comment.

You should probably dig in deeper and see if those IPs are indeed valid.
Given the way the sites are being attacked (DDoS, SQL Injection et al), you
could be seeing one. If you see a high load and your website is accessed by
users spread globally, you should try out a Content Delivery Network like
Akamai to meet the scale and improve the performance of your web-site
without compromising on the end-user's site navigation experience.

Regards,
Shreyas

On Fri, Jun 11, 2010 at 3:06 PM, Ashley Sheridan
<a...@ashleysheridan.co.uk>wrote:

> On Fri, 2010-06-11 at 15:13 +0530, Peter wrote:
>
> > Hi Ashley,
> >
> > Thanks for your answer.
> >
> > When too many users log in at the same time, the server gets loaded
> > with multiple sessions  files that leads to complexity and crashes the
> > server. In such cases how do we handle this ?
> >
> > Thanks in advance
> >
> > Peter
> >
> >
> > Ashley Sheridan wrote:
> >
> > > On Fri, 2010-06-11 at 13:01 +0530, Peter wrote:
> > >
> > >
> > >
> > > > Hi All,
> > > >
> > > > My Question is "How does php server identify that the particular
> session
> > > > belongs to particular user?"
> > > >
> > > > Please help me out
> > > >
> > > > Regards
> > > > Peter.m
> > > >
> > > >
> > >
> > >
> > >
> > > All the session data is stored on the server either in a database, file
> > > or memory against a unique ID value. The server handles how this is
> > > done, and it's likely you won't ever need to get involved with changing
> > > how it does things.
> > >
> > > >From the client-side of things; the user agent (browser) sends this
> > > unique ID either as part of the URL or with the headers as a post
> > > variable, which is why you may see a PHP_SESSION_ID (or something
> > > similar) index in the $_REQUEST array when you use session_start() in
> > > your scripts.
> > >
> > > Has this helped?
> > >
> > > Thanks,
> > > Ash
> > > http://www.ashleysheridan.co.uk
> > >
> > >
> > >
> > >
>
>
> I don't think it's the sessions that are crashing your server, it's more
> than likely something else. What is the server load when you notice the
> crashes? How many people are visiting your site simultaneously at that
> point?
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>


-- 
Regards,
Shreyas

--- End Message ---
--- Begin Message ---
On Fri, 2010-06-11 at 19:56 +0530, Shreyas wrote:

> I agree with Ash's comment.
> 
> You should probably dig in deeper and see if those IPs are indeed valid.
> Given the way the sites are being attacked (DDoS, SQL Injection et al), you
> could be seeing one. If you see a high load and your website is accessed by
> users spread globally, you should try out a Content Delivery Network like
> Akamai to meet the scale and improve the performance of your web-site
> without compromising on the end-user's site navigation experience.
> 
> Regards,
> Shreyas
> 
> On Fri, Jun 11, 2010 at 3:06 PM, Ashley Sheridan
> <a...@ashleysheridan.co.uk>wrote:
> 
> > On Fri, 2010-06-11 at 15:13 +0530, Peter wrote:
> >
> > > Hi Ashley,
> > >
> > > Thanks for your answer.
> > >
> > > When too many users log in at the same time, the server gets loaded
> > > with multiple sessions  files that leads to complexity and crashes the
> > > server. In such cases how do we handle this ?
> > >
> > > Thanks in advance
> > >
> > > Peter
> > >
> > >
> > > Ashley Sheridan wrote:
> > >
> > > > On Fri, 2010-06-11 at 13:01 +0530, Peter wrote:
> > > >
> > > >
> > > >
> > > > > Hi All,
> > > > >
> > > > > My Question is "How does php server identify that the particular
> > session
> > > > > belongs to particular user?"
> > > > >
> > > > > Please help me out
> > > > >
> > > > > Regards
> > > > > Peter.m
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > All the session data is stored on the server either in a database, file
> > > > or memory against a unique ID value. The server handles how this is
> > > > done, and it's likely you won't ever need to get involved with changing
> > > > how it does things.
> > > >
> > > > >From the client-side of things; the user agent (browser) sends this
> > > > unique ID either as part of the URL or with the headers as a post
> > > > variable, which is why you may see a PHP_SESSION_ID (or something
> > > > similar) index in the $_REQUEST array when you use session_start() in
> > > > your scripts.
> > > >
> > > > Has this helped?
> > > >
> > > > Thanks,
> > > > Ash
> > > > http://www.ashleysheridan.co.uk
> > > >
> > > >
> > > >
> > > >
> >
> >
> > I don't think it's the sessions that are crashing your server, it's more
> > than likely something else. What is the server load when you notice the
> > crashes? How many people are visiting your site simultaneously at that
> > point?
> >
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> >
> >
> 
> 


It might not even be as bad as that. It could be that you're just
hitting the max number of connections that the server is configured to
handle, or that the current number of connections is reaching the memory
limit.

Maybe the sessions are set up to be stored in files on the server on a
separate partition, and that has reached capacity?

There are a number of reasons which could cause the server to appear
that the sessions are causing a problem that is not a DDoS attack ;)

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
Agreed. I was just speculating; may be I over -speculated it ;)

Regards,
Shreyas


On Fri, Jun 11, 2010 at 8:18 PM, Ashley Sheridan
<a...@ashleysheridan.co.uk>wrote:

>  On Fri, 2010-06-11 at 19:56 +0530, Shreyas wrote:
>
> I agree with Ash's comment.
>
> You should probably dig in deeper and see if those IPs are indeed valid.
> Given the way the sites are being attacked (DDoS, SQL Injection et al), you
> could be seeing one. If you see a high load and your website is accessed by
> users spread globally, you should try out a Content Delivery Network like
> Akamai to meet the scale and improve the performance of your web-site
> without compromising on the end-user's site navigation experience.
>
> Regards,
> Shreyas
>
> On Fri, Jun 11, 2010 at 3:06 PM, Ashley Sheridan
> <a...@ashleysheridan.co.uk>wrote:
>
> > On Fri, 2010-06-11 at 15:13 +0530, Peter wrote:
> >
> > > Hi Ashley,
> > >
> > > Thanks for your answer.
> > >
> > > When too many users log in at the same time, the server gets loaded
> > > with multiple sessions  files that leads to complexity and crashes the
> > > server. In such cases how do we handle this ?
> > >
> > > Thanks in advance
> > >
> > > Peter
> > >
> > >
> > > Ashley Sheridan wrote:
> > >
> > > > On Fri, 2010-06-11 at 13:01 +0530, Peter wrote:
> > > >
> > > >
> > > >
> > > > > Hi All,
> > > > >
> > > > > My Question is "How does php server identify that the particular
> > session
> > > > > belongs to particular user?"
> > > > >
> > > > > Please help me out
> > > > >
> > > > > Regards
> > > > > Peter.m
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > All the session data is stored on the server either in a database, file
> > > > or memory against a unique ID value. The server handles how this is
> > > > done, and it's likely you won't ever need to get involved with changing
> > > > how it does things.
> > > >
> > > > >From the client-side of things; the user agent (browser) sends this
> > > > unique ID either as part of the URL or with the headers as a post
> > > > variable, which is why you may see a PHP_SESSION_ID (or something
> > > > similar) index in the $_REQUEST array when you use session_start() in
> > > > your scripts.
> > > >
> > > > Has this helped?
> > > >
> > > > Thanks,
> > > > Ash
> > > > http://www.ashleysheridan.co.uk
> > > >
> > > >
> > > >
> > > >
> >
> >
> > I don't think it's the sessions that are crashing your server, it's more
> > than likely something else. What is the server load when you notice the
> > crashes? How many people are visiting your site simultaneously at that
> > point?
> >
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> >
> >
>
>
>
>
> It might not even be as bad as that. It could be that you're just hitting
> the max number of connections that the server is configured to handle, or
> that the current number of connections is reaching the memory limit.
>
> Maybe the sessions are set up to be stored in files on the server on a
> separate partition, and that has reached capacity?
>
> There are a number of reasons which could cause the server to appear that
> the sessions are causing a problem that is not a DDoS attack ;)
>
>
>   Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>


-- 
Regards,
Shreyas

--- End Message ---
--- Begin Message ---
Hello,
I've got a page that uses include_once to include a set of functions
for use in that page. I later have another include_once pulling in
another page, which generates a table. It relies on a function from
the first file, yet an error is being generated undefined function, I
thought that since the function was included in the main page, and
that since the table file was also being included in the main page
that the functions would also be available to the table file. Is this
not so?
Thanks.
Dave.

--- End Message ---
--- Begin Message ---
On Fri, 2010-06-11 at 06:34 -0400, David Mehler wrote:

> Hello,
> I've got a page that uses include_once to include a set of functions
> for use in that page. I later have another include_once pulling in
> another page, which generates a table. It relies on a function from
> the first file, yet an error is being generated undefined function, I
> thought that since the function was included in the main page, and
> that since the table file was also being included in the main page
> that the functions would also be available to the table file. Is this
> not so?
> Thanks.
> Dave.
> 


It should be available. Can you show the code you're using? Is the first
include being called within some form of if statement? That might
explain why it's not available when you expect it.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
On 11 June 2010 11:41, Ashley Sheridan <a...@ashleysheridan.co.uk> wrote:
> On Fri, 2010-06-11 at 06:34 -0400, David Mehler wrote:
>
>> Hello,
>> I've got a page that uses include_once to include a set of functions
>> for use in that page. I later have another include_once pulling in
>> another page, which generates a table. It relies on a function from
>> the first file, yet an error is being generated undefined function, I
>> thought that since the function was included in the main page, and
>> that since the table file was also being included in the main page
>> that the functions would also be available to the table file. Is this
>> not so?
>> Thanks.
>> Dave.
>>
>
>
> It should be available. Can you show the code you're using? Is the first
> include being called within some form of if statement? That might
> explain why it's not available when you expect it.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>

You would probably be better served with changing the include_once to
require_once.

If there is a dependency, then using require will enforce it. E_FATAL
is produced if a required file is not available.



-- 
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

--- End Message ---
--- Begin Message ---
On 11 June 2010 12:45, Richard Quadling <rquadl...@gmail.com> wrote:
> On 11 June 2010 11:41, Ashley Sheridan <a...@ashleysheridan.co.uk> wrote:
>> On Fri, 2010-06-11 at 06:34 -0400, David Mehler wrote:
>>
>>> Hello,
>>> I've got a page that uses include_once to include a set of functions
>>> for use in that page. I later have another include_once pulling in
>>> another page, which generates a table. It relies on a function from
>>> the first file, yet an error is being generated undefined function, I
>>> thought that since the function was included in the main page, and
>>> that since the table file was also being included in the main page
>>> that the functions would also be available to the table file. Is this
>>> not so?
>>> Thanks.
>>> Dave.
>>>
>>
>>
>> It should be available. Can you show the code you're using? Is the first
>> include being called within some form of if statement? That might
>> explain why it's not available when you expect it.
>>
>> Thanks,
>> Ash
>> http://www.ashleysheridan.co.uk
>>
>>
>>
>
> You would probably be better served with changing the include_once to
> require_once.
>
> If there is a dependency, then using require will enforce it. E_FATAL
> is produced if a required file is not available.
>
>
>
> --
> -----
> Richard Quadling
> "Standing on the shoulders of some very clever giants!"
> EE : http://www.experts-exchange.com/M_248814.html
> EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
> ZOPA : http://uk.zopa.com/member/RQuadling
>

And that is, of course, a fatal E_ERROR, not an E_FATAL error.

-- 
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

--- End Message ---
--- Begin Message ---
Hi

I'm writing from france cuz i'm having a big problem with apache and ldap.
let me explain :

I would like to make an Apache server communicate in php with en openLDAP
server (both servers are under win srv 2003), using LDAPS protocol.

In order to activate LDAPS on my openLDAP srv (srvLDAP), I created self
signed certificates with openSSL. I got 3 files:


cacert.pem
srvLDAP.pem
srvLDAP.key


I configured my slapd.con file and ldap.conf fil (openLDAP side) like this:

slapd.conf

TLSCertificateFile      ./ssl/srvLDAP.pem
TLSCertificateKeyFile   ./ssl/srvLDAP.key
TLSCACertificateFile    ./ssl/cacert.pem


ldap.conf
BASE    <ma branche>
URI     ldaps://srvLDAP/
TLS_CACERT      ./ssl/cacert.pem
TLS_REQCERT     demand



I launched my openLDAP service, and checked ldaps protocol was okay, using
this command :



C:\Program Files\OpenLDAP>ldapsearch -b o=exemple,dc=fr -s sub -x -w pass-D
cn=admin,o=exemple,dc=fr -H ldaps://srvLDAP/


Now I would like, from the remote apache server, communicate with the
openLDAP server using [b]LDAPS[/b] Protocol.

Here is my simplified PHP code

<h2>LDAP OPENLDAP LDAPS</h2>
<?php


$host="ldaps://srvldap";
$port="636";
$ds=ldap_connect($host,$port);
ldap_set_option($ds,LDAP_OPT_PROTOCOL_VERSION,3);
$r=ldap_bind($ds,"cn=admin,o=exemple,dc=fr","pass" );
$sr=ldap_search($ds,"o=exemplec,dc=fr",("objectClass=maclasse" ));
$info=ldap_get_entries($ds,$sr);
print $info["count"]." enregistrements trouvés.";
   ?>

I get this errror:


Unable to bind to server: Can't contact LDAP server


I know i have to configure certificates in the Apache server configuration,
I tried to to this according several internet ressources but didn't succeed..
I also read this link [URL="
http://forum.hardware.fr/hfr/OSAlternatifs/Logiciels-2/certificats-securisee-connexion-sujet_65365_1.htm"]Here[/URL]
which is a french link which speak about an ldap.con and ldaprc files to put
in the apache server. I did it but nothing happened.

Well, i'm lost in all this stuff, that is why i'm asking for help to
configure my servers to use ldaps with php.

Do you have information that could help me ?

I thank you in advance

--- End Message ---
--- Begin Message ---
Hi,

I'm trying to contact an openLDAP from Apache server (on windows) using PHP
using LDAPS

Here is my sample code :

$host="ldaps://srvLDAP";
$port="636";
$ds=ldap_connect($host,$port);
ldap_set_option($ds,LDAP_OPT_PROTOCOL_VERSION,3);
$r=ldap_bind($ds,"cn=admin,o=exemple,dc=fr","exemple" );
$sr=ldap_search($ds,"o=exemple,dc=fr",("objectClass=exemple" ));
$info=ldap_get_entries($ds,$sr);
print $info["count"]." enregistrements trouvés.";


I passed lot of time trying configuring my servers and here is what i have
done :

First i configured my openLDAP server :

slapd.conf:
#cert requested for the ldapserver
TLSCertificateFile      ./ssl2/srvLDAP.cer
TLSCertificateKeyFile   ./ssl2/srvLDAP.key
#CA cert
TLSCACertificateFile    ./ssl2/cacert.cer
TLSVerifyClient         never

ldap.conf:
TLS_CACERT      ./ssl2/cacert.cer
TLS_REQCERT     never

On my apache server i created a folder C:\openldap\sysconf
and created a file ldap.conf :

TLS_CACERT      ./ssl/cacert.cer
TLS_REQCERT     never

(I also created a folder c:\openldap\sysconf\ssl and put my CA certificate
inside it)
(of course I activated ldap and ssl in my php.ini)

>From now it DOES work BUT it doesn't verify any certificate.

I want now to make it verifying the certificate. I know i have to
change TLS_REQCERT     never to TLS_REQCERT     demand on openldap server
and apache server. I tryed but it doesn't work. I can't contact ldap server..

On the openLDAP I have this following error:

connection_read(1176): checking for input on id=0
TLS trace: SSL_accept:before/accept initialization
TLS trace: SSL_accept:SSLv3 read client hello A
TLS trace: SSL_accept:SSLv3 write server hello A
TLS trace: SSL_accept:SSLv3 write certificate A
TLS trace: SSL_accept:SSLv3 write certificate request A
TLS trace: SSL_accept:SSLv3 flush data
TLS trace: SSL_accept:error in SSLv3 read client certificate A
TLS trace: SSL_accept:error in SSLv3 read client certificate A
connection_get(1176): got connid=0
connection_read(1176): checking for input on id=0
TLS trace: SSL3 alert write:fatal:handshake failure
TLS trace: SSL_accept:error in SSLv3 read client certificate B
TLS: can't accept.
TLS: error:140890C7:SSL routines:SSL3_GET_CLIENT_CERTIFICATE:peer did not
return
 a certificate s3_srvr.c:2471
connection_read(1176): TLS accept error error=-1 id=0, closing
connection_closing: readying conn=0 sd=1176 for close
connection_close: conn=0 sd=1176


That means that the openLDAP can't check the client certificate cuz PHP and
Apache don't send any to it.

I heard about a ldaprc file but I can't find any information about it...

Is there somebody who can help me with this ?

Thank you very much in advance.

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] 
> 
> ...as those tags only work when short_tags are turned on, which
> itself causes problems with outputting XML from PHP. 

Can you elaborate on this Ashley?

I use short tags and I output XML all the time. In fact I'm knee deep in
building an API right now for Panasonic Avionics that is all XML based. We
have hundreds of airplanes hitting the API, sending XML and getting XML
back -- all via LAMP. I'm also simultaneously doing some cURL JSON-RPC
bi-directional communication.

This is the second XML API I've written for enterprise level service. I
have no problems at all.

I call poppycock. This sounds like FUD to me. ;-)

D.


--- End Message ---
--- Begin Message ---


Daevid Vincent wrote:
-----Original Message-----
From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk]
...as those tags only work when short_tags are turned on, which
itself causes problems with outputting XML from PHP.

Can you elaborate on this Ashley?

I use short tags and I output XML all the time. In fact I'm knee deep in
building an API right now for Panasonic Avionics that is all XML based. We
have hundreds of airplanes hitting the API, sending XML and getting XML
back -- all via LAMP. I'm also simultaneously doing some cURL JSON-RPC
bi-directional communication.

This is the second XML API I've written for enterprise level service. I
have no problems at all.

I call poppycock. This sounds like FUD to me. ;-)

It's called a standard:

    http://www.w3.org/TR/REC-xml/#sec-pi

A processing instruction without a target is incorrect. What should process the data if there is no target? The assumption of PHP when no target is declared is not part of the standard. Just because you've done two anecdotal enterprise projects and haven't had a problem, doesn't make it right.

Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

--- End Message ---
--- Begin Message ---
Robert Cummings wrote:

Daevid Vincent wrote:
-----Original Message-----
From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk]
...as those tags only work when short_tags are turned on, which
itself causes problems with outputting XML from PHP.
Can you elaborate on this Ashley?

I use short tags and I output XML all the time. In fact I'm knee deep in
building an API right now for Panasonic Avionics that is all XML based. We
have hundreds of airplanes hitting the API, sending XML and getting XML
back -- all via LAMP. I'm also simultaneously doing some cURL JSON-RPC
bi-directional communication.

This is the second XML API I've written for enterprise level service. I
have no problems at all.

I call poppycock. This sounds like FUD to me. ;-)

It's called a standard:

     http://www.w3.org/TR/REC-xml/#sec-pi

A processing instruction without a target is incorrect. What should process the data if there is no target? The assumption of PHP when no target is declared is not part of the standard. Just because you've done two anecdotal enterprise projects and haven't had a problem, doesn't make it right.

I spoke too fast, I thought we were talking about <? and not <?=
The latter is questionable since technically the = could be considered a processing character (at least from what I read in the spec. Perhaps it is ambiguous though with other languages.

Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

--- End Message ---
--- Begin Message ---
Robert Cummings wrote:
Robert Cummings wrote:
Daevid Vincent wrote:
-----Original Message-----
From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk]
...as those tags only work when short_tags are turned on, which
itself causes problems with outputting XML from PHP.
Can you elaborate on this Ashley?

I use short tags and I output XML all the time. In fact I'm knee deep in
building an API right now for Panasonic Avionics that is all XML based. We
have hundreds of airplanes hitting the API, sending XML and getting XML
back -- all via LAMP. I'm also simultaneously doing some cURL JSON-RPC
bi-directional communication.

This is the second XML API I've written for enterprise level service. I
have no problems at all.

I call poppycock. This sounds like FUD to me. ;-)
It's called a standard:

     http://www.w3.org/TR/REC-xml/#sec-pi

A processing instruction without a target is incorrect. What should process the data if there is no target? The assumption of PHP when no target is declared is not part of the standard. Just because you've done two anecdotal enterprise projects and haven't had a problem, doesn't make it right.

I spoke too fast, I thought we were talking about <? and not <?=
The latter is questionable since technically the = could be considered a processing character (at least from what I read in the spec. Perhaps it is ambiguous though with other languages.

And on further reading I'm pretty sure the = character does not fall into the allowed caracters for a PITarget:

    http://www.w3.org/TR/REC-xml/#NT-PITarget

Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

--- End Message ---
--- Begin Message ---
On Fri, 2010-06-11 at 10:40 -0700, Daevid Vincent wrote:

> > -----Original Message-----
> > From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] 
> > 
> > ...as those tags only work when short_tags are turned on, which
> > itself causes problems with outputting XML from PHP. 
> 
> Can you elaborate on this Ashley?
> 
> I use short tags and I output XML all the time. In fact I'm knee deep in
> building an API right now for Panasonic Avionics that is all XML based. We
> have hundreds of airplanes hitting the API, sending XML and getting XML
> back -- all via LAMP. I'm also simultaneously doing some cURL JSON-RPC
> bi-directional communication.
> 
> This is the second XML API I've written for enterprise level service. I
> have no problems at all.
> 
> I call poppycock. This sounds like FUD to me. ;-)
> 
> D.
> 
> 


For <?= to work, the short_tags setting needs to be turned on I believe,
which can cause issues when outputting the XML declaration line unless
it's broken into two parts, which is messier than '<?php echo' IMHO.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
At 3:46 PM -0400 6/10/10, Paul M Foster wrote:
On Thu, Jun 10, 2010 at 11:16:08AM -0400, tedd wrote:

 > I spend much of my time thinking "Did I do that before?"

<grin> I know the feeling. I will say this, though. I have yet to figure
out, from your URLs, how your site(s) is/are organized. Maybe a reorg
would help?

Paul

Paul:

Unfortunately, I really don't follow an organization plan for my demos on any of my sites (well over a dozen now).

Please understand that when I started creating demos, I only wanted to see how a specific thing worked. I had no idea that this investigation would become a giant listing of stuff.

I could explain how I can easily create demos if you want, but it's pretty basic stuff using includes for a common header/footer files leaving only the specific of the topic to be added. The hard part is just finding a layout that you like -- after that it's pretty easy to duplicate it each time you want to demo something.

I will be updating my sperling.com soon to add in language specific code (php/css/js) -- and that *will* be organized into categories. However, that may be down the road because I have a few other pressing matters that are pulling me in several different directions.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---

Reply via email to