Re: [PHP] Closing PHP tag best practice?

2011-07-25 Thread Daniel Brown
On Sun, Jul 24, 2011 at 10:18, Ashley Sheridan a...@ashleysheridan.co.uk 
wrote:

 The PHP parser will automatically add the closing tag when it reaches
 the end of the file, so you don't have to worry about the final closing
 tag.

I quit using closing tags years ago and haven't looked back once
(except for code snippets, since explanatory text generally follows
the block).

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] SimpleXMLElement, adding nodes that are SimpleXMLElement.

2011-07-25 Thread Richard Quadling
Hello all.

I've got 2 XML documents (one from a URL and another via MS SQL Server).

The structure of these documents is the same, with just a difference
in attribute to identify things (the 'data' is different but the
variable's name attribute is the key here).

data
 variable name=var_name_x
  row
   columndata/column
   ...
  /row.
  ...
 /variable
/data

I need to merge both documents so that the variable node of each
document exists in a new document ...

data
 variable name=var_name_x
  ...
 /variable
 variable name=var_name_y
  ...
 /variable
/data

I know I can do this with string manipulation (and that's what I've
done), but I'd like to use a more appropriate mechanism (part learning
and part keeping the code tidy).

I suspect SimpleXMLElement may not be the right tool.

Richard.
-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: SimpleXMLElement, adding nodes that are SimpleXMLElement.

2011-07-25 Thread Richard Quadling
On 25 July 2011 13:47, Richard Quadling rquadl...@gmail.com wrote:
 Hello all.

 I've got 2 XML documents (one from a URL and another via MS SQL Server).

 The structure of these documents is the same, with just a difference
 in attribute to identify things (the 'data' is different but the
 variable's name attribute is the key here).

 data
  variable name=var_name_x
  row
   columndata/column
   ...
  /row.
  ...
  /variable
 /data

 I need to merge both documents so that the variable node of each
 document exists in a new document ...

 data
  variable name=var_name_x
  ...
  /variable
  variable name=var_name_y
  ...
  /variable
 /data

 I know I can do this with string manipulation (and that's what I've
 done), but I'd like to use a more appropriate mechanism (part learning
 and part keeping the code tidy).

 I suspect SimpleXMLElement may not be the right tool.

 Richard.

Got it working when I finally discovered DOMDocument-importNode().
Allows the copying of a node from one DOM to another.

Easy.

-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to install pecl_http into a web hosting service

2011-07-25 Thread Jamie Krasnoo
You should be using cURL for making requests.

No, you won't be able to install any pecl packages on your host. It's
a free account and I doubt they will be bending over backwards for you
anytime soon. If you want custom hosting, pay for a VPS account or a
dedicated server.

On Thu, Jul 21, 2011 at 8:52 PM, gato chalar dany...@gmail.com wrote:
 Hi list,

 I need to perform http requests (GET,POST) , I have readed about pecl_http
 package, so it seem to be what I need. Reading further I sow some ways to
 install this package to a server where you have all rights and privilegies,
 and that's the problem; I don't know if I will be able to install pecl_http
 in a php hosting service. Currently I have a free php hosting account. Is
 that posible?

 Thanks for the help.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to install pecl_http into a web hosting service

2011-07-25 Thread Richard Quadling
On 25 July 2011 17:26, Jamie Krasnoo jkras...@gmail.com wrote:
 You should be using cURL for making requests.

 No, you won't be able to install any pecl packages on your host. It's
 a free account and I doubt they will be bending over backwards for you
 anytime soon. If you want custom hosting, pay for a VPS account or a
 dedicated server.

 On Thu, Jul 21, 2011 at 8:52 PM, gato chalar dany...@gmail.com wrote:
 Hi list,

 I need to perform http requests (GET,POST) , I have readed about pecl_http
 package, so it seem to be what I need. Reading further I sow some ways to
 install this package to a server where you have all rights and privilegies,
 and that's the problem; I don't know if I will be able to install pecl_http
 in a php hosting service. Currently I have a free php hosting account. Is
 that posible?

 Thanks for the help.

Depending upon your complexity, you could possible use the builtin
streams mechanisms.

