<?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>Symfony-Zone &#187; caching</title>
	<atom:link href="http://www.symfony-zone.com/wordpress/tag/caching/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.symfony-zone.com/wordpress</link>
	<description>Timo Haberkern blogs about symfony</description>
	<lastBuildDate>Tue, 15 Nov 2011 11:00:21 +0000</lastBuildDate>
	<language>de</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Symfony applications on CD-ROM</title>
		<link>http://www.symfony-zone.com/wordpress/2007/12/18/symfony-applications-on-cd-rom/</link>
		<comments>http://www.symfony-zone.com/wordpress/2007/12/18/symfony-applications-on-cd-rom/#comments</comments>
		<pubDate>Tue, 18 Dec 2007 16:37:18 +0000</pubDate>
		<dc:creator>Timo Haberkern</dc:creator>
				<category><![CDATA[Symfony]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[CD-ROM]]></category>
		<category><![CDATA[Server2Go]]></category>

		<guid isPermaLink="false">http://www.symfony-zone.com/wordpress/2007/12/18/symfony-applications-on-cd-rom/</guid>
		<description><![CDATA[The last week I coded a webbased application thats being used directly from CD-ROM. I used Server2Go as a CD-ROM Webserver that servers the application for browsing and searching on the CD-ROM.As you know my favorite Webframework is Symfony (www.symfony-project.com) so i developed this piece of software with the most current stable symfony version (1.0.9). [...]]]></description>
			<content:encoded><![CDATA[<p>The last week I coded a webbased application thats being used directly from CD-ROM. I used Server2Go as a CD-ROM Webserver that servers the application for browsing and searching on the CD-ROM.As you know my favorite Webframework is Symfony (www.symfony-project.com) so i developed this piece of software with the most current stable symfony version (1.0.9).</p>
<p>There are only some things that needs your attention if you want to make a symfony application runnable from CD-ROM:</p>
<p><span id="more-3"></span></p>
<p>1.) Freeze it: After developing you have to freeze your project with:symfony freeze app-name</p>
<p>2.) Now copy the entire (freezed) project folder to the htdocs folder of your Server2Go directory</p>
<p>3.) Clear the cache folder! You can do this by manually delete the content of this folder or by using &#8220;symfony cc&#8221; before copying the data to the htdocs folder</p>
<p>4.) Open the server/config_tpl/httpd.conf file and change the root directory of the server to the web folder in htdocs:</p>
<p>DocumentRoot &#8220;%CDPMS:DOCROOT%/web&#8221;</p>
<p>&lt;Directory &#8220;%CDPMS:DOCROOT%/web&#8221;&gt;</p>
<p>&#8230;</p>
<p>&lt;/Directory&gt;</p>
<p>So far so good. Now the tricky part begins. Symfony is caching a lot of files and data in order to provide the best possible performance. Therefor views, configfiles and so on will be cached. Where&#8217;s the problem? The problem ist that the cache folder on CD-ROM isn&#8217;t writable and symfony is throwing exceptions if it can&#8217;t write the cache data&#8230;</p>
<p>My first thought: No problem, you have just to deactivate the caching in the settings.yml via</p>
<p>cache: off</p>
<p>Works great for view data, but not for the cached config data. Symfony always caches the config, there is no way to deactivate this (or i didn&#8217;t find one). So what to do? Was symfony the wrong choice for a cd-rom webapplication? No of course not <img src='http://www.symfony-zone.com/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>There possibility to customize the project structure (foldernames and hierarchie) via the constants.php file. You will find this in the htdocs/data/symfony/config folder. Open it and look for the line that starts with &#8216;sf_cache_dir&#8217; and change it to:</p>
<p>&#8216;sf_cache_dir&#8217; =&gt; $sf_cache_dir = $_ENV['S2G_TEMP_FOLDER'].DIRECTORY_SEPARATOR. &#8220;cache&#8221;. DIRECTORY_SEPARATOR. $sf_environment,</p>
<p>Thats it! This line redirects the cache folder to a temorary folder on the users machine (is done by the S2G_TEMP_FOLDER environment variable that is set by Server2Go.</p>
<p>After that you can burn the Server2Go folder to a CD-ROM and everything works as expected</p>
]]></content:encoded>
			<wfw:commentRss>http://www.symfony-zone.com/wordpress/2007/12/18/symfony-applications-on-cd-rom/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

