PHP

Jan 30 05:53

Scaling PHP from the farside

[UPDATE]: Facebook plans to release a rewritten PHP runtime shortly. There was some speculatory report which made claims of a 10Ximprovement over mod_php.

Lately, I've managed to push myself to work on a new (and hopefully useful) pet project. For somebody whose constrained world-view of PHPLand was centered around producing or maintaining MVC frameworks that weren't full of shit bloat, It's been an interesting experience treading previously uncharted territory.

The most bitter truth is complicated
Let's accept it. PHP (for it's 33% share of the web, facebook, wikipedia, yahoo! and everything else included) is a tough nut to scale. The conventional way of scaling the PHP-layer for an application from scratch involves getting your hands dirty in the world of web servers, load balancers, opcode-caches and more.

Nov 20 18:36

Why most frameworks suck

You might call me cynical, but this is a ranty (and nothing new) list of complaints + FUDs against most web development / application frameworks. Seems like this is also a natural point of transition for believers in another (new) faith, that of self-help (albeit more self deception and vanity all the same).

You fit the bill, rather than the bill fitting you
So many times, it seems that the problem is with MVC as a concept itself. The inherently flat flavor most frameworks put MVC in action to makes it that much more difficult for large codebases. It can't be helped feeling that adopting an MVC design is in many cases, squeezing yourself into a car rather than walking into one.

Sep 28 03:31

Help Translate Drupal to Kannada

http://localize.drupal.org/translate/languages/kn

Help Kannadize Drupal and Drupalize Kannada! Please join the Kannada localization group on localize.drupal.org and contribute translations online.

If you are the casual contributor who doesn't like messing around with translation editors, You need none of that. All you need is an account on Drupal.org. Or incase you prefer to / have translations locally/elsewhere, Please import your .pos in one shot.

Sep 28 01:34

Why Drush rocks and why dreamhost sucks.

I usually find three major uses of Dreamhost: Firstly (and importantly), as a backup dump, Secondly for SVN (Oops, not any more since I switched to github for good), Thirdly as cheap and slow hosting for mostly personal / hobby-network / friends sites. Contrary to people's complaints about Dreamhost, I find them extremely value providing (for shared hosting) for the money you pay them.

Now Drupal, as resource hungry as it is, is a pain on Dreamhost servers. I've had repeated painful experiences of the {menu_router} table getting half-rebuilt (or lesser) when I visit admin/build/modules before Dreamhost terminates the script for memory overconsumption, resulting in broken pages (and the annoyance of manually regenerating the table externally)

Apr 12 22:16

Useful Drupal Upgrade Snippet

Long time no post. Been really caught up: Tons of work, travel, Acads. Anyway, I happened to be upgrading some old Drupal sites from 5.x -> 6.x. Here's a little SQL snippet to disable all non-core modules first.

UPDATE `system` SET `status` = 0
WHERE `name` != 'system' AND `name` !='block' AND `name` !='node' AND `name` !='user' AND `name` !='watchdog' AND `name` !='filter' AND `name` !='upload' AND `name` !='tracker' AND `name` !='throttle' AND `name` !='taxonomy' AND `name` !='statistics' AND `name` !='search' AND `name` !='profile' AND `name` !='poll' AND `name` !='ping' AND `name` !='path' AND `name` !='menu'

Dec 11 21:19

Prepopulate Views Filters with args

Assuming that the argument is a node ID, being sent (say from a panel, under most circumstances)

// grab nid from referring node
$args[0]=arg(1);
if(is_numeric(arg(1))){
$nid = arg(1); //node id
$term = taxonomy_node_get_terms_by_vocabulary($nid, 3); // 3 is the vid. Use your own Vocabualary ID!
$tids=key($term);
return $tids;
}

$args[1]=$tids;

Feb 21 10:28

Useless, but...

Somebody wanted this.

function ripper($url) {
$page = appr_curl_function($url);
if ($page === false)
{
die("Something wack happened");
}
preg_match('/watch_fullscreen\?video_id=(.*?)&l=(.*?)+&t=(.*?)&/', $page, $match);
$match1 = "http://www.youtube.com/get_video?video_id=";
if(!$match[1]){

Feb 14 10:15

Drupal 6 Released!

http://drupal.org/drupal-6.0

Finally! I should be ready to upgrade most of my sites right away. First pleasing news of the day!