<commit_before><?php defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * @author <NAME> <<EMAIL>>, 2014
 * @license The MIT License, http://opensource.org/licenses/MIT
 */

class Client_controller extends Base_Controller {

    public function __construct() {

        parent::__construct();

        $this->template
            ->set_partial('subnavbar', 'rest/subnavbar')
            ->set('subnavbar_item_active', 'restclient')
        ;

        $this->registry->set('nav', 'playground');
    }

    public function index() {

        $code =
'    private function ci_rest($user_id) {

        $this->load->library(\'rest\', array(
            \'server\' => site_url(\'playground/rest/server-api-example/\'),
            //\'http_user\' => \'admin\',
            //\'http_pass\' => \'<PASSWORD>\',
            //\'http_auth\' => \'basic\' // or \'digest\'
        ));

        $result = $this->rest->get(\'users/id/\'.$user_id.\'/format/json\');

        return $result;
    }
';
        $result = $this->ci_rest(1);

        ob_start();
        echo print_d($result, true);
        $result = ob_get_contents();
        ob_end_clean();

        $this->template
            ->set('code', $code)
            ->set('result', $result)
        ;

        $this->template->build('rest/client');
    }

    private function ci_rest($user_id) {

        $this->load->library('rest', array(
            'server' => site_url('playground/rest/server-api-example/'),
            //'http_user' => 'admin',
            //'http_pass' => '<PASSWORD>',
            //'http_auth' => 'basic' // or 'digest'
        ));

        $result = $this->rest->get('users/id/'.$user_id.'/format/json');

        return $result;
    }
<commit_msg>Rest Client Demo: Avoiding future possible property name conflicts with REST_Controller, using the property name 'rest_client'.<commit_after><?php defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * @author <NAME> <<EMAIL>>, 2014
 * @license The MIT License, http://opensource.org/licenses/MIT
 */

class Client_controller extends Base_Controller {

    public function __construct() {

        parent::__construct();

        $this->template
            ->set_partial('subnavbar', 'rest/subnavbar')
            ->set('subnavbar_item_active', 'restclient')
        ;

        $this->registry->set('nav', 'playground');
    }

    public function index() {

        $code =
'    private function ci_rest($user_id) {

        $this->load->library(\'rest\', array(
            \'server\' => site_url(\'playground/rest/server-api-example/\'),
            //\'http_user\' => \'admin\',
            //\'http_pass\' => \'<PASSWORD>\',
            //\'http_auth\' => \'basic\' // or \'digest\'
        ), \'rest_client\');

        $result = $this->rest_client->get(\'users/id/\'.$user_id.\'/format/json\');

        return $result;
    }
';
        $result = $this->ci_rest(1);

        ob_start();
        echo print_d($result, true);
        $result = ob_get_contents();
        ob_end_clean();

        $this->template
            ->set('code', $code)
            ->set('result', $result)
        ;

        $this->template->build('rest/client');
    }

    private function ci_rest($user_id) {

        $this->load->library('rest', array(
            'server' => site_url('playground/rest/server-api-example/'),
            //'http_user' => 'admin',
            //'http_pass' => '<PASSWORD>',
            //'http_auth' => 'basic' // or 'digest'
        ), 'rest_client');

        $result = $this->rest_client->get('users/id/'.$user_id.'/format/json');

        return $result;
    }

{'fraction_non_alphanumeric': 0.19302580999450852, 'fraction_numerical': 0.0027457440966501922, 'mean_word_length': 2.1004255319148935, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 67, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7254683', 'n_tokens_mistral': 1143, 'n_tokens_neox': 1090, 'n_words': 195}