Skip to content

nnosal/phpix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ PHPix - Modern PHP Workflow Toolkit

WebService-Est v2.0 - Modern PHP development & deployment automation for macOS

Complete PHP workflow with pre-compiled binaries, deployment automation, and development tools.

✨ Features

  • PHP 8.4 via Homebrew (optimal EOL ratio for Q1 2026)
  • Composer global installation
  • WP-CLI with bundled PsySH & CPX
  • Deployer for automated deployments
  • mise task runner integration
  • Multi-environment support (production, staging, develop)

πŸ”§ Quick Start

# Clone the repository
git clone https://github.com/nnosal/phpix.git
cd phpix

# Run automated installation
chmod +x install.sh
./install.sh

# Verify installations
php -v          # PHP 8.4.x
composer -V     # Composer 2.x
wp --version    # WP-CLI 2.12.0
dep --version   # Deployer 7.5.x
psysh --version # PsySH 0.x

πŸ“¦ What Gets Installed

Core Tools

  1. PHP 8.4 (shivammathur/php tap)

    • Pre-compiled for optimal performance
    • Best EOL support ratio for 2026
  2. Composer (global)

    • Dependency management
    • Global package access via ~/.composer/vendor/bin
  3. WP-CLI Bundle

    • WordPress CLI (wp)
    • PsySH interactive shell (psysh)
    • CPX runner for Composer packages (cpx)
  4. Deployer

    • Zero-downtime deployments
    • Multi-server orchestration
    • Custom recipes included

🎯 Usage Examples

PsySH Interactive Development

# WordPress user inspection
psysh <<EOF
require 'vendor/autoload.php';
\$user = new WP_User(1);
dump(\$user->to_array());
EOF

# Database query
psysh --no-interaction '$pdo=new PDO("mysql:host=localhost;dbname=test","user","pass");$stmt=$pdo->query("SELECT COUNT(*) as count FROM users");print_r($stmt->fetch());'

# Email testing
psysh --no-interaction '$to="test@example.com";$subject="Test PsySH";$msg="Email test!";mail($to,$subject,$msg,"From: noreply@domain.com")&&echo"βœ“ Envoi OK";'

CPX Package Runner

# Laravel scaffolding
cpx laravel new MonSuperProjet && cd $_

# PHP CS Fixer
cpx php-cs-fixer fix ./src

# Psalm static analysis
cpx psalm

Deployer Automation

# Deploy to staging
dep deploy staging

# Deploy to production
dep deploy production

# Rollback if needed
dep rollback production

# Run custom tasks
dep cache:clear production

Mise Task Runner

# List available tasks
mise tasks

# Run custom tasks (define in mise.toml)
mise run deploy:staging
mise run test

πŸ“ Project Structure

phpix/
β”œβ”€β”€ README.md           # This file
β”œβ”€β”€ meta.json          # Project metadata & environments
β”œβ”€β”€ mise.toml          # Task runner configuration
β”œβ”€β”€ install.sh         # Automated installation script
β”œβ”€β”€ deploy.php         # Deployer recipe
β”œβ”€β”€ composer.json      # PHP dependencies
β”œβ”€β”€ src/               # Source code
β”‚   └── example.php    # Demo PHP file
β”œβ”€β”€ tests/             # Test suite
β”‚   └── ExampleTest.php
└── .github/
    └── workflows/
        └── ci.yml     # GitHub Actions CI/CD

🌍 Environment Configuration

Configure your environments in meta.json:

{
  "env": {
    "production": {
      "host": "prod.example.com",
      "user": "deploy",
      "deploy_path": "/var/www/production"
    },
    "staging": {
      "host": "staging.example.com",
      "user": "deploy",
      "deploy_path": "/var/www/staging"
    },
    "develop": {
      "host": "localhost",
      "deploy_path": "./build"
    }
  }
}

πŸ”„ CI/CD Pipeline

GitHub Actions workflow included:

  • PHP 8.4 setup
  • Composer dependency installation
  • Code quality checks (PHP CS Fixer, Psalm)
  • Automated tests
  • Deployment on tag push

πŸ“ Requirements

  • macOS (tested on Ventura+)
  • Homebrew installed
  • Git
  • Terminal with Zsh/Bash

πŸ› οΈ Customization

Adding Custom Deployer Tasks

Edit deploy.php:

task('custom:task', function () {
    run('echo "Running custom task"');
});

after('deploy:symlink', 'custom:task');

Adding Mise Tasks

Edit mise.toml:

[tasks."deploy:all"]
run = "dep deploy --all"
description = "Deploy to all environments"

[tasks.test]
run = "vendor/bin/phpunit"
description = "Run test suite"

πŸ“š Documentation

🏒 About

WebService-Est v2.0

  • Initial Release: 2012-04-01
  • Last Update: 2025-09-12
  • Maintained by Nicolas NOSAL

πŸ“„ License

MIT License - feel free to use for your projects!


Made with ❀️ for modern PHP development on macOS

About

πŸš€ Modern PHP workflow demo with Deployer, Brew, WP-CLI, PsySH - macOS ready automation toolkit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors