👽 PHP web application using Inphinit framework, for PHP 5.3 to PHP 8
PHP framework, routes, controllers and views
Inphinit\Helper::toAscii
)Inphinit\Helper::toAscii
)Inphinit\File::mime
)For check requirements see Check requirements
cd c:\wamp\www\
composer create-project inphinit/inphinit [project_name]
cd c:\Users\[username]\Documents\
composer create-project inphinit/inphinit [project_name]
cd /var/www/
php composer.phar create-project inphinit/inphinit [project_name]
cd /home/
php composer.phar create-project inphinit/inphinit [project_name]
master
for production use), clone last release example:
git clone -b 0.5.19 --recurse-submodules https://github.com/inphinit/inphinit.git [project_name]
cd [project_name]
Note: Don't use composer dev-master (eg.
create-project inphinit/inphinit:dev-master
), to collaborate, prefer to clone with GIT, example:git clone --recurse-submodules https://github.com/inphinit/inphinit.git inphinit cd inphinit
http://localhost/[project_name]/
http://localhost/[project_name]/generate-htaccess.php
for create .htaccess
explorer.exe
to project folderserver.bat
, change php.exe
path and php.ini
for your php path:
set PHP_BIN="C:\php\php.exe"
set PHP_INI="C:\php\php.ini"
set HOST_PORT=9000
server.bat
http://localhost:9000
cd /home/[project_name]/
php -S localhost:9000 system/boot/server.php
http://localhost:9000
server
#!/bin/bash
PHP_BIN="/usr/bin/php"
PHP_INI="/etc/php.ini"
HOST_PORT=9000
./server
In folder [project_name]/system/
find main.php
and put something like this:
Route::set('GET', '/foo', 'MyController:action');
In [project_name]/system/application/Controller/
folder create an file with this name MyController.php
(case sensitive)
Put this content:
<?php
namespace Controller;
use Inphinit\Viewing\View;
class MyController
{
public function action()
{
$data = array( 'foo' => 'Hello', 'Baz' => 'World!' );
View::render('myview', $data);
}
}
In [project_name]/system/application/View/
create file with this name myview.php
(case sensitive) and put:
<p><?php echo $foo, ' ', $baz; ?></p>
Navigate to http://localhost:9000/foo
or http://localhost/[project_name]/foo
For check requirements navigate with your web-browser to http://localhost:9000/check.php
or http://localhost/[project_name]/check.php
For setup access [project_name]/system/application/Config/config.php
with your text editor and change development
key to true
or false
:
<?php
return array(
'appdata_expires' => 86400,
'development' => true,
'maintenance' => false
);
For create nginx config run with terminal:
cd /home/[project_name]/
php generate-nginx.php
And copy content to clipboard and adjust nginx.conf
Install PHP:
%SYSTEMROOT%\php
(like c:\php
, d:\php
)Installing in IIS Express:
%USERPROFILE%\Documents\IISExpress\config
applicationHost.config
<location path="WebSite1">
<system.webServer>
<handlers>
<add
name="PHP_via_FastCGI"
path="*.php"
verb=""
modules="FastCgiModule"
scriptProcessor="c:\PHP\php-cgi.exe"
resourceType="Either" />
</handlers>
</system.webServer>
</location>
%USERPROFILE%\Documents\My Web Sites\WebSite1
WebSite1
to the new folder.For more details in https://msdn.microsoft.com/en-us/library/hh994590(v=ws.11).aspx
%windir%\System32\inetsrv\config\
applicationHost.config
(requires Administrator Privileges)<defaultDocument enabled="true">
<files>
<add value="index.php" />
<add value="Default.htm" />
<add value="Default.asp" />
<add value="index.htm" />
<add value="index.html" />
<add value="iisstart.htm" />
</files>
</defaultDocument>
<fastCgi>
<application
fullPath="C:\php\php-cgi.exe"
monitorChangesTo="C:\php\php.ini"
activityTimeout="300"
requestTimeout="300"
instanceMaxRequests="10000">
<environmentVariables>
<environmentVariable name="PHPRC" value="C:\php\" />
<environmentVariable name="PHP_FCGI_MAX_REQUESTS" value="10000" />
</environmentVariables>
</application>
</fastCgi>
<handlers accessPolicy="Read, Script">
<add
name="PHP_via_FastCGI"
path="*.php"
verb="*"
modules="FastCgiModule"
scriptProcessor="C:\php\php-cgi.exe"
resourceType="Either" />