GithubHelp home page GithubHelp logo

codeigniter-cache's People

Contributors

ericlbarnes avatar jeroenvdgulik avatar philsturgeon avatar tjoosten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codeigniter-cache's Issues

Composer?

Any chance you can update this to be loaded via composer?

Thanks for all you do for PHP.

permission

Hello mate,

I'm using your lib widely - it's nice.
But files created with library, can't be somehow deleted, their chmod shows 777, but still no luck...
don't you know what can be an issue?

Thanks!

Query results not being stored in cache file.

I think I'm possibly just being a bit dim here, but I can't seem to get query results to store in cache files.
Here's the exact problem I'm having:

Upon running the database query, a cache file is created but the results from the database are not stored in it.
To add to my confusion, the results appear on the page upon first load, but then after a refresh, the cached file is then loaded instead, so no data is retrieved.

Here’s my controller - users.php

class Users extends CI_Controller {

 public function test()
 {
  $this->output->enable_profiler(TRUE);
  $this->load->model('mdl_users');

  $id = 2;
  $data['query'] = $this->cache->model('mdl_users', 'get_user', array($id), 120);
  
  $this->load->view('users', $data);
 }

} 

My model - mdl_users.php

class Mdl_users extends CI_Model {

 function get_user($id)
 {
  $this->db->where('id', $id);
  $this->db->limit(1);
  $query=$this->db->get('users');
  return $query;
 }
 
}

and my view - users.php

 foreach($query->result() as $row)
 {
  echo $row->name;
 }

And this is what is stored in the cache file

a:4:{s:16:"__cache_contents";O:19:"CI_DB_mysqli_result":8:{s:7:"conn_id";O:6:"mysqli":19:{s:13:"affected_rows";N;s:11:"client_info";N;s:14:"client_version";N;s:13:"connect_errno";N;s:13:"connect_error";N;s:5:"errno";N;s:5:"error";N;s:10:"error_list";N;s:11:"field_count";N;s:9:"host_info";N;s:4:"info";N;s:9:"insert_id";N;s:11:"server_info";N;s:14:"server_version";N;s:4:"stat";N;s:8:"sqlstate";N;s:16:"protocol_version";N;s:9:"thread_id";N;s:13:"warning_count";N;}s:9:"result_id";O:13:"mysqli_result":5:{s:13:"current_field";N;s:11:"field_count";N;s:7:"lengths";N;s:8:"num_rows";N;s:4:"type";N;}s:12:"result_array";a:0:{}s:13:"result_object";a:0:{}s:20:"custom_result_object";a:0:{}s:11:"current_row";i:0;s:8:"num_rows";i:1;s:8:"row_data";N;}s:15:"__cache_created";i:1401965162;s:20:"__cache_dependencies";a:0:{}s:15:"__cache_expires";i:1401965182;} 

I'm testing this on a vanilla install for now, but the site I'm intending to use this on could potentially be running hundreds of queries per second, so this would be brilliant if I can get it working!

Thanks for any help!

Multiple attempts to delete the same (inexistant) file

1 errors have occured on the following session:
IP: [::1] UA: [ApacheBench/2.3] URL: [http://localhost/]
Errors:
Severity: Warning --> unlink(/www/application/cache/news_model/3e66759ca8f636b2ee7abea7f3e3e8854fd941ca.cache): Permission denied /www/application/libraries/Cache.php 372

1 errors have occured on the following session:
IP: [::1] UA: [ApacheBench/2.3] URL: [http://localhost/]
Errors:
Severity: Warning --> unlink(/www/application/cache/news_model/3e66759ca8f636b2ee7abea7f3e3e8854fd941ca.cache): Permission denied /www/application/libraries/Cache.php 372

1 errors have occured on the following session:
IP: [::1] UA: [ApacheBench/2.3] URL: [http://localhost/]
Errors:
Severity: Warning --> unlink(/www/application/cache/news_model/3e66759ca8f636b2ee7abea7f3e3e8854fd941ca.cache): Permission denied /www/application/libraries/Cache.php 372

1 errors have occured on the following session:
IP: [::1] UA: [ApacheBench/2.3] URL: [http://localhost/]
Errors:
Severity: Warning --> unlink(/www/application/cache/news_model/3e66759ca8f636b2ee7abea7f3e3e8854fd941ca.cache): No such file or directory /www/application/libraries/Cache.php 372

1 errors have occured on the following session:
IP: [::1] UA: [ApacheBench/2.3] URL: [http://localhost/]
Errors:
Severity: Warning --> unlink(/www/application/cache/news_model/3e66759ca8f636b2ee7abea7f3e3e8854fd941ca.cache): No such file or directory /www/application/libraries/Cache.php 372

This occurred while ApacheBench was running a benchmark (100 cycles). I think it detected the cache was old and attempted to delete it multiple times (race condition?). Possibly fixable with flock?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.