pedro_morgan
16th August 2007, 23:00
Hi there, new user to ISPConfig and love it. Also a php developer (amongst others) as a day job. FOSS as an evening pleasure ;-)
As a developer what attracted me to ISPCOnfig is that I need it for my business and also its FOSS, I also have time occasionally and wish to contribute. So here are some more questions.
I just got the svn://svn.ispconfig.org/ispconfig3 . Take it this is the future HEAD ?
I has a quick look on the code and feel it needs a bit of a tidy up. What is the coding standard ? can see a document anywhere. If there isn't one then I would suggest the PEAR coding standards. http://www.go-pear.org/manual/en/standards.php I can help with this. One thing I don't like is using "foo" where 'foo', should be used ie no substitution, makes for faster and more understandable code.
Also helpful code comments and "maybe" these should be in english (no offense as I speak Welsh). However I dont advocate all the php docs standard and /* a lot of pointless @param */ etc when a function speaks for itself; it also makes the file twice the size sometimes!
ADODB is a data abstraction layer for php and its pretty popular and part of PEAR now. http://adodb.sourceforge.net/ Has this ever been looked at. It uses placeholders amongst other features. For example this
$user = addslashes($user);
$pass = addslashes($pass);
$user = $go_api->db->queryOneRecord("SELECT * FROM remote_user WHERE username = '$user' and passwort = md5('$pass')");
would become
$user = $go_apo->db->getRow('SELECT * FROM remote_user WHERE username = ? and passwort = ?', array($user, md5($pass)));
Another feature of adodb is the Data dictionary which either creates or updates a table, and thats across any database and I use mySql, m$sql and Interbase/firebird. It does away completely with the Create Table.sql files Here's a snippet
$tables['job_statuses'] = "
job_status_id I AUTO PRIMARY NOTNULL,
job_status C(50) INDEX jt ,
so I1,
color C(20)
";
$tables['job_status_members'] = "
job_status_id I INDEX NOTNULL,
contact_id I INDEX NOTNULL
";
$dict = NewDataDictionary($db);
foreach($tables as $table => $flds){
$sqlarray = $dict->ChangeTableSQL($table, $flds, '');
$dict->ExecuteSQLArray($sqlarray);
}
The interfaces seem to have a lot of font and styling in the html. This needs to be ripped out to a stylesheet. Are there any guidelines for doing this or is there a stylesheet already available that includes the page layout ?
Has anyone conisidered using Smarty Templating (bit biased as I'm a smarty dev.
More question later maybe ;-)
As a developer what attracted me to ISPCOnfig is that I need it for my business and also its FOSS, I also have time occasionally and wish to contribute. So here are some more questions.
I just got the svn://svn.ispconfig.org/ispconfig3 . Take it this is the future HEAD ?
I has a quick look on the code and feel it needs a bit of a tidy up. What is the coding standard ? can see a document anywhere. If there isn't one then I would suggest the PEAR coding standards. http://www.go-pear.org/manual/en/standards.php I can help with this. One thing I don't like is using "foo" where 'foo', should be used ie no substitution, makes for faster and more understandable code.
Also helpful code comments and "maybe" these should be in english (no offense as I speak Welsh). However I dont advocate all the php docs standard and /* a lot of pointless @param */ etc when a function speaks for itself; it also makes the file twice the size sometimes!
ADODB is a data abstraction layer for php and its pretty popular and part of PEAR now. http://adodb.sourceforge.net/ Has this ever been looked at. It uses placeholders amongst other features. For example this
$user = addslashes($user);
$pass = addslashes($pass);
$user = $go_api->db->queryOneRecord("SELECT * FROM remote_user WHERE username = '$user' and passwort = md5('$pass')");
would become
$user = $go_apo->db->getRow('SELECT * FROM remote_user WHERE username = ? and passwort = ?', array($user, md5($pass)));
Another feature of adodb is the Data dictionary which either creates or updates a table, and thats across any database and I use mySql, m$sql and Interbase/firebird. It does away completely with the Create Table.sql files Here's a snippet
$tables['job_statuses'] = "
job_status_id I AUTO PRIMARY NOTNULL,
job_status C(50) INDEX jt ,
so I1,
color C(20)
";
$tables['job_status_members'] = "
job_status_id I INDEX NOTNULL,
contact_id I INDEX NOTNULL
";
$dict = NewDataDictionary($db);
foreach($tables as $table => $flds){
$sqlarray = $dict->ChangeTableSQL($table, $flds, '');
$dict->ExecuteSQLArray($sqlarray);
}
The interfaces seem to have a lot of font and styling in the html. This needs to be ripped out to a stylesheet. Are there any guidelines for doing this or is there a stylesheet already available that includes the page layout ?
Has anyone conisidered using Smarty Templating (bit biased as I'm a smarty dev.
More question later maybe ;-)