PHPDeveloper.org: Query7.com: Kohana 3.1 Wiki Tutorial

May 10, 2011

On the Query7.com blog today Logan shows you how to create a simple wiki with the help of the Kohana framework, a HMVC PHP5 framework that includes several tools (including UTF-8 suport and a cascading filesystem) to make a developer’s life easier.

In this tutorial you will learn how to create a simple wiki using the PHP framework Kohana version 3.1. Several years ago Siddharta Govindaraj created a screencast demonstrating how to create a wiki using Django, this is essentially the Kohana version of that. It covers using Kohana’s Routing, ORM and MVC systems. Full source code of the application is available on github.

You’ll need to be at least a bit familiar with the framework to follow along, but he takes it step-by-step to be sure things are easy to follow. He shows the configuration changes you’ll need to make to the boostrap and the database configuration. He shows you the creation of a model and the SQL to match as well as the routing change for the new addition. Views are next on the list, then the controller – all with full code included.

PHPDeveloper.org: DZone.com: A Mockery Review

May 10, 2011

On the Web Builder Zone (a part of DZone.com) there’s a recent post from Giorgio Sironi reviewing the Mockery library, a mock object framework created by Padraic Brady.

Mockery is a mock object framework (more properly Test Double framework) from @padraicb, independent from testing frameworks like PHPUnit. It can be used to quickly prepare Mocks, Stubs and other Test Doubles to use inside your unit tests. I’ve tried Mockery via a PEAR installation and I must say its expressive power is higher than that of PHPUnit mocking system. However, it may be too powerful for effective usage.

He talks about some of the features that are in Mockery that aren’t in PHPUnit like alternative expectations, recording of the expected calls and the mocking of non-existent methods. He notes that it can be too overwhelming at times, though, with so many features that may or may not be useful for the large majority of testers. He includes some sample code showing a set of five tests on a simple class implementing an interface.

PHPDeveloper.org: DZone.com: A Mockery Review

May 10, 2011

On the Web Builder Zone (a part of DZone.com) there’s a recent post from Giorgio Sironi reviewing the Mockery library, a mock object framework created by Padraic Brady.

Mockery is a mock object framework (more properly Test Double framework) from @padraicb, independent from testing frameworks like PHPUnit. It can be used to quickly prepare Mocks, Stubs and other Test Doubles to use inside your unit tests. I’ve tried Mockery via a PEAR installation and I must say its expressive power is higher than that of PHPUnit mocking system. However, it may be too powerful for effective usage.

He talks about some of the features that are in Mockery that aren’t in PHPUnit like alternative expectations, recording of the expected calls and the mocking of non-existent methods. He notes that it can be too overwhelming at times, though, with so many features that may or may not be useful for the large majority of testers. He includes some sample code showing a set of five tests on a simple class implementing an interface.

Thijs Lensselink has a new post to his blog today showing a step-by-step guide to setting up a vim editor environment to provide

May 10, 2011

Thijs Lensselink has a new post to his blog today showing a step-by-step guide to setting up a vim editor environment to provide

Servergrove: Email admin added to VPS control panel and more….

May 10, 2011

Servergrove: Email admin added to VPS control panel and more….

Servergrove: Email admin added to VPS control panel and more….

May 10, 2011

Servergrove: Email admin added to VPS control panel and more….

Servergrove: How to stop people from hotlinking your image files

May 9, 2011

When someone links directly to an asset on your server, say an image or even worse, a video file, the asset will appear on the another site but be hosted on your server. This method is called hotlinking or image leeching and, when done without permission, is nothing short of bandwidth theft since this uses your bandwidth and the other site gets credit for it. We recently had a case where a well known high-traffic blog hotlinked an entire image gallery from one of our clients. Of course our client, who was hosted on a Mini account blew his bandwidth allotment by a mile. Fortunately our server sent him a notification and when he contacted us we easily rectified the problem.

Here is how to prevent hotlinking, open your root .htaccess file and paste the following code:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?your-domain.com/.*$ [NC]
RewriteRule \.(gif|jpe?g|png|mov|avi|wmv|mpe?g)$ - [F]

