承接 machinjiri/installer 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

machinjiri/installer

最新稳定版本:1.1.0

Composer 安装命令:

composer require machinjiri/installer

包简介

Installer for Machinjiri PHP Framework

README 文档

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!

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固