News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Sameer Borate's Blog:
Splitting large MySQL dump files
October 03, 2011 @ 08:44:43

In a new post to his blog Sameer Borate includes a handy bit of code you can use to split up a large MySQL dump file into smaller, easier to digest chunks.

One of the frustrating things with working with MySQL is of importing large sql dump files. Either you get a 'max execution time exceeded' error from PHP or a 'Max_allowed_packet_size' from MySQL. In a recent task I needed to import a table of around a million records on a remote host, which quickly became an exercise in frustration due to various limitations on the server. SSH was of no help as changing the configuration files was restricted to the root user. My last resort was to split the huge 'INSERT' statements into smaller size files.

His script needs a little extra time to run (he sets max execute to 600 seconds) and takes the SQL file in line by line, splitting them back out to over files based on a "count" value - "dump-split-*". Depending on the size of your files, using something like this might not be an option. You might need something more like the command line "split" feature to keep it outside of PHP's memory management all together.

0 comments voice your opinion now!
mysql sql dump file split unix multiple tutorial


Symfony Blog:
Getting help on symfony1 or Symfony2
June 24, 2011 @ 09:02:02

On the Symfony blog Fabien Potencier has a new post talking about a change in the support structure for developers wanting to get help with either Symfony1 or Symfony2 - a split in the mailing list to help make things a bit easier to split out.

Now that Symfony2 is just around the corner, we need to better organize community support for both symfony1 and Symfony2. As more people start using Symfony2, the user mailing-list is becoming more and more difficult to follow. [...] After an opinionated discussion on the mailing-list, I've decided to create two new mailing-lists that are replacing the current users mailing-list: one for symfony1 and another one for Symfony2. The current mailing-list has been switched to the archive mode; all messages will remain browseable and searchable but new messages will be rejected.

If you're a current member of the "users" mailing list and want a similar experience, you'll need to subscribe to both. Otherwise, pick the one you like and watch your inbox fill up. This break up makes it easier for people to find messages specifically related to their version of choice without having to look for the "[Symfony2]" tag in the subject line.

0 comments voice your opinion now!
symfony1 symfony2 framework mailing list split users


Artur Ejsmont's Blog:
HTTP response splitting and mail headers splitting attacks
November 15, 2010 @ 10:57:16

In a recent post to his blog Artur Ejsmont looks at an attack that could potentially leave a hole open in your PHP-based application for a cross-site scripting (XSS) attack - HTTP response splitting (mail headers too).

There are two similar security issues both taken care of by Suhosin patch and strict escaping/encoding rules. They both relate to injecting new lines into headers of network protocols. They are not very well known and i think its worth mentioning it. HTTP response splitting is a web based attack where hacker manages to trick the server into injecting new lines into response headers along with arbitrary code. If you use GET/POST parameters in the headers like cookie or location, then someone could provide new lines with XSS attack.

He gives some examples of how it might work via the header function so that superglobals might be abused (like adding information on the URL to inject into $_GET). To prevent the attack, you just have to ensure that no special characters make it into the headers or cookies. He also mentions that the Suhosin patch takes care of the issue automatically.

2 comments voice your opinion now!
http response header split example attack


Project:
PHPScenario - A Free Split Testing Library for PHP
November 03, 2010 @ 13:13:12

If you've ever wanted to do any split testing in your PHP-based application (show one group one thing, a different group another - gather statistics), you might want to check out a newly released tool from James Sylvanus called PHPScenario.

