PHPackages                             alanvdb/app - 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. alanvdb/app

ActiveLibrary

alanvdb/app
===========

Personal app system

v0.1.2(1y ago)09MITPHP

Since Sep 23Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/Alanvdb/app)[ Packagist](https://packagist.org/packages/alanvdb/app)[ RSS](/packages/alanvdb-app/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (8)Versions (4)Used By (0)

AlanVdb/App
===========

[](#alanvdbapp)

**AlanVdb/App** is a modular PHP framework designed for modern web application development, featuring PSR-compliant components, robust routing, and integration with Doctrine ORM and Twig templating.

Installation
------------

[](#installation)

To create a new project, use **Composer**:

```
composer create-project alanvdb/app your-project-name
```

Configuration
-------------

[](#configuration)

After installation, configure the environment variables in the `.env` file located in the root directory of your project.

### Example `.env` File

[](#example-env-file)

```
# Debug Mode
DEBUG_MODE="true"

# Router Configuration
ROUTES_CONFIG="config/routes.php"

# Database Configuration: SQLite (default)
DB_DRIVER="sqlite"
DB_PATH="memory/database.sqlite"

# Or using MySQL database driver (uncomment and configure):
# DB_DRIVER="pdo_mysql"
# DB_HOST="127.0.0.1"
# DB_NAME="your_database"
# DB_USER="your_username"
# DB_PASSWORD="your_password"

# Doctrine ORM Configuration
ENTITY_DIRECTORIES="src/Model/Entity"
MODEL_PROXY_NAMESPACE="Model\\Proxy"
MODEL_PROXY_DIRECTORY="memory/cache/proxies"

# Twig Configuration
ACTIVATE_TEMPLATE_CACHE="false"
TEMPLATES_DIRECTORY="../assets/views"
RENDERER_CACHE_DIRECTORY="../memory/cache/templates"
```

### Switching Between SQLite and MySQL

[](#switching-between-sqlite-and-mysql)

1. **For SQLite**:

    - Keep the default values for `DB_DRIVER` and `DB_PATH`.
2. **For MySQL**:

    - Uncomment and set values for:
        - `DB_DRIVER` (use `pdo_mysql`).
        - `DB_HOST` (e.g., `127.0.0.1`).
        - `DB_NAME` (your database name).
        - `DB_USER` (your MySQL username).
        - `DB_PASSWORD` (your MySQL password).

Routing
-------

[](#routing)

Routes are defined in `config/routes.php`. Below is an example configuration:

```
