News Feed
Jobs Feed
Sections




News Archive
feed this:

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

Emanuele Minotto:
PHP in a Tweet
September 14, 2012 @ 10:19:09

Emanuele Minotto has a recent post with a set of "PHP in a tweet" posts that do all sorts of things.

Yesterday an ex colleague tweeted something that captured my attention, so I started thinking to a Twitter-powered code golfing competition. Looking for other examples.

Tweets included in the list are snippets like:

  • A dependency injection container
  • A super simple web framework
  • A microframework
  • Bypassing array_intersect

There's some game rules included in the post so you can contribute your own to the the comments. Several have already been added including a base64 encoding variant and getting the extension of a file.

0 comments voice your opinion now!
tweet size code twitter framework dic


Ilia Alshanetsky's Blog:
PHP's Output Buffering
December 08, 2011 @ 10:01:15

In a new post to his blog Ilia Alshanetsky takes a look at PHP's output buffering feature and some interesting things he found when testing some recent code (hint: it has to do with PHP's "interesting" management of the buffer).

While profiling our application I came across a a rather strange memory usage by the ob_start() function. We do use ob_start() quite a bit to defer output of data, which is a common thing in many applications. What was unusual is that 16 calls to ob_start() up chewing through almost 700kb of memory, given that the data being buffered rarely exceeds 1-2kb, this was quite unusual.

Through a bit more testing he found that, if a buffer provided for content isn't enough, PHP automatically bumps it up by 10kb each time - a waste of resources if you only need a small subset of that. He includes a small patch he made to the PHP core API that allows for defining a custom buffer size and, if it's not enough, bumps up the buffer size by 1kb instead of 10kb.

0 comments voice your opinion now!
output buffer increase patch custom size


Kevin Schroeder's Blog:
fatal The remote end hung up unexpectedly
November 04, 2011 @ 12:55:28

Kevin Schroeder has a quick tip for anyone using phpcloud.com and having trouble with git and "remote end hung up" error messages.

If you are using phpcloud.com and are experiencing errors with git [...] and you are trying to push large files (not sure what is defined as "large") you may need to change some git settings.

He points out two settings - one for Windows and the other for Linux - that increase the buffer size to handle larger files that might be included in your repository.

0 comments voice your opinion now!
phpcloud git problem large file buffer size


Jeez Tech:
Damn Small PHP Frameworks. Because size does matter.
September 17, 2009 @ 13:54:22

In this recent post to the Jeez Tech blog they take a look at some of the small, lightweight frameworks out there.

They look at five different frameworks:

A few other frameworks are also mentioned in the comments like the micro-framework limonade and Madeam.

0 comments voice your opinion now!
small framework size


Sameer Borate's Blog:
PHP built in functions map
January 16, 2009 @ 09:31:22

Sameer has put together a few images, the results from the Wordle website when he plugged in the names of the built-in functions included in PHP.

The application is simple. You enter a bunch of text and Wordle does the rest. The applet provides options to change color, font and layout. Just for fun I created a Wordle cloud to display php's built in functions. Two samples are shown below. The size of the font in the cloud is proportional to the number of functions starting with the particular name.

Among the largest on the list are words like "array", "get", "mysql" and "mcrypt". He used a call to the get_defined_functions() method and looped through the "internal" subarray to build his lists.

0 comments voice your opinion now!
function wordle builtin output image text size


Stefan Mischook's Blog:
Podcast Structuring PHP Projects
November 11, 2008 @ 10:25:52

Stefan Mischook has posted a new podcast that gives an overview of things to consider when structuring your application.

In the following podcast I go over the key factor when determining how to structure a PHP project. In a nutshell, it comes down to the size and complexity of the job. For the details, listen to me yap.

You can download the mp3 directly from his site. For more great PHP tutorials, check out his videos section.

0 comments voice your opinion now!
podcast structuring project tutorial video factor complexity size


Kae Verens' Blog:
pre-parsing HTML for incorrectly-sized images
July 29, 2008 @ 12:03:55

Kae Verens has a recent blog post that looks at a method for helping to protect users from themselves when working with images - a method for handling ones incorrectly sized.

Every now and then, I get a call from a client who is puzzled why their site is running slow. I would look at their page and see an innocuous image inserted into a paragraph. When I examine the image, though, I see that the client has artificially resized the image using HTML. One recent example showed on-screen as a 300px-wide image. When I examined it, it was actually 3000px wide (approx).

The script looks through some HTML markup and, based on the sizes in the image tags, resizes the images appropriately. An example and the source are provided.

0 comments voice your opinion now!
html image size height width parse resize


Etienne Kneuss' Blog:
SplFastArray to speed up your PHP arrays
June 09, 2008 @ 12:54:04

Etienne Kneuss has posted about a new part of the Standard PHP Library that creates arrays that are up to thirty percent faster than normal methods - SplFastArray.

Antony got the idea to implement a C-like array wrapper in SPL: SplFastArray. The main advantage of that class is performance, it's indeed faster than PHP arrays. How so? No free lunch: The speedup comes from the fact that non-numeric indexes are not allowed and that the array is of fixed size.

The code sample shows the setting of the size for the array (and changing it) with a var_dump of the output result. This method is always faster than normal arrays, it just varies how much from system to system (anywhere from ten to thirty percent).

0 comments voice your opinion now!
spl splfastarray set size speed faster


DevShed:
Retrieving Information on Selected Files with a PHP 5 File Uploader
March 27, 2008 @ 09:31:04

DevShed has continued their series (here's part one) looking at the use of file uploading in your PHP scripts. They build on that foundation and add in some more useful features this time:

The initial script in the first tutorial of this series lacked some important features, such as the implementation of an effective error handling module and the ability to check the MIME type and size of the file being uploaded. In this second installment of the series, I'm going to improve the logic of the script from the first tutorial to provide it with the capacity to retrieve useful information concerning the entire file uploading process.

They look back at the previous tutorial to remind you of some of the concepts and then move on to show you how to get information about the file (like the MIME type, name and size of the uploaded file). The last page is just the full source code for the cut and pasters out there.

0 comments voice your opinion now!
tutorial php5 file upload information mime name size


Ian Selby's Blog:
Uploading Large Files With PHP
September 14, 2007 @ 13:03:54

Ian Selby, working for a startup and building a lot of code up from scratch came across a problem - the upload of pretty large files via PHP:

I have found myself in a position where I am writing scripts that may need to upload fairly large files. My scripts were timing out, and I couldn't seem to figure out why. For the unitiated, there are some standard things that you usually do to both your php.ini and in your script in this situation [...] However, it turns out there are some other php.ini config variables that you may need to look at.

The "usual suspects" list includes changing the max_upload_size value and adjusting the script timeout. The other settings he mentions, though, are things like memory_limit, post_max_size and max_input_time to help increase the default times that PHP uses on most page executions.

0 comments voice your opinion now!
upload large file phpini setting timelimit size upload large file phpini setting timelimit size



Community Events











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


opinion podcast unittest overview package application facebook hhvm introduction component composer language series symfony2 hack security release dependency framework install

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