Warning: strpos() [function.strpos]: needle is not a string or an integer in /home/chaosorg/bugfeatures.com/blog/index.php on line 49
Bug Features - Free bug report and feature request service for your Web site. - BrowserSeal.BrowserPack - 10 browsers in 1
BrowserSeal.BrowserPack - 10 browsers in 1 
I've been using IETester for years but today I stumbled upon another browser package called BrowserSeal.BrowserPack that not only includes IE5.5/6/7/8, but also IE 1/2/3/4, Opera 8/9/10, Firefox 3/3.5 and Safari 3/4. Not a bad effort! Unlike IETester which executes all the browsers in a single tabbed window, BrowserSeal.BrowserPack is really just a collection of portable browser versions, so you are left running 10 windows instead of one. What I suggest is not installing the IE browsers in BrowserSeal.BrowserPack and continue using IETester instead.

PS: And if you want to run Firebug in your 10 new browsers you can bookmark the Firebug Lite bookmarklet and you get almost the same featureset as the native firefox extension gives you!
  |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 3 / 1779 )
Dynarch calendar and IE7 
OK here's one that might save you some time. I have a symfony admin gen site that works fine in all browsers but for some reason the rich calendar inputs failed to appear in IE7.

At first I thought this might have been the reason:

http://forum.symfony-project.org/index.php/m/58074/

But my calendar.js was already patched!

It turns out that you have an object in the DOM with an ID of "content" then you might find that any Dynarch calendars appear off-screen in IE7 only!

Rename your element to something else and it starts working. Don't ask me why, I can't find any reference to 'content' in the calendar script files. It's just one of those quiry things that makes you even more convinced that hating IE7 is completely justifiable!
  |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 3 / 1677 )
Symfony 2 hits the streets 
It's still very early days, but Symfony 2 now has it's own site with some introductory material included. You can get the code and read about the framework - although there's no side-by-side comparison with symfony 1.4.

Now that versions 1.0, 1.1 and 1.2 are all officially dead (and 1.3 being a transitional version from 1.2) it looks like 1.4 will be the last stepping stone before 2.0.

And what's so different about sf2? Well for starters it looks like every component of the symfony framework has been decoupled into what they are calling "bundles". Hmm, that sounds a bit like Zend doesn't it? Interestingly, the Zend framework is one of the core symfony 2 bundles! Whoop! I guess that means you could use the Zend MVC in place of the Symfony one, hypothetically...

Additionally, your app is a bundle, too - although I can't think of any real expedient here as I doubt your app will be of much use without the other bundles. Perhaps this allows you to easily unplug it from synfony 2 and move it somewhere else... in a parallel universe perhaps.

Ironically, the sf2 site also publishes some "hello world" benchmarks which, while impressive, are still subject to the criticisms thrown at earlier benchmark results where symfony did not do so well - hello world is not an application where a framework is useful etc. Anyway here are the stats:

For the "Hello World" application, the Symfony 2.0 is about:

* 20% faster than Solar 1.0.0beta3
* 60% faster than Lithium 0.6
* 75% faster than Yii 1.1.1
* 2 times faster than symfony 1.4.2
* 3.5 times faster than Zend 1.10
* 5.5 times faster than CakePHP 1.2.6
* 69 times faster than Flow3 1.0.0alpha7

Anyway, it doesn't look to me like symfony is getting easier, but it is definately getting better. I am particularly looking forward to the new debug toolbar:




  |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 3 / 1552 )
Check your water cooling 
Do you use water cooling? Well my advice is put a calendar item to check it monthly. And run a CPU temp app at all times. You see today after 3 years of smooth sailing my reservoir ran dry, cooked my cpu and then (after I quickly refilled it) sprayed water all over the motherboard, video card and power board, killing everything and short-circuiting the entire house.

Woohoo!
  |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 3 / 1503 )
Zend Mail mangles email text 
Had this strange problem ever since we upgraded a Symfony site from 1.0 to 1.2 - the emails being logged to the database were being mangled.

The problem turns out to be simply that the symfony 1.2 swToolkit plugin uses Zend Mail instead of phpMailer and Zend Mail spits out encoded text when you ask it for the email text or HTML contents.

So the simple fix is to wrap the data you get out of Zend Mail with the obscure quoted_printable_decode() function as shown here:

$message = quoted_printable_decode($zendEmail->getBodyHtml()->getContent());
$text = quoted_printable_decode($zendEmail->getBodyText()->getContent());

