Archives for the ‘PHP’ Category

Has the JVM design been holding back Java?

[Note: I've reposted this (with minor edits) as my original post got accidentally deleted. Thanks to Google cache]
Why is it? Why is it that Java applets -despite having the first mover advantage – achieved little traction. While Flash – a tool which targets graphic designers originally – continue to gain mindshare, and is now a [...]

Code Folding That Works

A user comments on VIM simplefold (a folding plugin that works better than the vim defaults):
First code folding that is worth the bother
I’ve just tried it and I have nothing more to add. It works well, and I look forward to using it as one of my default tools.

Patches to CodeIgniter for Sqlite Support

See CodeIgniter Forums
Note: The following doesn’t quite work as well.
From Price Change Blog (in Japanese):

function list_fields($table = ”)
{
// Is there a cached result?
if (isset($this->data_cache['field_names'][$table]))
{
return $this->data_cache['field_names'][$table];
}

if ($table == ”)
{
if ($this->db_debug)
{
return $this->display_error(‘db_field_param_missing’);
}
return FALSE;
}
$sql = “SELECT * FROM “.$this->escape($table).” LIMIT 1″;
$query = $this->query($sql);

$retval = array();

if ($query->num_rows() > 0)
{
$row = $query->row_array();
$keys = array_keys($row);
foreach ($keys as $val)
{
if (!is_int($val))
$retval[] = $val;
}
}

$this->data_cache['field_names'][$table] [...]

Integrating CakePHP with PEAR:Auth

If you have a web-site which uses PEAR::Auth, and another section of your site using CakePHP, you’d probably find it baffling that your CakePHP doesn’t remember your authentication cookie. In addition, CakePHP wouldn’t redirect properly after logging in.
The main reason is CakePHP overrides the standard PHP session environment, see cake/lib/session.php

ini_set(’session.use_trans_sid’, 0);
ini_set(’session.name’, [...]

Creating ImageMaps with PHP Image_Graph

You can create client-side image maps for charts using PHP. Here’s how.