<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
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/"
> <channel><title>Comments on: One core, one app, multiple domains for CakePHP</title> <atom:link href="http://www.eimermusic.com/articles/one-core-one-app-multiple-domains-for-cakephp/feed/" rel="self" type="application/rss+xml" /><link>http://www.eimermusic.com/articles/one-core-one-app-multiple-domains-for-cakephp/</link> <description>been here since 2002</description> <lastBuildDate>Sun, 16 Oct 2011 18:41:03 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=</generator> <item><title>By: martin</title><link>http://www.eimermusic.com/articles/one-core-one-app-multiple-domains-for-cakephp/comment-page-1/#comment-3040</link> <dc:creator>martin</dc:creator> <pubDate>Sun, 16 Oct 2011 18:41:03 +0000</pubDate> <guid
isPermaLink="false">http://next.eimermusic.com/?p=8#comment-3040</guid> <description>That is something I cannot recall ever seeing. But I haven&#039;t written more than 3 lines of php in the last year so my memory could be fading.</description> <content:encoded><![CDATA[<p>That is something I cannot recall ever seeing. But I haven&#8217;t written more than 3 lines of php in the last year so my memory could be fading.</p> ]]></content:encoded> </item> <item><title>By: Aaron Tate</title><link>http://www.eimermusic.com/articles/one-core-one-app-multiple-domains-for-cakephp/comment-page-1/#comment-3021</link> <dc:creator>Aaron Tate</dc:creator> <pubDate>Fri, 14 Oct 2011 18:33:21 +0000</pubDate> <guid
isPermaLink="false">http://next.eimermusic.com/?p=8#comment-3021</guid> <description>I tried this for running multiple instances of the site locally on my Mac, and for the most part it seems to work well.  Whenever I try to run a shell script, though, it simply prints out the domain file followed by the script itself, rather than processing them.  Ever heard of anything along these lines before?  I&#039;m stuck on CakePHP 1.2.5, and upgrading isn&#039;t really an option right now.  Does it seem likely that I simply configured something incorrectly?  Any idea what?</description> <content:encoded><![CDATA[<p>I tried this for running multiple instances of the site locally on my Mac, and for the most part it seems to work well.  Whenever I try to run a shell script, though, it simply prints out the domain file followed by the script itself, rather than processing them.  Ever heard of anything along these lines before?  I&#8217;m stuck on CakePHP 1.2.5, and upgrading isn&#8217;t really an option right now.  Does it seem likely that I simply configured something incorrectly?  Any idea what?</p> ]]></content:encoded> </item> <item><title>By: bazil</title><link>http://www.eimermusic.com/articles/one-core-one-app-multiple-domains-for-cakephp/comment-page-1/#comment-348</link> <dc:creator>bazil</dc:creator> <pubDate>Sat, 11 Sep 2010 22:38:53 +0000</pubDate> <guid
isPermaLink="false">http://next.eimermusic.com/?p=8#comment-348</guid> <description>Yes I agree with you about safety and actually I want same system. I only thinking, how I can do it without hacking CakePHP core ...</description> <content:encoded><![CDATA[<p>Yes I agree with you about safety and actually I want same system. I only thinking, how I can do it without hacking CakePHP core &#8230;</p> ]]></content:encoded> </item> <item><title>By: martin</title><link>http://www.eimermusic.com/articles/one-core-one-app-multiple-domains-for-cakephp/comment-page-1/#comment-346</link> <dc:creator>martin</dc:creator> <pubDate>Sat, 11 Sep 2010 18:38:39 +0000</pubDate> <guid
isPermaLink="false">http://next.eimermusic.com/?p=8#comment-346</guid> <description>I think &quot;needing tmp&quot; depends on two things:
1. How sensitive your data is.
2. How much you trust the framework to not mix things up between domains sharing the same tmp.Since the app I developed this for handles sensitive personal medical information I wanted there to be no way in h--- for the data from one subdomain to slip into the output of another. Separating everything into separate configs, separate databases and tmp was safest. Tmp contains caches, logs and in my case even uploaded files.If I was building a forum or a blog I would probably not bother with all that.</description> <content:encoded><![CDATA[<p>I think &#8220;needing tmp&#8221; depends on two things:<br
/> 1. How sensitive your data is.<br
/> 2. How much you trust the framework to not mix things up between domains sharing the same tmp.</p><p>Since the app I developed this for handles sensitive personal medical information I wanted there to be no way in h&#8212; for the data from one subdomain to slip into the output of another. Separating everything into separate configs, separate databases and tmp was safest. Tmp contains caches, logs and in my case even uploaded files.</p><p>If I was building a forum or a blog I would probably not bother with all that.</p> ]]></content:encoded> </item> <item><title>By: bazil</title><link>http://www.eimermusic.com/articles/one-core-one-app-multiple-domains-for-cakephp/comment-page-1/#comment-345</link> <dc:creator>bazil</dc:creator> <pubDate>Sat, 11 Sep 2010 15:32:39 +0000</pubDate> <guid
isPermaLink="false">http://next.eimermusic.com/?p=8#comment-345</guid> <description>Ah no, now I see my mistake with including index.php into bootstrap.php ... it&#039;s not a way ...</description> <content:encoded><![CDATA[<p>Ah no, now I see my mistake with including index.php into bootstrap.php &#8230; it&#8217;s not a way &#8230;</p> ]]></content:encoded> </item> <item><title>By: bazil</title><link>http://www.eimermusic.com/articles/one-core-one-app-multiple-domains-for-cakephp/comment-page-1/#comment-344</link> <dc:creator>bazil</dc:creator> <pubDate>Sat, 11 Sep 2010 15:29:49 +0000</pubDate> <guid
isPermaLink="false">http://next.eimermusic.com/?p=8#comment-344</guid> <description>In this point, you have right, but I&#039;m not sure, if CLI need /tmp/ ... if yes. There can be some call for CLI from bootstrap.phpelseif ( count($_SERVER[&#039;argv&#039;]) )
{
...
include(&#039;webroot/index.php&#039;); //I don&#039;t test this path, it shout be diferend
...
}Don&#039;t you think so?</description> <content:encoded><![CDATA[<p>In this point, you have right, but I&#8217;m not sure, if CLI need /tmp/ &#8230; if yes. There can be some call for CLI from bootstrap.php</p><p>elseif ( count($_SERVER['argv']) )<br
/> {<br
/> &#8230;<br
/> include(&#8216;webroot/index.php&#8217;); //I don&#8217;t test this path, it shout be diferend<br
/> &#8230;<br
/> }</p><p>Don&#8217;t you think so?</p> ]]></content:encoded> </item> <item><title>By: martin</title><link>http://www.eimermusic.com/articles/one-core-one-app-multiple-domains-for-cakephp/comment-page-1/#comment-343</link> <dc:creator>martin</dc:creator> <pubDate>Sat, 11 Sep 2010 14:24:27 +0000</pubDate> <guid
isPermaLink="false">http://next.eimermusic.com/?p=8#comment-343</guid> <description>Index.php is only available when your app is called from a browser. The reason I hacked the core is that it is not enough for apps needing to run things from a cli. For example, domain-specific cron jobs which is one thing I needed. </description> <content:encoded><![CDATA[<p>Index.php is only available when your app is called from a browser. The reason I hacked the core is that it is not enough for apps needing to run things from a cli. For example, domain-specific cron jobs which is one thing I needed.</p> ]]></content:encoded> </item> <item><title>By: bazil</title><link>http://www.eimermusic.com/articles/one-core-one-app-multiple-domains-for-cakephp/comment-page-1/#comment-342</link> <dc:creator>bazil</dc:creator> <pubDate>Sat, 11 Sep 2010 13:29:15 +0000</pubDate> <guid
isPermaLink="false">http://next.eimermusic.com/?p=8#comment-342</guid> <description>Hi, I know so this is quiet old article, but still: I don&#039;t like hacking of core (here becouse of TMP) and here is my solution:
Put this in webroot/index.php somewhere after defining ROOT and APP_DIR:
/**
* Define my own TMP depend ond domains.
*
*/
/**
* Check if dir exist and if not, create it.
* @param string $dir path to directory
*/
function check_dir($dir = null)
{
if(!is_dir($dir))
{
mkdir($dir,0777,true);
}
}if ( !isset($_SERVER[&#039;SERVER_NAME&#039;]) ) {
if ( count($_SERVER[&#039;argv&#039;]) ) { // cli
$_SERVER[&#039;SERVER_NAME&#039;] = $_SERVER[&#039;argv&#039;][count($_SERVER[&#039;argv&#039;])-1];
} else {
echo &#039;No server name is available. Halting...&#039;;
exit;
}
}
$tmp = ROOT.DS.APP_DIR.DS.&#039;tmp&#039;.DS;
if (!is_dir($tmp.&#039;domains&#039;))
{
@mkdir($tmp.&#039;domains&#039;);
}
if (!is_dir($tmp.&#039;domains&#039;.DS.$_SERVER[&#039;SERVER_NAME&#039;]))
{
$tmp = $tmp.&#039;domains&#039;.DS.$_SERVER[&#039;SERVER_NAME&#039;].DS;
//@mkdir($tmp);
$old = umask(0);
check_dir($tmp);
check_dir($tmp.&#039;logs&#039;.DS);
check_dir($tmp.&#039;cache&#039;.DS.&#039;models&#039;.DS);
check_dir($tmp.&#039;cache&#039;.DS.&#039;persistent&#039;.DS);
check_dir($tmp.&#039;cache&#039;.DS.&#039;views&#039;.DS);
check_dir($tmp.&#039;sessions&#039;.DS);
umask($old);
}
define(&#039;TMP&#039;, $tmp);And this work very nice without hacking core of CakePHP.</description> <content:encoded><![CDATA[<p>Hi, I know so this is quiet old article, but still: I don&#8217;t like hacking of core (here becouse of TMP) and here is my solution:<br
/> Put this in webroot/index.php somewhere after defining ROOT and APP_DIR:<br
/> /**<br
/> * Define my own TMP depend ond domains.<br
/> *<br
/> */<br
/> /**<br
/> * Check if dir exist and if not, create it.<br
/> * @param string $dir path to directory<br
/> */<br
/> function check_dir($dir = null)<br
/> {<br
/> if(!is_dir($dir))<br
/> {<br
/> mkdir($dir,0777,true);<br
/> }<br
/> }</p><p> if ( !isset($_SERVER['SERVER_NAME']) ) {<br
/> if ( count($_SERVER['argv']) ) { // cli<br
/> $_SERVER['SERVER_NAME'] = $_SERVER['argv'][count($_SERVER['argv'])-1];<br
/> } else {<br
/> echo &#8216;No server name is available. Halting&#8230;&#8217;;<br
/> exit;<br
/> }<br
/> }<br
/> $tmp = ROOT.DS.APP_DIR.DS.&#8217;tmp&#8217;.DS;<br
/> if (!is_dir($tmp.&#8217;domains&#8217;))<br
/> {<br
/> @mkdir($tmp.&#8217;domains&#8217;);<br
/> }<br
/> if (!is_dir($tmp.&#8217;domains&#8217;.DS.$_SERVER['SERVER_NAME']))<br
/> {<br
/> $tmp = $tmp.&#8217;domains&#8217;.DS.$_SERVER['SERVER_NAME'].DS;<br
/> //@mkdir($tmp);<br
/> $old = umask(0);<br
/> check_dir($tmp);<br
/> check_dir($tmp.&#8217;logs&#8217;.DS);<br
/> check_dir($tmp.&#8217;cache&#8217;.DS.&#8217;models&#8217;.DS);<br
/> check_dir($tmp.&#8217;cache&#8217;.DS.&#8217;persistent&#8217;.DS);<br
/> check_dir($tmp.&#8217;cache&#8217;.DS.&#8217;views&#8217;.DS);<br
/> check_dir($tmp.&#8217;sessions&#8217;.DS);<br
/> umask($old);<br
/> }</p><p> define(&#8216;TMP&#8217;, $tmp);</p><p>And this work very nice without hacking core of CakePHP.</p> ]]></content:encoded> </item> <item><title>By: martin</title><link>http://www.eimermusic.com/articles/one-core-one-app-multiple-domains-for-cakephp/comment-page-1/#comment-233</link> <dc:creator>martin</dc:creator> <pubDate>Sat, 07 Aug 2010 18:39:43 +0000</pubDate> <guid
isPermaLink="false">http://next.eimermusic.com/?p=8#comment-233</guid> <description>I have had certain models use a fixed database config while all the rest use the domain-specific configs. For that use-case all you have to do is set an extra config in config/database.php and tell your model(s) to use that config.If you want some models t use alternative configs that are still domain-specific you would need to set multiple configs in your domain files. It is also quite simple and requires no significant change from the techinique explained in the article.Good luck. </description> <content:encoded><![CDATA[<p>I have had certain models use a fixed database config while all the rest use the domain-specific configs. For that use-case all you have to do is set an extra config in config/database.php and tell your model(s) to use that config.</p><p>If you want some models t use alternative configs that are still domain-specific you would need to set multiple configs in your domain files. It is also quite simple and requires no significant change from the techinique explained in the article.</p><p>Good luck.</p> ]]></content:encoded> </item> <item><title>By: Jesper</title><link>http://www.eimermusic.com/articles/one-core-one-app-multiple-domains-for-cakephp/comment-page-1/#comment-228</link> <dc:creator>Jesper</dc:creator> <pubDate>Thu, 05 Aug 2010 12:28:46 +0000</pubDate> <guid
isPermaLink="false">http://next.eimermusic.com/?p=8#comment-228</guid> <description>interesting article and quite close to something I want to accomplish. I will try and apply this to my app.
Although my problem is I wish to have certain parts of my app handle database implementation different from the separate domains. I guess something like applying a factory pattern to certain models. I.e a product db that could be easily exchanged depending on client. But at the moment I have no idea how or if that could be accomplished in a cake-friendly way. Any leads or ideas would be greatly appriciated!
Nice website by the way! ;)</description> <content:encoded><![CDATA[<p>interesting article and quite close to something I want to accomplish. I will try and apply this to my app.<br
/> Although my problem is I wish to have certain parts of my app handle database implementation different from the separate domains. I guess something like applying a factory pattern to certain models. I.e a product db that could be easily exchanged depending on client. But at the moment I have no idea how or if that could be accomplished in a cake-friendly way. Any leads or ideas would be greatly appriciated!<br
/> Nice website by the way! <img
src='http://www.eimermusic.com/cms/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 9/27 queries in 0.007 seconds using disk: basic

Served from: www.eimermusic.com @ 2012-02-06 13:57:06 -->
