New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove obsolete Date/Time library #970
Comments
Marked as deprecated in 5.22.6, will be removed in 5.23.0 |
Documentation has been updated with warning boxes indicating that the library is deprecated in 5.22.6 and removed in 5.23.0. |
adodb_mktime removed unfinished. still adodb_mktime present in adodb.inc.php and adodb-sybase.inc.php |
@ptdesign yes, I noticed that a couple days ago as well. Will fix. |
Hello, any updates? |
Sorry no, I've been busy and have not been able to work on ADOdb lately... But it's not forgotten and I'll get to it eventually. |
Can I try to clean that up? Make a PR? Looking for things to do for this year hacktoberfest. If I can help here would be great! |
@joebordes contributions are always welcome, feel free to submit a pull request. Thanks ! |
Got it! PR on it's way :-) |
Can you please add the |
Done |
…Date/Time library
Looking at the code and the commit where the date/time library was eliminated I found that there were 4 functions being used and not defined:
I studied a little about the history and the functionality and decided (hopefully correctly) to just use the standard PHP functions. Then I validated my assumptions by creating an SQLite database and trying to access it. I received the error as expected: PHP Fatal error: Uncaught TypeError: SQLite3::createFunction():
Argument #2 ($callback) must be a valid callback, function "adodb_date" not found or invalid function name
in /home/joe/reps/ADOdb/drivers/adodb-sqlite3.inc.php:312 I then made the change and created a test file to validate the functionality. This test file is also in the pull request but not integrated into the test suite you have. It is just there as a starting point for future efforts. $> php testsqlite.php
Test sqlite access first 4 rows: select * from testtable order by id limit 4 ✓
Test SQLDate: SELECT strftime('%d-%m-%Y Q %H:%M:%S') ✓
Test SQLDate: SELECT strftime('%d-%m-%Y Q %H:%M:%S','1974-02-25') ✓
Test SQLDate: SELECT strftime('%d-%m-%Y Q %H:%M:%S','1474-02-25 05:04:16') ✓
Test SQLDate: SELECT strftime('%d-%m-%Y Q %H:%M:%S','2474-02-25 05:04:16') ✓ Let me know how it looks and if you need me to change anything. |
Hello, sorry for the lack of response, I've been busy... You mentioned a pull request, but you never actually created one... Anyway I had a quick look at the commit in your fork and it looks good. My only concern is the continued use of strftime() which has been deprecated in PHP 8.1. I know it's somewhat outside the scope of this issue and I have not analyzed the implications, but maybe this would be an opportunity to consider implementing an alternative (maybe as a 2nd PR). Thanks |
this one: #1002 |
I had a look at that strftime comment but I think it doesn't apply. That specific strftime is not evaluated by PHP but by SQLite: https://www.sqlite.org/lang_datefunc.html I eliminated the createfunction call and I am using native SQLite. Let me know |
Sorry I missed it as it was not referenced from here and was looking from my phone. Thanks
Right, I missed the quotes when reviewing... Ignore me 😉 |
Many thanks for your contribution |
my pleasure :-) |
It does not make much sense anymore in the age of 64-bit computing, where timestamps will not overflow for 292 billion years, and it relies on use of strftime()/gmstrftime(), which have been deprecated in PHP 8.1.
Follows discussion in #963
The text was updated successfully, but these errors were encountered: