PHP is often criticized for having an inconsistent syntax and this is exactly what Drunken PHP aims at. It's a set of alternative command completions, including aliases for ill-formed syntax. Read the Aliases section below for examples.
Install drunken-php
from Atom's Package Manager or the command-line equivalent:
$ apm install drunken-php
Change to your Atom packages directory:
Windows
# Powershell
$ cd $Env:USERPROFILE\.atom\packages
:: Command Prompt
$ cd %USERPROFILE%\.atom\packages
Linux & macOS
$ cd ~/.atom/packages/
Clone repository as drunken-php
:
$ git clone https://github.com/idleberg/atom-drunken-php drunken-php
You can tell apart Drunken PHP from proper syntax from the %
-prefix displayed in the command completion window. Aliases have been broken up into the following categories:
Named after the Prince Emulator in Douglas Coupland's Microserfs, you can substitute any to
with the number 2
and vice versa.
Examples:
PHP | Alias |
---|---|
bin2hex |
bintohex |
cal_to_jd |
cal2jd |
Enables you to type commands with or without spacing. Probably obsolete due to fuzzy completions.
Examples:
PHP | Alias |
---|---|
get_html_translation_table |
gethtmltranslationtable |
getimagesizefromstring |
get_image_size_from_string |
Corrects common spelling mistakes.
Examples:
PHP | Alias |
---|---|
mb_strwidth |
mb_strwidht |
ob_get_length |
ob_get_lenght |
phpversion |
phpverison |
Makes some native syntax more descriptive
Examples:
PHP | Alias |
---|---|
asin |
arc_sin (or arcsin ) |
asort |
array_sort |
bzcompress |
bzip_compress |
The order of noun and verb is reversible
Examples:
PHP | Alias |
---|---|
ini_get |
get_ini |
get_class |
class_get |
This work is licensed under The MIT License