Make sure to replace “your-domain.com” with your actual website domain. The above example will block images and movie files from being hotlinked. If someone hotlinks to your assets they will get a “image not found icon” on their page. If you want to allow a friendly URL to hotlink assets from your site, simply add the following code:

RewriteCond %{HTTP_REFERER} !^http://(www.)?friendlyURL.com/.*$ [NC]

And repeat the above code for every domain you wish to make an exception for.

Servergove: PHP Community conference wrapup

May 9, 2011

We were at the PHP Community conference last week and it was a lot of fun. First of all Nashville is a great city. Friendly people, lots of techies, good food & music. We had a good time. Oh yeah, the conference was good too.

Lorna Mitchell had a great talk about web services. It was particularly interesting to us because we are currently working on building our API into our hosting platform. She gave us a lot to think about and we might have to push the launch date back a bit to incorporate some of the ideas we got. Thanks Lorna.

Paul Reinheimer had an honest and inspiring talk about starting up his company. We enjoyed it and will probably be incorporating https://wonderproxy.com/ and/or http://whereisitup.com/ in some way or another into our products.

Day two opened well, Rasmus gave a very interesting talk about various things, but mostly performance. I liked it. It also ended well with the pecha kucha talks. Ryan Weaver had a very funny talk on writing terrible documentation. Not that developers need much prodding to write bad docs….

While in Nashville we also met with Jon Wage to talk about our new MongoDB hosting product. Things are coming along nicely, expect a beta soon! Can’t wait to release this product, it’s just amazing what’s getting done.

As always, it was good to see all our friends and clients again. We always get new ideas by talking to people and this conference was no exception. Our projects list grew daily as we continue to thrive to build the best ever hosting service for PHP applications.

Hope to see you next year!

Servergove: PHP Community conference wrapup

May 9, 2011

We were at the PHP Community conference last week and it was a lot of fun. First of all Nashville is a great city. Friendly people, lots of techies, good food & music. We had a good time. Oh yeah, the conference was good too.

Lorna Mitchell had a great talk about web services. It was particularly interesting to us because we are currently working on building our API into our hosting platform. She gave us a lot to think about and we might have to push the launch date back a bit to incorporate some of the ideas we got. Thanks Lorna.

Paul Reinheimer had an honest and inspiring talk about starting up his company. We enjoyed it and will probably be incorporating https://wonderproxy.com/ and/or http://whereisitup.com/ in some way or another into our products.

Day two opened well, Rasmus gave a very interesting talk about various things, but mostly performance. I liked it. It also ended well with the pecha kucha talks. Ryan Weaver had a very funny talk on writing terrible documentation. Not that developers need much prodding to write bad docs….

While in Nashville we also met with Jon Wage to talk about our new MongoDB hosting product. Things are coming along nicely, expect a beta soon! Can’t wait to release this product, it’s just amazing what’s getting done.

As always, it was good to see all our friends and clients again. We always get new ideas by talking to people and this conference was no exception. Our projects list grew daily as we continue to thrive to build the best ever hosting service for PHP applications.

Hope to see you next year!

Servergrove: How to stop people from hotlinking your image files

May 9, 2011

When someone links directly to an asset on your server, say an image or even worse, a video file, the asset will appear on the another site but be hosted on your server. This method is called hotlinking or image leeching and, when done without permission, is nothing short of bandwidth theft since this uses your bandwidth and the other site gets credit for it. We recently had a case where a well known high-traffic blog hotlinked an entire image gallery from one of our clients. Of course our client, who was hosted on a Mini account blew his bandwidth allotment by a mile. Fortunately our server sent him a notification and when he contacted us we easily rectified the problem.

Here is how to prevent hotlinking, open your root .htaccess file and paste the following code:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?your-domain.com/.*$ [NC]
RewriteRule \.(gif|jpe?g|png|mov|avi|wmv|mpe?g)$ - [F]

Make sure to replace “your-domain.com” with your actual website domain. The above example will block images and movie files from being hotlinked. If someone hotlinks to your assets they will get a “image not found icon” on their page. If you want to allow a friendly URL to hotlink assets from your site, simply add the following code:

RewriteCond %{HTTP_REFERER} !^http://(www.)?friendlyURL.com/.*$ [NC]

And repeat the above code for every domain you wish to make an exception for.


Follow

Get every new post delivered to your Inbox.