Archive for the ‘integration’ Category

Prototype styled Google Analytics javascript snippet

Monday, August 11th, 2008

Recently I’ve created a prototype styled javascript snippet to enable google analytics on one of my sites. Save this code in google.analytics.js file and include it from the head tag of the page just after including of the prototype.js:

gaTrackerId = 'ss-ddddddd-d'; // insert your tracker id here

document.observe('dom:loaded', function() {
var gaJsHost = (
('https:' == document.location.protocol)
? 'https://ssl.'
: 'http://www.'
) + 'google-analytics.com/ga.js';
var script = new Element('script', { 'src': gaJsHost});
var gaTrack = function() {
if (
!script.readyState
|| /loaded|complete/.test(script.readyState)
) {
var pageTracker = _gat._getTracker(gaTrackerId);
pageTracker._trackPageview();
}
};
script.observe('load', gaTrack);
script.observe('readystatechange', gaTrack);
document.body.appendChild(script);
});

Why Eclipse Equinox P2 Update Manager is not good enough for me yet

Friday, May 16th, 2008

As you all know in Eclipse 3.4 there is a new Update Manager (more correctly - Plug-in Manager) which is intended to be better.

The update managing side of it is an improvement indeed. But the first thing raised my alertness is there is no place to point where do I want my selected plug-ins to be installed. Well, I thought it’s just a default selection and manually downloaded the plug-ins and dropped them into the famous dropins directory (of course with keeping directory structure). And then after restarting eclipse I discovered that there is no such a thing like hierarchy of plug-ins and plug-in locations at all. That’s too bad.

Now, let’s say you installed all the plug-ins. Then if you want to update them, you don’t have a overall progress bar. And this is a network connection related progress. Isn’t it stupid?

Another glitch: My wireless connection to my neighbor’s hub suddenly aborted. So what does it do? It shows me an error dialog behind the modal dialog of progress information. I’m not even mentioning that there is no retry/ignore options.

Now they say: you can replace the new p2 with the good old Update Manager. But for that you must restore several configuration files from 3.3.2. I understand, this is my stupid mistake that I first completely destroyed my previous installation (I can allow it to myself at home), but it’s still annoying.

Zend Studio for Eclipse Release & cetera

Tuesday, January 22nd, 2008

Dear diary,

I have 2 news for you today.

  1. Today we successfully released Zend Studio for Eclipse. My contribution to it, beyond PDT commitments, is Sebastian Bergmann’s PHPUnit testing framework integration plug-in, File Network support, Organize Includes and other parts of Refactoring engine, Code Coverage browser… well, it seems that’s it. Maybe several additional, but minor things. Enjoy, guys. This is really a great (and some say - the best) PHP IDE.
  2. Occasionally, these are my last days at Zend Technologies. Since next week I’m starting at Nielsen Online (BuzzMetrics) to do text-mining. If you ask why, the answer is simple - I got bored of Zend, where I spent last 6.5 years of my life, and wanted to do something really new and exciting. I hope it will work :) For now I’m planning to stay an Eclipse committer and continue to help my brothers at Zend to move on.

Source

Debug PHP and JavaScript simultaneously

Saturday, October 20th, 2007

Yesterday me and Roy had a brainstorm session on future Zend Neon (Commercial version of PDT) and ATF integration and “occidently” found a way of debugging of an URL with both Zend’s PHPand Mozilla’s JavaScript debuggers in one session.

Surprise! It’s possible with neither patching nor hacking. I’m not going to show the exact steps of this, but the idea is very simple:

As you probably don’t know, to debug URL on a server which has Zend Debugger installed it’s enough to pass several simple parameters with the HTTP request (either in the query string or as cookies), like client IP and port, debug type etc., to start the debug session. Afterwards the debugger contacts the client machine, where a Neon’s Debug Daemon listens for incoming connections. The Daemon then raises up a new Launch Configuration.

When Neon’s Debug URL action is executed, it just appends the needed debug parameters to the passed URL and sends the updated URL either to the browser. Just grab this URL and start Mozilla JavaScript Debug Launch with it!

As the result 2 simultaneous launch configurations will start; the first activated session will be PHP’s one and then, after the browser will start receiving content from the server, JavaScript’s one will come into the picture.

Voila!

Moreover, if you enabled all-pages (cookie based) PHP debugging, it will go further with your AJAX (AJAH/AJAJ) requests!

Now the only problem :) is you cannot set breakpoints of both PHP and JavaScript types in the PHP source file, since it doesn’t match the final responce which will be passed to the browser, so you should enable the option to suspend the JavaScript execution immediately after it starts to add breakpoints to the responce HTML source.

  • You are currently browsing the archives for the integration category.
  • Pages

  • Archives

  • Categories