php-general Digest 30 Dec 2008 15:44:50 -0000 Issue 5873

Topics (messages 285221 through 285232):

Re: Architecture patterns in PHP
        285221 by: Sancar Saran
        285222 by: Manuel Lemos
        285224 by: Daniel Kolbo
        285225 by: Nathan Nobbe
        285226 by: Manuel Lemos
        285227 by: Nathan Nobbe
        285229 by: Nathan Nobbe

Re: turn shared hosting server to external image storage hosting
        285223 by: paragasu

Re: Webhotel structure
        285228 by: Dotan Cohen
        285230 by: Peter Sorensen
        285231 by: Carlos Medina
        285232 by: Dotan Cohen

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On Sunday 28 December 2008 01:40:01 Michael C. Yates wrote:
> Hey,
>
> How do you structure your web applications? I am thinking in terms of
> separating presentation  and logic. How is that done in PHP? And how
> many architecture patterns are there?
>
>
> Thanks
>
>
> Micheal C. Yates


Well,

I use, way of Rasmus (I give that name)

and please read this why

http://talks.php.net/show/drupal08/0

regards

Sancar

--- End Message ---
--- Begin Message ---
Hello,

on 12/30/2008 01:13 AM Sancar Saran said the following:
>> How do you structure your web applications? I am thinking in terms of
>> separating presentation  and logic. How is that done in PHP? And how
>> many architecture patterns are there?
> 
> 
> Well,
> 
> I use, way of Rasmus (I give that name)
> 
> and please read this why
> 
> http://talks.php.net/show/drupal08/0

After you watch that presentation, the conclusion that you reach is if
you want to develop a site that only shows a page saying "Hello world!"
you should not use an MVC framework because it adds to much performance
overhead! ;-)

Seriously, real world projects are way much more complex than simple
"Hello world!" pages.

Personally I do no use MVC frameworks (nor I have developed one) because
they just add unnecessary complexity.

However, separating concerns (processing, presentation, model data
storage, distributed services, etc...) is a good thing to help keeping
the project organization (and your mental sanity) as you project grows.

You can separate concerns without using MVC, especial front controllers
that go through many hops to sort which code to execute.

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--- End Message ---
--- Begin Message ---
Michael C. Yates wrote:
Hey,

How do you structure your web applications? I am thinking in terms of separating presentation and logic. How is that done in PHP? And how many architecture patterns are there?


Thanks


Micheal C. Yates


I am an amateur programmer, so take my comments with a grain of salt (i haven't done heavy traffic long term projects). Having read through this thread no one has of yet mentioned Smarty.net http://smarty.net/ . Smarty is a template engine. It allows presentation to be separated with logic. I like it cuz my site designes usually end up looking like a 3rd grader designed it and you need some sorta special glasses to protect your eyes. However, i can do some solid logic coding (query DBs and whatnot). So smarty has been highly prized by me in my projects. But that is all i am doing is 'projects', those that usually lost money. But this is not because of smarty. Without smarty i wouldn't have even been able to get going. Also, it cleans up the code if you stick to the division principles.
my USD 0.02$ which is a lot less now than it used to be... :(
dK

--- End Message ---
--- Begin Message ---
On Mon, Dec 29, 2008 at 9:05 PM, Manuel Lemos <mle...@acm.org> wrote:

> Hello,
>
> on 12/30/2008 01:13 AM Sancar Saran said the following:
> >> How do you structure your web applications? I am thinking in terms of
> >> separating presentation  and logic. How is that done in PHP? And how
> >> many architecture patterns are there?
> >
> >
> > Well,
> >
> > I use, way of Rasmus (I give that name)
> >
> > and please read this why
> >
> > http://talks.php.net/show/drupal08/0
>
> After you watch that presentation, the conclusion that you reach is if
> you want to develop a site that only shows a page saying "Hello world!"
> you should not use an MVC framework because it adds to much performance
> overhead! ;-)
>

it also acts as a nice control mechanism to compare so many frameworks,
trivial php, and html.  really nice to see the numbers like that; so cake is
horrifically slow, solar & zend are pretty fast and code igniter is like
twice as fast as those.

i also like how rasmus shows several advanced optimization techniques, via
strace and gdb.  ive not used the 'included' extension, ill probly check it
out.  you know some of us yougin's never really got too much pratical
exposure to tools like that =/  im still ramping up on these low level
utilities myself.

-nathan

--- End Message ---
--- Begin Message ---
Hello,

on 12/30/2008 05:07 AM Nathan Nobbe said the following:
>>>> How do you structure your web applications? I am thinking in terms of
>>>> separating presentation  and logic. How is that done in PHP? And how
>>>> many architecture patterns are there?
>>>
>>> Well,
>>>
>>> I use, way of Rasmus (I give that name)
>>>
>>> and please read this why
>>>
>>> http://talks.php.net/show/drupal08/0
>> After you watch that presentation, the conclusion that you reach is if
>> you want to develop a site that only shows a page saying "Hello world!"
>> you should not use an MVC framework because it adds to much performance
>> overhead! ;-)
>>
> 
> it also acts as a nice control mechanism to compare so many frameworks,
> trivial php, and html.  really nice to see the numbers like that; so cake is
> horrifically slow, solar & zend are pretty fast and code igniter is like
> twice as fast as those.

