DateTime::createFromFormat
11 posts
• Page 1 of 2 • 1, 2
DateTime::createFromFormat
When I use this method in Phalanger the compiler errors out saying the method does not exist in class DateTime.
This method was introduced in 5.3.0. It seems to be missing from the current version of Phalanger.
http://ca1.php.net/manual/en/datetime.c ... format.php
This method was introduced in 5.3.0. It seems to be missing from the current version of Phalanger.
http://ca1.php.net/manual/en/datetime.c ... format.php
- compucoder
- Posts: 12
- Joined: August 16th, 2012, 12:29 pm
Re: DateTime::createFromFormat
Thanks, we'll add it onto todo list or if you know anybody willing to help, he can contribute to Phalanger repository https://github.com/DEVSENSE/Phalanger
Thanks,
Thanks,
Jakub Misek │ DEVSENSE s.r.o. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
Re: DateTime::createFromFormat
I don't mind taking a crack at adding it. I am not a pro C# programmer but may be able to attempt it. It would be a fun challenge for sure. Can you tell me what folder and file I should start at? I don't know your source so findng where DateTime class is even coded would take a long time.
- compucoder
- Posts: 12
- Joined: August 16th, 2012, 12:29 pm
Re: DateTime::createFromFormat
Sure, That would be great!
https://github.com/DEVSENSE/Phalanger/b ... ateTime.cs
Notice every method has two overloads
- ArgLess, used for dynamic operations, has always this signature
- ArgFull is the method implementation, first arg is always ScriptContext, others are of type Object. Method returns Object.
The rest is just coding.
Thanks!
https://github.com/DEVSENSE/Phalanger/b ... ateTime.cs
Notice every method has two overloads
- ArgLess, used for dynamic operations, has always this signature
- Code: Select all
[EditorBrowsable(EditorBrowsableState.Never)]
public static object modify(object instance, PhpStack stack)
- ArgFull is the method implementation, first arg is always ScriptContext, others are of type Object. Method returns Object.
- Code: Select all
[ImplementsMethod]
public object modify(ScriptContext/*!*/context, object modify)
The rest is just coding.
Thanks!
Jakub Misek │ DEVSENSE s.r.o. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
Re: DateTime::createFromFormat
I downloaded the source and had a look and found where to do the work. Thanks for pointing me in the right direction. I would have found it easily based on how well organized the code is. You guys have done a wondeful job on this product!
I did hit a glitch though. I opened the Solution and when I try to build it I get the same errors over and over;
Error 1 Metadata file 'C:\Users\rcraig\Documents\Visual Studio 2012\Projects\Phalanger-master\Source\ClassLibrary\Bin\Debug\PhpNetClassLibrary.dll' could not be found C:\Users\rcraig\Documents\Visual Studio 2012\Projects\Phalanger-master\Source\Testing\Unit\CSC Testers.Unit
Error 2 Metadata file 'C:\Users\rcraig\Documents\Visual Studio 2012\Projects\Phalanger-master\Source\Core\Bin\Debug\PhpNetCore.dll' could not be found C:\Users\rcraig\Documents\Visual Studio 2012\Projects\Phalanger-master\Source\Testing\Unit\CSC Testers.Unit
I get 23 of these. It also can't find PhpNetClassLibrary.dll - not sure what is wrong; I would expect it to build these dll's. The build order does the core and library's first.
Am I missing something or doing something wrong?
I did hit a glitch though. I opened the Solution and when I try to build it I get the same errors over and over;
Error 1 Metadata file 'C:\Users\rcraig\Documents\Visual Studio 2012\Projects\Phalanger-master\Source\ClassLibrary\Bin\Debug\PhpNetClassLibrary.dll' could not be found C:\Users\rcraig\Documents\Visual Studio 2012\Projects\Phalanger-master\Source\Testing\Unit\CSC Testers.Unit
Error 2 Metadata file 'C:\Users\rcraig\Documents\Visual Studio 2012\Projects\Phalanger-master\Source\Core\Bin\Debug\PhpNetCore.dll' could not be found C:\Users\rcraig\Documents\Visual Studio 2012\Projects\Phalanger-master\Source\Testing\Unit\CSC Testers.Unit
I get 23 of these. It also can't find PhpNetClassLibrary.dll - not sure what is wrong; I would expect it to build these dll's. The build order does the core and library's first.
Am I missing something or doing something wrong?
- compucoder
- Posts: 12
- Joined: August 16th, 2012, 12:29 pm
Re: DateTime::createFromFormat
Thanks! I don't know what is wrong, simply unload Testers.Unit if it would help.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
Re: DateTime::createFromFormat
That didn't help. It seems to all start from a .cmd updater in the tools folder. I will install my 2010 VS pro and see if things work better. I am using VS2012. I did update the common tools paths but maybe there is more incompatabilities.
- compucoder
- Posts: 12
- Joined: August 16th, 2012, 12:29 pm
Re: DateTime::createFromFormat
I am still unable to contribute to compile failures. The errors seem to originate from the Core failing to build the main assembly. I think everything is originating from this error:
Error 22 The command "cd "C:\Users\rcraig\Documents\Visual Studio 2010\Projects\Phalanger-master\Solutions\.."
Tools\UpdateFileVersionFromChangeset.cmd "C:\Users\rcraig\Documents\Visual Studio 2010\Projects\Phalanger-master\Source\Core\AssemblyInfo.cs"" exited with code 255. Core
Any idea what may be wrong?
Error 22 The command "cd "C:\Users\rcraig\Documents\Visual Studio 2010\Projects\Phalanger-master\Solutions\.."
Tools\UpdateFileVersionFromChangeset.cmd "C:\Users\rcraig\Documents\Visual Studio 2010\Projects\Phalanger-master\Source\Core\AssemblyInfo.cs"" exited with code 255. Core
Any idea what may be wrong?
- compucoder
- Posts: 12
- Joined: August 16th, 2012, 12:29 pm
Re: DateTime::createFromFormat
Hi Jakub,
I got around this issue by taking the prebuild step away.
I started looking at adding the missing method but got stumped. It requires you to return a static DateTime object. I have no clue how to do that. Even if I could add this in I also need Diff which is also missing; and that needs a new class called DateInterval. I am not experienced enough with C# or this project to tackle all of this.
If you or someone experienced in the project can add createFromFormat, maybe I can try and help with Diff and DateInterval.
I really need to see new code being done that is in the context of what I am needing so my brain clicks in.
I wish I was a more experienced C# developer so I can contribute. I really want to but need a bit of help as stated above.
I got around this issue by taking the prebuild step away.
I started looking at adding the missing method but got stumped. It requires you to return a static DateTime object. I have no clue how to do that. Even if I could add this in I also need Diff which is also missing; and that needs a new class called DateInterval. I am not experienced enough with C# or this project to tackle all of this.
If you or someone experienced in the project can add createFromFormat, maybe I can try and help with Diff and DateInterval.
I really need to see new code being done that is in the context of what I am needing so my brain clicks in.
I wish I was a more experienced C# developer so I can contribute. I really want to but need a bit of help as stated above.
- compucoder
- Posts: 12
- Joined: August 16th, 2012, 12:29 pm
Re: DateTime::createFromFormat
Hi,
As I see, this is tricky one. DateTime::createFromFormat is not trivial function, but it does not needed anything new, everything is already coded in Phalanger. So I guess somebody will surely do it.
I submitted some stub on GitHub
https://github.com/DEVSENSE/Phalanger/c ... 740d887ec8
so somebody can finish it.
Thanks,
As I see, this is tricky one. DateTime::createFromFormat is not trivial function, but it does not needed anything new, everything is already coded in Phalanger. So I guess somebody will surely do it.
I submitted some stub on GitHub
https://github.com/DEVSENSE/Phalanger/c ... 740d887ec8
so somebody can finish it.
Thanks,
Jakub Misek │ DEVSENSE s.r.o. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
11 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 41 guests