Coder Social home page Coder Social logo

bmfu's People

Contributors

arrowrowe avatar at15 avatar commouse avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bmfu's Issues

production and develop environment for ci

Because i have changed ci's database class, so it will throw Exception when having unit test.
But this wont happen in production and development environment. so i have to add another check
for create and update error (eg: column doesn't exist).

may set the environment to test in different mode. (database class has/not exception)

model callbacks

  • before create
  • after create
  • before update
  • after update
  • before delete
  • after delete

and we may need to use event emitter, we can use symphony's ?

code style

I wrote a style guide in https://github.com/dyweb/bmFu/blob/master/doc/style.md

but now seems we have bifurcated.

@arrowrowe use countAll for model methods instead of count_all

I think it's still not too late to have this discussion.

Advantage of snake_case

  1. it follows the old standard in Codeignitor based project
  2. it's more explicit than camelCase

Advantage of CamelCase

  1. it follows modern php standard

@arrowrowe @ComMouse @swaylq @xsfour

so let's have a vote, ๐Ÿ‘ for snake_case, ๐Ÿ‘Ž for camelCase

validation

  1. generate standard output for validation error
  2. return 400 because it is client error.
  3. better have angularjs integration so front end will have little work to do. we can extend $http to another service.

you can use ilex's, but i suggest consider the one used in laravel in axws and the current one we are using in tongqu's tq folder, the one in dywiki is the newer version for that.

Add tag for release

currently we are using 'dev-master' and it's better to have version number and we can install using zip.

Better documentaion

  • usage in README.md and project wiki
  • add a MIT license to project.
  • comment for some core code.

And a Chinese version readme.....

cache layer

1. in memory cache.

eg: $row1 = User::find(1) ->
SELECT * FROMuserWHEREid= 1
User::$cached_rows['1'] = $row1 // then we cache
$row2 = User::find(1) -> return $cached_rows[1] // no more queries

2. in redis cache

eg: user A $act = Act::find(1) dbquery, $redis_client->set('user/1',$user)
user B $act = Act::find(1) $redis_client->get('user/1')

3. in mysql cache

eg: analysis for user like and dislike, friends etc. (table is large and these wont change very often)

the at15/restful may have the implementation ( have a look at `src/Dy/Restful/Resource

use guzzle to test http requests

because bmfu can be mounted to controller directly. they should get the user input and give correct
response. even if the request is invalid or contain injection.

laravel's TestCase can use $this->call to use http methods. we can learn from them.

filter user input

  • selected fields eg: act?select=name,desc,create_time
  • order by eg: act?order=+create_time-member_count
  • where eg: act?type=1

allow using the model to filter the user input, instead of write it in every controller

enable/disable create_time update_time

not all table need these two columns, eg: notification table doesn't need update_time.

add some method or const in order to enable/disable it when create and update

Collection

Do we need to realize it? If yes, then

  • Just use to iterate the objects (array wrapper)?
  • Also used in insert_batch, update_batch?

Needs further discussion.

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.