Giter VIP home page Giter VIP logo

ad-server-php's Introduction

Ad Server

Installation

  • Run composer install.
  • Create vw_ad_server database and import vw_ad_server.sql.
  • Update Config.php with DB connection details.

Usage

Campaigns

POST http://host/campaigns - create
GET http://host/campaigns - read all
GET http://host/campaigns/1 - read by ID
DELETE http://host/campaigns - delete all
DELETE http://host/campaigns/1 - delete by ID

Banners

POST http://host/banners - create
GET http://host/banners - read all
GET http://host/banners/1 - read by ID
DELETE http://host/banners - delete all
DELETE http://host/banners/1 - delete by ID

Campaign and banners

GET http://host/campaignAndBanners - create batch

Example banners key:

[{"name":"banner1", "width": 200, "height": 300, "content": "lorem"}, {"name": "banner2", "width": 400, "height": 500, "content": "ipsum"}, {"name": "banner3", "width": 600, "height": 700, "content": "dolor"}])

Recommend

GET http://host/recommend?width=200&height=300 - read random banner

Notes

  • I didn't need to create a storage interface as I followed an ORM pattern, and in doing so each developer created Model just extends Model which is my storage handler. I would need to think of any way to implement using a storage interface.
  • I use the NetBeans default formatting (Alt + Shift + f) but would have liked to get some kind of lint running. I tried to get a psr2 plugin working in NetBeans but was unable to.
  • I would have broken the controller logic up into other classes to avoid instantiating controllers but I didn't due to lack of time. I would like to have found a solution to passing $_POST data to these classes instead of using the global $_POST but that would require understanding the RestServer route handling better. I could have maybe passed all the parameters through the URL to try fix the $_POST issue but this would have presented other issues.
  • Would like to have setup and use JSON data for sending to the API.
  • Didn't have time to do API update (PUT) calls.
  • Would have setup .env but had no time so went with a static class approach.
  • If allowed I would have added an additional library for running unit tests.

ad-server-php's People

Contributors

wancieho 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.