承接 devteampro/magento2-playground 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

devteampro/magento2-playground

最新稳定版本:1.0.1

Composer 安装命令:

composer require --dev devteampro/magento2-playground

包简介

Playground for devs to quickly run & test services and methods.

README 文档

README

Playground enables developers to quickly test any code in their system and access any of the services in the app.

Install via composer

composer require devteampro/magento2-playground

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

Usage

To enable the playground, just copy the playground.php.dist file from module's root dir to dev/tools directory of the project dev/tools/playground.php.

If this module is installed manually in app/code then the path would be app/code/DTP/Playground/playground.php.dist.
Or if the module is installed via composer then the path would be vendor/devteampro/magento2-playground/playground.php.dist.

Add playground.php to .gitignore file

/dev/tools/playground.php

This file needs to return a closure. Here's an example:

<?php

use Magento\Framework\App\ObjectManager;
use Magento\Framework\App\Filesystem\DirectoryList;

return function(ObjectManager $ob) {
    $dir = $ob->get(DirectoryList::class);
    dump($dir->getRoot());
};

Run playground

You should be able to run this with: bin/magento dtp:playground.

Use a different path for playground

You can specify a different folder path for playground.php file if, don't want to add in dev/tools directory. Just update the pgDir argument in di.xml file

<type name="DTP\Playground\UI\Console\PlaygroundCommand">
        <arguments>
            <argument name="pgDir" xsi:type="const">DTP\Playground\UI\Console\PlaygroundDirResolver::PG_DIR_PATH</argument>
        </arguments>
    </type>

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: OSL-3.0
  • 更新时间: 2025-06-02