|
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-help
lists.php.net
Date: Thu Feb 14 2008 - 02:30:10 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 14 Feb 2008 08:30:10 -0000 Issue 5292
Topics (messages 269257 through 269286):
Re: Curl doesn't handle memory stream
269257 by: Manuel Lemos
269260 by: Jim Lucas
269261 by: Jim Lucas
269263 by: Nathan Nobbe
269264 by: Nathan Nobbe
269266 by: Richard Lynch
269275 by: Nathan Nobbe
269280 by: Manuel Lemos
Re: PHP fsockopen with the UNIX abstract namespace
269258 by: Jochem Maas
269259 by: .4u
269262 by: Jochem Maas
269265 by: .4u
Re: help me out with form details converted into pdf file save it one place as well as send mail attactment
269267 by: Richard Lynch
Re: Copying 1000s files and showing the progress
269268 by: Richard Lynch
269271 by: Ritesh Nadhani
269279 by: Manuel Lemos
Re: DOMXML Warning
269269 by: Richard Lynch
Static variable in a class method
269270 by: Pauau
269272 by: Nirmalya Lahiri
269273 by: Nathan Nobbe
Re: Run Process in back ground
269274 by: Richard Lynch
Re: Session and Multi Server Architecture
269276 by: Richard Lynch
269277 by: Michael McGlothlin
Re: database design tool
269278 by: Shawn McKenzie
Re: Template system in PHP
269281 by: Xavier de Lapeyre
269282 by: Xavier de Lapeyre
269283 by: Xavier de Lapeyre
269284 by: Shawn McKenzie
269285 by: Robert Cummings
269286 by: Zoltán Németh
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:
Hello,
on 02/13/2008 05:17 PM Nathan Nobbe said the following:
>> If nobody has a solution I think I'll report it as a bug tomorrow.
>
>
> did you ever report a bug on this ?
>
> i was messing around with it today, and i discovered that some urls,
> partially work. for example the google translate 'api', and php.net
>
> note, i set the user agent for the google site to work. and i say,
> partially, because even when data does come back, its not the complete
> page, which you can easily realize by navigating to the page and comparing
> the source w/ the output from the test script.
> i dont know of any ini setting that would influence the amount of space
> available to the memory buffer, aside from memory_limit, which i have set
> to 128M.
>
> <?php
> #$c = curl_init("
> http://google.com/translate_t?langpair=en%7Cfr&text=newspaper");
> $c = curl_init("http://php.net");
> $st = fopen('php://memory', 'r');
>
> curl_setopt($c, CURLOPT_FILE, $st);
> curl_setopt($c, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux i686; en-US;
> rv:1.8.1.11) Gecko/20080115 Firefox/2.0.0.11');
>
> if(!curl_exec($c)) die ("error: ".curl_error($c));
> curl_close($c);
>
> rewind($st);
>
> echo stream_get_contents($st);
> fclose($st);
> ?>
It does not seem like it is a real bug but maybe file access is
implemented inside Curl and it has no knowledge about PHP stream support.
Alternatively, you may want to try this HTTP client class, which can use
any access files you need to use in your HTTP requests.
--
Regards,
Manuel Lemos
PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
Nathan Nobbe wrote:
> On Nov 29, 2007 10:59 AM, Peter Smit <peter
petersmit.eu> wrote:
>
>> If nobody has a solution I think I'll report it as a bug tomorrow.
>
>
> did you ever report a bug on this ?
>
> i was messing around with it today, and i discovered that some urls,
> partially work. for example the google translate 'api', and php.net
>
> note, i set the user agent for the google site to work. and i say,
> partially, because even when data does come back, its not the complete
> page, which you can easily realize by navigating to the page and comparing
> the source w/ the output from the test script.
> i dont know of any ini setting that would influence the amount of space
> available to the memory buffer, aside from memory_limit, which i have set
> to 128M.
>
> <?php
> #$c = curl_init("
> http://google.com/translate_t?langpair=en%7Cfr&text=newspaper");
> $c = curl_init("http://php.net");
> $st = fopen('php://memory', 'r');
>
> curl_setopt($c, CURLOPT_FILE, $st);
> curl_setopt($c, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux i686; en-US;
> rv:1.8.1.11) Gecko/20080115 Firefox/2.0.0.11');
>
> if(!curl_exec($c)) die ("error: ".curl_error($c));
> curl_close($c);
>
> rewind($st);
>
> echo stream_get_contents($st);
> fclose($st);
> ?>
>
> -nathan
>
I see on the http://us.php.net/wrappers.php page that only php 5.1.0 and newer
have this feature. What version of PHP are you using?
--
Jim Lucas
"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."
Twelfth Night, Act II, Scene V
by William Shakespeare
attached mail follows:
Nathan Nobbe wrote:
> On Nov 29, 2007 10:59 AM, Peter Smit <peter
petersmit.eu> wrote:
>
>> If nobody has a solution I think I'll report it as a bug tomorrow.
>
>
> did you ever report a bug on this ?
>
http://bugs.php.net/bug.php?id=43468
--
Jim Lucas
"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."
Twelfth Night, Act II, Scene V
by William Shakespeare
attached mail follows:
On Feb 13, 2008 5:07 PM, Jim Lucas <lists
cmsws.com> wrote:
> I see on the http://us.php.net/wrappers.php page that only php 5.1.0 and
> newer
> have this feature. What version of PHP are you using?
thanks for your time jim;
im using 5.2.5.
manuel, thanks for your time as well. of course i can just use a file,
but im somewhat interested in this feature. and im not sure if curl
implements
the file handling on its own, otherwise why would i have partial success
with
certain urls? i think something goofy is going on here; id like to find out
if
at all possible. i know that some extensions may not support the feature,
but i could find no documentation that would say either way for the curl
extension..
-nathan
attached mail follows:
On Feb 13, 2008 5:10 PM, Jim Lucas <lists
cmsws.com> wrote:
> Nathan Nobbe wrote:
> > On Nov 29, 2007 10:59 AM, Peter Smit <peter
petersmit.eu> wrote:
> >
> >> If nobody has a solution I think I'll report it as a bug tomorrow.
> >
> >
> > did you ever report a bug on this ?
> >
>
> http://bugs.php.net/bug.php?id=43468
thanks jim ;)
-nathan
attached mail follows:
On Wed, February 13, 2008 4:11 pm, Nathan Nobbe wrote:
> On Feb 13, 2008 5:07 PM, Jim Lucas <lists
cmsws.com> wrote:
>
>> I see on the http://us.php.net/wrappers.php page that only php 5.1.0
>> and
>> newer
>> have this feature. What version of PHP are you using?
>
>
> thanks for your time jim;
> im using 5.2.5.
>
> manuel, thanks for your time as well. of course i can just use a
> file,
> but im somewhat interested in this feature. and im not sure if curl
> implements
> the file handling on its own, otherwise why would i have partial
> success
> with
> certain urls? i think something goofy is going on here; id like to
> find out
> if
> at all possible. i know that some extensions may not support the
> feature,
> but i could find no documentation that would say either way for the
> curl
> extension..
You may or may not want to file a bug report with curl itself,
depending on whether PHP is doing the stream file handling or curl is.
At a wild guess, I would expect it would be buried in curl code, not
PHP code...
Perhaps you can dig around here and find out for sure:
http://lxr.php.net
http://cvs.php.net
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Feb 13, 2008 6:52 PM, Richard Lynch <ceo
l-i-e.com> wrote:
> On Wed, February 13, 2008 4:11 pm, Nathan Nobbe wrote:
>
> You may or may not want to file a bug report with curl itself,
> depending on whether PHP is doing the stream file handling or curl is.
>
> At a wild guess, I would expect it would be buried in curl code, not
> PHP code...
>
> Perhaps you can dig around here and find out for sure:
> http://lxr.php.net
> http://cvs.php.net
thanks richard, even tho im not proficient w/ c ill take a look at it this
weekend and see if i can make any headway. i remember trying to look
when this thread first started and i was like, ummmm... yeah...
but its worth another shot. and the lxr link is pretty sweet too. i like
how
they have links for all the line numbers of the source files :)
-nathan
attached mail follows:
Hello
on 02/13/2008 08:11 PM Nathan Nobbe said the following:
> On Feb 13, 2008 5:07 PM, Jim Lucas <lists
cmsws.com> wrote:
>
>> I see on the http://us.php.net/wrappers.php page that only php 5.1.0 and
>> newer
>> have this feature. What version of PHP are you using?
>
>
> thanks for your time jim;
> im using 5.2.5.
>
> manuel, thanks for your time as well. of course i can just use a file,
> but im somewhat interested in this feature. and im not sure if curl
> implements
> the file handling on its own, otherwise why would i have partial success
> with
> certain urls? i think something goofy is going on here; id like to find out
> if
> at all possible. i know that some extensions may not support the feature,
> but i could find no documentation that would say either way for the curl
> extension..
THat is a bit intriguing why it works in some cases and others it doesn't.
I do not use the Curl library functions except for things that you
cannot do with the current fsockopen based socket connections. In the
latest PHP versions there is not much that you cannot do with socket
connections that you can do with Curl.
In any case, I have encapsulated HTTP client fucntionality in the class
that I mentioned, so it uses fsockopen or curl functions depending on
what you need and what is available in the underlying PHP version. This
way I achive a PHP version independent solution.
--
Regards,
Manuel Lemos
PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
4u schreef:
> Hi,
>
> I have a problem with fsockopen in connection with the UNIX abstract
> namespace.
>
> To open a UNIX socket in the abstract namespace I have to add a nul byte
> in front of the path.
>
> Unfortunately PHP returns
> fsockopen() [function.fsockopen]: unable to connect to unix://:0
> (Connection refused)
>
> for unix://\x00/tmp/dbus-whatever which is a bit strange because I
> expected at least the error message "fsockopen() [function.fsockopen]:
> unable to connect to unix://[NUL byte]/tmp/dbus-whatever:0 (Connection
> refused)"
your problem might be version related, but php does have a C level function
php_stream_sock_open_unix() explicitly for the issue of the NUL byte
(the NUL byte is seen as the end of a string, unless the string handling
is binary safe - if I got the lingo correct).
my first guess would be to use socket_create() in combination with
socket_connect() instead of fsockopen() and see if that does the trick.
>
> Is this a known issue or do I have to set something in the php.ini?
>
> I would appreciate any ideas how to debug this issue.
>
attached mail follows:
Hi,
thanks for your help - unfortunately it doesn't help.
With "stream_socket_client ()" I get the message "unable to connect to
unix://\0/tmp/hald-local/dbus-ZniNmvr5O0 (Connection refused) in
/root/dbus_session.php on line 272" which is at least better, because it
shows the full path.
I verified it with
PHP 5.1.2 (cli) (built: Jul 17 2007 17:32:48)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
(It's a Debian based machine)
and
PHP 5.2.5-pl1-gentoo (cli) (built: Dec 29 2007 11:46:44)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with eAccelerator v0.9.5.1, Copyright (c) 2004-2006 eAccelerator, by
eAccelerator
(Gentoo)
socket_create and socket_connect produces the following error:
Warning: socket_connect() [function.socket-connect]: unable to connect
[22]: Invalid argument in ...
again verified on both systems and definitely with the right arguments -
the socket resource and a "[NUL]/tmp/path" string as written in the PHP
manual.
Are their other solutions or known problems? If not, I will maybe post
it as a bug - but wanted to make sure that it's not my fault.
Jochem Maas schrieb:
>
4u schreef:
>> Hi,
>>
>> I have a problem with fsockopen in connection with the UNIX abstract
>> namespace.
>>
>> To open a UNIX socket in the abstract namespace I have to add a nul byte
>> in front of the path.
>>
>> Unfortunately PHP returns
>> fsockopen() [function.fsockopen]: unable to connect to unix://:0
>> (Connection refused)
>>
>> for unix://\x00/tmp/dbus-whatever which is a bit strange because I
>> expected at least the error message "fsockopen() [function.fsockopen]:
>> unable to connect to unix://[NUL byte]/tmp/dbus-whatever:0 (Connection
>> refused)"
>
> your problem might be version related, but php does have a C level function
> php_stream_sock_open_unix() explicitly for the issue of the NUL byte
> (the NUL byte is seen as the end of a string, unless the string handling
> is binary safe - if I got the lingo correct).
>
> my first guess would be to use socket_create() in combination with
> socket_connect() instead of fsockopen() and see if that does the trick.
>
>
>>
>> Is this a known issue or do I have to set something in the php.ini?
>>
>> I would appreciate any ideas how to debug this issue.
>>
attached mail follows:
4u schreef:
> Hi,
>
> thanks for your help - unfortunately it doesn't help.
>
> With "stream_socket_client ()" I get the message "unable to connect to
> unix://\0/tmp/hald-local/dbus-ZniNmvr5O0 (Connection refused) in
> /root/dbus_session.php on line 272" which is at least better, because it
> shows the full path.
is the connection refused a permissions thing here? can you
verify that it's possible to connect?
you might consider attaching php to gdb and seeing where things
go wrong, if the socket itself is fine and usable and your sure
then a bug report is in order, no?
maybe someone smarter cares to comment.
>
> I verified it with
>
> PHP 5.1.2 (cli) (built: Jul 17 2007 17:32:48)
> Copyright (c) 1997-2006 The PHP Group
> Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
>
> (It's a Debian based machine)
>
> and
>
> PHP 5.2.5-pl1-gentoo (cli) (built: Dec 29 2007 11:46:44)
> Copyright (c) 1997-2007 The PHP Group
> Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
> with eAccelerator v0.9.5.1, Copyright (c) 2004-2006 eAccelerator, by
> eAccelerator
>
> (Gentoo)
>
> socket_create and socket_connect produces the following error:
>
> Warning: socket_connect() [function.socket-connect]: unable to connect
> [22]: Invalid argument in ...
>
> again verified on both systems and definitely with the right arguments -
> the socket resource and a "[NUL]/tmp/path" string as written in the PHP
> manual.
>
> Are their other solutions or known problems? If not, I will maybe post
> it as a bug - but wanted to make sure that it's not my fault.
>
> Jochem Maas schrieb:
>>
4u schreef:
>>> Hi,
>>>
>>> I have a problem with fsockopen in connection with the UNIX abstract
>>> namespace.
>>>
>>> To open a UNIX socket in the abstract namespace I have to add a nul byte
>>> in front of the path.
>>>
>>> Unfortunately PHP returns
>>> fsockopen() [function.fsockopen]: unable to connect to unix://:0
>>> (Connection refused)
>>>
>>> for unix://\x00/tmp/dbus-whatever which is a bit strange because I
>>> expected at least the error message "fsockopen() [function.fsockopen]:
>>> unable to connect to unix://[NUL byte]/tmp/dbus-whatever:0 (Connection
>>> refused)"
>> your problem might be version related, but php does have a C level function
>> php_stream_sock_open_unix() explicitly for the issue of the NUL byte
>> (the NUL byte is seen as the end of a string, unless the string handling
>> is binary safe - if I got the lingo correct).
>>
>> my first guess would be to use socket_create() in combination with
>> socket_connect() instead of fsockopen() and see if that does the trick.
>>
>>
>>> Is this a known issue or do I have to set something in the php.ini?
>>>
>>> I would appreciate any ideas how to debug this issue.
>>>
>
attached mail follows:
Hi again,
Jochem Maas schrieb:
>
4u schreef:
[snip]
> is the connection refused a permissions thing here? can you
> verify that it's possible to connect?
I'm not sure but I don't think so. 1.) we speak about D-BUS and 2.) its
owner and root should always be able to connect to it. Especially the
socket_create test seems interesting - removing the NUL byte results in
this snipplet to work - adding it again results in an invalid argument.
> you might consider attaching php to gdb and seeing where things
> go wrong, if the socket itself is fine and usable and your sure
> then a bug report is in order, no?
Looks like I'll do that (trying gdb) and post a bug report.
> maybe someone smarter cares to comment.
Once more thanks for your help :) I wasn't sure if it was me or PHP -
but with the socket_* function tests it looks like it's something wrong
with PHP and the NUL byte.
attached mail follows:
On Wed, February 13, 2008 6:26 am, pretty wrote:
> hi any one help me out, im using cronofirm, i need to field form
> details will
> converted into pdf as well as it will go maill attachment doing this
> in
> joomla, atleast i need this only php with out joomla.
To make a PDF, you can use:
http://php.net/pdf
To save that to a file, you can use:
http://php.net/file_put_contents
To send the email out, you can use the PEAR mailer, phpmailer, or the
Mime Mail class at phpclasses.org or...
How you'd fit any of this into Joomla is a Joomla problem :-)
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Wed, February 13, 2008 4:28 am, Ritesh Nadhani wrote:
> I have a situation where I have to copy something like 1000 files one
> by one to a temporary folder. Tar it using the system tar command and
> let the user download the tar file.
>
> Now while the copy is going on at server, I want to show some progress
> to the user at client side. Most of the tutorial I found on net was
> about showing progress while a file is being uploaded from client to
> server. In this case the client has the info but for my case, the
> client has no info.
>
> A similar was problem was solved at
> http://menno.b10m.net/blog/blosxom/perl/cgi-upload-hook.html but its
> in PERL and uses some form of hook. I have no clue how to do it in
> PHP.
>
> Any clues or right direction would be awesome.
First of all, don't do that. :-)
Instead, set up a "job" system of what should be copied/tarred, and
then notify the user via email.
Don't make the user sit there waiting for the computer!
If you absolutely HAVE to do this due to a pointy-haired boss...
<?php
$path = "/full/path/to/1000s/of/files";
$dir = opendir($path) or die("Change that path");
$tmp = tmpname(); //or whatever...
while (($file = readdir($dir)) !== false){
echo "$file<br />\n";
copy("$path/$file", "/tmp/$tmp/$path");
}
exec("tar -cf /tmp/$tmp.tar /tmp/$tmp/", $output, $error);
echo implode("<br />\n", $output);
if ($error){
//handle error here!
die("OS Error: $error");
}
?>
shameless plug:
//handle error here could perhaps use this:
http://l-i-e.com/perror.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Feb 13, 2008 6:03 PM, Richard Lynch <ceo
l-i-e.com> wrote:
>
> On Wed, February 13, 2008 4:28 am, Ritesh Nadhani wrote:
> > I have a situation where I have to copy something like 1000 files one
> > by one to a temporary folder. Tar it using the system tar command and
> > let the user download the tar file.
> >
> > Now while the copy is going on at server, I want to show some progress
> > to the user at client side. Most of the tutorial I found on net was
> > about showing progress while a file is being uploaded from client to
> > server. In this case the client has the info but for my case, the
> > client has no info.
> >
> > A similar was problem was solved at
> > http://menno.b10m.net/blog/blosxom/perl/cgi-upload-hook.html but its
> > in PERL and uses some form of hook. I have no clue how to do it in
> > PHP.
> >
> > Any clues or right direction would be awesome.
>
> First of all, don't do that. :-)
>
> Instead, set up a "job" system of what should be copied/tarred, and
> then notify the user via email.
>
> Don't make the user sit there waiting for the computer!
>
> If you absolutely HAVE to do this due to a pointy-haired boss...
>
> <?php
> $path = "/full/path/to/1000s/of/files";
> $dir = opendir($path) or die("Change that path");
> $tmp = tmpname(); //or whatever...
> while (($file = readdir($dir)) !== false){
> echo "$file<br />\n";
> copy("$path/$file", "/tmp/$tmp/$path");
> }
> exec("tar -cf /tmp/$tmp.tar /tmp/$tmp/", $output, $error);
> echo implode("<br />\n", $output);
> if ($error){
> //handle error here!
> die("OS Error: $error");
> }
> ?>
>
> shameless plug:
> //handle error here could perhaps use this:
> http://l-i-e.com/perror.
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some indie artist.
> http://cdbaby.com/from/lynch
> Yeah, I get a buck. So?
>
>
I was actually doing what you just gave the code for. As of now, I was
doing something like:
""""
for file in files:
copy from source to folder
echo "Copying files encapsulated in ob_flush()"
tar the file which hardly takes time on the filessyetm but does take some time
Provide the link to the tar
"""
So at the client side it was like:
Copying file #1
Copying file #2
....
Download link
I though I could apply some funkiness to it by using some AJAX based
progress bar for which the example showed some sort of hooking and all
which I thought was too much for such a job. I will talk to my boss
regarding this and do the necessary.
BTW, whats the issue with AJAX based approach? Any particular reason
other then it seems to be a hack rather then an elegant solution
(which is more then enough reason not to implement it...but I wonder
if there is a technical reason to it too)?
--
Ritesh
http://www.riteshn.com
attached mail follows:
Hello,
on 02/13/2008 11:11 PM Ritesh Nadhani said the following:
> I though I could apply some funkiness to it by using some AJAX based
> progress bar for which the example showed some sort of hooking and all
> which I thought was too much for such a job. I will talk to my boss
> regarding this and do the necessary.
>
> BTW, whats the issue with AJAX based approach? Any particular reason
> other then it seems to be a hack rather then an elegant solution
> (which is more then enough reason not to implement it...but I wonder
> if there is a technical reason to it too)?
If the user hits the browser stop button, it may abort the process in
the server if you have the PHP option ignore_user_abort option set to
off. Other than that I do not see any other problem.
AJAX can be a little complicated if you have to code all the Javascript
by hand.
You may want to try this forms class that comes with an AJAX form
submission plug-in.
http://www.phpclasses.org/formsgeneration
Even if you do not need to submit any forms, the AJAX plug-in can be
used to do what you need without having to learn Javascript to implement
a browser independent AJAX solution.
Take a look at this live example that shows how to give progress
feedback of a task running on the server:
http://www.meta-language.net/forms-examples.html?example=test_ajax_form
--
Regards,
Manuel Lemos
PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
On Wed, February 13, 2008 1:51 am, Miguel J. Jiménez wrote:
> Hi, after enabling error reporting with E_ALL I am having this strange
> warning while loading a XML:
>
> Warning: DOMDocument::load() [function.DOMDocument-load]: Extra
> content
> at the end of the document in [...]
>
> The code I use is:
>
> $dom = new DOMDocument();
> $dom->load("http://example.com/file.xml");
> [...]
>
> If I open the xml uri (with firefox) I get a complete and well formed
> xml (nothing strange about it).
>
> With error reporting disabled everything works fine so I am
> puzzled :-( Any help will be appreciated.
Open the document in a Hex editor to see if there are unprintable
characters at the end.
It's also possible that they aren't at the END of the document, but at
the END of some node within the document, or even some CDATA within a
node within the document...
You could probably Google for an XML validator that would perhaps be
more specific about what's wrong where.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
I have a class method which declares a static variable within.However,
across all the instances of the class, the current value on that variable
replicates. Is it the intended functionality? Example: class A { public
function foo() { static $i=0; $i++; }}$obj1 = new
A();$obj1->foo(); //$i = 1 $obj2 = new A();$obj2->foo(); //$i = 2 where I
think it should be 1, becaue it's a new instance.
attached mail follows:
--- Pauau <wakamonka747
hotmail.com> wrote:
> I have a class method which declares a static variable
> within.However,
> across all the instances of the class, the current value on that
> variable
> replicates. Is it the intended functionality? Example: class A {
> public
> function foo() { static $i=0; $i++; }}$obj1 = new
> A();$obj1->foo(); //$i = 1 $obj2 = new A();$obj2->foo(); //$i = 2
> where I
> think it should be 1, becaue it's a new instance.
>
Pauau,
Please visit the link below for help..
http://www.php.net/manual/en/language.oop5.static.php
---
Nirmalya Lahiri
[+91-9433113536]
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
attached mail follows:
On Feb 13, 2008 8:44 PM, Nirmalya Lahiri <nirmalyalahiri
yahoo.com> wrote:
> --- Pauau <wakamonka747
hotmail.com> wrote:
>
> > I have a class method which declares a static variable
> > within.However,
> > across all the instances of the class, the current value on that
> > variable
> > replicates. Is it the intended functionality? Example: class A {
> > public
> > function foo() { static $i=0; $i++; }}$obj1 = new
> > A();$obj1->foo(); //$i = 1 $obj2 = new A();$obj2->foo(); //$i = 2
> > where I
> > think it should be 1, becaue it's a new instance.
> >
>
> Pauau,
> Please visit the link below for help..
> http://www.php.net/manual/en/language.oop5.static.php
what you are using is potentially not what you think it is. you are using
a 'static variable' which is not a static class member. you can find the
doc on static variables here,
http://www.php.net/manual/en/language.variables.scope.php
im not sure if their behavior is well defined when they are used in classes,
or objects.
as Nirmalya, has alluded, you should check out the docs on static class
members. im sure that you can achieve whatever you need to by using
some combination of static class members and instance variables.
-nathan
attached mail follows:
On Mon, February 11, 2008 1:23 pm, Richard Kurth wrote:
> Is there a way that I can call a function that will send an email and
> then move on redirecting to another website without having to what for
> the email to send?
> SendEmail($memberemail,$MailFrom,$MailHost);
> header("Location:http://domain.com");
The email is not actually sent if you use a decent email program that
just queues it up...
So it really should not take any time at all for the SendEmail
function to run...
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Mon, February 11, 2008 11:33 am, chetan rane wrote:
> Can any one tell me what will be the best way to maintain session
> information on a Multi Server Architecture i.e a Web Cluster.
Write a custom session handler which:
a) binhex the session data, and if it is less then 4K, put the actual
session data into a Cookie on the user's computer. Then their
session data travels with them.
b) If it's MORE than 4K, put it into memcache (or is it memcached?)
on an external box, which propogates to its own clusters.
More details somewhere on this site:
http://hostedlabs.com/
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
attached mail follows:
> Write a custom session handler which:
> a) binhex the session data, and if it is less then 4K, put the actual
> session data into a Cookie on the user's computer. Then their
> session data travels with them.
> b) If it's MORE than 4K, put it into memcache (or is it memcached?)
> on an external box, which propogates to its own clusters.
>
If you're going to store the user's session data as a cookie then make
sure there is nothing that will be insecure if they figure out how to
modify it.
--
Michael McGlothlin
Southwest Plumbing Supply
attached mail follows:
Thanks. I use kubuntu and have all ooo including base, but it seems
very minimal. I connected via jdbc (as only other option is odbc for
mysql). I can't even see how to define a key as auto increment, there
is no option. I tried dbdesigner4 and it is very old and buggy on
linux. I found a post that suggested I download the windows version and
run it under wine. Works great.
As for the OT, many apologies, I never even thought of looking for a
php-db list, thanks for the heads-up.
-Shawn
Thanks!
-Shawn
Daniel Brown wrote:
> On Feb 12, 2008 7:46 PM, Shawn McKenzie <nospam
mckenzies.net> wrote:
>
>> Can anyone recommend a preferably visual DB design tool? I normally use
>> mysql, but one that covered several types wood be cool. I'm on Linux,
>> so the new mysql workbench is a dud. I used it in an alpha or prior
>> version and it looked promising but crashed frequently. They say a
>> Linux version in 2008, but I'm not holding my breath.
>>
>
> For RAD-style database design, check out OpenOffice.org Base. I
> know it comes pre-packaged with Mandriva (which I use), but I'm not
> certain about other distros. Depending on your flavor, you can
> probably apt-get, yum, urpmi, or manually install from an RPM or DEB.
>
> It works a lot like Filemaker and Access, so if you're familiar
> with those, you should notice a lot of similarities. Plus, it will
> work without a problem with MyODBC, Unix ODBC, JDBC, and native
> connections.
>
> For future reference though, Shawn, try sending to the PHP-DB list
> when asking questions like that. Then it's not off-topic. ;-)
>
>
attached mail follows:
Wow,
Thnks...
Seems that are lots of routes to it.
Xavier de Lapeyre
Web Developer
Enterprise Data Services
www.eds.mu
Please consider the environment before printing this mail note.
-----Original Message-----
From: Robert Cummings [mailto:robert
interjinn.com]
Sent: mercredi 13 février 2008 00:57
To: Shawn McKenzie
Cc: php-general
lists.php.net
Subject: Re: [PHP] Template system in PHP
On Tue, 2008-02-12 at 14:22 -0600, Shawn McKenzie wrote:
> Ryan A wrote:
> > Add my vote too for Smarty....
> >
> > HTH,
> > -R
> >
> >
> >
> > ____________________________________________________________________________________
> > Looking for last minute shopping deals?
> > Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
>
> I like smarty and it's very powerful, however what you find is that it's
> just a less capable replacement for PHP. If I want conditional
> statements to display HTML and/or loop through arrays, why would I want
> to do it in smarty tags? Instead of moving display away from logic, it
> just replaces the logic with a different language. When I use templates
> I pretty much want variable substitution. My next project I'll probably
> use HTML files with little bits of PHP echos etc... sprinkled throughout.
I prefer content formatting encapsulation as provided by custom tags.
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. |
`------------------------------------------------------------'
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Sounds interesting...
Are your XML predefined or generated on the run? From say a DB?
Xavier
Please consider the environment before printing this mail note.
-----Original Message-----
From: Nathan Rixham [mailto:nrixham
gmail.com]
Sent: mercredi 13 février 2008 01:20
To: php-general
lists.php.net
Subject: Re: [PHP] Template system in PHP
Are you creating custom DTD's or 1.1 XHTML Mods then? I'd like to see
that, it's something I'd toyed with a few times in the past but found it
far too time consuming (even for me), and opted for the ol' redefine
everything in CSS
*lightbulb* :: runs off to try css on custom tags <why have i never
tried that before> :: <ponders accessibility..> :: wanders off to waste
time researching anyways>
Robert Cummings wrote:
> On Tue, 2008-02-12 at 15:02 -0600, Greg Donald wrote:
>> On Feb 12, 2008 2:57 PM, Robert Cummings <robert
interjinn.com> wrote:
>>> I prefer content formatting encapsulation as provided by custom tags.
>> Decorators?
>
> Custom tags (XML style ones anyways) provide support for arbitrary
> ordering and omission of optional attributes. They nest nicer than
> function calls, and they have the same general formatting as the HTML
> with which you are working. Additionally, they provide the opportunity
> to punt anything not necessary at run-time to pre-compiled HTML.
>
> Cheers,
> Rob.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Lol...
If IE7 goes "hun what?"
I wonder what would happen in lt IE7 :)
GO FIREFOX!!!
Xavier
-----Original Message-----
From: Nathan Rixham [mailto:nrixham
gmail.com]
Sent: mercredi 13 février 2008 01:27
To: php-general
lists.php.net
Subject: Re: [PHP] Template system in PHP
*sigh* as always, firefox obeys, ie7 goes huh what?
Nathan Rixham wrote:
> Are you creating custom DTD's or 1.1 XHTML Mods then? I'd like to see
> that, it's something I'd toyed with a few times in the past but found it
> far too time consuming (even for me), and opted for the ol' redefine
> everything in CSS
>
> *lightbulb* :: runs off to try css on custom tags <why have i never
> tried that before> :: <ponders accessibility..> :: wanders off to waste
> time researching anyways>
>
> Robert Cummings wrote:
>> On Tue, 2008-02-12 at 15:02 -0600, Greg Donald wrote:
>>> On Feb 12, 2008 2:57 PM, Robert Cummings <robert
interjinn.com> wrote:
>>>> I prefer content formatting encapsulation as provided by custom tags.
>>> Decorators?
>>
>> Custom tags (XML style ones anyways) provide support for arbitrary
>> ordering and omission of optional attributes. They nest nicer than
>> function calls, and they have the same general formatting as the HTML
>> with which you are working. Additionally, they provide the opportunity
>> to punt anything not necessary at run-time to pre-compiled HTML.
>>
>> Cheers,
>> Rob.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Xavier de Lapeyre wrote:
> Lol...
> If IE7 goes "hun what?"
> I wonder what would happen in lt IE7 :)
>
> GO FIREFOX!!!
>
>
> Xavier
>
>
>
> -----Original Message-----
> From: Nathan Rixham [mailto:nrixham
gmail.com]
> Sent: mercredi 13 février 2008 01:27
> To: php-general
lists.php.net
> Subject: Re: [PHP] Template system in PHP
>
> *sigh* as always, firefox obeys, ie7 goes huh what?
>
> Nathan Rixham wrote:
>> Are you creating custom DTD's or 1.1 XHTML Mods then? I'd like to see
>> that, it's something I'd toyed with a few times in the past but found it
>> far too time consuming (even for me), and opted for the ol' redefine
>> everything in CSS
>>
>> *lightbulb* :: runs off to try css on custom tags <why have i never
>> tried that before> :: <ponders accessibility..> :: wanders off to waste
>> time researching anyways>
>>
>> Robert Cummings wrote:
>>> On Tue, 2008-02-12 at 15:02 -0600, Greg Donald wrote:
>>>> On Feb 12, 2008 2:57 PM, Robert Cummings <robert
interjinn.com> wrote:
>>>>> I prefer content formatting encapsulation as provided by custom tags.
>>>> Decorators?
>>> Custom tags (XML style ones anyways) provide support for arbitrary
>>> ordering and omission of optional attributes. They nest nicer than
>>> function calls, and they have the same general formatting as the HTML
>>> with which you are working. Additionally, they provide the opportunity
>>> to punt anything not necessary at run-time to pre-compiled HTML.
>>>
>>> Cheers,
>>> Rob.
>
Ummm... It's 11:30PM my time and I'm half drunk. I can only assume the
same of you.
attached mail follows:
On Thu, 2008-02-14 at 08:58 +0400, Xavier de Lapeyre wrote:
> Sounds interesting...
> Are your XML predefined or generated on the run? From say a DB?
>From a compiler script that extends a base tag class... all it needs to
do is register the tag namespace, tag name, and the function that will
handle the tag's content. Here's a very simple case:
<?php
class ExampleSiteCompilersExampleSiteTag extends JinnBaseTagCompiler
{
var $filename = __FILE__;
function ___jinnConstruct()
{
$this->handlers = array
(
'example' => array
(
'mandatory' => 'expandTagMandatory',
),
);
}
function expandTagMandatory
( &$content, &$space, &$tag, &$atts, &$tagStack )
{
return '<span class="mandatory">*</span>';
}
}
?>
Then when doing forms I can do the following:
<example:mandatory/>
And that will be expanded to:
<span class="mandatory">*</span>
Then later down the road if I wanted the mandatory symbol to change to
an image, I could change the content expanded in the handler, rebuild
the site and all uses of the mandatory tag would be updated and would
incur no run-time overhead.
This is obviously a trivial example. There is much more that can be done.
For instance creating boxes, popups, relocating content, checking links,
image analysis to get the width and height of image at compile time instead
of run-time, etc. Encapsulating the data into a tag allows greatly
simplifying content. Also the tag system allows recursive expansion. So
a tag handler can output custom tags and those in turn will be expanded.
Hell, I could even create a validation tag around the primary layout
template that would then validate the content at build time.
Anyways, there ARE better template systems than PHP itself.
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:
> REST is the new SOAP. Yaml is the new XML. I'm guessing this news
> just hasn't made it into any PHP frameworks yet.
that's a very oversimplifying statement.
REST is good for small requests and stuff but there are cases when SOAP
is needed (at least in cases when you have to connect to some external
app with SOAP interface)
YAML is good for configuration files and stuff like that, but in no way
is replacement for XML, which is much more flexible and has the DOM API
which is very powerful.
and by the way, symfony has YAML configuration files and a plugin for
REST services.
greets
Zoltán Németh
- application/x-pkcs7-signature attachment: S/MIME Cryptographic Signature
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]