Re: [PHP] Gzipped output
Stut wrote: Make any PHP-based script available without usage-restriction, and you've got yourself a DDOS potential. Using exec() doesn't change anything. I would argue that it makes it easier since creating and tearing down processes is a pretty expensive operation for most OS's, but like I said you're free to do whatever you want with your servers and clients. I don't know about most OS'es, but creating and tearing down processes is very cheap on Linux. The fork() call takes very few resources (copy-on-write etc.) If you subsequently load another binary using execv(), it could well turn into a pretty expensive operation, but that's up to you. If you're the target of a DOS attack, I would venture a guess and say your Apache server is dead long before exec() would have a chance to exacerbate the problem. Regardless, the OP was after delivering large files compressed chunk by chunk - I really do not see a security issue in using gzip for that, but I still like Andre Robinets solution better. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 5.2.5 installation
Hi, I have downloaded and setup the Apachi web server and My SQL 5.0.51a prior to my PHP installation on the windows platform. As I have downloaded the PHP 5.2.5 version (msi) and installed it on my system, it gave some errors that says a lot of dll's and sort of files are missing. I checked how to install it on your site and found only the basic 5.xx is documented. Please help me on this. Thanks and regards, image001.jpg-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Run Process in back ground
--- Richard Kurth [EMAIL PROTECTED] wrote: Is there a way that I can call a function that will send an email and then move on redirecting to another website without having to what for the email to send? SendEmail($memberemail,$MailFrom,$MailHost); header(Location:http://domain.com;); -- Richard, You can do it in other way. The steps are 1 Just keep the emails in database. 2 Write another shell/PHP script which will fetch email from database and send the email using local/remote MTA. 3 Run this script from cron as background process. --- Nirmalya Lahiri [+91-9433113536] Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP 5.2.5 installation
Why don’t you try installing it the easy way through WAMP. It installs PHP, MySQL, and Apache all configured and ready to go. http://www.wampserver.com/en/ Includes : - Apache 2.2.6 - MySQL 5.0.45 - PHP 5.2.5 From: Yoshika Kehelpannala [mailto:[EMAIL PROTECTED] Sent: 12/Feb/2008 11:56 AM To: php-general@lists.php.net Subject: [PHP] PHP 5.2.5 installation Hi, I have downloaded and setup the Apachi web server and My SQL 5.0.51a prior to my PHP installation on the windows platform. As I have downloaded the PHP 5.2.5 version (msi) and installed it on my system, it gave some errors that says a lot of dll’s and sort of files are missing. I checked how to install it on your site and found only the basic 5.xx is documented. Please help me on this. Thanks and regards, image001.jpg
Re: [PHP] PHP 5.2.5 installation
--- Yoshika Kehelpannala [EMAIL PROTECTED] wrote: Hi, I have downloaded and setup the Apachi web server and My SQL 5.0.51a prior to my PHP installation on the windows platform. As I have downloaded the PHP 5.2.5 version (msi) and installed it on my system, it gave some errors that says a lot of dll's and sort of files are missing. I checked how to install it on your site and found only the basic 5.xx is documented. Please help me on this. -- Yoshika, Please post the name of dll's and other files which are reported as missing..!!! Without that no one can identify the error... --- Nirmalya Lahiri [+91-9433113536] Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs
[PHP] Re: PHP 5.2.5 installation
I had the same problems installing 5.2.5 last week on windows, the installer's a bit corrupt! I ended up having to manually install from the latest snapshot instead; (download, extract, configure manually) alternatively, attempt to install as best it will, then overwrite with a snapshot. terrible advice from myself there! but it will work. Nathan Yoshika Kehelpannala wrote: Hi, I have downloaded and setup the Apachi web server and My SQL 5.0.51a prior to my PHP installation on the windows platform. As I have downloaded the PHP 5.2.5 version (msi) and installed it on my system, it gave some errors that says a lot of dll’s and sort of files are missing. I checked how to install it on your site and found only the basic 5.xx is documented. Please help me on this. Thanks and regards, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Template system in PHP
Hi, I need to develop a website, but my management is rather unstable in his vision for the layout. I'm thinking of developing the components as classes and functions, and then use a template system to render the layout. If the management wishes to change the layout, I'll just have to modify my template and the jobs' done. Do any of you guys gurls know of a way to implement that template system. (The best one I know of is that of Wordpress) Regards, Xavier de Lapeyre Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
Hi, I suggest you to use a framework. Lots of them implements template system and more. You'll don't have to reinvent the wheel. My favorit is Copix http://www.copix.org/ Email me if you need help. Brice On Feb 12, 2008 11:01 AM, Xavier de Lapeyre [EMAIL PROTECTED] wrote: Hi, I need to develop a website, but my management is rather unstable in his vision for the layout. I'm thinking of developing the components as classes and functions, and then use a template system to render the layout. If the management wishes to change the layout, I'll just have to modify my template and the jobs' done. Do any of you guys gurls know of a way to implement that template system. (The best one I know of is that of Wordpress) Regards, Xavier de Lapeyre Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
Xavier de Lapeyre wrote: Do any of you guys gurls know of a way to implement that template system. Smarty ? (The best one I know of is that of Wordpress) Regards, Xavier de Lapeyre Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
eval() is my favorite templating engine. http://php.net/eval Ditto on Eval() PHP is already a templating system. Why go the long way around? eval()? Man, you guys have some seriously large cajones. :p thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP 5.2.5 installation
Yoshika Kehelpannala wrote: Hi, I have downloaded and setup the Apachi web server and My SQL 5.0.51a prior to my PHP installation on the windows platform. As I have downloaded the PHP 5.2.5 version (msi) and installed it on my system, it gave some errors that says a lot of dll’s and sort of files are missing. I checked how to install it on your site and found only the basic 5.xx is documented. Please help me on this. Thanks and regards, I don't know how much luck you'll have with the msi package and Apache. When I install on windows I use the PHP zip and install according to the install text. Works like a charm every time. -Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
Because its painful and fun at the same time :) Aleksandar Quoting Nate Tallman [EMAIL PROTECTED]: Ditto on Eval() PHP is already a templating system. Why go the long way around? On Feb 12, 2008 10:13 AM, Greg Donald [EMAIL PROTECTED] wrote: On 2/12/08, Xavier de Lapeyre [EMAIL PROTECTED] wrote: Do any of you guys gurls know of a way to implement that template system. eval() is my favorite templating engine. http://php.net/eval -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Question about development
Jason Pruim wrote: On Feb 12, 2008, at 1:03 PM, Nathan Rixham wrote: Jason Pruim wrote: Hi Everyone, I know this isn't 100% on topic... But when is any post to this list 100% on topic? :) I've been doing some googling trying to find info on how to plan for what a website needs. Stuff like Does it need a forum, live support, database driven etc. etc. Does anyone have a form that they use to give to the client asking them to outline some ideas that they have about the website? What I'm looking for is something that I could give to a potential client and ask them to describe some basic aspects of their target audience, a rough idea of what they want it to look like, or at least other sites that they like. Stuff like that.. Even if you don't have such a form, I'm sure you all have standard questions you ask each client before giving a quote :) Anyone want to share with the class? If there is interest, I may even put it together on a webpage to help future people :) -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] I always take the simple approach, ask them what they want to achieve/expect from the website. Then verbally work backwards with them to figure out what the website needs in order to reach the clients goal. (personally) In all honesty I'd stay away from any kind of form, as they'll just pick nice to have boxes and end up with something overpriced, not suited to there needs and you'll get complaints in 6 months time. hope that makes sense! ps: the only thing I've found useful that way after many years, is to make the base site structure with very short text descriptions on each page + links to the next page | and for god sake, leave the home page will very very last! Nathan Hey Nathan, Thanks for the reply. I'm just getting more and more into freelance web work and have my first client asking for a quote. Before now, it's all been internal applications, and the companies website that I have worked on. Nothing for other people. I was actually thinking that the form would be for me to make sure I covered the basics... I'm alot better if I have something written down and I can ask the client Do you need to support multiple languages? Which to me then, would lead me into using a database[1] for storing the pages and using browser sniffing to find out what language preference they currently had selected to display in that language :) [1] As I was typing this I realized that maybe a database isn't the best idea for that, but it's the only way I can think of. Anyone who wants to give me another option is more then welcome to do so! -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] --Email and Googletalk/Jabber IM ID. As to the multilingual; many approaches use defines for site words, buttons, links etc... but since you most likely keep dynamic content in the database then it makes sense to store the translations there too. Then you can build a management interface for the customer to add content and the associated translations. -Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
On Tue, 2008-02-12 at 14:22 -0600, Shawn McKenzie wrote: Ryan A wrote: Add my vote too for Smarty HTH, -R Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping I like smarty and it's very powerful, however what you find is that it's just a less capable replacement for PHP. If I want conditional statements to display HTML and/or loop through arrays, why would I want to do it in smarty tags? Instead of moving display away from logic, it just replaces the logic with a different language. When I use templates I pretty much want variable substitution. My next project I'll probably use HTML files with little bits of PHP echos etc... sprinkled throughout. I prefer content formatting encapsulation as provided by custom tags. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Recommended ORM for PHP
Hello, on 02/08/2008 11:51 AM Zoltán Németh said the following: Metabase also generates a separate class for installing or upgrading your database schema. If you change the definition of you objects, you just need to call that class to install, upgrade, downgrade your database schemas, safely without loosing any data that was already in the database. This is something very secure, as it does not do any schema changes if the underlying database does not support certain things you want to change. If you ask for a change that is not possible, it simply fails without changing anything. It is not that error prone migrations method of Ruby on Rails, that you have to write SQL manually to do your migrations, and if you made a mistake, your database data is lost. schema versioning is cool, AFAIK it is missing from propel but of course it can transform your schema without data loss. What I meant is that when you upgrade the database schema to reflect the changes in your object models, Metabase performs the database schema alterations without destroying the data previously inserted in the database tables. For instance, if you want to send a newsletter to a million subscribers and you just need the e-mail address and names of the subscribers, you can tell Metastorage to generate a report class that queries the users objects and retrives just the name and e-mail address. The report classes return arrays just like plain SELECT queries. If you use the Propel approach you would need to retrieve 1 million objects of the users class just to pick the name and e-mail address, which is totally inefficient in terms of memory and very slow. not at all. you can build the criteria for the select and then run a doSelectRS method which gives you only the result set in an array, no objects involved. That is not exactly what I am talking about. Metastorage has an Object Query Language (OQL) that lets you express whatever query conditions you want. It generates PHP code with the necessary SQL queries you need. You do not have to build any queries programatically at run-time. in propel you do not touch SQL too ;) you initialize an object of class Criteria and define whatever you want. e.g. $c = new Criteria(); $c-add('whatevercolumn', 'whatevervalue'); of course it can do much more, joins and everything you may need The way I see it, this is not better than writing SQL manually. Actually you become less productive because you need to learn a new syntax for composing conditions without any benefits. With Metastorage you can compose query conditions expressed in the OQL (Object Query Language). The OQL expressions are compiled into SQL expressions at compile time. The big difference is that if you have a mistake in your conditions, Metastorage tells you right away so you can fix it way before you ever try your code at run time. For instance, there is no way you can compare by mistake a object identifier (primary key) with a regular integer variable because it would not make sense, despite in SQL that is an acceptable key. This way you generate more reliable code and you take less time to detect and fix bugs as that happens before you ever run the generated code. Another thing is that Metastorage OQL is really object oriented, as opposed to relational oriented. This means that you can for instance ask to retrieve objects that belong to collection of objects established by a relationship between classes. In the relational world you would do joins. That may be simple in many cases, but if you need to deal with many-to-many relationships, you can easily get buried in the complexity of mapping such kind of relationships to the relational world. Metastorage makes that much easy. You just tell that a class may contain a collection of objects of another class, and that other class may contain a collection of the first class. From that Metastorage takes care of generating a schema that includes the intermediate database table that is necessary to establish the many-to-many relationship. Also in the OQL you can use operators such as in colllection or not in collection and Metastorage will generate an SQL expression that includes all the right joins, so you do not get buried in the details of doing that right manually. There are more differences between Metastorage and Propel (and probably others approach). I just wanted to make the point that the fact that approaches use generated code, it does not mean that all provide the same efficiency. yeah, sure. however there is a payoff between efficiency and portability and maintainability, and of course not all these orms have the same level of these. choose the one that fits your needs best. Exactly. I choose to develop my own because nothing that existed in PHP matched my needs and code quality code requirements. Of course doing it yourself is an expensive measure because it takes time and skill to reach a mature solution. I have
Re: [PHP] Re: Question about development
On Feb 12, 2008, at 4:24 PM, Daniel Brown wrote: On Feb 12, 2008 2:53 PM, Nathan Rixham [EMAIL PROTECTED] wrote: Browsers generally send the the HTTP_ACCEPT_LANGUAGE header in a request. $_SERVER[HTTP_ACCEPT_LANGUAGE] = en-gb,en;q=0.5 thus with mine, preference is en-gb, failing that anything en; failing that whatever you've got. ACCEPT_CHARSET is worth a check often aswell; finally POST requests can also have a CONTENT_LANGUAGE specified which describes the lang of the content. Yes, but as has been said in the past, you can't rely on browser headers, because they can easily be forged. ;-P I can see it now That'll mess with them. Now they'll think I'm Mexican! Which goes back to giving them an easy way of changing the display language :P If someone intentionally messes with the language headers they deserve to get a language they may or may not know! :P -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
*sigh* as always, firefox obeys, ie7 goes huh what? Nathan Rixham wrote: Are you creating custom DTD's or 1.1 XHTML Mods then? I'd like to see that, it's something I'd toyed with a few times in the past but found it far too time consuming (even for me), and opted for the ol' redefine everything in CSS *lightbulb* :: runs off to try css on custom tags why have i never tried that before :: ponders accessibility.. :: wanders off to waste time researching anyways Robert Cummings wrote: On Tue, 2008-02-12 at 15:02 -0600, Greg Donald wrote: On Feb 12, 2008 2:57 PM, Robert Cummings [EMAIL PROTECTED] wrote: I prefer content formatting encapsulation as provided by custom tags. Decorators? Custom tags (XML style ones anyways) provide support for arbitrary ordering and omission of optional attributes. They nest nicer than function calls, and they have the same general formatting as the HTML with which you are working. Additionally, they provide the opportunity to punt anything not necessary at run-time to pre-compiled HTML. Cheers, Rob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
Are you creating custom DTD's or 1.1 XHTML Mods then? I'd like to see that, it's something I'd toyed with a few times in the past but found it far too time consuming (even for me), and opted for the ol' redefine everything in CSS *lightbulb* :: runs off to try css on custom tags why have i never tried that before :: ponders accessibility.. :: wanders off to waste time researching anyways Robert Cummings wrote: On Tue, 2008-02-12 at 15:02 -0600, Greg Donald wrote: On Feb 12, 2008 2:57 PM, Robert Cummings [EMAIL PROTECTED] wrote: I prefer content formatting encapsulation as provided by custom tags. Decorators? Custom tags (XML style ones anyways) provide support for arbitrary ordering and omission of optional attributes. They nest nicer than function calls, and they have the same general formatting as the HTML with which you are working. Additionally, they provide the opportunity to punt anything not necessary at run-time to pre-compiled HTML. Cheers, Rob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
On Feb 12, 2008 3:15 PM, Robert Cummings [EMAIL PROTECTED] wrote: Custom tags (XML style ones anyways) provide support for arbitrary ordering and omission of optional attributes. They nest nicer than function calls, and they have the same general formatting as the HTML with which you are working. Additionally, they provide the opportunity to punt anything not necessary at run-time to pre-compiled HTML. Your solution to templating is XML? -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
On Tue, 2008-02-12 at 15:02 -0600, Greg Donald wrote: On Feb 12, 2008 2:57 PM, Robert Cummings [EMAIL PROTECTED] wrote: I prefer content formatting encapsulation as provided by custom tags. Decorators? Custom tags (XML style ones anyways) provide support for arbitrary ordering and omission of optional attributes. They nest nicer than function calls, and they have the same general formatting as the HTML with which you are working. Additionally, they provide the opportunity to punt anything not necessary at run-time to pre-compiled HTML. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session and Multi Server Architecture
On 2/12/08, Nathan Nobbe [EMAIL PROTECTED] wrote: also, in terms of scalability, isnt facebook proof that memcache can scale? memcached is behind facebook, livejournal (who made it), i believe dealnews, flickr, twitter, pownce, typepad, fotolog, slashdot, feedburner, 37signals, i think even myspace is trying to use it now. sun has even contributed 6? dedicated resources i believe to the project now too. here's an article about how it was key in helping twitter scale: http://highscalability.com/scaling-twitter-making-twitter-1-percent-faster most people will agree your biggest bottleneck is always your database. throwing a caching layer in the mix (where memcached is typically the most popular) alleviates a LOT of database traffic and processing (depending on the type of load - reads vs. writes, etc.) highscalability.com is an awesome website, lots of good information and products that have proven to be successful (since the sites are obviously up and functional :)) i have read a lot of presentations and almost all of them always eventually introduce data sharding, a caching layer, batched denormalization of specific data, etc. to effectively use memcached though, you'll want to design with a caching layer in place from the beginning. it might not be -active-, but with the right hooks it will be transparent to enable it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: database design tool
Shawn McKenzie wrote: Can anyone recommend a preferably visual DB design tool? I normally use mysql, but one that covered several types wood be cool. I'm on Linux, so the new mysql workbench is a dud. I used it in an alpha or prior version and it looked promising but crashed frequently. They say a Linux version in 2008, but I'm not holding my breath. Thanks! -Shawn Ha, I first tried a subject of OT: database design tool to be civil, but the news server rejected it with a message of apparent off topic post. Haha. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
REST is the new SOAP. Yaml is the new XML. I'm guessing this news just hasn't made it into any PHP frameworks yet. REST is fine for small communications but really isn't a very good solution for large and complex communication. SOAP is the 600 pound gorilla. Usually I use XML-RPC because it's sort of the middle ground. I usually use REST mostly for simple services that just need a simple trigger and response - often stuff I want to run from cron jobs. I save SOAP for the rare job that REST or XML-RPC can't do although in those cases I usually stop to consider if I'm making the problem more complex than it needs to be. YAML doesn't seem significantly easier (faster less intensive) to parse than XML, it doesn't seem as flexible as XML, and it's less familiar for developers to work with so I don't really see the benefit. It seems to exist entirely because some people didn't like the way XML looked. It might be slightly smaller than XML but that's hardly an issue since you can always compress your data. YAML fits in the same boat as people pushing binary XML. It doesn't really make a lot of sense. It's almost always cheaper to throw more CPU time at a problem than man hours and YAML is less obvious to work with than XML so it doesn't make business sense. If you really want something fast and non-intensive to parse then use tab-separated values or something similar. -- Michael McGlothlin Southwest Plumbing Supply smime.p7s Description: S/MIME Cryptographic Signature
Re: [PHP] Template system in PHP
On Feb 12, 2008 6:27 PM, Greg Donald [EMAIL PROTECTED] wrote: On Feb 12, 2008 4:23 PM, Nathan Nobbe [EMAIL PROTECTED] wrote: well thats what xslt is, which is pretty nice. /\ is a statement, not a question ;) Wow dude, you're a rock. I meant my question was rhetorical, not your statement about my question. well, my bad then; im just not clever like that i guess :D /me point Nathan to http://en.wikipedia.org/wiki/Rhetorical_question XSLT sucks, complete overkill. the best part about xslt is its a standard, not some new contrivance from Creation does not prove usefulness. some other corner of the galaxy like smarty. Well I certainly agree with that. Smarty is like the fat cousin you hope doesn't show up to the 4th of July cookout. But there's always some n00b developer who brings it up.. next thing you know the project manager thinks it's a good idea because his designers will love to use it (rofl) and then you're screwed. haha; i took a look at it when i was doing my initial research for a templating solution roughly a year ago, but settled on xsl at that time. i had done some previous research on xsl before then and it made sense. since then i think its still pretty solid, but im working on my own little template library where hopefully i wont have to deal with escaping in and out of php, eg ?php ? more template ?php ? the main issue ive run into with it is my templates will be so small it just will be too much overhead to splice them all together on a given page load. furthermore i dont think it overkill at all. so lets see, what are you rendering, o, a subset of xml, xhmtl. so its actually quite concise. beyond that its well suited to target the output from an application to other potential clients such as programmatic ones eg. web service clients or mobile devices. REST is the new SOAP. Yaml is the new XML. I'm guessing this news just hasn't made it into any PHP frameworks yet. rest has its advantages, but it is by far a complete replacement for soap. as per yaml, i dont know that i ever heard of it until you mentioned it on the ruby thread. but that doctrine framework does apparently use it. and if yaml does take off, ill be sure to tell everyone i discuss it w/ that greg donald from php-general was on the yaml tip back in the day ;) -nathan
RE: [PHP] Security scanner (Lockdown Networks Enforcer)
-Original Message- From: Emil Edeholt [mailto:[EMAIL PROTECTED] Sent: Monday, February 11, 2008 5:17 AM To: php-general@lists.php.net Subject: [PHP] Security scanner I've been trying Nessus to search for sql injections and other security issues. I'm quite sure Nessus is missing a lot of possible sql injections (and maybe other stuff too). Are there any other tools that I can install on my server that searches a bit more carefully? What do you use and why? Any other good security tools for LAMP that one should know of? I'll just use this opportunity to plug my company: http://www.lockdownnetworks.com We have several auditing engines and have a team in of people that write various plugins. Currently we have upwards of 13,000 tests (keep in mind it's not 1:1, a single test might check for multiple vulnerabilities). It's not a free product, but we have partners that offer auditing services, so you don't have to plunk down thousands to reap the benefits. Contact us if you're interested in exploring this further. http://www.lockdownnetworks.com/aboutus/contact.php Daevid Founding Employee #4 Sr. Software Architect -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
Michael McGlothlin wrote: REST is the new SOAP. Yaml is the new XML. I'm guessing this news just hasn't made it into any PHP frameworks yet. REST is fine for small communications but really isn't a very good solution for large and complex communication. SOAP is the 600 pound gorilla. Usually I use XML-RPC because it's sort of the middle ground. I usually use REST mostly for simple services that just need a simple trigger and response - often stuff I want to run from cron jobs. I save SOAP for the rare job that REST or XML-RPC can't do although in those cases I usually stop to consider if I'm making the problem more complex than it needs to be. YAML doesn't seem significantly easier (faster less intensive) to parse than XML, it doesn't seem as flexible as XML, and it's less familiar for developers to work with so I don't really see the benefit. It seems to exist entirely because some people didn't like the way XML looked. It might be slightly smaller than XML but that's hardly an issue since you can always compress your data. YAML fits in the same boat as people pushing binary XML. It doesn't really make a lot of sense. It's almost always cheaper to throw more CPU time at a problem than man hours and YAML is less obvious to work with than XML so it doesn't make business sense. If you really want something fast and non-intensive to parse then use tab-separated values or something similar. -- Michael McGlothlin Southwest Plumbing Supply *wades in* XML is by far superior to anything else out there for one reason and one reason only; the DOM API. Concider a node or an element compared to an array or a typical variable, no contest in terms of functionality at all; attributes alone win it hands down, without taking into account parent/child nodes, namespaces, nodeNames nodeTypes, pervious, next.. not to mention the associated methods for inserting, appending, searching by tagname namespace. More than this, DOM functionality is available both server and client side, with exactly the same value names and function names. XML is the perfect transport for DOM objects between servers, programs and clients; it's already widespread and not used properly nearly enough. The only drawback I can find is the lack of storage support, unless somebody out there knows a way to full text a specific node type in 10k xml documents as wuick as you could query a column on 10k db rows? *ducks out* -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] database design tool
Can anyone recommend a preferably visual DB design tool? I normally use mysql, but one that covered several types wood be cool. I'm on Linux, so the new mysql workbench is a dud. I used it in an alpha or prior version and it looked promising but crashed frequently. They say a Linux version in 2008, but I'm not holding my breath. Thanks! -Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
Nathan Nobbe wrote: On Feb 12, 2008 7:42 PM, Michael McGlothlin [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: REST is the new SOAP. Yaml is the new XML. I'm guessing this news just hasn't made it into any PHP frameworks yet. YAML doesn't seem significantly easier (faster less intensive) to parse than XML, it doesn't seem as flexible as XML, and it's less familiar for developers to work with so I don't really see the benefit. It seems to exist entirely because some people didn't like the way XML looked. It might be slightly smaller than XML but that's hardly an issue since you can always compress your data. YAML fits in the same boat as people pushing binary XML. It doesn't really make a lot of sense. It's almost always cheaper to throw more CPU time at a problem than man hours and YAML is less obvious to work with than XML so it doesn't make business sense. If you really want something fast and non-intensive to parse then use tab-separated values or something similar. damn dude, i couldnt have put it better myself if i tried. i whole-heartedly agree. this is one situation where i feel throwing some hardware at it is totally appropriate. the only place you wont escape is the cost on the network, but you could always get more bandwidth too, right ? :) Compression is a good choice for abusing your CPU more to free up network resources. So network resources shouldn't be much of an issue. btw. if there are schemas or dtds out there for what im working on, i will always run my xml against them and that makes it pretty damn easy to track down problems. and if there isnt a dtd or schema file, its usually some syntax i whipped up for a little project. and yes, i know yaml has support for validation.. Validation is handy although my experience is that often vendors don't bother making sure their stuff validates against their own schemas. Sort off annoying if you have no choice but to work with them. Usually the same vendors have crappy documentation too. -- Michael McGlothlin Southwest Plumbing Supply smime.p7s Description: S/MIME Cryptographic Signature
Re: [PHP] Template system in PHP
On Feb 12, 2008 7:42 PM, Michael McGlothlin [EMAIL PROTECTED] wrote: REST is the new SOAP. Yaml is the new XML. I'm guessing this news just hasn't made it into any PHP frameworks yet. YAML doesn't seem significantly easier (faster less intensive) to parse than XML, it doesn't seem as flexible as XML, and it's less familiar for developers to work with so I don't really see the benefit. It seems to exist entirely because some people didn't like the way XML looked. It might be slightly smaller than XML but that's hardly an issue since you can always compress your data. YAML fits in the same boat as people pushing binary XML. It doesn't really make a lot of sense. It's almost always cheaper to throw more CPU time at a problem than man hours and YAML is less obvious to work with than XML so it doesn't make business sense. If you really want something fast and non-intensive to parse then use tab-separated values or something similar. damn dude, i couldnt have put it better myself if i tried. i whole-heartedly agree. this is one situation where i feel throwing some hardware at it is totally appropriate. the only place you wont escape is the cost on the network, but you could always get more bandwidth too, right ? :) btw. if there are schemas or dtds out there for what im working on, i will always run my xml against them and that makes it pretty damn easy to track down problems. and if there isnt a dtd or schema file, its usually some syntax i whipped up for a little project. and yes, i know yaml has support for validation.. -nathan
Re: [PHP] Re: memcached (was: session and Multi Server Architecture)
On 2/12/08, Per Jessen [EMAIL PROTECTED] wrote: My mistake - I though I'd understood that memcached would replicate objects across the servers, but that's clearly wrong. If I've got it right, virtually every access to a cached object will require network traffic? (the exception being those cases where your object is on your local memcached). I've very likely overlooked something or other, but overall memcached seems to me to be unnecessarily complicated when the same problem can be solved with session persistency (even if you have to accept a slightly uneven load at times). As of pecl memcache 3.0.0 they have client-side support to push the data to more than one server (neat idea) - so you'd have a backup in case the primary went down without threat of a full cache stampede... To me it isn't a memcached vs. session persistency debate. memcached to me is a cache layer for anything - if I wanted to use it for sessions, it's an added bonus (I'd probably make sure to use 3.0.0+ so I could ensure the data is in more than one server, losing people's session data is a crappy user experience :)) I would suggest using MySQL (unless traffic is huge and needs lightweight memcached instead) for session storage. It alleviates the need for any sort of persistence and is easily transferrable to any server. I use it on all my webapps - single server or multi-server. memcached is a bit more unique, if you don't own the server you might have an issue getting support for it, but a PHP+MySQL combination is pretty standard, and typically the application already has a MySQL connection needed, so it's not really adding any additional connection overhead (if your connection stuff is handled properly and doesn't duplicate connections) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
On Feb 12, 2008 4:23 PM, Nathan Nobbe [EMAIL PROTECTED] wrote: well thats what xslt is, which is pretty nice. /\ is a statement, not a question ;) Wow dude, you're a rock. I meant my question was rhetorical, not your statement about my question. /me point Nathan to http://en.wikipedia.org/wiki/Rhetorical_question XSLT sucks, complete overkill. the best part about xslt is its a standard, not some new contrivance from Creation does not prove usefulness. some other corner of the galaxy like smarty. Well I certainly agree with that. Smarty is like the fat cousin you hope doesn't show up to the 4th of July cookout. But there's always some n00b developer who brings it up.. next thing you know the project manager thinks it's a good idea because his designers will love to use it (rofl) and then you're screwed. furthermore i dont think it overkill at all. so lets see, what are you rendering, o, a subset of xml, xhmtl. so its actually quite concise. beyond that its well suited to target the output from an application to other potential clients such as programmatic ones eg. web service clients or mobile devices. REST is the new SOAP. Yaml is the new XML. I'm guessing this news just hasn't made it into any PHP frameworks yet. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Question about development
Hi, I usually use a MoSCoW Analysis. http://en.wikipedia.org/wiki/MoSCoW_Method From then on, I move into detailing each needs. The S - Should have and C - could have parts are rather tricky if you are new to it. So far this method has saved me more than once in many projects. The most important aspects are the Must Have (which you should implement at all cost in the development cycle) and the Wont Have. Correctly defining the Wont Haves is a must. You won't like to have to re-do your whole development simply because you forgot to point out that there Wont have multiple languages. Or that there Wont Have a forum in this version. One little trick that I used now is the following point in the Won't Have section. Any not mentioned above as default. Dummy Site Version 1.X MoSCoW Analysis Must Have Features 1 Registration FeatureAllows user to register to website 2 Login Feature Allows user to login to website - Requires registration 3 Recover Pwd Feature Allows user to reset his password - Unique email required - mail() function - Overwrite pwd with a random pwd - Send hash MD5 4 Search Allows users to search for posts- basic search - advanced search 5 Product display 6 Add Products 7 Display latest news Should Have Features 1 Profile Updates Allows users to update their profiles. - Change password - Change display name - Change information details - Cannot change email Could Have Features 1 Forum 2 Chat Wont Have Features 1 Any not mentioned above 2 Multiple Languages Xavier de Lapeyre Web Developer Please consider the environment before printing this mail note. -Original Message- From: Jason Pruim [mailto:[EMAIL PROTECTED] Sent: mardi 12 février 2008 19:50 To: PHP-General General Subject: [PHP] Question about development Hi Everyone, I know this isn't 100% on topic... But when is any post to this list 100% on topic? :) I've been doing some googling trying to find info on how to plan for what a website needs. Stuff like Does it need a forum, live support, database driven etc. etc. Does anyone have a form that they use to give to the client asking them to outline some ideas that they have about the website? What I'm looking for is something that I could give to a potential client and ask them to describe some basic aspects of their target audience, a rough idea of what they want it to look like, or at least other sites that they like. Stuff like that.. Even if you don't have such a form, I'm sure you all have standard questions you ask each client before giving a quote :) Anyone want to share with the class? If there is interest, I may even put it together on a webpage to help future people :) -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
On Feb 12, 2008 5:10 PM, Greg Donald [EMAIL PROTECTED] wrote: On Feb 12, 2008 3:37 PM, Nathan Nobbe [EMAIL PROTECTED] wrote: well thats what xslt is, which is pretty nice. /\ is a statement, not a question ;) /me point Nathan to http://en.wikipedia.org/wiki/Rhetorical_question XSLT sucks, complete overkill. the best part about xslt is its a standard, not some new contrivance from some other corner of the galaxy like smarty. furthermore i dont think it overkill at all. so lets see, what are you rendering, o, a subset of xml, xhmtl. so its actually quite concise. beyond that its well suited to target the output from an application to other potential clients such as programmatic ones eg. web service clients or mobile devices. -nathan
Re: [PHP] Template system in PHP
Nathan Rixham wrote: Shawn McKenzie wrote: Ryan A wrote: Add my vote too for Smarty HTH, -R Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping I like smarty and it's very powerful, however what you find is that it's just a less capable replacement for PHP. If I want conditional statements to display HTML and/or loop through arrays, why would I want to do it in smarty tags? Instead of moving display away from logic, it just replaces the logic with a different language. When I use templates I pretty much want variable substitution. My next project I'll probably use HTML files with little bits of PHP echos etc... sprinkled throughout. -Shawn re: If I want conditional statements to display HTML and/or loop through arrays, why would I want to do it in smarty tags? Things are very different when there are a team of varyingly skilled people on the job, do you really want a junior designer going in and changing bits of a php application, when you could limit the damage to a smarty template? further; the font end smarty language is definately needed; concider {if $articles} {*loop through articles and show in table *} {else} {* show no articles message *} {/if} in my opinion, being able to dump that kind of ultra simple logic onto the designers makes: 1: my life much easier 2: my php files much neater 3: my code my own domain without worrying about random comments and breakages from designers 4: the designers happier as they have more freedom and power to control the display, without having to worry final note: personally I output every script to a suitably named .tpl file with a single line {debug} - job done I understand, but my point that I didn't make earlier is that I know PHP so I use that. Designers that I work with don't know PHP and don't know smarty and have no desire to know. They know graphic design and HTML. So I would rather give them some meaningful tags to insert somewhere in their HTML. Actually moving the logic out of the presentation/design. So instead of article.tpl: {if $articles} {*loop through articles and show in table *} {else} {* show no articles message *} {/if} I prefer to do this in my article.php: if($articles) { include('article.html'); //or optionally file_get_contents() and do replace on tags }else{ return; } And let the designer have his article.html: table tr td?php echo $something; ?/td !-- or {something} that is replaced with echo $something; -- /tr /table -Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
On Feb 12, 2008 3:37 PM, Nathan Nobbe [EMAIL PROTECTED] wrote: well thats what xslt is, which is pretty nice. /me point Nathan to http://en.wikipedia.org/wiki/Rhetorical_question XSLT sucks, complete overkill. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
On Feb 12, 2008 4:45 PM, Robert Cummings [EMAIL PROTECTED] wrote: well thats what xslt is, which is pretty nice. Nah, I don't bother with XSLT. i know, i just thought id mention it, since xml was brought up and nobodys even mentioned xslt yet. i will likely move away from xslt, but i will be doing something different than the straight php based templating, like in code igniter. thats great for simple projects, but the thing i hate the most is escaping in and out of php, bleh! im still experimenting w/ my solution so i wont bother to share it until its worth looking at, but for the meantime the basic php mechanism is suitable. and i certainly dont use eval()! its slow and it opens holes to attacks. the most simple, way to template w/ php is w/ php, very simply, you will have a file, blah.php and watch how i include another 'template' after the data portion, (the second template is blah2.php someHtmlTag ?=$someDataFromPhp? ?php include('blah2.php'); ? /someOtherHtmlTag and there you have it, that is the most direct way to template w/ php, backed by the language itself. there is no need for eval either. i have my reasons for not liking it, but as i said, my system is far from ready and well this is cleaner than writing functions with strings, thats just horrid, imho. whwe, rant finished :) -nathan
Re: [PHP] Template system in PHP
guys, you all know you can F5 in the view source bit of firefox yeah.. save's all the pre's and loads of time! right click : view source : F5 till your done debugging. :) Christoph Boget wrote: I agree. I usually add a little function like this to my PHP projects: function debug( $var ) { echo 'pre'; print_r( $var ); echo '/pre'; } As an aside, you can save lines when debugging by doing: echo 'pre' . print_r( $var, TRUE ) . '/pre'; thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
On Tue, 2008-02-12 at 16:37 -0500, Nathan Nobbe wrote: On Feb 12, 2008 4:18 PM, Greg Donald [EMAIL PROTECTED] wrote: On Feb 12, 2008 3:15 PM, Robert Cummings [EMAIL PROTECTED] wrote: Custom tags (XML style ones anyways) provide support for arbitrary ordering and omission of optional attributes. They nest nicer than function calls, and they have the same general formatting as the HTML with which you are working. Additionally, they provide the opportunity to punt anything not necessary at run-time to pre-compiled HTML. Your solution to templating is XML? well thats what xslt is, which is pretty nice. Nah, I don't bother with XSLT. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
On Tue, 2008-02-12 at 21:19 +, Nathan Rixham wrote: Are you creating custom DTD's or 1.1 XHTML Mods then? I'd like to see that, it's something I'd toyed with a few times in the past but found it far too time consuming (even for me), and opted for the ol' redefine everything in CSS *lightbulb* :: runs off to try css on custom tags why have i never tried that before :: ponders accessibility.. :: wanders off to waste time researching anyways I don't muck with DTDs and I don't bother with XSL. I could I guess, but they're more hassle than I care to work with. The tag lib hooks to PHP handlers that do what you want in good old PHP. The link below (if you're interested) is a basic example site that illustrates the custom tag system and various other InterJinn stuff. http://www.interjinn.com/download/exampleSite.tar.gz Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
On Tue, 2008-02-12 at 15:18 -0600, Greg Donald wrote: On Feb 12, 2008 3:15 PM, Robert Cummings [EMAIL PROTECTED] wrote: Custom tags (XML style ones anyways) provide support for arbitrary ordering and omission of optional attributes. They nest nicer than function calls, and they have the same general formatting as the HTML with which you are working. Additionally, they provide the opportunity to punt anything not necessary at run-time to pre-compiled HTML. Your solution to templating is XML? Not quite. My template engine allows arbitrary template types to be defined that are applied in a configured order. One such template type is similar to XML, but not quite. Specifically, the tags mostly conform to XML semantics, but they do not require a root nor do they require that the content in which they are embedded be well formed-- although they themselves must be well-formed. This allows the use of XML style custom tags to be used in any kind of document, whether it be HTML, XHTML, XML, plaintext, whatever. For most projects I work on the compiler is run to produce the documents requested. As such there is no cache overhead. In fact, if all you want is HTML, you can compile so that PHP is eliminated from the final result. I do this for CSS files (and others) that I have in multiple files that indicate specific CSS applicability. These are combined to a single CSS file by the template compiler and require no PHP overhead when requested. In cases of actual PHP empowered pages, in development I set a configuration variable to enable detection of changes to any of the dependency template files which invokes automatic recompilation. In production, auto recompilation is disabled for better performance. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
On Feb 12, 2008 4:18 PM, Greg Donald [EMAIL PROTECTED] wrote: On Feb 12, 2008 3:15 PM, Robert Cummings [EMAIL PROTECTED] wrote: Custom tags (XML style ones anyways) provide support for arbitrary ordering and omission of optional attributes. They nest nicer than function calls, and they have the same general formatting as the HTML with which you are working. Additionally, they provide the opportunity to punt anything not necessary at run-time to pre-compiled HTML. Your solution to templating is XML? well thats what xslt is, which is pretty nice. -nathan
Re: [PHP] Template system in PHP
I agree. I usually add a little function like this to my PHP projects: function debug( $var ) { echo 'pre'; print_r( $var ); echo '/pre'; } As an aside, you can save lines when debugging by doing: echo 'pre' . print_r( $var, TRUE ) . '/pre'; thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
2008/2/12, Xavier de Lapeyre [EMAIL PROTECTED]: Hi, I need to develop a website, but my management is rather unstable in his vision for the layout. I'm thinking of developing the components as classes and functions, and then use a template system to render the layout. If the management wishes to change the layout, I'll just have to modify my template and the jobs' done. Do any of you guys gurls know of a way to implement that template system. (The best one I know of is that of Wordpress) Regards, Xavier de Lapeyre Web Developer Hi Xavier! I think you need a framework and i suggest the Zend Framework. Good. -- - - -- Csanyi Andras -- http://sayusi.hu -- Sayusi Ando -- Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell
Re: [PHP] Template system in PHP
I used Smarty for long time but now switched to two-step-rendering. It's way more comfortable (for me). I suggest Zend_Layout + Zend_View at the moment (framework.zend.com) -- Łukasz Wojciechowski
Re: [PHP] Template system in PHP
On Feb 12, 2008 3:32 PM, Christoph Boget [EMAIL PROTECTED] wrote: As an aside, you can save lines when debugging by doing: echo 'pre' . print_r( $var, TRUE ) . '/pre'; OMG, thanks for that. Lines are so expensive nowadays and all. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
On Feb 12, 2008 1:58 PM, Nathan Rixham [EMAIL PROTECTED] wrote: I still don't understand why general net users don't just like to see print_r output; it's got all the info they could want, ordered and structured *shrugs* vote: text/plain I agree. I usually add a little function like this to my PHP projects: function debug( $var ) { echo 'pre'; print_r( $var ); echo '/pre'; } -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
Shawn McKenzie wrote: Ryan A wrote: Add my vote too for Smarty HTH, -R Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping I like smarty and it's very powerful, however what you find is that it's just a less capable replacement for PHP. If I want conditional statements to display HTML and/or loop through arrays, why would I want to do it in smarty tags? Instead of moving display away from logic, it just replaces the logic with a different language. When I use templates I pretty much want variable substitution. My next project I'll probably use HTML files with little bits of PHP echos etc... sprinkled throughout. -Shawn re: If I want conditional statements to display HTML and/or loop through arrays, why would I want to do it in smarty tags? Things are very different when there are a team of varyingly skilled people on the job, do you really want a junior designer going in and changing bits of a php application, when you could limit the damage to a smarty template? further; the font end smarty language is definately needed; concider {if $articles} {*loop through articles and show in table *} {else} {* show no articles message *} {/if} in my opinion, being able to dump that kind of ultra simple logic onto the designers makes: 1: my life much easier 2: my php files much neater 3: my code my own domain without worrying about random comments and breakages from designers 4: the designers happier as they have more freedom and power to control the display, without having to worry final note: personally I output every script to a suitably named .tpl file with a single line {debug} - job done -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
On Feb 12, 2008 2:57 PM, Robert Cummings [EMAIL PROTECTED] wrote: I prefer content formatting encapsulation as provided by custom tags. Decorators? -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
Ryan A wrote: Add my vote too for Smarty HTH, -R Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping I like smarty and it's very powerful, however what you find is that it's just a less capable replacement for PHP. If I want conditional statements to display HTML and/or loop through arrays, why would I want to do it in smarty tags? Instead of moving display away from logic, it just replaces the logic with a different language. When I use templates I pretty much want variable substitution. My next project I'll probably use HTML files with little bits of PHP echos etc... sprinkled throughout. -Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
Add my vote too for Smarty HTH, -R Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
I still don't understand why general net users don't just like to see print_r output; it's got all the info they could want, ordered and structured *shrugs* vote: text/plain Aleksandar Vojnovic wrote: Because its painful and fun at the same time :) Aleksandar Quoting Nate Tallman [EMAIL PROTECTED]: Ditto on Eval() PHP is already a templating system. Why go the long way around? On Feb 12, 2008 10:13 AM, Greg Donald [EMAIL PROTECTED] wrote: On 2/12/08, Xavier de Lapeyre [EMAIL PROTECTED] wrote: Do any of you guys gurls know of a way to implement that template system. eval() is my favorite templating engine. http://php.net/eval -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Question about development
Jason, If you don't mind I may give you an email off the list in a moment to brain storm up a quick list of questions to ask clients and indeed client gotchas. For the time being as this seems to be going down the line of how to handle multilingual sites here's my two pennies. XML, store everything in XML, that way I can store extra info specific to the files in there aswell. A quick XPath query [lang=en-gb] and I've got the content I need. To get around the search thing I generally store a plain text version of the content in a single table, with the key being a geometry column to keep things working ultra fast. But.. I'm still experimenting - sure xml is the way forwards.. Nathan Aleksandar Vojnovic wrote: Could you explain this a little better - ...into using a database[1] for storing the pages and using browser sniffing to find out what language preference they currently had selected to display in that language? Aleksandar Quoting Jason Pruim [EMAIL PROTECTED]: On Feb 12, 2008, at 1:03 PM, Nathan Rixham wrote: Jason Pruim wrote: Hi Everyone, I know this isn't 100% on topic... But when is any post to this list 100% on topic? :) I've been doing some googling trying to find info on how to plan for what a website needs. Stuff like Does it need a forum, live support, database driven etc. etc. Does anyone have a form that they use to give to the client asking them to outline some ideas that they have about the website? What I'm looking for is something that I could give to a potential client and ask them to describe some basic aspects of their target audience, a rough idea of what they want it to look like, or at least other sites that they like. Stuff like that.. Even if you don't have such a form, I'm sure you all have standard questions you ask each client before giving a quote :) Anyone want to share with the class? If there is interest, I may even put it together on a webpage to help future people :) -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] I always take the simple approach, ask them what they want to achieve/expect from the website. Then verbally work backwards with them to figure out what the website needs in order to reach the clients goal. (personally) In all honesty I'd stay away from any kind of form, as they'll just pick nice to have boxes and end up with something overpriced, not suited to there needs and you'll get complaints in 6 months time. hope that makes sense! ps: the only thing I've found useful that way after many years, is to make the base site structure with very short text descriptions on each page + links to the next page | and for god sake, leave the home page will very very last! Nathan Hey Nathan, Thanks for the reply. I'm just getting more and more into freelance web work and have my first client asking for a quote. Before now, it's all been internal applications, and the companies website that I have worked on. Nothing for other people. I was actually thinking that the form would be for me to make sure I covered the basics... I'm alot better if I have something written down and I can ask the client Do you need to support multiple languages? Which to me then, would lead me into using a database[1] for storing the pages and using browser sniffing to find out what language preference they currently had selected to display in that language :) [1] As I was typing this I realized that maybe a database isn't the best idea for that, but it's the only way I can think of. Anyone who wants to give me another option is more then welcome to do so! -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] --Email and Googletalk/Jabber IM ID. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Question about development
On Feb 12, 2008, at 2:09 PM, Aleksandar Vojnovic wrote: Could you explain this a little better - ...into using a database[1] for storing the pages and using browser sniffing to find out what language preference they currently had selected to display in that language? Aleksandar I'll try my best to :) I have heard from people (Haven't done it my self) that it is possible and reliable, to use the browsers language setting which gets transmitted in one of the headers (Not sure which one off hand) to initially select the language for the site from your database. IE: If you speak english, and have english selected as your browser language preference, it will send that to the server, when your script sees it, it's a fairly good assumption that that would be the preferred language to display in, so the server pushes up the english version of the site. Obviously, you need to have the actual translated files stored on your server to choose from. And, you should always give them away of overriding the guessed option, just in case they really don't want to use what it appears like they do :) Does that explain it better? -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Question about development
Jason Pruim [EMAIL PROTECTED] wrote: On Feb 12, 2008, at 1:03 PM, Nathan Rixham wrote: Jason Pruim wrote: Hi Everyone, I know this isn't 100% on topic... But when is any post to this list 100% on topic? :) I've been doing some googling trying to find info on how to plan for what a website needs. Stuff like Does it need a forum, live support, database driven etc. etc. Does anyone have a form that they use to give to the client asking them to outline some ideas that they have about the website? What I'm looking for is something that I could give to a potential client and ask them to describe some basic aspects of their target audience, a rough idea of what they want it to look like, or at least other sites that they like. Stuff like that.. Even if you don't have such a form, I'm sure you all have standard questions you ask each client before giving a quote :) Anyone want to share with the class? If there is interest, I may even put it together on a webpage to help future people :) -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] I always take the simple approach, ask them what they want to achieve/expect from the website. Then verbally work backwards with them to figure out what the website needs in order to reach the clients goal. (personally) In all honesty I'd stay away from any kind of form, as they'll just pick nice to have boxes and end up with something overpriced, not suited to there needs and you'll get complaints in 6 months time. hope that makes sense! ps: the only thing I've found useful that way after many years, is to make the base site structure with very short text descriptions on each page + links to the next page | and for god sake, leave the home page will very very last! Nathan Hey Nathan, Thanks for the reply. I'm just getting more and more into freelance web work and have my first client asking for a quote. Before now, it's all been internal applications, and the companies website that I have worked on. Nothing for other people. I was actually thinking that the form would be for me to make sure I covered the basics... I'm alot better if I have something written down and I can ask the client Do you need to support multiple languages? Which to me then, would lead me into using a database[1] for storing the pages and using browser sniffing to find out what language preference they currently had selected to display in that language :) [1] As I was typing this I realized that maybe a database isn't the best idea for that, but it's the only way I can think of. Anyone who wants to give me another option is more then welcome to do so! -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] --Email and Googletalk/Jabber IM ID. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I generally ask people what they are looking to do with the site. Are they just wanting to have an image out there, do they want a contact form, do they want to sell something, do they really care to translate it (blowfish), Then I go into how much $$$ do they want to spend, do they want to update it themselves, how they have worked on it in the past, etc. Generally that alone gives me a good base point. But I'm scatter-brained enough that I just write things down as we talk and that leads me to more questions to ask them. :) Wolf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Question about development
Could you explain this a little better - ...into using a database[1] for storing the pages and using browser sniffing to find out what language preference they currently had selected to display in that language? Aleksandar Quoting Jason Pruim [EMAIL PROTECTED]: On Feb 12, 2008, at 1:03 PM, Nathan Rixham wrote: Jason Pruim wrote: Hi Everyone, I know this isn't 100% on topic... But when is any post to this list 100% on topic? :) I've been doing some googling trying to find info on how to plan for what a website needs. Stuff like Does it need a forum, live support, database driven etc. etc. Does anyone have a form that they use to give to the client asking them to outline some ideas that they have about the website? What I'm looking for is something that I could give to a potential client and ask them to describe some basic aspects of their target audience, a rough idea of what they want it to look like, or at least other sites that they like. Stuff like that.. Even if you don't have such a form, I'm sure you all have standard questions you ask each client before giving a quote :) Anyone want to share with the class? If there is interest, I may even put it together on a webpage to help future people :) -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] I always take the simple approach, ask them what they want to achieve/expect from the website. Then verbally work backwards with them to figure out what the website needs in order to reach the clients goal. (personally) In all honesty I'd stay away from any kind of form, as they'll just pick nice to have boxes and end up with something overpriced, not suited to there needs and you'll get complaints in 6 months time. hope that makes sense! ps: the only thing I've found useful that way after many years, is to make the base site structure with very short text descriptions on each page + links to the next page | and for god sake, leave the home page will very very last! Nathan Hey Nathan, Thanks for the reply. I'm just getting more and more into freelance web work and have my first client asking for a quote. Before now, it's all been internal applications, and the companies website that I have worked on. Nothing for other people. I was actually thinking that the form would be for me to make sure I covered the basics... I'm alot better if I have something written down and I can ask the client Do you need to support multiple languages? Which to me then, would lead me into using a database[1] for storing the pages and using browser sniffing to find out what language preference they currently had selected to display in that language :) [1] As I was typing this I realized that maybe a database isn't the best idea for that, but it's the only way I can think of. Anyone who wants to give me another option is more then welcome to do so! -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] --Email and Googletalk/Jabber IM ID. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Question about development
On Feb 12, 2008, at 1:03 PM, Nathan Rixham wrote: Jason Pruim wrote: Hi Everyone, I know this isn't 100% on topic... But when is any post to this list 100% on topic? :) I've been doing some googling trying to find info on how to plan for what a website needs. Stuff like Does it need a forum, live support, database driven etc. etc. Does anyone have a form that they use to give to the client asking them to outline some ideas that they have about the website? What I'm looking for is something that I could give to a potential client and ask them to describe some basic aspects of their target audience, a rough idea of what they want it to look like, or at least other sites that they like. Stuff like that.. Even if you don't have such a form, I'm sure you all have standard questions you ask each client before giving a quote :) Anyone want to share with the class? If there is interest, I may even put it together on a webpage to help future people :) -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] I always take the simple approach, ask them what they want to achieve/expect from the website. Then verbally work backwards with them to figure out what the website needs in order to reach the clients goal. (personally) In all honesty I'd stay away from any kind of form, as they'll just pick nice to have boxes and end up with something overpriced, not suited to there needs and you'll get complaints in 6 months time. hope that makes sense! ps: the only thing I've found useful that way after many years, is to make the base site structure with very short text descriptions on each page + links to the next page | and for god sake, leave the home page will very very last! Nathan Hey Nathan, Thanks for the reply. I'm just getting more and more into freelance web work and have my first client asking for a quote. Before now, it's all been internal applications, and the companies website that I have worked on. Nothing for other people. I was actually thinking that the form would be for me to make sure I covered the basics... I'm alot better if I have something written down and I can ask the client Do you need to support multiple languages? Which to me then, would lead me into using a database[1] for storing the pages and using browser sniffing to find out what language preference they currently had selected to display in that language :) [1] As I was typing this I realized that maybe a database isn't the best idea for that, but it's the only way I can think of. Anyone who wants to give me another option is more then welcome to do so! -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] --Email and Googletalk/Jabber IM ID. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Question about development
Jason Pruim wrote: Hi Everyone, I know this isn't 100% on topic... But when is any post to this list 100% on topic? :) I've been doing some googling trying to find info on how to plan for what a website needs. Stuff like Does it need a forum, live support, database driven etc. etc. Does anyone have a form that they use to give to the client asking them to outline some ideas that they have about the website? What I'm looking for is something that I could give to a potential client and ask them to describe some basic aspects of their target audience, a rough idea of what they want it to look like, or at least other sites that they like. Stuff like that.. Even if you don't have such a form, I'm sure you all have standard questions you ask each client before giving a quote :) Anyone want to share with the class? If there is interest, I may even put it together on a webpage to help future people :) -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] I always take the simple approach, ask them what they want to achieve/expect from the website. Then verbally work backwards with them to figure out what the website needs in order to reach the clients goal. (personally) In all honesty I'd stay away from any kind of form, as they'll just pick nice to have boxes and end up with something overpriced, not suited to there needs and you'll get complaints in 6 months time. hope that makes sense! ps: the only thing I've found useful that way after many years, is to make the base site structure with very short text descriptions on each page + links to the next page | and for god sake, leave the home page will very very last! Nathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
I don't suggest the use of a template system unless you do need something as complex as XSLT. PHP itself works very well for templating. Just write your code so that the UI code is sepperate from the logic and everything is neat and tidy without adding a layer of complexity. If you want a really clean interface then break out your logic into a service that is connected with your UI layer by XML-RPC, SOAP, or whatever you're comfortable with. At least that extra complexity benefits by making scaling easier and making alternate interfaces easier. -- Michael McGlothlin Southwest Plumbing Supply smime.p7s Description: S/MIME Cryptographic Signature
Re: [PHP] Re: Question about development
On Feb 12, 2008 2:53 PM, Nathan Rixham [EMAIL PROTECTED] wrote: Browsers generally send the the HTTP_ACCEPT_LANGUAGE header in a request. $_SERVER[HTTP_ACCEPT_LANGUAGE] = en-gb,en;q=0.5 thus with mine, preference is en-gb, failing that anything en; failing that whatever you've got. ACCEPT_CHARSET is worth a check often aswell; finally POST requests can also have a CONTENT_LANGUAGE specified which describes the lang of the content. Yes, but as has been said in the past, you can't rely on browser headers, because they can easily be forged. ;-P I can see it now That'll mess with them. Now they'll think I'm Mexican! -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Question about development
Jason Pruim wrote: On Feb 12, 2008, at 2:09 PM, Aleksandar Vojnovic wrote: Could you explain this a little better - ...into using a database[1] for storing the pages and using browser sniffing to find out what language preference they currently had selected to display in that language? Aleksandar I'll try my best to :) I have heard from people (Haven't done it my self) that it is possible and reliable, to use the browsers language setting which gets transmitted in one of the headers (Not sure which one off hand) to initially select the language for the site from your database. IE: If you speak english, and have english selected as your browser language preference, it will send that to the server, when your script sees it, it's a fairly good assumption that that would be the preferred language to display in, so the server pushes up the english version of the site. Obviously, you need to have the actual translated files stored on your server to choose from. And, you should always give them away of overriding the guessed option, just in case they really don't want to use what it appears like they do :) Does that explain it better? -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] Browsers generally send the the HTTP_ACCEPT_LANGUAGE header in a request. $_SERVER[HTTP_ACCEPT_LANGUAGE] = en-gb,en;q=0.5 thus with mine, preference is en-gb, failing that anything en; failing that whatever you've got. ACCEPT_CHARSET is worth a check often aswell; finally POST requests can also have a CONTENT_LANGUAGE specified which describes the lang of the content. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
Ditto on Eval() PHP is already a templating system. Why go the long way around? On Feb 12, 2008 10:13 AM, Greg Donald [EMAIL PROTECTED] wrote: On 2/12/08, Xavier de Lapeyre [EMAIL PROTECTED] wrote: Do any of you guys gurls know of a way to implement that template system. eval() is my favorite templating engine. http://php.net/eval -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Question about development
On Tue, February 12, 2008 3:32 pm, Jason Pruim wrote: On Feb 12, 2008, at 4:24 PM, Daniel Brown wrote: On Feb 12, 2008 2:53 PM, Nathan Rixham [EMAIL PROTECTED] wrote: Browsers generally send the the HTTP_ACCEPT_LANGUAGE header in a request. $_SERVER[HTTP_ACCEPT_LANGUAGE] = en-gb,en;q=0.5 thus with mine, preference is en-gb, failing that anything en; failing that whatever you've got. ACCEPT_CHARSET is worth a check often aswell; finally POST requests can also have a CONTENT_LANGUAGE specified which describes the lang of the content. Yes, but as has been said in the past, you can't rely on browser headers, because they can easily be forged. ;-P I can see it now That'll mess with them. Now they'll think I'm Mexican! Which goes back to giving them an easy way of changing the display language :P If someone intentionally messes with the language headers they deserve to get a language they may or may not know! :P I was at an internet cafe in Paris once. Despite having a French keyboard layout and a browser sending fr as my preferred language, my French language skills were no better than when I walked in... :-) -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
On 2/12/08, Xavier de Lapeyre [EMAIL PROTECTED] wrote: Do any of you guys gurls know of a way to implement that template system. eval() is my favorite templating engine. http://php.net/eval -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question about development
Hi Everyone, I know this isn't 100% on topic... But when is any post to this list 100% on topic? :) I've been doing some googling trying to find info on how to plan for what a website needs. Stuff like Does it need a forum, live support, database driven etc. etc. Does anyone have a form that they use to give to the client asking them to outline some ideas that they have about the website? What I'm looking for is something that I could give to a potential client and ask them to describe some basic aspects of their target audience, a rough idea of what they want it to look like, or at least other sites that they like. Stuff like that.. Even if you don't have such a form, I'm sure you all have standard questions you ask each client before giving a quote :) Anyone want to share with the class? If there is interest, I may even put it together on a webpage to help future people :) -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: memcached (was: session and Multi Server Architecture)
Stut wrote: There's no question of locking users to particular machines, nor of uneven distribution. LVS will distribute evenly or according to weights. Indeed, but you must see that making the decision of which server to use per request will result in a more even distribution than deciding once per session. You might see a somewhat uneven distribution if you only have a small number of machines, but the resources you're saving by not having memcached replicate objects will now be available for that slightly less even distribution. I'm not sure what you mean by replicate objects. My mistake - I though I'd understood that memcached would replicate objects across the servers, but that's clearly wrong. If I've got it right, virtually every access to a cached object will require network traffic? (the exception being those cases where your object is on your local memcached). I've very likely overlooked something or other, but overall memcached seems to me to be unnecessarily complicated when the same problem can be solved with session persistency (even if you have to accept a slightly uneven load at times). /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session and Multi Server Architecture
Stut wrote: There's no question of locking users to particular machines, nor of uneven distribution. LVS will distribute evenly or according to weights. Indeed, but you must see that making the decision of which server to use per request will result in a more even distribution than deciding once per session. You might see a somewhat uneven distribution if you only have a small number of machines, but the resources you're saving by not having memcached replicate objects will now be available for that slightly less even distribution. Having said that I don't see a problem with depending on a particular piece of software as a dependency of the application. Your app already requires PHP, and most likely requires a bunch of extensions to be present so I don't see a major problem in adding memcache to that list, especially if it means you can use it much more efficiently by assuming it's available. My personal choice would be not to have my application deal directly with caching, but that's mostly a matter of choice. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session and Multi Server Architecture
Per Jessen wrote: Stut wrote: Of course, processing power, network capacity and memory are all very cheap these days, so it's easy to put on the Microsoft hat and be wasteful. In my mind you're exchanging traffic over a local network (probably 1Gbps) for a less resilient load balancing system. By locking users to particular machines you don't allow for the possibility that you'll end up with a large number of users on any given server while others lie idle. There's no question of locking users to particular machines, nor of uneven distribution. LVS will distribute evenly or according to weights. Indeed, but you must see that making the decision of which server to use per request will result in a more even distribution than deciding once per session. Personally I'd always opt for a solution where my hardware will be utilised as evenly as possible regardless of user patterns. Certainly. I'll be using memcache as a simple cache. I hate sessions and avoid them for anything but the most trivial sites. The main sites I work with no longer use sessions because they add a pointless layer of complexity to any application that need to scale beyond a single machine. Well, we have no problem using sessions on our web-cluster (with LVS session persistency). Good for you. Do you write your apps specifically for use with memcached? I did think of that, but I thought people would prefer not have their apps tied directly to memcached. I guess it's a matter of choice. No, but that's purely a result of the way I approach any programming problem. I try to deal in layers of abstraction at every level. Coincidentally I'm modifying my cache layer today to support memcache as a backend option since the current file-based backend is experiencing scalability problems due to recent traffic increases. Since the app is purposefully layered and modular I don't need to touch anything other than this layer. Having said that I don't see a problem with depending on a particular piece of software as a dependency of the application. Your app already requires PHP, and most likely requires a bunch of extensions to be present so I don't see a major problem in adding memcache to that list, especially if it means you can use it much more efficiently by assuming it's available. Since I'm just replacing a file-based cache with memcache I'm certain it won't be as efficient as it would be if I dove into the rest of the code and changed it to use memcache directly. For a start I'd be able to make use of requesting multiple keys at once which is not going to be possible with the way it works at the moment, but it will get past the scalability limits currently being tapped. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: LVS (was: Session and Multi Server Architecture)
On Feb 12, 2008 10:55 AM, Per Jessen [EMAIL PROTECTED] wrote: Nathan Nobbe wrote: i mean, i do understand the vserver concept, is LVS essentially the same as v-server, http://linux-vserver.org/Welcome_to_Linux-VServer.org ? Hi Nathan, they're two very different things. The VServer project makes multiple servers out of one, LVS makes multiple physical servers appear as one. With LVS you can basically have e.g. 50 physical boxes accessed as if they were just one big server. also, i dont understand how LVS is used to implement a 'persistent' session. allow me to explain my disconnect.. so you are using virtual servers on a real system; what benefit, in the context of sessions does this provide over a single machine w/ 1 os? another fundamental disconnect is, how are you using these machines to store session state, a network filesystem? Each physical server will store session information locally, probably on a local filesystem. Depending on your needs you could have a distributed filesystem or a DRDB setup, but you'd have other reason for having those. also, in terms of scalability, isnt facebook proof that memcache can scale? I'd misunderstood how memcached works, hence my misguided comment about it's lack of scalability. /Per Jessen, Zürich excellent! thanks for your response, now i am at least an enlightened newb :D -nathan
[PHP] Re: LVS (was: Session and Multi Server Architecture)
Nathan Nobbe wrote: i mean, i do understand the vserver concept, is LVS essentially the same as v-server, http://linux-vserver.org/Welcome_to_Linux-VServer.org ? Hi Nathan, they're two very different things. The VServer project makes multiple servers out of one, LVS makes multiple physical servers appear as one. With LVS you can basically have e.g. 50 physical boxes accessed as if they were just one big server. also, i dont understand how LVS is used to implement a 'persistent' session. allow me to explain my disconnect.. so you are using virtual servers on a real system; what benefit, in the context of sessions does this provide over a single machine w/ 1 os? another fundamental disconnect is, how are you using these machines to store session state, a network filesystem? Each physical server will store session information locally, probably on a local filesystem. Depending on your needs you could have a distributed filesystem or a DRDB setup, but you'd have other reason for having those. also, in terms of scalability, isnt facebook proof that memcache can scale? I'd misunderstood how memcached works, hence my misguided comment about it's lack of scalability. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session and Multi Server Architecture
On Tuesday 12 February 2008 16:06:04 Stut wrote: Sancar Saran wrote: Hello On Tuesday 12 February 2008 13:39:19 Stut wrote: I'll be using memcache as a simple cache. I hate sessions and avoid them for anything but the most trivial sites. The main sites I work with no longer use sessions because they add a pointless layer of complexity to any application that need to scale beyond a single machine. Maybe I'm just lucky that the applications I develop don't need to store huge amounts of temporary data during a visit, but I'm yet to come across a reason to use session data. -Stut May I ask how can you record the state ? You may. Oh, you probably want an actual answer... ok. The only 'state' I really need to keep track of is a few details about the logged in user (ID, username, etc). These get encrypted and get passed around as a single value in the same way PHP manages the session ID (cookie or embedded in the URL). The encrypted value is time limited and gets updated on each request. Clearly there is a limit to how much info can be stored like this but after some analysis of how the site worked I reached the conclusion that most of the crap that was being put into the session was not required from request to request and could be retrieved from the DB when it was needed. This has been running on a site with 1 million unique users a month for over 6 months with no issues. I now use this system with most sites I get involved in and am yet to find a valid reason to replace it with a traditional session. Part of the reason this works is that in the few parts of the site where it would make sense to use a traditional session to temporarily store data it does it in a table in the database. This is essentially a SQL-based session but with one important difference... DB hits are limited when they are needed only - i.e. when the user is using those parts of the site. With a SQL-based session you cause 2+ DB hits for each request even if you don't actually use the session. This is bad m'kay! Over the past few years I've learnt a lot about scalability and the single biggest tip I can pass on is to only do what is absolutely necessary at any given time. Sessions are the biggest barrier to being able to do that, so they had to go. Hope that answers your question. -Stut Yes Thanks much :) Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session and Multi Server Architecture
Per Jessen wrote: Stut wrote: There's no question of locking users to particular machines, nor of uneven distribution. LVS will distribute evenly or according to weights. Indeed, but you must see that making the decision of which server to use per request will result in a more even distribution than deciding once per session. You might see a somewhat uneven distribution if you only have a small number of machines, but the resources you're saving by not having memcached replicate objects will now be available for that slightly less even distribution. I'm not sure what you mean by replicate objects. Having said that I don't see a problem with depending on a particular piece of software as a dependency of the application. Your app already requires PHP, and most likely requires a bunch of extensions to be present so I don't see a major problem in adding memcache to that list, especially if it means you can use it much more efficiently by assuming it's available. My personal choice would be not to have my application deal directly with caching, but that's mostly a matter of choice. Abstraction is great but where scalability is needed it can prove to be horribly inefficient, but as you say it's a matter of choice. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session and Multi Server Architecture
Stut wrote: Of course, processing power, network capacity and memory are all very cheap these days, so it's easy to put on the Microsoft hat and be wasteful. In my mind you're exchanging traffic over a local network (probably 1Gbps) for a less resilient load balancing system. By locking users to particular machines you don't allow for the possibility that you'll end up with a large number of users on any given server while others lie idle. There's no question of locking users to particular machines, nor of uneven distribution. LVS will distribute evenly or according to weights. Personally I'd always opt for a solution where my hardware will be utilised as evenly as possible regardless of user patterns. Certainly. I'll be using memcache as a simple cache. I hate sessions and avoid them for anything but the most trivial sites. The main sites I work with no longer use sessions because they add a pointless layer of complexity to any application that need to scale beyond a single machine. Well, we have no problem using sessions on our web-cluster (with LVS session persistency). Do you write your apps specifically for use with memcached? I did think of that, but I thought people would prefer not have their apps tied directly to memcached. I guess it's a matter of choice. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session and Multi Server Architecture
Hello For poor man's multinode, ADODB offers Sql based sessions, it was good enough for starters. Of course memcached based session storage was an option. But with this model need better implementation. Memcached was just cache, there was no offical way to backup data. (as far as I know) Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session and Multi Server Architecture
Hello On Tuesday 12 February 2008 13:39:19 Stut wrote: I'll be using memcache as a simple cache. I hate sessions and avoid them for anything but the most trivial sites. The main sites I work with no longer use sessions because they add a pointless layer of complexity to any application that need to scale beyond a single machine. Maybe I'm just lucky that the applications I develop don't need to store huge amounts of temporary data during a visit, but I'm yet to come across a reason to use session data. -Stut May I ask how can you record the state ? Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session and Multi Server Architecture
On Tuesday 12 February 2008 00:45:59 Michael McGlothlin wrote: implement session_set_save_handler() with a database, or ideally, memcache. I use memcache with a secondary db backing. Works pretty well. I use it for session data as well as any other uses I want to make of memcache. Memcache makes it fast and using the db makes it more persistent and able to handle larger chunks of data. -- Michael McGlothlin Southwest Plumbing Supply Hello I really really interesting about this SECONDARY DB BACKING. Could you lead me a document, article, ANYTHING to backing up memcached into anything ? Last time it when I was try it, it was huge disaster. Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
Xavier de Lapeyre schreef: Hi, I need to develop a website, but my management is rather unstable in his vision for the layout. I'm thinking of developing the components as classes and functions, and then use a template system to render the layout. If the management wishes to change the layout, I'll just have to modify my template and the jobs' done. Do any of you guys gurls know of a way to implement that template system. (The best one I know of is that of Wordpress) you can do better. don't bother to create your own template system, using something that already exists. there are plenty of 'php template engines' out there. one of the most well known is Smarty (http://smarty.net/) which is a good one to start with, they have quite extensive docs and a decent mailing list (things which I feel are worth taking into consideration beyond the purely technical pros and cons when deciding which one to use). googling for php+template+engine will get you a stack of possible candidates. also consider that the way you write your HTML heavily influences how much you have to change when management decides on a visual change. if you go the route of writing very functional HTML (i.e. HTML that makes next to no attempt to provide layout/styling) and use CSS as much as possible to provide the actually layout/design then you might consider not bothering with a template and just using CSS to implement UI design changes. to get an idea of exactly how different a single page of HTML can look depending on the CSS that is applied take a look at csszengarden Regards, Xavier de Lapeyre Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template system in PHP
another vote here for smarty - it's pretty much standard issue nowadays and means should the need ever arise you can easily bring in a web designer to do the html without having to worry about them learning some new system. Nathan clive wrote: Xavier de Lapeyre wrote: Do any of you guys gurls know of a way to implement that template system. Smarty ? (The best one I know of is that of Wordpress) Regards, Xavier de Lapeyre Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session and Multi Server Architecture
Per Jessen wrote: Stut wrote: Per Jessen wrote: mike wrote: Check out persistency in LVS for instance: http://www.linuxvirtualserver.org/docs/persistence.html i know persistence handling is an option in LVS, but i haven't seen the need to use it. i use LVS right now without even bothering with any of that. Because you've chosen another option - memcached presumably - which is more expensive over all. (IMHO). Based on what? I'm currently looking at replacing a file-based cache with memcached and I'm interested in all justified opinions. You might not have much use for mine then :-) If I compare plain session-persistency (session being a client to server relationship, not $_SESSION) with memcacheds copying objects around across many machines, common sense tells me that the latter will use a lot more resources. Both on the network and on each machine. With memcached, and 1000 clients for a cluster of 50 machines, each using up 1Mb of $_SESSION space, that is 1000Mb per machine, 50Gb in total. With session-persistency, you have 50 machines with 1000/50 clients each, making 20Mb per machine. And virtually no session-related inter-machine network traffic. And your machines are not busy with keeping 980 objects needlessly up-to-date. Of course, processing power, network capacity and memory are all very cheap these days, so it's easy to put on the Microsoft hat and be wasteful. In my mind you're exchanging traffic over a local network (probably 1Gbps) for a less resilient load balancing system. By locking users to particular machines you don't allow for the possibility that you'll end up with a large number of users on any given server while others lie idle. Personally I'd always opt for a solution where my hardware will be utilised as evenly as possible regardless of user patterns. On the next request, LVS will know not to try that server, and the user will move to another one. Obviously the session-context will die, but is that really a big deal? How often does one of your servers die? Sure, if you've got 10,000 in a cluster, you'll have fans and harddisks pop every so often, but I have my doubts about memcached scaling to that level (please correct me if I'm wrong here, I have _no_ experience with memcached). Facebook. Digg. LiveJournal. That enough scalability proof for ya? If not there are plenty more where those came from. It wasn't really the scalability I was interested in here, but I'd be interested to hear some numbers if you have any. Mike posted a link to a thread that discusses Facebook usage. I don't have any other numbers handy but I'm sure Google can find some for you if needed. My point with the 10,000 machines was - with that many components, even the 100,000 hours MTBF of a regular harddisk will mean one will break every ten hours (statistically speaking). Add fan- and other failures to that, and you'll have sessions dying quite frequently. Which _could_ be a significant problem, and maybe enough to make you want to use memcached for object replication. (there might also be a restriction in the number of concurrent clients handled by LVS session persistency). However, with a much smaller cluster, say 50 or 100 machines, hardware failures will be a lot less frequent, and having the odd session die once a week might not be a problem. Which is why I think LVS session persistency is perfectly fine. Which is why memcache should never be the definitive source for any data. Memcache is volatile storage, that's a fact you can't get away from. If you're using it to store session data then you either accept that sessions might die at any time or you back it up with storage in something more persistent. I'll be using memcache as a simple cache. I hate sessions and avoid them for anything but the most trivial sites. The main sites I work with no longer use sessions because they add a pointless layer of complexity to any application that need to scale beyond a single machine. Maybe I'm just lucky that the applications I develop don't need to store huge amounts of temporary data during a visit, but I'm yet to come across a reason to use session data. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 5.2.5 installation
On Feb 12, 2008 9:55 AM, Yoshika Kehelpannala [EMAIL PROTECTED] wrote: I have downloaded and setup the Apachi web server and My SQL 5.0.51a prior to my PHP installation on the windows platform. As I have downloaded the PHP 5.2.5 version (msi) and installed it on my system, it gave some errors that says a lot of dll's and sort of files are missing. I checked how to install it on your site and found only the basic 5.xx is documented. Please help me on this. I have had the same problem. I figured I was stupid and forgot something (I'm used to pkg_add php5, not Windows installers). My sollution was to install WAMP server (http://www.wampserver.com/), lazy and effective. Floor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: memcached (was: session and Multi Server Architecture)
mike wrote: To me it isn't a memcached vs. session persistency debate. memcached to me is a cache layer for anything - if I wanted to use it for sessions, it's an added bonus (I'd probably make sure to use 3.0.0+ so I could ensure the data is in more than one server, losing people's session data is a crappy user experience :)) Cache layers are cheap - it's a known science after all. The key thing (AFAICT) about memcached is that is _distributed_. You need this when you don't have session persistency (session being the client-to-server relationship). /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session and Multi Server Architecture
Sancar Saran wrote: Hello On Tuesday 12 February 2008 13:39:19 Stut wrote: I'll be using memcache as a simple cache. I hate sessions and avoid them for anything but the most trivial sites. The main sites I work with no longer use sessions because they add a pointless layer of complexity to any application that need to scale beyond a single machine. Maybe I'm just lucky that the applications I develop don't need to store huge amounts of temporary data during a visit, but I'm yet to come across a reason to use session data. -Stut May I ask how can you record the state ? You may. Oh, you probably want an actual answer... ok. The only 'state' I really need to keep track of is a few details about the logged in user (ID, username, etc). These get encrypted and get passed around as a single value in the same way PHP manages the session ID (cookie or embedded in the URL). The encrypted value is time limited and gets updated on each request. Clearly there is a limit to how much info can be stored like this but after some analysis of how the site worked I reached the conclusion that most of the crap that was being put into the session was not required from request to request and could be retrieved from the DB when it was needed. This has been running on a site with 1 million unique users a month for over 6 months with no issues. I now use this system with most sites I get involved in and am yet to find a valid reason to replace it with a traditional session. Part of the reason this works is that in the few parts of the site where it would make sense to use a traditional session to temporarily store data it does it in a table in the database. This is essentially a SQL-based session but with one important difference... DB hits are limited when they are needed only - i.e. when the user is using those parts of the site. With a SQL-based session you cause 2+ DB hits for each request even if you don't actually use the session. This is bad m'kay! Over the past few years I've learnt a lot about scalability and the single biggest tip I can pass on is to only do what is absolutely necessary at any given time. Sessions are the biggest barrier to being able to do that, so they had to go. Hope that answers your question. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Template system in PHP
smarty? bastien Date: Tue, 12 Feb 2008 14:01:11 +0400 From: [EMAIL PROTECTED] To: php-general@lists.php.net Subject: [PHP] Template system in PHP Hi, I need to develop a website, but my management is rather unstable in his vision for the layout. I'm thinking of developing the components as classes and functions, and then use a template system to render the layout. If the management wishes to change the layout, I'll just have to modify my template and the jobs' done. Do any of you guys gurls know of a way to implement that template system. (The best one I know of is that of Wordpress) Regards, Xavier de Lapeyre Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _
Re: [PHP] Session and Multi Server Architecture
well guys, im reading all this stuff about LVS and so forth, and i must admit, i really dont know the first thing about it. i mean, i do understand the vserver concept, is LVS essentially the same as v-server, http://linux-vserver.org/Welcome_to_Linux-VServer.org ? also, i dont understand how LVS is used to implement a 'persistent' session. allow me to explain my disconnect.. so you are using virtual servers on a real system; what benefit, in the context of sessions does this provide over a single machine w/ 1 os? another fundamental disconnect is, how are you using these machines to store session state, a network filesystem? also, in terms of scalability, isnt facebook proof that memcache can scale? thanks, -nathan
Re: [PHP] Template system in PHP
On 2/12/08, Greg Donald [EMAIL PROTECTED] wrote: REST is the new SOAP. Yaml is the new XML. I'm guessing this news just hasn't made it into any PHP frameworks yet. REST for the win. SOAP is best left for the bathtub. as far as templating engines go, a while back i wanted to see if i could find the best template engine to suit all my needs. what i wind up finding was 100's of PHP-based templating engines, a LOT of them related to each other in some way. what you wind up doing is learning a proprietary language that is basically mimicing the constructs of PHP... and in theory, PHP -is- a templating language already. so after lots of digging and reading, i've come to the conclusion that packages like wordpress have it best: just let people write PHP. the whole designers shouldn't have to learn PHP is bunk, because they'll have to learn Smarty, or XSL, or some other proprietary language. i would say though that as far as template languages go, XSL/XML seems to be a decent fit. although XSL can be annoying (and processor intensive), it's a perfect fit of data in XML that can be validated and a template in XSL that can be validated and has presentation logic, variables and is a standard (published by W3C) which is a lot farther than any of these other templating languages can go. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] DOMXML Warning
Hi, after enabling error reporting with E_ALL I am having this strange warning while loading a XML: Warning: DOMDocument::load() [function.DOMDocument-load]: Extra content at the end of the document in [...] The code I use is: $dom = new DOMDocument(); $dom-load(http://example.com/file.xml;); [...] If I open the xml uri (with firefox) I get a complete and well formed xml (nothing strange about it). With error reporting disabled everything works fine so I am puzzled :-( Any help will be appreciated. --- .-. | Miguel J. Jiménez | | Sector Público, ISOTROL S.A.| | [EMAIL PROTECTED] | :-: | KeyID 0xFFE63EC6 hkp://pgp.rediris.es:11371 | :-: | Edificio BLUENET, Avda. Isaac Newton nº3, 4ª planta.| | Parque Tecnológico Cartuja '93, 41092 Sevilla (ESP).| | Tlfn: +34 955 036 800 (ext.1805) - Fax: +34 955 036 849 | | http://www.isotrol.com | :-: | UTM ED-50 X:765205.09 Y:4144614.91 Huso: 29 | :-: | Oh no, Number One. I'm sure most will be much more | | interesting. Let's see what's out there. Engage. | | Capt. Jean-Luc Picard | |Star Trek TNG (1x01, Encounter At Farpoint) | '-' signature.asc Description: PGP signature
Re: [PHP] Re: memcached (was: session and Multi Server Architecture)
On 2/12/08, Per Jessen [EMAIL PROTECTED] wrote: Cache layers are cheap - it's a known science after all. The key thing (AFAICT) about memcached is that is _distributed_. You need this when you don't have session persistency (session being the client-to-server relationship). correct. local file caching, APC, etc... but that doesn't really help, since you'd be constantly throwing out data (acting as an LRU) and have one copy of the data on each server is wasteful... yes the thing that makes memcached the best is the distribution. it also makes it not a requirement for cache persistency (if there is such a concept...) not -just- sessions. session persistency to me is a concept from the 90's... memcached's distribution in action (20 servers) for example: 20 megs of data x 20 servers = 400 megs of data used total (local cache) 20 megs of data x memcache = 20 megs of data. 40 if you copied it twice (using pecl memcache) to alleviate cache stampedes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php