I am not sure if that conclusion is correct. Were the benchmarks done
using a PHP cache extension? If not, the results may just show that Cake
 includes more code probably because it is more mature than others that
are younger.

What happens is that PHP code is compiled in zend opcode before
executing. The more code split in include files you load, more time it
spends loading the code before executing. When you use a PHP cache
extension, the compile phase is skipped and replaced by loading compiled
PHP code from cache. So most of the time is taken actually by executing
the code.

Therefore using the PHP cache extension may give more useful results to
compare framework execution overhead.


> i also like how rasmus shows several advanced optimization techniques, via
> strace and gdb.  ive not used the 'included' extension, ill probly check it
> out.  you know some of us yougin's never really got too much pratical
> exposure to tools like that =/  im still ramping up on these low level
> utilities myself.

Those may not be the best tools to tell you what PHP code is taking more
time to execute, as they only show system calls. There are PHP profiler
extension that give you a better vision of the actual PHP code that may
be slowing down things.

strace is more useful for PHP core developers as it tells which system
calls are more expensive and could be worth some optimization.

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--- End Message ---
--- Begin Message ---
On Tue, Dec 30, 2008 at 12:26 AM, Manuel Lemos <mle...@acm.org> wrote:

> Hello,
>
> on 12/30/2008 05:07 AM Nathan Nobbe said the following:
> >>>> How do you structure your web applications? I am thinking in terms of
> >>>> separating presentation  and logic. How is that done in PHP? And how
> >>>> many architecture patterns are there?
> >>>
> >>> Well,
> >>>
> >>> I use, way of Rasmus (I give that name)
> >>>
> >>> and please read this why
> >>>
> >>> http://talks.php.net/show/drupal08/0
> >> After you watch that presentation, the conclusion that you reach is if
> >> you want to develop a site that only shows a page saying "Hello world!"
> >> you should not use an MVC framework because it adds to much performance
> >> overhead! ;-)
> >>
> >
> > it also acts as a nice control mechanism to compare so many frameworks,
> > trivial php, and html.  really nice to see the numbers like that; so cake
> is
> > horrifically slow, solar & zend are pretty fast and code igniter is like
> > twice as fast as those.
>
> I am not sure if that conclusion is correct. Were the benchmarks done
> using a PHP cache extension?


im not sure, maybe ill ask him though.


> If not, the results may just show that Cake
>  includes more code probably because it is more mature than others that
> are younger.


hmm, im not so sure about that.  code igniter is specifically designed to be
fast, and it clearly is.  it would be interesting to see feature comparison
charts but im sure both zend and ci stack up against cake in that regard.

What happens is that PHP code is compiled in zend opcode before
> executing. The more code split in include files you load, more time it
> spends loading the code before executing. When you use a PHP cache
> extension, the compile phase is skipped and replaced by loading compiled
> PHP code from cache. So most of the time is taken actually by executing
> the code.
>

> Therefore using the PHP cache extension may give more useful results to
> compare framework execution overhead.
>

well, heres a series of tests that compare the aforementioned frameworks in
much the same manner, using different caching solutions, and you can see the
differences are grossly exagerated when the opcode cache is running.  cake
w/ the opcode cache is appauling compared to ci, and zend is substantially
faster both with and without the cache as well.

http://www.avnetlabs.com/php/php-framework-comparison-benchmarks

> i also like how rasmus shows several advanced optimization techniques, via
> > strace and gdb.  ive not used the 'included' extension, ill probly check
> it
> > out.  you know some of us yougin's never really got too much pratical
> > exposure to tools like that =/  im still ramping up on these low level
> > utilities myself.
>
> Those may not be the best tools to tell you what PHP code is taking more
> time to execute, as they only show system calls.


