Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6792631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:59:40+00:00 2026-05-26T17:59:40+00:00

99% of what REST API’s do is serve as a controlled interface between client

  • 0

99% of what REST API’s do is serve as a controlled interface between client and DB, and yet I can’t for the life of me find any libraries that do just that.

All libraries focus on providing a REST interface to the developer, who then sets up the communication with the database. It seems like a no-brainer to me to create a library that already interfaces with the database, and all the developer needs to do is define some ACL rules and plug in some logic here or there.

So, before I continue and put my thoughts into actions by actually creating this sort of library, may I just ask anyone with knowledge on the subject; has anyone implemented anything like this yet? Will I be re-inventing the wheel?

I’m talking strictly about a PHP based solutions by the way, I have nothing against other languages, PHP is simply my cup of tea. But for that matter, I haven’t found any implementations in other languages either.

And in case my explanation doesn’t make it very clear, this is essentially what I’d want:

<?php

class post_controller extends controller {

    protected static $config = array(
        'select'        => true,
        'insert'        => true,
        'update'        => true,
        'delete'        => false,

        'fields'            => array(
            'id'        => array(
                'select'    => true,
                'update'    => false
            ),
            'name'      => array(
                'select'    => true,
                'update'    => true
            ),
            'content'   => array(
                'select'    => true,
                'update'    => true
            )
        )
    );

    /**
     * GET, POST, DELETE are implemented already by the parent controller
     * Just overriding PUT to modify the content entry
     */
    function put($data) {
        $data->content = htmlentities($data);
        return parent::put($data);
    }

}

?>

Thanks in advance for anyone giving their input and apologies if this is not a proper Stackoverflow question.

Edit:

To clarify, this type of service would be for specific use-cases, I don’t imagine it to be a type of thing that anyone can use for any type of web service.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:59:41+00:00Added an answer on May 26, 2026 at 5:59 pm

    I have built a similar system for SOAP and must say it’s very easy to do so. I haven’t seen any prebuilt libraries that would help you do it (and I doubt they exist – see next paragraph), but it shouldn’t take you more than a few hours to build your own solution (a day max – with testing and documentation writing included).

    It is however a whole another question if you really want to do that. REST can be (mis)used for this purpose, but it is meant for manipulating resources. Records in a database only rarely have a one-to-one mapping with resources. If they do in your case (as they did in mine) then feel free to do it, otherwise it would be nicer to provide a proper REST API. Why expose your internal DB structure to the world? YMMV, of course.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a REST API in PHP and I can't find any resources explaining
We have a Rest API that requires client certificate authentication. The API is used
I'm developing a REST api. To simplify my question, I have an API that
We have a REST API where clients can supply parameters representing values defined on
I'm studying Wikipedia REST API but I'm not able to find the right option
We have a REST API that works great. We're refactoring and deciding how to
How using the twitter rest api can i follow a user in something like
I am developing a REST API that supports two kinds of authentication protocols: login
I am designing a REST API where some resources can be filtered through query
I am using a REST API that uses oauth for authentication. When registering for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.