machinjiri/installer

Installer for Machinjiri PHP Framework

Maintainers

Package info

github.com/preciouslyson/installer

Type:composer-plugin

pkg:composer/machinjiri/installer

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.1.0 2026-04-21 18:41 UTC

This package is auto-updated.

Last update: 2026-04-21 18:43:50 UTC


README

Machinjiri Installer

A professional Composer plugin and CLI tool for creating new Machinjiri PHP framework projects quickly and efficiently.

Installation

Method 1: Global Installation (Recommended)

Install the installer globally for creating projects anywhere:

composer global require machinjiri/installer

Method 2: Project Dependency

Add to your existing project's composer.json:

{
    "require-dev": {
        "preciouslyson/installer": "^1.0.0"
    }
}

Then run:

composer require-dev machinjiri/installer

Quick Start

After global installation, create a new Machinjiri project:

machinjiri new myapp

Available Commands

machinjiri new

Create a new Machinjiri application.

Usage:
  new [options] [--] [<name>]

Arguments:
  name                           Name of the project directory

Options:
  -f, --force                    Force installation even if the directory already exists
      --m-version[=VERSION]      Machinjiri version to install [default: "*"]
      --dev                      Install development dependencies
      --no-dev                   Skip development dependencies
      --no-scripts               Skip Composer scripts
  -n, --no-interaction           Do not ask any interactive question
  -h, --help                     Display help for the command
  -q, --quiet                    Do not output any message
  -V, --version                  Display this application version
      --ansi                     Force ANSI output
      --no-ansi                  Disable ANSI output
  -v|vv|vvv, --verbose           Increase the verbosity of messages

Usage Examples

Basic Installation

# Create app in default directory (machinjiri-app/)
machinjiri new

# Create app with custom name
machinjiri new my-awesome-app

# Create app with specific version
machinjiri new blog --version="^1.2"

# Force overwrite existing directory
machinjiri new api --force

Development Setup

# Create with development dependencies
machinjiri new project --dev

# Create without development dependencies (production)
machinjiri new project --no-dev

# Non-interactive mode for CI/CD
machinjiri new app --no-interaction --force

Advanced Usage

# Specify version and force overwrite
machinjiri:install ecommerce --version="^1.3" --force

# Skip Composer scripts
machinjiri:install microservice --no-scripts

# Verbose output for debugging
machinjiri:install api -vvv

Project Structure Created

The installer creates a complete Machinjiri application structure:

your-project/
├── app/
│   ├── Controllers/
│   ├── Middleware/
│   ├── Models/
│   └── Providers/
├── bootstrap/
│   ├── app.php
│   └── helpers.php
├── config/
│   ├── app.php
│   ├── providers.php
│   ├── appserviceprovider.php
│   └── databaseserviceprovider.php
├── database/
│   ├── seeders/
│   └── factories/
├── public/
│   ├── index.php
│   └── .htaccess
├── resources/
│   └── views/
│       ├── layouts/
│       ├── partials/
│       └── welcome.mg.php
├── routes/
│   └── web.php
├── storage/
│   ├── session/
│   ├── cache/
│   └── logs/
├── tests/
│   └── Unit/
├── .env
├── .gitignore
├── .htaccess
├── artisan
├── composer.json
├── phpunit.xml
└── README.md

Key Features

  1. Smart Requirements Check

The installer automatically checks:

· PHP version (≥ 8.0) · Required extensions (json, mbstring, openssl) · Composer availability · Directory permissions

  1. Secure Configuration

· Auto-generated 32-byte APP_KEY · Secure file permissions (storage: 0775, .env: 0600) · .htaccess security headers · Protected configuration files

  1. Modern CLI Experience

· Colored output · Progress indicators · Clear error messages · Interactive prompts · Verbose debugging mode

  1. Complete Application Setup

· Composer.json with proper autoloading · Environment configuration · Service providers · Database configuration · Testing setup (PHPUnit) · Development server ready

Environment Configuration

The installer generates a .env file with sensible defaults:

APP_NAME="Machinjiri App"
APP_ENV=local
APP_KEY=[auto-generated-32-byte-key]
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack
LOG_LEVEL=debug

DB_CONNECTION=sqlite
DB_DATABASE=database/database.sqlite

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_CONNECTION=sync

Post-Installation Steps

After successful installation:

  1. Navigate to your project:
    cd myapp
  2. Start the development server:
    php artisan server:start
  3. Visit the welcome page: Open http://localhost:8000 in your browser
  4. Set up database:
    # For SQLite (default)
    touch database/database.sqlite
    
    # For MySQL/PostgreSQL, update .env file
  5. Run migrations:
    php artisan migrate

Development Commands

Once your project is created:

# Start development server
php artisan serve

# Run tests
php vendor/bin/phpunit

# Create controller
php artisan make:controller UserController

# Create model with migration
php artisan make:model User -m

# Run database migrations
php artisan migrate

# Generate app key (if needed)
php artisan key:generate

Troubleshooting

"Command not found" after global installation

Ensure Composer's global bin directory is in your PATH:

# Linux/macOS
export PATH="$PATH:$HOME/.composer/vendor/bin"

# Or add to your shell profile
echo 'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> ~/.bashrc
echo 'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> ~/.zshrc

# Windows (Powershell)
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";$env:APPDATA\Composer\vendor\bin", "User")

"PHP extension missing"

Install required extensions:

# Ubuntu/Debian
sudo apt-get install php8.0-json php8.0-mbstring php8.0-openssl

# CentOS/RHEL
sudo yum install php-json php-mbstring php-openssl

# macOS with Homebrew
brew install php@8.0
brew services start php@8.0

"Permission denied"

# Check directory permissions
ls -la /path/to/project

# Fix permissions (Linux/macOS)
sudo chown -R $USER:$USER /path/to/project
sudo chmod -R 755 /path/to/project/storage

"Composer install failed"

# Check Composer version
composer --version

# Clear Composer cache
composer clear-cache

# Try with verbose output
machinjiri new app -vvv

For CI/CD Pipelines

The installer supports non-interactive mode for automation:

# GitLab CI example
before_script:
  - composer global require preciouslyson/machinjiri-installer
  - export PATH="$PATH:$HOME/.config/vendor/bin:$PATH"
  - machinjiri new ${CI_PROJECT_NAME} --no-interaction --force --no-dev
  - cd ${CI_PROJECT_NAME}
  - composer install --no-dev --no-interaction

To contribute to the installer:

```bash
# Clone the repository
git clone https://github.com/preciouslyson/machinjiri-installer.git
cd machinjiri-installer

# Install dependencies
composer install

# Run tests
composer test

# Test the installer locally
php bin/machinjiri new test-app

License

This installer is part of the Machinjiri framework ecosystem and is released under the MIT License.

Support

· Documentation: Machinjiri Documentation · Issues: GitHub Issues · Email: precious.lyson@gmail.com

Happy coding with Machinjiri Framework!