WebSVN Installation

Posted: August 12th, 2008 | Author: | Filed under: PHP | 2 Comments »

If you recently downloaded and installed WebSVN and have followed the Installation Guide only to receive this error:

Please set up a repository path in include/config.php using $config->parentPath or $config->addRepository

See the installation guide for more details

you need to do one of two things.

1) Move include/config.php into the WebSVN root OR
2) Edit include/setup.php by changing:
require_once 'config.php';

To

require_once 'include/config.php';

For some reason, WebSVN is looking for config.php in the root folder, even though it resides under the include directory by default.


Regular expression for CSV files

Posted: August 22nd, 2006 | Author: | Filed under: PHP | 1 Comment »

After many hours of searching, I found this regular expression to work the best on parsing CSV files:

$expr = “/,(?=(?:[^\"]*\”[^\"]*\”)*(?![^\"]*\”))/”;

Example:

$matches = preg_split($expr, ’2006-01-01, “Apples, Oranges, and Pears”, $5.95′);


PHP & database sessions

Posted: February 15th, 2006 | Author: | Filed under: Linux, PHP | No Comments »

If you have MySQL handle your PHP sessions and are finding that session data is not reliably being read after redirects via PHP’s header function, please read on.

For over a day I had been pulling my hair out trying to figure out why sessions were not sync’ing up after redirects via PHP’s header function. Some pages would load and others would not. I had just finished migrating our code base to a new server running slightly different versions of Apache, MySQL, and PHP – though from the same branches.

After some expirimentation, I discovered sessions handled by the defalt file handler would work just fine – just not reliadbly through my custom database handler. After even further investigation, redirects were working, the data for the session was “late” showing up and by simply refreshing the screen the data would be magically populated in $_SESSION.

After some reading around on the internet and some deep thinking, I understood the problem to be an issue of timing and/or cache timing issues. So, to resolve the issue, I add the session_write_close() command before each redirect I need. It works. Although, do not ask me why.

My LAMP versions:
Linux: RHEL 4.0
Apache: 2.0.52-22.ent
MySQL: 4.1.12-3.RHEL4.1
PHP: 4.3.9-3.9

Hope this saves someone!


PHP hotspot login script for Chillispot

Posted: November 18th, 2005 | Author: | Filed under: Networking, PHP | Tags: | 7 Comments »

I offer a modified version of drewb’s PHP version of hotspotlogin.cgi that contains support for PHP installs that do not register global variables.

Grab a copy today!

wlogin-1.20a