SitePoint Sponsor

User Tag List

Page 4 of 4 FirstFirst 1234
Results 76 to 94 of 94
  1. #76
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,011
    Mentioned
    56 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by F.Danials View Post
    There must be some advantages of using a Template Engine, as everybody uses them.

    I recently looked at some jobs websites for PHP Developer roles (Just curious to see what some requirements are), and many of the positions require the knowledge of Zend and Smarty.
    I doubt it. There's no advantage in using XHTML because at least 60% of the browsers out there can't display it if it is transmitted according to standard, but that doesn't stop people from using it. Why do they..

    FAD

    Nothing more or less. Just like pet rocks - just as stupid.

  2. #77
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,011
    Mentioned
    56 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by imaginethis View Post
    I've never worked on a server that didn't support <?= or <? and if I ever come across a server that doesn't then echo and print work just fine.
    I use them because it is not possible to block .htaccess enabling of them while simultaneously allowing htaccess mod rewrites. Since my framework REQUIRES the one (mod_rewrite) I know for certain the other WILL be available at all times. The statement that it might not be is at best a phantom.

  3. #78
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,011
    Mentioned
    56 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by G.Schuster View Post
    One question to the php-purists - how do you handle pure-php templates uploaded by users?
    If they can't be trusted with PHP why trust them with ANY display logic? What you allude to is the province of bbCode which is an entirely seperate animal from PHP and templating. I suppose if you where building a myspace or wiki-like service that you wanted to give users a lot of display control I could see the bbcode becoming template like in complexity (see wikipedia's templates for example), but you still aren't allowing for mid and low-level server access.

    In any event, Wiki / MySpace is still by no means even a fraction of the total PHP useage area.

    As most template engines support only a specified subset of what PHP offers it's relatively easy to deny the use of e.g. <?php unlink(...); ?> in a template - but how would you handle this in pure-php templates?
    Pure php templates are an approach for developers and end users in an admin capacity willing to learn PHP.

    As far as I can see you'd have to parse the code, check each and every function call and again limit it to a specified subset that seems OK.

    Just to make sure no one gets me wrong - I'm using both pure-php and Smarty, each one as it fits.

    The question above should be no offence, I'm really interessted in a solution to solve the mentioned problem as I'd like to write a "pure-php template system" for one of my apps that handles cahcing etc. but lets the templates be pure-php.
    I'm working on just such a framework - one that doesn't use templates (though admittedly it is flexible and tolerant enough to let one be grafted on).

  4. #79
    <?php while(!sleep()){code();} G.Schuster's Avatar
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, there are use-cases where a bbCode-style just isn't sufficient.
    I'm working on business projects where e.g. a shop system offers a full-flegded partner-API where the layout has to be "user"-definable - all parts of it.
    As I mentioned earlier - I don't want to flame or so, I'm really interessted in solutions to solve the "accessible functions"-problem.
    I already took a look at the PHP sandbox but as the development seems to be stopped that's no way.

    Would you mind sharing some more details or even code of your framework?

  5. #80
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,011
    Mentioned
    56 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by G.Schuster View Post
    Well, there are use-cases where a bbCode-style just isn't sufficient.
    I'm working on business projects where e.g. a shop system offers a full-flegded partner-API where the layout has to be "user"-definable - all parts of it.
    As I mentioned earlier - I don't want to flame or so, I'm really interessted in solutions to solve the "accessible functions"-problem.
    I already took a look at the PHP sandbox but as the development seems to be stopped that's no way.

    Would you mind sharing some more details or even code of your framework?
    Certainly. I'm thinking about releasing some code since phase 1 is complete (basic program flow and error handling environment) The next phase is the database model system. I think I'll fork to a different thread though. When I get the thread started I'll edit this post and place a link (the thread will be elsewhere on Sitepoint though).

    Here.
    http://www.sitepoint.com/forums/show...98#post4101198
    Last edited by Michael Morris; Jan 5, 2009 at 14:21.

  6. #81
    SitePoint Addict
    Join Date
    Jun 2008
    Posts
    279
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm working on just such a framework - one that doesn't use templates (though admittedly it is flexible and tolerant enough to let one be grafted on).
    If it doesn't use templates, then what does it use?

    I fail to see the point in using template engines like smarty, i see their use as a waste of resources (overhead). I prefer to echo (view in MVC) the stuff and format it using css.
    If you can do this, then whats the point of having Smarty? Why was Smarty created in the first place?

    Does a FrameWork not slow down the system, and waste resources.

    I'm learning alot, just by what people have posted within this thread!
    Cheers guys

  7. #82
    SitePoint Evangelist simshaun's Avatar
    Join Date
    Apr 2008
    Location
    North Carolina
    Posts
    438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes frameworks use a lot of resources the second you start using them.

    These are not actual statistics (although they could be relatively close)..
    and this also depends on the system, but for example..
    PHP is capable of ~800 requests per second
    PHP with a Framework (CodeIgniter in this stat) is capable of ~150 requests per second.
    Most frameworks are even slower.. Zend being the worst.

    Here's sort of a Framework comparison:
    http://www.yiiframework.com/performance/
    And no I'm not sponsoring Yii I don't like its conventions.

  8. #83
    SitePoint Addict
    Join Date
    Jun 2008
    Posts
    279
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's what I don't understand, if people say that Template Engines are a waste of resources, and can drastically slow down the system, whats the difference between this and a FrameWork?

    Do you actually need either of them, and what would be the main benefits as they slow down your system? (Template Engine or FrameWork)

    Great information cheers

  9. #84
    SitePoint Evangelist simshaun's Avatar
    Join Date
    Apr 2008
    Location
    North Carolina
    Posts
    438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No and No, you don't need either of them.

    I use a framework because it increases my development speed by about 100x. More time on my hands = more clients = more $$$$.

    The majority of websites you build will not be getting that kind of traffic mentioned in my last post, so it's probably not a concern you should have. However, if you actually are building a high-traffic site, then sure a framework is probably not the way to go.

    So, in conclusion:
    Frameworks are good for speedy development, bad for high-traffic (>~150 requests per second) sites
    Template engines.. well, I just don't see them as good at all.

  10. #85
    SitePoint Addict
    Join Date
    Jun 2008
    Posts
    279
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Using FaceBook as an example (As I know for a fact they use PHP)...

    ...What would they use? - Would they use a FrameWork and/or Template Engine, or would they use some other method?

  11. #86
    SitePoint Evangelist simshaun's Avatar
    Join Date
    Apr 2008
    Location
    North Carolina
    Posts
    438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not a dev for FaceBook and have not researched it in any way, but I think its safe to say they do not use either.

    Like I said, if you have a high traffic website (FaceBook), frameworks and template engines just aren't fast enough.

    Frameworks exist to speed up development time, at the expense of performance.

    Take Yahoo for example. Their website is built with PHP, but because of their traffic volume, they compile their routines into C libraries and load them as php extensions.
    There is no way a "big" website can run on a framework (or templating engine).

  12. #87
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Off Topic:

    Quote Originally Posted by F.Danials View Post
    Using FaceBook as an example (As I know for a fact they use PHP)...
    I am not saying you are wrong, but just because a script ends with .php does not mean its a PHP script, its just a single change in the server setup.

    I ran a site for about 5 years which masqueraded PHP as .asp files so we didnt have do bother with internal links, or external links going wrong (good fun watching the asp script-kiddy attacks come in). My current sites are all .htm.

    I even managed to get the asp files to run through the asp processor, then the php processor for a proof of concept on some 3rd party code.

  13. #88
    SitePoint Addict
    Join Date
    Jun 2008
    Posts
    279
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I though someone would bring that up
    They could also use mod-rewrite, if they really wanted to disclose the pages as being coded using PHP.

  14. #89
    SitePoint Addict
    Join Date
    Jun 2008
    Posts
    279
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by simshaun View Post
    I'm not a dev for FaceBook and have not researched it in any way, but I think its safe to say they do not use either.

    Like I said, if you have a high traffic website (FaceBook), frameworks and template engines just aren't fast enough.

    Frameworks exist to speed up development time, at the expense of performance.

    Take Yahoo for example. Their website is built with PHP, but because of their traffic volume, they compile their routines into C libraries and load them as php extensions.
    There is no way a "big" website can run on a framework (or templating engine).
    What would PHP Forum software user? - Would they use a FrameWork and/or Template Engine, or would they use some other method?....

    ..Or even vBulletin, take SitePoint for example. They must have millions of site hit every day. As a result of this the system used needs to be upto scratch.

    Do you think FaceBook will adopt MVC?

    *Interesting stuff. I'm still trying to get my head around all this.

  15. #90
    SitePoint Guru
    Join Date
    Jan 2005
    Location
    heaven
    Posts
    953
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by simshaun View Post
    I'm not a dev for FaceBook and have not researched it in any way, but I think its safe to say they do not use either.

    Like I said, if you have a high traffic website (FaceBook), frameworks and template engines just aren't fast enough.
    That depends on whether or not you view PHP as a template engine :3

    Quote Originally Posted by simshaun View Post
    There is no way a "big" website can run on a framework (or templating engine).
    ER... its entirely plausible that a large websites can make use of frameworks -- whether custom frameworks or otherwise. Lets not forget that C/C++ programmers are an expensive commodity while PHP programmers are cheap, generally speaking and its far easier to maintain PHP code than C/C++.

    Quote Originally Posted by F.Danials View Post
    Do you think FaceBook will adopt MVC?
    ? I think Facebook is a little beyond simple MVC.
    Creativity knows no other restraint than the
    confines of a small mind.
    - Me
    Geekly Humor
    Oh baby! Check out the design patterns on that framework!

  16. #91
    SitePoint Evangelist simshaun's Avatar
    Join Date
    Apr 2008
    Location
    North Carolina
    Posts
    438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by imaginethis View Post
    That depends on whether or not you view PHP as a template engine :3
    Smart alec remark, but ok. For the records, I'm referring to apps like Smarty when I say templating engine.

    ER... its entirely plausible that a large websites can make use of frameworks -- whether custom frameworks or otherwise. Lets not forget that C/C++ programmers are an expensive commodity while PHP programmers are cheap, generally speaking and its far easier to maintain PHP code than C/C++.
    Show me a website that's as large as Yahoo or Facebook running PHP that you know uses a framework, and runs efficiently. The fact of the matter is, frameworks like Zend, CakePHP, Symfony, CodeIgniter, etc.. are just not fast enough to handle that kind of traffic. Not to mention, none of them are flexible enough to do what those sites need to do. I don't believe a site like that is concerned with staffing some C programmers.

    To F. Daniels, sites like SitePoint (which I consider slow), and DevShed have most likely tried to squeeze every bit of performance they can out of what they use. Both use vBulletin for forum software, although I believe DevShed's is much more modified.

  17. #92
    SitePoint Guru
    Join Date
    Jan 2005
    Location
    heaven
    Posts
    953
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by simshaun View Post
    Smart alec remark, but ok. For the records, I'm referring to apps like Smarty when I say templating engine.


    Show me a website that's as large as Yahoo or Facebook running PHP that you know uses a framework, and runs efficiently.
    Zend Framework Case Studies has a list of several websites running Zend Framework. Granted, there not as large as Yahoo or Facebook, but they still receive a fair amount of traffic.

    Quote Originally Posted by simshaun View Post
    The fact of the matter is, frameworks like Zend, CakePHP, Symfony, CodeIgniter, etc.. are just not fast enough to handle that kind of traffic.
    Thats not a fact thats an opinion. And your not completely correct. Load balancing and caching can have a drastic impact on application performance.
    Creativity knows no other restraint than the
    confines of a small mind.
    - Me
    Geekly Humor
    Oh baby! Check out the design patterns on that framework!

  18. #93
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by imaginethis View Post
    ? I think Facebook is a little beyond simple MVC.
    You think? When the source code for their home page leaked a while ago, it looked like they used MVC to me...

  19. #94
    SitePoint Addict
    Join Date
    Jun 2008
    Posts
    279
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stormrider View Post
    You think? When the source code for their home page leaked a while ago, it looked like they used MVC to me...
    Would most websites use the MVC architecture? - As it's a good way of organizing website parts.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •