Re: [PHP] How to get a PHP bug fixed?

2012-11-17 Thread Iñigo Medina


On Sat, 17 Nov 2012, Enumag wrote:


Hi, there is a bug I'd like to be fixed and even a patch is available. But
there is still no reaction at all after 2 years. What else can I do to get
the bug fixed?

https://bugs.php.net/bug.php?id=45351 - patch available from 2010-06-13
https://bugs.php.net/bug.php?id=48724 - patch available from 2012-04-13


It looks like there is a thread about that on the PHP Bugzilla, but it is not
admitted as a patch to be accepted. Maybe you might try by GitHub, making
a pull request.

iñ



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

Re: [PHP] re:Switch - Case Statement Questions

2012-11-16 Thread Iñigo Medina


On Fri, 16 Nov 2012, Ken Robinson wrote:


At 07:10 AM 11/16/2012, Omar Muhsin wrote:

Hello,

I was just wondering after writting the code in version 2 here below, it 
turns out in testing that it actually PHP is not validating the expressions 
instead always I get the first case.


1.Using nested if statement {THE INTENDED BEHAVIOR}:
if ($count  14)
$boxes = 3;
elseif($count  7  $count = 14)
$boxes = 2;
else
$boxes = 1;

2. Using Switch {ALWAYS FIRST CASE!!!}

//$boxes = 1;
//switch ($count) {
//case ($count  14):
//$boxes = 3;
//break;
//case ($count  7  $count = 14):
//$boxes = 2;
//break;
//case ($count = 7):
//default :
//$boxes = 1;
//break;
//}


For the switch statement to work, you need to use switch (true)
  $boxes = 1;
  switch (true) {
   case ($count  14):
   $boxes = 3;
   break;
  case ($count  7  $count = 14):
   $boxes = 2;
  break;
  case ($count = 7):
   default :
  $boxes = 1;
  break;
   }


I understand you use `switch` there for answering the question 'which of the
n following questions is true'. But how do you evaluate `$count`?

iñ



BTW, you don't need the break statement at the end of the last case and you 
don't really need the case ($count = 7) since that condition is what 
remains anyway.


Ken


--
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

Re: [PHP] Re: Switch - Case Statement Questions

2012-11-16 Thread Iñigo Medina


On Fri, 16 Nov 2012, Jim Giner wrote:


On 11/16/2012 12:38 PM, Tim Streater wrote:

On 16 Nov 2012 at 12:10, Omar Muhsin mrfroa...@gmail.com wrote:


Hello,

I was just wondering after writting the code in version 2 here below, it 
turns
out in testing that it actually PHP is not validating the expressions 
instead

always I get the first case.

1.Using nested if statement {THE INTENDED BEHAVIOR}:
if ($count  14)
$boxes = 3;
elseif($count  7  $count = 14)


You don't need the count=14 part as you will *only* get there if 
$count=14.



$boxes = 2;
else
$boxes = 1;

2. Using Switch {ALWAYS FIRST CASE!!!}

//$boxes = 1;
//switch ($count) {
//case ($count  14):
//$boxes = 3;
//break;
//case ($count  7  $count = 14):
//$boxes = 2;
//break;
//case ($count = 7):
//default :
//$boxes = 1;
//break;
//}


Does anyone know the answer why using the Switch it always execute the 
first

case ?


As has been pointed out you need switch(true).

That's a strange way of writing a switch, IMO. You should be using the if 
version.


--
Cheers  --  Tim

Maybe I'm way out of touch, but when I look at php.net for the syntax of the 
switch statement I see:

switch($var){
case (value):
(do something)
case (other value):
(do something else)
}

IN your example, you are using a switch syntax that is nothing like that.  I 
think that your case  statements are not actually evaluating the value of 
$count, but are themselves evaluating to a true value that has nothing to do 
with $count.


That `switch` is evaluating to true each case. It's an alternative of using
if-elseif structure.

iñ



Here's the manual reference:
http://us.php.net/manual/en/control-structures.switch.php

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


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

Re: [PHP] Embed images in emails

2008-05-30 Thread Iñigo Medina García
Hi Bastien,

