安装

通过Git下载框架代码

  1. | - .htaccess // Rewrite rules
  2. | - index.php // Application entry
  3. | + static
  4. | + css
  5. | + js
  6. | + img
  7. - application/
  8. - Bootstrap.php // Bootstrap
  9. + configs
  10. + controllers
  11. - IndexController.php // Default controller
  12. + layouts
  13. | + default
  14. - layout.phtml // layout
  15. + logs //Log
  16. + models //Model
  17. + services //Service
  18. + views
  19. |+ index
  20. - index.phtml // View template for default controller
  21. + library
  22. | + Star //Star Framework

服务器环境要求

PHP最低版本: 5.2+

INI配置

  1. [production]
  2. ;bootstrap路径
  3. bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
  4. ;bootstrap类名
  5. bootstrap.class = "Bootstrap"

权限设置

SF日志目录是需要权限设置,application/logs目录需要设置为可写入权限。

nginx rewrite规则

  1. server {
  2. listen 80;
  3. server_name www.yoursf.com;
  4. location / {
  5. root sf_path/public;
  6. index index.php;
  7. if (!-e $request_filename) {
  8. rewrite ^/(.*) /index.php/$1 last;
  9. }
  10. location ~* \.(js|css|png|jpg|jpeg|gif|swf|ico|html|htm)$ {
  11. break;
  12. }
  13. location ~ \.php$ {
  14. root sf_path/public;
  15. fastcgi_pass 127.0.0.1:9000;
  16. fastcgi_index index.php;
  17. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  18. include fastcgi_params;
  19. }
  20. location ~ /\.ht {
  21. deny all;
  22. }

运行

安装完成后,你可以使用浏览器输入如下URL访问刚安装完毕的SF应用: