Today's post is quite full of wonderful chunks of details :)

First, people need to stop using Internet Explorer, it's just a retarded browser that can't render
the simplest things.

After struggling with making Shadows & Rounded Corners, using so many plugins I can't even remember
(to name a few), anyways, at the end I just came up with a simple stupid solution for a stupid browser:

Want a Shadow with Corners on your IE? Just add it as a Background Image, 1995 style.

Second thing I've dealt with today, is a strange bug that iPhone has with jQuery 1.5, for some reason it simply
won't work... Not to mention that Safari and Chrome are more than capable of rendering websites without any issue.
For those of you who are developing with jQuery, I encourage you to test it with an iPhone (and not one of those online emulators, because they don't emulate properly).
And as an easy fix here's a small script that does a checkup and chooses another jQuery version:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
<script type="text/javascript">
function addJavascript(jsname,pos) {
  var th = document.getElementsByTagName(pos)[0];
  var s = document.createElement('script');
  s.setAttribute('type','text/javascript');
  s.setAttribute('src',jsname);
  th.appendChild(s);
}
var agent=navigator.userAgent.toLowerCase();
var is_iphone = ((agent.indexOf('iphone')!=-1));
if (is_iphone) {
  addJavascript('jquery-1.4.2.min.js','head');
}
else {
  addJavascript('jquery-1.5.min.js','head');
}
</script>

Pretty clever, aint it? :)

Third thing, is how to generate entities (previously called Models) in Doctrine 2.0,
Took my way too much time to figure that out, those guys should make the documentation a little clearer
(and hopefully more full of examples):
in doctrine-orm/bin/
naturally you have to fill in the cli-config.php file before hand, example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/*
 * Doctrine
 */
require_once(dirname(__FILE__) . '/../Doctrine/Common/ClassLoader.php');
$classLoader = new DoctrineCommonClassLoader('Doctrine', dirname(__FILE__) . '/doctrine-orm/');
$classLoader->register();
use DoctrineORMEntityManager,
    DoctrineORMConfiguration;
$config = new Configuration;
/* configuration MetaData Driver (the format of the models files) */
$driver = new DoctrineORMMappingDriverPHPDriver(dirname(__FILE__).'/../../models/');
$config->setMetadataDriverImpl($driver);
$cache = new DoctrineCommonCacheArrayCache;
$config->setMetadataCacheImpl($cache);
$config->setQueryCacheImpl($cache);
$config->setProxyDir('proxies/');
$config->setProxyNamespace('proxies/');
$config->setAutoGenerateProxyClasses(true);
/*if ($applicationMode == "development") {
    $config->setAutoGenerateProxyClasses(true);
} else {
    $config->setAutoGenerateProxyClasses(false);
}*/
$connectionOptions = array(
    'driver' => 'pdo_mysql',
    'user' => 'user',
    'host' => 'localhost',
    'password' => 'password',
    'dbname' => 'databaseNAME',
    /*'path' => 'database.mysql',*/
);
$em = EntityManager::create($connectionOptions, $config);
$helperSet = new SymfonyComponentConsoleHelperHelperSet(array(
    'db' => new DoctrineDBALToolsConsoleHelperConnectionHelper($em->getConnection()),
    'em' => new DoctrineORMToolsConsoleHelperEntityManagerHelper($em)
));
$tool = new DoctrineORMToolsSchemaTool($em);
?>
afterwards simply write in command line
1
 php doctrine orm:convert-mapping --form-database php /path/to/entities/