Skip to main content
2 of 2
grammar
AJweb
  • 111
  • 4

Thanks for your library first of all.

I am not very comfortable posting this doubts here, doesn't seem the right place... let know if you want me to delete this "answer".

I had a problem with the cache while instantiating UserExchange:

$so = new UserExchange('stackoverflow','myapikey', 0);

But I realized the cache was still active even when passed $cache_ttl=0 as above (I wanted it disable for testing). I checked out your constructor of UserExchange and see that you are calling the parent StackBase constructor with ttl=10 , overriding any value that is passed in the constructor of a UserExchange. Is this intentional?

UserExchange.php line 20:

parent::__construct( $site, $key, $cache_ttl = 10 );

And another doubt about the caching. In the StackBase class you set up:

public $_cache_path = "cache/";

but then I can't see $_cache_path being used anywhere, the cache methods use hard coded paths. I guess this is just because you haven't have the time to complete this part?

Lines 437 to 439 in StackBase.php (startCache method):

if( !is_dir("cache/") )
    {
        if( !mkdir("cache/") ) {
            // ...
AJweb
  • 111
  • 4