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

Michael Kimsal:
Is your code portable to subfolders?
Sep 02, 2014 @ 14:12:53

In a quick new post to his site Michael Kimsal asks an interesting question that some PHP developers don't think about in the course of their development: "Is your code portable to subfolders?.

Have been dealing with a couple of PHP projects recently which have been a far bigger pain in the backside than I anticipated, and both had some of the same stumbling blocks. In both cases, and in other projects I’ve seen, there’s a huge assumption that the code will be run from the root of a domain, and all url and routing management have this assumption baked in to everything they touch. What’s the answer?

Some projects just suggest making a new virtual host in the web server configuration and moving on, but this isn't always a real possibility for some projects. In some recent experience, he's found several of the major PHP frameworks assume this kind of setup. He mentions a Java framework, Spring, that allows for this kind of redirect and wonders why it's not that easy in something like Slim.

Maybe try grabbing your own code sometime and reinstalling it in a ‘non-traditional’ way, and see how many assumptions you’ve baked in are really necessary, vs just using defaults.
tagged: subfolder project portable framework

Link: http://michaelkimsal.com/blog/is-your-code-portable-to-subfolders/

SitePoint PHP Blog:
Bringing Unicode to PHP with Portable UTF-8
Sep 10, 2013 @ 16:19:05

On the SitePoint PHP blog there's a new tutorial showing you how to bring portable UT-8 support to PHP with the Portable-UTF8 library. UTF-8 handling has long been one thing desired in the core of PHP, but hasn't been introduced quite yet.

PHP’s lack of Unicode/multibyte support means that the standard string handling functions treat strings as a sequence of single-byte characters. In fact, the official manual defines a string in PHP as a “series of characters, where a character is the same as a byte.” PHP supports only 8-bit characters, while Unicode (and many other character sets) may require more than one byte to represent a character. This limitation of PHP affects almost all aspects of string manipulation, including (but not limited to) substring extraction, determining string lengths, string splitting, shuffling etc.

The article mentions some of the efforts in the past that have been made to try to introduce this functionality into the core, but was shelved at the time. Instead of waiting on this feature to be introduced, they show you how to use the library to do things like check for UTF-8 strings, "cleaning" the UTF-8 strings and do some validation on the string's contents.

tagged: unicode portable utf8 library tutorial

Link: http://www.sitepoint.com/bringing-unicode-to-php-with-portable-utf8/

Andreas Gohr's Blog:
Compiling a Portable Apache for Linux
Apr 01, 2008 @ 16:32:57

Andreas Gohr has posted a guide for creating a mobile Apache installation that could run on something like a USB stick.

Today I spent some time to figure out how to compile a relocatable Apache with PHP support. Yes, this might result in a Linux version of the DokuWiki on a Stick project. Read on for detailed instructions.

The installation is pretty similar to the normal compile with a few small differences. Check out the post for the complete process, commands and all.

tagged: portable apache usb stick linux dokuwiki

Link:

LoopPo Blog:
PDML PHP tricks
Mar 01, 2007 @ 16:48:00

A new post on the LooPo blog points out a handy PHP library to make and work with PDF files in PHP - Portable Document Markup Language (PDML).

I was curious how this works, as it seemed pretty different from previous similar libraries (PDFLib, FPDF), that offered a programmatic API to generate PDF DOMs instead of a markup language.

They describe how it works, what's included with the download and how it uses output buffering to get the job done as well as a few updates and further tips on its usage.

tagged: pdml tricks portable document markup language pdf output buffering pdml tricks portable document markup language pdf output buffering

Link:

LoopPo Blog:
PDML PHP tricks
Mar 01, 2007 @ 16:48:00

A new post on the LooPo blog points out a handy PHP library to make and work with PDF files in PHP - Portable Document Markup Language (PDML).

I was curious how this works, as it seemed pretty different from previous similar libraries (PDFLib, FPDF), that offered a programmatic API to generate PDF DOMs instead of a markup language.

They describe how it works, what's included with the download and how it uses output buffering to get the job done as well as a few updates and further tips on its usage.

tagged: pdml tricks portable document markup language pdf output buffering pdml tricks portable document markup language pdf output buffering

Link:

Community News:
PortableWebAp.com
Dec 29, 2005 @ 16:23:35

Via a link from del.icio.us today, the PortableWebAp project has come to my attention.

PortableWebAp is a portable platform for web applications. With it you can run php web applications from a CDROM, DVD, USB Drive, from any directory from any hard drive. No installation is necessary.

It'll only run on Windows 98 or higher machines, but it has everything you need right there in one, handy package. It (currently) comes installed with PHP 5.1, SQLite 3.x, PDO, and the PHP command-line version - all in about 5MB. Once it's running, it can drop down to the system tray for a less intrusive execution. And, by default, it runs on port 800 so as not to interfere with anything already working on the standard port 80. And, of course, it's pretty cheap - a small price for a lot of time saved.

You can check out the project here...

tagged: portable web server database usb cd dvd portablewebap portable web server database usb cd dvd portablewebap

Link:

Community News:
PortableWebAp.com
Dec 29, 2005 @ 16:23:35

Via a link from del.icio.us today, the PortableWebAp project has come to my attention.

PortableWebAp is a portable platform for web applications. With it you can run php web applications from a CDROM, DVD, USB Drive, from any directory from any hard drive. No installation is necessary.

It'll only run on Windows 98 or higher machines, but it has everything you need right there in one, handy package. It (currently) comes installed with PHP 5.1, SQLite 3.x, PDO, and the PHP command-line version - all in about 5MB. Once it's running, it can drop down to the system tray for a less intrusive execution. And, by default, it runs on port 800 so as not to interfere with anything already working on the standard port 80. And, of course, it's pretty cheap - a small price for a lot of time saved.

You can check out the project here...

tagged: portable web server database usb cd dvd portablewebap portable web server database usb cd dvd portablewebap

Link:


Trending Topics: