定制 zemmelmootez/phplocator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

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

Packagist Version GitHub Stars License Downloads

🌐 Live Website & Demo

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:

Manual Installation:

  1. Download the latest release
  2. Extract the ZIP file
  3. Open chrome://extensions/
  4. Enable "Developer mode"
  5. Click "Load unpacked" → Select the extension folder

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:

  1. Hold Alt key
  2. Hover over any HTML element (highlights appear)
  3. 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-extension to register URL handler
  • Test with different browsers

Technical Details

How It Works:

  1. PHP Locator automatically injects source mapping data attributes
  2. Browser extension detects these attributes
  3. Alt+Click triggers VS Code protocol handler
  4. 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:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/improvement)
  3. Commit your changes (git commit -m 'Add improvement')
  4. Push to the branch (git push origin feature/improvement)
  5. 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

⭐ Star this repo if PHP Locator improves your workflow!

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 我们能提供哪些服务?
定制开发 / 二次开发

基于 zemmelmootez/phplocator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 0
  • Forks: 0
  • 开发语言: HTML

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-09-06