mirror of
https://gh.wpcy.net/https://github.com/CaptainCore/captaincore.git
synced 2026-04-22 22:40:22 +08:00
29 lines
738 B
PHP
29 lines
738 B
PHP
<?php
|
|
|
|
// Replaces dashes in keys with underscores
|
|
foreach($args as $index => $arg) {
|
|
$split = strpos($arg, "=");
|
|
if ( $split ) {
|
|
$key = str_replace('-', '_', substr( $arg , 0, $split ) );
|
|
$value = substr( $arg , $split, strlen( $arg ) );
|
|
|
|
// Removes unnecessary bash quotes
|
|
$value = trim( $value,'"' ); // Remove last quote
|
|
$value = str_replace( '="', '=', $value ); // Remove quote right after equals
|
|
|
|
$args[$index] = $key.$value;
|
|
} else {
|
|
$args[$index] = str_replace('-', '_', $arg);
|
|
}
|
|
|
|
}
|
|
|
|
// Converts --arguments into $arguments
|
|
parse_str( implode( '&', $args ) );
|
|
|
|
$account = ( new CaptainCore\Accounts )->get( $account_id );
|
|
|
|
if ( $account ) {
|
|
( new CaptainCore\Account( $account_id, true ) )->delete();
|
|
}
|
|
|