Re: Multisite (like WPMU + domain mapping)... possible?

2012-02-27 Thread Stephen
Damn, I forgot the link again!
http://nuts-and-bolts-of-cakephp.com/2009/03/14/run-multiple-cakephp-app-side-by-side/

On 27 February 2012 08:50, Stephen  wrote:

> Apologies, I didn't explain properly... I was on the train!
>
> *Step 1*
> I followed the nuts and bolts "Run multiple apps side-by-side" tutorial,
> this meant that I could use one shared cake folder between app folders (Not
> that it's really important to achieve what you want).
> From here by accessing www.website1.dev and www.website2.dev it would
> access either the app folder "website1" or "website2".
>
> *Step 2*
> I decided that any functionality unique to the client will be placed in
> the application and anything I think would be shared between applications
> would be placed in a plugin. The plugin has its own database connection and
> handles things such as categories, products etc.
>
> *Step 3*
> I could then access the same method from both applications by going to
> website1.dev/admin/pluginname/pluginname_categories/index or
> website2.dev/admin/pluginname/pluginname_categories/index
>
> *Step 4
> *This is the trickier one, I've created 2 controllers / models in my
> plugin "pluginname_clients" and "pluginname_client_hosts".
>
> I place each client as a new record in the database (i.e. INSERT INTO
> `pluginname_clients` VALUES (NULL, 1, 'Website 1', NOW(), NOW()). (Website
> 1 (ID1), Website 2 (ID2))
>
> I then place each known host and ip address in `pluginname_client_hosts`
> and state `pluginname_client_id` as 1 or 2.
>
> *Step 5
> *From here I could detect which client is accessing the plugin by their
> host and have the plugin adjust itself accordingly, one thing that is a
> little bit of a pain - permissions for the client (i.e. category 12 should
> be available for clients A, B and C but not client D).
>
> I wanted to create a config file for my plugin using Configure::load /
> Configure::read but I couldn't get it to work.
>
> If anybody has a better way of doing this, I'm all ears.
>
> HTH
>
> Kind Regards
>  Stephen
>
>  http://www.ninjacodermonkey.co.uk
>
>
>


-- 
Kind Regards
 Stephen

 http://www.ninjacodermonkey.co.uk

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Multisite (like WPMU + domain mapping)... possible?

2012-02-27 Thread Stephen
Apologies, I didn't explain properly... I was on the train!

*Step 1*
I followed the nuts and bolts "Run multiple apps side-by-side" tutorial,
this meant that I could use one shared cake folder between app folders (Not
that it's really important to achieve what you want).
>From here by accessing www.website1.dev and www.website2.dev it would
access either the app folder "website1" or "website2".

*Step 2*
I decided that any functionality unique to the client will be placed in the
application and anything I think would be shared between applications would
be placed in a plugin. The plugin has its own database connection and
handles things such as categories, products etc.

*Step 3*
I could then access the same method from both applications by going to
website1.dev/admin/pluginname/pluginname_categories/index or
website2.dev/admin/pluginname/pluginname_categories/index

*Step 4
*This is the trickier one, I've created 2 controllers / models in my plugin
"pluginname_clients" and "pluginname_client_hosts".

I place each client as a new record in the database (i.e. INSERT INTO
`pluginname_clients` VALUES (NULL, 1, 'Website 1', NOW(), NOW()). (Website
1 (ID1), Website 2 (ID2))

I then place each known host and ip address in `pluginname_client_hosts`
and state `pluginname_client_id` as 1 or 2.

*Step 5
*From here I could detect which client is accessing the plugin by their
host and have the plugin adjust itself accordingly, one thing that is a
little bit of a pain - permissions for the client (i.e. category 12 should
be available for clients A, B and C but not client D).

I wanted to create a config file for my plugin using Configure::load /
Configure::read but I couldn't get it to work.

If anybody has a better way of doing this, I'm all ears.

HTH

Kind Regards
 Stephen

 http://www.ninjacodermonkey.co.uk

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Multisite (like WPMU + domain mapping)... possible?

2012-02-26 Thread Stephen Speakman
Im working on a setup at the moment which does what you need by using  
http_host in the global web root but its done inefficently. It merges  
full apps together..


Im using 'nuts and bolts' method of running multiple apps from one  
cake folder. I have then developed a plugin which is shared between  
all the apps, this holds shared functionality and admin is done in one  
place.


Sent from my iPhone

On 25 Feb 2012, at 01:57, Benjamin Allison > wrote:



So I'm just starting to play with CakePHP and was wondering if the
following was possible:

A single install of Cake, with a super admin login. Then, admins that
have access to specified "sub sites", and the ability to create/edit
content and users on those sub sites. Finally, the ability to map
domain names (not subdomains, but unique domains) to the routes; so
instead of mysite.com/subsite/posts/1 it would just be newdomain.com/
posts/1

Essentially, I'm looking to replicate the experience of using
Wordpress Multi-user (with domain mapping).

Is this possible? If so, what should I be looking to?

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and  
help others with their CakePHP related questions.



To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this  
group at http://groups.google.com/group/cake-php


--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.



To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Multisite (like WPMU + domain mapping)... possible?

2012-02-26 Thread Benjamin Allison
I should also mention that even though a user, when logged in, is
seeing admin screens that are generated by the single CakePHP app, the
hope would be to somehow have their whole experience on the site
happen under the unique domain, instead of them flipping over to the
primary site domain.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php