i dont recall calling them 'the best tools'.  i said 'advanced optimization
techniques', which they can clearly can be.


> There are PHP profiler
> extension that give you a better vision of the actual PHP code that may
> be slowing down things.


i dont think ive ever seen a warning about the system timezone misusage on a
kcachegrind graph :p


> strace is more useful for PHP core developers as it tells which system
> calls are more expensive and could be worth some optimization.


in general sure;  but i would also say theyre fair game for the advanced
optimizer as well.

plus did you see the part about 'cleaning up the include path'.  moving to
require at the outer layer and as far in as possible, basically.  thats a
really good idea, and it looks like this 'includes' extension is well suited
for tweaking in that manner.  i may end up adding it in the arsenal
alongside xdebug+valgrind.

-nathan

--- End Message ---
--- Begin Message ---
On Tue, Dec 30, 2008 at 1:05 AM, Nathan Nobbe <quickshif...@gmail.com>wrote:

>
> plus did you see the part about 'cleaning up the include path'.  moving to
> require at the outer layer and as far in as possible, basically.  thats a
> really good idea, and it looks like this 'includes' extension
>

lol, its 'inclued' dummy :P

-other dude

--- End Message ---
--- Begin Message ---
i tried to ping photobucket. it takes 400ms for here. i only want to
create a small gallery locally. our ISP have a very slow connection
outside our country. so i want to take advantage of any available
server here.

cloudfront nearest server in asia is in hongkong. i try to look in to it.

On 12/28/08, Nathan Nobbe <quickshif...@gmail.com> wrote:
> On Sun, Dec 28, 2008 at 6:37 AM, paragasu <parag...@gmail.com> wrote:
>
>> do you have any idea how to do this. i have a small vps about 10GB
>> space. i live somewhere is south east asia where solutions like Amazon
>> S3 is incredibly slow. (500ms ping time).
>>
>> i have a simple php gallery. But dedicated server is quite expensive
>> ($100/month). searching around, i found several local hosting
>> companies provide a very cheap shared hosting. ($100 / year, 300GB).
>> local server with 40ms ping time.
>>
>> i am interested to use that shared hosting just as storage for images
>> of my gallery and a cheap vps to store the database.
>>
>> What is the best way for me to accomplish this? Amazon S3 using REST
>> etc. Is it possible to write a simple storage (REST system) like
>> amazon s3 in PHP? is there anyone wrote this before. I am interested
>> in your solutions..
>
>
> have you tried photobucket ?  we have an api in php which is freely
> available and we use a CDN for caching all around the globe.  in fact, id be
> interested to find out how it stacks up over there, in your neck of the
> woods.
>
> -nathan
>

--- End Message ---
--- Begin Message ---
2008/12/28 tedd <tedd.sperl...@gmail.com>:
>>>  So I would prefer to remove everythink and start all over .
>
> He's talking about everythink. Whenever I do that, I have problems too.
>

Interestingly enough, today I opened Dan Kegel's (of Wine fame)
website and was greeted with this:
"Dan Kegel's Web Hostel"

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת
ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه‍-و-ي
А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я
а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я
ä-ö-ü-ß-Ä-Ö-Ü

--- End Message ---
--- Begin Message ---
Hi Carlos Thanks for trying to help.

As a newbie on web design I was looking for help on about everythink, as a newbie you don't know which questions to ask.

With help from other sources I found out how to wipe my webhotel and start over.
After a fresh install of coppermin I still had problems adding pictures.

I finally solved that problem which turned out to be an error in Surftowns build in filemanager chmod command. In recursive mode it only changed permissions on files not on folders. So the coppermine users did not have the needed file permissions.
I used FileZilla to correct the permissions.

I anyone want to know more abot this see coppermine forum search for batch-add

best regards

Peter Sørensen


"Carlos Medina" <i...@simply-networks.de> wrote in message news:c5.73.47432.da8b6...@pb1.pair.com...
Nordstjernealle 10 schrieb:
Hi PHP experts

What is the overall structure on webhotels, how do I remove/clean everythink including everythinnk liek databases etc?

Sorry if this is not the proper news group for this question, please redirect me.
I am a newbie trying to make my osn webside with a minimum effort.

First I had a student to make some think for me, but he never finished it, so the useless remains are on my web.

My first plan was to use php gallery, but my web host surftown do not support safemode off.
So I found coppermine, surftown even support the install as one click.
First trial looked good, but then I ran into trouble, I get different error messages.

