Friday, December 22, 2006

[PHP] New version of GzOutput class

I've just updated my recent GzOutput.class.php (more recent than last file published on Ajaxian :D) and tested successful on many browsers.

The difference from other cache-manager files, functions or classes is that GzOutput is totally indipendent from folders or page type, You could use them to increase JSON responses (using text/plain as Content-Type) as well as XML, (X)HTML, CSS or every kind of document You need.

You could combine this class with a JavaScript compressor (to improve download speed) and you don't need to care about output changes because ETag is based on sha1 and not on every mktime of each file (it means better server performances).

The only think that You need to remember is that You don't need to write everything before to use this class (empty spaces, some char or pages can't be write before its usage).

Four public methods are really simple to use:

create, sending an output string and a Content-Type type to use cache if it's available (if not, forces next download to use cache)

createNew, sending an output and a Content-Type to force everytime the download (it's a must for Ajax interactions with XML, JSON or serialized strings)

createFromList, sending an array of files and a Content-Type to create a single generic output file including each file content and using create properties for output

createNewFromList, sending an array of files and a Content-Type to create a single generic output file including each file content and using createNew properties for output

That's all, do You like it ? :-)

Wednesday, December 20, 2006

PHP API Manager for Notepad++

I've used fantastic Komodo IDE to develop for a lot of time my Python/PHP web/desktop applications but now that my portable PC "has been regenerated" from SONY I'm spendig a lot of time to re-install everything I need.

My first favourite editor was ConTEXT, a fantastic, fast and powerful editor for every kind of program language but "my last love" has been Komodo that I've won on phpclasses.org.

Difference is amazing but there's just a problem .... Komodo is too much powerful and wants a lot of resources (I've not an extremely powerful VAIO) then I've choosed to install ConTEXT one more time but I've found, inside a forum, another famous editor as Notepad++ is and I don't know why I didn't try them before.

It's exactly what I need, a fast, simple, scite based, auto-completition enabled editor, then it's fantastic because I can write PHP as JavaScript, C and many other languages too !!!

Auto-completition is just what ConTEXT doesn't have but hey, it's a must to remember perfectly each kind of function or method because You can use them with CTRL and SPACE where You want then php.api file, as javascript.api files are a perfect solution to develop quickly without an api search engine under your nose ;-)


That's why I've created two really stupid PHP files to manage PHP API, one to create a personal installation dedicated api and one to update and mantain an api with old, unused or deprecated method too.

This is the readme file:

PHP API Manager - Andrea Giammarchi [http://webreflection.blogspot.com/]

These two simple phpfiles overwrite or create php.api file for Notepad++ program [http://notepad-plus.sourceforge.net/]

Usage:

- notepad.dedicated.api.php

call this file to create your personal PHP configuration api.
This script create php.api file for Notepad++ program overwriting, if present, precedent php.api file version.
Use this application if You don't need other not loaded/present extensions of your php installation.


- notepad.update.api.php

call this file to update your personal PHP configuration api or original Notepad++ default php.api file.
This script create php.api file for Notepad++ program overwriting, if present, precedent php.api file version.
Use this application if You want every other php functions too that shouldn't be present on your php installation.
Please remember to copy old php.api file inside this folder before to launch this application.


And this is the link of downloadable zip file with these two php scripts (on title too).

Have fun with Notepad++ :-)

Firefox Multiple Vulnerabilities ? Update in few hours !

The Highly critical Secunia Advisory of 2006-12-19 is not a problem, FireFox 2.0.0.1 has been released in few hours !!!

You don't need to download this new version if you have auto update feature enabled because your FireFox will update by itself in a "couple of seconds".

I wonder when Microsoft Internet Explorer released an multiple patches update the day after after and then I wonder why You've not yet installed FireFox on your Windows, Mac or Linux computer!

This is quite a record for a browser and this is the complete FireFox 2 veulnerability report ... just 2 vulnerabilities and just one of them unpatched and it's a less critical problem.

This is "your" Internet Explorer 6 vulnerability report and this is the last version 7 of, again, Internet Explorer Browser vulnerability report with 3 bugs, one of them moderately critical and any of them patched.

So c'mon guys, what are You waiting for ? GetFirefox ;-)