Giter VIP home page Giter VIP logo

tiny's Introduction

Tiny PHP Framework

Tiny PHP framework 主要是我在做游戏项目沉淀积累。 我参考了很多游戏的框架,例如doitphp,Cascade.

controller层,比较easy,主要是将我们项目中用到的Cascade引入,cascade的优点如下:

  1. 对各类数据源的访问同一接口

  2. 对memcache的访问直接用如下方法

    直接在gateway层添加callSessionBefore或callSessionAfter,AOP**,实现调用数据库数据与缓存数据分离。

    public function callSessionAfter($method,$args,$result) { switch ($method) { case 'execute' : $cache_session = $this->cache_session;

             if ($cache_session !== null && $args[1] == 'insert' && !empty($args[2]['qid']) && !empty($args[2]['user_id'])) {
                 $key = $args[2]['user_id'].'_'.$args[2]['qid'].'_got_reward';
    
                 $v = $cache_session->get($key);
                 if(empty($v[0])){
    
                     //                      $start_time = strtotime("now");
                     //                      $end_time = strtotime(date('Y-m-d').' 23:59:59');
                     //                      $time = abs($end_time - $start_time);
    
                     $cache_session->set($key, true, COUNTRY_POINT_QUARTER_CYCLE_TIME);
                 }   
    
             }   
    
             break;
         default :
             break;
     }   
     return null;
    

    }

  3. 分库分表

  4. 并非一般MVC结构,新增一层service,可提供不同的应用接口

tiny's People

Contributors

tetang1230 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.