thanks for the tip. I've already done it and it didn't run.
But I'll check it again.

  iñigo

 On Thu, May 29, 2008 at 6:11 AM, Iñigo Medina García 
 [EMAIL PROTECTED] wrote:
 
 Hi,

 I'm trying to send emails with embed and dynamic images: a normal tell a
 friend feature which sends the email with item's data: author, title,
 image-cover, etc.

 Ideas PEAR and mime classes apart?

 thanks

   iñigo

 --
 
 Iñigo Medina García
 Librería Díaz de Santos
 Madrid (Spain)
 Dpt.Desarrollo

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


 You'll need to create a HTML email, and then embed the image with the img
 tag, using the entire path to the image as the source attribute
 
 img src='http://www.mysite.com/images/thisimage.jpg'
 
 You may want to look at some email that you get that have images in them and
 just view the source.
 


-- 

Iñigo Medina García 
Librería Díaz de Santos 
Madrid (Spain)
Dpt.Desarrollo

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



Re: [PHP] Embed images in emails

2008-05-30 Thread Iñigo Medina García
Hi Per,

yep, it's true, playing with mime it can be sent as attachment, but I
don't want that but embed.

   iñigo

 Bastien Koert wrote:
 
 You'll need to create a HTML email, and then embed the image with the
 img tag, using the entire path to the image as the source attribute
 
 Not necessarily, images may simply be sent as an attachment with
 type image/jpeg etc. 
 
 
 /Per Jessen, Zürich
 
 


-- 

Iñigo Medina García 
Librería Díaz de Santos 
Madrid (Spain)
Dpt.Desarrollo

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



Re: [PHP] Embed images in emails

2008-05-30 Thread Iñigo Medina García
Hi Shawn,

ey, that content-disposition: inline is new for me. Maybe it's a
solution. I'll check it and tell us.

thanks

   iñigo

 Per Jessen wrote:
 Bastien Koert wrote:

 You'll need to create a HTML email, and then embed the image with the
 img tag, using the entire path to the image as the source attribute

 Not necessarily, images may simply be sent as an attachment with
 type image/jpeg etc.

 /Per Jessen, Zürich

 
 I haven't done it in a while but I believe you need a multipart mime
 email with:
 
 Content-Type: image/jpeg
 Content-Disposition: inline
 
 unless you want it to be a separate attachment.
 
 -Shawn
 


-- 

Iñigo Medina García 
Librería Díaz de Santos 
Madrid (Spain)
Dpt.Desarrollo

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



Re: [PHP] Embed images in emails

2008-05-30 Thread Iñigo Medina García
Hi Richard,

yep, i know your htmlMimeMail5. Ey, it's a good work! :-)

But in this case it would be easier for my work-team not to deal with
objects-jargon.

thanks anyway

  iñigo

 You'll need to create a HTML email, and then embed the image with the
 img tag, using the entire path to the image as the source attribute

 Not necessarily, images may simply be sent as an attachment with
 type image/jpeg etc.

 /Per Jessen, Zürich


 I haven't done it in a while but I believe you need a multipart mime
 email with:

 Content-Type: image/jpeg
 Content-Disposition: inline

 unless you want it to be a separate attachment.
 
 This may help:
 
 http://www.phpguru.org/static/htmlMimeMail5.html
 


-- 

Iñigo Medina García 
Librería Díaz de Santos 
Madrid (Spain)
Dpt.Desarrollo

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



Re: [PHP] Embed images in emails

2008-05-30 Thread Iñigo Medina García
Hi Chris,

yep, phpmailer is a good work too. But it works the same i said about
htmlMimeMail5.

  iñigo

 Iñigo Medina García wrote:
 Hi Bastien,

 thanks for the tip. I've already done it and it didn't run.
 But I'll check it again.

   iñigo

 On Thu, May 29, 2008 at 6:11 AM, Iñigo Medina García 
 [EMAIL PROTECTED] wrote:

 Hi,

 I'm trying to send emails with embed and dynamic images: a normal tell a
 friend feature which sends the email with item's data: author, title,
 image-cover, etc.

 Ideas PEAR and mime classes apart?

 thanks

   iñigo

 --
 
 Iñigo Medina García
 Librería Díaz de Santos
 Madrid (Spain)
 Dpt.Desarrollo

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


 You'll need to create a HTML email, and then embed the image with the img
 tag, using the entire path to the image as the source attribute

 img src='http://www.mysite.com/images/thisimage.jpg'

 You may want to look at some email that you get that have images in them and
 just view the source.
 
 Using an img src doesn't embed the image, it's fetched on the fly from
 the url (if you allow remote images to be displayed).
 
 Use something like phpmailer which can embed the images in the content
 for you (saves the headaches of working it all out yourself).
 
 http://phpmailer.codeworxtech.com/tutorial.html#4
 


