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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
19,400 | onigoetz/imagecache | src/Manager.php | Manager.handleRequest | public function handleRequest($preset_key, $file)
{
//do it at the beginning for early validation
$preset = $this->getPresetActions($preset_key, $file);
$source_file = $this->getOriginalFilename($file);
$original_file = $this->getOriginalFile($source_file);
$final_file = ... | php | public function handleRequest($preset_key, $file)
{
//do it at the beginning for early validation
$preset = $this->getPresetActions($preset_key, $file);
$source_file = $this->getOriginalFilename($file);
$original_file = $this->getOriginalFile($source_file);
$final_file = ... | [
"public",
"function",
"handleRequest",
"(",
"$",
"preset_key",
",",
"$",
"file",
")",
"{",
"//do it at the beginning for early validation",
"$",
"preset",
"=",
"$",
"this",
"->",
"getPresetActions",
"(",
"$",
"preset_key",
",",
"$",
"file",
")",
";",
"$",
"sou... | Take a preset and a file and return a transformed image
@param $preset_key string
@param $file string
@throws Exceptions\InvalidPresetException
@throws Exceptions\NotFoundException
@throws \RuntimeException
@return string | [
"Take",
"a",
"preset",
"and",
"a",
"file",
"and",
"return",
"a",
"transformed",
"image"
] | 8e22c11def1733819183e8296bab3c8a4ffc1d9c | https://github.com/onigoetz/imagecache/blob/8e22c11def1733819183e8296bab3c8a4ffc1d9c/src/Manager.php#L148-L170 |
19,401 | onigoetz/imagecache | src/Manager.php | Manager.verifyDirectoryExistence | protected function verifyDirectoryExistence($base, $cacheDir)
{
if (is_dir("$base/$cacheDir")) {
return;
}
$folder_path = explode('/', $cacheDir);
foreach ($folder_path as $element) {
$base .= '/' . $element;
if (!is_dir($base)) {
... | php | protected function verifyDirectoryExistence($base, $cacheDir)
{
if (is_dir("$base/$cacheDir")) {
return;
}
$folder_path = explode('/', $cacheDir);
foreach ($folder_path as $element) {
$base .= '/' . $element;
if (!is_dir($base)) {
... | [
"protected",
"function",
"verifyDirectoryExistence",
"(",
"$",
"base",
",",
"$",
"cacheDir",
")",
"{",
"if",
"(",
"is_dir",
"(",
"\"$base/$cacheDir\"",
")",
")",
"{",
"return",
";",
"}",
"$",
"folder_path",
"=",
"explode",
"(",
"'/'",
",",
"$",
"cacheDir",... | Create the folder containing the cached images if it doesn't exist
@param $base
@param $cacheDir | [
"Create",
"the",
"folder",
"containing",
"the",
"cached",
"images",
"if",
"it",
"doesn",
"t",
"exist"
] | 8e22c11def1733819183e8296bab3c8a4ffc1d9c | https://github.com/onigoetz/imagecache/blob/8e22c11def1733819183e8296bab3c8a4ffc1d9c/src/Manager.php#L178-L192 |
19,402 | onigoetz/imagecache | src/Manager.php | Manager.buildImage | protected function buildImage($actions, Image $image, $dst)
{
foreach ($actions as $action) {
// Make sure the width and height are computed first so they can be used
// in relative x/yoffsets like 'center' or 'bottom'.
if (isset($action['width'])) {
$acti... | php | protected function buildImage($actions, Image $image, $dst)
{
foreach ($actions as $action) {
// Make sure the width and height are computed first so they can be used
// in relative x/yoffsets like 'center' or 'bottom'.
if (isset($action['width'])) {
$acti... | [
"protected",
"function",
"buildImage",
"(",
"$",
"actions",
",",
"Image",
"$",
"image",
",",
"$",
"dst",
")",
"{",
"foreach",
"(",
"$",
"actions",
"as",
"$",
"action",
")",
"{",
"// Make sure the width and height are computed first so they can be used",
"// in relat... | Create a new image based on an image preset.
@param array $actions An image preset array.
@param Image $image Path of the source file.
@param string $dst Path of the destination file.
@throws \RuntimeException
@return Image | [
"Create",
"a",
"new",
"image",
"based",
"on",
"an",
"image",
"preset",
"."
] | 8e22c11def1733819183e8296bab3c8a4ffc1d9c | https://github.com/onigoetz/imagecache/blob/8e22c11def1733819183e8296bab3c8a4ffc1d9c/src/Manager.php#L208-L233 |
19,403 | onigoetz/imagecache | src/Manager.php | Manager.percent | public function percent($value, $current_pixels)
{
if (strpos($value, '%') !== false) {
$value = str_replace('%', '', $value) * 0.01 * $current_pixels;
}
return $value;
} | php | public function percent($value, $current_pixels)
{
if (strpos($value, '%') !== false) {
$value = str_replace('%', '', $value) * 0.01 * $current_pixels;
}
return $value;
} | [
"public",
"function",
"percent",
"(",
"$",
"value",
",",
"$",
"current_pixels",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"value",
",",
"'%'",
")",
"!==",
"false",
")",
"{",
"$",
"value",
"=",
"str_replace",
"(",
"'%'",
",",
"''",
",",
"$",
"value",... | Accept a percentage and return it in pixels.
@param string $value
@param int $current_pixels
@return mixed | [
"Accept",
"a",
"percentage",
"and",
"return",
"it",
"in",
"pixels",
"."
] | 8e22c11def1733819183e8296bab3c8a4ffc1d9c | https://github.com/onigoetz/imagecache/blob/8e22c11def1733819183e8296bab3c8a4ffc1d9c/src/Manager.php#L242-L249 |
19,404 | CakeCMS/Core | src/ORM/Behavior/ProcessBehavior.php | ProcessBehavior.process | public function process($name, array $ids = [])
{
$allowActions = $this->getConfig('actions');
if (!Arr::key($name, $allowActions)) {
throw new \InvalidArgumentException(__d('core', 'Invalid action to perform'));
}
$action = $allowActions[$name];
if ($action ===... | php | public function process($name, array $ids = [])
{
$allowActions = $this->getConfig('actions');
if (!Arr::key($name, $allowActions)) {
throw new \InvalidArgumentException(__d('core', 'Invalid action to perform'));
}
$action = $allowActions[$name];
if ($action ===... | [
"public",
"function",
"process",
"(",
"$",
"name",
",",
"array",
"$",
"ids",
"=",
"[",
"]",
")",
"{",
"$",
"allowActions",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"'actions'",
")",
";",
"if",
"(",
"!",
"Arr",
"::",
"key",
"(",
"$",
"name",
",",... | Process table method.
@param string $name
@param array $ids
@return mixed | [
"Process",
"table",
"method",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/ORM/Behavior/ProcessBehavior.php#L49-L67 |
19,405 | CakeCMS/Core | src/ORM/Behavior/ProcessBehavior.php | ProcessBehavior.processDelete | public function processDelete(array $ids)
{
return $this->_table->deleteAll([
$this->_table->getPrimaryKey() . ' IN (' . implode(',', $ids) . ')'
]);
} | php | public function processDelete(array $ids)
{
return $this->_table->deleteAll([
$this->_table->getPrimaryKey() . ' IN (' . implode(',', $ids) . ')'
]);
} | [
"public",
"function",
"processDelete",
"(",
"array",
"$",
"ids",
")",
"{",
"return",
"$",
"this",
"->",
"_table",
"->",
"deleteAll",
"(",
"[",
"$",
"this",
"->",
"_table",
"->",
"getPrimaryKey",
"(",
")",
".",
"' IN ('",
".",
"implode",
"(",
"','",
","... | Process delete method.
@param array $ids
@return int | [
"Process",
"delete",
"method",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/ORM/Behavior/ProcessBehavior.php#L75-L80 |
19,406 | CakeCMS/Core | src/ORM/Behavior/ProcessBehavior.php | ProcessBehavior._toggleField | protected function _toggleField(array $ids, $value = STATUS_UN_PUBLISH)
{
return $this->_table->updateAll([
$this->_configRead('field') => $value,
], [
$this->_table->getPrimaryKey() . ' IN (' . implode(',', $ids) . ')'
]);
} | php | protected function _toggleField(array $ids, $value = STATUS_UN_PUBLISH)
{
return $this->_table->updateAll([
$this->_configRead('field') => $value,
], [
$this->_table->getPrimaryKey() . ' IN (' . implode(',', $ids) . ')'
]);
} | [
"protected",
"function",
"_toggleField",
"(",
"array",
"$",
"ids",
",",
"$",
"value",
"=",
"STATUS_UN_PUBLISH",
")",
"{",
"return",
"$",
"this",
"->",
"_table",
"->",
"updateAll",
"(",
"[",
"$",
"this",
"->",
"_configRead",
"(",
"'field'",
")",
"=>",
"$"... | Toggle table field.
@param array $ids
@param int $value
@return int | [
"Toggle",
"table",
"field",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/ORM/Behavior/ProcessBehavior.php#L111-L118 |
19,407 | redaigbaria/oauth2 | src/Entity/AbstractTokenEntity.php | AbstractTokenEntity.setId | public function setId($id = null)
{
$this->id = ($id !== null) ? $id : SecureKey::generate();
return $this;
} | php | public function setId($id = null)
{
$this->id = ($id !== null) ? $id : SecureKey::generate();
return $this;
} | [
"public",
"function",
"setId",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"id",
"=",
"(",
"$",
"id",
"!==",
"null",
")",
"?",
"$",
"id",
":",
"SecureKey",
"::",
"generate",
"(",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Set token ID
@param string $id Token ID
@return self | [
"Set",
"token",
"ID"
] | 54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a | https://github.com/redaigbaria/oauth2/blob/54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a/src/Entity/AbstractTokenEntity.php#L131-L136 |
19,408 | redaigbaria/oauth2 | src/Entity/AbstractTokenEntity.php | AbstractTokenEntity.setSessionId | public function setSessionId($session_id=null)
{
$this->session_id= ($session_id!== null) ? $session_id : null;
return $this;
} | php | public function setSessionId($session_id=null)
{
$this->session_id= ($session_id!== null) ? $session_id : null;
return $this;
} | [
"public",
"function",
"setSessionId",
"(",
"$",
"session_id",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"session_id",
"=",
"(",
"$",
"session_id",
"!==",
"null",
")",
"?",
"$",
"session_id",
":",
"null",
";",
"return",
"$",
"this",
";",
"}"
] | Set the session id that this token is associated to ..
@param string $session_id Session id | [
"Set",
"the",
"session",
"id",
"that",
"this",
"token",
"is",
"associated",
"to",
".."
] | 54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a | https://github.com/redaigbaria/oauth2/blob/54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a/src/Entity/AbstractTokenEntity.php#L142-L147 |
19,409 | userfriendly/SocialUserBundle | OAuth/UserProvider.php | UserProvider.getExistingIdentity | protected function getExistingIdentity( UserResponseInterface $response )
{
$repo = $this->om->getRepository( $this->userIdentityClass ); // wrong class
return $repo->findOneBy( array(
'identifier' => $response->getUsername(),
'type' => $response->getResourceOwner()->getNam... | php | protected function getExistingIdentity( UserResponseInterface $response )
{
$repo = $this->om->getRepository( $this->userIdentityClass ); // wrong class
return $repo->findOneBy( array(
'identifier' => $response->getUsername(),
'type' => $response->getResourceOwner()->getNam... | [
"protected",
"function",
"getExistingIdentity",
"(",
"UserResponseInterface",
"$",
"response",
")",
"{",
"$",
"repo",
"=",
"$",
"this",
"->",
"om",
"->",
"getRepository",
"(",
"$",
"this",
"->",
"userIdentityClass",
")",
";",
"// wrong class",
"return",
"$",
"... | Checks whether the authenticating Identity already exists
@param \HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response
@return \Userfriendly\Bundle\SocialUserBundle\Model\UserIdentity | [
"Checks",
"whether",
"the",
"authenticating",
"Identity",
"already",
"exists"
] | 1dfcf76af2bc639901c471e6f28b04d73fb65452 | https://github.com/userfriendly/SocialUserBundle/blob/1dfcf76af2bc639901c471e6f28b04d73fb65452/OAuth/UserProvider.php#L98-L105 |
19,410 | userfriendly/SocialUserBundle | OAuth/UserProvider.php | UserProvider.createUser | protected function createUser( UserResponseInterface $response )
{
$user = $this->userManager->createUser();
$user->setUsername( $this->createUniqueUsername( $this->getRealName( $response )));
$user->setEmail( $this->getEmail( $response ) );
$user->setPassword( '' );
$user->s... | php | protected function createUser( UserResponseInterface $response )
{
$user = $this->userManager->createUser();
$user->setUsername( $this->createUniqueUsername( $this->getRealName( $response )));
$user->setEmail( $this->getEmail( $response ) );
$user->setPassword( '' );
$user->s... | [
"protected",
"function",
"createUser",
"(",
"UserResponseInterface",
"$",
"response",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"userManager",
"->",
"createUser",
"(",
")",
";",
"$",
"user",
"->",
"setUsername",
"(",
"$",
"this",
"->",
"createUniqueUser... | Creates new User
@param \HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response
@return \Userfriendly\Bundle\SocialUserBundle\Model\User | [
"Creates",
"new",
"User"
] | 1dfcf76af2bc639901c471e6f28b04d73fb65452 | https://github.com/userfriendly/SocialUserBundle/blob/1dfcf76af2bc639901c471e6f28b04d73fb65452/OAuth/UserProvider.php#L113-L123 |
19,411 | userfriendly/SocialUserBundle | OAuth/UserProvider.php | UserProvider.createIdentity | protected function createIdentity( User $user, UserResponseInterface $response )
{
$identity = new $this->userIdentityClass;
$identity->setAccessToken( $this->getAccessToken( $response ));
$identity->setIdentifier( $response->getUsername() );
$identity->setType( $response->getResourc... | php | protected function createIdentity( User $user, UserResponseInterface $response )
{
$identity = new $this->userIdentityClass;
$identity->setAccessToken( $this->getAccessToken( $response ));
$identity->setIdentifier( $response->getUsername() );
$identity->setType( $response->getResourc... | [
"protected",
"function",
"createIdentity",
"(",
"User",
"$",
"user",
",",
"UserResponseInterface",
"$",
"response",
")",
"{",
"$",
"identity",
"=",
"new",
"$",
"this",
"->",
"userIdentityClass",
";",
"$",
"identity",
"->",
"setAccessToken",
"(",
"$",
"this",
... | Creates new Identity
@param \HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response
@param \Userfriendly\Bundle\SocialUserBundle\Model\User $user
@return \Userfriendly\Bundle\SocialUserBundle\Model\UserIdentity | [
"Creates",
"new",
"Identity"
] | 1dfcf76af2bc639901c471e6f28b04d73fb65452 | https://github.com/userfriendly/SocialUserBundle/blob/1dfcf76af2bc639901c471e6f28b04d73fb65452/OAuth/UserProvider.php#L132-L144 |
19,412 | userfriendly/SocialUserBundle | OAuth/UserProvider.php | UserProvider.createUniqueUsername | protected function createUniqueUsername( $username )
{
$originalName = $username;
$existingUser = $this->userManager->findUserByUsername( $username );
$suffix = 0;
while ( $existingUser )
{
$suffix++;
$username = $originalName . $suffix;
$e... | php | protected function createUniqueUsername( $username )
{
$originalName = $username;
$existingUser = $this->userManager->findUserByUsername( $username );
$suffix = 0;
while ( $existingUser )
{
$suffix++;
$username = $originalName . $suffix;
$e... | [
"protected",
"function",
"createUniqueUsername",
"(",
"$",
"username",
")",
"{",
"$",
"originalName",
"=",
"$",
"username",
";",
"$",
"existingUser",
"=",
"$",
"this",
"->",
"userManager",
"->",
"findUserByUsername",
"(",
"$",
"username",
")",
";",
"$",
"suf... | Ensures uniqueness of username
@param string $username
@return string | [
"Ensures",
"uniqueness",
"of",
"username"
] | 1dfcf76af2bc639901c471e6f28b04d73fb65452 | https://github.com/userfriendly/SocialUserBundle/blob/1dfcf76af2bc639901c471e6f28b04d73fb65452/OAuth/UserProvider.php#L152-L164 |
19,413 | yuncms/framework | src/web/Response.php | Response.setCacheHeaders | public function setCacheHeaders()
{
$cacheTime = 31536000; // 1 year
$this->getHeaders()
->set('Expires', gmdate('D, d M Y H:i:s', time() + $cacheTime) . ' GMT')
->set('Pragma', 'cache')
->set('Cache-Control', 'max-age=' . $cacheTime);
return $this;
} | php | public function setCacheHeaders()
{
$cacheTime = 31536000; // 1 year
$this->getHeaders()
->set('Expires', gmdate('D, d M Y H:i:s', time() + $cacheTime) . ' GMT')
->set('Pragma', 'cache')
->set('Cache-Control', 'max-age=' . $cacheTime);
return $this;
} | [
"public",
"function",
"setCacheHeaders",
"(",
")",
"{",
"$",
"cacheTime",
"=",
"31536000",
";",
"// 1 year",
"$",
"this",
"->",
"getHeaders",
"(",
")",
"->",
"set",
"(",
"'Expires'",
",",
"gmdate",
"(",
"'D, d M Y H:i:s'",
",",
"time",
"(",
")",
"+",
"$"... | Sets headers that will instruct the client to cache this response.
@return static self reference | [
"Sets",
"headers",
"that",
"will",
"instruct",
"the",
"client",
"to",
"cache",
"this",
"response",
"."
] | af42e28ea4ae15ab8eead3f6d119f93863b94154 | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/web/Response.php#L63-L72 |
19,414 | yuncms/framework | src/web/Response.php | Response.setLastModifiedHeader | public function setLastModifiedHeader(string $path)
{
$modifiedTime = filemtime($path);
if ($modifiedTime) {
$this->getHeaders()->set('Last-Modified', gmdate('D, d M Y H:i:s', $modifiedTime) . ' GMT');
}
return $this;
} | php | public function setLastModifiedHeader(string $path)
{
$modifiedTime = filemtime($path);
if ($modifiedTime) {
$this->getHeaders()->set('Last-Modified', gmdate('D, d M Y H:i:s', $modifiedTime) . ' GMT');
}
return $this;
} | [
"public",
"function",
"setLastModifiedHeader",
"(",
"string",
"$",
"path",
")",
"{",
"$",
"modifiedTime",
"=",
"filemtime",
"(",
"$",
"path",
")",
";",
"if",
"(",
"$",
"modifiedTime",
")",
"{",
"$",
"this",
"->",
"getHeaders",
"(",
")",
"->",
"set",
"(... | Sets a Last-Modified header based on a given file path.
@param string $path The file to read the last modified date from.
@return static self reference | [
"Sets",
"a",
"Last",
"-",
"Modified",
"header",
"based",
"on",
"a",
"given",
"file",
"path",
"."
] | af42e28ea4ae15ab8eead3f6d119f93863b94154 | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/web/Response.php#L80-L89 |
19,415 | php-rise/rise | src/Response.php | Response.sendFile | public function sendFile($file) {
if ($this->sent) {
return $this;
}
$this->setMode(self::MODE_FILE);
$this->send($file);
return $this;
} | php | public function sendFile($file) {
if ($this->sent) {
return $this;
}
$this->setMode(self::MODE_FILE);
$this->send($file);
return $this;
} | [
"public",
"function",
"sendFile",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"sent",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"this",
"->",
"setMode",
"(",
"self",
"::",
"MODE_FILE",
")",
";",
"$",
"this",
"->",
"send",
"(",... | Send a file.
@param string $file
@return self | [
"Send",
"a",
"file",
"."
] | cd14ef9956f1b6875b7bcd642545dcef6a9152b7 | https://github.com/php-rise/rise/blob/cd14ef9956f1b6875b7bcd642545dcef6a9152b7/src/Response.php#L295-L304 |
19,416 | php-rise/rise | src/Response.php | Response.redirect | public function redirect($url, $statusCode = 302) {
$this->setStatusCode($statusCode)
->setHeader('Location', $url)
->setBody(sprintf('<!DOCTYPE html>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1;url=%1$s">
<title>Redirecting to %1$s</title>
Redirecting to <a href="%1$s">%1$s</a>', htmlspecialch... | php | public function redirect($url, $statusCode = 302) {
$this->setStatusCode($statusCode)
->setHeader('Location', $url)
->setBody(sprintf('<!DOCTYPE html>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1;url=%1$s">
<title>Redirecting to %1$s</title>
Redirecting to <a href="%1$s">%1$s</a>', htmlspecialch... | [
"public",
"function",
"redirect",
"(",
"$",
"url",
",",
"$",
"statusCode",
"=",
"302",
")",
"{",
"$",
"this",
"->",
"setStatusCode",
"(",
"$",
"statusCode",
")",
"->",
"setHeader",
"(",
"'Location'",
",",
"$",
"url",
")",
"->",
"setBody",
"(",
"sprintf... | Setup HTTP redirect.
@param string $url
@param int $statusCode Optional
@return self | [
"Setup",
"HTTP",
"redirect",
"."
] | cd14ef9956f1b6875b7bcd642545dcef6a9152b7 | https://github.com/php-rise/rise/blob/cd14ef9956f1b6875b7bcd642545dcef6a9152b7/src/Response.php#L313-L323 |
19,417 | php-rise/rise | src/Response.php | Response.redirectRoute | public function redirectRoute($name, $params = [], $statusCode = 302) {
$this->redirect($this->urlGenerator->generate($name, $params), $statusCode);
return $this;
} | php | public function redirectRoute($name, $params = [], $statusCode = 302) {
$this->redirect($this->urlGenerator->generate($name, $params), $statusCode);
return $this;
} | [
"public",
"function",
"redirectRoute",
"(",
"$",
"name",
",",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"statusCode",
"=",
"302",
")",
"{",
"$",
"this",
"->",
"redirect",
"(",
"$",
"this",
"->",
"urlGenerator",
"->",
"generate",
"(",
"$",
"name",
",",
... | HTTP redirect to a named route.
@param string $routeName
@param array $params
@param int $statusCode Optional
@return self | [
"HTTP",
"redirect",
"to",
"a",
"named",
"route",
"."
] | cd14ef9956f1b6875b7bcd642545dcef6a9152b7 | https://github.com/php-rise/rise/blob/cd14ef9956f1b6875b7bcd642545dcef6a9152b7/src/Response.php#L333-L336 |
19,418 | php-rise/rise | src/Response.php | Response.closeOutputBuffers | public static function closeOutputBuffers($targetLevel, $flush) {
$status = ob_get_status(true);
$level = count($status);
while ($level-- > $targetLevel
&& (!empty($status[$level]['del'])
|| (isset($status[$level]['flags'])
&& ($status[$level]['flags'] & PHP_OUTPUT_HANDLER_REMOVABLE)
... | php | public static function closeOutputBuffers($targetLevel, $flush) {
$status = ob_get_status(true);
$level = count($status);
while ($level-- > $targetLevel
&& (!empty($status[$level]['del'])
|| (isset($status[$level]['flags'])
&& ($status[$level]['flags'] & PHP_OUTPUT_HANDLER_REMOVABLE)
... | [
"public",
"static",
"function",
"closeOutputBuffers",
"(",
"$",
"targetLevel",
",",
"$",
"flush",
")",
"{",
"$",
"status",
"=",
"ob_get_status",
"(",
"true",
")",
";",
"$",
"level",
"=",
"count",
"(",
"$",
"status",
")",
";",
"while",
"(",
"$",
"level"... | Cleans or flushes output buffers up to target level.
@NOTE Function from Symfony\Component\HttpFoundation\Response
Resulting level can be greater than target level if a non-removable buffer has been encountered.
@param int $targetLevel The target output buffering level
@param bool $flush Whether to flush or c... | [
"Cleans",
"or",
"flushes",
"output",
"buffers",
"up",
"to",
"target",
"level",
"."
] | cd14ef9956f1b6875b7bcd642545dcef6a9152b7 | https://github.com/php-rise/rise/blob/cd14ef9956f1b6875b7bcd642545dcef6a9152b7/src/Response.php#L561-L579 |
19,419 | barebone-php/barebone-core | lib/LogTrait.php | LogTrait.log | public function log($text, $severity = 'info')
{
if ($severity === 'warn' || $severity === 'warning') {
return Log::warning($text);
}
if ($severity === 'err' || $severity === 'error') {
return Log::error($text);
}
return Log::info($text);
} | php | public function log($text, $severity = 'info')
{
if ($severity === 'warn' || $severity === 'warning') {
return Log::warning($text);
}
if ($severity === 'err' || $severity === 'error') {
return Log::error($text);
}
return Log::info($text);
} | [
"public",
"function",
"log",
"(",
"$",
"text",
",",
"$",
"severity",
"=",
"'info'",
")",
"{",
"if",
"(",
"$",
"severity",
"===",
"'warn'",
"||",
"$",
"severity",
"===",
"'warning'",
")",
"{",
"return",
"Log",
"::",
"warning",
"(",
"$",
"text",
")",
... | Write to application log
@param string $text message
@param string $severity Either 'info', 'warn' or 'error'
@return Boolean Whether the record has been processed | [
"Write",
"to",
"application",
"log"
] | 7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc | https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/LogTrait.php#L38-L49 |
19,420 | jfusion/org.jfusion.framework | src/User/Userinfo.php | Userinfo.getAnonymizeed | public function getAnonymizeed()
{
$userinfo = $this->toObject();
$userinfo->password_clear = '******';
if (isset($userinfo->password)) {
$userinfo->password = substr($userinfo->password, 0, 6) . '********';
}
if (isset($userinfo->password_salt)) {
$userinfo->password_salt = substr($userinfo->password_... | php | public function getAnonymizeed()
{
$userinfo = $this->toObject();
$userinfo->password_clear = '******';
if (isset($userinfo->password)) {
$userinfo->password = substr($userinfo->password, 0, 6) . '********';
}
if (isset($userinfo->password_salt)) {
$userinfo->password_salt = substr($userinfo->password_... | [
"public",
"function",
"getAnonymizeed",
"(",
")",
"{",
"$",
"userinfo",
"=",
"$",
"this",
"->",
"toObject",
"(",
")",
";",
"$",
"userinfo",
"->",
"password_clear",
"=",
"'******'",
";",
"if",
"(",
"isset",
"(",
"$",
"userinfo",
"->",
"password",
")",
"... | hides sensitive information
@return stdClass parsed userinfo object | [
"hides",
"sensitive",
"information"
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/User/Userinfo.php#L210-L221 |
19,421 | dburkart/scurvy | Scurvy.php | Scurvy.render | private function render() {
$strings = implode($this->strings);
// Render includes
foreach ($this->incTemplates as $path => $include) {
$incOutput = $include->render();
$path = preg_replace("/\//", "\/", $path);
$strings = preg_replace("/\{include\s$path\}/", $incOutput, $strings);
}
// Render ... | php | private function render() {
$strings = implode($this->strings);
// Render includes
foreach ($this->incTemplates as $path => $include) {
$incOutput = $include->render();
$path = preg_replace("/\//", "\/", $path);
$strings = preg_replace("/\{include\s$path\}/", $incOutput, $strings);
}
// Render ... | [
"private",
"function",
"render",
"(",
")",
"{",
"$",
"strings",
"=",
"implode",
"(",
"$",
"this",
"->",
"strings",
")",
";",
"// Render includes",
"foreach",
"(",
"$",
"this",
"->",
"incTemplates",
"as",
"$",
"path",
"=>",
"$",
"include",
")",
"{",
"$"... | The render function goes through and renders the parsed document.
@return string containing the rendered output. | [
"The",
"render",
"function",
"goes",
"through",
"and",
"renders",
"the",
"parsed",
"document",
"."
] | 990a7c4f0517298de304438cf9cd95a303a231fb | https://github.com/dburkart/scurvy/blob/990a7c4f0517298de304438cf9cd95a303a231fb/Scurvy.php#L102-L168 |
19,422 | dburkart/scurvy | Scurvy.php | Scurvy.set | private function set($var, $val) {
$this->vars[$var] = $val;
// We also need to set $var on each sub-template. So recursively do that
foreach($this->forTemplates as $templateBunch)
foreach($templateBunch as $sub)
$sub->set($var, $val);
foreach($this->ifTemplates as $templateBunch)
foreach($templat... | php | private function set($var, $val) {
$this->vars[$var] = $val;
// We also need to set $var on each sub-template. So recursively do that
foreach($this->forTemplates as $templateBunch)
foreach($templateBunch as $sub)
$sub->set($var, $val);
foreach($this->ifTemplates as $templateBunch)
foreach($templat... | [
"private",
"function",
"set",
"(",
"$",
"var",
",",
"$",
"val",
")",
"{",
"$",
"this",
"->",
"vars",
"[",
"$",
"var",
"]",
"=",
"$",
"val",
";",
"// We also need to set $var on each sub-template. So recursively do that",
"foreach",
"(",
"$",
"this",
"->",
"f... | Sets the value of a variable.
@param string $var variable to set
@param mixed $val value to set var to | [
"Sets",
"the",
"value",
"of",
"a",
"variable",
"."
] | 990a7c4f0517298de304438cf9cd95a303a231fb | https://github.com/dburkart/scurvy/blob/990a7c4f0517298de304438cf9cd95a303a231fb/Scurvy.php#L176-L190 |
19,423 | dburkart/scurvy | Scurvy.php | Scurvy.parseRecursive | private function parseRecursive($start, $regex, $subName = 'template') {
$re_beg = $regex[0];
$re_end = $regex[1];
$numLines = count($this->strings);
$i = $start;
$n = 0;
$line = 0;
for ($i; $i < $numLines; $i++) {
$match = preg_match($re_beg, $this->strings[$i]);
if ($match) $n += 1;
$match... | php | private function parseRecursive($start, $regex, $subName = 'template') {
$re_beg = $regex[0];
$re_end = $regex[1];
$numLines = count($this->strings);
$i = $start;
$n = 0;
$line = 0;
for ($i; $i < $numLines; $i++) {
$match = preg_match($re_beg, $this->strings[$i]);
if ($match) $n += 1;
$match... | [
"private",
"function",
"parseRecursive",
"(",
"$",
"start",
",",
"$",
"regex",
",",
"$",
"subName",
"=",
"'template'",
")",
"{",
"$",
"re_beg",
"=",
"$",
"regex",
"[",
"0",
"]",
";",
"$",
"re_end",
"=",
"$",
"regex",
"[",
"1",
"]",
";",
"$",
"num... | This function is used by the parse function to grab the contents of
scurvy block statements.
@param start the start index into $this->strings
@param regex the regular expression for the block statement
@param subName the name of the subTemplate (for debugging purposes)
@return a new template with the contents of the b... | [
"This",
"function",
"is",
"used",
"by",
"the",
"parse",
"function",
"to",
"grab",
"the",
"contents",
"of",
"scurvy",
"block",
"statements",
"."
] | 990a7c4f0517298de304438cf9cd95a303a231fb | https://github.com/dburkart/scurvy/blob/990a7c4f0517298de304438cf9cd95a303a231fb/Scurvy.php#L339-L389 |
19,424 | webforge-labs/psc-cms | lib/Psc/CMS/User.php | User.setPassword | public function setPassword($password) {
if (is_array($password)) {
if ($password['password'] == NULL) return $this;
$this->hashPassword($password['password']);
} else {
if ($password == NULL) return $this;
$this->password = $password;
}
return $this;
} | php | public function setPassword($password) {
if (is_array($password)) {
if ($password['password'] == NULL) return $this;
$this->hashPassword($password['password']);
} else {
if ($password == NULL) return $this;
$this->password = $password;
}
return $this;
} | [
"public",
"function",
"setPassword",
"(",
"$",
"password",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"password",
")",
")",
"{",
"if",
"(",
"$",
"password",
"[",
"'password'",
"]",
"==",
"NULL",
")",
"return",
"$",
"this",
";",
"$",
"this",
"->",
"... | Das setzt das gehashte Passwort und sollte nur intern benutzt werden
um das Passwort zu setzen hashPassword benutzen!
diese Funktion wird intern vom AbstractEntityController benutzt
der Parameter ist dann ein array mit confirmation und password
wir könnten auch im validator mit postValidation() arbeiten, aber so ist ... | [
"Das",
"setzt",
"das",
"gehashte",
"Passwort",
"und",
"sollte",
"nur",
"intern",
"benutzt",
"werden"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/User.php#L118-L127 |
19,425 | Chill-project/Main | Controller/ExportController.php | ExportController.indexAction | public function indexAction(Request $request)
{
$exportManager = $this->get('chill.main.export_manager');
$exports = $exportManager->getExports(true);
return $this->render('ChillMainBundle:Export:layout.html.twig', array(
'exports' => $exports
));
} | php | public function indexAction(Request $request)
{
$exportManager = $this->get('chill.main.export_manager');
$exports = $exportManager->getExports(true);
return $this->render('ChillMainBundle:Export:layout.html.twig', array(
'exports' => $exports
));
} | [
"public",
"function",
"indexAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"exportManager",
"=",
"$",
"this",
"->",
"get",
"(",
"'chill.main.export_manager'",
")",
";",
"$",
"exports",
"=",
"$",
"exportManager",
"->",
"getExports",
"(",
"true",
")",... | Render the list of available exports
@param Request $request
@return \Symfony\Component\HttpFoundation\Response | [
"Render",
"the",
"list",
"of",
"available",
"exports"
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/ExportController.php#L46-L55 |
19,426 | Chill-project/Main | Controller/ExportController.php | ExportController.newAction | public function newAction(Request $request, $alias)
{
// first check for ACL
$exportManager = $this->get('chill.main.export_manager');
$export = $exportManager->getExport($alias);
if ($exportManager->isGrantedForElement($export) === FALSE) {
throw $this->createAc... | php | public function newAction(Request $request, $alias)
{
// first check for ACL
$exportManager = $this->get('chill.main.export_manager');
$export = $exportManager->getExport($alias);
if ($exportManager->isGrantedForElement($export) === FALSE) {
throw $this->createAc... | [
"public",
"function",
"newAction",
"(",
"Request",
"$",
"request",
",",
"$",
"alias",
")",
"{",
"// first check for ACL",
"$",
"exportManager",
"=",
"$",
"this",
"->",
"get",
"(",
"'chill.main.export_manager'",
")",
";",
"$",
"export",
"=",
"$",
"exportManager... | handle the step to build a query for an export
This action has three steps :
1.'export', the export form. When the form is posted, the data is stored
in the session (if valid), and then a redirection is done to next step.
2. 'formatter', the formatter form. When the form is posted, the data is
stored in the session (... | [
"handle",
"the",
"step",
"to",
"build",
"a",
"query",
"for",
"an",
"export"
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/ExportController.php#L73-L100 |
19,427 | Chill-project/Main | Controller/ExportController.php | ExportController.exportFormStep | protected function exportFormStep(Request $request, $alias)
{
$exportManager = $this->get('chill.main.export_manager');
// check we have data from the previous step (export step)
$data = $this->get('session')->get('centers_step', null);
if ($data === null) {
... | php | protected function exportFormStep(Request $request, $alias)
{
$exportManager = $this->get('chill.main.export_manager');
// check we have data from the previous step (export step)
$data = $this->get('session')->get('centers_step', null);
if ($data === null) {
... | [
"protected",
"function",
"exportFormStep",
"(",
"Request",
"$",
"request",
",",
"$",
"alias",
")",
"{",
"$",
"exportManager",
"=",
"$",
"this",
"->",
"get",
"(",
"'chill.main.export_manager'",
")",
";",
"// check we have data from the previous step (export step)",
"$"... | Render the export form
When the method is POST, the form is stored if valid, and a redirection
is done to next step.
@param string $alias
@return \Symfony\Component\HttpFoundation\Response | [
"Render",
"the",
"export",
"form"
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/ExportController.php#L154-L203 |
19,428 | Chill-project/Main | Controller/ExportController.php | ExportController.createCreateFormExport | protected function createCreateFormExport($alias, $step, $data = array())
{
/* @var $exportManager \Chill\MainBundle\Export\ExportManager */
$exportManager = $this->get('chill.main.export_manager');
$isGenerate = strpos($step, 'generate_') === 0;
$builder = $this->get('form.... | php | protected function createCreateFormExport($alias, $step, $data = array())
{
/* @var $exportManager \Chill\MainBundle\Export\ExportManager */
$exportManager = $this->get('chill.main.export_manager');
$isGenerate = strpos($step, 'generate_') === 0;
$builder = $this->get('form.... | [
"protected",
"function",
"createCreateFormExport",
"(",
"$",
"alias",
",",
"$",
"step",
",",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"/* @var $exportManager \\Chill\\MainBundle\\Export\\ExportManager */",
"$",
"exportManager",
"=",
"$",
"this",
"->",
"get",
... | create a form to show on different steps.
@param string $alias
@param string $step, can either be 'export', 'formatter', 'generate_export' or 'generate_formatter' (last two are used by generate action)
@param array $data the data from previous step. Required for steps 'formatter' and 'generate_formatter'
@return \Symf... | [
"create",
"a",
"form",
"to",
"show",
"on",
"different",
"steps",
"."
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/ExportController.php#L213-L253 |
19,429 | hendrikmaus/reynaldo | src/Parser/RefractParser.php | RefractParser.iterate | private function iterate(array $content, $parent = null)
{
foreach ($content as $element) {
$this->process($element, $parent);
}
} | php | private function iterate(array $content, $parent = null)
{
foreach ($content as $element) {
$this->process($element, $parent);
}
} | [
"private",
"function",
"iterate",
"(",
"array",
"$",
"content",
",",
"$",
"parent",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"content",
"as",
"$",
"element",
")",
"{",
"$",
"this",
"->",
"process",
"(",
"$",
"element",
",",
"$",
"parent",
")",
"... | Iterate given content array and call `process` for every element inside
@param array $content
@param null|BaseElement $parent | [
"Iterate",
"given",
"content",
"array",
"and",
"call",
"process",
"for",
"every",
"element",
"inside"
] | be100f56e8f39d86d16ce9222838d20f462e8678 | https://github.com/hendrikmaus/reynaldo/blob/be100f56e8f39d86d16ce9222838d20f462e8678/src/Parser/RefractParser.php#L60-L65 |
19,430 | hendrikmaus/reynaldo | src/Parser/RefractParser.php | RefractParser.process | private function process(array $element, $parent = null)
{
$apiElement = $element['element'];
if (isset($this->elementMap[$apiElement])) {
$this->processElement(
$element,
$this->elementMap[$apiElement],
$parent
);
}
... | php | private function process(array $element, $parent = null)
{
$apiElement = $element['element'];
if (isset($this->elementMap[$apiElement])) {
$this->processElement(
$element,
$this->elementMap[$apiElement],
$parent
);
}
... | [
"private",
"function",
"process",
"(",
"array",
"$",
"element",
",",
"$",
"parent",
"=",
"null",
")",
"{",
"$",
"apiElement",
"=",
"$",
"element",
"[",
"'element'",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"elementMap",
"[",
"$",
"apiEle... | Create php classes using raw element data; called recursively
@param array $element
@param null|BaseElement $parent | [
"Create",
"php",
"classes",
"using",
"raw",
"element",
"data",
";",
"called",
"recursively"
] | be100f56e8f39d86d16ce9222838d20f462e8678 | https://github.com/hendrikmaus/reynaldo/blob/be100f56e8f39d86d16ce9222838d20f462e8678/src/Parser/RefractParser.php#L73-L89 |
19,431 | hendrikmaus/reynaldo | src/Parser/RefractParser.php | RefractParser.processElement | private function processElement(array $element, $class, BaseElement $parent, $replaceAttribute = null)
{
$apiElement = new $class($element);
if (!$replaceAttribute) {
$parent->addContentElement($apiElement);
} else {
$parent->replaceAttributeWithElement($replaceAttri... | php | private function processElement(array $element, $class, BaseElement $parent, $replaceAttribute = null)
{
$apiElement = new $class($element);
if (!$replaceAttribute) {
$parent->addContentElement($apiElement);
} else {
$parent->replaceAttributeWithElement($replaceAttri... | [
"private",
"function",
"processElement",
"(",
"array",
"$",
"element",
",",
"$",
"class",
",",
"BaseElement",
"$",
"parent",
",",
"$",
"replaceAttribute",
"=",
"null",
")",
"{",
"$",
"apiElement",
"=",
"new",
"$",
"class",
"(",
"$",
"element",
")",
";",
... | Create new element from raw data and add it to its parent
@param array $element Raw element data
@param string $class FQCN to use for creating an element
@param BaseElement $parent parent element to add the newly created one to
@param null|string $replaceAttribute usually, the new element will be added to the content
... | [
"Create",
"new",
"element",
"from",
"raw",
"data",
"and",
"add",
"it",
"to",
"its",
"parent"
] | be100f56e8f39d86d16ce9222838d20f462e8678 | https://github.com/hendrikmaus/reynaldo/blob/be100f56e8f39d86d16ce9222838d20f462e8678/src/Parser/RefractParser.php#L103-L137 |
19,432 | hendrikmaus/reynaldo | src/Parser/RefractParser.php | RefractParser.processCategory | private function processCategory(array $element, $parent = null)
{
if ($this->isMasterCategory($element)) {
$this->createCategory($element, MasterCategoryElement::class, $this->parseResult);
}
if ($this->isResourceGroup($element)) {
$this->createCategory($element, Re... | php | private function processCategory(array $element, $parent = null)
{
if ($this->isMasterCategory($element)) {
$this->createCategory($element, MasterCategoryElement::class, $this->parseResult);
}
if ($this->isResourceGroup($element)) {
$this->createCategory($element, Re... | [
"private",
"function",
"processCategory",
"(",
"array",
"$",
"element",
",",
"$",
"parent",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isMasterCategory",
"(",
"$",
"element",
")",
")",
"{",
"$",
"this",
"->",
"createCategory",
"(",
"$",
"ele... | Helper to create different php classes from element `category` which carries its actual meaning in its classes
@param array $element
@param null|BaseElement $parent | [
"Helper",
"to",
"create",
"different",
"php",
"classes",
"from",
"element",
"category",
"which",
"carries",
"its",
"actual",
"meaning",
"in",
"its",
"classes"
] | be100f56e8f39d86d16ce9222838d20f462e8678 | https://github.com/hendrikmaus/reynaldo/blob/be100f56e8f39d86d16ce9222838d20f462e8678/src/Parser/RefractParser.php#L145-L158 |
19,433 | hendrikmaus/reynaldo | src/Parser/RefractParser.php | RefractParser.createCategory | private function createCategory(array $element, $className, BaseElement $parent)
{
$newElement = new $className($element);
$parent->addContentElement($newElement);
$this->iterate($element['content'], $newElement);
} | php | private function createCategory(array $element, $className, BaseElement $parent)
{
$newElement = new $className($element);
$parent->addContentElement($newElement);
$this->iterate($element['content'], $newElement);
} | [
"private",
"function",
"createCategory",
"(",
"array",
"$",
"element",
",",
"$",
"className",
",",
"BaseElement",
"$",
"parent",
")",
"{",
"$",
"newElement",
"=",
"new",
"$",
"className",
"(",
"$",
"element",
")",
";",
"$",
"parent",
"->",
"addContentEleme... | Sub-helper for `processCategory`
@param array $element
@param string $className
@param BaseElement $parent | [
"Sub",
"-",
"helper",
"for",
"processCategory"
] | be100f56e8f39d86d16ce9222838d20f462e8678 | https://github.com/hendrikmaus/reynaldo/blob/be100f56e8f39d86d16ce9222838d20f462e8678/src/Parser/RefractParser.php#L190-L195 |
19,434 | simple-php-mvc/simple-php-mvc | src/MVC/Controller/Controller.php | Controller.call | final public function call(MVC $mvc, $method, $fileView = null)
{
if (!method_exists($this, $method)) {
throw new \LogicException(sprintf('Method "s" don\'t exists.', $method));
}
# Replace the view object
$this->view = $mvc->view();
# Arguments of method
... | php | final public function call(MVC $mvc, $method, $fileView = null)
{
if (!method_exists($this, $method)) {
throw new \LogicException(sprintf('Method "s" don\'t exists.', $method));
}
# Replace the view object
$this->view = $mvc->view();
# Arguments of method
... | [
"final",
"public",
"function",
"call",
"(",
"MVC",
"$",
"mvc",
",",
"$",
"method",
",",
"$",
"fileView",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"this",
",",
"$",
"method",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicExcept... | Call a action of controller
@access public
@param MVC $mvc MVC Application object
@param string $method Method or Function of the Class Controller
@param string $fileView String of the view file
@return array Response array
@throws \LogicException | [
"Call",
"a",
"action",
"of",
"controller"
] | e319eb09d29afad6993acb4a7e35f32a87dd0841 | https://github.com/simple-php-mvc/simple-php-mvc/blob/e319eb09d29afad6993acb4a7e35f32a87dd0841/src/MVC/Controller/Controller.php#L56-L110 |
19,435 | simple-php-mvc/simple-php-mvc | src/MVC/Controller/Controller.php | Controller.renderJson | public function renderJson($value)
{
$options = JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP;
return json_encode($value, $options);
} | php | public function renderJson($value)
{
$options = JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP;
return json_encode($value, $options);
} | [
"public",
"function",
"renderJson",
"(",
"$",
"value",
")",
"{",
"$",
"options",
"=",
"JSON_HEX_TAG",
"|",
"JSON_HEX_APOS",
"|",
"JSON_HEX_QUOT",
"|",
"JSON_HEX_AMP",
";",
"return",
"json_encode",
"(",
"$",
"value",
",",
"$",
"options",
")",
";",
"}"
] | Converts the supplied value to JSON.
@access public
@param mixed $value The value to encode.
@return string | [
"Converts",
"the",
"supplied",
"value",
"to",
"JSON",
"."
] | e319eb09d29afad6993acb4a7e35f32a87dd0841 | https://github.com/simple-php-mvc/simple-php-mvc/blob/e319eb09d29afad6993acb4a7e35f32a87dd0841/src/MVC/Controller/Controller.php#L128-L132 |
19,436 | Craftsware/scissor | src/Lib/Time.php | Time.offset | public function offset($timezone)
{
$timeOffset = (new \DateTimeZone($timezone))->getOffset(new \DateTime('now', new \DateTimeZone('UTC')));
if($timeOffset < 0) {
return 'UTC -'. gmdate('H:i', -$timeOffset);
} else {
return 'UTC +'. gmdate('H:i', $timeOffset);
... | php | public function offset($timezone)
{
$timeOffset = (new \DateTimeZone($timezone))->getOffset(new \DateTime('now', new \DateTimeZone('UTC')));
if($timeOffset < 0) {
return 'UTC -'. gmdate('H:i', -$timeOffset);
} else {
return 'UTC +'. gmdate('H:i', $timeOffset);
... | [
"public",
"function",
"offset",
"(",
"$",
"timezone",
")",
"{",
"$",
"timeOffset",
"=",
"(",
"new",
"\\",
"DateTimeZone",
"(",
"$",
"timezone",
")",
")",
"->",
"getOffset",
"(",
"new",
"\\",
"DateTime",
"(",
"'now'",
",",
"new",
"\\",
"DateTimeZone",
"... | Get Time Offset | [
"Get",
"Time",
"Offset"
] | 644e4a8ea9859fc30fee36705e54784acd8d43e2 | https://github.com/Craftsware/scissor/blob/644e4a8ea9859fc30fee36705e54784acd8d43e2/src/Lib/Time.php#L52-L64 |
19,437 | Craftsware/scissor | src/Lib/Time.php | Time.datetime | public function datetime($datetime, $timezone = null, $format = 'M/d/Y - h:i:s A')
{
$datetime = new \DateTime($datetime);
if($timezone) {
$datetime->setTimezone(new \DateTimeZone($timezone));
}
return $datetime->format($format);
} | php | public function datetime($datetime, $timezone = null, $format = 'M/d/Y - h:i:s A')
{
$datetime = new \DateTime($datetime);
if($timezone) {
$datetime->setTimezone(new \DateTimeZone($timezone));
}
return $datetime->format($format);
} | [
"public",
"function",
"datetime",
"(",
"$",
"datetime",
",",
"$",
"timezone",
"=",
"null",
",",
"$",
"format",
"=",
"'M/d/Y - h:i:s A'",
")",
"{",
"$",
"datetime",
"=",
"new",
"\\",
"DateTime",
"(",
"$",
"datetime",
")",
";",
"if",
"(",
"$",
"timezone"... | Set Date and Time | [
"Set",
"Date",
"and",
"Time"
] | 644e4a8ea9859fc30fee36705e54784acd8d43e2 | https://github.com/Craftsware/scissor/blob/644e4a8ea9859fc30fee36705e54784acd8d43e2/src/Lib/Time.php#L70-L80 |
19,438 | webforge-labs/psc-cms | lib/Psc/System/Deploy/Deployer.php | Deployer.createTask | public function createTask($name) {
$this->init();
$class = Code::expandNamespace(\Webforge\Common\String::expand($name, 'Task'), 'Psc\System\Deploy');
$gClass = GClass::factory($class);
$params = array();
if ($gClass->hasMethod('__construct')) {
$constructor = $gClass->getMethod('__const... | php | public function createTask($name) {
$this->init();
$class = Code::expandNamespace(\Webforge\Common\String::expand($name, 'Task'), 'Psc\System\Deploy');
$gClass = GClass::factory($class);
$params = array();
if ($gClass->hasMethod('__construct')) {
$constructor = $gClass->getMethod('__const... | [
"public",
"function",
"createTask",
"(",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"init",
"(",
")",
";",
"$",
"class",
"=",
"Code",
"::",
"expandNamespace",
"(",
"\\",
"Webforge",
"\\",
"Common",
"\\",
"String",
"::",
"expand",
"(",
"$",
"name",
","... | wird automatisch mit dependencies erstellt
@param string $name der Name des Tasks ohne Namespace und "Task" dahinter | [
"wird",
"automatisch",
"mit",
"dependencies",
"erstellt"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/System/Deploy/Deployer.php#L130-L144 |
19,439 | timiki/rpc-common | src/JsonRequest.php | JsonRequest.setResponse | public function setResponse(JsonResponse $response)
{
$this->response = $response;
if (!$response->getRequest()) {
$response->setRequest($this);
}
return $this;
} | php | public function setResponse(JsonResponse $response)
{
$this->response = $response;
if (!$response->getRequest()) {
$response->setRequest($this);
}
return $this;
} | [
"public",
"function",
"setResponse",
"(",
"JsonResponse",
"$",
"response",
")",
"{",
"$",
"this",
"->",
"response",
"=",
"$",
"response",
";",
"if",
"(",
"!",
"$",
"response",
"->",
"getRequest",
"(",
")",
")",
"{",
"$",
"response",
"->",
"setRequest",
... | Set response.
@param JsonResponse $response
@return $this | [
"Set",
"response",
"."
] | a20e8bc92b16aa3686c4405bf5182123a5cfc750 | https://github.com/timiki/rpc-common/blob/a20e8bc92b16aa3686c4405bf5182123a5cfc750/src/JsonRequest.php#L116-L125 |
19,440 | timiki/rpc-common | src/JsonRequest.php | JsonRequest.isValid | public function isValid()
{
if (empty($this->jsonrpc)) {
return false;
}
if (empty($this->method) || !is_string($this->method)) {
return false;
}
if (!empty($this->params) && !is_array($this->params)) {
return false;
}
re... | php | public function isValid()
{
if (empty($this->jsonrpc)) {
return false;
}
if (empty($this->method) || !is_string($this->method)) {
return false;
}
if (!empty($this->params) && !is_array($this->params)) {
return false;
}
re... | [
"public",
"function",
"isValid",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"jsonrpc",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"method",
")",
"||",
"!",
"is_string",
"(",
"$",
"this"... | Is valid.
@return boolean | [
"Is",
"valid",
"."
] | a20e8bc92b16aa3686c4405bf5182123a5cfc750 | https://github.com/timiki/rpc-common/blob/a20e8bc92b16aa3686c4405bf5182123a5cfc750/src/JsonRequest.php#L132-L147 |
19,441 | timiki/rpc-common | src/JsonRequest.php | JsonRequest.toArray | public function toArray()
{
$json = [];
$json['jsonrpc'] = $this->jsonrpc;
if ($this->method) {
$json['method'] = $this->method;
}
$json['method'] = $this->method;
if ($this->params) {
$json['params'] = $this->params;
}
... | php | public function toArray()
{
$json = [];
$json['jsonrpc'] = $this->jsonrpc;
if ($this->method) {
$json['method'] = $this->method;
}
$json['method'] = $this->method;
if ($this->params) {
$json['params'] = $this->params;
}
... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"json",
"=",
"[",
"]",
";",
"$",
"json",
"[",
"'jsonrpc'",
"]",
"=",
"$",
"this",
"->",
"jsonrpc",
";",
"if",
"(",
"$",
"this",
"->",
"method",
")",
"{",
"$",
"json",
"[",
"'method'",
"]",
"=... | Convert JsonRequest to json string.
@return array | [
"Convert",
"JsonRequest",
"to",
"json",
"string",
"."
] | a20e8bc92b16aa3686c4405bf5182123a5cfc750 | https://github.com/timiki/rpc-common/blob/a20e8bc92b16aa3686c4405bf5182123a5cfc750/src/JsonRequest.php#L166-L186 |
19,442 | ARCANEDEV/Sanitizer | src/Filters/EmailFilter.php | EmailFilter.filter | public function filter($value, array $options = [])
{
return is_string($value)
? filter_var(Str::lower(trim($value)), FILTER_SANITIZE_EMAIL)
: $value;
} | php | public function filter($value, array $options = [])
{
return is_string($value)
? filter_var(Str::lower(trim($value)), FILTER_SANITIZE_EMAIL)
: $value;
} | [
"public",
"function",
"filter",
"(",
"$",
"value",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"is_string",
"(",
"$",
"value",
")",
"?",
"filter_var",
"(",
"Str",
"::",
"lower",
"(",
"trim",
"(",
"$",
"value",
")",
")",
",",
... | Sanitize email of the given string.
@param mixed $value
@param array $options
@return string|mixed | [
"Sanitize",
"email",
"of",
"the",
"given",
"string",
"."
] | e21990ce6d881366d52a7f4e5040b07cc3ecca96 | https://github.com/ARCANEDEV/Sanitizer/blob/e21990ce6d881366d52a7f4e5040b07cc3ecca96/src/Filters/EmailFilter.php#L26-L31 |
19,443 | hackzilla/ticket-message | Manager/TicketManager.php | TicketManager.createMessage | public function createMessage(TicketInterface $ticket = null)
{
/* @var TicketMessageInterface $message */
$message = new $this->ticketMessageClass();
if ($ticket) {
$message->setPriority($ticket->getPriority());
$message->setStatus($ticket->getStatus());
... | php | public function createMessage(TicketInterface $ticket = null)
{
/* @var TicketMessageInterface $message */
$message = new $this->ticketMessageClass();
if ($ticket) {
$message->setPriority($ticket->getPriority());
$message->setStatus($ticket->getStatus());
... | [
"public",
"function",
"createMessage",
"(",
"TicketInterface",
"$",
"ticket",
"=",
"null",
")",
"{",
"/* @var TicketMessageInterface $message */",
"$",
"message",
"=",
"new",
"$",
"this",
"->",
"ticketMessageClass",
"(",
")",
";",
"if",
"(",
"$",
"ticket",
")",
... | Create a new instance of TicketMessage Entity.
@param TicketInterface $ticket
@return TicketMessageInterface | [
"Create",
"a",
"new",
"instance",
"of",
"TicketMessage",
"Entity",
"."
] | 043950aa95f322cfaae145ce3c7781a4b0618a18 | https://github.com/hackzilla/ticket-message/blob/043950aa95f322cfaae145ce3c7781a4b0618a18/Manager/TicketManager.php#L124-L138 |
19,444 | kattsoftware/phassets | src/Phassets/Deployers/FilesystemDeployer.php | FilesystemDeployer.isPreviouslyDeployed | public function isPreviouslyDeployed(Asset $asset)
{
// Is there any previous deployed version?
$outputBasename = $this->computeOutputBasename($asset);
$file = $this->destinationPath . DIRECTORY_SEPARATOR . $outputBasename;
if (is_file($file)) {
$objectUrl = $this->baseU... | php | public function isPreviouslyDeployed(Asset $asset)
{
// Is there any previous deployed version?
$outputBasename = $this->computeOutputBasename($asset);
$file = $this->destinationPath . DIRECTORY_SEPARATOR . $outputBasename;
if (is_file($file)) {
$objectUrl = $this->baseU... | [
"public",
"function",
"isPreviouslyDeployed",
"(",
"Asset",
"$",
"asset",
")",
"{",
"// Is there any previous deployed version?",
"$",
"outputBasename",
"=",
"$",
"this",
"->",
"computeOutputBasename",
"(",
"$",
"asset",
")",
";",
"$",
"file",
"=",
"$",
"this",
... | Attempt to retrieve a previously deployed asset; if it does exist,
then update the Asset instance's outputUrl property, without performing
any further filters' actions.
fullPath and outputExtension are set at this point in the Asset instance.
@param Asset $asset
@return bool Whether the Asset was previously deployed o... | [
"Attempt",
"to",
"retrieve",
"a",
"previously",
"deployed",
"asset",
";",
"if",
"it",
"does",
"exist",
"then",
"update",
"the",
"Asset",
"instance",
"s",
"outputUrl",
"property",
"without",
"performing",
"any",
"further",
"filters",
"actions",
".",
"fullPath",
... | cc982cf1941eb5776287d64f027218bd4835ed2b | https://github.com/kattsoftware/phassets/blob/cc982cf1941eb5776287d64f027218bd4835ed2b/src/Phassets/Deployers/FilesystemDeployer.php#L59-L73 |
19,445 | kattsoftware/phassets | src/Phassets/Deployers/FilesystemDeployer.php | FilesystemDeployer.deploy | public function deploy(Asset $asset)
{
$outputBasename = $this->computeOutputBasename($asset);
$fullPath = $this->destinationPath . DIRECTORY_SEPARATOR . $outputBasename;
$saving = file_put_contents($fullPath, $asset->getContents());
if($saving === false) {
throw new Ph... | php | public function deploy(Asset $asset)
{
$outputBasename = $this->computeOutputBasename($asset);
$fullPath = $this->destinationPath . DIRECTORY_SEPARATOR . $outputBasename;
$saving = file_put_contents($fullPath, $asset->getContents());
if($saving === false) {
throw new Ph... | [
"public",
"function",
"deploy",
"(",
"Asset",
"$",
"asset",
")",
"{",
"$",
"outputBasename",
"=",
"$",
"this",
"->",
"computeOutputBasename",
"(",
"$",
"asset",
")",
";",
"$",
"fullPath",
"=",
"$",
"this",
"->",
"destinationPath",
".",
"DIRECTORY_SEPARATOR",... | Given an Asset instance, try to deploy is using internal
rules of this deployer and update Asset's property outputUrl.
@param Asset $asset Asset instance whose outputUrl property will be modified
@throws PhassetsInternalException If the deployment process fails | [
"Given",
"an",
"Asset",
"instance",
"try",
"to",
"deploy",
"is",
"using",
"internal",
"rules",
"of",
"this",
"deployer",
"and",
"update",
"Asset",
"s",
"property",
"outputUrl",
"."
] | cc982cf1941eb5776287d64f027218bd4835ed2b | https://github.com/kattsoftware/phassets/blob/cc982cf1941eb5776287d64f027218bd4835ed2b/src/Phassets/Deployers/FilesystemDeployer.php#L82-L99 |
19,446 | kattsoftware/phassets | src/Phassets/Deployers/FilesystemDeployer.php | FilesystemDeployer.isSupported | public function isSupported()
{
$this->destinationPath = $this->configurator->getConfig('filesystem_deployer', 'destination_path');
$this->baseUrl = $this->configurator->getConfig('filesystem_deployer', 'base_url');
$this->trigger = $this->configurator->getConfig('filesystem_deployer', 'chan... | php | public function isSupported()
{
$this->destinationPath = $this->configurator->getConfig('filesystem_deployer', 'destination_path');
$this->baseUrl = $this->configurator->getConfig('filesystem_deployer', 'base_url');
$this->trigger = $this->configurator->getConfig('filesystem_deployer', 'chan... | [
"public",
"function",
"isSupported",
"(",
")",
"{",
"$",
"this",
"->",
"destinationPath",
"=",
"$",
"this",
"->",
"configurator",
"->",
"getConfig",
"(",
"'filesystem_deployer'",
",",
"'destination_path'",
")",
";",
"$",
"this",
"->",
"baseUrl",
"=",
"$",
"t... | This must throw a PhassetsInternalException if the current configuration
doesn't allow this deployer to deploy processed assets.
@throws PhassetsInternalException If at this time Phassets can't use this deployer to
deploy and serve deployed assets | [
"This",
"must",
"throw",
"a",
"PhassetsInternalException",
"if",
"the",
"current",
"configuration",
"doesn",
"t",
"allow",
"this",
"deployer",
"to",
"deploy",
"processed",
"assets",
"."
] | cc982cf1941eb5776287d64f027218bd4835ed2b | https://github.com/kattsoftware/phassets/blob/cc982cf1941eb5776287d64f027218bd4835ed2b/src/Phassets/Deployers/FilesystemDeployer.php#L108-L123 |
19,447 | CakeCMS/Core | src/Less/Less.php | Less.compile | public function compile($lessFile, $basePath = null)
{
try {
$basePath = $this->_prepareBasepath($basePath, dirname($lessFile));
$cache = new Cache($this->_options);
$cache->setFile($lessFile, $basePath);
$isExpired = $cache->isExpired();
$isForc... | php | public function compile($lessFile, $basePath = null)
{
try {
$basePath = $this->_prepareBasepath($basePath, dirname($lessFile));
$cache = new Cache($this->_options);
$cache->setFile($lessFile, $basePath);
$isExpired = $cache->isExpired();
$isForc... | [
"public",
"function",
"compile",
"(",
"$",
"lessFile",
",",
"$",
"basePath",
"=",
"null",
")",
"{",
"try",
"{",
"$",
"basePath",
"=",
"$",
"this",
"->",
"_prepareBasepath",
"(",
"$",
"basePath",
",",
"dirname",
"(",
"$",
"lessFile",
")",
")",
";",
"$... | Compile less file.
@param string $lessFile
@param null|string $basePath
@return array
@throws Exception | [
"Compile",
"less",
"file",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Less/Less.php#L38-L63 |
19,448 | fubhy/graphql-php | src/Executor/Values.php | Values.getVariableValues | public static function getVariableValues(Schema $schema, array $asts, array $inputs)
{
$values = [];
foreach ($asts as $ast) {
$variable = $ast->get('variable')->get('name')->get('value');
$values[$variable] = self::getvariableValue($schema, $ast, isset($inputs[$variable]) ? ... | php | public static function getVariableValues(Schema $schema, array $asts, array $inputs)
{
$values = [];
foreach ($asts as $ast) {
$variable = $ast->get('variable')->get('name')->get('value');
$values[$variable] = self::getvariableValue($schema, $ast, isset($inputs[$variable]) ? ... | [
"public",
"static",
"function",
"getVariableValues",
"(",
"Schema",
"$",
"schema",
",",
"array",
"$",
"asts",
",",
"array",
"$",
"inputs",
")",
"{",
"$",
"values",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"asts",
"as",
"$",
"ast",
")",
"{",
"$",
"v... | Prepares an object map of variables of the correct type based on the
provided variable definitions and arbitrary input. If the input cannot be
coerced to match the variable definitions, a Error will be thrown.
@param Schema $schema
@param array $asts
@param array $inputs
@return array
@throws \Exception | [
"Prepares",
"an",
"object",
"map",
"of",
"variables",
"of",
"the",
"correct",
"type",
"based",
"on",
"the",
"provided",
"variable",
"definitions",
"and",
"arbitrary",
"input",
".",
"If",
"the",
"input",
"cannot",
"be",
"coerced",
"to",
"match",
"the",
"varia... | c1de2233c731ca29e5c5db4c43f3b9db36478c83 | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Values.php#L33-L41 |
19,449 | fubhy/graphql-php | src/Executor/Values.php | Values.getVariableValue | protected static function getVariableValue(Schema $schema, VariableDefinition $definition, $input)
{
$type = TypeInfo::typeFromAST($schema, $definition->get('type'));
if (!$type) {
return NULL;
}
if (self::isValidValue($type, $input)) {
if (!isset($input)) {
... | php | protected static function getVariableValue(Schema $schema, VariableDefinition $definition, $input)
{
$type = TypeInfo::typeFromAST($schema, $definition->get('type'));
if (!$type) {
return NULL;
}
if (self::isValidValue($type, $input)) {
if (!isset($input)) {
... | [
"protected",
"static",
"function",
"getVariableValue",
"(",
"Schema",
"$",
"schema",
",",
"VariableDefinition",
"$",
"definition",
",",
"$",
"input",
")",
"{",
"$",
"type",
"=",
"TypeInfo",
"::",
"typeFromAST",
"(",
"$",
"schema",
",",
"$",
"definition",
"->... | Given a variable definition, and any value of input, return a value which
adheres to the variable definition, or throw an error.
@param Schema $schema
@param VariableDefinition $definition
@param $input
@return array|mixed|null|string
@throws \Exception | [
"Given",
"a",
"variable",
"definition",
"and",
"any",
"value",
"of",
"input",
"return",
"a",
"value",
"which",
"adheres",
"to",
"the",
"variable",
"definition",
"or",
"throw",
"an",
"error",
"."
] | c1de2233c731ca29e5c5db4c43f3b9db36478c83 | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Values.php#L112-L133 |
19,450 | fubhy/graphql-php | src/Executor/Values.php | Values.isValidValue | protected static function isValidValue(TypeInterface $type, $value)
{
if ($type instanceof NonNullModifier) {
if (NULL === $value) {
return FALSE;
}
return self::isValidValue($type->getWrappedType(), $value);
}
if ($value === NULL) {
... | php | protected static function isValidValue(TypeInterface $type, $value)
{
if ($type instanceof NonNullModifier) {
if (NULL === $value) {
return FALSE;
}
return self::isValidValue($type->getWrappedType(), $value);
}
if ($value === NULL) {
... | [
"protected",
"static",
"function",
"isValidValue",
"(",
"TypeInterface",
"$",
"type",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"type",
"instanceof",
"NonNullModifier",
")",
"{",
"if",
"(",
"NULL",
"===",
"$",
"value",
")",
"{",
"return",
"FALSE",
";"... | Given a type and any value, return true if that value is valid.
@param TypeInterface $type
@param $value
@return bool | [
"Given",
"a",
"type",
"and",
"any",
"value",
"return",
"true",
"if",
"that",
"value",
"is",
"valid",
"."
] | c1de2233c731ca29e5c5db4c43f3b9db36478c83 | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Values.php#L143-L188 |
19,451 | fubhy/graphql-php | src/Executor/Values.php | Values.coerceValue | protected static function coerceValue(TypeInterface $type, $value)
{
if ($type instanceof NonNullModifier) {
// Note: we're not checking that the result of coerceValue is non-null.
// We only call this function after calling isValidValue.
return self::coerceValue($type->g... | php | protected static function coerceValue(TypeInterface $type, $value)
{
if ($type instanceof NonNullModifier) {
// Note: we're not checking that the result of coerceValue is non-null.
// We only call this function after calling isValidValue.
return self::coerceValue($type->g... | [
"protected",
"static",
"function",
"coerceValue",
"(",
"TypeInterface",
"$",
"type",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"type",
"instanceof",
"NonNullModifier",
")",
"{",
"// Note: we're not checking that the result of coerceValue is non-null.",
"// We only call... | Given a type and any value, return a runtime value coerced to match the
type.
@param TypeInterface $type
@param $value
@return array|mixed|null|string | [
"Given",
"a",
"type",
"and",
"any",
"value",
"return",
"a",
"runtime",
"value",
"coerced",
"to",
"match",
"the",
"type",
"."
] | c1de2233c731ca29e5c5db4c43f3b9db36478c83 | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Values.php#L199-L241 |
19,452 | fubhy/graphql-php | src/Executor/Values.php | Values.coerceValueAST | protected static function coerceValueAST(TypeInterface $type, $ast, $variables = NULL)
{
if ($type instanceof NonNullModifier) {
// Note: we're not checking that the result of coerceValueAST is non-null.
// We're assuming that this query has been validated and the value used
... | php | protected static function coerceValueAST(TypeInterface $type, $ast, $variables = NULL)
{
if ($type instanceof NonNullModifier) {
// Note: we're not checking that the result of coerceValueAST is non-null.
// We're assuming that this query has been validated and the value used
... | [
"protected",
"static",
"function",
"coerceValueAST",
"(",
"TypeInterface",
"$",
"type",
",",
"$",
"ast",
",",
"$",
"variables",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"type",
"instanceof",
"NonNullModifier",
")",
"{",
"// Note: we're not checking that the result o... | Given a type and a value AST node known to match this type, build a
runtime value.
@param TypeInterface $type
@param $ast
@param null $variables
@return array|mixed|null|string | [
"Given",
"a",
"type",
"and",
"a",
"value",
"AST",
"node",
"known",
"to",
"match",
"this",
"type",
"build",
"a",
"runtime",
"value",
"."
] | c1de2233c731ca29e5c5db4c43f3b9db36478c83 | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Values.php#L253-L325 |
19,453 | lootils/archiver | src/Lootils/Archiver/ZipArchive.php | ZipArchive.close | public function close()
{
if (isset($this->zip)) {
$this->zip->close();
$this->zip = null;
}
} | php | public function close()
{
if (isset($this->zip)) {
$this->zip->close();
$this->zip = null;
}
} | [
"public",
"function",
"close",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"zip",
")",
")",
"{",
"$",
"this",
"->",
"zip",
"->",
"close",
"(",
")",
";",
"$",
"this",
"->",
"zip",
"=",
"null",
";",
"}",
"}"
] | Release the zip resource. | [
"Release",
"the",
"zip",
"resource",
"."
] | 5b801bddfe15f7378a118c4094f04b37abb5a53e | https://github.com/lootils/archiver/blob/5b801bddfe15f7378a118c4094f04b37abb5a53e/src/Lootils/Archiver/ZipArchive.php#L105-L111 |
19,454 | teneleven/GeolocatorBundle | DependencyInjection/TenelevenGeolocatorExtension.php | TenelevenGeolocatorExtension.prepend | public function prepend(ContainerBuilder $container)
{
$configs = array(
'bazinga_geocoder' => array(
'providers' => array('google_maps' => null)
),
// 'ivory_google_map' => array(
// 'map' => array('width' => "100%", 'height' => "600px"),
//... | php | public function prepend(ContainerBuilder $container)
{
$configs = array(
'bazinga_geocoder' => array(
'providers' => array('google_maps' => null)
),
// 'ivory_google_map' => array(
// 'map' => array('width' => "100%", 'height' => "600px"),
//... | [
"public",
"function",
"prepend",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"configs",
"=",
"array",
"(",
"'bazinga_geocoder'",
"=>",
"array",
"(",
"'providers'",
"=>",
"array",
"(",
"'google_maps'",
"=>",
"null",
")",
")",
",",
"// '... | Configure sensitive defaults for other bundles
@param ContainerBuilder $container | [
"Configure",
"sensitive",
"defaults",
"for",
"other",
"bundles"
] | 4ead8e783a91577f2a67aa302b79641d4b9e99ad | https://github.com/teneleven/GeolocatorBundle/blob/4ead8e783a91577f2a67aa302b79641d4b9e99ad/DependencyInjection/TenelevenGeolocatorExtension.php#L80-L104 |
19,455 | slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseApiLogQuery.php | BaseApiLogQuery.create | public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof ApiLogQuery) {
return $criteria;
}
$query = new ApiLogQuery(null, null, $modelAlias);
if ($criteria instanceof Criteria) {
$query->mergeWith($criteria);
}
... | php | public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof ApiLogQuery) {
return $criteria;
}
$query = new ApiLogQuery(null, null, $modelAlias);
if ($criteria instanceof Criteria) {
$query->mergeWith($criteria);
}
... | [
"public",
"static",
"function",
"create",
"(",
"$",
"modelAlias",
"=",
"null",
",",
"$",
"criteria",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"criteria",
"instanceof",
"ApiLogQuery",
")",
"{",
"return",
"$",
"criteria",
";",
"}",
"$",
"query",
"=",
"new"... | Returns a new ApiLogQuery object.
@param string $modelAlias The alias of a model in the query
@param ApiLogQuery|Criteria $criteria Optional Criteria to build the query from
@return ApiLogQuery | [
"Returns",
"a",
"new",
"ApiLogQuery",
"object",
"."
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseApiLogQuery.php#L83-L95 |
19,456 | slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseApiLogQuery.php | BaseApiLogQuery.filterByDtCall | public function filterByDtCall($dtCall = null, $comparison = null)
{
if (is_array($dtCall)) {
$useMinMax = false;
if (isset($dtCall['min'])) {
$this->addUsingAlias(ApiLogPeer::DT_CALL, $dtCall['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
... | php | public function filterByDtCall($dtCall = null, $comparison = null)
{
if (is_array($dtCall)) {
$useMinMax = false;
if (isset($dtCall['min'])) {
$this->addUsingAlias(ApiLogPeer::DT_CALL, $dtCall['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
... | [
"public",
"function",
"filterByDtCall",
"(",
"$",
"dtCall",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"dtCall",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",
"dt... | Filter the query on the dt_call column
Example usage:
<code>
$query->filterByDtCall('2011-03-14'); // WHERE dt_call = '2011-03-14'
$query->filterByDtCall('now'); // WHERE dt_call = '2011-03-14'
$query->filterByDtCall(array('max' => 'yesterday')); // WHERE dt_call < '2011-03-13'
</code>
@param mixed $dtCall The va... | [
"Filter",
"the",
"query",
"on",
"the",
"dt_call",
"column"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseApiLogQuery.php#L310-L331 |
19,457 | slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseApiLogQuery.php | BaseApiLogQuery.filterByLastResponse | public function filterByLastResponse($lastResponse = null, $comparison = null)
{
return $this->addUsingAlias(ApiLogPeer::LAST_RESPONSE, $lastResponse, $comparison);
} | php | public function filterByLastResponse($lastResponse = null, $comparison = null)
{
return $this->addUsingAlias(ApiLogPeer::LAST_RESPONSE, $lastResponse, $comparison);
} | [
"public",
"function",
"filterByLastResponse",
"(",
"$",
"lastResponse",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"addUsingAlias",
"(",
"ApiLogPeer",
"::",
"LAST_RESPONSE",
",",
"$",
"lastResponse",
",",
"$",
"c... | Filter the query on the last_response column
@param mixed $lastResponse The value to use as filter
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return ApiLogQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"last_response",
"column"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseApiLogQuery.php#L427-L431 |
19,458 | Double-Opt-in/php-client-api | src/Security/Crypter.php | Crypter.encrypt | public function encrypt($plaintext, $key)
{
// Set up encryption parameters.
$inputData = cryptoHelpers::convertStringToByteArray($plaintext);
$keyAsNumbers = cryptoHelpers::toNumbers(bin2hex($key));
$keyLength = count($keyAsNumbers);
$iv = cryptoHelpers::generateSharedKey(16);
$encrypted = AES::encrypt(
... | php | public function encrypt($plaintext, $key)
{
// Set up encryption parameters.
$inputData = cryptoHelpers::convertStringToByteArray($plaintext);
$keyAsNumbers = cryptoHelpers::toNumbers(bin2hex($key));
$keyLength = count($keyAsNumbers);
$iv = cryptoHelpers::generateSharedKey(16);
$encrypted = AES::encrypt(
... | [
"public",
"function",
"encrypt",
"(",
"$",
"plaintext",
",",
"$",
"key",
")",
"{",
"// Set up encryption parameters.",
"$",
"inputData",
"=",
"cryptoHelpers",
"::",
"convertStringToByteArray",
"(",
"$",
"plaintext",
")",
";",
"$",
"keyAsNumbers",
"=",
"cryptoHelpe... | encrypts the given plain text with a key
@param string $plaintext
@param string $key
@return string | [
"encrypts",
"the",
"given",
"plain",
"text",
"with",
"a",
"key"
] | 2f17da58ec20a408bbd55b2cdd053bc689f995f4 | https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Security/Crypter.php#L28-L49 |
19,459 | Double-Opt-in/php-client-api | src/Security/Crypter.php | Crypter.decrypt | public function decrypt($encrypted, $key)
{
if (empty($encrypted))
return null;
list($identifier, $input) = explode(self::SEPARATOR_ALGORITHM, $encrypted, 2);
if ($identifier !== self::IDENTIFIER)
throw new Exception('Encryption can not be decrypted. Unsupported identifier: ' . $identifier);
// Split ... | php | public function decrypt($encrypted, $key)
{
if (empty($encrypted))
return null;
list($identifier, $input) = explode(self::SEPARATOR_ALGORITHM, $encrypted, 2);
if ($identifier !== self::IDENTIFIER)
throw new Exception('Encryption can not be decrypted. Unsupported identifier: ' . $identifier);
// Split ... | [
"public",
"function",
"decrypt",
"(",
"$",
"encrypted",
",",
"$",
"key",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"encrypted",
")",
")",
"return",
"null",
";",
"list",
"(",
"$",
"identifier",
",",
"$",
"input",
")",
"=",
"explode",
"(",
"self",
"::"... | decrypts a message
@param string $encrypted
@param string $key
@return string
@throws Exception | [
"decrypts",
"a",
"message"
] | 2f17da58ec20a408bbd55b2cdd053bc689f995f4 | https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Security/Crypter.php#L60-L95 |
19,460 | ClanCats/Core | src/bundles/Mail/PHPMailer/class.phpmailer.php | PHPMailer.edebug | protected function edebug($str)
{
if (!$this->SMTPDebug) {
return;
}
switch ($this->Debugoutput) {
case 'error_log':
error_log($str);
break;
case 'html':
//Cleans up output a bit for a better looking display ... | php | protected function edebug($str)
{
if (!$this->SMTPDebug) {
return;
}
switch ($this->Debugoutput) {
case 'error_log':
error_log($str);
break;
case 'html':
//Cleans up output a bit for a better looking display ... | [
"protected",
"function",
"edebug",
"(",
"$",
"str",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"SMTPDebug",
")",
"{",
"return",
";",
"}",
"switch",
"(",
"$",
"this",
"->",
"Debugoutput",
")",
"{",
"case",
"'error_log'",
":",
"error_log",
"(",
"$",
... | Output debugging info via user-defined method.
Only if debug output is enabled.
@see PHPMailer::$Debugoutput
@see PHPMailer::$SMTPDebug
@param string $str | [
"Output",
"debugging",
"info",
"via",
"user",
"-",
"defined",
"method",
".",
"Only",
"if",
"debug",
"output",
"is",
"enabled",
"."
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.phpmailer.php#L629-L646 |
19,461 | ClanCats/Core | src/bundles/Mail/PHPMailer/class.phpmailer.php | PHPMailer.addAttachment | public function addAttachment($path, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment')
{
try {
if (!@is_file($path)) {
throw new phpmailerException($this->lang('file_access') . $path, self::STOP_CONTINUE);
}
// If a MIME type is n... | php | public function addAttachment($path, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment')
{
try {
if (!@is_file($path)) {
throw new phpmailerException($this->lang('file_access') . $path, self::STOP_CONTINUE);
}
// If a MIME type is n... | [
"public",
"function",
"addAttachment",
"(",
"$",
"path",
",",
"$",
"name",
"=",
"''",
",",
"$",
"encoding",
"=",
"'base64'",
",",
"$",
"type",
"=",
"''",
",",
"$",
"disposition",
"=",
"'attachment'",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"@",
"is_f... | Add an attachment from a path on the filesystem.
Returns false if the file could not be found or read.
@param string $path Path to the attachment.
@param string $name Overrides the attachment name.
@param string $encoding File encoding (see $Encoding).
@param string $type File extension (MIME) type.
@param string $disp... | [
"Add",
"an",
"attachment",
"from",
"a",
"path",
"on",
"the",
"filesystem",
".",
"Returns",
"false",
"if",
"the",
"file",
"could",
"not",
"be",
"found",
"or",
"read",
"."
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.phpmailer.php#L2050-L2087 |
19,462 | ClanCats/Core | src/bundles/Mail/PHPMailer/class.phpmailer.php | PHPMailer.encodeQ | public function encodeQ($str, $position = 'text')
{
// There should not be any EOL in the string
$pattern = '';
$encoded = str_replace(array("\r", "\n"), '', $str);
switch (strtolower($position)) {
case 'phrase':
// RFC 2047 section 5.3
$pa... | php | public function encodeQ($str, $position = 'text')
{
// There should not be any EOL in the string
$pattern = '';
$encoded = str_replace(array("\r", "\n"), '', $str);
switch (strtolower($position)) {
case 'phrase':
// RFC 2047 section 5.3
$pa... | [
"public",
"function",
"encodeQ",
"(",
"$",
"str",
",",
"$",
"position",
"=",
"'text'",
")",
"{",
"// There should not be any EOL in the string",
"$",
"pattern",
"=",
"''",
";",
"$",
"encoded",
"=",
"str_replace",
"(",
"array",
"(",
"\"\\r\"",
",",
"\"\\n\"",
... | Encode a string using Q encoding.
@link http://tools.ietf.org/html/rfc2047
@param string $str the text to encode
@param string $position Where the text is going to be used, see the RFC for what that means
@access public
@return string | [
"Encode",
"a",
"string",
"using",
"Q",
"encoding",
"."
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.phpmailer.php#L2466-L2504 |
19,463 | ClanCats/Core | src/bundles/Mail/PHPMailer/class.phpmailer.php | PHPMailer.html2text | public function html2text($html, $advanced = false)
{
if ($advanced) {
require_once 'extras/class.html2text.php';
$htmlconverter = new html2text($html);
return $htmlconverter->get_text();
}
return html_entity_decode(
trim(strip_tags(preg_replac... | php | public function html2text($html, $advanced = false)
{
if ($advanced) {
require_once 'extras/class.html2text.php';
$htmlconverter = new html2text($html);
return $htmlconverter->get_text();
}
return html_entity_decode(
trim(strip_tags(preg_replac... | [
"public",
"function",
"html2text",
"(",
"$",
"html",
",",
"$",
"advanced",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"advanced",
")",
"{",
"require_once",
"'extras/class.html2text.php'",
";",
"$",
"htmlconverter",
"=",
"new",
"html2text",
"(",
"$",
"html",
"... | Convert an HTML string into plain text.
@param string $html The HTML text to convert
@param boolean $advanced Should this use the more complex html2text converter or just a simple one?
@return string | [
"Convert",
"an",
"HTML",
"string",
"into",
"plain",
"text",
"."
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.phpmailer.php#L2926-L2938 |
19,464 | ClanCats/Core | src/bundles/Mail/PHPMailer/class.phpmailer.php | PHPMailer._mime_types | public static function _mime_types($ext = '')
{
$mimes = array(
'xl' => 'application/excel',
'hqx' => 'application/mac-binhex40',
'cpt' => 'application/mac-compactpro',
'bin' => 'application/macbinary',
'doc' => 'application/msword',
'w... | php | public static function _mime_types($ext = '')
{
$mimes = array(
'xl' => 'application/excel',
'hqx' => 'application/mac-binhex40',
'cpt' => 'application/mac-compactpro',
'bin' => 'application/macbinary',
'doc' => 'application/msword',
'w... | [
"public",
"static",
"function",
"_mime_types",
"(",
"$",
"ext",
"=",
"''",
")",
"{",
"$",
"mimes",
"=",
"array",
"(",
"'xl'",
"=>",
"'application/excel'",
",",
"'hqx'",
"=>",
"'application/mac-binhex40'",
",",
"'cpt'",
"=>",
"'application/mac-compactpro'",
",",
... | Get the MIME type for a file extension.
@param string $ext File extension
@access public
@return string MIME type of file.
@static | [
"Get",
"the",
"MIME",
"type",
"for",
"a",
"file",
"extension",
"."
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.phpmailer.php#L2947-L3040 |
19,465 | ClanCats/Core | src/bundles/Mail/PHPMailer/class.phpmailer.php | PHPMailer.set | public function set($name, $value = '')
{
try {
if (isset($this->$name)) {
$this->$name = $value;
} else {
throw new phpmailerException($this->lang('variable_set') . $name, self::STOP_CRITICAL);
}
} catch (Exception $exc) {
... | php | public function set($name, $value = '')
{
try {
if (isset($this->$name)) {
$this->$name = $value;
} else {
throw new phpmailerException($this->lang('variable_set') . $name, self::STOP_CRITICAL);
}
} catch (Exception $exc) {
... | [
"public",
"function",
"set",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"''",
")",
"{",
"try",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"$",
"name",
")",
")",
"{",
"$",
"this",
"->",
"$",
"name",
"=",
"$",
"value",
";",
"}",
"else",
... | Set or reset instance properties.
Usage Example:
$page->set('X-Priority', '3');
@access public
@param string $name
@param mixed $value
NOTE: will not work with arrays, there are no arrays to set/reset
@throws phpmailerException
@return boolean
@TODO Should this not be using __set() magic function? | [
"Set",
"or",
"reset",
"instance",
"properties",
"."
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.phpmailer.php#L3121-L3136 |
19,466 | ClanCats/Core | src/classes/ClanCats.php | ClanCats.runtime | public static function runtime( $fnc = null, $params = array() )
{
if ( is_null( $fnc ) )
{
return static::$runtime_class;
}
return call_user_func_array( array( static::$runtime_class, $fnc ), $params );
} | php | public static function runtime( $fnc = null, $params = array() )
{
if ( is_null( $fnc ) )
{
return static::$runtime_class;
}
return call_user_func_array( array( static::$runtime_class, $fnc ), $params );
} | [
"public",
"static",
"function",
"runtime",
"(",
"$",
"fnc",
"=",
"null",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"fnc",
")",
")",
"{",
"return",
"static",
"::",
"$",
"runtime_class",
";",
"}",
"return",... | get the current runtime class name
or execute an function on the runtime class
@return string | [
"get",
"the",
"current",
"runtime",
"class",
"name",
"or",
"execute",
"an",
"function",
"on",
"the",
"runtime",
"class"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/ClanCats.php#L111-L119 |
19,467 | ClanCats/Core | src/classes/ClanCats.php | ClanCats.paths | public static function paths( $paths = null, $define = true )
{
if ( is_null( $paths ) )
{
return static::$paths;
}
foreach( $paths as $key => $path )
{
static::$paths[$key] = $path;
if ( $define === true )
{
define( strtoupper( $key ).'PATH', $path );
}
}
} | php | public static function paths( $paths = null, $define = true )
{
if ( is_null( $paths ) )
{
return static::$paths;
}
foreach( $paths as $key => $path )
{
static::$paths[$key] = $path;
if ( $define === true )
{
define( strtoupper( $key ).'PATH', $path );
}
}
} | [
"public",
"static",
"function",
"paths",
"(",
"$",
"paths",
"=",
"null",
",",
"$",
"define",
"=",
"true",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"paths",
")",
")",
"{",
"return",
"static",
"::",
"$",
"paths",
";",
"}",
"foreach",
"(",
"$",
"pa... | paths getter and setter
when paths empty:
return all registerd paths
when paths an array:
adds paths to the index and optional create a define.
@param array $paths
@param bool $define
@return array|void | [
"paths",
"getter",
"and",
"setter"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/ClanCats.php#L162-L178 |
19,468 | ClanCats/Core | src/classes/ClanCats.php | ClanCats.directories | public static function directories( $dirs = null, $define = true )
{
if ( is_null( $dirs ) )
{
return static::$directories;
}
foreach( $dirs as $key => $dir )
{
static::$directories[$key] = $dir;
if ( $define === true )
{
define( 'CCDIR_'.strtoupper( $key ), $dir );
}
}
} | php | public static function directories( $dirs = null, $define = true )
{
if ( is_null( $dirs ) )
{
return static::$directories;
}
foreach( $dirs as $key => $dir )
{
static::$directories[$key] = $dir;
if ( $define === true )
{
define( 'CCDIR_'.strtoupper( $key ), $dir );
}
}
} | [
"public",
"static",
"function",
"directories",
"(",
"$",
"dirs",
"=",
"null",
",",
"$",
"define",
"=",
"true",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"dirs",
")",
")",
"{",
"return",
"static",
"::",
"$",
"directories",
";",
"}",
"foreach",
"(",
... | directories getter and setter
when dirs empty:
return all registerd directories
when dirs an array:
adds directories to the index and optional create a define.
@param array $paths
@param bool $define
@return array|void | [
"directories",
"getter",
"and",
"setter"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/ClanCats.php#L193-L209 |
19,469 | ClanCats/Core | src/classes/ClanCats.php | ClanCats.wake | public static function wake( $environment )
{
if ( !is_null( static::$environment ) )
{
throw new CCException( "ClanCats::wake - you cannot wake the application twice." );
}
// set environment
static::$environment = $environment;
// load the main configuration
static::$config = CCConfig::creat... | php | public static function wake( $environment )
{
if ( !is_null( static::$environment ) )
{
throw new CCException( "ClanCats::wake - you cannot wake the application twice." );
}
// set environment
static::$environment = $environment;
// load the main configuration
static::$config = CCConfig::creat... | [
"public",
"static",
"function",
"wake",
"(",
"$",
"environment",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"static",
"::",
"$",
"environment",
")",
")",
"{",
"throw",
"new",
"CCException",
"(",
"\"ClanCats::wake - you cannot wake the application twice.\"",
")",
... | start the ccf lifecycle
this method sets the current environment, loads the configuration
and wakes the application
@param string $environment
@return void | [
"start",
"the",
"ccf",
"lifecycle"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/ClanCats.php#L292-L322 |
19,470 | ClanCats/Core | src/classes/ClanCats.php | ClanCats.wake_app | public static function wake_app( $app )
{
static::$runtime_class = $app;
\CCFinder::bind( $app, static::$paths['app'].$app.EXT );
// run the application wake
$response = $app::wake();
// when the application wake returns an response we display it
if ( $response instanceof CCResponse ) {
if ( stati... | php | public static function wake_app( $app )
{
static::$runtime_class = $app;
\CCFinder::bind( $app, static::$paths['app'].$app.EXT );
// run the application wake
$response = $app::wake();
// when the application wake returns an response we display it
if ( $response instanceof CCResponse ) {
if ( stati... | [
"public",
"static",
"function",
"wake_app",
"(",
"$",
"app",
")",
"{",
"static",
"::",
"$",
"runtime_class",
"=",
"$",
"app",
";",
"\\",
"CCFinder",
"::",
"bind",
"(",
"$",
"app",
",",
"static",
"::",
"$",
"paths",
"[",
"'app'",
"]",
".",
"$",
"app... | start the ccf app lifecycle
This method registers the App class and runs the wake events.
@param string $app The used app class = APPATH/<$app>.php
@return void | [
"start",
"the",
"ccf",
"app",
"lifecycle"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/ClanCats.php#L332-L364 |
19,471 | qcubed/orm | src/Query/Node/Column.php | Column.join | public function join(
Builder $objBuilder,
$blnExpandSelection = false,
iCondition $objJoinCondition = null,
Clause\Select $objSelect = null
) {
$objParentNode = $this->objParentNode;
if (!$objParentNode) {
throw new Caller('A column node must have a paren... | php | public function join(
Builder $objBuilder,
$blnExpandSelection = false,
iCondition $objJoinCondition = null,
Clause\Select $objSelect = null
) {
$objParentNode = $this->objParentNode;
if (!$objParentNode) {
throw new Caller('A column node must have a paren... | [
"public",
"function",
"join",
"(",
"Builder",
"$",
"objBuilder",
",",
"$",
"blnExpandSelection",
"=",
"false",
",",
"iCondition",
"$",
"objJoinCondition",
"=",
"null",
",",
"Clause",
"\\",
"Select",
"$",
"objSelect",
"=",
"null",
")",
"{",
"$",
"objParentNod... | Join the node to the given query. Since this is a leaf node, we pass on the join to the parent.
@param Builder $objBuilder
@param bool $blnExpandSelection
@param iCondition|null $objJoinCondition
@param Clause\Select|null $objSelect
@throws Caller | [
"Join",
"the",
"node",
"to",
"the",
"given",
"query",
".",
"Since",
"this",
"is",
"a",
"leaf",
"node",
"we",
"pass",
"on",
"the",
"join",
"to",
"the",
"parent",
"."
] | f320eba671f20874b1f3809c5293f8c02d5b1204 | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Query/Node/Column.php#L96-L109 |
19,472 | qcubed/orm | src/Query/Node/Column.php | Column.getAsManualSqlColumn | public function getAsManualSqlColumn()
{
if ($this->strTableName) {
return $this->strTableName . '.' . $this->strName;
} else {
if (($this->objParentNode) && ($this->objParentNode->strTableName)) {
return $this->objParentNode->strTableName . '.' . $this->strNa... | php | public function getAsManualSqlColumn()
{
if ($this->strTableName) {
return $this->strTableName . '.' . $this->strName;
} else {
if (($this->objParentNode) && ($this->objParentNode->strTableName)) {
return $this->objParentNode->strTableName . '.' . $this->strNa... | [
"public",
"function",
"getAsManualSqlColumn",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"strTableName",
")",
"{",
"return",
"$",
"this",
"->",
"strTableName",
".",
"'.'",
".",
"$",
"this",
"->",
"strName",
";",
"}",
"else",
"{",
"if",
"(",
"(",
"$... | Get the unaliased column name. For special situations, like order by, since you can't order by aliases.
@return string | [
"Get",
"the",
"unaliased",
"column",
"name",
".",
"For",
"special",
"situations",
"like",
"order",
"by",
"since",
"you",
"can",
"t",
"order",
"by",
"aliases",
"."
] | f320eba671f20874b1f3809c5293f8c02d5b1204 | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Query/Node/Column.php#L115-L126 |
19,473 | meccado/acl-admin-control-panel | src/Http/Controllers/Admin/AdminController.php | AdminController.getUserRolePermissions | public function getUserRolePermissions()
{
$roles = Role::select('id', 'name', 'label')->get();
$permissions = Permission::select('id', 'name', 'label')->get();
return \View::make('admin.permissions.role-assign-permissions', [
'roles' => $roles,
'permissions' => $permissi... | php | public function getUserRolePermissions()
{
$roles = Role::select('id', 'name', 'label')->get();
$permissions = Permission::select('id', 'name', 'label')->get();
return \View::make('admin.permissions.role-assign-permissions', [
'roles' => $roles,
'permissions' => $permissi... | [
"public",
"function",
"getUserRolePermissions",
"(",
")",
"{",
"$",
"roles",
"=",
"Role",
"::",
"select",
"(",
"'id'",
",",
"'name'",
",",
"'label'",
")",
"->",
"get",
"(",
")",
";",
"$",
"permissions",
"=",
"Permission",
"::",
"select",
"(",
"'id'",
"... | Display given permissions to role.
@return void | [
"Display",
"given",
"permissions",
"to",
"role",
"."
] | 50ac4c0dbf8bd49944ecad6a70708a70411b7378 | https://github.com/meccado/acl-admin-control-panel/blob/50ac4c0dbf8bd49944ecad6a70708a70411b7378/src/Http/Controllers/Admin/AdminController.php#L45-L54 |
19,474 | meccado/acl-admin-control-panel | src/Http/Controllers/Admin/AdminController.php | AdminController.postUserRolePermissions | public function postUserRolePermissions(Request $request)
{
$this->validate($request, ['role' => 'required', 'permissions' => 'required']);
$role = Role::with('permissions')->whereName($request->role)->first();
$role->permissions()->detach();
foreach ($request->permissions as $permission_name) {
... | php | public function postUserRolePermissions(Request $request)
{
$this->validate($request, ['role' => 'required', 'permissions' => 'required']);
$role = Role::with('permissions')->whereName($request->role)->first();
$role->permissions()->detach();
foreach ($request->permissions as $permission_name) {
... | [
"public",
"function",
"postUserRolePermissions",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"validate",
"(",
"$",
"request",
",",
"[",
"'role'",
"=>",
"'required'",
",",
"'permissions'",
"=>",
"'required'",
"]",
")",
";",
"$",
"role",
"="... | Store given permissions to role.
@param \Illuminate\Http\Request $request
@return void | [
"Store",
"given",
"permissions",
"to",
"role",
"."
] | 50ac4c0dbf8bd49944ecad6a70708a70411b7378 | https://github.com/meccado/acl-admin-control-panel/blob/50ac4c0dbf8bd49944ecad6a70708a70411b7378/src/Http/Controllers/Admin/AdminController.php#L64-L76 |
19,475 | kherge-abandoned/php-wise | src/lib/Herrera/Wise/Wise.php | Wise.create | public static function create($paths, $cache = null, $debug = false)
{
$wise = new self($debug);
if ($cache) {
$wise->setCacheDir($cache);
}
$locator = new FileLocator($paths);
$resolver = new LoaderResolver(
array(
new Loader\IniFile... | php | public static function create($paths, $cache = null, $debug = false)
{
$wise = new self($debug);
if ($cache) {
$wise->setCacheDir($cache);
}
$locator = new FileLocator($paths);
$resolver = new LoaderResolver(
array(
new Loader\IniFile... | [
"public",
"static",
"function",
"create",
"(",
"$",
"paths",
",",
"$",
"cache",
"=",
"null",
",",
"$",
"debug",
"=",
"false",
")",
"{",
"$",
"wise",
"=",
"new",
"self",
"(",
"$",
"debug",
")",
";",
"if",
"(",
"$",
"cache",
")",
"{",
"$",
"wise"... | Creates a pre-configured instance of Wise.
@param array|string $paths The configuration directory path(s).
@param string $cache The cache directory path.
@param boolean $debug Enable debugging?
@return Wise The instance. | [
"Creates",
"a",
"pre",
"-",
"configured",
"instance",
"of",
"Wise",
"."
] | 7621e0be7dbb2a015d68197d290fe8469f539a4d | https://github.com/kherge-abandoned/php-wise/blob/7621e0be7dbb2a015d68197d290fe8469f539a4d/src/lib/Herrera/Wise/Wise.php#L90-L116 |
19,476 | kherge-abandoned/php-wise | src/lib/Herrera/Wise/Wise.php | Wise.load | public function load($resource, $type = null, $require = false)
{
if (null === $this->loader) {
throw new LogicException('No loader has been configured.');
}
if (false === $this->loader->supports($resource, $type)) {
throw LoaderException::format(
'Th... | php | public function load($resource, $type = null, $require = false)
{
if (null === $this->loader) {
throw new LogicException('No loader has been configured.');
}
if (false === $this->loader->supports($resource, $type)) {
throw LoaderException::format(
'Th... | [
"public",
"function",
"load",
"(",
"$",
"resource",
",",
"$",
"type",
"=",
"null",
",",
"$",
"require",
"=",
"false",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"loader",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'No loader has been... | Loads the configuration data from a resource.
@param mixed $resource A resource.
@param string $type The resource type.
@param boolean $require Require processing?
@return array The data.
@throws LoaderException If the loader could not be used.
@throws LogicException If no loader has been configured. | [
"Loads",
"the",
"configuration",
"data",
"from",
"a",
"resource",
"."
] | 7621e0be7dbb2a015d68197d290fe8469f539a4d | https://github.com/kherge-abandoned/php-wise/blob/7621e0be7dbb2a015d68197d290fe8469f539a4d/src/lib/Herrera/Wise/Wise.php#L190-L239 |
19,477 | kherge-abandoned/php-wise | src/lib/Herrera/Wise/Wise.php | Wise.loadFlat | public function loadFlat($resource, $type = null, $require = false)
{
return ArrayUtil::flatten($this->load($resource, $type, $require));
} | php | public function loadFlat($resource, $type = null, $require = false)
{
return ArrayUtil::flatten($this->load($resource, $type, $require));
} | [
"public",
"function",
"loadFlat",
"(",
"$",
"resource",
",",
"$",
"type",
"=",
"null",
",",
"$",
"require",
"=",
"false",
")",
"{",
"return",
"ArrayUtil",
"::",
"flatten",
"(",
"$",
"this",
"->",
"load",
"(",
"$",
"resource",
",",
"$",
"type",
",",
... | Loads the configuration data from a resource and returns it flattened.
@param mixed $resource A resource.
@param string $type The resource type.
@param boolean $require Require processing?
@return array The data. | [
"Loads",
"the",
"configuration",
"data",
"from",
"a",
"resource",
"and",
"returns",
"it",
"flattened",
"."
] | 7621e0be7dbb2a015d68197d290fe8469f539a4d | https://github.com/kherge-abandoned/php-wise/blob/7621e0be7dbb2a015d68197d290fe8469f539a4d/src/lib/Herrera/Wise/Wise.php#L250-L253 |
19,478 | kherge-abandoned/php-wise | src/lib/Herrera/Wise/Wise.php | Wise.setCollector | public function setCollector(ResourceCollectorInterface $collector)
{
$this->collector = $collector;
if ($this->loader) {
if ($this->loader instanceof ResourceAwareInterface) {
$this->loader->setResourceCollector($collector);
}
if ($this->loader ... | php | public function setCollector(ResourceCollectorInterface $collector)
{
$this->collector = $collector;
if ($this->loader) {
if ($this->loader instanceof ResourceAwareInterface) {
$this->loader->setResourceCollector($collector);
}
if ($this->loader ... | [
"public",
"function",
"setCollector",
"(",
"ResourceCollectorInterface",
"$",
"collector",
")",
"{",
"$",
"this",
"->",
"collector",
"=",
"$",
"collector",
";",
"if",
"(",
"$",
"this",
"->",
"loader",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"loader",
"in... | Sets the resource collector.
@param ResourceCollectorInterface $collector The collector. | [
"Sets",
"the",
"resource",
"collector",
"."
] | 7621e0be7dbb2a015d68197d290fe8469f539a4d | https://github.com/kherge-abandoned/php-wise/blob/7621e0be7dbb2a015d68197d290fe8469f539a4d/src/lib/Herrera/Wise/Wise.php#L270-L287 |
19,479 | kherge-abandoned/php-wise | src/lib/Herrera/Wise/Wise.php | Wise.setGlobalParameters | public function setGlobalParameters($parameters)
{
if (!is_array($parameters) && !($parameters instanceof ArrayAccess)) {
throw new InvalidArgumentException(
'The $parameters argument must be an array or array accessible object.'
);
}
$this->parameter... | php | public function setGlobalParameters($parameters)
{
if (!is_array($parameters) && !($parameters instanceof ArrayAccess)) {
throw new InvalidArgumentException(
'The $parameters argument must be an array or array accessible object.'
);
}
$this->parameter... | [
"public",
"function",
"setGlobalParameters",
"(",
"$",
"parameters",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"parameters",
")",
"&&",
"!",
"(",
"$",
"parameters",
"instanceof",
"ArrayAccess",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
... | Sets a list of global parameters.
@param array|ArrayAccess $parameters The parameters.
@throws InvalidArgumentException If $parameters is invalid. | [
"Sets",
"a",
"list",
"of",
"global",
"parameters",
"."
] | 7621e0be7dbb2a015d68197d290fe8469f539a4d | https://github.com/kherge-abandoned/php-wise/blob/7621e0be7dbb2a015d68197d290fe8469f539a4d/src/lib/Herrera/Wise/Wise.php#L296-L305 |
19,480 | kherge-abandoned/php-wise | src/lib/Herrera/Wise/Wise.php | Wise.setLoader | public function setLoader(LoaderInterface $loader)
{
$this->loader = $loader;
if ($this->collector && ($loader instanceof ResourceAwareInterface)) {
$loader->setResourceCollector($this->collector);
}
if ($loader instanceof WiseAwareInterface) {
$loader->setW... | php | public function setLoader(LoaderInterface $loader)
{
$this->loader = $loader;
if ($this->collector && ($loader instanceof ResourceAwareInterface)) {
$loader->setResourceCollector($this->collector);
}
if ($loader instanceof WiseAwareInterface) {
$loader->setW... | [
"public",
"function",
"setLoader",
"(",
"LoaderInterface",
"$",
"loader",
")",
"{",
"$",
"this",
"->",
"loader",
"=",
"$",
"loader",
";",
"if",
"(",
"$",
"this",
"->",
"collector",
"&&",
"(",
"$",
"loader",
"instanceof",
"ResourceAwareInterface",
")",
")",... | Sets a configuration loader.
@param LoaderInterface $loader A loader. | [
"Sets",
"a",
"configuration",
"loader",
"."
] | 7621e0be7dbb2a015d68197d290fe8469f539a4d | https://github.com/kherge-abandoned/php-wise/blob/7621e0be7dbb2a015d68197d290fe8469f539a4d/src/lib/Herrera/Wise/Wise.php#L312-L336 |
19,481 | kherge-abandoned/php-wise | src/lib/Herrera/Wise/Wise.php | Wise.process | private function process(array $data, $resource, $type, $require)
{
if ($this->processor) {
if ($this->processor instanceof ProcessorInterface) {
if ($this->processor->supports($resource, $type)) {
$data = $this->processor->process($data);
} el... | php | private function process(array $data, $resource, $type, $require)
{
if ($this->processor) {
if ($this->processor instanceof ProcessorInterface) {
if ($this->processor->supports($resource, $type)) {
$data = $this->processor->process($data);
} el... | [
"private",
"function",
"process",
"(",
"array",
"$",
"data",
",",
"$",
"resource",
",",
"$",
"type",
",",
"$",
"require",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"processor",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"processor",
"instanceof",
"Process... | Processes the configuration definition.
@param array $data The configuration data.
@param mixed $resource A resource.
@param string $type The resource type.
@param boolean $require Require processing?
@return array The processed configuration data.
@throws ProcessorException If the processor could not ... | [
"Processes",
"the",
"configuration",
"definition",
"."
] | 7621e0be7dbb2a015d68197d290fe8469f539a4d | https://github.com/kherge-abandoned/php-wise/blob/7621e0be7dbb2a015d68197d290fe8469f539a4d/src/lib/Herrera/Wise/Wise.php#L361-L388 |
19,482 | ClanCats/Core | src/classes/CCOrbit/Ship.php | CCOrbit_Ship.create | public static function create( $path )
{
if ( is_null( $path ) )
{
return new static();
}
// use the orbit path if we are relative
if ( substr( $path, 0, 1 ) != '/' )
{
$path = ORBITPATH.$path;
}
// check the path
if ( substr( $path, -1 ) != '/' )
{
$path .= '/';
}
$bluep... | php | public static function create( $path )
{
if ( is_null( $path ) )
{
return new static();
}
// use the orbit path if we are relative
if ( substr( $path, 0, 1 ) != '/' )
{
$path = ORBITPATH.$path;
}
// check the path
if ( substr( $path, -1 ) != '/' )
{
$path .= '/';
}
$bluep... | [
"public",
"static",
"function",
"create",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"path",
")",
")",
"{",
"return",
"new",
"static",
"(",
")",
";",
"}",
"// use the orbit path if we are relative",
"if",
"(",
"substr",
"(",
"$",
"path",... | create an new ship object from path
@param string $path
@return CCOrbit_Ship | [
"create",
"an",
"new",
"ship",
"object",
"from",
"path"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCOrbit/Ship.php#L21-L53 |
19,483 | ClanCats/Core | src/classes/CCOrbit/Ship.php | CCOrbit_Ship.blueprint | public static function blueprint( $data, $path )
{
if ( !is_array( $data ) )
{
throw new \InvalidArgumentException( "CCOrbit_Ship::blueprint - first argument has to be an array." );
}
$ship = new static();
$name = $data['name'];
$namespace = $data['namespace'];
// check if we have a name ... | php | public static function blueprint( $data, $path )
{
if ( !is_array( $data ) )
{
throw new \InvalidArgumentException( "CCOrbit_Ship::blueprint - first argument has to be an array." );
}
$ship = new static();
$name = $data['name'];
$namespace = $data['namespace'];
// check if we have a name ... | [
"public",
"static",
"function",
"blueprint",
"(",
"$",
"data",
",",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"CCOrbit_Ship::blueprint - first argument has to be a... | create new ship with given data
@param array $data
@return CCOrbit_Ship | [
"create",
"new",
"ship",
"with",
"given",
"data"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCOrbit/Ship.php#L61-L146 |
19,484 | ClanCats/Core | src/classes/CCOrbit/Ship.php | CCOrbit_Ship.event | public function event( $event )
{
// call the wake event
if ( is_string( $this->namespace ) )
{
if ( strpos( $event, '::' ) !== false )
{
$callback = explode( '::', $event );
$class = $this->namespace."\\".$callback[0];
if ( class_exists( $class ) )
{
call_user_func( array( $t... | php | public function event( $event )
{
// call the wake event
if ( is_string( $this->namespace ) )
{
if ( strpos( $event, '::' ) !== false )
{
$callback = explode( '::', $event );
$class = $this->namespace."\\".$callback[0];
if ( class_exists( $class ) )
{
call_user_func( array( $t... | [
"public",
"function",
"event",
"(",
"$",
"event",
")",
"{",
"// call the wake event",
"if",
"(",
"is_string",
"(",
"$",
"this",
"->",
"namespace",
")",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"event",
",",
"'::'",
")",
"!==",
"false",
")",
"{",
"$",... | run an event on this object | [
"run",
"an",
"event",
"on",
"this",
"object"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCOrbit/Ship.php#L202-L232 |
19,485 | Kylob/Bootstrap | src/Form.php | Form.align | public function align($direction = 'horizontal', $collapse = 'sm', $indent = 2)
{
if ($direction == 'collapse') {
$this->align = '';
} elseif ($direction == 'inline') {
$this->align = 'form-inline';
} else {
$this->align = 'form-horizontal';
$t... | php | public function align($direction = 'horizontal', $collapse = 'sm', $indent = 2)
{
if ($direction == 'collapse') {
$this->align = '';
} elseif ($direction == 'inline') {
$this->align = 'form-inline';
} else {
$this->align = 'form-horizontal';
$t... | [
"public",
"function",
"align",
"(",
"$",
"direction",
"=",
"'horizontal'",
",",
"$",
"collapse",
"=",
"'sm'",
",",
"$",
"indent",
"=",
"2",
")",
"{",
"if",
"(",
"$",
"direction",
"==",
"'collapse'",
")",
"{",
"$",
"this",
"->",
"align",
"=",
"''",
... | Utilize any Bootstrap form style.
@param string $direction The options are:
- '**collapse**' - This will display the form prompt immediately above the field.
- '**inline**' - All of the fields will be inline with each other, and the form prompts will be removed.
- '**horizontal**' - Vertically aligns all of the field... | [
"Utilize",
"any",
"Bootstrap",
"form",
"style",
"."
] | 0d7677a90656fbc461eabb5512ab16f9d5f728c6 | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Form.php#L118-L129 |
19,486 | Kylob/Bootstrap | src/Form.php | Form.prompt | public function prompt($place, $html, $required = false)
{
switch ($place) {
case 'info':
case 'append':
$this->prompt[$place] = $html;
break;
case 'prepend':
$this->prompt['prepend'] = array('html' => $html, 'required' => (... | php | public function prompt($place, $html, $required = false)
{
switch ($place) {
case 'info':
case 'append':
$this->prompt[$place] = $html;
break;
case 'prepend':
$this->prompt['prepend'] = array('html' => $html, 'required' => (... | [
"public",
"function",
"prompt",
"(",
"$",
"place",
",",
"$",
"html",
",",
"$",
"required",
"=",
"false",
")",
"{",
"switch",
"(",
"$",
"place",
")",
"{",
"case",
"'info'",
":",
"case",
"'append'",
":",
"$",
"this",
"->",
"prompt",
"[",
"$",
"place"... | This is to add html tags, or semicolons, or asterisks, or whatever you would like to all of the form's prompts.
@param string $place Either '**info**', '**append**', or '**prepend**' to the prompt. You only have one shot at each.
@param string $html Whatever you would like to add. For '**info**', this will be... | [
"This",
"is",
"to",
"add",
"html",
"tags",
"or",
"semicolons",
"or",
"asterisks",
"or",
"whatever",
"you",
"would",
"like",
"to",
"all",
"of",
"the",
"form",
"s",
"prompts",
"."
] | 0d7677a90656fbc461eabb5512ab16f9d5f728c6 | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Form.php#L146-L157 |
19,487 | Kylob/Bootstrap | src/Form.php | Form.submit | public function submit($submit = 'Submit', $reset = '')
{
// never use name="submit" per: http://jqueryvalidation.org/reference/#developing-and-debugging-a-form
$buttons = func_get_args();
if (substr($submit, 0, 1) != '<') {
$buttons[0] = $this->page->tag('button', array(
... | php | public function submit($submit = 'Submit', $reset = '')
{
// never use name="submit" per: http://jqueryvalidation.org/reference/#developing-and-debugging-a-form
$buttons = func_get_args();
if (substr($submit, 0, 1) != '<') {
$buttons[0] = $this->page->tag('button', array(
... | [
"public",
"function",
"submit",
"(",
"$",
"submit",
"=",
"'Submit'",
",",
"$",
"reset",
"=",
"''",
")",
"{",
"// never use name=\"submit\" per: http://jqueryvalidation.org/reference/#developing-and-debugging-a-form",
"$",
"buttons",
"=",
"func_get_args",
"(",
")",
";",
... | Quickly adds a submit button to your form.
@param string $submit What you would like the submit button to say. If it starts with a '**<**', then we assume you have spelled it all out for us.
@param string $reset This will add a reset button if you give it a value, and if it starts with a '**<**' then it can be whate... | [
"Quickly",
"adds",
"a",
"submit",
"button",
"to",
"your",
"form",
"."
] | 0d7677a90656fbc461eabb5512ab16f9d5f728c6 | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Form.php#L372-L391 |
19,488 | Double-Opt-in/php-client-api | src/Client/Commands/Responses/DecryptedCommandResponse.php | DecryptedCommandResponse.assignCryptographyEngine | public function assignCryptographyEngine(CryptographyEngine $cryptographyEngine, $email)
{
$this->cryptographyEngine = $cryptographyEngine;
$this->email = $email;
} | php | public function assignCryptographyEngine(CryptographyEngine $cryptographyEngine, $email)
{
$this->cryptographyEngine = $cryptographyEngine;
$this->email = $email;
} | [
"public",
"function",
"assignCryptographyEngine",
"(",
"CryptographyEngine",
"$",
"cryptographyEngine",
",",
"$",
"email",
")",
"{",
"$",
"this",
"->",
"cryptographyEngine",
"=",
"$",
"cryptographyEngine",
";",
"$",
"this",
"->",
"email",
"=",
"$",
"email",
";",... | assigns the cryptography engine
@param \DoubleOptIn\ClientApi\Security\CryptographyEngine $cryptographyEngine
@param string $email
@return void | [
"assigns",
"the",
"cryptography",
"engine"
] | 2f17da58ec20a408bbd55b2cdd053bc689f995f4 | https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Client/Commands/Responses/DecryptedCommandResponse.php#L38-L42 |
19,489 | Double-Opt-in/php-client-api | src/Client/Commands/Responses/DecryptedCommandResponse.php | DecryptedCommandResponse.resolveActionFromStdClass | protected function resolveActionFromStdClass(stdClass $stdClass)
{
if (isset($stdClass->data))
$stdClass->data = $this->cryptographyEngine->decrypt($stdClass->data, $this->email);
return Action::createFromStdClass($stdClass);
} | php | protected function resolveActionFromStdClass(stdClass $stdClass)
{
if (isset($stdClass->data))
$stdClass->data = $this->cryptographyEngine->decrypt($stdClass->data, $this->email);
return Action::createFromStdClass($stdClass);
} | [
"protected",
"function",
"resolveActionFromStdClass",
"(",
"stdClass",
"$",
"stdClass",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"stdClass",
"->",
"data",
")",
")",
"$",
"stdClass",
"->",
"data",
"=",
"$",
"this",
"->",
"cryptographyEngine",
"->",
"decrypt",
... | resolves an action from a stdClass
@param \stdClass $stdClass
@return Action | [
"resolves",
"an",
"action",
"from",
"a",
"stdClass"
] | 2f17da58ec20a408bbd55b2cdd053bc689f995f4 | https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Client/Commands/Responses/DecryptedCommandResponse.php#L51-L57 |
19,490 | andrelohmann/silverstripe-extended-image | code/extensions/ExtendedGDBackend.php | ExtendedGDBackend.merge | public function merge(GDBackend $image){
imagealphablending($this->owner->getImageResource(), false);
imagesavealpha($this->owner->getImageResource(), true);
imagealphablending($image->getImageResource(), false);
imagesavealpha($image->getImageResource(), true);
$s... | php | public function merge(GDBackend $image){
imagealphablending($this->owner->getImageResource(), false);
imagesavealpha($this->owner->getImageResource(), true);
imagealphablending($image->getImageResource(), false);
imagesavealpha($image->getImageResource(), true);
$s... | [
"public",
"function",
"merge",
"(",
"GDBackend",
"$",
"image",
")",
"{",
"imagealphablending",
"(",
"$",
"this",
"->",
"owner",
"->",
"getImageResource",
"(",
")",
",",
"false",
")",
";",
"imagesavealpha",
"(",
"$",
"this",
"->",
"owner",
"->",
"getImageRe... | Merge two Images together | [
"Merge",
"two",
"Images",
"together"
] | 178e9142ae8ff63f9bf36464093379f6e836b90b | https://github.com/andrelohmann/silverstripe-extended-image/blob/178e9142ae8ff63f9bf36464093379f6e836b90b/code/extensions/ExtendedGDBackend.php#L15-L37 |
19,491 | andrelohmann/silverstripe-extended-image | code/extensions/ExtendedGDBackend.php | ExtendedGDBackend.blur | public function blur($intensity) {
$image = $this->owner->getImageResource();
switch($intensity){
case 'light':
for ($x=1; $x<=10; $x++)
imagefilter($image, IMG_FILTER_GAUSSIAN_BLUR);
break;
case 'strong':
... | php | public function blur($intensity) {
$image = $this->owner->getImageResource();
switch($intensity){
case 'light':
for ($x=1; $x<=10; $x++)
imagefilter($image, IMG_FILTER_GAUSSIAN_BLUR);
break;
case 'strong':
... | [
"public",
"function",
"blur",
"(",
"$",
"intensity",
")",
"{",
"$",
"image",
"=",
"$",
"this",
"->",
"owner",
"->",
"getImageResource",
"(",
")",
";",
"switch",
"(",
"$",
"intensity",
")",
"{",
"case",
"'light'",
":",
"for",
"(",
"$",
"x",
"=",
"1"... | blur the image | [
"blur",
"the",
"image"
] | 178e9142ae8ff63f9bf36464093379f6e836b90b | https://github.com/andrelohmann/silverstripe-extended-image/blob/178e9142ae8ff63f9bf36464093379f6e836b90b/code/extensions/ExtendedGDBackend.php#L42-L66 |
19,492 | andrelohmann/silverstripe-extended-image | code/extensions/ExtendedGDBackend.php | ExtendedGDBackend.toJpeg | public function toJpeg($backgroundColor, $type) {
$image = $this->owner->getImageResource();
switch($type){
case IMAGETYPE_GIF:
case IMAGETYPE_PNG:
$newGD = imagecreatetruecolor($this->owner->getWidth(), $this->owner->getHeight());
$bg = GDBackend::color_web2gd($newGD, $backgroundColor);
... | php | public function toJpeg($backgroundColor, $type) {
$image = $this->owner->getImageResource();
switch($type){
case IMAGETYPE_GIF:
case IMAGETYPE_PNG:
$newGD = imagecreatetruecolor($this->owner->getWidth(), $this->owner->getHeight());
$bg = GDBackend::color_web2gd($newGD, $backgroundColor);
... | [
"public",
"function",
"toJpeg",
"(",
"$",
"backgroundColor",
",",
"$",
"type",
")",
"{",
"$",
"image",
"=",
"$",
"this",
"->",
"owner",
"->",
"getImageResource",
"(",
")",
";",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"IMAGETYPE_GIF",
":",
"case",... | convert to jpeg | [
"convert",
"to",
"jpeg"
] | 178e9142ae8ff63f9bf36464093379f6e836b90b | https://github.com/andrelohmann/silverstripe-extended-image/blob/178e9142ae8ff63f9bf36464093379f6e836b90b/code/extensions/ExtendedGDBackend.php#L144-L165 |
19,493 | javiacei/IdeupSimplePaginatorBundle | Paginator/Adapter/AdapterFactory.php | AdapterFactory.createAdapter | public function createAdapter($collection)
{
if (\is_array($collection)) {
$className = 'Array';
} else {
try {
$r = new \ReflectionClass($collection);
$className = $r->getName();
} catch (\ReflectionException $exc) {
... | php | public function createAdapter($collection)
{
if (\is_array($collection)) {
$className = 'Array';
} else {
try {
$r = new \ReflectionClass($collection);
$className = $r->getName();
} catch (\ReflectionException $exc) {
... | [
"public",
"function",
"createAdapter",
"(",
"$",
"collection",
")",
"{",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"collection",
")",
")",
"{",
"$",
"className",
"=",
"'Array'",
";",
"}",
"else",
"{",
"try",
"{",
"$",
"r",
"=",
"new",
"\\",
"ReflectionC... | This method recieve a data collection and returns the corresponding adapter.
@param mixed $collection
@return AdapterInterface
@throws Ideup\SimplePaginatorBundle\Paginator\Exception\AdapterNotSupportedException | [
"This",
"method",
"recieve",
"a",
"data",
"collection",
"and",
"returns",
"the",
"corresponding",
"adapter",
"."
] | 12639a9c75bc403649fc2b2881e190a017d8c5b2 | https://github.com/javiacei/IdeupSimplePaginatorBundle/blob/12639a9c75bc403649fc2b2881e190a017d8c5b2/Paginator/Adapter/AdapterFactory.php#L24-L42 |
19,494 | zicht/z-plugin-git | git/Plugin.php | Plugin.appendConfiguration | public function appendConfiguration(ArrayNodeDefinition $rootNode)
{
$rootNode
->children()
->arrayNode('vcs')
->children()
->scalarNode('url')->end()
->arrayNode('export')
->children(... | php | public function appendConfiguration(ArrayNodeDefinition $rootNode)
{
$rootNode
->children()
->arrayNode('vcs')
->children()
->scalarNode('url')->end()
->arrayNode('export')
->children(... | [
"public",
"function",
"appendConfiguration",
"(",
"ArrayNodeDefinition",
"$",
"rootNode",
")",
"{",
"$",
"rootNode",
"->",
"children",
"(",
")",
"->",
"arrayNode",
"(",
"'vcs'",
")",
"->",
"children",
"(",
")",
"->",
"scalarNode",
"(",
"'url'",
")",
"->",
... | Appends Git configuration options
@param \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $rootNode
@return mixed|void | [
"Appends",
"Git",
"configuration",
"options"
] | 0ed336b19a20225f96111e30db1ae59fabdea0e7 | https://github.com/zicht/z-plugin-git/blob/0ed336b19a20225f96111e30db1ae59fabdea0e7/git/Plugin.php#L27-L43 |
19,495 | phossa2/config | src/Config/Traits/DelegatorWritableTrait.php | DelegatorWritableTrait.setRegistryWritableFalse | protected function setRegistryWritableFalse()/*# : bool */
{
foreach ($this->lookup_pool as $reg) {
if ($reg instanceof WritableInterface &&
!$reg->setWritable(false)) {
return false;
}
}
return true;
} | php | protected function setRegistryWritableFalse()/*# : bool */
{
foreach ($this->lookup_pool as $reg) {
if ($reg instanceof WritableInterface &&
!$reg->setWritable(false)) {
return false;
}
}
return true;
} | [
"protected",
"function",
"setRegistryWritableFalse",
"(",
")",
"/*# : bool */",
"{",
"foreach",
"(",
"$",
"this",
"->",
"lookup_pool",
"as",
"$",
"reg",
")",
"{",
"if",
"(",
"$",
"reg",
"instanceof",
"WritableInterface",
"&&",
"!",
"$",
"reg",
"->",
"setWrit... | Set writable to FALSE in all registries
@return bool
@access protected | [
"Set",
"writable",
"to",
"FALSE",
"in",
"all",
"registries"
] | 7c046fd2c97633b69545b4745d8bffe28e19b1df | https://github.com/phossa2/config/blob/7c046fd2c97633b69545b4745d8bffe28e19b1df/src/Config/Traits/DelegatorWritableTrait.php#L79-L88 |
19,496 | steeffeen/FancyManiaLinks | FML/Script/Features/CheckBoxFeature.php | CheckBoxFeature.setQuad | public function setQuad(Quad $quad)
{
$quad->checkId();
$quad->setScriptEvents(true);
$this->quad = $quad;
return $this;
} | php | public function setQuad(Quad $quad)
{
$quad->checkId();
$quad->setScriptEvents(true);
$this->quad = $quad;
return $this;
} | [
"public",
"function",
"setQuad",
"(",
"Quad",
"$",
"quad",
")",
"{",
"$",
"quad",
"->",
"checkId",
"(",
")",
";",
"$",
"quad",
"->",
"setScriptEvents",
"(",
"true",
")",
";",
"$",
"this",
"->",
"quad",
"=",
"$",
"quad",
";",
"return",
"$",
"this",
... | Set the CheckBox Quad
@api
@param Quad $quad CheckBox Quad
@return static | [
"Set",
"the",
"CheckBox",
"Quad"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/CheckBoxFeature.php#L97-L103 |
19,497 | ClanCats/Core | src/classes/CCFile.php | CCFile.write | public static function write( $path, $content )
{
static::mkdir( $path );
// if writing the file fails
if ( file_put_contents( $path, $content, LOCK_EX ) === false )
{
if ( static::_can_print() )
{
CCCli::line( CCCli::color( 'failure', 'red' ).' creating '.$path );
}
return false;
}
... | php | public static function write( $path, $content )
{
static::mkdir( $path );
// if writing the file fails
if ( file_put_contents( $path, $content, LOCK_EX ) === false )
{
if ( static::_can_print() )
{
CCCli::line( CCCli::color( 'failure', 'red' ).' creating '.$path );
}
return false;
}
... | [
"public",
"static",
"function",
"write",
"(",
"$",
"path",
",",
"$",
"content",
")",
"{",
"static",
"::",
"mkdir",
"(",
"$",
"path",
")",
";",
"// if writing the file fails",
"if",
"(",
"file_put_contents",
"(",
"$",
"path",
",",
"$",
"content",
",",
"LO... | save a file
@param string $path
@param string $content
@return bool | [
"save",
"a",
"file"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCFile.php#L90-L113 |
19,498 | ClanCats/Core | src/classes/CCFile.php | CCFile.append | public static function append( $path, $content )
{
if ( !is_dir( dirname( $path ) ) )
{
if ( !mkdir( dirname( $path ), 0755, true ) )
{
throw new CCException( "CCFile - could not create directory: ".dirname( $path ) );
}
}
return file_put_contents( $path, $content, LOCK_EX | FILE_APPEND );
} | php | public static function append( $path, $content )
{
if ( !is_dir( dirname( $path ) ) )
{
if ( !mkdir( dirname( $path ), 0755, true ) )
{
throw new CCException( "CCFile - could not create directory: ".dirname( $path ) );
}
}
return file_put_contents( $path, $content, LOCK_EX | FILE_APPEND );
} | [
"public",
"static",
"function",
"append",
"(",
"$",
"path",
",",
"$",
"content",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"dirname",
"(",
"$",
"path",
")",
")",
")",
"{",
"if",
"(",
"!",
"mkdir",
"(",
"dirname",
"(",
"$",
"path",
")",
",",
"075... | append to a file
@param string $path
@param string $content
@return bool | [
"append",
"to",
"a",
"file"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCFile.php#L122-L132 |
19,499 | ClanCats/Core | src/classes/CCFile.php | CCFile.delete | public static function delete( $path )
{
$success = false;
if ( file_exists( $path ) )
{
$success = unlink( $path );
}
if ( static::_can_print() )
{
if ( $success )
{
CCCli::line( CCCli::color( 'removed', 'green' ).' '.$path );
}
else
{
CCCli::line( CCCli::color( 'removing f... | php | public static function delete( $path )
{
$success = false;
if ( file_exists( $path ) )
{
$success = unlink( $path );
}
if ( static::_can_print() )
{
if ( $success )
{
CCCli::line( CCCli::color( 'removed', 'green' ).' '.$path );
}
else
{
CCCli::line( CCCli::color( 'removing f... | [
"public",
"static",
"function",
"delete",
"(",
"$",
"path",
")",
"{",
"$",
"success",
"=",
"false",
";",
"if",
"(",
"file_exists",
"(",
"$",
"path",
")",
")",
"{",
"$",
"success",
"=",
"unlink",
"(",
"$",
"path",
")",
";",
"}",
"if",
"(",
"static... | Delete a file
This function is going to remove a file from your filesystem
@param string $path
@return bool | [
"Delete",
"a",
"file",
"This",
"function",
"is",
"going",
"to",
"remove",
"a",
"file",
"from",
"your",
"filesystem"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCFile.php#L141-L163 |
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.