Chris | 1 Aug 2008 04:06
Picon

Re: limiting the amount of emails sent at a time in a batch send

brian wrote:
> Richard Kurth wrote:
>> I want to limit these script two send 100 email and then pause for a
>> few seconds and then send another 100 emails and repeat this tell it
>> has sent all the emails that are dated for today. This script is runs
>> by cron so it is running in the background.
>>
>> How would I do this and is it the best way to do it. I am using swift
>> mailer to send the mail.
>>
>> I think I would use limit 100 in the query but how would I tell it to
>> get the next 100.
> 
> There's no need to limit the DB query, nor to track what's been sent by
> updating the DB. Grab all of the addresses at once and let SwiftMailer
> deal with the throttling:

Of course there is.

1) What if the server gets rebooted in the middle of the send or the
database goes down in the middle? You send to everyone again.

2) What if the host has a limit on how long a script can run for? You
send to everyone again and again and again each time the script tries to
start.

3) What if safe-mode is enabled on the server? You have a limited send
time and possibly end up with the same outcome as #2.

4) What if you are sending to 100,000 email addresses? You run out of
(Continue reading)

Jignesh Thummar | 1 Aug 2008 07:36
Picon

Re: upload file problem

Thanks.. It's fixed...

- Jignesh

On Thu, Jul 31, 2008 at 6:05 PM, brian <php <at> logi.ca> wrote:
> Jignesh Thummar wrote:
>>
>> I'm trying to upload the file. It's showing me successfully uploaded.
>> But it's not able to move from temp directory to my defined directory
>>
>> my code:
>>
>> if (is_uploaded_file($_FILES['myfile']['tmp_name'])) {
>>   move_uploaded_file($_FILES['myfile']['tmp_name'], $myfilename);
>>   echo "File ". $_FILES['myfile']['name'] ." uploaded successfully.\n";
>> } else {
>>  echo "File uploading error";
>> }
>>
>
> What does $myfilename resolve to? It should include the complete path from
> server root (not DOCUMENT_ROOT).
>
> Try:
>
> echo "File uploading error: ${myfilename}";
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
(Continue reading)

mike | 1 Aug 2008 09:27
Picon

HTTP PUT for file uploads

It appears that PHP can support the PUT method using php://stdin and
appropriately configuring the webserver to accept it.

My company needs a file upload solution that will support large file
uploads (2GB limit is optional - if we have to tell them less than 2GB
that's fine) that will keep re-trying the upload until it is done. We
have slow geo users and then just flat out large files to deal with
even from fast connections.

There's a variety of Java-based PUT uploaders.

So far, we haven't found any Flash ones (we'd love to NOT use Java) -
but there is a way to do it apparently, we just can't find anyone
who's done it yet.

I'm assuming that we should keep the connection open as long as there
is some activity and maybe timeout after a minute or two... the
client-side applet should have the logic to continue retrying and
since it is PUT, the PHP script will accept the data and use fseek()
on the file to resume at the offset supplied (the client will have to
give us that info)

See the examples here:
http://www.radinks.com/upload/examples/ - look at the "Handlers that
support resume" section.

Anyone have any thoughts? I think I need to tweak PHP settings
too possibly as well, for max execution time and such. But also any
uploader ideas would be great.

(Continue reading)

Lukas Kahwe Smith | 1 Aug 2008 09:31
Picon

PHP 5.3.0alpha1

Hello!

Johannes has packed PHP 5.3.0alpha1 yesterday evening, which you can  
find here:
http://downloads.php.net/johannes/

Please test it carefully, and report any bugs in the bug system, but  
only if you have a short reproducable test case. The final release is  
expected sometime between mid September and mid October. You can read  
more information about this release here:
http://www.php.net/archive/2008.php#id2008-08-01-1

regards,
Johannes and Lukas

--

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

Micah Gersten | 1 Aug 2008 09:34
Favicon

Re: HTTP PUT for file uploads

Is this a repetitive thing your clients will do many times?  I recently
created a backup solution using ssh keys and the pecl ssh extension to
automate backups.  Then a cronjob sorts the files on the server.  It's a
lot more secure than allowing PUTs.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com

mike wrote:
> It appears that PHP can support the PUT method using php://stdin and
> appropriately configuring the webserver to accept it.
>
> My company needs a file upload solution that will support large file
> uploads (2GB limit is optional - if we have to tell them less than 2GB
> that's fine) that will keep re-trying the upload until it is done. We
> have slow geo users and then just flat out large files to deal with
> even from fast connections.
>
> There's a variety of Java-based PUT uploaders.
>
> So far, we haven't found any Flash ones (we'd love to NOT use Java) -
> but there is a way to do it apparently, we just can't find anyone
> who's done it yet.
>
> I'm assuming that we should keep the connection open as long as there
> is some activity and maybe timeout after a minute or two... the
> client-side applet should have the logic to continue retrying and
(Continue reading)

