moazzamabbas / phpbrowscap

Automatically exported from code.google.com/p/phpbrowscap
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Patch to give access to INI version info. #4

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I have made a patch to the PHP 5 file to allow you to be able to save and
thus recall the version info about the ini file you currently have loaded
(cached).

The new property is $_versionInfo which has an array of the version number
and the version date.

Also added a setting for the version url and renamed the date url
appropriately to reflect that it is date checking.  Allows you to override
the version url which could be used to check for version updates instead of
relying on the date of the file with mtime().  I will post a patch later to
make use of the version checking instead of the time checking.

Take a look at the patch file which is a diff and let me know if there are
any issues.  Hopefully you will see this as a step in the right direction
to make this library more robust and smarter.

Please provide feedback.

-Austin

Original issue reported on code.google.com by austin.bischoff on 23 Dec 2008 at 8:41

Attachments:

GoogleCodeExporter commented 8 years ago
Hi Austin,
I understand the need of version checking instead of date checking, I'll take a 
closer look at the modifications 
in the next days and it can even be that I include this along with the release 
to correct issue 3.

P.S. In php I use tabs instead of spaces ;-)
P.P.S You can have your credits in the head docblock, but I'll remove all from 
the code. I hope you understand 
this.

Let me know.

Jonathan

Original comment by st.jonat...@gmail.com on 24 Dec 2008 at 10:24

GoogleCodeExporter commented 8 years ago
Ahh sorry about the tabs.  I use spaces for all my stuff and it is set to remove
trailing white space so that is what a lot of the changes are.  I should have 
turned
off white spaces in the diff, my fault.

The credit is no big deal it was mainly for the stuff we use at my work so other
people when they looked at the library would know I changed so if they had any
questions they would know who to email.

As far as issue 3 I was in contact with Gary when he was mass-blocking the
user-agent.  The issue with him seeing all kinds of hits was probably a 
permissions
issue on web side of the site trying to utilize the library.  Some permissions
checking such as is_writable() probably needs to be implemented before any 
remote
checks are performed so that stuff like that can be avoided. If the directory 
and/or
the actual php file are not writeable (i.e. touch()able) then just throw an 
exception
and exit.

Let me know if you need any help as we utilize this library in some projects so 
much
so that we setup our own mirror to pull from so we did not get banned by Gary 
in case
something with the permissions got messed up.

-Austin

Original comment by austin.bischoff on 24 Dec 2008 at 7:47