<commit_before>one-php-mvc
===========

one-php-mvc is a true PHP microframework that is contained in one PHP file with internationalization support. No libraries, extensions or dependencies.  

It has everything you need to write an MVC application in PHP and nothing you don't need. Since one-php-mvc contains only one file to initialize and execute server requests, it contains no autoloader, no ORM/DCI, and no additional packages or frameworks.  Controllers and View pages are dynamically loaded based on the requested URL. Developers interested in using one-php-mvc can add anything else they need.  

Because the one-php-mvc microframework exists in one PHP file and only loads the files required to complete the request, this makes one-php-mvc faster than other PHP microframeworks and certainly faster than other larger PHP frameworks with built in functionalities. The application is also highly portable. Compatible with PHP 5.3 and up, one-php-mvc will run on almost any machine with any PHP configuration.

What Files are Included?
------------------------

index.php


What Other Files are Included?
------------------------------

Optionally, the user can can create a configuration file which is expected to contan a JSON object. When the Router is constructed, the user can pass in the file path for this configuration object, and it's properties will be added to the `Configuration` class.  

This repository also contains sample projects for setting up one-php-mvc for a variety of uses.  

How Should I Structure My Project?
----------------------------------

* /controllers
    * home.php
* /includes
* /views
    * /home
        * index.php
    * _layout.php
* config.json
* index.php<commit_msg>Added how to setup Webserver to readme<commit_after>one-php-mvc
===========

one-php-mvc is a true PHP microframework that is contained in one PHP file with internationalization support. No libraries, extensions or dependencies.  

It has everything you need to write an MVC application in PHP and nothing you don't need. Since one-php-mvc contains only one file to initialize and execute server requests, it contains no autoloader, no ORM/DCI, and no additional packages or frameworks.  Controllers and View pages are dynamically loaded based on the requested URL. Developers interested in using one-php-mvc can add anything else they need.  

Because the one-php-mvc microframework exists in one PHP file and only loads the files required to complete the request, this makes one-php-mvc faster than other PHP microframeworks and certainly faster than other larger PHP frameworks with built in functionalities. The application is also highly portable. Compatible with PHP 5.3 and up, one-php-mvc will run on almost any machine with any PHP configuration.

What Files are Included?
------------------------

index.php


What Other Files are Included?
------------------------------

Optionally, the user can can create a configuration file which is expected to contan a JSON object. When the Router is constructed, the user can pass in the file path for this configuration object, and it's properties will be added to the `Configuration` class.  

This repository also contains sample projects for setting up one-php-mvc for a variety of uses.  

How Should I Structure My Project?
----------------------------------

* /controllers
    * home.php
* /includes
* /views
    * /home
        * index.php
    * _layout.php
* config.json
* index.php


How Do I Setup My Webserver?
----------------------------

Same way as other PHP MVC framworks:  

### Apache

In your site-configurtaion file add the following:  

    <Directory />
        RewriteEngine On
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule .* index.php [QSA,L]
    </Directory>

## IIS

In the Web.config add the following:  

    ﻿<?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <directoryBrowse enabled="false" />
            <rewrite>
                <rules>
                    <rule name="Rewrite Rule" stopProcessing="true">
                        <match url="^(.*)$" ignoreCase="true" />
                        <conditions>
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                        </conditions>
                        <action type="Rewrite" url="index.php" appendQueryString="true" />
                    </rule>
                </rules>
            </rewrite>
        </system.webServer>
    </configuration>
{'fraction_non_alphanumeric': 0.10815563860189052, 'fraction_numerical': 0.0015387997362057595, 'mean_word_length': 2.588328075709779, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 1, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3123007', 'n_tokens_mistral': 1141, 'n_tokens_neox': 1091, 'n_words': 539}