drunken-php

Atom snippets for PHP, right kinda wrong

Jan T. Sott

41,421

17

0.3.2

MIT

GitHub

Drunken PHP for Atom

apm apm apm CI

Description

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.

Installation

apm

Install drunken-php from Atom's Package Manager or the command-line equivalent:

$ apm install drunken-php

Using Git

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

Usage

Aliases

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:

Prince Versions

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

Spacing

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

Spelling

Corrects common spelling mistakes.

Examples:

PHP Alias
mb_strwidth mb_strwidht
ob_get_length ob_get_lenght
phpversion phpverison

Synonyms

Makes some native syntax more descriptive

Examples:

PHP Alias
asin arc_sin (or arcsin)
asort array_sort
bzcompress bzip_compress

Word Order

The order of noun and verb is reversible

Examples:

PHP Alias
ini_get get_ini
get_class class_get

License

This work is licensed under The MIT License