changed all dirname(__FILE__) to __DIR__