Re: [PHP] "use strict" or similar in PHP?

2009-02-26 Thread Ovidiu Rosoiu
On Thu, Feb 26, 2009 at 10:45 PM, Hans Schultz wrote:

> Hello,
> I am beginner with PHP and prior to PHP I have worked with java for some
> time
> and with perl for very short period. I can't help to notice some things
> that
> are little annoyance for me with PHP, but I am sure someone more
> experienced
> can help me :-)
> Is there in PHP something like "use strict" from perl? I find it pretty
> annoying to need to run script over and over again just to find out that I
> made typo in variable name.
> Is there some way for PHP to cache some data on the page? I like very much
> PHP's speed but it would be even better to be able to cache some frequently
> used data from database?
> Also regarding databases, I liked a lot java's way of sending data to
> database
> using parameters ("select * from user where username = ?" and then passing
> parameter separately with database doing necessary escaping and
> everything).
> Is there something like PHPDBC similar to JDBC?
>
> TIA,
> Hans
>
>
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
I have no ideea why my response from half an hour ago was not sent, but here
it is again:

1. Error reporting set to show notices, warnings and errors. See
http://www.php.net/manual/en/function.error-reporting.php

2. For caching you can use memcache. See http://www.php.net/memcache

3. These are called prepared statements. See
http://www.google.ro/search?q=prepared+statements+php


Regards,
Ovidiu


Re: [PHP] "use strict" or similar in PHP?

2009-02-26 Thread Ovidiu Rosoiu

Hans Schultz wrote:

Hello,
I am beginner with PHP and prior to PHP I have worked with java for 
some time
and with perl for very short period. I can't help to notice some 
things that
are little annoyance for me with PHP, but I am sure someone more 
experienced

can help me :-)
Is there in PHP something like "use strict" from perl? I find it pretty
annoying to need to run script over and over again just to find out 
that I

made typo in variable name.
Is there some way for PHP to cache some data on the page? I like very 
much
PHP's speed but it would be even better to be able to cache some 
frequently

used data from database?
Also regarding databases, I liked a lot java's way of sending data to 
database
using parameters ("select * from user where username = ?" and then 
passing
parameter separately with database doing necessary escaping and 
everything).

Is there something like PHPDBC similar to JDBC?

TIA,
Hans


1. Error reporting set to show notices, warnings and errors. See 
http://www.php.net/manual/en/function.error-reporting.php


2. For caching you can use memcache. See http://www.php.net/memcache

3. These are called prepared statements. See 
http://www.google.ro/search?q=prepared+statements+php



Regards,
Ovdiiu

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



Re: [PHP] Google Chrome

2008-09-04 Thread Ovidiu Rosoiu

Richard Heyes wrote:

Hi,

Is it just me, or is everyones disk thrshing more since installing (if
you have) Chrome? Oh, and to keep it in-line with list, isn't PHP
great? :-)

  
I uninstalled it precisely beacause of this behaviour. The disk was 
running crazy every time chrome was started.
And I don't know how to do "lsof | grep chrome" on Windows to see what's 
going on.


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



Re: [PHP] Download speed limit

2007-05-17 Thread Ovidiu Rosoiu
limiting speed by using sleep in your script is a very bad idea. for a 
350 MB file, with a 20 KB/s limit the script would take aprox. 5 hours. 
you can see how this is totally wrong. even skyrocketing the timeout, 
it's not a good solution.
Use a web server mod for dynamic bandwidth limiting. See 
http://www.topology.org/src/bwshare/README.html, maybe it will help you.


Rangel Reale wrote:

Between 90 and 350 MB.

- Original Message - From: "Jim Lucas" <[EMAIL PROTECTED]>
To: "Rangel Reale" <[EMAIL PROTECTED]>
Cc: 
Sent: Wednesday, May 16, 2007 6:41 PM
Subject: Re: [PHP] Download speed limit



Rangel Reale wrote:

Hello!

For my application I need to limit the speed that my application 
sends data, in my case a binary file.


I need to send the speed as a parameter, like:

sendfile.php?speed=2

Would send the file at 20kb/s (forgetting about real byte counts for 
this example).


To send the file, I am doing:

$fp=fopen($this->contentfile,"rb");
while(!feof($fp)){
print(fread($fp,1024*8));
flush();
ob_flush();
}
fclose($fp);

If after ob_flush I do a sleep(), I can limit the speed, but I would 
like to limit at the speed of the parameter.


Is there a way to do this?

Thanks,
Rangel


on average, how big are the files that you will be sending?

--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Unknown

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




--
No virus found in this incoming message.
Checked by AVG Free Edition. Version: 7.5.467 / Virus Database: 
269.7.0/803 - Release Date: 13/5/2007 12:17







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