mike | 1 Aug 2008 09:58
Picon

Re: HTTP PUT for file uploads

On 8/1/08, Micah Gersten <micah <at> onshore.com> wrote:

> Is this a repetitive thing your clients will do many times?  I recently
> created a backup solution using ssh keys and the pecl ssh extension to
> automate backups.  Then a cronjob sorts the files on the server.  It's a
> lot more secure than allowing PUTs.

Yes, we have end users (non-employees) and other employees from all
geographies (slow connections in China, India), USA, europe, etc, etc.
uploading files of any size and any shape. Video files, audio files,
executables, PDFs, anything.

This is a general purpose file upload solution for our content
management system used worldwide. We can't really create a list of
users and such, as it's open to anyone to contribute. We still
moderate/filter/etc. as needed. We're not worried about security, each
file will have its own unique location so they wouldn't clobber each
other, and they'll be isolated and not executed on the server, so
security to me isn't a concern. The webserver is already open to the
world, SSH/SFTP and FTP are not; so that would technically open that
up to the world, and actually open up more attack vectors :)

--

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

Peter Ford | 1 Aug 2008 10:18
Favicon

Re: Back to Basics - Why Use Single Quotes?

Eric Butera wrote:
> On Wed, Jul 30, 2008 at 6:51 PM, Stephen <stephen-d <at> rogers.com> wrote:
>> I have traditionally used double quotes going back to my PASCAL days.
>>
>> I see many PHP examples using single quotes, and I began to adopt that
>> convention.
>>
>> Even updating existing code.
>>
>> And I broke some stuff that was doing variable expansion. So I am back to
>> using double quotes.
>>
>> But I wonder, is there any reason to use single quotes?
>>
>> Stephen
> 
> Because sometimes it is nice to do this:
> 
> $onclick = ' onclick="..."'
> 
> Not having to escape my single tick makes it more readable.

Now *that's* a good reason... anything that means fewer \'s or \"s.
I often go for HEREDOC syntax if the backslashes start taking over - readability 
is much more important to me than nanoseconds of performance.

There's also the case where you might want literal $s in your string:
e.g.
$foo = 'You need to pay $dollars...';

(Continue reading)

Jason Pruim | 1 Aug 2008 13:49

Writing my own web based user forum

Hi Everyone,

I am looking at writing my own web based user forum somewhat for my  
own knowledge, and because I know that I don't know enough to be able  
to tie in authentication so they only need 1 user account.

Does anyone have any examples short of downloading something like  
phpbb and tearing it apart?

It will probably be really light weight, basic forum that hopefully  
will expand into more as time goes on :)

I've tried searching the web but have not been able to turn up any  
help unless I was to write a bridge for a song...

Any knowledge you can bestow upon me is greatly appreciated!

Thanks!

--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
Holland, MI 49424
www.raoset.com
japruim <at> raoset.com

(Continue reading)

Bernhard Kohl | 1 Aug 2008 14:07
Favicon

Re: Writing my own web based user forum

<?php
#User authentication should not be a problem at all.
#If you want it simple just serialize a user class and write it to a
file or into a DB.

class user {
 var $username;
 var $pw;
 function set_user($name, $pw) {
  $this->pw = md5($pw);
  $this->username = $name;
  return true;
 }
}

$new_user = new user();
if ($new_user->set_user('Joe', 'swordfish') {
 $fp = <at>  fopen('/some_dir/users.txt', 'a');
  <at> fwrite($fp, serialize($new_user));
  <at> fclose($fp);
}

# the next time you need it simple read it in again with unserialize()

?>
On Fri, Aug 1, 2008 at 1:49 PM, Jason Pruim <japruim <at> raoset.com> wrote:
> Hi Everyone,
>
> I am looking at writing my own web based user forum somewhat for my own
> knowledge, and because I know that I don't know enough to be able to tie in
(Continue reading)

Jason Pruim | 1 Aug 2008 14:52

Re: Writing my own web based user forum

So are you suggesting, create the users in the forum, and then just  
serialize/unserialize when needed to store the info so when they go to  
the picture upload side it queries the forum database?

On Aug 1, 2008, at 8:07 AM, Bernhard Kohl wrote:

> <?php
> #User authentication should not be a problem at all.
> #If you want it simple just serialize a user class and write it to a
> file or into a DB.
>
> class user {
> var $username;
> var $pw;
> function set_user($name, $pw) {
>  $this->pw = md5($pw);
>  $this->username = $name;
>  return true;
> }
> }
>
> $new_user = new user();
> if ($new_user->set_user('Joe', 'swordfish') {
> $fp = <at>  fopen('/some_dir/users.txt', 'a');
>  <at> fwrite($fp, serialize($new_user));
>  <at> fclose($fp);
> }
>
> # the next time you need it simple read it in again with unserialize()
>
(Continue reading)


Gmane