gdc_cmod/.serena/memories/project_commands.md

2.1 KiB

Development Commands

Testing

# Run all tests
composer test
./vendor/bin/phpunit

# Run single test file
./vendor/bin/phpunit tests/unit/HealthTest.php

# Run single test method
./vendor/bin/phpunit tests/unit/HealthTest.php --filter testIsDefinedAppPath

# Generate code coverage report
./vendor/bin/phpunit --colors --coverage-text=tests/coverage.txt --coverage-html=tests/coverage/ -d memory_limit=1024m

Development Server

# Start development server
php spark serve

Code Generation (CLI)

# Create controller
php spark make:controller Admin

# Create model
php spark make:model User

Routing

# List all routes
php spark list

Git Commands (Windows)

# Check git status
git status

# Check git diff
git diff

# View recent commits
git log

# Add files to staging
git add .

# Create commit
git commit -m "message"

# Push to remote
git push

# Pull from remote
git pull

File System Commands (Windows)

# List directory contents
ls
dir

# Change directory
cd directory_name

# Create directory
mkdir directory_name

# Copy files
copy source destination

# Move files
move source destination

# Remove files
del filename
rm filename

# Find files by name
dir /s /b filename

# Search content in files
findstr /s /i "search_term" *.php

CodeIgniter-Specific

# Clear cache
php spark cache:clear

# Clear view cache
php spark cache:clear

# Install dependencies
composer install
composer update

# Dump autoload
composer dump-autoload

What to do after completing a task

  1. Run tests

    composer test
    
  2. Check for errors

    • Review any output from tests
    • Check for lint errors or warnings
  3. Verify the changes

    • Test the functionality manually
    • Check if any routes or filters were affected
  4. Update documentation (if needed)

    • Add new routes to documentation
    • Update CHECKLIST.md if it's a new feature
  5. Commit changes (only when explicitly asked)

    git add .
    git commit -m "describe changes"
    

Important: Never commit changes unless explicitly asked by the user.