Example #1
0
 /**
  * Hent info fra global cache
  */
 public function cache_global_load()
 {
     static $is_loading = false;
     if ($is_loading) {
         return false;
     }
     // avoid recursive calls
     $is_loading = true;
     // forsøk og last inn cache
     $res = $this->filmdb->cache_get($this->path_id);
     if ($res) {
         $this->cache_movie = $res['movie_details'];
         $this->cache = $res['imdb'];
     }
     $is_loading = false;
     if (!$res) {
         return false;
     }
     return true;
 }
Example #2
0
<?php

namespace henrist\FilmDB;

require "vendor/autoload.php";
set_time_limit(0);
define("HS_FILMDB_WIN", stripos(PHP_OS, 'win') !== false);
$filmdb = new FilmDB();
$filmdb->init();
// last inn template
require "base/template/template.php";
$template = new \hs_filmdb_template();
/*if (isset($_GET['reindex']) || (isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == "reindex"))
{
	self::reindex();
	die;
}*/
// indekser noen filmer
/*if (isset($_GET['index']) || (isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == "index"))
{
	header("Content-Type: text/plain");
	ob_implicit_flush(true);
	ob_end_flush();
	$filmer = hs_imdbdata::get_all_movies_grouped();

	echo "Starting indexing...\n";

	$i = 0;
	foreach ($filmer['unknown'] as $film)
	{
		if ($i++ == 20) break;