PHPackages                             microweber-packages/shared-server-scripts - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. microweber-packages/shared-server-scripts

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

microweber-packages/shared-server-scripts
=========================================

Shared server scripts

3.1(10mo ago)04.8kMITPHPPHP &gt;=8.3CI failing

Since Jun 28Pushed 10mo ago2 watchersCompare

[ Source](https://github.com/microweber-packages/shared-server-scripts)[ Packagist](https://packagist.org/packages/microweber-packages/shared-server-scripts)[ Docs](http://microweber.com)[ RSS](/packages/microweber-packages-shared-server-scripts/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (8)Dependencies (3)Versions (14)Used By (0)

Microweber Shared Server Scripts
================================

[](#microweber-shared-server-scripts)

A comprehensive PHP package for managing Microweber CMS installations, downloads, templates, modules, and server operations. This package provides a unified interface for server-side operations commonly needed when managing multiple Microweber websites.

Overview
--------

[](#overview)

The Microweber Shared Server Scripts package provides automated tools for:

- Installing and managing Microweber CMS instances
- Downloading core files, templates, and modules
- Managing environment variables and configurations
- Scanning and monitoring installations
- Handling whitelabel and WHMCS integrations

Requirements
------------

[](#requirements)

- PHP &gt;= 8.3
- Symfony Process component
- Symfony Filesystem component
- Microweber Composer Client package

Installation
------------

[](#installation)

```
composer require microweber-packages/shared-server-scripts
```

Core Classes
------------

[](#core-classes)

### Installation &amp; Management

[](#installation--management)

#### `MicroweberInstaller`

[](#microweberinstaller)

Handles fresh installations of Microweber CMS with support for both standalone and symlink installations.

**Key Features:**

- Supports MySQL and SQLite databases
- Configurable admin credentials
- Template and language selection
- Standalone or symlinked installations
- Automatic directory structure creation

**Usage:**

```
use MicroweberPackages\SharedServerScripts\MicroweberInstaller;

$installer = new MicroweberInstaller();
$installer->setPath('/path/to/website');
$installer->setSourcePath('/path/to/microweber/source');
$installer->setDatabaseDriver('mysql');
$installer->setDatabaseHost('localhost');
$installer->setDatabaseName('my_database');
$installer->setDatabaseUsername('user');
$installer->setDatabasePassword('password');
$installer->setAdminEmail('admin@example.com');
$installer->setAdminUsername('admin');
$installer->setAdminPassword('password');
$installer->run();
```

#### `MicroweberReinstaller`

[](#microweberreinstaller)

Extends MicroweberInstaller to handle reinstallation scenarios while preserving user data and configurations.

**Key Features:**

- Preserves user files and configurations
- Updates core files only
- Supports both symlink and standalone reinstalls
- Maintains file ownership and permissions

#### `MicroweberUninstaller`

[](#microweberuninstaller)

Safely removes Microweber installations while providing detailed feedback on the removal process.

**Key Features:**

- Selective file and directory removal
- Error handling and logging
- Preserves user data if needed
- Complete cleanup of core files

### Download &amp; Content Management

[](#download--content-management)

#### `MicroweberDownloader`

[](#microweberdownloader)

Downloads the latest Microweber CMS releases from official sources.

**Key Features:**

- Stable and development release support
- Automatic validation of downloads
- Integration with Composer client
- Configurable download sources

**Usage:**

```
use MicroweberPackages\SharedServerScripts\MicroweberDownloader;

$downloader = new MicroweberDownloader();
$downloader->setReleaseSource(MicroweberDownloader::STABLE_RELEASE);
$downloader->download('/path/to/download/location');
```

#### `MicroweberTemplatesDownloader`

[](#microwebertemplatesdownloader)

Downloads and manages Microweber templates from the official repository.

**Key Features:**

- Composer-based template discovery
- Automatic template installation
- Version management
- Bulk template downloads

#### `MicroweberModuleConnectorsDownloader`

[](#microwebermoduleconnectorsdownloader)

Handles downloading and installation of Microweber modules and connectors.

**Key Features:**

- Module discovery via Composer
- Automatic dependency resolution
- Version compatibility checking
- License validation

### Environment &amp; Configuration

[](#environment--configuration)

#### `MicroweberEnvFileWebsiteApply`

[](#microweberenvfilewebsiteapply)

Manages environment variables in .env files with support for specific section isolation.

**Key Features:**

- Section-based environment variable management
- Automatic value escaping and validation
- Selective updates without affecting other configurations
- Backup and restore capabilities

**Usage:**

```
use MicroweberPackages\SharedServerScripts\MicroweberEnvFileWebsiteApply;

$envApply = new MicroweberEnvFileWebsiteApply();
$envApply->setWebPath('/path/to/website');

// Apply environment variables
$envVars = [
    'DB_HOST' => 'localhost',
    'DB_NAME' => 'my_database',
    'APP_URL' => 'https://example.com'
];
$envApply->applyEnvVars($envVars);

// Get current MW env vars
$currentVars = $envApply->getMwEnvVars();

// Remove MW env vars
$envApply->removeMwEnvVars();
```

### Analysis &amp; Monitoring

[](#analysis--monitoring)

#### `MicroweberAppPathHelper`

[](#microweberapppathhelper)

Provides detailed information about Microweber installations and their capabilities.

**Key Features:**

- Installation detection and validation
- Version information retrieval
- Module and template discovery
- Language support detection
- Admin token generation
- Application details extraction

**Usage:**

```
use MicroweberPackages\SharedServerScripts\MicroweberAppPathHelper;

$helper = new MicroweberAppPathHelper();
$helper->setPath('/path/to/installation');

$isInstalled = $helper->isInstalled();
$version = $helper->getCurrentVersion();
$modules = $helper->getSupportedModules();
$templates = $helper->getSupportedTemplates();
$languages = $helper->getSupportedLanguages();
```

#### `MicroweberInstallationsScanner`

[](#microweberinstallationsscanner)

Recursively scans directories to find and analyze Microweber installations.

**Key Features:**

- Recursive directory scanning
- Installation validation
- Bulk installation analysis
- Symlink detection
- Installation metadata extraction

### Integration &amp; White-labeling

[](#integration--white-labeling)

#### `MicroweberWhitelabelWebsiteApply`

[](#microweberwhitelabelwebsiteapply)

Applies white-label branding configurations to Microweber installations.

**Key Features:**

- Branding file management
- Symlink-based branding application
- Configuration synchronization

#### `MicroweberWhitelabelSettingsUpdater`

[](#microweberwhitelabelsettingsupdater)

Updates white-label settings and configurations for SaaS deployments.

**Key Features:**

- JSON-based settings management
- Storage directory handling
- Settings validation and formatting

#### `MicroweberWhmcsConnector`

[](#microweberwhmcsconnector)

Integrates Microweber installations with WHMCS billing systems.

**Key Features:**

- WHMCS API integration
- Domain-based configuration
- Template selection from WHMCS
- White-label settings retrieval
- Automated configuration application

Shared Components
-----------------

[](#shared-components)

### Traits

[](#traits)

#### `MicroweberFileOperationsTrait`

[](#microweberfileoperationstrait)

Provides common file operations and path management functionality used across all classes.

**Key Features:**

- File manager and shell executor initialization
- Version detection (v2 vs v3)
- Directory structure management
- File operation helpers
- Permission and ownership handling

### Adapters

[](#adapters)

#### File Management

[](#file-management)

- **`NativeFileManager`**: Standard filesystem operations
- **`PleskDomainFileManager`**: Plesk domain-specific file operations
- **`PleskServerFileManager`**: Plesk server-level file operations

#### Shell Execution

[](#shell-execution)

- **`NativeShellExecutor`**: Standard shell command execution
- **`PleskShellExecutor`**: Plesk-specific shell operations with proper environment handling

### Interfaces

[](#interfaces)

#### `IMicroweberDownloader`

[](#imicroweberdownloader)

Defines the contract for download operations, ensuring consistent implementation across different download strategies.

Shell Scripts
-------------

[](#shell-scripts)

The package includes several shell scripts for system-level operations:

- **`check_disk_space.sh`**: Monitors available disk space
- **`chown_installed_app.sh`**: Sets proper file ownership for installed applications
- **`unzip_app_module.sh`**: Extracts module archives
- **`unzip_app_template.sh`**: Extracts template archives
- **`unzip_app_version.sh`**: Extracts version-specific archives

Testing
-------

[](#testing)

The package includes comprehensive PHPUnit tests:

```
vendor/bin/phpunit
```

Test files:

- `MicroweberDownloaderTest.php`: Tests download functionality
- `MicroweberInstallerTest.php`: Tests installation processes

Configuration
-------------

[](#configuration)

### Environment Variables

[](#environment-variables)

The package supports the following environment variable patterns in .env files:

```
# Regular application settings
APP_NAME=MyApp
DB_CONNECTION=mysql

### MW ENV VARS APPLY ###
SOME_VAR=text@example.com
SOME_VAR_2=text@example.com
### END MW ENV VARS APPLY ###

# Other settings continue here
```

### Database Support

[](#database-support)

- **MySQL**: Full support with configurable host, port, credentials
- **SQLite**: Automatic database file creation and management

### Installation Types

[](#installation-types)

- **Standalone**: Complete file copy installation
- **Symlink**: Symbolic link-based installation for shared hosting

Error Handling
--------------

[](#error-handling)

All classes implement comprehensive error handling with:

- Detailed exception messages
- Operation logging
- Rollback capabilities where applicable
- Validation at each step

Best Practices
--------------

[](#best-practices)

1. **Always validate paths** before performing operations
2. **Use appropriate adapters** for your hosting environment
3. **Check permissions** before file operations
4. **Backup configurations** before making changes
5. **Test installations** in development environments first

License
-------

[](#license)

MIT License - See LICENSE file for details

Support
-------

[](#support)

For support, please contact:

Contributing
------------

[](#contributing)

Contributions are welcome! Please ensure all tests pass and follow the existing code style.

---

*This package is part of the Microweber CMS ecosystem and is designed for server administrators and hosting providers managing multiple Microweber installations.*

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance54

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 93.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~91 days

Recently: every ~66 days

Total

13

Last Release

321d ago

Major Versions

0.9 → 1.02025-02-07

1.1 → 3.02025-06-18

PHP version history (2 changes)0.1PHP &gt;=7.2

3.0PHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/4dc06e05e127ad3192ef9797ace808069687140538add8e6dbad34ce50bcd1f8?d=identicon)[boksiora](/maintainers/boksiora)

![](https://avatars.githubusercontent.com/u/50577633?v=4)[Bozhidar Slaveykov](/maintainers/bobimicroweber)[@bobimicroweber](https://github.com/bobimicroweber)

---

Top Contributors

[![bobimicroweber](https://avatars.githubusercontent.com/u/50577633?v=4)](https://github.com/bobimicroweber "bobimicroweber (168 commits)")[![peter-mw](https://avatars.githubusercontent.com/u/5698247?v=4)](https://github.com/peter-mw "peter-mw (12 commits)")

### Embed Badge

![Health badge](/badges/microweber-packages-shared-server-scripts/health.svg)

```
[![Health](https://phpackages.com/badges/microweber-packages-shared-server-scripts/health.svg)](https://phpackages.com/packages/microweber-packages-shared-server-scripts)
```

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

310107.9k1](/packages/cognesy-instructor-php)[shyim/danger-php

Port of danger to PHP

8544.9k](/packages/shyim-danger-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
