php-general Digest 1 Jan 2009 04:07:37 -0000 Issue 5876
Topics (messages 285286 through 285324):
Re: IE Problem Detecting Post Variables
285286 by: Phpster
285294 by: ceo.l-i-e.com
285316 by: L. Herbert
285317 by: L. Herbert
285318 by: Micah Gersten
285323 by: L. Herbert
285324 by: Lupus Michaelis
Re: Is MD5 still considered safe for storing application user passwords?
285287 by: ceo.l-i-e.com
Re: Webhotel structure
285288 by: Dotan Cohen
Re: =.='' what wrong ? just simple code, however error.
285289 by: LKSunny
285292 by: Micah Gersten
285293 by: ceo.l-i-e.com
285301 by: Daniel Brown
Re: Encryption/decryption of PHP data
285290 by: ceo.l-i-e.com
285315 by: Edward Diener
Re: PHP telnet server
285291 by: ceo.l-i-e.com
285295 by: Per Jessen
285297 by: Robert Cummings
285298 by: Robert Cummings
Question about version control.. sorta..
285296 by: TG
285299 by: Nathan Rixham
285300 by: Richard Heyes
285320 by: Micah Gersten
285322 by: Nathan Nobbe
When is an Exception not an Exception?
285302 by: ceo.l-i-e.com
285303 by: Nathan Nobbe
285304 by: ceo.l-i-e.com
285305 by: phphelp -- kbk
285306 by: Nathan Nobbe
Quick question regarding debugging and PHP structure.
285307 by: Ólafur Waage
285308 by: Ashley Sheridan
IM Convert PDF->JPG works in command line, not in PHP
285309 by: Brian Dunning
285310 by: Brian Dunning
285311 by: chris smith
285312 by: Brian Dunning
285313 by: Brian Dunning
Anyone else have trouble with Apple Mail threading this list?
285314 by: Brian Dunning
Re: system() Question
285319 by: Micah Gersten
285321 by: Nathan Nobbe
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
Try checking to see if the value was passed with var_dump($_REQUEST)
Also try (!empty($_REQUEST['style']))
Bastien
Sent from my iPod
On Dec 31, 2008, at 10:24 AM, "L. Herbert" <[email protected]>
wrote:
Hello all,
Anyone have insight to share on the following issue:
I have a simple theme switcher script that functions as expected in
FF, Safari, etc. but does not work in IE 6 or 7. It appears that
the posted form variables are not detected in IE. I am using the
following check within the script:
if(isset($_REQUEST['style'])) {
$style = $_REQUEST['style'];
}
Thanks in advance for your assistance.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Whatever is SENDING the request data is broken, almost for sure.
PHP doesn't *do* much to the HTTP Request data except urldecode it for you.
There's not much that can go wrong there.
If your theme switcher, presumably in JS, isn't sending the data properly,
there's not much PHP can do about it.
"If the quarterback throws the ball nowhere near the receiver, don't blame the
receiver."
--- End Message ---
--- Begin Message ---
Bastien,
Thanks for your response. The curious thing is that the value is
passed when using FF, but not passed when using IE.
Here is the relevant form html:
<div id="switch-theme">
<form action="" method="post">
<label>Flip It!</label>
<input name="style" type="image" src="images/switch-button-
grey.gif" title="Default Theme" id="style1" value="default" />
<input name="style" type="image" src="himages/switch-button-
default.gif" title="Alternate Theme" id="style2" value="alternate" />
</form>
</div>
The action attribute is left blank so the form posts to the current
page. The theme switcher script is at the top of each page and
intercepts the posted variables.
Any thoughts?
On Dec 31, 2008, at 11:02 AM, Phpster wrote:
Try checking to see if the value was passed with var_dump($_REQUEST)
Also try (!empty($_REQUEST['style']))
Bastien
Sent from my iPod
On Dec 31, 2008, at 10:24 AM, "L. Herbert"
<[email protected]> wrote:
Hello all,
Anyone have insight to share on the following issue:
I have a simple theme switcher script that functions as expected in
FF, Safari, etc. but does not work in IE 6 or 7. It appears that
the posted form variables are not detected in IE. I am using the
following check within the script:
if(isset($_REQUEST['style'])) {
$style = $_REQUEST['style'];
}
Thanks in advance for your assistance.
--
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
--- End Message ---
--- Begin Message ---
I agree with your supposition. The problem is that the variable is
passed in one instance with FF and not with IE. Thus my quandary.
Here's the form html:
<div id="switch-theme">
<form action="" method="post">
<label>Flip It!</label>
<input name="style" type="image" src="images/switch-button-grey.gif"
title="Default Theme" id="style1" value="default" />
<input name="style" type="image" src="himages/switch-button-
default.gif" title="Alternate Theme" id="style2" value="alternate" />
</form>
</div>
Any thoughts?
On Dec 31, 2008, at 11:27 AM, [email protected] wrote:
Whatever is SENDING the request data is broken, almost for sure.
PHP doesn't *do* much to the HTTP Request data except urldecode it
for you.
There's not much that can go wrong there.
If your theme switcher, presumably in JS, isn't sending the data
properly, there's not much PHP can do about it.
"If the quarterback throws the ball nowhere near the receiver, don't
blame the receiver."
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
L. Herbert wrote:
> The problem is that the variable is passed in one instance with FF and
> not with IE. Thus my quandary.
>
> Here's the form html:
>
> <div id="switch-theme">
> <form action="" method="post">
> <label>Flip It!</label>
> <input name="style" type="image"
> src="images/switch-button-grey.gif" title="Default Theme" id="style1"
> value="default" />
> <input name="style" type="image"
> src="himages/switch-button-default.gif" title="Alternate Theme"
> id="style2" value="alternate" />
> </form>
> </div>
>
> Any thoughts?
>
How is this being submitted?
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
--- End Message ---
--- Begin Message ---
Each input is a "submit" button.
On Dec 31, 2008, at 8:57 PM, Micah Gersten wrote:
L. Herbert wrote:
The problem is that the variable is passed in one instance with FF
and
not with IE. Thus my quandary.
Here's the form html:
<div id="switch-theme">
<form action="" method="post">
<label>Flip It!</label>
<input name="style" type="image"
src="images/switch-button-grey.gif" title="Default Theme" id="style1"
value="default" />
<input name="style" type="image"
src="himages/switch-button-default.gif" title="Alternate Theme"
id="style2" value="alternate" />
</form>
</div>
Any thoughts?
How is this being submitted?
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
L. Herbert a écrit :
Each input is a "submit" button.
MSIE pushes input_name.x and input_name.y to the server, when the
input is an image.
--
Mickaël Wolff aka Lupus Michaelis
http://lupusmic.org
--- End Message ---
--- Begin Message ---
For a bank? No, MD5 would not be acceptable.
For you gramma's blog? Sure, MD5 for passwords is fine.
--- End Message ---
--- Begin Message ---
2008/12/31 tedd <[email protected]>:
> At 9:47 AM +0200 12/31/08, Dotan Cohen wrote:
>>
>> 2008/12/31 tedd <[email protected]>:
>>>
>>> Everythink about getin' a job?
>>>
>>
>> There's that word again! You keep using that word. I do not think that
>> it means what you think it means.
>>
>> --
>> Dotan Cohen
>
> Dotan:
>
> And perhaps nether of us understand what the other is saying.
>
> I was using it in a humorous manner, at least that was my intent.
>
It was a quote from The Princess Bride, also in humorous manner.
> Cheers and Happy New Year.
>
A safe New Year!
--
Dotan Cohen
http://what-is-what.com
http://gibberish.co.il
א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת
ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي
А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я
а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я
ä-ö-ü-ß-Ä-Ö-Ü
--- End Message ---
--- Begin Message ---
i need accuracy, how to ?
Thank You.
"Per Jessen" <[email protected]> ¼¶¼g©ó¶l¥ó·s»D:[email protected]...
LKSunny wrote:
> <?
> $credithold = 100;
> for($i=1;$i<=1000;$i++){
> $credithold -= 0.1;
> echo "$credithold<br />";
> }
> //i don't know why, when run this code, on 91.3 after expect is 91.2,
> however......91.200000000001
> //who can help me ? and tell me why ?
It's a floating point rounding error. If you don't need the accuracy,
just round it to what you need.
/Per Jessen, Zurich
--- End Message ---
--- Begin Message ---
http://us3.php.net/manual/en/function.number-format.php
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
LKSunny wrote:
> i need accuracy, how to ?
>
> Thank You.
>
> "Per Jessen" <[email protected]>
> ¼¶¼g©ó¶l¥ó·s»D:[email protected]...
> LKSunny wrote:
>
>
>> <?
>> $credithold = 100;
>> for($i=1;$i<=1000;$i++){
>> $credithold -= 0.1;
>> echo "$credithold<br />";
>> }
>> //i don't know why, when run this code, on 91.3 after expect is 91.2,
>> however......91.200000000001
>> //who can help me ? and tell me why ?
>>
>
> It's a floating point rounding error. If you don't need the accuracy,
> just round it to what you need.
>
>
> /Per Jessen, Zurich
>
>
>
>
--- End Message ---
--- Begin Message ---
If it's money, store everything in pennies INTEGER, and format as dollars on
output.
--- End Message ---
--- Begin Message ---
On Wed, Dec 31, 2008 at 11:15, LKSunny <[email protected]> wrote:
> i need accuracy, how to ?
No you don't. Not the level of accuracy Per was mentioning. His
suggestion to round() is what you need. Just adjust the [optional]
second parameter to the number of decimal places you wish to round:
<?php
$credithold = 100;
for($i=1;$i<=1000;$i++){
$credithold -= 0.1;
echo round($credithold,1)."<br />\n";
}
?>
> "Per Jessen" <[email protected]> 撰寫於郵件新聞:[email protected]...
> LKSunny wrote:
>
>> <?
>> $credithold = 100;
>> for($i=1;$i<=1000;$i++){
>> $credithold -= 0.1;
>> echo "$credithold<br />";
>> }
>> //i don't know why, when run this code, on 91.3 after expect is 91.2,
>> however......91.200000000001
>> //who can help me ? and tell me why ?
>
> It's a floating point rounding error. If you don't need the accuracy,
> just round it to what you need.
>
>
> /Per Jessen, Zurich
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
</Daniel P. Brown>
[email protected] || [email protected]
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!
--- End Message ---
--- Begin Message ---
As I understand it:
You can LINK your commercial binary with GPL binaries, and keep closed source.
You cannot co-mingle the two C source codes together and keep it closed.
I am fairly certain you can find commercial C++ offerings to generate PGP key
pairs, instead of using the GnuPG OSS alternative...
--- End Message ---
--- Begin Message ---
Phpster wrote:
In reading the license I believe it refers to the gnupg itself, not the
application it may be embedded in. You are completely free to use gnupg
as you choose including modifying it to meet your needs.
I always thought the GNU public license demanded that any non-free
modules, which use any software distributed with this license, make
their source code freely available to end users. If this is either not
the case or no longer the case, then I will be glad to use GnuPG.
Bastien
Sent from my iPod
On Dec 30, 2008, at 10:50 PM, Edward Diener <[email protected]> wrote:
My client application needs to send data to a PHP page in encrypted form
and have the PHP code able to decrypt it. Likewise the PHP code needs to
return data to my application encrypted and my client application needs
to be able to decrypt it.
My application is written in C++ and naturally the PHP page is written
in PHP.
I do understand that public key-private key cryptography is the way to
go. So far my Internet search has turrned up GnuPG as a means of doing
public key-private key cryptography for PHP with libraries for C++ also.
However the client application is a commercial application and unless I
misunderstand the GNU General Public License the software of the
application which uses GnuPG must allow its source to be freely
available in order to use the library. This is of course something which
I am completely unwilling to do for the commercial application.
Is there any other public key-private key cryptography solution on the
PHP side which also has a C++ library which I can use for the client
application, which does not adhere to the GNU General Public License ?
This does not have to be a free product.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
>> I often thought PHP would be a nice language for a MUD, if one could
>> get the performance out of it...
>
> Design your code such that you can just throw more hardware at it
> whenever you need more performance.
That's easily said, but a MUD means all the users have to share a significant
portion of your data model.
Though I suspect the bandwidth issue would be the main bottleneck most of the
time...
I don't want to get into this in much detail, mainly because I've spent all of
5 minutes seriously thinking about it, and may just need more bake-time...
But it's not ALWAYS that easy to architect something to be "shared-nothing"
even with PHP.
--- End Message ---
--- Begin Message ---
[email protected] wrote:
>
>>> I often thought PHP would be a nice language for a MUD, if one could
>>> get the performance out of it...
>>
>> Design your code such that you can just throw more hardware at it
>> whenever you need more performance.
>
> That's easily said, but a MUD means all the users have to share a
> significant portion of your data model.
That's fine - there are many well-known schemes for distributing and
updating such data.
> Though I suspect the bandwidth issue would be the main bottleneck most
> of the time...
> I don't want to get into this in much detail, mainly because I've
> spent all of 5 minutes seriously thinking about it, and may just need
> more bake-time...
> But it's not ALWAYS that easy to architect something to be
> "shared-nothing" even with PHP.
It's not easy in any language, but if your key concern is the
performance of PHP (as a language), hardware is what you need. You can
design your software to run on a single box with lots of CPU cores, or
you can go for a distributed (and more easily scalable) approach. If
you don't need/want straight scalability, go for the 32 cores all
ticking at 3GHz. Once that is saturated, buy another one.
/Per Jessen, Zürich
--- End Message ---
--- Begin Message ---
On Wed, 2008-12-31 at 16:19 +0000, [email protected] wrote:
> >> I often thought PHP would be a nice language for a MUD, if one could
> >> get the performance out of it...
> >
> > Design your code such that you can just throw more hardware at it
> > whenever you need more performance.
>
> That's easily said, but a MUD means all the users have to share a significant
> portion of your data model.
>
> Though I suspect the bandwidth issue would be the main bottleneck most of the
> time...
Nah, you can run a MUD on most home internet connections these days. It
really takes up very little bandwidth. I think our web-based builder
eats more bandwidth than the mud itself.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
--- End Message ---
--- Begin Message ---
On Wed, 2008-12-31 at 17:35 +0100, Per Jessen wrote:
> [email protected] wrote:
>
> >
> >>> I often thought PHP would be a nice language for a MUD, if one could
> >>> get the performance out of it...
> >>
> >> Design your code such that you can just throw more hardware at it
> >> whenever you need more performance.
> >
> > That's easily said, but a MUD means all the users have to share a
> > significant portion of your data model.
>
> That's fine - there are many well-known schemes for distributing and
> updating such data.
>
> > Though I suspect the bandwidth issue would be the main bottleneck most
> > of the time...
> > I don't want to get into this in much detail, mainly because I've
> > spent all of 5 minutes seriously thinking about it, and may just need
> > more bake-time...
> > But it's not ALWAYS that easy to architect something to be
> > "shared-nothing" even with PHP.
>
> It's not easy in any language, but if your key concern is the
> performance of PHP (as a language), hardware is what you need. You can
> design your software to run on a single box with lots of CPU cores, or
> you can go for a distributed (and more easily scalable) approach. If
> you don't need/want straight scalability, go for the 32 cores all
> ticking at 3GHz. Once that is saturated, buy another one.
If you go multi core then you need to go with a threaded approach...
which makes the development a bit complex for newbies to MUD
development. I don't think I'd go distributed since people whine about
lag that takes a 1/4 second... distributed would inherently require more
time while messages are passed to and fro.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
--- End Message ---
--- Begin Message ---
Ok.. so I know about CVS and SVN and unfortunately haven't had as much
experience with them as I'd like. I've used them, but always in a really
basic sense and always on systems that have already been set up. A friend
recently mentioned GIT ( http://git.or.cz/ ) too.
But here's my situation.. I deal with dozens of clients. I usually make a
backup copy of their site (at least the files, not usually the DB) so I
have the latest copy of the site to make changes to. Usually I'm the only
one working on the site, but sometimes other people may make changes too.
Not so often than we're conflicting with our changes, or if this is a known
issue, we make sure to coordinate.
What I'd ideally like to do is be able to use a CVS type system to keep
incremental backups of the code. So instead of checking code out of CVS,
changing it, then checking it back in... I'd like to just do a mass checkin
of the whole site and have changes recorded and the ability to look at
previous versions with DIFF and all that. And of course the ability to
'check out' a previous set of files by date or revision maybe.
I assume you can do this with one of the major version control systems, but
mostly what I see with how to use these systems involves checking code out
then checking it back in. That's not really what I want to do.
The other issue is that I run Windows. So if there's something nice and
WinGUI, that'd be nice. Please no "you should be running linux"
responses. I don't have anything against Linux or Mac, they're great
systems. But I have my reasons for running Windows.
Also, I realize this is semi-OT for a PHP list, but asking on a CVS list or a
SVN list might not give me the more comprehensive/broad experience base I'm
looking for. I'd like a semi-unbiased response. :)
Thanks in advance!
-TG
--- End Message ---
--- Begin Message ---
TG wrote:
Ok.. so I know about CVS and SVN and unfortunately haven't had as much
experience with them as I'd like. I've used them, but always in a really
basic sense and always on systems that have already been set up. A friend
recently mentioned GIT ( http://git.or.cz/ ) too.
But here's my situation.. I deal with dozens of clients. I usually make a
backup copy of their site (at least the files, not usually the DB) so I
have the latest copy of the site to make changes to. Usually I'm the only
one working on the site, but sometimes other people may make changes too.
Not so often than we're conflicting with our changes, or if this is a known
issue, we make sure to coordinate.
What I'd ideally like to do is be able to use a CVS type system to keep
incremental backups of the code. So instead of checking code out of CVS,
changing it, then checking it back in... I'd like to just do a mass checkin
of the whole site and have changes recorded and the ability to look at
previous versions with DIFF and all that. And of course the ability to
'check out' a previous set of files by date or revision maybe.
I assume you can do this with one of the major version control systems, but
mostly what I see with how to use these systems involves checking code out
then checking it back in. That's not really what I want to do.
The other issue is that I run Windows. So if there's something nice and
WinGUI, that'd be nice. Please no "you should be running linux"
responses. I don't have anything against Linux or Mac, they're great
systems. But I have my reasons for running Windows.
Also, I realize this is semi-OT for a PHP list, but asking on a CVS list or a
SVN list might not give me the more comprehensive/broad experience base I'm
looking for. I'd like a semi-unbiased response. :)
Thanks in advance!
-TG
Hi TG,
I use svn (on windows and linux); and very happy with it :)
Not sure if you already have an SVN server or not, if you don't best to
get one installed on server somewhere I'd reckon.
To use with windows you can get something like Tortoise SVN which
integrates right in to the windows shell; updateing, commiting etc is as
simple as a right click on a synchronised folder.
http://tortoisesvn.tigris.org/
Personally though; I use eclipse as my IDE (on windows + linux), and let
eclipse handle all my svn needs by way of Subversive SVN (kit and
connectors from polarion); works a charm and keeps everything in the ide
+ caters for all the norms like importing, rolling back, diff etc etc -
couldn't recommend it enough.
Regards
--- End Message ---
--- Begin Message ---
> What I'd ideally like to do is be able to use a CVS type system to keep
> incremental backups of the code.
Space is so cheap these days I don't think is particularly useful to
do incremental backups unless you have a hell of a lot of data. I
simply do full backups daily. Now...
> So instead of checking code out of CVS,
> changing it, then checking it back in... I'd like to just do a mass checkin
> of the whole site and have changes recorded and the ability to look at
> previous versions with DIFF and all that. And of course the ability to
> 'check out' a previous set of files by date or revision maybe.
You can definitely do this with CVS and I assume SVN. I keep a
separate "abbreviated" change log which I compile manually from
checkin diffs. This changelog is what I publish. No one wants to know
about the whitespace changes I've done for example. Or maybe they do -
saddos
> I assume you can do this with one of the major version control systems, but
> mostly what I see with how to use these systems involves checking code out
> then checking it back in. That's not really what I want to do.
I find it quite useful. It's an extra step but the advantages it
provides are more than worth it.
> The other issue is that I run Windows. So if there's something nice and
> WinGUI, that'd be nice. Please no "you should be running linux"
You should be running linux. Muhaha.
> responses. I don't have anything against Linux or Mac, they're great
> systems. But I have my reasons for running Windows.
There's definitely a Gui for CVS. TurtleCVS IIRC. Presumably there's
one for SVN.
--
Richard Heyes
HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org (Updated December 20th)
--- End Message ---
--- Begin Message ---
Richard Heyes wrote:
>> The other issue is that I run Windows. So if there's something nice and
>> WinGUI, that'd be nice. Please no "you should be running linux"
>>
>
> You should be running linux. Muhaha.
>
>
>> responses. I don't have anything against Linux or Mac, they're great
>> systems. But I have my reasons for running Windows.
>>
>
> There's definitely a Gui for CVS. TurtleCVS IIRC. Presumably there's
> one for SVN.
>
>
TortoiseCVS and TortoiseSVN on Windows
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
--- End Message ---
--- Begin Message ---
On Wed, Dec 31, 2008 at 9:40 AM, TG <[email protected]> wrote:
> Ok.. so I know about CVS and SVN and unfortunately haven't had as much
> experience with them as I'd like. I've used them, but always in a really
> basic sense and always on systems that have already been set up. A friend
> recently mentioned GIT ( http://git.or.cz/ ) too.
>
> But here's my situation.. I deal with dozens of clients. I usually make a
> backup copy of their site (at least the files, not usually the DB) so I
> have the latest copy of the site to make changes to. Usually I'm the only
> one working on the site, but sometimes other people may make changes too.
> Not so often than we're conflicting with our changes, or if this is a known
> issue, we make sure to coordinate.
>
> What I'd ideally like to do is be able to use a CVS type system to keep
> incremental backups of the code. So instead of checking code out of CVS,
> changing it, then checking it back in... I'd like to just do a mass checkin
> of the whole site and have changes recorded and the ability to look at
> previous versions with DIFF and all that. And of course the ability to
> 'check out' a previous set of files by date or revision maybe.
>
>
> I assume you can do this with one of the major version control systems, but
> mostly what I see with how to use these systems involves checking code out
> then checking it back in. That's not really what I want to do.
>
> The other issue is that I run Windows. So if there's something nice and
> WinGUI, that'd be nice. Please no "you should be running linux"
> responses. I don't have anything against Linux or Mac, they're great
> systems. But I have my reasons for running Windows.
>
> Also, I realize this is semi-OT for a PHP list, but asking on a CVS list or
> a
> SVN list might not give me the more comprehensive/broad experience base I'm
> looking for. I'd like a semi-unbiased response. :)
im not sure how well git works on windows atm, but if youre interested in a
dcvs that works on windows, ive heard good things about mercurial; its
written in python.
http://www.selenic.com/mercurial/wiki/
-nathan
--- End Message ---
--- Begin Message ---
We have code like this:
try
{
$details = $this->__client->getData($email); //Line 274
}
catch (SoapFault $sf)
{
//do stuff
}
catch (Exception $e)
{
//do more general stuff
}
SoapFault: No data found in C:\classes\Client.php on line 274
Hello?
What is the point of all this try/catch stuff, eh?
I don't think we've done anything particularly fancy/tricky with the class
hierarchy.
--- End Message ---
--- Begin Message ---
On Wed, Dec 31, 2008 at 12:41 PM, <[email protected]> wrote:
>
> We have code like this:
>
> try
> {
> $details = $this->__client->getData($email); //Line 274
> }
> catch (SoapFault $sf)
> {
> //do stuff
> }
> catch (Exception $e)
> {
> //do more general stuff
> }
>
> SoapFault: No data found in C:\classes\Client.php on line 274
>
> Hello?
>
> What is the point of all this try/catch stuff, eh?
>
you dont have to use it if you dont want, in fact you could strip it out of
that code segment if you wanted to.
> I don't think we've done anything particularly fancy/tricky with the class
> hierarchy.
>
nobody said you did, but that has no bearing on the fact that the Soap
extension throws exceptions. as i said you dont have to catch them, but the
idea is they provide opportunities for your code to degrade gracefully in
the event of a problem occurring.
-nathan
--- End Message ---
--- Begin Message ---
I'm afraid I wasn't clear enough.
I thought the "catch" block was not actually 'catching' anything, since I'm
seeing an error message with the line of code that is causing the Fault.
Turns out, XDebug is kindly splatting out the exception even though it's being
caught.
Which I'm sure it desirable to many folk in dev environment.
But my colleagues' habit of using Exceptions for non-exceptional events is
pretty much going to drive me crazy, like it or not.
There's probably some setting for xdebug that I need to turn off to just ignore
caught Exceptions.
Hopefully it will still blow up for un-caught Exceptions...
Sorry for the noise. Now that I know what is happening, I'm feeling silly for
asking.
--- End Message ---
--- Begin Message ---
On Dec 31, 2008, at 2:12 PM, [email protected] wrote:
Sorry for the noise. Now that I know what is happening, I'm feeling
silly for asking.
For me, hitting the the "Send" button often suddenly opens my eyes.
Too bad there is no "un-Send" button.
Ken
--- End Message ---
--- Begin Message ---
On Wed, Dec 31, 2008 at 1:12 PM, <[email protected]> wrote:
>
> I'm afraid I wasn't clear enough.
>
> I thought the "catch" block was not actually 'catching' anything, since I'm
> seeing an error message with the line of code that is causing the Fault.
oic. yeah xdebug will do things like that, you may want to experiment w/
the xdebug settings in php.ini; if you cant get it cleared up that way, you
may just have to disable it to test this piece of code.
you might also look at which settings you can toggle via .htaccess. what im
getting at is see if you can have an instance of the site w/ your settings
(possibly disable xdebug) and other instances for your colleagues where they
can enable it if they like.
Turns out, XDebug is kindly splatting out the exception even though it's
> being caught.
>
> Sorry for the noise. Now that I know what is happening, I'm feeling silly
> for asking.
i wouldnt worry about it; i dont think theres a spot in the xdebug docs
where they discuss how it can screw up some things you might want to leave
alone :D
-nathan
--- End Message ---
--- Begin Message ---
Short: Is it possible to see the PHP code that is going to be
processed in whole?
Long: I love to see things visually, and while programming i create
all kinds of debugging variables i keep on the side for each
page/request.
I know this is possibly not possible since this has to be done from
either the Zend Engine or PHP itself, but if i could see a complete
output of all the code within my project that is used for a certain
execution.
Example:
I call index.php?page=10
index.php includes functions.php and classes.php
classes.php include page_classes.php if there is a $_GET["page"]
variable set and product_classes.php if there is a $_GET["product"]
variable set
What i would like to see is the linear output of what code is included
(so the data of functions.php, classes.php, then page_classes.php, and
then index.php (not product_classes.php since its not included within
this request)
This is most likely possible with some PHP code but I'm thinking of
trying to make sense of an old project i didn't create quickly and if
this is possible it would help a lot.
--- End Message ---
--- Begin Message ---
On Wed, 2008-12-31 at 20:41 +0000, Ólafur Waage wrote:
> Short: Is it possible to see the PHP code that is going to be
> processed in whole?
>
> Long: I love to see things visually, and while programming i create
> all kinds of debugging variables i keep on the side for each
> page/request.
> I know this is possibly not possible since this has to be done from
> either the Zend Engine or PHP itself, but if i could see a complete
> output of all the code within my project that is used for a certain
> execution.
>
> Example:
> I call index.php?page=10
>
> index.php includes functions.php and classes.php
> classes.php include page_classes.php if there is a $_GET["page"]
> variable set and product_classes.php if there is a $_GET["product"]
> variable set
>
> What i would like to see is the linear output of what code is included
> (so the data of functions.php, classes.php, then page_classes.php, and
> then index.php (not product_classes.php since its not included within
> this request)
>
> This is most likely possible with some PHP code but I'm thinking of
> trying to make sense of an old project i didn't create quickly and if
> this is possible it would help a lot.
>
Have you looked at PHPDebug? It offers something similar to what has
been offered by ASP, ColdFusion, and .Net in terms of debugging output,
and could help you?
Ash
www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
Here's a weird thing. I have a new Redhat machine, with PHP 5.2.6 and
IM 6.4.8. The following works beautifully on the command line:
convert original.pdf new.jpg
But from PHP, it only works beautifully if I specify complete
pathnames for convert, the original file, and the new file (that's OK,
no problem), but it only works converting JPG and GIF images. As soon
as I try to convert a PDF image, it fails:
<?php
$command_line = "/usr/local/imagemagick/bin/convert /var/www/html/
original.pdf /var/www/new.jpg";
system($command_line, $return_var);
?>
$return_var = 1. I don't have ghostscript, but I figured I don't need
it since the PDF->JPG conversions works on the command line. Any
suggestions?
--- End Message ---
--- Begin Message ---
My typo skipping the '/html/' in the pathname, the paths are correct
in my actual code.
On Dec 31, 2008, at 3:24 PM, Brian Dunning wrote:
/var/www/html/original.pdf /var/www/html/new.jpg
--- End Message ---
--- Begin Message ---
> But from PHP, it only works beautifully if I specify complete pathnames for
> convert
/usr/local/imagemagick/ is not in apache's $PATH, so you need to
specify the full location.
> As soon as I try to convert a PDF
> image, it fails:
>
> <?php
> $command_line = "/usr/local/imagemagick/bin/convert
> /var/www/html/original.pdf /var/www/new.jpg";
> system($command_line, $return_var);
Try using exec() so you get the whole return message, might be
something useful in there.
exec($command_line, $return_output, $return_code);
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---
--- Begin Message ---
Interesting. When I try this, $return_output gives an empty array, and
$return_code gives 1.
On Dec 31, 2008, at 3:38 PM, chris smith wrote:
Try using exec() so you get the whole return message, might be
something useful in there.
exec($command_line, $return_output, $return_code);
--- End Message ---
--- Begin Message ---
OMG. I had not set the permissions properly on the destination
directory. It works now.
Sorry for wasting the list's time, and thanks to Chris for your help.
--- End Message ---
--- Begin Message ---
I use Apple Mail, and subscribe to many lists but PHP-General is the
only one I have this problem with. People tell me that my replies are
not properly threaded to the original post. When I hit Reply or Reply
All in Mail, it wants to reply directly to the poster, and only CC's
the list. So I drag the CC address up to the To field and delete the
poster's address. Seems like the best I can do, but it creates this
problem people have reported. Do I just totally suck, or is there a
more reasonable explanation?
--- End Message ---
--- Begin Message ---
Nathan Nobbe wrote:
>
>
> On Sun, Dec 28, 2008 at 8:40 PM, Micah Gersten <[email protected]
> <mailto:[email protected]>> wrote:
>
> Nathan Nobbe wrote:
> > good point dan, and just to add further clarification, thats b/c the
> > function specifies $return_var is passed by reference in the formal
> > parameter. when you include the & along w/ an actual parameter
> (during
> > function invocation) thats referred to as
> call-time-pass-by-reference in
> > php, and its typically frowned upon. in fact, i think its being
> removed
> > from a future version of php.
> >
> > -nathan
> >
> >
> You don't call system using the ampersand. The reference is
> declared in
> the function definition. There's no reason for this to be frowned
> upon.
>
>
> well i dont think they deprecated it for shits-&-giggles.
>
> http://us.php.net/manual/en/language.references.pass.php
>
> its disabled by default in php.ini; wonder why.. ;)
>
>
> What you are referring to is the old PHP4 style of explicit
> pass-by-reference in function usage which is frowned upon.
>
>
> no im referring to call-time-pass by reference, which works just as
> well in php5; as long as you enable it in php.ini (or one of the other
> various ways).
>
> and also, for clarification, marking parameters as pass-by-reference
> works during method definition in php4 as well, of course.
>
> -nathan
>
I think I was confused here about your response. After re-reading a few
times, I see that you were enhancing Dan's response by explaining what
call-time pass by reference is, not saying that the function is used
that way.
My apologies.
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
--- End Message ---
--- Begin Message ---
On Wed, Dec 31, 2008 at 7:03 PM, Micah Gersten <[email protected]> wrote:
> Nathan Nobbe wrote:
> >
> >
> > On Sun, Dec 28, 2008 at 8:40 PM, Micah Gersten <[email protected]
> > <mailto:[email protected]>> wrote:
> >
> > Nathan Nobbe wrote:
> > > good point dan, and just to add further clarification, thats b/c
> the
> > > function specifies $return_var is passed by reference in the formal
> > > parameter. when you include the & along w/ an actual parameter
> > (during
> > > function invocation) thats referred to as
> > call-time-pass-by-reference in
> > > php, and its typically frowned upon. in fact, i think its being
> > removed
> > > from a future version of php.
> > >
> > > -nathan
> > >
> > >
> > You don't call system using the ampersand. The reference is
> > declared in
> > the function definition. There's no reason for this to be frowned
> > upon.
> >
> >
> > well i dont think they deprecated it for shits-&-giggles.
> >
> > http://us.php.net/manual/en/language.references.pass.php
> >
> > its disabled by default in php.ini; wonder why.. ;)
> >
> >
> > What you are referring to is the old PHP4 style of explicit
> > pass-by-reference in function usage which is frowned upon.
> >
> >
> > no im referring to call-time-pass by reference, which works just as
> > well in php5; as long as you enable it in php.ini (or one of the other
> > various ways).
> >
> > and also, for clarification, marking parameters as pass-by-reference
> > works during method definition in php4 as well, of course.
> >
> > -nathan
> >
> I think I was confused here about your response. After re-reading a few
> times, I see that you were enhancing Dan's response by explaining what
> call-time pass by reference is, not saying that the function is used
> that way.
> My apologies.
>
no worries
-nathan
--- End Message ---