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 |
|---|---|---|---|---|---|---|---|---|---|---|
nguyenanhung/nusoap | src-fix/nusoap.php | nusoap_server.verify_method | function verify_method($operation, $request)
{
if (isset($this->wsdl) && is_object($this->wsdl)) {
if ($this->wsdl->getOperationData($operation)) {
return TRUE;
}
} elseif (isset($this->operations[$operation])) {
return TRUE;
}
ret... | php | function verify_method($operation, $request)
{
if (isset($this->wsdl) && is_object($this->wsdl)) {
if ($this->wsdl->getOperationData($operation)) {
return TRUE;
}
} elseif (isset($this->operations[$operation])) {
return TRUE;
}
ret... | [
"function",
"verify_method",
"(",
"$",
"operation",
",",
"$",
"request",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"wsdl",
")",
"&&",
"is_object",
"(",
"$",
"this",
"->",
"wsdl",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"wsdl",
"-... | takes the value that was created by parsing the request
and compares to the method's signature, if available.
@param string $operation The operation to be invoked
@param array $request The array of parameter values
@return boolean Whether the operation was found
@access private | [
"takes",
"the",
"value",
"that",
"was",
"created",
"by",
"parsing",
"the",
"request",
"and",
"compares",
"to",
"the",
"method",
"s",
"signature",
"if",
"available",
"."
] | train | https://github.com/nguyenanhung/nusoap/blob/a9b4d98f4f3fe748f8e5d9f8091dfc53585d2556/src-fix/nusoap.php#L4548-L4559 |
nguyenanhung/nusoap | src-fix/nusoap.php | nusoap_server.parseRequest | function parseRequest($headers, $data)
{
$this->debug('Entering parseRequest() for data of length ' . strlen($data) . ' headers:');
$this->appendDebug($this->varDump($headers));
if (!isset($headers['content-type'])) {
$this->setError('Request not of type text/xml (no content-type... | php | function parseRequest($headers, $data)
{
$this->debug('Entering parseRequest() for data of length ' . strlen($data) . ' headers:');
$this->appendDebug($this->varDump($headers));
if (!isset($headers['content-type'])) {
$this->setError('Request not of type text/xml (no content-type... | [
"function",
"parseRequest",
"(",
"$",
"headers",
",",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"debug",
"(",
"'Entering parseRequest() for data of length '",
".",
"strlen",
"(",
"$",
"data",
")",
".",
"' headers:'",
")",
";",
"$",
"this",
"->",
"appendDebug... | processes SOAP message received from client
@param array $headers The HTTP headers
@param string $data unprocessed request data from client
@return mixed value of the message, decoded into a PHP type
@access private | [
"processes",
"SOAP",
"message",
"received",
"from",
"client"
] | train | https://github.com/nguyenanhung/nusoap/blob/a9b4d98f4f3fe748f8e5d9f8091dfc53585d2556/src-fix/nusoap.php#L4570-L4620 |
nguyenanhung/nusoap | src-fix/nusoap.php | nusoap_server.add_to_map | function add_to_map($methodname, $in, $out)
{
$this->operations[$methodname] = ['name' => $methodname, 'in' => $in, 'out' => $out];
} | php | function add_to_map($methodname, $in, $out)
{
$this->operations[$methodname] = ['name' => $methodname, 'in' => $in, 'out' => $out];
} | [
"function",
"add_to_map",
"(",
"$",
"methodname",
",",
"$",
"in",
",",
"$",
"out",
")",
"{",
"$",
"this",
"->",
"operations",
"[",
"$",
"methodname",
"]",
"=",
"[",
"'name'",
"=>",
"$",
"methodname",
",",
"'in'",
"=>",
"$",
"in",
",",
"'out'",
"=>"... | add a method to the dispatch map (this has been replaced by the register method)
@param string $methodname
@param string $in array of input values
@param string $out array of output values
@access public
@deprecated | [
"add",
"a",
"method",
"to",
"the",
"dispatch",
"map",
"(",
"this",
"has",
"been",
"replaced",
"by",
"the",
"register",
"method",
")"
] | train | https://github.com/nguyenanhung/nusoap/blob/a9b4d98f4f3fe748f8e5d9f8091dfc53585d2556/src-fix/nusoap.php#L4672-L4675 |
nguyenanhung/nusoap | src-fix/nusoap.php | nusoap_server.register | function register(
$name, $in = [], $out = [], $namespace = FALSE, $soapaction = FALSE, $style = FALSE, $use = FALSE, $documentation = '',
$encodingStyle = ''
) {
global $HTTP_SERVER_VARS;
if ($this->externalWSDLURL) {
die('You cannot bind to an external WSDL file, and r... | php | function register(
$name, $in = [], $out = [], $namespace = FALSE, $soapaction = FALSE, $style = FALSE, $use = FALSE, $documentation = '',
$encodingStyle = ''
) {
global $HTTP_SERVER_VARS;
if ($this->externalWSDLURL) {
die('You cannot bind to an external WSDL file, and r... | [
"function",
"register",
"(",
"$",
"name",
",",
"$",
"in",
"=",
"[",
"]",
",",
"$",
"out",
"=",
"[",
"]",
",",
"$",
"namespace",
"=",
"FALSE",
",",
"$",
"soapaction",
"=",
"FALSE",
",",
"$",
"style",
"=",
"FALSE",
",",
"$",
"use",
"=",
"FALSE",
... | register a service function with the server
@param string $name the name of the PHP function, class.method or class..method
@param array $in assoc array of input values: key = param name, value = param type
@param array $out assoc array of output values: key = param name, value... | [
"register",
"a",
"service",
"function",
"with",
"the",
"server"
] | train | https://github.com/nguyenanhung/nusoap/blob/a9b4d98f4f3fe748f8e5d9f8091dfc53585d2556/src-fix/nusoap.php#L4693-L4754 |
nguyenanhung/nusoap | src-fix/nusoap.php | nusoap_server.configureWSDL | function configureWSDL(
$serviceName, $namespace = FALSE, $endpoint = FALSE, $style = 'rpc', $transport = 'http://schemas.xmlsoap.org/soap/http',
$schemaTargetNamespace = FALSE
) {
global $HTTP_SERVER_VARS;
if (isset($_SERVER)) {
$SERVER_NAME = $_SERVER['SERVER_NAME'];
... | php | function configureWSDL(
$serviceName, $namespace = FALSE, $endpoint = FALSE, $style = 'rpc', $transport = 'http://schemas.xmlsoap.org/soap/http',
$schemaTargetNamespace = FALSE
) {
global $HTTP_SERVER_VARS;
if (isset($_SERVER)) {
$SERVER_NAME = $_SERVER['SERVER_NAME'];
... | [
"function",
"configureWSDL",
"(",
"$",
"serviceName",
",",
"$",
"namespace",
"=",
"FALSE",
",",
"$",
"endpoint",
"=",
"FALSE",
",",
"$",
"style",
"=",
"'rpc'",
",",
"$",
"transport",
"=",
"'http://schemas.xmlsoap.org/soap/http'",
",",
"$",
"schemaTargetNamespace... | Sets up wsdl object.
Acts as a flag to enable internal WSDL generation
@param string $serviceName , name of the service
@param mixed $namespace optional 'tns' service namespace or false
@param mixed $endpoint optional URL of service endpoint or false
@param string $style ... | [
"Sets",
"up",
"wsdl",
"object",
".",
"Acts",
"as",
"a",
"flag",
"to",
"enable",
"internal",
"WSDL",
"generation"
] | train | https://github.com/nguyenanhung/nusoap/blob/a9b4d98f4f3fe748f8e5d9f8091dfc53585d2556/src-fix/nusoap.php#L4787-L4860 |
nguyenanhung/nusoap | src-fix/nusoap.php | wsdl.getOperations | function getOperations($portName = '', $bindingType = 'soap')
{
$ops = [];
if ($bindingType == 'soap') {
$bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/';
} elseif ($bindingType == 'soap12') {
$bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/';
} e... | php | function getOperations($portName = '', $bindingType = 'soap')
{
$ops = [];
if ($bindingType == 'soap') {
$bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/';
} elseif ($bindingType == 'soap12') {
$bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/';
} e... | [
"function",
"getOperations",
"(",
"$",
"portName",
"=",
"''",
",",
"$",
"bindingType",
"=",
"'soap'",
")",
"{",
"$",
"ops",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"bindingType",
"==",
"'soap'",
")",
"{",
"$",
"bindingType",
"=",
"'http://schemas.xmlsoap.org... | returns an assoc array of operation names => operation data
@param string $portName WSDL port name
@param string $bindingType eg: soap, smtp, dime (only soap and soap12 are currently supported)
@return array
@access public | [
"returns",
"an",
"assoc",
"array",
"of",
"operation",
"names",
"=",
">",
"operation",
"data"
] | train | https://github.com/nguyenanhung/nusoap/blob/a9b4d98f4f3fe748f8e5d9f8091dfc53585d2556/src-fix/nusoap.php#L5481-L5513 |
nguyenanhung/nusoap | src-fix/nusoap.php | wsdl.getOperationData | function getOperationData($operation, $bindingType = 'soap')
{
if ($bindingType == 'soap') {
$bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/';
} elseif ($bindingType == 'soap12') {
$bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/';
}
// loop thru ... | php | function getOperationData($operation, $bindingType = 'soap')
{
if ($bindingType == 'soap') {
$bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/';
} elseif ($bindingType == 'soap12') {
$bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/';
}
// loop thru ... | [
"function",
"getOperationData",
"(",
"$",
"operation",
",",
"$",
"bindingType",
"=",
"'soap'",
")",
"{",
"if",
"(",
"$",
"bindingType",
"==",
"'soap'",
")",
"{",
"$",
"bindingType",
"=",
"'http://schemas.xmlsoap.org/wsdl/soap/'",
";",
"}",
"elseif",
"(",
"$",
... | returns an associative array of data necessary for calling an operation
@param string $operation name of operation
@param string $bindingType type of binding eg: soap, soap12
@return array
@access public | [
"returns",
"an",
"associative",
"array",
"of",
"data",
"necessary",
"for",
"calling",
"an",
"operation"
] | train | https://github.com/nguyenanhung/nusoap/blob/a9b4d98f4f3fe748f8e5d9f8091dfc53585d2556/src-fix/nusoap.php#L5524-L5547 |
nguyenanhung/nusoap | src-fix/nusoap.php | wsdl.serializeParameters | function serializeParameters($operation, $direction, $parameters)
{
$this->debug("in serializeParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion");
$this->appendDebug('parameters=' . $this->varDump($parameters));
if ($direction != 'input' && $di... | php | function serializeParameters($operation, $direction, $parameters)
{
$this->debug("in serializeParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion");
$this->appendDebug('parameters=' . $this->varDump($parameters));
if ($direction != 'input' && $di... | [
"function",
"serializeParameters",
"(",
"$",
"operation",
",",
"$",
"direction",
",",
"$",
"parameters",
")",
"{",
"$",
"this",
"->",
"debug",
"(",
"\"in serializeParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion\"",
")",
";",
... | serialize a PHP value according to a WSDL message definition
TODO
- multi-ref serialization
- validate PHP values against type definitions, return errors if invalid
@param string $operation operation name
@param string $direction (input|output)
@param mixed $parameters parameter value(s)
@return mixed parameters ... | [
"serialize",
"a",
"PHP",
"value",
"according",
"to",
"a",
"WSDL",
"message",
"definition"
] | train | https://github.com/nguyenanhung/nusoap/blob/a9b4d98f4f3fe748f8e5d9f8091dfc53585d2556/src-fix/nusoap.php#L6134-L6202 |
nguyenanhung/nusoap | src-fix/nusoap.php | wsdl.serializeType | function serializeType($name, $type, $value, $use = 'encoded', $encodingStyle = FALSE, $unqualified = FALSE)
{
$this->debug("in serializeType: name=$name, type=$type, use=$use, encodingStyle=$encodingStyle, unqualified=" . ($unqualified ? "unqualified" : "qualified"));
$this->appendDebug("value=" . ... | php | function serializeType($name, $type, $value, $use = 'encoded', $encodingStyle = FALSE, $unqualified = FALSE)
{
$this->debug("in serializeType: name=$name, type=$type, use=$use, encodingStyle=$encodingStyle, unqualified=" . ($unqualified ? "unqualified" : "qualified"));
$this->appendDebug("value=" . ... | [
"function",
"serializeType",
"(",
"$",
"name",
",",
"$",
"type",
",",
"$",
"value",
",",
"$",
"use",
"=",
"'encoded'",
",",
"$",
"encodingStyle",
"=",
"FALSE",
",",
"$",
"unqualified",
"=",
"FALSE",
")",
"{",
"$",
"this",
"->",
"debug",
"(",
"\"in se... | serializes a PHP value according a given type definition
@param string $name name of value (part or element)
@param string $type XML schema type of value (type or element)
@param mixed $value a native PHP value (parameter value)
@param string $use use for part (encoded|literal)... | [
"serializes",
"a",
"PHP",
"value",
"according",
"a",
"given",
"type",
"definition"
] | train | https://github.com/nguyenanhung/nusoap/blob/a9b4d98f4f3fe748f8e5d9f8091dfc53585d2556/src-fix/nusoap.php#L6217-L6532 |
nguyenanhung/nusoap | src-fix/nusoap.php | nusoap_parser.end_element | function end_element($parser, $name)
{
// position of current element is equal to the last value left in depth_array for my depth
$pos = $this->depth_array[$this->depth--];
// get element prefix
if (strpos($name, ':')) {
// get ns prefix
$prefix = substr($nam... | php | function end_element($parser, $name)
{
// position of current element is equal to the last value left in depth_array for my depth
$pos = $this->depth_array[$this->depth--];
// get element prefix
if (strpos($name, ':')) {
// get ns prefix
$prefix = substr($nam... | [
"function",
"end_element",
"(",
"$",
"parser",
",",
"$",
"name",
")",
"{",
"// position of current element is equal to the last value left in depth_array for my depth",
"$",
"pos",
"=",
"$",
"this",
"->",
"depth_array",
"[",
"$",
"this",
"->",
"depth",
"--",
"]",
";... | end-element handler
@param resource $parser XML parser object
@param string $name element name
@access private | [
"end",
"-",
"element",
"handler"
] | train | https://github.com/nguyenanhung/nusoap/blob/a9b4d98f4f3fe748f8e5d9f8091dfc53585d2556/src-fix/nusoap.php#L7198-L7296 |
nguyenanhung/nusoap | src-fix/nusoap.php | nusoap_client.call | function call(
$operation, $params = [], $namespace = 'http://tempuri.org', $soapAction = '', $headers = FALSE, $rpcParams = NULL, $style = 'rpc',
$use = 'encoded'
) {
$this->operation = $operation;
$this->fault = FALSE;
$this->setError('');
$this->request = ... | php | function call(
$operation, $params = [], $namespace = 'http://tempuri.org', $soapAction = '', $headers = FALSE, $rpcParams = NULL, $style = 'rpc',
$use = 'encoded'
) {
$this->operation = $operation;
$this->fault = FALSE;
$this->setError('');
$this->request = ... | [
"function",
"call",
"(",
"$",
"operation",
",",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"namespace",
"=",
"'http://tempuri.org'",
",",
"$",
"soapAction",
"=",
"''",
",",
"$",
"headers",
"=",
"FALSE",
",",
"$",
"rpcParams",
"=",
"NULL",
",",
"$",
"sty... | calls method, returns PHP native type
@param string $operation SOAP server URL or path
@param mixed $params An array, associative or simple, of the parameters
for the method call, or a string that is the XML
for the call. For rpc style, this call will
wrap the XML in a tag named after the method, as
wel... | [
"calls",
"method",
"returns",
"PHP",
"native",
"type"
] | train | https://github.com/nguyenanhung/nusoap/blob/a9b4d98f4f3fe748f8e5d9f8091dfc53585d2556/src-fix/nusoap.php#L7710-L7900 |
nguyenanhung/nusoap | src-fix/nusoap.php | nusoap_client.parseResponse | function parseResponse($headers, $data)
{
$this->debug('Entering parseResponse() for data of length ' . strlen($data) . ' headers:');
$this->appendDebug($this->varDump($headers));
if (!isset($headers['content-type'])) {
$this->setError('Response not of type text/xml (no content-t... | php | function parseResponse($headers, $data)
{
$this->debug('Entering parseResponse() for data of length ' . strlen($data) . ' headers:');
$this->appendDebug($this->varDump($headers));
if (!isset($headers['content-type'])) {
$this->setError('Response not of type text/xml (no content-t... | [
"function",
"parseResponse",
"(",
"$",
"headers",
",",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"debug",
"(",
"'Entering parseResponse() for data of length '",
".",
"strlen",
"(",
"$",
"data",
")",
".",
"' headers:'",
")",
";",
"$",
"this",
"->",
"appendDeb... | processes SOAP message returned from server
@param array $headers The HTTP headers
@param string $data unprocessed response data from server
@return mixed value of the message, decoded into a PHP type
@access private | [
"processes",
"SOAP",
"message",
"returned",
"from",
"server"
] | train | https://github.com/nguyenanhung/nusoap/blob/a9b4d98f4f3fe748f8e5d9f8091dfc53585d2556/src-fix/nusoap.php#L8072-L8124 |
nguyenanhung/nusoap | src-fix/nusoap.php | nusoap_client.getProxy | function getProxy()
{
$r = rand();
$evalStr = $this->_getProxyClassCode($r);
//$this->debug("proxy class: $evalStr");
if ($this->getError()) {
$this->debug("Error from _getProxyClassCode, so return null");
return NULL;
}
// eval the clas... | php | function getProxy()
{
$r = rand();
$evalStr = $this->_getProxyClassCode($r);
//$this->debug("proxy class: $evalStr");
if ($this->getError()) {
$this->debug("Error from _getProxyClassCode, so return null");
return NULL;
}
// eval the clas... | [
"function",
"getProxy",
"(",
")",
"{",
"$",
"r",
"=",
"rand",
"(",
")",
";",
"$",
"evalStr",
"=",
"$",
"this",
"->",
"_getProxyClassCode",
"(",
"$",
"r",
")",
";",
"//$this->debug(\"proxy class: $evalStr\");",
"if",
"(",
"$",
"this",
"->",
"getError",
"(... | dynamically creates an instance of a proxy class,
allowing user to directly call methods from wsdl
@return object soap_proxy object
@access public | [
"dynamically",
"creates",
"an",
"instance",
"of",
"a",
"proxy",
"class",
"allowing",
"user",
"to",
"directly",
"call",
"methods",
"from",
"wsdl"
] | train | https://github.com/nguyenanhung/nusoap/blob/a9b4d98f4f3fe748f8e5d9f8091dfc53585d2556/src-fix/nusoap.php#L8306-L8349 |
nguyenanhung/nusoap | src-fix/nusoap.php | nusoap_client._getProxyClassCode | function _getProxyClassCode($r)
{
$this->debug("in getProxy endpointType=$this->endpointType");
$this->appendDebug("wsdl=" . $this->varDump($this->wsdl));
if ($this->endpointType != 'wsdl') {
$evalStr = 'A proxy can only be created for a WSDL client';
$this->setError(... | php | function _getProxyClassCode($r)
{
$this->debug("in getProxy endpointType=$this->endpointType");
$this->appendDebug("wsdl=" . $this->varDump($this->wsdl));
if ($this->endpointType != 'wsdl') {
$evalStr = 'A proxy can only be created for a WSDL client';
$this->setError(... | [
"function",
"_getProxyClassCode",
"(",
"$",
"r",
")",
"{",
"$",
"this",
"->",
"debug",
"(",
"\"in getProxy endpointType=$this->endpointType\"",
")",
";",
"$",
"this",
"->",
"appendDebug",
"(",
"\"wsdl=\"",
".",
"$",
"this",
"->",
"varDump",
"(",
"$",
"this",
... | dynamically creates proxy class code
@return string PHP/NuSOAP code for the proxy class
@access private | [
"dynamically",
"creates",
"proxy",
"class",
"code"
] | train | https://github.com/nguyenanhung/nusoap/blob/a9b4d98f4f3fe748f8e5d9f8091dfc53585d2556/src-fix/nusoap.php#L8357-L8411 |
ruvents/ruwork-upload-bundle | Form/Type/UploadType.php | UploadType.buildForm | public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add(self::FILE, $options['file_type'], ['mapped' => false] + $options['file_options'])
->setDataMapper(new UploadMapper(
$this->manager,
$this->savers,
... | php | public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add(self::FILE, $options['file_type'], ['mapped' => false] + $options['file_options'])
->setDataMapper(new UploadMapper(
$this->manager,
$this->savers,
... | [
"public",
"function",
"buildForm",
"(",
"FormBuilderInterface",
"$",
"builder",
",",
"array",
"$",
"options",
")",
"{",
"$",
"builder",
"->",
"add",
"(",
"self",
"::",
"FILE",
",",
"$",
"options",
"[",
"'file_type'",
"]",
",",
"[",
"'mapped'",
"=>",
"fal... | {@inheritdoc} | [
"{"
] | train | https://github.com/ruvents/ruwork-upload-bundle/blob/8ad09cc2dce6ab389105c440d791346696da43af/Form/Type/UploadType.php#L37-L58 |
ruvents/ruwork-upload-bundle | Form/Type/UploadType.php | UploadType.configureOptions | public function configureOptions(OptionsResolver $resolver): void
{
$resolver
->setRequired([
'class',
'finder',
])
->setDefaults([
'empty_data' => null,
'error_bubbling' => false,
'factory' =... | php | public function configureOptions(OptionsResolver $resolver): void
{
$resolver
->setRequired([
'class',
'finder',
])
->setDefaults([
'empty_data' => null,
'error_bubbling' => false,
'factory' =... | [
"public",
"function",
"configureOptions",
"(",
"OptionsResolver",
"$",
"resolver",
")",
":",
"void",
"{",
"$",
"resolver",
"->",
"setRequired",
"(",
"[",
"'class'",
",",
"'finder'",
",",
"]",
")",
"->",
"setDefaults",
"(",
"[",
"'empty_data'",
"=>",
"null",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/ruvents/ruwork-upload-bundle/blob/8ad09cc2dce6ab389105c440d791346696da43af/Form/Type/UploadType.php#L63-L90 |
yuncms/framework | src/user/migrations/m180411_035330_create_rbac_table.php | m180411_035330_create_rbac_table.safeUp | public function safeUp()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
$tableOptions = 'CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE=Inn... | php | public function safeUp()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
$tableOptions = 'CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE=Inn... | [
"public",
"function",
"safeUp",
"(",
")",
"{",
"$",
"tableOptions",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"db",
"->",
"driverName",
"===",
"'mysql'",
")",
"{",
"// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-... | {@inheritdoc} | [
"{"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/user/migrations/m180411_035330_create_rbac_table.php#L13-L60 |
webforge-labs/psc-cms | lib/Psc/Form/ComponentsValidator.php | ComponentsValidator.validateSet | public function validateSet() {
$this->validatedComponents = array(); // jede Componente nur einmal validieren, wir führen buch
$exceptions = array();
foreach ($this->components as $component) {
try {
$this->validateComponent($component);
} catch (ValidatorException $e) {
... | php | public function validateSet() {
$this->validatedComponents = array(); // jede Componente nur einmal validieren, wir führen buch
$exceptions = array();
foreach ($this->components as $component) {
try {
$this->validateComponent($component);
} catch (ValidatorException $e) {
... | [
"public",
"function",
"validateSet",
"(",
")",
"{",
"$",
"this",
"->",
"validatedComponents",
"=",
"array",
"(",
")",
";",
"// jede Componente nur einmal validieren, wir führen buch",
"$",
"exceptions",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"... | Validiert alle Daten anhand der Meta-Daten von den FormDaten
optionals müssen hiervor gesetzt werden
wenn $this->exceptionList TRUE ist werden die ValidationExceptions gesammelt und dann eine ValidatorExceptionList geworfen
wenn FALSE wird direkt die erste ValidatorException geworfen | [
"Validiert",
"alle",
"Daten",
"anhand",
"der",
"Meta",
"-",
"Daten",
"von",
"den",
"FormDaten"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Form/ComponentsValidator.php#L67-L89 |
PortaText/php-sdk | src/PortaText/Command/Base.php | Base.getBody | protected function getBody($method)
{
$file = $this->getArgument("file");
if (!is_null($file)) {
return "file:$file";
}
if (count($this->getArguments($method)) > 0) {
return json_encode($this->getArguments($method));
}
return "";
} | php | protected function getBody($method)
{
$file = $this->getArgument("file");
if (!is_null($file)) {
return "file:$file";
}
if (count($this->getArguments($method)) > 0) {
return json_encode($this->getArguments($method));
}
return "";
} | [
"protected",
"function",
"getBody",
"(",
"$",
"method",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"getArgument",
"(",
"\"file\"",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"file",
")",
")",
"{",
"return",
"\"file:$file\"",
";",
"}",
"if",
... | Returns the body for this endpoint.
@param string $method Method for this command.
@return string | [
"Returns",
"the",
"body",
"for",
"this",
"endpoint",
"."
] | train | https://github.com/PortaText/php-sdk/blob/dbe04ef043db5b251953f9de57aa4d0f1785dfcc/src/PortaText/Command/Base.php#L96-L106 |
PortaText/php-sdk | src/PortaText/Command/Base.php | Base.getContentType | protected function getContentType($method)
{
// Just to make PHPMD happy.
$method = null;
$file = $this->getArgument("file");
if (!is_null($file)) {
return "text/csv";
}
$soundFile = $this->getArgument("sound_file");
if (!is_null($soundFile)) {
... | php | protected function getContentType($method)
{
// Just to make PHPMD happy.
$method = null;
$file = $this->getArgument("file");
if (!is_null($file)) {
return "text/csv";
}
$soundFile = $this->getArgument("sound_file");
if (!is_null($soundFile)) {
... | [
"protected",
"function",
"getContentType",
"(",
"$",
"method",
")",
"{",
"// Just to make PHPMD happy.",
"$",
"method",
"=",
"null",
";",
"$",
"file",
"=",
"$",
"this",
"->",
"getArgument",
"(",
"\"file\"",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
... | Returns the content type for this endpoint.
@param string $method Method for this command.
@return string | [
"Returns",
"the",
"content",
"type",
"for",
"this",
"endpoint",
"."
] | train | https://github.com/PortaText/php-sdk/blob/dbe04ef043db5b251953f9de57aa4d0f1785dfcc/src/PortaText/Command/Base.php#L115-L128 |
PortaText/php-sdk | src/PortaText/Command/Base.php | Base.getAcceptContentType | protected function getAcceptContentType($method)
{
// Just to make PHPMD happy.
$method = null;
$acceptFile = $this->getArgument("accept_file");
if (!is_null($acceptFile)) {
return "text/csv";
}
$acceptAnyFile = $this->getArgument("accept_any_file");
... | php | protected function getAcceptContentType($method)
{
// Just to make PHPMD happy.
$method = null;
$acceptFile = $this->getArgument("accept_file");
if (!is_null($acceptFile)) {
return "text/csv";
}
$acceptAnyFile = $this->getArgument("accept_any_file");
... | [
"protected",
"function",
"getAcceptContentType",
"(",
"$",
"method",
")",
"{",
"// Just to make PHPMD happy.",
"$",
"method",
"=",
"null",
";",
"$",
"acceptFile",
"=",
"$",
"this",
"->",
"getArgument",
"(",
"\"accept_file\"",
")",
";",
"if",
"(",
"!",
"is_null... | Returns the accepted content type for this endpoint.
@param string $method Method for this command.
@return string | [
"Returns",
"the",
"accepted",
"content",
"type",
"for",
"this",
"endpoint",
"."
] | train | https://github.com/PortaText/php-sdk/blob/dbe04ef043db5b251953f9de57aa4d0f1785dfcc/src/PortaText/Command/Base.php#L137-L154 |
PortaText/php-sdk | src/PortaText/Command/Base.php | Base.run | protected function run($method)
{
$endpoint = $this->getEndpoint($method);
$outputFile = $this->getArgument('accept_file');
if (is_null($outputFile)) {
$outputFile = $this->getArgument('accept_any_file');
}
if (is_null($outputFile)) {
$outputFile = $th... | php | protected function run($method)
{
$endpoint = $this->getEndpoint($method);
$outputFile = $this->getArgument('accept_file');
if (is_null($outputFile)) {
$outputFile = $this->getArgument('accept_any_file');
}
if (is_null($outputFile)) {
$outputFile = $th... | [
"protected",
"function",
"run",
"(",
"$",
"method",
")",
"{",
"$",
"endpoint",
"=",
"$",
"this",
"->",
"getEndpoint",
"(",
"$",
"method",
")",
";",
"$",
"outputFile",
"=",
"$",
"this",
"->",
"getArgument",
"(",
"'accept_file'",
")",
";",
"if",
"(",
"... | Runs this command with the given method and returns the result.
@param string $method HTTP Method to use.
@return PortaText\Command\ICommand
@throws PortaText\Exception\RequestError | [
"Runs",
"this",
"command",
"with",
"the",
"given",
"method",
"and",
"returns",
"the",
"result",
"."
] | train | https://github.com/PortaText/php-sdk/blob/dbe04ef043db5b251953f9de57aa4d0f1785dfcc/src/PortaText/Command/Base.php#L219-L243 |
seeruo/framework | src/Service/GitService.php | Git._cmd | private function _cmd($cmd) {
$path = str_replace("\\","/\\", $this->_path);
$cmd = "cd ".$path." && ".$cmd;
$last_line = system($cmd, $retval);
$this->_writeLog( $retval );
return $last_line;
} | php | private function _cmd($cmd) {
$path = str_replace("\\","/\\", $this->_path);
$cmd = "cd ".$path." && ".$cmd;
$last_line = system($cmd, $retval);
$this->_writeLog( $retval );
return $last_line;
} | [
"private",
"function",
"_cmd",
"(",
"$",
"cmd",
")",
"{",
"$",
"path",
"=",
"str_replace",
"(",
"\"\\\\\"",
",",
"\"/\\\\\"",
",",
"$",
"this",
"->",
"_path",
")",
";",
"$",
"cmd",
"=",
"\"cd \"",
".",
"$",
"path",
".",
"\" && \"",
".",
"$",
"cmd",... | /*
运行命令行
该方法可以运行命令行, 并会自动记录命令行日志
@param string $cmd 要运行的命令行
@return boolen | [
"/",
"*",
"运行命令行",
"该方法可以运行命令行",
"并会自动记录命令行日志"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/GitService.php#L67-L73 |
seeruo/framework | src/Service/GitService.php | Git._writeLog | private function _writeLog($msg) {
$log = "-------------------------------------\n";
$log .= date('Y-m-d H:i:s') . ":\n";
$log .= $msg."\n";
$log .= "-------------------------------------\n";
file_put_contents($this->_output, $log, FILE_APPEND | LOCK_EX);
} | php | private function _writeLog($msg) {
$log = "-------------------------------------\n";
$log .= date('Y-m-d H:i:s') . ":\n";
$log .= $msg."\n";
$log .= "-------------------------------------\n";
file_put_contents($this->_output, $log, FILE_APPEND | LOCK_EX);
} | [
"private",
"function",
"_writeLog",
"(",
"$",
"msg",
")",
"{",
"$",
"log",
"=",
"\"-------------------------------------\\n\"",
";",
"$",
"log",
".=",
"date",
"(",
"'Y-m-d H:i:s'",
")",
".",
"\":\\n\"",
";",
"$",
"log",
".=",
"$",
"msg",
".",
"\"\\n\"",
";... | 记录日志
@param string $string [日志内容]
@return [type] [description] | [
"记录日志"
] | train | https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Service/GitService.php#L79-L85 |
onigoetz/imagecache | src/Manager.php | Manager.getOriginalFile | public function getOriginalFile($source_file)
{
$original_file = $this->options['path_local'] . '/' . $source_file;
if (!is_file($original_file)) {
throw new Exceptions\NotFoundException('File not found');
}
return $original_file;
} | php | public function getOriginalFile($source_file)
{
$original_file = $this->options['path_local'] . '/' . $source_file;
if (!is_file($original_file)) {
throw new Exceptions\NotFoundException('File not found');
}
return $original_file;
} | [
"public",
"function",
"getOriginalFile",
"(",
"$",
"source_file",
")",
"{",
"$",
"original_file",
"=",
"$",
"this",
"->",
"options",
"[",
"'path_local'",
"]",
".",
"'/'",
".",
"$",
"source_file",
";",
"if",
"(",
"!",
"is_file",
"(",
"$",
"original_file",
... | The path to the original file
@param $source_file
@return string
@throws Exceptions\NotFoundException | [
"The",
"path",
"to",
"the",
"original",
"file"
] | train | https://github.com/onigoetz/imagecache/blob/8e22c11def1733819183e8296bab3c8a4ffc1d9c/src/Manager.php#L128-L136 |
onigoetz/imagecache | src/Manager.php | Manager.handleRequest | public function handleRequest($preset_key, $file)
{
//do it at the beginning for early validation
$preset = $this->getPresetActions($preset_key, $file);
$source_file = $this->getOriginalFilename($file);
$original_file = $this->getOriginalFile($source_file);
$final_file = ... | php | public function handleRequest($preset_key, $file)
{
//do it at the beginning for early validation
$preset = $this->getPresetActions($preset_key, $file);
$source_file = $this->getOriginalFilename($file);
$original_file = $this->getOriginalFile($source_file);
$final_file = ... | [
"public",
"function",
"handleRequest",
"(",
"$",
"preset_key",
",",
"$",
"file",
")",
"{",
"//do it at the beginning for early validation",
"$",
"preset",
"=",
"$",
"this",
"->",
"getPresetActions",
"(",
"$",
"preset_key",
",",
"$",
"file",
")",
";",
"$",
"sou... | Take a preset and a file and return a transformed image
@param $preset_key string
@param $file string
@throws Exceptions\InvalidPresetException
@throws Exceptions\NotFoundException
@throws \RuntimeException
@return string | [
"Take",
"a",
"preset",
"and",
"a",
"file",
"and",
"return",
"a",
"transformed",
"image"
] | train | https://github.com/onigoetz/imagecache/blob/8e22c11def1733819183e8296bab3c8a4ffc1d9c/src/Manager.php#L148-L170 |
onigoetz/imagecache | src/Manager.php | Manager.verifyDirectoryExistence | protected function verifyDirectoryExistence($base, $cacheDir)
{
if (is_dir("$base/$cacheDir")) {
return;
}
$folder_path = explode('/', $cacheDir);
foreach ($folder_path as $element) {
$base .= '/' . $element;
if (!is_dir($base)) {
... | php | protected function verifyDirectoryExistence($base, $cacheDir)
{
if (is_dir("$base/$cacheDir")) {
return;
}
$folder_path = explode('/', $cacheDir);
foreach ($folder_path as $element) {
$base .= '/' . $element;
if (!is_dir($base)) {
... | [
"protected",
"function",
"verifyDirectoryExistence",
"(",
"$",
"base",
",",
"$",
"cacheDir",
")",
"{",
"if",
"(",
"is_dir",
"(",
"\"$base/$cacheDir\"",
")",
")",
"{",
"return",
";",
"}",
"$",
"folder_path",
"=",
"explode",
"(",
"'/'",
",",
"$",
"cacheDir",... | Create the folder containing the cached images if it doesn't exist
@param $base
@param $cacheDir | [
"Create",
"the",
"folder",
"containing",
"the",
"cached",
"images",
"if",
"it",
"doesn",
"t",
"exist"
] | train | https://github.com/onigoetz/imagecache/blob/8e22c11def1733819183e8296bab3c8a4ffc1d9c/src/Manager.php#L178-L192 |
onigoetz/imagecache | src/Manager.php | Manager.buildImage | protected function buildImage($actions, Image $image, $dst)
{
foreach ($actions as $action) {
// Make sure the width and height are computed first so they can be used
// in relative x/yoffsets like 'center' or 'bottom'.
if (isset($action['width'])) {
$acti... | php | protected function buildImage($actions, Image $image, $dst)
{
foreach ($actions as $action) {
// Make sure the width and height are computed first so they can be used
// in relative x/yoffsets like 'center' or 'bottom'.
if (isset($action['width'])) {
$acti... | [
"protected",
"function",
"buildImage",
"(",
"$",
"actions",
",",
"Image",
"$",
"image",
",",
"$",
"dst",
")",
"{",
"foreach",
"(",
"$",
"actions",
"as",
"$",
"action",
")",
"{",
"// Make sure the width and height are computed first so they can be used",
"// in relat... | Create a new image based on an image preset.
@param array $actions An image preset array.
@param Image $image Path of the source file.
@param string $dst Path of the destination file.
@throws \RuntimeException
@return Image | [
"Create",
"a",
"new",
"image",
"based",
"on",
"an",
"image",
"preset",
"."
] | train | https://github.com/onigoetz/imagecache/blob/8e22c11def1733819183e8296bab3c8a4ffc1d9c/src/Manager.php#L208-L233 |
onigoetz/imagecache | src/Manager.php | Manager.percent | public function percent($value, $current_pixels)
{
if (strpos($value, '%') !== false) {
$value = str_replace('%', '', $value) * 0.01 * $current_pixels;
}
return $value;
} | php | public function percent($value, $current_pixels)
{
if (strpos($value, '%') !== false) {
$value = str_replace('%', '', $value) * 0.01 * $current_pixels;
}
return $value;
} | [
"public",
"function",
"percent",
"(",
"$",
"value",
",",
"$",
"current_pixels",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"value",
",",
"'%'",
")",
"!==",
"false",
")",
"{",
"$",
"value",
"=",
"str_replace",
"(",
"'%'",
",",
"''",
",",
"$",
"value",... | Accept a percentage and return it in pixels.
@param string $value
@param int $current_pixels
@return mixed | [
"Accept",
"a",
"percentage",
"and",
"return",
"it",
"in",
"pixels",
"."
] | train | https://github.com/onigoetz/imagecache/blob/8e22c11def1733819183e8296bab3c8a4ffc1d9c/src/Manager.php#L242-L249 |
onigoetz/imagecache | src/Manager.php | Manager.keywords | public function keywords($value, $current_pixels, $new_pixels)
{
switch ($value) {
case 'top':
case 'left':
$value = 0;
break;
case 'bottom':
case 'right':
$value = $current_pixels - $new_pixels;
... | php | public function keywords($value, $current_pixels, $new_pixels)
{
switch ($value) {
case 'top':
case 'left':
$value = 0;
break;
case 'bottom':
case 'right':
$value = $current_pixels - $new_pixels;
... | [
"public",
"function",
"keywords",
"(",
"$",
"value",
",",
"$",
"current_pixels",
",",
"$",
"new_pixels",
")",
"{",
"switch",
"(",
"$",
"value",
")",
"{",
"case",
"'top'",
":",
"case",
"'left'",
":",
"$",
"value",
"=",
"0",
";",
"break",
";",
"case",
... | Accept a keyword (center, top, left, etc) and return it as an offset in pixels.
@param $value
@param $current_pixels
@param $new_pixels
@return float|int | [
"Accept",
"a",
"keyword",
"(",
"center",
"top",
"left",
"etc",
")",
"and",
"return",
"it",
"as",
"an",
"offset",
"in",
"pixels",
"."
] | train | https://github.com/onigoetz/imagecache/blob/8e22c11def1733819183e8296bab3c8a4ffc1d9c/src/Manager.php#L259-L276 |
CakeCMS/Core | src/ORM/Behavior/ProcessBehavior.php | ProcessBehavior.process | public function process($name, array $ids = [])
{
$allowActions = $this->getConfig('actions');
if (!Arr::key($name, $allowActions)) {
throw new \InvalidArgumentException(__d('core', 'Invalid action to perform'));
}
$action = $allowActions[$name];
if ($action ===... | php | public function process($name, array $ids = [])
{
$allowActions = $this->getConfig('actions');
if (!Arr::key($name, $allowActions)) {
throw new \InvalidArgumentException(__d('core', 'Invalid action to perform'));
}
$action = $allowActions[$name];
if ($action ===... | [
"public",
"function",
"process",
"(",
"$",
"name",
",",
"array",
"$",
"ids",
"=",
"[",
"]",
")",
"{",
"$",
"allowActions",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"'actions'",
")",
";",
"if",
"(",
"!",
"Arr",
"::",
"key",
"(",
"$",
"name",
",",... | Process table method.
@param string $name
@param array $ids
@return mixed | [
"Process",
"table",
"method",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/ORM/Behavior/ProcessBehavior.php#L49-L67 |
CakeCMS/Core | src/ORM/Behavior/ProcessBehavior.php | ProcessBehavior.processDelete | public function processDelete(array $ids)
{
return $this->_table->deleteAll([
$this->_table->getPrimaryKey() . ' IN (' . implode(',', $ids) . ')'
]);
} | php | public function processDelete(array $ids)
{
return $this->_table->deleteAll([
$this->_table->getPrimaryKey() . ' IN (' . implode(',', $ids) . ')'
]);
} | [
"public",
"function",
"processDelete",
"(",
"array",
"$",
"ids",
")",
"{",
"return",
"$",
"this",
"->",
"_table",
"->",
"deleteAll",
"(",
"[",
"$",
"this",
"->",
"_table",
"->",
"getPrimaryKey",
"(",
")",
".",
"' IN ('",
".",
"implode",
"(",
"','",
","... | Process delete method.
@param array $ids
@return int | [
"Process",
"delete",
"method",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/ORM/Behavior/ProcessBehavior.php#L75-L80 |
CakeCMS/Core | src/ORM/Behavior/ProcessBehavior.php | ProcessBehavior._toggleField | protected function _toggleField(array $ids, $value = STATUS_UN_PUBLISH)
{
return $this->_table->updateAll([
$this->_configRead('field') => $value,
], [
$this->_table->getPrimaryKey() . ' IN (' . implode(',', $ids) . ')'
]);
} | php | protected function _toggleField(array $ids, $value = STATUS_UN_PUBLISH)
{
return $this->_table->updateAll([
$this->_configRead('field') => $value,
], [
$this->_table->getPrimaryKey() . ' IN (' . implode(',', $ids) . ')'
]);
} | [
"protected",
"function",
"_toggleField",
"(",
"array",
"$",
"ids",
",",
"$",
"value",
"=",
"STATUS_UN_PUBLISH",
")",
"{",
"return",
"$",
"this",
"->",
"_table",
"->",
"updateAll",
"(",
"[",
"$",
"this",
"->",
"_configRead",
"(",
"'field'",
")",
"=>",
"$"... | Toggle table field.
@param array $ids
@param int $value
@return int | [
"Toggle",
"table",
"field",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/ORM/Behavior/ProcessBehavior.php#L111-L118 |
redaigbaria/oauth2 | src/Entity/AbstractTokenEntity.php | AbstractTokenEntity.setId | public function setId($id = null)
{
$this->id = ($id !== null) ? $id : SecureKey::generate();
return $this;
} | php | public function setId($id = null)
{
$this->id = ($id !== null) ? $id : SecureKey::generate();
return $this;
} | [
"public",
"function",
"setId",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"id",
"=",
"(",
"$",
"id",
"!==",
"null",
")",
"?",
"$",
"id",
":",
"SecureKey",
"::",
"generate",
"(",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Set token ID
@param string $id Token ID
@return self | [
"Set",
"token",
"ID"
] | train | https://github.com/redaigbaria/oauth2/blob/54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a/src/Entity/AbstractTokenEntity.php#L131-L136 |
redaigbaria/oauth2 | src/Entity/AbstractTokenEntity.php | AbstractTokenEntity.setSessionId | public function setSessionId($session_id=null)
{
$this->session_id= ($session_id!== null) ? $session_id : null;
return $this;
} | php | public function setSessionId($session_id=null)
{
$this->session_id= ($session_id!== null) ? $session_id : null;
return $this;
} | [
"public",
"function",
"setSessionId",
"(",
"$",
"session_id",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"session_id",
"=",
"(",
"$",
"session_id",
"!==",
"null",
")",
"?",
"$",
"session_id",
":",
"null",
";",
"return",
"$",
"this",
";",
"}"
] | Set the session id that this token is associated to ..
@param string $session_id Session id | [
"Set",
"the",
"session",
"id",
"that",
"this",
"token",
"is",
"associated",
"to",
".."
] | train | https://github.com/redaigbaria/oauth2/blob/54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a/src/Entity/AbstractTokenEntity.php#L142-L147 |
redaigbaria/oauth2 | src/Entity/AbstractTokenEntity.php | AbstractTokenEntity.formatScopes | protected function formatScopes($unformatted = [])
{
if (is_null($unformatted)) {
return [];
}
$scopes = [];
foreach ($unformatted as $scope) {
if ($scope instanceof ScopeEntity) {
$scopes[$scope->getId()] = $scope;
}
}
... | php | protected function formatScopes($unformatted = [])
{
if (is_null($unformatted)) {
return [];
}
$scopes = [];
foreach ($unformatted as $scope) {
if ($scope instanceof ScopeEntity) {
$scopes[$scope->getId()] = $scope;
}
}
... | [
"protected",
"function",
"formatScopes",
"(",
"$",
"unformatted",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"unformatted",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"scopes",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"unformat... | Format the local scopes array
@param \League\OAuth2\Server\Entity\ScopeEntity[]
@return array | [
"Format",
"the",
"local",
"scopes",
"array"
] | train | https://github.com/redaigbaria/oauth2/blob/54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a/src/Entity/AbstractTokenEntity.php#L189-L203 |
userfriendly/SocialUserBundle | OAuth/UserProvider.php | UserProvider.connect | public function connect( $user, UserResponseInterface $response )
{
$existingIdentity = $this->getExistingIdentity( $response );
if ( $existingIdentity )
{
// $previousUser = $existingIdentity->getUser();
// $event = new UserAccountMergedEvent( 'User accounts merged' );... | php | public function connect( $user, UserResponseInterface $response )
{
$existingIdentity = $this->getExistingIdentity( $response );
if ( $existingIdentity )
{
// $previousUser = $existingIdentity->getUser();
// $event = new UserAccountMergedEvent( 'User accounts merged' );... | [
"public",
"function",
"connect",
"(",
"$",
"user",
",",
"UserResponseInterface",
"$",
"response",
")",
"{",
"$",
"existingIdentity",
"=",
"$",
"this",
"->",
"getExistingIdentity",
"(",
"$",
"response",
")",
";",
"if",
"(",
"$",
"existingIdentity",
")",
"{",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/userfriendly/SocialUserBundle/blob/1dfcf76af2bc639901c471e6f28b04d73fb65452/OAuth/UserProvider.php#L47-L65 |
userfriendly/SocialUserBundle | OAuth/UserProvider.php | UserProvider.loadUserByOAuthUserResponse | public function loadUserByOAuthUserResponse( UserResponseInterface $response )
{
$existingIdentity = $this->getExistingIdentity( $response );
if ( $existingIdentity )
{
$existingIdentity->setAccessToken( $this->getAccessToken( $response ));
return $existingIdentity->g... | php | public function loadUserByOAuthUserResponse( UserResponseInterface $response )
{
$existingIdentity = $this->getExistingIdentity( $response );
if ( $existingIdentity )
{
$existingIdentity->setAccessToken( $this->getAccessToken( $response ));
return $existingIdentity->g... | [
"public",
"function",
"loadUserByOAuthUserResponse",
"(",
"UserResponseInterface",
"$",
"response",
")",
"{",
"$",
"existingIdentity",
"=",
"$",
"this",
"->",
"getExistingIdentity",
"(",
"$",
"response",
")",
";",
"if",
"(",
"$",
"existingIdentity",
")",
"{",
"$... | {@inheritdoc} | [
"{"
] | train | https://github.com/userfriendly/SocialUserBundle/blob/1dfcf76af2bc639901c471e6f28b04d73fb65452/OAuth/UserProvider.php#L81-L90 |
userfriendly/SocialUserBundle | OAuth/UserProvider.php | UserProvider.getExistingIdentity | protected function getExistingIdentity( UserResponseInterface $response )
{
$repo = $this->om->getRepository( $this->userIdentityClass ); // wrong class
return $repo->findOneBy( array(
'identifier' => $response->getUsername(),
'type' => $response->getResourceOwner()->getNam... | php | protected function getExistingIdentity( UserResponseInterface $response )
{
$repo = $this->om->getRepository( $this->userIdentityClass ); // wrong class
return $repo->findOneBy( array(
'identifier' => $response->getUsername(),
'type' => $response->getResourceOwner()->getNam... | [
"protected",
"function",
"getExistingIdentity",
"(",
"UserResponseInterface",
"$",
"response",
")",
"{",
"$",
"repo",
"=",
"$",
"this",
"->",
"om",
"->",
"getRepository",
"(",
"$",
"this",
"->",
"userIdentityClass",
")",
";",
"// wrong class",
"return",
"$",
"... | Checks whether the authenticating Identity already exists
@param \HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response
@return \Userfriendly\Bundle\SocialUserBundle\Model\UserIdentity | [
"Checks",
"whether",
"the",
"authenticating",
"Identity",
"already",
"exists"
] | train | https://github.com/userfriendly/SocialUserBundle/blob/1dfcf76af2bc639901c471e6f28b04d73fb65452/OAuth/UserProvider.php#L98-L105 |
userfriendly/SocialUserBundle | OAuth/UserProvider.php | UserProvider.createUser | protected function createUser( UserResponseInterface $response )
{
$user = $this->userManager->createUser();
$user->setUsername( $this->createUniqueUsername( $this->getRealName( $response )));
$user->setEmail( $this->getEmail( $response ) );
$user->setPassword( '' );
$user->s... | php | protected function createUser( UserResponseInterface $response )
{
$user = $this->userManager->createUser();
$user->setUsername( $this->createUniqueUsername( $this->getRealName( $response )));
$user->setEmail( $this->getEmail( $response ) );
$user->setPassword( '' );
$user->s... | [
"protected",
"function",
"createUser",
"(",
"UserResponseInterface",
"$",
"response",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"userManager",
"->",
"createUser",
"(",
")",
";",
"$",
"user",
"->",
"setUsername",
"(",
"$",
"this",
"->",
"createUniqueUser... | Creates new User
@param \HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response
@return \Userfriendly\Bundle\SocialUserBundle\Model\User | [
"Creates",
"new",
"User"
] | train | https://github.com/userfriendly/SocialUserBundle/blob/1dfcf76af2bc639901c471e6f28b04d73fb65452/OAuth/UserProvider.php#L113-L123 |
userfriendly/SocialUserBundle | OAuth/UserProvider.php | UserProvider.createIdentity | protected function createIdentity( User $user, UserResponseInterface $response )
{
$identity = new $this->userIdentityClass;
$identity->setAccessToken( $this->getAccessToken( $response ));
$identity->setIdentifier( $response->getUsername() );
$identity->setType( $response->getResourc... | php | protected function createIdentity( User $user, UserResponseInterface $response )
{
$identity = new $this->userIdentityClass;
$identity->setAccessToken( $this->getAccessToken( $response ));
$identity->setIdentifier( $response->getUsername() );
$identity->setType( $response->getResourc... | [
"protected",
"function",
"createIdentity",
"(",
"User",
"$",
"user",
",",
"UserResponseInterface",
"$",
"response",
")",
"{",
"$",
"identity",
"=",
"new",
"$",
"this",
"->",
"userIdentityClass",
";",
"$",
"identity",
"->",
"setAccessToken",
"(",
"$",
"this",
... | Creates new Identity
@param \HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response
@param \Userfriendly\Bundle\SocialUserBundle\Model\User $user
@return \Userfriendly\Bundle\SocialUserBundle\Model\UserIdentity | [
"Creates",
"new",
"Identity"
] | train | https://github.com/userfriendly/SocialUserBundle/blob/1dfcf76af2bc639901c471e6f28b04d73fb65452/OAuth/UserProvider.php#L132-L144 |
userfriendly/SocialUserBundle | OAuth/UserProvider.php | UserProvider.createUniqueUsername | protected function createUniqueUsername( $username )
{
$originalName = $username;
$existingUser = $this->userManager->findUserByUsername( $username );
$suffix = 0;
while ( $existingUser )
{
$suffix++;
$username = $originalName . $suffix;
$e... | php | protected function createUniqueUsername( $username )
{
$originalName = $username;
$existingUser = $this->userManager->findUserByUsername( $username );
$suffix = 0;
while ( $existingUser )
{
$suffix++;
$username = $originalName . $suffix;
$e... | [
"protected",
"function",
"createUniqueUsername",
"(",
"$",
"username",
")",
"{",
"$",
"originalName",
"=",
"$",
"username",
";",
"$",
"existingUser",
"=",
"$",
"this",
"->",
"userManager",
"->",
"findUserByUsername",
"(",
"$",
"username",
")",
";",
"$",
"suf... | Ensures uniqueness of username
@param string $username
@return string | [
"Ensures",
"uniqueness",
"of",
"username"
] | train | https://github.com/userfriendly/SocialUserBundle/blob/1dfcf76af2bc639901c471e6f28b04d73fb65452/OAuth/UserProvider.php#L152-L164 |
userfriendly/SocialUserBundle | OAuth/UserProvider.php | UserProvider.getAccessToken | protected function getAccessToken( UserResponseInterface $response )
{
$accessToken = $response->getAccessToken();
switch ( $response->getResourceOwner()->getName() )
{
//case UserIdentity::getReadableType( UserIdentity::TYPE_TWITTER ):
case UserIdentity::getReadableT... | php | protected function getAccessToken( UserResponseInterface $response )
{
$accessToken = $response->getAccessToken();
switch ( $response->getResourceOwner()->getName() )
{
//case UserIdentity::getReadableType( UserIdentity::TYPE_TWITTER ):
case UserIdentity::getReadableT... | [
"protected",
"function",
"getAccessToken",
"(",
"UserResponseInterface",
"$",
"response",
")",
"{",
"$",
"accessToken",
"=",
"$",
"response",
"->",
"getAccessToken",
"(",
")",
";",
"switch",
"(",
"$",
"response",
"->",
"getResourceOwner",
"(",
")",
"->",
"getN... | Workaround method for HWIOAuthBundle issue
Waiting for this issue to be fixed upstream
@param \HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response
@return string | [
"Workaround",
"method",
"for",
"HWIOAuthBundle",
"issue"
] | train | https://github.com/userfriendly/SocialUserBundle/blob/1dfcf76af2bc639901c471e6f28b04d73fb65452/OAuth/UserProvider.php#L174-L185 |
userfriendly/SocialUserBundle | OAuth/UserProvider.php | UserProvider.getRealName | protected function getRealName( UserResponseInterface $response )
{
switch ( $response->getResourceOwner()->getName() )
{
case UserIdentity::getReadableType( UserIdentity::TYPE_YAHOO ):
$responseArray = $response->getResponse();
$name = trim( $responseArra... | php | protected function getRealName( UserResponseInterface $response )
{
switch ( $response->getResourceOwner()->getName() )
{
case UserIdentity::getReadableType( UserIdentity::TYPE_YAHOO ):
$responseArray = $response->getResponse();
$name = trim( $responseArra... | [
"protected",
"function",
"getRealName",
"(",
"UserResponseInterface",
"$",
"response",
")",
"{",
"switch",
"(",
"$",
"response",
"->",
"getResourceOwner",
"(",
")",
"->",
"getName",
"(",
")",
")",
"{",
"case",
"UserIdentity",
"::",
"getReadableType",
"(",
"Use... | Workaround method for HWIOAuthBundle issue
Waiting for this issue to be fixed upstream
@param \HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response
@return string | [
"Workaround",
"method",
"for",
"HWIOAuthBundle",
"issue"
] | train | https://github.com/userfriendly/SocialUserBundle/blob/1dfcf76af2bc639901c471e6f28b04d73fb65452/OAuth/UserProvider.php#L195-L213 |
userfriendly/SocialUserBundle | OAuth/UserProvider.php | UserProvider.getEmail | protected function getEmail( UserResponseInterface $response )
{
$responseArray = $response->getResponse();
switch ( $response->getResourceOwner()->getName() )
{
case UserIdentity::getReadableType( UserIdentity::TYPE_TWITTER ):
return NULL;
case UserId... | php | protected function getEmail( UserResponseInterface $response )
{
$responseArray = $response->getResponse();
switch ( $response->getResourceOwner()->getName() )
{
case UserIdentity::getReadableType( UserIdentity::TYPE_TWITTER ):
return NULL;
case UserId... | [
"protected",
"function",
"getEmail",
"(",
"UserResponseInterface",
"$",
"response",
")",
"{",
"$",
"responseArray",
"=",
"$",
"response",
"->",
"getResponse",
"(",
")",
";",
"switch",
"(",
"$",
"response",
"->",
"getResourceOwner",
"(",
")",
"->",
"getName",
... | Workaround method for HWIOAuthBundle issue
Waiting for this issue to be fixed upstream
@param \HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response
@return string | [
"Workaround",
"method",
"for",
"HWIOAuthBundle",
"issue"
] | train | https://github.com/userfriendly/SocialUserBundle/blob/1dfcf76af2bc639901c471e6f28b04d73fb65452/OAuth/UserProvider.php#L223-L244 |
fsi-open/doctrine-extensions-bundle | DependencyInjection/Compiler/GaufretteFilesystemsPass.php | GaufretteFilesystemsPass.process | public function process(ContainerBuilder $container)
{
$configuration = new Configuration();
$processor = new Processor();
$config = $processor->processConfiguration($configuration, $container->getExtensionConfig('fsi_doctrine_extensions'));
foreach ($config['uploadable_filesystems'... | php | public function process(ContainerBuilder $container)
{
$configuration = new Configuration();
$processor = new Processor();
$config = $processor->processConfiguration($configuration, $container->getExtensionConfig('fsi_doctrine_extensions'));
foreach ($config['uploadable_filesystems'... | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"configuration",
"=",
"new",
"Configuration",
"(",
")",
";",
"$",
"processor",
"=",
"new",
"Processor",
"(",
")",
";",
"$",
"config",
"=",
"$",
"processor",
"->",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/fsi-open/doctrine-extensions-bundle/blob/1b9c01e0b216b2c1b2af087de233abbf3c84b9fe/DependencyInjection/Compiler/GaufretteFilesystemsPass.php#L24-L34 |
SachaMorard/phalcon-console | Library/Phalcon/Commands/Builtin/ClearCache.php | ClearCache.run | public function run(array $parameters)
{
print Color::colorize('Clear File Cache:', Color::FG_BROWN) . PHP_EOL;
$cacheDir = $this->getConfig()->application->cacheDir;
$directories = scandir($cacheDir);
foreach ($directories as $dir) {
if ($dir !== "." && $dir !== ".." && ... | php | public function run(array $parameters)
{
print Color::colorize('Clear File Cache:', Color::FG_BROWN) . PHP_EOL;
$cacheDir = $this->getConfig()->application->cacheDir;
$directories = scandir($cacheDir);
foreach ($directories as $dir) {
if ($dir !== "." && $dir !== ".." && ... | [
"public",
"function",
"run",
"(",
"array",
"$",
"parameters",
")",
"{",
"print",
"Color",
"::",
"colorize",
"(",
"'Clear File Cache:'",
",",
"Color",
"::",
"FG_BROWN",
")",
".",
"PHP_EOL",
";",
"$",
"cacheDir",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"... | {@inheritdoc}
@param array $parameters
@return mixed | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/SachaMorard/phalcon-console/blob/a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3/Library/Phalcon/Commands/Builtin/ClearCache.php#L33-L54 |
transfer-framework/ezplatform | src/Transfer/EzPlatform/Repository/Manager/LanguageManager.php | LanguageManager.find | public function find(ValueObject $object)
{
try {
if (isset($object->data['code'])) {
$language = $this->languageService->loadLanguage($object->data['code']);
}
} catch (NotFoundException $notFoundException) {
// We'll throw our own exception later... | php | public function find(ValueObject $object)
{
try {
if (isset($object->data['code'])) {
$language = $this->languageService->loadLanguage($object->data['code']);
}
} catch (NotFoundException $notFoundException) {
// We'll throw our own exception later... | [
"public",
"function",
"find",
"(",
"ValueObject",
"$",
"object",
")",
"{",
"try",
"{",
"if",
"(",
"isset",
"(",
"$",
"object",
"->",
"data",
"[",
"'code'",
"]",
")",
")",
"{",
"$",
"language",
"=",
"$",
"this",
"->",
"languageService",
"->",
"loadLan... | {@inheritdoc} | [
"{"
] | train | https://github.com/transfer-framework/ezplatform/blob/1b2d87caa1a6b79fd8fc78109c26a2d1d6359c2f/src/Transfer/EzPlatform/Repository/Manager/LanguageManager.php#L66-L81 |
transfer-framework/ezplatform | src/Transfer/EzPlatform/Repository/Manager/LanguageManager.php | LanguageManager.create | public function create(ObjectInterface $object)
{
if (!$object instanceof LanguageObject) {
throw new UnsupportedObjectOperationException(LanguageObject::class, get_class($object));
}
try {
$language = $this->find($object);
$this->languageService->enableL... | php | public function create(ObjectInterface $object)
{
if (!$object instanceof LanguageObject) {
throw new UnsupportedObjectOperationException(LanguageObject::class, get_class($object));
}
try {
$language = $this->find($object);
$this->languageService->enableL... | [
"public",
"function",
"create",
"(",
"ObjectInterface",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"$",
"object",
"instanceof",
"LanguageObject",
")",
"{",
"throw",
"new",
"UnsupportedObjectOperationException",
"(",
"LanguageObject",
"::",
"class",
",",
"get_class",... | {@inheritdoc} | [
"{"
] | train | https://github.com/transfer-framework/ezplatform/blob/1b2d87caa1a6b79fd8fc78109c26a2d1d6359c2f/src/Transfer/EzPlatform/Repository/Manager/LanguageManager.php#L86-L104 |
transfer-framework/ezplatform | src/Transfer/EzPlatform/Repository/Manager/LanguageManager.php | LanguageManager.update | public function update(ObjectInterface $object)
{
if (!$object instanceof LanguageObject) {
throw new UnsupportedObjectOperationException(LanguageObject::class, get_class($object));
}
$language = $this->find($object);
$language = $this->languageService->updateLanguageNam... | php | public function update(ObjectInterface $object)
{
if (!$object instanceof LanguageObject) {
throw new UnsupportedObjectOperationException(LanguageObject::class, get_class($object));
}
$language = $this->find($object);
$language = $this->languageService->updateLanguageNam... | [
"public",
"function",
"update",
"(",
"ObjectInterface",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"$",
"object",
"instanceof",
"LanguageObject",
")",
"{",
"throw",
"new",
"UnsupportedObjectOperationException",
"(",
"LanguageObject",
"::",
"class",
",",
"get_class",... | {@inheritdoc} | [
"{"
] | train | https://github.com/transfer-framework/ezplatform/blob/1b2d87caa1a6b79fd8fc78109c26a2d1d6359c2f/src/Transfer/EzPlatform/Repository/Manager/LanguageManager.php#L109-L121 |
transfer-framework/ezplatform | src/Transfer/EzPlatform/Repository/Manager/LanguageManager.php | LanguageManager.createOrUpdate | public function createOrUpdate(ObjectInterface $object)
{
if (!$object instanceof LanguageObject) {
throw new UnsupportedObjectOperationException(LanguageObject::class, get_class($object));
}
try {
$this->find($object);
return $this->update($object);
... | php | public function createOrUpdate(ObjectInterface $object)
{
if (!$object instanceof LanguageObject) {
throw new UnsupportedObjectOperationException(LanguageObject::class, get_class($object));
}
try {
$this->find($object);
return $this->update($object);
... | [
"public",
"function",
"createOrUpdate",
"(",
"ObjectInterface",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"$",
"object",
"instanceof",
"LanguageObject",
")",
"{",
"throw",
"new",
"UnsupportedObjectOperationException",
"(",
"LanguageObject",
"::",
"class",
",",
"get... | {@inheritdoc} | [
"{"
] | train | https://github.com/transfer-framework/ezplatform/blob/1b2d87caa1a6b79fd8fc78109c26a2d1d6359c2f/src/Transfer/EzPlatform/Repository/Manager/LanguageManager.php#L126-L139 |
transfer-framework/ezplatform | src/Transfer/EzPlatform/Repository/Manager/LanguageManager.php | LanguageManager.remove | public function remove(ObjectInterface $object)
{
if (!$object instanceof LanguageObject) {
throw new UnsupportedObjectOperationException(LanguageObject::class, get_class($object));
}
try {
$language = $this->find($object);
$this->languageService->deleteL... | php | public function remove(ObjectInterface $object)
{
if (!$object instanceof LanguageObject) {
throw new UnsupportedObjectOperationException(LanguageObject::class, get_class($object));
}
try {
$language = $this->find($object);
$this->languageService->deleteL... | [
"public",
"function",
"remove",
"(",
"ObjectInterface",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"$",
"object",
"instanceof",
"LanguageObject",
")",
"{",
"throw",
"new",
"UnsupportedObjectOperationException",
"(",
"LanguageObject",
"::",
"class",
",",
"get_class",... | {@inheritdoc} | [
"{"
] | train | https://github.com/transfer-framework/ezplatform/blob/1b2d87caa1a6b79fd8fc78109c26a2d1d6359c2f/src/Transfer/EzPlatform/Repository/Manager/LanguageManager.php#L144-L164 |
webforge-labs/psc-cms | lib/Psc/Doctrine/EventCollectionSynchronizer.php | EventCollectionSynchronizer.dispatchInsert | protected function dispatchInsert($item, $eventData = array()) {
return $this->manager->dispatchEvent(self::EVENT_INSERT, array_merge(array('item'=>$item), $eventData), $this);
} | php | protected function dispatchInsert($item, $eventData = array()) {
return $this->manager->dispatchEvent(self::EVENT_INSERT, array_merge(array('item'=>$item), $eventData), $this);
} | [
"protected",
"function",
"dispatchInsert",
"(",
"$",
"item",
",",
"$",
"eventData",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"manager",
"->",
"dispatchEvent",
"(",
"self",
"::",
"EVENT_INSERT",
",",
"array_merge",
"(",
"array",
"(",
... | /* Hilfsfunktionen für ableitende Klassen | [
"/",
"*",
"Hilfsfunktionen",
"für",
"ableitende",
"Klassen"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/EventCollectionSynchronizer.php#L75-L77 |
simple-php-mvc/simple-php-mvc | src/MVC/DataBase/PdoProvider.php | PdoProvider.register | public function register(MVC $mvc)
{
$this->pdo = new PDO($this->options['dsn'], $this->options['user'], $this->options['passwd'], $this->options['driverOptions']);
if (!$mvc->hasCvpp('pdo')) {
$mvc->setCvpp('pdo', $this->pdo);
}
} | php | public function register(MVC $mvc)
{
$this->pdo = new PDO($this->options['dsn'], $this->options['user'], $this->options['passwd'], $this->options['driverOptions']);
if (!$mvc->hasCvpp('pdo')) {
$mvc->setCvpp('pdo', $this->pdo);
}
} | [
"public",
"function",
"register",
"(",
"MVC",
"$",
"mvc",
")",
"{",
"$",
"this",
"->",
"pdo",
"=",
"new",
"PDO",
"(",
"$",
"this",
"->",
"options",
"[",
"'dsn'",
"]",
",",
"$",
"this",
"->",
"options",
"[",
"'user'",
"]",
",",
"$",
"this",
"->",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/simple-php-mvc/simple-php-mvc/blob/e319eb09d29afad6993acb4a7e35f32a87dd0841/src/MVC/DataBase/PdoProvider.php#L91-L98 |
yuncms/framework | src/web/Response.php | Response.getContentType | public function getContentType(): string
{
// If the response hasn't been prepared yet, go with what the formatter is going to set
if (!$this->_isPrepared) {
switch ($this->format) {
case self::FORMAT_HTML:
return 'text/html';
case self... | php | public function getContentType(): string
{
// If the response hasn't been prepared yet, go with what the formatter is going to set
if (!$this->_isPrepared) {
switch ($this->format) {
case self::FORMAT_HTML:
return 'text/html';
case self... | [
"public",
"function",
"getContentType",
"(",
")",
":",
"string",
"{",
"// If the response hasn't been prepared yet, go with what the formatter is going to set",
"if",
"(",
"!",
"$",
"this",
"->",
"_isPrepared",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"format",
")"... | Returns the Content-Type header (sans `charset=X`) that the response will most likely include.
@return string|null | [
"Returns",
"the",
"Content",
"-",
"Type",
"header",
"(",
"sans",
"charset",
"=",
"X",
")",
"that",
"the",
"response",
"will",
"most",
"likely",
"include",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/web/Response.php#L30-L56 |
yuncms/framework | src/web/Response.php | Response.setCacheHeaders | public function setCacheHeaders()
{
$cacheTime = 31536000; // 1 year
$this->getHeaders()
->set('Expires', gmdate('D, d M Y H:i:s', time() + $cacheTime) . ' GMT')
->set('Pragma', 'cache')
->set('Cache-Control', 'max-age=' . $cacheTime);
return $this;
} | php | public function setCacheHeaders()
{
$cacheTime = 31536000; // 1 year
$this->getHeaders()
->set('Expires', gmdate('D, d M Y H:i:s', time() + $cacheTime) . ' GMT')
->set('Pragma', 'cache')
->set('Cache-Control', 'max-age=' . $cacheTime);
return $this;
} | [
"public",
"function",
"setCacheHeaders",
"(",
")",
"{",
"$",
"cacheTime",
"=",
"31536000",
";",
"// 1 year",
"$",
"this",
"->",
"getHeaders",
"(",
")",
"->",
"set",
"(",
"'Expires'",
",",
"gmdate",
"(",
"'D, d M Y H:i:s'",
",",
"time",
"(",
")",
"+",
"$"... | Sets headers that will instruct the client to cache this response.
@return static self reference | [
"Sets",
"headers",
"that",
"will",
"instruct",
"the",
"client",
"to",
"cache",
"this",
"response",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/web/Response.php#L63-L72 |
yuncms/framework | src/web/Response.php | Response.setLastModifiedHeader | public function setLastModifiedHeader(string $path)
{
$modifiedTime = filemtime($path);
if ($modifiedTime) {
$this->getHeaders()->set('Last-Modified', gmdate('D, d M Y H:i:s', $modifiedTime) . ' GMT');
}
return $this;
} | php | public function setLastModifiedHeader(string $path)
{
$modifiedTime = filemtime($path);
if ($modifiedTime) {
$this->getHeaders()->set('Last-Modified', gmdate('D, d M Y H:i:s', $modifiedTime) . ' GMT');
}
return $this;
} | [
"public",
"function",
"setLastModifiedHeader",
"(",
"string",
"$",
"path",
")",
"{",
"$",
"modifiedTime",
"=",
"filemtime",
"(",
"$",
"path",
")",
";",
"if",
"(",
"$",
"modifiedTime",
")",
"{",
"$",
"this",
"->",
"getHeaders",
"(",
")",
"->",
"set",
"(... | Sets a Last-Modified header based on a given file path.
@param string $path The file to read the last modified date from.
@return static self reference | [
"Sets",
"a",
"Last",
"-",
"Modified",
"header",
"based",
"on",
"a",
"given",
"file",
"path",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/web/Response.php#L80-L89 |
yuncms/framework | src/web/Response.php | Response.startBuffering | public function startBuffering($content)
{
$this->getHeaders()
->set('Surrogate-Control','BigPipe/1.0')
->set('X-Accel-Buffering', 'no');
$this->data = $content;
$this->send();
} | php | public function startBuffering($content)
{
$this->getHeaders()
->set('Surrogate-Control','BigPipe/1.0')
->set('X-Accel-Buffering', 'no');
$this->data = $content;
$this->send();
} | [
"public",
"function",
"startBuffering",
"(",
"$",
"content",
")",
"{",
"$",
"this",
"->",
"getHeaders",
"(",
")",
"->",
"set",
"(",
"'Surrogate-Control'",
",",
"'BigPipe/1.0'",
")",
"->",
"set",
"(",
"'X-Accel-Buffering'",
",",
"'no'",
")",
";",
"$",
"this... | 开始分片输出
@param string $content | [
"开始分片输出"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/web/Response.php#L95-L102 |
php-rise/rise | src/Response.php | Response.send | public function send($content = null) {
if ($this->sent) {
return $this;
}
if ($this->request->isMethod('HEAD')) {
$this->setMode(self::MODE_STRING);
$this->unsetHeader('Content-Length');
$this->setBody('');
}
switch ($this->mode) {
case self::MODE_STRING:
if ($content !== null) {
$this... | php | public function send($content = null) {
if ($this->sent) {
return $this;
}
if ($this->request->isMethod('HEAD')) {
$this->setMode(self::MODE_STRING);
$this->unsetHeader('Content-Length');
$this->setBody('');
}
switch ($this->mode) {
case self::MODE_STRING:
if ($content !== null) {
$this... | [
"public",
"function",
"send",
"(",
"$",
"content",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"sent",
")",
"{",
"return",
"$",
"this",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"request",
"->",
"isMethod",
"(",
"'HEAD'",
")",
")",
"{",
... | Send response.
@param mixed $content
@return self | [
"Send",
"response",
"."
] | train | https://github.com/php-rise/rise/blob/cd14ef9956f1b6875b7bcd642545dcef6a9152b7/src/Response.php#L218-L268 |
php-rise/rise | src/Response.php | Response.sendFile | public function sendFile($file) {
if ($this->sent) {
return $this;
}
$this->setMode(self::MODE_FILE);
$this->send($file);
return $this;
} | php | public function sendFile($file) {
if ($this->sent) {
return $this;
}
$this->setMode(self::MODE_FILE);
$this->send($file);
return $this;
} | [
"public",
"function",
"sendFile",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"sent",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"this",
"->",
"setMode",
"(",
"self",
"::",
"MODE_FILE",
")",
";",
"$",
"this",
"->",
"send",
"(",... | Send a file.
@param string $file
@return self | [
"Send",
"a",
"file",
"."
] | train | https://github.com/php-rise/rise/blob/cd14ef9956f1b6875b7bcd642545dcef6a9152b7/src/Response.php#L295-L304 |
php-rise/rise | src/Response.php | Response.redirect | public function redirect($url, $statusCode = 302) {
$this->setStatusCode($statusCode)
->setHeader('Location', $url)
->setBody(sprintf('<!DOCTYPE html>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1;url=%1$s">
<title>Redirecting to %1$s</title>
Redirecting to <a href="%1$s">%1$s</a>', htmlspecialch... | php | public function redirect($url, $statusCode = 302) {
$this->setStatusCode($statusCode)
->setHeader('Location', $url)
->setBody(sprintf('<!DOCTYPE html>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1;url=%1$s">
<title>Redirecting to %1$s</title>
Redirecting to <a href="%1$s">%1$s</a>', htmlspecialch... | [
"public",
"function",
"redirect",
"(",
"$",
"url",
",",
"$",
"statusCode",
"=",
"302",
")",
"{",
"$",
"this",
"->",
"setStatusCode",
"(",
"$",
"statusCode",
")",
"->",
"setHeader",
"(",
"'Location'",
",",
"$",
"url",
")",
"->",
"setBody",
"(",
"sprintf... | Setup HTTP redirect.
@param string $url
@param int $statusCode Optional
@return self | [
"Setup",
"HTTP",
"redirect",
"."
] | train | https://github.com/php-rise/rise/blob/cd14ef9956f1b6875b7bcd642545dcef6a9152b7/src/Response.php#L313-L323 |
php-rise/rise | src/Response.php | Response.redirectRoute | public function redirectRoute($name, $params = [], $statusCode = 302) {
$this->redirect($this->urlGenerator->generate($name, $params), $statusCode);
return $this;
} | php | public function redirectRoute($name, $params = [], $statusCode = 302) {
$this->redirect($this->urlGenerator->generate($name, $params), $statusCode);
return $this;
} | [
"public",
"function",
"redirectRoute",
"(",
"$",
"name",
",",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"statusCode",
"=",
"302",
")",
"{",
"$",
"this",
"->",
"redirect",
"(",
"$",
"this",
"->",
"urlGenerator",
"->",
"generate",
"(",
"$",
"name",
",",
... | HTTP redirect to a named route.
@param string $routeName
@param array $params
@param int $statusCode Optional
@return self | [
"HTTP",
"redirect",
"to",
"a",
"named",
"route",
"."
] | train | https://github.com/php-rise/rise/blob/cd14ef9956f1b6875b7bcd642545dcef6a9152b7/src/Response.php#L333-L336 |
php-rise/rise | src/Response.php | Response.closeOutputBuffers | public static function closeOutputBuffers($targetLevel, $flush) {
$status = ob_get_status(true);
$level = count($status);
while ($level-- > $targetLevel
&& (!empty($status[$level]['del'])
|| (isset($status[$level]['flags'])
&& ($status[$level]['flags'] & PHP_OUTPUT_HANDLER_REMOVABLE)
... | php | public static function closeOutputBuffers($targetLevel, $flush) {
$status = ob_get_status(true);
$level = count($status);
while ($level-- > $targetLevel
&& (!empty($status[$level]['del'])
|| (isset($status[$level]['flags'])
&& ($status[$level]['flags'] & PHP_OUTPUT_HANDLER_REMOVABLE)
... | [
"public",
"static",
"function",
"closeOutputBuffers",
"(",
"$",
"targetLevel",
",",
"$",
"flush",
")",
"{",
"$",
"status",
"=",
"ob_get_status",
"(",
"true",
")",
";",
"$",
"level",
"=",
"count",
"(",
"$",
"status",
")",
";",
"while",
"(",
"$",
"level"... | Cleans or flushes output buffers up to target level.
@NOTE Function from Symfony\Component\HttpFoundation\Response
Resulting level can be greater than target level if a non-removable buffer has been encountered.
@param int $targetLevel The target output buffering level
@param bool $flush Whether to flush or c... | [
"Cleans",
"or",
"flushes",
"output",
"buffers",
"up",
"to",
"target",
"level",
"."
] | train | https://github.com/php-rise/rise/blob/cd14ef9956f1b6875b7bcd642545dcef6a9152b7/src/Response.php#L561-L579 |
creonit-dev/PageBundle | Admin/PageTable.php | PageTable.schema | public function schema()
{
$this->setHandler('synchronize', function($request, $response) {
$page = $this->container->get('creonit_page');
$page->synchronizeRoutePages();
$page->clearCache();
});
$this->setHandler('copy', function(ComponentRequest $reques... | php | public function schema()
{
$this->setHandler('synchronize', function($request, $response) {
$page = $this->container->get('creonit_page');
$page->synchronizeRoutePages();
$page->clearCache();
});
$this->setHandler('copy', function(ComponentRequest $reques... | [
"public",
"function",
"schema",
"(",
")",
"{",
"$",
"this",
"->",
"setHandler",
"(",
"'synchronize'",
",",
"function",
"(",
"$",
"request",
",",
"$",
"response",
")",
"{",
"$",
"page",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'creonit_pa... | @title Список страниц
@header
{{ button('Добавить страницу', {size: 'sm', icon: 'file-text-o', type: 'success'}) | open('Page.PageEditor') }}
{{ button('Синхронизировать', {size: 'sm', icon: 'refresh'}) | action('synchronize') }}
@cols Заголовок, Идентификатор, URL, .
@action synchronize(){
this.request('synchronize',... | [
"@title",
"Список",
"страниц",
"@header",
"{{",
"button",
"(",
"Добавить",
"страницу",
"{",
"size",
":",
"sm",
"icon",
":",
"file",
"-",
"text",
"-",
"o",
"type",
":",
"success",
"}",
")",
"|",
"open",
"(",
"Page",
".",
"PageEditor",
")",
"}}",
"{{",... | train | https://github.com/creonit-dev/PageBundle/blob/05aee8f91772aceaea6e688ac4e0593ca98d7884/Admin/PageTable.php#L74-L128 |
barebone-php/barebone-core | lib/LogTrait.php | LogTrait.log | public function log($text, $severity = 'info')
{
if ($severity === 'warn' || $severity === 'warning') {
return Log::warning($text);
}
if ($severity === 'err' || $severity === 'error') {
return Log::error($text);
}
return Log::info($text);
} | php | public function log($text, $severity = 'info')
{
if ($severity === 'warn' || $severity === 'warning') {
return Log::warning($text);
}
if ($severity === 'err' || $severity === 'error') {
return Log::error($text);
}
return Log::info($text);
} | [
"public",
"function",
"log",
"(",
"$",
"text",
",",
"$",
"severity",
"=",
"'info'",
")",
"{",
"if",
"(",
"$",
"severity",
"===",
"'warn'",
"||",
"$",
"severity",
"===",
"'warning'",
")",
"{",
"return",
"Log",
"::",
"warning",
"(",
"$",
"text",
")",
... | Write to application log
@param string $text message
@param string $severity Either 'info', 'warn' or 'error'
@return Boolean Whether the record has been processed | [
"Write",
"to",
"application",
"log"
] | train | https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/LogTrait.php#L38-L49 |
jfusion/org.jfusion.framework | src/User/Userinfo.php | Userinfo.getAnonymizeed | public function getAnonymizeed()
{
$userinfo = $this->toObject();
$userinfo->password_clear = '******';
if (isset($userinfo->password)) {
$userinfo->password = substr($userinfo->password, 0, 6) . '********';
}
if (isset($userinfo->password_salt)) {
$userinfo->password_salt = substr($userinfo->password_... | php | public function getAnonymizeed()
{
$userinfo = $this->toObject();
$userinfo->password_clear = '******';
if (isset($userinfo->password)) {
$userinfo->password = substr($userinfo->password, 0, 6) . '********';
}
if (isset($userinfo->password_salt)) {
$userinfo->password_salt = substr($userinfo->password_... | [
"public",
"function",
"getAnonymizeed",
"(",
")",
"{",
"$",
"userinfo",
"=",
"$",
"this",
"->",
"toObject",
"(",
")",
";",
"$",
"userinfo",
"->",
"password_clear",
"=",
"'******'",
";",
"if",
"(",
"isset",
"(",
"$",
"userinfo",
"->",
"password",
")",
"... | hides sensitive information
@return stdClass parsed userinfo object | [
"hides",
"sensitive",
"information"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/User/Userinfo.php#L210-L221 |
netgen/metadata-bundle | bundle/Form/Type/FieldType/FieldValueTransformer.php | FieldValueTransformer.transform | public function transform($value)
{
if (!$value instanceof Value) {
return null;
}
return array(
'title' => $value->title,
'description' => $value->description,
'keywords' => implode(',', $value->keywords),
'priority' => $value->pr... | php | public function transform($value)
{
if (!$value instanceof Value) {
return null;
}
return array(
'title' => $value->title,
'description' => $value->description,
'keywords' => implode(',', $value->keywords),
'priority' => $value->pr... | [
"public",
"function",
"transform",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"value",
"instanceof",
"Value",
")",
"{",
"return",
"null",
";",
"}",
"return",
"array",
"(",
"'title'",
"=>",
"$",
"value",
"->",
"title",
",",
"'description'",
"=>",... | @param \Netgen\Bundle\MetadataBundle\Core\FieldType\Metadata\Value $value
@return array | [
"@param",
"\\",
"Netgen",
"\\",
"Bundle",
"\\",
"MetadataBundle",
"\\",
"Core",
"\\",
"FieldType",
"\\",
"Metadata",
"\\",
"Value",
"$value"
] | train | https://github.com/netgen/metadata-bundle/blob/12bfca68e8e8f4be409c7151f99dff665c53755b/bundle/Form/Type/FieldType/FieldValueTransformer.php#L26-L40 |
dburkart/scurvy | Scurvy.php | Scurvy.render | private function render() {
$strings = implode($this->strings);
// Render includes
foreach ($this->incTemplates as $path => $include) {
$incOutput = $include->render();
$path = preg_replace("/\//", "\/", $path);
$strings = preg_replace("/\{include\s$path\}/", $incOutput, $strings);
}
// Render ... | php | private function render() {
$strings = implode($this->strings);
// Render includes
foreach ($this->incTemplates as $path => $include) {
$incOutput = $include->render();
$path = preg_replace("/\//", "\/", $path);
$strings = preg_replace("/\{include\s$path\}/", $incOutput, $strings);
}
// Render ... | [
"private",
"function",
"render",
"(",
")",
"{",
"$",
"strings",
"=",
"implode",
"(",
"$",
"this",
"->",
"strings",
")",
";",
"// Render includes",
"foreach",
"(",
"$",
"this",
"->",
"incTemplates",
"as",
"$",
"path",
"=>",
"$",
"include",
")",
"{",
"$"... | The render function goes through and renders the parsed document.
@return string containing the rendered output. | [
"The",
"render",
"function",
"goes",
"through",
"and",
"renders",
"the",
"parsed",
"document",
"."
] | train | https://github.com/dburkart/scurvy/blob/990a7c4f0517298de304438cf9cd95a303a231fb/Scurvy.php#L102-L168 |
dburkart/scurvy | Scurvy.php | Scurvy.set | private function set($var, $val) {
$this->vars[$var] = $val;
// We also need to set $var on each sub-template. So recursively do that
foreach($this->forTemplates as $templateBunch)
foreach($templateBunch as $sub)
$sub->set($var, $val);
foreach($this->ifTemplates as $templateBunch)
foreach($templat... | php | private function set($var, $val) {
$this->vars[$var] = $val;
// We also need to set $var on each sub-template. So recursively do that
foreach($this->forTemplates as $templateBunch)
foreach($templateBunch as $sub)
$sub->set($var, $val);
foreach($this->ifTemplates as $templateBunch)
foreach($templat... | [
"private",
"function",
"set",
"(",
"$",
"var",
",",
"$",
"val",
")",
"{",
"$",
"this",
"->",
"vars",
"[",
"$",
"var",
"]",
"=",
"$",
"val",
";",
"// We also need to set $var on each sub-template. So recursively do that",
"foreach",
"(",
"$",
"this",
"->",
"f... | Sets the value of a variable.
@param string $var variable to set
@param mixed $val value to set var to | [
"Sets",
"the",
"value",
"of",
"a",
"variable",
"."
] | train | https://github.com/dburkart/scurvy/blob/990a7c4f0517298de304438cf9cd95a303a231fb/Scurvy.php#L176-L190 |
dburkart/scurvy | Scurvy.php | Scurvy.require_file | protected function require_file($file) {
if (file_exists($this->template_dir . $file)) {
require_once $this->template_dir . $file;
return true;
}
return false;
} | php | protected function require_file($file) {
if (file_exists($this->template_dir . $file)) {
require_once $this->template_dir . $file;
return true;
}
return false;
} | [
"protected",
"function",
"require_file",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"this",
"->",
"template_dir",
".",
"$",
"file",
")",
")",
"{",
"require_once",
"$",
"this",
"->",
"template_dir",
".",
"$",
"file",
";",
"return",
... | --- Protected functions ------------------------------------------------// | [
"---",
"Protected",
"functions",
"------------------------------------------------",
"//"
] | train | https://github.com/dburkart/scurvy/blob/990a7c4f0517298de304438cf9cd95a303a231fb/Scurvy.php#L194-L200 |
dburkart/scurvy | Scurvy.php | Scurvy.parse | private function parse() {
if ($this->cache) {
$this->cacheFile = $this->CACHE_DIR.'/'.$this->name.$this->checksum();
// Make sure we have a cache directory to write to
if (!is_dir($this->CACHE_DIR)) {
mkdir($this->CACHE_DIR);
}
// If our cache file already exists, load it up
if (file_exists($... | php | private function parse() {
if ($this->cache) {
$this->cacheFile = $this->CACHE_DIR.'/'.$this->name.$this->checksum();
// Make sure we have a cache directory to write to
if (!is_dir($this->CACHE_DIR)) {
mkdir($this->CACHE_DIR);
}
// If our cache file already exists, load it up
if (file_exists($... | [
"private",
"function",
"parse",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"cache",
")",
"{",
"$",
"this",
"->",
"cacheFile",
"=",
"$",
"this",
"->",
"CACHE_DIR",
".",
"'/'",
".",
"$",
"this",
"->",
"name",
".",
"$",
"this",
"->",
"checksum",
"... | Parse the template. The process here is basically to create sub-templates
for some of the language constructs, and tie them in with placeholders in
their parent template. Later, when we call render(), we can put the
output of sub-templates back into their parents. | [
"Parse",
"the",
"template",
".",
"The",
"process",
"here",
"is",
"basically",
"to",
"create",
"sub",
"-",
"templates",
"for",
"some",
"of",
"the",
"language",
"constructs",
"and",
"tie",
"them",
"in",
"with",
"placeholders",
"in",
"their",
"parent",
"templat... | train | https://github.com/dburkart/scurvy/blob/990a7c4f0517298de304438cf9cd95a303a231fb/Scurvy.php#L210-L328 |
dburkart/scurvy | Scurvy.php | Scurvy.parseRecursive | private function parseRecursive($start, $regex, $subName = 'template') {
$re_beg = $regex[0];
$re_end = $regex[1];
$numLines = count($this->strings);
$i = $start;
$n = 0;
$line = 0;
for ($i; $i < $numLines; $i++) {
$match = preg_match($re_beg, $this->strings[$i]);
if ($match) $n += 1;
$match... | php | private function parseRecursive($start, $regex, $subName = 'template') {
$re_beg = $regex[0];
$re_end = $regex[1];
$numLines = count($this->strings);
$i = $start;
$n = 0;
$line = 0;
for ($i; $i < $numLines; $i++) {
$match = preg_match($re_beg, $this->strings[$i]);
if ($match) $n += 1;
$match... | [
"private",
"function",
"parseRecursive",
"(",
"$",
"start",
",",
"$",
"regex",
",",
"$",
"subName",
"=",
"'template'",
")",
"{",
"$",
"re_beg",
"=",
"$",
"regex",
"[",
"0",
"]",
";",
"$",
"re_end",
"=",
"$",
"regex",
"[",
"1",
"]",
";",
"$",
"num... | This function is used by the parse function to grab the contents of
scurvy block statements.
@param start the start index into $this->strings
@param regex the regular expression for the block statement
@param subName the name of the subTemplate (for debugging purposes)
@return a new template with the contents of the b... | [
"This",
"function",
"is",
"used",
"by",
"the",
"parse",
"function",
"to",
"grab",
"the",
"contents",
"of",
"scurvy",
"block",
"statements",
"."
] | train | https://github.com/dburkart/scurvy/blob/990a7c4f0517298de304438cf9cd95a303a231fb/Scurvy.php#L339-L389 |
webforge-labs/psc-cms | lib/Psc/CMS/User.php | User.setPassword | public function setPassword($password) {
if (is_array($password)) {
if ($password['password'] == NULL) return $this;
$this->hashPassword($password['password']);
} else {
if ($password == NULL) return $this;
$this->password = $password;
}
return $this;
} | php | public function setPassword($password) {
if (is_array($password)) {
if ($password['password'] == NULL) return $this;
$this->hashPassword($password['password']);
} else {
if ($password == NULL) return $this;
$this->password = $password;
}
return $this;
} | [
"public",
"function",
"setPassword",
"(",
"$",
"password",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"password",
")",
")",
"{",
"if",
"(",
"$",
"password",
"[",
"'password'",
"]",
"==",
"NULL",
")",
"return",
"$",
"this",
";",
"$",
"this",
"->",
"... | Das setzt das gehashte Passwort und sollte nur intern benutzt werden
um das Passwort zu setzen hashPassword benutzen!
diese Funktion wird intern vom AbstractEntityController benutzt
der Parameter ist dann ein array mit confirmation und password
wir könnten auch im validator mit postValidation() arbeiten, aber so ist ... | [
"Das",
"setzt",
"das",
"gehashte",
"Passwort",
"und",
"sollte",
"nur",
"intern",
"benutzt",
"werden"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/User.php#L118-L127 |
shinjin/freezer | src/Storage/Pdo.php | Pdo.doStore | protected function doStore(array $frozenObject)
{
foreach (array_reverse($frozenObject['objects']) as $id => $object) {
if ($object['isDirty'] === true) {
$payload = array(
'class' => $object['class'],
'state' => $object['state']
... | php | protected function doStore(array $frozenObject)
{
foreach (array_reverse($frozenObject['objects']) as $id => $object) {
if ($object['isDirty'] === true) {
$payload = array(
'class' => $object['class'],
'state' => $object['state']
... | [
"protected",
"function",
"doStore",
"(",
"array",
"$",
"frozenObject",
")",
"{",
"foreach",
"(",
"array_reverse",
"(",
"$",
"frozenObject",
"[",
"'objects'",
"]",
")",
"as",
"$",
"id",
"=>",
"$",
"object",
")",
"{",
"if",
"(",
"$",
"object",
"[",
"'isD... | {@inheritdoc} | [
"{"
] | train | https://github.com/shinjin/freezer/blob/f5955fb5476fa8ac456e27c0edafaae331d02cd3/src/Storage/Pdo.php#L60-L78 |
shinjin/freezer | src/Storage/Pdo.php | Pdo.doFetch | protected function doFetch($id, array &$objects = array())
{
$isRoot = empty($objects);
if (!isset($objects[$id])) {
$stmt = sprintf('SELECT * FROM %s WHERE id = ?', $this->table);
$stmt = $this->db->query($stmt, array($id));
if (($result = $stmt->fetch(\PDO::FE... | php | protected function doFetch($id, array &$objects = array())
{
$isRoot = empty($objects);
if (!isset($objects[$id])) {
$stmt = sprintf('SELECT * FROM %s WHERE id = ?', $this->table);
$stmt = $this->db->query($stmt, array($id));
if (($result = $stmt->fetch(\PDO::FE... | [
"protected",
"function",
"doFetch",
"(",
"$",
"id",
",",
"array",
"&",
"$",
"objects",
"=",
"array",
"(",
")",
")",
"{",
"$",
"isRoot",
"=",
"empty",
"(",
"$",
"objects",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"objects",
"[",
"$",
"id",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/shinjin/freezer/blob/f5955fb5476fa8ac456e27c0edafaae331d02cd3/src/Storage/Pdo.php#L83-L108 |
Chill-project/Main | Controller/ExportController.php | ExportController.indexAction | public function indexAction(Request $request)
{
$exportManager = $this->get('chill.main.export_manager');
$exports = $exportManager->getExports(true);
return $this->render('ChillMainBundle:Export:layout.html.twig', array(
'exports' => $exports
));
} | php | public function indexAction(Request $request)
{
$exportManager = $this->get('chill.main.export_manager');
$exports = $exportManager->getExports(true);
return $this->render('ChillMainBundle:Export:layout.html.twig', array(
'exports' => $exports
));
} | [
"public",
"function",
"indexAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"exportManager",
"=",
"$",
"this",
"->",
"get",
"(",
"'chill.main.export_manager'",
")",
";",
"$",
"exports",
"=",
"$",
"exportManager",
"->",
"getExports",
"(",
"true",
")",... | Render the list of available exports
@param Request $request
@return \Symfony\Component\HttpFoundation\Response | [
"Render",
"the",
"list",
"of",
"available",
"exports"
] | train | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/ExportController.php#L46-L55 |
Chill-project/Main | Controller/ExportController.php | ExportController.newAction | public function newAction(Request $request, $alias)
{
// first check for ACL
$exportManager = $this->get('chill.main.export_manager');
$export = $exportManager->getExport($alias);
if ($exportManager->isGrantedForElement($export) === FALSE) {
throw $this->createAc... | php | public function newAction(Request $request, $alias)
{
// first check for ACL
$exportManager = $this->get('chill.main.export_manager');
$export = $exportManager->getExport($alias);
if ($exportManager->isGrantedForElement($export) === FALSE) {
throw $this->createAc... | [
"public",
"function",
"newAction",
"(",
"Request",
"$",
"request",
",",
"$",
"alias",
")",
"{",
"// first check for ACL",
"$",
"exportManager",
"=",
"$",
"this",
"->",
"get",
"(",
"'chill.main.export_manager'",
")",
";",
"$",
"export",
"=",
"$",
"exportManager... | handle the step to build a query for an export
This action has three steps :
1.'export', the export form. When the form is posted, the data is stored
in the session (if valid), and then a redirection is done to next step.
2. 'formatter', the formatter form. When the form is posted, the data is
stored in the session (... | [
"handle",
"the",
"step",
"to",
"build",
"a",
"query",
"for",
"an",
"export"
] | train | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/ExportController.php#L73-L100 |
Chill-project/Main | Controller/ExportController.php | ExportController.exportFormStep | protected function exportFormStep(Request $request, $alias)
{
$exportManager = $this->get('chill.main.export_manager');
// check we have data from the previous step (export step)
$data = $this->get('session')->get('centers_step', null);
if ($data === null) {
... | php | protected function exportFormStep(Request $request, $alias)
{
$exportManager = $this->get('chill.main.export_manager');
// check we have data from the previous step (export step)
$data = $this->get('session')->get('centers_step', null);
if ($data === null) {
... | [
"protected",
"function",
"exportFormStep",
"(",
"Request",
"$",
"request",
",",
"$",
"alias",
")",
"{",
"$",
"exportManager",
"=",
"$",
"this",
"->",
"get",
"(",
"'chill.main.export_manager'",
")",
";",
"// check we have data from the previous step (export step)",
"$"... | Render the export form
When the method is POST, the form is stored if valid, and a redirection
is done to next step.
@param string $alias
@return \Symfony\Component\HttpFoundation\Response | [
"Render",
"the",
"export",
"form"
] | train | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/ExportController.php#L154-L203 |
Chill-project/Main | Controller/ExportController.php | ExportController.createCreateFormExport | protected function createCreateFormExport($alias, $step, $data = array())
{
/* @var $exportManager \Chill\MainBundle\Export\ExportManager */
$exportManager = $this->get('chill.main.export_manager');
$isGenerate = strpos($step, 'generate_') === 0;
$builder = $this->get('form.... | php | protected function createCreateFormExport($alias, $step, $data = array())
{
/* @var $exportManager \Chill\MainBundle\Export\ExportManager */
$exportManager = $this->get('chill.main.export_manager');
$isGenerate = strpos($step, 'generate_') === 0;
$builder = $this->get('form.... | [
"protected",
"function",
"createCreateFormExport",
"(",
"$",
"alias",
",",
"$",
"step",
",",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"/* @var $exportManager \\Chill\\MainBundle\\Export\\ExportManager */",
"$",
"exportManager",
"=",
"$",
"this",
"->",
"get",
... | create a form to show on different steps.
@param string $alias
@param string $step, can either be 'export', 'formatter', 'generate_export' or 'generate_formatter' (last two are used by generate action)
@param array $data the data from previous step. Required for steps 'formatter' and 'generate_formatter'
@return \Symf... | [
"create",
"a",
"form",
"to",
"show",
"on",
"different",
"steps",
"."
] | train | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/ExportController.php#L213-L253 |
Chill-project/Main | Controller/ExportController.php | ExportController.getNextStep | private function getNextStep($step, $reverse = false)
{
switch($step) {
case 'centers':
if ($reverse !== false) {
throw new \LogicException("there is no step before 'export'");
}
return 'export';
case 'export':
... | php | private function getNextStep($step, $reverse = false)
{
switch($step) {
case 'centers':
if ($reverse !== false) {
throw new \LogicException("there is no step before 'export'");
}
return 'export';
case 'export':
... | [
"private",
"function",
"getNextStep",
"(",
"$",
"step",
",",
"$",
"reverse",
"=",
"false",
")",
"{",
"switch",
"(",
"$",
"step",
")",
"{",
"case",
"'centers'",
":",
"if",
"(",
"$",
"reverse",
"!==",
"false",
")",
"{",
"throw",
"new",
"\\",
"LogicExce... | get the next step. If $reverse === true, the previous step is returned.
This method provides a centralized way of handling next/previous step.
@param string $step the current step
@param boolean $reverse set to true to get the previous step
@return string the next/current step
@throws \LogicException if there is no s... | [
"get",
"the",
"next",
"step",
".",
"If",
"$reverse",
"===",
"true",
"the",
"previous",
"step",
"is",
"returned",
"."
] | train | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/ExportController.php#L265-L286 |
Chill-project/Main | Controller/ExportController.php | ExportController.forwardToGenerate | protected function forwardToGenerate(Request $request, $alias)
{
$dataCenters = $this->get('session')->get('centers_step_raw', null);
$dataFormatter = $this->get('session')->get('formatter_step_raw', null);
$dataExport = $this->get('session')->get('export_step_raw', null);
i... | php | protected function forwardToGenerate(Request $request, $alias)
{
$dataCenters = $this->get('session')->get('centers_step_raw', null);
$dataFormatter = $this->get('session')->get('formatter_step_raw', null);
$dataExport = $this->get('session')->get('export_step_raw', null);
i... | [
"protected",
"function",
"forwardToGenerate",
"(",
"Request",
"$",
"request",
",",
"$",
"alias",
")",
"{",
"$",
"dataCenters",
"=",
"$",
"this",
"->",
"get",
"(",
"'session'",
")",
"->",
"get",
"(",
"'centers_step_raw'",
",",
"null",
")",
";",
"$",
"data... | Gather data stored in session from previous steps, and redirect
to the `generate` action, compiling data from previous step in the URL
(to obtain a GET HTTP query).
The data from previous steps is removed from session.
@param Request $request
@param string $alias
@return \Symfony\Component\HttpFoundation\RedirectResp... | [
"Gather",
"data",
"stored",
"in",
"session",
"from",
"previous",
"steps",
"and",
"redirect",
"to",
"the",
"generate",
"action",
"compiling",
"data",
"from",
"previous",
"step",
"in",
"the",
"URL",
"(",
"to",
"obtain",
"a",
"GET",
"HTTP",
"query",
")",
"."
... | train | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/ExportController.php#L351-L379 |
Chill-project/Main | Controller/ExportController.php | ExportController.generateAction | public function generateAction(Request $request, $alias)
{
/* @var $exportManager \Chill\MainBundle\Export\ExportManager */
$exportManager = $this->get('chill.main.export_manager');
$formCenters = $this->createCreateFormExport($alias, 'generate_centers');
$formCenters->handl... | php | public function generateAction(Request $request, $alias)
{
/* @var $exportManager \Chill\MainBundle\Export\ExportManager */
$exportManager = $this->get('chill.main.export_manager');
$formCenters = $this->createCreateFormExport($alias, 'generate_centers');
$formCenters->handl... | [
"public",
"function",
"generateAction",
"(",
"Request",
"$",
"request",
",",
"$",
"alias",
")",
"{",
"/* @var $exportManager \\Chill\\MainBundle\\Export\\ExportManager */",
"$",
"exportManager",
"=",
"$",
"this",
"->",
"get",
"(",
"'chill.main.export_manager'",
")",
";"... | Generate a report.
This action must work with GET queries.
@param Request $request
@param string $alias
@return \Symfony\Component\HttpFoundation\Response | [
"Generate",
"a",
"report",
"."
] | train | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Controller/ExportController.php#L390-L415 |
hendrikmaus/reynaldo | src/Parser/RefractParser.php | RefractParser.iterate | private function iterate(array $content, $parent = null)
{
foreach ($content as $element) {
$this->process($element, $parent);
}
} | php | private function iterate(array $content, $parent = null)
{
foreach ($content as $element) {
$this->process($element, $parent);
}
} | [
"private",
"function",
"iterate",
"(",
"array",
"$",
"content",
",",
"$",
"parent",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"content",
"as",
"$",
"element",
")",
"{",
"$",
"this",
"->",
"process",
"(",
"$",
"element",
",",
"$",
"parent",
")",
"... | Iterate given content array and call `process` for every element inside
@param array $content
@param null|BaseElement $parent | [
"Iterate",
"given",
"content",
"array",
"and",
"call",
"process",
"for",
"every",
"element",
"inside"
] | train | https://github.com/hendrikmaus/reynaldo/blob/be100f56e8f39d86d16ce9222838d20f462e8678/src/Parser/RefractParser.php#L60-L65 |
hendrikmaus/reynaldo | src/Parser/RefractParser.php | RefractParser.process | private function process(array $element, $parent = null)
{
$apiElement = $element['element'];
if (isset($this->elementMap[$apiElement])) {
$this->processElement(
$element,
$this->elementMap[$apiElement],
$parent
);
}
... | php | private function process(array $element, $parent = null)
{
$apiElement = $element['element'];
if (isset($this->elementMap[$apiElement])) {
$this->processElement(
$element,
$this->elementMap[$apiElement],
$parent
);
}
... | [
"private",
"function",
"process",
"(",
"array",
"$",
"element",
",",
"$",
"parent",
"=",
"null",
")",
"{",
"$",
"apiElement",
"=",
"$",
"element",
"[",
"'element'",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"elementMap",
"[",
"$",
"apiEle... | Create php classes using raw element data; called recursively
@param array $element
@param null|BaseElement $parent | [
"Create",
"php",
"classes",
"using",
"raw",
"element",
"data",
";",
"called",
"recursively"
] | train | https://github.com/hendrikmaus/reynaldo/blob/be100f56e8f39d86d16ce9222838d20f462e8678/src/Parser/RefractParser.php#L73-L89 |
hendrikmaus/reynaldo | src/Parser/RefractParser.php | RefractParser.processElement | private function processElement(array $element, $class, BaseElement $parent, $replaceAttribute = null)
{
$apiElement = new $class($element);
if (!$replaceAttribute) {
$parent->addContentElement($apiElement);
} else {
$parent->replaceAttributeWithElement($replaceAttri... | php | private function processElement(array $element, $class, BaseElement $parent, $replaceAttribute = null)
{
$apiElement = new $class($element);
if (!$replaceAttribute) {
$parent->addContentElement($apiElement);
} else {
$parent->replaceAttributeWithElement($replaceAttri... | [
"private",
"function",
"processElement",
"(",
"array",
"$",
"element",
",",
"$",
"class",
",",
"BaseElement",
"$",
"parent",
",",
"$",
"replaceAttribute",
"=",
"null",
")",
"{",
"$",
"apiElement",
"=",
"new",
"$",
"class",
"(",
"$",
"element",
")",
";",
... | Create new element from raw data and add it to its parent
@param array $element Raw element data
@param string $class FQCN to use for creating an element
@param BaseElement $parent parent element to add the newly created one to
@param null|string $replaceAttribute usually, the new element will be added to the content
... | [
"Create",
"new",
"element",
"from",
"raw",
"data",
"and",
"add",
"it",
"to",
"its",
"parent"
] | train | https://github.com/hendrikmaus/reynaldo/blob/be100f56e8f39d86d16ce9222838d20f462e8678/src/Parser/RefractParser.php#L103-L137 |
hendrikmaus/reynaldo | src/Parser/RefractParser.php | RefractParser.processCategory | private function processCategory(array $element, $parent = null)
{
if ($this->isMasterCategory($element)) {
$this->createCategory($element, MasterCategoryElement::class, $this->parseResult);
}
if ($this->isResourceGroup($element)) {
$this->createCategory($element, Re... | php | private function processCategory(array $element, $parent = null)
{
if ($this->isMasterCategory($element)) {
$this->createCategory($element, MasterCategoryElement::class, $this->parseResult);
}
if ($this->isResourceGroup($element)) {
$this->createCategory($element, Re... | [
"private",
"function",
"processCategory",
"(",
"array",
"$",
"element",
",",
"$",
"parent",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isMasterCategory",
"(",
"$",
"element",
")",
")",
"{",
"$",
"this",
"->",
"createCategory",
"(",
"$",
"ele... | Helper to create different php classes from element `category` which carries its actual meaning in its classes
@param array $element
@param null|BaseElement $parent | [
"Helper",
"to",
"create",
"different",
"php",
"classes",
"from",
"element",
"category",
"which",
"carries",
"its",
"actual",
"meaning",
"in",
"its",
"classes"
] | train | https://github.com/hendrikmaus/reynaldo/blob/be100f56e8f39d86d16ce9222838d20f462e8678/src/Parser/RefractParser.php#L145-L158 |
hendrikmaus/reynaldo | src/Parser/RefractParser.php | RefractParser.createCategory | private function createCategory(array $element, $className, BaseElement $parent)
{
$newElement = new $className($element);
$parent->addContentElement($newElement);
$this->iterate($element['content'], $newElement);
} | php | private function createCategory(array $element, $className, BaseElement $parent)
{
$newElement = new $className($element);
$parent->addContentElement($newElement);
$this->iterate($element['content'], $newElement);
} | [
"private",
"function",
"createCategory",
"(",
"array",
"$",
"element",
",",
"$",
"className",
",",
"BaseElement",
"$",
"parent",
")",
"{",
"$",
"newElement",
"=",
"new",
"$",
"className",
"(",
"$",
"element",
")",
";",
"$",
"parent",
"->",
"addContentEleme... | Sub-helper for `processCategory`
@param array $element
@param string $className
@param BaseElement $parent | [
"Sub",
"-",
"helper",
"for",
"processCategory"
] | train | https://github.com/hendrikmaus/reynaldo/blob/be100f56e8f39d86d16ce9222838d20f462e8678/src/Parser/RefractParser.php#L190-L195 |
simple-php-mvc/simple-php-mvc | src/MVC/Controller/Controller.php | Controller.call | final public function call(MVC $mvc, $method, $fileView = null)
{
if (!method_exists($this, $method)) {
throw new \LogicException(sprintf('Method "s" don\'t exists.', $method));
}
# Replace the view object
$this->view = $mvc->view();
# Arguments of method
... | php | final public function call(MVC $mvc, $method, $fileView = null)
{
if (!method_exists($this, $method)) {
throw new \LogicException(sprintf('Method "s" don\'t exists.', $method));
}
# Replace the view object
$this->view = $mvc->view();
# Arguments of method
... | [
"final",
"public",
"function",
"call",
"(",
"MVC",
"$",
"mvc",
",",
"$",
"method",
",",
"$",
"fileView",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"this",
",",
"$",
"method",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicExcept... | Call a action of controller
@access public
@param MVC $mvc MVC Application object
@param string $method Method or Function of the Class Controller
@param string $fileView String of the view file
@return array Response array
@throws \LogicException | [
"Call",
"a",
"action",
"of",
"controller"
] | train | https://github.com/simple-php-mvc/simple-php-mvc/blob/e319eb09d29afad6993acb4a7e35f32a87dd0841/src/MVC/Controller/Controller.php#L56-L110 |
simple-php-mvc/simple-php-mvc | src/MVC/Controller/Controller.php | Controller.renderJson | public function renderJson($value)
{
$options = JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP;
return json_encode($value, $options);
} | php | public function renderJson($value)
{
$options = JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP;
return json_encode($value, $options);
} | [
"public",
"function",
"renderJson",
"(",
"$",
"value",
")",
"{",
"$",
"options",
"=",
"JSON_HEX_TAG",
"|",
"JSON_HEX_APOS",
"|",
"JSON_HEX_QUOT",
"|",
"JSON_HEX_AMP",
";",
"return",
"json_encode",
"(",
"$",
"value",
",",
"$",
"options",
")",
";",
"}"
] | Converts the supplied value to JSON.
@access public
@param mixed $value The value to encode.
@return string | [
"Converts",
"the",
"supplied",
"value",
"to",
"JSON",
"."
] | train | https://github.com/simple-php-mvc/simple-php-mvc/blob/e319eb09d29afad6993acb4a7e35f32a87dd0841/src/MVC/Controller/Controller.php#L128-L132 |
shrink0r/workflux | src/StateMachine.php | StateMachine.execute | public function execute(InputInterface $input, string $start_state = null): OutputInterface
{
$execution_tracker = new ExecutionTracker($this);
$next_state = $this->determineStartState($input, $start_state);
do {
$cur_cycle = $execution_tracker->track($next_state);
$o... | php | public function execute(InputInterface $input, string $start_state = null): OutputInterface
{
$execution_tracker = new ExecutionTracker($this);
$next_state = $this->determineStartState($input, $start_state);
do {
$cur_cycle = $execution_tracker->track($next_state);
$o... | [
"public",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"string",
"$",
"start_state",
"=",
"null",
")",
":",
"OutputInterface",
"{",
"$",
"execution_tracker",
"=",
"new",
"ExecutionTracker",
"(",
"$",
"this",
")",
";",
"$",
"next_state",
"... | @param InputInterface $input
@param string $start_state
@return OutputInterface | [
"@param",
"InputInterface",
"$input",
"@param",
"string",
"$start_state"
] | train | https://github.com/shrink0r/workflux/blob/008f45c64f52b1f795ab7f6ddbfc1a55580254d9/src/StateMachine.php#L69-L87 |
shrink0r/workflux | src/StateMachine.php | StateMachine.determineStartState | private function determineStartState(InputInterface $input, string $state_name = null): StateInterface
{
if (!$state_name) {
return $this->getInitialState();
}
if (!$this->states->has($state_name)) {
throw new ExecutionError("Trying to start statemachine execution at ... | php | private function determineStartState(InputInterface $input, string $state_name = null): StateInterface
{
if (!$state_name) {
return $this->getInitialState();
}
if (!$this->states->has($state_name)) {
throw new ExecutionError("Trying to start statemachine execution at ... | [
"private",
"function",
"determineStartState",
"(",
"InputInterface",
"$",
"input",
",",
"string",
"$",
"state_name",
"=",
"null",
")",
":",
"StateInterface",
"{",
"if",
"(",
"!",
"$",
"state_name",
")",
"{",
"return",
"$",
"this",
"->",
"getInitialState",
"(... | @param InputInterface $input
@param string $state_name
@return StateInterface | [
"@param",
"InputInterface",
"$input",
"@param",
"string",
"$state_name"
] | train | https://github.com/shrink0r/workflux/blob/008f45c64f52b1f795ab7f6ddbfc1a55580254d9/src/StateMachine.php#L135-L153 |
shrink0r/workflux | src/StateMachine.php | StateMachine.activateTransition | private function activateTransition(InputInterface $input, OutputInterface $output)
{
$next_state = null;
foreach ($this->state_transitions->get($output->getCurrentState()) as $transition) {
if ($transition->isActivatedBy($input, $output)) {
if (is_null($next_state)) {
... | php | private function activateTransition(InputInterface $input, OutputInterface $output)
{
$next_state = null;
foreach ($this->state_transitions->get($output->getCurrentState()) as $transition) {
if ($transition->isActivatedBy($input, $output)) {
if (is_null($next_state)) {
... | [
"private",
"function",
"activateTransition",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"next_state",
"=",
"null",
";",
"foreach",
"(",
"$",
"this",
"->",
"state_transitions",
"->",
"get",
"(",
"$",
"output",
"... | @param InputInterface $input
@param OutputInterface $output
@return StateInterface|null | [
"@param",
"InputInterface",
"$input",
"@param",
"OutputInterface",
"$output"
] | train | https://github.com/shrink0r/workflux/blob/008f45c64f52b1f795ab7f6ddbfc1a55580254d9/src/StateMachine.php#L161-L178 |
4devs/ElfinderPhpConnector | Driver/AbstractDriver.php | AbstractDriver.addDisabledCmd | public function addDisabledCmd($cmd)
{
if (!isset($this->options['disabled'])) {
$this->options['disabled'] = [];
}
if (array_search($cmd, $this->options['disabled']) === false) {
$this->options['disabled'][] = $cmd;
}
return $this;
} | php | public function addDisabledCmd($cmd)
{
if (!isset($this->options['disabled'])) {
$this->options['disabled'] = [];
}
if (array_search($cmd, $this->options['disabled']) === false) {
$this->options['disabled'][] = $cmd;
}
return $this;
} | [
"public",
"function",
"addDisabledCmd",
"(",
"$",
"cmd",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"options",
"[",
"'disabled'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"options",
"[",
"'disabled'",
"]",
"=",
"[",
"]",
";",
"}",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Driver/AbstractDriver.php#L97-L107 |
Craftsware/scissor | src/Lib/Time.php | Time.offset | public function offset($timezone)
{
$timeOffset = (new \DateTimeZone($timezone))->getOffset(new \DateTime('now', new \DateTimeZone('UTC')));
if($timeOffset < 0) {
return 'UTC -'. gmdate('H:i', -$timeOffset);
} else {
return 'UTC +'. gmdate('H:i', $timeOffset);
... | php | public function offset($timezone)
{
$timeOffset = (new \DateTimeZone($timezone))->getOffset(new \DateTime('now', new \DateTimeZone('UTC')));
if($timeOffset < 0) {
return 'UTC -'. gmdate('H:i', -$timeOffset);
} else {
return 'UTC +'. gmdate('H:i', $timeOffset);
... | [
"public",
"function",
"offset",
"(",
"$",
"timezone",
")",
"{",
"$",
"timeOffset",
"=",
"(",
"new",
"\\",
"DateTimeZone",
"(",
"$",
"timezone",
")",
")",
"->",
"getOffset",
"(",
"new",
"\\",
"DateTime",
"(",
"'now'",
",",
"new",
"\\",
"DateTimeZone",
"... | Get Time Offset | [
"Get",
"Time",
"Offset"
] | train | https://github.com/Craftsware/scissor/blob/644e4a8ea9859fc30fee36705e54784acd8d43e2/src/Lib/Time.php#L52-L64 |
Craftsware/scissor | src/Lib/Time.php | Time.datetime | public function datetime($datetime, $timezone = null, $format = 'M/d/Y - h:i:s A')
{
$datetime = new \DateTime($datetime);
if($timezone) {
$datetime->setTimezone(new \DateTimeZone($timezone));
}
return $datetime->format($format);
} | php | public function datetime($datetime, $timezone = null, $format = 'M/d/Y - h:i:s A')
{
$datetime = new \DateTime($datetime);
if($timezone) {
$datetime->setTimezone(new \DateTimeZone($timezone));
}
return $datetime->format($format);
} | [
"public",
"function",
"datetime",
"(",
"$",
"datetime",
",",
"$",
"timezone",
"=",
"null",
",",
"$",
"format",
"=",
"'M/d/Y - h:i:s A'",
")",
"{",
"$",
"datetime",
"=",
"new",
"\\",
"DateTime",
"(",
"$",
"datetime",
")",
";",
"if",
"(",
"$",
"timezone"... | Set Date and Time | [
"Set",
"Date",
"and",
"Time"
] | train | https://github.com/Craftsware/scissor/blob/644e4a8ea9859fc30fee36705e54784acd8d43e2/src/Lib/Time.php#L70-L80 |
Craftsware/scissor | src/Lib/Time.php | Time.timezones | public function timezones()
{
$timezone = [];
foreach(timezone_identifiers_list() as $key => $value) {
$timezone[$key] = [
'timezone' => $value,
'offset' => $this->offset($value)
];
}
return $timezone;
} | php | public function timezones()
{
$timezone = [];
foreach(timezone_identifiers_list() as $key => $value) {
$timezone[$key] = [
'timezone' => $value,
'offset' => $this->offset($value)
];
}
return $timezone;
} | [
"public",
"function",
"timezones",
"(",
")",
"{",
"$",
"timezone",
"=",
"[",
"]",
";",
"foreach",
"(",
"timezone_identifiers_list",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"timezone",
"[",
"$",
"key",
"]",
"=",
"[",
"'timezone'... | Get Timezone | [
"Get",
"Timezone"
] | train | https://github.com/Craftsware/scissor/blob/644e4a8ea9859fc30fee36705e54784acd8d43e2/src/Lib/Time.php#L87-L100 |
webforge-labs/psc-cms | lib/Psc/System/Deploy/Deployer.php | Deployer.createTask | public function createTask($name) {
$this->init();
$class = Code::expandNamespace(\Webforge\Common\String::expand($name, 'Task'), 'Psc\System\Deploy');
$gClass = GClass::factory($class);
$params = array();
if ($gClass->hasMethod('__construct')) {
$constructor = $gClass->getMethod('__const... | php | public function createTask($name) {
$this->init();
$class = Code::expandNamespace(\Webforge\Common\String::expand($name, 'Task'), 'Psc\System\Deploy');
$gClass = GClass::factory($class);
$params = array();
if ($gClass->hasMethod('__construct')) {
$constructor = $gClass->getMethod('__const... | [
"public",
"function",
"createTask",
"(",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"init",
"(",
")",
";",
"$",
"class",
"=",
"Code",
"::",
"expandNamespace",
"(",
"\\",
"Webforge",
"\\",
"Common",
"\\",
"String",
"::",
"expand",
"(",
"$",
"name",
","... | wird automatisch mit dependencies erstellt
@param string $name der Name des Tasks ohne Namespace und "Task" dahinter | [
"wird",
"automatisch",
"mit",
"dependencies",
"erstellt"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/System/Deploy/Deployer.php#L130-L144 |
VincentChalnot/SidusAdminBundle | DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root($this->root);
$rootNode
->children()
->scalarNode('admin_class')->defaultValue(Admin::class)->end()
->scalarNode('action_class')->defaul... | php | public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root($this->root);
$rootNode
->children()
->scalarNode('admin_class')->defaultValue(Admin::class)->end()
->scalarNode('action_class')->defaul... | [
"public",
"function",
"getConfigTreeBuilder",
"(",
")",
":",
"TreeBuilder",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
")",
";",
"$",
"rootNode",
"=",
"$",
"treeBuilder",
"->",
"root",
"(",
"$",
"this",
"->",
"root",
")",
";",
"$",
"rootNod... | {@inheritdoc}
@throws \RuntimeException | [
"{"
] | train | https://github.com/VincentChalnot/SidusAdminBundle/blob/3366f3f1525435860cf275ed2f1f0b58cf6eea18/DependencyInjection/Configuration.php#L44-L58 |
VincentChalnot/SidusAdminBundle | DependencyInjection/Configuration.php | Configuration.getAdminConfigTreeBuilder | protected function getAdminConfigTreeBuilder(): NodeDefinition
{
$builder = new TreeBuilder();
$node = $builder->root('configurations');
$adminDefinition = $node
->useAttributeAsKey('code')
->prototype('array')
->performNoDeepMerging()
->childr... | php | protected function getAdminConfigTreeBuilder(): NodeDefinition
{
$builder = new TreeBuilder();
$node = $builder->root('configurations');
$adminDefinition = $node
->useAttributeAsKey('code')
->prototype('array')
->performNoDeepMerging()
->childr... | [
"protected",
"function",
"getAdminConfigTreeBuilder",
"(",
")",
":",
"NodeDefinition",
"{",
"$",
"builder",
"=",
"new",
"TreeBuilder",
"(",
")",
";",
"$",
"node",
"=",
"$",
"builder",
"->",
"root",
"(",
"'configurations'",
")",
";",
"$",
"adminDefinition",
"... | @throws \RuntimeException
@return NodeDefinition | [
"@throws",
"\\",
"RuntimeException"
] | train | https://github.com/VincentChalnot/SidusAdminBundle/blob/3366f3f1525435860cf275ed2f1f0b58cf6eea18/DependencyInjection/Configuration.php#L65-L82 |
yuncms/framework | src/admin/models/TaskSearch.php | TaskSearch.search | public function search($params)
{
$query = Task::find();
// add conditions that should always apply here
$dataProvider = new ActiveDataProvider([
'query' => $query,
'sort' => [
'defaultOrder' => [
'id' => SORT_ASC,
... | php | public function search($params)
{
$query = Task::find();
// add conditions that should always apply here
$dataProvider = new ActiveDataProvider([
'query' => $query,
'sort' => [
'defaultOrder' => [
'id' => SORT_ASC,
... | [
"public",
"function",
"search",
"(",
"$",
"params",
")",
"{",
"$",
"query",
"=",
"Task",
"::",
"find",
"(",
")",
";",
"// add conditions that should always apply here",
"$",
"dataProvider",
"=",
"new",
"ActiveDataProvider",
"(",
"[",
"'query'",
"=>",
"$",
"que... | Creates data provider instance with search query applied
@param array $params
@return ActiveDataProvider | [
"Creates",
"data",
"provider",
"instance",
"with",
"search",
"query",
"applied"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/admin/models/TaskSearch.php#L43-L82 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.