ColumnCount not implemented

Discussion about the open-source Phalanger [?] project.

ColumnCount not implemented

Postby davidbcn » October 21st, 2014, 8:31 pm

PDOStatement class in PHP has a ColumnCount method.

http://php.net/manual/es/pdostatement.columncount.php

This is not implement in Phalanger's PDO extension.

Greetings,
davidbcn
 
Posts: 87
Joined: September 10th, 2014, 3:07 am

Re: ColumnCount not implemented

Postby davidbcn » October 21st, 2014, 8:39 pm

This made the trick, I'm not sure if the implementation is right.

#region columnCount
[PhpVisible, ImplementsMethod]
public virtual object columnCount(ScriptContext context)
{
if (this.CurrentReader != null)
{
return this.CurrentReader.FieldCount;
}
return -1;
}

[EditorBrowsable(EditorBrowsableState.Never)]
public static object columnCount(object instance, PhpStack stack)
{
stack.RemoveFrame();
return ((PDOStatement)instance).columnCount(stack.Context);
}
#endregion
davidbcn
 
Posts: 87
Joined: September 10th, 2014, 3:07 am

Re: ColumnCount not implemented

Postby Jakub Misek » October 30th, 2014, 10:23 am

sorry for the delay.

It looks great, I can merge it into sources and push it on github.

Thanks,
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2072
Joined: January 4th, 2012, 2:42 pm
Location: Prague


Return to Phalanger project

Who is online

Users browsing this forum: No registered users and 2 guests

cron

User Control Panel

Login

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 5 minutes)
Most users ever online was 62 on January 7th, 2012, 10:54 pm

Users browsing this forum: No registered users and 2 guests
Phalanger