Beispiel #1
0
 public final function readMetadata()
 {
     $this->name = $this->filename;
     $filePath = MUSICS_DIR . DS . $this->getFilehash() . '.mp3';
     if (file_exists($filePath)) {
         $id_start = filesize($filePath) - 128;
         $fp = fopen($filePath, "r");
         fseek($fp, $id_start);
         $tag = fread($fp, 3);
         dev_dump($tag);
         if ($tag == "TAG") {
             $this->name = fread($fp, 30);
             $this->artist = fread($fp, 30);
             $this->album = fread($fp, 30);
             //$data['year'] = fread($fp, 4);
             //$data['comment'] = fread($fp, 30);
             //$data['genre'] = fread($fp, 1);
             fclose($fp);
             return true;
         } else {
             fclose($fp);
             return false;
         }
     } else {
         return false;
     }
 }
Beispiel #2
0
function dump_globals()
{
    dev_dump($_POST, "Post Values Array", 1);
    dev_dump($_GET, "Get Values Array", 1);
    dev_dump($_SESSION["user"], "Signed in user Values Array", 1);
    dev_dump($_SESSION, "All Session Values Array", 1);
    dev_dump($_FILES, "Files Array", 1);
    dev_dump($_COOKIE, "Cookie Array", 1);
    //dev_dump($_SERVER,"Server Values Array",1);
    //phpinfo();
}
Beispiel #3
0
 public function page_missing($fail_type, $id, $url_extra, $node = null)
 {
     $node_404 = $this->node_model->get_node(404, 'page');
     if (1 == $this->config->item('dev_404')) {
         // unset session message so we don't get a lagged 404
         $this->session->set_userdata('message', '');
         dev_dump('fail type:');
         dev_dump($fail_type);
         dev_dump('id into function:');
         dev_dump($id);
         dev_dump('url extra:');
         dev_dump($this->data['current_tab']);
         dev_dump('retrieved node:');
         dev_dump($node);
     }
     $this->_reload($node_404['url'], 'page not found - ' . $fail_type, 'fail');
 }
Beispiel #4
0
 private function dump($data)
 {
     if ($this->debug_mode == 1) {
         dev_dump($data);
     }
 }
Beispiel #5
0
 public function get_nodes($where_clauses = array(), $joined = null, $order_by = null, $limit = null)
 {
     /* BENCHMARK */
     $this->benchmark->mark('func_get_nodes_start');
     // get the type of node to retrieve, could be null
     if (isset($where_clauses['type'])) {
         $type = $where_clauses['type'];
     } else {
         $type = '';
         if ($joined != null) {
             dev_dump('type must be set in where array if a joined record set is required');
         }
     }
     // default the order by if it isn't explicitly set
     if (null == $order_by) {
         // set order by to node_order, then name as master default
         // this way name will come into play if node_orders are all 0s which is how they default
         $order_by = 'node_order,name';
         // get config order bys and set if present
         $order_bys = $this->config->item('default_list_order');
         if (isset($order_bys[$type])) {
             $order_by = $order_bys[$type];
         }
     }
     // get the nodes, either with a join or without
     if (null == $joined) {
         if (is_array($where_clauses)) {
             $nodes = $this->db->select('*')->from('node')->where($where_clauses);
         } else {
             $nodes = $this->db->select('*')->from('node')->where($where_clauses, null, false);
         }
         $nodes = $nodes->order_by($order_by);
         if ($limit != null && is_numeric($limit)) {
             $node = $nodes->limit($limit);
         }
         $nodes = $nodes->get()->result_array();
     } else {
         if ('user' == $type ? $id_key = 'user_id' : ($id_key = 'node_id')) {
         }
         if (is_array($where_clauses)) {
             $nodes = $this->db->select('*')->from('node')->where($where_clauses)->join($type, 'node.id=' . $type . '.' . $id_key);
         } else {
             $nodes = $this->db->select('*')->from('node')->where($where_clauses, null, false)->join($type, 'node.id=' . $type . '.' . $id_key);
         }
         $nodes = $nodes->order_by($order_by);
         if ($limit != null && is_numeric($limit)) {
             $node = $nodes->limit($limit);
         }
         $nodes = $nodes->get()->result_array();
     }
     // add human type and flag
     for ($x = 0; $x < count($nodes); $x++) {
         $nodes[$x]['human_type'] = $this->get_human_type($nodes[$x]['type']);
         $nodes[$x]['flag_id'] = $nodes[$x]['type'] . "_" . $nodes[$x]['id'];
     }
     /* BENCHMARK */
     $this->benchmark->mark('func_get_nodes_end');
     return $nodes;
 }
Beispiel #6
0
<?php

foreach ($cells as $date => $events) {
    ?>
	<?php 
    dev_dump($events);
}
Beispiel #7
0
 public function categorised_links()
 {
     // get categories
     $this->load->model('hierarchy_model');
     $query = $this->db->select('*')->from('hierarchy')->join('node', 'hierarchy.node_id=node.id')->join('category', 'hierarchy.node_id=category.node_id')->order_by('lft');
     $res = $query->get();
     $cats = $res->result_array();
     $stubbed_cats = array();
     foreach ($cats as $c) {
         $stubbed_cats[] = array($c['id'], $c['parent_id'], $c['lft'], $c['name']);
     }
     dev_dump($stubbed_cats);
     die;
     // iterate, add links
 }