<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>iTopiaBlog</title>
	<atom:link href="http://blog.itopia.de/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.itopia.de</link>
	<description>liVe iN oRder tO lEArN</description>
	<lastBuildDate>Thu, 23 Feb 2012 14:17:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>jQuery: Problem with hidden selectbox</title>
		<link>http://blog.itopia.de/jquery-problem-with-hidden-selectbox/378</link>
		<comments>http://blog.itopia.de/jquery-problem-with-hidden-selectbox/378#comments</comments>
		<pubDate>Thu, 23 Feb 2012 14:17:02 +0000</pubDate>
		<dc:creator>TBA</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[SelectBox]]></category>

		<guid isPermaLink="false">http://blog.itopia.de/?p=378</guid>
		<description><![CDATA[I use the jQuery SelectBox Plugin for a select box in a hidden DIV container. The problem was that after removing<a href="http://blog.itopia.de/jquery-problem-with-hidden-selectbox/378" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>I use the<strong> jQuery SelectBox Plugin</strong> for a select box in a hidden DIV container. The problem was that after removing the hidden CSS class from the container, the jQuery SelectBox was empty. I thought that maybe it is in correlation with this statement from <a href="http://www.abeautifulsite.net/blog/2011/01/jquery-selectbox-plugin/">A Beautiful Site</a>:</p>
<blockquote><p>Since the original controls aren’t destroyed (they’re hidden), you can  easily integrate this plugin into just about any existing form.</p></blockquote>
<p>so the only way to get the SelectBox filled correctly was to first destroy  and then reinitialize it (see the code snippet below).</p>
<pre class="brush:plain">&lt;style&gt;

.hidden {
  display: none;
}

&lt;/style&gt;

&lt;script&gt;
$(document).ready(function() {

  $('#show').bind("click", function(){

     $('#container').removeClass('hidden');
     $("#container select").selectBox('destroy');
     $("#container select").selectBox();

  });

  $("select").selectBox();

});
&lt;/script&gt;

&lt;a id="show" href="#"&gt;show&lt;/a&gt;

&lt;div id="container" class="hidden"&gt;
  &lt;select&gt;...&lt;/select&gt;
&lt;/div&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.itopia.de/jquery-problem-with-hidden-selectbox/378/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Symfony 1.4: symfony generator Invalid column name &#8216;id&#8217;</title>
		<link>http://blog.itopia.de/symfony-1-4-generator-invalid-column-name-id/375</link>
		<comments>http://blog.itopia.de/symfony-1-4-generator-invalid-column-name-id/375#comments</comments>
		<pubDate>Fri, 17 Feb 2012 15:29:56 +0000</pubDate>
		<dc:creator>TBA</dc:creator>
				<category><![CDATA[Doctrine]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[doctine]]></category>
		<category><![CDATA[generator]]></category>
		<category><![CDATA[schema]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://blog.itopia.de/?p=375</guid>
		<description><![CDATA[It seems that the symfony generator needs a primary key. If there&#8217;s no PK defined the generator throws the following<a href="http://blog.itopia.de/symfony-1-4-generator-invalid-column-name-id/375" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>It seems that the symfony generator needs a primary key. If there&#8217;s no PK defined the generator throws the following exception:</p>
<blockquote><p>symfony generator Invalid column name &#8216;id&#8217;</p></blockquote>
<p>In some blog post they solved the problem by adding a primary key to the concerning table. But in my case the DB isn&#8217;t under my control, so I found out that it is enough to set the primary key only in the schema.</p>
<p>For instance:</p>
<pre class="brush:plain">my_table:
  connection: doctrine
  tableName: MyTable
  columns:
    id:
      type: int(11)
      primary: true  # &lt;-- SET TO true
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.itopia.de/symfony-1-4-generator-invalid-column-name-id/375/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Azure: Compute Emulator: Can&#8217;t locate service model</title>
		<link>http://blog.itopia.de/windows-azure-compute-emulator-cant-locate-service-model/370</link>
		<comments>http://blog.itopia.de/windows-azure-compute-emulator-cant-locate-service-model/370#comments</comments>
		<pubDate>Thu, 26 Jan 2012 16:41:30 +0000</pubDate>
		<dc:creator>TBA</dc:creator>
				<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Windows Azure]]></category>
		<category><![CDATA[csrun]]></category>
		<category><![CDATA[emulator]]></category>
		<category><![CDATA[package]]></category>

		<guid isPermaLink="false">http://blog.itopia.de/?p=370</guid>
		<description><![CDATA[Just to share, if you get this error messag: The compute emulator had a error: Can&#8217;t locate service model.. for<a href="http://blog.itopia.de/windows-azure-compute-emulator-cant-locate-service-model/370" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>Just to share, if you get this error messag:</p>
<blockquote><p>The compute emulator had a error: Can&#8217;t locate service model..</p></blockquote>
<p>for instance when starting &#8220;<em>package create &#8230;</em>&#8220;, the problem could be a too deep project folder structure. In my case caused by the file cache directory of my application. After clearing this directory everything was ok.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.itopia.de/windows-azure-compute-emulator-cant-locate-service-model/370/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Azure: Custom PHP installation</title>
		<link>http://blog.itopia.de/windows-azure-custom-php-installation/366</link>
		<comments>http://blog.itopia.de/windows-azure-custom-php-installation/366#comments</comments>
		<pubDate>Wed, 25 Jan 2012 10:02:43 +0000</pubDate>
		<dc:creator>TBA</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Windows Azure]]></category>

		<guid isPermaLink="false">http://blog.itopia.de/?p=366</guid>
		<description><![CDATA[I write this article because of an odyssey of bug tracing concerning my PHP application hosted in the Windows Azure<a href="http://blog.itopia.de/windows-azure-custom-php-installation/366" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>I write this article because of an odyssey of bug tracing concerning my PHP application hosted in the Windows Azure cloud.</p>
<p>Before the <a href="http://www.microsoft.com/web/gallery/install.aspx?appid=WindowsAzureToolsVS2010">Windows Azure SDK 1.6</a> the configuration of PHP with Fast CGI was done in the <em>Web.config</em>. Here you could define the exact path of your custom PHP.</p>
<p>Now with the SDK 1.6 and the different folder structure defined by the scaffolder, the integration of PHP has changed. The new way is to install PHP automatically by the predefined startup scripts. So you don&#8217;t need to put the whole PHP stuff into your package. You just add your <em>php.ini</em> modifications and maybe your special PHP extension DLLs.</p>
<p>Now, when you deploy your package the startup scripts will add some environment variables,  install PHP53, SQLDriverPHP53IIS and PHPManager.</p>
<p>That&#8217;s all quite cool, but last week my live application crashed (WORST CASE!) without any modifications by my side. I could not find the problem. A few days ago I recognized that on the compute instances runs a different PHP version than on my local dev environment. I could not figure out how this could happen. But since I know that the startup script uses <strong>webpicmdline </strong>(Web Plattform Installer for Commandline) to <a href="http://msdn.microsoft.com/en-us/library/windowsazure/hh691735%28v=vs.103%29.aspx">install the PHP</a> stuff (s.o.) it&#8217;s clear to me. The WebPI always takes the newest PHP version for installation, and it&#8217;s not possible to set up a specific version number. In my case in need PHP 5.3.8 but WebPI installs PHP 5.3.9 which crashes my application with an ugly PHP53_via_FastCGI  Error Code 0xc0000005.</p>
<p>Ok, how can I tell Azure to take my PHP version. The only way is to again put the whole PHP folder into the deployment package as explained in this <a href="http://azurephp.interoperabilitybridges.com/articles/using-a-custom-php-installation">tutorial</a>.</p>
<p>I for my use case I needed to do it a little bit different:</p>
<ul>
<li>I put the PHP folder into <em>MyProject\WebRole\bin\PHP\v5.3\php-cgi.exe</em></li>
<li>The extensions are in <em>MyProject\WebRole\bin\PHP\v5.3\ext\</em></li>
<li>In <em>configureIIS.cmd</em> I changed <code>SET PHP_FULL_PATH=%~dp0php\php-cgi.exe </code>to<code> </code><code>SET PHP_FULL_PATH=%~dp0<strong>PHP\v5.3</strong>\php-cgi.exe</code></li>
<li>To add the environment variables I leave <em>add-environment-variables.cmd</em> as it was</li>
<li>To set user permission I leave <em>monitor-environment.cmd</em> as it was</li>
</ul>
<p>These changes bring some small losings (with which I can live):</p>
<ul>
<li>SQLDriverPHP53IIS needs to be installed manually (<a href="http://msdn.microsoft.com/de-de/library/cc296170%28v=sql.90%29.aspx">ext\php_sqlsrv_53_nts_vc9.dll</a> [<a href="http://dll-files.org/10808/php_sqlsrv_53_nts_vc9.dll.html">2</a>]).</li>
<li>No IIS PHPManager (Maybe it&#8217;s possible to install it by modifing the<em> install-php.cmd</em>).</li>
</ul>
<p>The startup script part in my <em>ServiceDefinition.csdef</em> now looks like:</p>
<pre class="brush:xml">    &lt;Startup&gt;
      &lt;Task commandLine="add-environment-variables.cmd" executionContext="elevated" taskType="simple" /&gt;
      &lt;Task commandLine="installCustomPHP.cmd" executionContext="elevated" taskType="simple"&gt;
        &lt;Environment&gt;
          &lt;Variable name="EMULATED"&gt;
            &lt;RoleInstanceValue xpath="/RoleEnvironment/Deployment/@emulated" /&gt;
          &lt;/Variable&gt;
        &lt;/Environment&gt;
      &lt;/Task&gt;
      &lt;Task commandLine="monitor-environment.cmd" executionContext="elevated" taskType="background" /&gt;
    &lt;/Startup&gt;</pre>
<p>I renamed the <em>configureIIS.cmd</em> from the tutorial to <em>installCustomPHP.cmd</em>.</p>
<p><strong>One thing</strong>: It very strange to make the experience as Azure PHP developer that there are sometime changes within the Azure Plattform which are crashing my live application. And I have no chance to get warned/informed early enough to fix the problems before my customers get a blank page.</p>
<p>Corrections, tips and hints are welcome <img src='http://blog.itopia.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Links:</strong></p>
<ul>
<li><a href="http://www.microsoft.com/web/gallery/install.aspx?appid=WindowsAzureToolsVS2010">Windows Azure SDK 1.6</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/windowsazure/hh691735%28v=vs.103%29.aspx">How to use WebPI to install PHP</a></li>
<li><a href="http://azurephp.interoperabilitybridges.com/articles/using-a-custom-php-installation">Using a custom PHP installation</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.itopia.de/windows-azure-custom-php-installation/366/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Azure SDK 1.6 Update &amp; Windows Azure for PHP</title>
		<link>http://blog.itopia.de/windows-azure-sdk-1-6-update-php/348</link>
		<comments>http://blog.itopia.de/windows-azure-sdk-1-6-update-php/348#comments</comments>
		<pubDate>Fri, 02 Dec 2011 11:38:44 +0000</pubDate>
		<dc:creator>TBA</dc:creator>
				<category><![CDATA[Could Computing]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Windows Azure]]></category>
		<category><![CDATA[Windows Azure for PHP]]></category>
		<category><![CDATA[Windows Azure SDK 1.6]]></category>

		<guid isPermaLink="false">http://blog.itopia.de/?p=348</guid>
		<description><![CDATA[Windows Azure came up with a new SDK update &#8220;Windows Azure SDK 1.6&#8243;. In our case it brought a lot<a href="http://blog.itopia.de/windows-azure-sdk-1-6-update-php/348" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>Windows Azure came up with a new SDK update &#8220;Windows Azure SDK 1.6&#8243;.</p>
<p>In our case it brought a lot of hair tearing chances with it. Because so far we developed our PHP application with eclispe and the out-dated  <a href="http://www.windowsazure4e.org/">windowsazue4e</a> Plugin.</p>
<p>Eclipse presetting for the folder structure was like this:</p>
<pre class="brush:plain">C:\WindowsAzurePHPApp
|_ ServiceDefinition.csdef
|_ ServiceConfiguraion.cscfg
|_ ServiceDefinition.csx (Development approot folder)
|_ WindowsAzurePHPApp.cspkg (Package file)

C:\WindowsAzurePHPApp_WebRole
|_ php
|_ Web.config
|_ Web.roleconfig
|_ index.php</pre>
<p>Whereas the new <a href="http://azurephp.interoperabilitybridges.com/articles/build-and-deploy-a-windows-azure-php-application#h2Section4">scaffolding</a> advices the following structure:</p>
<pre class="brush:plain">C:\WindowsAzurePHPApp
|_ ServiceDefinition.csdef
|_ ServiceConfiguraion.cscfg
|_ WebRole
|_ build
|    |_ [Local dev. package files]
|_ pack [Package files]
|    |_ WindowsAzurePHPApp.cspkg
|    |_ ServiceConfiguraion.cscfg
|_ php
|    |_ [The whole PHP libs]
|_ bin
|    |_ [Start up scripts]
|_ index.php</pre>
<p>Command to run the development build:</p>
<pre class="brush:shell">package create -in="C:\temp\WindowsAzurePHPApp"
   -out="C:\temp\WindowsAzurePHPApp\build" -dev=true</pre>
<p>Command to generate the cloud package:</p>
<pre class="brush:shell">package create -in="C:\temp\WindowsAzurePHPApp"
   -out="C:\temp\WindowsAzurePHPApp\pack" -dev=false</pre>
<p>&nbsp;</p>
<p><strong>Preparing everything:</strong></p>
<ol>
<li><a href="http://www.microsoft.com/windowsazure/sdk">Get the Windows Azure SDK<br />
</a>The best way is it to use the Windows Web Platform Installer. Follow step by step the instructions <a href="http://azurephp.interoperabilitybridges.com/articles/setup-the-windows-azure-development-environment-automatically-with-the-microsoft-web-platform-installer">here</a>.<a href="http://www.microsoft.com/windowsazure/sdk"></a></li>
<li>Get the new <a href="http://phpazure.codeplex.com/">WindowsAzure for PHP SDK</a>.<br />
Set it up step by step using the instructions <a href="http://azurephp.interoperabilitybridges.com/articles/setup-the-windows-azure-sdk-for-php">here</a>.<br />
If you use classes from this SDK within your project you should also put a copy into your project itself.</li>
</ol>
<p><strong>What to change after the SDK update:</strong></p>
<ol>
<li><strong>Generate a sample project:</strong><br />
To have a clean sample project for copying the needed parts to the our project we generate it by using the new scaffoldig functionality of the <a href="http://phpazure.codeplex.com/">WindowsAzure for PHP SDK</a>:<br />
Open the command line and run:&nbsp;</p>
<pre class="brush:shell">scaffolder run -out="C:\temp\WindowsAzurePHPApp"</pre>
<p>Now we have clean and simple sample project.<br />
Test everything by following these <a href="http://azurephp.interoperabilitybridges.com/articles/build-and-deploy-a-windows-azure-php-application#h2Section4">steps</a>.</p>
<p><strong> </strong></li>
<li><strong>Move the sources into the new folder structure:<br />
</strong>Rebuild the sample structure for our project and move your files into it.<strong> </strong>&nbsp;</p>
<ul>
<li>Replace the <em>php-folder</em> with the php folder in c:\program files\PHP\v5.3 (installed with the Web Platform Installer) and edit the <em>php.in</em>i with your settings.<br />
Set the xtension directory to:&nbsp;</p>
<pre class="brush:plain">extension_dir="ext"</pre>
</li>
<li>Replace the old <em>bin-folder</em> with the bin folder of the sample project.</li>
<li>Edit the PHP-paths within cmd-scripts in the <em>bin-folder</em>.</li>
</ul>
<p><strong> </strong></li>
<li><strong>ServiceDefinition.csdef configuration: </strong>
<ul>
<li>Add the <a href="http://msdn.microsoft.com/en-us/library/gg557553.aspx#Sites">Sites-Element</a>.</li>
<li>Add the Startup-Element for the PHP installation.</li>
</ul>
<pre class="brush:xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;ServiceDefinition name="WindowsAzurePHPApp" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition"&gt;
  &lt;WebRole enableNativeCodeExecution="true" name="WebRole" vmsize="ExtraSmall"&gt;
    &lt;Sites&gt;
      &lt;Site name="Web" physicalDirectory="./WebRole"&gt;
        &lt;Bindings&gt;
          &lt;Binding name="HttpIn" endpointName="HttpIn" /&gt;
        &lt;/Bindings&gt;
      &lt;/Site&gt;
    &lt;/Sites&gt;
    &lt;Startup&gt;
      &lt;Task commandLine="add-environment-variables.cmd" executionContext="elevated" taskType="simple" /&gt;
      &lt;Task commandLine="install-php.cmd" executionContext="elevated" taskType="simple"&gt;
        &lt;Environment&gt;
          &lt;Variable name="EMULATED"&gt;
            &lt;RoleInstanceValue xpath="/RoleEnvironment/Deployment/@emulated" /&gt;
          &lt;/Variable&gt;
        &lt;/Environment&gt;
      &lt;/Task&gt;
      &lt;Task commandLine="monitor-environment.cmd" executionContext="elevated" taskType="background" /&gt;
    &lt;/Startup&gt;
    &lt;InputEndpoints&gt;
      &lt;InputEndpoint name="HttpIn" port="80" protocol="http"/&gt;
    &lt;/InputEndpoints&gt;
    &lt;ConfigurationSettings&gt;
      ...
    &lt;/ConfigurationSettings&gt;
  &lt;/WebRole&gt;
&lt;/ServiceDefinition&gt;</pre>
</li>
<li><strong>ServiceConfiguraion.cscfg configuration:</strong><br />
Add the <em>osFamily </em>and <em>osVersion </em>attributes:&nbsp;</p>
<pre class="brush:xml">&lt;ServiceConfiguration serviceName="Stats" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="2" osVersion="*"&gt;
...
&lt;/ServiceConfiguration&gt;</pre>
</li>
<li><strong>Web.config configuration:</strong>
<ul>
<li>Remove the Handlers-Element for PHP via FastCGI (By now on this will be handled by the startup scripts)</li>
</ul>
</li>
</ol>
<p>&nbsp;</p>
<p><strong>Important changes with the new SDK:</strong></p>
<ul>
<li>$_SERVER['RoleRoot'] doesn&#8217;t exist anymore.</li>
<li>$_SERVER['INSTANCE_ID']  doesn&#8217;t contain a local Instance number like &#8220;1&#8243; or &#8220;2&#8243; anymore. It seams that  it&#8217;s now a global number like &#8220;16325987&#8243;.<br />
Alternativly you can use [RoleInstanceID] =&gt; WebRole_IN_0.</li>
<li>$_SERVER['TEMP'] is not the same drive like the accessable <a href="http://msdn.microsoft.com/en-us/library/gg557553.aspx#LocalStorage">local storage</a> any more, so you can&#8217;t use it to locate the current letter of the accessable this drive. I don&#8217;t know if it&#8217;s always &#8220;<strong>c:\</strong>&#8220;.</li>
<li>The PHP method <strong>azure_getconfig(&#8216;StorageAccountName&#8217;)</strong> does not exist anymore. This method could be used to get the setting values of the ServiceConfiguration.cscnf.<br />
Even if I copy the php_azure.dll of the old project into the new one and enabling the extension (extension=php_azure.dll) in th ephp.ini, it does not work.</li>
<li>The file Web.roleconfig is deprecated.</li>
</ul>
<p><strong> </strong></p>
<p>&nbsp;</p>
<p><strong>Links:</strong></p>
<ul>
<li><a href="http://www.microsoft.com/windowsazure/sdk">Windows Azure SDK for PHP</a></li>
<li><a href="http://azurephp.interoperabilitybridges.com/articles/setup-the-windows-azure-sdk-for-php">Setup the Windows Azure SDK for PHP</a></li>
<li><a href="http://azurephp.interoperabilitybridges.com/articles/build-and-deploy-a-windows-azure-php-application">Build and deploy a Windows Azure PHP application</a></li>
<li><a href="http://azurephp.interoperabilitybridges.com/articles/setup-the-windows-azure-development-environment-automatically-with-the-microsoft-web-platform-installer">Setup the Windows Azure Development Environment automatically with the Microsoft Web Platform Installer</a></li>
<li><a href="http://phpazure.codeplex.com/discussions/281065">Windows Azure SDK 1.6 Update PHP Discussion</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/gg557553.aspx">ServiceDefinition Schema</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/ee758710.aspx">Service Configuration Schema</a></li>
<li><a href="http://blogs.msdn.com/b/silverlining/archive/2011/11/23/packaging-a-custom-php-installation-for-windows-azure.aspx">Packaging a Custom PHP Installation for Windows Azure</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.itopia.de/windows-azure-sdk-1-6-update-php/348/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Symfony 1.4: Doctrine: There is no open connection</title>
		<link>http://blog.itopia.de/symfony-1-4-doctrine-there-is-no-open-connection/342</link>
		<comments>http://blog.itopia.de/symfony-1-4-doctrine-there-is-no-open-connection/342#comments</comments>
		<pubDate>Wed, 31 Aug 2011 15:04:25 +0000</pubDate>
		<dc:creator>TBA</dc:creator>
				<category><![CDATA[Doctrine]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Connection]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://blog.itopia.de/?p=342</guid>
		<description><![CDATA[When you have this problem just go into your controler e.g. index.php and add the following line: $configuration = ProjectConfiguration::getApplicationConfiguration('frontend',<a href="http://blog.itopia.de/symfony-1-4-doctrine-there-is-no-open-connection/342" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>When you have this problem just go into your controler e.g. index.php and add the following line:</p>
<pre><code>
<pre class="brush:php">$configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'test', true);
new sfDatabaseManager($configuration);
</pre>
<p></code></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.itopia.de/symfony-1-4-doctrine-there-is-no-open-connection/342/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Symfony: Instruct browser to refresh CSS and JS files</title>
		<link>http://blog.itopia.de/symfony-instruct-browser-to-refresh-css-and-js-files/339</link>
		<comments>http://blog.itopia.de/symfony-instruct-browser-to-refresh-css-and-js-files/339#comments</comments>
		<pubDate>Fri, 13 May 2011 13:31:30 +0000</pubDate>
		<dc:creator>TBA</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://blog.itopia.de/?p=339</guid>
		<description><![CDATA[In Symfony the stylesheets and javascript files are defined in the view.yml. Sometimes the problem appears that the browsers cache<a href="http://blog.itopia.de/symfony-instruct-browser-to-refresh-css-and-js-files/339" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>In Symfony the stylesheets and javascript files are defined in the <strong><em>view.yml</em></strong>. Sometimes the problem appears that the browsers cache these files, even if there where some changes in the last release without refreshing the new contents.</p>
<p>There is a common technique to instruct the browser to take the new file version: Browsers store different file versions for different GET paramters. So if you include a CSS file like this:</p>
<pre class="brush:xml">&lt;script type="text/javascript" src="css/styles.css?v=21"&gt;&lt;/script&gt;</pre>
<p>and in the next version with a higher version number (v=22), the browser will use  (and cache) the newer version.</p>
<p>In our case we save the current version number (SVN) into the <em><strong>app.yml</strong></em> and we use this number as increasing GET-Parameter to force a cache refresh:</p>
<pre class="brush:plain">default:
  stylesheets: [styles.css?v=&lt;?php echo sfConfig::get('app_revision'); ?&gt;]</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.itopia.de/symfony-instruct-browser-to-refresh-css-and-js-files/339/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Symfony cache folder on Windows Azure</title>
		<link>http://blog.itopia.de/symfony-cache-folder-on-windows-azure/330</link>
		<comments>http://blog.itopia.de/symfony-cache-folder-on-windows-azure/330#comments</comments>
		<pubDate>Thu, 12 May 2011 15:53:44 +0000</pubDate>
		<dc:creator>TBA</dc:creator>
				<category><![CDATA[Could Computing]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Windows Azure]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://blog.itopia.de/?p=330</guid>
		<description><![CDATA[I had the problem, that symfony had no write permissons to create the cache files in the Windows Azure approot<a href="http://blog.itopia.de/symfony-cache-folder-on-windows-azure/330" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>I had the problem, that symfony had no write permissons to create the cache files in the Windows Azure approot folder.</p>
<p>After some research I found out, that it is possible to allocate local storage where the role user has write permissions. The disadvantage though is, that the local storage is not persistent, that means, it will be reset after role upgrades, instance reimage or reboots. But for caching I don&#8217;t need a persistent storage.</p>
<p>To get it running you need the folowing settings:</p>
<p><strong>ServiceDefinition.csdef</strong></p>
<p>Define a local resource, in this case with the folder name &#8220;FileCacheStorage&#8221; and the size 1000MB:</p>
<pre class="brush:xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;ServiceDefinition name="MyWebRole" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition"&gt;
  &lt;WebRole enableNativeCodeExecution="true" name="WebRole" vmsize="ExtraSmall"&gt;
    ...
    &lt;LocalResources&gt;
      &lt;LocalStorage name="FileCacheStorage" sizeInMB="1000" /&gt;
    &lt;/LocalResources&gt;
 &lt;/WebRole&gt;
&lt;/ServiceDefinition&gt;</pre>
<p><strong>ProjectConfiguration.class.php</strong></p>
<p>Change the default symfony cache path within the &#8220;setup()&#8221; method:</p>
<pre class="brush:text">    if(strpos($_SERVER['HTTP_HOST'], "127.0.0.1")===false)
    {
    	$azureFileCachePath = substr($_SERVER['TEMP'], 0, 3).'Resources\Directory\\'.$_SERVER['RoleDeploymentID'].'.WebRole.FileCacheStorage\\cache';
    	$azureFileLogPath   = substr($_SERVER['TEMP'], 0, 3).'Resources\Directory\\'.$_SERVER['RoleDeploymentID'].'.WebRole.FileLogStorage\\log';

		  // Replace default path with local azure storage path, defined in ServiceDefinition ("LocalStorage" = "FileCacheStorage"):
		  $this-&gt;setCacheDir($azureFileCachePath);
    }</pre>
<p><strong>Notice:</strong> When you are testing in your local dev environment the local storage path is completely different (<a title="Accessing a local storage resource at runtime" href="http://msdn.microsoft.com/en-us/library/ee758708.aspx" target="_blank">more information here</a>), so I decided to change the path only in the cloud env, because locally I have no write problems. To get the recent drive letter I take it from $_SERVER['TEMP'].</p>
<p>(For the symonfy logging I did it the same way.)</p>
<p>Special thanks to <a href="http://stackoverflow.com/questions/5106179/windowsazure-is-it-possible-to-set-directory-permissions-within-the-web-config" target="_blank">Taylor </a>for his hints.</p>
<p>I hope this helps somebody <img src='http://blog.itopia.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><strong>Links</strong></p>
<ul>
<li><a title="How to Configure Local Storage Resources" href="http://msdn.microsoft.com/en-us/library/ee758708.aspx" target="_blank">How to Configure Local Storage Resources</a></li>
<li><a title="Azure - Reading and Writing with LocalStorage" href="http://blogs.mscommunity.net/blogs/dadamec/archive/2008/12/11/azure-reading-and-writing-with-localstorage.aspx" target="_blank">Azure &#8211; Reading and Writing with LocalStorage</a></li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.itopia.de/symfony-cache-folder-on-windows-azure/330/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Symfony 1.4: Doctrine and SQL Azure</title>
		<link>http://blog.itopia.de/symfony-1-4-doctrine-and-sql-azure/325</link>
		<comments>http://blog.itopia.de/symfony-1-4-doctrine-and-sql-azure/325#comments</comments>
		<pubDate>Fri, 25 Mar 2011 10:05:05 +0000</pubDate>
		<dc:creator>TBA</dc:creator>
				<category><![CDATA[Could Computing]]></category>
		<category><![CDATA[SQL Azure]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Doctrine]]></category>
		<category><![CDATA[ODBC]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://blog.itopia.de/?p=325</guid>
		<description><![CDATA[&#160; To get your SQL Azure DB running with Symony 1.4 and Doctrine 1.2.4 you need to make the following<a href="http://blog.itopia.de/symfony-1-4-doctrine-and-sql-azure/325" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>To get your <strong>SQL Azure</strong> DB running with <strong>Symony 1.4</strong> and <strong>Doctrine 1.2.4</strong> you need to make the following changes:</p>
<p>In databases.yml:</p>
<pre class="brush:plain">all:
  doctrine:
    class: sfDoctrineDatabase
    param:
      dsn:      odbc:DRIVER={SQL Server Native Client 10.0};Server=SERVER.database.windows.net;Database=DATABASE;Encrypt=yes;
      username: USERNAME@SERVER
      password: PASSWORD</pre>
<p>Sadly there appeard some ugly errors, but I could fix them (please don&#8217;t ask me how I found the solutions).</p>
<p>The first error appeared trying to build the model:</p>
<blockquote><p>When using the attribute ATTR_AUTO_ACCESSOR_OVERRIDE you cannot use the field name &#8220;defaultculture&#8221; because it is reserved by Doctrine. You must cho<br />
ose another field name.</p></blockquote>
<p>In my case it&#8217;s not possible to change the field name because the DB schema is not under my control. To solve this I did the follwing changes:</p>
<p>In <em>symfony/lib/plugins/sfDoctrinePlugin/config/sfDoctrinePluginConfiguration.class.php</em> deactivate the setting ATTR_AUTO_ACCESSOR_OVERRIDE:</p>
<pre>
<pre class="brush:php">$manager-&gt;setAttribute(Doctrine_Core::ATTR_AUTO_ACCESSOR_OVERRIDE, false);</pre>
<p>And in <em>symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Import/Mssql.php</em> I had to change:</pre>
<pre class="brush:plain">    public function listTableColumns($table)
    {
        #$sql = 'EXEC sp_primary_keys_rowset @table_name = ' . $this-&gt;conn-&gt;quoteIdentifier($table, true);
        $sql = 'EXEC sp_pkeys @table_name = ' . $this-&gt;conn-&gt;quoteIdentifier($table, true);</pre>
<p>The changes inside the Doctrine Plugin are not clean, it should be an accrodingly extension, but it worked for my quick requirement to generate a schema out of the database.</p>
<p><strong>EDIT:</strong></p>
<p>For some reason I got again an error while trying to build the schema out of the SQL Azure database:</p>
<blockquote><p>SQLSTATE[42000]: Syntax error or access violation: 156 [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near the keyword &#8216;File&#8217;. (SQLExecute[156] at ext\pdo_odbc\odbc_stmt.c:254). Failing Query: &#8220;EXEC sp_pkeys @table_name = File&#8221;</p></blockquote>
<p>and</p>
<blockquote><p>SQLSTATE[42000]: Syntax error or access violation: 156 [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near the keyword &#8216;File&#8217;. (SQLExecute[156] at ext\pdo_odbc\odbc_stmt.c:254). Failing Query: &#8220;EXEC sp_columns @table_name = File&#8221;</p></blockquote>
<p>To solve the problem I need to modifie the change I did in</p>
<p><em>symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Import/Mssql.php:</em></p>
<pre class="brush:plain">    public function listTableColumns($table)
    {
        #$sql = 'EXEC sp_primary_keys_rowset @table_name = ' . $this-&gt;conn-&gt;quoteIdentifier($table, true);
        $sql = 'EXEC sp_pkeys @table_name = ' . $this-&gt;conn-&gt;quoteIdentifier($table, false);
        ...
        #$sql     = 'EXEC sp_columns @table_name = ' . $this-&gt;conn-&gt;quoteIdentifier($table, true);
        $sql     = 'EXEC sp_columns @table_name = ' . $this-&gt;conn-&gt;quoteIdentifier($table, false);</pre>
<p>I changed the 2nd quoteIdentifier parameter to &#8220;<strong>false</strong>&#8220;.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.itopia.de/symfony-1-4-doctrine-and-sql-azure/325/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse: javax.crypto.BadPaddingException</title>
		<link>http://blog.itopia.de/eclipse-javax-crypto-badpaddingexception-given-final-block-not-properly-padded/323</link>
		<comments>http://blog.itopia.de/eclipse-javax-crypto-badpaddingexception-given-final-block-not-properly-padded/323#comments</comments>
		<pubDate>Thu, 17 Mar 2011 10:38:39 +0000</pubDate>
		<dc:creator>TBA</dc:creator>
				<category><![CDATA[Could Computing]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Windows Azure]]></category>
		<category><![CDATA[Certificate]]></category>

		<guid isPermaLink="false">http://blog.itopia.de/?p=323</guid>
		<description><![CDATA[Today I just wanted to add the Windows Azure Certificate to my Eclipse IDE (WindowsAzure4e). I misstyped the cert password<a href="http://blog.itopia.de/eclipse-javax-crypto-badpaddingexception-given-final-block-not-properly-padded/323" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>Today I just wanted to add the Windows Azure Certificate to my Eclipse IDE (<a title="windowsazure4e" href="http://www.windowsazure4e.org">WindowsAzure4e</a>).<br />
I misstyped the cert password and get this error:</p>
<blockquote><p>javax.crypto.BadPaddingException: Given final block not properly padded</p></blockquote>
<p>But then I didn&#8217;t get the dialog again to enter the right password.</p>
<p>To get this problem solved you need to delete the imported windows azure certs settings in eclipse.</p>
<p>To do so just delete this folder:</p>
<blockquote><p>ECLIPSE_WORKSPACE/.metadata/.plugins/org.soyatec.windows.azure.core</p></blockquote>
<p>Then you can repeat adding the certificate.</p>
<p>Maybe it also helps to delete the certificate completely from your system. To do so start the windows cert manger:</p>
<blockquote><p>Start -&gt; Search -&gt; certmgr.msc -&gt; Enter</p></blockquote>
<p>Search for the installed cert in the different cert folders and delete it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.itopia.de/eclipse-javax-crypto-badpaddingexception-given-final-block-not-properly-padded/323/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

