2012-10-19 2 views
1

drupal 다중 사이트를 구축 중입니다 (예 : childone 및 childtwo). 둘 다 별도의 데이터베이스를 가지고 있습니다. 이제 테이블의 일부를 공유해야합니다. 사이트 childone에서 작성된 사용자는 사이트 childto에서도 동일한 액세스 권한을 가져야합니다. 누구나 적절한 Stepwise 솔루션을 제안 할 수 있습니까?다른 데이터베이스의 테이블을 다중 사이트 용으로 공유

감사

답변

3

당신은 테이블 접두사를 사용해야하고, settings.php이 수행하는 방법을 설명합니다 : 당신 그래서 예를 들면

* You can optionally set prefixes for some or all database table names 
* by using the 'prefix' setting. If a prefix is specified, the table 
* name will be prepended with its value. Be sure to use valid database 
* characters only, usually alphanumeric and underscore. If no prefixes 
* are desired, leave it as an empty string ''. 
* 
* To have all database names prefixed, set 'prefix' as a string: 
* @code 
* 'prefix' => 'main_', 
* @endcode 
* To provide prefixes for specific tables, set 'prefix' as an array. 
* The array's keys are the table names and the values are the prefixes. 
* The 'default' element is mandatory and holds the prefix for any tables 
* not specified elsewhere in the array. Example: 
* @code 
* 'prefix' => array(
*  'default' => 'main_', 
*  'users'  => 'shared_', 
*  'sessions' => 'shared_', 
*  'role'  => 'shared_', 
*  'authmap' => 'shared_', 
* ), 
* @endcode 

, 당신의 childone 사이트의 settings.php를 들어, 당신이 줄을 다음과 같은 :
'prefix' => array(
    'default' => 'childone_', 
    'user'  => 'shared_', 
    'sessions' => 'shared_', 
    'role'  => 'shared_', 
    'permission' => 'shared_', 
); 

그리고 childtwo의 settings.php에 대한

, 그것은 매우 유사 :

'prefix' => array(
    'default' => 'childtwo_', 
    'user'  => 'shared_', 
    'sessions' => 'shared_', 
    'role'  => 'shared_', 
    'permission' => 'shared_', 
); 

모든 테이블의 접두사는 childone_ 또는 childtwo_이며, 공유 된 접두어는 접두어가 붙습니다. 접두어는 shared_ (또는 원하는대로)로 시작합니다.

+0

고맙습니다. web Drip Webdrips도 구현하려고했지만 웹 페이지를 새로 고칠 때마다 오류가 발생합니다. 오류는 파일을 찾을 수 없거나 .inc 파일과 관련된 오류와 유사합니다. – AkiShankar

+0

childone과 childtwo의 settings.php 파일은 u가 게시 한 것과 정확히 동일하게 보입니다. 수행해야 할 다른 설정이있을 수 있습니다. u가 조금씩 정교하게 설명해 주실 수 있다면. 사전에 감사드립니다. – AkiShankar

+0

잘 보시려면 여기를 클릭하십시오 : http://drupal.org/node/22267 실제 오류 메시지를 게시 할 수 있습니까? 다중 사이트 작업을 수행하는 데는 다른 단계가 많이 있습니다. 전에 멀티 사이트를 해본 적이 있습니까? 아니면 공유 테이블에서만 고생하고 있습니까? – Webdrips

관련 문제