Overview

Packages

  • controller
  • models
  • None

Classes

  • Ajax
  • Article
  • Cache
  • Employee
  • Firefly
  • gmreader
  • gmsite
  • Home
  • Link
  • Merchant
  • Model_article
  • Model_cache
  • Model_employee
  • Model_firefly
  • Model_gmreader
  • Model_gmsite
  • Model_link
  • Model_merchant
  • Model_reference
  • Model_user
  • Reference
  • Setting
  • User

Functions

  • check_permission
  • data_status
  • data_status_select
  • dump_html_tree
  • employee_select
  • file_get_html
  • generate_page
  • gerenate_pager_from_table
  • get_desc_asc
  • get_url_support
  • is_admin
  • is_loggedin
  • link_extractor
  • merchant_status
  • reference_reverter
  • role_select
  • siteinfo
  • str_get_html
  • yes_no
  • yesno_select
  • Overview
  • Package
  • Class
 1: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 2: 
 3: /**
 4:  * The Cache class is the controller used for managing data cache in database.
 5:  *
 6:  * @package   controller
 7:  * @version   0.01
 8:  * @since     2014-04-03
 9:  * @author    Rizwan Ali <riz@bitspro.com>
10:  */
11: class Cache extends CI_Controller {
12:     /**
13:      * Builds cache for each article iteratively by giving starting id
14:      *
15:      * @param int $id
16:      *
17:      * @return string
18:      *
19:      * @since   2014-04-03
20:      * @author  Rizwan Ali <riz@bitspro.com>
21:      */
22:     function build($id = 0){
23:         $this->load->model('Model_article');
24:         $articles = $this->db->select('data_body,data_id')->from('xenon_data')->where('data_id >',$id)->limit(1500)->get();
25:         $article_id = 0;
26:         foreach($articles->result() as $article){
27:             $this->Model_article->build_article_temp($article->data_body,$article->data_id);
28:             $article_id = $article->data_id;            
29:         }
30:         echo '<a href="'.site_url('cache/build/'.$article_id).'">Next Page</a>';
31:     }
32: 
33:     /**
34:      * Builds cache for each article iteratively for GMReader by giving starting id
35:      *
36:      * @param int $id
37:      *
38:      * @return string
39:      *
40:      * @since   2014-04-03
41:      * @author  Rizwan Ali <riz@bitspro.com>
42:      */
43:     function build_reader_full($id = 0){
44:         $this->load->model('Model_article');
45:         $this->load->model('Model_cache');
46:         $articles = $this->db->select('data_body_cache,data_id')->from('xenon_data')->where('data_id >',$id)->limit(1500)->get();
47:         $article_id = 0;
48:         foreach($articles->result() as $article){
49:             $this->Model_cache->build_article_cache_gmreader($article->data_body_cache,$article->data_id);
50:             $article_id = $article->data_id;            
51:         }
52:         echo '<a href="'.site_url('cache/build_reader_full/'.$article_id).'">Next Page</a>';
53:     }
54: 
55:     /**
56:      * Builds single article cache for GMReader by giving id of article
57:      *
58:      * @param int $id
59:      *
60:      * @return void
61:      *
62:      * @since   2014-04-03
63:      * @author  Rizwan Ali <riz@bitspro.com>
64:      */
65:     function build_reader_single($id = 0){
66:         $this->load->model('Model_article');
67:         $articles = $this->db->select('data_body_temp,data_id')->from('xenon_data')->where('data_id',$id)->get();
68:         $article_id = 0;
69:         foreach($articles->result() as $article){
70:             $this->Model_article->build_article_cache_gmreader($article->data_body_temp,$article->data_id);
71:             $article_id = $article->data_id;            
72:         }
73:     }
74: 
75:     /**
76:      * Find and enlist all the article whose cache are not being generated
77:      *
78:      * @return view
79:      *
80:      * @since   2014-04-03
81:      * @author  Rizwan Ali <riz@bitspro.com>
82:      */
83:     function not_done(){
84:         if($this->input->get('page')!=''){
85:             $page = $this->input->get('page');
86:             $start = ($page * 50)-50;
87:             $end = ($page * 50);
88:             $this->db->limit(50,$start);
89:         }else{
90:             $this->db->limit(50);
91:         }
92:         $articles = $this->db->from('xenon_data')->like('data_body_temp','Copyright')->get();
93:         $this->load->view('head');
94:         $this->load->view('article/not_done',array('articles'=>$articles));
95:         $this->load->view('foot');
96:     }
97: }
98: ?>
API documentation generated by ApiGen