elecena / nano
A legacy PHP framework for elecena.pl
Installs: 1 583
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 3
Requires
- php: ^8.1
- ext-curl: *
- ext-gd: *
- ext-json: *
- ext-mbstring: *
- ext-mysqli: *
- ext-xml: *
- ext-xmlwriter: *
- ext-zlib: *
- macbre/monolog-utils: ^3.0.0
- monolog/monolog: ^3.3.1
- predis/predis: ^2.0
- tedivm/jshrink: ^1.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- phpstan/phpstan: ^1.0.1
- phpunit/phpunit: 10.5.12
- psr/cache: ^3.0.0
README
nano
Testing
docker run -d -p 6379:6379 --name redis-test redis:5.0.9-alpine redis-server --requirepass qwerty --port 6379
docker run -d -p 5555:80 --name httpin kennethreitz/httpbin
composer run test
Configuration
- Add the following entry to
/etc/hosts
:
127.0.0.1 elecena.local
- Copy
../app/apache/000-elecena.conf
to/etc/apache2/sites-available
. sudo a2enmod rewrite && sudo a2enmod php5 && sudo a2ensite 000-elecena.conf
sudo service apache2 restart
rsyslog
- Uncomment the following in
/etc/rsyslog.conf
:
# provides UDP syslog reception
$ModLoad imudp
$UDPServerRun 514
sudo service rsyslog restart
Apache
RewriteEngine On
# static assets
RewriteRule \.(css|js|gif|png|jpg)$ static.php [L]
# API requests
RewriteRule \.(json|xml)$ api.php [L]
# URL - last (always redirect)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php [L]
Nginx
<nginx>
<location path="/">
<!-- static assets -->
<rewrite>\.(css|js|gif|png|jpg)$ /static.php</rewrite>
<!-- API requests -->
<rewrite>\.(json|xml)$ /api.php</rewrite>
<!-- URL - last (always redirect) -->
<!-- @see http://rootnode.net/web#vhost-configuration-advanced-mode -->
<if condition="!-f $request_filename">
<rewrite>^/(.+)$ /index.php last</rewrite>
<break/>
</if>
</location>
</nginx>