Download the PHP package cdoebler/doppelganger without Composer

On this page you can find all versions of the php package cdoebler/doppelganger. 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 doppelganger

Doppelganger

A WordPress integration for the php-generic-user-switcher package. This plugin allows authorized administrators to instantly switch their session to any other user on the site, which is useful for debugging issues reported by specific users or testing role capabilities.

Features

Requirements

Installation

Right now, the WordPress plugin is not available on the WordPress plugin repository because of unsupported PHP keywords in the plugin's code but it will be released once the PHP keywords are accepted by WordPress.

You can still install the plugin manually by downloading a zip archive from the Releases page and installing it in the WordPress backend or by using Composer.

Installation via Composer:

Ensure your site is configured to load the vendor/autoload.php file, or activate the plugin if it's placed in wp-content/plugins and installed with dependencies.

Usage

  1. Log in as an Administrator. By default, only users with the edit_users capability (typically Administrators) can see and use the switcher.

  2. Switch User

    • Look for the "Switch User" toggle in the bottom-right corner of the screen.
    • Click it to open the user list.
    • Click on any user to switch to their account.
  3. Impersonation Mode

    • While impersonating, a "Stop Impersonating" banner/button will be visible.
    • You are effectively logged in as that user, with their permissions.
  4. Stop Impersonating
    • Click "Stop Impersonating" to return to your original administrative account.

Configuration

The plugin is designed to work out-of-the-box, with three layers of configuration (in order of precedence):

  1. Default Behavior - Works immediately after installation
  2. wp-config.php Constants - Simple toggles for non-technical users
  3. WordPress Filters - Advanced customization for developers

Default Behavior

Out of the box, the plugin:

Simple Configuration (wp-config.php Constants)

For basic on/off toggles and environment control, add constants to your wp-config.php file:

Important: Constants take precedence over filters. If a constant is defined, filters for that setting will be ignored with a warning in debug mode and the WordPress admin dashboard.

⚠️ Development Mode (EXTREMELY DANGEROUS)

🚨 CRITICAL SECURITY WARNING:

When DOPPELGANGER_DEV_MODE is enabled:

This constant is ONLY for:

NEVER EVER:

A persistent red warning banner will appear in the WordPress admin dashboard when dev mode is active. If you see this warning in production, disable dev mode immediately by removing the constant from wp-config.php.

Note: The main DOPPELGANGER_ENABLED=false constant still works as an emergency kill switch even when dev mode is active.

Advanced Configuration (WordPress Filters)

For complex logic and dynamic behavior, use WordPress filters in your theme's functions.php or a custom plugin:

Environment Control

Note: This filter is ignored if DOPPELGANGER_ALLOWED_ENVIRONMENTS constant is defined.

Permissions (Authorization)

By default, edit_users capability is required. You can change this logic:

How Authorization Works During Impersonation

Important: When you're impersonating another user, authorization checks are based on the original user (the one who started impersonation), not the currently impersonated user.

This means:

This prevents the common issue where the switcher disappears after switching to an unauthorized user.

Example Scenario:

  1. Admin (authorized) logs in → Widget appears ✅
  2. Admin switches to Regular User (unauthorized) → Widget still appears
  3. Admin can switch back or to other users ✅
  4. Regular User logs in directly → Widget does not appear ✅

UI Configuration

Customize the renderer configuration:

Available configuration options:

Database Options (Alternative to Constants)

The plugin also checks a database option for the enabled state. This is useful if you need to toggle the plugin programmatically:

Note: The DOPPELGANGER_ENABLED constant takes precedence over this database option.

Security

Development

To run static analysis and code quality checks:


All versions of doppelganger with dependencies

PHP Build Version
Package Version
Requires cdoebler/php-generic-user-switcher Version ^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 cdoebler/doppelganger contains the following files

Loading the files please wait ...