 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Joshua Thijssen's Blog: Setting up a development environment
by Chris Cornutt February 06, 2012 @ 09:27:41
In a new post to his blog Joshua Thijssen gives a guide to how he usually sets up his development environments when working in PHP. It includes working with virtual machines, configuring DNS and setting up his tools to work with it all.
Doing development on multiple projects can be a burden from time to time. One project would be running on PHP 5.3, while another still needs 5.1. Sometimes you need a MySQL server, while on other occasions, you need a NoSQL solution like couchDB or MongoDB together with all kind of gearman functionality. This article shows you how I've setup such a development platform that allows you to quickly create new projects, and still maintain flexibility when you need it.
He uses VirtualBox with either a Debian or CentOS installation as a base platform. He uses Vagrant to set up and configure the machines to make setup almost automatic. He still has to go in and configure a few things like the VirtualHost and DNS settings for the site/application he's working on.
Next up is setting up the tools he uses, specifically XDebug and setting up his editor of choice (PHPStorm) for remote debugging.
voice your opinion now!
development environment virtualbox debian centos mysql vagrant xdebug phpstorm dns virtualhost
PHPMaster.com: Writing Custom Session Handlers
by Chris Cornutt December 29, 2011 @ 09:41:25
On PHPMaster.com today there's a new post showing you how to write custom session handlers - in their case, a database-based option that can span across multiple servers/services.
Sessions are a tool which helps the web programmer overcome the stateless nature of the internet. You can use them to build shopping carts, monitor visits to a website, and even track how a user navigates through your application. PHP's default session handling behavior can provide all you need in most cases, but there may be times when you want to expand the functionality and store session data differently. This article will show you how the default functionality works and then goes on to show you how override it to provide a custom solution.
They introduce how sessions are stored normally (based on the save path) and what the serialized contents of it would look like. They show you how to take this, normally stored on the local file system, and change it to be written to a "session" table in a MySQL database (via PDO). It includes reading, writing, updating and some garbage collection to clean out old values from the table.
voice your opinion now!
custom session handler tutorial mysql database pdo
DevArticles.com: Singletons in PHP
by Chris Cornutt December 06, 2011 @ 10:17:33
On DevArticles.com today there's a new tutorial posted talking about one of the more popular design patterns, the Singleton, and how it can be implemented in PHP.
Though in the past they enjoyed both popularity and a certain amount of prestige, without a doubt Singletons have progressively become one of the most evil and despicable villains in object-oriented design. Singletons earned their bad reputation for a reason: bringing them to life requires the programmer to deal at least with a static method. This is simply an elegant masquerade for creating a global access point (which in most cases is mutable as well) throughout an entire application. And we all know that global, mutable access is unquestionably a bad thing that must be avoided at all costs.
In this first part (of two) of the series they introduce the Singleton pattern and show how, via an example of using a database adapter interface to work with a MySQL database, in a tightly coupled example.
In the second part of the series, they'll show how to break these apart using dependency injection.
voice your opinion now!
singleton designpattern dependencyinjection di mysql database adapter interface
Community News: Zagreb PHP User Group December 2011 Meeting - 13th @ 6pm
by Chris Cornutt November 30, 2011 @ 08:29:30
Miro has submitted some information about the latest meeting of the Zagreb PHP User Group happening December 13th at 6pm in the Multimedia Institute:
Although Zagreb PHP Meetup started only 3 months ago with monthly meetups (up to 30 developers coming), our next meeting will be first meetup with organized talks. December meetup will have 5 talks with themes like 'How to write readable code?', 'Flex & PHP development' , 'Introduction to test driven development' && 'MySQL - explain explained'.
We would like to invite all interested PHP and non-PHP developers that would like to listen to some of best Croatian PHP devs (and understand Croatian language) to come on December 13th from 6PM to Mama, Preradoviceva 18 in Zagreb. Unfortunately we are limited with number of available seats so please signup at http://zgphp.eventbrite.com/.
Due to space limitations, there's only 12 seats available so hurry and reserve your spot if you'd like to attend (it's free)!
Have a user group meeting you'd like announced? Let us know!
voice your opinion now!
zagreb usergroup meeting ttd flex mysql explain december
NetTuts.com: How to Generate a Complete Excel Spreadsheet From MySQL
by Chris Cornutt November 23, 2011 @ 17:52:54
On NetTuts there's a new tutorial showing how to take data from a MySQL database and translate it into a usable Excel file with the help of some simple PHP.
A CSV (Comma Separated Value) file is usually sufficient for exporting MySQL data as an Excel Spreadsheet. These CSV files are data only though. A real Excel spreadsheet has formatting, formulas and perhaps even graphics - the difference between a simple method of data transfer and a professional report. This tutorial shows how to use open source PHP components to create "real" Excel spreadsheets from MySQL SELECT statements.
With the help of the PHPExcel tool, making Excel-formatted files is a simple process. They show how to label columns, pull data out with a "quick and dirty" SQL statement, formatting the results to something a bit more clean and iterate through the pages of data to push them into the spreadsheet (including formulas). You can download the full source to get everything in one shot.
voice your opinion now!
excel spreadsheet tutorial phpexcel mysql database
Johannes Schlüter's Blog: High Performance PHP Session Storage on Scale
by Chris Cornutt November 18, 2011 @ 10:13:25
In this new post to his blog, Johannes Schlüter looks at a high-performance solution to the usual storing PHP session information via a memcache frontend with a MySQL Cluster backend.
Unfortunately even such a system [using MySQL and InnoDB tables] has limits and unfortunately replication is no good solution here to scale further as we will always need a master for writing the updated session data. By using replication we can take some load from it and we can configure a slave which can be promoted to master to keep session alive if the primary master machine fails but at some point in time we need another solution ... but, happy news, again: One doesn't have to look far as MySQL cluster will be happy to help. MySQL Cluster "is a high-availability, high-redundancy version of MySQL adapted for the distributed computing environment," as the MySQL documentation states.
He describes the setup (after pointing to this post about installing MySQL Cluster for memcache) and includes some sample code/SQL/ini settings you'll need to use to get PHP's memcached functionality to cooperate with it.
voice your opinion now!
performance session storage mysql cluster memcache frontend backend
DevShed: Building an ORM in PHP
by Chris Cornutt November 18, 2011 @ 09:45:15
On DevShed today there's a new tutorial showing you how to build a basic ORM layer on top of a MySQL database. It includes all the code you'll need (cut&paste-able, not as a download).
Obviously, with so many ORMs at one's disposal for free, it seems pretty pointless to develop a custom one; are we trying to reinvent the wheel? No, of course not. But if you need to create a simple application that performs a few CRUD operations on some related domain objects and don't want to climb the learning curve of a third-party library, then implementing a custom ORM might make sense. There's alos the educational aspect of the process (yes, learning one or two things never hurts).
They start you off with the creation of the "data persistence layer" (an interface first) to connect to the database, building a MySQL-specific one on top of it. Next up is the data mapper layer making things like "fetch by ID" and the insert/update/delete possible. Their simple example doesn't include anything about ORM relationships, though - just fetching simple rows.
voice your opinion now!
orm tutorial mysql mapper fetch database
|
Community Events
Don't see your event here? Let us know!
|