zemmelmootez/phplocator
Composer 安装命令:
composer require zemmelmootez/phplocator
包简介
Click-to-code for PHP: automatic source mapping for browser extensions like LocatorJS
README 文档
README
Instantly jump from browser elements to your PHP source code
What is PHP Locator?
PHP Locator brings click-to-code functionality to PHP development. Inspired by LocatorJS, it allows you to Alt+Click any element in your browser and instantly jump to the exact source code line in VS Code.
Key Benefits:
- Zero Configuration - Install and it works automatically
- Universal Compatibility - Works with any PHP project or framework
- Instant Navigation - Jump directly to source code in seconds
- Visual Feedback - Clear indicators show clickable elements
- Professional Workflow - Streamlines debugging and development
Installation
Step 1: Browser Extension
Chrome/Edge/Brave/Opera:
- 🚀 Install from Chrome Web Store ✅ NOW LIVE!
Manual Installation:
- Download the latest release
- Extract the ZIP file
- Open
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked" → Select the
extensionfolder
Step 2: PHP Package
Option A: Composer (Recommended)
composer require zemmelmootez/phplocator
The package auto-loads and starts working immediately - no additional setup required.
Option B: Manual Installation
git clone https://github.com/zemmelmootez/phplocator.git
<?php require_once 'path/to/phplocator.php'; // Now ready to use ?>
Usage
The Simple Process:
- Hold
Altkey - Hover over any HTML element (highlights appear)
- Click the element → VS Code opens to the exact line
Framework Examples:
Vanilla PHP:
<?php // Composer auto-loads PHP Locator ?> <!DOCTYPE html> <html> <body> <h1>Welcome</h1> <!-- Alt+Click opens this line in VS Code --> <p>Content here</p> </body> </html>
Laravel Blade:
@extends('layouts.app') @section('content') <div class="container"> <h1>{{ $title }}</h1> {{-- Alt+Click opens this Blade file --}} </div> @endsection
WordPress:
<?php // In your theme's functions.php - Composer auto-loads ?> <div class="post-content"> <h2><?php the_title(); ?></h2> <!-- Alt+Click opens this template --> </div>
Advanced Configuration
Manual Data Attributes
For custom implementations:
<div data-php-file="<?php echo __FILE__; ?>" data-php-line="<?php echo __LINE__; ?>"> Custom tracked element </div>
Troubleshooting
Extension not working?
- ✅ Extension installed and enabled
- ✅ Developer mode enabled in browser
- ✅ VS Code installed with URL handler
- ✅ PHP package installed via Composer
No highlights appearing?
- Check HTML source for:
<!-- PHP Locator: Tracking file: ... --> - Verify Composer autoload is working
- Check browser console for errors
VS Code not opening?
- Ensure VS Code is properly installed
- Try:
code --install-extensionto register URL handler - Test with different browsers
Technical Details
How It Works:
- PHP Locator automatically injects source mapping data attributes
- Browser extension detects these attributes
- Alt+Click triggers VS Code protocol handler
- VS Code opens the exact file and line number
Supported Environments:
- PHP: 7.4+ (tested with 8.0, 8.1, 8.2, 8.3)
- Frameworks: Laravel, Symfony, WordPress, CodeIgniter, or any PHP project
- Browsers: Chrome, Edge, Brave, Opera (Firefox coming soon)
- IDEs: VS Code (PHPStorm support planned)
Contributing
We welcome contributions! Here's how to help:
- Fork the repository
- Create your feature branch (
git checkout -b feature/improvement) - Commit your changes (
git commit -m 'Add improvement') - Push to the branch (
git push origin feature/improvement) - Open a Pull Request
Development Setup:
git clone https://github.com/zemmelmootez/phplocator.git cd phplocator # Extension development in /extension folder # PHP development in root directory
License
This project is licensed under the MIT License - see the LICENSE file for details.
Links
- 📦 Package: Packagist
- 🐙 Source: GitHub
- 🐛 Issues: Bug Reports
- 💬 Discussions: GitHub Discussions
zemmelmootez/phplocator 适用场景与选型建议
zemmelmootez/phplocator 是一款 基于 HTML 开发的 Composer 扩展包,目前已累计 5 次下载、GitHub Stars 达 3, 最近一次更新时间为 2025 年 09 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「debugging」 「developer-tools」 「vscode」 「click-to-code」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 zemmelmootez/phplocator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 zemmelmootez/phplocator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 zemmelmootez/phplocator 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Puppeteer bridge for PHP, supporting the entire API.
A PHP package that takes a snapshot of your application and allows you to retrieve it later to help with debugging.
Laravel Database Query Logger and debug helper.
Interactive CLI that generates customized Claude Code markdown files (CLAUDE.md, commands, agents) for PHP projects with Symfony, Laravel, Rector, PHPStan, PHP-CS-Fixer, GrumPHP and more.
A PHP security linter to detect insecure functions like var_dump, print_r, and other dangerous functions in your codebase
Symfony Profiler bundle that analyzes per-request signals and produces scored, actionable optimization opportunities with ready-made AI agent prompts.
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-09-06