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

class Content extends Easol_Controller {


    protected function accessRules(){
        return [
            "index"     =>  "@",
        ];
    }

    /**
     * index action
     * @param null $id
     */
    public function index()
    {
        if(Easol_AuthorizationRoles::hasAccess(['System Administrator', 'Data Administrator'])) {

            // get the values for the html form elements.
            $this->config->load('gradelevels');
            $this->config->load('standards');

            // show the results if we are processing the html form or parsing url attributes directly.
            if ($data = $this->input->get()) {

                // define the dataset size
                $data['limit'] = EASOL_PAGINATION_PAGE_SIZE;
                // fetch the limited dataset. There will be no page attribute if we are processing the html
                // form and there will be a page attribute if we are following a pagination link.
                // If there is no page param then the api starts with the first record through the limit param. 
                $query = http_build_query($data);
                $site = 'http://content-staging.learningtapestry.com/api/v1/resources?'.$query;
                $response = json_decode(file_get_contents($site, true));
            
                // Define a new query string without the page and limit values and get the full dataset
                // for use in building the pagination links.
                $base = $data;
                unset($base['page']);
                unset($base['limit']);
                $base_qs = http_build_query($base);

                $site = 'http://content-staging.learningtapestry.com/api/v1/resources?'.$base_qs;
                $unlimited = json_decode(file_get_contents($site, true));
            }

            // build the pagination links.
            $this->load->library('pagination');
            $config['base_url'] = (isset($base_qs))? 'content?'.$base_qs : 'content?';
            $config['page_query_string'] = TRUE; 
            $config['use_page_numbers'] = TRUE;
            $config['per_page'] = 1;<commit_msg>https://github.com/EASOL/easol/issues/53 Changed API calls to https protocol.<commit_after><?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Content extends Easol_Controller {


    protected function accessRules(){
        return [
            "index"     =>  "@",
        ];
    }

    /**
     * index action
     * @param null $id
     */
    public function index()
    {
        if(Easol_AuthorizationRoles::hasAccess(['System Administrator', 'Data Administrator'])) {

            // get the values for the html form elements.
            $this->config->load('gradelevels');
            $this->config->load('standards');

            // show the results if we are processing the html form or parsing url attributes directly.
            if ($data = $this->input->get()) {

                // define the dataset size
                $data['limit'] = EASOL_PAGINATION_PAGE_SIZE;
                // fetch the limited dataset. There will be no page attribute if we are processing the html
                // form and there will be a page attribute if we are following a pagination link.
                // If there is no page param then the api starts with the first record through the limit param. 
                $query = http_build_query($data);
                $site = 'https://content-staging.learningtapestry.com/api/v1/resources?'.$query;
                $response = json_decode(file_get_contents($site, true));
            
                // Define a new query string without the page and limit values and get the full dataset
                // for use in building the pagination links.
                $base = $data;
                unset($base['page']);
                unset($base['limit']);
                $base_qs = http_build_query($base);

                $site = 'https://content-staging.learningtapestry.com/api/v1/resources?'.$base_qs;
                $unlimited = json_decode(file_get_contents($site, true));
            }

            // build the pagination links.
            $this->load->library('pagination');
            $config['base_url'] = (isset($base_qs))? 'content?'.$base_qs : 'content?';
            $config['page_query_string'] = TRUE; 
            $config['use_page_numbers'] = TRUE;
            $config['per_page'] = 1;
{'fraction_non_alphanumeric': 0.1163563829787234, 'fraction_numerical': 0.0017730496453900709, 'mean_word_length': 1.9477465708687132, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 3, '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': '5982963', 'n_tokens_mistral': 1193, 'n_tokens_neox': 1129, 'n_words': 341}