Lines Matching defs:meta
264 $meta = p_read_metadata($id, $cache);
285 $metafn = metaFN($id, '.meta');
298 $old_meta = $meta;
299 $meta = p_render_metadata($id, $meta);
301 if ($meta == $old_meta || p_save_metadata($id, $meta)) {
303 // this timestamp is also stored when the meta data is still the same
313 $val = $meta['current'] ?? null;
349 $meta = $orig;
356 $meta = $render ? p_render_metadata($id, $orig) : $orig;
362 // be careful with sub-arrays of $meta['relation']
365 if (isset($meta['current'][$key][$subkey]) && is_array($meta['current'][$key][$subkey])) {
366 $meta['current'][$key][$subkey] = array_replace($meta['current'][$key][$subkey], (array)$subvalue);
368 $meta['current'][$key][$subkey] = $subvalue;
371 if (isset($meta['persistent'][$key][$subkey]) && is_array($meta['persistent'][$key][$subkey])) {
372 $meta['persistent'][$key][$subkey] = array_replace(
373 $meta['persistent'][$key][$subkey],
377 $meta['persistent'][$key][$subkey] = $subvalue;
382 // be careful with some senisitive arrays of $meta
386 $meta['current'][$key] = empty($meta['current'][$key]) ?
388 array_replace((array)$meta['current'][$key], $value);
391 $meta['persistent'][$key] = empty($meta['persistent'][$key]) ?
393 array_replace((array)$meta['persistent'][$key], $value);
399 $meta['current'][$key] = $value;
400 if ($persistent) $meta['persistent'][$key] = $value;
405 if ($meta == $orig) return true;
409 $METADATA_RENDERERS[$id]['current'] = $meta['current'];
410 $METADATA_RENDERERS[$id]['persistent'] = $meta['persistent'];
413 return p_save_metadata($id, $meta);
418 * Purges the non-persistant part of the meta data
428 $meta = p_read_metadata($id);
429 foreach ($meta['current'] as $key => $value) {
430 if (isset($meta[$key]) && is_array($meta[$key])) {
431 $meta['current'][$key] = [];
433 $meta['current'][$key] = '';
436 return p_save_metadata($id, $meta);
457 $file = metaFN($id, '.meta');
458 $meta = file_exists($file) ?
463 $cache_metadata[(string)$id] = $meta;
466 return $meta;
473 * @param array $meta metadata
477 function p_save_metadata($id, $meta)
482 if (isset($cache_metadata[$id])) $cache_metadata[$id] = $meta;
484 $INFO['meta'] = $meta['current'];
487 return io_saveFile(metaFN($id, '.meta'), serialize($meta));
529 $renderer->meta =& $orig['current'];
538 $evt->result = ['current' => &$renderer->meta, 'persistent' => &$renderer->persistent];