mortenscheel/editor-links
Composer 安装命令:
composer require mortenscheel/editor-links
包简介
A lightweight PHP package that generates clickable links to open files directly in your preferred code editor.
README 文档
README
EditorLinks
A lightweight PHP package that generates clickable links to open files directly in your preferred code editor.
Installation
You can install the package via composer:
composer require mortenscheel/editor-links
Usage
<?php use function Scheel\EditorLinks\editorLink; // Generate a link to open a file at a specific line in your editor $link = editorLink('/path/to/your/file.php', 42); // Output: phpstorm://open?file=/path/to/your/file.php&line=42 echo $link;
Supported Editors
EditorLinks supports the following editors out of the box:
phpstorm(default)sublimetextmateemacsmacvimideavscodevscode-insidersvscode-remotevscode-insiders-remotevscodiumnovaxdebugatomespressonetbeans
Configuration
Setting the editor
By default, EditorLinks uses PhpStorm as the target editor. You can change this by setting the EDITOR_LINK_EDITOR environment variable:
# In your .env file or shell environment
EDITOR_LINK_EDITOR=vscode
Using a custom link format
Alternatively you can provide a custom link format with %file and %line placeholders:
EDITOR_LINK_FORMAT=custom-scheme://open?file=%file&line=%line
Path Mapping
If you're working in an environment where file paths need to be transformed (like Docker or WSL), you can set up path mapping using the EDITOR_LINK_MAPPING environment variable:
# Format: localPath:remotePath
EDITOR_LINK_MAPPING=/var/www/html:/Users/username/Projects
This will replace /var/www/html with /Users/username/Projects in file paths.
Examples
HTML link to error location
$link = editorLink($exception->getFile(), $exception->getLine()); echo "<a href=\"$link\">Open in editor</a>";
Terminal link in console commands
// In Symfony Console command $output->writeln("<href=$link>Link label</>"); // In Laravel Artisan commands $this->output->writeln("<href=$link>Link label</>"); $this->info("<href=$link>Link label</>");
Contributing
Contributions are welcome! If you'd like to add support for another editor or improve the package, please feel free to submit a pull request.
License
The MIT License (MIT). Please see License File for more information.
Credits
mortenscheel/editor-links 适用场景与选型建议
mortenscheel/editor-links 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10.62k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 03 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「package」 「php」 「Skeleton」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mortenscheel/editor-links 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mortenscheel/editor-links 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mortenscheel/editor-links 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Simple ASCII output of array data
Slim starter / Slim skeleton package to boost your development with Slim framework
Base Skeleton for Laravel Application
An awesome skeleton for modern PHP development.
Alfabank REST API integration
统计信息
- 总下载量: 10.62k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 25
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-15