Svick Framework is a simple, fast, standardized, flexible and scalable php http api development framework.

πŸš€ Features

  • 1. PHP7.2+
  • 2. PSR-4 standard automatic loading
  • 3. Lightweight, flexible expansion, quick start
  • 4. Support service container, realize dependency injection and inversion of control
  • 5. Support single application, multi-application, multi-version API
  • 6. Multi-environment support, such as development environment (dev), test environment (test) and online environment (pro)
  • 7. Support cli mode operation
  • 8. ORM chain call, support database read and write separation settings, can be specific to a certain table
  • 9. Simple and easy-to-use Http client

🦊 install

First enter the directory where you store the project, such as: cd D:\php

> composer create-project tomener/svick svick-demo

Do you want to remove the existing VCS (.git, .svn..) history? [Y,n]?
> Y

> cd svick-demo

> php svick serve

πŸ‘‰ visit

Address 1:http://localhost:8090

Address 2:http://your ip:8090

πŸ“• Documentation

address:http://svick.gumaor.com/

Of course you can also use apache, nginx

apache

<VirtualHost *:9000>
    ServerAdmin webmaster@svick.com
    DocumentRoot "D:\php\svick-demo\public"
    ServerName localhost
    ErrorLog "logs/api.svick-demo.de-error.log"
    CustomLog "logs/api.svick-demo.de-access.log" common

    <Directory "D:\php\svick-demo\public">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
        Header set Access-Control-Allow-Origin *
        Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Token"
    </Directory>
</VirtualHost>

nginx

server {
    listen       9000;
    server_name  localhost

    charset utf-8;
    access_log off;

    root /data/svick-demo/public;

    error_page 404 /404.html;

    add_header Access-Control-Allow-Origin *;
    add_header Access-Control-Allow-Headers 'Token,Uptoken';
    add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
    add_header Access-Control-Max-Age 86400;

    location / {
        if ($request_method = 'OPTIONS') {
            return 204;
        }
        index index.php index.html;
        if (!-e $request_filename) {
            rewrite ^/(.*)$ /index.php/$1 last;
        }
    }

    location ~ \.php(/|$) {
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        fastcgi_pass   unix:/dev/shm/php-fpm.sock;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param  PATH_INFO        $fastcgi_path_info;
        include        fastcgi_params;
    }
}

#Svick #Framework #homepage #documentation #downloads #php #http #api #development #framework #News Fast Delivery

Leave a Comment

Your email address will not be published. Required fields are marked *