本文整理汇总了PHP中C::init方法的典型用法代码示例。如果您正苦于以下问题:PHP C::init方法的具体用法?PHP C::init怎么用?PHP C::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类C
的用法示例。
在下文中一共展示了C::init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
<?php
trait T
{
public function init()
{
parent::init();
}
}
class A
{
public function init()
{
echo 'A::init';
}
}
class B extends A
{
use T;
}
class C extends B
{
public function init()
{
parent::init();
}
}
$obj = new C();
$obj->init();
示例2: array
class C
{
// there are a couple of categories of basic queries; we keep track of them
public static $baseQueries = array("year", "genre", "director", "actor", "rating", "rated", "length", "lOp", "sep", "connector");
public static $logicOps = array("and" => array(), "or" => array(), "not" => array());
// we keep track of keywords, with associated information to them
public static $keywords = array("before" => array("base" => "year", "oLim" => ST), "after" => array("base" => "year", "oLim" => ST), "higher" => array("base" => "rating"), "lower" => array("base" => "rating"), "directed" => array("base" => "director"), "director" => array("base" => "director"), "rating" => array("base" => "rating", "oLim" => ST), "rated" => array("base" => array("rating", "rated"), "oLim" => ST));
public static $rateSites = array("imdb" => array(), "rotten" => array(), "tomato" => array(), "netflix" => array());
public static $genres = array("action", "adventure", "animation", "biography", "comedy", "crime", "documentary", "drama", "family", "fantasy", "film-noir", "history", "horror", "music", "musical", "mystery", "romance", "sci-fi", "sport", "thriller", "war", "western");
public static $genreAliases = array("scifi" => "sci-fi", "science fiction" => "sci-fi", "biographies" => "biography", "comedies" => "comedy", "documentaries" => "documentary", "historical" => "history", "mysteries" => "mystery", "fantasies" => "fantasy", "romantic" => "romance");
// any element of the array we map to may be a valid genre
public static $emotions = array("sad" => array("drama", "war"), "funny" => array("comedy"), "serious" => array("documentary", "drama", "film-noir", "history", "war", "biography"), "scary" => array("thriller", "horror"), "intense" => array("thriller"), "kid" => array("animation", "family"));
public static $emotionRegexPattern;
// this is just the ones people may search for
public static $familyRating = array("G", "PG", "PG-13", "14A", "NC-17", "18A", "R", "X");
public static $regexRules = array("/^\\d{4}\$/" => array("base" => "year", "oLim" => EN), "/^\\d{1,3}\\%?\$/" => array("base" => array("length", "rating")), "/^\\d{1}\\.\\d+\$/" => array("base" => "rating"));
public static $connectors = array("by" => array("directed" => array("base" => "director", "pLim" => ST)), "than" => array("lower" => "copy", "higher" => "copy"), "with" => array("movies" => array("base" => "sep", "oLim" => BOTH), "movie" => array("base" => "sep", "oLim" => BOTH)));
/* Does all one time initialization -- will only be called upon including
this file. */
static function init()
{
// 1: create a regex from the $emotions array
static::$emotionRegexPattern = "/(" . implode("|", array_keys(static::$emotions));
static::$emotionRegexPattern .= ").*movie/";
// echo "emotion regex = " . static::$emotionRegexPattern . "\n";
}
}
C::init();
if ($DEBUG) {
echo "loaded all parsing constants\n";
}