Autocomplete in Aptana 3 for CodeIgniter 2

Based on the instructions from Autocomplete in Eclipse for CodeIgniter 2, I tried to get it done with Aptana 3. It’s a little bit different, so here is what I did:

I modified the files from CodeIgniter like explained by TaggedZi.
Then I added a new user library. Open Aptana 3 and navigate to:
Window > Preferences > Aptana > Editors > PHP – Libraries
Click New user library, type in a name and select the path to the modified CodeIgniter library.

Adding a new user library for CodeIgniter 2
Adding a new user library for CodeIgniter 2

Deselect the library and close the Preferences.
Now open the properties of your actual project and go to PHP Buildpath > Libraries.
Uncheck “Use Project specified settings”and select the CodeIgniter library.

Changing project properties
Changing project properties

Done! Now Aptana 3 autocompletes the CodeIgniter 2 functions.

Edit: December 27, 2011
Some other neat solutions: Aptana 3 and CodeIgniter 2 code completion

 

Script für mktorrent

Ein Script zum erstellen von Torrents. Einfach eine Datei oder einen Ordner angeben und mktorrent erstellt eine gleichnamige Torrentdatei.

#!/bin/bash
TAG="[TaG]"

if [ ! $1 = "" ]; then
    if [ -e "$1.torrent" ]; then
        rm "$1.torrent"
    fi
    mktorrent -v -l 21 -a http://localhost:2710/announce -n "$TAG$1" -o "$1.torrent" "$1"
    mv "$1" "$TAG$1"
else
    echo "Usage: mkt <file|dir>"
fi
exit 0

PHP-Shorttags ersetzen

Ich bin vor kurzem auf ein PHP-Projekt gestoßen, das Shorttags voraussetzt.
Da diese aber nicht empfohlen werden, habe ich mir mal ein Bash-Script gebastelt um die alle zu ersetzen.

[bash highlight=”7″]#!/bin/bash
if [ "$1" = "-h" ]; then
echo "Replaces short php open tags <? with <?php in all files of the current dir."
exit 0
fi

find ./ -name "*.php" -exec sed -i -e ‘s!<?php!#php_long_tag#!g’ -e ‘s!<?!#php_long_tag#!g’ -e ‘s!#php_long_tag#!<?php !g’ {} \;

echo "done"

exit 0[/bash]