Archive for the 'Fixes' Category

Mysqli small fix for allowing socket in Zend Framework

Monday, December 31st, 2007

As this site is running on ICDSoft hosting, they allow to use MySQL 5 or MySQL 4, but they provide different sockets for each version.

In MySQLi extension, the following host string doesn’t works: localhost:/tmp/mysql5.sock (or localhost:/tmp/mysql.sock), this because they separate the socket from the server host string.

In Zend Framework in the MySQLi Adapter, they don’t use the socket optional parameter, so I made a small fix to allow this [Zend/Db/Adapter/Mysqli.php]:

if (isset($this->_config['port'])) {$port = (integer) $this->_config['port'];

} else {

$port = null;

}/* new block */

if (isset($this->_config['socket'])) {

$socket = $this->_config['socket'];

} else {

$socket = null;

}

/* end of new block */

// Suppress connection warnings here.

// Throw an exception instead.

@$this->_connection = new mysqli(

$this->_config['host'],

$this->_config['username'],

$this->_config['password'],

$this->_config['dbname'],

$port,

$socket //new

);

This allow you to use the socket name, this was for enabling my new showcase example: Google Maps and GeoIP Location, you can see the full code here: http://blog.danguer.com/files/Zend_Db_Adapter/Mysqli.phps

Security Policies in Flash Player 9

Thursday, December 20th, 2007

I recently had a problem with Security Policies with flash player; I suggest you to read the official documentation specially if you want to know what to do in several versions of Flash Player.

WhatI learn is too simple about loading a crossdomain.xml from a server:

  1. If you load the crossdomain.xml from an http request. Example: Security.loadPolicyFile('http://www.danguer.com/crossdomain.xml'). The flash player sandbox will only allow to you swf to connect to ports over 1024
  2. If you want to load ports below this, you need to read the crossdomain from a port below 1024, for example: Security.loadPolicyFile('xmlsocket://www.danguer.com:100')

Of course the most important about the last is that you can load from any port below 1024 and you’re granted to access any port on that server; you can use classes like Socket or XMLSocket for connecting to other ports; so you can have a server listening to information from Flash, but in another to serve the policies. You can do for example a small server in PHP5 for example: http://devzone.zend.com/node/view/id/1086 which shows you to use this great feature in PHP5.

Hope this help you.

Links:

IE Fix on Fieldset Background Color

Thursday, October 25th, 2007

Useful information to patch the problem that your background in the fieldset starts before the content in IE, example:

Community MX - Fix on Fieldset Background Color on IE

Link: The IE Fieldset Background Color Bleed Bug

Flex 2 Debug with Flash 9.0.47.0

Friday, August 17th, 2007

I had some troubles debugging Flex 2 since I installed some updates for CS3 suite.
The error show it cannot use this file:
C:\Windows\System32\Macromed\Flash\Flash9d.ocx

But you can fix this if you download and install the files from:
http://www.adobe.com/support/flashplayer/downloads.html#fp9 

in the part: Adobe Flash Player 9 — Debugger Versions (aka debug players or content debuggers) for Flex and Flash Developers

coLinux on Windows Vista

Monday, July 16th, 2007

I’m testing Windows Vista Ultimate, as I’m working hard with coLinux I need this to work on Vista.

The stable version (0.6) will make crash your Windows Vista. Checking on internet I found posts about how to install coLinux on Vista, fortunately the latest snapshots of 0.8 have incorporated all the fixes to install coLinux on Vista without crashing or making more steps.

You can download from:
http://www.henrynestler.com/colinux/testing/devel-0.8.0/20070708-Snapshot/

But I strongly suggest to check the base dir:
http://www.henrynestler.com/colinux/testing/devel-0.8.0

Since the snapshot dir name will change according date.

The next step is to install as service, in Vista you don’t have much control of your programs (emulating a Mac os X behavior and loosely a Linux behavior). So you cannot install the service if you start the console as “normal user” (even you are in the administrator group). Searching I got here:
http://forums.techarena.in/showthread.php?t=617133

There you will know how to start the cmd in administrator mode and you will be allowed to install the service of coLinux, copying from the site the way to do is:

  1. Click Start
  2. Type: cmd
  3. Press the right-ctrl, right-shift, and enter at the same time

After that you need to install your service as:

colinux-daemon.exe @config.cfg --install-service "coLinux"

And you will have it installed as service. Everything now seems to be working fine but I need to test if 0.8 is really development version =)