id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
32,600 | gocom/textpattern-installer | src/Textpattern/Composer/Installer/Textpattern/Validate.php | Validate.isValidConfig | public function isValidConfig()
{
$missing = [];
foreach ($this->required as $required) {
if (!array_key_exists($required, $this->txpcfg)) {
$missing[] = $required;
}
}
if ($missing) {
throw new \InvalidArgumentException(
... | php | public function isValidConfig()
{
$missing = [];
foreach ($this->required as $required) {
if (!array_key_exists($required, $this->txpcfg)) {
$missing[] = $required;
}
}
if ($missing) {
throw new \InvalidArgumentException(
... | [
"public",
"function",
"isValidConfig",
"(",
")",
"{",
"$",
"missing",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"required",
"as",
"$",
"required",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"required",
",",
"$",
"this",
"->"... | Checks that the config contains all needed options.
@throws \InvalidArgumentException | [
"Checks",
"that",
"the",
"config",
"contains",
"all",
"needed",
"options",
"."
] | 804271de54177ebd294a4a19d409ae7fc2317935 | https://github.com/gocom/textpattern-installer/blob/804271de54177ebd294a4a19d409ae7fc2317935/src/Textpattern/Composer/Installer/Textpattern/Validate.php#L72-L87 |
32,601 | gocom/textpattern-installer | src/Textpattern/Composer/Installer/Textpattern/Validate.php | Validate.hasDatabase | public function hasDatabase()
{
try {
$pdo = new \PDO(
'mysql:host='.$this->txpcfg['host'].';dbname='.$this->txpcfg['db'],
$this->txpcfg['user'],
$this->txpcfg['pass']
);
} catch (\PDOException $e) {
$pdo = false;
... | php | public function hasDatabase()
{
try {
$pdo = new \PDO(
'mysql:host='.$this->txpcfg['host'].';dbname='.$this->txpcfg['db'],
$this->txpcfg['user'],
$this->txpcfg['pass']
);
} catch (\PDOException $e) {
$pdo = false;
... | [
"public",
"function",
"hasDatabase",
"(",
")",
"{",
"try",
"{",
"$",
"pdo",
"=",
"new",
"\\",
"PDO",
"(",
"'mysql:host='",
".",
"$",
"this",
"->",
"txpcfg",
"[",
"'host'",
"]",
".",
"';dbname='",
".",
"$",
"this",
"->",
"txpcfg",
"[",
"'db'",
"]",
... | Checks if the database exists.
@throws \InvalidArgumentException | [
"Checks",
"if",
"the",
"database",
"exists",
"."
] | 804271de54177ebd294a4a19d409ae7fc2317935 | https://github.com/gocom/textpattern-installer/blob/804271de54177ebd294a4a19d409ae7fc2317935/src/Textpattern/Composer/Installer/Textpattern/Validate.php#L94-L115 |
32,602 | Vectorface/cache | src/MCCache.php | MCCache.set | public function set($key, $value, $ttl = false)
{
return $this->mc->set($key, $value, null, (int)$ttl);
} | php | public function set($key, $value, $ttl = false)
{
return $this->mc->set($key, $value, null, (int)$ttl);
} | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"ttl",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"mc",
"->",
"set",
"(",
"$",
"key",
",",
"$",
"value",
",",
"null",
",",
"(",
"int",
")",
"$",
"ttl",
")",
... | Place an item into the cache
@param string $key The cache key.
@param mixed $value The value to be stored. (Warning: Caches cannot store items of type resource.)
@param int $ttl The time to live, in seconds. The time before the object should expire.
@return bool True if successful, false otherwise. | [
"Place",
"an",
"item",
"into",
"the",
"cache"
] | 159f4aeaf639da7a1f7e1d4e5e719a279442658b | https://github.com/Vectorface/cache/blob/159f4aeaf639da7a1f7e1d4e5e719a279442658b/src/MCCache.php#L64-L67 |
32,603 | flipboxfactory/craft-ember | src/queries/ActiveQuery.php | ActiveQuery.requireAll | public function requireAll($db = null)
{
$records = $this->all($db);
if (empty($records)) {
throw new RecordNotFoundException(
sprintf(
"Records not found."
)
);
}
return $records;
} | php | public function requireAll($db = null)
{
$records = $this->all($db);
if (empty($records)) {
throw new RecordNotFoundException(
sprintf(
"Records not found."
)
);
}
return $records;
} | [
"public",
"function",
"requireAll",
"(",
"$",
"db",
"=",
"null",
")",
"{",
"$",
"records",
"=",
"$",
"this",
"->",
"all",
"(",
"$",
"db",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"records",
")",
")",
"{",
"throw",
"new",
"RecordNotFoundException",
"... | Executes query and returns all results as an array. If results are not found, an exception is
thrown as we explicitly expect results.
@param Connection $db the DB connection used to create the DB command.
If null, the DB connection returned by [[modelClass]] will be used.
@return array|ActiveRecord[] the query result... | [
"Executes",
"query",
"and",
"returns",
"all",
"results",
"as",
"an",
"array",
".",
"If",
"results",
"are",
"not",
"found",
"an",
"exception",
"is",
"thrown",
"as",
"we",
"explicitly",
"expect",
"results",
"."
] | 9185b885b404b1cb272a0983023eb7c6c0df61c8 | https://github.com/flipboxfactory/craft-ember/blob/9185b885b404b1cb272a0983023eb7c6c0df61c8/src/queries/ActiveQuery.php#L57-L70 |
32,604 | flipboxfactory/craft-ember | src/queries/ActiveQuery.php | ActiveQuery.requireOne | public function requireOne($db = null)
{
if (null === ($record = $this->one($db))) {
throw new RecordNotFoundException(
sprintf(
"Record not found."
)
);
}
return $record;
} | php | public function requireOne($db = null)
{
if (null === ($record = $this->one($db))) {
throw new RecordNotFoundException(
sprintf(
"Record not found."
)
);
}
return $record;
} | [
"public",
"function",
"requireOne",
"(",
"$",
"db",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"(",
"$",
"record",
"=",
"$",
"this",
"->",
"one",
"(",
"$",
"db",
")",
")",
")",
"{",
"throw",
"new",
"RecordNotFoundException",
"(",
"sprintf",
"... | Executes query and returns a single result. If a result is not found, an exception is
thrown as we explicitly expect a result.
@param Connection|null $db the DB connection used to create the DB command.
If `null`, the DB connection returned by [[modelClass]] will be used.
@return ActiveRecord|array a single row of qu... | [
"Executes",
"query",
"and",
"returns",
"a",
"single",
"result",
".",
"If",
"a",
"result",
"is",
"not",
"found",
"an",
"exception",
"is",
"thrown",
"as",
"we",
"explicitly",
"expect",
"a",
"result",
"."
] | 9185b885b404b1cb272a0983023eb7c6c0df61c8 | https://github.com/flipboxfactory/craft-ember/blob/9185b885b404b1cb272a0983023eb7c6c0df61c8/src/queries/ActiveQuery.php#L83-L94 |
32,605 | firebrandhq/silverstripe-hail | src/Api/Client.php | Client.getOne | public function getOne($hail_object)
{
$uri = $hail_object::$object_endpoint . '/' . $hail_object->HailID;
return $this->get($uri);
} | php | public function getOne($hail_object)
{
$uri = $hail_object::$object_endpoint . '/' . $hail_object->HailID;
return $this->get($uri);
} | [
"public",
"function",
"getOne",
"(",
"$",
"hail_object",
")",
"{",
"$",
"uri",
"=",
"$",
"hail_object",
"::",
"$",
"object_endpoint",
".",
"'/'",
".",
"$",
"hail_object",
"->",
"HailID",
";",
"return",
"$",
"this",
"->",
"get",
"(",
"$",
"uri",
")",
... | Get one Hail object from the API
@param mixed $hail_object Object to retrieve
@return array Reply from Hail
@throws | [
"Get",
"one",
"Hail",
"object",
"from",
"the",
"API"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Api/Client.php#L110-L115 |
32,606 | firebrandhq/silverstripe-hail | src/Api/Client.php | Client.fetchAccessToken | public function fetchAccessToken($redirect_code)
{
$http = $this->getHTTPClient();
$post_data = [
'client_id' => $this->client_id,
'client_secret' => $this->client_secret,
'grant_type' => 'authorization_code',
'code' => $redirect_code,
... | php | public function fetchAccessToken($redirect_code)
{
$http = $this->getHTTPClient();
$post_data = [
'client_id' => $this->client_id,
'client_secret' => $this->client_secret,
'grant_type' => 'authorization_code',
'code' => $redirect_code,
... | [
"public",
"function",
"fetchAccessToken",
"(",
"$",
"redirect_code",
")",
"{",
"$",
"http",
"=",
"$",
"this",
"->",
"getHTTPClient",
"(",
")",
";",
"$",
"post_data",
"=",
"[",
"'client_id'",
"=>",
"$",
"this",
"->",
"client_id",
",",
"'client_secret'",
"=>... | Fetch OAuth Access token from the HAil API
@param string $redirect_code
@throws | [
"Fetch",
"OAuth",
"Access",
"token",
"from",
"the",
"HAil",
"API"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Api/Client.php#L124-L150 |
32,607 | firebrandhq/silverstripe-hail | src/Api/Client.php | Client.setAccessTokenExpire | public function setAccessTokenExpire($access_token_expire)
{
//Store expiry date as unix timestamp (now + expires in)
$access_token_expire = time() + $access_token_expire;
$this->access_token_expire = $access_token_expire;
$config = SiteConfig::current_site_config();
$c... | php | public function setAccessTokenExpire($access_token_expire)
{
//Store expiry date as unix timestamp (now + expires in)
$access_token_expire = time() + $access_token_expire;
$this->access_token_expire = $access_token_expire;
$config = SiteConfig::current_site_config();
$c... | [
"public",
"function",
"setAccessTokenExpire",
"(",
"$",
"access_token_expire",
")",
"{",
"//Store expiry date as unix timestamp (now + expires in)\r",
"$",
"access_token_expire",
"=",
"time",
"(",
")",
"+",
"$",
"access_token_expire",
";",
"$",
"this",
"->",
"access_token... | Set Hail API OAuth access token expiry time in current SiteConfig
@param string $access_token_expire
@throws | [
"Set",
"Hail",
"API",
"OAuth",
"access",
"token",
"expiry",
"time",
"in",
"current",
"SiteConfig"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Api/Client.php#L188-L196 |
32,608 | firebrandhq/silverstripe-hail | src/Api/Client.php | Client.setRefreshToken | public function setRefreshToken($refresh_token)
{
$config = SiteConfig::current_site_config();
$config->HailRefreshToken = $refresh_token;
$this->refresh_token = $refresh_token;
$config->write();
} | php | public function setRefreshToken($refresh_token)
{
$config = SiteConfig::current_site_config();
$config->HailRefreshToken = $refresh_token;
$this->refresh_token = $refresh_token;
$config->write();
} | [
"public",
"function",
"setRefreshToken",
"(",
"$",
"refresh_token",
")",
"{",
"$",
"config",
"=",
"SiteConfig",
"::",
"current_site_config",
"(",
")",
";",
"$",
"config",
"->",
"HailRefreshToken",
"=",
"$",
"refresh_token",
";",
"$",
"this",
"->",
"refresh_tok... | Set Hail API OAuth refresh token in current SiteConfig
@param string $refresh_token
@throws | [
"Set",
"Hail",
"API",
"OAuth",
"refresh",
"token",
"in",
"current",
"SiteConfig"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Api/Client.php#L203-L209 |
32,609 | firebrandhq/silverstripe-hail | src/Api/Client.php | Client.handleException | public function handleException($exception)
{
//Log the error
Injector::inst()->get(LoggerInterface::class)->debug($exception->getMessage());
$request = Injector::inst()->get(HTTPRequest::class);
$request->getSession()->set('notice', true);
$request->getSession()->set('... | php | public function handleException($exception)
{
//Log the error
Injector::inst()->get(LoggerInterface::class)->debug($exception->getMessage());
$request = Injector::inst()->get(HTTPRequest::class);
$request->getSession()->set('notice', true);
$request->getSession()->set('... | [
"public",
"function",
"handleException",
"(",
"$",
"exception",
")",
"{",
"//Log the error\r",
"Injector",
"::",
"inst",
"(",
")",
"->",
"get",
"(",
"LoggerInterface",
"::",
"class",
")",
"->",
"debug",
"(",
"$",
"exception",
"->",
"getMessage",
"(",
")",
... | Silently handle Hail API HTTP Exception to avoid CMS crashes
Stores error message in a session variable for CMS display
@param \Exception $exception | [
"Silently",
"handle",
"Hail",
"API",
"HTTP",
"Exception",
"to",
"avoid",
"CMS",
"crashes",
"Stores",
"error",
"message",
"in",
"a",
"session",
"variable",
"for",
"CMS",
"display"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Api/Client.php#L217-L232 |
32,610 | firebrandhq/silverstripe-hail | src/Api/Client.php | Client.getAuthorizationURL | public function getAuthorizationURL()
{
$url = Config::inst()->get(self::class, 'AuthorizationUrl');
$params = [
'client_id' => $this->client_id,
'redirect_uri' => $this->getRedirectURL(),
'response_type' => "code",
'scope' => $this->scopes,
... | php | public function getAuthorizationURL()
{
$url = Config::inst()->get(self::class, 'AuthorizationUrl');
$params = [
'client_id' => $this->client_id,
'redirect_uri' => $this->getRedirectURL(),
'response_type' => "code",
'scope' => $this->scopes,
... | [
"public",
"function",
"getAuthorizationURL",
"(",
")",
"{",
"$",
"url",
"=",
"Config",
"::",
"inst",
"(",
")",
"->",
"get",
"(",
"self",
"::",
"class",
",",
"'AuthorizationUrl'",
")",
";",
"$",
"params",
"=",
"[",
"'client_id'",
"=>",
"$",
"this",
"->"... | Build Hail API Authorization URL
@return string | [
"Build",
"Hail",
"API",
"Authorization",
"URL"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Api/Client.php#L239-L250 |
32,611 | firebrandhq/silverstripe-hail | src/Api/Client.php | Client.setUserID | public function setUserID()
{
$response = $this->get("me");
$config = SiteConfig::current_site_config();
$config->HailUserID = $response['id'];
$this->user_id = $response['id'];
$config->write();
} | php | public function setUserID()
{
$response = $this->get("me");
$config = SiteConfig::current_site_config();
$config->HailUserID = $response['id'];
$this->user_id = $response['id'];
$config->write();
} | [
"public",
"function",
"setUserID",
"(",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"get",
"(",
"\"me\"",
")",
";",
"$",
"config",
"=",
"SiteConfig",
"::",
"current_site_config",
"(",
")",
";",
"$",
"config",
"->",
"HailUserID",
"=",
"$",
"respo... | Get Hail User ID from the API and set it in the current SiteConfig
@throws | [
"Get",
"Hail",
"User",
"ID",
"from",
"the",
"API",
"and",
"set",
"it",
"in",
"the",
"current",
"SiteConfig"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Api/Client.php#L257-L264 |
32,612 | firebrandhq/silverstripe-hail | src/Api/Client.php | Client.getAccessToken | public function getAccessToken()
{
//Check if AccessToken needs to be refreshed
$now = time();
$time = time();
$difference = $this->access_token_expire - $time;
if ($difference < strtotime('15 minutes', 0)) {
$this->refreshAccessToken();
}
... | php | public function getAccessToken()
{
//Check if AccessToken needs to be refreshed
$now = time();
$time = time();
$difference = $this->access_token_expire - $time;
if ($difference < strtotime('15 minutes', 0)) {
$this->refreshAccessToken();
}
... | [
"public",
"function",
"getAccessToken",
"(",
")",
"{",
"//Check if AccessToken needs to be refreshed\r",
"$",
"now",
"=",
"time",
"(",
")",
";",
"$",
"time",
"=",
"time",
"(",
")",
";",
"$",
"difference",
"=",
"$",
"this",
"->",
"access_token_expire",
"-",
"... | Get current Hail API OAuth Access token
Will refresh the token from the API if it has expired
@return string | [
"Get",
"current",
"Hail",
"API",
"OAuth",
"Access",
"token",
"Will",
"refresh",
"the",
"token",
"from",
"the",
"API",
"if",
"it",
"has",
"expired"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Api/Client.php#L272-L283 |
32,613 | firebrandhq/silverstripe-hail | src/Api/Client.php | Client.setAccessToken | public function setAccessToken($access_token)
{
$this->access_token = $access_token;
$config = SiteConfig::current_site_config();
$config->HailAccessToken = $access_token;
$config->write();
} | php | public function setAccessToken($access_token)
{
$this->access_token = $access_token;
$config = SiteConfig::current_site_config();
$config->HailAccessToken = $access_token;
$config->write();
} | [
"public",
"function",
"setAccessToken",
"(",
"$",
"access_token",
")",
"{",
"$",
"this",
"->",
"access_token",
"=",
"$",
"access_token",
";",
"$",
"config",
"=",
"SiteConfig",
"::",
"current_site_config",
"(",
")",
";",
"$",
"config",
"->",
"HailAccessToken",
... | Set Hail API OAuth token in the current SiteConfig
@throws | [
"Set",
"Hail",
"API",
"OAuth",
"token",
"in",
"the",
"current",
"SiteConfig"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Api/Client.php#L290-L296 |
32,614 | firebrandhq/silverstripe-hail | src/Api/Client.php | Client.refreshAccessToken | public function refreshAccessToken()
{
$http = $this->getHTTPClient();
$post_data = [
'client_id' => $this->client_id,
'client_secret' => $this->client_secret,
'grant_type' => 'refresh_token',
'refresh_token' => $this->refresh_token,
];... | php | public function refreshAccessToken()
{
$http = $this->getHTTPClient();
$post_data = [
'client_id' => $this->client_id,
'client_secret' => $this->client_secret,
'grant_type' => 'refresh_token',
'refresh_token' => $this->refresh_token,
];... | [
"public",
"function",
"refreshAccessToken",
"(",
")",
"{",
"$",
"http",
"=",
"$",
"this",
"->",
"getHTTPClient",
"(",
")",
";",
"$",
"post_data",
"=",
"[",
"'client_id'",
"=>",
"$",
"this",
"->",
"client_id",
",",
"'client_secret'",
"=>",
"$",
"this",
"-... | Refresh Hail API OAuth Access token from the API
@throws | [
"Refresh",
"Hail",
"API",
"OAuth",
"Access",
"token",
"from",
"the",
"API"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Api/Client.php#L303-L329 |
32,615 | firebrandhq/silverstripe-hail | src/Api/Client.php | Client.getAvailableOrganisations | public function getAvailableOrganisations($as_simple_array = false)
{
$organisations = $this->get('users/' . $this->user_id . '/organisations');
//If simple array is true, we send back an array with [id] => [name] instead of the full list
if ($as_simple_array) {
$temp = [];
... | php | public function getAvailableOrganisations($as_simple_array = false)
{
$organisations = $this->get('users/' . $this->user_id . '/organisations');
//If simple array is true, we send back an array with [id] => [name] instead of the full list
if ($as_simple_array) {
$temp = [];
... | [
"public",
"function",
"getAvailableOrganisations",
"(",
"$",
"as_simple_array",
"=",
"false",
")",
"{",
"$",
"organisations",
"=",
"$",
"this",
"->",
"get",
"(",
"'users/'",
".",
"$",
"this",
"->",
"user_id",
".",
"'/organisations'",
")",
";",
"//If simple arr... | Get all available Hail Organisation the configured client has access to
@param boolean $as_simple_array Return a simple associative array (ID => Tile )instead of the full objects
@return array
@throws | [
"Get",
"all",
"available",
"Hail",
"Organisation",
"the",
"configured",
"client",
"has",
"access",
"to"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Api/Client.php#L359-L373 |
32,616 | firebrandhq/silverstripe-hail | src/Api/Client.php | Client.getAvailablePrivateTags | public function getAvailablePrivateTags($organisations = null, $as_simple_array = false)
{
$orgs_ids = $organisations ? array_keys($organisations) : json_decode($this->orgs_ids);
if (!$orgs_ids) {
//No organisations configured
$this->handleException(new \Exception("You n... | php | public function getAvailablePrivateTags($organisations = null, $as_simple_array = false)
{
$orgs_ids = $organisations ? array_keys($organisations) : json_decode($this->orgs_ids);
if (!$orgs_ids) {
//No organisations configured
$this->handleException(new \Exception("You n... | [
"public",
"function",
"getAvailablePrivateTags",
"(",
"$",
"organisations",
"=",
"null",
",",
"$",
"as_simple_array",
"=",
"false",
")",
"{",
"$",
"orgs_ids",
"=",
"$",
"organisations",
"?",
"array_keys",
"(",
"$",
"organisations",
")",
":",
"json_decode",
"("... | Get all available Private Tags from the Hail API
Will get all tags from all configured organisations unless specified otherwise
@param array|null $organisations Pass an array of organisations (HailID => Organisation Name) to get the tag for, if null will get all configured organisation
@param boolean $as_simple_array ... | [
"Get",
"all",
"available",
"Private",
"Tags",
"from",
"the",
"Hail",
"API",
"Will",
"get",
"all",
"tags",
"from",
"all",
"configured",
"organisations",
"unless",
"specified",
"otherwise"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Api/Client.php#L385-L421 |
32,617 | firebrandhq/silverstripe-hail | src/Api/Client.php | Client.getImagesByArticles | public function getImagesByArticles($id)
{
$uri = Article::$object_endpoint . '/' . $id . '/' . Image::$object_endpoint;
return $this->get($uri);
} | php | public function getImagesByArticles($id)
{
$uri = Article::$object_endpoint . '/' . $id . '/' . Image::$object_endpoint;
return $this->get($uri);
} | [
"public",
"function",
"getImagesByArticles",
"(",
"$",
"id",
")",
"{",
"$",
"uri",
"=",
"Article",
"::",
"$",
"object_endpoint",
".",
"'/'",
".",
"$",
"id",
".",
"'/'",
".",
"Image",
"::",
"$",
"object_endpoint",
";",
"return",
"$",
"this",
"->",
"get"... | Retrieve a list of images for a given article.
@param string $id ID of the article in Hail
@return array
@throws | [
"Retrieve",
"a",
"list",
"of",
"images",
"for",
"a",
"given",
"article",
"."
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Api/Client.php#L491-L495 |
32,618 | firebrandhq/silverstripe-hail | src/Api/Client.php | Client.getVideosByArticles | public function getVideosByArticles($id)
{
$uri = Article::$object_endpoint . '/' . $id . '/' . Video::$object_endpoint;
return $this->get($uri);
} | php | public function getVideosByArticles($id)
{
$uri = Article::$object_endpoint . '/' . $id . '/' . Video::$object_endpoint;
return $this->get($uri);
} | [
"public",
"function",
"getVideosByArticles",
"(",
"$",
"id",
")",
"{",
"$",
"uri",
"=",
"Article",
"::",
"$",
"object_endpoint",
".",
"'/'",
".",
"$",
"id",
".",
"'/'",
".",
"Video",
"::",
"$",
"object_endpoint",
";",
"return",
"$",
"this",
"->",
"get"... | Retrieve a list of videos for a given article.
@param string $id ID of the article in Hail
@return array
@throws | [
"Retrieve",
"a",
"list",
"of",
"videos",
"for",
"a",
"given",
"article",
"."
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Api/Client.php#L505-L509 |
32,619 | CradlePHP/cradle-system | src/Schema/Validator.php | Validator.getCreateErrors | public static function getCreateErrors(array $data, array $errors = [])
{
if (!isset($data['singular']) || empty($data['singular'])) {
$errors['singular'] = 'Singular is required';
}
if (!isset($data['plural']) || empty($data['plural'])) {
$errors['plural'] = 'Plural... | php | public static function getCreateErrors(array $data, array $errors = [])
{
if (!isset($data['singular']) || empty($data['singular'])) {
$errors['singular'] = 'Singular is required';
}
if (!isset($data['plural']) || empty($data['plural'])) {
$errors['plural'] = 'Plural... | [
"public",
"static",
"function",
"getCreateErrors",
"(",
"array",
"$",
"data",
",",
"array",
"$",
"errors",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"data",
"[",
"'singular'",
"]",
")",
"||",
"empty",
"(",
"$",
"data",
"[",
"'sing... | Returns Table Create Errors
@param *array $data
@param array $errors
@return array | [
"Returns",
"Table",
"Create",
"Errors"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Schema/Validator.php#L31-L62 |
32,620 | CradlePHP/cradle-system | src/Schema/Validator.php | Validator.getOptionalErrors | public static function getOptionalErrors(array $data, array $errors = [])
{
//validations
if (isset($data['singular']) && strlen($data['singular']) <= 2) {
$errors['singular'] = 'Singular should be longer than 2 characters';
}
if (isset($data['singular']) && strlen($dat... | php | public static function getOptionalErrors(array $data, array $errors = [])
{
//validations
if (isset($data['singular']) && strlen($data['singular']) <= 2) {
$errors['singular'] = 'Singular should be longer than 2 characters';
}
if (isset($data['singular']) && strlen($dat... | [
"public",
"static",
"function",
"getOptionalErrors",
"(",
"array",
"$",
"data",
",",
"array",
"$",
"errors",
"=",
"[",
"]",
")",
"{",
"//validations",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"'singular'",
"]",
")",
"&&",
"strlen",
"(",
"$",
"data",
... | Returns Table Optional Errors
@param *array $data
@param array $errors
@return array | [
"Returns",
"Table",
"Optional",
"Errors"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Schema/Validator.php#L101-L143 |
32,621 | CradlePHP/cradle-system | src/Schema.php | Schema.getRelations | public function getRelations($many = -1)
{
$results = [];
if (!isset($this->data['relations'])
|| empty($this->data['relations'])
) {
return $results;
}
$table = $this->getName();
$primary = $this->getPrimaryFieldName();
foreach ($thi... | php | public function getRelations($many = -1)
{
$results = [];
if (!isset($this->data['relations'])
|| empty($this->data['relations'])
) {
return $results;
}
$table = $this->getName();
$primary = $this->getPrimaryFieldName();
foreach ($thi... | [
"public",
"function",
"getRelations",
"(",
"$",
"many",
"=",
"-",
"1",
")",
"{",
"$",
"results",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"'relations'",
"]",
")",
"||",
"empty",
"(",
"$",
"this",
"->",
"... | Returns relational data
@param int $many
@return array | [
"Returns",
"relational",
"data"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Schema.php#L190-L246 |
32,622 | CradlePHP/cradle-system | src/Schema.php | Schema.getReverseRelations | public function getReverseRelations($many = -1)
{
$results = [];
$name = $this->getName();
$payload = cradle()->makePayload();
cradle()->trigger(
'system-schema-search',
$payload['request'],
$payload['response']
);
$rows = $paylo... | php | public function getReverseRelations($many = -1)
{
$results = [];
$name = $this->getName();
$payload = cradle()->makePayload();
cradle()->trigger(
'system-schema-search',
$payload['request'],
$payload['response']
);
$rows = $paylo... | [
"public",
"function",
"getReverseRelations",
"(",
"$",
"many",
"=",
"-",
"1",
")",
"{",
"$",
"results",
"=",
"[",
"]",
";",
"$",
"name",
"=",
"$",
"this",
"->",
"getName",
"(",
")",
";",
"$",
"payload",
"=",
"cradle",
"(",
")",
"->",
"makePayload",... | Returns reverse relational data
@param int $many
@return array | [
"Returns",
"reverse",
"relational",
"data"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Schema.php#L255-L293 |
32,623 | CradlePHP/cradle-system | src/Schema.php | Schema.getSuggestionFormat | public function getSuggestionFormat(array $data)
{
//if no suggestion format
if (!isset($this->data['suggestion']) || !trim($this->data['suggestion'])) {
//use best guess
$suggestion = null;
foreach ($data as $key => $value) {
if (is_numeric($value... | php | public function getSuggestionFormat(array $data)
{
//if no suggestion format
if (!isset($this->data['suggestion']) || !trim($this->data['suggestion'])) {
//use best guess
$suggestion = null;
foreach ($data as $key => $value) {
if (is_numeric($value... | [
"public",
"function",
"getSuggestionFormat",
"(",
"array",
"$",
"data",
")",
"{",
"//if no suggestion format",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"'suggestion'",
"]",
")",
"||",
"!",
"trim",
"(",
"$",
"this",
"->",
"data",
"[",... | Based on the data will generate a suggestion format
@param array
@return string | [
"Based",
"on",
"the",
"data",
"will",
"generate",
"a",
"suggestion",
"format"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Schema.php#L325-L360 |
32,624 | CradlePHP/cradle-system | src/Schema.php | Schema.getUpdatedFieldName | public function getUpdatedFieldName()
{
if (!isset($this->data['fields']) || empty($this->data['fields'])) {
return false;
}
$table = $this->data['name'];
foreach ($this->data['fields'] as $field) {
if ($field['name'] === 'updated') {
return $... | php | public function getUpdatedFieldName()
{
if (!isset($this->data['fields']) || empty($this->data['fields'])) {
return false;
}
$table = $this->data['name'];
foreach ($this->data['fields'] as $field) {
if ($field['name'] === 'updated') {
return $... | [
"public",
"function",
"getUpdatedFieldName",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"'fields'",
"]",
")",
"||",
"empty",
"(",
"$",
"this",
"->",
"data",
"[",
"'fields'",
"]",
")",
")",
"{",
"return",
"false",
"... | Returns updated field
@return string|false | [
"Returns",
"updated",
"field"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Schema.php#L390-L404 |
32,625 | CradlePHP/cradle-system | src/Model/Service/SqlService.php | SqlService.create | public function create(array $data)
{
if (is_null($this->schema)) {
throw SystemException::forNoSchema();
}
$table = $this->schema->getName();
$created = $this->schema->getCreatedFieldName();
$updated = $this->schema->getUpdatedFieldName();
$ipaddress = $... | php | public function create(array $data)
{
if (is_null($this->schema)) {
throw SystemException::forNoSchema();
}
$table = $this->schema->getName();
$created = $this->schema->getCreatedFieldName();
$updated = $this->schema->getUpdatedFieldName();
$ipaddress = $... | [
"public",
"function",
"create",
"(",
"array",
"$",
"data",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"schema",
")",
")",
"{",
"throw",
"SystemException",
"::",
"forNoSchema",
"(",
")",
";",
"}",
"$",
"table",
"=",
"$",
"this",
"->",
"... | Create in database
@param *array $object
@param *array $data
@return array | [
"Create",
"in",
"database"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Model/Service/SqlService.php#L58-L92 |
32,626 | CradlePHP/cradle-system | src/Model/Service/SqlService.php | SqlService.exists | public function exists($key, $value)
{
if (is_null($this->schema)) {
throw SystemException::forNoSchema();
}
$search = $this
->resource
->search($this->schema->getName())
->addFilter($key . ' = %s', $value);
return !!$search->getRow()... | php | public function exists($key, $value)
{
if (is_null($this->schema)) {
throw SystemException::forNoSchema();
}
$search = $this
->resource
->search($this->schema->getName())
->addFilter($key . ' = %s', $value);
return !!$search->getRow()... | [
"public",
"function",
"exists",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"schema",
")",
")",
"{",
"throw",
"SystemException",
"::",
"forNoSchema",
"(",
")",
";",
"}",
"$",
"search",
"=",
"$",
"this... | Checks to see if unique.0 already exists
@param *string $objectKey
@return bool | [
"Checks",
"to",
"see",
"if",
"unique",
".",
"0",
"already",
"exists"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Model/Service/SqlService.php#L101-L113 |
32,627 | CradlePHP/cradle-system | src/Model/Service/SqlService.php | SqlService.remove | public function remove($id)
{
if (is_null($this->schema)) {
throw SystemException::forNoSchema();
}
$table = $this->schema->getName();
$primary = $this->schema->getPrimaryFieldName();
//please rely on SQL CASCADING ON DELETE
$model = $this->resource->mode... | php | public function remove($id)
{
if (is_null($this->schema)) {
throw SystemException::forNoSchema();
}
$table = $this->schema->getName();
$primary = $this->schema->getPrimaryFieldName();
//please rely on SQL CASCADING ON DELETE
$model = $this->resource->mode... | [
"public",
"function",
"remove",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"schema",
")",
")",
"{",
"throw",
"SystemException",
"::",
"forNoSchema",
"(",
")",
";",
"}",
"$",
"table",
"=",
"$",
"this",
"->",
"schema",
"-... | Remove from database
PLEASE BECAREFUL USING THIS !!!
It's here for clean up scripts
@param *array $object
@param *int $id | [
"Remove",
"from",
"database",
"PLEASE",
"BECAREFUL",
"USING",
"THIS",
"!!!",
"It",
"s",
"here",
"for",
"clean",
"up",
"scripts"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Model/Service/SqlService.php#L371-L383 |
32,628 | CradlePHP/cradle-system | src/Model/Service/SqlService.php | SqlService.unlink | public function unlink($relation, $primary1, $primary2)
{
if (is_null($this->schema)) {
throw SystemException::forNoSchema();
}
$name = $this->schema->getName();
$relations = $this->schema->getRelations();
$table = $name . '_' . $relation;
if (!isset($re... | php | public function unlink($relation, $primary1, $primary2)
{
if (is_null($this->schema)) {
throw SystemException::forNoSchema();
}
$name = $this->schema->getName();
$relations = $this->schema->getRelations();
$table = $name . '_' . $relation;
if (!isset($re... | [
"public",
"function",
"unlink",
"(",
"$",
"relation",
",",
"$",
"primary1",
",",
"$",
"primary2",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"schema",
")",
")",
"{",
"throw",
"SystemException",
"::",
"forNoSchema",
"(",
")",
";",
"}",
"$... | Unlinks table to another table
@param *string $relation
@param *int $primary1
@param *int $primary2
@return array | [
"Unlinks",
"table",
"to",
"another",
"table"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Model/Service/SqlService.php#L822-L843 |
32,629 | CradlePHP/cradle-system | src/Model/Service/SqlService.php | SqlService.unlinkAll | public function unlinkAll($relation, $primary)
{
if (is_null($this->schema)) {
throw SystemException::forNoSchema();
}
$name = $this->schema->getName();
$relations = $this->schema->getRelations();
$table = $name . '_' . $relation;
if (!isset($relations[$... | php | public function unlinkAll($relation, $primary)
{
if (is_null($this->schema)) {
throw SystemException::forNoSchema();
}
$name = $this->schema->getName();
$relations = $this->schema->getRelations();
$table = $name . '_' . $relation;
if (!isset($relations[$... | [
"public",
"function",
"unlinkAll",
"(",
"$",
"relation",
",",
"$",
"primary",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"schema",
")",
")",
"{",
"throw",
"SystemException",
"::",
"forNoSchema",
"(",
")",
";",
"}",
"$",
"name",
"=",
"$",... | Unlinks all references in a table from another table
@param *string $relation
@param *int $primary
@return array | [
"Unlinks",
"all",
"references",
"in",
"a",
"table",
"from",
"another",
"table"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Model/Service/SqlService.php#L853-L880 |
32,630 | firebrandhq/silverstripe-hail | src/Lists/HailList.php | HailList.getOrganisations | public function getOrganisations()
{
$config = SiteConfig::current_site_config();
//Filter out Organisation that are not setup in the config
$organisations = Organisation::get()->filter(['HailID' => json_decode($config->HailOrgsIDs)]);
return $organisations->sort('Title')->map... | php | public function getOrganisations()
{
$config = SiteConfig::current_site_config();
//Filter out Organisation that are not setup in the config
$organisations = Organisation::get()->filter(['HailID' => json_decode($config->HailOrgsIDs)]);
return $organisations->sort('Title')->map... | [
"public",
"function",
"getOrganisations",
"(",
")",
"{",
"$",
"config",
"=",
"SiteConfig",
"::",
"current_site_config",
"(",
")",
";",
"//Filter out Organisation that are not setup in the config\r",
"$",
"organisations",
"=",
"Organisation",
"::",
"get",
"(",
")",
"->... | Get currently configured Hail Organisations
@return array | [
"Get",
"currently",
"configured",
"Hail",
"Organisations"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Lists/HailList.php#L107-L114 |
32,631 | firebrandhq/silverstripe-hail | src/Lists/HailList.php | HailList.getPrivateTagsList | public function getPrivateTagsList()
{
$config = SiteConfig::current_site_config();
//Filter out global excluded tags and non configured Organisations
$pri_tags = PrivateTag::get()->filter(['HailID:not' => json_decode($config->HailExcludePrivateTagsIDs), 'HailOrgID' => json_decode($confi... | php | public function getPrivateTagsList()
{
$config = SiteConfig::current_site_config();
//Filter out global excluded tags and non configured Organisations
$pri_tags = PrivateTag::get()->filter(['HailID:not' => json_decode($config->HailExcludePrivateTagsIDs), 'HailOrgID' => json_decode($confi... | [
"public",
"function",
"getPrivateTagsList",
"(",
")",
"{",
"$",
"config",
"=",
"SiteConfig",
"::",
"current_site_config",
"(",
")",
";",
"//Filter out global excluded tags and non configured Organisations\r",
"$",
"pri_tags",
"=",
"PrivateTag",
"::",
"get",
"(",
")",
... | Get currently available Hail Private Tags
@return array | [
"Get",
"currently",
"available",
"Hail",
"Private",
"Tags"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Lists/HailList.php#L121-L128 |
32,632 | firebrandhq/silverstripe-hail | src/Lists/HailList.php | HailList.getPublicTagsList | public function getPublicTagsList()
{
$config = SiteConfig::current_site_config();
//Filter out global excluded tags and non configured Organisations
$pub_tags = PublicTag::get()->filter(['HailID:not' => json_decode($config->HailExcludePublicTagsIDs), 'HailOrgID' => json_decode($config->... | php | public function getPublicTagsList()
{
$config = SiteConfig::current_site_config();
//Filter out global excluded tags and non configured Organisations
$pub_tags = PublicTag::get()->filter(['HailID:not' => json_decode($config->HailExcludePublicTagsIDs), 'HailOrgID' => json_decode($config->... | [
"public",
"function",
"getPublicTagsList",
"(",
")",
"{",
"$",
"config",
"=",
"SiteConfig",
"::",
"current_site_config",
"(",
")",
";",
"//Filter out global excluded tags and non configured Organisations\r",
"$",
"pub_tags",
"=",
"PublicTag",
"::",
"get",
"(",
")",
"-... | Get currently available Hail Public Tags
@return array | [
"Get",
"currently",
"available",
"Hail",
"Public",
"Tags"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Lists/HailList.php#L135-L142 |
32,633 | firebrandhq/silverstripe-hail | src/Pages/HailPage.php | HailPage.getCurrentArticle | public function getCurrentArticle()
{
if ($this->current_article instanceof Article || $this->current_article === null) {
return $this->current_article;
}
$params = Controller::curr()->getRequest()->params();
if(empty($params['ID'])){
$this->current_a... | php | public function getCurrentArticle()
{
if ($this->current_article instanceof Article || $this->current_article === null) {
return $this->current_article;
}
$params = Controller::curr()->getRequest()->params();
if(empty($params['ID'])){
$this->current_a... | [
"public",
"function",
"getCurrentArticle",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"current_article",
"instanceof",
"Article",
"||",
"$",
"this",
"->",
"current_article",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"current_article",
";",
"}",... | Get article accessed in current request
@return Article|null | [
"Get",
"article",
"accessed",
"in",
"current",
"request"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Pages/HailPage.php#L132-L146 |
32,634 | firebrandhq/silverstripe-hail | src/Pages/HailPage.php | HailPage.MetaTags | public function MetaTags($includeTitle = true)
{
$tags = parent::MetaTags($includeTitle);
$params = Controller::curr()->getRequest()->params();
if ($article = $this->getCurrentArticle()) {
$tags .= "<link rel=\"canonical\" href=\"{$article->AbsoluteLink()}\" />\n";
... | php | public function MetaTags($includeTitle = true)
{
$tags = parent::MetaTags($includeTitle);
$params = Controller::curr()->getRequest()->params();
if ($article = $this->getCurrentArticle()) {
$tags .= "<link rel=\"canonical\" href=\"{$article->AbsoluteLink()}\" />\n";
... | [
"public",
"function",
"MetaTags",
"(",
"$",
"includeTitle",
"=",
"true",
")",
"{",
"$",
"tags",
"=",
"parent",
"::",
"MetaTags",
"(",
"$",
"includeTitle",
")",
";",
"$",
"params",
"=",
"Controller",
"::",
"curr",
"(",
")",
"->",
"getRequest",
"(",
")",... | Add a canonical link meta tag
Replace description meta tag with Article description when necessary
@param boolean $includeTitle Show default <title>-tag, set to false for custom templating
@return string The XHTML metatags | [
"Add",
"a",
"canonical",
"link",
"meta",
"tag",
"Replace",
"description",
"meta",
"tag",
"with",
"Article",
"description",
"when",
"necessary"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Pages/HailPage.php#L155-L176 |
32,635 | firebrandhq/silverstripe-hail | src/Pages/HailPage.php | HailPage.getTitle | public function getTitle()
{
$article = $this->getCurrentArticle();
if ($article instanceof Article) {
return $article->Title;
}
return parent::getTitle();
} | php | public function getTitle()
{
$article = $this->getCurrentArticle();
if ($article instanceof Article) {
return $article->Title;
}
return parent::getTitle();
} | [
"public",
"function",
"getTitle",
"(",
")",
"{",
"$",
"article",
"=",
"$",
"this",
"->",
"getCurrentArticle",
"(",
")",
";",
"if",
"(",
"$",
"article",
"instanceof",
"Article",
")",
"{",
"return",
"$",
"article",
"->",
"Title",
";",
"}",
"return",
"par... | Get page or article title
@return string | [
"Get",
"page",
"or",
"article",
"title"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Pages/HailPage.php#L183-L191 |
32,636 | firebrandhq/silverstripe-hail | src/Controllers/HailController.php | HailController.progress | public function progress(HTTPRequest $request)
{
if (!Security::getCurrentUser()) {
return $this->makeJsonReponse(401, [
'message' => 'Unauthorized.'
])->setStatusDescription('Unauthorized.');
}
$latest_job = FetchJob::get()->filter('ErrorShow... | php | public function progress(HTTPRequest $request)
{
if (!Security::getCurrentUser()) {
return $this->makeJsonReponse(401, [
'message' => 'Unauthorized.'
])->setStatusDescription('Unauthorized.');
}
$latest_job = FetchJob::get()->filter('ErrorShow... | [
"public",
"function",
"progress",
"(",
"HTTPRequest",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"Security",
"::",
"getCurrentUser",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"makeJsonReponse",
"(",
"401",
",",
"[",
"'message'",
"=>",
"'Unauthorized.... | Get the progress on the current fetch job running
@param HTTPRequest $request Current request
@return HTTPResponse JSON response
@throws | [
"Get",
"the",
"progress",
"on",
"the",
"current",
"fetch",
"job",
"running"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Controllers/HailController.php#L120-L145 |
32,637 | firebrandhq/silverstripe-hail | src/Controllers/HailController.php | HailController.fetchOneSync | public function fetchOneSync(HTTPRequest $request)
{
if (!Security::getCurrentUser()) {
return $this->makeJsonReponse(401, [
'message' => 'Unauthorized.'
])->setStatusDescription('Unauthorized.');
}
$params = $request->params();
if ... | php | public function fetchOneSync(HTTPRequest $request)
{
if (!Security::getCurrentUser()) {
return $this->makeJsonReponse(401, [
'message' => 'Unauthorized.'
])->setStatusDescription('Unauthorized.');
}
$params = $request->params();
if ... | [
"public",
"function",
"fetchOneSync",
"(",
"HTTPRequest",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"Security",
"::",
"getCurrentUser",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"makeJsonReponse",
"(",
"401",
",",
"[",
"'message'",
"=>",
"'Unauthori... | Fetch one specific Hail object synchronously and update its database record
The object to fetch is specified in the URL
e.g.: /hail/fetchOne/[CLASS]/[HAILID]
Example: /hail/fetchOne/Firebrand-Hail-Models-Article/l1KjRUP will fetch and update the article with HailID=l1KjRUP
@param HTTPRequest $request Current request
... | [
"Fetch",
"one",
"specific",
"Hail",
"object",
"synchronously",
"and",
"update",
"its",
"database",
"record"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Controllers/HailController.php#L159-L193 |
32,638 | firebrandhq/silverstripe-hail | src/Controllers/HailController.php | HailController.articles | public function articles(HTTPRequest $request)
{
if (!Security::getCurrentUser()) {
return $this->makeJsonReponse(401, [
'message' => 'Unauthorized.'
])->setStatusDescription('Unauthorized.');
}
$pages = HailPage::get();
$articles = [... | php | public function articles(HTTPRequest $request)
{
if (!Security::getCurrentUser()) {
return $this->makeJsonReponse(401, [
'message' => 'Unauthorized.'
])->setStatusDescription('Unauthorized.');
}
$pages = HailPage::get();
$articles = [... | [
"public",
"function",
"articles",
"(",
"HTTPRequest",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"Security",
"::",
"getCurrentUser",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"makeJsonReponse",
"(",
"401",
",",
"[",
"'message'",
"=>",
"'Unauthorized.... | Retrieve a list of articles from the database
Only used by the Hail TinyMCE plugin to add article links to any HTML content
@param HTTPRequest $request Current request
@return HTTPResponse JSON response
@throws | [
"Retrieve",
"a",
"list",
"of",
"articles",
"from",
"the",
"database"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Controllers/HailController.php#L205-L233 |
32,639 | firebrandhq/silverstripe-hail | src/Controllers/HailController.php | HailController.makeJsonReponse | public function makeJsonReponse($status_code, $body)
{
$this->getResponse()->setBody(json_encode($body, JSON_UNESCAPED_SLASHES));
$this->getResponse()->setStatusCode($status_code);
$this->getResponse()->addHeader("Content-type", "application/json");
return $this->getResponse()... | php | public function makeJsonReponse($status_code, $body)
{
$this->getResponse()->setBody(json_encode($body, JSON_UNESCAPED_SLASHES));
$this->getResponse()->setStatusCode($status_code);
$this->getResponse()->addHeader("Content-type", "application/json");
return $this->getResponse()... | [
"public",
"function",
"makeJsonReponse",
"(",
"$",
"status_code",
",",
"$",
"body",
")",
"{",
"$",
"this",
"->",
"getResponse",
"(",
")",
"->",
"setBody",
"(",
"json_encode",
"(",
"$",
"body",
",",
"JSON_UNESCAPED_SLASHES",
")",
")",
";",
"$",
"this",
"-... | Make the JSON response
@param int $status_code HTTP status code to return
@param array|null $body JSON body of the request
@return HTTPResponse JSON response | [
"Make",
"the",
"JSON",
"response"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Controllers/HailController.php#L243-L250 |
32,640 | CradlePHP/cradle-system | src/Helpers.php | Helpers.getFieldset | public static function getFieldset($name) {
if (!isset(self::$fieldsets[$name])) {
try {
self::$fieldsets[$name] = Fieldset::i($name);
} catch (Exception $e) {
return false;
}
}
return self::$fieldsets[$name];
} | php | public static function getFieldset($name) {
if (!isset(self::$fieldsets[$name])) {
try {
self::$fieldsets[$name] = Fieldset::i($name);
} catch (Exception $e) {
return false;
}
}
return self::$fieldsets[$name];
} | [
"public",
"static",
"function",
"getFieldset",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"fieldsets",
"[",
"$",
"name",
"]",
")",
")",
"{",
"try",
"{",
"self",
"::",
"$",
"fieldsets",
"[",
"$",
"name",
"]",
"=",... | Returns a cached fieldset
@param *string $name
@return Fieldset|false | [
"Returns",
"a",
"cached",
"fieldset"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Helpers.php#L46-L56 |
32,641 | CradlePHP/cradle-system | src/Helpers.php | Helpers.getSchema | public static function getSchema($name) {
if (!isset(self::$schemas[$name])) {
try {
self::$schemas[$name] = Schema::i($name);
} catch (Exception $e) {
return false;
}
}
return self::$schemas[$name];
} | php | public static function getSchema($name) {
if (!isset(self::$schemas[$name])) {
try {
self::$schemas[$name] = Schema::i($name);
} catch (Exception $e) {
return false;
}
}
return self::$schemas[$name];
} | [
"public",
"static",
"function",
"getSchema",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"schemas",
"[",
"$",
"name",
"]",
")",
")",
"{",
"try",
"{",
"self",
"::",
"$",
"schemas",
"[",
"$",
"name",
"]",
"=",
"Sc... | Returns a cached schema
@param *string $name
@return Schema | [
"Returns",
"a",
"cached",
"schema"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Helpers.php#L65-L75 |
32,642 | CradlePHP/cradle-system | src/Helpers.php | Helpers.getFormatTemplate | public static function getFormatTemplate($name) {
$file = sprintf(
'%s/Model/template/format/%s.html',
__DIR__,
$name
);
if (!file_exists($file)) {
return null;
}
if (!isset(self::$templates[$name])) {
self::$templates... | php | public static function getFormatTemplate($name) {
$file = sprintf(
'%s/Model/template/format/%s.html',
__DIR__,
$name
);
if (!file_exists($file)) {
return null;
}
if (!isset(self::$templates[$name])) {
self::$templates... | [
"public",
"static",
"function",
"getFormatTemplate",
"(",
"$",
"name",
")",
"{",
"$",
"file",
"=",
"sprintf",
"(",
"'%s/Model/template/format/%s.html'",
",",
"__DIR__",
",",
"$",
"name",
")",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"file",
")",
")",
... | Returns a format template
@param *string $name
@return Schema | [
"Returns",
"a",
"format",
"template"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Helpers.php#L84-L100 |
32,643 | oasmobile/php-http | src/SilexKernel.php | SilexKernel.isGranted | public function isGranted($attributes, $object = null)
{
if (!$this->offsetExists('security.authorization_checker')) {
return false;
}
$checker = $this['security.authorization_checker'];
if ($checker instanceof AuthorizationCheckerInterface) {
try {
... | php | public function isGranted($attributes, $object = null)
{
if (!$this->offsetExists('security.authorization_checker')) {
return false;
}
$checker = $this['security.authorization_checker'];
if ($checker instanceof AuthorizationCheckerInterface) {
try {
... | [
"public",
"function",
"isGranted",
"(",
"$",
"attributes",
",",
"$",
"object",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"offsetExists",
"(",
"'security.authorization_checker'",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"checker",
... | Checks if the attributes are granted against the current authentication token and optionally supplied object.
@param mixed $attributes
@param mixed $object
@return bool | [
"Checks",
"if",
"the",
"attributes",
"are",
"granted",
"against",
"the",
"current",
"authentication",
"token",
"and",
"optionally",
"supplied",
"object",
"."
] | a7570893742286c30222c393891aeb6857064f37 | https://github.com/oasmobile/php-http/blob/a7570893742286c30222c393891aeb6857064f37/src/SilexKernel.php#L512-L533 |
32,644 | firebrandhq/silverstripe-hail | src/Models/Publication.php | Publication.processFeaturedArticle | private function processFeaturedArticle($articleData)
{
if ($articleData) {
$article = Article::get()->filter(['HailID' => $articleData['id']])->first();
if (!$article) {
$article = new Article();
$article->importHailData($articleData);
}
... | php | private function processFeaturedArticle($articleData)
{
if ($articleData) {
$article = Article::get()->filter(['HailID' => $articleData['id']])->first();
if (!$article) {
$article = new Article();
$article->importHailData($articleData);
}
... | [
"private",
"function",
"processFeaturedArticle",
"(",
"$",
"articleData",
")",
"{",
"if",
"(",
"$",
"articleData",
")",
"{",
"$",
"article",
"=",
"Article",
"::",
"get",
"(",
")",
"->",
"filter",
"(",
"[",
"'HailID'",
"=>",
"$",
"articleData",
"[",
"'id'... | Attach the featured article to this publication if there is one
@param array $articleData | [
"Attach",
"the",
"featured",
"article",
"to",
"this",
"publication",
"if",
"there",
"is",
"one"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Models/Publication.php#L143-L170 |
32,645 | flipboxfactory/craft-ember | src/records/SortableTrait.php | SortableTrait.ensureSortOrder | protected function ensureSortOrder(
array $sortOrderCondition = [],
string $sortOrderAttribute = 'sortOrder'
) {
if ($this->getAttribute($sortOrderAttribute) === null) {
$this->setAttribute(
$sortOrderAttribute,
$this->nextSortOrder(
... | php | protected function ensureSortOrder(
array $sortOrderCondition = [],
string $sortOrderAttribute = 'sortOrder'
) {
if ($this->getAttribute($sortOrderAttribute) === null) {
$this->setAttribute(
$sortOrderAttribute,
$this->nextSortOrder(
... | [
"protected",
"function",
"ensureSortOrder",
"(",
"array",
"$",
"sortOrderCondition",
"=",
"[",
"]",
",",
"string",
"$",
"sortOrderAttribute",
"=",
"'sortOrder'",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getAttribute",
"(",
"$",
"sortOrderAttribute",
")",
"==="... | Ensure a sort order is set. If a sort order is not provided, it will be added to the end.
@param array $sortOrderCondition
@param string $sortOrderAttribute | [
"Ensure",
"a",
"sort",
"order",
"is",
"set",
".",
"If",
"a",
"sort",
"order",
"is",
"not",
"provided",
"it",
"will",
"be",
"added",
"to",
"the",
"end",
"."
] | 9185b885b404b1cb272a0983023eb7c6c0df61c8 | https://github.com/flipboxfactory/craft-ember/blob/9185b885b404b1cb272a0983023eb7c6c0df61c8/src/records/SortableTrait.php#L105-L118 |
32,646 | flipboxfactory/craft-ember | src/records/SortableTrait.php | SortableTrait.nextSortOrder | protected function nextSortOrder(
array $sortOrderCondition = [],
string $sortOrderAttribute = 'sortOrder'
): int {
$maxSortOrder = $this->sortOrderQuery(
$sortOrderCondition,
$sortOrderAttribute
)->max('[[' . $sortOrderAttribute . ']]');
return ++$ma... | php | protected function nextSortOrder(
array $sortOrderCondition = [],
string $sortOrderAttribute = 'sortOrder'
): int {
$maxSortOrder = $this->sortOrderQuery(
$sortOrderCondition,
$sortOrderAttribute
)->max('[[' . $sortOrderAttribute . ']]');
return ++$ma... | [
"protected",
"function",
"nextSortOrder",
"(",
"array",
"$",
"sortOrderCondition",
"=",
"[",
"]",
",",
"string",
"$",
"sortOrderAttribute",
"=",
"'sortOrder'",
")",
":",
"int",
"{",
"$",
"maxSortOrder",
"=",
"$",
"this",
"->",
"sortOrderQuery",
"(",
"$",
"so... | Get the next available sort order available
@param array $sortOrderCondition
@param string $sortOrderAttribute
@return int | [
"Get",
"the",
"next",
"available",
"sort",
"order",
"available"
] | 9185b885b404b1cb272a0983023eb7c6c0df61c8 | https://github.com/flipboxfactory/craft-ember/blob/9185b885b404b1cb272a0983023eb7c6c0df61c8/src/records/SortableTrait.php#L200-L210 |
32,647 | flipboxfactory/craft-ember | src/records/SortableTrait.php | SortableTrait.sortOrderQuery | protected function sortOrderQuery(
array $sortOrderCondition = [],
string $sortOrderAttribute = 'sortOrder'
): ActiveQuery {
return static::find()
->andWhere($sortOrderCondition)
->orderBy([
$sortOrderAttribute => SORT_ASC,
'dateUpdated... | php | protected function sortOrderQuery(
array $sortOrderCondition = [],
string $sortOrderAttribute = 'sortOrder'
): ActiveQuery {
return static::find()
->andWhere($sortOrderCondition)
->orderBy([
$sortOrderAttribute => SORT_ASC,
'dateUpdated... | [
"protected",
"function",
"sortOrderQuery",
"(",
"array",
"$",
"sortOrderCondition",
"=",
"[",
"]",
",",
"string",
"$",
"sortOrderAttribute",
"=",
"'sortOrder'",
")",
":",
"ActiveQuery",
"{",
"return",
"static",
"::",
"find",
"(",
")",
"->",
"andWhere",
"(",
... | Creates a sort order query which will display all siblings ordered by their sort order
@param array $sortOrderCondition
@param string $sortOrderAttribute
@return ActiveQuery | [
"Creates",
"a",
"sort",
"order",
"query",
"which",
"will",
"display",
"all",
"siblings",
"ordered",
"by",
"their",
"sort",
"order"
] | 9185b885b404b1cb272a0983023eb7c6c0df61c8 | https://github.com/flipboxfactory/craft-ember/blob/9185b885b404b1cb272a0983023eb7c6c0df61c8/src/records/SortableTrait.php#L220-L230 |
32,648 | flipboxfactory/craft-ember | src/records/SortableTrait.php | SortableTrait.saveNewOrder | protected function saveNewOrder(
array $sortOrder,
string $targetAttribute,
array $sortOrderCondition = [],
string $sortOrderAttribute = 'sortOrder'
): bool {
foreach ($sortOrder as $target => $order) {
Craft::$app->getDb()->createCommand()
->updat... | php | protected function saveNewOrder(
array $sortOrder,
string $targetAttribute,
array $sortOrderCondition = [],
string $sortOrderAttribute = 'sortOrder'
): bool {
foreach ($sortOrder as $target => $order) {
Craft::$app->getDb()->createCommand()
->updat... | [
"protected",
"function",
"saveNewOrder",
"(",
"array",
"$",
"sortOrder",
",",
"string",
"$",
"targetAttribute",
",",
"array",
"$",
"sortOrderCondition",
"=",
"[",
"]",
",",
"string",
"$",
"sortOrderAttribute",
"=",
"'sortOrder'",
")",
":",
"bool",
"{",
"foreac... | Saves a new sort order.
@param array $sortOrder The new sort order that needs to be saved. The 'key' represents the target value and
the 'value' represent the sort order.
@param string $targetAttribute The target attribute that the new order is keyed on.
@param array $sortOrderCondition Additional condition params us... | [
"Saves",
"a",
"new",
"sort",
"order",
"."
] | 9185b885b404b1cb272a0983023eb7c6c0df61c8 | https://github.com/flipboxfactory/craft-ember/blob/9185b885b404b1cb272a0983023eb7c6c0df61c8/src/records/SortableTrait.php#L245-L267 |
32,649 | flipboxfactory/craft-ember | src/helpers/QueryHelper.php | QueryHelper.parseBaseParam | public static function parseBaseParam(&$value, &$join): bool
{
// Force array
if (!is_array($value)) {
$value = [$value];
}
// Get join type ('and' , 'or')
$join = self::getJoinType($value, $join);
// Check for object array (via 'id' key)
if ($id... | php | public static function parseBaseParam(&$value, &$join): bool
{
// Force array
if (!is_array($value)) {
$value = [$value];
}
// Get join type ('and' , 'or')
$join = self::getJoinType($value, $join);
// Check for object array (via 'id' key)
if ($id... | [
"public",
"static",
"function",
"parseBaseParam",
"(",
"&",
"$",
"value",
",",
"&",
"$",
"join",
")",
":",
"bool",
"{",
"// Force array",
"if",
"(",
"!",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"[",
"$",
"value",
"]",
";",
... | Standard param parsing.
@param $value
@param $join
@return bool
@deprecated | [
"Standard",
"param",
"parsing",
"."
] | 9185b885b404b1cb272a0983023eb7c6c0df61c8 | https://github.com/flipboxfactory/craft-ember/blob/9185b885b404b1cb272a0983023eb7c6c0df61c8/src/helpers/QueryHelper.php#L185-L202 |
32,650 | flipboxfactory/craft-ember | src/helpers/QueryHelper.php | QueryHelper.prependOperator | private static function prependOperator($value, $operator = null)
{
if ($operator) {
$operator = StringHelper::toLowerCase($operator);
if (in_array($operator, static::$operators) || $operator === 'not') {
if (is_array($value)) {
$values = [];
... | php | private static function prependOperator($value, $operator = null)
{
if ($operator) {
$operator = StringHelper::toLowerCase($operator);
if (in_array($operator, static::$operators) || $operator === 'not') {
if (is_array($value)) {
$values = [];
... | [
"private",
"static",
"function",
"prependOperator",
"(",
"$",
"value",
",",
"$",
"operator",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"operator",
")",
"{",
"$",
"operator",
"=",
"StringHelper",
"::",
"toLowerCase",
"(",
"$",
"operator",
")",
";",
"if",
"... | Prepend the operator to a value
@param $value
@param null $operator
@return string|array
@deprecated | [
"Prepend",
"the",
"operator",
"to",
"a",
"value"
] | 9185b885b404b1cb272a0983023eb7c6c0df61c8 | https://github.com/flipboxfactory/craft-ember/blob/9185b885b404b1cb272a0983023eb7c6c0df61c8/src/helpers/QueryHelper.php#L354-L376 |
32,651 | flipboxfactory/craft-ember | src/helpers/QueryHelper.php | QueryHelper.parseParamOperator | private static function parseParamOperator(&$value)
{
foreach (static::$operators as $testOperator) {
// Does the value start with this operator?
$operatorLength = strlen($testOperator);
if (strncmp(
StringHelper::toLowerCase($value),
$tes... | php | private static function parseParamOperator(&$value)
{
foreach (static::$operators as $testOperator) {
// Does the value start with this operator?
$operatorLength = strlen($testOperator);
if (strncmp(
StringHelper::toLowerCase($value),
$tes... | [
"private",
"static",
"function",
"parseParamOperator",
"(",
"&",
"$",
"value",
")",
"{",
"foreach",
"(",
"static",
"::",
"$",
"operators",
"as",
"$",
"testOperator",
")",
"{",
"// Does the value start with this operator?",
"$",
"operatorLength",
"=",
"strlen",
"("... | Extracts the operator from a DB param and returns it.
@param string &$value Te param value.
@return string The operator.
@deprecated | [
"Extracts",
"the",
"operator",
"from",
"a",
"DB",
"param",
"and",
"returns",
"it",
"."
] | 9185b885b404b1cb272a0983023eb7c6c0df61c8 | https://github.com/flipboxfactory/craft-ember/blob/9185b885b404b1cb272a0983023eb7c6c0df61c8/src/helpers/QueryHelper.php#L405-L428 |
32,652 | Vectorface/cache | src/CacheHelper.php | CacheHelper.fetch | public static function fetch(Cache $cache, $key, $callback, $args, $ttl = 300)
{
if (!(is_string($key))) {
throw new \Exception('Cache key must be a string');
}
$item = $cache->get($key);
if ($item === false) {
$item = static::runCallback($callback, $args);
... | php | public static function fetch(Cache $cache, $key, $callback, $args, $ttl = 300)
{
if (!(is_string($key))) {
throw new \Exception('Cache key must be a string');
}
$item = $cache->get($key);
if ($item === false) {
$item = static::runCallback($callback, $args);
... | [
"public",
"static",
"function",
"fetch",
"(",
"Cache",
"$",
"cache",
",",
"$",
"key",
",",
"$",
"callback",
",",
"$",
"args",
",",
"$",
"ttl",
"=",
"300",
")",
"{",
"if",
"(",
"!",
"(",
"is_string",
"(",
"$",
"key",
")",
")",
")",
"{",
"throw",... | Implement the mechanics of caching the result of a heavy function call.
For example, if one has a function like so:
public static function getLargeDatasetFromDB($arg1, $arg2) {
// Lots of SQL/compute
return $giantDataSet;
}
One could cache this by adding cache calls to the top/bottom. CacheHelper::fetch can automatat... | [
"Implement",
"the",
"mechanics",
"of",
"caching",
"the",
"result",
"of",
"a",
"heavy",
"function",
"call",
"."
] | 159f4aeaf639da7a1f7e1d4e5e719a279442658b | https://github.com/Vectorface/cache/blob/159f4aeaf639da7a1f7e1d4e5e719a279442658b/src/CacheHelper.php#L34-L49 |
32,653 | Vectorface/cache | src/CacheHelper.php | CacheHelper.runCallback | protected static function runCallback($callback, $args)
{
if (!is_array($args)) {
$args = isset($args) ? array($args) : array();
}
return call_user_func_array($callback, $args);
} | php | protected static function runCallback($callback, $args)
{
if (!is_array($args)) {
$args = isset($args) ? array($args) : array();
}
return call_user_func_array($callback, $args);
} | [
"protected",
"static",
"function",
"runCallback",
"(",
"$",
"callback",
",",
"$",
"args",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"args",
")",
")",
"{",
"$",
"args",
"=",
"isset",
"(",
"$",
"args",
")",
"?",
"array",
"(",
"$",
"args",
")"... | Run the callback, normalizing the arguments.
@param callable $callback The callable to be executed to fetch the value the cache.
@param mixed[] $args The argument(s) to the callback function.
@return mixed The value returned by the callback. | [
"Run",
"the",
"callback",
"normalizing",
"the",
"arguments",
"."
] | 159f4aeaf639da7a1f7e1d4e5e719a279442658b | https://github.com/Vectorface/cache/blob/159f4aeaf639da7a1f7e1d4e5e719a279442658b/src/CacheHelper.php#L58-L64 |
32,654 | JanDC/css-from-html-extractor | src/Css/Rule/Processor.php | Processor.splitIntoSeparateMediaQueries | public function splitIntoSeparateMediaQueries($rulesString)
{
// Intelligently break up rules, preserving mediaquery context and such
$mediaQuerySelector = '/@media[^{]+\{([\s\S]+?\})\s*\}/';
$mediaQueryMatches = [];
preg_match_all($mediaQuerySelector, $rulesString, $mediaQueryMatch... | php | public function splitIntoSeparateMediaQueries($rulesString)
{
// Intelligently break up rules, preserving mediaquery context and such
$mediaQuerySelector = '/@media[^{]+\{([\s\S]+?\})\s*\}/';
$mediaQueryMatches = [];
preg_match_all($mediaQuerySelector, $rulesString, $mediaQueryMatch... | [
"public",
"function",
"splitIntoSeparateMediaQueries",
"(",
"$",
"rulesString",
")",
"{",
"// Intelligently break up rules, preserving mediaquery context and such",
"$",
"mediaQuerySelector",
"=",
"'/@media[^{]+\\{([\\s\\S]+?\\})\\s*\\}/'",
";",
"$",
"mediaQueryMatches",
"=",
"[",
... | Split a string into seperate rules
@param string $rulesString
@return array | [
"Split",
"a",
"string",
"into",
"seperate",
"rules"
] | e471a1e9ea00f800cb20e014079050cb2d9ad57c | https://github.com/JanDC/css-from-html-extractor/blob/e471a1e9ea00f800cb20e014079050cb2d9ad57c/src/Css/Rule/Processor.php#L19-L71 |
32,655 | JanDC/css-from-html-extractor | src/Css/Rule/Processor.php | Processor.convertToObjects | public function convertToObjects($media, $rule, $originalOrder)
{
$rule = $this->cleanup($rule);
$chunks = explode('{', $rule);
$selectorIdentifier = 0;
$ruleIdentifier = 1;
if (!isset($chunks[$ruleIdentifier])) {
return [];
}
$propertiesProcess... | php | public function convertToObjects($media, $rule, $originalOrder)
{
$rule = $this->cleanup($rule);
$chunks = explode('{', $rule);
$selectorIdentifier = 0;
$ruleIdentifier = 1;
if (!isset($chunks[$ruleIdentifier])) {
return [];
}
$propertiesProcess... | [
"public",
"function",
"convertToObjects",
"(",
"$",
"media",
",",
"$",
"rule",
",",
"$",
"originalOrder",
")",
"{",
"$",
"rule",
"=",
"$",
"this",
"->",
"cleanup",
"(",
"$",
"rule",
")",
";",
"$",
"chunks",
"=",
"explode",
"(",
"'{'",
",",
"$",
"ru... | Convert a rule-string into an object
@param string $media
@param string $rule
@param int $originalOrder
@return array | [
"Convert",
"a",
"rule",
"-",
"string",
"into",
"an",
"object"
] | e471a1e9ea00f800cb20e014079050cb2d9ad57c | https://github.com/JanDC/css-from-html-extractor/blob/e471a1e9ea00f800cb20e014079050cb2d9ad57c/src/Css/Rule/Processor.php#L98-L129 |
32,656 | appaydin/pd-mailer | SwiftMailer/SendListener.php | SendListener.logCreate | private function logCreate(\Swift_Mime_SimpleMessage $message, $status, $templateID, $language)
{
// Check Message
if (null === $message->getId() || empty($message->getId())) {
return false;
}
// Create Log
$class = $this->bag->get('pd_mailer.mail_log_class');
... | php | private function logCreate(\Swift_Mime_SimpleMessage $message, $status, $templateID, $language)
{
// Check Message
if (null === $message->getId() || empty($message->getId())) {
return false;
}
// Create Log
$class = $this->bag->get('pd_mailer.mail_log_class');
... | [
"private",
"function",
"logCreate",
"(",
"\\",
"Swift_Mime_SimpleMessage",
"$",
"message",
",",
"$",
"status",
",",
"$",
"templateID",
",",
"$",
"language",
")",
"{",
"// Check Message",
"if",
"(",
"null",
"===",
"$",
"message",
"->",
"getId",
"(",
")",
"|... | Create Mail Log.
@param \Swift_Mime_SimpleMessage $message
@param $status
@param $templateID
@param $language
@return bool | [
"Create",
"Mail",
"Log",
"."
] | c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f | https://github.com/appaydin/pd-mailer/blob/c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f/SwiftMailer/SendListener.php#L161-L189 |
32,657 | appaydin/pd-mailer | SwiftMailer/SendListener.php | SendListener.logUpdate | private function logUpdate(\Swift_Mime_SimpleMessage $message, $status)
{
// Check Message
if (null === $message->getId() || empty($message->getId())) {
return false;
}
// Update Data
$this->log->setStatus($status);
$this->log->setDate($message->getDate()... | php | private function logUpdate(\Swift_Mime_SimpleMessage $message, $status)
{
// Check Message
if (null === $message->getId() || empty($message->getId())) {
return false;
}
// Update Data
$this->log->setStatus($status);
$this->log->setDate($message->getDate()... | [
"private",
"function",
"logUpdate",
"(",
"\\",
"Swift_Mime_SimpleMessage",
"$",
"message",
",",
"$",
"status",
")",
"{",
"// Check Message",
"if",
"(",
"null",
"===",
"$",
"message",
"->",
"getId",
"(",
")",
"||",
"empty",
"(",
"$",
"message",
"->",
"getId... | Update Log Status & Date.
@param \Swift_Mime_SimpleMessage $message
@param $status
@return bool | [
"Update",
"Log",
"Status",
"&",
"Date",
"."
] | c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f | https://github.com/appaydin/pd-mailer/blob/c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f/SwiftMailer/SendListener.php#L199-L215 |
32,658 | CradlePHP/cradle-system | src/Fieldset.php | Fieldset.getFields | public function getFields()
{
$results = [];
if (!isset($this->data['fields'])
|| empty($this->data['fields'])
) {
return $results;
}
$table = $this->data['name'];
foreach ($this->data['fields'] as $field) {
$name = $table . '_' . ... | php | public function getFields()
{
$results = [];
if (!isset($this->data['fields'])
|| empty($this->data['fields'])
) {
return $results;
}
$table = $this->data['name'];
foreach ($this->data['fields'] as $field) {
$name = $table . '_' . ... | [
"public",
"function",
"getFields",
"(",
")",
"{",
"$",
"results",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"'fields'",
"]",
")",
"||",
"empty",
"(",
"$",
"this",
"->",
"data",
"[",
"'fields'",
"]",
")",
... | Returns All fields
@return array | [
"Returns",
"All",
"fields"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Fieldset.php#L104-L120 |
32,659 | CradlePHP/cradle-system | src/Fieldset.php | Fieldset.getFileFieldNames | public function getFileFieldNames()
{
$results = [];
if (!isset($this->data['fields'])
|| empty($this->data['fields'])
) {
return $results;
}
$table = $this->data['name'];
foreach ($this->data['fields'] as $field) {
$name = $table ... | php | public function getFileFieldNames()
{
$results = [];
if (!isset($this->data['fields'])
|| empty($this->data['fields'])
) {
return $results;
}
$table = $this->data['name'];
foreach ($this->data['fields'] as $field) {
$name = $table ... | [
"public",
"function",
"getFileFieldNames",
"(",
")",
"{",
"$",
"results",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"'fields'",
"]",
")",
"||",
"empty",
"(",
"$",
"this",
"->",
"data",
"[",
"'fields'",
"]",
... | Returns All files
@return array | [
"Returns",
"All",
"files"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Fieldset.php#L127-L155 |
32,660 | CradlePHP/cradle-system | src/Fieldset.php | Fieldset.getRequiredFieldNames | public function getRequiredFieldNames()
{
$results = [];
if (!isset($this->data['fields']) || empty($this->data['fields'])) {
return $results;
}
$table = $this->data['name'];
foreach ($this->data['fields'] as $field) {
$name = $table . '_' . $field['n... | php | public function getRequiredFieldNames()
{
$results = [];
if (!isset($this->data['fields']) || empty($this->data['fields'])) {
return $results;
}
$table = $this->data['name'];
foreach ($this->data['fields'] as $field) {
$name = $table . '_' . $field['n... | [
"public",
"function",
"getRequiredFieldNames",
"(",
")",
"{",
"$",
"results",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"'fields'",
"]",
")",
"||",
"empty",
"(",
"$",
"this",
"->",
"data",
"[",
"'fields'",
"]... | Returns a list of required fields
@return array | [
"Returns",
"a",
"list",
"of",
"required",
"fields"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Fieldset.php#L231-L254 |
32,661 | CradlePHP/cradle-system | src/Fieldset.php | Fieldset.getSlugableFieldNames | public function getSlugableFieldNames($primary = false)
{
$results = [];
if ($primary) {
$results[] = $primary;
}
if (!isset($this->data['fields']) || empty($this->data['fields'])) {
return $results;
}
$table = $this->data['name'];
fo... | php | public function getSlugableFieldNames($primary = false)
{
$results = [];
if ($primary) {
$results[] = $primary;
}
if (!isset($this->data['fields']) || empty($this->data['fields'])) {
return $results;
}
$table = $this->data['name'];
fo... | [
"public",
"function",
"getSlugableFieldNames",
"(",
"$",
"primary",
"=",
"false",
")",
"{",
"$",
"results",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"primary",
")",
"{",
"$",
"results",
"[",
"]",
"=",
"$",
"primary",
";",
"}",
"if",
"(",
"!",
"isset",
... | Returns slug fields
@param string|false $primary
@return array | [
"Returns",
"slug",
"fields"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Fieldset.php#L263-L285 |
32,662 | CradlePHP/cradle-system | src/Fieldset.php | Fieldset.getUniqueFieldNames | public function getUniqueFieldNames()
{
$results = [ $this->getPrimaryFieldName() ];
if (!isset($this->data['fields']) || empty($this->data['fields'])) {
return $results;
}
$table = $this->data['name'];
foreach ($this->data['fields'] as $field) {
$nam... | php | public function getUniqueFieldNames()
{
$results = [ $this->getPrimaryFieldName() ];
if (!isset($this->data['fields']) || empty($this->data['fields'])) {
return $results;
}
$table = $this->data['name'];
foreach ($this->data['fields'] as $field) {
$nam... | [
"public",
"function",
"getUniqueFieldNames",
"(",
")",
"{",
"$",
"results",
"=",
"[",
"$",
"this",
"->",
"getPrimaryFieldName",
"(",
")",
"]",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"'fields'",
"]",
")",
"||",
"empty",
"("... | Returns a list of unique fields
@return array | [
"Returns",
"a",
"list",
"of",
"unique",
"fields"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Fieldset.php#L292-L320 |
32,663 | ahand/mobileesp | PHP/mdetect.php | uagent_info.uagent_info | function uagent_info()
{
$this->useragent = isset($_SERVER['HTTP_USER_AGENT'])?strtolower($_SERVER['HTTP_USER_AGENT']):'';
$this->httpaccept = isset($_SERVER['HTTP_ACCEPT'])?strtolower($_SERVER['HTTP_ACCEPT']):'';
//Let's initialize some values to save cycles later.
$this->InitDeviceScan();
} | php | function uagent_info()
{
$this->useragent = isset($_SERVER['HTTP_USER_AGENT'])?strtolower($_SERVER['HTTP_USER_AGENT']):'';
$this->httpaccept = isset($_SERVER['HTTP_ACCEPT'])?strtolower($_SERVER['HTTP_ACCEPT']):'';
//Let's initialize some values to save cycles later.
$this->InitDeviceScan();
} | [
"function",
"uagent_info",
"(",
")",
"{",
"$",
"this",
"->",
"useragent",
"=",
"isset",
"(",
"$",
"_SERVER",
"[",
"'HTTP_USER_AGENT'",
"]",
")",
"?",
"strtolower",
"(",
"$",
"_SERVER",
"[",
"'HTTP_USER_AGENT'",
"]",
")",
":",
"''",
";",
"$",
"this",
"-... | The object initializer. Initializes several default variables. | [
"The",
"object",
"initializer",
".",
"Initializes",
"several",
"default",
"variables",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L225-L232 |
32,664 | ahand/mobileesp | PHP/mdetect.php | uagent_info.InitDeviceScan | function InitDeviceScan()
{
//Save these properties to speed processing
global $isWebkit, $isIphone, $isAndroid, $isAndroidPhone;
$this->isWebkit = $this->DetectWebkit();
$this->isIphone = $this->DetectIphone();
$this->isAndroid = $this->DetectAndroid();
$this->... | php | function InitDeviceScan()
{
//Save these properties to speed processing
global $isWebkit, $isIphone, $isAndroid, $isAndroidPhone;
$this->isWebkit = $this->DetectWebkit();
$this->isIphone = $this->DetectIphone();
$this->isAndroid = $this->DetectAndroid();
$this->... | [
"function",
"InitDeviceScan",
"(",
")",
"{",
"//Save these properties to speed processing\r",
"global",
"$",
"isWebkit",
",",
"$",
"isIphone",
",",
"$",
"isAndroid",
",",
"$",
"isAndroidPhone",
";",
"$",
"this",
"->",
"isWebkit",
"=",
"$",
"this",
"->",
"DetectW... | Initialize Key Stored Values. | [
"Initialize",
"Key",
"Stored",
"Values",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L236-L257 |
32,665 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectIphone | function DetectIphone()
{
if ($this->initCompleted == $this->true ||
$this->isIphone == $this->true)
return $this->isIphone;
if (stripos($this->useragent, $this->deviceIphone) > -1)
{
//The iPad and iPod Touch say they're an iPhone. So let's disambiguate.
... | php | function DetectIphone()
{
if ($this->initCompleted == $this->true ||
$this->isIphone == $this->true)
return $this->isIphone;
if (stripos($this->useragent, $this->deviceIphone) > -1)
{
//The iPad and iPod Touch say they're an iPhone. So let's disambiguate.
... | [
"function",
"DetectIphone",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"initCompleted",
"==",
"$",
"this",
"->",
"true",
"||",
"$",
"this",
"->",
"isIphone",
"==",
"$",
"this",
"->",
"true",
")",
"return",
"$",
"this",
"->",
"isIphone",
";",
"if",
... | Detects if the current device is an iPhone. | [
"Detects",
"if",
"the",
"current",
"device",
"is",
"an",
"iPhone",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L280-L298 |
32,666 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectIpod | function DetectIpod()
{
if (stripos($this->useragent, $this->deviceIpod) > -1)
return $this->true;
else
return $this->false;
} | php | function DetectIpod()
{
if (stripos($this->useragent, $this->deviceIpod) > -1)
return $this->true;
else
return $this->false;
} | [
"function",
"DetectIpod",
"(",
")",
"{",
"if",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"deviceIpod",
")",
">",
"-",
"1",
")",
"return",
"$",
"this",
"->",
"true",
";",
"else",
"return",
"$",
"this",
"->",
"false... | Detects if the current device is an iPod Touch. | [
"Detects",
"if",
"the",
"current",
"device",
"is",
"an",
"iPod",
"Touch",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L302-L308 |
32,667 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectIpad | function DetectIpad()
{
if (stripos($this->useragent, $this->deviceIpad) > -1 &&
$this->DetectWebkit() == $this->true)
return $this->true;
else
return $this->false;
} | php | function DetectIpad()
{
if (stripos($this->useragent, $this->deviceIpad) > -1 &&
$this->DetectWebkit() == $this->true)
return $this->true;
else
return $this->false;
} | [
"function",
"DetectIpad",
"(",
")",
"{",
"if",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"deviceIpad",
")",
">",
"-",
"1",
"&&",
"$",
"this",
"->",
"DetectWebkit",
"(",
")",
"==",
"$",
"this",
"->",
"true",
")",
... | Detects if the current device is an iPad tablet. | [
"Detects",
"if",
"the",
"current",
"device",
"is",
"an",
"iPad",
"tablet",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L312-L319 |
32,668 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectIphoneOrIpod | function DetectIphoneOrIpod()
{
//We repeat the searches here because some iPods may report themselves as an iPhone, which would be okay.
if ($this->DetectIphone() == $this->true ||
$this->DetectIpod() == $this->true)
return $this->true;
else
return $this->fa... | php | function DetectIphoneOrIpod()
{
//We repeat the searches here because some iPods may report themselves as an iPhone, which would be okay.
if ($this->DetectIphone() == $this->true ||
$this->DetectIpod() == $this->true)
return $this->true;
else
return $this->fa... | [
"function",
"DetectIphoneOrIpod",
"(",
")",
"{",
"//We repeat the searches here because some iPods may report themselves as an iPhone, which would be okay.\r",
"if",
"(",
"$",
"this",
"->",
"DetectIphone",
"(",
")",
"==",
"$",
"this",
"->",
"true",
"||",
"$",
"this",
"->"... | Detects if the current device is an iPhone or iPod Touch. | [
"Detects",
"if",
"the",
"current",
"device",
"is",
"an",
"iPhone",
"or",
"iPod",
"Touch",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L323-L331 |
32,669 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectAndroid | function DetectAndroid()
{
if ($this->initCompleted == $this->true ||
$this->isAndroid == $this->true)
return $this->isAndroid;
if ((stripos($this->useragent, $this->deviceAndroid) > -1)
|| ($this->DetectGoogleTV() == $this->true))
return $this->true;
... | php | function DetectAndroid()
{
if ($this->initCompleted == $this->true ||
$this->isAndroid == $this->true)
return $this->isAndroid;
if ((stripos($this->useragent, $this->deviceAndroid) > -1)
|| ($this->DetectGoogleTV() == $this->true))
return $this->true;
... | [
"function",
"DetectAndroid",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"initCompleted",
"==",
"$",
"this",
"->",
"true",
"||",
"$",
"this",
"->",
"isAndroid",
"==",
"$",
"this",
"->",
"true",
")",
"return",
"$",
"this",
"->",
"isAndroid",
";",
"if... | Also detects Google TV. | [
"Also",
"detects",
"Google",
"TV",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L348-L359 |
32,670 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectAndroidTablet | function DetectAndroidTablet()
{
//First, let's make sure we're on an Android device.
if ($this->DetectAndroid() == $this->false)
return $this->false;
//Special check for Android devices with Opera Mobile/Mini. They should NOT report here.
if ($this->DetectOperaMobile() == $... | php | function DetectAndroidTablet()
{
//First, let's make sure we're on an Android device.
if ($this->DetectAndroid() == $this->false)
return $this->false;
//Special check for Android devices with Opera Mobile/Mini. They should NOT report here.
if ($this->DetectOperaMobile() == $... | [
"function",
"DetectAndroidTablet",
"(",
")",
"{",
"//First, let's make sure we're on an Android device.\r",
"if",
"(",
"$",
"this",
"->",
"DetectAndroid",
"(",
")",
"==",
"$",
"this",
"->",
"false",
")",
"return",
"$",
"this",
"->",
"false",
";",
"//Special check ... | Google says these devices will have 'Android' and NOT 'mobile' in their user agent. | [
"Google",
"says",
"these",
"devices",
"will",
"have",
"Android",
"and",
"NOT",
"mobile",
"in",
"their",
"user",
"agent",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L390-L405 |
32,671 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectAndroidWebKit | function DetectAndroidWebKit()
{
if (($this->DetectAndroid() == $this->true) &&
($this->DetectWebkit() == $this->true))
return $this->true;
else
return $this->false;
} | php | function DetectAndroidWebKit()
{
if (($this->DetectAndroid() == $this->true) &&
($this->DetectWebkit() == $this->true))
return $this->true;
else
return $this->false;
} | [
"function",
"DetectAndroidWebKit",
"(",
")",
"{",
"if",
"(",
"(",
"$",
"this",
"->",
"DetectAndroid",
"(",
")",
"==",
"$",
"this",
"->",
"true",
")",
"&&",
"(",
"$",
"this",
"->",
"DetectWebkit",
"(",
")",
"==",
"$",
"this",
"->",
"true",
")",
")",... | the browser is based on WebKit. | [
"the",
"browser",
"is",
"based",
"on",
"WebKit",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L410-L417 |
32,672 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectGoogleTV | function DetectGoogleTV()
{
if (stripos($this->useragent, $this->deviceGoogleTV) > -1)
return $this->true;
else
return $this->false;
} | php | function DetectGoogleTV()
{
if (stripos($this->useragent, $this->deviceGoogleTV) > -1)
return $this->true;
else
return $this->false;
} | [
"function",
"DetectGoogleTV",
"(",
")",
"{",
"if",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"deviceGoogleTV",
")",
">",
"-",
"1",
")",
"return",
"$",
"this",
"->",
"true",
";",
"else",
"return",
"$",
"this",
"->",
... | Detects if the current device is a GoogleTV. | [
"Detects",
"if",
"the",
"current",
"device",
"is",
"a",
"GoogleTV",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L421-L427 |
32,673 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectWebkit | function DetectWebkit()
{
if ($this->initCompleted == $this->true ||
$this->isWebkit == $this->true)
return $this->isWebkit;
if (stripos($this->useragent, $this->engineWebKit) > -1)
return $this->true;
else
return $this->false;
} | php | function DetectWebkit()
{
if ($this->initCompleted == $this->true ||
$this->isWebkit == $this->true)
return $this->isWebkit;
if (stripos($this->useragent, $this->engineWebKit) > -1)
return $this->true;
else
return $this->false;
} | [
"function",
"DetectWebkit",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"initCompleted",
"==",
"$",
"this",
"->",
"true",
"||",
"$",
"this",
"->",
"isWebkit",
"==",
"$",
"this",
"->",
"true",
")",
"return",
"$",
"this",
"->",
"isWebkit",
";",
"if",
... | Detects if the current browser is based on WebKit. | [
"Detects",
"if",
"the",
"current",
"browser",
"is",
"based",
"on",
"WebKit",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L431-L441 |
32,674 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectWindowsPhone | function DetectWindowsPhone()
{
if (($this->DetectWindowsPhone7() == $this->true)
|| ($this->DetectWindowsPhone8() == $this->true)
|| ($this->DetectWindowsPhone10() == $this->true))
return $this->true;
else
return $this->false;
} | php | function DetectWindowsPhone()
{
if (($this->DetectWindowsPhone7() == $this->true)
|| ($this->DetectWindowsPhone8() == $this->true)
|| ($this->DetectWindowsPhone10() == $this->true))
return $this->true;
else
return $this->false;
} | [
"function",
"DetectWindowsPhone",
"(",
")",
"{",
"if",
"(",
"(",
"$",
"this",
"->",
"DetectWindowsPhone7",
"(",
")",
"==",
"$",
"this",
"->",
"true",
")",
"||",
"(",
"$",
"this",
"->",
"DetectWindowsPhone8",
"(",
")",
"==",
"$",
"this",
"->",
"true",
... | Windows Phone 7, 8, or 10 device. | [
"Windows",
"Phone",
"7",
"8",
"or",
"10",
"device",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L447-L455 |
32,675 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectWindowsMobile | function DetectWindowsMobile()
{
if ($this->DetectWindowsPhone() == $this->true)
return $this->false;
//Most devices use 'Windows CE', but some report 'iemobile'
// and some older ones report as 'PIE' for Pocket IE.
if (stripos($this->useragent, $this->deviceWinMob) ... | php | function DetectWindowsMobile()
{
if ($this->DetectWindowsPhone() == $this->true)
return $this->false;
//Most devices use 'Windows CE', but some report 'iemobile'
// and some older ones report as 'PIE' for Pocket IE.
if (stripos($this->useragent, $this->deviceWinMob) ... | [
"function",
"DetectWindowsMobile",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"DetectWindowsPhone",
"(",
")",
"==",
"$",
"this",
"->",
"true",
")",
"return",
"$",
"this",
"->",
"false",
";",
"//Most devices use 'Windows CE', but some report 'iemobile' \r",
"// ... | Focuses on Windows Mobile 6.xx and earlier. | [
"Focuses",
"on",
"Windows",
"Mobile",
"6",
".",
"xx",
"and",
"earlier",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L491-L515 |
32,676 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectBlackBerry | function DetectBlackBerry()
{
if ((stripos($this->useragent, $this->deviceBB) > -1) ||
(stripos($this->httpaccept, $this->vndRIM) > -1))
return $this->true;
if ($this->DetectBlackBerry10Phone() == $this->true)
return $this->true;
else
return $t... | php | function DetectBlackBerry()
{
if ((stripos($this->useragent, $this->deviceBB) > -1) ||
(stripos($this->httpaccept, $this->vndRIM) > -1))
return $this->true;
if ($this->DetectBlackBerry10Phone() == $this->true)
return $this->true;
else
return $t... | [
"function",
"DetectBlackBerry",
"(",
")",
"{",
"if",
"(",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"deviceBB",
")",
">",
"-",
"1",
")",
"||",
"(",
"stripos",
"(",
"$",
"this",
"->",
"httpaccept",
",",
"$",
"this"... | Includes BB10 OS, but excludes the PlayBook. | [
"Includes",
"BB10",
"OS",
"but",
"excludes",
"the",
"PlayBook",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L520-L529 |
32,677 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectBlackBerry10Phone | function DetectBlackBerry10Phone()
{
if ((stripos($this->useragent, $this->deviceBB10) > -1) &&
(stripos($this->useragent, $this->mobile) > -1))
return $this->true;
else
return $this->false;
} | php | function DetectBlackBerry10Phone()
{
if ((stripos($this->useragent, $this->deviceBB10) > -1) &&
(stripos($this->useragent, $this->mobile) > -1))
return $this->true;
else
return $this->false;
} | [
"function",
"DetectBlackBerry10Phone",
"(",
")",
"{",
"if",
"(",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"deviceBB10",
")",
">",
"-",
"1",
")",
"&&",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
... | Excludes tablets. | [
"Excludes",
"tablets",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L534-L541 |
32,678 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectBlackBerryTouch | function DetectBlackBerryTouch()
{
if ((stripos($this->useragent, $this->deviceBBStorm) > -1) ||
(stripos($this->useragent, $this->deviceBBTorch) > -1) ||
(stripos($this->useragent, $this->deviceBBBoldTouch) > -1) ||
(stripos($this->useragent, $this->deviceBBCurveTouch) > -1))
return $t... | php | function DetectBlackBerryTouch()
{
if ((stripos($this->useragent, $this->deviceBBStorm) > -1) ||
(stripos($this->useragent, $this->deviceBBTorch) > -1) ||
(stripos($this->useragent, $this->deviceBBBoldTouch) > -1) ||
(stripos($this->useragent, $this->deviceBBCurveTouch) > -1))
return $t... | [
"function",
"DetectBlackBerryTouch",
"(",
")",
"{",
"if",
"(",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"deviceBBStorm",
")",
">",
"-",
"1",
")",
"||",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",... | a large screen, such as the Storm, Torch, and Bold Touch. Excludes the Playbook. | [
"a",
"large",
"screen",
"such",
"as",
"the",
"Storm",
"Torch",
"and",
"Bold",
"Touch",
".",
"Excludes",
"the",
"Playbook",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L570-L579 |
32,679 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectBlackBerryHigh | function DetectBlackBerryHigh()
{
//Disambiguate for BlackBerry OS 6 or 7 (WebKit) browser
if ($this->DetectBlackBerryWebKit() == $this->true)
return $this->false;
if ($this->DetectBlackBerry() == $this->true)
{
if (($this->DetectBlackBerryTouch() == $this->true) ||... | php | function DetectBlackBerryHigh()
{
//Disambiguate for BlackBerry OS 6 or 7 (WebKit) browser
if ($this->DetectBlackBerryWebKit() == $this->true)
return $this->false;
if ($this->DetectBlackBerry() == $this->true)
{
if (($this->DetectBlackBerryTouch() == $this->true) ||... | [
"function",
"DetectBlackBerryHigh",
"(",
")",
"{",
"//Disambiguate for BlackBerry OS 6 or 7 (WebKit) browser\r",
"if",
"(",
"$",
"this",
"->",
"DetectBlackBerryWebKit",
"(",
")",
"==",
"$",
"this",
"->",
"true",
")",
"return",
"$",
"this",
"->",
"false",
";",
"if"... | Excludes the new BlackBerry OS 6 and 7 browser!! | [
"Excludes",
"the",
"new",
"BlackBerry",
"OS",
"6",
"and",
"7",
"browser!!"
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L586-L605 |
32,680 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectS60OssBrowser | function DetectS60OssBrowser()
{
//First, test for WebKit, then make sure it's either Symbian or S60.
if ($this->DetectWebkit() == $this->true)
{
if (stripos($this->useragent, $this->deviceSymbian) > -1 ||
stripos($this->useragent, $this->deviceS60) > -1)
{
... | php | function DetectS60OssBrowser()
{
//First, test for WebKit, then make sure it's either Symbian or S60.
if ($this->DetectWebkit() == $this->true)
{
if (stripos($this->useragent, $this->deviceSymbian) > -1 ||
stripos($this->useragent, $this->deviceS60) > -1)
{
... | [
"function",
"DetectS60OssBrowser",
"(",
")",
"{",
"//First, test for WebKit, then make sure it's either Symbian or S60.\r",
"if",
"(",
"$",
"this",
"->",
"DetectWebkit",
"(",
")",
"==",
"$",
"this",
"->",
"true",
")",
"{",
"if",
"(",
"stripos",
"(",
"$",
"this",
... | Detects if the current browser is the Nokia S60 Open Source Browser. | [
"Detects",
"if",
"the",
"current",
"browser",
"is",
"the",
"Nokia",
"S60",
"Open",
"Source",
"Browser",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L629-L644 |
32,681 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectSymbianOS | function DetectSymbianOS()
{
if (stripos($this->useragent, $this->deviceSymbian) > -1 ||
stripos($this->useragent, $this->deviceS60) > -1 ||
stripos($this->useragent, $this->deviceS70) > -1 ||
stripos($this->useragent, $this->deviceS80) > -1 ||
stripos($this... | php | function DetectSymbianOS()
{
if (stripos($this->useragent, $this->deviceSymbian) > -1 ||
stripos($this->useragent, $this->deviceS60) > -1 ||
stripos($this->useragent, $this->deviceS70) > -1 ||
stripos($this->useragent, $this->deviceS80) > -1 ||
stripos($this... | [
"function",
"DetectSymbianOS",
"(",
")",
"{",
"if",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"deviceSymbian",
")",
">",
"-",
"1",
"||",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"devic... | or other browsers running on these devices. | [
"or",
"other",
"browsers",
"running",
"on",
"these",
"devices",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L650-L660 |
32,682 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectPalmOS | function DetectPalmOS()
{
//Most devices nowadays report as 'Palm', but some older ones reported as Blazer or Xiino.
if (stripos($this->useragent, $this->devicePalm) > -1 ||
stripos($this->useragent, $this->engineBlazer) > -1 ||
stripos($this->useragent, $this->engineXiino) > -1)... | php | function DetectPalmOS()
{
//Most devices nowadays report as 'Palm', but some older ones reported as Blazer or Xiino.
if (stripos($this->useragent, $this->devicePalm) > -1 ||
stripos($this->useragent, $this->engineBlazer) > -1 ||
stripos($this->useragent, $this->engineXiino) > -1)... | [
"function",
"DetectPalmOS",
"(",
")",
"{",
"//Most devices nowadays report as 'Palm', but some older ones reported as Blazer or Xiino.\r",
"if",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"devicePalm",
")",
">",
"-",
"1",
"||",
"strip... | Detects if the current browser is on a PalmOS device. | [
"Detects",
"if",
"the",
"current",
"browser",
"is",
"on",
"a",
"PalmOS",
"device",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L665-L680 |
32,683 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectPalmWebOS | function DetectPalmWebOS()
{
if (stripos($this->useragent, $this->deviceWebOS) > -1)
return $this->true;
else
return $this->false;
} | php | function DetectPalmWebOS()
{
if (stripos($this->useragent, $this->deviceWebOS) > -1)
return $this->true;
else
return $this->false;
} | [
"function",
"DetectPalmWebOS",
"(",
")",
"{",
"if",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"deviceWebOS",
")",
">",
"-",
"1",
")",
"return",
"$",
"this",
"->",
"true",
";",
"else",
"return",
"$",
"this",
"->",
... | running the new WebOS. | [
"running",
"the",
"new",
"WebOS",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L686-L692 |
32,684 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectWebOSTablet | function DetectWebOSTablet()
{
if ((stripos($this->useragent, $this->deviceWebOShp) > -1)
&& (stripos($this->useragent, $this->deviceTablet) > -1))
return $this->true;
else
return $this->false;
} | php | function DetectWebOSTablet()
{
if ((stripos($this->useragent, $this->deviceWebOShp) > -1)
&& (stripos($this->useragent, $this->deviceTablet) > -1))
return $this->true;
else
return $this->false;
} | [
"function",
"DetectWebOSTablet",
"(",
")",
"{",
"if",
"(",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"deviceWebOShp",
")",
">",
"-",
"1",
")",
"&&",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"... | Detects if the current browser is on an HP tablet running WebOS. | [
"Detects",
"if",
"the",
"current",
"browser",
"is",
"on",
"an",
"HP",
"tablet",
"running",
"WebOS",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L696-L703 |
32,685 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectWebOSTV | function DetectWebOSTV()
{
if ((stripos($this->useragent, $this->deviceWebOStv) > -1)
&& (stripos($this->useragent, $this->smartTV2) > -1))
return $this->true;
else
return $this->false;
} | php | function DetectWebOSTV()
{
if ((stripos($this->useragent, $this->deviceWebOStv) > -1)
&& (stripos($this->useragent, $this->smartTV2) > -1))
return $this->true;
else
return $this->false;
} | [
"function",
"DetectWebOSTV",
"(",
")",
"{",
"if",
"(",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"deviceWebOStv",
")",
">",
"-",
"1",
")",
"&&",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this... | Detects if the current browser is on a WebOS smart TV. | [
"Detects",
"if",
"the",
"current",
"browser",
"is",
"on",
"a",
"WebOS",
"smart",
"TV",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L707-L714 |
32,686 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectOperaMobile | function DetectOperaMobile()
{
if ((stripos($this->useragent, $this->engineOpera) > -1) &&
((stripos($this->useragent, $this->mini) > -1) ||
(stripos($this->useragent, $this->mobi) > -1)))
return $this->true;
return $this->false;
} | php | function DetectOperaMobile()
{
if ((stripos($this->useragent, $this->engineOpera) > -1) &&
((stripos($this->useragent, $this->mini) > -1) ||
(stripos($this->useragent, $this->mobi) > -1)))
return $this->true;
return $this->false;
} | [
"function",
"DetectOperaMobile",
"(",
")",
"{",
"if",
"(",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"engineOpera",
")",
">",
"-",
"1",
")",
"&&",
"(",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$"... | Detects if the current browser is Opera Mobile or Mini. | [
"Detects",
"if",
"the",
"current",
"browser",
"is",
"Opera",
"Mobile",
"or",
"Mini",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L719-L727 |
32,687 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectGarminNuvifone | function DetectGarminNuvifone()
{
if (stripos($this->useragent, $this->deviceNuvifone) > -1)
return $this->true;
else
return $this->false;
} | php | function DetectGarminNuvifone()
{
if (stripos($this->useragent, $this->deviceNuvifone) > -1)
return $this->true;
else
return $this->false;
} | [
"function",
"DetectGarminNuvifone",
"(",
")",
"{",
"if",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"deviceNuvifone",
")",
">",
"-",
"1",
")",
"return",
"$",
"this",
"->",
"true",
";",
"else",
"return",
"$",
"this",
... | Detects if a Garmin Nuvifone device. | [
"Detects",
"if",
"a",
"Garmin",
"Nuvifone",
"device",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L754-L760 |
32,688 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectBada | function DetectBada()
{
if (stripos($this->useragent, $this->deviceBada) > -1)
return $this->true;
else
return $this->false;
} | php | function DetectBada()
{
if (stripos($this->useragent, $this->deviceBada) > -1)
return $this->true;
else
return $this->false;
} | [
"function",
"DetectBada",
"(",
")",
"{",
"if",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"deviceBada",
")",
">",
"-",
"1",
")",
"return",
"$",
"this",
"->",
"true",
";",
"else",
"return",
"$",
"this",
"->",
"false... | Detects a device running the Bada OS from Samsung. | [
"Detects",
"a",
"device",
"running",
"the",
"Bada",
"OS",
"from",
"Samsung",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L764-L770 |
32,689 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectTizen | function DetectTizen()
{
if ((stripos($this->useragent, $this->deviceTizen) > -1)
&& (stripos($this->useragent, $this->mobile) > -1))
return $this->true;
else
return $this->false;
} | php | function DetectTizen()
{
if ((stripos($this->useragent, $this->deviceTizen) > -1)
&& (stripos($this->useragent, $this->mobile) > -1))
return $this->true;
else
return $this->false;
} | [
"function",
"DetectTizen",
"(",
")",
"{",
"if",
"(",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"deviceTizen",
")",
">",
"-",
"1",
")",
"&&",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
... | Detects a device running the Tizen smartphone OS. | [
"Detects",
"a",
"device",
"running",
"the",
"Tizen",
"smartphone",
"OS",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L774-L781 |
32,690 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectTizenTV | function DetectTizenTV()
{
if ((stripos($this->useragent, $this->deviceTizen) > -1)
&& (stripos($this->useragent, $this->smartTV1) > -1))
return $this->true;
else
return $this->false;
} | php | function DetectTizenTV()
{
if ((stripos($this->useragent, $this->deviceTizen) > -1)
&& (stripos($this->useragent, $this->smartTV1) > -1))
return $this->true;
else
return $this->false;
} | [
"function",
"DetectTizenTV",
"(",
")",
"{",
"if",
"(",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"deviceTizen",
")",
">",
"-",
"1",
")",
"&&",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",... | Detects if the current browser is on a Tizen smart TV. | [
"Detects",
"if",
"the",
"current",
"browser",
"is",
"on",
"a",
"Tizen",
"smart",
"TV",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L785-L792 |
32,691 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectMeego | function DetectMeego()
{
if (stripos($this->useragent, $this->deviceMeego) > -1)
return $this->true;
else
return $this->false;
} | php | function DetectMeego()
{
if (stripos($this->useragent, $this->deviceMeego) > -1)
return $this->true;
else
return $this->false;
} | [
"function",
"DetectMeego",
"(",
")",
"{",
"if",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"deviceMeego",
")",
">",
"-",
"1",
")",
"return",
"$",
"this",
"->",
"true",
";",
"else",
"return",
"$",
"this",
"->",
"fal... | Detects a device running the Meego OS. | [
"Detects",
"a",
"device",
"running",
"the",
"Meego",
"OS",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L796-L802 |
32,692 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectMeegoPhone | function DetectMeegoPhone()
{
if ((stripos($this->useragent, $this->deviceMeego) > -1)
&& (stripos($this->useragent, $this->mobi) > -1))
return $this->true;
else
return $this->false;
} | php | function DetectMeegoPhone()
{
if ((stripos($this->useragent, $this->deviceMeego) > -1)
&& (stripos($this->useragent, $this->mobi) > -1))
return $this->true;
else
return $this->false;
} | [
"function",
"DetectMeegoPhone",
"(",
")",
"{",
"if",
"(",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"deviceMeego",
")",
">",
"-",
"1",
")",
"&&",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"thi... | Detects a phone running the Meego OS. | [
"Detects",
"a",
"phone",
"running",
"the",
"Meego",
"OS",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L806-L813 |
32,693 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectSailfish | function DetectSailfish()
{
if (stripos($this->useragent, $this->deviceSailfish) > -1)
return $this->true;
else
return $this->false;
} | php | function DetectSailfish()
{
if (stripos($this->useragent, $this->deviceSailfish) > -1)
return $this->true;
else
return $this->false;
} | [
"function",
"DetectSailfish",
"(",
")",
"{",
"if",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"deviceSailfish",
")",
">",
"-",
"1",
")",
"return",
"$",
"this",
"->",
"true",
";",
"else",
"return",
"$",
"this",
"->",
... | Detects a device running the Sailfish OS. | [
"Detects",
"a",
"device",
"running",
"the",
"Sailfish",
"OS",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L862-L868 |
32,694 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectSailfishPhone | function DetectSailfishPhone()
{
if (($this->DetectSailfish() == $this->true) &&
(stripos($this->useragent, $this->mobile) > -1))
return $this->true;
return $this->false;
} | php | function DetectSailfishPhone()
{
if (($this->DetectSailfish() == $this->true) &&
(stripos($this->useragent, $this->mobile) > -1))
return $this->true;
return $this->false;
} | [
"function",
"DetectSailfishPhone",
"(",
")",
"{",
"if",
"(",
"(",
"$",
"this",
"->",
"DetectSailfish",
"(",
")",
"==",
"$",
"this",
"->",
"true",
")",
"&&",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"mobile",
")",
... | Detects a phone running the Sailfish OS. | [
"Detects",
"a",
"phone",
"running",
"the",
"Sailfish",
"OS",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L872-L879 |
32,695 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectUbuntu | function DetectUbuntu()
{
if (($this->DetectUbuntuPhone() == $this->true)
|| ($this->DetectUbuntuTablet() == $this->true))
return $this->true;
else
return $this->false;
} | php | function DetectUbuntu()
{
if (($this->DetectUbuntuPhone() == $this->true)
|| ($this->DetectUbuntuTablet() == $this->true))
return $this->true;
else
return $this->false;
} | [
"function",
"DetectUbuntu",
"(",
")",
"{",
"if",
"(",
"(",
"$",
"this",
"->",
"DetectUbuntuPhone",
"(",
")",
"==",
"$",
"this",
"->",
"true",
")",
"||",
"(",
"$",
"this",
"->",
"DetectUbuntuTablet",
"(",
")",
"==",
"$",
"this",
"->",
"true",
")",
"... | Detects a mobile device running the Ubuntu Mobile OS. | [
"Detects",
"a",
"mobile",
"device",
"running",
"the",
"Ubuntu",
"Mobile",
"OS",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L883-L890 |
32,696 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectUbuntuPhone | function DetectUbuntuPhone()
{
if ((stripos($this->useragent, $this->deviceUbuntu) > -1) &&
(stripos($this->useragent, $this->mobile) > -1))
return $this->true;
return $this->false;
} | php | function DetectUbuntuPhone()
{
if ((stripos($this->useragent, $this->deviceUbuntu) > -1) &&
(stripos($this->useragent, $this->mobile) > -1))
return $this->true;
return $this->false;
} | [
"function",
"DetectUbuntuPhone",
"(",
")",
"{",
"if",
"(",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"deviceUbuntu",
")",
">",
"-",
"1",
")",
"&&",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"t... | Detects a phone running the Ubuntu Mobile OS. | [
"Detects",
"a",
"phone",
"running",
"the",
"Ubuntu",
"Mobile",
"OS",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L894-L901 |
32,697 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectUbuntuTablet | function DetectUbuntuTablet()
{
if ((stripos($this->useragent, $this->deviceUbuntu) > -1) &&
(stripos($this->useragent, $this->deviceTablet) > -1))
return $this->true;
return $this->false;
} | php | function DetectUbuntuTablet()
{
if ((stripos($this->useragent, $this->deviceUbuntu) > -1) &&
(stripos($this->useragent, $this->deviceTablet) > -1))
return $this->true;
return $this->false;
} | [
"function",
"DetectUbuntuTablet",
"(",
")",
"{",
"if",
"(",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"deviceUbuntu",
")",
">",
"-",
"1",
")",
"&&",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"... | Detects a tablet running the Ubuntu Mobile OS. | [
"Detects",
"a",
"tablet",
"running",
"the",
"Ubuntu",
"Mobile",
"OS",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L905-L912 |
32,698 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectDangerHiptop | function DetectDangerHiptop()
{
if (stripos($this->useragent, $this->deviceDanger) > -1 ||
stripos($this->useragent, $this->deviceHiptop) > -1)
return $this->true;
else
return $this->false;
} | php | function DetectDangerHiptop()
{
if (stripos($this->useragent, $this->deviceDanger) > -1 ||
stripos($this->useragent, $this->deviceHiptop) > -1)
return $this->true;
else
return $this->false;
} | [
"function",
"DetectDangerHiptop",
"(",
")",
"{",
"if",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"deviceDanger",
")",
">",
"-",
"1",
"||",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"dev... | Detects the Danger Hiptop device. | [
"Detects",
"the",
"Danger",
"Hiptop",
"device",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L916-L923 |
32,699 | ahand/mobileesp | PHP/mdetect.php | uagent_info.DetectSonyMylo | function DetectSonyMylo()
{
if ((stripos($this->useragent, $this->manuSony) > -1) &&
((stripos($this->useragent, $this->qtembedded) > -1) ||
(stripos($this->useragent, $this->mylocom2) > -1)))
return $this->true;
else
return $this->false;
} | php | function DetectSonyMylo()
{
if ((stripos($this->useragent, $this->manuSony) > -1) &&
((stripos($this->useragent, $this->qtembedded) > -1) ||
(stripos($this->useragent, $this->mylocom2) > -1)))
return $this->true;
else
return $this->false;
} | [
"function",
"DetectSonyMylo",
"(",
")",
"{",
"if",
"(",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"this",
"->",
"manuSony",
")",
">",
"-",
"1",
")",
"&&",
"(",
"(",
"stripos",
"(",
"$",
"this",
"->",
"useragent",
",",
"$",
"t... | Detects if the current browser is a Sony Mylo device. | [
"Detects",
"if",
"the",
"current",
"browser",
"is",
"a",
"Sony",
"Mylo",
"device",
"."
] | c02055dbe9baee63aab11438f4d7b5d25075d347 | https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L927-L935 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.