PHPackages                             codelinered/file-sharing - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. codelinered/file-sharing

ActiveProject[HTTP &amp; Networking](/categories/http)

codelinered/file-sharing
========================

File Sharing - CodelineRed

4.1.0(2y ago)061[3 issues](https://github.com/CodelineRed/file-sharing/issues)[1 PRs](https://github.com/CodelineRed/file-sharing/pulls)MITPHPPHP 8.0.\*

Since Aug 2Pushed 2y agoCompare

[ Source](https://github.com/CodelineRed/file-sharing)[ Packagist](https://packagist.org/packages/codelinered/file-sharing)[ Docs](http://fs.codelinered.net)[ RSS](/packages/codelinered-file-sharing/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (16)Versions (35)Used By (0)

File Sharing - CodelineRed
==========================

[](#file-sharing---codelinered)

This git is for [fs.codelinered.net](https://fs.codelinered.net). Take a look at [screenshots](https://github.com/CodelineRed/file-sharing/tree/main/screenshots).

This application based on [Slim Skeleton](https://github.com/CodelineRed/file-sharing) and [Gulp Skeleton](https://github.com/CodelineRed/gulp-Skeleton).

Table of contents
-----------------

[](#table-of-contents)

- [Included Third Party Code](#included)
- Install Guides
    - [Install Production Build (Recommended)](#install-production-build-recommended)
    - [Install Main/ Develop Build](#install-main-develop-build)
    - [Install with Docker (optional)](#install-with-docker-optional)
- [Project Commands](#project-commands)
- [`gulpfile.json`](#gulpfilejson)
- [Path generation with Locale code and Generic locale code](#path-generation-with-locale-code-and-generic-locale-code)
- [How to create further localisations](#how-to-create-further-localisations)
- [How to switch between different url modes](#how-to-switch-between-different-url-modes)
    - [Mode 1](#mode-1)
    - [Mode 2](#mode-2)
    - [Mode 3](#mode-3-default)
- [ACL settings](#acl-settings)
- [Troubleshooting](#troubleshooting)
- [Links](#links)

Included
--------

[](#included)

- [Slim 3](https://www.slimframework.com)
- [Slim Twig View 2](https://github.com/slimphp/Twig-View)
- [Slim CSRF 0.8](https://github.com/slimphp/fs-Csrf)
- [Slim Flash 0.4](https://github.com/slimphp/fs-Flash)
- [Monolog 1](https://seldaek.github.io/monolog/)
- [Doctrine ORM 2](https://packagist.org/packages/doctrine/orm)
- [Geggleto ACL 1](https://github.com/geggleto/geggleto-acl)
- [Google Authenticator](https://github.com/PHPGangsta/GoogleAuthenticator)
- [Google reCAPTCHA 1](https://github.com/google/recaptcha)
- [HTML Compress Twig Extension](https://github.com/nochso/html-compress-twig)

Install Production Build (Recommended)
--------------------------------------

[](#install-production-build-recommended)

### Required

[](#required)

- PHP 8.0
- MySQL 5.7 (pdo\_mysql)

[Download zip](https://github.com/CodelineRed/file-sharing/archive/production.zip) if you don't have git or composer on your OS. Open console on your OS and navigate to your project folder.

```
+++++ COMPOSER VERSION +++++
$ php composer create-project codelinered/file-sharing file-sharing "dev-production" --no-dev
$ cd file-sharing
$ php doctrine dbal:run-sql "CREATE DATABASE file_sharing"
$ php doctrine orm:schema-tool:update --force
$ php doctrine dbal:import sql/all-records.sql
```

```
+++++ GIT VERSION +++++
$ git clone https://github.com/CodelineRed/file-sharing.git
$ cd file-sharing
$ git checkout production
$ (optional on unix)  rm -rf .git
$ (optional on win10) rmdir .git /s
$ (optional) cp config\additional-settings.dist.php config\additional-settings.php
$ ---- Open "config\additional-settings.php" and change everything you have to change ----
$ php composer insall --no-dev
$ php doctrine dbal:run-sql "CREATE DATABASE file_sharing"
$ php doctrine orm:schema-tool:update --force
$ php doctrine dbal:import sql/all-records.sql
```

```
+++++ ZIP VERSION +++++
$ (unix) wget -O fs-prod.zip https://github.com/CodelineRed/file-sharing/archive/production.zip
$ (unix) unzip fs-prod.zip
$ (win10) curl -L -o fs-prod.zip https://github.com/CodelineRed/file-sharing/archive/production.zip
$ (win10) tar -xf fs-prod.zip
$ cd file-sharing-production
$ (optional) cp config\additional-settings.dist.php config\additional-settings.php
$ ---- Open "config\additional-settings.php" and change everything you have to change ----
$ php composer insall --no-dev
$ php doctrine dbal:run-sql "CREATE DATABASE file_sharing"
$ php doctrine orm:schema-tool:update --force
$ php doctrine dbal:import sql/all-records.sql
```

LoginWebsiteUsernameuserPasswordpasswordIf you want to use Docker: [click here](#install-with-docker-optional)

Install Main/ Develop Build
---------------------------

[](#install-main-develop-build)

### Required

[](#required-1)

- [Node.js](http://nodejs.org/en/download/)
- [npm](http://www.npmjs.com/get-npm) `$ npm i npm@latest -g`
- [gulp-cli](https://www.npmjs.com/package/gulp-cli) `$ npm i gulp-cli@latest -g`
- PHP 8.0
- MySQL 5.7 (pdo\_mysql)

[Download zip](https://github.com/CodelineRed/file-sharing/archive/main.zip) if you don't have git on your OS. Open console on your OS and navigate to your project folder.

```
+++++ COMPOSER VERSION +++++
$ php composer create-project codelinered/file-sharing file-sharing
$ cd file-sharing
$ npm i
$ gulp build
$ php doctrine dbal:run-sql "CREATE DATABASE file_sharing"
$ php doctrine orm:schema-tool:update --force
$ php doctrine dbal:import sql/all-records.sql
```

```
+++++ GIT VERSION +++++
$ git clone https://github.com/CodelineRed/file-sharing.git
$ cd file-sharing
$ npm i
$ gulp build
$ (optional on unix)  rm -rf .git
$ (optional on win10) rmdir .git /s
$ (optional) cp config\additional-settings.dist.php config\additional-settings.php
$ ---- Open "config\additional-settings.php" and change everything you have to change ----
$ php composer insall
$ php doctrine dbal:run-sql "CREATE DATABASE file_sharing"
$ php doctrine orm:schema-tool:update --force
$ php doctrine dbal:import sql/all-records.sql
```

```
+++++ ZIP VERSION +++++
$ (unix) wget -O fs-main.zip https://github.com/CodelineRed/file-sharing/archive/main.zip
$ (unix) unzip fs-main.zip
$ (win10) curl -L -o fs-main.zip https://github.com/CodelineRed/file-sharing/archive/main.zip
$ (win10) tar -xf fs-main.zip
$ cd file-sharing-main
$ npm i
$ gulp build
$ (optional) cp config\additional-settings.dist.php config\additional-settings.php
$ ---- Open "config\additional-settings.php" and change everything you have to change ----
$ php composer insall
$ php doctrine dbal:run-sql "CREATE DATABASE file_sharing"
$ php doctrine orm:schema-tool:update --force
$ php doctrine dbal:import sql/all-records.sql
```

LoginWebsiteUsernameuserPasswordpasswordInstall with Docker (optional)
------------------------------

[](#install-with-docker-optional)

### Required

[](#required-2)

- [Docker](https://www.docker.com/)

Open console on your OS and navigate to the place where you want to install the project.

```
$ ---- Unix ----
$ systemctl docker start
$ docker run --rm --interactive --tty --volume $PWD:/app composer create-project --ignore-platform-reqs --no-dev codelinered/file-sharing file-sharing "dev-production"
$ cd file-sharing
$ cp -n config/additional-settings.dist.php config/additional-settings.php
$ docker run --rm --interactive --tty --volume $PWD:/app composer update --no-dev
$ ---- Windows ----
$ "c:\path\to\Docker Desktop.exe"
$ docker run --rm --interactive --tty --volume %cd%:/app composer create-project --ignore-platform-reqs --no-dev codelinered/file-sharing file-sharing "dev-production"
$ cd file-sharing
$ echo n | copy /-y config\additional-settings.dist.php config\additional-settings.php
$ docker run --rm --interactive --tty --volume %cd%:/app composer update --no-dev
$ --- All OS ----
$ docker-compose build
$ docker-compose up -d
```

Login[Website](http://localhost:7710)[Adminer](http://localhost:7712)Server-databaseUsernameuserrootPasswordpasswordrootdockerpwDatabase--Project Commands
----------------

[](#project-commands)

Descriptiongulpwatch files and start [BrowserSync](https://www.npmjs.com/package/browser-sync)gulp buildexecutes following tasks: cleanUp, favicon, font, img, js, jsLint, json, scss, scssLint, svggulp lintAllexecutes following tasks: jsLint, scssLintgulp cleanUpclean up public foldergulp favicongenerate faviconsgulp fontcopy font filesgulp imgcopy and compress imagesgulp jsuglify, minify and concat js filesgulp jsLintchecks js follows [lint rules](https://github.com/CodelineRed/file-sharing/blob/main/gulpfiles/app/js-lint.json)gulp jsoncopy and minify json filesgulp scsscompile, minify and concat scss filesgulp scssLintchecks scss follows [lint rules](https://github.com/CodelineRed/file-sharing/blob/main/gulpfiles/app/scss-lint.json)gulp svgcopy and compress svg filesgulp watchwatch scss, js, json, img, font and svg files[`gulpfile.json`](https://github.com/CodelineRed/file-sharing/blob/main/gulpfiles/app/gulpfile.dist.json)
---------------------------------------------------------------------------------------------------------

[](#gulpfilejson)

DescriptionbrowserSyncConfigRequired - Defines which config is used for [BrowserSync](https://www.npmjs.com/package/browser-sync) (default: browserSyncDocker)sourcePathRequired - Path to raw files (default: gulpfiles/)publicPathRequired - Path to transpiled files (default: public/)envRequired - Environment dev, test or prod (default: prod)Path generation with Locale code and Generic locale code
--------------------------------------------------------

[](#path-generation-with-locale-code-and-generic-locale-code)

- Mode 1 - example.com/de/ = `'process' => \App\Utility\LanguageUtility::LOCALE_URL | \App\Utility\LanguageUtility::DOMAIN_DISABLED,`
- Mode 2 - example.de = `'process' => \App\Utility\LanguageUtility::LOCALE_URL | \App\Utility\LanguageUtility::DOMAIN_ENABLED,`
- Mode 3 - example.com (de-DE session) = `'process' => \App\Utility\LanguageUtility::LOCALE_SESSION | \App\Utility\LanguageUtility::DOMAIN_DISABLED,` (default)

It depends on your configuration what will be returned.

Mode 1Mode 2Mode 3locale codede-DEde-DExx-XXgeneric locale codede-DExx-XXxx-XXTwigPHPTwig ExamplePHP Examplelocale code`{{ lc }}``LanguageUtility::getLocale()``{{ path_for('user-register-' ~ lc) }}``$this->router->pathFor('user-register-' . LanguageUtility::getLocale())`generic locale code`{{ glc }}``LanguageUtility::getGenericLocale()``{{ path_for('user-login-' ~ glc) }}``$this->router->pathFor('user-login-' . LanguageUtility::getGenericLocale())`How to create further localisations
-----------------------------------

[](#how-to-create-further-localisations)

- Duplicate one existing file in folder [`locale/`](https://github.com/CodelineRed/file-sharing/tree/main/locale) (e.g. copy `de-DE.php` to `fr-FR.php`)
- (if you use Mode 1 or 2) Duplicate one existing file in folder [`config/routes/`](https://github.com/CodelineRed/file-sharing/tree/main/config/routes) (e.g. copy `de-DE.php` to `fr-FR.php`)
- (if you use Mode 1 or 2) Change route prefix from `/de/` to `/fr/` in `config/routes/fr-FR.php`
- You can also define paths like `/fr-be/` (`locale/fr-BE.php`/ `config/routes/fr-BE.php`) for example
- If you want to show language in langswitch, add `fr-FR` and domain in `locale => active` ([`config/additional-settings.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/additional-settings.dist.php#L56))
- (if you use Mode 1 or 2) Add case for `fr/` in [`src/localisation.php`](https://github.com/CodelineRed/file-sharing/blob/main/src/localisation.php#L47)

How to switch between different url modes
-----------------------------------------

[](#how-to-switch-between-different-url-modes)

### Mode 1

[](#mode-1)

Example: example.com/de/

- EN is default language and DE is alternative language for this steps
- Got to `locale` in [`config/additional-settings.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/additional-settings.dist.php#L52)
- Set `'process' => \App\Utility\LanguageUtility::LOCALE_URL | \App\Utility\LanguageUtility::DOMAIN_DISABLED,`
- Set up english routes with or without `/en` prefix in [`config/routes/en-US.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/en-US.php)
- Set up german routes with `/de` prefix in [`config/routes/de-DE.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/de-DE.php)
- [`config/routes/xx-XX.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/xx-XX.php) can be leave untouched

### Mode 2

[](#mode-2)

Example: de.example.com or example.de

- EN is default language and DE is alternative language for this steps
- Got to `locale` in [`config/additional-settings.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/additional-settings.dist.php#L52)
- Set `'process' => \App\Utility\LanguageUtility::LOCALE_URL | \App\Utility\LanguageUtility::DOMAIN_ENABLED,`
- Enter your domains in `active`
- Go to [`config/routes/de-DE.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/de-DE.php)
- Remove `/de` prefix from every `route`
- Go to [`config/routes/xx-XX.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/xx-XX.php)
- Insert all routes where the config is equal between [`config/routes/en-US.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/en-US.php) and [`config/routes/de-DE.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/de-DE.php)
- Remove these equal routes in [`config/routes/en-US.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/en-US.php) and [`config/routes/de-DE.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/de-DE.php)

### Mode 3 (default)

[](#mode-3-default)

Example: example.com

- EN is default language and DE is alternative language for this steps
- Got to `locale` in [`config/additional-settings.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/additional-settings.dist.php#L52)
- Set `'process' => \App\Utility\LanguageUtility::LOCALE_SESSION | \App\Utility\LanguageUtility::DOMAIN_DISABLED,`
- Set up all routes in [`config/routes/xx-XX.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/xx-XX.php)
- [`config/routes/en-US.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/en-US.php) can be leave untouched
- [`config/routes/de-DE.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/de-DE.php) can be leave untouched

ACL settings
------------

[](#acl-settings)

With [Geggleto ACL](https://github.com/geggleto/geggleto-acl), routes are protected by role the current user has. By default every new route is not accessable until you give the route roles. Routes are defined in the route files (e.g. [`config/routes/de-DE.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/de-DE.php)). Any other resource is defined in [`config/settings.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/settings.php#L90). Inside the Twig templates you can use ACL functions [`has_role`](https://github.com/CodelineRed/file-sharing/blob/main/templates/partials/navigation.html.twig#L23) and is\_allowed. Inside controllers you can also use this ACL functions and [many more](https://github.com/geggleto/geggleto-acl/blob/main/src/AclRepository.php) (e.g. [`isAllowed()`](https://github.com/CodelineRed/file-sharing/blob/main/src/Controller/UserController.php#L101)).

Troubleshooting
---------------

[](#troubleshooting)

In some cases you'll get the error message "Internal Server Error".

If this happened, go to [`public/.htaccess`](https://github.com/CodelineRed/file-sharing/blob/main/public/.htaccess) and enable `RewriteBase /`.

If project is in sub directory then `RewriteBase /project/public/`.

Links
-----

[](#links)

- [Slim Framework](https://www.slimframework.com/)
- [Twig](https://twig.symfony.com/)
- [Doctrine](https://www.doctrine-project.org/)
- [Slim 3 and Doctrine 2 Website](http://blog.sub85.com/slim-3-with-doctrine-2.html)
- [Slim 3 and Doctrine 2 Github](https://github.com/matthewfedak/slim-3-doctrine-2)
- [DataTables Translations](https://datatables.net/plug-ins/i18n/)
- [ESLint Rules](https://eslint.org/docs/rules/)
- [Sass Lint Rules](https://github.com/sasstools/sass-lint/tree/develop/docs/rules)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~62 days

Total

31

Last Release

989d ago

Major Versions

1.x-dev → 2.0.02018-10-10

2.x-dev → 3.0.02019-04-23

3.10.0 → 4.0.02022-12-09

3.x-dev → 4.1.02023-09-01

PHP version history (4 changes)1.3.0PHP &gt;=5.5.0

3.2.0PHP &gt;=5.5.9

4.0.0PHP 8.0.\*

3.11.0PHP ^7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/ee6e31fe6d3d4e4195c529de51507adb97cad32e247d9b1be3bdce92c8837102?d=identicon)[CodelineRed](/maintainers/CodelineRed)

---

Top Contributors

[![CodelineRed](https://avatars.githubusercontent.com/u/35538671?v=4)](https://github.com/CodelineRed "CodelineRed (123 commits)")

---

Tags

downloadfilesgulpshareslim3uploadresttwigrouterpsr7doctrine2fafilesacluploadloginmicroframeworkdownloadcsrfsharelocalisation

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/codelinered-file-sharing/health.svg)

```
[![Health](https://phpackages.com/badges/codelinered-file-sharing/health.svg)](https://phpackages.com/packages/codelinered-file-sharing)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
