Add new search algorithm and solve phar path resolution bug