Download the PHP package mikenz/silverstripe-simplesubsites without Composer

On this page you can find all versions of the php package mikenz/silverstripe-simplesubsites. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package silverstripe-simplesubsites

Simple Subsites Module

This is a fork of the Silverstripe Subsites module.

Differences from Subsites module

This should be a drop in replacement for the silverstripe subsites module except you will lose access to all pages from the "main site" unless you do some database hacking.

Introduction

The subsites module provides a convenient way of running multiple websites from a single installation of SilverStripe, sharing users, content, and assets between them - the sites will be managed from a single CMS.

A useful way to think of its use is where you have a business with a global headquarters and four branches in various countries. The subsites module allows the five offices to use a single SilverStripe installation, and have information from the headquarters flow down into the branches. The branches can hold information that is individual and the website templates can also be different.

All separation of content achieved with this module should be viewed as cosmetic and not appropriate for security-critical applications. The module gives some control over access rights especially in the "Pages" and "Files" area of the CMS, but other sections' separation is much weaker: for example giving someone any of the "Roles and access permissions" will imply that the person will likely be able to escalate his/her privileges to the global admin role.

For user documentation please see:

  1. Setting up subsites
  2. Working with subsites

Features & limitations

Features:

Limitations:

If more isolation of code, security, or performance is needed, then consider running multiple separate installations (e.g. on separate servers).

Requirements

Installation

Usage

Strict Subdomain Matching

The module tries to provide sensible defaults, in which it regards example.com and www.example.com as the same domains. In case you want to distinguish between these variations, set Subsite::$strict_subdomain_matching to TRUE. This won't affect wildcard/asterisk checks, but removes the ambiguity about default subdomains.

Permissions

Groups can be associated with one or more subsites, in which case the granted page- and asset-related permissions only apply to this subsite.

Note that creating a Subsite-specific group, and giving it permissions unrelated to content editing and asset management will result in members of this group being able to escalate their privileges. An example here is giving that group "Full administrative rights" or some of the "Roles and access permissions", in which case it is possible for the member of that group to simply add himself to the global "Administrators" group or change his own group to having access to all sites.

The subsites module should be viewed as providing a convenience of visual separation for the sites on the interface level, rather than a fully tight security model for managing many sites on the same CMS (it is still the same CMS).

Access created domains

Once you have created some subsites/domains in your admin, you can check the overall functionality of subsites by

http://your.primary-domain.com/subsite-metadata-url?SubsiteID=1

In some Browsers the SubsiteID is visible if you hover over the "Edit" link in the search results of Subsite admin.

Enable Subsite support on DataObjects

To make your DataObject subsite aware, include a SubsiteID on your DataObject. eg:

MyDataObject.php

:::php
private static $has_one = array(
    'Subsite' => 'Subsite'
);

Include the current SubsiteID as a hidden field on getCMSFields, or updateCMSFields. eg:

MyDataObject.php

:::php
public function getCMSFields() {
    $fields = parent::getCMSFields();
    if(class_exists('Subsite')){
        $fields->push(new HiddenField('SubsiteID','SubsiteID', Subsite::currentSubsiteID()));
    }
    return $fields;
}

To limit your admin gridfields to the current Subsite records, you can do something like this:

MyAdmin.php

:::php
public function getEditForm($id = null, $fields = null){
    $form = parent::getEditForm($id, $fields);

    $gridField = $form->Fields()->fieldByName($this->sanitiseClassName($this->modelClass));
    if(class_exists('Subsite')){
        $list = $gridField->getList()->filter(array('SubsiteID'=>Subsite::currentSubsiteID()));
        $gridField->setList($list);
    }

    return $form;
}

Enable menu support for custom areas in subsites

Custom admin areas, by default, will not show in the menu of a subsite. Not all admins are adapted for or appropriate to show within a subsite. If your admin does have subsite support, or is intentionally global, you can enable the show in menu option either by applying:

mysite/_config.php

:::php
MyAdmin::add_extension('SubsiteMenuExtension');

or by defining the subsiteCMSShowInMenu function in your admin:

MyAdmin.php

:::php
public function subsiteCMSShowInMenu(){
    return true;
}

Public display of a subsite

To ensure the logged-in status of a member is carried across to subdomains, you also need to configure PHP session cookies to be set for all subdomains:

// Example matching subsite1.example.org and www.example.org
Session::set_cookie_domain('.example.org');

Screenshots


All versions of silverstripe-simplesubsites with dependencies

PHP Build Version
Package Version
Requires silverstripe/framework Version ~3.1.0
silverstripe/cms Version ~3.1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mikenz/silverstripe-simplesubsites contains the following files

Loading the files please wait ....