benedmunds / codeigniter-cache Goto Github PK
View Code? Open in Web Editor NEWCache Money!
Home Page: http://getsparks.org/packages/cache/show
Cache Money!
Home Page: http://getsparks.org/packages/cache/show
Any chance you can update this to be loaded via composer?
Thanks for all you do for PHP.
The method $this->cache->delete_all() deletes all the files in the folder including the .htaccess and the index.html files which are necessary for security purposes.
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!
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!
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 3721 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 3721 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 3721 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 3721 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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.