repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
yuncms/framework | src/notifications/channels/CloudPushChannel.php | CloudPushChannel.send | public function send(NotifiableInterface $notifiable, Notification $notification)
{
/**
* @var $message CloudPushMessage
*/
$message = $notification->toCloudPush();
$appRecipient = $notifiable->routeNotificationFor('cloudPush');
if ($message->validate()) {
... | php | public function send(NotifiableInterface $notifiable, Notification $notification)
{
/**
* @var $message CloudPushMessage
*/
$message = $notification->toCloudPush();
$appRecipient = $notifiable->routeNotificationFor('cloudPush');
if ($message->validate()) {
... | [
"public",
"function",
"send",
"(",
"NotifiableInterface",
"$",
"notifiable",
",",
"Notification",
"$",
"notification",
")",
"{",
"/**\n * @var $message CloudPushMessage\n */",
"$",
"message",
"=",
"$",
"notification",
"->",
"toCloudPush",
"(",
")",
";",
... | Send the given notification.
@param NotifiableInterface $notifiable
@param Notification $notification
@return mixed
@throws \yii\base\InvalidConfigException | [
"Send",
"the",
"given",
"notification",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/notifications/channels/CloudPushChannel.php#L55-L80 |
timiki/rpc-common | src/JsonRequest.php | JsonRequest.setResponse | public function setResponse(JsonResponse $response)
{
$this->response = $response;
if (!$response->getRequest()) {
$response->setRequest($this);
}
return $this;
} | php | public function setResponse(JsonResponse $response)
{
$this->response = $response;
if (!$response->getRequest()) {
$response->setRequest($this);
}
return $this;
} | [
"public",
"function",
"setResponse",
"(",
"JsonResponse",
"$",
"response",
")",
"{",
"$",
"this",
"->",
"response",
"=",
"$",
"response",
";",
"if",
"(",
"!",
"$",
"response",
"->",
"getRequest",
"(",
")",
")",
"{",
"$",
"response",
"->",
"setRequest",
... | Set response.
@param JsonResponse $response
@return $this | [
"Set",
"response",
"."
] | train | https://github.com/timiki/rpc-common/blob/a20e8bc92b16aa3686c4405bf5182123a5cfc750/src/JsonRequest.php#L116-L125 |
timiki/rpc-common | src/JsonRequest.php | JsonRequest.isValid | public function isValid()
{
if (empty($this->jsonrpc)) {
return false;
}
if (empty($this->method) || !is_string($this->method)) {
return false;
}
if (!empty($this->params) && !is_array($this->params)) {
return false;
}
re... | php | public function isValid()
{
if (empty($this->jsonrpc)) {
return false;
}
if (empty($this->method) || !is_string($this->method)) {
return false;
}
if (!empty($this->params) && !is_array($this->params)) {
return false;
}
re... | [
"public",
"function",
"isValid",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"jsonrpc",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"method",
")",
"||",
"!",
"is_string",
"(",
"$",
"this"... | Is valid.
@return boolean | [
"Is",
"valid",
"."
] | train | https://github.com/timiki/rpc-common/blob/a20e8bc92b16aa3686c4405bf5182123a5cfc750/src/JsonRequest.php#L132-L147 |
timiki/rpc-common | src/JsonRequest.php | JsonRequest.toArray | public function toArray()
{
$json = [];
$json['jsonrpc'] = $this->jsonrpc;
if ($this->method) {
$json['method'] = $this->method;
}
$json['method'] = $this->method;
if ($this->params) {
$json['params'] = $this->params;
}
... | php | public function toArray()
{
$json = [];
$json['jsonrpc'] = $this->jsonrpc;
if ($this->method) {
$json['method'] = $this->method;
}
$json['method'] = $this->method;
if ($this->params) {
$json['params'] = $this->params;
}
... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"json",
"=",
"[",
"]",
";",
"$",
"json",
"[",
"'jsonrpc'",
"]",
"=",
"$",
"this",
"->",
"jsonrpc",
";",
"if",
"(",
"$",
"this",
"->",
"method",
")",
"{",
"$",
"json",
"[",
"'method'",
"]",
"=... | Convert JsonRequest to json string.
@return array | [
"Convert",
"JsonRequest",
"to",
"json",
"string",
"."
] | train | https://github.com/timiki/rpc-common/blob/a20e8bc92b16aa3686c4405bf5182123a5cfc750/src/JsonRequest.php#L166-L186 |
ARCANEDEV/Sanitizer | src/Filters/EmailFilter.php | EmailFilter.filter | public function filter($value, array $options = [])
{
return is_string($value)
? filter_var(Str::lower(trim($value)), FILTER_SANITIZE_EMAIL)
: $value;
} | php | public function filter($value, array $options = [])
{
return is_string($value)
? filter_var(Str::lower(trim($value)), FILTER_SANITIZE_EMAIL)
: $value;
} | [
"public",
"function",
"filter",
"(",
"$",
"value",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"is_string",
"(",
"$",
"value",
")",
"?",
"filter_var",
"(",
"Str",
"::",
"lower",
"(",
"trim",
"(",
"$",
"value",
")",
")",
",",
... | Sanitize email of the given string.
@param mixed $value
@param array $options
@return string|mixed | [
"Sanitize",
"email",
"of",
"the",
"given",
"string",
"."
] | train | https://github.com/ARCANEDEV/Sanitizer/blob/e21990ce6d881366d52a7f4e5040b07cc3ecca96/src/Filters/EmailFilter.php#L26-L31 |
webforge-labs/psc-cms | lib/Psc/CMS/Project.php | Project.getInstallPharFile | public function getInstallPharFile() {
if (($ipf = $this->config->get(array('build','installPharFile'), NULL)) !== NULL) {
return new File($ipf);
} else {
return new File($this->getSrc(), 'psc-cms.phar.gz');
}
} | php | public function getInstallPharFile() {
if (($ipf = $this->config->get(array('build','installPharFile'), NULL)) !== NULL) {
return new File($ipf);
} else {
return new File($this->getSrc(), 'psc-cms.phar.gz');
}
} | [
"public",
"function",
"getInstallPharFile",
"(",
")",
"{",
"if",
"(",
"(",
"$",
"ipf",
"=",
"$",
"this",
"->",
"config",
"->",
"get",
"(",
"array",
"(",
"'build'",
",",
"'installPharFile'",
")",
",",
"NULL",
")",
")",
"!==",
"NULL",
")",
"{",
"return... | Gibt den Ort zurück in dem im Projekt die psc-cms.phar.gz abgelegt werden soll
@return File | [
"Gibt",
"den",
"Ort",
"zurück",
"in",
"dem",
"im",
"Projekt",
"die",
"psc",
"-",
"cms",
".",
"phar",
".",
"gz",
"abgelegt",
"werden",
"soll"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Project.php#L250-L256 |
webforge-labs/psc-cms | lib/Psc/CMS/Project.php | Project.namespaceToPath | public function namespaceToPath($namespace, Dir $classPath = NULL) {
$cp = $classPath ?: $this->getClassPath()->up();
// end und anfangs backslashs weg
$namespace = trim($namespace,'\\');
$dir = $cp->sub(str_replace('\\','/',$namespace).'/');
return $dir;
} | php | public function namespaceToPath($namespace, Dir $classPath = NULL) {
$cp = $classPath ?: $this->getClassPath()->up();
// end und anfangs backslashs weg
$namespace = trim($namespace,'\\');
$dir = $cp->sub(str_replace('\\','/',$namespace).'/');
return $dir;
} | [
"public",
"function",
"namespaceToPath",
"(",
"$",
"namespace",
",",
"Dir",
"$",
"classPath",
"=",
"NULL",
")",
"{",
"$",
"cp",
"=",
"$",
"classPath",
"?",
":",
"$",
"this",
"->",
"getClassPath",
"(",
")",
"->",
"up",
"(",
")",
";",
"// end und anfangs... | Gibt das Verzeichnis eines Namespaces in einem Verzeichnis zurück
dies nimmt einfach den Namespace
@return Dir absolute im angegebenen $classPath oder in $this->getClassPath() | [
"Gibt",
"das",
"Verzeichnis",
"eines",
"Namespaces",
"in",
"einem",
"Verzeichnis",
"zurück"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Project.php#L304-L313 |
hackzilla/ticket-message | Manager/TicketManager.php | TicketManager.createMessage | public function createMessage(TicketInterface $ticket = null)
{
/* @var TicketMessageInterface $message */
$message = new $this->ticketMessageClass();
if ($ticket) {
$message->setPriority($ticket->getPriority());
$message->setStatus($ticket->getStatus());
... | php | public function createMessage(TicketInterface $ticket = null)
{
/* @var TicketMessageInterface $message */
$message = new $this->ticketMessageClass();
if ($ticket) {
$message->setPriority($ticket->getPriority());
$message->setStatus($ticket->getStatus());
... | [
"public",
"function",
"createMessage",
"(",
"TicketInterface",
"$",
"ticket",
"=",
"null",
")",
"{",
"/* @var TicketMessageInterface $message */",
"$",
"message",
"=",
"new",
"$",
"this",
"->",
"ticketMessageClass",
"(",
")",
";",
"if",
"(",
"$",
"ticket",
")",
... | Create a new instance of TicketMessage Entity.
@param TicketInterface $ticket
@return TicketMessageInterface | [
"Create",
"a",
"new",
"instance",
"of",
"TicketMessage",
"Entity",
"."
] | train | https://github.com/hackzilla/ticket-message/blob/043950aa95f322cfaae145ce3c7781a4b0618a18/Manager/TicketManager.php#L124-L138 |
hackzilla/ticket-message | Manager/TicketManager.php | TicketManager.updateTicket | public function updateTicket(TicketInterface $ticket, TicketMessageInterface $message = null)
{
$this->storageManager('persist', $ticket);
if (is_null($ticket->getId())) {
$this->fireEvent(TicketEvents::TICKET_CREATE, $ticket);
$this->storageManager('persist', $ticket);
... | php | public function updateTicket(TicketInterface $ticket, TicketMessageInterface $message = null)
{
$this->storageManager('persist', $ticket);
if (is_null($ticket->getId())) {
$this->fireEvent(TicketEvents::TICKET_CREATE, $ticket);
$this->storageManager('persist', $ticket);
... | [
"public",
"function",
"updateTicket",
"(",
"TicketInterface",
"$",
"ticket",
",",
"TicketMessageInterface",
"$",
"message",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"storageManager",
"(",
"'persist'",
",",
"$",
"ticket",
")",
";",
"if",
"(",
"is_null",
"(",... | Update or Create a Ticket in the database
Update or Create a TicketMessage in the database.
@param TicketInterface $ticket
@param TicketMessageInterface $message
@return TicketInterface | [
"Update",
"or",
"Create",
"a",
"Ticket",
"in",
"the",
"database",
"Update",
"or",
"Create",
"a",
"TicketMessage",
"in",
"the",
"database",
"."
] | train | https://github.com/hackzilla/ticket-message/blob/043950aa95f322cfaae145ce3c7781a4b0618a18/Manager/TicketManager.php#L149-L168 |
hackzilla/ticket-message | Manager/TicketManager.php | TicketManager.deleteTicket | public function deleteTicket(TicketInterface $ticket)
{
$this->fireEvent(TicketEvents::TICKET_DELETE, $ticket);
$this->storageManager('remove', $ticket);
$this->storageManager('flush');
} | php | public function deleteTicket(TicketInterface $ticket)
{
$this->fireEvent(TicketEvents::TICKET_DELETE, $ticket);
$this->storageManager('remove', $ticket);
$this->storageManager('flush');
} | [
"public",
"function",
"deleteTicket",
"(",
"TicketInterface",
"$",
"ticket",
")",
"{",
"$",
"this",
"->",
"fireEvent",
"(",
"TicketEvents",
"::",
"TICKET_DELETE",
",",
"$",
"ticket",
")",
";",
"$",
"this",
"->",
"storageManager",
"(",
"'remove'",
",",
"$",
... | Delete a ticket from the database.
@param TicketInterface $ticket* | [
"Delete",
"a",
"ticket",
"from",
"the",
"database",
"."
] | train | https://github.com/hackzilla/ticket-message/blob/043950aa95f322cfaae145ce3c7781a4b0618a18/Manager/TicketManager.php#L175-L181 |
hackzilla/ticket-message | Manager/TicketManager.php | TicketManager.getTicketList | public function getTicketList($ticketStatus, $ticketPriority = null, array $orderBy = null)
{
return $this->storageManager('getTicketList', $ticketStatus, $ticketPriority, $orderBy);
} | php | public function getTicketList($ticketStatus, $ticketPriority = null, array $orderBy = null)
{
return $this->storageManager('getTicketList', $ticketStatus, $ticketPriority, $orderBy);
} | [
"public",
"function",
"getTicketList",
"(",
"$",
"ticketStatus",
",",
"$",
"ticketPriority",
"=",
"null",
",",
"array",
"$",
"orderBy",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"storageManager",
"(",
"'getTicketList'",
",",
"$",
"ticketStatus",
",... | @param int $ticketStatus
@param int $ticketPriority
@param array $orderBy field as the key and direction as the value
@return Pagerfanta | [
"@param",
"int",
"$ticketStatus",
"@param",
"int",
"$ticketPriority",
"@param",
"array",
"$orderBy",
"field",
"as",
"the",
"key",
"and",
"direction",
"as",
"the",
"value"
] | train | https://github.com/hackzilla/ticket-message/blob/043950aa95f322cfaae145ce3c7781a4b0618a18/Manager/TicketManager.php#L236-L239 |
hackzilla/ticket-message | Manager/TicketManager.php | TicketManager.getTicketStatus | public function getTicketStatus($statusStr)
{
static $statuses = false;
if ($statuses === false) {
$statuses = [];
foreach (TicketMessageInterface::STATUSES as $id => $value) {
$statuses[$id] = $this->translate($value);
}
}
retur... | php | public function getTicketStatus($statusStr)
{
static $statuses = false;
if ($statuses === false) {
$statuses = [];
foreach (TicketMessageInterface::STATUSES as $id => $value) {
$statuses[$id] = $this->translate($value);
}
}
retur... | [
"public",
"function",
"getTicketStatus",
"(",
"$",
"statusStr",
")",
"{",
"static",
"$",
"statuses",
"=",
"false",
";",
"if",
"(",
"$",
"statuses",
"===",
"false",
")",
"{",
"$",
"statuses",
"=",
"[",
"]",
";",
"foreach",
"(",
"TicketMessageInterface",
"... | Lookup status code.
@param string $statusStr
@return int | [
"Lookup",
"status",
"code",
"."
] | train | https://github.com/hackzilla/ticket-message/blob/043950aa95f322cfaae145ce3c7781a4b0618a18/Manager/TicketManager.php#L259-L272 |
hackzilla/ticket-message | Manager/TicketManager.php | TicketManager.getTicketPriority | public function getTicketPriority($priorityStr)
{
static $priorities = false;
if ($priorities === false) {
$priorities = [];
foreach (TicketMessageInterface::PRIORITIES as $id => $value) {
$priorities[$id] = $this->translate($value);
}
}
... | php | public function getTicketPriority($priorityStr)
{
static $priorities = false;
if ($priorities === false) {
$priorities = [];
foreach (TicketMessageInterface::PRIORITIES as $id => $value) {
$priorities[$id] = $this->translate($value);
}
}
... | [
"public",
"function",
"getTicketPriority",
"(",
"$",
"priorityStr",
")",
"{",
"static",
"$",
"priorities",
"=",
"false",
";",
"if",
"(",
"$",
"priorities",
"===",
"false",
")",
"{",
"$",
"priorities",
"=",
"[",
"]",
";",
"foreach",
"(",
"TicketMessageInter... | Lookup priority code.
@param string $priorityStr
@return int | [
"Lookup",
"priority",
"code",
"."
] | train | https://github.com/hackzilla/ticket-message/blob/043950aa95f322cfaae145ce3c7781a4b0618a18/Manager/TicketManager.php#L281-L294 |
hackzilla/ticket-message | Manager/TicketManager.php | TicketManager.fireEvent | private function fireEvent($event, ...$params)
{
if (!$this->eventManager) {
return;
}
$this->eventManager->handle($event, ...$params);
} | php | private function fireEvent($event, ...$params)
{
if (!$this->eventManager) {
return;
}
$this->eventManager->handle($event, ...$params);
} | [
"private",
"function",
"fireEvent",
"(",
"$",
"event",
",",
"...",
"$",
"params",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"eventManager",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"eventManager",
"->",
"handle",
"(",
"$",
"event",
",",
... | EventManager wrapper
@param string $event
@param array ...$params | [
"EventManager",
"wrapper"
] | train | https://github.com/hackzilla/ticket-message/blob/043950aa95f322cfaae145ce3c7781a4b0618a18/Manager/TicketManager.php#L319-L326 |
PortaText/php-sdk | src/PortaText/Command/Api/CampaignLifecycle.php | CampaignLifecycle.getEndpoint | protected function getEndpoint($method)
{
$campaignId = $this->getArgument("id");
if (is_null($campaignId)) {
throw new \InvalidArgumentException("Campaign id cant be null");
}
$this->delArgument("id");
return "campaigns/$campaignId/lifecycle";
} | php | protected function getEndpoint($method)
{
$campaignId = $this->getArgument("id");
if (is_null($campaignId)) {
throw new \InvalidArgumentException("Campaign id cant be null");
}
$this->delArgument("id");
return "campaigns/$campaignId/lifecycle";
} | [
"protected",
"function",
"getEndpoint",
"(",
"$",
"method",
")",
"{",
"$",
"campaignId",
"=",
"$",
"this",
"->",
"getArgument",
"(",
"\"id\"",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"campaignId",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentEx... | Returns a string with the endpoint for the given command.
@param string $method Method for this command.
@return string | [
"Returns",
"a",
"string",
"with",
"the",
"endpoint",
"for",
"the",
"given",
"command",
"."
] | train | https://github.com/PortaText/php-sdk/blob/dbe04ef043db5b251953f9de57aa4d0f1785dfcc/src/PortaText/Command/Api/CampaignLifecycle.php#L80-L88 |
phpmob/changmin | src/PhpMob/ChangMinBundle/DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('changmin');
$rootNode
->children()
->scalarNode('driver')->defaultValue(SyliusResourceBundle::DRIVER_DOCTRINE_ORM)->end()
->scalarNode('taxo... | php | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('changmin');
$rootNode
->children()
->scalarNode('driver')->defaultValue(SyliusResourceBundle::DRIVER_DOCTRINE_ORM)->end()
->scalarNode('taxo... | [
"public",
"function",
"getConfigTreeBuilder",
"(",
")",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
")",
";",
"$",
"rootNode",
"=",
"$",
"treeBuilder",
"->",
"root",
"(",
"'changmin'",
")",
";",
"$",
"rootNode",
"->",
"children",
"(",
")",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/ChangMinBundle/DependencyInjection/Configuration.php#L27-L42 |
xltxlm/logger | src/Log/DefineLog.php | DefineLog.resetUniqids | public static function resetUniqids()
{
$posix_getpid = posix_getpid();
unset(self::$uniqids[$posix_getpid]);
unset(self::$i[$posix_getpid]);
//重新设置数据库的值
PdoConfig::unsetAllinstance();
} | php | public static function resetUniqids()
{
$posix_getpid = posix_getpid();
unset(self::$uniqids[$posix_getpid]);
unset(self::$i[$posix_getpid]);
//重新设置数据库的值
PdoConfig::unsetAllinstance();
} | [
"public",
"static",
"function",
"resetUniqids",
"(",
")",
"{",
"$",
"posix_getpid",
"=",
"posix_getpid",
"(",
")",
";",
"unset",
"(",
"self",
"::",
"$",
"uniqids",
"[",
"$",
"posix_getpid",
"]",
")",
";",
"unset",
"(",
"self",
"::",
"$",
"i",
"[",
"$... | 如果是处理队列类型的数据,每处理一次数据,重置一下日志的唯一标志 | [
"如果是处理队列类型的数据,每处理一次数据,重置一下日志的唯一标志"
] | train | https://github.com/xltxlm/logger/blob/09592eeac38c6760bb4faabef939dd542f69b056/src/Log/DefineLog.php#L395-L402 |
xltxlm/logger | src/Log/DefineLog.php | DefineLog.setMessage | public function setMessage($message)
{
if (is_object($message)) {
$message = (new ConvertObject($message))
->toArray();
}
$this->message = $message;
return $this;
} | php | public function setMessage($message)
{
if (is_object($message)) {
$message = (new ConvertObject($message))
->toArray();
}
$this->message = $message;
return $this;
} | [
"public",
"function",
"setMessage",
"(",
"$",
"message",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"message",
")",
")",
"{",
"$",
"message",
"=",
"(",
"new",
"ConvertObject",
"(",
"$",
"message",
")",
")",
"->",
"toArray",
"(",
")",
";",
"}",
"$"... | @param mixed $message
@return $this | [
"@param",
"mixed",
"$message"
] | train | https://github.com/xltxlm/logger/blob/09592eeac38c6760bb4faabef939dd542f69b056/src/Log/DefineLog.php#L668-L676 |
kattsoftware/phassets | src/Phassets/Deployers/FilesystemDeployer.php | FilesystemDeployer.isPreviouslyDeployed | public function isPreviouslyDeployed(Asset $asset)
{
// Is there any previous deployed version?
$outputBasename = $this->computeOutputBasename($asset);
$file = $this->destinationPath . DIRECTORY_SEPARATOR . $outputBasename;
if (is_file($file)) {
$objectUrl = $this->baseU... | php | public function isPreviouslyDeployed(Asset $asset)
{
// Is there any previous deployed version?
$outputBasename = $this->computeOutputBasename($asset);
$file = $this->destinationPath . DIRECTORY_SEPARATOR . $outputBasename;
if (is_file($file)) {
$objectUrl = $this->baseU... | [
"public",
"function",
"isPreviouslyDeployed",
"(",
"Asset",
"$",
"asset",
")",
"{",
"// Is there any previous deployed version?",
"$",
"outputBasename",
"=",
"$",
"this",
"->",
"computeOutputBasename",
"(",
"$",
"asset",
")",
";",
"$",
"file",
"=",
"$",
"this",
... | Attempt to retrieve a previously deployed asset; if it does exist,
then update the Asset instance's outputUrl property, without performing
any further filters' actions.
fullPath and outputExtension are set at this point in the Asset instance.
@param Asset $asset
@return bool Whether the Asset was previously deployed o... | [
"Attempt",
"to",
"retrieve",
"a",
"previously",
"deployed",
"asset",
";",
"if",
"it",
"does",
"exist",
"then",
"update",
"the",
"Asset",
"instance",
"s",
"outputUrl",
"property",
"without",
"performing",
"any",
"further",
"filters",
"actions",
".",
"fullPath",
... | train | https://github.com/kattsoftware/phassets/blob/cc982cf1941eb5776287d64f027218bd4835ed2b/src/Phassets/Deployers/FilesystemDeployer.php#L59-L73 |
kattsoftware/phassets | src/Phassets/Deployers/FilesystemDeployer.php | FilesystemDeployer.deploy | public function deploy(Asset $asset)
{
$outputBasename = $this->computeOutputBasename($asset);
$fullPath = $this->destinationPath . DIRECTORY_SEPARATOR . $outputBasename;
$saving = file_put_contents($fullPath, $asset->getContents());
if($saving === false) {
throw new Ph... | php | public function deploy(Asset $asset)
{
$outputBasename = $this->computeOutputBasename($asset);
$fullPath = $this->destinationPath . DIRECTORY_SEPARATOR . $outputBasename;
$saving = file_put_contents($fullPath, $asset->getContents());
if($saving === false) {
throw new Ph... | [
"public",
"function",
"deploy",
"(",
"Asset",
"$",
"asset",
")",
"{",
"$",
"outputBasename",
"=",
"$",
"this",
"->",
"computeOutputBasename",
"(",
"$",
"asset",
")",
";",
"$",
"fullPath",
"=",
"$",
"this",
"->",
"destinationPath",
".",
"DIRECTORY_SEPARATOR",... | Given an Asset instance, try to deploy is using internal
rules of this deployer and update Asset's property outputUrl.
@param Asset $asset Asset instance whose outputUrl property will be modified
@throws PhassetsInternalException If the deployment process fails | [
"Given",
"an",
"Asset",
"instance",
"try",
"to",
"deploy",
"is",
"using",
"internal",
"rules",
"of",
"this",
"deployer",
"and",
"update",
"Asset",
"s",
"property",
"outputUrl",
"."
] | train | https://github.com/kattsoftware/phassets/blob/cc982cf1941eb5776287d64f027218bd4835ed2b/src/Phassets/Deployers/FilesystemDeployer.php#L82-L99 |
kattsoftware/phassets | src/Phassets/Deployers/FilesystemDeployer.php | FilesystemDeployer.isSupported | public function isSupported()
{
$this->destinationPath = $this->configurator->getConfig('filesystem_deployer', 'destination_path');
$this->baseUrl = $this->configurator->getConfig('filesystem_deployer', 'base_url');
$this->trigger = $this->configurator->getConfig('filesystem_deployer', 'chan... | php | public function isSupported()
{
$this->destinationPath = $this->configurator->getConfig('filesystem_deployer', 'destination_path');
$this->baseUrl = $this->configurator->getConfig('filesystem_deployer', 'base_url');
$this->trigger = $this->configurator->getConfig('filesystem_deployer', 'chan... | [
"public",
"function",
"isSupported",
"(",
")",
"{",
"$",
"this",
"->",
"destinationPath",
"=",
"$",
"this",
"->",
"configurator",
"->",
"getConfig",
"(",
"'filesystem_deployer'",
",",
"'destination_path'",
")",
";",
"$",
"this",
"->",
"baseUrl",
"=",
"$",
"t... | This must throw a PhassetsInternalException if the current configuration
doesn't allow this deployer to deploy processed assets.
@throws PhassetsInternalException If at this time Phassets can't use this deployer to
deploy and serve deployed assets | [
"This",
"must",
"throw",
"a",
"PhassetsInternalException",
"if",
"the",
"current",
"configuration",
"doesn",
"t",
"allow",
"this",
"deployer",
"to",
"deploy",
"processed",
"assets",
"."
] | train | https://github.com/kattsoftware/phassets/blob/cc982cf1941eb5776287d64f027218bd4835ed2b/src/Phassets/Deployers/FilesystemDeployer.php#L108-L123 |
kattsoftware/phassets | src/Phassets/Deployers/FilesystemDeployer.php | FilesystemDeployer.computeOutputBasename | private function computeOutputBasename(Asset $asset)
{
$ext = $asset->getOutputExtension() ? '.' . $asset->getOutputExtension() : '';
switch ($this->trigger) {
case 'md5':
$suffix = $asset->getMd5();
break;
case 'sha1':
$suffix... | php | private function computeOutputBasename(Asset $asset)
{
$ext = $asset->getOutputExtension() ? '.' . $asset->getOutputExtension() : '';
switch ($this->trigger) {
case 'md5':
$suffix = $asset->getMd5();
break;
case 'sha1':
$suffix... | [
"private",
"function",
"computeOutputBasename",
"(",
"Asset",
"$",
"asset",
")",
"{",
"$",
"ext",
"=",
"$",
"asset",
"->",
"getOutputExtension",
"(",
")",
"?",
"'.'",
".",
"$",
"asset",
"->",
"getOutputExtension",
"(",
")",
":",
"''",
";",
"switch",
"(",... | Generates the output full file name of an Asset instance.
Pattern: <filename>_<triggering_asset_value>[.<output_extension>]
@param Asset $asset
@return string Generated basename of asset | [
"Generates",
"the",
"output",
"full",
"file",
"name",
"of",
"an",
"Asset",
"instance",
".",
"Pattern",
":",
"<filename",
">",
"_<triggering_asset_value",
">",
"[",
".",
"<output_extension",
">",
"]"
] | train | https://github.com/kattsoftware/phassets/blob/cc982cf1941eb5776287d64f027218bd4835ed2b/src/Phassets/Deployers/FilesystemDeployer.php#L132-L149 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Common/CoverFishMessageWarning.php | CoverFishMessageWarning.getWarningStreamTemplate | public function getWarningStreamTemplate(CoverFishMapping $coverMapping, $noAnsiColors = false)
{
$coverLine = null;
switch ($this->getMessageCode()) {
case self::PHPUNIT_NO_COVERAGE_FOR_METHOD:
$coverLine = sprintf('no @covers annotation for %s::%s', $coverMapping->getCl... | php | public function getWarningStreamTemplate(CoverFishMapping $coverMapping, $noAnsiColors = false)
{
$coverLine = null;
switch ($this->getMessageCode()) {
case self::PHPUNIT_NO_COVERAGE_FOR_METHOD:
$coverLine = sprintf('no @covers annotation for %s::%s', $coverMapping->getCl... | [
"public",
"function",
"getWarningStreamTemplate",
"(",
"CoverFishMapping",
"$",
"coverMapping",
",",
"$",
"noAnsiColors",
"=",
"false",
")",
"{",
"$",
"coverLine",
"=",
"null",
";",
"switch",
"(",
"$",
"this",
"->",
"getMessageCode",
"(",
")",
")",
"{",
"cas... | @param CoverFishMapping $coverMapping
@param bool|false $noAnsiColors
@return null|string | [
"@param",
"CoverFishMapping",
"$coverMapping",
"@param",
"bool|false",
"$noAnsiColors"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Common/CoverFishMessageWarning.php#L42-L79 |
CakeCMS/Core | src/Less/Less.php | Less.compile | public function compile($lessFile, $basePath = null)
{
try {
$basePath = $this->_prepareBasepath($basePath, dirname($lessFile));
$cache = new Cache($this->_options);
$cache->setFile($lessFile, $basePath);
$isExpired = $cache->isExpired();
$isForc... | php | public function compile($lessFile, $basePath = null)
{
try {
$basePath = $this->_prepareBasepath($basePath, dirname($lessFile));
$cache = new Cache($this->_options);
$cache->setFile($lessFile, $basePath);
$isExpired = $cache->isExpired();
$isForc... | [
"public",
"function",
"compile",
"(",
"$",
"lessFile",
",",
"$",
"basePath",
"=",
"null",
")",
"{",
"try",
"{",
"$",
"basePath",
"=",
"$",
"this",
"->",
"_prepareBasepath",
"(",
"$",
"basePath",
",",
"dirname",
"(",
"$",
"lessFile",
")",
")",
";",
"$... | Compile less file.
@param string $lessFile
@param null|string $basePath
@return array
@throws Exception | [
"Compile",
"less",
"file",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Less/Less.php#L38-L63 |
fubhy/graphql-php | src/Executor/Values.php | Values.getVariableValues | public static function getVariableValues(Schema $schema, array $asts, array $inputs)
{
$values = [];
foreach ($asts as $ast) {
$variable = $ast->get('variable')->get('name')->get('value');
$values[$variable] = self::getvariableValue($schema, $ast, isset($inputs[$variable]) ? ... | php | public static function getVariableValues(Schema $schema, array $asts, array $inputs)
{
$values = [];
foreach ($asts as $ast) {
$variable = $ast->get('variable')->get('name')->get('value');
$values[$variable] = self::getvariableValue($schema, $ast, isset($inputs[$variable]) ? ... | [
"public",
"static",
"function",
"getVariableValues",
"(",
"Schema",
"$",
"schema",
",",
"array",
"$",
"asts",
",",
"array",
"$",
"inputs",
")",
"{",
"$",
"values",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"asts",
"as",
"$",
"ast",
")",
"{",
"$",
"v... | Prepares an object map of variables of the correct type based on the
provided variable definitions and arbitrary input. If the input cannot be
coerced to match the variable definitions, a Error will be thrown.
@param Schema $schema
@param array $asts
@param array $inputs
@return array
@throws \Exception | [
"Prepares",
"an",
"object",
"map",
"of",
"variables",
"of",
"the",
"correct",
"type",
"based",
"on",
"the",
"provided",
"variable",
"definitions",
"and",
"arbitrary",
"input",
".",
"If",
"the",
"input",
"cannot",
"be",
"coerced",
"to",
"match",
"the",
"varia... | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Values.php#L33-L41 |
fubhy/graphql-php | src/Executor/Values.php | Values.getArgumentValues | public static function getArgumentValues($arguments, $asts, $variables)
{
if (!$arguments || count($arguments) === 0) {
return NULL;
}
$map = array_reduce($asts, function ($carry, $argument) {
$carry[$argument->get('name')->get('value')] = $argument;
retu... | php | public static function getArgumentValues($arguments, $asts, $variables)
{
if (!$arguments || count($arguments) === 0) {
return NULL;
}
$map = array_reduce($asts, function ($carry, $argument) {
$carry[$argument->get('name')->get('value')] = $argument;
retu... | [
"public",
"static",
"function",
"getArgumentValues",
"(",
"$",
"arguments",
",",
"$",
"asts",
",",
"$",
"variables",
")",
"{",
"if",
"(",
"!",
"$",
"arguments",
"||",
"count",
"(",
"$",
"arguments",
")",
"===",
"0",
")",
"{",
"return",
"NULL",
";",
"... | Prepares an object map of argument values given a list of argument
definitions and list of argument AST nodes.
@param $arguments
@param $asts
@param $variables
@return array|null | [
"Prepares",
"an",
"object",
"map",
"of",
"argument",
"values",
"given",
"a",
"list",
"of",
"argument",
"definitions",
"and",
"list",
"of",
"argument",
"AST",
"nodes",
"."
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Values.php#L53-L71 |
fubhy/graphql-php | src/Executor/Values.php | Values.getDirectiveValue | public static function getDirectiveValue(DirectiveInterface $definition, $directives, $variables)
{
$ast = NULL;
if ($directives) {
foreach ($directives as $directive) {
if ($directive->get('name')->get('value') === $definition->getName()) {
$ast = $di... | php | public static function getDirectiveValue(DirectiveInterface $definition, $directives, $variables)
{
$ast = NULL;
if ($directives) {
foreach ($directives as $directive) {
if ($directive->get('name')->get('value') === $definition->getName()) {
$ast = $di... | [
"public",
"static",
"function",
"getDirectiveValue",
"(",
"DirectiveInterface",
"$",
"definition",
",",
"$",
"directives",
",",
"$",
"variables",
")",
"{",
"$",
"ast",
"=",
"NULL",
";",
"if",
"(",
"$",
"directives",
")",
"{",
"foreach",
"(",
"$",
"directiv... | @param DirectiveInterface $definition
@param $directives
@param $variables
@return array|mixed|null|string | [
"@param",
"DirectiveInterface",
"$definition",
"@param",
"$directives",
"@param",
"$variables"
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Values.php#L80-L98 |
fubhy/graphql-php | src/Executor/Values.php | Values.getVariableValue | protected static function getVariableValue(Schema $schema, VariableDefinition $definition, $input)
{
$type = TypeInfo::typeFromAST($schema, $definition->get('type'));
if (!$type) {
return NULL;
}
if (self::isValidValue($type, $input)) {
if (!isset($input)) {
... | php | protected static function getVariableValue(Schema $schema, VariableDefinition $definition, $input)
{
$type = TypeInfo::typeFromAST($schema, $definition->get('type'));
if (!$type) {
return NULL;
}
if (self::isValidValue($type, $input)) {
if (!isset($input)) {
... | [
"protected",
"static",
"function",
"getVariableValue",
"(",
"Schema",
"$",
"schema",
",",
"VariableDefinition",
"$",
"definition",
",",
"$",
"input",
")",
"{",
"$",
"type",
"=",
"TypeInfo",
"::",
"typeFromAST",
"(",
"$",
"schema",
",",
"$",
"definition",
"->... | Given a variable definition, and any value of input, return a value which
adheres to the variable definition, or throw an error.
@param Schema $schema
@param VariableDefinition $definition
@param $input
@return array|mixed|null|string
@throws \Exception | [
"Given",
"a",
"variable",
"definition",
"and",
"any",
"value",
"of",
"input",
"return",
"a",
"value",
"which",
"adheres",
"to",
"the",
"variable",
"definition",
"or",
"throw",
"an",
"error",
"."
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Values.php#L112-L133 |
fubhy/graphql-php | src/Executor/Values.php | Values.isValidValue | protected static function isValidValue(TypeInterface $type, $value)
{
if ($type instanceof NonNullModifier) {
if (NULL === $value) {
return FALSE;
}
return self::isValidValue($type->getWrappedType(), $value);
}
if ($value === NULL) {
... | php | protected static function isValidValue(TypeInterface $type, $value)
{
if ($type instanceof NonNullModifier) {
if (NULL === $value) {
return FALSE;
}
return self::isValidValue($type->getWrappedType(), $value);
}
if ($value === NULL) {
... | [
"protected",
"static",
"function",
"isValidValue",
"(",
"TypeInterface",
"$",
"type",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"type",
"instanceof",
"NonNullModifier",
")",
"{",
"if",
"(",
"NULL",
"===",
"$",
"value",
")",
"{",
"return",
"FALSE",
";"... | Given a type and any value, return true if that value is valid.
@param TypeInterface $type
@param $value
@return bool | [
"Given",
"a",
"type",
"and",
"any",
"value",
"return",
"true",
"if",
"that",
"value",
"is",
"valid",
"."
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Values.php#L143-L188 |
fubhy/graphql-php | src/Executor/Values.php | Values.coerceValue | protected static function coerceValue(TypeInterface $type, $value)
{
if ($type instanceof NonNullModifier) {
// Note: we're not checking that the result of coerceValue is non-null.
// We only call this function after calling isValidValue.
return self::coerceValue($type->g... | php | protected static function coerceValue(TypeInterface $type, $value)
{
if ($type instanceof NonNullModifier) {
// Note: we're not checking that the result of coerceValue is non-null.
// We only call this function after calling isValidValue.
return self::coerceValue($type->g... | [
"protected",
"static",
"function",
"coerceValue",
"(",
"TypeInterface",
"$",
"type",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"type",
"instanceof",
"NonNullModifier",
")",
"{",
"// Note: we're not checking that the result of coerceValue is non-null.",
"// We only call... | Given a type and any value, return a runtime value coerced to match the
type.
@param TypeInterface $type
@param $value
@return array|mixed|null|string | [
"Given",
"a",
"type",
"and",
"any",
"value",
"return",
"a",
"runtime",
"value",
"coerced",
"to",
"match",
"the",
"type",
"."
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Values.php#L199-L241 |
fubhy/graphql-php | src/Executor/Values.php | Values.coerceValueAST | protected static function coerceValueAST(TypeInterface $type, $ast, $variables = NULL)
{
if ($type instanceof NonNullModifier) {
// Note: we're not checking that the result of coerceValueAST is non-null.
// We're assuming that this query has been validated and the value used
... | php | protected static function coerceValueAST(TypeInterface $type, $ast, $variables = NULL)
{
if ($type instanceof NonNullModifier) {
// Note: we're not checking that the result of coerceValueAST is non-null.
// We're assuming that this query has been validated and the value used
... | [
"protected",
"static",
"function",
"coerceValueAST",
"(",
"TypeInterface",
"$",
"type",
",",
"$",
"ast",
",",
"$",
"variables",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"type",
"instanceof",
"NonNullModifier",
")",
"{",
"// Note: we're not checking that the result o... | Given a type and a value AST node known to match this type, build a
runtime value.
@param TypeInterface $type
@param $ast
@param null $variables
@return array|mixed|null|string | [
"Given",
"a",
"type",
"and",
"a",
"value",
"AST",
"node",
"known",
"to",
"match",
"this",
"type",
"build",
"a",
"runtime",
"value",
"."
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Executor/Values.php#L253-L325 |
lootils/archiver | src/Lootils/Archiver/ZipArchive.php | ZipArchive.add | public function add($file, $entry_name = null)
{
// Make sure to adapt the entry name as the original filename.
if (!isset($entry_name)) {
$entry_name = basename($file);
}
$result = $this->zip->addFile($file, $entry_name);
if ($result === false) {
thro... | php | public function add($file, $entry_name = null)
{
// Make sure to adapt the entry name as the original filename.
if (!isset($entry_name)) {
$entry_name = basename($file);
}
$result = $this->zip->addFile($file, $entry_name);
if ($result === false) {
thro... | [
"public",
"function",
"add",
"(",
"$",
"file",
",",
"$",
"entry_name",
"=",
"null",
")",
"{",
"// Make sure to adapt the entry name as the original filename.",
"if",
"(",
"!",
"isset",
"(",
"$",
"entry_name",
")",
")",
"{",
"$",
"entry_name",
"=",
"basename",
... | Add the given file to the file archive. | [
"Add",
"the",
"given",
"file",
"to",
"the",
"file",
"archive",
"."
] | train | https://github.com/lootils/archiver/blob/5b801bddfe15f7378a118c4094f04b37abb5a53e/src/Lootils/Archiver/ZipArchive.php#L34-L46 |
lootils/archiver | src/Lootils/Archiver/ZipArchive.php | ZipArchive.remove | public function remove($entry)
{
$result = $this->zip->deleteName($entry);
if ($result === false) {
throw new ArchiveException('Error removing entry ' . $entry);
}
return $this;
} | php | public function remove($entry)
{
$result = $this->zip->deleteName($entry);
if ($result === false) {
throw new ArchiveException('Error removing entry ' . $entry);
}
return $this;
} | [
"public",
"function",
"remove",
"(",
"$",
"entry",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"zip",
"->",
"deleteName",
"(",
"$",
"entry",
")",
";",
"if",
"(",
"$",
"result",
"===",
"false",
")",
"{",
"throw",
"new",
"ArchiveException",
"(",
... | Remove the specified file from the archive. | [
"Remove",
"the",
"specified",
"file",
"from",
"the",
"archive",
"."
] | train | https://github.com/lootils/archiver/blob/5b801bddfe15f7378a118c4094f04b37abb5a53e/src/Lootils/Archiver/ZipArchive.php#L51-L59 |
lootils/archiver | src/Lootils/Archiver/ZipArchive.php | ZipArchive.contents | public function contents()
{
$files = array();
for ($i=0; $i < $this->zip->numFiles; $i++) {
$details = $this->zip->statIndex($i);
$files[$details['name']] = $details;
}
return $files;
} | php | public function contents()
{
$files = array();
for ($i=0; $i < $this->zip->numFiles; $i++) {
$details = $this->zip->statIndex($i);
$files[$details['name']] = $details;
}
return $files;
} | [
"public",
"function",
"contents",
"(",
")",
"{",
"$",
"files",
"=",
"array",
"(",
")",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"this",
"->",
"zip",
"->",
"numFiles",
";",
"$",
"i",
"++",
")",
"{",
"$",
"details",
"=",
... | Retrieve an array of the archive contents. | [
"Retrieve",
"an",
"array",
"of",
"the",
"archive",
"contents",
"."
] | train | https://github.com/lootils/archiver/blob/5b801bddfe15f7378a118c4094f04b37abb5a53e/src/Lootils/Archiver/ZipArchive.php#L82-L92 |
lootils/archiver | src/Lootils/Archiver/ZipArchive.php | ZipArchive.close | public function close()
{
if (isset($this->zip)) {
$this->zip->close();
$this->zip = null;
}
} | php | public function close()
{
if (isset($this->zip)) {
$this->zip->close();
$this->zip = null;
}
} | [
"public",
"function",
"close",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"zip",
")",
")",
"{",
"$",
"this",
"->",
"zip",
"->",
"close",
"(",
")",
";",
"$",
"this",
"->",
"zip",
"=",
"null",
";",
"}",
"}"
] | Release the zip resource. | [
"Release",
"the",
"zip",
"resource",
"."
] | train | https://github.com/lootils/archiver/blob/5b801bddfe15f7378a118c4094f04b37abb5a53e/src/Lootils/Archiver/ZipArchive.php#L105-L111 |
yohang/dependency-tools | src/Yohang/DependencyTools.php | DependencyTools.getOptions | protected static function getOptions($event)
{
$extra = $event->getComposer()->getPackage()->getExtra();
return array_merge(
array(
'npm' => false,
'bower' => false
),
isset($extra['dependency-tools']) ? $extra['dependency-tools'... | php | protected static function getOptions($event)
{
$extra = $event->getComposer()->getPackage()->getExtra();
return array_merge(
array(
'npm' => false,
'bower' => false
),
isset($extra['dependency-tools']) ? $extra['dependency-tools'... | [
"protected",
"static",
"function",
"getOptions",
"(",
"$",
"event",
")",
"{",
"$",
"extra",
"=",
"$",
"event",
"->",
"getComposer",
"(",
")",
"->",
"getPackage",
"(",
")",
"->",
"getExtra",
"(",
")",
";",
"return",
"array_merge",
"(",
"array",
"(",
"'n... | @param $event
@return array | [
"@param",
"$event"
] | train | https://github.com/yohang/dependency-tools/blob/9e0b85e8108900e397e25b8d1830b3d785ef11af/src/Yohang/DependencyTools.php#L47-L58 |
yohang/dependency-tools | src/Yohang/DependencyTools.php | DependencyTools.execCommand | protected static function execCommand($options, $cmd, array $args, $ifError)
{
if (is_array($options) && isset($options['path'])) {
$cmd = $options['path'];
} else {
$executableFinder = new ExecutableFinder;
$cmd = $executableFinder->find($cmd);
}
... | php | protected static function execCommand($options, $cmd, array $args, $ifError)
{
if (is_array($options) && isset($options['path'])) {
$cmd = $options['path'];
} else {
$executableFinder = new ExecutableFinder;
$cmd = $executableFinder->find($cmd);
}
... | [
"protected",
"static",
"function",
"execCommand",
"(",
"$",
"options",
",",
"$",
"cmd",
",",
"array",
"$",
"args",
",",
"$",
"ifError",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"options",
")",
"&&",
"isset",
"(",
"$",
"options",
"[",
"'path'",
"]",... | @param array $options
@param string $cmd
@param array $args
@param string $ifError
@throws \RuntimeException | [
"@param",
"array",
"$options",
"@param",
"string",
"$cmd",
"@param",
"array",
"$args",
"@param",
"string",
"$ifError"
] | train | https://github.com/yohang/dependency-tools/blob/9e0b85e8108900e397e25b8d1830b3d785ef11af/src/Yohang/DependencyTools.php#L68-L87 |
webforge-labs/psc-cms | lib/Psc/GPC.php | GPC.clean | public static function clean($value) {
if (!get_magic_quotes_gpc() && !self::$forceStripSlashes) return $value;
return is_array($value) ?
array_map(array('GPC','clean'), $value) :
stripslashes($value);
} | php | public static function clean($value) {
if (!get_magic_quotes_gpc() && !self::$forceStripSlashes) return $value;
return is_array($value) ?
array_map(array('GPC','clean'), $value) :
stripslashes($value);
} | [
"public",
"static",
"function",
"clean",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"get_magic_quotes_gpc",
"(",
")",
"&&",
"!",
"self",
"::",
"$",
"forceStripSlashes",
")",
"return",
"$",
"value",
";",
"return",
"is_array",
"(",
"$",
"value",
")",
"... | Gibt den Wert (oder Array) ohne magic Slashes zurück
@param array|string $value | [
"Gibt",
"den",
"Wert",
"(",
"oder",
"Array",
")",
"ohne",
"magic",
"Slashes",
"zurück"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/GPC.php#L19-L25 |
teneleven/GeolocatorBundle | DependencyInjection/TenelevenGeolocatorExtension.php | TenelevenGeolocatorExtension.load | public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$container->setAlias('teneleven.geolocator.geocoder', $config['geocoder_service']);
$loader = new Loader\XmlFil... | php | public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$container->setAlias('teneleven.geolocator.geocoder', $config['geocoder_service']);
$loader = new Loader\XmlFil... | [
"public",
"function",
"load",
"(",
"array",
"$",
"configs",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"configuration",
"=",
"new",
"Configuration",
"(",
")",
";",
"$",
"config",
"=",
"$",
"this",
"->",
"processConfiguration",
"(",
"$",
"con... | {@inheritDoc} | [
"{"
] | train | https://github.com/teneleven/GeolocatorBundle/blob/4ead8e783a91577f2a67aa302b79641d4b9e99ad/DependencyInjection/TenelevenGeolocatorExtension.php#L32-L45 |
teneleven/GeolocatorBundle | DependencyInjection/TenelevenGeolocatorExtension.php | TenelevenGeolocatorExtension.prepend | public function prepend(ContainerBuilder $container)
{
$configs = array(
'bazinga_geocoder' => array(
'providers' => array('google_maps' => null)
),
// 'ivory_google_map' => array(
// 'map' => array('width' => "100%", 'height' => "600px"),
//... | php | public function prepend(ContainerBuilder $container)
{
$configs = array(
'bazinga_geocoder' => array(
'providers' => array('google_maps' => null)
),
// 'ivory_google_map' => array(
// 'map' => array('width' => "100%", 'height' => "600px"),
//... | [
"public",
"function",
"prepend",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"configs",
"=",
"array",
"(",
"'bazinga_geocoder'",
"=>",
"array",
"(",
"'providers'",
"=>",
"array",
"(",
"'google_maps'",
"=>",
"null",
")",
")",
",",
"// '... | Configure sensitive defaults for other bundles
@param ContainerBuilder $container | [
"Configure",
"sensitive",
"defaults",
"for",
"other",
"bundles"
] | train | https://github.com/teneleven/GeolocatorBundle/blob/4ead8e783a91577f2a67aa302b79641d4b9e99ad/DependencyInjection/TenelevenGeolocatorExtension.php#L80-L104 |
andrelohmann/silverstripe-extended-image | code/models/SecureImage.php | SecureImage.getTag | public function getTag() {
if($this->exists()) {
$url = $this->getURL();
$title = ($this->Title) ? $this->Title : $this->Filename;
if($this->Title) {
$title = Convert::raw2att($this->Title);
} else {
if(preg_match("/([^\/]*)\.[a-zA-Z0-9]{1,6}$/", $title, $matches)) {
$title = Convert::raw2att... | php | public function getTag() {
if($this->exists()) {
$url = $this->getURL();
$title = ($this->Title) ? $this->Title : $this->Filename;
if($this->Title) {
$title = Convert::raw2att($this->Title);
} else {
if(preg_match("/([^\/]*)\.[a-zA-Z0-9]{1,6}$/", $title, $matches)) {
$title = Convert::raw2att... | [
"public",
"function",
"getTag",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"exists",
"(",
")",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"getURL",
"(",
")",
";",
"$",
"title",
"=",
"(",
"$",
"this",
"->",
"Title",
")",
"?",
"$",
"this",... | Return an XHTML img tag for this Image,
or NULL if the image file doesn't exist on the filesystem.
@return string | [
"Return",
"an",
"XHTML",
"img",
"tag",
"for",
"this",
"Image",
"or",
"NULL",
"if",
"the",
"image",
"file",
"doesn",
"t",
"exist",
"on",
"the",
"filesystem",
"."
] | train | https://github.com/andrelohmann/silverstripe-extended-image/blob/178e9142ae8ff63f9bf36464093379f6e836b90b/code/models/SecureImage.php#L105-L118 |
andrelohmann/silverstripe-extended-image | code/models/SecureImage.php | SecureImage.getFormattedImage | public function getFormattedImage($format) {
$args = func_get_args();
if($this->exists()) {
$cacheFile = call_user_func_array(array($this, "cacheFilename"), $args);
if(!file_exists(Director::baseFolder()."/".$cacheFile) || self::$flush) {
call_user_func_array(array($this, "generateFormattedImage"), $arg... | php | public function getFormattedImage($format) {
$args = func_get_args();
if($this->exists()) {
$cacheFile = call_user_func_array(array($this, "cacheFilename"), $args);
if(!file_exists(Director::baseFolder()."/".$cacheFile) || self::$flush) {
call_user_func_array(array($this, "generateFormattedImage"), $arg... | [
"public",
"function",
"getFormattedImage",
"(",
"$",
"format",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"exists",
"(",
")",
")",
"{",
"$",
"cacheFile",
"=",
"call_user_func_array",
"(",
"array",
"(",
"$"... | Return an image object representing the image in the given format.
This image will be generated using generateFormattedImage().
The generated image is cached, to flush the cache append ?flush=1 to your URL.
@param string $format The name of the format.
@param string $arg1 An argument to pass to the generate function.
@... | [
"Return",
"an",
"image",
"object",
"representing",
"the",
"image",
"in",
"the",
"given",
"format",
".",
"This",
"image",
"will",
"be",
"generated",
"using",
"generateFormattedImage",
"()",
".",
"The",
"generated",
"image",
"is",
"cached",
"to",
"flush",
"the",... | train | https://github.com/andrelohmann/silverstripe-extended-image/blob/178e9142ae8ff63f9bf36464093379f6e836b90b/code/models/SecureImage.php#L130-L147 |
andrelohmann/silverstripe-extended-image | code/models/SecureImage.php | SecureImage.cacheFilename | public function cacheFilename($format) {
$args = func_get_args();
array_shift($args);
$folder = $this->ParentID ? $this->Parent()->Filename : ASSETS_DIR . "/";
$format = $format.implode('',$args);
$file = pathinfo($this->Name);
return $folder . "_resampled/".md5($format."-".$file['filename'... | php | public function cacheFilename($format) {
$args = func_get_args();
array_shift($args);
$folder = $this->ParentID ? $this->Parent()->Filename : ASSETS_DIR . "/";
$format = $format.implode('',$args);
$file = pathinfo($this->Name);
return $folder . "_resampled/".md5($format."-".$file['filename'... | [
"public",
"function",
"cacheFilename",
"(",
"$",
"format",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"array_shift",
"(",
"$",
"args",
")",
";",
"$",
"folder",
"=",
"$",
"this",
"->",
"ParentID",
"?",
"$",
"this",
"->",
"Parent",
"("... | Return the filename for the cached image, given it's format name and arguments.
@param string $format The format name.
@param string $arg1 The first argument passed to the generate function.
@param string $arg2 The second argument passed to the generate function.
@return string | [
"Return",
"the",
"filename",
"for",
"the",
"cached",
"image",
"given",
"it",
"s",
"format",
"name",
"and",
"arguments",
"."
] | train | https://github.com/andrelohmann/silverstripe-extended-image/blob/178e9142ae8ff63f9bf36464093379f6e836b90b/code/models/SecureImage.php#L156-L164 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseApiLogQuery.php | BaseApiLogQuery.create | public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof ApiLogQuery) {
return $criteria;
}
$query = new ApiLogQuery(null, null, $modelAlias);
if ($criteria instanceof Criteria) {
$query->mergeWith($criteria);
}
... | php | public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof ApiLogQuery) {
return $criteria;
}
$query = new ApiLogQuery(null, null, $modelAlias);
if ($criteria instanceof Criteria) {
$query->mergeWith($criteria);
}
... | [
"public",
"static",
"function",
"create",
"(",
"$",
"modelAlias",
"=",
"null",
",",
"$",
"criteria",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"criteria",
"instanceof",
"ApiLogQuery",
")",
"{",
"return",
"$",
"criteria",
";",
"}",
"$",
"query",
"=",
"new"... | Returns a new ApiLogQuery object.
@param string $modelAlias The alias of a model in the query
@param ApiLogQuery|Criteria $criteria Optional Criteria to build the query from
@return ApiLogQuery | [
"Returns",
"a",
"new",
"ApiLogQuery",
"object",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseApiLogQuery.php#L83-L95 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseApiLogQuery.php | BaseApiLogQuery.filterByDtCall | public function filterByDtCall($dtCall = null, $comparison = null)
{
if (is_array($dtCall)) {
$useMinMax = false;
if (isset($dtCall['min'])) {
$this->addUsingAlias(ApiLogPeer::DT_CALL, $dtCall['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
... | php | public function filterByDtCall($dtCall = null, $comparison = null)
{
if (is_array($dtCall)) {
$useMinMax = false;
if (isset($dtCall['min'])) {
$this->addUsingAlias(ApiLogPeer::DT_CALL, $dtCall['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
... | [
"public",
"function",
"filterByDtCall",
"(",
"$",
"dtCall",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"dtCall",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",
"dt... | Filter the query on the dt_call column
Example usage:
<code>
$query->filterByDtCall('2011-03-14'); // WHERE dt_call = '2011-03-14'
$query->filterByDtCall('now'); // WHERE dt_call = '2011-03-14'
$query->filterByDtCall(array('max' => 'yesterday')); // WHERE dt_call < '2011-03-13'
</code>
@param mixed $dtCall The va... | [
"Filter",
"the",
"query",
"on",
"the",
"dt_call",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseApiLogQuery.php#L310-L331 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseApiLogQuery.php | BaseApiLogQuery.filterByLastResponse | public function filterByLastResponse($lastResponse = null, $comparison = null)
{
return $this->addUsingAlias(ApiLogPeer::LAST_RESPONSE, $lastResponse, $comparison);
} | php | public function filterByLastResponse($lastResponse = null, $comparison = null)
{
return $this->addUsingAlias(ApiLogPeer::LAST_RESPONSE, $lastResponse, $comparison);
} | [
"public",
"function",
"filterByLastResponse",
"(",
"$",
"lastResponse",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"addUsingAlias",
"(",
"ApiLogPeer",
"::",
"LAST_RESPONSE",
",",
"$",
"lastResponse",
",",
"$",
"c... | Filter the query on the last_response column
@param mixed $lastResponse The value to use as filter
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return ApiLogQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"on",
"the",
"last_response",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseApiLogQuery.php#L427-L431 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseApiLogQuery.php | BaseApiLogQuery.filterByRemoteApp | public function filterByRemoteApp($remoteApp, $comparison = null)
{
if ($remoteApp instanceof RemoteApp) {
return $this
->addUsingAlias(ApiLogPeer::REMOTE_APP_ID, $remoteApp->getId(), $comparison);
} elseif ($remoteApp instanceof PropelObjectCollection) {
if (... | php | public function filterByRemoteApp($remoteApp, $comparison = null)
{
if ($remoteApp instanceof RemoteApp) {
return $this
->addUsingAlias(ApiLogPeer::REMOTE_APP_ID, $remoteApp->getId(), $comparison);
} elseif ($remoteApp instanceof PropelObjectCollection) {
if (... | [
"public",
"function",
"filterByRemoteApp",
"(",
"$",
"remoteApp",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"remoteApp",
"instanceof",
"RemoteApp",
")",
"{",
"return",
"$",
"this",
"->",
"addUsingAlias",
"(",
"ApiLogPeer",
"::",
"REMOTE_... | Filter the query by a related RemoteApp object
@param RemoteApp|PropelObjectCollection $remoteApp The related object(s) to use as filter
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return ApiLogQuery The current query, for fluid interface
@th... | [
"Filter",
"the",
"query",
"by",
"a",
"related",
"RemoteApp",
"object"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseApiLogQuery.php#L442-L457 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseApiLogQuery.php | BaseApiLogQuery.prune | public function prune($apiLog = null)
{
if ($apiLog) {
$this->addUsingAlias(ApiLogPeer::ID, $apiLog->getId(), Criteria::NOT_EQUAL);
}
return $this;
} | php | public function prune($apiLog = null)
{
if ($apiLog) {
$this->addUsingAlias(ApiLogPeer::ID, $apiLog->getId(), Criteria::NOT_EQUAL);
}
return $this;
} | [
"public",
"function",
"prune",
"(",
"$",
"apiLog",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"apiLog",
")",
"{",
"$",
"this",
"->",
"addUsingAlias",
"(",
"ApiLogPeer",
"::",
"ID",
",",
"$",
"apiLog",
"->",
"getId",
"(",
")",
",",
"Criteria",
"::",
"NO... | Exclude object from result
@param ApiLog $apiLog Object to remove from the list of results
@return ApiLogQuery The current query, for fluid interface | [
"Exclude",
"object",
"from",
"result"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseApiLogQuery.php#L516-L523 |
Double-Opt-in/php-client-api | src/Security/Crypter.php | Crypter.encrypt | public function encrypt($plaintext, $key)
{
// Set up encryption parameters.
$inputData = cryptoHelpers::convertStringToByteArray($plaintext);
$keyAsNumbers = cryptoHelpers::toNumbers(bin2hex($key));
$keyLength = count($keyAsNumbers);
$iv = cryptoHelpers::generateSharedKey(16);
$encrypted = AES::encrypt(
... | php | public function encrypt($plaintext, $key)
{
// Set up encryption parameters.
$inputData = cryptoHelpers::convertStringToByteArray($plaintext);
$keyAsNumbers = cryptoHelpers::toNumbers(bin2hex($key));
$keyLength = count($keyAsNumbers);
$iv = cryptoHelpers::generateSharedKey(16);
$encrypted = AES::encrypt(
... | [
"public",
"function",
"encrypt",
"(",
"$",
"plaintext",
",",
"$",
"key",
")",
"{",
"// Set up encryption parameters.",
"$",
"inputData",
"=",
"cryptoHelpers",
"::",
"convertStringToByteArray",
"(",
"$",
"plaintext",
")",
";",
"$",
"keyAsNumbers",
"=",
"cryptoHelpe... | encrypts the given plain text with a key
@param string $plaintext
@param string $key
@return string | [
"encrypts",
"the",
"given",
"plain",
"text",
"with",
"a",
"key"
] | train | https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Security/Crypter.php#L28-L49 |
Double-Opt-in/php-client-api | src/Security/Crypter.php | Crypter.decrypt | public function decrypt($encrypted, $key)
{
if (empty($encrypted))
return null;
list($identifier, $input) = explode(self::SEPARATOR_ALGORITHM, $encrypted, 2);
if ($identifier !== self::IDENTIFIER)
throw new Exception('Encryption can not be decrypted. Unsupported identifier: ' . $identifier);
// Split ... | php | public function decrypt($encrypted, $key)
{
if (empty($encrypted))
return null;
list($identifier, $input) = explode(self::SEPARATOR_ALGORITHM, $encrypted, 2);
if ($identifier !== self::IDENTIFIER)
throw new Exception('Encryption can not be decrypted. Unsupported identifier: ' . $identifier);
// Split ... | [
"public",
"function",
"decrypt",
"(",
"$",
"encrypted",
",",
"$",
"key",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"encrypted",
")",
")",
"return",
"null",
";",
"list",
"(",
"$",
"identifier",
",",
"$",
"input",
")",
"=",
"explode",
"(",
"self",
"::"... | decrypts a message
@param string $encrypted
@param string $key
@return string
@throws Exception | [
"decrypts",
"a",
"message"
] | train | https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Security/Crypter.php#L60-L95 |
ClanCats/Core | src/bundles/Mail/PHPMailer/class.phpmailer.php | PHPMailer.edebug | protected function edebug($str)
{
if (!$this->SMTPDebug) {
return;
}
switch ($this->Debugoutput) {
case 'error_log':
error_log($str);
break;
case 'html':
//Cleans up output a bit for a better looking display ... | php | protected function edebug($str)
{
if (!$this->SMTPDebug) {
return;
}
switch ($this->Debugoutput) {
case 'error_log':
error_log($str);
break;
case 'html':
//Cleans up output a bit for a better looking display ... | [
"protected",
"function",
"edebug",
"(",
"$",
"str",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"SMTPDebug",
")",
"{",
"return",
";",
"}",
"switch",
"(",
"$",
"this",
"->",
"Debugoutput",
")",
"{",
"case",
"'error_log'",
":",
"error_log",
"(",
"$",
... | Output debugging info via user-defined method.
Only if debug output is enabled.
@see PHPMailer::$Debugoutput
@see PHPMailer::$SMTPDebug
@param string $str | [
"Output",
"debugging",
"info",
"via",
"user",
"-",
"defined",
"method",
".",
"Only",
"if",
"debug",
"output",
"is",
"enabled",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.phpmailer.php#L629-L646 |
ClanCats/Core | src/bundles/Mail/PHPMailer/class.phpmailer.php | PHPMailer.preSend | public function preSend()
{
try {
$this->mailHeader = '';
if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {
throw new phpmailerException($this->lang('provide_address'), self::STOP_CRITICAL);
}
// Set whether the message is m... | php | public function preSend()
{
try {
$this->mailHeader = '';
if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {
throw new phpmailerException($this->lang('provide_address'), self::STOP_CRITICAL);
}
// Set whether the message is m... | [
"public",
"function",
"preSend",
"(",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"mailHeader",
"=",
"''",
";",
"if",
"(",
"(",
"count",
"(",
"$",
"this",
"->",
"to",
")",
"+",
"count",
"(",
"$",
"this",
"->",
"cc",
")",
"+",
"count",
"(",
"$",
... | Prepare a message for sending.
@throws phpmailerException
@return boolean | [
"Prepare",
"a",
"message",
"for",
"sending",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.phpmailer.php#L962-L1022 |
ClanCats/Core | src/bundles/Mail/PHPMailer/class.phpmailer.php | PHPMailer.createHeader | public function createHeader()
{
$result = '';
// Set the boundaries
$uniq_id = md5(uniqid(time()));
$this->boundary[1] = 'b1_' . $uniq_id;
$this->boundary[2] = 'b2_' . $uniq_id;
$this->boundary[3] = 'b3_' . $uniq_id;
if ($this->MessageDate == '') {
... | php | public function createHeader()
{
$result = '';
// Set the boundaries
$uniq_id = md5(uniqid(time()));
$this->boundary[1] = 'b1_' . $uniq_id;
$this->boundary[2] = 'b2_' . $uniq_id;
$this->boundary[3] = 'b3_' . $uniq_id;
if ($this->MessageDate == '') {
... | [
"public",
"function",
"createHeader",
"(",
")",
"{",
"$",
"result",
"=",
"''",
";",
"// Set the boundaries",
"$",
"uniq_id",
"=",
"md5",
"(",
"uniqid",
"(",
"time",
"(",
")",
")",
")",
";",
"$",
"this",
"->",
"boundary",
"[",
"1",
"]",
"=",
"'b1_'",
... | Assemble message headers.
@access public
@return string The assembled headers | [
"Assemble",
"message",
"headers",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.phpmailer.php#L1623-L1717 |
ClanCats/Core | src/bundles/Mail/PHPMailer/class.phpmailer.php | PHPMailer.setMessageType | protected function setMessageType()
{
$this->message_type = array();
if ($this->alternativeExists()) {
$this->message_type[] = 'alt';
}
if ($this->inlineImageExists()) {
$this->message_type[] = 'inline';
}
if ($this->attachmentExists()) {
... | php | protected function setMessageType()
{
$this->message_type = array();
if ($this->alternativeExists()) {
$this->message_type[] = 'alt';
}
if ($this->inlineImageExists()) {
$this->message_type[] = 'inline';
}
if ($this->attachmentExists()) {
... | [
"protected",
"function",
"setMessageType",
"(",
")",
"{",
"$",
"this",
"->",
"message_type",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"alternativeExists",
"(",
")",
")",
"{",
"$",
"this",
"->",
"message_type",
"[",
"]",
"=",
"'alt'",
... | Set the message type.
PHPMailer only supports some preset message types,
not arbitrary MIME structures.
@access protected
@return void | [
"Set",
"the",
"message",
"type",
".",
"PHPMailer",
"only",
"supports",
"some",
"preset",
"message",
"types",
"not",
"arbitrary",
"MIME",
"structures",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.phpmailer.php#L1998-L2014 |
ClanCats/Core | src/bundles/Mail/PHPMailer/class.phpmailer.php | PHPMailer.addAttachment | public function addAttachment($path, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment')
{
try {
if (!@is_file($path)) {
throw new phpmailerException($this->lang('file_access') . $path, self::STOP_CONTINUE);
}
// If a MIME type is n... | php | public function addAttachment($path, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment')
{
try {
if (!@is_file($path)) {
throw new phpmailerException($this->lang('file_access') . $path, self::STOP_CONTINUE);
}
// If a MIME type is n... | [
"public",
"function",
"addAttachment",
"(",
"$",
"path",
",",
"$",
"name",
"=",
"''",
",",
"$",
"encoding",
"=",
"'base64'",
",",
"$",
"type",
"=",
"''",
",",
"$",
"disposition",
"=",
"'attachment'",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"@",
"is_f... | Add an attachment from a path on the filesystem.
Returns false if the file could not be found or read.
@param string $path Path to the attachment.
@param string $name Overrides the attachment name.
@param string $encoding File encoding (see $Encoding).
@param string $type File extension (MIME) type.
@param string $disp... | [
"Add",
"an",
"attachment",
"from",
"a",
"path",
"on",
"the",
"filesystem",
".",
"Returns",
"false",
"if",
"the",
"file",
"could",
"not",
"be",
"found",
"or",
"read",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.phpmailer.php#L2050-L2087 |
ClanCats/Core | src/bundles/Mail/PHPMailer/class.phpmailer.php | PHPMailer.encodeQ | public function encodeQ($str, $position = 'text')
{
// There should not be any EOL in the string
$pattern = '';
$encoded = str_replace(array("\r", "\n"), '', $str);
switch (strtolower($position)) {
case 'phrase':
// RFC 2047 section 5.3
$pa... | php | public function encodeQ($str, $position = 'text')
{
// There should not be any EOL in the string
$pattern = '';
$encoded = str_replace(array("\r", "\n"), '', $str);
switch (strtolower($position)) {
case 'phrase':
// RFC 2047 section 5.3
$pa... | [
"public",
"function",
"encodeQ",
"(",
"$",
"str",
",",
"$",
"position",
"=",
"'text'",
")",
"{",
"// There should not be any EOL in the string",
"$",
"pattern",
"=",
"''",
";",
"$",
"encoded",
"=",
"str_replace",
"(",
"array",
"(",
"\"\\r\"",
",",
"\"\\n\"",
... | Encode a string using Q encoding.
@link http://tools.ietf.org/html/rfc2047
@param string $str the text to encode
@param string $position Where the text is going to be used, see the RFC for what that means
@access public
@return string | [
"Encode",
"a",
"string",
"using",
"Q",
"encoding",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.phpmailer.php#L2466-L2504 |
ClanCats/Core | src/bundles/Mail/PHPMailer/class.phpmailer.php | PHPMailer.html2text | public function html2text($html, $advanced = false)
{
if ($advanced) {
require_once 'extras/class.html2text.php';
$htmlconverter = new html2text($html);
return $htmlconverter->get_text();
}
return html_entity_decode(
trim(strip_tags(preg_replac... | php | public function html2text($html, $advanced = false)
{
if ($advanced) {
require_once 'extras/class.html2text.php';
$htmlconverter = new html2text($html);
return $htmlconverter->get_text();
}
return html_entity_decode(
trim(strip_tags(preg_replac... | [
"public",
"function",
"html2text",
"(",
"$",
"html",
",",
"$",
"advanced",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"advanced",
")",
"{",
"require_once",
"'extras/class.html2text.php'",
";",
"$",
"htmlconverter",
"=",
"new",
"html2text",
"(",
"$",
"html",
"... | Convert an HTML string into plain text.
@param string $html The HTML text to convert
@param boolean $advanced Should this use the more complex html2text converter or just a simple one?
@return string | [
"Convert",
"an",
"HTML",
"string",
"into",
"plain",
"text",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.phpmailer.php#L2926-L2938 |
ClanCats/Core | src/bundles/Mail/PHPMailer/class.phpmailer.php | PHPMailer._mime_types | public static function _mime_types($ext = '')
{
$mimes = array(
'xl' => 'application/excel',
'hqx' => 'application/mac-binhex40',
'cpt' => 'application/mac-compactpro',
'bin' => 'application/macbinary',
'doc' => 'application/msword',
'w... | php | public static function _mime_types($ext = '')
{
$mimes = array(
'xl' => 'application/excel',
'hqx' => 'application/mac-binhex40',
'cpt' => 'application/mac-compactpro',
'bin' => 'application/macbinary',
'doc' => 'application/msword',
'w... | [
"public",
"static",
"function",
"_mime_types",
"(",
"$",
"ext",
"=",
"''",
")",
"{",
"$",
"mimes",
"=",
"array",
"(",
"'xl'",
"=>",
"'application/excel'",
",",
"'hqx'",
"=>",
"'application/mac-binhex40'",
",",
"'cpt'",
"=>",
"'application/mac-compactpro'",
",",
... | Get the MIME type for a file extension.
@param string $ext File extension
@access public
@return string MIME type of file.
@static | [
"Get",
"the",
"MIME",
"type",
"for",
"a",
"file",
"extension",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.phpmailer.php#L2947-L3040 |
ClanCats/Core | src/bundles/Mail/PHPMailer/class.phpmailer.php | PHPMailer.filenameToType | public static function filenameToType($filename)
{
// In case the path is a URL, strip any query string before getting extension
$qpos = strpos($filename, '?');
if ($qpos !== false) {
$filename = substr($filename, 0, $qpos);
}
$pathinfo = self::mb_pathinfo($filena... | php | public static function filenameToType($filename)
{
// In case the path is a URL, strip any query string before getting extension
$qpos = strpos($filename, '?');
if ($qpos !== false) {
$filename = substr($filename, 0, $qpos);
}
$pathinfo = self::mb_pathinfo($filena... | [
"public",
"static",
"function",
"filenameToType",
"(",
"$",
"filename",
")",
"{",
"// In case the path is a URL, strip any query string before getting extension",
"$",
"qpos",
"=",
"strpos",
"(",
"$",
"filename",
",",
"'?'",
")",
";",
"if",
"(",
"$",
"qpos",
"!==",
... | Map a file name to a MIME type.
Defaults to 'application/octet-stream', i.e.. arbitrary binary data.
@param string $filename A file name or full path, does not need to exist as a file
@return string
@static | [
"Map",
"a",
"file",
"name",
"to",
"a",
"MIME",
"type",
".",
"Defaults",
"to",
"application",
"/",
"octet",
"-",
"stream",
"i",
".",
"e",
"..",
"arbitrary",
"binary",
"data",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.phpmailer.php#L3049-L3058 |
ClanCats/Core | src/bundles/Mail/PHPMailer/class.phpmailer.php | PHPMailer.set | public function set($name, $value = '')
{
try {
if (isset($this->$name)) {
$this->$name = $value;
} else {
throw new phpmailerException($this->lang('variable_set') . $name, self::STOP_CRITICAL);
}
} catch (Exception $exc) {
... | php | public function set($name, $value = '')
{
try {
if (isset($this->$name)) {
$this->$name = $value;
} else {
throw new phpmailerException($this->lang('variable_set') . $name, self::STOP_CRITICAL);
}
} catch (Exception $exc) {
... | [
"public",
"function",
"set",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"''",
")",
"{",
"try",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"$",
"name",
")",
")",
"{",
"$",
"this",
"->",
"$",
"name",
"=",
"$",
"value",
";",
"}",
"else",
... | Set or reset instance properties.
Usage Example:
$page->set('X-Priority', '3');
@access public
@param string $name
@param mixed $value
NOTE: will not work with arrays, there are no arrays to set/reset
@throws phpmailerException
@return boolean
@TODO Should this not be using __set() magic function? | [
"Set",
"or",
"reset",
"instance",
"properties",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.phpmailer.php#L3121-L3136 |
webtown-php/KunstmaanExtensionBundle | src/Entity/PageParts/InsertPagePagePart.php | InsertPagePagePart.setNode | public function setNode(\Kunstmaan\NodeBundle\Entity\Node $node = null)
{
$this->node = $node;
return $this;
} | php | public function setNode(\Kunstmaan\NodeBundle\Entity\Node $node = null)
{
$this->node = $node;
return $this;
} | [
"public",
"function",
"setNode",
"(",
"\\",
"Kunstmaan",
"\\",
"NodeBundle",
"\\",
"Entity",
"\\",
"Node",
"$",
"node",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"node",
"=",
"$",
"node",
";",
"return",
"$",
"this",
";",
"}"
] | Set node
@param \Kunstmaan\NodeBundle\Entity\Node $node
@return InsertPagePagePart | [
"Set",
"node"
] | train | https://github.com/webtown-php/KunstmaanExtensionBundle/blob/86c656c131295fe1f3f7694fd4da1e5e454076b9/src/Entity/PageParts/InsertPagePagePart.php#L32-L37 |
ClanCats/Core | src/classes/ClanCats.php | ClanCats.runtime | public static function runtime( $fnc = null, $params = array() )
{
if ( is_null( $fnc ) )
{
return static::$runtime_class;
}
return call_user_func_array( array( static::$runtime_class, $fnc ), $params );
} | php | public static function runtime( $fnc = null, $params = array() )
{
if ( is_null( $fnc ) )
{
return static::$runtime_class;
}
return call_user_func_array( array( static::$runtime_class, $fnc ), $params );
} | [
"public",
"static",
"function",
"runtime",
"(",
"$",
"fnc",
"=",
"null",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"fnc",
")",
")",
"{",
"return",
"static",
"::",
"$",
"runtime_class",
";",
"}",
"return",... | get the current runtime class name
or execute an function on the runtime class
@return string | [
"get",
"the",
"current",
"runtime",
"class",
"name",
"or",
"execute",
"an",
"function",
"on",
"the",
"runtime",
"class"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/ClanCats.php#L111-L119 |
ClanCats/Core | src/classes/ClanCats.php | ClanCats.paths | public static function paths( $paths = null, $define = true )
{
if ( is_null( $paths ) )
{
return static::$paths;
}
foreach( $paths as $key => $path )
{
static::$paths[$key] = $path;
if ( $define === true )
{
define( strtoupper( $key ).'PATH', $path );
}
}
} | php | public static function paths( $paths = null, $define = true )
{
if ( is_null( $paths ) )
{
return static::$paths;
}
foreach( $paths as $key => $path )
{
static::$paths[$key] = $path;
if ( $define === true )
{
define( strtoupper( $key ).'PATH', $path );
}
}
} | [
"public",
"static",
"function",
"paths",
"(",
"$",
"paths",
"=",
"null",
",",
"$",
"define",
"=",
"true",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"paths",
")",
")",
"{",
"return",
"static",
"::",
"$",
"paths",
";",
"}",
"foreach",
"(",
"$",
"pa... | paths getter and setter
when paths empty:
return all registerd paths
when paths an array:
adds paths to the index and optional create a define.
@param array $paths
@param bool $define
@return array|void | [
"paths",
"getter",
"and",
"setter"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/ClanCats.php#L162-L178 |
ClanCats/Core | src/classes/ClanCats.php | ClanCats.directories | public static function directories( $dirs = null, $define = true )
{
if ( is_null( $dirs ) )
{
return static::$directories;
}
foreach( $dirs as $key => $dir )
{
static::$directories[$key] = $dir;
if ( $define === true )
{
define( 'CCDIR_'.strtoupper( $key ), $dir );
}
}
} | php | public static function directories( $dirs = null, $define = true )
{
if ( is_null( $dirs ) )
{
return static::$directories;
}
foreach( $dirs as $key => $dir )
{
static::$directories[$key] = $dir;
if ( $define === true )
{
define( 'CCDIR_'.strtoupper( $key ), $dir );
}
}
} | [
"public",
"static",
"function",
"directories",
"(",
"$",
"dirs",
"=",
"null",
",",
"$",
"define",
"=",
"true",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"dirs",
")",
")",
"{",
"return",
"static",
"::",
"$",
"directories",
";",
"}",
"foreach",
"(",
... | directories getter and setter
when dirs empty:
return all registerd directories
when dirs an array:
adds directories to the index and optional create a define.
@param array $paths
@param bool $define
@return array|void | [
"directories",
"getter",
"and",
"setter"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/ClanCats.php#L193-L209 |
ClanCats/Core | src/classes/ClanCats.php | ClanCats.environment_detector | public static function environment_detector( $env )
{
$detected_environment = 'development';
if ( isset( $env ) && !empty( $env ) )
{
if ( is_string( $env ) )
{
$detected_environment = $env;
}
elseif ( is_array( $env ) )
{
if ( isset( $env[':all'] ) )
{
$detected_environment = ... | php | public static function environment_detector( $env )
{
$detected_environment = 'development';
if ( isset( $env ) && !empty( $env ) )
{
if ( is_string( $env ) )
{
$detected_environment = $env;
}
elseif ( is_array( $env ) )
{
if ( isset( $env[':all'] ) )
{
$detected_environment = ... | [
"public",
"static",
"function",
"environment_detector",
"(",
"$",
"env",
")",
"{",
"$",
"detected_environment",
"=",
"'development'",
";",
"if",
"(",
"isset",
"(",
"$",
"env",
")",
"&&",
"!",
"empty",
"(",
"$",
"env",
")",
")",
"{",
"if",
"(",
"is_stri... | Detect the environment by the given parameter.
You can pass arrays, strings and callbacks:
array:
// if you pass an array the detector is going
// to try to match the HTTP_HOST as key.
array( 'localhost' => 'development', ':all' => 'production' )
string:
return 'staging'
callback:
function() { return $_SERVER['CCF_E... | [
"Detect",
"the",
"environment",
"by",
"the",
"given",
"parameter",
".",
"You",
"can",
"pass",
"arrays",
"strings",
"and",
"callbacks",
":"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/ClanCats.php#L247-L281 |
ClanCats/Core | src/classes/ClanCats.php | ClanCats.wake | public static function wake( $environment )
{
if ( !is_null( static::$environment ) )
{
throw new CCException( "ClanCats::wake - you cannot wake the application twice." );
}
// set environment
static::$environment = $environment;
// load the main configuration
static::$config = CCConfig::creat... | php | public static function wake( $environment )
{
if ( !is_null( static::$environment ) )
{
throw new CCException( "ClanCats::wake - you cannot wake the application twice." );
}
// set environment
static::$environment = $environment;
// load the main configuration
static::$config = CCConfig::creat... | [
"public",
"static",
"function",
"wake",
"(",
"$",
"environment",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"static",
"::",
"$",
"environment",
")",
")",
"{",
"throw",
"new",
"CCException",
"(",
"\"ClanCats::wake - you cannot wake the application twice.\"",
")",
... | start the ccf lifecycle
this method sets the current environment, loads the configuration
and wakes the application
@param string $environment
@return void | [
"start",
"the",
"ccf",
"lifecycle"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/ClanCats.php#L292-L322 |
ClanCats/Core | src/classes/ClanCats.php | ClanCats.wake_app | public static function wake_app( $app )
{
static::$runtime_class = $app;
\CCFinder::bind( $app, static::$paths['app'].$app.EXT );
// run the application wake
$response = $app::wake();
// when the application wake returns an response we display it
if ( $response instanceof CCResponse ) {
if ( stati... | php | public static function wake_app( $app )
{
static::$runtime_class = $app;
\CCFinder::bind( $app, static::$paths['app'].$app.EXT );
// run the application wake
$response = $app::wake();
// when the application wake returns an response we display it
if ( $response instanceof CCResponse ) {
if ( stati... | [
"public",
"static",
"function",
"wake_app",
"(",
"$",
"app",
")",
"{",
"static",
"::",
"$",
"runtime_class",
"=",
"$",
"app",
";",
"\\",
"CCFinder",
"::",
"bind",
"(",
"$",
"app",
",",
"static",
"::",
"$",
"paths",
"[",
"'app'",
"]",
".",
"$",
"app... | start the ccf app lifecycle
This method registers the App class and runs the wake events.
@param string $app The used app class = APPATH/<$app>.php
@return void | [
"start",
"the",
"ccf",
"app",
"lifecycle"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/ClanCats.php#L332-L364 |
qcubed/orm | src/Query/Node/Column.php | Column.join | public function join(
Builder $objBuilder,
$blnExpandSelection = false,
iCondition $objJoinCondition = null,
Clause\Select $objSelect = null
) {
$objParentNode = $this->objParentNode;
if (!$objParentNode) {
throw new Caller('A column node must have a paren... | php | public function join(
Builder $objBuilder,
$blnExpandSelection = false,
iCondition $objJoinCondition = null,
Clause\Select $objSelect = null
) {
$objParentNode = $this->objParentNode;
if (!$objParentNode) {
throw new Caller('A column node must have a paren... | [
"public",
"function",
"join",
"(",
"Builder",
"$",
"objBuilder",
",",
"$",
"blnExpandSelection",
"=",
"false",
",",
"iCondition",
"$",
"objJoinCondition",
"=",
"null",
",",
"Clause",
"\\",
"Select",
"$",
"objSelect",
"=",
"null",
")",
"{",
"$",
"objParentNod... | Join the node to the given query. Since this is a leaf node, we pass on the join to the parent.
@param Builder $objBuilder
@param bool $blnExpandSelection
@param iCondition|null $objJoinCondition
@param Clause\Select|null $objSelect
@throws Caller | [
"Join",
"the",
"node",
"to",
"the",
"given",
"query",
".",
"Since",
"this",
"is",
"a",
"leaf",
"node",
"we",
"pass",
"on",
"the",
"join",
"to",
"the",
"parent",
"."
] | train | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Query/Node/Column.php#L96-L109 |
qcubed/orm | src/Query/Node/Column.php | Column.getAsManualSqlColumn | public function getAsManualSqlColumn()
{
if ($this->strTableName) {
return $this->strTableName . '.' . $this->strName;
} else {
if (($this->objParentNode) && ($this->objParentNode->strTableName)) {
return $this->objParentNode->strTableName . '.' . $this->strNa... | php | public function getAsManualSqlColumn()
{
if ($this->strTableName) {
return $this->strTableName . '.' . $this->strName;
} else {
if (($this->objParentNode) && ($this->objParentNode->strTableName)) {
return $this->objParentNode->strTableName . '.' . $this->strNa... | [
"public",
"function",
"getAsManualSqlColumn",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"strTableName",
")",
"{",
"return",
"$",
"this",
"->",
"strTableName",
".",
"'.'",
".",
"$",
"this",
"->",
"strName",
";",
"}",
"else",
"{",
"if",
"(",
"(",
"$... | Get the unaliased column name. For special situations, like order by, since you can't order by aliases.
@return string | [
"Get",
"the",
"unaliased",
"column",
"name",
".",
"For",
"special",
"situations",
"like",
"order",
"by",
"since",
"you",
"can",
"t",
"order",
"by",
"aliases",
"."
] | train | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Query/Node/Column.php#L115-L126 |
aedart/laravel-helpers | src/Traits/Routing/RouteTrait.php | RouteTrait.getRoute | public function getRoute(): ?Registrar
{
if (!$this->hasRoute()) {
$this->setRoute($this->getDefaultRoute());
}
return $this->route;
} | php | public function getRoute(): ?Registrar
{
if (!$this->hasRoute()) {
$this->setRoute($this->getDefaultRoute());
}
return $this->route;
} | [
"public",
"function",
"getRoute",
"(",
")",
":",
"?",
"Registrar",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasRoute",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setRoute",
"(",
"$",
"this",
"->",
"getDefaultRoute",
"(",
")",
")",
";",
"}",
"return",
... | Get route
If no route has been set, this method will
set and return a default route, if any such
value is available
@see getDefaultRoute()
@return Registrar|null route or null if none route has been set | [
"Get",
"route"
] | train | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Routing/RouteTrait.php#L53-L59 |
meccado/acl-admin-control-panel | src/Http/Controllers/Admin/AdminController.php | AdminController.index | public function index()
{
$user = \App\User::with('profile')->findOrFail(\Auth::user()->id);
return \View::make('acl::admin.dashboard', [
'user' => $user,
'title' => 'list',
]);
} | php | public function index()
{
$user = \App\User::with('profile')->findOrFail(\Auth::user()->id);
return \View::make('acl::admin.dashboard', [
'user' => $user,
'title' => 'list',
]);
} | [
"public",
"function",
"index",
"(",
")",
"{",
"$",
"user",
"=",
"\\",
"App",
"\\",
"User",
"::",
"with",
"(",
"'profile'",
")",
"->",
"findOrFail",
"(",
"\\",
"Auth",
"::",
"user",
"(",
")",
"->",
"id",
")",
";",
"return",
"\\",
"View",
"::",
"ma... | \Illuminate\Routing\Router $router | [
"\\",
"Illuminate",
"\\",
"Routing",
"\\",
"Router",
"$router"
] | train | https://github.com/meccado/acl-admin-control-panel/blob/50ac4c0dbf8bd49944ecad6a70708a70411b7378/src/Http/Controllers/Admin/AdminController.php#L31-L38 |
meccado/acl-admin-control-panel | src/Http/Controllers/Admin/AdminController.php | AdminController.getUserRolePermissions | public function getUserRolePermissions()
{
$roles = Role::select('id', 'name', 'label')->get();
$permissions = Permission::select('id', 'name', 'label')->get();
return \View::make('admin.permissions.role-assign-permissions', [
'roles' => $roles,
'permissions' => $permissi... | php | public function getUserRolePermissions()
{
$roles = Role::select('id', 'name', 'label')->get();
$permissions = Permission::select('id', 'name', 'label')->get();
return \View::make('admin.permissions.role-assign-permissions', [
'roles' => $roles,
'permissions' => $permissi... | [
"public",
"function",
"getUserRolePermissions",
"(",
")",
"{",
"$",
"roles",
"=",
"Role",
"::",
"select",
"(",
"'id'",
",",
"'name'",
",",
"'label'",
")",
"->",
"get",
"(",
")",
";",
"$",
"permissions",
"=",
"Permission",
"::",
"select",
"(",
"'id'",
"... | Display given permissions to role.
@return void | [
"Display",
"given",
"permissions",
"to",
"role",
"."
] | train | https://github.com/meccado/acl-admin-control-panel/blob/50ac4c0dbf8bd49944ecad6a70708a70411b7378/src/Http/Controllers/Admin/AdminController.php#L45-L54 |
meccado/acl-admin-control-panel | src/Http/Controllers/Admin/AdminController.php | AdminController.postUserRolePermissions | public function postUserRolePermissions(Request $request)
{
$this->validate($request, ['role' => 'required', 'permissions' => 'required']);
$role = Role::with('permissions')->whereName($request->role)->first();
$role->permissions()->detach();
foreach ($request->permissions as $permission_name) {
... | php | public function postUserRolePermissions(Request $request)
{
$this->validate($request, ['role' => 'required', 'permissions' => 'required']);
$role = Role::with('permissions')->whereName($request->role)->first();
$role->permissions()->detach();
foreach ($request->permissions as $permission_name) {
... | [
"public",
"function",
"postUserRolePermissions",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"validate",
"(",
"$",
"request",
",",
"[",
"'role'",
"=>",
"'required'",
",",
"'permissions'",
"=>",
"'required'",
"]",
")",
";",
"$",
"role",
"="... | Store given permissions to role.
@param \Illuminate\Http\Request $request
@return void | [
"Store",
"given",
"permissions",
"to",
"role",
"."
] | train | https://github.com/meccado/acl-admin-control-panel/blob/50ac4c0dbf8bd49944ecad6a70708a70411b7378/src/Http/Controllers/Admin/AdminController.php#L64-L76 |
kherge-abandoned/php-wise | src/lib/Herrera/Wise/Wise.php | Wise.create | public static function create($paths, $cache = null, $debug = false)
{
$wise = new self($debug);
if ($cache) {
$wise->setCacheDir($cache);
}
$locator = new FileLocator($paths);
$resolver = new LoaderResolver(
array(
new Loader\IniFile... | php | public static function create($paths, $cache = null, $debug = false)
{
$wise = new self($debug);
if ($cache) {
$wise->setCacheDir($cache);
}
$locator = new FileLocator($paths);
$resolver = new LoaderResolver(
array(
new Loader\IniFile... | [
"public",
"static",
"function",
"create",
"(",
"$",
"paths",
",",
"$",
"cache",
"=",
"null",
",",
"$",
"debug",
"=",
"false",
")",
"{",
"$",
"wise",
"=",
"new",
"self",
"(",
"$",
"debug",
")",
";",
"if",
"(",
"$",
"cache",
")",
"{",
"$",
"wise"... | Creates a pre-configured instance of Wise.
@param array|string $paths The configuration directory path(s).
@param string $cache The cache directory path.
@param boolean $debug Enable debugging?
@return Wise The instance. | [
"Creates",
"a",
"pre",
"-",
"configured",
"instance",
"of",
"Wise",
"."
] | train | https://github.com/kherge-abandoned/php-wise/blob/7621e0be7dbb2a015d68197d290fe8469f539a4d/src/lib/Herrera/Wise/Wise.php#L90-L116 |
kherge-abandoned/php-wise | src/lib/Herrera/Wise/Wise.php | Wise.load | public function load($resource, $type = null, $require = false)
{
if (null === $this->loader) {
throw new LogicException('No loader has been configured.');
}
if (false === $this->loader->supports($resource, $type)) {
throw LoaderException::format(
'Th... | php | public function load($resource, $type = null, $require = false)
{
if (null === $this->loader) {
throw new LogicException('No loader has been configured.');
}
if (false === $this->loader->supports($resource, $type)) {
throw LoaderException::format(
'Th... | [
"public",
"function",
"load",
"(",
"$",
"resource",
",",
"$",
"type",
"=",
"null",
",",
"$",
"require",
"=",
"false",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"loader",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'No loader has been... | Loads the configuration data from a resource.
@param mixed $resource A resource.
@param string $type The resource type.
@param boolean $require Require processing?
@return array The data.
@throws LoaderException If the loader could not be used.
@throws LogicException If no loader has been configured. | [
"Loads",
"the",
"configuration",
"data",
"from",
"a",
"resource",
"."
] | train | https://github.com/kherge-abandoned/php-wise/blob/7621e0be7dbb2a015d68197d290fe8469f539a4d/src/lib/Herrera/Wise/Wise.php#L190-L239 |
kherge-abandoned/php-wise | src/lib/Herrera/Wise/Wise.php | Wise.loadFlat | public function loadFlat($resource, $type = null, $require = false)
{
return ArrayUtil::flatten($this->load($resource, $type, $require));
} | php | public function loadFlat($resource, $type = null, $require = false)
{
return ArrayUtil::flatten($this->load($resource, $type, $require));
} | [
"public",
"function",
"loadFlat",
"(",
"$",
"resource",
",",
"$",
"type",
"=",
"null",
",",
"$",
"require",
"=",
"false",
")",
"{",
"return",
"ArrayUtil",
"::",
"flatten",
"(",
"$",
"this",
"->",
"load",
"(",
"$",
"resource",
",",
"$",
"type",
",",
... | Loads the configuration data from a resource and returns it flattened.
@param mixed $resource A resource.
@param string $type The resource type.
@param boolean $require Require processing?
@return array The data. | [
"Loads",
"the",
"configuration",
"data",
"from",
"a",
"resource",
"and",
"returns",
"it",
"flattened",
"."
] | train | https://github.com/kherge-abandoned/php-wise/blob/7621e0be7dbb2a015d68197d290fe8469f539a4d/src/lib/Herrera/Wise/Wise.php#L250-L253 |
kherge-abandoned/php-wise | src/lib/Herrera/Wise/Wise.php | Wise.setCollector | public function setCollector(ResourceCollectorInterface $collector)
{
$this->collector = $collector;
if ($this->loader) {
if ($this->loader instanceof ResourceAwareInterface) {
$this->loader->setResourceCollector($collector);
}
if ($this->loader ... | php | public function setCollector(ResourceCollectorInterface $collector)
{
$this->collector = $collector;
if ($this->loader) {
if ($this->loader instanceof ResourceAwareInterface) {
$this->loader->setResourceCollector($collector);
}
if ($this->loader ... | [
"public",
"function",
"setCollector",
"(",
"ResourceCollectorInterface",
"$",
"collector",
")",
"{",
"$",
"this",
"->",
"collector",
"=",
"$",
"collector",
";",
"if",
"(",
"$",
"this",
"->",
"loader",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"loader",
"in... | Sets the resource collector.
@param ResourceCollectorInterface $collector The collector. | [
"Sets",
"the",
"resource",
"collector",
"."
] | train | https://github.com/kherge-abandoned/php-wise/blob/7621e0be7dbb2a015d68197d290fe8469f539a4d/src/lib/Herrera/Wise/Wise.php#L270-L287 |
kherge-abandoned/php-wise | src/lib/Herrera/Wise/Wise.php | Wise.setGlobalParameters | public function setGlobalParameters($parameters)
{
if (!is_array($parameters) && !($parameters instanceof ArrayAccess)) {
throw new InvalidArgumentException(
'The $parameters argument must be an array or array accessible object.'
);
}
$this->parameter... | php | public function setGlobalParameters($parameters)
{
if (!is_array($parameters) && !($parameters instanceof ArrayAccess)) {
throw new InvalidArgumentException(
'The $parameters argument must be an array or array accessible object.'
);
}
$this->parameter... | [
"public",
"function",
"setGlobalParameters",
"(",
"$",
"parameters",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"parameters",
")",
"&&",
"!",
"(",
"$",
"parameters",
"instanceof",
"ArrayAccess",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
... | Sets a list of global parameters.
@param array|ArrayAccess $parameters The parameters.
@throws InvalidArgumentException If $parameters is invalid. | [
"Sets",
"a",
"list",
"of",
"global",
"parameters",
"."
] | train | https://github.com/kherge-abandoned/php-wise/blob/7621e0be7dbb2a015d68197d290fe8469f539a4d/src/lib/Herrera/Wise/Wise.php#L296-L305 |
kherge-abandoned/php-wise | src/lib/Herrera/Wise/Wise.php | Wise.setLoader | public function setLoader(LoaderInterface $loader)
{
$this->loader = $loader;
if ($this->collector && ($loader instanceof ResourceAwareInterface)) {
$loader->setResourceCollector($this->collector);
}
if ($loader instanceof WiseAwareInterface) {
$loader->setW... | php | public function setLoader(LoaderInterface $loader)
{
$this->loader = $loader;
if ($this->collector && ($loader instanceof ResourceAwareInterface)) {
$loader->setResourceCollector($this->collector);
}
if ($loader instanceof WiseAwareInterface) {
$loader->setW... | [
"public",
"function",
"setLoader",
"(",
"LoaderInterface",
"$",
"loader",
")",
"{",
"$",
"this",
"->",
"loader",
"=",
"$",
"loader",
";",
"if",
"(",
"$",
"this",
"->",
"collector",
"&&",
"(",
"$",
"loader",
"instanceof",
"ResourceAwareInterface",
")",
")",... | Sets a configuration loader.
@param LoaderInterface $loader A loader. | [
"Sets",
"a",
"configuration",
"loader",
"."
] | train | https://github.com/kherge-abandoned/php-wise/blob/7621e0be7dbb2a015d68197d290fe8469f539a4d/src/lib/Herrera/Wise/Wise.php#L312-L336 |
kherge-abandoned/php-wise | src/lib/Herrera/Wise/Wise.php | Wise.process | private function process(array $data, $resource, $type, $require)
{
if ($this->processor) {
if ($this->processor instanceof ProcessorInterface) {
if ($this->processor->supports($resource, $type)) {
$data = $this->processor->process($data);
} el... | php | private function process(array $data, $resource, $type, $require)
{
if ($this->processor) {
if ($this->processor instanceof ProcessorInterface) {
if ($this->processor->supports($resource, $type)) {
$data = $this->processor->process($data);
} el... | [
"private",
"function",
"process",
"(",
"array",
"$",
"data",
",",
"$",
"resource",
",",
"$",
"type",
",",
"$",
"require",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"processor",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"processor",
"instanceof",
"Process... | Processes the configuration definition.
@param array $data The configuration data.
@param mixed $resource A resource.
@param string $type The resource type.
@param boolean $require Require processing?
@return array The processed configuration data.
@throws ProcessorException If the processor could not ... | [
"Processes",
"the",
"configuration",
"definition",
"."
] | train | https://github.com/kherge-abandoned/php-wise/blob/7621e0be7dbb2a015d68197d290fe8469f539a4d/src/lib/Herrera/Wise/Wise.php#L361-L388 |
aedart/laravel-helpers | src/Traits/Foundation/AppTrait.php | AppTrait.getApp | public function getApp(): ?Application
{
if (!$this->hasApp()) {
$this->setApp($this->getDefaultApp());
}
return $this->app;
} | php | public function getApp(): ?Application
{
if (!$this->hasApp()) {
$this->setApp($this->getDefaultApp());
}
return $this->app;
} | [
"public",
"function",
"getApp",
"(",
")",
":",
"?",
"Application",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasApp",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setApp",
"(",
"$",
"this",
"->",
"getDefaultApp",
"(",
")",
")",
";",
"}",
"return",
"$",... | Get app
If no app has been set, this method will
set and return a default app, if any such
value is available
@see getDefaultApp()
@return Application|null app or null if none app has been set | [
"Get",
"app"
] | train | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Foundation/AppTrait.php#L53-L59 |
ClanCats/Core | src/classes/CCError/Handler/Cli.php | CCError_Handler_Cli.respond | public function respond()
{
$inspector = $this->inspector;
CCCli::write( "\n".$inspector->exception_name().': ', 'red' );
CCCli::line( $inspector->message() );
CCCli::line( $inspector->exception()->getFile().':'.$inspector->exception()->getLine() );
} | php | public function respond()
{
$inspector = $this->inspector;
CCCli::write( "\n".$inspector->exception_name().': ', 'red' );
CCCli::line( $inspector->message() );
CCCli::line( $inspector->exception()->getFile().':'.$inspector->exception()->getLine() );
} | [
"public",
"function",
"respond",
"(",
")",
"{",
"$",
"inspector",
"=",
"$",
"this",
"->",
"inspector",
";",
"CCCli",
"::",
"write",
"(",
"\"\\n\"",
".",
"$",
"inspector",
"->",
"exception_name",
"(",
")",
".",
"': '",
",",
"'red'",
")",
";",
"CCCli",
... | respond information to the user
@return void | [
"respond",
"information",
"to",
"the",
"user"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCError/Handler/Cli.php#L19-L26 |
egeloen/IvorySerializerBundle | DependencyInjection/Compiler/RegisterFOSServicePass.php | RegisterFOSServicePass.process | public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('fos_rest.exception.messages_map')) {
$container->removeDefinition('ivory.serializer.fos');
return;
}
$exceptionType = $container->getDefinition('ivory.serializer.type.exception');... | php | public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('fos_rest.exception.messages_map')) {
$container->removeDefinition('ivory.serializer.fos');
return;
}
$exceptionType = $container->getDefinition('ivory.serializer.type.exception');... | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"if",
"(",
"!",
"$",
"container",
"->",
"hasDefinition",
"(",
"'fos_rest.exception.messages_map'",
")",
")",
"{",
"$",
"container",
"->",
"removeDefinition",
"(",
"'ivory.seriali... | {@inheritdoc} | [
"{"
] | train | https://github.com/egeloen/IvorySerializerBundle/blob/a2bdd912bf715c61b823cf7257ee232d5c823dd3/DependencyInjection/Compiler/RegisterFOSServicePass.php#L27-L42 |
christianvizarra/laravel-service-provider | src/Publisher/Publisher.php | Publisher.getSourceFiles | protected function getSourceFiles($path)
{
$files = [];
foreach (glob($path.'/*.php') as $file) {
$files[] = $file;
}
return $files;
} | php | protected function getSourceFiles($path)
{
$files = [];
foreach (glob($path.'/*.php') as $file) {
$files[] = $file;
}
return $files;
} | [
"protected",
"function",
"getSourceFiles",
"(",
"$",
"path",
")",
"{",
"$",
"files",
"=",
"[",
"]",
";",
"foreach",
"(",
"glob",
"(",
"$",
"path",
".",
"'/*.php'",
")",
"as",
"$",
"file",
")",
"{",
"$",
"files",
"[",
"]",
"=",
"$",
"file",
";",
... | @param $type
@param $files
@return array | [
"@param",
"$type",
"@param",
"$files"
] | train | https://github.com/christianvizarra/laravel-service-provider/blob/73e6b664c34ce228d4a3a48ed3b96cf2546ccfee/src/Publisher/Publisher.php#L146-L154 |
christianvizarra/laravel-service-provider | src/Publisher/Publisher.php | Publisher.getClassFromFile | protected function getClassFromFile($path)
{
$count = count($tokens = token_get_all(file_get_contents($path)));
for ($i = 2; $i < $count; ++$i) {
if ($tokens[$i - 2][0] == T_CLASS && $tokens[$i - 1][0] == T_WHITESPACE && $tokens[$i][0] == T_STRING) {
return $tokens[$i][1... | php | protected function getClassFromFile($path)
{
$count = count($tokens = token_get_all(file_get_contents($path)));
for ($i = 2; $i < $count; ++$i) {
if ($tokens[$i - 2][0] == T_CLASS && $tokens[$i - 1][0] == T_WHITESPACE && $tokens[$i][0] == T_STRING) {
return $tokens[$i][1... | [
"protected",
"function",
"getClassFromFile",
"(",
"$",
"path",
")",
"{",
"$",
"count",
"=",
"count",
"(",
"$",
"tokens",
"=",
"token_get_all",
"(",
"file_get_contents",
"(",
"$",
"path",
")",
")",
")",
";",
"for",
"(",
"$",
"i",
"=",
"2",
";",
"$",
... | @param $path
@return mixed | [
"@param",
"$path"
] | train | https://github.com/christianvizarra/laravel-service-provider/blob/73e6b664c34ce228d4a3a48ed3b96cf2546ccfee/src/Publisher/Publisher.php#L161-L170 |
Chill-project/Main | Routing/Loader/ChillRoutesLoader.php | ChillRoutesLoader.load | public function load($resource, $type = null)
{
$collection = new RouteCollection();
foreach ($this->routes as $resource) {
$collection->addCollection(
$this->import($resource, NULL)
);
}
return $collection;
} | php | public function load($resource, $type = null)
{
$collection = new RouteCollection();
foreach ($this->routes as $resource) {
$collection->addCollection(
$this->import($resource, NULL)
);
}
return $collection;
} | [
"public",
"function",
"load",
"(",
"$",
"resource",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"collection",
"=",
"new",
"RouteCollection",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"routes",
"as",
"$",
"resource",
")",
"{",
"$",
"collecti... | {@inheritDoc}
@param type $resource
@param type $type
@return RouteCollection | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Routing/Loader/ChillRoutesLoader.php#L54-L65 |
ClanCats/Core | src/classes/CCOrbit/Ship.php | CCOrbit_Ship.create | public static function create( $path )
{
if ( is_null( $path ) )
{
return new static();
}
// use the orbit path if we are relative
if ( substr( $path, 0, 1 ) != '/' )
{
$path = ORBITPATH.$path;
}
// check the path
if ( substr( $path, -1 ) != '/' )
{
$path .= '/';
}
$bluep... | php | public static function create( $path )
{
if ( is_null( $path ) )
{
return new static();
}
// use the orbit path if we are relative
if ( substr( $path, 0, 1 ) != '/' )
{
$path = ORBITPATH.$path;
}
// check the path
if ( substr( $path, -1 ) != '/' )
{
$path .= '/';
}
$bluep... | [
"public",
"static",
"function",
"create",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"path",
")",
")",
"{",
"return",
"new",
"static",
"(",
")",
";",
"}",
"// use the orbit path if we are relative",
"if",
"(",
"substr",
"(",
"$",
"path",... | create an new ship object from path
@param string $path
@return CCOrbit_Ship | [
"create",
"an",
"new",
"ship",
"object",
"from",
"path"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCOrbit/Ship.php#L21-L53 |
ClanCats/Core | src/classes/CCOrbit/Ship.php | CCOrbit_Ship.blueprint | public static function blueprint( $data, $path )
{
if ( !is_array( $data ) )
{
throw new \InvalidArgumentException( "CCOrbit_Ship::blueprint - first argument has to be an array." );
}
$ship = new static();
$name = $data['name'];
$namespace = $data['namespace'];
// check if we have a name ... | php | public static function blueprint( $data, $path )
{
if ( !is_array( $data ) )
{
throw new \InvalidArgumentException( "CCOrbit_Ship::blueprint - first argument has to be an array." );
}
$ship = new static();
$name = $data['name'];
$namespace = $data['namespace'];
// check if we have a name ... | [
"public",
"static",
"function",
"blueprint",
"(",
"$",
"data",
",",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"CCOrbit_Ship::blueprint - first argument has to be a... | create new ship with given data
@param array $data
@return CCOrbit_Ship | [
"create",
"new",
"ship",
"with",
"given",
"data"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCOrbit/Ship.php#L61-L146 |
ClanCats/Core | src/classes/CCOrbit/Ship.php | CCOrbit_Ship.event | public function event( $event )
{
// call the wake event
if ( is_string( $this->namespace ) )
{
if ( strpos( $event, '::' ) !== false )
{
$callback = explode( '::', $event );
$class = $this->namespace."\\".$callback[0];
if ( class_exists( $class ) )
{
call_user_func( array( $t... | php | public function event( $event )
{
// call the wake event
if ( is_string( $this->namespace ) )
{
if ( strpos( $event, '::' ) !== false )
{
$callback = explode( '::', $event );
$class = $this->namespace."\\".$callback[0];
if ( class_exists( $class ) )
{
call_user_func( array( $t... | [
"public",
"function",
"event",
"(",
"$",
"event",
")",
"{",
"// call the wake event",
"if",
"(",
"is_string",
"(",
"$",
"this",
"->",
"namespace",
")",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"event",
",",
"'::'",
")",
"!==",
"false",
")",
"{",
"$",... | run an event on this object | [
"run",
"an",
"event",
"on",
"this",
"object"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCOrbit/Ship.php#L202-L232 |
nyeholt/silverstripe-external-content | thirdparty/Zend/Validate/Ip.php | Zend_Validate_Ip.isValid | public function isValid($value)
{
$valueString = (string) $value;
$this->_setValue($valueString);
if ((ip2long($valueString) === false) || (long2ip(ip2long($valueString)) !== $valueString)) {
if (!function_exists('inet_pton')) {
$this->_error();
... | php | public function isValid($value)
{
$valueString = (string) $value;
$this->_setValue($valueString);
if ((ip2long($valueString) === false) || (long2ip(ip2long($valueString)) !== $valueString)) {
if (!function_exists('inet_pton')) {
$this->_error();
... | [
"public",
"function",
"isValid",
"(",
"$",
"value",
")",
"{",
"$",
"valueString",
"=",
"(",
"string",
")",
"$",
"value",
";",
"$",
"this",
"->",
"_setValue",
"(",
"$",
"valueString",
")",
";",
"if",
"(",
"(",
"ip2long",
"(",
"$",
"valueString",
")",
... | Defined by Zend_Validate_Interface
Returns true if and only if $value is a valid IP address
@param mixed $value
@return boolean | [
"Defined",
"by",
"Zend_Validate_Interface"
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Validate/Ip.php#L52-L69 |
Kylob/Bootstrap | src/Form.php | Form.message | public function message($status, $message)
{
$this->page->session->setFlash(array(__CLASS__, $this->header['name']), array(
'status' => $status,
'msg' => $message,
));
} | php | public function message($status, $message)
{
$this->page->session->setFlash(array(__CLASS__, $this->header['name']), array(
'status' => $status,
'msg' => $message,
));
} | [
"public",
"function",
"message",
"(",
"$",
"status",
",",
"$",
"message",
")",
"{",
"$",
"this",
"->",
"page",
"->",
"session",
"->",
"setFlash",
"(",
"array",
"(",
"__CLASS__",
",",
"$",
"this",
"->",
"header",
"[",
"'name'",
"]",
")",
",",
"array",... | Display a message to your user after ``$form->eject()``ing them. The Bootstrap alert status message will be displayed at the top of the form when you return ``$form->header()``.
@param string $status Either '**success**', '**info**', '**warning**', or '**danger**'. If this is '**html**', then the $message will be d... | [
"Display",
"a",
"message",
"to",
"your",
"user",
"after",
"$form",
"-",
">",
"eject",
"()",
"ing",
"them",
".",
"The",
"Bootstrap",
"alert",
"status",
"message",
"will",
"be",
"displayed",
"at",
"the",
"top",
"of",
"the",
"form",
"when",
"you",
"return",... | train | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Form.php#L77-L83 |
Kylob/Bootstrap | src/Form.php | Form.align | public function align($direction = 'horizontal', $collapse = 'sm', $indent = 2)
{
if ($direction == 'collapse') {
$this->align = '';
} elseif ($direction == 'inline') {
$this->align = 'form-inline';
} else {
$this->align = 'form-horizontal';
$t... | php | public function align($direction = 'horizontal', $collapse = 'sm', $indent = 2)
{
if ($direction == 'collapse') {
$this->align = '';
} elseif ($direction == 'inline') {
$this->align = 'form-inline';
} else {
$this->align = 'form-horizontal';
$t... | [
"public",
"function",
"align",
"(",
"$",
"direction",
"=",
"'horizontal'",
",",
"$",
"collapse",
"=",
"'sm'",
",",
"$",
"indent",
"=",
"2",
")",
"{",
"if",
"(",
"$",
"direction",
"==",
"'collapse'",
")",
"{",
"$",
"this",
"->",
"align",
"=",
"''",
... | Utilize any Bootstrap form style.
@param string $direction The options are:
- '**collapse**' - This will display the form prompt immediately above the field.
- '**inline**' - All of the fields will be inline with each other, and the form prompts will be removed.
- '**horizontal**' - Vertically aligns all of the field... | [
"Utilize",
"any",
"Bootstrap",
"form",
"style",
"."
] | train | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Form.php#L118-L129 |
Kylob/Bootstrap | src/Form.php | Form.prompt | public function prompt($place, $html, $required = false)
{
switch ($place) {
case 'info':
case 'append':
$this->prompt[$place] = $html;
break;
case 'prepend':
$this->prompt['prepend'] = array('html' => $html, 'required' => (... | php | public function prompt($place, $html, $required = false)
{
switch ($place) {
case 'info':
case 'append':
$this->prompt[$place] = $html;
break;
case 'prepend':
$this->prompt['prepend'] = array('html' => $html, 'required' => (... | [
"public",
"function",
"prompt",
"(",
"$",
"place",
",",
"$",
"html",
",",
"$",
"required",
"=",
"false",
")",
"{",
"switch",
"(",
"$",
"place",
")",
"{",
"case",
"'info'",
":",
"case",
"'append'",
":",
"$",
"this",
"->",
"prompt",
"[",
"$",
"place"... | This is to add html tags, or semicolons, or asterisks, or whatever you would like to all of the form's prompts.
@param string $place Either '**info**', '**append**', or '**prepend**' to the prompt. You only have one shot at each.
@param string $html Whatever you would like to add. For '**info**', this will be... | [
"This",
"is",
"to",
"add",
"html",
"tags",
"or",
"semicolons",
"or",
"asterisks",
"or",
"whatever",
"you",
"would",
"like",
"to",
"all",
"of",
"the",
"form",
"s",
"prompts",
"."
] | train | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Form.php#L146-L157 |
Kylob/Bootstrap | src/Form.php | Form.header | public function header(array $validate = array())
{
$this->validator->jquery('form[name='.$this->header['name'].']', array_merge(array(
'ignore' => '[]',
'errorClass' => '"has-error"',
'validClass' => '""',
'errorElement' => '"span"',
'highlight' =... | php | public function header(array $validate = array())
{
$this->validator->jquery('form[name='.$this->header['name'].']', array_merge(array(
'ignore' => '[]',
'errorClass' => '"has-error"',
'validClass' => '""',
'errorElement' => '"span"',
'highlight' =... | [
"public",
"function",
"header",
"(",
"array",
"$",
"validate",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"validator",
"->",
"jquery",
"(",
"'form[name='",
".",
"$",
"this",
"->",
"header",
"[",
"'name'",
"]",
".",
"']'",
",",
"array_merge",
... | Creates the ``<form>``, invokes the Validator jQuery, and displays your message (if any).
@param array $validate Override the custom validator settings we have created for Bootstrap
@return string
@example
```php
echo $form->header();
``` | [
"Creates",
"the",
"<form",
">",
"invokes",
"the",
"Validator",
"jQuery",
"and",
"displays",
"your",
"message",
"(",
"if",
"any",
")",
"."
] | train | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Form.php#L172-L195 |
Kylob/Bootstrap | src/Form.php | Form.checkbox | public function checkbox($field, array $attributes = array(), $inline = false)
{
$disabled = in_array('disabled', $attributes) ? 'disabled' : '';
if ($inline !== false) {
$wrap = $this->page->tag('label', array('class' => array('checkbox-inline', $this->input, $disabled)), '%s');
... | php | public function checkbox($field, array $attributes = array(), $inline = false)
{
$disabled = in_array('disabled', $attributes) ? 'disabled' : '';
if ($inline !== false) {
$wrap = $this->page->tag('label', array('class' => array('checkbox-inline', $this->input, $disabled)), '%s');
... | [
"public",
"function",
"checkbox",
"(",
"$",
"field",
",",
"array",
"$",
"attributes",
"=",
"array",
"(",
")",
",",
"$",
"inline",
"=",
"false",
")",
"{",
"$",
"disabled",
"=",
"in_array",
"(",
"'disabled'",
",",
"$",
"attributes",
")",
"?",
"'disabled'... | Creates checkboxes from the ``$form->menu($field)`` you set earlier.
@param string $field The checkbox's name.
@param array $attributes Anything else you would like to add besides the 'name', 'value', 'checked', and data validation attributes.
@param mixed $inline This tells us if you want the checkboxes to... | [
"Creates",
"checkboxes",
"from",
"the",
"$form",
"-",
">",
"menu",
"(",
"$field",
")",
"you",
"set",
"earlier",
"."
] | train | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Form.php#L215-L225 |
Kylob/Bootstrap | src/Form.php | Form.group | public function group($prepend, $append, $input)
{
if (!empty($prepend)) {
foreach ((array) $prepend as $html) {
$class = (strpos($html, 'btn') !== false) ? 'input-group-btn' : 'input-group-addon';
$input = $this->page->tag('div', array('class' => $class), $html).... | php | public function group($prepend, $append, $input)
{
if (!empty($prepend)) {
foreach ((array) $prepend as $html) {
$class = (strpos($html, 'btn') !== false) ? 'input-group-btn' : 'input-group-addon';
$input = $this->page->tag('div', array('class' => $class), $html).... | [
"public",
"function",
"group",
"(",
"$",
"prepend",
",",
"$",
"append",
",",
"$",
"input",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"prepend",
")",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"prepend",
"as",
"$",
"html",
")",
"{",
"$... | Group an input field with addons. You can prepend and/or append a ``$bp->button(...)``, ``$bp->icon(...)``, or just a string of text. To prepend or append multiple elements, then make it an ``array($html, ...)`` of addons.
@param string|array $prepend An element to place before the $input.
@param string|array $appen... | [
"Group",
"an",
"input",
"field",
"with",
"addons",
".",
"You",
"can",
"prepend",
"and",
"/",
"or",
"append",
"a",
"$bp",
"-",
">",
"button",
"(",
"...",
")",
"$bp",
"-",
">",
"icon",
"(",
"...",
")",
"or",
"just",
"a",
"string",
"of",
"text",
"."... | train | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Form.php#L272-L292 |
Kylob/Bootstrap | src/Form.php | Form.field | public function field($prompt, $input, $error = null)
{
foreach (array('input', 'select', 'textarea', 'button', 'p') as $tag) {
if ($this->firstTagAttributes($input, $matches, '<'.$tag)) {
break;
}
}
list($first, $tag, $attributes) = $matches;
... | php | public function field($prompt, $input, $error = null)
{
foreach (array('input', 'select', 'textarea', 'button', 'p') as $tag) {
if ($this->firstTagAttributes($input, $matches, '<'.$tag)) {
break;
}
}
list($first, $tag, $attributes) = $matches;
... | [
"public",
"function",
"field",
"(",
"$",
"prompt",
",",
"$",
"input",
",",
"$",
"error",
"=",
"null",
")",
"{",
"foreach",
"(",
"array",
"(",
"'input'",
",",
"'select'",
",",
"'textarea'",
",",
"'button'",
",",
"'p'",
")",
"as",
"$",
"tag",
")",
"{... | Adds a (properly formatted) **$prompt** to your **$input** field, and manages any error messages.
@param string|array $prompt For the **$input** field. If you want to include additional info that will appear when clicked or hovered over, then you can make this an ``array($prompt => $info)``. To customize the icon us... | [
"Adds",
"a",
"(",
"properly",
"formatted",
")",
"**",
"$prompt",
"**",
"to",
"your",
"**",
"$input",
"**",
"field",
"and",
"manages",
"any",
"error",
"messages",
"."
] | train | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Form.php#L309-L356 |
Kylob/Bootstrap | src/Form.php | Form.submit | public function submit($submit = 'Submit', $reset = '')
{
// never use name="submit" per: http://jqueryvalidation.org/reference/#developing-and-debugging-a-form
$buttons = func_get_args();
if (substr($submit, 0, 1) != '<') {
$buttons[0] = $this->page->tag('button', array(
... | php | public function submit($submit = 'Submit', $reset = '')
{
// never use name="submit" per: http://jqueryvalidation.org/reference/#developing-and-debugging-a-form
$buttons = func_get_args();
if (substr($submit, 0, 1) != '<') {
$buttons[0] = $this->page->tag('button', array(
... | [
"public",
"function",
"submit",
"(",
"$",
"submit",
"=",
"'Submit'",
",",
"$",
"reset",
"=",
"''",
")",
"{",
"// never use name=\"submit\" per: http://jqueryvalidation.org/reference/#developing-and-debugging-a-form",
"$",
"buttons",
"=",
"func_get_args",
"(",
")",
";",
... | Quickly adds a submit button to your form.
@param string $submit What you would like the submit button to say. If it starts with a '**<**', then we assume you have spelled it all out for us.
@param string $reset This will add a reset button if you give it a value, and if it starts with a '**<**' then it can be whate... | [
"Quickly",
"adds",
"a",
"submit",
"button",
"to",
"your",
"form",
"."
] | train | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Form.php#L372-L391 |
Kylob/Bootstrap | src/Form.php | Form.label | private function label($prompt, $name, $id)
{
if (empty($prompt)) {
return '';
}
if (is_array($prompt)) {
list($prompt, $info) = (count($prompt) > 1) ? array_values($prompt) : each($prompt);
}
if (empty($prompt) || strpos($prompt, '<label') !== false) ... | php | private function label($prompt, $name, $id)
{
if (empty($prompt)) {
return '';
}
if (is_array($prompt)) {
list($prompt, $info) = (count($prompt) > 1) ? array_values($prompt) : each($prompt);
}
if (empty($prompt) || strpos($prompt, '<label') !== false) ... | [
"private",
"function",
"label",
"(",
"$",
"prompt",
",",
"$",
"name",
",",
"$",
"id",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"prompt",
")",
")",
"{",
"return",
"''",
";",
"}",
"if",
"(",
"is_array",
"(",
"$",
"prompt",
")",
")",
"{",
"list",
... | Used by ``$this->field()`` to create a ``<label>`` prompt.
@param string|array $prompt The form label reference.
@param string $name The name of the associated input field.
@param string $id The id of the associated input field.
@return string The generated HTML ``<label>``. | [
"Used",
"by",
"$this",
"-",
">",
"field",
"()",
"to",
"create",
"a",
"<label",
">",
"prompt",
"."
] | train | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Form.php#L402-L453 |
Double-Opt-in/php-client-api | src/Client/Commands/Responses/DecryptedCommandResponse.php | DecryptedCommandResponse.assignCryptographyEngine | public function assignCryptographyEngine(CryptographyEngine $cryptographyEngine, $email)
{
$this->cryptographyEngine = $cryptographyEngine;
$this->email = $email;
} | php | public function assignCryptographyEngine(CryptographyEngine $cryptographyEngine, $email)
{
$this->cryptographyEngine = $cryptographyEngine;
$this->email = $email;
} | [
"public",
"function",
"assignCryptographyEngine",
"(",
"CryptographyEngine",
"$",
"cryptographyEngine",
",",
"$",
"email",
")",
"{",
"$",
"this",
"->",
"cryptographyEngine",
"=",
"$",
"cryptographyEngine",
";",
"$",
"this",
"->",
"email",
"=",
"$",
"email",
";",... | assigns the cryptography engine
@param \DoubleOptIn\ClientApi\Security\CryptographyEngine $cryptographyEngine
@param string $email
@return void | [
"assigns",
"the",
"cryptography",
"engine"
] | train | https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Client/Commands/Responses/DecryptedCommandResponse.php#L38-L42 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.