Search for Resources and Solutions

Midrub Apps Interface

Midrub is a CSM which has the main scope to provide SAAS services. For this scope i've invented the Midrub's apps which are provides as services based on the user's plan. 

After 1 year of researches i've invented this app's structure:

interface Apps {


    /**

     * The public method check_availability checks if the app is available

     *

     * @return boolean true or false

     */

    public function check_availability();

    

    /**

     * The public method user loads the app's main page in the user panel

     * 

     * @since 0.0.7.9

     * 

     * @return void

     */

    public function user();

    

    /**

     * The public method ajax processes the ajax's requests

     * 

     * @since 0.0.7.9

     * 

     * @return void

     */

    public function ajax();


    /**

     * The public method rest processes the rest's requests

     * 

     * @param string $endpoint contains the requested endpoint

     * 

     * @since 0.0.7.9

     * 

     * @return void

     */

    public function rest($endpoint);

    

    /**

     * The public method cron_jobs loads the cron jobs commands

     * 

     * @since 0.0.7.9

     * 

     * @return void

     */

    public function cron_jobs();

    

    /**

     * The public method delete_account is called when user's account is deleted

     * 

     * @param integer $user_id contains the user's ID

     * 

     * @since 0.0.7.9

     * 

     * @return void

     */

    public function delete_account($user_id);

    

    /**

     * The public method hooks contains the app's hooks

     * 

     * @param string $category contains the hooks category

     * 

     * @since 0.0.7.9

     * 

     * @return void

     */

    public function load_hooks($category);


    /**

     * The public method guest contains the app's access for guests

     * 

     * @since 0.0.7.9

     * 

     * @return void

     */

    public function guest();

    

    /**

     * The public method app_info contains the app's info

     * 

     * @since 0.0.7.9

     * 

     * @return array with app's info

     */

    public function app_info();

    

}

 

Was this article helpful?