So I would prefer to remove everythink and start all over .



best regards

Peter Sørensen



Hallo Peter,
i think i understand what you mean (again: i think) but i am not really sure to understand what you need.
You need some Support on PHP? and when yes, by what?
When you dont need support for PHP please tell us, what you are looking for? Do you need Suport for coppermine? then look here http://documentation.coppermine-gallery.net/en/languages.htm You want remove all the Application on your server and you dont know how? What is your System, where ist Your Server System? Do you need some Support from PHP programmer? Please contact me then :-) (reply only to me then)


Regards

Carlos Medina




--- End Message ---
--- Begin Message ---
Peter Sorensen schrieb:
Hi Carlos Thanks for trying to help.

As a newbie on web design I was looking for help on about everythink, as a newbie you don't know which questions to ask.

With help from other sources I found out how to wipe my webhotel and start over.
After a fresh install of coppermin I still had problems adding pictures.

I finally solved that problem which turned out to be an error in Surftowns build in filemanager chmod command. In recursive mode it only changed permissions on files not on folders. So the coppermine users did not have the needed file permissions.
I used FileZilla to correct the permissions.

I anyone want to know more abot this see coppermine forum search for batch-add

best regards

Peter Sørensen


"Carlos Medina" <i...@simply-networks.de> wrote in message news:c5.73.47432.da8b6...@pb1.pair.com...
Nordstjernealle 10 schrieb:
Hi PHP experts

What is the overall structure on webhotels, how do I remove/clean everythink including everythinnk liek databases etc?

Sorry if this is not the proper news group for this question, please redirect me.
I am a newbie trying to make my osn webside with a minimum effort.

First I had a student to make some think for me, but he never finished it, so the useless remains are on my web.

My first plan was to use php gallery, but my web host surftown do not support safemode off.
So I found coppermine, surftown even support the install as one click.
First trial looked good, but then I ran into trouble, I get different error messages.

So I would prefer to remove everythink and start all over .



best regards

Peter Sørensen



Hallo Peter,
i think i understand what you mean (again: i think) but i am not really sure to understand what you need.
You need some Support on PHP? and when yes, by what?
When you dont need support for PHP please tell us, what you are looking for? Do you need Suport for coppermine? then look here http://documentation.coppermine-gallery.net/en/languages.htm You want remove all the Application on your server and you dont know how? What is your System, where ist Your Server System? Do you need some Support from PHP programmer? Please contact me then :-) (reply only to me then)


Regards

Carlos Medina



Hi Peter,
well done, as a news you are learning, that the best way to find out is to search, look at and try. I can give you only this advice: try, Search, Try again and again, and when you can not find the solution, ask more detailed.

Regards

Carlos

--- End Message ---
--- Begin Message ---
2008/12/30 Peter Sorensen <nordstjerneall...@gmail.com>:
> Hi Carlos Thanks for trying to help.
>
> As a newbie on web design I was looking for help on about everythink, as a
> newbie you don't know which questions to ask.
>
> With help from other sources I found out how to wipe my webhotel and start
> over.
> After a fresh install of coppermin I still had problems adding pictures.
>
> I finally solved that problem which turned out to be an error in Surftowns
> build in filemanager chmod command. In recursive mode it only changed
> permissions on files not on folders. So the coppermine users did not have
> the needed file permissions.
> I used FileZilla to correct the permissions.
>
> I anyone want to know more abot this see coppermine forum search for
> batch-add
>
> best regards
>


Peter, the list had a laugh at your expense, as you used some
incorrect words in what turned out to be a funny manner for those
fluent in English.

1) "Webhotel" is called "web hosting" in English.
2) "Everythink" should probably be "everything". "Everythink" sounds
like you are thying to think about the entire universe at the same
second. It also sounds like a term from the book 1984.
3) It is obvious that you are unfamiliar with some basic concepts
regarding web servers and the software that runs on them. That is
fine- everyone here was at the same stage once and this list in
particular is very friendly to newbies. But the way you worded your
sentence just turned out funny. I am certain that you would have an
even bigger laugh if I were to try asking a question in Bokmal or
Nynorsk!

You might want to look at the linux commands rm and rmdir if you have
SSH access to the server (and if it is a Linux server). Otherwise, I
recommend Konqueror (From KDE) as the best graphical tool for managing
files on a remote server.

Good luck.

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת
ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه‍-و-ي
А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я
а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я
ä-ö-ü-ß-Ä-Ö-Ü

--- End Message ---

Reply via email to