Tagged: CacheHandler RSS Toggle Comment Threads | Keyboard Shortcuts

  • danielsaidi 9:54 am on June 11, 2010 Permalink | Reply
    Tags: Application relative path, CacheHandler, Page relative path   

    PHP and JS CacheHandler path differences 

    As I am finishing the Wigbi 1.0 implementation, the time has come to implement the JS versions of the Wigbi PHP handler classes. As I implemented the CacheHandler JS class, I came across an interesting problem.

    In this post, ~/ indicates the application root, which is where the wigbi folder is located.

    In PHP, the CacheHandler class uses page relative paths to the cache folder. All class functions are executed directly when called, which makes page relative paths natural.

    In JavaScript, however, the same does not apply. Since the JS class uses asynchronous methods, a page that calls a method will not exist in the same folder as the one that executes it.

    This leaves us with an interesting scenario. Say that the page ~/admin/account/myAccount.php sets the cache folder to ../cache.

    With PHP the cached files will end up in ~/admin/cache/.

    With JavaScript, however, the call is sent to ~/wigbi/pages/postBack.php, where it is executed. Thus, the ../cache path will make the cached cached files end up in ~/wigbi/cache/.

    Using the same kind of paths for PHP and JavaScript will therefore not work. Instead, the JavaScript class is set to use application relative paths. Instead of ../cache, use admin/cache.

    The CacheHandler JavaScript class will automatically adjust application relative paths so that the postback page can use them.

     
  • danielsaidi 9:24 pm on April 28, 2010 Permalink | Reply
    Tags: , CacheHandler, , , , SessionHandler, SimpleTest,   

    The work with Wigbi 1.0 proceeds 

    I am currently working with the Wigbi 1.0 release, which I wrote about earlier. I have now finished writing new versions for the following classes:

    • CacheHandler
    • IniReader
    • JavaScript
    • LogHandler
    • SessionHandler
    • Wigbi (part done)

    Working with SimpleTest has simplified development a lot, which is why the pace is so good ;)

    In Wigbi 1.0, all system classes will be independent of the Wigbi class (except—the Wigbi class), which means that you will be able to use them for other purposes as well, without having to rely on Wigbi. The only static classes (so far) are JavaScript and Wigbi. All other system classes now have default handlers that are initialized by Wigbi and accessed as properties of the Wigbi class.

    Several classes remain,  as well as data and UI plugin classes…but I’m getting there.

     
  • danielsaidi 12:59 pm on November 20, 2009 Permalink | Reply
    Tags: CacheHandler, Data   

    Caching available in Wigbi 0.99.2 

    I have now implemented a cache handling class, which simplifies working with cached data. The class, CacheHandler, will be released together with Wigbi 0.99.2, a corresponding demo, the new forum template application as well as a bunch of new seeds and controls.

    When I developed the CacheHandler class, I had a very constructive dialogue with Mattias Sundberg, an old friend of mine who is a great PHP developer. He informed me about the serialize/unserialize functions, which works great! I use them to serialize the data in the CacheHandled class and have updated the SessionHandler class to use this approach as well.

    The new SessionHandler version will be released together with Wigbi 0.99.2 as well.

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel
Follow

Get every new post delivered to your Inbox.