Plugin Directory

Changeset 3495148


Ignore:
Timestamp:
03/31/2026 05:40:54 AM (22 hours ago)
Author:
jamesdlow
Message:

1.5.4

  • Latest version of restlib library 20260331
Location:
pageapp
Files:
18 added
3 edited

Legend:

Unmodified
Added
Removed
  • pageapp/trunk/inc/restlib.php

    r3482874 r3495148  
    22/*
    33 * File: restlib.php
    4  * Date: 20250315
     4 * Date: 20260331
    55 * Author: James D. Low
    66 * URL: http://jameslow.com
     
    1515    public $is_wordpress = false;
    1616    public $cookie = false;
     17    public $debug = false;
    1718
    1819    /* Constructor */
    19     function __construct($apikeys = null, $cache = 60, $prefix = null, $route = 'wordpress', $cookie = false) {
     20    function __construct($apikeys = null, $cache = 60, $prefix = null, $route = 'wordpress', $cookie = false, $debug = false) {
    2021        $this->apikeys = $apikeys ? (is_array($apikeys) ? $apikeys : array($apikeys)) : array();
    2122        $this->cache = $cache !== null ? $cache : $this->cache;
     
    2324        $this->route = $route !== null ? $route : $this->route;
    2425        $this->cookie = $cookie;
     26        $this->debug = $debug;
    2527        $this->add_hooks();
    2628    }
     
    5961    }
    6062    public function error($e, $code = 1) {
     63        $this->debug($e);
    6164        $this->output(array(
    6265            'error' => $e->getMessage(),
     
    6467            'type' => get_class($e)
    6568        ));
     69    }
     70    public function error_wp($e) {
     71        $this->debug($e);
     72        return new WP_Error('error', $e->getMessage());
     73    }
     74    public function debug($e) {
     75        if ($this->debug) {
     76            error_log($e->getMessage());
     77            error_log($e->getTraceAsString());
     78        }
    6679    }
    6780    public function header_sent($header) {
     
    293306            $result = $this->method();
    294307        } catch (Exception $e) {
    295             $result = new WP_Error('error', $e->getMessage());
     308            $result = $this->error_wp($e);
    296309        } catch (TypeError $e) {
    297             $result = new WP_Error('error', $e->getMessage());
     310            $result = $this->error_wp($e);
    298311        }
    299312        $this->active = false;
  • pageapp/trunk/pageapp.php

    r3482874 r3495148  
    44Plugin URI: https://wordpress.org/plugins/pageapp/
    55Description: Extensions to Wordpress wp-json for the PageApp API and mobile framework
    6 Version: 1.5.3
     6Version: 1.5.4
    77Author: PageApp
    88Author URI: https://www.thirteen.com/
  • pageapp/trunk/readme.txt

    r3482874 r3495148  
    44Requires at least: 4.0
    55Tested up to: 6.9
    6 Stable tag: 1.5.3
     6Stable tag: 1.5.4
    77License: MIT
    88Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=K6VKWB3HZB2T2&item_name=Donation%20to%20jameslow%2ecom&currency_code=USD&bn=PP%2dDonationsBF&charset=UTF%2d8
     
    2929== Changelog ==
    3030
     31= 1.5.4 =
     32* Latest version of restlib library 20260331
     33
    3134= 1.5.3 =
    32 * Latest version of restlib library 20250315
     35* Latest version of restlib library 20260315
    3336
    3437= 1.5.2 =
    35 * Latest version of restlib library 20250306
     38* Latest version of restlib library 20260306
    3639
    3740= 1.5.1 =
Note: See TracChangeset for help on using the changeset viewer.