User login

code snippet

Remove a trailing slash (if any) from a string with PHP

php remove traling slash
php remove last character
http://us2.php.net/manual/en/function.rtrim.php

From a line in template.php that also takes out leading http:// to present a more human-friendly web address.

<?php
    $display = rtrim(str_replace('http://', '', $url), " /");
?>

Checking if a web site URL is valid: There's a Drupal function for that

drupal php check valid url

A too-simple snippet contributed elsewhere:

<?php
function valid_url($str)
{
    return ( ! preg_match('/^(http|https|ftp):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/i', $str)) ? FALSE : TRUE;
}
?>

After following this epic thread
http://drupal.org/node/124492
it becomes clear that Drupal has a wonderful valid_url function of its own, thanks to mfer

Convert an associative array to variables with the names of the keys and the matching values

php turn an array into variables matching keys
php associative array to variables

The function you want is

<?php
 extract($array);
?>

http://us.php.net/extract

You can also do it the hard way.

Helper script for deploying Drupal sites in Agaric's system

To get an agaric project repository, without the helper script, it's simply: git clone git.agariclabs.org:/srv/git/whoswho.git

And get the current version of the script at https://gitorious.org/agaric-scripts

File: 
File: 

Installing Drush

We are fTollowing our Debian-inspired sysadmin, Stefan Freudenberg, in the locations of this extra-Drupal project, but you can put it anywhere.

Remember to check the Drush project page for the latest version to wget, and replace the CURRENT-VERSION tarball link with that. This will be the last module you ever have to do that for.

Syndicate content