Skip to content

Commit

Permalink
Merge pull request #91 from sserbin/defer-services-json-inclusion
Browse files Browse the repository at this point in the history
Defer Services_Json inclusion/initialization until really needed
  • Loading branch information
tobio authored Jul 31, 2019
2 parents 3002903 + 288adf3 commit d8ae5ba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions class/serialisation.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<?php

if (!class_exists('Services_JSON', false)) {
require_once dirname(__FILE__).'/services_json.php';
}

if(!function_exists("CS_REST_SERIALISATION_get_available")) {
function CS_REST_SERIALISATION_get_available($log) {
$log->log_message('Getting serialiser', __FUNCTION__, CS_REST_LOG_VERBOSE);
Expand Down Expand Up @@ -107,6 +103,10 @@ class CS_REST_ServicesJsonSerialiser extends CS_REST_BaseSerialiser {

function __construct($log) {
parent::__construct($log);
if (!class_exists('Services_JSON', false)) {
require_once dirname(__FILE__).'/services_json.php';
}

$this->_serialiser = new Services_JSON();
}

Expand Down

0 comments on commit d8ae5ba

Please sign in to comment.