From tony_white at twdesigns.com Mon Jul 8 22:00:47 2013 From: tony_white at twdesigns.com (Tony White) Date: Mon Jul 8 20:56:56 2013 Subject: [FX.php List] Patterns of Enterprise Application Architecture on sale for 3 more hours Message-ID: Hi All, Patterns of Enterprise Application Architecture - on sale for 3 more hours https://www.informit.com/deals/ Good read (IMO) and relevant to the whole framework conversation. All the best, Tony White Tony White Designs, Inc. Tel: 646-714-2797 (Google Voice) Tel: 718-797-4175 tony_white@twdesigns.com http://www.twdesigns.com From tony_white at twdesigns.com Sun Jul 14 20:07:52 2013 From: tony_white at twdesigns.com (Tony White) Date: Sun Jul 14 19:03:40 2013 Subject: [FX.php List] [OFF] Someting to show at DevCon CWP User Group? -> web frameworks In-Reply-To: <6F9055A8-E060-40E7-8C09-CA0C8950AD49@gmail.com> Message-ID: Hi Dales, thanks for the thoughtful answer. Please see in-line replies below... On 6/20/13 3:04 PM, "Dale Bengston" wrote: > Okay, Tony. I'll bite on frameworks. > > Yes, frameworks often take more steps to do something like create a simple > form. Sometimes. But there are payoffs that make it well worth the effort of > learning that new way of doing it. I use the Cake framework, and the first > time I coded a form it was utterly alien and incredibly frustrating to get it > working. But the upside is Cake builds in all sorts of security features to > protect against SQL injection and cross-site submits. (I won't try to explain > how they do it; Cake's documentation can do a far better job.) I have been reading the docs for 4 of the well know frameworks, 3 in the PHP world and 1 in the ruby world (RoR) to learn from the collective thinking of many. I thought this page was an interesting overview on security issues: http://guides.rubyonrails.org/security.html > I'll freely admit that this was really difficult for me, after writing my own > PHP code for ten years. But once I got past the frustration and learned enough > to be a functional coder again, I will never look back. I am completely freed > up from the menial work of hard-coding paginated search results, sortable > tables, form validation, AJAX calls, jQuery functions to bind clicks, on and > on. I can focus on the things that my clients are really looking to me for, > like overall usability. Lots of pros for sure. > An added benefit of learning a framework like Cake is it's forced me to > completely understand and embrace MVC. An ancillary benefit is that every > action on a site is contained, and there is very little risk of something > breaking somewhere else when I do code modifications. Are running PHPUnit or something like it? > But the big issue for me, and the reason I will never go back to my own > self-written framework, is security. There is just no way a solo coder like me > can even stay on top of security threats, let alone address them all. But a > group of highly-motivated experts contributing to an open-source project like > Cake can do it. I choose to stand on the shoulders of these giants. This was an interesting podcast episode that talked about an exploit of a vulnerability that was discovered in Rails. http://rubyrogues.com/093-rr-security-exploits-with-patrick-mckenzie/ [begin excerpt] Since late December, there?s been a number of very, very critical issues found on Ruby on Rails. The largely stemmed to one root cause which is de-serializing YAML, which Rails uses a lot internally, is insecure. You?re probably familiar with the YAML from database.yml where you have your production and test and development settings for your databases. But it turns out that Rail uses the same format to de-serialize other things like JSON in some instances. And YAML is a very powerful language, it lets you de-serialize into arbitrary Ruby objects. [end excerpt] It is interesting to me how a framework can sometimes lose track of the magic, slip up and leave an opening. Ruby on Rails (RoR) was quickly patched. Still there is food for thought in that episode. > Yes, it's a struggle as an experienced coder to learn someone else's methods > and conventions. But in the long run, it's worth the struggle to reap the > benefits of a well-written, well-maintained framework. I agree that there are time where using a framework is the best choice. > I hope that helped, Yes, thanks. Tony > Dale > > PS I am not a Cake zealot; it is what I use but there may be other frameworks > that are more suited to your projects. > > > On Jun 20, 2013, at 11:02 AM, Tony White wrote: > >> [FX.php List] [OFF] Someting to show at DevCon CWP User Group? -> web >> frameworks >> Hi All, >> >> First off, I should say that on the topic of web frameworks, I have more >> questions than answers. >> >> That said, I have been researching web frameworks both in the PHP world and >> in the Ruby world and have some thoughts on the matter. >> >> I have to confess a bias...I prefer to code as ?close to the metal? as I can >> for any given environment. I want the shortest path from point A to point B, >> unless there is an advantage to inserting more hops along the way. >> >> There are lots of blog posts (many of which I?ve read) that talk about the >> advantages of using a framework versus not using a framework. >> >> There are also many blog posts on the web comparing procedural PHP to >> object-oriented PHP. >> >> There is also a lot of documentation about how different frameworks work. I >> have read through much of the documentation for CodeIgniter and ZEND. >> >>> From Joel Shapiro a while ago: >> http://www.phpframeworks.com/ >> >> Having said all that...I?m currently of the opinion that it is sometimes >> correct to use a web framework and sometime correct to avoid using a web >> framework. >> >> Likewise it is sometimes correct to use object-oriented PHP and sometimes >> best to use procedural PHP. >> >> Any given choice should be guided by pros and cons and how they affect a >> particular situation. >> >> I?ll start off by making the assertion that the web frameworks have greater >> complexity. This complexity must be balanced by benefits in order to justify >> the cost. >> >> For an example of complexity, have a look at what?s involved using the ZEND >> framework to add form elements to a web form... >> >> http://framework.zend.com/manual/1.12/en/zend.form.standardDecorators.html >> >> ? and compare this to building a form manually: >> >> http://webcheatsheet.com/PHP/form_processing.php >> >> Most people would agree that it is more complicated to use a web framework >> for this task. >> >> This gets us to the question, ?what are the advantages to balance out this >> type of complexity?? >> >> The idea behind a web framework is that it solves a number of recurring >> problems that will (or might) come up in any given web project. Examples >> include: >> >> * Protection against cross site scripting attacks >> >> * The ability to implement unit testing (PHPUnit, RSpec, etc.) to protect >> against changes breaking code, for example on large projects with multiple >> team members. >> >> * Protection against web form spoofing. >> >> * Dynamic database query generation within an Object-relational mapping >> pattern >> https://en.wikipedia.org/wiki/Object-relational_mapping >> >> *** I wish I had a comprehensive list of all the things that a web framework >> gives you. Please feel free to add to this list. Additions appreciated. >> >> A web framework is a collection of code, some of which which will be useful >> for a given project and some of which will not. There might be advantages in >> deploying only the pieces of code that are needed for a given project and in >> the simplest possible way. >> >> For example, in the Ruby world, the 2 popular frameworks seem to be Ruby on >> Rails (RoR) and Sinatra. Ruby developers talk about using RoR in some cases >> and Sinatra in other cases where they don?t need the overhead of RoR. This >> method of starting with the amount of code that?s appropriate for a project >> seems like a good idea. There is also the question of how easy is it to >> modify a framework for those cases where you need to color outside the lines. >> >> The most important question seems to be what problems does a framework solve? >> If we can answer that question, it will help us make the best decision of >> when to use a framework and when to keep it simple. >> >> What do you all think? >> >> Thanks. >> >> All the best, >> >> >> Tony White >> Tony White Designs, Inc. >> Tel: 646-714-2797 (Google Voice) >> Tel: 718-797-4175 >> tony_white@twdesigns.com >> http://www.twdesigns.com >> _______________________________________________ >> FX.php_List mailing list >> FX.php_List@mail.iviking.org >> http://www.iviking.org/mailman/listinfo/fx.php_list > > > > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list From tony_white at twdesigns.com Sun Jul 14 20:23:07 2013 From: tony_white at twdesigns.com (Tony White) Date: Sun Jul 14 19:18:54 2013 Subject: [FX.php List] [OFF] Someting to show at DevCon CWP User Group? -> web frameworks In-Reply-To: Message-ID: Hi Joel, Please see in-line replies below... On 6/20/13 6:42 PM, "Joel Shapiro" wrote: > Hiya > > First - Tony (& Michael), you're in luck :-) We've got someone coming to the > group this year who's going to show us how he's using CodeIgniter w/ FM (FX > specifically, I believe) and talk about why he decided to make the effort to > learn it, and why he, like Dale, "will never go back". Cool. > Second - Steve: I think you make a really great point. I thought about that > kind of thing recently when a new client of mine wanted me to make a small > change on a site built by their previous FM/CWP devs. It turned out that the > site used both Smarty ("PHP Template Engine") & Dojo ("JavaScript toolkit"), > neither of which I knew. I was able to figure them out enough to make the > requested changes, but it really got me thinking about the line between a > developer's preferred tools & the client's best (long-term) interests. I am with you on the Smarty thought. Just because you call it Smarty does not mean that it is! Perhaps it should be called Slowy ;-) http://ellislab.com/codeigniter/user-guide/libraries/parser.html [begin excerpt] Note:?CodeIgniter does?not?require you to use this class since using pure PHP in your view pages lets them run a little faster. However, some developers prefer to use a template engine if they work with designers who they feel would find some confusion working with PHP. [end excerpt] Just my opinion at the moment. I could be missing something. > It may be more relevant for consultants than for in-house developers (since a > "house" can set their own tools & requirements), but I think it's a good thing > to think about when choosing what tools to use on a job. (For instance, I'm a > huge fan now of Sass and CSS pre-processing, but if a future developer on one > of my sites doesn't know or like Sass it'll be no problem because s/he could > just choose to edit the plain CSS files that get produced and totally ignore > everything Sass.) +1 Thanks. Tony > Best, > -Joel > > > On Jun 20, 2013, at 2:28 PM, Steven Thoms wrote: > >> So, it's clear frameworks are preferred here, and I use them, and largely >> agree. >> >> That said, I often choose to write procedural code for a simple reason; more >> people can pick it up, read through it and solve a problem. When I have a >> small client, with a limited budget, I think the kindest, long term solution >> is to write a neat, well-commented procedural experience. This gives them >> many more options in future, after I'm gone. If the code is well commented, I >> believe a novice can often go in, take a peak and maybe avoid spending a >> bunch of money hiring a big gun with big tools. >> >> Security often overrides this calculus, but I wanted to inject the simplicity >> point for discussion. >> >> - Steve >> >> On Jun 20, 2013, at 12:02 PM, Tony White wrote: >> >>> Hi All, >>> >>> First off, I should say that on the topic of web frameworks, I have more >>> questions than answers. >>> >>> That said, I have been researching web frameworks both in the PHP world and >>> in the Ruby world and have some thoughts on the matter. >>> >>> I have to confess a bias...I prefer to code as ?close to the metal? as I can >>> for any given environment. I want the shortest path from point A to point B, >>> unless there is an advantage to inserting more hops along the way. >>> >>> There are lots of blog posts (many of which I?ve read) that talk about the >>> advantages of using a framework versus not using a framework. >>> >>> There are also many blog posts on the web comparing procedural PHP to >>> object-oriented PHP. >>> >>> There is also a lot of documentation about how different frameworks work. I >>> have read through much of the documentation for CodeIgniter and ZEND. >>> >>>> From Joel Shapiro a while ago: >>> http://www.phpframeworks.com/ >>> >>> Having said all that...I?m currently of the opinion that it is sometimes >>> correct to use a web framework and sometime correct to avoid using a web >>> framework. >>> >>> Likewise it is sometimes correct to use object-oriented PHP and sometimes >>> best to use procedural PHP. >>> >>> Any given choice should be guided by pros and cons and how they affect a >>> particular situation. >>> >>> I?ll start off by making the assertion that the web frameworks have greater >>> complexity. This complexity must be balanced by benefits in order to justify >>> the cost. >>> >>> For an example of complexity, have a look at what?s involved using the ZEND >>> framework to add form elements to a web form... >>> >>> http://framework.zend.com/manual/1.12/en/zend.form.standardDecorators.html >>> >>> ? and compare this to building a form manually: >>> >>> http://webcheatsheet.com/PHP/form_processing.php >>> >>> Most people would agree that it is more complicated to use a web framework >>> for this task. >>> >>> This gets us to the question, ?what are the advantages to balance out this >>> type of complexity?? >>> >>> The idea behind a web framework is that it solves a number of recurring >>> problems that will (or might) come up in any given web project. Examples >>> include: >>> >>> * Protection against cross site scripting attacks >>> >>> * The ability to implement unit testing (PHPUnit, RSpec, etc.) to protect >>> against changes breaking code, for example on large projects with multiple >>> team members. >>> >>> * Protection against web form spoofing. >>> >>> * Dynamic database query generation within an Object-relational mapping >>> pattern >>> https://en.wikipedia.org/wiki/Object-relational_mapping >>> >>> *** I wish I had a comprehensive list of all the things that a web framework >>> gives you. Please feel free to add to this list. Additions appreciated. >>> >>> A web framework is a collection of code, some of which which will be useful >>> for a given project and some of which will not. There might be advantages in >>> deploying only the pieces of code that are needed for a given project and in >>> the simplest possible way. >>> >>> For example, in the Ruby world, the 2 popular frameworks seem to be Ruby on >>> Rails (RoR) and Sinatra. Ruby developers talk about using RoR in some cases >>> and Sinatra in other cases where they don?t need the overhead of RoR. This >>> method of starting with the amount of code that?s appropriate for a project >>> seems like a good idea. There is also the question of how easy is it to >>> modify a framework for those cases where you need to color outside the >>> lines. >>> >>> The most important question seems to be what problems does a framework >>> solve? If we can answer that question, it will help us make the best >>> decision of when to use a framework and when to keep it simple. >>> >>> What do you all think? >>> >>> Thanks. >>> >>> All the best, >>> >>> >>> Tony White >>> Tony White Designs, Inc. >>> Tel: 646-714-2797 (Google Voice) >>> Tel: 718-797-4175 >>> tony_white@twdesigns.com >>> http://www.twdesigns.com >>> _______________________________________________ >>> FX.php_List mailing list >>> FX.php_List@mail.iviking.org >>> http://www.iviking.org/mailman/listinfo/fx.php_list >> >> _______________________________________________ >> FX.php_List mailing list >> FX.php_List@mail.iviking.org >> http://www.iviking.org/mailman/listinfo/fx.php_list > > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list > From dsomar at gmail.com Wed Jul 31 15:27:36 2013 From: dsomar at gmail.com (Denis Somar) Date: Wed Jul 31 14:22:31 2013 Subject: [FX.php List] Catching a FM11 DB nonresponsive Message-ID: I keep having my FM 11 DB server host go down and want to catch the error before doing all the PHP of my app, whats the best way to handle that error exception? Anyone have any code samples? From dale.bengston at gmail.com Wed Jul 31 16:04:29 2013 From: dale.bengston at gmail.com (Dale Bengston) Date: Wed Jul 31 14:59:06 2013 Subject: [FX.php List] Catching a FM11 DB nonresponsive In-Reply-To: References: Message-ID: <25506F5E-0890-44D8-A993-EA1C830BC65C@gmail.com> Hi Denis, Is the Web Publishing Engine going down, or FileMaker Server? Dale On Jul 31, 2013, at 5:27 PM, Denis Somar wrote: > I keep having my FM 11 DB server host go down and want to catch the > error before doing all the PHP of my app, whats the best way to handle > that error exception? Anyone have any code samples? > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list From dsomar at gmail.com Wed Jul 31 17:39:12 2013 From: dsomar at gmail.com (Denis Somar) Date: Wed Jul 31 16:33:48 2013 Subject: [FX.php List] Catching a FM11 DB nonresponsive In-Reply-To: <25506F5E-0890-44D8-A993-EA1C830BC65C@gmail.com> References: <25506F5E-0890-44D8-A993-EA1C830BC65C@gmail.com> Message-ID: <121643AA-488C-4BF0-BF37-7F9E282ABE45@gmail.com> I believe the WPE On Jul 31, 2013, at 6:04 PM, Dale Bengston wrote: > Hi Denis, > > Is the Web Publishing Engine going down, or FileMaker Server? > > Dale > > On Jul 31, 2013, at 5:27 PM, Denis Somar wrote: > >> I keep having my FM 11 DB server host go down and want to catch the >> error before doing all the PHP of my app, whats the best way to handle >> that error exception? Anyone have any code samples? >> _______________________________________________ >> FX.php_List mailing list >> FX.php_List@mail.iviking.org >> http://www.iviking.org/mailman/listinfo/fx.php_list > > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list From tim.webko at gmail.com Wed Jul 31 18:39:45 2013 From: tim.webko at gmail.com (Tim 'Webko' Booth) Date: Wed Jul 31 17:34:19 2013 Subject: [FX.php List] Catching a FM11 DB nonresponsive In-Reply-To: <121643AA-488C-4BF0-BF37-7F9E282ABE45@gmail.com> References: <25506F5E-0890-44D8-A993-EA1C830BC65C@gmail.com> <121643AA-488C-4BF0-BF37-7F9E282ABE45@gmail.com> Message-ID: I'd run a simple check to see if anything is available, and redirect based on that. My server test file looks like: setDBPassword($dbPass,$dbUser); $pageObj -> setDBData($dbName, $layout, 'all'); $pageData = $pageObj -> FMFindAny(); $_SESSION['serverError'] = $pageData['errorCode']; } if ($_SESSION['serverError'] != "0") { echo "Error: ".$_SESSION['serverError']; } ?> On 1 August 2013 09:39, Denis Somar wrote: > I believe the WPE > > On Jul 31, 2013, at 6:04 PM, Dale Bengston > wrote: > > > Hi Denis, > > > > Is the Web Publishing Engine going down, or FileMaker Server? > > > > Dale > > > > On Jul 31, 2013, at 5:27 PM, Denis Somar wrote: > > > >> I keep having my FM 11 DB server host go down and want to catch the > >> error before doing all the PHP of my app, whats the best way to handle > >> that error exception? Anyone have any code samples? > >> _______________________________________________ > >> FX.php_List mailing list > >> FX.php_List@mail.iviking.org > >> http://www.iviking.org/mailman/listinfo/fx.php_list > > > > _______________________________________________ > > FX.php_List mailing list > > FX.php_List@mail.iviking.org > > http://www.iviking.org/mailman/listinfo/fx.php_list > _______________________________________________ > FX.php_List mailing list > FX.php_List@mail.iviking.org > http://www.iviking.org/mailman/listinfo/fx.php_list > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20130801/8736d7a3/attachment.html