I've used them to force all PHP requests through a NTLM authentication
proxy server (network required NTLM authentication which was not
handled by PHP).

http://uk.php.net/manual/en/book.stream.php

-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to install pecl_http into a web hosting service

2011-07-25 Thread Andrew Ballard
On Mon, Jul 25, 2011 at 12:26 PM, Jamie Krasnoo jkras...@gmail.com wrote:
[reordered and snipped]

 On Thu, Jul 21, 2011 at 8:52 PM, gato chalar dany...@gmail.com wrote:
 Hi list,

 I need to perform http requests (GET,POST) , I have readed about pecl_http
 package, so it seem to be what I need. Reading further I sow some ways to
 install this package to a server where you have all rights and privilegies,
 and that's the problem; I don't know if I will be able to install pecl_http
 in a php hosting service. Currently I have a free php hosting account. Is
 that posible?

 You should be using cURL for making requests.

If the pecl HTTP extension is unavailable, cURL is the next simplest
choice, but I've used HTTP when it was available and it worked just
fine. I'm curious as to your reason (other than general availability)
for stating that one *should* use cURL (as opposed to something else
like HTTP).

Andrew

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to install pecl_http into a web hosting service

2011-07-25 Thread Jamie Krasnoo
Most hosting companies have cURL already installed and available
rather than pecl_http. I probably should have said try using cURL
instead of you should be using cURL. However most FREE hosting
companies probably won't even have that installed due to security
concerns.

Jamie

On Mon, Jul 25, 2011 at 11:16 AM, Andrew Ballard aball...@gmail.com wrote:
 On Mon, Jul 25, 2011 at 12:26 PM, Jamie Krasnoo jkras...@gmail.com wrote:
 [reordered and snipped]

 On Thu, Jul 21, 2011 at 8:52 PM, gato chalar dany...@gmail.com wrote:
 Hi list,

 I need to perform http requests (GET,POST) , I have readed about pecl_http
 package, so it seem to be what I need. Reading further I sow some ways to
 install this package to a server where you have all rights and privilegies,
 and that's the problem; I don't know if I will be able to install pecl_http
 in a php hosting service. Currently I have a free php hosting account. Is
 that posible?

 You should be using cURL for making requests.

 If the pecl HTTP extension is unavailable, cURL is the next simplest
 choice, but I've used HTTP when it was available and it worked just
 fine. I'm curious as to your reason (other than general availability)
 for stating that one *should* use cURL (as opposed to something else
 like HTTP).

 Andrew


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to install pecl_http into a web hosting service

2011-07-25 Thread gato chalar
Hi to everybody,
Currently I'm using curl, it is installed in my free hosting account.

On 25 July 2011 16:29, Jamie Krasnoo jkras...@gmail.com wrote:

 Most hosting companies have cURL already installed and available
 rather than pecl_http. I probably should have said try using cURL
 instead of you should be using cURL. However most FREE hosting
 companies probably won't even have that installed due to security
 concerns.

 Jamie

 On Mon, Jul 25, 2011 at 11:16 AM, Andrew Ballard aball...@gmail.com
 wrote:
  On Mon, Jul 25, 2011 at 12:26 PM, Jamie Krasnoo jkras...@gmail.com
 wrote:
  [reordered and snipped]
 
  On Thu, Jul 21, 2011 at 8:52 PM, gato chalar dany...@gmail.com wrote:
  Hi list,
 
  I need to perform http requests (GET,POST) , I have readed about
 pecl_http
  package, so it seem to be what I need. Reading further I sow some ways
 to
  install this package to a server where you have all rights and
 privilegies,
  and that's the problem; I don't know if I will be able to install
 pecl_http
  in a php hosting service. Currently I have a free php hosting account.
 Is
  that posible?
 
  You should be using cURL for making requests.
 
  If the pecl HTTP extension is unavailable, cURL is the next simplest
  choice, but I've used HTTP when it was available and it worked just
  fine. I'm curious as to your reason (other than general availability)
  for stating that one *should* use cURL (as opposed to something else
  like HTTP).
 
  Andrew
 

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
Daniel Echalar Fernandez
Truesoft Developer
AIESEC Alumni