speich.net logo

Installing Xdebug on Windows

There is a small catch when installing Xdebug on windows: You need to set the full path of the extension directive in the php.ini, since the default directory is only used for non-zend extensions.

; used only for 'normal' extensions
extension_dir = "C:\Program Files (x86)\PHP\ext"

; still necessary to use full path
zend_extension="C:\Program Files (x86)\PHP\ext\php_xdebug.dll"

; won't work
; zend_extension=php_xdebug.dll
Posted in PHP | Leave a comment

Why I love JetBrains phpStorm II

Here’s another example for the reason why I like phpStorm so much: SQL code assist in the Database Console completes statements either in upper case or lower case depending on how you started typing, not to speak of understanding aliased tables when suggesting column names after typing a dot.

Screenshot: SQL code assist in PhpStorm understands aliased tables.

Posted in Übrige | Tagged , | Leave a comment

Deutsche Lokalisierung von BlueGriffon 1.0

Zusammen mit André Frick habe ich die deutsche Lokalisierung des freien WYSIWYG HTML-Editors BlueGriffon erstellt. Das härteste Stück Arbeit meinerseits war das Übersetzen der Definitionen der WAI-ARIA Rollen: Eine 1:1 Übersetzung war in den seltensten Fällen möglich, dennoch durfte dabei die exakte Bedeutung nicht verloren gehen. Dazu kam noch, dass die Ausgangstexte bereits in der Originalsprache schwierig zu verstehen waren und nicht immer konsistent formuliert sind.

Falls also jemand nach einer deutschen Übersetzung der ARIA Rollen sucht, kann er diese von der Projektseite der DE-Lokalisierung auf github.com herunterladen.

Posted in Übrige | Tagged , | Leave a comment

HTML5 tutorial: How to pause/resume a file upload

I wrote a HTML5 tutorial about ‘How to pause/resume a file upload‘ which just got published on hacks.mozilla.org.

I’m very happy and excited about having contributed something to mozilla aside from a few bug reports. I started working as a web developer in 1998 at the peak of the first browser war when it could take you hours just to make simple things work across Netscape and Internet Explorer. That’s why I’ve become a firm believer of web standards and a lover of Mozilla since Mozilla 0.8.

Simon Speich started as a web developer in 1998 at the peak of the
> first browser war when it could take you hours just to make simple
> things work across Netscape and Internet Explorer. That's why he's
> been a believer of web standards and a lover of Mozilla since
> Mozilla 0.8.
Posted in Übrige | Tagged , | Leave a comment

Dojo Demo: Multiple file uploading with pause/resume

I implemented a demo of a file uploader with dojo and PHP that lets you upload multiple files at once with drag and drop. The upload of each file can be paused/resumed thanks to the slice method of the new Blob interface.

Download: The php and js code is available for download on github.com.
More info: How to resume a paused or broken file upload Continue reading

Posted in JavaScript | Tagged , , , | 20 Comments

Creating a ‘blocking’ confirm dialog with dojo

JavaScript has a window.confirm() method, which opens a dialog and stops code execution until the user presses either the ‘OK’ or ‘Cancel’ button. Dojo also comes with a dijit.Dialog widget, but that doesn’t exhibit the same blocking behavior. Since I needed to simulate the native blocking behavior for an application I am currently developing, I extended the widget and created the snet.DialogConfirm widget:

  • shows an ‘OK’ and ‘Cancel’ button by default (can be set to false)
  • shows a check box, which when set will remember the decision and not ask again (can be set to false)
  • the show() method returns a dojo.Deferred() which allows you to simulate the code blocking
  • underlay can be hidden

Update 03.12.2011: I updated the code to use dojo 1.7 with AMD. I also moved the creation of the Deferred to the show() method as suggested by ben, which will make the instance of the dialog reusable. Added new property hasUnderlay: true, which can be set to false

The demo of the DialogConfirm widget shows you how to halt code execution by just using the then() method of the returned deferred as follows:

var dialog = new snet.DialogConfirm({
   title: 'Confirm',
   content: '<p>Dialog content lore ipsum</p>'
});
dialog.show().then(function(remember) {
   // user pressed ok button
   // remember is true, when user wants you to remember his decision (user ticked the check box)
   if (remember) {
      // do something and never show this dialog again
   }
   else {
      // do something
   }
}, function() {
   // user pressed cancel button
   // do something
});
Posted in JavaScript | Tagged , , | 14 Comments

phpStorm and documenting JavaScript

I’m awed again and again by phpStorm‘s features. I just came across this one: When I comment my JavaScript methods/functions with the @param, all IDEs I have tried out so far, let you only set a primitive type in curly braces, e.g.:

 /**
 * Some method description.
 * @param {Object} deferred dojo.Deferred
 **/
someMethod: function(deferrede) {
   // ...
}

Anything else would be marked as an error. But phpStorm is a lot, lot smarter.  When I’m using dojo it recognizes all classes and I can use them as a type, e.g.:

 /**
 * Some method description.
 * @param {dojo.Deferred} deferred
 **/
someMethod: function(deferred) {
  // ...
}
Posted in JavaScript | Tagged , | Leave a comment

How to create JavaScript documentation in PhpStorm

PhpStorm’s code assist feature nicely displays our own JavaScript code documentation. But what if you wanted to create a separate documentation you can hand out or integrate into your website? Then you should use jsdoc-toolkit. You can configure and run jsdoc-toolkit directly from PhpStorm. Here is what you have to do:

Continue reading

Posted in JavaScript | Tagged , , | 1 Comment

© 2011 speich.net, Konzept und Programmierung Simon Speich.
Die Artikel auf dieser Seite laufen mit WordPress.