Define DATADIR constant in `index.php` and `console`

## Define DATADIR constant in `index.php` and `console`