本文整理汇总了PHP中ServiceUtil::getObjByCurie方法的典型用法代码示例。如果您正苦于以下问题:PHP ServiceUtil::getObjByCurie方法的具体用法?PHP ServiceUtil::getObjByCurie怎么用?PHP ServiceUtil::getObjByCurie使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ServiceUtil
的用法示例。
在下文中一共展示了ServiceUtil::getObjByCurie方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: summary
public function summary($page)
{
require_once 'ServiceUtil.php';
$util = new ServiceUtil();
require_once 'Config.php';
$myConfig = new Config();
$myConfig->loadJsonConfig($data);
$pageName = NULL;
$termObj = NULL;
$pageName = $page;
$pos = strpos($pageName, ":");
//echo "----pos:".$pos;
if ($pos == false) {
$pageName = str_replace("_", "%20", $page);
$pageName = str_replace(",", "%2c", $pageName);
$data["page"] = $page;
}
$isNifID = false;
$originalPageName = "";
if ($pos != false) {
$termObj[0] = $util->getObjByCurie($pageName);
#echo "\n-------Willy----!is_null(termObj):".!is_null($termObj)."\n";
if (!is_null($termObj) && !is_null($termObj[0])) {
$data['curie'] = $termObj[0]->curie;
if (count($termObj[0]->labels) > 0) {
$data['pageName'] = $termObj[0]->labels[0];
$pageName = $data['pageName'];
$originalPageName = $pageName;
$pageName = str_replace(" ", "%20", $pageName);
$pageName = str_replace(",", "%2c", $pageName);
$data['pageName'] = $pageName;
$isNifID = true;
} else {
$data['pageName'] = $pageName;
}
} else {
$data['pageName'] = $pageName;
$termObj = getTerm($pageName);
}
}
$pageName = str_replace(str_split('_'), '%20', $pageName);
$pageName = str_replace(str_split(','), '%2c', $pageName);
$pageName = str_replace(str_split('/'), '%2f', $pageName);
$data['pageName'] = $pageName;
$data['page_title'] = $pageName;
$data['enable_config'] = true;
$stitle = "";
if (!$isNifID) {
$stitle = ucfirst($page);
$stitle = str_replace("_", " ", $stitle);
$data['title'] = $stitle;
} else {
$stitle = $originalPageName;
$data['title'] = $stitle;
}
$this->handleDataSpace($data, $pageName);
$this->load->view('api/view_summary', $data);
}
示例2: view
public function view($page = 'home')
{
require_once 'ServiceUtil.php';
$util = new ServiceUtil();
require_once 'Config.php';
$myConfig = new Config();
$myConfig->loadJsonConfig($data);
$pageName = $page;
$termObj = NULL;
$termObj[0] = $util->getObjByCurie($pageName);
#echo "\n-------Willy----!is_null(termObj):".!is_null($termObj)."\n";
if (!is_null($termObj) && !is_null($termObj[0])) {
$data['curie'] = $termObj[0]->curie;
if (count($termObj[0]->labels) > 0) {
$data['pageName'] = $termObj[0]->labels[0];
$pageName = $data['pageName'];
//echo "PageName here-----".$pageName;
$originalPageName = $pageName;
$pageName = str_replace(" ", "%20", $pageName);
// echo "<br/>PageName here-----".$pageName;
$pageName = str_replace(",", "%2c", $pageName);
// echo "<br/>PageName here-----".$pageName;
$data['pageName'] = $pageName;
$isNifID = true;
} else {
$data['pageName'] = $pageName;
}
}
$pageName = str_replace(str_split('_'), '%20', $pageName);
$pageName = str_replace(str_split(','), '%2c', $pageName);
$pageName = str_replace(str_split('/'), '%2f', $pageName);
$data['pageName'] = $pageName;
$data['page_title'] = $pageName;
$data['title'] = $pageName;
$data['enable_config'] = true;
//$newCurie = str_replace(":","_",$data['curie']);
$fileName = "/" . $data['config_array']->cache_folder . "/" . $data['curie'] . "-literature-String.cache";
//echo "<br/>".$fileName;
$stats = NULL;
if (file_exists($fileName)) {
$stats = stat($fileName);
}
$current = time();
$diff = $current - $stats[9];
/*if (file_exists($fileName) && $diff > (86400 * 1))
{
unlink($fileName);
//echo "unlinking due to expiration.";
}
else if(file_exists($fileName) && filesize($fileName) == 0)
{
unlink($fileName);
//echo "unlinking due to empty file";
}*/
// $fileContent = file_get_contents($fileName);
//echo "<br/>File content:".$fileContent."------";
if (!file_exists($fileName)) {
//echo "<br/>----File does not exist:".$fileName."-----";
$this->handleLiterature($data, $pageName);
$this->load->view('pages/outputLiteratureAsString', $data);
} else {
//echo "<br/>----File exists:".$fileName;
$fileContent = file_get_contents($fileName);
$data['fileContent'] = $fileContent;
$this->load->view('pages/outputLiteratureAsString2', $data);
}
//$this->load->view('templates/header2', $data);
//$this->load->view('templates/footer2', $data);
}
示例3: view
public function view($page = 'home')
{
//require 'Globals.php';
//$enableCaching = false;
//require_once 'CacheConfig.php';
//require_once 'JsonClientUtil.php';
//require_once 'Config.php';
$this->load->helper('url');
require_once 'ServiceUtil.php';
$util = new ServiceUtil();
require_once 'Config.php';
$myConfig = new Config();
$myConfig->loadJsonConfig($data);
//$this->loadJsonConfig($data);
//init();
/*if ( ! file_exists(APPPATH.'/views/pages/'.$page.'.php'))
{
// Whoops, we don't have a page for that!
show_404();
}*/
$pageName = NULL;
$termObj = NULL;
$pageName = $page;
$pos = strpos($pageName, ":");
//echo "----pos:".$pos;
if ($pos == false) {
$pageName = str_replace("_", "%20", $page);
$pageName = str_replace(",", "%2c", $pageName);
$data["page"] = $page;
}
$isNifID = false;
$originalPageName = "";
//Loading sources configurations
/*$sources = $this->loadSourcesConfig($data);
if($sources != null)
{
$data['ks_sources'] = $sources;
}*/
//Loading categories configurations
/*$categories = $this->loadCategoriesConfig($data);
if($categories != null)
{
$data['categories'] = $categories;
}*/
if ($pos != false) {
$termObj[0] = $util->getObjByCurie($pageName);
#echo "\n-------Willy----!is_null(termObj):".!is_null($termObj)."\n";
if (!is_null($termObj) && !is_null($termObj[0])) {
$data['curie'] = $termObj[0]->curie;
if (count($termObj[0]->labels) > 0) {
$data['pageName'] = $termObj[0]->labels[0];
$pageName = $data['pageName'];
//echo "PageName here-----".$pageName;
$originalPageName = $pageName;
$pageName = str_replace(" ", "%20", $pageName);
// echo "<br/>PageName here-----".$pageName;
$pageName = str_replace(",", "%2c", $pageName);
// echo "<br/>PageName here-----".$pageName;
$data['pageName'] = $pageName;
$isNifID = true;
} else {
$data['pageName'] = $pageName;
}
} else {
$data['pageName'] = $pageName;
$termObj = getTerm($pageName);
}
} else {
$data['pageName'] = $pageName;
//echo "-----pageName:".$pageName;
$termObj = $util->getTerm($pageName);
//var_dump($termObj);
$protocol = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443 ? "https://" : "http://";
$domainName = $_SERVER['HTTP_HOST'];
if (!is_null($termObj)) {
//echo "-------------termObj size: ".count($termObj);
if (count($termObj) == 1 && isset($termObj[0]) && !is_null($termObj[0]->curie)) {
//redirect('http://google.com', 'location');
redirect($protocol . "://" . $domainName . "/" . Config::$localContextName . "/index.php/pages/view/" . $termObj[0]->curie, 'refresh');
}
if (count($termObj) > 1) {
//http://localhost/NeuroKS/index.php/TermLanding/view/cerebellum%20purkinje%20cell
//redirect($protocol.":/".$domainName."/".Config::$localContextName."/index.php/Term/view/".$page, 'refresh');
$data['termObj'] = $termObj;
$temp_page_title = $pageName = str_replace(str_split('_,'), ' ', $page);
$data['page_title'] = "Term:" . $temp_page_title;
$data['enable_config'] = false;
//redirect('http://google.com', 'location');
//redirect($protocol."://".$domainName."/".Config::$localContextName."/index.php/pages/view/".$termObj[0]->curie, 'refresh');
//exit(0);
$this->load->view('templates/header2', $data);
$this->load->view('pages/DisplayTermLanding', $data);
$this->load->view('templates/footer2', $data);
return;
//exit(0);
}
$data['curie'] = $termObj[0]->curie;
}
}
//.........这里部分代码省略.........