Skip to content

SysBind/moodle-dev

Repository files navigation

Moodle Development Plugin for IntelliJ IDEA

Build Version Downloads Rating

This plugin helps Moodle Developers work efficiently by providing development tools and ensuring compliance with Moodle coding standards and requirements.

Requirements

Before installing the plugin, ensure you have:

  1. PHP 7.4 or later installed and available in PATH
  2. Composer installed globally and available in PATH
  3. Git (optional, but recommended for version control)

Installation

Using IDE built-in plugin system:

  1. Open IntelliJ IDEA
  2. Go to Settings/Preferences > Plugins > Marketplace
  3. Search for "moodle-dev"
  4. Click Install Plugin
  5. Restart IDE when prompted

Manual Installation:

  1. Download the latest release
  2. Open IntelliJ IDEA
  3. Go to Preferences > Plugins > ⚙️ > Install plugin from disk...
  4. Select the downloaded plugin file
  5. Restart IDE when prompted

Configuration

Option 1: Auto Settings (Recommended)

  1. Open your Moodle project in IntelliJ IDEA
  2. Right-click on the project in the Project Explorer
  3. Select "Moodle" > "Auto Settings"
  4. The plugin will automatically:
    • Enable all required features
    • Configure your developer information
    • Set up PHP_CodeSniffer with Moodle standards
    • Set Composer's minimum-stability to dev
    • Install moodlehq/moodle-cs globally
    • Configure all necessary paths

Option 2: Manual Configuration

If you need to adjust settings manually:

  1. For PHP_CodeSniffer settings:

    • Go to Settings/Preferences > PHP > Quality Tools > PHP_CodeSniffer
    • Configure paths to phpcs and phpcbf executables
    • Set up coding standards
  2. For other Moodle-specific settings:

    • Go to Settings/Preferences > PHP > Frameworks
    • Find the "Moodle" section
    • Adjust settings as needed

Features

  • Moodle-specific code templates and generators
  • Automatic code style configuration for:
    • PHP
    • JavaScript
    • LESS
    • SCSS
  • Integration with Moodle Code Sniffer
  • Support for Moodle project structure:
    • PHP classes in 'classes/' directory
    • Mustache templates in 'templates/'
    • Database files in 'db/'
    • Language files in 'lang/'
    • JavaScript files in 'amd/src/'
    • CLI scripts in 'cli/'
    • Backup files in 'backup/'
    • Images in 'pix/'

Troubleshooting

Common Issues

  1. Plugin not detecting Moodle directory

    • Ensure the directory contains a valid Moodle installation
    • Check if version.php exists in the root directory
    • Verify directory permissions
  2. PHP_Codesniffer not working

    • Verify Composer is installed and in PATH
    • Check Composer global installation directory permissions
    • Try running composer global require moodlehq/moodle-cs manually
    • For Windows users, the plugin now automatically detects .bat extensions for executables
  3. Code style not applying

    • Ensure the plugin is enabled
    • Verify the Moodle project directory is correctly set
    • Try restarting the IDE
  4. Composer operations failing

    • The plugin now includes improved error handling and fallback mechanisms
    • Default Composer directories are checked if the command-line detection fails
    • More detailed logs are available for troubleshooting

Getting Help

  • Check the plugin issues page
  • Submit a new issue if you encounter problems
  • Include relevant logs and configuration details when reporting issues

Plugin based on the IntelliJ Platform Plugin Template.

About

This plugin will help Moodle Developers to work quickly and according to Moodle requirements

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •