The class HTTPConnection has been updated to support connections through proxy-servers.
I guess that might be useful for some users.
Since there were some little problems with the regular expressions for detecting the boundaries of expressions in the statement I changed these regular expressions in order to fix the problem.
A few tests suggest that everything should be okay now.
With the new class, SQLSession, you can store sessions in a database.
This class requires MultiSQL and by this offers support for all databases supported by MultiSQL.
Identification of the client is not only based on the session-id, but also on IP and user-agent, which should give a little more security.
IP- and user-agent will be treated with the database's escaping-function to prevent SQL-injections based on a faked user-agent.
For other values no escaping is done, you are responsible to ensure no SQL-injections are possible via values stored in the session.
I want to wish all of you a merry christmas and a happy, healthy and successful new year.
At the moment I'm not working pretty much, and what I do is related to another big project which is still to be published (it's not PHP-related ;-) ) but next year I want to find some time to give some classes a little make-over and maybe I can also find some ideas for new classes.
Enjoy the holiday season.
I added two useful methods to the MultiSQL class. connected() checks the current database-connection. select_db() changes the current database.
I just added support to change the database (select_db()) in MultiSQL.
Next I'm thinking about adding some returns into the functions in case the connection has not been established.
I put together a little introduction about the differences between the PHP4- and PHP5-versions of the classes and also wrote a, hopefully useful, documentation of the HTTPConnection class.
I think I will also provide some code examples soon.
In order to help you using my classes I thought it might be good to write some short API documentation about the classes. Explaining the methods and their parameters a little so that you don't need to study the code closely to be able to use the classes. I hope that especially users who are new to PHP will benefit from this because I know that it sometimes can be hard to understand code written by others, especially when you're just looking for a solution for your problems.
So this will be the next step, writing the API-documentation for all published classes, including pointing out possible differences between the PHP4- and PHP5-versions.
It took a couple of days more than expected, but finally I could find some time to check the PHP4-version of MultiSQL and upload it.
Finally I managed to do some testing on my new class MultiSQL.
With this class you can use different DBMS with the same code, with no (or little) changes to the SQL-queries. Not all kinds of queries can be translated, but for most SELECT, INSERT, DELETE and UPDATE queries it seems to work perfectly fine.
Creating tables for example will most propably not work without changes because of different names for datatypes.
But as I said, most normal queries should work perfectly. I actually use this class on my website (which is still under construction) and have no problems at all.
The class currently supports MySQL, PostgreSQL and MSSQL, including support to emulate LIMIT and OFFSET for MSSQL and to translate MSSQL's TOP to LIMIT.
Tomorrow I will do some testing on the PHP4-version and if there are no problems (which I expect) it will be released tomorrow.
I'm still working on new classes, so please don't think this project is dead.
Right now I'm working on a database-class, which is supposed to make migration from one DBMS to another easier, meaning that you don't have to rewrite all your queries.
At the moment I'm implementing this for MySQL, PostgreSQL and MSSQL. So far this is limited to rewrite the indicators for field- and table-names (for example `` in MySQL) to the selected DBMS's indicators (for example [] in MSSQL).
I want to try to add some emulation for LIMIT, which does not exist in MSSQL and does not accept the offset parameter in PostgreSQL (there you have to use OFFSET to specify it, but at least this is also supported by MySQL), and maybe some other functions if I can find something which could be useful to emulate.
For testing I changed my website (still not online) to use the class, and I can easily switch from MySQL to PostgreSQL (MSSQL would propably work too if I wouldn't use LIMIT from time to time) just by editing my config-file.
Since I had some I time I followed my plan to backport the classes to PHP4 and just released PHP4-versions of all classes.
These classes are not tested, but should work without problems.
I'm planning to backport my classes to use PHP4-OOP. With this I hope to be able to reach a wider audience.
I just update the Tar class because I noticed that I forgot to remove some test-output which shoudld not be there for normal use.
So, for everyone who wondered why you always get a list of files when you write the file, now that's gone.
The initial version of Tar has been released today.
With this class you can create your own .tar-files from within PHP. Not all functions of tar are supported yet, but in my tests all my archives worked perfectly.
Wow, only one month and two days after the first 100 downloads we reached the 200 mark.
I guess now it's really time to finish the Tar-class.
I will try to finish it tonight or tomorrow.
After that I will have to think about something new, suggestions are always welcome.
Thanks a lot for downloading my classes so much. I hope you like my code and don't just download the files to be disappointed when looking at the code.
Today I found a little bug in the Tar class, which means the release will be delayed a little. I guess I can fix it this weekend or until next weekend. Stay tuned for news.
The initial version of SMTPConnection has been released.
This class enables you to send mails not only via a local mail-server but also via any other mail-server. Authentication is not fully supported, but the wide-spread mechanisms PLAIN and LOGIN are implemented. The easiest way to feed this class with a mail is using the eMail class which you can also find here.
The initial version of eMail has been released.
You can use this class to create eMails with any number of attachments.
A good way sending the mails created with this class is to use SMTPConnection which you can also find here.
I am happy to see we got the first 100 downloads.
I really hope you like the classes I offer here and would like you to come by from time to time to check for new classes.
As I said in a previous news-post I still got a few classes in testing and I plan to put another big project aside for a day or two so that I can finish these classes and finally upload them.
The initial version of the UnTar class is released.
With this you can get filelists of .tar files and extract selected or all files from the archives.
Currently I'm making final changes and running some more tests on some new classes.
There will be a class to create eMails, including an unlimited number of attachments.
The SMTP-class enables you to send eMails using non-local SMTP-servers. Includung SMTPS- and SMTP-Auth-support.
And finally there will be two classes to create and extract TAR-archives.
I thought it might be useful adding HTTP-Authentication to that class. So, here it is. I hope you'll enjoy the code.
The initial version for the HTTPConnection class is released.
Although I call this the initial version I did quite some testing before I put it here.
As all classes here HTTPConnection is written in PHP 5, and will not work with PHP 4, due to the differences in OOP.
You can use this class to connect to Web-Servers and perform actions like GET, POST and HEAD, without using CURL.
Replies are split into header and body so that the data is easy to use. Cookies can be transferred as well as form-data via POST, including file-uploads. It's even possible to login into websites with this.
The initial version for the FTPConnection class is released.
Although I call this the initial version I did quite some testing before I put it here.
As all classes here FTPConnection is written in PHP 5, and will not work with PHP 4, due to the differences in OOP.
This class provides FTP-access without utilizing PHP's own FTP-functions and offers even a few bonus-functions, like reading a file from FTP to variables instead of just downloading it into a local file.