Development

joho.se @ stockholm.sweden

Check out

Work2Go
WebbPlatsen Webbhotell
avgantivirus.se
junkfood.se
s9y.se
My iStockPhotos

Ads by Google

Top Exits

en.wikipedia.org (231)
www.sevenforums.com (30)
www.joho.se (27)
www.pseudocoder.com (27)
www.homrighausen.com (19)
Locations of visitors to this page

Feed me

Blog Administration

Coding, building, tweaking

Thursday, March 18. 2010

Free CakePHP E-Book - Super Awesome Advanced CakePHP Tips

Development There are a few books out for CakePHP development. The main problem with them is that they're fairly old. There's also a book on the way (2010) that has not yet been released. And then there's Matt Curry's completely free CakePHP book for those that have managed to grasp the basics of CakePHP and want a guide to somewhat more advanced topics.

One can only congratulate Matt on a great idea and implementation; and what's not to like about a free book about CakePHP development?

An introduction to the book here: www.pseudocoder.com/free-cakephp-book/
Matt Curry's original blog post about it here: www.pseudocoder.com/archives/2009/05/13/free-cakephp-e-book-super-awesome-advanced-cakephp-tips/
The book's direct download link is here: www.pseudocoder.com/Super_Awesome_Advanced_CakePHP_Tips.pdf

More about CakePHP can of course be found on www.cakephp.org

Matt has also released a number of CakePHP plugins and code snippets here github.com/mcurry.


Thanks Matt!
Posted by joho in Development at 09:54 | Comments (0) | Trackbacks (0)
Vote for articles fresher than 7 days!
Current karma: 2, 1 vote(s) 938 hits
Bookmark Free CakePHP E-Book - Super Awesome Advanced CakePHP Tips  at del.icio.us Digg Free CakePHP E-Book - Super Awesome Advanced CakePHP Tips Bloglines Free CakePHP E-Book - Super Awesome Advanced CakePHP Tips Technorati Free CakePHP E-Book - Super Awesome Advanced CakePHP Tips Bookmark Free CakePHP E-Book - Super Awesome Advanced CakePHP Tips  at blogmarks Bookmark using any bookmark manager! Stumble It!
 

Thursday, April 30. 2009

Preventing access to backup PHP~ files in Apache

Development Many Linux command-line people use the VI editor; but if you're like me and prefer Emacs, you often run into the "problem" that Emacs creates backup files using the original filename and appending a tilde (~) to the end of the filename. E.g. "secret.conf.php" becomes "secret.conf.php~".

There are a number of ways to go around this, of course. One way is to configure a separate directory for each user where Emacs stores its backup files, and then make that directory readable only by the user.

Why is this a problem? Well, if you're using Emacs to quickly modify PHP applications' configuration files, like the database configuration file, you'll leave a trail of .php~ files. These files are typically not parsed by the PHP processor, instead they are handled by the text file handler in Apache. Meaning, if I enter the url http://myverycoolsite.com/secret.conf.php~, Apache will gladly display its actual contents, just like if you were editing the file.

This can be prevented by using the .. configuration construct in Apache like so:
<Files ~ "\.(html\~|htmls\~|php\~|phps\~|php3\~|php4\~)$">
  Order allow,deny
  Deny from all
</Files>

Perhaps not the most elegant of solutions, but it works. It will result in an "Forbidden" response from Apache. Check out the Apache documentation for more details on this directive.

You can go back to sleep now :-)
Posted by joho in Development at 10:00 | Comment (1) | Trackbacks (0)
Vote for articles fresher than 7 days!
Current karma: 2, 1 vote(s) 5154 hits
Bookmark Preventing access to backup PHP~ files in Apache  at del.icio.us Digg Preventing access to backup PHP~ files in Apache Bloglines Preventing access to backup PHP~ files in Apache Technorati Preventing access to backup PHP~ files in Apache Bookmark Preventing access to backup PHP~ files in Apache  at blogmarks Bookmark using any bookmark manager! Stumble It!
 

Friday, January 30. 2009

Nullifying pointers in PHP

Development Using pointers in PHP is quite useful at times; but it can also leave you dumbstruck with serious debugging on your hands. Consider this construct:

CODE:
for ($i = 0; $i < 10; $i++)     {     $p1 = null;     if ($Buffer [$i]['type'] == 'scanthis'])         {         $p1 =& $Buffer [$i]['data'];         }     ..     if ($p1 != null)         ..      }//for

This will in effect dereference and overwrite a given ['data'] array member of $Buffer if ['scanthis'] evaluates to true. But I still want to use "null" as an indicator to whether or not to do something.

