emacs-php / php-auto-yasnippets

Dynamically Generated YASnippets for PHP Code in GNU Emacs
GNU General Public License v3.0
41 stars 12 forks source link

Update check for cli to not throw an error #2

Closed glynnforrest closed 11 years ago

glynnforrest commented 11 years ago

Thanks for the great plugin! This is just what I needed.

I ran the php script from the command line outside of emacs and got the error

Notice: Undefined index: SERVER_NAME

On my system $_SERVER["SERVER_NAME"] is not defined when running php from the command line, so I changed the conditional to an isset to account for that.

ejmr commented 11 years ago

Thank you for the patch. The PHP script should not produce any output on errors so as to not accidentally insert into an Emacs buffer, which makes this patch a nice fix. I almost always sign-off on pull requests, which changes the commit hash, so your patch is in the master branch as 03f95b74b3a9611846077b558122c1e4d9064655. I also added your name to the README as a contributor, so thanks again.

drzraf commented 10 years ago

Without argument given, a notice is thrown $ php Create-PHP-YASnippet.php

PHP Notice:  Undefined offset: 1 in Create-PHP-YASnippet.php on line 102
PHP Stack trace:
PHP   1. {main}() Create-PHP-YASnippet.php:0

Notice: Undefined offset: 1 in Create-PHP-YASnippet.php on line 102
ejmr commented 10 years ago

@drzraf Thanks for the information. I have added commit 64aa9560ff38a4e2cdb0945fdd1d36e63206dc61 to fix the problem.