repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
barebone-php/barebone-core | lib/Controller.php | Controller.setRequest | public function setRequest(Request $request)
{
$this->request = $request;
$parsedBody = $this->request->getParsedBody();
if (!empty($parsedBody)) {
if (is_array($parsedBody)) {
$this->data = array_map('trim', (array)$parsedBody);
} else {
... | php | public function setRequest(Request $request)
{
$this->request = $request;
$parsedBody = $this->request->getParsedBody();
if (!empty($parsedBody)) {
if (is_array($parsedBody)) {
$this->data = array_map('trim', (array)$parsedBody);
} else {
... | [
"public",
"function",
"setRequest",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"request",
"=",
"$",
"request",
";",
"$",
"parsedBody",
"=",
"$",
"this",
"->",
"request",
"->",
"getParsedBody",
"(",
")",
";",
"if",
"(",
"!",
"empty",
... | Assign a request object
@param Request $request FIG-7 Request Interface
@return self | [
"Assign",
"a",
"request",
"object"
] | train | https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Controller.php#L278-L293 |
steeffeen/FancyManiaLinks | FML/Controls/Frame3d.php | Frame3d.setStyle3dId | public function setStyle3dId($style3dId)
{
$this->style3dId = (string)$style3dId;
$this->style3d = null;
return $this;
} | php | public function setStyle3dId($style3dId)
{
$this->style3dId = (string)$style3dId;
$this->style3d = null;
return $this;
} | [
"public",
"function",
"setStyle3dId",
"(",
"$",
"style3dId",
")",
"{",
"$",
"this",
"->",
"style3dId",
"=",
"(",
"string",
")",
"$",
"style3dId",
";",
"$",
"this",
"->",
"style3d",
"=",
"null",
";",
"return",
"$",
"this",
";",
"}"
] | Set the Style3d id
@api
@param string $style3dId Style3d id
@return static | [
"Set",
"the",
"Style3d",
"id"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Controls/Frame3d.php#L81-L86 |
steeffeen/FancyManiaLinks | FML/Controls/Frame3d.php | Frame3d.setStyle3d | public function setStyle3d(Style3d $style3d)
{
$this->style3dId = null;
$this->style3d = $style3d;
return $this;
} | php | public function setStyle3d(Style3d $style3d)
{
$this->style3dId = null;
$this->style3d = $style3d;
return $this;
} | [
"public",
"function",
"setStyle3d",
"(",
"Style3d",
"$",
"style3d",
")",
"{",
"$",
"this",
"->",
"style3dId",
"=",
"null",
";",
"$",
"this",
"->",
"style3d",
"=",
"$",
"style3d",
";",
"return",
"$",
"this",
";",
"}"
] | Set the Style3d
@api
@param Style3d $style3d Style3d
@return static | [
"Set",
"the",
"Style3d"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Controls/Frame3d.php#L106-L111 |
ClanCats/Core | src/bundles/Mail/PHPMailer/class.smtp.php | SMTP.edebug | protected function edebug($str)
{
switch ($this->Debugoutput) {
case 'error_log':
//Don't output, just log
error_log($str);
break;
case 'html':
//Cleans up output a bit for a better looking, HTML-safe output
... | php | protected function edebug($str)
{
switch ($this->Debugoutput) {
case 'error_log':
//Don't output, just log
error_log($str);
break;
case 'html':
//Cleans up output a bit for a better looking, HTML-safe output
... | [
"protected",
"function",
"edebug",
"(",
"$",
"str",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"Debugoutput",
")",
"{",
"case",
"'error_log'",
":",
"//Don't output, just log",
"error_log",
"(",
"$",
"str",
")",
";",
"break",
";",
"case",
"'html'",
":",
... | Output debugging info via a user-selected method.
@param string $str Debug string to output
@return void | [
"Output",
"debugging",
"info",
"via",
"a",
"user",
"-",
"selected",
"method",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.smtp.php#L152-L172 |
ClanCats/Core | src/bundles/Mail/PHPMailer/class.smtp.php | SMTP.authenticate | public function authenticate(
$username,
$password,
$authtype = 'LOGIN',
$realm = '',
$workstation = ''
) {
if (empty($authtype)) {
$authtype = 'LOGIN';
}
switch ($authtype) {
case 'PLAIN':
// Start authenticatio... | php | public function authenticate(
$username,
$password,
$authtype = 'LOGIN',
$realm = '',
$workstation = ''
) {
if (empty($authtype)) {
$authtype = 'LOGIN';
}
switch ($authtype) {
case 'PLAIN':
// Start authenticatio... | [
"public",
"function",
"authenticate",
"(",
"$",
"username",
",",
"$",
"password",
",",
"$",
"authtype",
"=",
"'LOGIN'",
",",
"$",
"realm",
"=",
"''",
",",
"$",
"workstation",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"authtype",
")",
")",
... | Perform SMTP authentication.
Must be run after hello().
@see hello()
@param string $username The user name
@param string $password The password
@param string $authtype The auth type (PLAIN, LOGIN, NTLM, CRAM-MD5)
@param string $realm The auth realm for NTLM
@param string $workstation The auth workstation... | [
"Perform",
"SMTP",
"authentication",
".",
"Must",
"be",
"run",
"after",
"hello",
"()",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.smtp.php#L300-L404 |
ClanCats/Core | src/bundles/Mail/PHPMailer/class.smtp.php | SMTP.connected | public function connected()
{
if (is_resource($this->smtp_conn)) {
$sock_status = stream_get_meta_data($this->smtp_conn);
if ($sock_status['eof']) {
// the socket is valid but we are not connected
if ($this->do_debug >= 1) {
$this->... | php | public function connected()
{
if (is_resource($this->smtp_conn)) {
$sock_status = stream_get_meta_data($this->smtp_conn);
if ($sock_status['eof']) {
// the socket is valid but we are not connected
if ($this->do_debug >= 1) {
$this->... | [
"public",
"function",
"connected",
"(",
")",
"{",
"if",
"(",
"is_resource",
"(",
"$",
"this",
"->",
"smtp_conn",
")",
")",
"{",
"$",
"sock_status",
"=",
"stream_get_meta_data",
"(",
"$",
"this",
"->",
"smtp_conn",
")",
";",
"if",
"(",
"$",
"sock_status",... | Check connection state.
@access public
@return boolean True if connected. | [
"Check",
"connection",
"state",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.smtp.php#L447-L464 |
ClanCats/Core | src/bundles/Mail/PHPMailer/class.smtp.php | SMTP.close | public function close()
{
$this->error = array();
$this->helo_rply = null;
if (is_resource($this->smtp_conn)) {
// close the connection and cleanup
fclose($this->smtp_conn);
if ($this->do_debug >= 3) {
$this->edebug('Connection: closed');
... | php | public function close()
{
$this->error = array();
$this->helo_rply = null;
if (is_resource($this->smtp_conn)) {
// close the connection and cleanup
fclose($this->smtp_conn);
if ($this->do_debug >= 3) {
$this->edebug('Connection: closed');
... | [
"public",
"function",
"close",
"(",
")",
"{",
"$",
"this",
"->",
"error",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"helo_rply",
"=",
"null",
";",
"if",
"(",
"is_resource",
"(",
"$",
"this",
"->",
"smtp_conn",
")",
")",
"{",
"// close the conne... | Close the socket and clean up the state of the class.
Don't use this function without first trying to use QUIT.
@see quit()
@access public
@return void | [
"Close",
"the",
"socket",
"and",
"clean",
"up",
"the",
"state",
"of",
"the",
"class",
".",
"Don",
"t",
"use",
"this",
"function",
"without",
"first",
"trying",
"to",
"use",
"QUIT",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.smtp.php#L473-L484 |
ClanCats/Core | src/bundles/Mail/PHPMailer/class.smtp.php | SMTP.data | public function data($msg_data)
{
if (!$this->sendCommand('DATA', 'DATA', 354)) {
return false;
}
/* The server is ready to accept data!
* According to rfc821 we should not send more than 1000 characters on a single line (including the CRLF)
* so we will break t... | php | public function data($msg_data)
{
if (!$this->sendCommand('DATA', 'DATA', 354)) {
return false;
}
/* The server is ready to accept data!
* According to rfc821 we should not send more than 1000 characters on a single line (including the CRLF)
* so we will break t... | [
"public",
"function",
"data",
"(",
"$",
"msg_data",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"sendCommand",
"(",
"'DATA'",
",",
"'DATA'",
",",
"354",
")",
")",
"{",
"return",
"false",
";",
"}",
"/* The server is ready to accept data!\n * According ... | Send an SMTP DATA command.
Issues a data command and sends the msg_data to the server,
finializing the mail transaction. $msg_data is the message
that is to be send with the headers. Each header needs to be
on a single line followed by a <CRLF> with the message headers
and the message body being separated by and additi... | [
"Send",
"an",
"SMTP",
"DATA",
"command",
".",
"Issues",
"a",
"data",
"command",
"and",
"sends",
"the",
"msg_data",
"to",
"the",
"server",
"finializing",
"the",
"mail",
"transaction",
".",
"$msg_data",
"is",
"the",
"message",
"that",
"is",
"to",
"be",
"send... | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.smtp.php#L498-L568 |
ClanCats/Core | src/bundles/Mail/PHPMailer/class.smtp.php | SMTP.sendHello | protected function sendHello($hello, $host)
{
$noerror = $this->sendCommand($hello, $hello . ' ' . $host, 250);
$this->helo_rply = $this->last_reply;
return $noerror;
} | php | protected function sendHello($hello, $host)
{
$noerror = $this->sendCommand($hello, $hello . ' ' . $host, 250);
$this->helo_rply = $this->last_reply;
return $noerror;
} | [
"protected",
"function",
"sendHello",
"(",
"$",
"hello",
",",
"$",
"host",
")",
"{",
"$",
"noerror",
"=",
"$",
"this",
"->",
"sendCommand",
"(",
"$",
"hello",
",",
"$",
"hello",
".",
"' '",
".",
"$",
"host",
",",
"250",
")",
";",
"$",
"this",
"->... | Send an SMTP HELO or EHLO command.
Low-level implementation used by hello()
@see hello()
@param string $hello The HELO string
@param string $host The hostname to say we are
@access protected
@return boolean | [
"Send",
"an",
"SMTP",
"HELO",
"or",
"EHLO",
"command",
".",
"Low",
"-",
"level",
"implementation",
"used",
"by",
"hello",
"()"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.smtp.php#L595-L600 |
ClanCats/Core | src/bundles/Mail/PHPMailer/class.smtp.php | SMTP.sendCommand | protected function sendCommand($command, $commandstring, $expect)
{
if (!$this->connected()) {
$this->error = array(
'error' => "Called $command without being connected"
);
return false;
}
$this->client_send($commandstring . self::CRLF);
... | php | protected function sendCommand($command, $commandstring, $expect)
{
if (!$this->connected()) {
$this->error = array(
'error' => "Called $command without being connected"
);
return false;
}
$this->client_send($commandstring . self::CRLF);
... | [
"protected",
"function",
"sendCommand",
"(",
"$",
"command",
",",
"$",
"commandstring",
",",
"$",
"expect",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"connected",
"(",
")",
")",
"{",
"$",
"this",
"->",
"error",
"=",
"array",
"(",
"'error'",
"=>",
... | Send a command to an SMTP server and check its return code.
@param string $command The command name - not sent to the server
@param string $commandstring The actual command to send
@param integer|array $expect One or more expected integer success codes
@access protected
@return boolean True on success. | [
"Send",
"a",
"command",
"to",
"an",
"SMTP",
"server",
"and",
"check",
"its",
"return",
"code",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.smtp.php#L680-L715 |
ClanCats/Core | src/bundles/Mail/PHPMailer/class.smtp.php | SMTP.turn | public function turn()
{
$this->error = array(
'error' => 'The SMTP TURN command is not implemented'
);
if ($this->do_debug >= 1) {
$this->edebug('SMTP NOTICE: ' . $this->error['error']);
}
return false;
} | php | public function turn()
{
$this->error = array(
'error' => 'The SMTP TURN command is not implemented'
);
if ($this->do_debug >= 1) {
$this->edebug('SMTP NOTICE: ' . $this->error['error']);
}
return false;
} | [
"public",
"function",
"turn",
"(",
")",
"{",
"$",
"this",
"->",
"error",
"=",
"array",
"(",
"'error'",
"=>",
"'The SMTP TURN command is not implemented'",
")",
";",
"if",
"(",
"$",
"this",
"->",
"do_debug",
">=",
"1",
")",
"{",
"$",
"this",
"->",
"edebug... | Send an SMTP TURN command.
This is an optional command for SMTP that this class does not support.
This method is here to make the RFC821 Definition complete for this class
and _may_ be implemented in future
Implements from rfc 821: TURN <CRLF>
@access public
@return boolean | [
"Send",
"an",
"SMTP",
"TURN",
"command",
".",
"This",
"is",
"an",
"optional",
"command",
"for",
"SMTP",
"that",
"this",
"class",
"does",
"not",
"support",
".",
"This",
"method",
"is",
"here",
"to",
"make",
"the",
"RFC821",
"Definition",
"complete",
"for",
... | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.smtp.php#L766-L775 |
ClanCats/Core | src/bundles/Mail/PHPMailer/class.smtp.php | SMTP.client_send | public function client_send($data)
{
if ($this->do_debug >= 1) {
$this->edebug("CLIENT -> SERVER: $data");
}
return fwrite($this->smtp_conn, $data);
} | php | public function client_send($data)
{
if ($this->do_debug >= 1) {
$this->edebug("CLIENT -> SERVER: $data");
}
return fwrite($this->smtp_conn, $data);
} | [
"public",
"function",
"client_send",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"do_debug",
">=",
"1",
")",
"{",
"$",
"this",
"->",
"edebug",
"(",
"\"CLIENT -> SERVER: $data\"",
")",
";",
"}",
"return",
"fwrite",
"(",
"$",
"this",
"->",
... | Send raw data to the server.
@param string $data The data to send
@access public
@return integer|boolean The number of bytes sent to the server or false on error | [
"Send",
"raw",
"data",
"to",
"the",
"server",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.smtp.php#L783-L789 |
SignpostMarv/daft-object | src/AbstractArrayBackedDaftObject.php | AbstractArrayBackedDaftObject.RetrievePropertyValueFromData | protected function RetrievePropertyValueFromData(string $property)
{
$isNullable = in_array(
$property,
static::DaftObjectNullableProperties(),
DefinitionAssistant::IN_ARRAY_STRICT_MODE
);
if ( ! array_key_exists($property, $this->data) && ! $isNullable) ... | php | protected function RetrievePropertyValueFromData(string $property)
{
$isNullable = in_array(
$property,
static::DaftObjectNullableProperties(),
DefinitionAssistant::IN_ARRAY_STRICT_MODE
);
if ( ! array_key_exists($property, $this->data) && ! $isNullable) ... | [
"protected",
"function",
"RetrievePropertyValueFromData",
"(",
"string",
"$",
"property",
")",
"{",
"$",
"isNullable",
"=",
"in_array",
"(",
"$",
"property",
",",
"static",
"::",
"DaftObjectNullableProperties",
"(",
")",
",",
"DefinitionAssistant",
"::",
"IN_ARRAY_S... | Retrieve a property from data.
@param string $property the property being retrieved
@throws Exceptions\PropertyNotNullableException if value is not set and $property is not listed as nullabe
@return scalar|array|object|null the property value | [
"Retrieve",
"a",
"property",
"from",
"data",
"."
] | train | https://github.com/SignpostMarv/daft-object/blob/514886592b64986cc637040045f098335e27c037/src/AbstractArrayBackedDaftObject.php#L180-L195 |
SignpostMarv/daft-object | src/AbstractArrayBackedDaftObject.php | AbstractArrayBackedDaftObject.MaybeModifyValueBeforeNudge | private function MaybeModifyValueBeforeNudge(
string $property,
$value,
bool $autoTrimStrings = self::BOOL_DEFAULT_AUTOTRIMSTRINGS,
bool $throwIfNotUnique = self::BOOL_DEFAULT_THROWIFNOTUNIQUE
) {
$spec = null;
if (
is_a(
static::class,
... | php | private function MaybeModifyValueBeforeNudge(
string $property,
$value,
bool $autoTrimStrings = self::BOOL_DEFAULT_AUTOTRIMSTRINGS,
bool $throwIfNotUnique = self::BOOL_DEFAULT_THROWIFNOTUNIQUE
) {
$spec = null;
if (
is_a(
static::class,
... | [
"private",
"function",
"MaybeModifyValueBeforeNudge",
"(",
"string",
"$",
"property",
",",
"$",
"value",
",",
"bool",
"$",
"autoTrimStrings",
"=",
"self",
"::",
"BOOL_DEFAULT_AUTOTRIMSTRINGS",
",",
"bool",
"$",
"throwIfNotUnique",
"=",
"self",
"::",
"BOOL_DEFAULT_TH... | @param scalar|array|object|null $value
@return scalar|array|object|null | [
"@param",
"scalar|array|object|null",
"$value"
] | train | https://github.com/SignpostMarv/daft-object/blob/514886592b64986cc637040045f098335e27c037/src/AbstractArrayBackedDaftObject.php#L291-L325 |
inpsyde/inpsyde-filter | src/WordPress/EscUrlRaw.php | EscUrlRaw.filter | public function filter( $value ) {
if ( ! is_scalar( $value ) || empty( $value ) ) {
do_action( 'inpsyde.filter.error', 'The given value is not scalar or empty.', [ 'method' => __METHOD__, 'value' => $value ] );
return $value;
}
return esc_url_raw( (string) $value, $this->options[ 'protocols' ] );
} | php | public function filter( $value ) {
if ( ! is_scalar( $value ) || empty( $value ) ) {
do_action( 'inpsyde.filter.error', 'The given value is not scalar or empty.', [ 'method' => __METHOD__, 'value' => $value ] );
return $value;
}
return esc_url_raw( (string) $value, $this->options[ 'protocols' ] );
} | [
"public",
"function",
"filter",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_scalar",
"(",
"$",
"value",
")",
"||",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"do_action",
"(",
"'inpsyde.filter.error'",
",",
"'The given value is not scalar or empty.'",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/inpsyde/inpsyde-filter/blob/777a6208ea4dfbeed89e6d0712a35dc25eab498b/src/WordPress/EscUrlRaw.php#L24-L33 |
egeloen/IvorySerializerBundle | DependencyInjection/Compiler/RegisterVisitorPass.php | RegisterVisitorPass.process | public function process(ContainerBuilder $container)
{
$mapping = [
'serialization' => Direction::SERIALIZATION,
'deserialization' => Direction::DESERIALIZATION,
];
$typeRegistry = $container->getDefinition('ivory.serializer.registry.visitor');
foreach ($c... | php | public function process(ContainerBuilder $container)
{
$mapping = [
'serialization' => Direction::SERIALIZATION,
'deserialization' => Direction::DESERIALIZATION,
];
$typeRegistry = $container->getDefinition('ivory.serializer.registry.visitor');
foreach ($c... | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"mapping",
"=",
"[",
"'serialization'",
"=>",
"Direction",
"::",
"SERIALIZATION",
",",
"'deserialization'",
"=>",
"Direction",
"::",
"DESERIALIZATION",
",",
"]",
";",
"$",... | {@inheritdoc} | [
"{"
] | train | https://github.com/egeloen/IvorySerializerBundle/blob/a2bdd912bf715c61b823cf7257ee232d5c823dd3/DependencyInjection/Compiler/RegisterVisitorPass.php#L27-L70 |
haldayne/boost | src/MapOfCollections.php | MapOfCollections.pluck | public function pluck($key_for_value, $key_for_key = null)
{
$map = new Map;
$this->walk(function ($v) use ($key_for_value, $key_for_key, $map) {
// get the key to use
if (null === $key_for_key) {
$key = null;
} else if ($v->has($key_for_key)) {
... | php | public function pluck($key_for_value, $key_for_key = null)
{
$map = new Map;
$this->walk(function ($v) use ($key_for_value, $key_for_key, $map) {
// get the key to use
if (null === $key_for_key) {
$key = null;
} else if ($v->has($key_for_key)) {
... | [
"public",
"function",
"pluck",
"(",
"$",
"key_for_value",
",",
"$",
"key_for_key",
"=",
"null",
")",
"{",
"$",
"map",
"=",
"new",
"Map",
";",
"$",
"this",
"->",
"walk",
"(",
"function",
"(",
"$",
"v",
")",
"use",
"(",
"$",
"key_for_value",
",",
"$"... | Create a new map by pulling the given key out of all contained maps.
Thinking of a Map of Collections as a two-dimensional array, this
method slices a column out:
```
use Haldayne\Boost\MapOfCollections;
$map = new MapOfCollections;
$map->push([ 'id' => 5, 'name' => 'Ada', 'age' => 16 ]);
$map->push([ 'id' => 6, 'nam... | [
"Create",
"a",
"new",
"map",
"by",
"pulling",
"the",
"given",
"key",
"out",
"of",
"all",
"contained",
"maps",
"."
] | train | https://github.com/haldayne/boost/blob/d18cc398557e23f9c316ea7fb40b90f84cc53650/src/MapOfCollections.php#L40-L61 |
Ocramius/OcraDiCompiler | src/OcraDiCompiler/Mvc/Service/DiFactory.php | DiFactory.createService | public function createService(ServiceLocatorInterface $serviceLocator)
{
$config = $serviceLocator->get('Config');
ErrorHandler::start();
$compiledInstantiators = include $config['ocra_di_compiler']['compiled_di_instantiator_filename'];
ErrorHandler::stop();
if (!is_array($... | php | public function createService(ServiceLocatorInterface $serviceLocator)
{
$config = $serviceLocator->get('Config');
ErrorHandler::start();
$compiledInstantiators = include $config['ocra_di_compiler']['compiled_di_instantiator_filename'];
ErrorHandler::stop();
if (!is_array($... | [
"public",
"function",
"createService",
"(",
"ServiceLocatorInterface",
"$",
"serviceLocator",
")",
"{",
"$",
"config",
"=",
"$",
"serviceLocator",
"->",
"get",
"(",
"'Config'",
")",
";",
"ErrorHandler",
"::",
"start",
"(",
")",
";",
"$",
"compiledInstantiators",... | Generates a compiled Di proxy to be used as a replacement for \Zend\Di\Di
@param ServiceLocatorInterface $serviceLocator
@return Di | [
"Generates",
"a",
"compiled",
"Di",
"proxy",
"to",
"be",
"used",
"as",
"a",
"replacement",
"for",
"\\",
"Zend",
"\\",
"Di",
"\\",
"Di"
] | train | https://github.com/Ocramius/OcraDiCompiler/blob/667f4b24771f27fb9c8d6c38ffaf72d9cd55ca4a/src/OcraDiCompiler/Mvc/Service/DiFactory.php#L55-L77 |
kherge-abandoned/php-wise | src/lib/Herrera/Wise/Util/ArrayUtil.php | ArrayUtil.flatten | public static function flatten(array $array, $prefix = '', $join = '.')
{
$flat = array();
foreach ($array as $key => $value) {
$key = $prefix ? $prefix . $join . $key : $key;
if (is_array($value)) {
$flat = array_merge(
$flat,
... | php | public static function flatten(array $array, $prefix = '', $join = '.')
{
$flat = array();
foreach ($array as $key => $value) {
$key = $prefix ? $prefix . $join . $key : $key;
if (is_array($value)) {
$flat = array_merge(
$flat,
... | [
"public",
"static",
"function",
"flatten",
"(",
"array",
"$",
"array",
",",
"$",
"prefix",
"=",
"''",
",",
"$",
"join",
"=",
"'.'",
")",
"{",
"$",
"flat",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"... | Flattens an associative array.
@param array $array An array.
@param string $prefix A key prefix.
@param string $join The key join character.
@return array The flattened array. | [
"Flattens",
"an",
"associative",
"array",
"."
] | train | https://github.com/kherge-abandoned/php-wise/blob/7621e0be7dbb2a015d68197d290fe8469f539a4d/src/lib/Herrera/Wise/Util/ArrayUtil.php#L21-L39 |
kherge-abandoned/php-wise | src/lib/Herrera/Wise/Util/ArrayUtil.php | ArrayUtil.walkRecursive | public static function walkRecursive(&$array, $callback, $data = null)
{
foreach ($array as $key => &$value) {
if (is_array($value)) {
self::walkRecursive($value, $callback, $data);
} else {
$callback($value, $key, $array, $data);
}
... | php | public static function walkRecursive(&$array, $callback, $data = null)
{
foreach ($array as $key => &$value) {
if (is_array($value)) {
self::walkRecursive($value, $callback, $data);
} else {
$callback($value, $key, $array, $data);
}
... | [
"public",
"static",
"function",
"walkRecursive",
"(",
"&",
"$",
"array",
",",
"$",
"callback",
",",
"$",
"data",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"&",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
... | Similar to `array_walk_recursive()`, but passes the current array too.
@param array &$array An array.
@param callable $callback The callable.
@param mixed $data The user data. | [
"Similar",
"to",
"array_walk_recursive",
"()",
"but",
"passes",
"the",
"current",
"array",
"too",
"."
] | train | https://github.com/kherge-abandoned/php-wise/blob/7621e0be7dbb2a015d68197d290fe8469f539a4d/src/lib/Herrera/Wise/Util/ArrayUtil.php#L48-L57 |
webforge-labs/psc-cms | lib/Psc/HTML/WidgetBase.php | WidgetBase.doInit | protected function doInit() {
if ($this->loadWith === self::JAVASCRIPT) {
jQuery::widget($this->html, $this->widgetName, (array) $this->widgetOptions);
} else {
$this->html
->setAttribute('data-widget', $this->widgetName)
->setAttribute('data-widget-options', $this->getJSONConverter(... | php | protected function doInit() {
if ($this->loadWith === self::JAVASCRIPT) {
jQuery::widget($this->html, $this->widgetName, (array) $this->widgetOptions);
} else {
$this->html
->setAttribute('data-widget', $this->widgetName)
->setAttribute('data-widget-options', $this->getJSONConverter(... | [
"protected",
"function",
"doInit",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"loadWith",
"===",
"self",
"::",
"JAVASCRIPT",
")",
"{",
"jQuery",
"::",
"widget",
"(",
"$",
"this",
"->",
"html",
",",
"$",
"this",
"->",
"widgetName",
",",
"(",
"array"... | Initialisiert das Widget des objektes
wenn loadWith === self::JAVASCRIPT ist
an das Element wird inline Javascript angehängt welcher jQuery( elementSelector ).$widgetName.({ $options}) aufruft
ansonsten wird im Element die attribute
data-widget und data-widget-options (ein JSON string) gesetzt | [
"Initialisiert",
"das",
"Widget",
"des",
"objektes"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/HTML/WidgetBase.php#L40-L50 |
freyo/flysystem-qcloud-cos-v3 | src/ServiceProvider.php | ServiceProvider.boot | public function boot()
{
if ($this->app instanceof LumenApplication) {
$this->app->configure('filesystems');
}
$this->app->make('filesystem')
->extend('cosv3', function ($app, $config) {
$flysystem = new Filesystem(new Adapter($config));
... | php | public function boot()
{
if ($this->app instanceof LumenApplication) {
$this->app->configure('filesystems');
}
$this->app->make('filesystem')
->extend('cosv3', function ($app, $config) {
$flysystem = new Filesystem(new Adapter($config));
... | [
"public",
"function",
"boot",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"app",
"instanceof",
"LumenApplication",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"configure",
"(",
"'filesystems'",
")",
";",
"}",
"$",
"this",
"->",
"app",
"->",
"make",
"(... | Bootstrap any application services.
@return void | [
"Bootstrap",
"any",
"application",
"services",
"."
] | train | https://github.com/freyo/flysystem-qcloud-cos-v3/blob/6bddbc22396aa1228942ec4c0ce46935d415f3b4/src/ServiceProvider.php#L22-L36 |
anime-db/app-bundle | src/Event/Listener/Project.php | Project.onUpdatedProposeUpdateTask | public function onUpdatedProposeUpdateTask()
{
/* @var $task Task */
$task = $this->em
->getRepository('AnimeDbAppBundle:Task')
->findOneBy(['command' => 'animedb:propose-update']);
$next_run = new \DateTime();
$next_run->modify(sprintf('+%s seconds 01:00:00... | php | public function onUpdatedProposeUpdateTask()
{
/* @var $task Task */
$task = $this->em
->getRepository('AnimeDbAppBundle:Task')
->findOneBy(['command' => 'animedb:propose-update']);
$next_run = new \DateTime();
$next_run->modify(sprintf('+%s seconds 01:00:00... | [
"public",
"function",
"onUpdatedProposeUpdateTask",
"(",
")",
"{",
"/* @var $task Task */",
"$",
"task",
"=",
"$",
"this",
"->",
"em",
"->",
"getRepository",
"(",
"'AnimeDbAppBundle:Task'",
")",
"->",
"findOneBy",
"(",
"[",
"'command'",
"=>",
"'animedb:propose-updat... | Update next run date for the propose update task. | [
"Update",
"next",
"run",
"date",
"for",
"the",
"propose",
"update",
"task",
"."
] | train | https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Event/Listener/Project.php#L52-L64 |
stanislav-web/phalcon-ulogin | src/ULogin/Init.php | Init.setProviders | public function setProviders($providers)
{
$array = Parser::map($providers);
// collection data
if (empty($array['required']) === false) {
$this->requiredProviders = implode(',', $array['required']);
}
if (empty($array['hidden']) === false) {
$this->... | php | public function setProviders($providers)
{
$array = Parser::map($providers);
// collection data
if (empty($array['required']) === false) {
$this->requiredProviders = implode(',', $array['required']);
}
if (empty($array['hidden']) === false) {
$this->... | [
"public",
"function",
"setProviders",
"(",
"$",
"providers",
")",
"{",
"$",
"array",
"=",
"Parser",
"::",
"map",
"(",
"$",
"providers",
")",
";",
"// collection data",
"if",
"(",
"empty",
"(",
"$",
"array",
"[",
"'required'",
"]",
")",
"===",
"false",
... | Allows you to add authentication providers in the list of available.
@param mixed $providers as ('provider' => true, 'provider' => false) or string separated by comma
@example <code>
$this->setProviders([
'vkontakte' => true,
'odnoklassniki' => true,
'mailru' => true,
'facebook' => true,
'twitter' ... | [
"Allows",
"you",
"to",
"add",
"authentication",
"providers",
"in",
"the",
"list",
"of",
"available",
"."
] | train | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Init.php#L129-L143 |
stanislav-web/phalcon-ulogin | src/ULogin/Init.php | Init.setFields | public function setFields($fields)
{
if (empty($fields) === false) {
if (is_array($fields) === true) {
$this->requiredFields = implode(',', $fields);
} else {
$this->requiredFields = $fields;
}
}
return $this;
} | php | public function setFields($fields)
{
if (empty($fields) === false) {
if (is_array($fields) === true) {
$this->requiredFields = implode(',', $fields);
} else {
$this->requiredFields = $fields;
}
}
return $this;
} | [
"public",
"function",
"setFields",
"(",
"$",
"fields",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"fields",
")",
"===",
"false",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"fields",
")",
"===",
"true",
")",
"{",
"$",
"this",
"->",
"requiredFields",
"=... | Allows you to add to the list of fields requested for the provider's authorization.
@param mixed $fields as ('field1', 'field2', ...) or string separated by comma
@example <code>
$this->setFields([
'first_name',
'last_name',
'photo'
]);
$this->setFields('first_name,last_name,photo');
</code>
@return Init | [
"Allows",
"you",
"to",
"add",
"to",
"the",
"list",
"of",
"fields",
"requested",
"for",
"the",
"provider",
"s",
"authorization",
"."
] | train | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Init.php#L160-L174 |
stanislav-web/phalcon-ulogin | src/ULogin/Init.php | Init.setOptional | public function setOptional($fields)
{
if (empty($fields) === false) {
if (is_array($fields) === true) {
$this->optionalFields = implode(',', $fields);
} else {
$this->optionalFields = $fields;
}
}
return $this;
} | php | public function setOptional($fields)
{
if (empty($fields) === false) {
if (is_array($fields) === true) {
$this->optionalFields = implode(',', $fields);
} else {
$this->optionalFields = $fields;
}
}
return $this;
} | [
"public",
"function",
"setOptional",
"(",
"$",
"fields",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"fields",
")",
"===",
"false",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"fields",
")",
"===",
"true",
")",
"{",
"$",
"this",
"->",
"optionalFields",
... | Allows you to add to the list of optionals fields.
@param mixed $fields as ('field1', 'field2', ...) or string separated by comma
@example <code>
$this->setOptional([
'bday',
'city',
'sex'
]);
$this->setOptional('bday,city,sex');
</code>
@return Init | [
"Allows",
"you",
"to",
"add",
"to",
"the",
"list",
"of",
"optionals",
"fields",
"."
] | train | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Init.php#L191-L206 |
stanislav-web/phalcon-ulogin | src/ULogin/Init.php | Init.setType | public function setType($type)
{
if(is_array($type) === true) {
$type = $type[key($type)];
}
$this->types = array_flip($this->types);
if (isset($this->types[$type]) === true) {
$this->widget = $type;
}
return $this;
} | php | public function setType($type)
{
if(is_array($type) === true) {
$type = $type[key($type)];
}
$this->types = array_flip($this->types);
if (isset($this->types[$type]) === true) {
$this->widget = $type;
}
return $this;
} | [
"public",
"function",
"setType",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"type",
")",
"===",
"true",
")",
"{",
"$",
"type",
"=",
"$",
"type",
"[",
"key",
"(",
"$",
"type",
")",
"]",
";",
"}",
"$",
"this",
"->",
"types",
"... | Lets you specify the widget type. Must match the variable `types`
@param $type
@example <code>
$this->setType('small');
</code>
@return Init | [
"Lets",
"you",
"specify",
"the",
"widget",
"type",
".",
"Must",
"match",
"the",
"variable",
"types"
] | train | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Init.php#L217-L231 |
stanislav-web/phalcon-ulogin | src/ULogin/Init.php | Init.setUrl | public function setUrl($url = '')
{
if(is_array($url) === true) {
$url = $url[key($url)];
}
$request = new Request();
if (empty($url) === true) {
$this->url = $request->getScheme() . '://' . $request->getHttpHost() . (new Router())->getRewriteUri();
... | php | public function setUrl($url = '')
{
if(is_array($url) === true) {
$url = $url[key($url)];
}
$request = new Request();
if (empty($url) === true) {
$this->url = $request->getScheme() . '://' . $request->getHttpHost() . (new Router())->getRewriteUri();
... | [
"public",
"function",
"setUrl",
"(",
"$",
"url",
"=",
"''",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"url",
")",
"===",
"true",
")",
"{",
"$",
"url",
"=",
"$",
"url",
"[",
"key",
"(",
"$",
"url",
")",
"]",
";",
"}",
"$",
"request",
"=",
"... | Lets you specify the callback url to redirect to when authorizing the page is reloaded.
If the url is not specified and is used to redirect the authorization,
the authorization after the current page just updated
@param string $url page that will be implemented to redirect after login (accept QUERY_STRING)
@return $th... | [
"Lets",
"you",
"specify",
"the",
"callback",
"url",
"to",
"redirect",
"to",
"when",
"authorizing",
"the",
"page",
"is",
"reloaded",
".",
"If",
"the",
"url",
"is",
"not",
"specified",
"and",
"is",
"used",
"to",
"redirect",
"the",
"authorization",
"the",
"au... | train | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Init.php#L241-L257 |
stanislav-web/phalcon-ulogin | src/ULogin/Init.php | Init.destroyUserData | private function destroyUserData()
{
if (is_array($this->user) === true
&& isset($this->user["error"]) === true
) {
$this->user = false;
return true;
}
return false;
} | php | private function destroyUserData()
{
if (is_array($this->user) === true
&& isset($this->user["error"]) === true
) {
$this->user = false;
return true;
}
return false;
} | [
"private",
"function",
"destroyUserData",
"(",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"user",
")",
"===",
"true",
"&&",
"isset",
"(",
"$",
"this",
"->",
"user",
"[",
"\"error\"",
"]",
")",
"===",
"true",
")",
"{",
"$",
"this",
"->... | Destroy user data
@return bool | [
"Destroy",
"user",
"data"
] | train | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Init.php#L264-L274 |
stanislav-web/phalcon-ulogin | src/ULogin/Init.php | Init.getToken | public function getToken()
{
$request = new Request();
if ($request->isPost() === true) {
$this->token = $request->getPost('token', null, false);
} else {
$this->token = $request->getQuery('token', null, false);
}
return $this->token;
} | php | public function getToken()
{
$request = new Request();
if ($request->isPost() === true) {
$this->token = $request->getPost('token', null, false);
} else {
$this->token = $request->getQuery('token', null, false);
}
return $this->token;
} | [
"public",
"function",
"getToken",
"(",
")",
"{",
"$",
"request",
"=",
"new",
"Request",
"(",
")",
";",
"if",
"(",
"$",
"request",
"->",
"isPost",
"(",
")",
"===",
"true",
")",
"{",
"$",
"this",
"->",
"token",
"=",
"$",
"request",
"->",
"getPost",
... | Reads the parameters passed to the script, and selects the authorization key ULogin
@return bool|mixed | [
"Reads",
"the",
"parameters",
"passed",
"to",
"the",
"script",
"and",
"selects",
"the",
"authorization",
"key",
"ULogin"
] | train | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Init.php#L281-L293 |
stanislav-web/phalcon-ulogin | src/ULogin/Init.php | Init.getUser | public function getUser()
{
// destroy previous content
$this->destroyUserData();
if ($this->user === false) {
// get user
$url = 'http://ulogin.ru/token.php?token=' . $this->getToken() . '&host=' . (new Request())->getHttpHost();
$content = file_get_c... | php | public function getUser()
{
// destroy previous content
$this->destroyUserData();
if ($this->user === false) {
// get user
$url = 'http://ulogin.ru/token.php?token=' . $this->getToken() . '&host=' . (new Request())->getHttpHost();
$content = file_get_c... | [
"public",
"function",
"getUser",
"(",
")",
"{",
"// destroy previous content",
"$",
"this",
"->",
"destroyUserData",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"user",
"===",
"false",
")",
"{",
"// get user",
"$",
"url",
"=",
"'http://ulogin.ru/token.php?tok... | Returns an associative array with the data about the user.
Fields array described in the method setFields
@example <code>
$this->getUser();
</code>
@return array|bool|mixed data provided by the ISP login | [
"Returns",
"an",
"associative",
"array",
"with",
"the",
"data",
"about",
"the",
"user",
".",
"Fields",
"array",
"described",
"in",
"the",
"method",
"setFields"
] | train | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Init.php#L305-L326 |
stanislav-web/phalcon-ulogin | src/ULogin/Init.php | Init.isAuthorised | public function isAuthorised()
{
if (is_array($this->user) === true
&& isset($this->user['error']) === false
) {
return true;
}
return $this->getUser();
} | php | public function isAuthorised()
{
if (is_array($this->user) === true
&& isset($this->user['error']) === false
) {
return true;
}
return $this->getUser();
} | [
"public",
"function",
"isAuthorised",
"(",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"user",
")",
"===",
"true",
"&&",
"isset",
"(",
"$",
"this",
"->",
"user",
"[",
"'error'",
"]",
")",
"===",
"false",
")",
"{",
"return",
"true",
";"... | Checks whether logon
@return array|bool|mixed | [
"Checks",
"whether",
"logon"
] | train | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Init.php#L333-L344 |
stanislav-web/phalcon-ulogin | src/ULogin/Init.php | Init.getForm | public function getForm()
{
$view = new View();
return $view->render(__DIR__ . '/../views/ulogin', [
'widget' => $this->widget,
'fields' => $this->requiredFields,
'optional' => $this->optionalFields,
'providers' => $this->requiredProviders,
... | php | public function getForm()
{
$view = new View();
return $view->render(__DIR__ . '/../views/ulogin', [
'widget' => $this->widget,
'fields' => $this->requiredFields,
'optional' => $this->optionalFields,
'providers' => $this->requiredProviders,
... | [
"public",
"function",
"getForm",
"(",
")",
"{",
"$",
"view",
"=",
"new",
"View",
"(",
")",
";",
"return",
"$",
"view",
"->",
"render",
"(",
"__DIR__",
".",
"'/../views/ulogin'",
",",
"[",
"'widget'",
"=>",
"$",
"this",
"->",
"widget",
",",
"'fields'",
... | Returns the html-form widget
@return View | [
"Returns",
"the",
"html",
"-",
"form",
"widget"
] | train | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Init.php#L366-L380 |
jfusion/org.jfusion.framework | src/Installer/Installer.php | Installer.setOverwrite | public function setOverwrite($state = false)
{
$tmp = $this->overwrite;
if ($state)
{
$this->overwrite = true;
}
else
{
$this->overwrite = false;
}
return $tmp;
} | php | public function setOverwrite($state = false)
{
$tmp = $this->overwrite;
if ($state)
{
$this->overwrite = true;
}
else
{
$this->overwrite = false;
}
return $tmp;
} | [
"public",
"function",
"setOverwrite",
"(",
"$",
"state",
"=",
"false",
")",
"{",
"$",
"tmp",
"=",
"$",
"this",
"->",
"overwrite",
";",
"if",
"(",
"$",
"state",
")",
"{",
"$",
"this",
"->",
"overwrite",
"=",
"true",
";",
"}",
"else",
"{",
"$",
"th... | Set the allow overwrite switch
@param boolean $state Overwrite switch state
@return boolean True it state is set, false if it is not
@since 3.1 | [
"Set",
"the",
"allow",
"overwrite",
"switch"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Installer/Installer.php#L125-L139 |
jfusion/org.jfusion.framework | src/Installer/Installer.php | Installer.setUpgrade | public function setUpgrade($state = false)
{
$tmp = $this->upgrade;
if ($state)
{
$this->upgrade = true;
}
else
{
$this->upgrade = false;
}
return $tmp;
} | php | public function setUpgrade($state = false)
{
$tmp = $this->upgrade;
if ($state)
{
$this->upgrade = true;
}
else
{
$this->upgrade = false;
}
return $tmp;
} | [
"public",
"function",
"setUpgrade",
"(",
"$",
"state",
"=",
"false",
")",
"{",
"$",
"tmp",
"=",
"$",
"this",
"->",
"upgrade",
";",
"if",
"(",
"$",
"state",
")",
"{",
"$",
"this",
"->",
"upgrade",
"=",
"true",
";",
"}",
"else",
"{",
"$",
"this",
... | Set the upgrade switch
@param boolean $state Upgrade switch state
@return boolean True if upgrade, false otherwise
@since 3.1 | [
"Set",
"the",
"upgrade",
"switch"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Installer/Installer.php#L162-L176 |
jfusion/org.jfusion.framework | src/Installer/Installer.php | Installer.getPath | public function getPath($name, $default = null)
{
return (!empty($this->paths[$name])) ? $this->paths[$name] : $default;
} | php | public function getPath($name, $default = null)
{
return (!empty($this->paths[$name])) ? $this->paths[$name] : $default;
} | [
"public",
"function",
"getPath",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"return",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"paths",
"[",
"$",
"name",
"]",
")",
")",
"?",
"$",
"this",
"->",
"paths",
"[",
"$",
"name",
"]"... | Get an installer path by name
@param string $name Path name
@param string $default Default value
@return string Path
@since 3.1 | [
"Get",
"an",
"installer",
"path",
"by",
"name"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Installer/Installer.php#L188-L191 |
jfusion/org.jfusion.framework | src/Installer/Installer.php | Installer.abort | public function abort($msg = null, $type = null)
{
$retval = true;
$step = array_pop($this->stepStack);
// Raise abort warning
if ($msg)
{
$this->log(LogLevel::WARNING, $msg);
}
while ($step != null)
{
switch ($step['type'])
{
case 'file':
// Remove the file
$stepval = File::de... | php | public function abort($msg = null, $type = null)
{
$retval = true;
$step = array_pop($this->stepStack);
// Raise abort warning
if ($msg)
{
$this->log(LogLevel::WARNING, $msg);
}
while ($step != null)
{
switch ($step['type'])
{
case 'file':
// Remove the file
$stepval = File::de... | [
"public",
"function",
"abort",
"(",
"$",
"msg",
"=",
"null",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"retval",
"=",
"true",
";",
"$",
"step",
"=",
"array_pop",
"(",
"$",
"this",
"->",
"stepStack",
")",
";",
"// Raise abort warning",
"if",
"(",
... | Installation abort method
@param string $msg Abort message from the installer
@param string $type Package type if defined
@return boolean True if successful
@since 3.1
@throws RuntimeException | [
"Installation",
"abort",
"method"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Installer/Installer.php#L233-L279 |
jfusion/org.jfusion.framework | src/Installer/Installer.php | Installer.parseFiles | public function parseFiles(SimpleXMLElement $element, $cid = 0, $oldFiles = null, $oldMD5 = null)
{
// Get the array of file nodes to process; we checked whether this had children above.
if (!$element || !$element->children()->count())
{
// Either the tag does not exist or has no children (hence no files to p... | php | public function parseFiles(SimpleXMLElement $element, $cid = 0, $oldFiles = null, $oldMD5 = null)
{
// Get the array of file nodes to process; we checked whether this had children above.
if (!$element || !$element->children()->count())
{
// Either the tag does not exist or has no children (hence no files to p... | [
"public",
"function",
"parseFiles",
"(",
"SimpleXMLElement",
"$",
"element",
",",
"$",
"cid",
"=",
"0",
",",
"$",
"oldFiles",
"=",
"null",
",",
"$",
"oldMD5",
"=",
"null",
")",
"{",
"// Get the array of file nodes to process; we checked whether this had children above... | Method to parse through a files element of the installation manifest and take appropriate
action.
@param SimpleXMLElement $element The XML node to process
@param integer $cid Application ID of application to install to
@param array $oldFiles List of old files (SimpleXMLElement's)
... | [
"Method",
"to",
"parse",
"through",
"a",
"files",
"element",
"of",
"the",
"installation",
"manifest",
"and",
"take",
"appropriate",
"action",
"."
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Installer/Installer.php#L295-L400 |
jfusion/org.jfusion.framework | src/Installer/Installer.php | Installer.copyFiles | public function copyFiles($files, $overwrite = null)
{
/*
* To allow for manual override on the overwriting flag, we check to see if
* the $overwrite flag was set and is a boolean value. If not, use the object
* allowOverwrite flag.
*/
if (is_null($overwrite) || !is_bool($overwrite))
{
$overwrit... | php | public function copyFiles($files, $overwrite = null)
{
/*
* To allow for manual override on the overwriting flag, we check to see if
* the $overwrite flag was set and is a boolean value. If not, use the object
* allowOverwrite flag.
*/
if (is_null($overwrite) || !is_bool($overwrite))
{
$overwrit... | [
"public",
"function",
"copyFiles",
"(",
"$",
"files",
",",
"$",
"overwrite",
"=",
"null",
")",
"{",
"/*\n\t\t * To allow for manual override on the overwriting flag, we check to see if\n\t\t * the $overwrite flag was set and is a boolean value. If not, use the object\n\t\t * allowOverwrit... | Copyfiles
Copy files from source directory to the target directory
@param array $files Array with filenames
@param boolean $overwrite True if existing files can be replaced
@return boolean True on success
@since 3.1 | [
"Copyfiles"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Installer/Installer.php#L414-L516 |
jfusion/org.jfusion.framework | src/Installer/Installer.php | Installer.findDeletedFiles | public function findDeletedFiles($old_files, $new_files)
{
// The magic find deleted files function!
// The files that are new
$files = array();
// The folders that are new
$folders = array();
// The folders of the files that are new
$containers = array();
// A list of files to delete
$files_delet... | php | public function findDeletedFiles($old_files, $new_files)
{
// The magic find deleted files function!
// The files that are new
$files = array();
// The folders that are new
$folders = array();
// The folders of the files that are new
$containers = array();
// A list of files to delete
$files_delet... | [
"public",
"function",
"findDeletedFiles",
"(",
"$",
"old_files",
",",
"$",
"new_files",
")",
"{",
"// The magic find deleted files function!",
"// The files that are new",
"$",
"files",
"=",
"array",
"(",
")",
";",
"// The folders that are new",
"$",
"folders",
"=",
"... | Compares two "files" entries to find deleted files/folders
@param array[SimpleXMLElement] $old_files An array of SimpleXMLElement objects that are the old files
@param array[SimpleXMLElement] $new_files An array of SimpleXMLElement objects that are the new files
@return array An array with the delete files ... | [
"Compares",
"two",
"files",
"entries",
"to",
"find",
"deleted",
"files",
"/",
"folders"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Installer/Installer.php#L528-L626 |
Lansoweb/LosReCaptcha | src/Service/Request/ZendHttpClient.php | ZendHttpClient.send | public function send(Parameters $params)
{
$this->client->setUri(ReCaptcha::VERIFY_SERVER);
$this->client->setRawBody($params->toQueryString());
$this->client->setEncType('application/x-www-form-urlencoded');
$result = $this->client->setMethod('POST')->send();
return $result ... | php | public function send(Parameters $params)
{
$this->client->setUri(ReCaptcha::VERIFY_SERVER);
$this->client->setRawBody($params->toQueryString());
$this->client->setEncType('application/x-www-form-urlencoded');
$result = $this->client->setMethod('POST')->send();
return $result ... | [
"public",
"function",
"send",
"(",
"Parameters",
"$",
"params",
")",
"{",
"$",
"this",
"->",
"client",
"->",
"setUri",
"(",
"ReCaptcha",
"::",
"VERIFY_SERVER",
")",
";",
"$",
"this",
"->",
"client",
"->",
"setRawBody",
"(",
"$",
"params",
"->",
"toQueryS... | Submit ReCaptcha API request, return response body.
@param Parameters $params ReCaptcha parameters
@return string | [
"Submit",
"ReCaptcha",
"API",
"request",
"return",
"response",
"body",
"."
] | train | https://github.com/Lansoweb/LosReCaptcha/blob/8df866995501db087c3850f97fd2b6547632e6ed/src/Service/Request/ZendHttpClient.php#L33-L40 |
Chill-project/Main | Entity/Address.php | Address.setPostcode | public function setPostcode(\Chill\MainBundle\Entity\PostalCode $postcode = null)
{
$this->postcode = $postcode;
return $this;
} | php | public function setPostcode(\Chill\MainBundle\Entity\PostalCode $postcode = null)
{
$this->postcode = $postcode;
return $this;
} | [
"public",
"function",
"setPostcode",
"(",
"\\",
"Chill",
"\\",
"MainBundle",
"\\",
"Entity",
"\\",
"PostalCode",
"$",
"postcode",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"postcode",
"=",
"$",
"postcode",
";",
"return",
"$",
"this",
";",
"}"
] | Set postcode
@param \Chill\MainBundle\Entity\PostalCode $postcode
@return Address | [
"Set",
"postcode"
] | train | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Entity/Address.php#L107-L112 |
windwork/wf-mailer | lib/adapter/SMTP.php | SMTP.send | public function send($to, $subject, $message, $from = '', $cc = '', $bcc = '')
{
// 端口
$this->cfg['port'] = empty($this->cfg['port']) ? 25 : $this->cfg['port'];
// SMTP发送邮件账号必须与发件人一致
$from = $this->cfg['user'];
$to = \wf\mailer\Helper::emailEncode($to)... | php | public function send($to, $subject, $message, $from = '', $cc = '', $bcc = '')
{
// 端口
$this->cfg['port'] = empty($this->cfg['port']) ? 25 : $this->cfg['port'];
// SMTP发送邮件账号必须与发件人一致
$from = $this->cfg['user'];
$to = \wf\mailer\Helper::emailEncode($to)... | [
"public",
"function",
"send",
"(",
"$",
"to",
",",
"$",
"subject",
",",
"$",
"message",
",",
"$",
"from",
"=",
"''",
",",
"$",
"cc",
"=",
"''",
",",
"$",
"bcc",
"=",
"''",
")",
"{",
"// 端口",
"$",
"this",
"->",
"cfg",
"[",
"'port'",
"]",
"=",
... | {@inheritDoc}
@see \wf\mailer\MailerInterface::send() | [
"{"
] | train | https://github.com/windwork/wf-mailer/blob/71fbdb3bcb5bdc0a53fa8b4433c446828e205d22/lib/adapter/SMTP.php#L42-L160 |
wikimedia/CLDRPluralRuleParser | src/Converter/Operator.php | Operator.operate | public function operate( Expression $left, Expression $right ) {
$typeSpec = self::$opTypes[$this->name];
$leftType = self::$typeSpecMap[$typeSpec[0]];
$rightType = self::$typeSpecMap[$typeSpec[1]];
$resultType = self::$typeSpecMap[$typeSpec[2]];
$start = min( $this->pos, $left->pos, $right->pos );
$end =... | php | public function operate( Expression $left, Expression $right ) {
$typeSpec = self::$opTypes[$this->name];
$leftType = self::$typeSpecMap[$typeSpec[0]];
$rightType = self::$typeSpecMap[$typeSpec[1]];
$resultType = self::$typeSpecMap[$typeSpec[2]];
$start = min( $this->pos, $left->pos, $right->pos );
$end =... | [
"public",
"function",
"operate",
"(",
"Expression",
"$",
"left",
",",
"Expression",
"$",
"right",
")",
"{",
"$",
"typeSpec",
"=",
"self",
"::",
"$",
"opTypes",
"[",
"$",
"this",
"->",
"name",
"]",
";",
"$",
"leftType",
"=",
"self",
"::",
"$",
"typeSp... | Compute the operation
@param Expression $left The left part of the expression
@param Expression $right The right part of the expression
@return Expression The result of the operation | [
"Compute",
"the",
"operation"
] | train | https://github.com/wikimedia/CLDRPluralRuleParser/blob/4c5d71a3fd62a75871da8562310ca2258647ee6d/src/Converter/Operator.php#L89-L113 |
GrahamDeprecated/CMS-Core | src/Seeds/GroupsTableSeeder.php | GroupsTableSeeder.run | public function run()
{
DB::table('groups')->delete();
// users
$permissions = array('user' => 1, 'edit' => 0, 'blog' => 0, 'mod' => 0, 'admin' => 0);
$group = array('name' => 'Users', 'permissions' => $permissions);
Credentials::getGroupProvider()->create($group);
... | php | public function run()
{
DB::table('groups')->delete();
// users
$permissions = array('user' => 1, 'edit' => 0, 'blog' => 0, 'mod' => 0, 'admin' => 0);
$group = array('name' => 'Users', 'permissions' => $permissions);
Credentials::getGroupProvider()->create($group);
... | [
"public",
"function",
"run",
"(",
")",
"{",
"DB",
"::",
"table",
"(",
"'groups'",
")",
"->",
"delete",
"(",
")",
";",
"// users",
"$",
"permissions",
"=",
"array",
"(",
"'user'",
"=>",
"1",
",",
"'edit'",
"=>",
"0",
",",
"'blog'",
"=>",
"0",
",",
... | Run the database seeding.
@return void | [
"Run",
"the",
"database",
"seeding",
"."
] | train | https://github.com/GrahamDeprecated/CMS-Core/blob/5603e2bfa2fac6cf46ca3ed62d21518f2f653675/src/Seeds/GroupsTableSeeder.php#L39-L67 |
steeffeen/FancyManiaLinks | FML/Script/Features/Paging.php | Paging.addPageControl | public function addPageControl(Control $pageControl, $pageNumber = null)
{
if ($pageNumber === null) {
$pageNumber = count($this->pages) + 1;
}
$page = new PagingPage($pageControl, $pageNumber);
return $this->addPage($page);
} | php | public function addPageControl(Control $pageControl, $pageNumber = null)
{
if ($pageNumber === null) {
$pageNumber = count($this->pages) + 1;
}
$page = new PagingPage($pageControl, $pageNumber);
return $this->addPage($page);
} | [
"public",
"function",
"addPageControl",
"(",
"Control",
"$",
"pageControl",
",",
"$",
"pageNumber",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"pageNumber",
"===",
"null",
")",
"{",
"$",
"pageNumber",
"=",
"count",
"(",
"$",
"this",
"->",
"pages",
")",
"+"... | Add a new Page Control
@api
@param Control $pageControl Page Control
@param string $pageNumber (optional) Page number
@return static | [
"Add",
"a",
"new",
"Page",
"Control"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Paging.php#L133-L140 |
steeffeen/FancyManiaLinks | FML/Script/Features/Paging.php | Paging.addPage | public function addPage(PagingPage $page)
{
if (!in_array($page, $this->pages, true)) {
array_push($this->pages, $page);
}
return $this;
} | php | public function addPage(PagingPage $page)
{
if (!in_array($page, $this->pages, true)) {
array_push($this->pages, $page);
}
return $this;
} | [
"public",
"function",
"addPage",
"(",
"PagingPage",
"$",
"page",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"page",
",",
"$",
"this",
"->",
"pages",
",",
"true",
")",
")",
"{",
"array_push",
"(",
"$",
"this",
"->",
"pages",
",",
"$",
"page",
... | Add a new Page
@api
@param PagingPage $page Page
@return static | [
"Add",
"a",
"new",
"Page"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Paging.php#L149-L155 |
steeffeen/FancyManiaLinks | FML/Script/Features/Paging.php | Paging.setPages | public function setPages(array $pages)
{
$this->pages = array();
foreach ($pages as $page) {
$this->addPage($page);
}
return $this;
} | php | public function setPages(array $pages)
{
$this->pages = array();
foreach ($pages as $page) {
$this->addPage($page);
}
return $this;
} | [
"public",
"function",
"setPages",
"(",
"array",
"$",
"pages",
")",
"{",
"$",
"this",
"->",
"pages",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"pages",
"as",
"$",
"page",
")",
"{",
"$",
"this",
"->",
"addPage",
"(",
"$",
"page",
")",
";",
... | Add new Pages
@api
@param PagingPage[] $pages Pages
@return static | [
"Add",
"new",
"Pages"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Paging.php#L164-L171 |
steeffeen/FancyManiaLinks | FML/Script/Features/Paging.php | Paging.addButtonControl | public function addButtonControl(Control $buttonControl, $browseAction = null)
{
if ($browseAction === null) {
$buttonCount = count($this->buttons);
if ($buttonCount % 2 === 0) {
$browseAction = $buttonCount / 2 + 1;
} else {
$browseAction ... | php | public function addButtonControl(Control $buttonControl, $browseAction = null)
{
if ($browseAction === null) {
$buttonCount = count($this->buttons);
if ($buttonCount % 2 === 0) {
$browseAction = $buttonCount / 2 + 1;
} else {
$browseAction ... | [
"public",
"function",
"addButtonControl",
"(",
"Control",
"$",
"buttonControl",
",",
"$",
"browseAction",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"browseAction",
"===",
"null",
")",
"{",
"$",
"buttonCount",
"=",
"count",
"(",
"$",
"this",
"->",
"buttons",
... | Add a new Button Control to browse through the Pages
@api
@param Control $buttonControl Button used for browsing
@param int $browseAction (optional) Number of browsed Pages per click
@return static | [
"Add",
"a",
"new",
"Button",
"Control",
"to",
"browse",
"through",
"the",
"Pages"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Paging.php#L192-L204 |
steeffeen/FancyManiaLinks | FML/Script/Features/Paging.php | Paging.addButton | public function addButton(PagingButton $button)
{
if (!in_array($button, $this->buttons, true)) {
array_push($this->buttons, $button);
}
return $this;
} | php | public function addButton(PagingButton $button)
{
if (!in_array($button, $this->buttons, true)) {
array_push($this->buttons, $button);
}
return $this;
} | [
"public",
"function",
"addButton",
"(",
"PagingButton",
"$",
"button",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"button",
",",
"$",
"this",
"->",
"buttons",
",",
"true",
")",
")",
"{",
"array_push",
"(",
"$",
"this",
"->",
"buttons",
",",
"$",... | Add a new Button to browse through Pages
@api
@param PagingButton $button Paging Button
@return static | [
"Add",
"a",
"new",
"Button",
"to",
"browse",
"through",
"Pages"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Paging.php#L213-L219 |
steeffeen/FancyManiaLinks | FML/Script/Features/Paging.php | Paging.setButtons | public function setButtons(array $buttons)
{
$this->buttons = array();
foreach ($buttons as $button) {
$this->addButton($button);
}
return $this;
} | php | public function setButtons(array $buttons)
{
$this->buttons = array();
foreach ($buttons as $button) {
$this->addButton($button);
}
return $this;
} | [
"public",
"function",
"setButtons",
"(",
"array",
"$",
"buttons",
")",
"{",
"$",
"this",
"->",
"buttons",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"buttons",
"as",
"$",
"button",
")",
"{",
"$",
"this",
"->",
"addButton",
"(",
"$",
"button",
... | Set the Paging Buttons
@api
@param PagingButton[] $buttons Paging Buttons
@return static | [
"Set",
"the",
"Paging",
"Buttons"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Paging.php#L228-L235 |
steeffeen/FancyManiaLinks | FML/Script/Features/Paging.php | Paging.getMinPage | protected function getMinPage()
{
$minPageNumber = null;
$minPage = null;
foreach ($this->pages as $page) {
$pageNumber = $page->getPageNumber();
if ($minPageNumber === null || $pageNumber < $minPageNumber) {
$minPageNumber = $pageNumber;
... | php | protected function getMinPage()
{
$minPageNumber = null;
$minPage = null;
foreach ($this->pages as $page) {
$pageNumber = $page->getPageNumber();
if ($minPageNumber === null || $pageNumber < $minPageNumber) {
$minPageNumber = $pageNumber;
... | [
"protected",
"function",
"getMinPage",
"(",
")",
"{",
"$",
"minPageNumber",
"=",
"null",
";",
"$",
"minPage",
"=",
"null",
";",
"foreach",
"(",
"$",
"this",
"->",
"pages",
"as",
"$",
"page",
")",
"{",
"$",
"pageNumber",
"=",
"$",
"page",
"->",
"getPa... | Get the minimum Page
@return PagingPage | [
"Get",
"the",
"minimum",
"Page"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Paging.php#L466-L478 |
steeffeen/FancyManiaLinks | FML/Script/Features/Paging.php | Paging.getMaxPage | protected function getMaxPage()
{
$maxPageNumber = null;
$maxPage = null;
foreach ($this->pages as $page) {
$pageNumber = $page->getPageNumber();
if ($maxPageNumber === null || $pageNumber > $maxPageNumber) {
$maxPageNumber = $pageNumber;
... | php | protected function getMaxPage()
{
$maxPageNumber = null;
$maxPage = null;
foreach ($this->pages as $page) {
$pageNumber = $page->getPageNumber();
if ($maxPageNumber === null || $pageNumber > $maxPageNumber) {
$maxPageNumber = $pageNumber;
... | [
"protected",
"function",
"getMaxPage",
"(",
")",
"{",
"$",
"maxPageNumber",
"=",
"null",
";",
"$",
"maxPage",
"=",
"null",
";",
"foreach",
"(",
"$",
"this",
"->",
"pages",
"as",
"$",
"page",
")",
"{",
"$",
"pageNumber",
"=",
"$",
"page",
"->",
"getPa... | Get the maximum Page
@return PagingPage | [
"Get",
"the",
"maximum",
"Page"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Paging.php#L485-L497 |
steeffeen/FancyManiaLinks | FML/Script/Features/Paging.php | Paging.getPagesArrayText | protected function getPagesArrayText()
{
if (empty($this->pages)) {
return Builder::getArray(array(0 => ''), true);
}
$pages = array();
foreach ($this->pages as $page) {
$pages[$page->getPageNumber()] = $page->getControl()
... | php | protected function getPagesArrayText()
{
if (empty($this->pages)) {
return Builder::getArray(array(0 => ''), true);
}
$pages = array();
foreach ($this->pages as $page) {
$pages[$page->getPageNumber()] = $page->getControl()
... | [
"protected",
"function",
"getPagesArrayText",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"pages",
")",
")",
"{",
"return",
"Builder",
"::",
"getArray",
"(",
"array",
"(",
"0",
"=>",
"''",
")",
",",
"true",
")",
";",
"}",
"$",
"pages... | Build the array text for the Pages
@return string | [
"Build",
"the",
"array",
"text",
"for",
"the",
"Pages"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Paging.php#L504-L515 |
steeffeen/FancyManiaLinks | FML/Script/Features/Paging.php | Paging.getPageButtonsArrayText | protected function getPageButtonsArrayText()
{
if (empty($this->buttons)) {
return Builder::getArray(array('' => 0), true);
}
$pageButtons = array();
foreach ($this->buttons as $pageButton) {
$pageButtons[$pageButton->getControl()
... | php | protected function getPageButtonsArrayText()
{
if (empty($this->buttons)) {
return Builder::getArray(array('' => 0), true);
}
$pageButtons = array();
foreach ($this->buttons as $pageButton) {
$pageButtons[$pageButton->getControl()
... | [
"protected",
"function",
"getPageButtonsArrayText",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"buttons",
")",
")",
"{",
"return",
"Builder",
"::",
"getArray",
"(",
"array",
"(",
"''",
"=>",
"0",
")",
",",
"true",
")",
";",
"}",
"$",
... | Build the array text for the Page Buttons
@return string | [
"Build",
"the",
"array",
"text",
"for",
"the",
"Page",
"Buttons"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Paging.php#L522-L533 |
digitalkaoz/versioneye-php | src/Http/ClientFactory.php | ClientFactory.create | public static function create($url, $token)
{
$plugins = [
new Plugin\RedirectPlugin(),
new Plugin\RetryPlugin(['retries' => 5]),
new Plugin\DecoderPlugin(),
new Plugin\ErrorPlugin(),
];
if ($token) {
$plugins[] = new Plugin\Authen... | php | public static function create($url, $token)
{
$plugins = [
new Plugin\RedirectPlugin(),
new Plugin\RetryPlugin(['retries' => 5]),
new Plugin\DecoderPlugin(),
new Plugin\ErrorPlugin(),
];
if ($token) {
$plugins[] = new Plugin\Authen... | [
"public",
"static",
"function",
"create",
"(",
"$",
"url",
",",
"$",
"token",
")",
"{",
"$",
"plugins",
"=",
"[",
"new",
"Plugin",
"\\",
"RedirectPlugin",
"(",
")",
",",
"new",
"Plugin",
"\\",
"RetryPlugin",
"(",
"[",
"'retries'",
"=>",
"5",
"]",
")"... | @param string $url
@param string $token
@return HttpClient | [
"@param",
"string",
"$url",
"@param",
"string",
"$token"
] | train | https://github.com/digitalkaoz/versioneye-php/blob/7b8eb9cdc83e01138dda0e709c07e3beb6aad136/src/Http/ClientFactory.php#L24-L44 |
guillermoandrae/php-repository | src/Repositories/RepositoryFactory.php | RepositoryFactory.factory | public static function factory(string $name, $options = null): RepositoryInterface
{
try {
$className = sprintf(
'%s\%sRepository',
self::getNamespace(),
ucfirst(strtolower($name))
);
$reflectionClass = new \ReflectionClass(... | php | public static function factory(string $name, $options = null): RepositoryInterface
{
try {
$className = sprintf(
'%s\%sRepository',
self::getNamespace(),
ucfirst(strtolower($name))
);
$reflectionClass = new \ReflectionClass(... | [
"public",
"static",
"function",
"factory",
"(",
"string",
"$",
"name",
",",
"$",
"options",
"=",
"null",
")",
":",
"RepositoryInterface",
"{",
"try",
"{",
"$",
"className",
"=",
"sprintf",
"(",
"'%s\\%sRepository'",
",",
"self",
"::",
"getNamespace",
"(",
... | Returns the desired repository using the provided data.
@param string $name The name of the desired repository.
@param mixed|null $options The data needed to build the repository.
@return RepositoryInterface
@throws InvalidRepositoryException Thrown when an invalid repository is
requested. | [
"Returns",
"the",
"desired",
"repository",
"using",
"the",
"provided",
"data",
"."
] | train | https://github.com/guillermoandrae/php-repository/blob/8cf9c50c7c7f4c08190b3232df77e21e706e7a2a/src/Repositories/RepositoryFactory.php#L53-L71 |
xinix-technology/norm | src/Norm/Type/Object.php | Object.toObject | public function toObject()
{
$obj = new stdClass();
if (! empty($this->attributes)) {
foreach ($this->attributes as $key => $value) {
$obj->$key = $value;
}
}
return $obj;
} | php | public function toObject()
{
$obj = new stdClass();
if (! empty($this->attributes)) {
foreach ($this->attributes as $key => $value) {
$obj->$key = $value;
}
}
return $obj;
} | [
"public",
"function",
"toObject",
"(",
")",
"{",
"$",
"obj",
"=",
"new",
"stdClass",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"attributes",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"attributes",
"as",
"$",
"key",
"... | Convert this class to a standard object.
@return \stdClass | [
"Convert",
"this",
"class",
"to",
"a",
"standard",
"object",
"."
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Type/Object.php#L20-L31 |
shinjin/freezer | src/Storage/CouchDB.php | CouchDB.doStore | protected function doStore(array $frozenObject)
{
$payload = array('docs' => array());
foreach ($frozenObject['objects'] as $id => $object) {
if ($object['isDirty'] === true) {
$doc = array(
'_id' => $id,
'class' => $object['clas... | php | protected function doStore(array $frozenObject)
{
$payload = array('docs' => array());
foreach ($frozenObject['objects'] as $id => $object) {
if ($object['isDirty'] === true) {
$doc = array(
'_id' => $id,
'class' => $object['clas... | [
"protected",
"function",
"doStore",
"(",
"array",
"$",
"frozenObject",
")",
"{",
"$",
"payload",
"=",
"array",
"(",
"'docs'",
"=>",
"array",
"(",
")",
")",
";",
"foreach",
"(",
"$",
"frozenObject",
"[",
"'objects'",
"]",
"as",
"$",
"id",
"=>",
"$",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/shinjin/freezer/blob/f5955fb5476fa8ac456e27c0edafaae331d02cd3/src/Storage/CouchDB.php#L70-L97 |
shinjin/freezer | src/Storage/CouchDB.php | CouchDB.doFetch | protected function doFetch($id, array &$objects = array())
{
$isRoot = empty($objects);
if (!isset($objects[$id])) {
$response = $this->send('GET', '/' . $this->database . '/' . $id);
if (strpos($response['headers'], 'HTTP/1.1 200 OK') === 0) {
$object = jso... | php | protected function doFetch($id, array &$objects = array())
{
$isRoot = empty($objects);
if (!isset($objects[$id])) {
$response = $this->send('GET', '/' . $this->database . '/' . $id);
if (strpos($response['headers'], 'HTTP/1.1 200 OK') === 0) {
$object = jso... | [
"protected",
"function",
"doFetch",
"(",
"$",
"id",
",",
"array",
"&",
"$",
"objects",
"=",
"array",
"(",
")",
")",
"{",
"$",
"isRoot",
"=",
"empty",
"(",
"$",
"objects",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"objects",
"[",
"$",
"id",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/shinjin/freezer/blob/f5955fb5476fa8ac456e27c0edafaae331d02cd3/src/Storage/CouchDB.php#L102-L131 |
mle86/php-wq | src/WQ/Job/QueueEntry.php | QueueEntry.fromSerializedJob | public static function fromSerializedJob(
string $serializedData,
string $originWorkQueue,
$handle,
string $jobId
): self {
/** @var Job $job */
$job = unserialize($serializedData);
if ($job === false) {
throw new UnserializationException("job {$j... | php | public static function fromSerializedJob(
string $serializedData,
string $originWorkQueue,
$handle,
string $jobId
): self {
/** @var Job $job */
$job = unserialize($serializedData);
if ($job === false) {
throw new UnserializationException("job {$j... | [
"public",
"static",
"function",
"fromSerializedJob",
"(",
"string",
"$",
"serializedData",
",",
"string",
"$",
"originWorkQueue",
",",
"$",
"handle",
",",
"string",
"$",
"jobId",
")",
":",
"self",
"{",
"/** @var Job $job */",
"$",
"job",
"=",
"unserialize",
"(... | Unserializes a stored {@see Job} instance
from a Work Queue entry's raw data
and wraps it in a {@see QueueEntry} instance.
@param string $serializedData The serialized raw data.
@param string $originWorkQueue
@param mixed $handle The Work Server adapter's representation of this job.
@param string $jobId ... | [
"Unserializes",
"a",
"stored",
"{",
"@see",
"Job",
"}",
"instance",
"from",
"a",
"Work",
"Queue",
"entry",
"s",
"raw",
"data",
"and",
"wraps",
"it",
"in",
"a",
"{",
"@see",
"QueueEntry",
"}",
"instance",
"."
] | train | https://github.com/mle86/php-wq/blob/e1ca1dcfd3d40edb0085f6dfa83d90db74253de4/src/WQ/Job/QueueEntry.php#L72-L92 |
flipboxstudio/orm-manager | src/Flipbox/OrmManager/BothRelations/MorphManytoMany.php | MorphManytoMany.stylingText | protected function stylingText()
{
$this->text = array_merge($this->text, [
'name' => "[".$this->command->paintString($this->defaultOptions['name'], 'green')."]",
'pivot_table' => "[".$this->command->paintString($this->defaultOptions['pivot_table'], 'green')."]",
'foreign... | php | protected function stylingText()
{
$this->text = array_merge($this->text, [
'name' => "[".$this->command->paintString($this->defaultOptions['name'], 'green')."]",
'pivot_table' => "[".$this->command->paintString($this->defaultOptions['pivot_table'], 'green')."]",
'foreign... | [
"protected",
"function",
"stylingText",
"(",
")",
"{",
"$",
"this",
"->",
"text",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"text",
",",
"[",
"'name'",
"=>",
"\"[\"",
".",
"$",
"this",
"->",
"command",
"->",
"paintString",
"(",
"$",
"this",
"->",
"... | styling text
@return void | [
"styling",
"text"
] | train | https://github.com/flipboxstudio/orm-manager/blob/4288426517f53d05177b8729c4ba94c5beca9a98/src/Flipbox/OrmManager/BothRelations/MorphManytoMany.php#L86-L97 |
davidgorges/color-contrast-php | src/ContrastAlgorithm/LuminosityContrast.php | LuminosityContrast.calculate | public function calculate(ColorJizz $foreground, ColorJizz $background)
{
$fgLuma = $this->relativeLuminosity($foreground->toRGB());
$bgLuma = $this->relativeLuminosity($background->toRGB());
if ($fgLuma > $bgLuma) {
return ($fgLuma + 0.05) / ($bgLuma + 0.05);
} else {... | php | public function calculate(ColorJizz $foreground, ColorJizz $background)
{
$fgLuma = $this->relativeLuminosity($foreground->toRGB());
$bgLuma = $this->relativeLuminosity($background->toRGB());
if ($fgLuma > $bgLuma) {
return ($fgLuma + 0.05) / ($bgLuma + 0.05);
} else {... | [
"public",
"function",
"calculate",
"(",
"ColorJizz",
"$",
"foreground",
",",
"ColorJizz",
"$",
"background",
")",
"{",
"$",
"fgLuma",
"=",
"$",
"this",
"->",
"relativeLuminosity",
"(",
"$",
"foreground",
"->",
"toRGB",
"(",
")",
")",
";",
"$",
"bgLuma",
... | returns the contrast ratio between foreground and background color.
@param ColorJizz $foreground
@param ColorJizz $background
@return float | [
"returns",
"the",
"contrast",
"ratio",
"between",
"foreground",
"and",
"background",
"color",
"."
] | train | https://github.com/davidgorges/color-contrast-php/blob/11edc6e04ce73d8d9b0bffeda1586f2c2fa22e71/src/ContrastAlgorithm/LuminosityContrast.php#L24-L34 |
davidgorges/color-contrast-php | src/ContrastAlgorithm/LuminosityContrast.php | LuminosityContrast.relativeLuminosity | private function relativeLuminosity(RGB $color)
{
$luminosity = 0.2126 * pow($color->getRed() / 255, 2.2) +
0.7152 * pow($color->getGreen() / 255, 2.2) +
0.0722 * pow($color->getBlue() / 255, 2.2);
return $luminosity;
} | php | private function relativeLuminosity(RGB $color)
{
$luminosity = 0.2126 * pow($color->getRed() / 255, 2.2) +
0.7152 * pow($color->getGreen() / 255, 2.2) +
0.0722 * pow($color->getBlue() / 255, 2.2);
return $luminosity;
} | [
"private",
"function",
"relativeLuminosity",
"(",
"RGB",
"$",
"color",
")",
"{",
"$",
"luminosity",
"=",
"0.2126",
"*",
"pow",
"(",
"$",
"color",
"->",
"getRed",
"(",
")",
"/",
"255",
",",
"2.2",
")",
"+",
"0.7152",
"*",
"pow",
"(",
"$",
"color",
"... | @param RGB $color
@return float | [
"@param",
"RGB",
"$color"
] | train | https://github.com/davidgorges/color-contrast-php/blob/11edc6e04ce73d8d9b0bffeda1586f2c2fa22e71/src/ContrastAlgorithm/LuminosityContrast.php#L41-L48 |
spiral-modules/auth | source/Auth/Middlewares/AuthMiddleware.php | AuthMiddleware.commitContext | protected function commitContext(
Request $request,
Response $response,
TokenInterface $token
): Response {
return $token->getOperator()->commitToken($request, $response, $token);
} | php | protected function commitContext(
Request $request,
Response $response,
TokenInterface $token
): Response {
return $token->getOperator()->commitToken($request, $response, $token);
} | [
"protected",
"function",
"commitContext",
"(",
"Request",
"$",
"request",
",",
"Response",
"$",
"response",
",",
"TokenInterface",
"$",
"token",
")",
":",
"Response",
"{",
"return",
"$",
"token",
"->",
"getOperator",
"(",
")",
"->",
"commitToken",
"(",
"$",
... | @param Request $request
@param Response $response
@param TokenInterface $token
@return Response | [
"@param",
"Request",
"$request",
"@param",
"Response",
"$response",
"@param",
"TokenInterface",
"$token"
] | train | https://github.com/spiral-modules/auth/blob/24e2070028f7257e8192914556963a4794428a99/source/Auth/Middlewares/AuthMiddleware.php#L96-L102 |
spiral-modules/auth | source/Auth/Middlewares/AuthMiddleware.php | AuthMiddleware.closeContext | protected function closeContext(
Request $request,
Response $response,
TokenInterface $token
): Response {
return $token->getOperator()->removeToken($request, $response, $token);
} | php | protected function closeContext(
Request $request,
Response $response,
TokenInterface $token
): Response {
return $token->getOperator()->removeToken($request, $response, $token);
} | [
"protected",
"function",
"closeContext",
"(",
"Request",
"$",
"request",
",",
"Response",
"$",
"response",
",",
"TokenInterface",
"$",
"token",
")",
":",
"Response",
"{",
"return",
"$",
"token",
"->",
"getOperator",
"(",
")",
"->",
"removeToken",
"(",
"$",
... | @param Request $request
@param Response $response
@param TokenInterface $token
@return Response | [
"@param",
"Request",
"$request",
"@param",
"Response",
"$response",
"@param",
"TokenInterface",
"$token"
] | train | https://github.com/spiral-modules/auth/blob/24e2070028f7257e8192914556963a4794428a99/source/Auth/Middlewares/AuthMiddleware.php#L111-L117 |
stanislav-web/phalcon-ulogin | src/ULogin/Parser.php | Parser.map | public static function map($data) {
if(is_array($data) === true) {
$array = self::arrayResolve($data);
} else {
$array = self::stringResolve($data);
}
return $array;
} | php | public static function map($data) {
if(is_array($data) === true) {
$array = self::arrayResolve($data);
} else {
$array = self::stringResolve($data);
}
return $array;
} | [
"public",
"static",
"function",
"map",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"data",
")",
"===",
"true",
")",
"{",
"$",
"array",
"=",
"self",
"::",
"arrayResolve",
"(",
"$",
"data",
")",
";",
"}",
"else",
"{",
"$",
"array",... | Resolve mapper
@param mixed $data input data
@access static
@return array | [
"Resolve",
"mapper"
] | train | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Parser.php#L23-L35 |
stanislav-web/phalcon-ulogin | src/ULogin/Parser.php | Parser.arrayResolve | public static function arrayResolve(array $data)
{
$array = [];
foreach ($data as $provider => $bool) {
if ($bool === true) {
$array['required'][] = $provider;
}
else {
$array['hidden'][] = $provider;
}
}
... | php | public static function arrayResolve(array $data)
{
$array = [];
foreach ($data as $provider => $bool) {
if ($bool === true) {
$array['required'][] = $provider;
}
else {
$array['hidden'][] = $provider;
}
}
... | [
"public",
"static",
"function",
"arrayResolve",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"array",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"provider",
"=>",
"$",
"bool",
")",
"{",
"if",
"(",
"$",
"bool",
"===",
"true",
")",
"{... | Resolve array data as providers
@param array $data
@access static
@return array | [
"Resolve",
"array",
"data",
"as",
"providers"
] | train | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Parser.php#L44-L64 |
stanislav-web/phalcon-ulogin | src/ULogin/Parser.php | Parser.separate | private static function separate(array $data)
{
$array = [];
foreach ($data as $provider) {
if(($bool = self::isDelim($provider)) === false) {
$array['required'][] = $provider;
}
else {
if ($bool[1] === 'true') {
... | php | private static function separate(array $data)
{
$array = [];
foreach ($data as $provider) {
if(($bool = self::isDelim($provider)) === false) {
$array['required'][] = $provider;
}
else {
if ($bool[1] === 'true') {
... | [
"private",
"static",
"function",
"separate",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"array",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"provider",
")",
"{",
"if",
"(",
"(",
"$",
"bool",
"=",
"self",
"::",
"isDelim",
"(",
"$",... | Separate string
@param array $data
@access static
@return array | [
"Separate",
"string"
] | train | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Parser.php#L90-L110 |
stanislav-web/phalcon-ulogin | src/ULogin/Parser.php | Parser.isDelim | private static function isDelim($provider, $delimiter = '=')
{
if (mb_strpos($provider, $delimiter) !== false) {
$res = explode('=', $provider);
return $res;
}
return false;
} | php | private static function isDelim($provider, $delimiter = '=')
{
if (mb_strpos($provider, $delimiter) !== false) {
$res = explode('=', $provider);
return $res;
}
return false;
} | [
"private",
"static",
"function",
"isDelim",
"(",
"$",
"provider",
",",
"$",
"delimiter",
"=",
"'='",
")",
"{",
"if",
"(",
"mb_strpos",
"(",
"$",
"provider",
",",
"$",
"delimiter",
")",
"!==",
"false",
")",
"{",
"$",
"res",
"=",
"explode",
"(",
"'='",... | Check if data has delimiter
@param string $provider
@param string $delimiter
@access static
@return array|false | [
"Check",
"if",
"data",
"has",
"delimiter"
] | train | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Parser.php#L120-L131 |
kherge-abandoned/php-wise | src/lib/Herrera/Wise/Processor/ProcessorResolver.php | ProcessorResolver.resolve | public function resolve($resource, $type = null)
{
foreach ($this->processors as $processor) {
if ($processor->supports($resource, $type)) {
return $processor;
}
}
return false;
} | php | public function resolve($resource, $type = null)
{
foreach ($this->processors as $processor) {
if ($processor->supports($resource, $type)) {
return $processor;
}
}
return false;
} | [
"public",
"function",
"resolve",
"(",
"$",
"resource",
",",
"$",
"type",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"processors",
"as",
"$",
"processor",
")",
"{",
"if",
"(",
"$",
"processor",
"->",
"supports",
"(",
"$",
"resource",
",... | {@inheritDoc} | [
"{"
] | train | https://github.com/kherge-abandoned/php-wise/blob/7621e0be7dbb2a015d68197d290fe8469f539a4d/src/lib/Herrera/Wise/Processor/ProcessorResolver.php#L54-L63 |
yuncms/framework | src/helpers/Html.php | Html.encodeParams | public static function encodeParams(string $html, array $variables = []): string
{
// Normalize the param keys
$normalizedVariables = [];
if (is_array($variables)) {
foreach ($variables as $key => $value) {
$key = '{' . trim($key, '{}') . '}';
$nor... | php | public static function encodeParams(string $html, array $variables = []): string
{
// Normalize the param keys
$normalizedVariables = [];
if (is_array($variables)) {
foreach ($variables as $key => $value) {
$key = '{' . trim($key, '{}') . '}';
$nor... | [
"public",
"static",
"function",
"encodeParams",
"(",
"string",
"$",
"html",
",",
"array",
"$",
"variables",
"=",
"[",
"]",
")",
":",
"string",
"{",
"// Normalize the param keys",
"$",
"normalizedVariables",
"=",
"[",
"]",
";",
"if",
"(",
"is_array",
"(",
"... | Will take an HTML string and an associative array of key=>value pairs, HTML encode the values and swap them back
into the original string using the keys as tokens.
@param string $html The HTML string.
@param array $variables An associative array of key => value pairs to be applied to the HTML string using `strtr`.
@re... | [
"Will",
"take",
"an",
"HTML",
"string",
"and",
"an",
"associative",
"array",
"of",
"key",
"=",
">",
"value",
"pairs",
"HTML",
"encode",
"the",
"values",
"and",
"swap",
"them",
"back",
"into",
"the",
"original",
"string",
"using",
"the",
"keys",
"as",
"to... | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/helpers/Html.php#L82-L94 |
factorio-item-browser/export-data | src/Entity/Icon/Color.php | Color.setRed | public function setRed(float $red, float $scale = 1.)
{
$this->red = $this->setComponent($red, $scale);
return $this;
} | php | public function setRed(float $red, float $scale = 1.)
{
$this->red = $this->setComponent($red, $scale);
return $this;
} | [
"public",
"function",
"setRed",
"(",
"float",
"$",
"red",
",",
"float",
"$",
"scale",
"=",
"1.",
")",
"{",
"$",
"this",
"->",
"red",
"=",
"$",
"this",
"->",
"setComponent",
"(",
"$",
"red",
",",
"$",
"scale",
")",
";",
"return",
"$",
"this",
";",... | Sets the red component of the color.
@param float $red
@param float $scale
@return $this | [
"Sets",
"the",
"red",
"component",
"of",
"the",
"color",
"."
] | train | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Entity/Icon/Color.php#L50-L54 |
factorio-item-browser/export-data | src/Entity/Icon/Color.php | Color.setGreen | public function setGreen(float $green, float $scale = 1.)
{
$this->green = $this->setComponent($green, $scale);
return $this;
} | php | public function setGreen(float $green, float $scale = 1.)
{
$this->green = $this->setComponent($green, $scale);
return $this;
} | [
"public",
"function",
"setGreen",
"(",
"float",
"$",
"green",
",",
"float",
"$",
"scale",
"=",
"1.",
")",
"{",
"$",
"this",
"->",
"green",
"=",
"$",
"this",
"->",
"setComponent",
"(",
"$",
"green",
",",
"$",
"scale",
")",
";",
"return",
"$",
"this"... | Sets the green component of the color.
@param float $green
@param float $scale
@return $this | [
"Sets",
"the",
"green",
"component",
"of",
"the",
"color",
"."
] | train | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Entity/Icon/Color.php#L72-L76 |
factorio-item-browser/export-data | src/Entity/Icon/Color.php | Color.setBlue | public function setBlue(float $blue, float $scale = 1.)
{
$this->blue = $this->setComponent($blue, $scale);
return $this;
} | php | public function setBlue(float $blue, float $scale = 1.)
{
$this->blue = $this->setComponent($blue, $scale);
return $this;
} | [
"public",
"function",
"setBlue",
"(",
"float",
"$",
"blue",
",",
"float",
"$",
"scale",
"=",
"1.",
")",
"{",
"$",
"this",
"->",
"blue",
"=",
"$",
"this",
"->",
"setComponent",
"(",
"$",
"blue",
",",
"$",
"scale",
")",
";",
"return",
"$",
"this",
... | Sets the blue component of the color.
@param float $blue
@param float $scale
@return $this | [
"Sets",
"the",
"blue",
"component",
"of",
"the",
"color",
"."
] | train | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Entity/Icon/Color.php#L94-L98 |
factorio-item-browser/export-data | src/Entity/Icon/Color.php | Color.setAlpha | public function setAlpha(float $alpha, float $scale = 1.)
{
$this->alpha = $this->setComponent($alpha, $scale);
return $this;
} | php | public function setAlpha(float $alpha, float $scale = 1.)
{
$this->alpha = $this->setComponent($alpha, $scale);
return $this;
} | [
"public",
"function",
"setAlpha",
"(",
"float",
"$",
"alpha",
",",
"float",
"$",
"scale",
"=",
"1.",
")",
"{",
"$",
"this",
"->",
"alpha",
"=",
"$",
"this",
"->",
"setComponent",
"(",
"$",
"alpha",
",",
"$",
"scale",
")",
";",
"return",
"$",
"this"... | Sets the alpha component of the color.
@param float $alpha
@param float $scale
@return $this | [
"Sets",
"the",
"alpha",
"component",
"of",
"the",
"color",
"."
] | train | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Entity/Icon/Color.php#L116-L120 |
factorio-item-browser/export-data | src/Entity/Icon/Color.php | Color.setComponent | protected function setComponent(float $value, float $scale): float
{
return ($scale < 0) ? (1 - $value / -$scale) : ($value / $scale);
} | php | protected function setComponent(float $value, float $scale): float
{
return ($scale < 0) ? (1 - $value / -$scale) : ($value / $scale);
} | [
"protected",
"function",
"setComponent",
"(",
"float",
"$",
"value",
",",
"float",
"$",
"scale",
")",
":",
"float",
"{",
"return",
"(",
"$",
"scale",
"<",
"0",
")",
"?",
"(",
"1",
"-",
"$",
"value",
"/",
"-",
"$",
"scale",
")",
":",
"(",
"$",
"... | Calculates the value to set a component.
@param float $value
@param float $scale
@return float | [
"Calculates",
"the",
"value",
"to",
"set",
"a",
"component",
"."
] | train | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Entity/Icon/Color.php#L138-L141 |
factorio-item-browser/export-data | src/Entity/Icon/Color.php | Color.getComponent | protected function getComponent(float $value, float $scale): float
{
return ($scale < 0) ? ((1 - $value) * -$scale) : ($value * $scale);
} | php | protected function getComponent(float $value, float $scale): float
{
return ($scale < 0) ? ((1 - $value) * -$scale) : ($value * $scale);
} | [
"protected",
"function",
"getComponent",
"(",
"float",
"$",
"value",
",",
"float",
"$",
"scale",
")",
":",
"float",
"{",
"return",
"(",
"$",
"scale",
"<",
"0",
")",
"?",
"(",
"(",
"1",
"-",
"$",
"value",
")",
"*",
"-",
"$",
"scale",
")",
":",
"... | Calculates the value to get a component.
@param float $value
@param float $scale
@return float | [
"Calculates",
"the",
"value",
"to",
"get",
"a",
"component",
"."
] | train | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Entity/Icon/Color.php#L149-L152 |
factorio-item-browser/export-data | src/Entity/Icon/Color.php | Color.writeData | public function writeData(): array
{
$dataBuilder = new DataBuilder();
$dataBuilder->setFloat('r', $this->getRed(), 1.)
->setFloat('g', $this->getGreen(), 1.)
->setFloat('b', $this->getBlue(), 1.)
->setFloat('a', $this->getAlpha(), 1.);
... | php | public function writeData(): array
{
$dataBuilder = new DataBuilder();
$dataBuilder->setFloat('r', $this->getRed(), 1.)
->setFloat('g', $this->getGreen(), 1.)
->setFloat('b', $this->getBlue(), 1.)
->setFloat('a', $this->getAlpha(), 1.);
... | [
"public",
"function",
"writeData",
"(",
")",
":",
"array",
"{",
"$",
"dataBuilder",
"=",
"new",
"DataBuilder",
"(",
")",
";",
"$",
"dataBuilder",
"->",
"setFloat",
"(",
"'r'",
",",
"$",
"this",
"->",
"getRed",
"(",
")",
",",
"1.",
")",
"->",
"setFloa... | Writes the entity data to an array.
@return array | [
"Writes",
"the",
"entity",
"data",
"to",
"an",
"array",
"."
] | train | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Entity/Icon/Color.php#L158-L166 |
factorio-item-browser/export-data | src/Entity/Icon/Color.php | Color.readData | public function readData(DataContainer $data)
{
$this->red = $data->getFloat('r', 1.);
$this->green = $data->getFloat('g', 1.);
$this->blue = $data->getFloat('b', 1.);
$this->alpha = $data->getFloat('a', 1.);
return $this;
} | php | public function readData(DataContainer $data)
{
$this->red = $data->getFloat('r', 1.);
$this->green = $data->getFloat('g', 1.);
$this->blue = $data->getFloat('b', 1.);
$this->alpha = $data->getFloat('a', 1.);
return $this;
} | [
"public",
"function",
"readData",
"(",
"DataContainer",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"red",
"=",
"$",
"data",
"->",
"getFloat",
"(",
"'r'",
",",
"1.",
")",
";",
"$",
"this",
"->",
"green",
"=",
"$",
"data",
"->",
"getFloat",
"(",
"'g'"... | Reads the entity data.
@param DataContainer $data
@return $this | [
"Reads",
"the",
"entity",
"data",
"."
] | train | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Entity/Icon/Color.php#L173-L180 |
factorio-item-browser/export-data | src/Entity/Icon/Color.php | Color.calculateHash | public function calculateHash(): string
{
return EntityUtils::calculateHashOfArray([
$this->red,
$this->green,
$this->blue,
$this->alpha,
]);
} | php | public function calculateHash(): string
{
return EntityUtils::calculateHashOfArray([
$this->red,
$this->green,
$this->blue,
$this->alpha,
]);
} | [
"public",
"function",
"calculateHash",
"(",
")",
":",
"string",
"{",
"return",
"EntityUtils",
"::",
"calculateHashOfArray",
"(",
"[",
"$",
"this",
"->",
"red",
",",
"$",
"this",
"->",
"green",
",",
"$",
"this",
"->",
"blue",
",",
"$",
"this",
"->",
"al... | Calculates a hash value representing the entity.
@return string | [
"Calculates",
"a",
"hash",
"value",
"representing",
"the",
"entity",
"."
] | train | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Entity/Icon/Color.php#L186-L194 |
forxer/tao | src/Tao/Controller/SearchableControllerTrait.php | SearchableControllerTrait.setSearchCriteriaFromSession | protected function setSearchCriteriaFromSession()
{
$this->initSearchCriteria();
foreach ($this->aCriteria as $sIndex => $mValue) {
$this->aCriteria[$sIndex] = $this->app['session']->get($sIndex, $mValue);
}
} | php | protected function setSearchCriteriaFromSession()
{
$this->initSearchCriteria();
foreach ($this->aCriteria as $sIndex => $mValue) {
$this->aCriteria[$sIndex] = $this->app['session']->get($sIndex, $mValue);
}
} | [
"protected",
"function",
"setSearchCriteriaFromSession",
"(",
")",
"{",
"$",
"this",
"->",
"initSearchCriteria",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"aCriteria",
"as",
"$",
"sIndex",
"=>",
"$",
"mValue",
")",
"{",
"$",
"this",
"->",
"aCriteri... | Retrouve les éventuels critères de recherche en _SESSION
@return void | [
"Retrouve",
"les",
"éventuels",
"critères",
"de",
"recherche",
"en",
"_SESSION"
] | train | https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Controller/SearchableControllerTrait.php#L40-L47 |
forxer/tao | src/Tao/Controller/SearchableControllerTrait.php | SearchableControllerTrait.removeSearchCriteriaFromSession | protected function removeSearchCriteriaFromSession()
{
$this->initSearchCriteria();
foreach (array_keys($this->aCriteria) as $sIndex) {
$this->app['session']->remove($sIndex);
}
} | php | protected function removeSearchCriteriaFromSession()
{
$this->initSearchCriteria();
foreach (array_keys($this->aCriteria) as $sIndex) {
$this->app['session']->remove($sIndex);
}
} | [
"protected",
"function",
"removeSearchCriteriaFromSession",
"(",
")",
"{",
"$",
"this",
"->",
"initSearchCriteria",
"(",
")",
";",
"foreach",
"(",
"array_keys",
"(",
"$",
"this",
"->",
"aCriteria",
")",
"as",
"$",
"sIndex",
")",
"{",
"$",
"this",
"->",
"ap... | Supprime les critères de recherche de la _SESSION
@return void | [
"Supprime",
"les",
"critères",
"de",
"recherche",
"de",
"la",
"_SESSION"
] | train | https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Controller/SearchableControllerTrait.php#L54-L61 |
forxer/tao | src/Tao/Controller/SearchableControllerTrait.php | SearchableControllerTrait.setSearchCriteriaFromPost | protected function setSearchCriteriaFromPost()
{
$this->initSearchCriteria();
foreach ($this->aCriteria as $sIndex => $mValue) {
$this->aCriteria[$sIndex] = $this->app['request']->request->get($sIndex, $mValue);
}
} | php | protected function setSearchCriteriaFromPost()
{
$this->initSearchCriteria();
foreach ($this->aCriteria as $sIndex => $mValue) {
$this->aCriteria[$sIndex] = $this->app['request']->request->get($sIndex, $mValue);
}
} | [
"protected",
"function",
"setSearchCriteriaFromPost",
"(",
")",
"{",
"$",
"this",
"->",
"initSearchCriteria",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"aCriteria",
"as",
"$",
"sIndex",
"=>",
"$",
"mValue",
")",
"{",
"$",
"this",
"->",
"aCriteria",... | Retrouve les éventuels critères de recherche en _POST
@return void | [
"Retrouve",
"les",
"éventuels",
"critères",
"de",
"recherche",
"en",
"_POST"
] | train | https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Controller/SearchableControllerTrait.php#L68-L75 |
forxer/tao | src/Tao/Controller/SearchableControllerTrait.php | SearchableControllerTrait.setSearchCriteriaFromQuery | protected function setSearchCriteriaFromQuery()
{
$this->initSearchCriteria();
foreach ($this->aCriteria as $sIndex => $mValue) {
$this->aCriteria[$sIndex] = $this->app['request']->query->get($sIndex, $mValue);
}
} | php | protected function setSearchCriteriaFromQuery()
{
$this->initSearchCriteria();
foreach ($this->aCriteria as $sIndex => $mValue) {
$this->aCriteria[$sIndex] = $this->app['request']->query->get($sIndex, $mValue);
}
} | [
"protected",
"function",
"setSearchCriteriaFromQuery",
"(",
")",
"{",
"$",
"this",
"->",
"initSearchCriteria",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"aCriteria",
"as",
"$",
"sIndex",
"=>",
"$",
"mValue",
")",
"{",
"$",
"this",
"->",
"aCriteria"... | Retrouve les éventuels critères de recherche en _GET
@return void | [
"Retrouve",
"les",
"éventuels",
"critères",
"de",
"recherche",
"en",
"_GET"
] | train | https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Controller/SearchableControllerTrait.php#L82-L89 |
aedart/laravel-helpers | src/Traits/Notifications/NotificationDispatcherTrait.php | NotificationDispatcherTrait.getNotificationDispatcher | public function getNotificationDispatcher(): ?Dispatcher
{
if (!$this->hasNotificationDispatcher()) {
$this->setNotificationDispatcher($this->getDefaultNotificationDispatcher());
}
return $this->notificationDispatcher;
} | php | public function getNotificationDispatcher(): ?Dispatcher
{
if (!$this->hasNotificationDispatcher()) {
$this->setNotificationDispatcher($this->getDefaultNotificationDispatcher());
}
return $this->notificationDispatcher;
} | [
"public",
"function",
"getNotificationDispatcher",
"(",
")",
":",
"?",
"Dispatcher",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasNotificationDispatcher",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setNotificationDispatcher",
"(",
"$",
"this",
"->",
"getDefaultNot... | Get notification dispatcher
If no notification dispatcher has been set, this method will
set and return a default notification dispatcher, if any such
value is available
@see getDefaultNotificationDispatcher()
@return Dispatcher|null notification dispatcher or null if none notification dispatcher has been set | [
"Get",
"notification",
"dispatcher"
] | train | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Notifications/NotificationDispatcherTrait.php#L53-L59 |
ClanCats/Core | src/classes/CCUrl.php | CCUrl._init | public static function _init()
{
static::$path_offset = ClanCats::$config->get( 'url.path', '/' );
if ( empty( static::$path_offset ) )
{
static::$path_offset = '/';
}
if ( substr( static::$path_offset, -1 ) != '/' )
{
static::$path_offset .= '/';
}
// register the default parameter providers... | php | public static function _init()
{
static::$path_offset = ClanCats::$config->get( 'url.path', '/' );
if ( empty( static::$path_offset ) )
{
static::$path_offset = '/';
}
if ( substr( static::$path_offset, -1 ) != '/' )
{
static::$path_offset .= '/';
}
// register the default parameter providers... | [
"public",
"static",
"function",
"_init",
"(",
")",
"{",
"static",
"::",
"$",
"path_offset",
"=",
"ClanCats",
"::",
"$",
"config",
"->",
"get",
"(",
"'url.path'",
",",
"'/'",
")",
";",
"if",
"(",
"empty",
"(",
"static",
"::",
"$",
"path_offset",
")",
... | static CCUrl initialisation | [
"static",
"CCUrl",
"initialisation"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCUrl.php#L32-L62 |
ClanCats/Core | src/classes/CCUrl.php | CCUrl.to | public static function to( $uri = '', $params = array(), $retain = false )
{
// To avoid // urls we check for a single slash.
if ( $uri === '/' )
{
$uri = '';
}
// When the uri starts with an @ sign we handle the uri as route alias.
if ( substr( $uri, 0, 1 ) == '@' )
{
return static::alias( sub... | php | public static function to( $uri = '', $params = array(), $retain = false )
{
// To avoid // urls we check for a single slash.
if ( $uri === '/' )
{
$uri = '';
}
// When the uri starts with an @ sign we handle the uri as route alias.
if ( substr( $uri, 0, 1 ) == '@' )
{
return static::alias( sub... | [
"public",
"static",
"function",
"to",
"(",
"$",
"uri",
"=",
"''",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"retain",
"=",
"false",
")",
"{",
"// To avoid // urls we check for a single slash.",
"if",
"(",
"$",
"uri",
"===",
"'/'",
")",
"{",
... | Generate an url
@param string $uri
@param array $params
@param bool $retain Should we keep the get parameters?
@return string | [
"Generate",
"an",
"url"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCUrl.php#L84-L167 |
ClanCats/Core | src/classes/CCUrl.php | CCUrl.alias | public static function alias( $alias, $params = array(), $retain = false )
{
$route_params = array();
// to handle the suffix after a slash in an alias define
$suffix = '';
if ( strpos( $alias, '/' ) !== false && $alias !== '/' )
{
// slashes in aliases get appended as suffix
list( $alias, $suffi... | php | public static function alias( $alias, $params = array(), $retain = false )
{
$route_params = array();
// to handle the suffix after a slash in an alias define
$suffix = '';
if ( strpos( $alias, '/' ) !== false && $alias !== '/' )
{
// slashes in aliases get appended as suffix
list( $alias, $suffi... | [
"public",
"static",
"function",
"alias",
"(",
"$",
"alias",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"retain",
"=",
"false",
")",
"{",
"$",
"route_params",
"=",
"array",
"(",
")",
";",
"// to handle the suffix after a slash in an alias define",
... | Create an URL based on an router alias
@param string $alias
@param array $params
@param bool $retain Should we keep the get parameters?
@return string | [
"Create",
"an",
"URL",
"based",
"on",
"an",
"router",
"alias"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCUrl.php#L177-L204 |
ClanCats/Core | src/classes/CCUrl.php | CCUrl.full | public static function full( $uri = '', $params = array(), $retain = false )
{
return CCIn::protocol().'://'.CCIn::host().static::to( $uri, $params, $retain );
} | php | public static function full( $uri = '', $params = array(), $retain = false )
{
return CCIn::protocol().'://'.CCIn::host().static::to( $uri, $params, $retain );
} | [
"public",
"static",
"function",
"full",
"(",
"$",
"uri",
"=",
"''",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"retain",
"=",
"false",
")",
"{",
"return",
"CCIn",
"::",
"protocol",
"(",
")",
".",
"'://'",
".",
"CCIn",
"::",
"host",
"("... | Create the full url including protocol and hostname
@param string $uri
@param array $params
@param bool $retain Should we keep the get parameters?
@return string | [
"Create",
"the",
"full",
"url",
"including",
"protocol",
"and",
"hostname"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCUrl.php#L214-L217 |
ClanCats/Core | src/classes/CCUrl.php | CCUrl.secure | public static function secure( $uri = '', $params = array(), $retain = false )
{
return 'https://'.CCIn::host().static::to( $uri, $params, $retain );
} | php | public static function secure( $uri = '', $params = array(), $retain = false )
{
return 'https://'.CCIn::host().static::to( $uri, $params, $retain );
} | [
"public",
"static",
"function",
"secure",
"(",
"$",
"uri",
"=",
"''",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"retain",
"=",
"false",
")",
"{",
"return",
"'https://'",
".",
"CCIn",
"::",
"host",
"(",
")",
".",
"static",
"::",
"to",
... | Create the url and force the https protocol
@param string $uri
@param array $params
@param bool $retain Should we keep the get parameters?
@return string | [
"Create",
"the",
"url",
"and",
"force",
"the",
"https",
"protocol"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCUrl.php#L227-L230 |
ClanCats/Core | src/classes/CCUrl.php | CCUrl.action | public static function action( $action = '', $params = array(), $retain = false )
{
if ( $action == 'index' )
{
$action = '';
}
if ( CCRequest::current() && ( $route = CCRequest::current()->route ) )
{
$uri = $route->uri;
if ( !is_null( $route->action ) )
{
$uri = substr( $uri, 0, strl... | php | public static function action( $action = '', $params = array(), $retain = false )
{
if ( $action == 'index' )
{
$action = '';
}
if ( CCRequest::current() && ( $route = CCRequest::current()->route ) )
{
$uri = $route->uri;
if ( !is_null( $route->action ) )
{
$uri = substr( $uri, 0, strl... | [
"public",
"static",
"function",
"action",
"(",
"$",
"action",
"=",
"''",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"retain",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"action",
"==",
"'index'",
")",
"{",
"$",
"action",
"=",
"''",
";",
... | Get the url to a action of the current route
!Important it's not possible to link between action on multiple routes
This method always assumes that all actions are in the same route.
If you want to link to another route using an alias you could do something like:
CCUrl::to( '@myalias/myaction' );
@param string $act... | [
"Get",
"the",
"url",
"to",
"a",
"action",
"of",
"the",
"current",
"route"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCUrl.php#L258-L283 |
ClanCats/Core | src/classes/CCUrl.php | CCUrl.active | public static function active( $url )
{
$url = parse_url( $url, PHP_URL_PATH );
if ( empty( $url ) )
{
return false;
}
if ( $url[0] !== '/' )
{
$url = static::to( $url );
}
// when we are on "/" only "/" counts as active.
if ( $url === '/' )
{
return static::current() == $url;
}
/... | php | public static function active( $url )
{
$url = parse_url( $url, PHP_URL_PATH );
if ( empty( $url ) )
{
return false;
}
if ( $url[0] !== '/' )
{
$url = static::to( $url );
}
// when we are on "/" only "/" counts as active.
if ( $url === '/' )
{
return static::current() == $url;
}
/... | [
"public",
"static",
"function",
"active",
"(",
"$",
"url",
")",
"{",
"$",
"url",
"=",
"parse_url",
"(",
"$",
"url",
",",
"PHP_URL_PATH",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"url",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
... | Is the given url active?
This function ignores the domain and the parameters if the
uri matches the current uri true will be returned.
@param string $url
@return bool | [
"Is",
"the",
"given",
"url",
"active?",
"This",
"function",
"ignores",
"the",
"domain",
"and",
"the",
"parameters",
"if",
"the",
"uri",
"matches",
"the",
"current",
"uri",
"true",
"will",
"be",
"returned",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCUrl.php#L293-L317 |
CakeCMS/Core | src/Plugin.php | Plugin.getData | public static function getData($plugin, $key = null)
{
$data = self::_checkData($plugin);
if (empty($data) && $path = self::getManifestPath($plugin)) {
if (FS::isFile($path)) {
/** @noinspection PhpIncludeInspection */
$plgData = include $path;
... | php | public static function getData($plugin, $key = null)
{
$data = self::_checkData($plugin);
if (empty($data) && $path = self::getManifestPath($plugin)) {
if (FS::isFile($path)) {
/** @noinspection PhpIncludeInspection */
$plgData = include $path;
... | [
"public",
"static",
"function",
"getData",
"(",
"$",
"plugin",
",",
"$",
"key",
"=",
"null",
")",
"{",
"$",
"data",
"=",
"self",
"::",
"_checkData",
"(",
"$",
"plugin",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"data",
")",
"&&",
"$",
"path",
"=",
... | Get plugin manifest data.
@param string $plugin
@param null|string $key
@return Data | [
"Get",
"plugin",
"manifest",
"data",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Plugin.php#L88-L104 |
CakeCMS/Core | src/Plugin.php | Plugin.getManifestPath | public static function getManifestPath($plugin)
{
if (self::loaded($plugin)) {
return FS::clean(self::path($plugin) . DS . self::PLUGIN_MANIFEST);
}
return null;
} | php | public static function getManifestPath($plugin)
{
if (self::loaded($plugin)) {
return FS::clean(self::path($plugin) . DS . self::PLUGIN_MANIFEST);
}
return null;
} | [
"public",
"static",
"function",
"getManifestPath",
"(",
"$",
"plugin",
")",
"{",
"if",
"(",
"self",
"::",
"loaded",
"(",
"$",
"plugin",
")",
")",
"{",
"return",
"FS",
"::",
"clean",
"(",
"self",
"::",
"path",
"(",
"$",
"plugin",
")",
".",
"DS",
"."... | Get absolute plugin manifest file path.
@param string $plugin
@return null|string | [
"Get",
"absolute",
"plugin",
"manifest",
"file",
"path",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Plugin.php#L123-L130 |
CakeCMS/Core | src/Plugin.php | Plugin.load | public static function load($plugin, array $config = [])
{
parent::load($plugin, $config);
$plugin = (array) $plugin;
foreach ($plugin as $name) {
if ((bool) self::loaded($name)) {
self::_addManifestCallback($name);
Cms::mergeConfig('App.paths.loc... | php | public static function load($plugin, array $config = [])
{
parent::load($plugin, $config);
$plugin = (array) $plugin;
foreach ($plugin as $name) {
if ((bool) self::loaded($name)) {
self::_addManifestCallback($name);
Cms::mergeConfig('App.paths.loc... | [
"public",
"static",
"function",
"load",
"(",
"$",
"plugin",
",",
"array",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"parent",
"::",
"load",
"(",
"$",
"plugin",
",",
"$",
"config",
")",
";",
"$",
"plugin",
"=",
"(",
"array",
")",
"$",
"plugin",
";",... | Load the plugin.
@param array|string $plugin
@param array $config | [
"Load",
"the",
"plugin",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Plugin.php#L149-L160 |
CakeCMS/Core | src/Plugin.php | Plugin.loadList | public static function loadList(array $plugins)
{
foreach ($plugins as $name) {
if (self::loaded($name)) {
continue;
}
if ($path = self::_findPlugin($name)) {
self::load($name, self::_getConfigForLoad($path));
}
}
} | php | public static function loadList(array $plugins)
{
foreach ($plugins as $name) {
if (self::loaded($name)) {
continue;
}
if ($path = self::_findPlugin($name)) {
self::load($name, self::_getConfigForLoad($path));
}
}
} | [
"public",
"static",
"function",
"loadList",
"(",
"array",
"$",
"plugins",
")",
"{",
"foreach",
"(",
"$",
"plugins",
"as",
"$",
"name",
")",
"{",
"if",
"(",
"self",
"::",
"loaded",
"(",
"$",
"name",
")",
")",
"{",
"continue",
";",
"}",
"if",
"(",
... | Load list plugin.
@param array $plugins
@return void | [
"Load",
"list",
"plugin",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Plugin.php#L168-L179 |
CakeCMS/Core | src/Plugin.php | Plugin.manifestEvent | public static function manifestEvent()
{
$args = func_get_args();
$callback = array_shift($args);
if (Arr::key($callback, self::$_eventList)) {
$callbacks = self::$_eventList[$callback];
foreach ($callbacks as $method) {
call_user_func_array($meth... | php | public static function manifestEvent()
{
$args = func_get_args();
$callback = array_shift($args);
if (Arr::key($callback, self::$_eventList)) {
$callbacks = self::$_eventList[$callback];
foreach ($callbacks as $method) {
call_user_func_array($meth... | [
"public",
"static",
"function",
"manifestEvent",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"callback",
"=",
"array_shift",
"(",
"$",
"args",
")",
";",
"if",
"(",
"Arr",
"::",
"key",
"(",
"$",
"callback",
",",
"self",
"::",... | Call plugin manifest callbacks.
@return void | [
"Call",
"plugin",
"manifest",
"callbacks",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Plugin.php#L186-L197 |
CakeCMS/Core | src/Plugin.php | Plugin.unload | public static function unload($plugin = null)
{
if (self::loaded($plugin)) {
$locales = Configure::read('App.paths.locales');
foreach ($locales as $key => $path) {
if ($path == self::getLocalePath($plugin)) {
unset($locales[$key]);
... | php | public static function unload($plugin = null)
{
if (self::loaded($plugin)) {
$locales = Configure::read('App.paths.locales');
foreach ($locales as $key => $path) {
if ($path == self::getLocalePath($plugin)) {
unset($locales[$key]);
... | [
"public",
"static",
"function",
"unload",
"(",
"$",
"plugin",
"=",
"null",
")",
"{",
"if",
"(",
"self",
"::",
"loaded",
"(",
"$",
"plugin",
")",
")",
"{",
"$",
"locales",
"=",
"Configure",
"::",
"read",
"(",
"'App.paths.locales'",
")",
";",
"foreach",
... | Unload the plugin.
@param null|string $plugin
@return void | [
"Unload",
"the",
"plugin",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Plugin.php#L205-L219 |
CakeCMS/Core | src/Plugin.php | Plugin._addManifestCallback | protected static function _addManifestCallback($plugin)
{
$data = Plugin::getData($plugin);
foreach ($data as $name => $callback) {
if (self::_isCallablePluginData($name, $plugin, $callback) && $plugin !== 'Core') {
self::$_eventList[$name][$plugin] = $callback;
... | php | protected static function _addManifestCallback($plugin)
{
$data = Plugin::getData($plugin);
foreach ($data as $name => $callback) {
if (self::_isCallablePluginData($name, $plugin, $callback) && $plugin !== 'Core') {
self::$_eventList[$name][$plugin] = $callback;
... | [
"protected",
"static",
"function",
"_addManifestCallback",
"(",
"$",
"plugin",
")",
"{",
"$",
"data",
"=",
"Plugin",
"::",
"getData",
"(",
"$",
"plugin",
")",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"name",
"=>",
"$",
"callback",
")",
"{",
"if",
... | Registration plugin manifest callbacks.
@param string $plugin
@return void | [
"Registration",
"plugin",
"manifest",
"callbacks",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Plugin.php#L227-L235 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.