elecena / nano
elecena.pl 的一个旧 PHP 框架
v0.14.0
2024-03-11 23:01 UTC
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
This package is auto-updated.
Last update: 2024-09-26 14:39:37 UTC
README
nano

测试
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
配置
- 将以下条目添加到
/etc/hosts
127.0.0.1 elecena.local
- 将
../app/apache/000-elecena.conf
复制到/etc/apache2/sites-available
。 sudo a2enmod rewrite && sudo a2enmod php5 && sudo a2ensite 000-elecena.conf
sudo service apache2 restart
rsyslog
- 在
/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>