You are here: Re: Zip some folders and send by email « PHP Programming Language « IT news, forums, messages
Re: Zip some folders and send by email

Posted by Tim Roberts on 12/17/98 11:52

nark <nark.l@home.home.com> wrote:
>
>chernyshevsky@hotmail.com says...
>>
>> Krustov wrote:
>> > Using the standard php functions found on most web servers - how do i
>> > zip selected folders and have the zip file emailed to myself .
>> >
>> > Not as a cron job or anything automated - it will be a option i will add
>> > in the control panel .
>>
>> Try this class I wrote some time ago:
>>
>> http://www.conradish.net/bobo/show_source.php?filename=flyzip.php
>>
>> It uses the zlib functions to compress the data. If the function aren't
>> there, then it just package the files.
>
>Please forgive a silly question but can you tell me why you made it a
>"class" rather than a simple set of functions?

It's fascinating that you would ask this question, and I suspect a PHP
newsgroup is the only one in which the value of encapsulation would be
questioned.

By defining a class, he is adding only one new name to the namespace,
instead of a whole set of names that might conflict with functions I
already have. In addition, it allows him to hide whatever state he might
need in the class object, instead of again polluting the namespace with
globals.

I know the PHP philosophy is to plop 100 functions into the global
namespace where one class name would do, but I suspect PHP programs would
be easier to read and maintain if the library were reorganized as classes
instead.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация