id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
12,000 | pletfix/core | src/Services/Process.php | Process.isRunning | public function isRunning()
{
if ($this->process === null) {
return false;
}
$status = proc_get_status($this->process);
if ($status && $status['running'] === false && $this->exitcode === null) {
$this->exitcode = $status['exitcode'];
// Note that ... | php | public function isRunning()
{
if ($this->process === null) {
return false;
}
$status = proc_get_status($this->process);
if ($status && $status['running'] === false && $this->exitcode === null) {
$this->exitcode = $status['exitcode'];
// Note that ... | [
"public",
"function",
"isRunning",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"process",
"===",
"null",
")",
"{",
"return",
"false",
";",
"}",
"$",
"status",
"=",
"proc_get_status",
"(",
"$",
"this",
"->",
"process",
")",
";",
"if",
"(",
"$",
"st... | Determine if the process is currently running.
@return bool true if the process is currently running, false otherwise. | [
"Determine",
"if",
"the",
"process",
"is",
"currently",
"running",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/Process.php#L248-L262 |
12,001 | pletfix/core | src/Services/Process.php | Process.getExitCode | public function getExitCode()
{
if ($this->exitcode === null && $this->process !== null) {
$status = proc_get_status($this->process);
if ($status && $status['running'] === false) {
$this->exitcode = $status['exitcode'];
}
}
return $this->e... | php | public function getExitCode()
{
if ($this->exitcode === null && $this->process !== null) {
$status = proc_get_status($this->process);
if ($status && $status['running'] === false) {
$this->exitcode = $status['exitcode'];
}
}
return $this->e... | [
"public",
"function",
"getExitCode",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"exitcode",
"===",
"null",
"&&",
"$",
"this",
"->",
"process",
"!==",
"null",
")",
"{",
"$",
"status",
"=",
"proc_get_status",
"(",
"$",
"this",
"->",
"process",
")",
"... | Get the exit code returned by the process.
@return null|int The exit status code, null if the Process is not terminated. | [
"Get",
"the",
"exit",
"code",
"returned",
"by",
"the",
"process",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/Process.php#L269-L279 |
12,002 | becopay/Invoice_SDK_PHP | src/PaymentGateway.php | PaymentGateway.create | public function create($orderId, $price, $description = '', $currency = 'IRR', $merchantCur = 'IRR')
{
// Clear the error variable
$this->error = '';
$orderId = (string)$orderId;
/**
* Check value is string
* If validation functions return false, it will be set e... | php | public function create($orderId, $price, $description = '', $currency = 'IRR', $merchantCur = 'IRR')
{
// Clear the error variable
$this->error = '';
$orderId = (string)$orderId;
/**
* Check value is string
* If validation functions return false, it will be set e... | [
"public",
"function",
"create",
"(",
"$",
"orderId",
",",
"$",
"price",
",",
"$",
"description",
"=",
"''",
",",
"$",
"currency",
"=",
"'IRR'",
",",
"$",
"merchantCur",
"=",
"'IRR'",
")",
"{",
"// Clear the error variable",
"$",
"this",
"->",
"error",
"=... | Create the payment invoice and return the gateway url
@param string | integer $orderId
@param integer $price
@param string $description
@param string $currency payer currency
@param string $merchantCur merchant currency
@return mixed false|response object
@throws \Exceptio... | [
"Create",
"the",
"payment",
"invoice",
"and",
"return",
"the",
"gateway",
"url"
] | f39df3cd9ffa72738f082ad303ac9841fb158313 | https://github.com/becopay/Invoice_SDK_PHP/blob/f39df3cd9ffa72738f082ad303ac9841fb158313/src/PaymentGateway.php#L78-L128 |
12,003 | becopay/Invoice_SDK_PHP | src/PaymentGateway.php | PaymentGateway.check | public function check($invoiceId)
{
// Clear the error variable
$this->error = '';
/**
* Check value is string
* If string return false and set error message on error variable
*/
if (
!self::__validateString($invoiceId, 1, 50)
)
... | php | public function check($invoiceId)
{
// Clear the error variable
$this->error = '';
/**
* Check value is string
* If string return false and set error message on error variable
*/
if (
!self::__validateString($invoiceId, 1, 50)
)
... | [
"public",
"function",
"check",
"(",
"$",
"invoiceId",
")",
"{",
"// Clear the error variable",
"$",
"this",
"->",
"error",
"=",
"''",
";",
"/**\n * Check value is string\n * If string return false and set error message on error variable\n */",
"if",
"(",
... | Check the payment status with invoice id
@param string $invoiceId
@return mixed false|response object
@throws \Exception | [
"Check",
"the",
"payment",
"status",
"with",
"invoice",
"id"
] | f39df3cd9ffa72738f082ad303ac9841fb158313 | https://github.com/becopay/Invoice_SDK_PHP/blob/f39df3cd9ffa72738f082ad303ac9841fb158313/src/PaymentGateway.php#L137-L158 |
12,004 | becopay/Invoice_SDK_PHP | src/PaymentGateway.php | PaymentGateway.__sendCheckRequest | private function __sendCheckRequest($path, $param)
{
$result = self::__sendRequest($path, 'GET', $param);
// if response code is 200 return the response value
if ($result->code === 200) {
if (isset($result->response->qr))
unset($result->response->qr);
... | php | private function __sendCheckRequest($path, $param)
{
$result = self::__sendRequest($path, 'GET', $param);
// if response code is 200 return the response value
if ($result->code === 200) {
if (isset($result->response->qr))
unset($result->response->qr);
... | [
"private",
"function",
"__sendCheckRequest",
"(",
"$",
"path",
",",
"$",
"param",
")",
"{",
"$",
"result",
"=",
"self",
"::",
"__sendRequest",
"(",
"$",
"path",
",",
"'GET'",
",",
"$",
"param",
")",
";",
"// if response code is 200 return the response value",
... | Send Check invoice request
@param $path
@param $param
@return bool
@throws \Exception | [
"Send",
"Check",
"invoice",
"request"
] | f39df3cd9ffa72738f082ad303ac9841fb158313 | https://github.com/becopay/Invoice_SDK_PHP/blob/f39df3cd9ffa72738f082ad303ac9841fb158313/src/PaymentGateway.php#L200-L221 |
12,005 | becopay/Invoice_SDK_PHP | src/PaymentGateway.php | PaymentGateway.__sendRequest | private function __sendRequest($urlPath, $method, $param)
{
// Check Curl function if is enabled to send request
if (function_exists('curl_version'))
return self::__sendCurl($urlPath, $method, $param);
// Check file_get_contents function if is enabled to send request
els... | php | private function __sendRequest($urlPath, $method, $param)
{
// Check Curl function if is enabled to send request
if (function_exists('curl_version'))
return self::__sendCurl($urlPath, $method, $param);
// Check file_get_contents function if is enabled to send request
els... | [
"private",
"function",
"__sendRequest",
"(",
"$",
"urlPath",
",",
"$",
"method",
",",
"$",
"param",
")",
"{",
"// Check Curl function if is enabled to send request",
"if",
"(",
"function_exists",
"(",
"'curl_version'",
")",
")",
"return",
"self",
"::",
"__sendCurl",... | Send the request to payment server
@param string $urlPath
@param string $method request method type , POST|GET
@param array $param request parameters
@return object
@throws \Exception | [
"Send",
"the",
"request",
"to",
"payment",
"server"
] | f39df3cd9ffa72738f082ad303ac9841fb158313 | https://github.com/becopay/Invoice_SDK_PHP/blob/f39df3cd9ffa72738f082ad303ac9841fb158313/src/PaymentGateway.php#L232-L245 |
12,006 | becopay/Invoice_SDK_PHP | src/PaymentGateway.php | PaymentGateway.__sendCurl | private function __sendCurl($urlPath, $method, $param)
{
$url = trim($this->apiBaseUrl, '/') . '/' . trim($urlPath, '/');
if ($method == 'GET') {
$query = http_build_query($param);
$url = $url . '?' . $query;
}
$curl = curl_init();
curl_setopt_array(... | php | private function __sendCurl($urlPath, $method, $param)
{
$url = trim($this->apiBaseUrl, '/') . '/' . trim($urlPath, '/');
if ($method == 'GET') {
$query = http_build_query($param);
$url = $url . '?' . $query;
}
$curl = curl_init();
curl_setopt_array(... | [
"private",
"function",
"__sendCurl",
"(",
"$",
"urlPath",
",",
"$",
"method",
",",
"$",
"param",
")",
"{",
"$",
"url",
"=",
"trim",
"(",
"$",
"this",
"->",
"apiBaseUrl",
",",
"'/'",
")",
".",
"'/'",
".",
"trim",
"(",
"$",
"urlPath",
",",
"'/'",
"... | Use Curl function for Send request
@param string $urlPath
@param string $method request method type , POST|GET
@param array $param request parameters
@return object | [
"Use",
"Curl",
"function",
"for",
"Send",
"request"
] | f39df3cd9ffa72738f082ad303ac9841fb158313 | https://github.com/becopay/Invoice_SDK_PHP/blob/f39df3cd9ffa72738f082ad303ac9841fb158313/src/PaymentGateway.php#L255-L288 |
12,007 | becopay/Invoice_SDK_PHP | src/PaymentGateway.php | PaymentGateway.__sendFileGetContents | private function __sendFileGetContents($urlPath, $method, $param)
{
$url = trim($this->apiBaseUrl, '/') . '/' . trim($urlPath, '/');
if ($method == 'GET') {
$query = http_build_query($param);
$url = $url . '?' . $query;
}
$opts = array('http' =>
... | php | private function __sendFileGetContents($urlPath, $method, $param)
{
$url = trim($this->apiBaseUrl, '/') . '/' . trim($urlPath, '/');
if ($method == 'GET') {
$query = http_build_query($param);
$url = $url . '?' . $query;
}
$opts = array('http' =>
... | [
"private",
"function",
"__sendFileGetContents",
"(",
"$",
"urlPath",
",",
"$",
"method",
",",
"$",
"param",
")",
"{",
"$",
"url",
"=",
"trim",
"(",
"$",
"this",
"->",
"apiBaseUrl",
",",
"'/'",
")",
".",
"'/'",
".",
"trim",
"(",
"$",
"urlPath",
",",
... | Use file_get_contents function for Send request
@param string $urlPath
@param string $method request method type , POST|GET
@param array $param request parameters
@return object | [
"Use",
"file_get_contents",
"function",
"for",
"Send",
"request"
] | f39df3cd9ffa72738f082ad303ac9841fb158313 | https://github.com/becopay/Invoice_SDK_PHP/blob/f39df3cd9ffa72738f082ad303ac9841fb158313/src/PaymentGateway.php#L298-L330 |
12,008 | becopay/Invoice_SDK_PHP | src/PaymentGateway.php | PaymentGateway.__validateUrl | private function __validateUrl($url)
{
if (empty($url) || !is_string($url) || strlen($url) > 512 ||
!preg_match('/^http(s)?:\/\/[a-z0-9-]+(.[a-z0-9-]+)+(:[0-9]+)?(\/.*)?$/i', $url) ||
!filter_var($url, FILTER_VALIDATE_URL)
) {
$this->error = 'invalid url format';
... | php | private function __validateUrl($url)
{
if (empty($url) || !is_string($url) || strlen($url) > 512 ||
!preg_match('/^http(s)?:\/\/[a-z0-9-]+(.[a-z0-9-]+)+(:[0-9]+)?(\/.*)?$/i', $url) ||
!filter_var($url, FILTER_VALIDATE_URL)
) {
$this->error = 'invalid url format';
... | [
"private",
"function",
"__validateUrl",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"url",
")",
"||",
"!",
"is_string",
"(",
"$",
"url",
")",
"||",
"strlen",
"(",
"$",
"url",
")",
">",
"512",
"||",
"!",
"preg_match",
"(",
"'/^http(s)?:... | Validate url
If url is invalid throw the exception
@param $url
@return bool | [
"Validate",
"url",
"If",
"url",
"is",
"invalid",
"throw",
"the",
"exception"
] | f39df3cd9ffa72738f082ad303ac9841fb158313 | https://github.com/becopay/Invoice_SDK_PHP/blob/f39df3cd9ffa72738f082ad303ac9841fb158313/src/PaymentGateway.php#L339-L349 |
12,009 | becopay/Invoice_SDK_PHP | src/PaymentGateway.php | PaymentGateway.__validateString | private function __validateString($string, $minLength = 1, $maxLength = 0)
{
if (!is_string($string)) {
$this->error = 'parameter is not string.';
return false;
} else if ($maxLength > 0 && strlen($string) > $maxLength) {
$this->error = 'parameter is too long. str... | php | private function __validateString($string, $minLength = 1, $maxLength = 0)
{
if (!is_string($string)) {
$this->error = 'parameter is not string.';
return false;
} else if ($maxLength > 0 && strlen($string) > $maxLength) {
$this->error = 'parameter is too long. str... | [
"private",
"function",
"__validateString",
"(",
"$",
"string",
",",
"$",
"minLength",
"=",
"1",
",",
"$",
"maxLength",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"string",
")",
")",
"{",
"$",
"this",
"->",
"error",
"=",
"'parameter is... | validate the string
@param $string
@param $minLength
@param $maxLength
@return bool | [
"validate",
"the",
"string"
] | f39df3cd9ffa72738f082ad303ac9841fb158313 | https://github.com/becopay/Invoice_SDK_PHP/blob/f39df3cd9ffa72738f082ad303ac9841fb158313/src/PaymentGateway.php#L359-L372 |
12,010 | becopay/Invoice_SDK_PHP | src/PaymentGateway.php | PaymentGateway.__validateNumeric | private function __validateNumeric($int, $minLength = 1, $maxLength = 0)
{
if (!is_numeric($int)) {
$this->error = 'parameter is not number';
return false;
} else if ($maxLength > 0 && strlen($int) > $maxLength) {
$this->error = 'parameter is too long. number:' . ... | php | private function __validateNumeric($int, $minLength = 1, $maxLength = 0)
{
if (!is_numeric($int)) {
$this->error = 'parameter is not number';
return false;
} else if ($maxLength > 0 && strlen($int) > $maxLength) {
$this->error = 'parameter is too long. number:' . ... | [
"private",
"function",
"__validateNumeric",
"(",
"$",
"int",
",",
"$",
"minLength",
"=",
"1",
",",
"$",
"maxLength",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"int",
")",
")",
"{",
"$",
"this",
"->",
"error",
"=",
"'parameter is not... | validate variable is a number or a numeric string
@param $int
@param $minLength
@param $maxLength
@return bool | [
"validate",
"variable",
"is",
"a",
"number",
"or",
"a",
"numeric",
"string"
] | f39df3cd9ffa72738f082ad303ac9841fb158313 | https://github.com/becopay/Invoice_SDK_PHP/blob/f39df3cd9ffa72738f082ad303ac9841fb158313/src/PaymentGateway.php#L382-L395 |
12,011 | bmdevel/php-index | classes/xml/XmlParser.php | XmlParser.parseKeys | public function parseKeys($data, $offset)
{
$element = \preg_quote($this->getIndex()->getElement());
$attribute = \preg_quote($this->getIndex()->getAttribute());
$pregExp = '/<' . $element . '\s([^>]*\s)?'
. $attribute . '\s*=\s*([\'"])(.+?)\2[^>]*>/si';
\preg_match_al... | php | public function parseKeys($data, $offset)
{
$element = \preg_quote($this->getIndex()->getElement());
$attribute = \preg_quote($this->getIndex()->getAttribute());
$pregExp = '/<' . $element . '\s([^>]*\s)?'
. $attribute . '\s*=\s*([\'"])(.+?)\2[^>]*>/si';
\preg_match_al... | [
"public",
"function",
"parseKeys",
"(",
"$",
"data",
",",
"$",
"offset",
")",
"{",
"$",
"element",
"=",
"\\",
"preg_quote",
"(",
"$",
"this",
"->",
"getIndex",
"(",
")",
"->",
"getElement",
"(",
")",
")",
";",
"$",
"attribute",
"=",
"\\",
"preg_quote... | Returns an array with FoundKey objects
$data is parsed for keys. The found keys are returned.
@param string $data Parseable data
@param int $offset The position where the date came from
@return array
@see FoundKey | [
"Returns",
"an",
"array",
"with",
"FoundKey",
"objects"
] | 6a6b476f1706b9524bfb34f6ce0963b1aea91259 | https://github.com/bmdevel/php-index/blob/6a6b476f1706b9524bfb34f6ce0963b1aea91259/classes/xml/XmlParser.php#L45-L67 |
12,012 | bmdevel/php-index | classes/xml/XmlParser.php | XmlParser.getData | public function getData($offset)
{
$this->parserPosition = null;
$this->parserLevel = 0;
$data = "";
$parser = @\xml_parser_create();
$filePointer = $this->getIndex()->getFile()->getFilePointer();
if (! \is_resource($parser)) {
$error = \er... | php | public function getData($offset)
{
$this->parserPosition = null;
$this->parserLevel = 0;
$data = "";
$parser = @\xml_parser_create();
$filePointer = $this->getIndex()->getFile()->getFilePointer();
if (! \is_resource($parser)) {
$error = \er... | [
"public",
"function",
"getData",
"(",
"$",
"offset",
")",
"{",
"$",
"this",
"->",
"parserPosition",
"=",
"null",
";",
"$",
"this",
"->",
"parserLevel",
"=",
"0",
";",
"$",
"data",
"=",
"\"\"",
";",
"$",
"parser",
"=",
"@",
"\\",
"xml_parser_create",
... | Returns the XML container which begins at the specified offset
This method uses the event based XML parser. So public handler methods
are defined.
@param int $offset Offset of the XML container
@return string
@throws ReadDataIndexException | [
"Returns",
"the",
"XML",
"container",
"which",
"begins",
"at",
"the",
"specified",
"offset"
] | 6a6b476f1706b9524bfb34f6ce0963b1aea91259 | https://github.com/bmdevel/php-index/blob/6a6b476f1706b9524bfb34f6ce0963b1aea91259/classes/xml/XmlParser.php#L80-L118 |
12,013 | bmdevel/php-index | classes/xml/XmlParser.php | XmlParser.onEndElement | public function onEndElement($parser, $element)
{
$this->parserLevel--;
if ($this->parserLevel > 0) {
return;
}
if ($element != \strtoupper($this->getIndex()->getElement())) {
throw new ReadDataIndexException(
"Unexpected closing of element '$... | php | public function onEndElement($parser, $element)
{
$this->parserLevel--;
if ($this->parserLevel > 0) {
return;
}
if ($element != \strtoupper($this->getIndex()->getElement())) {
throw new ReadDataIndexException(
"Unexpected closing of element '$... | [
"public",
"function",
"onEndElement",
"(",
"$",
"parser",
",",
"$",
"element",
")",
"{",
"$",
"this",
"->",
"parserLevel",
"--",
";",
"if",
"(",
"$",
"this",
"->",
"parserLevel",
">",
"0",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"element",
"!... | Handler for an element end event
This method is internally used by getData().
@param resource $parser XML Parser
@param string $element Element name
@return void
@throws ReadDataIndexException
@see XmlParser::getData()
@see xml_set_element_handler() | [
"Handler",
"for",
"an",
"element",
"end",
"event"
] | 6a6b476f1706b9524bfb34f6ce0963b1aea91259 | https://github.com/bmdevel/php-index/blob/6a6b476f1706b9524bfb34f6ce0963b1aea91259/classes/xml/XmlParser.php#L151-L165 |
12,014 | webriq/core | module/Paragraph/src/Grid/Paragraph/Model/Dashboard/Structure.php | Structure.reflectCss | protected function reflectCss( FieldsetInterface $fieldset, $selector )
{
foreach ( $fieldset->getFieldsets() as $subFieldset )
{
if ( ! $subFieldset instanceof Collection )
{
$this->reflectCss( $subFieldset, $selector );
}
}
forea... | php | protected function reflectCss( FieldsetInterface $fieldset, $selector )
{
foreach ( $fieldset->getFieldsets() as $subFieldset )
{
if ( ! $subFieldset instanceof Collection )
{
$this->reflectCss( $subFieldset, $selector );
}
}
forea... | [
"protected",
"function",
"reflectCss",
"(",
"FieldsetInterface",
"$",
"fieldset",
",",
"$",
"selector",
")",
"{",
"foreach",
"(",
"$",
"fieldset",
"->",
"getFieldsets",
"(",
")",
"as",
"$",
"subFieldset",
")",
"{",
"if",
"(",
"!",
"$",
"subFieldset",
"inst... | Reflect css properties
@param \Zend\Form\FieldsetInterface $fieldset
@param string $selector
@return \Zend\Form\FieldsetInterface | [
"Reflect",
"css",
"properties"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Model/Dashboard/Structure.php#L99-L125 |
12,015 | registripe/registripe-core | code/pages/RegistrableEvent.php | RegistrableEvent.getAvailableTickets | public function getAvailableTickets() {
$available = ArrayList::create();
$tickets = $this->Tickets();
foreach($tickets as $ticket) {
if ($ticket->isAvailable()) {
$available->push($ticket);
}
}
return $available;
} | php | public function getAvailableTickets() {
$available = ArrayList::create();
$tickets = $this->Tickets();
foreach($tickets as $ticket) {
if ($ticket->isAvailable()) {
$available->push($ticket);
}
}
return $available;
} | [
"public",
"function",
"getAvailableTickets",
"(",
")",
"{",
"$",
"available",
"=",
"ArrayList",
"::",
"create",
"(",
")",
";",
"$",
"tickets",
"=",
"$",
"this",
"->",
"Tickets",
"(",
")",
";",
"foreach",
"(",
"$",
"tickets",
"as",
"$",
"ticket",
")",
... | Get available tickets.
@return ArrayList | [
"Get",
"available",
"tickets",
"."
] | e52b3340aef323067ebfa9bd5fa07cb81bb63db9 | https://github.com/registripe/registripe-core/blob/e52b3340aef323067ebfa9bd5fa07cb81bb63db9/code/pages/RegistrableEvent.php#L168-L177 |
12,016 | registripe/registripe-core | code/pages/RegistrableEvent.php | RegistrableEvent.getRemainingCapacity | public function getRemainingCapacity($excludeId = null) {
if (!$this->Capacity){
return true;
}
$bookings = $this->Registrations()->filter("Status:not", "Canceled");
if ($excludeId) {
$bookings = $bookings->filter("ID:not", $excludeId);
}
$taken = $bookings->sum("Quantity");
if($this->Capacity >= $t... | php | public function getRemainingCapacity($excludeId = null) {
if (!$this->Capacity){
return true;
}
$bookings = $this->Registrations()->filter("Status:not", "Canceled");
if ($excludeId) {
$bookings = $bookings->filter("ID:not", $excludeId);
}
$taken = $bookings->sum("Quantity");
if($this->Capacity >= $t... | [
"public",
"function",
"getRemainingCapacity",
"(",
"$",
"excludeId",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"Capacity",
")",
"{",
"return",
"true",
";",
"}",
"$",
"bookings",
"=",
"$",
"this",
"->",
"Registrations",
"(",
")",
"->",
... | Returns the overall number of places remaining at this event, TRUE if
there are unlimited places or FALSE if they are all taken.
@param int $excludeId A registration ID to exclude from calculations.
@return int|bool | [
"Returns",
"the",
"overall",
"number",
"of",
"places",
"remaining",
"at",
"this",
"event",
"TRUE",
"if",
"there",
"are",
"unlimited",
"places",
"or",
"FALSE",
"if",
"they",
"are",
"all",
"taken",
"."
] | e52b3340aef323067ebfa9bd5fa07cb81bb63db9 | https://github.com/registripe/registripe-core/blob/e52b3340aef323067ebfa9bd5fa07cb81bb63db9/code/pages/RegistrableEvent.php#L228-L242 |
12,017 | registripe/registripe-core | code/pages/RegistrableEvent.php | RegistrableEvent_Controller.registration | public function registration($request) {
$id = $request->param('ID');
if (!ctype_digit($id)) {
return $this->httpError(404);
}
$rego = EventRegistration::get()->byID($id);
if (!$rego || $rego->EventID != $this->ID) {
return $this->httpError(404);
}
$request->shift();
$request->shiftAllParams();
... | php | public function registration($request) {
$id = $request->param('ID');
if (!ctype_digit($id)) {
return $this->httpError(404);
}
$rego = EventRegistration::get()->byID($id);
if (!$rego || $rego->EventID != $this->ID) {
return $this->httpError(404);
}
$request->shift();
$request->shiftAllParams();
... | [
"public",
"function",
"registration",
"(",
"$",
"request",
")",
"{",
"$",
"id",
"=",
"$",
"request",
"->",
"param",
"(",
"'ID'",
")",
";",
"if",
"(",
"!",
"ctype_digit",
"(",
"$",
"id",
")",
")",
"{",
"return",
"$",
"this",
"->",
"httpError",
"(",
... | Allows a user to view the details of their registration.
@param SS_HTTPRequest $request
@return EventRegistrationDetailsController | [
"Allows",
"a",
"user",
"to",
"view",
"the",
"details",
"of",
"their",
"registration",
"."
] | e52b3340aef323067ebfa9bd5fa07cb81bb63db9 | https://github.com/registripe/registripe-core/blob/e52b3340aef323067ebfa9bd5fa07cb81bb63db9/code/pages/RegistrableEvent.php#L268-L281 |
12,018 | GustavSoftware/Lexer | src/ALexer.php | ALexer.getToken | public function getToken()
{
if(isset($this->_tokens[$this->_position])) {
return $this->_tokens[$this->_position];
} else {
return null;
}
} | php | public function getToken()
{
if(isset($this->_tokens[$this->_position])) {
return $this->_tokens[$this->_position];
} else {
return null;
}
} | [
"public",
"function",
"getToken",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_tokens",
"[",
"$",
"this",
"->",
"_position",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_tokens",
"[",
"$",
"this",
"->",
"_position",
"]",
";",
... | Returns the current token on input.
@return \Gustav\Lexer\Token|null
The current token | [
"Returns",
"the",
"current",
"token",
"on",
"input",
"."
] | c0dca9d2c297eeccd37521fa52128e8a782f1f0b | https://github.com/GustavSoftware/Lexer/blob/c0dca9d2c297eeccd37521fa52128e8a782f1f0b/src/ALexer.php#L116-L123 |
12,019 | joegreen88/zf1-components-base | src/Zend/Loader/PluginLoader.php | Zend_Loader_PluginLoader._formatPrefix | protected function _formatPrefix($prefix)
{
if($prefix == "") {
return $prefix;
}
$nsSeparator = (false !== strpos($prefix, '\\'))?'\\':'_';
return rtrim($prefix, $nsSeparator) . $nsSeparator;
} | php | protected function _formatPrefix($prefix)
{
if($prefix == "") {
return $prefix;
}
$nsSeparator = (false !== strpos($prefix, '\\'))?'\\':'_';
return rtrim($prefix, $nsSeparator) . $nsSeparator;
} | [
"protected",
"function",
"_formatPrefix",
"(",
"$",
"prefix",
")",
"{",
"if",
"(",
"$",
"prefix",
"==",
"\"\"",
")",
"{",
"return",
"$",
"prefix",
";",
"}",
"$",
"nsSeparator",
"=",
"(",
"false",
"!==",
"strpos",
"(",
"$",
"prefix",
",",
"'\\\\'",
")... | Format prefix for internal use
@param string $prefix
@return string | [
"Format",
"prefix",
"for",
"internal",
"use"
] | d4591a2234c2db3094b54c08bcdc4303f7bf4819 | https://github.com/joegreen88/zf1-components-base/blob/d4591a2234c2db3094b54c08bcdc4303f7bf4819/src/Zend/Loader/PluginLoader.php#L124-L132 |
12,020 | joegreen88/zf1-components-base | src/Zend/Loader/PluginLoader.php | Zend_Loader_PluginLoader.getPaths | public function getPaths($prefix = null)
{
if ((null !== $prefix) && is_string($prefix)) {
$prefix = $this->_formatPrefix($prefix);
if ($this->_useStaticRegistry) {
if (isset(self::$_staticPrefixToPaths[$this->_useStaticRegistry][$prefix])) {
retur... | php | public function getPaths($prefix = null)
{
if ((null !== $prefix) && is_string($prefix)) {
$prefix = $this->_formatPrefix($prefix);
if ($this->_useStaticRegistry) {
if (isset(self::$_staticPrefixToPaths[$this->_useStaticRegistry][$prefix])) {
retur... | [
"public",
"function",
"getPaths",
"(",
"$",
"prefix",
"=",
"null",
")",
"{",
"if",
"(",
"(",
"null",
"!==",
"$",
"prefix",
")",
"&&",
"is_string",
"(",
"$",
"prefix",
")",
")",
"{",
"$",
"prefix",
"=",
"$",
"this",
"->",
"_formatPrefix",
"(",
"$",
... | Get path stack
@param string $prefix
@return false|array False if prefix does not exist, array otherwise | [
"Get",
"path",
"stack"
] | d4591a2234c2db3094b54c08bcdc4303f7bf4819 | https://github.com/joegreen88/zf1-components-base/blob/d4591a2234c2db3094b54c08bcdc4303f7bf4819/src/Zend/Loader/PluginLoader.php#L170-L194 |
12,021 | joegreen88/zf1-components-base | src/Zend/Loader/PluginLoader.php | Zend_Loader_PluginLoader.clearPaths | public function clearPaths($prefix = null)
{
if ((null !== $prefix) && is_string($prefix)) {
$prefix = $this->_formatPrefix($prefix);
if ($this->_useStaticRegistry) {
if (isset(self::$_staticPrefixToPaths[$this->_useStaticRegistry][$prefix])) {
uns... | php | public function clearPaths($prefix = null)
{
if ((null !== $prefix) && is_string($prefix)) {
$prefix = $this->_formatPrefix($prefix);
if ($this->_useStaticRegistry) {
if (isset(self::$_staticPrefixToPaths[$this->_useStaticRegistry][$prefix])) {
uns... | [
"public",
"function",
"clearPaths",
"(",
"$",
"prefix",
"=",
"null",
")",
"{",
"if",
"(",
"(",
"null",
"!==",
"$",
"prefix",
")",
"&&",
"is_string",
"(",
"$",
"prefix",
")",
")",
"{",
"$",
"prefix",
"=",
"$",
"this",
"->",
"_formatPrefix",
"(",
"$"... | Clear path stack
@param string $prefix
@return bool False only if $prefix does not exist | [
"Clear",
"path",
"stack"
] | d4591a2234c2db3094b54c08bcdc4303f7bf4819 | https://github.com/joegreen88/zf1-components-base/blob/d4591a2234c2db3094b54c08bcdc4303f7bf4819/src/Zend/Loader/PluginLoader.php#L202-L230 |
12,022 | joegreen88/zf1-components-base | src/Zend/Loader/PluginLoader.php | Zend_Loader_PluginLoader.isLoaded | public function isLoaded($name)
{
$name = $this->_formatName($name);
if ($this->_useStaticRegistry) {
return isset(self::$_staticLoadedPlugins[$this->_useStaticRegistry][$name]);
}
return isset($this->_loadedPlugins[$name]);
} | php | public function isLoaded($name)
{
$name = $this->_formatName($name);
if ($this->_useStaticRegistry) {
return isset(self::$_staticLoadedPlugins[$this->_useStaticRegistry][$name]);
}
return isset($this->_loadedPlugins[$name]);
} | [
"public",
"function",
"isLoaded",
"(",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"_formatName",
"(",
"$",
"name",
")",
";",
"if",
"(",
"$",
"this",
"->",
"_useStaticRegistry",
")",
"{",
"return",
"isset",
"(",
"self",
"::",
"$",
"... | Whether or not a Plugin by a specific name is loaded
@param string $name
@return Zend_Loader_PluginLoader | [
"Whether",
"or",
"not",
"a",
"Plugin",
"by",
"a",
"specific",
"name",
"is",
"loaded"
] | d4591a2234c2db3094b54c08bcdc4303f7bf4819 | https://github.com/joegreen88/zf1-components-base/blob/d4591a2234c2db3094b54c08bcdc4303f7bf4819/src/Zend/Loader/PluginLoader.php#L284-L292 |
12,023 | joegreen88/zf1-components-base | src/Zend/Loader/PluginLoader.php | Zend_Loader_PluginLoader.getClassName | public function getClassName($name)
{
$name = $this->_formatName($name);
if ($this->_useStaticRegistry
&& isset(self::$_staticLoadedPlugins[$this->_useStaticRegistry][$name])
) {
return self::$_staticLoadedPlugins[$this->_useStaticRegistry][$name];
} elseif (i... | php | public function getClassName($name)
{
$name = $this->_formatName($name);
if ($this->_useStaticRegistry
&& isset(self::$_staticLoadedPlugins[$this->_useStaticRegistry][$name])
) {
return self::$_staticLoadedPlugins[$this->_useStaticRegistry][$name];
} elseif (i... | [
"public",
"function",
"getClassName",
"(",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"_formatName",
"(",
"$",
"name",
")",
";",
"if",
"(",
"$",
"this",
"->",
"_useStaticRegistry",
"&&",
"isset",
"(",
"self",
"::",
"$",
"_staticLoadedP... | Return full class name for a named plugin
@param string $name
@return string|false False if class not found, class name otherwise | [
"Return",
"full",
"class",
"name",
"for",
"a",
"named",
"plugin"
] | d4591a2234c2db3094b54c08bcdc4303f7bf4819 | https://github.com/joegreen88/zf1-components-base/blob/d4591a2234c2db3094b54c08bcdc4303f7bf4819/src/Zend/Loader/PluginLoader.php#L300-L312 |
12,024 | joegreen88/zf1-components-base | src/Zend/Loader/PluginLoader.php | Zend_Loader_PluginLoader.getClassPath | public function getClassPath($name)
{
$name = $this->_formatName($name);
if ($this->_useStaticRegistry
&& !empty(self::$_staticLoadedPluginPaths[$this->_useStaticRegistry][$name])
) {
return self::$_staticLoadedPluginPaths[$this->_useStaticRegistry][$name];
} ... | php | public function getClassPath($name)
{
$name = $this->_formatName($name);
if ($this->_useStaticRegistry
&& !empty(self::$_staticLoadedPluginPaths[$this->_useStaticRegistry][$name])
) {
return self::$_staticLoadedPluginPaths[$this->_useStaticRegistry][$name];
} ... | [
"public",
"function",
"getClassPath",
"(",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"_formatName",
"(",
"$",
"name",
")",
";",
"if",
"(",
"$",
"this",
"->",
"_useStaticRegistry",
"&&",
"!",
"empty",
"(",
"self",
"::",
"$",
"_static... | Get path to plugin class
@param mixed $name
@return string|false False if not found | [
"Get",
"path",
"to",
"plugin",
"class"
] | d4591a2234c2db3094b54c08bcdc4303f7bf4819 | https://github.com/joegreen88/zf1-components-base/blob/d4591a2234c2db3094b54c08bcdc4303f7bf4819/src/Zend/Loader/PluginLoader.php#L320-L344 |
12,025 | joegreen88/zf1-components-base | src/Zend/Loader/PluginLoader.php | Zend_Loader_PluginLoader.load | public function load($name, $throwExceptions = true)
{
$name = $this->_formatName($name);
if ($this->isLoaded($name)) {
return $this->getClassName($name);
}
if ($this->_useStaticRegistry) {
$registry = self::$_staticPrefixToPaths[$this->_useStaticRegistry];
... | php | public function load($name, $throwExceptions = true)
{
$name = $this->_formatName($name);
if ($this->isLoaded($name)) {
return $this->getClassName($name);
}
if ($this->_useStaticRegistry) {
$registry = self::$_staticPrefixToPaths[$this->_useStaticRegistry];
... | [
"public",
"function",
"load",
"(",
"$",
"name",
",",
"$",
"throwExceptions",
"=",
"true",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"_formatName",
"(",
"$",
"name",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isLoaded",
"(",
"$",
"name",
")",
"... | Load a plugin via the name provided
@param string $name
@param bool $throwExceptions Whether or not to throw exceptions if the
class is not resolved
@return string|false Class name of loaded class; false if $throwExceptions
if false and no class found
@throws Zend_Loader_Exception if class not found | [
"Load",
"a",
"plugin",
"via",
"the",
"name",
"provided"
] | d4591a2234c2db3094b54c08bcdc4303f7bf4819 | https://github.com/joegreen88/zf1-components-base/blob/d4591a2234c2db3094b54c08bcdc4303f7bf4819/src/Zend/Loader/PluginLoader.php#L356-L421 |
12,026 | joegreen88/zf1-components-base | src/Zend/Loader/PluginLoader.php | Zend_Loader_PluginLoader.setIncludeFileCache | public static function setIncludeFileCache($file)
{
if (null === $file) {
self::$_includeFileCache = null;
return;
}
if (!file_exists($file) && !file_exists(dirname($file))) {
throw new Zend_Loader_PluginLoader_Exception('Specified file does not exist an... | php | public static function setIncludeFileCache($file)
{
if (null === $file) {
self::$_includeFileCache = null;
return;
}
if (!file_exists($file) && !file_exists(dirname($file))) {
throw new Zend_Loader_PluginLoader_Exception('Specified file does not exist an... | [
"public",
"static",
"function",
"setIncludeFileCache",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"file",
")",
"{",
"self",
"::",
"$",
"_includeFileCache",
"=",
"null",
";",
"return",
";",
"}",
"if",
"(",
"!",
"file_exists",
"(",
"$",
... | Set path to class file cache
Specify a path to a file that will add include_once statements for each
plugin class loaded. This is an opt-in feature for performance purposes.
@param string $file
@return void
@throws Zend_Loader_PluginLoader_Exception if file is not writeable or path does not exist | [
"Set",
"path",
"to",
"class",
"file",
"cache"
] | d4591a2234c2db3094b54c08bcdc4303f7bf4819 | https://github.com/joegreen88/zf1-components-base/blob/d4591a2234c2db3094b54c08bcdc4303f7bf4819/src/Zend/Loader/PluginLoader.php#L433-L454 |
12,027 | joegreen88/zf1-components-base | src/Zend/Loader/PluginLoader.php | Zend_Loader_PluginLoader._appendIncFile | protected static function _appendIncFile($incFile)
{
if (!file_exists(self::$_includeFileCache)) {
$file = '<?php';
} else {
$file = file_get_contents(self::$_includeFileCache);
}
if (!strstr($file, $incFile)) {
$file .= "\ninclude_once '$incFile';... | php | protected static function _appendIncFile($incFile)
{
if (!file_exists(self::$_includeFileCache)) {
$file = '<?php';
} else {
$file = file_get_contents(self::$_includeFileCache);
}
if (!strstr($file, $incFile)) {
$file .= "\ninclude_once '$incFile';... | [
"protected",
"static",
"function",
"_appendIncFile",
"(",
"$",
"incFile",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"self",
"::",
"$",
"_includeFileCache",
")",
")",
"{",
"$",
"file",
"=",
"'<?php'",
";",
"}",
"else",
"{",
"$",
"file",
"=",
"file_g... | Append an include_once statement to the class file cache
@param string $incFile
@return void | [
"Append",
"an",
"include_once",
"statement",
"to",
"the",
"class",
"file",
"cache"
] | d4591a2234c2db3094b54c08bcdc4303f7bf4819 | https://github.com/joegreen88/zf1-components-base/blob/d4591a2234c2db3094b54c08bcdc4303f7bf4819/src/Zend/Loader/PluginLoader.php#L472-L483 |
12,028 | bwaidelich/Wwwision.Eventr | Classes/EventHandler/ProjectionHandleJob.php | ProjectionHandleJob.execute | public function execute(QueueInterface $queue, Message $message)
{
$projection = $this->eventr->getProjection($this->projectionName);
$aggregateType = $this->eventr->getAggregateType($this->aggregateType);
$aggregate = $aggregateType->getAggregate($this->aggregateId);
$projection->ha... | php | public function execute(QueueInterface $queue, Message $message)
{
$projection = $this->eventr->getProjection($this->projectionName);
$aggregateType = $this->eventr->getAggregateType($this->aggregateType);
$aggregate = $aggregateType->getAggregate($this->aggregateId);
$projection->ha... | [
"public",
"function",
"execute",
"(",
"QueueInterface",
"$",
"queue",
",",
"Message",
"$",
"message",
")",
"{",
"$",
"projection",
"=",
"$",
"this",
"->",
"eventr",
"->",
"getProjection",
"(",
"$",
"this",
"->",
"projectionName",
")",
";",
"$",
"aggregateT... | Execute the job
A job should finish itself after successful execution using the queue methods.
@param QueueInterface $queue
@param Message $message The original message
@return boolean TRUE if the job was executed successfully and the message should be finished | [
"Execute",
"the",
"job",
"A",
"job",
"should",
"finish",
"itself",
"after",
"successful",
"execution",
"using",
"the",
"queue",
"methods",
"."
] | c3cfac121c922e8e11e2605fe88711d22a0c49d7 | https://github.com/bwaidelich/Wwwision.Eventr/blob/c3cfac121c922e8e11e2605fe88711d22a0c49d7/Classes/EventHandler/ProjectionHandleJob.php#L65-L72 |
12,029 | horse-php/horse | src/Horse/Transformers/ClassTransformer.php | ClassTransformer.transform | public function transform(Command $command)
{
$block = $this->block->reflector(new \ReflectionClass($command));
$lines = [];
foreach ($block->getLines() as $line)
{
$lines[] = $line->stripTag();
}
list($name, $description, $signature) = $lines;
... | php | public function transform(Command $command)
{
$block = $this->block->reflector(new \ReflectionClass($command));
$lines = [];
foreach ($block->getLines() as $line)
{
$lines[] = $line->stripTag();
}
list($name, $description, $signature) = $lines;
... | [
"public",
"function",
"transform",
"(",
"Command",
"$",
"command",
")",
"{",
"$",
"block",
"=",
"$",
"this",
"->",
"block",
"->",
"reflector",
"(",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"command",
")",
")",
";",
"$",
"lines",
"=",
"[",
"]",
";",
... | Read the command metadata and apply it.
@param Command $command
@return void | [
"Read",
"the",
"command",
"metadata",
"and",
"apply",
"it",
"."
] | e2b72508dde353de6cacfbed852aa3de3fc06eff | https://github.com/horse-php/horse/blob/e2b72508dde353de6cacfbed852aa3de3fc06eff/src/Horse/Transformers/ClassTransformer.php#L54-L69 |
12,030 | horse-php/horse | src/Horse/Transformers/ClassTransformer.php | ClassTransformer.getDefinition | public function getDefinition($signature)
{
$elements = $this->meta->parseMany($signature);
return \array_map([$this->element, 'transform'], $elements);
} | php | public function getDefinition($signature)
{
$elements = $this->meta->parseMany($signature);
return \array_map([$this->element, 'transform'], $elements);
} | [
"public",
"function",
"getDefinition",
"(",
"$",
"signature",
")",
"{",
"$",
"elements",
"=",
"$",
"this",
"->",
"meta",
"->",
"parseMany",
"(",
"$",
"signature",
")",
";",
"return",
"\\",
"array_map",
"(",
"[",
"$",
"this",
"->",
"element",
",",
"'tra... | Transform the string to a valid command definition.
@param string $signature
@return array | [
"Transform",
"the",
"string",
"to",
"a",
"valid",
"command",
"definition",
"."
] | e2b72508dde353de6cacfbed852aa3de3fc06eff | https://github.com/horse-php/horse/blob/e2b72508dde353de6cacfbed852aa3de3fc06eff/src/Horse/Transformers/ClassTransformer.php#L77-L82 |
12,031 | skgroup/php-rbac | src/Manager.php | Manager.addRole | public function addRole($role, $inherits = null)
{
if (is_string($role)) {
$name = $role;
$role = $this->createRole($name);
} elseif ($role instanceof RoleInterface) {
$name = $role->getName();
} else {
throw new \InvalidArgumentException('Role... | php | public function addRole($role, $inherits = null)
{
if (is_string($role)) {
$name = $role;
$role = $this->createRole($name);
} elseif ($role instanceof RoleInterface) {
$name = $role->getName();
} else {
throw new \InvalidArgumentException('Role... | [
"public",
"function",
"addRole",
"(",
"$",
"role",
",",
"$",
"inherits",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"role",
")",
")",
"{",
"$",
"name",
"=",
"$",
"role",
";",
"$",
"role",
"=",
"$",
"this",
"->",
"createRole",
"(",
... | Creates a new Role to the RBAC system.
@param string $role
@param string|array|RoleInterface $inherits
@return RoleInterface | [
"Creates",
"a",
"new",
"Role",
"to",
"the",
"RBAC",
"system",
"."
] | 89b08cacda9b1376b8f07d16038d2eade6dfb9e8 | https://github.com/skgroup/php-rbac/blob/89b08cacda9b1376b8f07d16038d2eade6dfb9e8/src/Manager.php#L40-L64 |
12,032 | skgroup/php-rbac | src/Manager.php | Manager.addPermission | public function addPermission($permission)
{
if (is_string($permission)) {
$name = $permission;
$permission = $this->createPermission($name);
} elseif ($permission instanceof PermissionInterface) {
$name = $permission->getName();
} else {
... | php | public function addPermission($permission)
{
if (is_string($permission)) {
$name = $permission;
$permission = $this->createPermission($name);
} elseif ($permission instanceof PermissionInterface) {
$name = $permission->getName();
} else {
... | [
"public",
"function",
"addPermission",
"(",
"$",
"permission",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"permission",
")",
")",
"{",
"$",
"name",
"=",
"$",
"permission",
";",
"$",
"permission",
"=",
"$",
"this",
"->",
"createPermission",
"(",
"$",
"... | Adds a permission to the RBAC system.
@param string|PermissionInterface $permission
@return PermissionInterface | [
"Adds",
"a",
"permission",
"to",
"the",
"RBAC",
"system",
"."
] | 89b08cacda9b1376b8f07d16038d2eade6dfb9e8 | https://github.com/skgroup/php-rbac/blob/89b08cacda9b1376b8f07d16038d2eade6dfb9e8/src/Manager.php#L72-L85 |
12,033 | skgroup/php-rbac | src/Manager.php | Manager.revokeRole | public function revokeRole($role)
{
if ($this->hasRole($role)) {
unset($this->roles[$role]);
return true;
} else {
return false;
}
} | php | public function revokeRole($role)
{
if ($this->hasRole($role)) {
unset($this->roles[$role]);
return true;
} else {
return false;
}
} | [
"public",
"function",
"revokeRole",
"(",
"$",
"role",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasRole",
"(",
"$",
"role",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"roles",
"[",
"$",
"role",
"]",
")",
";",
"return",
"true",
";",
"}",
"el... | Revokes a role from the RBAC system.
@param string $role
@return bool | [
"Revokes",
"a",
"role",
"from",
"the",
"RBAC",
"system",
"."
] | 89b08cacda9b1376b8f07d16038d2eade6dfb9e8 | https://github.com/skgroup/php-rbac/blob/89b08cacda9b1376b8f07d16038d2eade6dfb9e8/src/Manager.php#L93-L101 |
12,034 | skgroup/php-rbac | src/Manager.php | Manager.getRole | public function getRole($name)
{
if ($this->hasRole($name)) {
return $this->roles[$name];
}
throw new \InvalidArgumentException(sprintf('No role with name "%s" could be found', $name));
} | php | public function getRole($name)
{
if ($this->hasRole($name)) {
return $this->roles[$name];
}
throw new \InvalidArgumentException(sprintf('No role with name "%s" could be found', $name));
} | [
"public",
"function",
"getRole",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasRole",
"(",
"$",
"name",
")",
")",
"{",
"return",
"$",
"this",
"->",
"roles",
"[",
"$",
"name",
"]",
";",
"}",
"throw",
"new",
"\\",
"InvalidArgumentExce... | Returns the named role from the RBAC system.
@param string $name
@return RoleInterface | [
"Returns",
"the",
"named",
"role",
"from",
"the",
"RBAC",
"system",
"."
] | 89b08cacda9b1376b8f07d16038d2eade6dfb9e8 | https://github.com/skgroup/php-rbac/blob/89b08cacda9b1376b8f07d16038d2eade6dfb9e8/src/Manager.php#L124-L131 |
12,035 | skgroup/php-rbac | src/Manager.php | Manager.revokePermission | public function revokePermission($permission)
{
if ($this->hasPermission($permission)) {
unset($this->permissions[$permission]);
return true;
} else {
return false;
}
} | php | public function revokePermission($permission)
{
if ($this->hasPermission($permission)) {
unset($this->permissions[$permission]);
return true;
} else {
return false;
}
} | [
"public",
"function",
"revokePermission",
"(",
"$",
"permission",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasPermission",
"(",
"$",
"permission",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"permissions",
"[",
"$",
"permission",
"]",
")",
";",
"re... | Revokes a permission from the RBAC system.
@param string $permission
@return bool | [
"Revokes",
"a",
"permission",
"from",
"the",
"RBAC",
"system",
"."
] | 89b08cacda9b1376b8f07d16038d2eade6dfb9e8 | https://github.com/skgroup/php-rbac/blob/89b08cacda9b1376b8f07d16038d2eade6dfb9e8/src/Manager.php#L149-L157 |
12,036 | skgroup/php-rbac | src/Manager.php | Manager.getPermission | public function getPermission($name)
{
if ($this->hasPermission($name)) {
return $this->permissions[$name];
}
throw new \InvalidArgumentException(sprintf('No permission with name "%s" could be found', $name));
} | php | public function getPermission($name)
{
if ($this->hasPermission($name)) {
return $this->permissions[$name];
}
throw new \InvalidArgumentException(sprintf('No permission with name "%s" could be found', $name));
} | [
"public",
"function",
"getPermission",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasPermission",
"(",
"$",
"name",
")",
")",
"{",
"return",
"$",
"this",
"->",
"permissions",
"[",
"$",
"name",
"]",
";",
"}",
"throw",
"new",
"\\",
"I... | Returns the named permission from the RBAC system.
@param string $name
@return PermissionInterface | [
"Returns",
"the",
"named",
"permission",
"from",
"the",
"RBAC",
"system",
"."
] | 89b08cacda9b1376b8f07d16038d2eade6dfb9e8 | https://github.com/skgroup/php-rbac/blob/89b08cacda9b1376b8f07d16038d2eade6dfb9e8/src/Manager.php#L180-L187 |
12,037 | fproject/php-common | fproject/common/utils/BinaryStream.php | BinaryStream.writeLongUTF | public function writeLongUTF($stream)
{
$this->writeLong($this->_mbStringFunctionsOverloaded ? mb_strlen($stream, '8bit') : strlen($stream));
$this->_stream.= $stream;
} | php | public function writeLongUTF($stream)
{
$this->writeLong($this->_mbStringFunctionsOverloaded ? mb_strlen($stream, '8bit') : strlen($stream));
$this->_stream.= $stream;
} | [
"public",
"function",
"writeLongUTF",
"(",
"$",
"stream",
")",
"{",
"$",
"this",
"->",
"writeLong",
"(",
"$",
"this",
"->",
"_mbStringFunctionsOverloaded",
"?",
"mb_strlen",
"(",
"$",
"stream",
",",
"'8bit'",
")",
":",
"strlen",
"(",
"$",
"stream",
")",
... | Write a long UTF string to the buffer
@param string $stream
@return BinaryStream | [
"Write",
"a",
"long",
"UTF",
"string",
"to",
"the",
"buffer"
] | f8bb514e3fa421764e6a6f5bc167da28178e5236 | https://github.com/fproject/php-common/blob/f8bb514e3fa421764e6a6f5bc167da28178e5236/fproject/common/utils/BinaryStream.php#L236-L240 |
12,038 | bishopb/vanilla | applications/vanilla/controllers/class.categoriescontroller.php | CategoriesController.Table | public function Table() {
if ($this->SyndicationMethod == SYNDICATION_NONE) {
$this->View = 'table';
} else
$this->View = 'all';
$this->All();
} | php | public function Table() {
if ($this->SyndicationMethod == SYNDICATION_NONE) {
$this->View = 'table';
} else
$this->View = 'all';
$this->All();
} | [
"public",
"function",
"Table",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"SyndicationMethod",
"==",
"SYNDICATION_NONE",
")",
"{",
"$",
"this",
"->",
"View",
"=",
"'table'",
";",
"}",
"else",
"$",
"this",
"->",
"View",
"=",
"'all'",
";",
"$",
"this... | "Table" layout for categories. Mimics more traditional forum category layout. | [
"Table",
"layout",
"for",
"categories",
".",
"Mimics",
"more",
"traditional",
"forum",
"category",
"layout",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/controllers/class.categoriescontroller.php#L56-L62 |
12,039 | bishopb/vanilla | applications/vanilla/controllers/class.categoriescontroller.php | CategoriesController.Discussions | public function Discussions() {
// Setup head
$this->AddCssFile('vanilla.css');
$this->Menu->HighlightRoute('/discussions');
$this->AddJsFile('discussions.js');
$Title = C('Garden.HomepageTitle');
if ($Title)
$this->Title($Title, '');
else
$this->Title(T('All ... | php | public function Discussions() {
// Setup head
$this->AddCssFile('vanilla.css');
$this->Menu->HighlightRoute('/discussions');
$this->AddJsFile('discussions.js');
$Title = C('Garden.HomepageTitle');
if ($Title)
$this->Title($Title, '');
else
$this->Title(T('All ... | [
"public",
"function",
"Discussions",
"(",
")",
"{",
"// Setup head",
"$",
"this",
"->",
"AddCssFile",
"(",
"'vanilla.css'",
")",
";",
"$",
"this",
"->",
"Menu",
"->",
"HighlightRoute",
"(",
"'/discussions'",
")",
";",
"$",
"this",
"->",
"AddJsFile",
"(",
"... | Show all categories and few discussions from each.
@since 2.0.0
@access public | [
"Show",
"all",
"categories",
"and",
"few",
"discussions",
"from",
"each",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/controllers/class.categoriescontroller.php#L297-L341 |
12,040 | bishopb/vanilla | applications/vanilla/controllers/class.categoriescontroller.php | CategoriesController.Initialize | public function Initialize() {
parent::Initialize();
if (!C('Vanilla.Categories.Use'))
Redirect('/discussions');
if ($this->Menu)
$this->Menu->HighlightRoute('/categories');
$this->CountCommentsPerPage = C('Vanilla.Comments.PerPage', 30);
} | php | public function Initialize() {
parent::Initialize();
if (!C('Vanilla.Categories.Use'))
Redirect('/discussions');
if ($this->Menu)
$this->Menu->HighlightRoute('/categories');
$this->CountCommentsPerPage = C('Vanilla.Comments.PerPage', 30);
} | [
"public",
"function",
"Initialize",
"(",
")",
"{",
"parent",
"::",
"Initialize",
"(",
")",
";",
"if",
"(",
"!",
"C",
"(",
"'Vanilla.Categories.Use'",
")",
")",
"Redirect",
"(",
"'/discussions'",
")",
";",
"if",
"(",
"$",
"this",
"->",
"Menu",
")",
"$",... | Highlight route.
Always called by dispatcher before controller's requested method.
@since 2.0.0
@access public | [
"Highlight",
"route",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/controllers/class.categoriescontroller.php#L361-L369 |
12,041 | netherphp/object | src/Nether/Object/Datastore.php | Datastore.Append | public function
Append(Array $List, Bool $Keys=FALSE) {
/*//
goes through the given array and appends all the data to this dataset. by
default the array keys are completely ignored. if you need to preseve
the keys (and ergo overwrite any existing data) set the second argument
to true.
//*/
foreach($L... | php | public function
Append(Array $List, Bool $Keys=FALSE) {
/*//
goes through the given array and appends all the data to this dataset. by
default the array keys are completely ignored. if you need to preseve
the keys (and ergo overwrite any existing data) set the second argument
to true.
//*/
foreach($L... | [
"public",
"function",
"Append",
"(",
"Array",
"$",
"List",
",",
"Bool",
"$",
"Keys",
"=",
"FALSE",
")",
"{",
"/*//\r\n\tgoes through the given array and appends all the data to this dataset. by\r\n\tdefault the array keys are completely ignored. if you need to preseve\r\n\tthe keys (an... | item management api for the datastore. | [
"item",
"management",
"api",
"for",
"the",
"datastore",
"."
] | fd07e9340d9d2e4faff7ebb7e197d3ffb6f72ff4 | https://github.com/netherphp/object/blob/fd07e9340d9d2e4faff7ebb7e197d3ffb6f72ff4/src/Nether/Object/Datastore.php#L233-L251 |
12,042 | netherphp/object | src/Nether/Object/Datastore.php | Datastore.Each | public function
Each(Callable $Function, ?Array $Argv=NULL) {
/*//
@argv callable Func
run the specified function against every single thing in the list. it is
is slower than running a direct foreach() on the property but it sure makes
for some nice looking shit sometimes.
//*/
foreach($this->Data as... | php | public function
Each(Callable $Function, ?Array $Argv=NULL) {
/*//
@argv callable Func
run the specified function against every single thing in the list. it is
is slower than running a direct foreach() on the property but it sure makes
for some nice looking shit sometimes.
//*/
foreach($this->Data as... | [
"public",
"function",
"Each",
"(",
"Callable",
"$",
"Function",
",",
"?",
"Array",
"$",
"Argv",
"=",
"NULL",
")",
"{",
"/*//\r\n\t@argv callable Func\r\n\trun the specified function against every single thing in the list. it is\r\n\tis slower than running a direct foreach() on the pr... | item manipulation api for the data. | [
"item",
"manipulation",
"api",
"for",
"the",
"data",
"."
] | fd07e9340d9d2e4faff7ebb7e197d3ffb6f72ff4 | https://github.com/netherphp/object/blob/fd07e9340d9d2e4faff7ebb7e197d3ffb6f72ff4/src/Nether/Object/Datastore.php#L576-L589 |
12,043 | bugotech/http | src/Exceptions/Handler.php | Handler.toIlluminateResponse | protected function toIlluminateResponse($response, Exception $e)
{
$response = new Response($response->getContent(), $response->getStatusCode(), $response->headers->all());
$response->exception = $e;
return $response;
} | php | protected function toIlluminateResponse($response, Exception $e)
{
$response = new Response($response->getContent(), $response->getStatusCode(), $response->headers->all());
$response->exception = $e;
return $response;
} | [
"protected",
"function",
"toIlluminateResponse",
"(",
"$",
"response",
",",
"Exception",
"$",
"e",
")",
"{",
"$",
"response",
"=",
"new",
"Response",
"(",
"$",
"response",
"->",
"getContent",
"(",
")",
",",
"$",
"response",
"->",
"getStatusCode",
"(",
")",... | Map exception into an illuminate response.
@param \Symfony\Component\HttpFoundation\Response $response
@param \Exception $e
@return \Illuminate\Http\Response | [
"Map",
"exception",
"into",
"an",
"illuminate",
"response",
"."
] | 68c2e8a28eaa2e53f98a55d2f2ec0e33c83fd486 | https://github.com/bugotech/http/blob/68c2e8a28eaa2e53f98a55d2f2ec0e33c83fd486/src/Exceptions/Handler.php#L40-L47 |
12,044 | mijohansen/php-gae-util | src/Secrets.php | Secrets.getDefaultKeyName | static public function getDefaultKeyName(Config $conf = null) {
$locationId = "global";
if (is_null($conf)) {
$projectId = self::getProjectId();
$keyRingId = self::getKeyRingId();
$cryptoKeyId = self::getCryptoKeyId();
} else {
$projectId = $conf->... | php | static public function getDefaultKeyName(Config $conf = null) {
$locationId = "global";
if (is_null($conf)) {
$projectId = self::getProjectId();
$keyRingId = self::getKeyRingId();
$cryptoKeyId = self::getCryptoKeyId();
} else {
$projectId = $conf->... | [
"static",
"public",
"function",
"getDefaultKeyName",
"(",
"Config",
"$",
"conf",
"=",
"null",
")",
"{",
"$",
"locationId",
"=",
"\"global\"",
";",
"if",
"(",
"is_null",
"(",
"$",
"conf",
")",
")",
"{",
"$",
"projectId",
"=",
"self",
"::",
"getProjectId",... | Support passing the config object directly.
@param Config|null $conf
@return string | [
"Support",
"passing",
"the",
"config",
"object",
"directly",
"."
] | dfa7a1a4d61aa435351d6a5b1b120c0e23d81dde | https://github.com/mijohansen/php-gae-util/blob/dfa7a1a4d61aa435351d6a5b1b120c0e23d81dde/src/Secrets.php#L75-L87 |
12,045 | mijohansen/php-gae-util | src/Secrets.php | Secrets.encrypt | static public function encrypt($plaintextFileName, $ciphertextFileName, $key_name = null) {
$kms = self::getService();
if (is_null($key_name)) {
$key_name = self::getDefaultKeyName();
}
// Use the KMS API to encrypt the text.
$encoded = base64_encode(file_get_content... | php | static public function encrypt($plaintextFileName, $ciphertextFileName, $key_name = null) {
$kms = self::getService();
if (is_null($key_name)) {
$key_name = self::getDefaultKeyName();
}
// Use the KMS API to encrypt the text.
$encoded = base64_encode(file_get_content... | [
"static",
"public",
"function",
"encrypt",
"(",
"$",
"plaintextFileName",
",",
"$",
"ciphertextFileName",
",",
"$",
"key_name",
"=",
"null",
")",
"{",
"$",
"kms",
"=",
"self",
"::",
"getService",
"(",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"key_name",... | Takes an input file and encrypts using the KMS service
and puts it to an outputfile.
@param $plaintextFileName
@param $ciphertextFileName
@return bool | [
"Takes",
"an",
"input",
"file",
"and",
"encrypts",
"using",
"the",
"KMS",
"service",
"and",
"puts",
"it",
"to",
"an",
"outputfile",
"."
] | dfa7a1a4d61aa435351d6a5b1b120c0e23d81dde | https://github.com/mijohansen/php-gae-util/blob/dfa7a1a4d61aa435351d6a5b1b120c0e23d81dde/src/Secrets.php#L120-L139 |
12,046 | mijohansen/php-gae-util | src/Secrets.php | Secrets.decrypt | static public function decrypt($ciphertextFileName, Config $config = null) {
// Instantiate the client, authenticate, and add scopes.
$kms = self::getService();
$name = self::getDefaultKeyName($config);
// Use the KMS API to decrypt the text.
$ciphertext = base64_encode(file_get_... | php | static public function decrypt($ciphertextFileName, Config $config = null) {
// Instantiate the client, authenticate, and add scopes.
$kms = self::getService();
$name = self::getDefaultKeyName($config);
// Use the KMS API to decrypt the text.
$ciphertext = base64_encode(file_get_... | [
"static",
"public",
"function",
"decrypt",
"(",
"$",
"ciphertextFileName",
",",
"Config",
"$",
"config",
"=",
"null",
")",
"{",
"// Instantiate the client, authenticate, and add scopes.",
"$",
"kms",
"=",
"self",
"::",
"getService",
"(",
")",
";",
"$",
"name",
"... | Can receive the config singleton to be able to be used of the config class
during initiation of that object.
@param $ciphertextFileName
@param Conf|null $conf
@return bool|string | [
"Can",
"receive",
"the",
"config",
"singleton",
"to",
"be",
"able",
"to",
"be",
"used",
"of",
"the",
"config",
"class",
"during",
"initiation",
"of",
"that",
"object",
"."
] | dfa7a1a4d61aa435351d6a5b1b120c0e23d81dde | https://github.com/mijohansen/php-gae-util/blob/dfa7a1a4d61aa435351d6a5b1b120c0e23d81dde/src/Secrets.php#L149-L162 |
12,047 | mijohansen/php-gae-util | src/Secrets.php | Secrets.decryptJson | static public function decryptJson($ciphertextFileName, Config $config = null) {
$content = self::decrypt($ciphertextFileName, $config);
$data = json_decode($content, JSON_OBJECT_AS_ARRAY);
Util::isArrayOrFail("Encrypted secrets", $data);
return $data;
} | php | static public function decryptJson($ciphertextFileName, Config $config = null) {
$content = self::decrypt($ciphertextFileName, $config);
$data = json_decode($content, JSON_OBJECT_AS_ARRAY);
Util::isArrayOrFail("Encrypted secrets", $data);
return $data;
} | [
"static",
"public",
"function",
"decryptJson",
"(",
"$",
"ciphertextFileName",
",",
"Config",
"$",
"config",
"=",
"null",
")",
"{",
"$",
"content",
"=",
"self",
"::",
"decrypt",
"(",
"$",
"ciphertextFileName",
",",
"$",
"config",
")",
";",
"$",
"data",
"... | Utility function to decrypt json.
@param $ciphertextFileName
@param Config|null $config
@return mixed
@throws \Exception | [
"Utility",
"function",
"to",
"decrypt",
"json",
"."
] | dfa7a1a4d61aa435351d6a5b1b120c0e23d81dde | https://github.com/mijohansen/php-gae-util/blob/dfa7a1a4d61aa435351d6a5b1b120c0e23d81dde/src/Secrets.php#L172-L177 |
12,048 | mijohansen/php-gae-util | src/Secrets.php | Secrets.encryptString | static public function encryptString($plaintext_string, $key_name) {
$kms = self::getService();
$base64_encoded_json = base64_encode($plaintext_string);
$request = new \Google_Service_CloudKMS_EncryptRequest();
$request->setPlaintext($base64_encoded_json);
$response = $kms->proje... | php | static public function encryptString($plaintext_string, $key_name) {
$kms = self::getService();
$base64_encoded_json = base64_encode($plaintext_string);
$request = new \Google_Service_CloudKMS_EncryptRequest();
$request->setPlaintext($base64_encoded_json);
$response = $kms->proje... | [
"static",
"public",
"function",
"encryptString",
"(",
"$",
"plaintext_string",
",",
"$",
"key_name",
")",
"{",
"$",
"kms",
"=",
"self",
"::",
"getService",
"(",
")",
";",
"$",
"base64_encoded_json",
"=",
"base64_encode",
"(",
"$",
"plaintext_string",
")",
";... | Encrypts a string and returns the base64_encoded response from KMS.
@param $string
@param $key_name
@return mixed | [
"Encrypts",
"a",
"string",
"and",
"returns",
"the",
"base64_encoded",
"response",
"from",
"KMS",
"."
] | dfa7a1a4d61aa435351d6a5b1b120c0e23d81dde | https://github.com/mijohansen/php-gae-util/blob/dfa7a1a4d61aa435351d6a5b1b120c0e23d81dde/src/Secrets.php#L186-L196 |
12,049 | priskz/sorad-api | src/Priskz/SORAD/Laravel/APIServiceProvider.php | APIServiceProvider.includeRoutesFiles | public function includeRoutesFiles()
{
// Application Specific Module Route File Locations
if(Config::get('sorad.api.routes.file') && is_array(Config::get('sorad.api.routes.file')))
{
foreach(Config::get('sorad.api.routes.file') as $route)
{
// Check if is an app directory and use default routes file n... | php | public function includeRoutesFiles()
{
// Application Specific Module Route File Locations
if(Config::get('sorad.api.routes.file') && is_array(Config::get('sorad.api.routes.file')))
{
foreach(Config::get('sorad.api.routes.file') as $route)
{
// Check if is an app directory and use default routes file n... | [
"public",
"function",
"includeRoutesFiles",
"(",
")",
"{",
"// Application Specific Module Route File Locations",
"if",
"(",
"Config",
"::",
"get",
"(",
"'sorad.api.routes.file'",
")",
"&&",
"is_array",
"(",
"Config",
"::",
"get",
"(",
"'sorad.api.routes.file'",
")",
... | Include Routes Files
@return void | [
"Include",
"Routes",
"Files"
] | 7fd7b5dfb487d9f6653f5a073ccc9eb8526e7b74 | https://github.com/priskz/sorad-api/blob/7fd7b5dfb487d9f6653f5a073ccc9eb8526e7b74/src/Priskz/SORAD/Laravel/APIServiceProvider.php#L60-L78 |
12,050 | priskz/sorad-api | src/Priskz/SORAD/Laravel/APIServiceProvider.php | APIServiceProvider.loadRoutesClasses | public function loadRoutesClasses()
{
// Application Specific Module Route File Locations
if(Config::get('sorad.api.routes.class') && is_array(Config::get('sorad.api.routes.class')))
{
foreach(Config::get('sorad.api.routes.class') as $route => $config)
{
$route = sprintf('\\%s', $route);
if(class_... | php | public function loadRoutesClasses()
{
// Application Specific Module Route File Locations
if(Config::get('sorad.api.routes.class') && is_array(Config::get('sorad.api.routes.class')))
{
foreach(Config::get('sorad.api.routes.class') as $route => $config)
{
$route = sprintf('\\%s', $route);
if(class_... | [
"public",
"function",
"loadRoutesClasses",
"(",
")",
"{",
"// Application Specific Module Route File Locations",
"if",
"(",
"Config",
"::",
"get",
"(",
"'sorad.api.routes.class'",
")",
"&&",
"is_array",
"(",
"Config",
"::",
"get",
"(",
"'sorad.api.routes.class'",
")",
... | Load Routes Classes
@return void | [
"Load",
"Routes",
"Classes"
] | 7fd7b5dfb487d9f6653f5a073ccc9eb8526e7b74 | https://github.com/priskz/sorad-api/blob/7fd7b5dfb487d9f6653f5a073ccc9eb8526e7b74/src/Priskz/SORAD/Laravel/APIServiceProvider.php#L85-L104 |
12,051 | eureka-framework/component-routing | src/Routing/RouteCollection.php | RouteCollection.addFromConfig | public function addFromConfig(array $config)
{
foreach ($config as $name => $data) {
$params = isset($data['params']) ? $data['params'] : array();
$parameters = array();
foreach ($params as $nameParam => $param) {
if (empty($params['type'])) {
... | php | public function addFromConfig(array $config)
{
foreach ($config as $name => $data) {
$params = isset($data['params']) ? $data['params'] : array();
$parameters = array();
foreach ($params as $nameParam => $param) {
if (empty($params['type'])) {
... | [
"public",
"function",
"addFromConfig",
"(",
"array",
"$",
"config",
")",
"{",
"foreach",
"(",
"$",
"config",
"as",
"$",
"name",
"=>",
"$",
"data",
")",
"{",
"$",
"params",
"=",
"isset",
"(",
"$",
"data",
"[",
"'params'",
"]",
")",
"?",
"$",
"data",... | Add routes data from configuration file.
@param array $config
@return self | [
"Add",
"routes",
"data",
"from",
"configuration",
"file",
"."
] | 47b37ba7ce47731762a5eed873d1605eab1785e1 | https://github.com/eureka-framework/component-routing/blob/47b37ba7ce47731762a5eed873d1605eab1785e1/src/Routing/RouteCollection.php#L72-L105 |
12,052 | eureka-framework/component-routing | src/Routing/RouteCollection.php | RouteCollection.match | public function match($url, $redirect404 = true)
{
$routeFound = null;
foreach ($this->routes as $route) {
if (!$route->verify($url)) {
continue;
}
$routeFound = $route;
break;
}
if (!($routeFound instanceof RouteInte... | php | public function match($url, $redirect404 = true)
{
$routeFound = null;
foreach ($this->routes as $route) {
if (!$route->verify($url)) {
continue;
}
$routeFound = $route;
break;
}
if (!($routeFound instanceof RouteInte... | [
"public",
"function",
"match",
"(",
"$",
"url",
",",
"$",
"redirect404",
"=",
"true",
")",
"{",
"$",
"routeFound",
"=",
"null",
";",
"foreach",
"(",
"$",
"this",
"->",
"routes",
"as",
"$",
"route",
")",
"{",
"if",
"(",
"!",
"$",
"route",
"->",
"v... | Try to find a route that match the specified url.
@param string $url
@param bool $redirect404
@return Route|null
@throws \Exception | [
"Try",
"to",
"find",
"a",
"route",
"that",
"match",
"the",
"specified",
"url",
"."
] | 47b37ba7ce47731762a5eed873d1605eab1785e1 | https://github.com/eureka-framework/component-routing/blob/47b37ba7ce47731762a5eed873d1605eab1785e1/src/Routing/RouteCollection.php#L144-L162 |
12,053 | nirix/radium | src/Helpers/Form.php | Form.submit | public static function submit($text, $attributes = array())
{
if (isset($attributes['name'])) {
$name = $attributes['name'];
unset($attributes['name']);
} else {
$name = 'submit';
}
return self::input('submit', $name, array_merge(array('value' => ... | php | public static function submit($text, $attributes = array())
{
if (isset($attributes['name'])) {
$name = $attributes['name'];
unset($attributes['name']);
} else {
$name = 'submit';
}
return self::input('submit', $name, array_merge(array('value' => ... | [
"public",
"static",
"function",
"submit",
"(",
"$",
"text",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"attributes",
"[",
"'name'",
"]",
")",
")",
"{",
"$",
"name",
"=",
"$",
"attributes",
"[",
"'name'",... | Creates a form submit button.
@param string $text
@param string $attributes
@return string | [
"Creates",
"a",
"form",
"submit",
"button",
"."
] | cc6907bfee296b64a7630b0b188e233d7cdb86fd | https://github.com/nirix/radium/blob/cc6907bfee296b64a7630b0b188e233d7cdb86fd/src/Helpers/Form.php#L94-L104 |
12,054 | nirix/radium | src/Helpers/Form.php | Form.checkbox | public static function checkbox($name, $value, $attributes = array())
{
$attributes['value'] = $value;
return self::input('checkbox', $name, $attributes);
} | php | public static function checkbox($name, $value, $attributes = array())
{
$attributes['value'] = $value;
return self::input('checkbox', $name, $attributes);
} | [
"public",
"static",
"function",
"checkbox",
"(",
"$",
"name",
",",
"$",
"value",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"$",
"attributes",
"[",
"'value'",
"]",
"=",
"$",
"value",
";",
"return",
"self",
"::",
"input",
"(",
"'checkbo... | Creates a checkbox field.
@param string $name
@param mixed $value
@param array $attributes
@return string | [
"Creates",
"a",
"checkbox",
"field",
"."
] | cc6907bfee296b64a7630b0b188e233d7cdb86fd | https://github.com/nirix/radium/blob/cc6907bfee296b64a7630b0b188e233d7cdb86fd/src/Helpers/Form.php#L128-L132 |
12,055 | nirix/radium | src/Helpers/Form.php | Form.radio | public static function radio($name, $value, $attributes = array())
{
$attributes['value'] = $value;
return self::input('radio', $name, $attributes);
} | php | public static function radio($name, $value, $attributes = array())
{
$attributes['value'] = $value;
return self::input('radio', $name, $attributes);
} | [
"public",
"static",
"function",
"radio",
"(",
"$",
"name",
",",
"$",
"value",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"$",
"attributes",
"[",
"'value'",
"]",
"=",
"$",
"value",
";",
"return",
"self",
"::",
"input",
"(",
"'radio'",
... | Creates a radio field.
@param string $name
@param mixed $value
@param array $attributes
@return string | [
"Creates",
"a",
"radio",
"field",
"."
] | cc6907bfee296b64a7630b0b188e233d7cdb86fd | https://github.com/nirix/radium/blob/cc6907bfee296b64a7630b0b188e233d7cdb86fd/src/Helpers/Form.php#L143-L147 |
12,056 | nirix/radium | src/Helpers/Form.php | Form.select | public static function select($name, $options, $attributes = array())
{
// Extract the value
$value = isset($attributes['value']) ? $attributes['value'] : null;
unset($attributes['value']);
// Set the name
$attributes['name'] = $name;
// Set the id to the name if on... | php | public static function select($name, $options, $attributes = array())
{
// Extract the value
$value = isset($attributes['value']) ? $attributes['value'] : null;
unset($attributes['value']);
// Set the name
$attributes['name'] = $name;
// Set the id to the name if on... | [
"public",
"static",
"function",
"select",
"(",
"$",
"name",
",",
"$",
"options",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"// Extract the value",
"$",
"value",
"=",
"isset",
"(",
"$",
"attributes",
"[",
"'value'",
"]",
")",
"?",
"$",
... | Creates a select field.
@param string $name
@param array $attributes
@return string | [
"Creates",
"a",
"select",
"field",
"."
] | cc6907bfee296b64a7630b0b188e233d7cdb86fd | https://github.com/nirix/radium/blob/cc6907bfee296b64a7630b0b188e233d7cdb86fd/src/Helpers/Form.php#L157-L193 |
12,057 | nirix/radium | src/Helpers/Form.php | Form.selectOption | public static function selectOption($option, $value)
{
$attributes = [''];
$attributes[] = "value=\"{$option['value']}\"";
if (
(is_array($value) && in_array($option['value'], $value))
|| ($option['value'] == $value)
) {
$attributes[] = 'selected... | php | public static function selectOption($option, $value)
{
$attributes = [''];
$attributes[] = "value=\"{$option['value']}\"";
if (
(is_array($value) && in_array($option['value'], $value))
|| ($option['value'] == $value)
) {
$attributes[] = 'selected... | [
"public",
"static",
"function",
"selectOption",
"(",
"$",
"option",
",",
"$",
"value",
")",
"{",
"$",
"attributes",
"=",
"[",
"''",
"]",
";",
"$",
"attributes",
"[",
"]",
"=",
"\"value=\\\"{$option['value']}\\\"\"",
";",
"if",
"(",
"(",
"is_array",
"(",
... | Return the HTML for a select option.
@param array $option
@return string | [
"Return",
"the",
"HTML",
"for",
"a",
"select",
"option",
"."
] | cc6907bfee296b64a7630b0b188e233d7cdb86fd | https://github.com/nirix/radium/blob/cc6907bfee296b64a7630b0b188e233d7cdb86fd/src/Helpers/Form.php#L202-L217 |
12,058 | nirix/radium | src/Helpers/Form.php | Form.input | public static function input($type, $name, $attributes)
{
// Set id attribute to be same as the name
// if one has not been set
if (!isset($attributes['id'])) {
$attributes['id'] = $name;
}
// Check if the value is set in the
// attributes array
... | php | public static function input($type, $name, $attributes)
{
// Set id attribute to be same as the name
// if one has not been set
if (!isset($attributes['id'])) {
$attributes['id'] = $name;
}
// Check if the value is set in the
// attributes array
... | [
"public",
"static",
"function",
"input",
"(",
"$",
"type",
",",
"$",
"name",
",",
"$",
"attributes",
")",
"{",
"// Set id attribute to be same as the name",
"// if one has not been set",
"if",
"(",
"!",
"isset",
"(",
"$",
"attributes",
"[",
"'id'",
"]",
")",
"... | Creates a form field.
@param string $type
@param string $name
@param array $attributes
@return string | [
"Creates",
"a",
"form",
"field",
"."
] | cc6907bfee296b64a7630b0b188e233d7cdb86fd | https://github.com/nirix/radium/blob/cc6907bfee296b64a7630b0b188e233d7cdb86fd/src/Helpers/Form.php#L228-L275 |
12,059 | anklimsk/cakephp-basic-functions | Vendor/langcode-conv/zendframework/zend-filter/src/Encrypt/Openssl.php | Openssl._setKeys | protected function _setKeys($keys)
{
if (!is_array($keys)) {
throw new Exception\InvalidArgumentException('Invalid options argument provided to filter');
}
foreach ($keys as $type => $key) {
if (is_file($key) and is_readable($key)) {
$file = fopen($ke... | php | protected function _setKeys($keys)
{
if (!is_array($keys)) {
throw new Exception\InvalidArgumentException('Invalid options argument provided to filter');
}
foreach ($keys as $type => $key) {
if (is_file($key) and is_readable($key)) {
$file = fopen($ke... | [
"protected",
"function",
"_setKeys",
"(",
"$",
"keys",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"keys",
")",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"InvalidArgumentException",
"(",
"'Invalid options argument provided to filter'",
")",
";",
"}",
"f... | Sets the encryption keys
@param string|array $keys Key with type association
@return self
@throws Exception\InvalidArgumentException | [
"Sets",
"the",
"encryption",
"keys"
] | 7554e8b0b420fd3155593af7bf76b7ccbdc8701e | https://github.com/anklimsk/cakephp-basic-functions/blob/7554e8b0b420fd3155593af7bf76b7ccbdc8701e/Vendor/langcode-conv/zendframework/zend-filter/src/Encrypt/Openssl.php#L110-L154 |
12,060 | anklimsk/cakephp-basic-functions | Vendor/langcode-conv/zendframework/zend-filter/src/Encrypt/Openssl.php | Openssl.setPublicKey | public function setPublicKey($key)
{
if (is_array($key)) {
foreach ($key as $type => $option) {
if ($type !== 'public') {
$key['public'] = $option;
unset($key[$type]);
}
}
} else {
$key = ['pu... | php | public function setPublicKey($key)
{
if (is_array($key)) {
foreach ($key as $type => $option) {
if ($type !== 'public') {
$key['public'] = $option;
unset($key[$type]);
}
}
} else {
$key = ['pu... | [
"public",
"function",
"setPublicKey",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"key",
")",
")",
"{",
"foreach",
"(",
"$",
"key",
"as",
"$",
"type",
"=>",
"$",
"option",
")",
"{",
"if",
"(",
"$",
"type",
"!==",
"'public'",
")",
... | Sets public keys
@param string|array $key Public keys
@return self | [
"Sets",
"public",
"keys"
] | 7554e8b0b420fd3155593af7bf76b7ccbdc8701e | https://github.com/anklimsk/cakephp-basic-functions/blob/7554e8b0b420fd3155593af7bf76b7ccbdc8701e/Vendor/langcode-conv/zendframework/zend-filter/src/Encrypt/Openssl.php#L173-L187 |
12,061 | MrJiawen/php-support | src/Tool/StringTool.php | StringTool.str_utf8_chinese_word_count | public static function str_utf8_chinese_word_count($str = "")
{
$str = preg_replace(self::UTF8_SYMBOL_PATTERN, "", $str);
return preg_match_all(self::UTF8_CHINESE_PATTERN, $str, $arr);
} | php | public static function str_utf8_chinese_word_count($str = "")
{
$str = preg_replace(self::UTF8_SYMBOL_PATTERN, "", $str);
return preg_match_all(self::UTF8_CHINESE_PATTERN, $str, $arr);
} | [
"public",
"static",
"function",
"str_utf8_chinese_word_count",
"(",
"$",
"str",
"=",
"\"\"",
")",
"{",
"$",
"str",
"=",
"preg_replace",
"(",
"self",
"::",
"UTF8_SYMBOL_PATTERN",
",",
"\"\"",
",",
"$",
"str",
")",
";",
"return",
"preg_match_all",
"(",
"self",... | count only chinese words
@param string $str
@return int | [
"count",
"only",
"chinese",
"words"
] | 5e878486a916eef5437f4614e6ae286c21f8782c | https://github.com/MrJiawen/php-support/blob/5e878486a916eef5437f4614e6ae286c21f8782c/src/Tool/StringTool.php#L17-L21 |
12,062 | MrJiawen/php-support | src/Tool/StringTool.php | StringTool.str_utf8_mix_word_count | public static function str_utf8_mix_word_count($str = "")
{
$str = preg_replace(self::UTF8_SYMBOL_PATTERN, "", $str);
return self::str_utf8_chinese_word_count($str) + str_word_count(preg_replace(self::UTF8_CHINESE_PATTERN, "", $str));
} | php | public static function str_utf8_mix_word_count($str = "")
{
$str = preg_replace(self::UTF8_SYMBOL_PATTERN, "", $str);
return self::str_utf8_chinese_word_count($str) + str_word_count(preg_replace(self::UTF8_CHINESE_PATTERN, "", $str));
} | [
"public",
"static",
"function",
"str_utf8_mix_word_count",
"(",
"$",
"str",
"=",
"\"\"",
")",
"{",
"$",
"str",
"=",
"preg_replace",
"(",
"self",
"::",
"UTF8_SYMBOL_PATTERN",
",",
"\"\"",
",",
"$",
"str",
")",
";",
"return",
"self",
"::",
"str_utf8_chinese_wo... | count both chinese and english
@param string $str
@return int | [
"count",
"both",
"chinese",
"and",
"english"
] | 5e878486a916eef5437f4614e6ae286c21f8782c | https://github.com/MrJiawen/php-support/blob/5e878486a916eef5437f4614e6ae286c21f8782c/src/Tool/StringTool.php#L27-L31 |
12,063 | douyacun/dyc-pay | src/Gateways/Wechat/Support.php | Support.baseUri | public static function baseUri($mode = null): string
{
switch ($mode) {
case Wechat::MODE_DEV:
self::getInstance()->baseUri = 'https://api.mch.weixin.qq.com/sandboxnew/';
break;
case Wechat::MODE_HK:
self::getInstance()->baseUri = 'htt... | php | public static function baseUri($mode = null): string
{
switch ($mode) {
case Wechat::MODE_DEV:
self::getInstance()->baseUri = 'https://api.mch.weixin.qq.com/sandboxnew/';
break;
case Wechat::MODE_HK:
self::getInstance()->baseUri = 'htt... | [
"public",
"static",
"function",
"baseUri",
"(",
"$",
"mode",
"=",
"null",
")",
":",
"string",
"{",
"switch",
"(",
"$",
"mode",
")",
"{",
"case",
"Wechat",
"::",
"MODE_DEV",
":",
"self",
"::",
"getInstance",
"(",
")",
"->",
"baseUri",
"=",
"'https://api... | Wechat gateway.
@author yansongda <[email protected]>
@param string $mode
@return string | [
"Wechat",
"gateway",
"."
] | 9fac85d375bdd52b872c3fa8174920e40609f6f2 | https://github.com/douyacun/dyc-pay/blob/9fac85d375bdd52b872c3fa8174920e40609f6f2/src/Gateways/Wechat/Support.php#L250-L266 |
12,064 | tagadvance/Gilligan | src/tagadvance/gilligan/session/MySQLSessionHandler.php | MySQLSessionHandler.triggerError | private function triggerError($message) {
$pdo = $this->pdoSupplier->getPDO();
$mode = $pdo->getAttribute(\PDO::ATTR_ERRMODE);
switch ($mode) {
case \PDO::ERRMODE_WARNING:
trigger_error($message, E_USER_ERROR);
break;
case \PDO::ERRMODE_EXC... | php | private function triggerError($message) {
$pdo = $this->pdoSupplier->getPDO();
$mode = $pdo->getAttribute(\PDO::ATTR_ERRMODE);
switch ($mode) {
case \PDO::ERRMODE_WARNING:
trigger_error($message, E_USER_ERROR);
break;
case \PDO::ERRMODE_EXC... | [
"private",
"function",
"triggerError",
"(",
"$",
"message",
")",
"{",
"$",
"pdo",
"=",
"$",
"this",
"->",
"pdoSupplier",
"->",
"getPDO",
"(",
")",
";",
"$",
"mode",
"=",
"$",
"pdo",
"->",
"getAttribute",
"(",
"\\",
"PDO",
"::",
"ATTR_ERRMODE",
")",
"... | Honor the PDO ATTR_ERRMODE. | [
"Honor",
"the",
"PDO",
"ATTR_ERRMODE",
"."
] | 470c82b1ef16d0f839ba2245cd96cd414792483b | https://github.com/tagadvance/Gilligan/blob/470c82b1ef16d0f839ba2245cd96cd414792483b/src/tagadvance/gilligan/session/MySQLSessionHandler.php#L136-L150 |
12,065 | slickframework/template | src/Template.php | Template.addExtension | public function addExtension($className)
{
$object = is_object($className) ? $className : null;
$className = is_object($className) ? get_class($object) : $className;
$this->checkExtension($className);
self::$extensions[$className] = $object;
return $this;
} | php | public function addExtension($className)
{
$object = is_object($className) ? $className : null;
$className = is_object($className) ? get_class($object) : $className;
$this->checkExtension($className);
self::$extensions[$className] = $object;
return $this;
} | [
"public",
"function",
"addExtension",
"(",
"$",
"className",
")",
"{",
"$",
"object",
"=",
"is_object",
"(",
"$",
"className",
")",
"?",
"$",
"className",
":",
"null",
";",
"$",
"className",
"=",
"is_object",
"(",
"$",
"className",
")",
"?",
"get_class",... | Adds an extension to the template engine
@param string|object $className The class name or an instance
of EngineExtensionInterface interface
@return self|$this|Template | [
"Adds",
"an",
"extension",
"to",
"the",
"template",
"engine"
] | d31abe9608acb30cfb8a6abd9cdf9d334f682fef | https://github.com/slickframework/template/blob/d31abe9608acb30cfb8a6abd9cdf9d334f682fef/src/Template.php#L107-L116 |
12,066 | slickframework/template | src/Template.php | Template.applyExtensions | private function applyExtensions(TemplateEngineInterface $engine)
{
foreach (static::$extensions as $className => $extension) {
$ext = $this->getExtension($className, $extension);
if ($ext->appliesTo($engine)) {
$ext->update($engine);
}
}
r... | php | private function applyExtensions(TemplateEngineInterface $engine)
{
foreach (static::$extensions as $className => $extension) {
$ext = $this->getExtension($className, $extension);
if ($ext->appliesTo($engine)) {
$ext->update($engine);
}
}
r... | [
"private",
"function",
"applyExtensions",
"(",
"TemplateEngineInterface",
"$",
"engine",
")",
"{",
"foreach",
"(",
"static",
"::",
"$",
"extensions",
"as",
"$",
"className",
"=>",
"$",
"extension",
")",
"{",
"$",
"ext",
"=",
"$",
"this",
"->",
"getExtension"... | Apply defined extensions to the provided template engine
@param TemplateEngineInterface $engine
@return TemplateEngineInterface | [
"Apply",
"defined",
"extensions",
"to",
"the",
"provided",
"template",
"engine"
] | d31abe9608acb30cfb8a6abd9cdf9d334f682fef | https://github.com/slickframework/template/blob/d31abe9608acb30cfb8a6abd9cdf9d334f682fef/src/Template.php#L157-L166 |
12,067 | digipolisgent/openbib-id-api | src/Value/UserActivities/Hold.php | Hold.fromXml | public static function fromXml(\DOMElement $xml)
{
$static = new static();
$static->libraryItemMetadata = LibraryItemMetadata::fromXml($xml);
$static->pickupLocation = PickupLocation::fromXml($xml);
$requestStartDate = $xml->getElementsByTagName('requestDate');
$requestEndDa... | php | public static function fromXml(\DOMElement $xml)
{
$static = new static();
$static->libraryItemMetadata = LibraryItemMetadata::fromXml($xml);
$static->pickupLocation = PickupLocation::fromXml($xml);
$requestStartDate = $xml->getElementsByTagName('requestDate');
$requestEndDa... | [
"public",
"static",
"function",
"fromXml",
"(",
"\\",
"DOMElement",
"$",
"xml",
")",
"{",
"$",
"static",
"=",
"new",
"static",
"(",
")",
";",
"$",
"static",
"->",
"libraryItemMetadata",
"=",
"LibraryItemMetadata",
"::",
"fromXml",
"(",
"$",
"xml",
")",
"... | Builds a Hold object from XML.
@param \DOMElement $xml
The xml element containing the hold.
@return Hold
A Hold object. | [
"Builds",
"a",
"Hold",
"object",
"from",
"XML",
"."
] | 79f58dec53a91f44333d10fa4ef79f85f31fc2de | https://github.com/digipolisgent/openbib-id-api/blob/79f58dec53a91f44333d10fa4ef79f85f31fc2de/src/Value/UserActivities/Hold.php#L96-L125 |
12,068 | tadcka/Breadcrumbs | Breadcrumb.php | Breadcrumb.truncate | protected function truncate($string, $length = 30, $separator = '...')
{
if (mb_strlen($string) > $length) {
return rtrim(mb_substr($string, 0, $length)) . $separator;
}
return $string;
} | php | protected function truncate($string, $length = 30, $separator = '...')
{
if (mb_strlen($string) > $length) {
return rtrim(mb_substr($string, 0, $length)) . $separator;
}
return $string;
} | [
"protected",
"function",
"truncate",
"(",
"$",
"string",
",",
"$",
"length",
"=",
"30",
",",
"$",
"separator",
"=",
"'...'",
")",
"{",
"if",
"(",
"mb_strlen",
"(",
"$",
"string",
")",
">",
"$",
"length",
")",
"{",
"return",
"rtrim",
"(",
"mb_substr",... | Truncate string.
@param string $string
@param int $length
@param string $separator
@return string | [
"Truncate",
"string",
"."
] | 3608361cb21d1a26d5e1929ab4e11645b51b13ac | https://github.com/tadcka/Breadcrumbs/blob/3608361cb21d1a26d5e1929ab4e11645b51b13ac/Breadcrumb.php#L108-L116 |
12,069 | SocietyCMS/Core | Providers/ModulesServiceProvider.php | ModulesServiceProvider.bootModules | private function bootModules()
{
foreach ($this->app['modules']->enabled() as $module) {
$this->registerViewNamespace($module);
$this->registerLanguageNamespace($module);
$this->registerConfigNamespace($module);
}
} | php | private function bootModules()
{
foreach ($this->app['modules']->enabled() as $module) {
$this->registerViewNamespace($module);
$this->registerLanguageNamespace($module);
$this->registerConfigNamespace($module);
}
} | [
"private",
"function",
"bootModules",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"app",
"[",
"'modules'",
"]",
"->",
"enabled",
"(",
")",
"as",
"$",
"module",
")",
"{",
"$",
"this",
"->",
"registerViewNamespace",
"(",
"$",
"module",
")",
";",
... | Register the modules aliases. | [
"Register",
"the",
"modules",
"aliases",
"."
] | fb6be1b1dd46c89a976c02feb998e9af01ddca54 | https://github.com/SocietyCMS/Core/blob/fb6be1b1dd46c89a976c02feb998e9af01ddca54/Providers/ModulesServiceProvider.php#L51-L58 |
12,070 | SocietyCMS/Core | Providers/ModulesServiceProvider.php | ModulesServiceProvider.registerViewNamespace | protected function registerViewNamespace(Module $module)
{
$this->app['view']->addNamespace(
$module->getName(),
$module->getPath().'/Resources/views'
);
} | php | protected function registerViewNamespace(Module $module)
{
$this->app['view']->addNamespace(
$module->getName(),
$module->getPath().'/Resources/views'
);
} | [
"protected",
"function",
"registerViewNamespace",
"(",
"Module",
"$",
"module",
")",
"{",
"$",
"this",
"->",
"app",
"[",
"'view'",
"]",
"->",
"addNamespace",
"(",
"$",
"module",
"->",
"getName",
"(",
")",
",",
"$",
"module",
"->",
"getPath",
"(",
")",
... | Register the view namespaces for the modules.
@param Module $module | [
"Register",
"the",
"view",
"namespaces",
"for",
"the",
"modules",
"."
] | fb6be1b1dd46c89a976c02feb998e9af01ddca54 | https://github.com/SocietyCMS/Core/blob/fb6be1b1dd46c89a976c02feb998e9af01ddca54/Providers/ModulesServiceProvider.php#L75-L81 |
12,071 | SocietyCMS/Core | Providers/ModulesServiceProvider.php | ModulesServiceProvider.registerLanguageNamespace | protected function registerLanguageNamespace(Module $module)
{
$moduleName = $module->getName();
$langPath = base_path("resources/lang/modules/$moduleName");
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, $moduleName);
$this->app['localization.js-ge... | php | protected function registerLanguageNamespace(Module $module)
{
$moduleName = $module->getName();
$langPath = base_path("resources/lang/modules/$moduleName");
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, $moduleName);
$this->app['localization.js-ge... | [
"protected",
"function",
"registerLanguageNamespace",
"(",
"Module",
"$",
"module",
")",
"{",
"$",
"moduleName",
"=",
"$",
"module",
"->",
"getName",
"(",
")",
";",
"$",
"langPath",
"=",
"base_path",
"(",
"\"resources/lang/modules/$moduleName\"",
")",
";",
"if",... | Register the language namespaces for the modules.
@param Module $module | [
"Register",
"the",
"language",
"namespaces",
"for",
"the",
"modules",
"."
] | fb6be1b1dd46c89a976c02feb998e9af01ddca54 | https://github.com/SocietyCMS/Core/blob/fb6be1b1dd46c89a976c02feb998e9af01ddca54/Providers/ModulesServiceProvider.php#L88-L101 |
12,072 | xloit/xloit-bridge-zend-log | src/Log.php | Log.exception | public static function exception($title, PhpException $e)
{
$exceptionMessage = (string) $e->getMessage();
$content = (string) $title . PHP_EOL . 'Exception of type \'' . get_class($e) . '\': ' . $exceptionMessage;
// need to add check if the log verbosity is info or debug. Look at old cod... | php | public static function exception($title, PhpException $e)
{
$exceptionMessage = (string) $e->getMessage();
$content = (string) $title . PHP_EOL . 'Exception of type \'' . get_class($e) . '\': ' . $exceptionMessage;
// need to add check if the log verbosity is info or debug. Look at old cod... | [
"public",
"static",
"function",
"exception",
"(",
"$",
"title",
",",
"PhpException",
"$",
"e",
")",
"{",
"$",
"exceptionMessage",
"=",
"(",
"string",
")",
"$",
"e",
"->",
"getMessage",
"(",
")",
";",
"$",
"content",
"=",
"(",
"string",
")",
"$",
"tit... | Save an exception as an error in the log file.
@param string $title
@param PhpException $e
@return bool
@throws \Zend\Log\Exception\InvalidArgumentException
@throws \Zend\Log\Exception\RuntimeException | [
"Save",
"an",
"exception",
"as",
"an",
"error",
"in",
"the",
"log",
"file",
"."
] | d5c93341931089a6bbf71328f88616bc544e3864 | https://github.com/xloit/xloit-bridge-zend-log/blob/d5c93341931089a6bbf71328f88616bc544e3864/src/Log.php#L126-L136 |
12,073 | xloit/xloit-bridge-zend-log | src/Log.php | Log.err | public static function err($message, array $extras = [])
{
if (self::$logger) {
self::$logger->err($message, $extras);
}
} | php | public static function err($message, array $extras = [])
{
if (self::$logger) {
self::$logger->err($message, $extras);
}
} | [
"public",
"static",
"function",
"err",
"(",
"$",
"message",
",",
"array",
"$",
"extras",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"logger",
")",
"{",
"self",
"::",
"$",
"logger",
"->",
"err",
"(",
"$",
"message",
",",
"$",
"extras",... | Log an error message for external consumption.
@param string $message
@param array $extras
@return void
@throws \Zend\Log\Exception\InvalidArgumentException
@throws \Zend\Log\Exception\RuntimeException | [
"Log",
"an",
"error",
"message",
"for",
"external",
"consumption",
"."
] | d5c93341931089a6bbf71328f88616bc544e3864 | https://github.com/xloit/xloit-bridge-zend-log/blob/d5c93341931089a6bbf71328f88616bc544e3864/src/Log.php#L148-L153 |
12,074 | xloit/xloit-bridge-zend-log | src/Log.php | Log.debug | public static function debug($message, array $extras = [])
{
if (self::$logger) {
self::$logger->debug($message, $extras);
}
} | php | public static function debug($message, array $extras = [])
{
if (self::$logger) {
self::$logger->debug($message, $extras);
}
} | [
"public",
"static",
"function",
"debug",
"(",
"$",
"message",
",",
"array",
"$",
"extras",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"logger",
")",
"{",
"self",
"::",
"$",
"logger",
"->",
"debug",
"(",
"$",
"message",
",",
"$",
"extr... | Log a debug message for internal use.
@param string $message
@param array $extras
@return void | [
"Log",
"a",
"debug",
"message",
"for",
"internal",
"use",
"."
] | d5c93341931089a6bbf71328f88616bc544e3864 | https://github.com/xloit/xloit-bridge-zend-log/blob/d5c93341931089a6bbf71328f88616bc544e3864/src/Log.php#L163-L168 |
12,075 | xloit/xloit-bridge-zend-log | src/Log.php | Log.info | public static function info($message, array $extras = [])
{
if (self::$logger) {
self::$logger->info($message, $extras);
}
} | php | public static function info($message, array $extras = [])
{
if (self::$logger) {
self::$logger->info($message, $extras);
}
} | [
"public",
"static",
"function",
"info",
"(",
"$",
"message",
",",
"array",
"$",
"extras",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"logger",
")",
"{",
"self",
"::",
"$",
"logger",
"->",
"info",
"(",
"$",
"message",
",",
"$",
"extras... | Log an info message for external consumption.
@param string $message
@param array $extras
@return void | [
"Log",
"an",
"info",
"message",
"for",
"external",
"consumption",
"."
] | d5c93341931089a6bbf71328f88616bc544e3864 | https://github.com/xloit/xloit-bridge-zend-log/blob/d5c93341931089a6bbf71328f88616bc544e3864/src/Log.php#L178-L183 |
12,076 | xloit/xloit-bridge-zend-log | src/Log.php | Log.notice | public static function notice($message, array $extras = [])
{
if (self::$logger) {
self::$logger->notice($message, $extras);
}
} | php | public static function notice($message, array $extras = [])
{
if (self::$logger) {
self::$logger->notice($message, $extras);
}
} | [
"public",
"static",
"function",
"notice",
"(",
"$",
"message",
",",
"array",
"$",
"extras",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"logger",
")",
"{",
"self",
"::",
"$",
"logger",
"->",
"notice",
"(",
"$",
"message",
",",
"$",
"ex... | Log a notice message for external consumption.
@param string $message
@param array $extras
@return void | [
"Log",
"a",
"notice",
"message",
"for",
"external",
"consumption",
"."
] | d5c93341931089a6bbf71328f88616bc544e3864 | https://github.com/xloit/xloit-bridge-zend-log/blob/d5c93341931089a6bbf71328f88616bc544e3864/src/Log.php#L193-L198 |
12,077 | xloit/xloit-bridge-zend-log | src/Log.php | Log.warn | public static function warn($message, array $extras = [])
{
if (self::$logger) {
self::$logger->warn($message, $extras);
}
} | php | public static function warn($message, array $extras = [])
{
if (self::$logger) {
self::$logger->warn($message, $extras);
}
} | [
"public",
"static",
"function",
"warn",
"(",
"$",
"message",
",",
"array",
"$",
"extras",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"logger",
")",
"{",
"self",
"::",
"$",
"logger",
"->",
"warn",
"(",
"$",
"message",
",",
"$",
"extras... | Log a warning message for external consumption.
@param string $message
@param array $extras
@return void | [
"Log",
"a",
"warning",
"message",
"for",
"external",
"consumption",
"."
] | d5c93341931089a6bbf71328f88616bc544e3864 | https://github.com/xloit/xloit-bridge-zend-log/blob/d5c93341931089a6bbf71328f88616bc544e3864/src/Log.php#L208-L213 |
12,078 | xloit/xloit-bridge-zend-log | src/Log.php | Log.crit | public static function crit($message, array $extras = [])
{
if (self::$logger) {
self::$logger->crit($message, $extras);
}
} | php | public static function crit($message, array $extras = [])
{
if (self::$logger) {
self::$logger->crit($message, $extras);
}
} | [
"public",
"static",
"function",
"crit",
"(",
"$",
"message",
",",
"array",
"$",
"extras",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"logger",
")",
"{",
"self",
"::",
"$",
"logger",
"->",
"crit",
"(",
"$",
"message",
",",
"$",
"extras... | Log a critical message for external consumption.
@param string $message
@param array $extras
@return void | [
"Log",
"a",
"critical",
"message",
"for",
"external",
"consumption",
"."
] | d5c93341931089a6bbf71328f88616bc544e3864 | https://github.com/xloit/xloit-bridge-zend-log/blob/d5c93341931089a6bbf71328f88616bc544e3864/src/Log.php#L223-L228 |
12,079 | xloit/xloit-bridge-zend-log | src/Log.php | Log.alert | public static function alert($message, array $extras = [])
{
if (self::$logger) {
self::$logger->alert($message, $extras);
}
} | php | public static function alert($message, array $extras = [])
{
if (self::$logger) {
self::$logger->alert($message, $extras);
}
} | [
"public",
"static",
"function",
"alert",
"(",
"$",
"message",
",",
"array",
"$",
"extras",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"logger",
")",
"{",
"self",
"::",
"$",
"logger",
"->",
"alert",
"(",
"$",
"message",
",",
"$",
"extr... | Log an alert message for external consumption.
@param string $message
@param array $extras
@return void | [
"Log",
"an",
"alert",
"message",
"for",
"external",
"consumption",
"."
] | d5c93341931089a6bbf71328f88616bc544e3864 | https://github.com/xloit/xloit-bridge-zend-log/blob/d5c93341931089a6bbf71328f88616bc544e3864/src/Log.php#L238-L243 |
12,080 | xloit/xloit-bridge-zend-log | src/Log.php | Log.emerg | public static function emerg($message, array $extras = [])
{
if (self::$logger) {
self::$logger->emerg($message, $extras);
}
} | php | public static function emerg($message, array $extras = [])
{
if (self::$logger) {
self::$logger->emerg($message, $extras);
}
} | [
"public",
"static",
"function",
"emerg",
"(",
"$",
"message",
",",
"array",
"$",
"extras",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"logger",
")",
"{",
"self",
"::",
"$",
"logger",
"->",
"emerg",
"(",
"$",
"message",
",",
"$",
"extr... | Log an emergency message for external consumption.
@param string $message
@param array $extras
@return void | [
"Log",
"an",
"emergency",
"message",
"for",
"external",
"consumption",
"."
] | d5c93341931089a6bbf71328f88616bc544e3864 | https://github.com/xloit/xloit-bridge-zend-log/blob/d5c93341931089a6bbf71328f88616bc544e3864/src/Log.php#L253-L258 |
12,081 | phplegends/collections | src/Collection.php | Collection.delete | public function delete($key)
{
if (! $this->has($key)) return null;
$value = $this->items[$key];
unset($this->items[$key]);
return $value;
} | php | public function delete($key)
{
if (! $this->has($key)) return null;
$value = $this->items[$key];
unset($this->items[$key]);
return $value;
} | [
"public",
"function",
"delete",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"key",
")",
")",
"return",
"null",
";",
"$",
"value",
"=",
"$",
"this",
"->",
"items",
"[",
"$",
"key",
"]",
";",
"unset",
"(",
"$"... | Unset item from collection via index and return value
@param int|string $key
@return mixed | [
"Unset",
"item",
"from",
"collection",
"via",
"index",
"and",
"return",
"value"
] | 33b048176b09e58fcecf229dd3fe0a16eca8605f | https://github.com/phplegends/collections/blob/33b048176b09e58fcecf229dd3fe0a16eca8605f/src/Collection.php#L121-L130 |
12,082 | cybalex/session | DefaultSessionStorage.php | DefaultSessionStorage.loadSession | protected function loadSession(array &$session = null)
{
if (null === $session) {
$session = &$_SESSION;
}
//initialize the attributes bag
$key = $this->getAttributes()->getName();
$session[$key] = isset($session[$key]) ? $session[$key] : array();
$this-... | php | protected function loadSession(array &$session = null)
{
if (null === $session) {
$session = &$_SESSION;
}
//initialize the attributes bag
$key = $this->getAttributes()->getName();
$session[$key] = isset($session[$key]) ? $session[$key] : array();
$this-... | [
"protected",
"function",
"loadSession",
"(",
"array",
"&",
"$",
"session",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"session",
")",
"{",
"$",
"session",
"=",
"&",
"$",
"_SESSION",
";",
"}",
"//initialize the attributes bag",
"$",
"key",
"=",... | Load the session with attributes
After starting the session, PHP retrieves the session from whatever handlers
are set to (either PHP's internal, or a custom save handler set with session_set_save_handler()).
PHP takes the return value from the read() handler, unserializes it
and populates $_SESSION with the result aut... | [
"Load",
"the",
"session",
"with",
"attributes"
] | 527679d8f5dca9aa1cb0c843cb3a6e86ff740da8 | https://github.com/cybalex/session/blob/527679d8f5dca9aa1cb0c843cb3a6e86ff740da8/DefaultSessionStorage.php#L273-L287 |
12,083 | fazland/elastica-odm | src/Persister/DocumentPersister.php | DocumentPersister.exists | public function exists(array $criteria): bool
{
$query = $this->prepareQuery($criteria);
$query->setSize(0);
$query->setParam('terminate_after', 1);
return $this->collection->search($query)->count() > 0;
} | php | public function exists(array $criteria): bool
{
$query = $this->prepareQuery($criteria);
$query->setSize(0);
$query->setParam('terminate_after', 1);
return $this->collection->search($query)->count() > 0;
} | [
"public",
"function",
"exists",
"(",
"array",
"$",
"criteria",
")",
":",
"bool",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"prepareQuery",
"(",
"$",
"criteria",
")",
";",
"$",
"query",
"->",
"setSize",
"(",
"0",
")",
";",
"$",
"query",
"->",
"setP... | Checks whether a document matching criteria exists in collection.
@param array $criteria
@return bool | [
"Checks",
"whether",
"a",
"document",
"matching",
"criteria",
"exists",
"in",
"collection",
"."
] | 9d7276ea9ea9103c670f13f889bf59568ff35274 | https://github.com/fazland/elastica-odm/blob/9d7276ea9ea9103c670f13f889bf59568ff35274/src/Persister/DocumentPersister.php#L110-L117 |
12,084 | fazland/elastica-odm | src/Persister/DocumentPersister.php | DocumentPersister.insert | public function insert($document): ?PostInsertId
{
/** @var DocumentMetadata $class */
$class = $this->dm->getClassMetadata(get_class($document));
$idGenerator = $this->dm->getUnitOfWork()->getIdGenerator($class->idGeneratorType);
$postIdGenerator = $idGenerator->isPostInsertGenerato... | php | public function insert($document): ?PostInsertId
{
/** @var DocumentMetadata $class */
$class = $this->dm->getClassMetadata(get_class($document));
$idGenerator = $this->dm->getUnitOfWork()->getIdGenerator($class->idGeneratorType);
$postIdGenerator = $idGenerator->isPostInsertGenerato... | [
"public",
"function",
"insert",
"(",
"$",
"document",
")",
":",
"?",
"PostInsertId",
"{",
"/** @var DocumentMetadata $class */",
"$",
"class",
"=",
"$",
"this",
"->",
"dm",
"->",
"getClassMetadata",
"(",
"get_class",
"(",
"$",
"document",
")",
")",
";",
"$",... | Insert a document in the collection.
@param object $document
@return PostInsertId|null | [
"Insert",
"a",
"document",
"in",
"the",
"collection",
"."
] | 9d7276ea9ea9103c670f13f889bf59568ff35274 | https://github.com/fazland/elastica-odm/blob/9d7276ea9ea9103c670f13f889bf59568ff35274/src/Persister/DocumentPersister.php#L126-L159 |
12,085 | fazland/elastica-odm | src/Persister/DocumentPersister.php | DocumentPersister.update | public function update($document): void
{
$class = $this->dm->getClassMetadata(get_class($document));
$data = $this->prepareUpdateData($document);
$id = $class->getSingleIdentifier($document);
$this->collection->update((string) $id, $data['body'], $data['script']);
} | php | public function update($document): void
{
$class = $this->dm->getClassMetadata(get_class($document));
$data = $this->prepareUpdateData($document);
$id = $class->getSingleIdentifier($document);
$this->collection->update((string) $id, $data['body'], $data['script']);
} | [
"public",
"function",
"update",
"(",
"$",
"document",
")",
":",
"void",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"dm",
"->",
"getClassMetadata",
"(",
"get_class",
"(",
"$",
"document",
")",
")",
";",
"$",
"data",
"=",
"$",
"this",
"->",
"prepareUpd... | Updates a managed document.
@param object $document | [
"Updates",
"a",
"managed",
"document",
"."
] | 9d7276ea9ea9103c670f13f889bf59568ff35274 | https://github.com/fazland/elastica-odm/blob/9d7276ea9ea9103c670f13f889bf59568ff35274/src/Persister/DocumentPersister.php#L166-L173 |
12,086 | fazland/elastica-odm | src/Persister/DocumentPersister.php | DocumentPersister.delete | public function delete($document): void
{
$class = $this->dm->getClassMetadata(get_class($document));
$id = $class->getSingleIdentifier($document);
$this->collection->delete((string) $id);
} | php | public function delete($document): void
{
$class = $this->dm->getClassMetadata(get_class($document));
$id = $class->getSingleIdentifier($document);
$this->collection->delete((string) $id);
} | [
"public",
"function",
"delete",
"(",
"$",
"document",
")",
":",
"void",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"dm",
"->",
"getClassMetadata",
"(",
"get_class",
"(",
"$",
"document",
")",
")",
";",
"$",
"id",
"=",
"$",
"class",
"->",
"getSingleId... | Deletes a managed document.
@param object $document | [
"Deletes",
"a",
"managed",
"document",
"."
] | 9d7276ea9ea9103c670f13f889bf59568ff35274 | https://github.com/fazland/elastica-odm/blob/9d7276ea9ea9103c670f13f889bf59568ff35274/src/Persister/DocumentPersister.php#L180-L186 |
12,087 | watoki/reflect | src/watoki/reflect/PropertyReader.php | PropertyReader.readInterface | public function readInterface($object = null) {
$properties = new Map();
if ($this->class->getConstructor()) {
foreach ($this->class->getConstructor()->getParameters() as $parameter) {
$this->accumulate($properties,
new property\ConstructorProperty($this-... | php | public function readInterface($object = null) {
$properties = new Map();
if ($this->class->getConstructor()) {
foreach ($this->class->getConstructor()->getParameters() as $parameter) {
$this->accumulate($properties,
new property\ConstructorProperty($this-... | [
"public",
"function",
"readInterface",
"(",
"$",
"object",
"=",
"null",
")",
"{",
"$",
"properties",
"=",
"new",
"Map",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"class",
"->",
"getConstructor",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"... | Derives properties from constructor, public instance variables, getters and setters.
@param object|null $object If provided, dynamic (run-time) variables are read as well
@return \watoki\collections\Map|Property[] indexed by property name | [
"Derives",
"properties",
"from",
"constructor",
"public",
"instance",
"variables",
"getters",
"and",
"setters",
"."
] | 1d85de462f942d6d387811cd71ccc7623dc01f12 | https://github.com/watoki/reflect/blob/1d85de462f942d6d387811cd71ccc7623dc01f12/src/watoki/reflect/PropertyReader.php#L30-L66 |
12,088 | fly-studio/laravel-addons-func | src/SSHClient.php | SSHClient.connect | public function connect()
{
//Attempt to connect to host
$link = ssh2_connect($this->_config['host'], $this->_config['port']);
//If host connection fails, throw exception
if(!$link)
{
throw new \Exception('Unable to connect to '.$host.' on port '.$port);
}
else
{
//Assign the connection link t... | php | public function connect()
{
//Attempt to connect to host
$link = ssh2_connect($this->_config['host'], $this->_config['port']);
//If host connection fails, throw exception
if(!$link)
{
throw new \Exception('Unable to connect to '.$host.' on port '.$port);
}
else
{
//Assign the connection link t... | [
"public",
"function",
"connect",
"(",
")",
"{",
"//Attempt to connect to host",
"$",
"link",
"=",
"ssh2_connect",
"(",
"$",
"this",
"->",
"_config",
"[",
"'host'",
"]",
",",
"$",
"this",
"->",
"_config",
"[",
"'port'",
"]",
")",
";",
"//If host connection fa... | Connect to host
Connects to the host. Throws exception if the host is unable to be connected to. Will automatically
verify the host fingerprint, if one was provided, and throw an exception if the fingerprint is not
verified. | [
"Connect",
"to",
"host"
] | 02043c7a3834ec8525aca8156b3c89dfd4ff0d22 | https://github.com/fly-studio/laravel-addons-func/blob/02043c7a3834ec8525aca8156b3c89dfd4ff0d22/src/SSHClient.php#L76-L115 |
12,089 | fly-studio/laravel-addons-func | src/SSHClient.php | SSHClient.verify_host_fingerprint | protected function verify_host_fingerprint()
{
//Get the hosts fingerprint
$fingerprint = ssh2_fingerprint($this->_conn_link);
//Check the returned fingerprint, to the one expected
if($this->_config['host_fingerprint'] === $fingerprint)
{
return TRUE;
}
else
{
return FALSE;
}
} | php | protected function verify_host_fingerprint()
{
//Get the hosts fingerprint
$fingerprint = ssh2_fingerprint($this->_conn_link);
//Check the returned fingerprint, to the one expected
if($this->_config['host_fingerprint'] === $fingerprint)
{
return TRUE;
}
else
{
return FALSE;
}
} | [
"protected",
"function",
"verify_host_fingerprint",
"(",
")",
"{",
"//Get the hosts fingerprint",
"$",
"fingerprint",
"=",
"ssh2_fingerprint",
"(",
"$",
"this",
"->",
"_conn_link",
")",
";",
"//Check the returned fingerprint, to the one expected",
"if",
"(",
"$",
"this",
... | Verify host fingerprint
Verifies the host fingerprint.
@return TRUE on success, FALSE on failure | [
"Verify",
"host",
"fingerprint"
] | 02043c7a3834ec8525aca8156b3c89dfd4ff0d22 | https://github.com/fly-studio/laravel-addons-func/blob/02043c7a3834ec8525aca8156b3c89dfd4ff0d22/src/SSHClient.php#L138-L152 |
12,090 | fly-studio/laravel-addons-func | src/SSHClient.php | SSHClient.login_key | public function login_key()
{
//TODO: add location for pub/private key files
return ssh2_auth_pubkey_file($this->_conn_link, $this->_config['pub_key'], $this->_config['private_key'], $this->_config['passphrase']);
} | php | public function login_key()
{
//TODO: add location for pub/private key files
return ssh2_auth_pubkey_file($this->_conn_link, $this->_config['pub_key'], $this->_config['private_key'], $this->_config['passphrase']);
} | [
"public",
"function",
"login_key",
"(",
")",
"{",
"//TODO: add location for pub/private key files",
"return",
"ssh2_auth_pubkey_file",
"(",
"$",
"this",
"->",
"_conn_link",
",",
"$",
"this",
"->",
"_config",
"[",
"'pub_key'",
"]",
",",
"$",
"this",
"->",
"_config"... | Login using a key
This will attempt to login using the provided user and a hash key.
@return bool TRUE on success, FALSE on failure | [
"Login",
"using",
"a",
"key"
] | 02043c7a3834ec8525aca8156b3c89dfd4ff0d22 | https://github.com/fly-studio/laravel-addons-func/blob/02043c7a3834ec8525aca8156b3c89dfd4ff0d22/src/SSHClient.php#L161-L165 |
12,091 | fly-studio/laravel-addons-func | src/SSHClient.php | SSHClient.exec | public function exec($command, $pty = NULL, $env = array(), $width = 80, $height = 25, $width_height_type = SSH2_TERM_UNIT_CHARS)
{
return ssh2_exec($this->_conn_link, $command);
} | php | public function exec($command, $pty = NULL, $env = array(), $width = 80, $height = 25, $width_height_type = SSH2_TERM_UNIT_CHARS)
{
return ssh2_exec($this->_conn_link, $command);
} | [
"public",
"function",
"exec",
"(",
"$",
"command",
",",
"$",
"pty",
"=",
"NULL",
",",
"$",
"env",
"=",
"array",
"(",
")",
",",
"$",
"width",
"=",
"80",
",",
"$",
"height",
"=",
"25",
",",
"$",
"width_height_type",
"=",
"SSH2_TERM_UNIT_CHARS",
")",
... | Exec a command
@param $command string 命令
@param | [
"Exec",
"a",
"command"
] | 02043c7a3834ec8525aca8156b3c89dfd4ff0d22 | https://github.com/fly-studio/laravel-addons-func/blob/02043c7a3834ec8525aca8156b3c89dfd4ff0d22/src/SSHClient.php#L186-L189 |
12,092 | fly-studio/laravel-addons-func | src/SSHClient.php | SSHClient.send_file | public function send_file($local_filepath, $remote_filepath, $create_mode = 0644)
{
$local_filepath = $this->format_path($local_filepath);
$remote_filepath = $this->format_path($remote_filepath);
//Attempt to send the file
return ssh2_scp_send($this->_conn_link, $local_filepath, $remote_filepath, $create_m... | php | public function send_file($local_filepath, $remote_filepath, $create_mode = 0644)
{
$local_filepath = $this->format_path($local_filepath);
$remote_filepath = $this->format_path($remote_filepath);
//Attempt to send the file
return ssh2_scp_send($this->_conn_link, $local_filepath, $remote_filepath, $create_m... | [
"public",
"function",
"send_file",
"(",
"$",
"local_filepath",
",",
"$",
"remote_filepath",
",",
"$",
"create_mode",
"=",
"0644",
")",
"{",
"$",
"local_filepath",
"=",
"$",
"this",
"->",
"format_path",
"(",
"$",
"local_filepath",
")",
";",
"$",
"remote_filep... | Sends a file to the remote server using scp
Attempts to send a file via SCP to the remote server currently connected to
@param $local_filepath string The path to the file to send
@param $remote_filepath string The path to the remote location to save the file | [
"Sends",
"a",
"file",
"to",
"the",
"remote",
"server",
"using",
"scp"
] | 02043c7a3834ec8525aca8156b3c89dfd4ff0d22 | https://github.com/fly-studio/laravel-addons-func/blob/02043c7a3834ec8525aca8156b3c89dfd4ff0d22/src/SSHClient.php#L199-L207 |
12,093 | fly-studio/laravel-addons-func | src/SSHClient.php | SSHClient.receive_file | public function receive_file($remote_filepath, $local_filepath)
{
$local_filepath = $this->format_path($local_filepath);
$remote_filepath = $this->format_path($remote_filepath);
return ssh2_scp_recv($this->_conn_link, $remote_filepath, $local_filepath);
} | php | public function receive_file($remote_filepath, $local_filepath)
{
$local_filepath = $this->format_path($local_filepath);
$remote_filepath = $this->format_path($remote_filepath);
return ssh2_scp_recv($this->_conn_link, $remote_filepath, $local_filepath);
} | [
"public",
"function",
"receive_file",
"(",
"$",
"remote_filepath",
",",
"$",
"local_filepath",
")",
"{",
"$",
"local_filepath",
"=",
"$",
"this",
"->",
"format_path",
"(",
"$",
"local_filepath",
")",
";",
"$",
"remote_filepath",
"=",
"$",
"this",
"->",
"form... | Requests a file from the remote server using SCP
Attempts to request and save a file from the currently connected to server using SCP.
@param $local_filepath string The path to save the file to on local server
@param $remote_filepath string The path to the remote file that is being requested | [
"Requests",
"a",
"file",
"from",
"the",
"remote",
"server",
"using",
"SCP"
] | 02043c7a3834ec8525aca8156b3c89dfd4ff0d22 | https://github.com/fly-studio/laravel-addons-func/blob/02043c7a3834ec8525aca8156b3c89dfd4ff0d22/src/SSHClient.php#L218-L224 |
12,094 | fly-studio/laravel-addons-func | src/SSHClient.php | SSHClient.disconnect | public function disconnect()
{
$this->exec('echo "EXITING" && exit;');
$this->_conn_link = NULL;
$this->_connected = FALSE;
$this->_sftp = NULL;
} | php | public function disconnect()
{
$this->exec('echo "EXITING" && exit;');
$this->_conn_link = NULL;
$this->_connected = FALSE;
$this->_sftp = NULL;
} | [
"public",
"function",
"disconnect",
"(",
")",
"{",
"$",
"this",
"->",
"exec",
"(",
"'echo \"EXITING\" && exit;'",
")",
";",
"$",
"this",
"->",
"_conn_link",
"=",
"NULL",
";",
"$",
"this",
"->",
"_connected",
"=",
"FALSE",
";",
"$",
"this",
"->",
"_sftp",... | Disconnects from the connected server | [
"Disconnects",
"from",
"the",
"connected",
"server"
] | 02043c7a3834ec8525aca8156b3c89dfd4ff0d22 | https://github.com/fly-studio/laravel-addons-func/blob/02043c7a3834ec8525aca8156b3c89dfd4ff0d22/src/SSHClient.php#L381-L388 |
12,095 | eix/core | src/php/main/Eix/Services/Data/Sources/MongoDB.php | MongoDB.convertFromMongo | private static function convertFromMongo(array $data)
{
// Move the Mongo _id field into an 'id' field.
if (isset($data['_id'])) {
$data['id'] = $data['_id'];
unset($data['_id']);
}
foreach ($data as $name => &$value) {
if (is_array($value)) {
... | php | private static function convertFromMongo(array $data)
{
// Move the Mongo _id field into an 'id' field.
if (isset($data['_id'])) {
$data['id'] = $data['_id'];
unset($data['_id']);
}
foreach ($data as $name => &$value) {
if (is_array($value)) {
... | [
"private",
"static",
"function",
"convertFromMongo",
"(",
"array",
"$",
"data",
")",
"{",
"// Move the Mongo _id field into an 'id' field.",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"'_id'",
"]",
")",
")",
"{",
"$",
"data",
"[",
"'id'",
"]",
"=",
"$",
"d... | Convert the various Mongo-based objects into PHP standard types, and
apply other conversions to standardise Mongo's idiosyncrasies.
@param array $data the data that will be passed to Mongo for storage.
@return array | [
"Convert",
"the",
"various",
"Mongo",
"-",
"based",
"objects",
"into",
"PHP",
"standard",
"types",
"and",
"apply",
"other",
"conversions",
"to",
"standardise",
"Mongo",
"s",
"idiosyncrasies",
"."
] | a5b4c09cc168221e85804fdfeb78e519a0415466 | https://github.com/eix/core/blob/a5b4c09cc168221e85804fdfeb78e519a0415466/src/php/main/Eix/Services/Data/Sources/MongoDB.php#L178-L203 |
12,096 | eix/core | src/php/main/Eix/Services/Data/Sources/MongoDB.php | MongoDB.convertToMongo | private static function convertToMongo(array &$data)
{
// Move the ID field where Mongo expects it.
if (isset($data['id'])) {
// Create the _id field Mongo expects.
$data['_id'] = $data['id'];
// Remove the 'id' field from the data set that will be stored.
... | php | private static function convertToMongo(array &$data)
{
// Move the ID field where Mongo expects it.
if (isset($data['id'])) {
// Create the _id field Mongo expects.
$data['_id'] = $data['id'];
// Remove the 'id' field from the data set that will be stored.
... | [
"private",
"static",
"function",
"convertToMongo",
"(",
"array",
"&",
"$",
"data",
")",
"{",
"// Move the ID field where Mongo expects it.",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"'id'",
"]",
")",
")",
"{",
"// Create the _id field Mongo expects.",
"$",
"data... | Convert entity data so that it better fits Mongo's idiosyncrasies. | [
"Convert",
"entity",
"data",
"so",
"that",
"it",
"better",
"fits",
"Mongo",
"s",
"idiosyncrasies",
"."
] | a5b4c09cc168221e85804fdfeb78e519a0415466 | https://github.com/eix/core/blob/a5b4c09cc168221e85804fdfeb78e519a0415466/src/php/main/Eix/Services/Data/Sources/MongoDB.php#L208-L234 |
12,097 | thecodingmachine/utils.common.conditioninterface | src/Mouf/Utils/Common/ConditionInterface/AndCondition.php | AndCondition.isOk | public function isOk($caller = null) {
foreach ($this->conditions as $condition) {
if (!$condition->isOk($caller)) {
return false;
}
}
return true;
} | php | public function isOk($caller = null) {
foreach ($this->conditions as $condition) {
if (!$condition->isOk($caller)) {
return false;
}
}
return true;
} | [
"public",
"function",
"isOk",
"(",
"$",
"caller",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"conditions",
"as",
"$",
"condition",
")",
"{",
"if",
"(",
"!",
"$",
"condition",
"->",
"isOk",
"(",
"$",
"caller",
")",
")",
"{",
"return",... | Returns true if the condition is met, false otherwise.
@param mixed $caller The condition caller. Optional.
@return bool | [
"Returns",
"true",
"if",
"the",
"condition",
"is",
"met",
"false",
"otherwise",
"."
] | d38b67427a68bd7e37615c08ba28182e6c1867f1 | https://github.com/thecodingmachine/utils.common.conditioninterface/blob/d38b67427a68bd7e37615c08ba28182e6c1867f1/src/Mouf/Utils/Common/ConditionInterface/AndCondition.php#L33-L40 |
12,098 | sheychen290/colis | src/Response.php | Response.withStatus | public function withStatus($code, $reason = '')
{
$code = Validator::checkCode($code);
if (!is_string($reason) && !method_exists($reason, '__toString')) {
throw new InvalidArgumentException('ReasonPhrase must be a string');
}
$clone = clone $this;
$clone->code =... | php | public function withStatus($code, $reason = '')
{
$code = Validator::checkCode($code);
if (!is_string($reason) && !method_exists($reason, '__toString')) {
throw new InvalidArgumentException('ReasonPhrase must be a string');
}
$clone = clone $this;
$clone->code =... | [
"public",
"function",
"withStatus",
"(",
"$",
"code",
",",
"$",
"reason",
"=",
"''",
")",
"{",
"$",
"code",
"=",
"Validator",
"::",
"checkCode",
"(",
"$",
"code",
")",
";",
"if",
"(",
"!",
"is_string",
"(",
"$",
"reason",
")",
"&&",
"!",
"method_ex... | Return an instance with the specified status code and, optionally, reason phrase | [
"Return",
"an",
"instance",
"with",
"the",
"specified",
"status",
"code",
"and",
"optionally",
"reason",
"phrase"
] | b0552ece885d6b258e73ddbccf0b52c5c28e6054 | https://github.com/sheychen290/colis/blob/b0552ece885d6b258e73ddbccf0b52c5c28e6054/src/Response.php#L48-L69 |
12,099 | helionogueir/database | core/command/table/Create.class.php | Create.table | public function table(stdClass $variable) {
(new Table())->render($this->pdo, $this->info, $variable, $this->output);
} | php | public function table(stdClass $variable) {
(new Table())->render($this->pdo, $this->info, $variable, $this->output);
} | [
"public",
"function",
"table",
"(",
"stdClass",
"$",
"variable",
")",
"{",
"(",
"new",
"Table",
"(",
")",
")",
"->",
"render",
"(",
"$",
"this",
"->",
"pdo",
",",
"$",
"this",
"->",
"info",
",",
"$",
"variable",
",",
"$",
"this",
"->",
"output",
... | - Create table and insert rows
@param stdClass $variable Content variables for execute functionality
@return null | [
"-",
"Create",
"table",
"and",
"insert",
"rows"
] | 685606726cd90cc730c419681383e2cb6c4150f3 | https://github.com/helionogueir/database/blob/685606726cd90cc730c419681383e2cb6c4150f3/core/command/table/Create.class.php#L35-L37 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.