{"id":31715030,"url":"https://github.com/linna/app","last_synced_at":"2025-10-09T01:51:12.318Z","repository":{"id":36908480,"uuid":"41215510","full_name":"linna/app","owner":"linna","description":"Application skeleton for rapid development with Framework","archived":false,"fork":false,"pushed_at":"2025-04-26T17:51:40.000Z","size":528,"stargazers_count":6,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-31T19:26:26.758Z","etag":null,"topics":["app","mvc","php","skeleton"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linna.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-22T16:23:30.000Z","updated_at":"2025-04-26T17:51:38.000Z","dependencies_parsed_at":"2022-09-07T14:31:27.083Z","dependency_job_id":null,"html_url":"https://github.com/linna/app","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/linna/app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linna%2Fapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linna%2Fapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linna%2Fapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linna%2Fapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linna","download_url":"https://codeload.github.com/linna/app/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linna%2Fapp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000704,"owners_count":26082894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["app","mvc","php","skeleton"],"created_at":"2025-10-09T01:50:30.525Z","updated_at":"2025-10-09T01:51:12.309Z","avatar_url":"https://github.com/linna.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"#\"\u003e\u003cimg src=\"logo-linna-128.png\" alt=\"Linna Logo\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cbr/\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"#\"\u003e\u003cimg src=\"logo-app.png\" alt=\"Linna dotenv Logo\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cbr/\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![Tests](https://github.com/linna/app/actions/workflows/tests.yml/badge.svg)](https://github.com/linna/app/actions/workflows/tests.yml)\n[![PDS Skeleton](https://img.shields.io/badge/pds-skeleton-blue.svg?style=flat)](https://github.com/php-pds/skeleton)\n[![PHP 8.1](https://img.shields.io/badge/PHP-8.1-8892BF.svg)](http://php.net)\n\n\u003c/div\u003e\n\n# About\nApplication Skeleton for Linna framework\n\n## Actual stable environment\n* app 0.16.0\n* framework 0.27.0\n* auth-mapper-* 0.2.0\n\n# Index\n1. [Requirements](#requirements)\n2. [Installation](#installation)\n3. [Before first run](#before-first-run)\n    * [Protocol and app dir config](#protocol-and-app-dir-config)\n    * [Router config](#router-config)\n4. [Url rewriting](#url-rewriting)\n    * [Apache Virtual Host config for mod_rewrite](#apache-virtual-host-config-for-mod_rewrite)\n    * [Apache .htaccess config for mod_rewrite](#apache-htaccess-config-for-mod_rewrite)\n    * [Nginx](#nginx)\n5. [Dot env file](#dot-env-file)\n\n# Requirements\n* App need [linna/framework](https://github.com/linna/framework), please read the\n[changelog](https://github.com/linna/app/blob/b0.16.0/CHANGELOG.md) for know with \nwhich version the app works.\n* PHP 7.4 or higher.\n\n\u003e **Note:** App was only tested under Linux with Apache web server with default php.ini\n\n# Installation\n\u003e **Note:** Consider use of sudo command if need administrator privileges and don't\nforget to set proper folder permissions\n\nWith [composer](https://getcomposer.org/)\n```Shell\ncd /var/www/html\nmkdir app\ncomposer create-project --prefer-dist linna/app app\n```\nWhere `app` is directory under webserver document root ex. `/var/www/html/app`\n\nAfter, run composer [dump-autoload](https://getcomposer.org/doc/03-cli.md#dump-autoload) for optimize file autoloading\n```Shell\ncomposer dump-autoload --optimize\n```\n\n# Before first run\nChange config in `config.php` file placed in `/var/www/html/app/config` directory.\n\n## Protocol and app dir config\n```php\n$options = [\n\n    'app' =\u003e [\n        //protocol utilized [http://, https://]\n        //default value set automatically\n        'protocol'     =\u003e REQUEST_SCHEME.'://',\n        //folder of the app, if app isn't in the web server root add a\n        //directory (/app, /other/app) else insert a / (slash) as value\n        //default value [/app]\n        'subFolder'    =\u003e '/app',\n        //public folder of the app, starting from web server root\n        //default value [/app/public]\n        'publicFolder' =\u003e '/app/public',\n        //.env file position, remember to add ../ if don't use an absolute path\n        'envFile'      =\u003e '../.env',\n        //name of the fallback route, indicate the path when router return a NullRoute\n        //default /error/404\n        'onNullRoute'  =\u003e '/error/404'\n    ],\n\n    //other options\n];\n```\n\n## Router config\n```php\n$options = [\n\n    //other options\n\n    'router' =\u003e [\n        //must be equal to app.subFolder, it represents the part of the path\n        //that the router ignore when check a route. Example '/app/user/delete/5'\n        //become '/user/delete/5' where the router subtract the basePath\n        //default [/app]\n        'basePath'             =\u003e '/app',\n        //url rewriting\n        //default [true]\n        'rewriteMode'          =\u003e true,\n        //part of the url that the router ignore when url rewriting is off\n        'rewriteModeOffRouter' =\u003e '/index.php?',\n    ],\n\n    //other options\n];\n```\n\n# Url rewriting\nIf you enable the option of the router named `rewriteMode` in `config.php`,\nneed to configure your virtual host/server block.\n\n## Apache Virtual Host config for mod_rewrite\nFor Apache VirtualHost config please see:  \n[http://httpd.apache.org/docs/current/vhosts/](http://httpd.apache.org/docs/current/vhosts/)  \nFor Apache mod_rewrite config please see:  \n[https://httpd.apache.org/docs/current/rewrite/](https://httpd.apache.org/docs/current/rewrite/)  \n```ApacheConf\n\u003cVirtualHost *:80\u003e\n\n    # Other virtual host directives.\n\n    \u003cDirectory /var/www/html/app\u003e\n        RewriteEngine on\n        # Route to /app/public\n        RewriteRule ^(.*)  public/$1 [L]\n    \u003c/Directory\u003e\n\n    \u003cDirectory /var/www/html/app/public\u003e\n        # Necessary to prevent problems when using a controller named \"index\" and having a root index.php\n        # more here: http://httpd.apache.org/docs/current/content-negotiation.html\n        Options -MultiViews\n\n        # Activates URL rewriting (like myproject.com/controller/action/1/2/3)\n        RewriteEngine On\n\n        # Prevent people from looking directly into folders\n        Options -Indexes\n\n        # If the following conditions are true, then rewrite the URL:\n        # If the requested filename is not a directory,\n        RewriteCond %{REQUEST_FILENAME} !-d\n        # and if the requested filename is not a regular file that exists,\n        RewriteCond %{REQUEST_FILENAME} !-f\n        # and if the requested filename is not a symbolic link,\n        RewriteCond %{REQUEST_FILENAME} !-l\n\n        # then rewrite the URL in the following way:\n        # Take the whole request filename and provide it as the value of a\n        # \"url\" query parameter to index.php. Append any query string from\n        # the original URL as further query parameters (QSA), and stop\n        # processing (L).\n        # https://httpd.apache.org/docs/current/rewrite/flags.html#flag_qsa\n        # https://httpd.apache.org/docs/current/rewrite/flags.html#flag_l\n        RewriteRule ^(.+)$ index.php [QSA,L]\n    \u003c/Directory\u003e\n\n    # Other virtual host directives.\n\n\u003c/VirtualHost\u003e\n```\n\n## Apache .htaccess config for mod_rewrite\nIf you haven't access to your apache virtual host configuration,\nyou can add .htaccess files to the app for enable mod_rewrite.  \n\nCreate `.htaccess` file in `app/` directory with this content:\n```ApacheConf\nRewriteEngine on\n# Route to /app/public\nRewriteRule ^(.*)  public/$1 [L]\n```\n\nCreate `.htaccess` file in `app/public/` directory with this content:\n```ApacheConf\n# Necessary to prevent problems when using a controller named \"index\" and having a root index.php\n# more here: http://httpd.apache.org/docs/current/content-negotiation.html\nOptions -MultiViews\n\n# Activates URL rewriting (like myproject.com/controller/action/1/2/3)\nRewriteEngine On\n\n# Prevent people from looking directly into folders\nOptions -Indexes\n\n# If the following conditions are true, then rewrite the URL:\n# If the requested filename is not a directory,\nRewriteCond %{REQUEST_FILENAME} !-d\n# and if the requested filename is not a regular file that exists,\nRewriteCond %{REQUEST_FILENAME} !-f\n# and if the requested filename is not a symbolic link,\nRewriteCond %{REQUEST_FILENAME} !-l\n\n# then rewrite the URL in the following way:\n# Take the whole request filename and provide it as the value of a\n# \"url\" query parameter to index.php. Append any query string from\n# the original URL as further query parameters (QSA), and stop\n# processing (L).\n# https://httpd.apache.org/docs/current/rewrite/flags.html#flag_qsa\n# https://httpd.apache.org/docs/current/rewrite/flags.html#flag_l\nRewriteRule ^(.+)$ index.php [QSA,L]\n```\n\n## Nginx \nFor Nginx Server Blocks config please see:  \n[https://www.nginx.com/resources/wiki/start/topics/examples/server_blocks/](https://www.nginx.com/resources/wiki/start/topics/examples/server_blocks/)  \n\nSetting url rewrite with Nginx is simpler than Apache counterpart, \nadd `try_files $uri $uri/ /index.php?$args;` to `location` block:\n```Nginx\nserver {\n\n    # Other directives\n    \n    location / {\n        # Url rewrite\n        # Add line blow to location block for enable url rewriting\n        try_files $uri $uri/ /index.php?$args;\n    }\n\n    # Other directives\n}\n```\n\n# Dot env file\nWith `composer` installation, a `.env` file is created into `app` root directory \nand it could be used for declaring default environment variables.\n\n`.env` file content look like this:\n```\n# Session\nsession.name   = linna_session\nsession.expire = 1800\n\n## Pdo Mysql\npdo_mysql.user     = root\npdo_mysql.password =\n\n## Mysqli\n#mysqli.host     = 127.0.0.1\n#mysqli.user     = root\n#mysqli.password =\n#mysqli.database = linna_db\n#mysqli.port     = 3306\n\n## MongoDB\n#mongo_db.uri = mongodb://localhost:27017\n\n## Memcached\n#memcached.host = localhost\n#memcached.port = 11211\n```\n\n`.env` file valid keys:\n```\nsession.name\nsession.expire\n\npdo_mysql.dsn\npdo_mysql.user\npdo_mysql.password\n\npdo_pgsql.dsn\npdo_pgsql.user\npdo_pgsql.password\n\nmysqli.host\nmysqli.user\nmysqli.password\nmysqli.database\nmysqli.port\n\nmongo_db.uri\n\nmemcached.host\nmemcached.port\n```\n\nValues declared in the file will overwrite `config.php` values.\n\nPosition of `.env` file could be changed editing `envFile` value.\n```php\n$options = [\n\n    'app' =\u003e [\n        //other app options\n        'envFile'           =\u003e '../.env'\n    ],\n\n    //other options\n];\n```\n\nIf you do not want use `.env` file can delete it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinna%2Fapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinna%2Fapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinna%2Fapp/lists"}