mirror of
https://github.com/flarum/framework.git
synced 2025-03-29 18:55:14 +08:00
22 lines
477 B
PHP
Executable File
22 lines
477 B
PHP
Executable File
<?php
|
|
|
|
/*
|
|
* This file is part of Flarum.
|
|
*
|
|
* For detailed copyright and license information, please view the
|
|
* LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Flarum\PackageManager\Extension;
|
|
|
|
class ExtensionUtils
|
|
{
|
|
public static function nameToId(string $name): string
|
|
{
|
|
[$vendor, $package] = explode('/', $name);
|
|
$package = str_replace(['flarum-ext-', 'flarum-'], '', $package);
|
|
|
|
return "$vendor-$package";
|
|
}
|
|
}
|