-- 

Iñigo Medina García 
Librería Díaz de Santos 
Madrid (Spain)
Dpt.Desarrollo

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



Re: [PHP] Embed images in emails

2008-05-30 Thread Iñigo Medina García
Aha, I see.
Perfect, Per. I'll look at this RFC.

  iñigo

 Iñigo Medina García wrote:
 
 Hi Per,

 yep, it's true, playing with mime it can be sent as attachment, but I
 don't want that but embed.

iñigo
 
 OK, then you need to revisit what Bastien said.  However, instead of
 img referring to an external image, you need to use
 src=cid: where 'nnn' will refer to an attached image file
 with a Content-ID header.  It may sound a little complicated, but it's
 not really difficult - if you want to know more, see RFC2111.
 
 
 /Per Jessen, Zürich
 
 


-- 

Iñigo Medina García 
Librería Díaz de Santos 
Madrid (Spain)
Dpt.Desarrollo

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



Re: [PHP] Embed images in emails

2008-05-30 Thread Iñigo Medina García


 Iñigo Medina García wrote:
 Hi Chris,

 yep, phpmailer is a good work too. But it works the same i said about
 htmlMimeMail5.
 
 So use either package to figure out what it does and how it does it -
 you can learn a lot from other peoples code.

Thanks for the advice. :-)

  iñigo

-- 

Iñigo Medina García 
Librería Díaz de Santos 
Madrid (Spain)
Dpt.Desarrollo

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



[PHP] Embed images in emails

2008-05-29 Thread Iñigo Medina García
Hi,

I'm trying to send emails with embed and dynamic images: a normal tell a
friend feature which sends the email with item's data: author, title,
image-cover, etc.

Ideas PEAR and mime classes apart?

thanks

   iñigo

-- 

Iñigo Medina García 
Librería Díaz de Santos 
Madrid (Spain)
Dpt.Desarrollo

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



Re: RES: [PHP] Big companies that use PHP?

2008-04-25 Thread Iñigo Medina García

 Actually I was at FISL (Free Software International Forum) last week and
 Rasmus was there.
 
 He was talking about Large Scale PHP (fair enough, huh?) and he said he
 still works for Yahoo, it's been 6 years now.
 
 There's a link for his talk: http://talks.php.net/show/fisl08
 
 
 That just rang a bell: Rasmus+Yahoo+M$ != PHP?
 
 
 I did not know Google used it, does anyone have any proof of that? I know
 they make extense use of python, but not sure about PHP.

Nop, Thiago. My mistake: We spoke about Rasmus but my memory was with
Guido (python). :-(

Sorry and thanks for the link.

  Iñigo

 -Mensagem original-
 De: Iñigo Medina García [mailto:[EMAIL PROTECTED] 
 Enviada em: quinta-feira, 24 de abril de 2008 04:37
 Cc: php-general@lists.php.net
 Assunto: Re: [PHP] Big companies that use PHP?
 
 Warren Vail wrote:
 How about Yahoo and Google, extensively, in fact, I believe Rasmus Lerdorf
 is still on staff at Yahoo, unless it's Micro Hoo by now ;-).
 
 :-) I think he is in fact at Google.
 
   Iñigo
 
 
 Warren

 -Original Message-
 From: Nathan Nobbe [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, April 23, 2008 1:50 PM
 To: Thiago Pojda
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] Big companies that use PHP?

 On Wed, Apr 23, 2008 at 2:26 PM, Thiago Pojda  
 [EMAIL PROTECTED] wrote:

 Thanks everyone for replying, I think those names can 
 change someone's 
 mind
 ;)
 i know where youre coming from; i recall a certain manager 
 once saying to me 'php doesnt scale when it goes OO'.  i 
 wanted to take his head off, but instead i mentioned wikipedia.

 -nathan


 
 


-- 

Iñigo Medina García 
Librería Díaz de Santos Madrid (Spain)
[EMAIL PROTECTED]   [EMAIL PROTECTED]

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



Re: [PHP] Big companies that use PHP?

