pushHandler($handler); // Create the logger $this->logger = new Logger($_SERVER['SERVER_ADDR']); // Create Graylog GELF TCP transport $transport = new Gelf\Transport\TcpTransport("10.0.0.112",12201); // Create GELF handler $handler = new GelfHandler(new Gelf\Publisher($transport)); // Now add GELF handler to logger $this->logger->pushHandler($handler); // You can now use your logger $logger->info('My logger is now ready'); $cache = \Config\Services::cache(); $blog_array_cache = $cache->get('blog_array'); var_dump($cache->getMetadata('ameye')); */ $data=array(); $this->db = \Config\Database::connect($this->con_name); try { $mysql = "SELECT id, post_title, post_content,post_date,comment_count FROM wp_posts WHERE post_type='post' AND post_status = 'publish' ORDER BY post_date DESC LIMIT 5"; $mysql = "SELECT p1.id AS id, p1.*, wm2.meta_value FROM wp_posts p1 LEFT JOIN wp_postmeta wm1 ON (wm1.post_id = p1.id AND wm1.meta_value IS NOT NULL AND wm1.meta_key = '_thumbnail_id' ) LEFT JOIN wp_postmeta wm2 ON (wm1.meta_value = wm2.post_id AND wm2.meta_key = '_wp_attached_file' AND wm2.meta_value IS NOT NULL ) WHERE p1.post_status='publish' AND p1.post_type='post' ORDER BY p1.post_date DESC LIMIT 5"; $query = $this->db->query($mysql); $row = $query->getResultArray(); // print_r( $row ); // $r = $this->db->query($mysql); $data["blog_array"] = $row; } catch (Exception $ex) { } if (! $blog_array_cache = cache('blog_array')) { // echo 'Saving to the cache!
'; // $foo = 'foobarbaz!'; // Save into the cache for 5 minutes // cache()->save('blog_array', $data["blog_array"], 300); // cache()->save('ameye', 'testing_ameye', 300); } // var_dump($cache->getCacheInfo()); // var_dump($cache->redis->is_supported()); // featured try { $mysql = "SELECT id, post_title, post_content,post_date,comment_count FROM wp_posts WHERE post_type='post' AND post_status = 'publish' AND id = 263"; $query = $this->db->query($mysql); $rowF = $query->getResultArray(); // print_r( $rowF ); // $r = $this->db->query($mysql); $data["blog_featured"] = $rowF[0]; } catch (Exception $ex) { } //return view('welcome_message'); return view('chiefsoft',$data); } public function projectstart() { return view('projects/index'); } }