[PHP] Re: [PHP-DEV] WEIRD, WEIRD problem with upgrade to 4.0.5

2001-05-11 Thread Vlad Krupin

As I said before, it is most likely due to the newlines that PHP can not 
recognize. You do not see the newlines, so as far as you are concerned, 
the code is totally valid. But this is not what PHP sees - PHP sees a 
long string rather than multiple lines in your code because it treats a 
single '\r' as a whitespace.. Try to replace all single '\r' in your 
code with '\n' or '\r\n'. This sould be a simple script that does not 
damage any of your scripts, can do that automatically, and should fix 
the problem..

The problem usually comes from editing your code with different editors 
- one uses '\r' as a newline, and the other - 'r\\n', for example. So 
some of your code will be broken, and some - not.. To make things more 
confusing, PHP allows you to have several statements on one line 
(sometimes), so in some places '\r' will not break it while in some 
other it will.. For example (I make newlines visible),

if(x>y){\r
  echo "hellow";\r
}\r

will be seen by php as:
if(x>y){  echo "hellow;}
Which is a valid statement. But if you do:

if(x>y){\r
  // say hellow \r
  echo "hellow";\r
}\r

which will be seen by php as:
if(x>y){   // say hellow \r  echo "hellow;}
Which is obviously broken. In fact, php should give you an error because 
among other things you just commented out the closing curly bracket.

Now, if you used UNIX-style or DOS-style ('\n' or '\r\n') newlines 
instead, everything would be fine

Bottom line: It is not a // comments problem, you do not have to switch 
to /* */ comments, just take your hex editor, look at your source file 
in hex (pay attention to newlines) and replace them with proper 
newlines. That should fix that.

Take care,

Vlad


P.S. Crossposting is a bad idea, so please select which list you really 
think his should be posted to. I think it is the right question for 
php-general, but I do not subscribe there, so I won't get anything you 
post there.

Maxim Maletsky wrote:

> well,
> 
> I don't think that was the reason... because
> 
>  echo 'hello world'; // please no...
> echo '';
> ?>
> 
> will print me:
> 
> // please no...
> echo '';
> 
> 
> any further ideas?
> Maxim Maletsky
> 
> 
>  
> 
> -Original Message-
> From: Vlad Krupin [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 11, 2001 7:12 AM
> To: Maxim Maletsky
> Cc: 'PHP General List. (E-mail)'; '[EMAIL PROTECTED]';
> '[EMAIL PROTECTED]'
> Subject: Re: [PHP-DEV] WEIRD, WEIRD problem with upgrade to 4.0.5
> 
> 
> That's most likely because you have newlines that PHP does not 
> understand (it should in 4.0.6). In particular, the newline just before 
> the // comment that got printed out where it should not is probably 
> mac-style '\r' instead of unix-style '\n' or dos-style '\r\n'. Fix those 
> newlines and everything will work like a charm, or wait tilll 4.0.6 and 
> hope it works:)
> 
> Vlad
> 
> 
> Maxim Maletsky wrote:
> 
>> Hello everyone.
>> 
>> in short: I had upgraded PHP from 4.0.1pl2 to 4.0.5.
>> and this is what happened:
>> 
>> The pages started breaking on
>>  '//'
>> (YES, ON COMMENTS!)
>> 
>> If there's no '//' then it works ok, but when it encounters any
>> backslashes-commented line like here:
>> --
>> >  $special_folder = 'inc';
>>  $DoNotQuit =True; if( !$config_inc_def )
>>  include("$DOCUMENT_ROOT/inc/config.php");
>> 
>>  session_start();
>>  session_register('array_ra');
>>  session_register('PV');
>>  session_register('w3');
>>  session_unregister('view');
>>  //unset($view);
>>  if (isset($w3))
>>  $time_spent = time()+1-$w3;
>>  $w3 = time();
>> 
>>  include ("$DOCUMENT_ROOT/inc/head.php");
>> --
>> 
>> IT CRASHES!
>> 
>> 
>> The weird thing is that there a config file included before, and it HAS a
>> WHOLE BUNCH of '//' but the page goes well until the first '//'
> 
> encountered.
> 
>> AND, THE CODE IS BEING SHOWN ON THE PAGE! 
>> 
>> to give you an idea:
>> 
>>  -- config.inc
>> 
>>  echo "What the ";
>>  // should print some
>> 
>>  ---
>> 
>>  -- test.php
>> 
>>  include('conf.inc');
>>  echo 'hell';
&g

[PHP] Re: [PHP-DEV] WEIRD, WEIRD problem with upgrade to 4.0.5

2001-05-10 Thread Vlad Krupin

That's most likely because you have newlines that PHP does not 
understand (it should in 4.0.6). In particular, the newline just before 
the // comment that got printed out where it should not is probably 
mac-style '\r' instead of unix-style '\n' or dos-style '\r\n'. Fix those 
newlines and everything will work like a charm, or wait tilll 4.0.6 and 
hope it works:)

Vlad


Maxim Maletsky wrote:

> Hello everyone.
> 
> in short: I had upgraded PHP from 4.0.1pl2 to 4.0.5.
> and this is what happened:
> 
> The pages started breaking on
>   '//'
> (YES, ON COMMENTS!)
> 
> If there's no '//' then it works ok, but when it encounters any
> backslashes-commented line like here:
> --
>$special_folder = 'inc';
>   $DoNotQuit =True; if( !$config_inc_def )
>   include("$DOCUMENT_ROOT/inc/config.php");
> 
>   session_start();
>   session_register('array_ra');
>   session_register('PV');
>   session_register('w3');
>   session_unregister('view');
>   //unset($view);
>   if (isset($w3))
>   $time_spent = time()+1-$w3;
>   $w3 = time();
> 
>   include ("$DOCUMENT_ROOT/inc/head.php");
> --
> 
> IT CRASHES!
> 
> 
> The weird thing is that there a config file included before, and it HAS a
> WHOLE BUNCH of '//' but the page goes well until the first '//' encountered.
> 
> AND, THE CODE IS BEING SHOWN ON THE PAGE! 
> 
> to give you an idea:
> 
>   -- config.inc
> 
>   echo "What the ";
>   // should print some
> 
>   ---
> 
>   -- test.php
> 
>   include('conf.inc');
>   echo 'hell';
>   ---
> 
> this works fine
> prints 'What the hell'
> 
> but if modify test.php:
> 
>   -- test.php
> 
>   include('conf.inc');
>   // should work too..
>   echo 'hell';
>   ---
> 
> it prints: 'What the // should work too..'
> 
> ISN'T THAT WEIRD?
> WHAT IS IT?
> 
> I cannot keep testing any further since we had out server down for the whole
> 20 mins and had to place back from the tapes old PHP4.0.1pl2.
> 
> CONCLUSION:
>   IT WORKS ON 4.0.1pl2 AND CRASHES ON 4.0.5
> 
> MY PRESUMPTIONS:
>   A BUG
> 
> PHP COMPILED AS:
>   --with-mysql --with-pgsql --with-apxs --enable-track-vars
> 
> WHAT WAS CHANGED:
>   php 4.0.5 is now also compiled --with-pgsql while the previous
> installation wasn't
> 
> PLATFORM:
>   LINUX Red Hat 6.1
>   Apache 1.3.9
> 
> 
> Please help us with this.
> 
> 
> Sincerely, 
>  Maxim Maletsky
>   Web Developer 
> 
>  Digital Media,
>  Japan Inc Communications 
>   www.japaninc.com 
>   [EMAIL PROTECTED] 
>   TEL: 03-3499-2175 x 1271 
>   FAX: 03-3499-3109 
> 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: [PHP-DEV] Re: IMAP/POP3 Administration API?

2001-07-23 Thread Vlad Krupin

...None of them will. This is not a part of IMAP protocol; it is part
of the mail server, and each server does that in its own way.

On a brighter note - if you use qmail, there is a very nice patch for
it that will allow to store users in a mysql database, so you can use
php to add/delete users whenever you want. We used that in
production for a couple of years now. Very convenient. Also
patches to make it work with postgres, and it won't take much
time to make it work with the DB of your choice, if you look at
the sources of those patches - they are rather simple.
Website is http://www.qmail.org/.

Now, crossposting is a *really* bad idea, and is not looked well
upon by the developers. You posted to 15(!) different groups
while only one (php-general) is somewhat proper for that question.
This significantly reduces your chances to get an answer to your
question at all.

Vlad


Christopher Cheng wrote:

>Have looked through it already. None of them allows me to add/delete users
>
>
>"Dave Mertens" <[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED]...
>
>>On Sun, Jul 22, 2001 at 07:41:01PM +0800, Christopher Cheng wrote:
>>
>>>Is there any IMAP/POP3 API/Modules of Linux email system (Sendmail)
>>>
>written
>
>>>in PHP?
>>>I am looking for API to write a signup page for users.
>>>
>>
>>Have to tried http://www.php.net/imap ?? Great source for API's ;-)
>>
>>Dave Mertens
>>
>
>
>




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/pspell pspell.c

2001-02-05 Thread Vlad Krupin

vladMon Feb  5 10:15:32 2001 EDT

  Modified files:  
/php4/ext/pspellpspell.c 
  Log:
  now when pspell/pspell.h is included, it will recognize
  that it has to work in compatibility mode. (The previous fix
  had the right idea, but was too far down in the source)
  
  
Index: php4/ext/pspell/pspell.c
diff -u php4/ext/pspell/pspell.c:1.13 php4/ext/pspell/pspell.c:1.14
--- php4/ext/pspell/pspell.c:1.13   Fri Feb  2 10:28:48 2001
+++ php4/ext/pspell/pspell.cMon Feb  5 10:15:31 2001
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: pspell.c,v 1.13 2001/02/02 18:28:48 rasmus Exp $ */
+/* $Id: pspell.c,v 1.14 2001/02/05 18:15:31 vlad Exp $ */
 
 #define IS_EXT_MODULE
 
@@ -28,6 +28,9 @@
 
 #if HAVE_PSPELL
 
+/* this will enforce compatibility in .12 version (broken after .11.2) */
+#define USE_ORIGINAL_MANAGER_FUNCS
+
 #include "php_pspell.h"
 #include 
 #include "ext/standard/info.h"
@@ -37,7 +40,6 @@
 #define PSPELL_BAD_SPELLERS 3L
 #define PSPELL_SPEED_MASK_INTERNAL 3L
 #define PSPELL_RUN_TOGETHER 8L
-#define USE_ORIGINAL_MANAGER_FUNCS 1L
 
 function_entry pspell_functions[] = {
PHP_FE(pspell_new,  NULL)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/pspell CREDITS

2001-02-05 Thread Vlad Krupin

vladMon Feb  5 11:18:04 2001 EDT

  Modified files:  
/php4/ext/pspellCREDITS 
  Log:
  Added myself to CREDITS (vlad)
  
  
Index: php4/ext/pspell/CREDITS
diff -u php4/ext/pspell/CREDITS:1.1 php4/ext/pspell/CREDITS:1.2
--- php4/ext/pspell/CREDITS:1.1 Mon Nov 20 02:31:31 2000
+++ php4/ext/pspell/CREDITS Mon Feb  5 11:18:04 2001
@@ -0,0 +1,2 @@
+Pspell
+Vlad Krupin



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]