2008-04-24 Thread Iñigo Medina García
Warren Vail wrote:
 How about Yahoo and Google, extensively, in fact, I believe Rasmus Lerdorf
 is still on staff at Yahoo, unless it's Micro Hoo by now ;-).

:-) I think he is in fact at Google.

  Iñigo


 Warren
 
 -Original Message-
 From: Nathan Nobbe [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, April 23, 2008 1:50 PM
 To: Thiago Pojda
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] Big companies that use PHP?

 On Wed, Apr 23, 2008 at 2:26 PM, Thiago Pojda  
 [EMAIL PROTECTED] wrote:

 Thanks everyone for replying, I think those names can 
 change someone's 
 mind
 ;)

 i know where youre coming from; i recall a certain manager 
 once saying to me 'php doesnt scale when it goes OO'.  i 
 wanted to take his head off, but instead i mentioned wikipedia.

 -nathan

 
 


-- 

Iñigo Medina García 
Librería Díaz de Santos Madrid (Spain)
[EMAIL PROTECTED]   [EMAIL PROTECTED]

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



Re: [PHP] What is the practical use of abstract and interface?

2008-04-15 Thread Iñigo Medina García
Daevid Vincent wrote:
 I've had at least three job interviews in the past two weeks, and each one 
 has asked me this rather text book academic question regarding the 
 difference between abstract vs. interface. I've been coding for nearly 20 
 years, and at least 10 of those have been in PHP and another 3 in J++. I have 
 NEVER used either of these concepts/keywords? Am I missing some exciting 
 tool/feature? 
 
 All the reading I've done tonight just reinforces my thoughts that these are, 
 for the most part useless. Unless you're building some HUGE project that has 
 an API and there are teams of people that are going to extend your framework, 
 then what good are they? 
 
 This DB wrapper is the closest to an answer I've come across. 
 
 http://www.developer.com/lang/php/article.php/3604111
 
 But that still doesn't explain the difference between abstract and interface, 
 it only illustrates the possible need for a 'template' so others know which 
 methods they must implement. In my mind, it just seems like overhead, as if 
 you were going to write another DB wrapper using this one, then wouldn't you 
 just look at their code (example) and implement those same methods anyways? I 
 mean, you'd have to look at the abstract/interface to find out the required 
 methods, so why not skip that and just look at the actual class instead?
 
 Here are two more pages that still don't seem to answer why there are both 
 and when you'd use one over the other?
 
 http://www.hiteshagrawal.com/php/oops-in-php5/oops-in-php5-tutorial-abstract-class
 http://www.hiteshagrawal.com/php/oops-in-php5/oops-in-php5-using-interface
 
 And then this completely absurd over the top use of them for a HelloWorld 
 example, which seems to use them just for the sake of using them...
 
 http://marc.info/?l=php-generalm=115950654928311w=2
 
 Lastly was this page:
 
 http://www.phpro.org/tutorials/Object-Oriented-Programming-with-PHP.html
 
 Which seems to only really provide a hack (printerFax) to circumvent the 
 lack of multiple inheritance.
 
 
 Can someone clear this up for me?

Look at this url:
http://www.codeproject.com/KB/cs/abstractsvsinterfaces.aspx

Iñigo

 Daevid.
 http://daevid.com
 
 


-- 

Iñigo Medina García 
Librería Díaz de Santos Madrid (Spain)
[EMAIL PROTECTED]   [EMAIL PROTECTED]

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



Re: [PHP] Setting php server

2008-04-09 Thread Iñigo Medina García
hce wrote:
 Hi,
 
 I am setting a lighty and php server in my local machine FC 6 for
 testing my php source code. Both index.html and index.php have been
 set in lighty. If I have an index.html on the server, the http
 response was fine. But, if I set an index.php on the server, the
 browser got a blank page, there were no errors on browser or lighty
 access.log. What I could be missing?

Did you check lighty error.log?
Did you try with a simple ?php phpinfo(); ? to check php configuration?

   Iñigo

 $ php --version
 PHP 5.1.6 (cli) (built: Sep 18 2007 09:07:04)
 Copyright (c) 1997-2006 The PHP Group
 Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
 
 Thank you.
 


-- 

Iñigo Medina García 
Librería Díaz de Santos Madrid (Spain)
[EMAIL PROTECTED]   [EMAIL PROTECTED]

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