# Binary Bay Typo3 (v8) Muster instance

[TYPO3](https://typo3.org/) is an open source PHP based web content management system released under the GNU GPL.

## Used technologies
* [Composer](https://getcomposer.org/)
* [Gulp](http://gulpjs.com/)
* [SASS](http://sass-lang.com/)
* [Git](https://git-scm.com/)
* [PHPloy](https://github.com/banago/PHPloy)



## Installation
You have to have access to [Binary Bay git repository](https://gitlab.com/binary-bay/typo3muster8).
### Via composer create-project
In your web root folder just run:
```bash
$ composer create-project binary-bay/typo3muster8 project-name.local --repository=http://composer.binary-bay.com/ --stability=dev --prefer-dist --no-secure-http
```

### Manually
Create `project-name.local/` folder and clone/download the repository.
```bash
$ git clone git@gitlab.com:binary-bay/typo3muster8.git
```
Install composer dependecies
```bash
$ composer install
```
NOTE: If you will be asked `Do you want to remove the existing VCS (.git, .svn..) history?` hit `Y`.

Follow the instructions. You will be asked for:
* Project name [projectName]
* Database root user [databaseRootName]
* Database root password [databaseRootPassword]
* New project database user [projectDatabaseUser]
* New project database password [projectDatabasePassword]
* New project database name [projectDatabaseName]
* Muster database dump file [databaseDumpFilename]
* New project Typo3 admin username [typo3AdminUser]
* New project Typo3 admin password [typo3AdminPassword]

Then you will be asked if you want to create database for your project. Do so.
Depending on your OS you will be asked if you wnat to create vhost (Works only on Linux).

## Database
Create new database and import sql dump file from `sql/muster_v7.sql`
```sql
CREATE DATABASE projectDatabaseName;
GRANT ALL PRIVILEGES ON projectDatabaseName.* TO 'projectDatabaseUser'@'localhost' IDENTIFIED BY "projectDatabasePassword";
FLUSH PRIVILEGES;
```

## Virtualhost setup
If virtualhost wasn't created durring project installation
### Linux and macOS
Create file `project-name.local.conf` in `/etc/apache2/sites-available/` directory and paste following config.

NOTE: `conf` file path may vary depending on your OS
```bash
<VirtualHost *:80>
		DocumentRoot /var/www/project-name.local
		ServerName project-name.local
		ServerAdmin webmaster@localhost
		ServerAlias project-name.local
		SetEnv TYPO3_CONTEXT Development

		ErrorLog /var/log/apache2/project-name.local-error.log
		#LogLevel error
		#CustomLog /var/log/apache2/project-name.local-access.log combined

		<Directory /var/www/project-name.local>
		    Options Indexes FollowSymLinks MultiViews
		    AllowOverride All
		    Require all granted
		</Directory>
	</VirtualHost>
```
Don't forget to replace paths to yours.\
Add this line `127.0.0.1 project-name.local` to your hosts file `/etc/hosts`\
Restart the apache server `sudo service apache2 restart` or `sudo apachectl restart`
### Windows
[TODO:]
## IDE/Editor configuration ([.editorconfig](http://editorconfig.org/))
Use attached .editorconfig

## Deploying
Use `phploy`. See more [PHPloy](https://github.com/banago/PHPloy)

## Gulp
Install required gulp dependencies `npm install` and run gulp watch task `gulp`