So I replace the above with:

CODE:
for ($i = 0; $i < 10; $i++)     {     unset ($p1);  <--     $p1 = null;     if ($Buffer [$i]['type'] == 'scanthis'])         {         $p1 =& $Buffer [$i]['data'];         }     ..     if ($p1 != null)         ..      }//for

This will destroy $p1, but not what it's pointing to, and then it sets $p1 to null, just like before.

This is obvious when you look at it, and there are a number of other ways to accomplish what I describe above, but it had me stumped for a while :-)
Posted by joho in Development at 11:07 | Comments (0) | Trackbacks (0)
Vote for articles fresher than 7 days!
Current karma: 0, 0 vote(s) 839 hits
Bookmark Nullifying pointers in PHP  at del.icio.us Digg Nullifying pointers in PHP Bloglines Nullifying pointers in PHP Technorati Nullifying pointers in PHP Bookmark Nullifying pointers in PHP  at blogmarks Bookmark using any bookmark manager! Stumble It!
 

Saturday, April 7. 2007

Delphi for PHP

Development So Borland (or CodeGear) finally realized the web was a place where old Delphi developers may hang around on, and decided to release Delphi for PHP (!). I haven't looked at the product myself, other than screenshots, but it sounds like someone at Borland or CodeGear got their flashbulb working a bit too late. Had this product been out a few years ago, it might have been an interesting package. As an IDE and framework platform, it may still have some merit, in particular for "quick and dirty" needs. And, I suppose, for someone who has spent a lot of time working with Delphi/Kylix and want to publish "generic PHP apps" without having to learn too many new things in order to do so, Delphi for PHP may be a good solution.

Having worked with Turbo Pascal since version 2.x (yes, I'm that old), and then Borland Pascal, Object Pascal, Delphi, Turbo C/C++, Borland C/C++, I would probably have been interested in Delphi for PHP, five years ago. But I'd say it takes a lot more than a revamped Delphi interface sporting PHP code, to get people with tools like ZDE and all the available PHP frameworks, to switch their development environment.

TASM anyone? Or perhaps Microsoft will now release MASM for PHP. Another hotseller might be Sidekick for the Web! :-)

I wish CodeGear the best of luck, and I hope this will bring forth even more competent PHP developers.

Other related links:
  Delphi Wiki: http://delphi.wikia.com
  Slashdot: Delphi for PHP released
  CodeGear: Delphi for PHP
  First impressions: Tim Anderson’s ITWriting
  Other impressions: The Joel on Software Discussion Group
  InfoWorld: CodeGear extends Delphi for PHP, Vista, AJAX
  Professional PHP: Delphi for PHP
Posted by joho in Development at 21:20 | Comments (0) | Trackbacks (0)
Vote for articles fresher than 7 days!
Current karma: 0, 0 vote(s) 2080 hits
Bookmark Delphi for PHP  at del.icio.us Digg Delphi for PHP Bloglines Delphi for PHP Technorati Delphi for PHP Bookmark Delphi for PHP  at blogmarks Bookmark using any bookmark manager! Stumble It!
 

Thursday, March 1. 2007

SwiftMailer 3

Development "Swift is a fully OOP Library for sending e-mails from PHP websites and applications. It does not rely on PHP's native mail() function which is known for using high server resources when sending multiple emails. Instead, Swift communicates directly with an SMTP server or a MTA binary to send mail quickly and efficiently.

Early versions of Swift were comparable to PHPMailer. Swift has since evolved and matured into a fully-fledged object-oriented mailing solution. Compared with PHPMailer, the interface for Swift is both tighter and more intuitive."


So describes Chris Corbyn his Swift or SwiftMailer project for PHP. I've been using it since version 2.x and can happily recommend it to any serious PHP developer out there (in stating this, I'm by no means claiming to be a serious PHP developer of course :-). Chris provides for both PHP4 and PHP5 compliant packages.

SwiftMailer is more than just a replacement for PHPmailer, XpertMailer, and other similar packages. Version three sports a much more flexible plugin architecture.

Do you PHP? Do it Swiftly.

You'll find SwiftMailer on www.swiftmailer.org.
Posted by joho in Development at 19:58 | Comments (0) | Trackbacks (0)
Vote for articles fresher than 7 days!
Current karma: 0, 14 vote(s) 1421 hits
Bookmark SwiftMailer 3  at del.icio.us Digg SwiftMailer 3 Bloglines SwiftMailer 3 Technorati SwiftMailer 3 Bookmark SwiftMailer 3  at blogmarks Bookmark using any bookmark manager! Stumble It!