There, that gets rid of all those =0D=0A characters everywhere!

Note that you would think you could avoid this simply by passing the line ending explicitly, but it does not work:
//this does *NOT* work!
$message = $zendEmail->getBodyHtml()->getContent("\r\n");
$text = $zendEmail->getBodyText()->getContent("\r\n");

  |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 3 / 1503 )
Sendmail woes 
I have battled postfix, qmail and sendmail for years - and my latest trouble involved sendmail trying to route emails to local (non-existant) users, even though the domains in question were not in the local domains config.

After running around in config circles for a couple of hours it turns out that if you set the server's hosts to include your domains, sendmail will assume local delivery for those domains.

That is even if you have sendmail configured not to (ie: in /etc/mail/local-host-names). It even ignores your virtusertable with explicit instructions to forward mail for those domains elsewhere.

Go figure. Hope this helps someone.
  |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 3 / 1450 )
Restore single table from HUGE mysqldump file 
That's one of the problems with 'enterprise' websites - huge databases. Knowing that everything is backed up, it is occasionally tempting to run some ad-hoc handmade 'looks about right' SQL statements every now and then - and occasionally they don't work out too well.

As it happens, restoring a table from a 5GB SQL backup can actually be a pretty time consuming task, not to mention tedious.

Faced with this slightly daunting task I did what I usually do when faced with daunting tasks - checked how other people did it :)

So a big thanks to ThatsLinux for sharing a nice little shell script that takes the pain out of extracting one little table from a mammoth sql script. Kudos.

ThatsLinux
  |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 3 / 1439 )
Chrome Explorer 
All right now Google are installing Chrome inside Internet Explorer so now Microsoft can claim to have a standards compliant browser. But what I'm excited about is viewing it all inside Firefox with the ieTab plugin!

That's Firefox rendering Internet Explorer rendering Chrome.

Now somebody create a chrome plugin that uses the Opera rendering engine or - even better - the Firefox rendering engine!

Whoop!
  |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 3 / 1484 )
Integrated framework commands 
When I get the urge to run a symfony command from an explorer window I have a few options...

Command prompt here
Well this is handy but you still have to type out your command. Fortunately I have PowerCmd which lets you save common commands and make them toolbar buttons.

Directory Opus
My favourite explorer replacement lets me type commands directly into the toolbar - and it *remembers* the history of commands. Nice.



XYplorer
Another good file manager - and a bit more lightweight than Directory Opus - has a great scripting engine. Check this out:

::if (confirm("propel-build-ALL?!")){
run 'php symfony propel-build-all',<curpath>
}

That's not bad. And you can make it a favourite (category) that will execute on the current activated folder. Again, nice.



PhpEd
Well this isn't exactly an explorer replacement, but seeing as though I never close my IDE it is technically a file manager ;) And as I posted here, you can add scripts to the right-click menu. The biggest drawback is that you can't put < characters in your scripts, which means you can't load sql files into mysql without requiring a seperate DOS batch file.


  |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 3 / 1441 )
Modify view for an environment 
This is something that has been discussed in the Symfony google groups but was unresolved - how to modify a view configuration based on the environment. Some developers say you should not be doing this, as the view should be the same in all environments, but let me explain why I needed do do it...

I have some javascripts loaded from google to speed up my sites - anyone who has used the Yahoo YSlow plugin for FireBug will be familiar with the "F" rating for content delivery networks (CDN) score. But I have a developer on my team who works offline and wants to be able to develop locally without having to constantly modify all the view.yml files (and there are a few!) for each app.

So, although it would be nice to be able to specify an environment in the view.yml the same way you can in the settings.yml, some folks forget that you can put PHP code in your view.yml to be evaluated at runtime (or at least read from the cache at runtime!).

So, this is how we manage to serve google's minified high speed Javascript libraries in the "live" environment but use local copies elsewhere:
default:
javascripts:
- <?php echo (strpos(SF_ENVIRONMENT,"live")!==false?'http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.3/prototype.js':'/js/prototype').PHP_EOL ?>
- <?php echo (strpos(SF_ENVIRONMENT,"live")!==false?'http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.2/scriptaculous.js?load=effects':'/js/scriptaculous/scriptaculous.js?load=effects').PHP_EOL ?>

Damn, that was easy, wasn't it?
:-)
  |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 3 / 1369 )

Back Next