I recently wrote up a bunch of split testing code for an application of mine (listy.us) and decided to round out the code, smooth the edges, and make it available under a BSD license. The result is phpScenario (http://www.phpscenario.org), a free object-oriented split testing library for PHP 5.2+. I basically designed the library to be something you could just drop into a project, particularly a Zend Framework project, in a matter of minutes and be good to go. There are posts in the forums that provide very detailed setup instructions. At its very simplest, the library provides one-line A/B testing, and is fairly extensible. I think it'd make a great addition to designer/developer toolboxes.

Right now it's in its early beta stages, but it has plenty of (generated) documentation to help you out. There's also a basic example of its use and results on the main site. You can download it directly if you'd like to try it out.

0 comments voice your opinion now!
project phpscenario split test library


NETTUTS.com:
An Introduction to Split Testing in WordPress
August 18, 2010 @ 12:56:55

On NETTUTS.com today there's a new tutorial showing you how to create a split testing environment in your WordPress installation with the help of the Google Website Optimizer plugin.

Split testing is a way to experiment with a live site and find which headlines and text are the most effective. Amazon uses split testing to determine which versions of their site convert customers better. We'll use WordPress and Google's Website Optimizer to test two different headlines, and find which works best at capturing customer emails.

They walk you through their six step process to help you create the pages for testing, install the Google plugin and use the Web Optimizer tool to keep track of the results of your testing.

0 comments voice your opinion now!
wordpress split testing google website optimizer


SitePoint PHP Blog:
How to Split WordPress Content Into Two or More Columns
February 05, 2010 @ 12:58:00

On the SitePoint PHP blog there's a recent post from Craig Buckler showing how to split up your WordPress content into two or more columns quickly and easily.

WordPress is a great CMS, but implementing some features within your theme can require a little lateral thinking. The content for your page or post is usually output by the theme code using a single function call. But what if you need to split the content into two or more blocks? That might be necessary if your theme requires multiple columns or sections on the page.

There's a built in call WordPress includes, "get_the_content", that returns the content rather than just echoing it out. With this handy function giving you just the content, you're free to split up the content however you want - on certain tags or as they suggest, using the "more..." tag and a few modifications to a few other scripts to split it out into DIV blocks.

0 comments voice your opinion now!
wordpress content tutorial split column


Matthew Turland's Blog:
Splitting PHP Class Files
January 25, 2010 @ 13:23:56

Matthew Turland, in trying to solve a problem from work, needed a way to split out some code into two files to simplify and make it easier to use them individually.

The issue I ran into was due to all the generated PHP classes being housed in a single file. I had to process two WSDL files that had several identical user-defined types in common. As a result, I couldn't simply include the two PHP files generated from them because PHP doesn't allow you to define two classes with the same name.

He used the tokenizer extension to create a simple command-line script that did the splitting for him. This script could potentially be used for splitting out other kinds of files too - "unpacking" them from their combined state. You can download the latest version from Matthew's github account.

0 comments voice your opinion now!
tutorial split class file wsdl


Francois Zaninotto's Blog:
Introducing Code Usability
May 05, 2009 @ 13:48:19

Francois Zaninotto has a recent post looking at something every developer should consider when creating their applications - especially the libraries that might be used by other developers: code usability.

Usability guidelines can sometimes be of use in awkward places. I try to apply them to source code. [...] Of course, coding guidelines are there to make the code easy to read by everyone. But code usability goes somehow beyond. Let's see some of the differences.

He compares good versus bad code in a few different areas:

  • Bad Code Comments
  • Split Up Code
  • Cleanliness
  • New Conventions
  • Listen To User Feedback

Each item is described, some including code examples to help make them more clear. Be sure to check out the comments for more good suggestions.

0 comments voice your opinion now!
usability comments split clean convention user feedback


Alex Netkachov's Blog:
BAT file tips
June 06, 2008 @ 07:58:08

Alex Netkachov has updated a post he made a while back (in 2006 in fact) about making Windows batch files (.BAT) that would do the same thing as some of the functions in PHP. He's added two more to it today - one for string replace and another for splitting a string.

The replace is as simple three line call, much the same as PHP's and the split call, while a bit more complex, is still pretty straight forward (it just needs a few extra variables).

Other methods in the post include a "switch" method, defining a procedure and updating variable by its name.

0 comments voice your opinion now!
bat file tip string replace split function port


Ken Guest's Blog:
The Date_Holidays package, a pack of splitters and a pear tree
May 09, 2008 @ 12:56:39

In a new post to his blog today, Ken Guest talks about the split that's been made in a PEAR package for calculating the dates of holidays (Date_Holidays) for localization reasons.

We decided that this one package should be split into subpackages: one subpackage per region/country. Some advantages of this approach are that each driver / filter / subpackage gets it's own stability and version number - we wouldn't have to keep increasing the version number of Date_Holidays each time a new driver is added or when an existing driver gets a significant number of fixes.

To replace your current version of the package (with all of the regions built in) with a new version that still contains all versions, uninstall the Date_Holidays and grab the "Date_Holidays#all" package. Otherwise, you can check out the PEAR page for the main package and see the subpackage list if you only need one for your area.

0 comments voice your opinion now!
dateholidays pear package split regional filter driver subpackage



Community Events





Don't see your event here?
Let us know!


list update opinion series laravel tips install release library deployment package symfony zendserver framework api podcast community language interview introduction

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework