id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
236,000 | jakecleary/ultrapress-library | src/Ultra/Helpers/PostObject.php | PostObject.imageSizes | public static function imageSizes($size = false)
{
global $_wp_additional_image_sizes;
$additionalSizes = $_wp_additional_image_sizes;
$sizes = [];
$imageSizes = get_intermediate_image_sizes();
foreach($imageSizes as $imageSize)
{
if(in_array($imageSize,... | php | public static function imageSizes($size = false)
{
global $_wp_additional_image_sizes;
$additionalSizes = $_wp_additional_image_sizes;
$sizes = [];
$imageSizes = get_intermediate_image_sizes();
foreach($imageSizes as $imageSize)
{
if(in_array($imageSize,... | [
"public",
"static",
"function",
"imageSizes",
"(",
"$",
"size",
"=",
"false",
")",
"{",
"global",
"$",
"_wp_additional_image_sizes",
";",
"$",
"additionalSizes",
"=",
"$",
"_wp_additional_image_sizes",
";",
"$",
"sizes",
"=",
"[",
"]",
";",
"$",
"imageSizes",
... | Create an array of all image sizes and their meta data.
@param string $size Optionally return a specific image size only | [
"Create",
"an",
"array",
"of",
"all",
"image",
"sizes",
"and",
"their",
"meta",
"data",
"."
] | 84ca5d1dae8eb16de8c886787575ea41f9332ae2 | https://github.com/jakecleary/ultrapress-library/blob/84ca5d1dae8eb16de8c886787575ea41f9332ae2/src/Ultra/Helpers/PostObject.php#L63-L106 |
236,001 | jakecleary/ultrapress-library | src/Ultra/Helpers/PostObject.php | PostObject.images | public static function images($id)
{
$sizes = self::imageSizes();
$urls = [];
if(has_post_thumbnail($id))
{
$image = wp_get_attachment_image_src(
get_post_thumbnail_id($id),
'full'
);
$image = pathinfo($image[0]);
... | php | public static function images($id)
{
$sizes = self::imageSizes();
$urls = [];
if(has_post_thumbnail($id))
{
$image = wp_get_attachment_image_src(
get_post_thumbnail_id($id),
'full'
);
$image = pathinfo($image[0]);
... | [
"public",
"static",
"function",
"images",
"(",
"$",
"id",
")",
"{",
"$",
"sizes",
"=",
"self",
"::",
"imageSizes",
"(",
")",
";",
"$",
"urls",
"=",
"[",
"]",
";",
"if",
"(",
"has_post_thumbnail",
"(",
"$",
"id",
")",
")",
"{",
"$",
"image",
"=",
... | Create an object casted array of the featured image in all sizes.
@param integer $id The post objects ID
@return object|boolean The object casted array or false | [
"Create",
"an",
"object",
"casted",
"array",
"of",
"the",
"featured",
"image",
"in",
"all",
"sizes",
"."
] | 84ca5d1dae8eb16de8c886787575ea41f9332ae2 | https://github.com/jakecleary/ultrapress-library/blob/84ca5d1dae8eb16de8c886787575ea41f9332ae2/src/Ultra/Helpers/PostObject.php#L114-L142 |
236,002 | vitodtagliente/pure-orm | SchemaPropertyDescriptor.php | SchemaPropertyDescriptor.getQueryStatements | public function getQueryStatements($table){
// field declaration
$query = array();
array_push($query, $this->name . ' ' . $this->type);
if($this->nullable == false)
array_push($query, ' NOT NULL');
else array_push($query, ' NULL');
if(isset($this->default_value)){
$value = $this->default_value;
if(... | php | public function getQueryStatements($table){
// field declaration
$query = array();
array_push($query, $this->name . ' ' . $this->type);
if($this->nullable == false)
array_push($query, ' NOT NULL');
else array_push($query, ' NULL');
if(isset($this->default_value)){
$value = $this->default_value;
if(... | [
"public",
"function",
"getQueryStatements",
"(",
"$",
"table",
")",
"{",
"// field declaration",
"$",
"query",
"=",
"array",
"(",
")",
";",
"array_push",
"(",
"$",
"query",
",",
"$",
"this",
"->",
"name",
".",
"' '",
".",
"$",
"this",
"->",
"type",
")"... | query statement generation | [
"query",
"statement",
"generation"
] | 04d80106430f45f82f922cc9da25de3d278dbb94 | https://github.com/vitodtagliente/pure-orm/blob/04d80106430f45f82f922cc9da25de3d278dbb94/SchemaPropertyDescriptor.php#L68-L93 |
236,003 | jaimeeee/laravelpanel | src/LaravelPanel/fields/date/DateField.php | DateField.footer | public static function footer()
{
$code = '<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/js/bootstrap-datepicker.min.js"></script>'.chr(10);
if (App::getLocale() != 'en') {
$code .= ' <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepic... | php | public static function footer()
{
$code = '<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/js/bootstrap-datepicker.min.js"></script>'.chr(10);
if (App::getLocale() != 'en') {
$code .= ' <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepic... | [
"public",
"static",
"function",
"footer",
"(",
")",
"{",
"$",
"code",
"=",
"'<script src=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/js/bootstrap-datepicker.min.js\"></script>'",
".",
"chr",
"(",
"10",
")",
";",
"if",
"(",
"App",
"::",
"getLocale",
... | Add stuff to the footer.
@return string | [
"Add",
"stuff",
"to",
"the",
"footer",
"."
] | 211599ba0be7dc5ea11af292a75d4104c41512ca | https://github.com/jaimeeee/laravelpanel/blob/211599ba0be7dc5ea11af292a75d4104c41512ca/src/LaravelPanel/fields/date/DateField.php#L50-L68 |
236,004 | calgamo/di | src/Slot.php | Slot.mustBeTypeOf | public function mustBeTypeOf(string $type) : Slot
{
static $allowed_types = [
'boolean',
'bool',
'integer',
'int',
'float',
'double',
'string',
'array',
'object',
'resource',
'... | php | public function mustBeTypeOf(string $type) : Slot
{
static $allowed_types = [
'boolean',
'bool',
'integer',
'int',
'float',
'double',
'string',
'array',
'object',
'resource',
'... | [
"public",
"function",
"mustBeTypeOf",
"(",
"string",
"$",
"type",
")",
":",
"Slot",
"{",
"static",
"$",
"allowed_types",
"=",
"[",
"'boolean'",
",",
"'bool'",
",",
"'integer'",
",",
"'int'",
",",
"'float'",
",",
"'double'",
",",
"'string'",
",",
"'array'",... | Set type restriction
@param string $type
@return Slot | [
"Set",
"type",
"restriction"
] | d7630628a1d6f385839a9d0a8de41aadbea657a9 | https://github.com/calgamo/di/blob/d7630628a1d6f385839a9d0a8de41aadbea657a9/src/Slot.php#L111-L129 |
236,005 | calgamo/di | src/Slot.php | Slot.mustBeInstanceOf | public function mustBeInstanceOf(string $instanceOf) : Slot
{
$this->instanceOf = class_exists($instanceOf) || interface_exists($instanceOf) ? $instanceOf : self::INSTANCE_OF_ANY;
return $this;
} | php | public function mustBeInstanceOf(string $instanceOf) : Slot
{
$this->instanceOf = class_exists($instanceOf) || interface_exists($instanceOf) ? $instanceOf : self::INSTANCE_OF_ANY;
return $this;
} | [
"public",
"function",
"mustBeInstanceOf",
"(",
"string",
"$",
"instanceOf",
")",
":",
"Slot",
"{",
"$",
"this",
"->",
"instanceOf",
"=",
"class_exists",
"(",
"$",
"instanceOf",
")",
"||",
"interface_exists",
"(",
"$",
"instanceOf",
")",
"?",
"$",
"instanceOf... | Set instance-of restriction
@param string $instanceOf
@return Slot | [
"Set",
"instance",
"-",
"of",
"restriction"
] | d7630628a1d6f385839a9d0a8de41aadbea657a9 | https://github.com/calgamo/di/blob/d7630628a1d6f385839a9d0a8de41aadbea657a9/src/Slot.php#L192-L196 |
236,006 | jivoo/core | src/EventSubjectTrait.php | EventSubjectTrait.triggerEvent | public function triggerEvent($name, Event $event = null)
{
return $this->e->trigger($name, $event);
} | php | public function triggerEvent($name, Event $event = null)
{
return $this->e->trigger($name, $event);
} | [
"public",
"function",
"triggerEvent",
"(",
"$",
"name",
",",
"Event",
"$",
"event",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"e",
"->",
"trigger",
"(",
"$",
"name",
",",
"$",
"event",
")",
";",
"}"
] | Trigger an event on this object.
@param string $name
Name of event.
@param Event $event
Event object.
@return bool False if event was stopped, true otherwise. | [
"Trigger",
"an",
"event",
"on",
"this",
"object",
"."
] | 4ef3445068f0ff9c0a6512cb741831a847013b76 | https://github.com/jivoo/core/blob/4ef3445068f0ff9c0a6512cb741831a847013b76/src/EventSubjectTrait.php#L113-L116 |
236,007 | irs/magento-initializer | src/Irs/MagentoInitializer/Initializer/GenericInitializer.php | GenericInitializer.initialize | public function initialize()
{
if (!file_exists($this->paramsPathname)) {
throw new \InvalidArgumentException("Invalid Magento root '$this->magentoRoot'.");
}
$params = $this->getParams();
$params['code'] = $this->store;
$params['type'] = $this->scope;
... | php | public function initialize()
{
if (!file_exists($this->paramsPathname)) {
throw new \InvalidArgumentException("Invalid Magento root '$this->magentoRoot'.");
}
$params = $this->getParams();
$params['code'] = $this->store;
$params['type'] = $this->scope;
... | [
"public",
"function",
"initialize",
"(",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"paramsPathname",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"Invalid Magento root '$this->magentoRoot'.\"",
")",
";",
"}",
"$"... | Sets store and scope code into index.php generated by GenericInstaller
@see \Irs\MagentoInitializer\Initializer\InitializerInterface::initialize() | [
"Sets",
"store",
"and",
"scope",
"code",
"into",
"index",
".",
"php",
"generated",
"by",
"GenericInstaller"
] | a5583ab01759f320717547a79c7dae2121588a14 | https://github.com/irs/magento-initializer/blob/a5583ab01759f320717547a79c7dae2121588a14/src/Irs/MagentoInitializer/Initializer/GenericInitializer.php#L46-L56 |
236,008 | onesimus-systems/oslogger | src/Adaptors/ChromeLoggerAdaptor.php | ChromeLoggerAdaptor.write | public function write($level, $message, array $context = array())
{
if ($this->overflowed){
return;
}
$backtraceLine = '';
if ($this->logBacktrace) {
$backtrace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 3);
$backtrace = array_pop($backtrac... | php | public function write($level, $message, array $context = array())
{
if ($this->overflowed){
return;
}
$backtraceLine = '';
if ($this->logBacktrace) {
$backtrace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 3);
$backtrace = array_pop($backtrac... | [
"public",
"function",
"write",
"(",
"$",
"level",
",",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"overflowed",
")",
"{",
"return",
";",
"}",
"$",
"backtraceLine",
"=",
"''",
";",
... | Write logs to the void
@param mixed $level
@param string $message
@param array $context
@return null | [
"Write",
"logs",
"to",
"the",
"void"
] | 98138d4fbcae83b9cedac13ab173a3f8273de3e0 | https://github.com/onesimus-systems/oslogger/blob/98138d4fbcae83b9cedac13ab173a3f8273de3e0/src/Adaptors/ChromeLoggerAdaptor.php#L75-L102 |
236,009 | onesimus-systems/oslogger | src/Adaptors/ChromeLoggerAdaptor.php | ChromeLoggerAdaptor.send | protected function send()
{
if (!$this->initialized) {
$this->initialized = true;
$this->sendHeader = $this->headersAccepted();
if (!$this->sendHeader) {
return;
}
}
$jsonEncoded = json_encode($this->json);
$jsonEncode... | php | protected function send()
{
if (!$this->initialized) {
$this->initialized = true;
$this->sendHeader = $this->headersAccepted();
if (!$this->sendHeader) {
return;
}
}
$jsonEncoded = json_encode($this->json);
$jsonEncode... | [
"protected",
"function",
"send",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"initialized",
")",
"{",
"$",
"this",
"->",
"initialized",
"=",
"true",
";",
"$",
"this",
"->",
"sendHeader",
"=",
"$",
"this",
"->",
"headersAccepted",
"(",
")",
";",... | Prepare to send header | [
"Prepare",
"to",
"send",
"header"
] | 98138d4fbcae83b9cedac13ab173a3f8273de3e0 | https://github.com/onesimus-systems/oslogger/blob/98138d4fbcae83b9cedac13ab173a3f8273de3e0/src/Adaptors/ChromeLoggerAdaptor.php#L112-L143 |
236,010 | nirvana-msu/yii2-helpers | MathHelper.php | MathHelper.histogram | public static function histogram($values, $edges)
{
$bins = [];
foreach ($edges as $key => $val) {
if (!isset($edges[$key + 1])) break;
$bins[] = $val . '-' . ($edges[$key + 1]);
}
$histogram = array_fill_keys($bins, []);
foreach ($values as $value) {... | php | public static function histogram($values, $edges)
{
$bins = [];
foreach ($edges as $key => $val) {
if (!isset($edges[$key + 1])) break;
$bins[] = $val . '-' . ($edges[$key + 1]);
}
$histogram = array_fill_keys($bins, []);
foreach ($values as $value) {... | [
"public",
"static",
"function",
"histogram",
"(",
"$",
"values",
",",
"$",
"edges",
")",
"{",
"$",
"bins",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"edges",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"edges... | Creates a histogram with specified bins out of a given array
@param array $values , e.g. [11, 12, 20, 25, 20.1, 33.5]
@param array $edges , e.g. [0, 10, 20, 30, 40]
@throws \Exception
@return array histogram, e.g. ['0-10' => [], '10-20' => [11,12], '20-30' => [20,25,20.1], '30-40' => [33.5]] | [
"Creates",
"a",
"histogram",
"with",
"specified",
"bins",
"out",
"of",
"a",
"given",
"array"
] | 1aeecfe8c47211440bab1aa30b65cc205f0ea9ba | https://github.com/nirvana-msu/yii2-helpers/blob/1aeecfe8c47211440bab1aa30b65cc205f0ea9ba/MathHelper.php#L26-L45 |
236,011 | konservs/brilliant.framework | libraries/Modules/BSoftModules.php | BSoftModules.getmodulescounts_forgroups | public function getmodulescounts_forgroups($groupids){
if(!$db=BFactory::getDBO()){
return array();
}
$qr='select count(pageid)as cnt,pageid from soft_modules_rules ';
$qr.=' where pageid in ('.implode(',',$groupids).')';
$qr.='group by pageid';
$q=$db->Query($qr);
$counts=array();
while($l=$db->fet... | php | public function getmodulescounts_forgroups($groupids){
if(!$db=BFactory::getDBO()){
return array();
}
$qr='select count(pageid)as cnt,pageid from soft_modules_rules ';
$qr.=' where pageid in ('.implode(',',$groupids).')';
$qr.='group by pageid';
$q=$db->Query($qr);
$counts=array();
while($l=$db->fet... | [
"public",
"function",
"getmodulescounts_forgroups",
"(",
"$",
"groupids",
")",
"{",
"if",
"(",
"!",
"$",
"db",
"=",
"BFactory",
"::",
"getDBO",
"(",
")",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"$",
"qr",
"=",
"'select count(pageid)as cnt,pageid f... | end of get | [
"end",
"of",
"get"
] | 95f03f1917f746fee98bea8a906ba0588c87762d | https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/Modules/BSoftModules.php#L273-L286 |
236,012 | codebobbly/dvoconnector | Classes/Hooks/RealUrlAutoConfiguration.php | RealUrlAutoConfiguration.addDVOConnectorConfig | public function addDVOConnectorConfig($params)
{
return array_merge_recursive($params['config'], [
'postVarSets' => [
'_DEFAULT' => [
'dvoconnector' => [
[
'GETvar' => 'tx_dvoconnector_pi1[controller]',
'noMatch' => ... | php | public function addDVOConnectorConfig($params)
{
return array_merge_recursive($params['config'], [
'postVarSets' => [
'_DEFAULT' => [
'dvoconnector' => [
[
'GETvar' => 'tx_dvoconnector_pi1[controller]',
'noMatch' => ... | [
"public",
"function",
"addDVOConnectorConfig",
"(",
"$",
"params",
")",
"{",
"return",
"array_merge_recursive",
"(",
"$",
"params",
"[",
"'config'",
"]",
",",
"[",
"'postVarSets'",
"=>",
"[",
"'_DEFAULT'",
"=>",
"[",
"'dvoconnector'",
"=>",
"[",
"[",
"'GETvar'... | Generates additional RealURL configuration and merges it with provided configuration
@param array $params Default configuration
@return array Updated configuration
@hook TYPO3_CONF_VARS|SC_OPTIONS|ext/realurl/class.tx_realurl_autoconfgen.php|extensionConfiguration | [
"Generates",
"additional",
"RealURL",
"configuration",
"and",
"merges",
"it",
"with",
"provided",
"configuration"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Hooks/RealUrlAutoConfiguration.php#L19-L74 |
236,013 | encorephp/development | src/ServiceProvider.php | ServiceProvider.register | public function register()
{
$this->container['config']->addLocation($this->container->basePath().'/dev/config');
foreach ($this->container['config']->get('app.providers') as $provider) {
$this->container->addProvider($provider);
}
} | php | public function register()
{
$this->container['config']->addLocation($this->container->basePath().'/dev/config');
foreach ($this->container['config']->get('app.providers') as $provider) {
$this->container->addProvider($provider);
}
} | [
"public",
"function",
"register",
"(",
")",
"{",
"$",
"this",
"->",
"container",
"[",
"'config'",
"]",
"->",
"addLocation",
"(",
"$",
"this",
"->",
"container",
"->",
"basePath",
"(",
")",
".",
"'/dev/config'",
")",
";",
"foreach",
"(",
"$",
"this",
"-... | Register the dev config directory and register providers.
@return void | [
"Register",
"the",
"dev",
"config",
"directory",
"and",
"register",
"providers",
"."
] | 734ea31fab803d62b7baeb5ae3a33a0d655833cd | https://github.com/encorephp/development/blob/734ea31fab803d62b7baeb5ae3a33a0d655833cd/src/ServiceProvider.php#L20-L27 |
236,014 | coolms/common | src/Permissions/Acl/AclAwareTrait.php | AclAwareTrait.hasAcl | public function hasAcl()
{
if ($this->acl instanceof Acl\Acl
|| static::$defaultAcl instanceof Acl\Acl
) {
return true;
}
return false;
} | php | public function hasAcl()
{
if ($this->acl instanceof Acl\Acl
|| static::$defaultAcl instanceof Acl\Acl
) {
return true;
}
return false;
} | [
"public",
"function",
"hasAcl",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"acl",
"instanceof",
"Acl",
"\\",
"Acl",
"||",
"static",
"::",
"$",
"defaultAcl",
"instanceof",
"Acl",
"\\",
"Acl",
")",
"{",
"return",
"true",
";",
"}",
"return",
"false",
... | Checks if the helper has an ACL instance
Implements {@link AclAwareInterface::hasAcl()}.
@return bool | [
"Checks",
"if",
"the",
"helper",
"has",
"an",
"ACL",
"instance"
] | 3572993cdcdb2898cdde396a2f1de9864b193660 | https://github.com/coolms/common/blob/3572993cdcdb2898cdde396a2f1de9864b193660/src/Permissions/Acl/AclAwareTrait.php#L92-L101 |
236,015 | coolms/common | src/Permissions/Acl/AclAwareTrait.php | AclAwareTrait.hasRole | public function hasRole()
{
if ($this->role instanceof Acl\Role\RoleInterface
|| is_string($this->role)
|| static::$defaultRole instanceof Acl\Role\RoleInterface
|| is_string(static::$defaultRole)
) {
return true;
}
return false;
... | php | public function hasRole()
{
if ($this->role instanceof Acl\Role\RoleInterface
|| is_string($this->role)
|| static::$defaultRole instanceof Acl\Role\RoleInterface
|| is_string(static::$defaultRole)
) {
return true;
}
return false;
... | [
"public",
"function",
"hasRole",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"role",
"instanceof",
"Acl",
"\\",
"Role",
"\\",
"RoleInterface",
"||",
"is_string",
"(",
"$",
"this",
"->",
"role",
")",
"||",
"static",
"::",
"$",
"defaultRole",
"instanceof"... | Checks if the helper has an ACL role
Implements {@link AclAwareInterface::hasRole()}.
@return bool | [
"Checks",
"if",
"the",
"helper",
"has",
"an",
"ACL",
"role"
] | 3572993cdcdb2898cdde396a2f1de9864b193660 | https://github.com/coolms/common/blob/3572993cdcdb2898cdde396a2f1de9864b193660/src/Permissions/Acl/AclAwareTrait.php#L181-L192 |
236,016 | FelixOnline/Core | src/FelixOnline/Core/User.php | User.jsonEncode | public static function jsonEncode($data)
{
$json = json_encode($data);
// if json_encode failed
if ($json === false) {
self::jsonLastError();
}
return $json;
} | php | public static function jsonEncode($data)
{
$json = json_encode($data);
// if json_encode failed
if ($json === false) {
self::jsonLastError();
}
return $json;
} | [
"public",
"static",
"function",
"jsonEncode",
"(",
"$",
"data",
")",
"{",
"$",
"json",
"=",
"json_encode",
"(",
"$",
"data",
")",
";",
"// if json_encode failed",
"if",
"(",
"$",
"json",
"===",
"false",
")",
"{",
"self",
"::",
"jsonLastError",
"(",
")",
... | Encode as JSON and throw error if fails
@param mixed $data - data to encode
@static
@return string - json string
@throws \Exception if json decode fails with message about why | [
"Encode",
"as",
"JSON",
"and",
"throw",
"error",
"if",
"fails"
] | b29f50cd96cee73da83968ee1eb88d8b3ab1c430 | https://github.com/FelixOnline/Core/blob/b29f50cd96cee73da83968ee1eb88d8b3ab1c430/src/FelixOnline/Core/User.php#L299-L307 |
236,017 | FelixOnline/Core | src/FelixOnline/Core/User.php | User.updateName | private function updateName()
{
if (!LOCAL) {
$ds = ldap_connect("addressbook.ic.ac.uk");
$r = ldap_bind($ds);
$justthese = array("displayname");
$sr = ldap_search(
$ds,
"ou=People,ou=shibboleth,dc=ic,dc=ac,dc=uk",
... | php | private function updateName()
{
if (!LOCAL) {
$ds = ldap_connect("addressbook.ic.ac.uk");
$r = ldap_bind($ds);
$justthese = array("displayname");
$sr = ldap_search(
$ds,
"ou=People,ou=shibboleth,dc=ic,dc=ac,dc=uk",
... | [
"private",
"function",
"updateName",
"(",
")",
"{",
"if",
"(",
"!",
"LOCAL",
")",
"{",
"$",
"ds",
"=",
"ldap_connect",
"(",
"\"addressbook.ic.ac.uk\"",
")",
";",
"$",
"r",
"=",
"ldap_bind",
"(",
"$",
"ds",
")",
";",
"$",
"justthese",
"=",
"array",
"(... | Update user's name from ldap | [
"Update",
"user",
"s",
"name",
"from",
"ldap"
] | b29f50cd96cee73da83968ee1eb88d8b3ab1c430 | https://github.com/FelixOnline/Core/blob/b29f50cd96cee73da83968ee1eb88d8b3ab1c430/src/FelixOnline/Core/User.php#L458-L481 |
236,018 | FelixOnline/Core | src/FelixOnline/Core/User.php | User.updateEmail | private function updateEmail()
{
if (!LOCAL) {
$ds = ldap_connect("addressbook.ic.ac.uk");
$r = ldap_bind($ds);
$justthese = array("mail");
$sr = ldap_search(
$ds,
"ou=People,ou=shibboleth,dc=ic,dc=ac,dc=uk",
"ui... | php | private function updateEmail()
{
if (!LOCAL) {
$ds = ldap_connect("addressbook.ic.ac.uk");
$r = ldap_bind($ds);
$justthese = array("mail");
$sr = ldap_search(
$ds,
"ou=People,ou=shibboleth,dc=ic,dc=ac,dc=uk",
"ui... | [
"private",
"function",
"updateEmail",
"(",
")",
"{",
"if",
"(",
"!",
"LOCAL",
")",
"{",
"$",
"ds",
"=",
"ldap_connect",
"(",
"\"addressbook.ic.ac.uk\"",
")",
";",
"$",
"r",
"=",
"ldap_bind",
"(",
"$",
"ds",
")",
";",
"$",
"justthese",
"=",
"array",
"... | Update user's email address from ldap | [
"Update",
"user",
"s",
"email",
"address",
"from",
"ldap"
] | b29f50cd96cee73da83968ee1eb88d8b3ab1c430 | https://github.com/FelixOnline/Core/blob/b29f50cd96cee73da83968ee1eb88d8b3ab1c430/src/FelixOnline/Core/User.php#L486-L509 |
236,019 | silverorange/Net_Notifier | Net/Notifier/ServerCLI.php | Net_Notifier_ServerCLI.getUiXml | protected function getUiXml()
{
$dir = '@data-dir@' . DIRECTORY_SEPARATOR
. '@package-name@' . DIRECTORY_SEPARATOR . 'data';
if ($dir[0] == '@') {
$dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..'
. DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'data... | php | protected function getUiXml()
{
$dir = '@data-dir@' . DIRECTORY_SEPARATOR
. '@package-name@' . DIRECTORY_SEPARATOR . 'data';
if ($dir[0] == '@') {
$dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..'
. DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'data... | [
"protected",
"function",
"getUiXml",
"(",
")",
"{",
"$",
"dir",
"=",
"'@data-dir@'",
".",
"DIRECTORY_SEPARATOR",
".",
"'@package-name@'",
".",
"DIRECTORY_SEPARATOR",
".",
"'data'",
";",
"if",
"(",
"$",
"dir",
"[",
"0",
"]",
"==",
"'@'",
")",
"{",
"$",
"d... | Gets the XML command line interface definition for this server
@return string the XML command line interface definition for this
server. | [
"Gets",
"the",
"XML",
"command",
"line",
"interface",
"definition",
"for",
"this",
"server"
] | b446e27cd1bebd58ba89243cde1272c5d281d3fb | https://github.com/silverorange/Net_Notifier/blob/b446e27cd1bebd58ba89243cde1272c5d281d3fb/Net/Notifier/ServerCLI.php#L165-L176 |
236,020 | rezzza/jobflow | src/Rezzza/Jobflow/Scheduler/JobGraph.php | JobGraph.move | public function move($value)
{
// No need to update if $value is already current one
if ($value === $this->current()) {
return;
}
$index = $this->search($value);
if (false === $index) {
throw new \InvalidArgumentException(sprintf('"%s" value not foun... | php | public function move($value)
{
// No need to update if $value is already current one
if ($value === $this->current()) {
return;
}
$index = $this->search($value);
if (false === $index) {
throw new \InvalidArgumentException(sprintf('"%s" value not foun... | [
"public",
"function",
"move",
"(",
"$",
"value",
")",
"{",
"// No need to update if $value is already current one",
"if",
"(",
"$",
"value",
"===",
"$",
"this",
"->",
"current",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"index",
"=",
"$",
"this",
"->",
... | Moves cursor to the given value.
Useful when using asynchronous transport
@param string $value | [
"Moves",
"cursor",
"to",
"the",
"given",
"value",
".",
"Useful",
"when",
"using",
"asynchronous",
"transport"
] | 80ded8ac6ed6a2f4500b8f86e2958701ec84fd65 | https://github.com/rezzza/jobflow/blob/80ded8ac6ed6a2f4500b8f86e2958701ec84fd65/src/Rezzza/Jobflow/Scheduler/JobGraph.php#L60-L74 |
236,021 | rezzza/jobflow | src/Rezzza/Jobflow/Scheduler/JobGraph.php | JobGraph.getJob | public function getJob($index)
{
if ($this->hasNextJob($index)) {
return $this->getIterator()->offsetGet($index);
}
return false;
} | php | public function getJob($index)
{
if ($this->hasNextJob($index)) {
return $this->getIterator()->offsetGet($index);
}
return false;
} | [
"public",
"function",
"getJob",
"(",
"$",
"index",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasNextJob",
"(",
"$",
"index",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getIterator",
"(",
")",
"->",
"offsetGet",
"(",
"$",
"index",
")",
";",
"}",
... | Get name of the job for given index
@param string|integer $index
@return string | [
"Get",
"name",
"of",
"the",
"job",
"for",
"given",
"index"
] | 80ded8ac6ed6a2f4500b8f86e2958701ec84fd65 | https://github.com/rezzza/jobflow/blob/80ded8ac6ed6a2f4500b8f86e2958701ec84fd65/src/Rezzza/Jobflow/Scheduler/JobGraph.php#L93-L100 |
236,022 | rsmike/fa | dist/FA.php | FA.css | public function css($css) {
$css = trim($css);
if (substr($css, -1) !== ';') {
$css = $css . ';';
}
return $this->att(['style' => $css]);
} | php | public function css($css) {
$css = trim($css);
if (substr($css, -1) !== ';') {
$css = $css . ';';
}
return $this->att(['style' => $css]);
} | [
"public",
"function",
"css",
"(",
"$",
"css",
")",
"{",
"$",
"css",
"=",
"trim",
"(",
"$",
"css",
")",
";",
"if",
"(",
"substr",
"(",
"$",
"css",
",",
"-",
"1",
")",
"!==",
"';'",
")",
"{",
"$",
"css",
"=",
"$",
"css",
".",
"';'",
";",
"}... | Add custom style for the icon
Example:
echo FA::check('ok')->css('padding-right:20px');
echo FA::check('ok', FA::FA_ROT90&FA::FA_SPIN)->css('padding-right:20px');
@param $css string
@return static | [
"Add",
"custom",
"style",
"for",
"the",
"icon"
] | 5c08e836a6871b17ee9f15cb3bf87033b2267922 | https://github.com/rsmike/fa/blob/5c08e836a6871b17ee9f15cb3bf87033b2267922/dist/FA.php#L821-L827 |
236,023 | phPoirot/Http | HttpMessage/Request/Plugin/MethodType.php | MethodType.isXmlHttpRequest | function isXmlHttpRequest()
{
/** @var iHeader $header */
if (! $this->getMessageObject()->headers()->has('X-Requested-With') )
return false;
$header = $this->getMessageObject()->headers()->get('X-Requested-With');
return false !== $header && \Poirot\Http\Header\renderHe... | php | function isXmlHttpRequest()
{
/** @var iHeader $header */
if (! $this->getMessageObject()->headers()->has('X-Requested-With') )
return false;
$header = $this->getMessageObject()->headers()->get('X-Requested-With');
return false !== $header && \Poirot\Http\Header\renderHe... | [
"function",
"isXmlHttpRequest",
"(",
")",
"{",
"/** @var iHeader $header */",
"if",
"(",
"!",
"$",
"this",
"->",
"getMessageObject",
"(",
")",
"->",
"headers",
"(",
")",
"->",
"has",
"(",
"'X-Requested-With'",
")",
")",
"return",
"false",
";",
"$",
"header",... | Is the request a Javascript XMLHttpRequest?
Should work with Prototype/Script.aculo.us, possibly others.
@return bool | [
"Is",
"the",
"request",
"a",
"Javascript",
"XMLHttpRequest?"
] | 3230b3555abf0e74c3d593fc49c8978758969736 | https://github.com/phPoirot/Http/blob/3230b3555abf0e74c3d593fc49c8978758969736/HttpMessage/Request/Plugin/MethodType.php#L123-L131 |
236,024 | phPoirot/Http | HttpMessage/Request/Plugin/MethodType.php | MethodType.isFlashRequest | function isFlashRequest()
{
/** @var iHeader $header */
if (! $this->getMessageObject()->headers()->has('User-Agent') )
return false;
$header = $this->getMessageObject()->headers()->get('User-Agent');
return false !== $header && stristr(\Poirot\Http\Header\renderHeader($... | php | function isFlashRequest()
{
/** @var iHeader $header */
if (! $this->getMessageObject()->headers()->has('User-Agent') )
return false;
$header = $this->getMessageObject()->headers()->get('User-Agent');
return false !== $header && stristr(\Poirot\Http\Header\renderHeader($... | [
"function",
"isFlashRequest",
"(",
")",
"{",
"/** @var iHeader $header */",
"if",
"(",
"!",
"$",
"this",
"->",
"getMessageObject",
"(",
")",
"->",
"headers",
"(",
")",
"->",
"has",
"(",
"'User-Agent'",
")",
")",
"return",
"false",
";",
"$",
"header",
"=",
... | Is this a Flash request?
@return bool | [
"Is",
"this",
"a",
"Flash",
"request?"
] | 3230b3555abf0e74c3d593fc49c8978758969736 | https://github.com/phPoirot/Http/blob/3230b3555abf0e74c3d593fc49c8978758969736/HttpMessage/Request/Plugin/MethodType.php#L138-L146 |
236,025 | acacha/ebre_escool_model | src/Study.php | Study.modules | public function modules()
{
$courses = $this->courses->pluck('course_id');
return StudyModule::whereHas('modulesByPeriod.courses', function ($query) use ($courses) {
$query->whereIn('course_id',$courses);
});
} | php | public function modules()
{
$courses = $this->courses->pluck('course_id');
return StudyModule::whereHas('modulesByPeriod.courses', function ($query) use ($courses) {
$query->whereIn('course_id',$courses);
});
} | [
"public",
"function",
"modules",
"(",
")",
"{",
"$",
"courses",
"=",
"$",
"this",
"->",
"courses",
"->",
"pluck",
"(",
"'course_id'",
")",
";",
"return",
"StudyModule",
"::",
"whereHas",
"(",
"'modulesByPeriod.courses'",
",",
"function",
"(",
"$",
"query",
... | Get the active study modules for this study. | [
"Get",
"the",
"active",
"study",
"modules",
"for",
"this",
"study",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Study.php#L104-L110 |
236,026 | acacha/ebre_escool_model | src/Study.php | Study.modulesActiveOn | public function modulesActiveOn($periodId)
{
$courses = $this->coursesActiveOn($periodId)->pluck('course_id');
return StudyModule::whereHas('modulesByPeriod.courses', function ($query) use ($courses) {
$query->whereIn('course_id',$courses);
});
} | php | public function modulesActiveOn($periodId)
{
$courses = $this->coursesActiveOn($periodId)->pluck('course_id');
return StudyModule::whereHas('modulesByPeriod.courses', function ($query) use ($courses) {
$query->whereIn('course_id',$courses);
});
} | [
"public",
"function",
"modulesActiveOn",
"(",
"$",
"periodId",
")",
"{",
"$",
"courses",
"=",
"$",
"this",
"->",
"coursesActiveOn",
"(",
"$",
"periodId",
")",
"->",
"pluck",
"(",
"'course_id'",
")",
";",
"return",
"StudyModule",
"::",
"whereHas",
"(",
"'mo... | Get the active study modules for this study on period id. | [
"Get",
"the",
"active",
"study",
"modules",
"for",
"this",
"study",
"on",
"period",
"id",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Study.php#L116-L122 |
236,027 | monomelodies/ornament | src/Virtual.php | Virtual.__isset | public function __isset($prop)
{
if (property_exists($this, $prop) && $prop{0} != '_') {
return true;
}
$method = 'get'.ucfirst(Helper::denormalize($prop));
if (method_exists($this, $method)) {
return true;
}
if (method_exists($this, 'callback'... | php | public function __isset($prop)
{
if (property_exists($this, $prop) && $prop{0} != '_') {
return true;
}
$method = 'get'.ucfirst(Helper::denormalize($prop));
if (method_exists($this, $method)) {
return true;
}
if (method_exists($this, 'callback'... | [
"public",
"function",
"__isset",
"(",
"$",
"prop",
")",
"{",
"if",
"(",
"property_exists",
"(",
"$",
"this",
",",
"$",
"prop",
")",
"&&",
"$",
"prop",
"{",
"0",
"}",
"!=",
"'_'",
")",
"{",
"return",
"true",
";",
"}",
"$",
"method",
"=",
"'get'",
... | Check if a property is defined, but not public or virtual. Note that it
will return true if a property _is_ defined, but has a value of null.
@param string $prop The property to check.
@return boolean True if set, otherwise false. | [
"Check",
"if",
"a",
"property",
"is",
"defined",
"but",
"not",
"public",
"or",
"virtual",
".",
"Note",
"that",
"it",
"will",
"return",
"true",
"if",
"a",
"property",
"_is_",
"defined",
"but",
"has",
"a",
"value",
"of",
"null",
"."
] | d7d070ad11f5731be141cf55c2756accaaf51402 | https://github.com/monomelodies/ornament/blob/d7d070ad11f5731be141cf55c2756accaaf51402/src/Virtual.php#L84-L101 |
236,028 | marando/phpSOFA | src/Marando/IAU/iauEors.php | iauEors.Eors | public static function Eors(array $rnpb, $s) {
$x;
$ax;
$xs;
$ys;
$zs;
$p;
$q;
$eo;
/* Evaluate Wallace & Capitaine (2006) expression (16). */
$x = $rnpb[2][0];
$ax = $x / (1.0 + $rnpb[2][2]);
$xs = 1.0 - $ax * $x;
$ys = -$ax * $rnpb[2][1];
$zs = -$x;
$p = ... | php | public static function Eors(array $rnpb, $s) {
$x;
$ax;
$xs;
$ys;
$zs;
$p;
$q;
$eo;
/* Evaluate Wallace & Capitaine (2006) expression (16). */
$x = $rnpb[2][0];
$ax = $x / (1.0 + $rnpb[2][2]);
$xs = 1.0 - $ax * $x;
$ys = -$ax * $rnpb[2][1];
$zs = -$x;
$p = ... | [
"public",
"static",
"function",
"Eors",
"(",
"array",
"$",
"rnpb",
",",
"$",
"s",
")",
"{",
"$",
"x",
";",
"$",
"ax",
";",
"$",
"xs",
";",
"$",
"ys",
";",
"$",
"zs",
";",
"$",
"p",
";",
"$",
"q",
";",
"$",
"eo",
";",
"/* Evaluate Wallace & Ca... | - - - - - - - -
i a u E o r s
- - - - - - - -
Equation of the origins, given the classical NPB matrix and the
quantity s.
This function is part of the International Astronomical Union's
SOFA (Standards Of Fundamental Astronomy) software collection.
Status: support function.
Given:
rnpb double[3][3] classical nut... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"E",
"o",
"r",
"s",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauEors.php#L50-L71 |
236,029 | phlexible/phlexible | src/Phlexible/Bundle/UserBundle/Controller/ResourcesController.php | ResourcesController.scriptsAction | public function scriptsAction()
{
$locator = $this->get('file_locator');
$content =
file_get_contents($locator->locate('@PhlexibleUserBundle/Resources/scripts/ChangePasswordWindow.js')).
file_get_contents($locator->locate('@PhlexibleUserBundle/Resources/scripts/ValidateWindo... | php | public function scriptsAction()
{
$locator = $this->get('file_locator');
$content =
file_get_contents($locator->locate('@PhlexibleUserBundle/Resources/scripts/ChangePasswordWindow.js')).
file_get_contents($locator->locate('@PhlexibleUserBundle/Resources/scripts/ValidateWindo... | [
"public",
"function",
"scriptsAction",
"(",
")",
"{",
"$",
"locator",
"=",
"$",
"this",
"->",
"get",
"(",
"'file_locator'",
")",
";",
"$",
"content",
"=",
"file_get_contents",
"(",
"$",
"locator",
"->",
"locate",
"(",
"'@PhlexibleUserBundle/Resources/scripts/Cha... | Return user javascripts.
@return Response | [
"Return",
"user",
"javascripts",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/UserBundle/Controller/ResourcesController.php#L29-L39 |
236,030 | phlexible/phlexible | src/Phlexible/Bundle/UserBundle/Controller/ResourcesController.php | ResourcesController.translationsAction | public function translationsAction($language)
{
$language = $this->getUser()->getInterfaceLanguage($language);
$translations = $this->get('resourcesTranslations');
$content = $translations->get($language);
return new Response($content, 200, ['Content-Type' => 'text/javascript']);
... | php | public function translationsAction($language)
{
$language = $this->getUser()->getInterfaceLanguage($language);
$translations = $this->get('resourcesTranslations');
$content = $translations->get($language);
return new Response($content, 200, ['Content-Type' => 'text/javascript']);
... | [
"public",
"function",
"translationsAction",
"(",
"$",
"language",
")",
"{",
"$",
"language",
"=",
"$",
"this",
"->",
"getUser",
"(",
")",
"->",
"getInterfaceLanguage",
"(",
"$",
"language",
")",
";",
"$",
"translations",
"=",
"$",
"this",
"->",
"get",
"(... | Return users translations.
@param string $language
@return Response | [
"Return",
"users",
"translations",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/UserBundle/Controller/ResourcesController.php#L72-L80 |
236,031 | devsdmf/slice-http | src/Slice/Http/Client.php | Client.setUri | public function setUri($uri)
{
if (filter_var($uri, FILTER_VALIDATE_URL)) {
$this->uri = $uri;
} else {
throw new RuntimeException('Invalid URI setted.');
}
return $this;
} | php | public function setUri($uri)
{
if (filter_var($uri, FILTER_VALIDATE_URL)) {
$this->uri = $uri;
} else {
throw new RuntimeException('Invalid URI setted.');
}
return $this;
} | [
"public",
"function",
"setUri",
"(",
"$",
"uri",
")",
"{",
"if",
"(",
"filter_var",
"(",
"$",
"uri",
",",
"FILTER_VALIDATE_URL",
")",
")",
"{",
"$",
"this",
"->",
"uri",
"=",
"$",
"uri",
";",
"}",
"else",
"{",
"throw",
"new",
"RuntimeException",
"(",... | Set the URI to perform the request
@param string $uri
@throws RuntimeException
@return \Slice\Http\Client | [
"Set",
"the",
"URI",
"to",
"perform",
"the",
"request"
] | 8ab12b42354ff092d88d29d265733186698cb829 | https://github.com/devsdmf/slice-http/blob/8ab12b42354ff092d88d29d265733186698cb829/src/Slice/Http/Client.php#L194-L203 |
236,032 | devsdmf/slice-http | src/Slice/Http/Client.php | Client.setMethod | public function setMethod($method = self::GET)
{
if (in_array($method, $this->allowedMethods)) {
$this->method = $method;
} else {
throw new RuntimeException('Invalid method setted.');
}
return $this;
} | php | public function setMethod($method = self::GET)
{
if (in_array($method, $this->allowedMethods)) {
$this->method = $method;
} else {
throw new RuntimeException('Invalid method setted.');
}
return $this;
} | [
"public",
"function",
"setMethod",
"(",
"$",
"method",
"=",
"self",
"::",
"GET",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"method",
",",
"$",
"this",
"->",
"allowedMethods",
")",
")",
"{",
"$",
"this",
"->",
"method",
"=",
"$",
"method",
";",
"}"... | Set the request method to use
@param string $method Recommended use of Client class constants
@throws RuntimeException
@return \Slice\Http\Client | [
"Set",
"the",
"request",
"method",
"to",
"use"
] | 8ab12b42354ff092d88d29d265733186698cb829 | https://github.com/devsdmf/slice-http/blob/8ab12b42354ff092d88d29d265733186698cb829/src/Slice/Http/Client.php#L222-L231 |
236,033 | devsdmf/slice-http | src/Slice/Http/Client.php | Client.setHeaders | public function setHeaders($name, $value = null)
{
//Verifying if is array
if (is_array($name)) {
foreach ($name as $k => $v) {
if (is_string($k)) {
$this->setHeaders($k, $v);
} else {
$this->setHeaders($v, null);
}
}
} else {
// Verifying if is a string without $value parameter
... | php | public function setHeaders($name, $value = null)
{
//Verifying if is array
if (is_array($name)) {
foreach ($name as $k => $v) {
if (is_string($k)) {
$this->setHeaders($k, $v);
} else {
$this->setHeaders($v, null);
}
}
} else {
// Verifying if is a string without $value parameter
... | [
"public",
"function",
"setHeaders",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"null",
")",
"{",
"//Verifying if is array",
"if",
"(",
"is_array",
"(",
"$",
"name",
")",
")",
"{",
"foreach",
"(",
"$",
"name",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{"... | Set the headers to send in request
@param string|array $name The header name or an associative array with mutiples headers
@param mixed $value
@return \Slice\Http\Client | [
"Set",
"the",
"headers",
"to",
"send",
"in",
"request"
] | 8ab12b42354ff092d88d29d265733186698cb829 | https://github.com/devsdmf/slice-http/blob/8ab12b42354ff092d88d29d265733186698cb829/src/Slice/Http/Client.php#L250-L278 |
236,034 | devsdmf/slice-http | src/Slice/Http/Client.php | Client.setParameterGet | public function setParameterGet($name, $value = null)
{
// Verifying if is array
if (is_array($name)) {
foreach ($name as $k => $v) {
$this->setParameterGet($k,$v);
}
} else {
$parray = &$this->paramsGet;
if (is_null($value)) {
if (isset($parray[$name])) unset($parray[$name]);
} else ... | php | public function setParameterGet($name, $value = null)
{
// Verifying if is array
if (is_array($name)) {
foreach ($name as $k => $v) {
$this->setParameterGet($k,$v);
}
} else {
$parray = &$this->paramsGet;
if (is_null($value)) {
if (isset($parray[$name])) unset($parray[$name]);
} else ... | [
"public",
"function",
"setParameterGet",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"null",
")",
"{",
"// Verifying if is array",
"if",
"(",
"is_array",
"(",
"$",
"name",
")",
")",
"{",
"foreach",
"(",
"$",
"name",
"as",
"$",
"k",
"=>",
"$",
"v",
")",... | Set a GET parameter for the request
@param string|array $name Parameter name or an associative array with multiple parameters
@param mixed $value
@return \Slice\Http\Client | [
"Set",
"a",
"GET",
"parameter",
"for",
"the",
"request"
] | 8ab12b42354ff092d88d29d265733186698cb829 | https://github.com/devsdmf/slice-http/blob/8ab12b42354ff092d88d29d265733186698cb829/src/Slice/Http/Client.php#L302-L320 |
236,035 | devsdmf/slice-http | src/Slice/Http/Client.php | Client.setParameterPost | public function setParameterPost($name, $value = null)
{
// Verifying if is array
if (is_array($name)) {
foreach ($name as $k => $v) {
$this->setParameterPost($k,$v);
}
} else {
$parray = &$this->paramsPost;
if (is_null($value)) {
if (isset($parray[$name])) unset($parray[$name]);
} els... | php | public function setParameterPost($name, $value = null)
{
// Verifying if is array
if (is_array($name)) {
foreach ($name as $k => $v) {
$this->setParameterPost($k,$v);
}
} else {
$parray = &$this->paramsPost;
if (is_null($value)) {
if (isset($parray[$name])) unset($parray[$name]);
} els... | [
"public",
"function",
"setParameterPost",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"null",
")",
"{",
"// Verifying if is array",
"if",
"(",
"is_array",
"(",
"$",
"name",
")",
")",
"{",
"foreach",
"(",
"$",
"name",
"as",
"$",
"k",
"=>",
"$",
"v",
")"... | Set a POST parameter for the request
@param string|array $name Parameter name or an associative array with multiples parameters
@param string $value
@return \Slice\Http\Client | [
"Set",
"a",
"POST",
"parameter",
"for",
"the",
"request"
] | 8ab12b42354ff092d88d29d265733186698cb829 | https://github.com/devsdmf/slice-http/blob/8ab12b42354ff092d88d29d265733186698cb829/src/Slice/Http/Client.php#L329-L347 |
236,036 | devsdmf/slice-http | src/Slice/Http/Client.php | Client.rawData | public function rawData($bool = false)
{
if (is_bool($bool)) {
$this->useRawData = $bool;
} else {
throw new RuntimeException('Invalid parameter type, expected boolean, got ' . gettype($bool));
}
return $this;
} | php | public function rawData($bool = false)
{
if (is_bool($bool)) {
$this->useRawData = $bool;
} else {
throw new RuntimeException('Invalid parameter type, expected boolean, got ' . gettype($bool));
}
return $this;
} | [
"public",
"function",
"rawData",
"(",
"$",
"bool",
"=",
"false",
")",
"{",
"if",
"(",
"is_bool",
"(",
"$",
"bool",
")",
")",
"{",
"$",
"this",
"->",
"useRawData",
"=",
"$",
"bool",
";",
"}",
"else",
"{",
"throw",
"new",
"RuntimeException",
"(",
"'I... | Set true or false to use RAW data in request
@param boolean $bool
@throws RuntimeException
@return \Slice\Http\Client | [
"Set",
"true",
"or",
"false",
"to",
"use",
"RAW",
"data",
"in",
"request"
] | 8ab12b42354ff092d88d29d265733186698cb829 | https://github.com/devsdmf/slice-http/blob/8ab12b42354ff092d88d29d265733186698cb829/src/Slice/Http/Client.php#L356-L365 |
236,037 | devsdmf/slice-http | src/Slice/Http/Client.php | Client.setRawData | public function setRawData($data)
{
if (is_string($data)) {
$this->rawData(true);
$this->dataRaw = $data;
} else {
throw new RuntimeException('Invalid RAW data setted.');
}
return $this;
} | php | public function setRawData($data)
{
if (is_string($data)) {
$this->rawData(true);
$this->dataRaw = $data;
} else {
throw new RuntimeException('Invalid RAW data setted.');
}
return $this;
} | [
"public",
"function",
"setRawData",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"data",
")",
")",
"{",
"$",
"this",
"->",
"rawData",
"(",
"true",
")",
";",
"$",
"this",
"->",
"dataRaw",
"=",
"$",
"data",
";",
"}",
"else",
"{",
... | Set the RAW data for the request
@param string $data
@throws RuntimeException
@return \Slice\Http\Client | [
"Set",
"the",
"RAW",
"data",
"for",
"the",
"request"
] | 8ab12b42354ff092d88d29d265733186698cb829 | https://github.com/devsdmf/slice-http/blob/8ab12b42354ff092d88d29d265733186698cb829/src/Slice/Http/Client.php#L374-L384 |
236,038 | devsdmf/slice-http | src/Slice/Http/Client.php | Client.setFiles | public function setFiles($file, $name = null)
{
// Verifying if is array
if (is_array($file)) {
foreach ($file as $k => $v) {
$this->setFiles($v,$k);
}
} else {
$parray = &$this->files;
if (file_exists($file)) {
if (is_null($file)) {
if (isset($parray[$name])) unset($parray[$name]);
... | php | public function setFiles($file, $name = null)
{
// Verifying if is array
if (is_array($file)) {
foreach ($file as $k => $v) {
$this->setFiles($v,$k);
}
} else {
$parray = &$this->files;
if (file_exists($file)) {
if (is_null($file)) {
if (isset($parray[$name])) unset($parray[$name]);
... | [
"public",
"function",
"setFiles",
"(",
"$",
"file",
",",
"$",
"name",
"=",
"null",
")",
"{",
"// Verifying if is array",
"if",
"(",
"is_array",
"(",
"$",
"file",
")",
")",
"{",
"foreach",
"(",
"$",
"file",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
... | Set files for send in request
@param string|array $file
@param string $name
@return \Slice\Http\Client | [
"Set",
"files",
"for",
"send",
"in",
"request"
] | 8ab12b42354ff092d88d29d265733186698cb829 | https://github.com/devsdmf/slice-http/blob/8ab12b42354ff092d88d29d265733186698cb829/src/Slice/Http/Client.php#L393-L420 |
236,039 | devsdmf/slice-http | src/Slice/Http/Client.php | Client.setHTTPVersion | public function setHTTPVersion($version = self::HTTP_1)
{
if ($version == self::HTTP_0 || $version == self::HTTP_1) {
$this->httpVersion = $version;
} else {
throw new RuntimeException('Invalid HTTP version setted.');
}
return $this;
} | php | public function setHTTPVersion($version = self::HTTP_1)
{
if ($version == self::HTTP_0 || $version == self::HTTP_1) {
$this->httpVersion = $version;
} else {
throw new RuntimeException('Invalid HTTP version setted.');
}
return $this;
} | [
"public",
"function",
"setHTTPVersion",
"(",
"$",
"version",
"=",
"self",
"::",
"HTTP_1",
")",
"{",
"if",
"(",
"$",
"version",
"==",
"self",
"::",
"HTTP_0",
"||",
"$",
"version",
"==",
"self",
"::",
"HTTP_1",
")",
"{",
"$",
"this",
"->",
"httpVersion",... | Set HTTP protocol version for request
@param integer $version
@throws RuntimeException
@return \Slice\Http\Client | [
"Set",
"HTTP",
"protocol",
"version",
"for",
"request"
] | 8ab12b42354ff092d88d29d265733186698cb829 | https://github.com/devsdmf/slice-http/blob/8ab12b42354ff092d88d29d265733186698cb829/src/Slice/Http/Client.php#L439-L448 |
236,040 | devsdmf/slice-http | src/Slice/Http/Client.php | Client.setCurlOpts | public function setCurlOpts($opt, $value = null)
{
// Verifying if is array
if (is_array($opt)) {
foreach ($opt as $k => $v) {
$this->setCurlOpts($k,$v);
}
} else {
$this->curlOpts[$opt] = $value;
}
return $this;
} | php | public function setCurlOpts($opt, $value = null)
{
// Verifying if is array
if (is_array($opt)) {
foreach ($opt as $k => $v) {
$this->setCurlOpts($k,$v);
}
} else {
$this->curlOpts[$opt] = $value;
}
return $this;
} | [
"public",
"function",
"setCurlOpts",
"(",
"$",
"opt",
",",
"$",
"value",
"=",
"null",
")",
"{",
"// Verifying if is array",
"if",
"(",
"is_array",
"(",
"$",
"opt",
")",
")",
"{",
"foreach",
"(",
"$",
"opt",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",... | Set custom CURL options for CURL handle
@param mixed $opt The option value in CURL or an associative array with multiples options
@param mixed $value The value of parameter
@return \Slice\Http\Client | [
"Set",
"custom",
"CURL",
"options",
"for",
"CURL",
"handle"
] | 8ab12b42354ff092d88d29d265733186698cb829 | https://github.com/devsdmf/slice-http/blob/8ab12b42354ff092d88d29d265733186698cb829/src/Slice/Http/Client.php#L457-L469 |
236,041 | devsdmf/slice-http | src/Slice/Http/Client.php | Client.noReset | public function noReset($bool = false)
{
if (is_bool($bool)) {
$this->noReset = $bool;
} else {
throw new RuntimeException('Invalid parameter type setted, expected boolean, got ' . gettype($bool));
}
} | php | public function noReset($bool = false)
{
if (is_bool($bool)) {
$this->noReset = $bool;
} else {
throw new RuntimeException('Invalid parameter type setted, expected boolean, got ' . gettype($bool));
}
} | [
"public",
"function",
"noReset",
"(",
"$",
"bool",
"=",
"false",
")",
"{",
"if",
"(",
"is_bool",
"(",
"$",
"bool",
")",
")",
"{",
"$",
"this",
"->",
"noReset",
"=",
"$",
"bool",
";",
"}",
"else",
"{",
"throw",
"new",
"RuntimeException",
"(",
"'Inva... | Set true or false for reset the Client state after request
@param boolean $bool
@throws RuntimeException | [
"Set",
"true",
"or",
"false",
"for",
"reset",
"the",
"Client",
"state",
"after",
"request"
] | 8ab12b42354ff092d88d29d265733186698cb829 | https://github.com/devsdmf/slice-http/blob/8ab12b42354ff092d88d29d265733186698cb829/src/Slice/Http/Client.php#L497-L504 |
236,042 | devsdmf/slice-http | src/Slice/Http/Client.php | Client.reset | public function reset()
{
$this->uri = null;
$this->method = self::GET;
$this->headers = array();
$this->paramsGet = array();
$this->paramsPost = array();
$this->useRawData = false;
$this->dataRaw = null;
$this->httpVersion = self::HTTP_1;
$this->curlOpts = array();
retur... | php | public function reset()
{
$this->uri = null;
$this->method = self::GET;
$this->headers = array();
$this->paramsGet = array();
$this->paramsPost = array();
$this->useRawData = false;
$this->dataRaw = null;
$this->httpVersion = self::HTTP_1;
$this->curlOpts = array();
retur... | [
"public",
"function",
"reset",
"(",
")",
"{",
"$",
"this",
"->",
"uri",
"=",
"null",
";",
"$",
"this",
"->",
"method",
"=",
"self",
"::",
"GET",
";",
"$",
"this",
"->",
"headers",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"paramsGet",
"=",
... | Reset the Client state
@return \Slice\Http\Client | [
"Reset",
"the",
"Client",
"state"
] | 8ab12b42354ff092d88d29d265733186698cb829 | https://github.com/devsdmf/slice-http/blob/8ab12b42354ff092d88d29d265733186698cb829/src/Slice/Http/Client.php#L638-L651 |
236,043 | harmony-project/modular-routing | source/Bridge/Doctrine/EventListener/ModularSubscriber.php | ModularSubscriber.loadClassMetadata | public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs)
{
/** @var ClassMetadata $classMetadata */
$classMetadata = $eventArgs->getClassMetadata();
if (null === $classMetadata->getReflectionClass() ||
false == $this->isModular($classMetadata) ||
'Har... | php | public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs)
{
/** @var ClassMetadata $classMetadata */
$classMetadata = $eventArgs->getClassMetadata();
if (null === $classMetadata->getReflectionClass() ||
false == $this->isModular($classMetadata) ||
'Har... | [
"public",
"function",
"loadClassMetadata",
"(",
"LoadClassMetadataEventArgs",
"$",
"eventArgs",
")",
"{",
"/** @var ClassMetadata $classMetadata */",
"$",
"classMetadata",
"=",
"$",
"eventArgs",
"->",
"getClassMetadata",
"(",
")",
";",
"if",
"(",
"null",
"===",
"$",
... | Handles actions when metadata is loaded.
Creates an association for entities that inherit ModularTrait.
@param LoadClassMetadataEventArgs $eventArgs | [
"Handles",
"actions",
"when",
"metadata",
"is",
"loaded",
"."
] | 399bb427678ddc17c67295c738b96faea485e2d8 | https://github.com/harmony-project/modular-routing/blob/399bb427678ddc17c67295c738b96faea485e2d8/source/Bridge/Doctrine/EventListener/ModularSubscriber.php#L80-L103 |
236,044 | harmony-project/modular-routing | source/Bridge/Doctrine/EventListener/ModularSubscriber.php | ModularSubscriber.prePersist | public function prePersist(LifecycleEventArgs $args)
{
$entity = $args->getEntity();
$entityManager = $args->getEntityManager();
$classMetadata = $entityManager->getClassMetadata(get_class($entity));
if (false == $this->isModular($classMetadata)) {
return;
... | php | public function prePersist(LifecycleEventArgs $args)
{
$entity = $args->getEntity();
$entityManager = $args->getEntityManager();
$classMetadata = $entityManager->getClassMetadata(get_class($entity));
if (false == $this->isModular($classMetadata)) {
return;
... | [
"public",
"function",
"prePersist",
"(",
"LifecycleEventArgs",
"$",
"args",
")",
"{",
"$",
"entity",
"=",
"$",
"args",
"->",
"getEntity",
"(",
")",
";",
"$",
"entityManager",
"=",
"$",
"args",
"->",
"getEntityManager",
"(",
")",
";",
"$",
"classMetadata",
... | Handles actions before creation of an entity.
Sets the module of an entity to the current module defined
by the module manager if it has been left empty.
@param LifecycleEventArgs $args | [
"Handles",
"actions",
"before",
"creation",
"of",
"an",
"entity",
"."
] | 399bb427678ddc17c67295c738b96faea485e2d8 | https://github.com/harmony-project/modular-routing/blob/399bb427678ddc17c67295c738b96faea485e2d8/source/Bridge/Doctrine/EventListener/ModularSubscriber.php#L113-L127 |
236,045 | perfumer/framework | src/Component/Container/Container.php | Container.get | public function get($name, array $parameters = [])
{
// Shared services are preserved through whole request
if (isset($this->shared[$name])) {
return $this->shared[$name];
}
if (!$this->has($name)) {
throw new NotFoundException('No definition found for servic... | php | public function get($name, array $parameters = [])
{
// Shared services are preserved through whole request
if (isset($this->shared[$name])) {
return $this->shared[$name];
}
if (!$this->has($name)) {
throw new NotFoundException('No definition found for servic... | [
"public",
"function",
"get",
"(",
"$",
"name",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"// Shared services are preserved through whole request",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"shared",
"[",
"$",
"name",
"]",
")",
")",
"{",
... | get
Get service instance.
@param string $name
@param array $parameters
@return mixed
@access public
@uses \ReflectionClass
@throws NotFoundException | [
"get",
"Get",
"service",
"instance",
"."
] | 3565b560e9b45dfac0a28600f70496afa91179be | https://github.com/perfumer/framework/blob/3565b560e9b45dfac0a28600f70496afa91179be/src/Component/Container/Container.php#L56-L119 |
236,046 | pMatviienko/zf2-data-grid | DataGrid/src/DataGrid/Condition/Pair.php | Pair.calculate | public function calculate($values)
{
$dataToReplace = array();
foreach ($this->getVariables() as $mask => $var) {
$var = $values[$var];
if ($var instanceof \DateTime) {
$var = new \Zend_Date($var->getTimestamp());
$var = $var->get(self::DEFAULT... | php | public function calculate($values)
{
$dataToReplace = array();
foreach ($this->getVariables() as $mask => $var) {
$var = $values[$var];
if ($var instanceof \DateTime) {
$var = new \Zend_Date($var->getTimestamp());
$var = $var->get(self::DEFAULT... | [
"public",
"function",
"calculate",
"(",
"$",
"values",
")",
"{",
"$",
"dataToReplace",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getVariables",
"(",
")",
"as",
"$",
"mask",
"=>",
"$",
"var",
")",
"{",
"$",
"var",
"=",
"$",
... | Calculating condition by given values.
@param array $values
@throws Exception\UnknownPairOperatorException
@return boolean | [
"Calculating",
"condition",
"by",
"given",
"values",
"."
] | 1d1958c059d2ac31b972bfd4a49c70e068677461 | https://github.com/pMatviienko/zf2-data-grid/blob/1d1958c059d2ac31b972bfd4a49c70e068677461/DataGrid/src/DataGrid/Condition/Pair.php#L54-L101 |
236,047 | n0m4dz/laracasa | Zend/Gdata/Gapps/GroupEntry.php | Zend_Gdata_Gapps_GroupEntry.getProperty | public function getProperty($rel = null)
{
if ($rel == null) {
return $this->_property;
} else {
foreach ($this->_property as $p) {
if ($p->rel == $rel) {
return $p;
}
}
return null;
}
} | php | public function getProperty($rel = null)
{
if ($rel == null) {
return $this->_property;
} else {
foreach ($this->_property as $p) {
if ($p->rel == $rel) {
return $p;
}
}
return null;
}
} | [
"public",
"function",
"getProperty",
"(",
"$",
"rel",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"rel",
"==",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"_property",
";",
"}",
"else",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_property",
"as",
"$",
... | Returns all property tags for this entry
@param string $rel The rel value of the property to be found. If null,
the array of properties is returned instead.
@return mixed Either an array of Zend_Gdata_Gapps_Extension_Property
objects if $rel is null, a single
Zend_Gdata_Gapps_Extension_Property object if $rel is speci... | [
"Returns",
"all",
"property",
"tags",
"for",
"this",
"entry"
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Gapps/GroupEntry.php#L130-L142 |
236,048 | JoshuaEstes/Daedalus | src/Daedalus/Loader/YamlBuildFileLoader.php | YamlBuildFileLoader.processTasks | protected function processTasks($tasks)
{
foreach ($tasks as $taskName => $taskConfig) {
$serviceId = sprintf('task.%s', $taskName);
$this->container->setDefinition(
$serviceId,
new Definition()
)->setSynthetic(true);
$command ... | php | protected function processTasks($tasks)
{
foreach ($tasks as $taskName => $taskConfig) {
$serviceId = sprintf('task.%s', $taskName);
$this->container->setDefinition(
$serviceId,
new Definition()
)->setSynthetic(true);
$command ... | [
"protected",
"function",
"processTasks",
"(",
"$",
"tasks",
")",
"{",
"foreach",
"(",
"$",
"tasks",
"as",
"$",
"taskName",
"=>",
"$",
"taskConfig",
")",
"{",
"$",
"serviceId",
"=",
"sprintf",
"(",
"'task.%s'",
",",
"$",
"taskName",
")",
";",
"$",
"this... | Process tasks that the user has defined and turn them into commands
that can be ran.
@param array $tasks | [
"Process",
"tasks",
"that",
"the",
"user",
"has",
"defined",
"and",
"turn",
"them",
"into",
"commands",
"that",
"can",
"be",
"ran",
"."
] | 4c898c41433242e46b30d45ebe03fdc91512b444 | https://github.com/JoshuaEstes/Daedalus/blob/4c898c41433242e46b30d45ebe03fdc91512b444/src/Daedalus/Loader/YamlBuildFileLoader.php#L117-L131 |
236,049 | psiphp/grid | lib/ActionPerformer.php | ActionPerformer.perform | public function perform(
AgentInterface $agent,
GridMetadata $gridMetadata,
string $actionName,
array $selectedIdentifiers
): ActionResponseInterface {
$actionMetadatas = $gridMetadata->getActions();
if (!isset($actionMetadatas[$actionName])) {
throw new \... | php | public function perform(
AgentInterface $agent,
GridMetadata $gridMetadata,
string $actionName,
array $selectedIdentifiers
): ActionResponseInterface {
$actionMetadatas = $gridMetadata->getActions();
if (!isset($actionMetadatas[$actionName])) {
throw new \... | [
"public",
"function",
"perform",
"(",
"AgentInterface",
"$",
"agent",
",",
"GridMetadata",
"$",
"gridMetadata",
",",
"string",
"$",
"actionName",
",",
"array",
"$",
"selectedIdentifiers",
")",
":",
"ActionResponseInterface",
"{",
"$",
"actionMetadatas",
"=",
"$",
... | Retrieve a collection from the given agent using the given metadata and
identifiers and perform the named action on each member of the
collection.
It should be assumed that the storage will be flushed by the action
which is executed.
@throws \InvalidArgumentException If the action is not available. | [
"Retrieve",
"a",
"collection",
"from",
"the",
"given",
"agent",
"using",
"the",
"given",
"metadata",
"and",
"identifiers",
"and",
"perform",
"the",
"named",
"action",
"on",
"each",
"member",
"of",
"the",
"collection",
"."
] | 3c2183db23321d019147bb7c2a93575865d96789 | https://github.com/psiphp/grid/blob/3c2183db23321d019147bb7c2a93575865d96789/lib/ActionPerformer.php#L30-L51 |
236,050 | marando/phpSOFA | src/Marando/IAU/iauRx.php | iauRx.Rx | public static function Rx($phi, array &$r) {
$s;
$c;
$a10;
$a11;
$a12;
$a20;
$a21;
$a22;
$s = sin($phi);
$c = cos($phi);
$a10 = $c * $r[1][0] + $s * $r[2][0];
$a11 = $c * $r[1][1] + $s * $r[2][1];
$a12 = $c * $r[1][2] + $s * $r[2][2];
$a20 = - $s * $r[1][0] + $c... | php | public static function Rx($phi, array &$r) {
$s;
$c;
$a10;
$a11;
$a12;
$a20;
$a21;
$a22;
$s = sin($phi);
$c = cos($phi);
$a10 = $c * $r[1][0] + $s * $r[2][0];
$a11 = $c * $r[1][1] + $s * $r[2][1];
$a12 = $c * $r[1][2] + $s * $r[2][2];
$a20 = - $s * $r[1][0] + $c... | [
"public",
"static",
"function",
"Rx",
"(",
"$",
"phi",
",",
"array",
"&",
"$",
"r",
")",
"{",
"$",
"s",
";",
"$",
"c",
";",
"$",
"a10",
";",
"$",
"a11",
";",
"$",
"a12",
";",
"$",
"a20",
";",
"$",
"a21",
";",
"$",
"a22",
";",
"$",
"s",
... | - - - - - -
i a u R x
- - - - - -
Rotate an r-matrix about the x-axis.
This function is part of the International Astronomical Union's
SOFA (Standards Of Fundamental Astronomy) software collection.
Status: vector/matrix support function.
Given:
phi double angle (radians)
Given and returned:
r dou... | [
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"R",
"x",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauRx.php#L45-L73 |
236,051 | Webiny/Hrc | src/Webiny/Hrc/IndexStorage/FileSystem.php | FileSystem.getIndex | private function getIndex($key, $tags)
{
// tags folder
$tagFolder = $this->createFolderNameFromTags($tags);
if (!is_dir($tagFolder)) {
mkdir($tagFolder, 0755, true);
}
// key folder
$folder = $tagFolder . substr($key, 0, 2) . DIRECTORY_SEPARATOR . subst... | php | private function getIndex($key, $tags)
{
// tags folder
$tagFolder = $this->createFolderNameFromTags($tags);
if (!is_dir($tagFolder)) {
mkdir($tagFolder, 0755, true);
}
// key folder
$folder = $tagFolder . substr($key, 0, 2) . DIRECTORY_SEPARATOR . subst... | [
"private",
"function",
"getIndex",
"(",
"$",
"key",
",",
"$",
"tags",
")",
"{",
"// tags folder",
"$",
"tagFolder",
"=",
"$",
"this",
"->",
"createFolderNameFromTags",
"(",
"$",
"tags",
")",
";",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"tagFolder",
")",
")... | Based on the provided key and tag list, a path to the index is created and returned.
@param string $key
@param string $tags
@return string | [
"Based",
"on",
"the",
"provided",
"key",
"and",
"tag",
"list",
"a",
"path",
"to",
"the",
"index",
"is",
"created",
"and",
"returned",
"."
] | 2594d645dd79a579916d90ec93ce815bd413558f | https://github.com/Webiny/Hrc/blob/2594d645dd79a579916d90ec93ce815bd413558f/src/Webiny/Hrc/IndexStorage/FileSystem.php#L224-L242 |
236,052 | Webiny/Hrc | src/Webiny/Hrc/IndexStorage/FileSystem.php | FileSystem.createFolderNameFromTags | private function createFolderNameFromTags(array $tags)
{
natsort($tags);
$tagFolder = '_';
foreach ($tags as $t) {
$tagFolder .= $t . '_';
}
return $this->indexDir . $tagFolder . DIRECTORY_SEPARATOR;
} | php | private function createFolderNameFromTags(array $tags)
{
natsort($tags);
$tagFolder = '_';
foreach ($tags as $t) {
$tagFolder .= $t . '_';
}
return $this->indexDir . $tagFolder . DIRECTORY_SEPARATOR;
} | [
"private",
"function",
"createFolderNameFromTags",
"(",
"array",
"$",
"tags",
")",
"{",
"natsort",
"(",
"$",
"tags",
")",
";",
"$",
"tagFolder",
"=",
"'_'",
";",
"foreach",
"(",
"$",
"tags",
"as",
"$",
"t",
")",
"{",
"$",
"tagFolder",
".=",
"$",
"t",... | Based on the provided list of tags, a path to the root tags folder is created.
@param array $tags
@return string | [
"Based",
"on",
"the",
"provided",
"list",
"of",
"tags",
"a",
"path",
"to",
"the",
"root",
"tags",
"folder",
"is",
"created",
"."
] | 2594d645dd79a579916d90ec93ce815bd413558f | https://github.com/Webiny/Hrc/blob/2594d645dd79a579916d90ec93ce815bd413558f/src/Webiny/Hrc/IndexStorage/FileSystem.php#L251-L260 |
236,053 | jurchiks/commons | src/upload/UploadedFile.php | UploadedFile.getErrorMessage | public function getErrorMessage(): string
{
static $messages = [
UPLOAD_ERR_OK => 'Upload successful',
UPLOAD_ERR_INI_SIZE => 'The size of the file exceeds the value of the "upload_max_filesize" directive in php.ini',
UPLOAD_ERR_FORM_SIZE => 'The size of the file exceeds the value of the "MAX_FIL... | php | public function getErrorMessage(): string
{
static $messages = [
UPLOAD_ERR_OK => 'Upload successful',
UPLOAD_ERR_INI_SIZE => 'The size of the file exceeds the value of the "upload_max_filesize" directive in php.ini',
UPLOAD_ERR_FORM_SIZE => 'The size of the file exceeds the value of the "MAX_FIL... | [
"public",
"function",
"getErrorMessage",
"(",
")",
":",
"string",
"{",
"static",
"$",
"messages",
"=",
"[",
"UPLOAD_ERR_OK",
"=>",
"'Upload successful'",
",",
"UPLOAD_ERR_INI_SIZE",
"=>",
"'The size of the file exceeds the value of the \"upload_max_filesize\" directive in php.i... | Get a human-readable error message of the upload status.
Do not use this to check the upload status!
@see getErrorCode
@see getErrorConstant
@see isValid
@see http://php.net/manual/en/features.file-upload.errors.php | [
"Get",
"a",
"human",
"-",
"readable",
"error",
"message",
"of",
"the",
"upload",
"status",
".",
"Do",
"not",
"use",
"this",
"to",
"check",
"the",
"upload",
"status!"
] | be9e1eca6a94380647160a882b8476bee3e4d8f8 | https://github.com/jurchiks/commons/blob/be9e1eca6a94380647160a882b8476bee3e4d8f8/src/upload/UploadedFile.php#L135-L149 |
236,054 | jurchiks/commons | src/upload/UploadedFile.php | UploadedFile.moveTo | public function moveTo(string $destination)
{
if (!$this->isValid())
{
throw new FileMoveException('File was not uploaded successfully and thus cannot be moved');
}
if ($this->hasBeenMoved)
{
throw new FileMoveException('Uploaded file has already been moved');
}
if (is_dir($destination))
{
... | php | public function moveTo(string $destination)
{
if (!$this->isValid())
{
throw new FileMoveException('File was not uploaded successfully and thus cannot be moved');
}
if ($this->hasBeenMoved)
{
throw new FileMoveException('Uploaded file has already been moved');
}
if (is_dir($destination))
{
... | [
"public",
"function",
"moveTo",
"(",
"string",
"$",
"destination",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isValid",
"(",
")",
")",
"{",
"throw",
"new",
"FileMoveException",
"(",
"'File was not uploaded successfully and thus cannot be moved'",
")",
";",
"}... | Move the newly uploaded file to another directory and optionally rename it.
This method can only be called once, subsequent calls will throw an exception.
@param string $destination : the absolute path to where to move the file; if this does not include the file name,
the original file name is used
@return string the ... | [
"Move",
"the",
"newly",
"uploaded",
"file",
"to",
"another",
"directory",
"and",
"optionally",
"rename",
"it",
".",
"This",
"method",
"can",
"only",
"be",
"called",
"once",
"subsequent",
"calls",
"will",
"throw",
"an",
"exception",
"."
] | be9e1eca6a94380647160a882b8476bee3e4d8f8 | https://github.com/jurchiks/commons/blob/be9e1eca6a94380647160a882b8476bee3e4d8f8/src/upload/UploadedFile.php#L160-L201 |
236,055 | hamjoint/mustard-commerce | src/lib/Http/Controllers/InventoryController.php | InventoryController.getBought | public function getBought()
{
$items = Item::join('seller')
->leftJoin('purchases')
->where('purchases.user_id', Auth::user()->userId);
if (mustard_loaded('auctions')) {
$items->leftJoin('winningBid')
->orWhere('bids.user_id', Auth::user()->userId... | php | public function getBought()
{
$items = Item::join('seller')
->leftJoin('purchases')
->where('purchases.user_id', Auth::user()->userId);
if (mustard_loaded('auctions')) {
$items->leftJoin('winningBid')
->orWhere('bids.user_id', Auth::user()->userId... | [
"public",
"function",
"getBought",
"(",
")",
"{",
"$",
"items",
"=",
"Item",
"::",
"join",
"(",
"'seller'",
")",
"->",
"leftJoin",
"(",
"'purchases'",
")",
"->",
"where",
"(",
"'purchases.user_id'",
",",
"Auth",
"::",
"user",
"(",
")",
"->",
"userId",
... | Return the inventory bought items view.
@return \Illuminate\View\View | [
"Return",
"the",
"inventory",
"bought",
"items",
"view",
"."
] | 886caeb5a88d827c8e9201e90020b64651dd87ad | https://github.com/hamjoint/mustard-commerce/blob/886caeb5a88d827c8e9201e90020b64651dd87ad/src/lib/Http/Controllers/InventoryController.php#L40-L57 |
236,056 | hamjoint/mustard-commerce | src/lib/Http/Controllers/InventoryController.php | InventoryController.getSold | public function getSold()
{
$items = Auth::user()->items()
->leftJoin('purchases')
->where(function ($query) {
$query->typeFixed()->whereNotNull('purchases.purchase_id');
});
// Allows sorting by buyer username
$items->getBaseQuery()
... | php | public function getSold()
{
$items = Auth::user()->items()
->leftJoin('purchases')
->where(function ($query) {
$query->typeFixed()->whereNotNull('purchases.purchase_id');
});
// Allows sorting by buyer username
$items->getBaseQuery()
... | [
"public",
"function",
"getSold",
"(",
")",
"{",
"$",
"items",
"=",
"Auth",
"::",
"user",
"(",
")",
"->",
"items",
"(",
")",
"->",
"leftJoin",
"(",
"'purchases'",
")",
"->",
"where",
"(",
"function",
"(",
"$",
"query",
")",
"{",
"$",
"query",
"->",
... | Return the inventory sold items view.
@return \Illuminate\View\View | [
"Return",
"the",
"inventory",
"sold",
"items",
"view",
"."
] | 886caeb5a88d827c8e9201e90020b64651dd87ad | https://github.com/hamjoint/mustard-commerce/blob/886caeb5a88d827c8e9201e90020b64651dd87ad/src/lib/Http/Controllers/InventoryController.php#L64-L89 |
236,057 | hamjoint/mustard-commerce | src/lib/Http/Controllers/InventoryController.php | InventoryController.getUnsold | public function getUnsold()
{
$items = Auth::user()->items()
->with('purchases')
->where(function ($query) {
$query->has('purchases', 0)
->where('end_date', '<', time())
->where('auction', false)
->orWhere(fu... | php | public function getUnsold()
{
$items = Auth::user()->items()
->with('purchases')
->where(function ($query) {
$query->has('purchases', 0)
->where('end_date', '<', time())
->where('auction', false)
->orWhere(fu... | [
"public",
"function",
"getUnsold",
"(",
")",
"{",
"$",
"items",
"=",
"Auth",
"::",
"user",
"(",
")",
"->",
"items",
"(",
")",
"->",
"with",
"(",
"'purchases'",
")",
"->",
"where",
"(",
"function",
"(",
"$",
"query",
")",
"{",
"$",
"query",
"->",
... | Return the inventory unsold items view.
@return \Illuminate\View\View | [
"Return",
"the",
"inventory",
"unsold",
"items",
"view",
"."
] | 886caeb5a88d827c8e9201e90020b64651dd87ad | https://github.com/hamjoint/mustard-commerce/blob/886caeb5a88d827c8e9201e90020b64651dd87ad/src/lib/Http/Controllers/InventoryController.php#L96-L117 |
236,058 | webriq/core | module/User/src/Grid/User/Authentication/AuthenticationServiceFactory.php | AuthenticationServiceFactory.createService | public function createService( ServiceLocatorInterface $services )
{
$manager = $services->get( 'Zend\Session\ManagerInterface' );
$storage = new Session( null, null, $manager );
return new AuthenticationService( $services, $storage );
} | php | public function createService( ServiceLocatorInterface $services )
{
$manager = $services->get( 'Zend\Session\ManagerInterface' );
$storage = new Session( null, null, $manager );
return new AuthenticationService( $services, $storage );
} | [
"public",
"function",
"createService",
"(",
"ServiceLocatorInterface",
"$",
"services",
")",
"{",
"$",
"manager",
"=",
"$",
"services",
"->",
"get",
"(",
"'Zend\\Session\\ManagerInterface'",
")",
";",
"$",
"storage",
"=",
"new",
"Session",
"(",
"null",
",",
"n... | Create authentication service
@param ServiceLocatorInterface $services
@return AuthenticationService | [
"Create",
"authentication",
"service"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/User/src/Grid/User/Authentication/AuthenticationServiceFactory.php#L23-L28 |
236,059 | arvici/framework | src/Arvici/Heart/Router/Router.php | Router.addMiddleware | public function addMiddleware(Middleware $middleware)
{
$group = $middleware->getGroup();
if (! isset($this->middleware[$group])) {
$this->middleware[$group] = array(
'before' => array(),
'after' => array()
);
}
$this->middlewa... | php | public function addMiddleware(Middleware $middleware)
{
$group = $middleware->getGroup();
if (! isset($this->middleware[$group])) {
$this->middleware[$group] = array(
'before' => array(),
'after' => array()
);
}
$this->middlewa... | [
"public",
"function",
"addMiddleware",
"(",
"Middleware",
"$",
"middleware",
")",
"{",
"$",
"group",
"=",
"$",
"middleware",
"->",
"getGroup",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"middleware",
"[",
"$",
"group",
"]",
")",
... | Add middleware trigger to registry.
@param Middleware $middleware | [
"Add",
"middleware",
"trigger",
"to",
"registry",
"."
] | 4d0933912fef8f9edc756ef1ace009e96d9fc4b1 | https://github.com/arvici/framework/blob/4d0933912fef8f9edc756ef1ace009e96d9fc4b1/src/Arvici/Heart/Router/Router.php#L130-L141 |
236,060 | arvici/framework | src/Arvici/Heart/Router/Router.php | Router.executeRoute | private function executeRoute(Route &$route, $method, $force = false)
{
$continue = true;
if (! $force) {
$continue = $this->executeRouteMiddleware($route, 'before', $method);
}
if ($continue === true) {
$route->execute($this->compiled);
}
if... | php | private function executeRoute(Route &$route, $method, $force = false)
{
$continue = true;
if (! $force) {
$continue = $this->executeRouteMiddleware($route, 'before', $method);
}
if ($continue === true) {
$route->execute($this->compiled);
}
if... | [
"private",
"function",
"executeRoute",
"(",
"Route",
"&",
"$",
"route",
",",
"$",
"method",
",",
"$",
"force",
"=",
"false",
")",
"{",
"$",
"continue",
"=",
"true",
";",
"if",
"(",
"!",
"$",
"force",
")",
"{",
"$",
"continue",
"=",
"$",
"this",
"... | Will try to match parameters and execute the callback.
Will also trigger middleware.
@param Route $route
@param string $method Method of request.
@param bool $force true for skipping middleware. Could be bad to do! | [
"Will",
"try",
"to",
"match",
"parameters",
"and",
"execute",
"the",
"callback",
".",
"Will",
"also",
"trigger",
"middleware",
"."
] | 4d0933912fef8f9edc756ef1ace009e96d9fc4b1 | https://github.com/arvici/framework/blob/4d0933912fef8f9edc756ef1ace009e96d9fc4b1/src/Arvici/Heart/Router/Router.php#L184-L198 |
236,061 | arvici/framework | src/Arvici/Heart/Router/Router.php | Router.executeRouteMiddleware | private function executeRouteMiddleware(Route &$route, $position, $method)
{
$method = strtoupper($method);
/** @var Middleware[] $middleware */
$middleware = array();
$continue = true;
// Get all global middleware's.
if (isset(
$this->middleware['... | php | private function executeRouteMiddleware(Route &$route, $position, $method)
{
$method = strtoupper($method);
/** @var Middleware[] $middleware */
$middleware = array();
$continue = true;
// Get all global middleware's.
if (isset(
$this->middleware['... | [
"private",
"function",
"executeRouteMiddleware",
"(",
"Route",
"&",
"$",
"route",
",",
"$",
"position",
",",
"$",
"method",
")",
"{",
"$",
"method",
"=",
"strtoupper",
"(",
"$",
"method",
")",
";",
"/** @var Middleware[] $middleware */",
"$",
"middleware",
"="... | Execute middleware found for the route.
@param Route $route
@param string $position 'before' or 'after'
@param string $method
@return bool Continue? | [
"Execute",
"middleware",
"found",
"for",
"the",
"route",
"."
] | 4d0933912fef8f9edc756ef1ace009e96d9fc4b1 | https://github.com/arvici/framework/blob/4d0933912fef8f9edc756ef1ace009e96d9fc4b1/src/Arvici/Heart/Router/Router.php#L211-L250 |
236,062 | teamelf/ext-mailer | src/Driver.php | Driver.subject | public function subject($subject)
{
$name = Config::get('name');
$subject = '[' . $name . '] ' . $subject;
/**
* strange subject encode error
* occurred when there's both chinese and english
* solution see: https://github.com/swiftmailer/swiftmailer/issues/665
... | php | public function subject($subject)
{
$name = Config::get('name');
$subject = '[' . $name . '] ' . $subject;
/**
* strange subject encode error
* occurred when there's both chinese and english
* solution see: https://github.com/swiftmailer/swiftmailer/issues/665
... | [
"public",
"function",
"subject",
"(",
"$",
"subject",
")",
"{",
"$",
"name",
"=",
"Config",
"::",
"get",
"(",
"'name'",
")",
";",
"$",
"subject",
"=",
"'['",
".",
"$",
"name",
".",
"'] '",
".",
"$",
"subject",
";",
"/**\n * strange subject encode... | set message subject
@param string $subject
@return $this | [
"set",
"message",
"subject"
] | 46d88f5e3dd11b3631a1fed2cd7a7dc46698cc99 | https://github.com/teamelf/ext-mailer/blob/46d88f5e3dd11b3631a1fed2cd7a7dc46698cc99/src/Driver.php#L92-L104 |
236,063 | teamelf/ext-mailer | src/Driver.php | Driver.body | public function body($body, $contentType = null)
{
$this->message->setBody($body, $contentType);
return $this;
} | php | public function body($body, $contentType = null)
{
$this->message->setBody($body, $contentType);
return $this;
} | [
"public",
"function",
"body",
"(",
"$",
"body",
",",
"$",
"contentType",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"message",
"->",
"setBody",
"(",
"$",
"body",
",",
"$",
"contentType",
")",
";",
"return",
"$",
"this",
";",
"}"
] | set message body
@param string $body
@param string $contentType
@return $this | [
"set",
"message",
"body"
] | 46d88f5e3dd11b3631a1fed2cd7a7dc46698cc99 | https://github.com/teamelf/ext-mailer/blob/46d88f5e3dd11b3631a1fed2cd7a7dc46698cc99/src/Driver.php#L113-L117 |
236,064 | teamelf/ext-mailer | src/Driver.php | Driver.view | public function view($template, $data = [])
{
$html = ViewService::getEngine()->render($template, $data);
$this->message->setBody($html, 'text/html');
return $this;
} | php | public function view($template, $data = [])
{
$html = ViewService::getEngine()->render($template, $data);
$this->message->setBody($html, 'text/html');
return $this;
} | [
"public",
"function",
"view",
"(",
"$",
"template",
",",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"html",
"=",
"ViewService",
"::",
"getEngine",
"(",
")",
"->",
"render",
"(",
"$",
"template",
",",
"$",
"data",
")",
";",
"$",
"this",
"->",
"mes... | set message body with twig template
@param string $template
@param array $data
@return $this | [
"set",
"message",
"body",
"with",
"twig",
"template"
] | 46d88f5e3dd11b3631a1fed2cd7a7dc46698cc99 | https://github.com/teamelf/ext-mailer/blob/46d88f5e3dd11b3631a1fed2cd7a7dc46698cc99/src/Driver.php#L126-L131 |
236,065 | nicholasnet/common | src/Utils/Collection.php | Collection.median | public function median($key = null)
{
$count = $this->count();
if ($count == 0) {
return;
}
$values = $this->with(isset($key) ? $this->pluck($key) : $this)->sort()->values();
$middle = (int) ($count / 2);
if ($count % 2) {
return $values->... | php | public function median($key = null)
{
$count = $this->count();
if ($count == 0) {
return;
}
$values = $this->with(isset($key) ? $this->pluck($key) : $this)->sort()->values();
$middle = (int) ($count / 2);
if ($count % 2) {
return $values->... | [
"public",
"function",
"median",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"$",
"count",
"=",
"$",
"this",
"->",
"count",
"(",
")",
";",
"if",
"(",
"$",
"count",
"==",
"0",
")",
"{",
"return",
";",
"}",
"$",
"values",
"=",
"$",
"this",
"->",
"wi... | Get the median of a given key.
@param null $key
@return mixed | [
"Get",
"the",
"median",
"of",
"a",
"given",
"key",
"."
] | 8b948592ecf2a3a9060d05d04f12e30058dabf3f | https://github.com/nicholasnet/common/blob/8b948592ecf2a3a9060d05d04f12e30058dabf3f/src/Utils/Collection.php#L114-L132 |
236,066 | nicholasnet/common | src/Utils/Collection.php | Collection.containsStrict | public function containsStrict($key, $value = null)
{
if (func_num_args() == 2) {
return $this->contains(function ($item) use ($key, $value) {
return ArrayHelper::dataGet($item, $key) === $value;
});
}
if ($this->useAsCallable($key)) {
... | php | public function containsStrict($key, $value = null)
{
if (func_num_args() == 2) {
return $this->contains(function ($item) use ($key, $value) {
return ArrayHelper::dataGet($item, $key) === $value;
});
}
if ($this->useAsCallable($key)) {
... | [
"public",
"function",
"containsStrict",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
"==",
"2",
")",
"{",
"return",
"$",
"this",
"->",
"contains",
"(",
"function",
"(",
"$",
"item",
")",
"use",
"(... | Determine if an item exists in the collection using strict comparison.
@param mixed $key
@param mixed $value
@return bool | [
"Determine",
"if",
"an",
"item",
"exists",
"in",
"the",
"collection",
"using",
"strict",
"comparison",
"."
] | 8b948592ecf2a3a9060d05d04f12e30058dabf3f | https://github.com/nicholasnet/common/blob/8b948592ecf2a3a9060d05d04f12e30058dabf3f/src/Utils/Collection.php#L219-L235 |
236,067 | PublisherHub/Publisher | src/Publisher/Selector/Parameter/AbstractSelector.php | AbstractSelector.doRequest | protected final function doRequest()
{
$stepId = count($this->results);
$request = $this->steps[$stepId]($this->results);
$response = $this->requestor->doRequest($request);
$this->checkGotResponse($response);
$this->saveResult($stepId, $response);
} | php | protected final function doRequest()
{
$stepId = count($this->results);
$request = $this->steps[$stepId]($this->results);
$response = $this->requestor->doRequest($request);
$this->checkGotResponse($response);
$this->saveResult($stepId, $response);
} | [
"protected",
"final",
"function",
"doRequest",
"(",
")",
"{",
"$",
"stepId",
"=",
"count",
"(",
"$",
"this",
"->",
"results",
")",
";",
"$",
"request",
"=",
"$",
"this",
"->",
"steps",
"[",
"$",
"stepId",
"]",
"(",
"$",
"this",
"->",
"results",
")"... | Request and store the choices for the current step.
@return void | [
"Request",
"and",
"store",
"the",
"choices",
"for",
"the",
"current",
"step",
"."
] | 954e05118be9956e0c8631e44958af4ba42606b3 | https://github.com/PublisherHub/Publisher/blob/954e05118be9956e0c8631e44958af4ba42606b3/src/Publisher/Selector/Parameter/AbstractSelector.php#L187-L194 |
236,068 | mcfedr/twitterpushbundle | src/Mcfedr/TwitterPushBundle/Service/TweetPusher.php | TweetPusher.pushTweet | public function pushTweet($tweet)
{
if ($this->maxPushesPerHour > 0 && $this->cache) {
$hourAgo = new \DateTime('- 1 hour');
/** @var \DateTime[] $tweetTimes */
$tweetTimes = $this->cache->fetch(static::CACHE_KEY) ?: [];
foreach ($tweetTimes as $k => $time) {
... | php | public function pushTweet($tweet)
{
if ($this->maxPushesPerHour > 0 && $this->cache) {
$hourAgo = new \DateTime('- 1 hour');
/** @var \DateTime[] $tweetTimes */
$tweetTimes = $this->cache->fetch(static::CACHE_KEY) ?: [];
foreach ($tweetTimes as $k => $time) {
... | [
"public",
"function",
"pushTweet",
"(",
"$",
"tweet",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"maxPushesPerHour",
">",
"0",
"&&",
"$",
"this",
"->",
"cache",
")",
"{",
"$",
"hourAgo",
"=",
"new",
"\\",
"DateTime",
"(",
"'- 1 hour'",
")",
";",
"/** @v... | Send a tweet to everyone
@param array $tweet
@throws MaxPushesPerHourException
@throws \Mcfedr\AwsPushBundle\Exception\PlatformNotConfiguredException | [
"Send",
"a",
"tweet",
"to",
"everyone"
] | f18de2d69561f6b9a2d3dda60a1d8f5a230ca6c8 | https://github.com/mcfedr/twitterpushbundle/blob/f18de2d69561f6b9a2d3dda60a1d8f5a230ca6c8/src/Mcfedr/TwitterPushBundle/Service/TweetPusher.php#L74-L99 |
236,069 | movicon/movicon-http | src/http/HttpView.php | HttpView.printDocument | public function printDocument()
{
header("Content-Type: {$this->_contentType}; {$this->_charset}");
try {
$this->controller->processRequest();
} catch (Exception $e) {
$message = substr(
preg_replace('/\s+/', ' ', $e->getMessage()), 0, 150
... | php | public function printDocument()
{
header("Content-Type: {$this->_contentType}; {$this->_charset}");
try {
$this->controller->processRequest();
} catch (Exception $e) {
$message = substr(
preg_replace('/\s+/', ' ', $e->getMessage()), 0, 150
... | [
"public",
"function",
"printDocument",
"(",
")",
"{",
"header",
"(",
"\"Content-Type: {$this->_contentType}; {$this->_charset}\"",
")",
";",
"try",
"{",
"$",
"this",
"->",
"controller",
"->",
"processRequest",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"$",
... | Prints the document.
Returns a 'client exception' if an exception has occurred.
@return void | [
"Prints",
"the",
"document",
"."
] | ae9e4aa763c52f272c628fef0ec4496478312355 | https://github.com/movicon/movicon-http/blob/ae9e4aa763c52f272c628fef0ec4496478312355/src/http/HttpView.php#L46-L61 |
236,070 | christianklisch/phpcache | PHPCache.class.php | PHPCache.getConfig | public function getConfig($name) {
return isset($this->settings[$name]) ? $this->settings[$name] : null;
} | php | public function getConfig($name) {
return isset($this->settings[$name]) ? $this->settings[$name] : null;
} | [
"public",
"function",
"getConfig",
"(",
"$",
"name",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"settings",
"[",
"$",
"name",
"]",
")",
"?",
"$",
"this",
"->",
"settings",
"[",
"$",
"name",
"]",
":",
"null",
";",
"}"
] | Read and Write config
@param $name setting name
@return string | [
"Read",
"and",
"Write",
"config"
] | 3fad52b670f0f00d7edd16c3357fb64cada24366 | https://github.com/christianklisch/phpcache/blob/3fad52b670f0f00d7edd16c3357fb64cada24366/PHPCache.class.php#L81-L83 |
236,071 | christianklisch/phpcache | PHPCache.class.php | PHPCache.cacheVal | public function cacheVal($value, $id = null) {
if ($id == null) {
if (is_object($value))
$id = $this->getIDfromOjb($value);
if ($id == null && $this->getConfig('debug')) {
echo "no caching key";
return $value;
}
... | php | public function cacheVal($value, $id = null) {
if ($id == null) {
if (is_object($value))
$id = $this->getIDfromOjb($value);
if ($id == null && $this->getConfig('debug')) {
echo "no caching key";
return $value;
}
... | [
"public",
"function",
"cacheVal",
"(",
"$",
"value",
",",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"id",
"==",
"null",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"value",
")",
")",
"$",
"id",
"=",
"$",
"this",
"->",
"getIDfromOjb",
"(... | get cached value in time or return value
@param $value value or object to cache
@param $id key for cache
@return object | [
"get",
"cached",
"value",
"in",
"time",
"or",
"return",
"value"
] | 3fad52b670f0f00d7edd16c3357fb64cada24366 | https://github.com/christianklisch/phpcache/blob/3fad52b670f0f00d7edd16c3357fb64cada24366/PHPCache.class.php#L103-L129 |
236,072 | christianklisch/phpcache | PHPCache.class.php | PHPCache.cacheFun | public function cacheFun($function) {
if ($this->getConfig('debug') && !is_callable($function))
echo "no valid function";
$r = new ReflectionFunction($function);
$id = null;
foreach ($r->getStaticVariables() as $key => $var) {
if ($key == 'key')
... | php | public function cacheFun($function) {
if ($this->getConfig('debug') && !is_callable($function))
echo "no valid function";
$r = new ReflectionFunction($function);
$id = null;
foreach ($r->getStaticVariables() as $key => $var) {
if ($key == 'key')
... | [
"public",
"function",
"cacheFun",
"(",
"$",
"function",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getConfig",
"(",
"'debug'",
")",
"&&",
"!",
"is_callable",
"(",
"$",
"function",
")",
")",
"echo",
"\"no valid function\"",
";",
"$",
"r",
"=",
"new",
"Ref... | cache function result and return it
@param $function closure to cache
@return object | [
"cache",
"function",
"result",
"and",
"return",
"it"
] | 3fad52b670f0f00d7edd16c3357fb64cada24366 | https://github.com/christianklisch/phpcache/blob/3fad52b670f0f00d7edd16c3357fb64cada24366/PHPCache.class.php#L136-L172 |
236,073 | christianklisch/phpcache | PHPCache.class.php | PHPCache.isCached | public function isCached($id) {
if ($id != null) {
$id = $this->getIDfromOjb($id);
}
if ($id == null)
return false;
$cachefile = $this->getConfig('cacheDir') . '/' . utf8_decode($id);
$cachetime = $this->getConfig('cacheTime');
if (fi... | php | public function isCached($id) {
if ($id != null) {
$id = $this->getIDfromOjb($id);
}
if ($id == null)
return false;
$cachefile = $this->getConfig('cacheDir') . '/' . utf8_decode($id);
$cachetime = $this->getConfig('cacheTime');
if (fi... | [
"public",
"function",
"isCached",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"$",
"id",
"!=",
"null",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getIDfromOjb",
"(",
"$",
"id",
")",
";",
"}",
"if",
"(",
"$",
"id",
"==",
"null",
")",
"return",
"fa... | check, if key or object in first parameter is cached. Returns true, if cached
@param $id key of cached object or value
@return bool | [
"check",
"if",
"key",
"or",
"object",
"in",
"first",
"parameter",
"is",
"cached",
".",
"Returns",
"true",
"if",
"cached"
] | 3fad52b670f0f00d7edd16c3357fb64cada24366 | https://github.com/christianklisch/phpcache/blob/3fad52b670f0f00d7edd16c3357fb64cada24366/PHPCache.class.php#L179-L195 |
236,074 | christianklisch/phpcache | PHPCache.class.php | PHPCache.clearCache | public function clearCache() {
$files = glob($this->getConfig('cacheDir') . '/*', GLOB_MARK);
foreach ($files as $file) {
unlink($file);
}
} | php | public function clearCache() {
$files = glob($this->getConfig('cacheDir') . '/*', GLOB_MARK);
foreach ($files as $file) {
unlink($file);
}
} | [
"public",
"function",
"clearCache",
"(",
")",
"{",
"$",
"files",
"=",
"glob",
"(",
"$",
"this",
"->",
"getConfig",
"(",
"'cacheDir'",
")",
".",
"'/*'",
",",
"GLOB_MARK",
")",
";",
"foreach",
"(",
"$",
"files",
"as",
"$",
"file",
")",
"{",
"unlink",
... | delete all cached files | [
"delete",
"all",
"cached",
"files"
] | 3fad52b670f0f00d7edd16c3357fb64cada24366 | https://github.com/christianklisch/phpcache/blob/3fad52b670f0f00d7edd16c3357fb64cada24366/PHPCache.class.php#L218-L223 |
236,075 | christianklisch/phpcache | PHPCache.class.php | PHPCache.gc | public function gc() {
$files = glob($this->getConfig('cacheDir') . '/*', GLOB_MARK);
$cachetime = $this->getConfig('cacheTime');
foreach ($files as $file) {
if(time() - $cachetime > fileatime($file))
unlink($file);
}
} | php | public function gc() {
$files = glob($this->getConfig('cacheDir') . '/*', GLOB_MARK);
$cachetime = $this->getConfig('cacheTime');
foreach ($files as $file) {
if(time() - $cachetime > fileatime($file))
unlink($file);
}
} | [
"public",
"function",
"gc",
"(",
")",
"{",
"$",
"files",
"=",
"glob",
"(",
"$",
"this",
"->",
"getConfig",
"(",
"'cacheDir'",
")",
".",
"'/*'",
",",
"GLOB_MARK",
")",
";",
"$",
"cachetime",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"'cacheTime'",
")"... | delete old cached files | [
"delete",
"old",
"cached",
"files"
] | 3fad52b670f0f00d7edd16c3357fb64cada24366 | https://github.com/christianklisch/phpcache/blob/3fad52b670f0f00d7edd16c3357fb64cada24366/PHPCache.class.php#L228-L235 |
236,076 | spipremix/facteur | lib/markdownify/markdownify.php | Markdownify.parseString | function parseString($html) {
$this->parser->html = $html;
$this->parse();
return $this->output;
} | php | function parseString($html) {
$this->parser->html = $html;
$this->parse();
return $this->output;
} | [
"function",
"parseString",
"(",
"$",
"html",
")",
"{",
"$",
"this",
"->",
"parser",
"->",
"html",
"=",
"$",
"html",
";",
"$",
"this",
"->",
"parse",
"(",
")",
";",
"return",
"$",
"this",
"->",
"output",
";",
"}"
] | parse a HTML string
@param string $html
@return string markdown formatted | [
"parse",
"a",
"HTML",
"string"
] | 9cdca595d1f8f9a66c29e5c74e8666d81ebc65ca | https://github.com/spipremix/facteur/blob/9cdca595d1f8f9a66c29e5c74e8666d81ebc65ca/lib/markdownify/markdownify.php#L150-L154 |
236,077 | spipremix/facteur | lib/markdownify/markdownify.php | Markdownify.flushStacked | function flushStacked() {
# links
foreach ($this->stack as $tag => $a) {
if (!empty($a)) {
call_user_func(array(&$this, 'flushStacked_'.$tag));
}
}
} | php | function flushStacked() {
# links
foreach ($this->stack as $tag => $a) {
if (!empty($a)) {
call_user_func(array(&$this, 'flushStacked_'.$tag));
}
}
} | [
"function",
"flushStacked",
"(",
")",
"{",
"# links",
"foreach",
"(",
"$",
"this",
"->",
"stack",
"as",
"$",
"tag",
"=>",
"$",
"a",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"a",
")",
")",
"{",
"call_user_func",
"(",
"array",
"(",
"&",
"$",
... | output all stacked tags
@param void
@return void | [
"output",
"all",
"stacked",
"tags"
] | 9cdca595d1f8f9a66c29e5c74e8666d81ebc65ca | https://github.com/spipremix/facteur/blob/9cdca595d1f8f9a66c29e5c74e8666d81ebc65ca/lib/markdownify/markdownify.php#L388-L395 |
236,078 | spipremix/facteur | lib/markdownify/markdownify.php | Markdownify.flushLinebreaks | function flushLinebreaks() {
if ($this->lineBreaks && !empty($this->output)) {
$this->out(str_repeat("\n".$this->indent, $this->lineBreaks), true);
}
$this->lineBreaks = 0;
} | php | function flushLinebreaks() {
if ($this->lineBreaks && !empty($this->output)) {
$this->out(str_repeat("\n".$this->indent, $this->lineBreaks), true);
}
$this->lineBreaks = 0;
} | [
"function",
"flushLinebreaks",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"lineBreaks",
"&&",
"!",
"empty",
"(",
"$",
"this",
"->",
"output",
")",
")",
"{",
"$",
"this",
"->",
"out",
"(",
"str_repeat",
"(",
"\"\\n\"",
".",
"$",
"this",
"->",
"ind... | flush enqued linebreaks
@param void
@return void | [
"flush",
"enqued",
"linebreaks"
] | 9cdca595d1f8f9a66c29e5c74e8666d81ebc65ca | https://github.com/spipremix/facteur/blob/9cdca595d1f8f9a66c29e5c74e8666d81ebc65ca/lib/markdownify/markdownify.php#L424-L429 |
236,079 | spipremix/facteur | lib/markdownify/markdownify.php | Markdownify.handleText | function handleText() {
if ($this->hasParent('pre') && strpos($this->parser->node, "\n") !== false) {
$this->parser->node = str_replace("\n", "\n".$this->indent, $this->parser->node);
}
if (!$this->hasParent('code') && !$this->hasParent('pre')) {
# entity decode
$this->parser->node = $this... | php | function handleText() {
if ($this->hasParent('pre') && strpos($this->parser->node, "\n") !== false) {
$this->parser->node = str_replace("\n", "\n".$this->indent, $this->parser->node);
}
if (!$this->hasParent('code') && !$this->hasParent('pre')) {
# entity decode
$this->parser->node = $this... | [
"function",
"handleText",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasParent",
"(",
"'pre'",
")",
"&&",
"strpos",
"(",
"$",
"this",
"->",
"parser",
"->",
"node",
",",
"\"\\n\"",
")",
"!==",
"false",
")",
"{",
"$",
"this",
"->",
"parser",
"->",... | handle plain text
@param void
@return void | [
"handle",
"plain",
"text"
] | 9cdca595d1f8f9a66c29e5c74e8666d81ebc65ca | https://github.com/spipremix/facteur/blob/9cdca595d1f8f9a66c29e5c74e8666d81ebc65ca/lib/markdownify/markdownify.php#L522-L538 |
236,080 | spipremix/facteur | lib/markdownify/markdownify.php | Markdownify.stack | function stack() {
if (!isset($this->stack[$this->parser->tagName])) {
$this->stack[$this->parser->tagName] = array();
}
array_push($this->stack[$this->parser->tagName], $this->parser->tagAttributes);
} | php | function stack() {
if (!isset($this->stack[$this->parser->tagName])) {
$this->stack[$this->parser->tagName] = array();
}
array_push($this->stack[$this->parser->tagName], $this->parser->tagAttributes);
} | [
"function",
"stack",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"stack",
"[",
"$",
"this",
"->",
"parser",
"->",
"tagName",
"]",
")",
")",
"{",
"$",
"this",
"->",
"stack",
"[",
"$",
"this",
"->",
"parser",
"->",
"tagName",
... | add current node to the stack
this only stores the attributes
@param void
@return void | [
"add",
"current",
"node",
"to",
"the",
"stack",
"this",
"only",
"stores",
"the",
"attributes"
] | 9cdca595d1f8f9a66c29e5c74e8666d81ebc65ca | https://github.com/spipremix/facteur/blob/9cdca595d1f8f9a66c29e5c74e8666d81ebc65ca/lib/markdownify/markdownify.php#L929-L934 |
236,081 | spipremix/facteur | lib/markdownify/markdownify.php | Markdownify.unstack | function unstack() {
if (!isset($this->stack[$this->parser->tagName]) || !is_array($this->stack[$this->parser->tagName])) {
trigger_error('Trying to unstack from empty stack. This must not happen.', E_USER_ERROR);
}
return array_pop($this->stack[$this->parser->tagName]);
} | php | function unstack() {
if (!isset($this->stack[$this->parser->tagName]) || !is_array($this->stack[$this->parser->tagName])) {
trigger_error('Trying to unstack from empty stack. This must not happen.', E_USER_ERROR);
}
return array_pop($this->stack[$this->parser->tagName]);
} | [
"function",
"unstack",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"stack",
"[",
"$",
"this",
"->",
"parser",
"->",
"tagName",
"]",
")",
"||",
"!",
"is_array",
"(",
"$",
"this",
"->",
"stack",
"[",
"$",
"this",
"->",
"parser",... | remove current tag from stack
@param void
@return array | [
"remove",
"current",
"tag",
"from",
"stack"
] | 9cdca595d1f8f9a66c29e5c74e8666d81ebc65ca | https://github.com/spipremix/facteur/blob/9cdca595d1f8f9a66c29e5c74e8666d81ebc65ca/lib/markdownify/markdownify.php#L941-L946 |
236,082 | spipremix/facteur | lib/markdownify/markdownify.php | Markdownify.decode | function decode($text, $quote_style = ENT_QUOTES) {
if (version_compare(PHP_VERSION, '5', '>=')) {
# UTF-8 is only supported in PHP 5.x.x and above
$text = html_entity_decode($text, $quote_style, 'UTF-8');
} else {
if (function_exists('html_entity_decode')) {
$text = html_entity_decode... | php | function decode($text, $quote_style = ENT_QUOTES) {
if (version_compare(PHP_VERSION, '5', '>=')) {
# UTF-8 is only supported in PHP 5.x.x and above
$text = html_entity_decode($text, $quote_style, 'UTF-8');
} else {
if (function_exists('html_entity_decode')) {
$text = html_entity_decode... | [
"function",
"decode",
"(",
"$",
"text",
",",
"$",
"quote_style",
"=",
"ENT_QUOTES",
")",
"{",
"if",
"(",
"version_compare",
"(",
"PHP_VERSION",
",",
"'5'",
",",
"'>='",
")",
")",
"{",
"# UTF-8 is only supported in PHP 5.x.x and above",
"$",
"text",
"=",
"html_... | decode email addresses
@author derernst@gmx.ch <http://www.php.net/manual/en/function.html-entity-decode.php#68536>
@author Milian Wolff <http://milianw.de> | [
"decode",
"email",
"addresses"
] | 9cdca595d1f8f9a66c29e5c74e8666d81ebc65ca | https://github.com/spipremix/facteur/blob/9cdca595d1f8f9a66c29e5c74e8666d81ebc65ca/lib/markdownify/markdownify.php#L1075-L1093 |
236,083 | flowcode/AmulenMediaBundle | src/Flowcode/MediaBundle/Controller/AdminMediaTypeController.php | AdminMediaTypeController.createCreateForm | private function createCreateForm(MediaType $entity)
{
$form = $this->createForm(new MediaTypeType(), $entity, array(
'action' => $this->generateUrl('mediatype_create'),
'method' => 'POST',
));
$form->add('submit', 'submit', array('label' => 'Create'));
retu... | php | private function createCreateForm(MediaType $entity)
{
$form = $this->createForm(new MediaTypeType(), $entity, array(
'action' => $this->generateUrl('mediatype_create'),
'method' => 'POST',
));
$form->add('submit', 'submit', array('label' => 'Create'));
retu... | [
"private",
"function",
"createCreateForm",
"(",
"MediaType",
"$",
"entity",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"MediaTypeType",
"(",
")",
",",
"$",
"entity",
",",
"array",
"(",
"'action'",
"=>",
"$",
"this",
"->",
... | Creates a form to create a MediaType entity.
@param MediaType $entity The entity
@return \Symfony\Component\Form\Form The form | [
"Creates",
"a",
"form",
"to",
"create",
"a",
"MediaType",
"entity",
"."
] | 3be28720ff108cca1480de609872d29283776643 | https://github.com/flowcode/AmulenMediaBundle/blob/3be28720ff108cca1480de609872d29283776643/src/Flowcode/MediaBundle/Controller/AdminMediaTypeController.php#L72-L82 |
236,084 | flowcode/AmulenMediaBundle | src/Flowcode/MediaBundle/Controller/AdminMediaTypeController.php | AdminMediaTypeController.newAction | public function newAction()
{
$entity = new MediaType();
$form = $this->createCreateForm($entity);
return array(
'entity' => $entity,
'form' => $form->createView(),
);
} | php | public function newAction()
{
$entity = new MediaType();
$form = $this->createCreateForm($entity);
return array(
'entity' => $entity,
'form' => $form->createView(),
);
} | [
"public",
"function",
"newAction",
"(",
")",
"{",
"$",
"entity",
"=",
"new",
"MediaType",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"createCreateForm",
"(",
"$",
"entity",
")",
";",
"return",
"array",
"(",
"'entity'",
"=>",
"$",
"entity",
"... | Displays a form to create a new MediaType entity.
@Route("/new", name="mediatype_new")
@Method("GET")
@Template() | [
"Displays",
"a",
"form",
"to",
"create",
"a",
"new",
"MediaType",
"entity",
"."
] | 3be28720ff108cca1480de609872d29283776643 | https://github.com/flowcode/AmulenMediaBundle/blob/3be28720ff108cca1480de609872d29283776643/src/Flowcode/MediaBundle/Controller/AdminMediaTypeController.php#L91-L100 |
236,085 | flowcode/AmulenMediaBundle | src/Flowcode/MediaBundle/Controller/AdminMediaTypeController.php | AdminMediaTypeController.createEditForm | private function createEditForm(MediaType $entity)
{
$form = $this->createForm(new MediaTypeType(), $entity, array(
'action' => $this->generateUrl('mediatype_update', array('id' => $entity->getId())),
'method' => 'PUT',
));
$form->add('submit', 'submit', array('label... | php | private function createEditForm(MediaType $entity)
{
$form = $this->createForm(new MediaTypeType(), $entity, array(
'action' => $this->generateUrl('mediatype_update', array('id' => $entity->getId())),
'method' => 'PUT',
));
$form->add('submit', 'submit', array('label... | [
"private",
"function",
"createEditForm",
"(",
"MediaType",
"$",
"entity",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"MediaTypeType",
"(",
")",
",",
"$",
"entity",
",",
"array",
"(",
"'action'",
"=>",
"$",
"this",
"->",
"g... | Creates a form to edit a MediaType entity.
@param MediaType $entity The entity
@return \Symfony\Component\Form\Form The form | [
"Creates",
"a",
"form",
"to",
"edit",
"a",
"MediaType",
"entity",
"."
] | 3be28720ff108cca1480de609872d29283776643 | https://github.com/flowcode/AmulenMediaBundle/blob/3be28720ff108cca1480de609872d29283776643/src/Flowcode/MediaBundle/Controller/AdminMediaTypeController.php#L161-L171 |
236,086 | bkdotcom/Toolbox | src/FetchUrl.php | FetchUrl.extractHeaders | private function extractHeaders($str)
{
$this->debug->log(__METHOD__);
$this->debug->groupUncollapse();
$headerStart = 0;
#$this->debug->log(('top', \substr($return, 0, $this->curlInfo['header_size']));
$headerLenStack = array();
$i = 0;
while (true) {
... | php | private function extractHeaders($str)
{
$this->debug->log(__METHOD__);
$this->debug->groupUncollapse();
$headerStart = 0;
#$this->debug->log(('top', \substr($return, 0, $this->curlInfo['header_size']));
$headerLenStack = array();
$i = 0;
while (true) {
... | [
"private",
"function",
"extractHeaders",
"(",
"$",
"str",
")",
"{",
"$",
"this",
"->",
"debug",
"->",
"log",
"(",
"__METHOD__",
")",
";",
"$",
"this",
"->",
"debug",
"->",
"groupUncollapse",
"(",
")",
";",
"$",
"headerStart",
"=",
"0",
";",
"#$this->de... | for a string containing both headers and content, return the header portion
@param string $str headers + content
@return string | [
"for",
"a",
"string",
"containing",
"both",
"headers",
"and",
"content",
"return",
"the",
"header",
"portion"
] | 2f9d34fd57bd8382baee4c29aac13a6710e3a994 | https://github.com/bkdotcom/Toolbox/blob/2f9d34fd57bd8382baee4c29aac13a6710e3a994/src/FetchUrl.php#L189-L223 |
236,087 | bkdotcom/Toolbox | src/FetchUrl.php | FetchUrl.curlGetOptions | protected function curlGetOptions($url, $options = array())
{
$this->debug->groupCollapsed(__METHOD__);
$urlParts = Html::parseUrl($url);
$optionsDefault = $this->curlOptionsDefault($url);
$options = $this->curlOptionsNormalize($options);
// $this->debug->log('optionsDefault'... | php | protected function curlGetOptions($url, $options = array())
{
$this->debug->groupCollapsed(__METHOD__);
$urlParts = Html::parseUrl($url);
$optionsDefault = $this->curlOptionsDefault($url);
$options = $this->curlOptionsNormalize($options);
// $this->debug->log('optionsDefault'... | [
"protected",
"function",
"curlGetOptions",
"(",
"$",
"url",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"debug",
"->",
"groupCollapsed",
"(",
"__METHOD__",
")",
";",
"$",
"urlParts",
"=",
"Html",
"::",
"parseUrl",
"(",
"$"... | Get complete options
@param string $url url to fetch
@param array $options array o options
@return array | [
"Get",
"complete",
"options"
] | 2f9d34fd57bd8382baee4c29aac13a6710e3a994 | https://github.com/bkdotcom/Toolbox/blob/2f9d34fd57bd8382baee4c29aac13a6710e3a994/src/FetchUrl.php#L406-L438 |
236,088 | bkdotcom/Toolbox | src/FetchUrl.php | FetchUrl.curlOptionsDefault | protected function curlOptionsDefault($url)
{
$this->debug->groupCollapsed(__METHOD__);
$opts = array(
// 'CURLOPT_VERBOSE' => 1,
// 'CURLOPT_STDERR' => fopen(dirname($_SERVER['SCRIPT_FILENAME']).'/stderr.txt','a'),
// 'CURLOPT_COOKIEJAR' => 'c:/shazbot.tx... | php | protected function curlOptionsDefault($url)
{
$this->debug->groupCollapsed(__METHOD__);
$opts = array(
// 'CURLOPT_VERBOSE' => 1,
// 'CURLOPT_STDERR' => fopen(dirname($_SERVER['SCRIPT_FILENAME']).'/stderr.txt','a'),
// 'CURLOPT_COOKIEJAR' => 'c:/shazbot.tx... | [
"protected",
"function",
"curlOptionsDefault",
"(",
"$",
"url",
")",
"{",
"$",
"this",
"->",
"debug",
"->",
"groupCollapsed",
"(",
"__METHOD__",
")",
";",
"$",
"opts",
"=",
"array",
"(",
"// 'CURLOPT_VERBOSE' => 1,",
"// 'CURLOPT_STDERR' => fopen(dirname($_SERV... | Get defautl cURL options
@param string $url url
@return array | [
"Get",
"defautl",
"cURL",
"options"
] | 2f9d34fd57bd8382baee4c29aac13a6710e3a994 | https://github.com/bkdotcom/Toolbox/blob/2f9d34fd57bd8382baee4c29aac13a6710e3a994/src/FetchUrl.php#L447-L491 |
236,089 | bkdotcom/Toolbox | src/FetchUrl.php | FetchUrl.curlGetReturn | protected function curlGetReturn()
{
$follow = !isset($this->optionsPassed['CURLOPT_FOLLOWLOCATION'])
|| $this->optionsPassed['CURLOPT_FOLLOWLOCATION'];
$headers = $this->fetchResponse['headers'];
if ($follow && isset($headers['Location'])) { // follow location
$loc... | php | protected function curlGetReturn()
{
$follow = !isset($this->optionsPassed['CURLOPT_FOLLOWLOCATION'])
|| $this->optionsPassed['CURLOPT_FOLLOWLOCATION'];
$headers = $this->fetchResponse['headers'];
if ($follow && isset($headers['Location'])) { // follow location
$loc... | [
"protected",
"function",
"curlGetReturn",
"(",
")",
"{",
"$",
"follow",
"=",
"!",
"isset",
"(",
"$",
"this",
"->",
"optionsPassed",
"[",
"'CURLOPT_FOLLOWLOCATION'",
"]",
")",
"||",
"$",
"this",
"->",
"optionsPassed",
"[",
"'CURLOPT_FOLLOWLOCATION'",
"]",
";",
... | Build return value from fetchResponse
@return array|false | [
"Build",
"return",
"value",
"from",
"fetchResponse"
] | 2f9d34fd57bd8382baee4c29aac13a6710e3a994 | https://github.com/bkdotcom/Toolbox/blob/2f9d34fd57bd8382baee4c29aac13a6710e3a994/src/FetchUrl.php#L629-L665 |
236,090 | fabsgc/framework | Core/Asset/Asset.php | Asset._setFile | protected function _setFile($path) {
$this->_name .= $path;
$this->_data['' . $path . ''] = file_get_contents($path);
if ($this->_type == 'css') {
$this->_currentPath = dirname($path) . '/';
$this->_data['' . $path . ''] = preg_replace_callback('`url\((.*)\)`isU', ['Gcs\... | php | protected function _setFile($path) {
$this->_name .= $path;
$this->_data['' . $path . ''] = file_get_contents($path);
if ($this->_type == 'css') {
$this->_currentPath = dirname($path) . '/';
$this->_data['' . $path . ''] = preg_replace_callback('`url\((.*)\)`isU', ['Gcs\... | [
"protected",
"function",
"_setFile",
"(",
"$",
"path",
")",
"{",
"$",
"this",
"->",
"_name",
".=",
"$",
"path",
";",
"$",
"this",
"->",
"_data",
"[",
"''",
".",
"$",
"path",
".",
"''",
"]",
"=",
"file_get_contents",
"(",
"$",
"path",
")",
";",
"i... | configure one file
@access public
@param $path string
@return void
@since 3.0
@package Gcs\Framework\Core\Asset | [
"configure",
"one",
"file"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Asset/Asset.php#L172-L181 |
236,091 | fabsgc/framework | Core/Asset/Asset.php | Asset._setDir | protected function _setDir($path) {
if ($handle = opendir($path)) {
while (false !== ($entry = readdir($handle))) {
$extension = explode('.', basename($entry));
$ext = $extension[count($extension) - 1];
if ($ext == $this->_type) {
... | php | protected function _setDir($path) {
if ($handle = opendir($path)) {
while (false !== ($entry = readdir($handle))) {
$extension = explode('.', basename($entry));
$ext = $extension[count($extension) - 1];
if ($ext == $this->_type) {
... | [
"protected",
"function",
"_setDir",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"$",
"handle",
"=",
"opendir",
"(",
"$",
"path",
")",
")",
"{",
"while",
"(",
"false",
"!==",
"(",
"$",
"entry",
"=",
"readdir",
"(",
"$",
"handle",
")",
")",
")",
"{",
... | configure a directory
@access public
@param $path string
@return void
@since 3.0
@package Gcs\Framework\Core\Asset | [
"configure",
"a",
"directory"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Asset/Asset.php#L192-L205 |
236,092 | fabsgc/framework | Core/Asset/Asset.php | Asset._parseRelativePathCss | protected function _parseRelativePathCss($m) {
/**
* We take the page. Each time we have a '../' in a path file in the css, we drop a folder of the parent file. Zxample :
* css file : css/dossier/truc/test.css
* image file in css : ../../test.png
* we have two ../ so we... | php | protected function _parseRelativePathCss($m) {
/**
* We take the page. Each time we have a '../' in a path file in the css, we drop a folder of the parent file. Zxample :
* css file : css/dossier/truc/test.css
* image file in css : ../../test.png
* we have two ../ so we... | [
"protected",
"function",
"_parseRelativePathCss",
"(",
"$",
"m",
")",
"{",
"/**\n * We take the page. Each time we have a '../' in a path file in the css, we drop a folder of the parent file. Zxample :\n * css file : css/dossier/truc/test.css\n * image file in css : ../..... | correct wrong links
@access public
@param $m array
@return string
@since 3.0
@package Gcs\Framework\Core\Asset | [
"correct",
"wrong",
"links"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Asset/Asset.php#L242-L295 |
236,093 | fabsgc/framework | Core/Asset/Asset.php | Asset._compress | protected function _compress() {
//$before = '(?<=[:(, ])';
//$after = '(?=[ ,);}])';
//$units = '(em|ex|%|px|cm|mm|in|pt|pc|ch|rem|vh|vw|vmin|vmax|vm)';
foreach ($this->_data as $value) {
$this->_concatContent .= $value;
}
if ($this->_type == 'css') {
... | php | protected function _compress() {
//$before = '(?<=[:(, ])';
//$after = '(?=[ ,);}])';
//$units = '(em|ex|%|px|cm|mm|in|pt|pc|ch|rem|vh|vw|vmin|vmax|vm)';
foreach ($this->_data as $value) {
$this->_concatContent .= $value;
}
if ($this->_type == 'css') {
... | [
"protected",
"function",
"_compress",
"(",
")",
"{",
"//$before = '(?<=[:(, ])';",
"//$after = '(?=[ ,);}])';",
"//$units = '(em|ex|%|px|cm|mm|in|pt|pc|ch|rem|vh|vw|vmin|vmax|vm)';",
"foreach",
"(",
"$",
"this",
"->",
"_data",
"as",
"$",
"value",
")",
"{",
"$",
"this",
"-... | concatenate parser content
@access public
@return void
@since 3.0
@package Gcs\Framework\Core\Asset | [
"concatenate",
"parser",
"content"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Asset/Asset.php#L305-L319 |
236,094 | Ingewikkeld/oauth-server-bundle | src/Ingewikkeld/Rest/OAuthServerBundle/ResourceMapper/Client.php | Client.getResource | public function getResource($identifier)
{
/** @var ClientEntity $client */
$client = $this->getRepository()->findOneBy(array('id' => $identifier));
if (!$client) {
throw new NotFoundHttpException(
$this->translator->trans('error.client_not_found', array('%id%' =>... | php | public function getResource($identifier)
{
/** @var ClientEntity $client */
$client = $this->getRepository()->findOneBy(array('id' => $identifier));
if (!$client) {
throw new NotFoundHttpException(
$this->translator->trans('error.client_not_found', array('%id%' =>... | [
"public",
"function",
"getResource",
"(",
"$",
"identifier",
")",
"{",
"/** @var ClientEntity $client */",
"$",
"client",
"=",
"$",
"this",
"->",
"getRepository",
"(",
")",
"->",
"findOneBy",
"(",
"array",
"(",
"'id'",
"=>",
"$",
"identifier",
")",
")",
";",... | Returns the oAuth2 Client with the given identifier.
@param string|integer $identifier
@throws NotFoundHttpException if the client could not be found.
@return Resource | [
"Returns",
"the",
"oAuth2",
"Client",
"with",
"the",
"given",
"identifier",
"."
] | b5957414e57aeb2223d3b403aff4b108c10fd5cc | https://github.com/Ingewikkeld/oauth-server-bundle/blob/b5957414e57aeb2223d3b403aff4b108c10fd5cc/src/Ingewikkeld/Rest/OAuthServerBundle/ResourceMapper/Client.php#L60-L71 |
236,095 | Ingewikkeld/oauth-server-bundle | src/Ingewikkeld/Rest/OAuthServerBundle/ResourceMapper/Client.php | Client.getCollection | public function getCollection(array $options = array())
{
/** @var ClientEntity[] $collection */
$collection = $this->getRepository()->findAll();
$resource = new Resource($this->generateBrowseUrl(), array('count' => count($collection)));
foreach ($collection as $element) {
... | php | public function getCollection(array $options = array())
{
/** @var ClientEntity[] $collection */
$collection = $this->getRepository()->findAll();
$resource = new Resource($this->generateBrowseUrl(), array('count' => count($collection)));
foreach ($collection as $element) {
... | [
"public",
"function",
"getCollection",
"(",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"/** @var ClientEntity[] $collection */",
"$",
"collection",
"=",
"$",
"this",
"->",
"getRepository",
"(",
")",
"->",
"findAll",
"(",
")",
";",
"$",
"resou... | Returns all clients in a single collection resource.
@param string[] $options
@return Resource | [
"Returns",
"all",
"clients",
"in",
"a",
"single",
"collection",
"resource",
"."
] | b5957414e57aeb2223d3b403aff4b108c10fd5cc | https://github.com/Ingewikkeld/oauth-server-bundle/blob/b5957414e57aeb2223d3b403aff4b108c10fd5cc/src/Ingewikkeld/Rest/OAuthServerBundle/ResourceMapper/Client.php#L80-L91 |
236,096 | Ingewikkeld/oauth-server-bundle | src/Ingewikkeld/Rest/OAuthServerBundle/ResourceMapper/Client.php | Client.delete | public function delete(Resource $resource)
{
$data = $resource->toArray();
$client = $this->getRepository()->findOneBy(array('id' => $data['id']));
if (!$client) {
$errorMessage = $this->translator->trans('error.client_not_found', array('%id%' => $data['id']));
throw... | php | public function delete(Resource $resource)
{
$data = $resource->toArray();
$client = $this->getRepository()->findOneBy(array('id' => $data['id']));
if (!$client) {
$errorMessage = $this->translator->trans('error.client_not_found', array('%id%' => $data['id']));
throw... | [
"public",
"function",
"delete",
"(",
"Resource",
"$",
"resource",
")",
"{",
"$",
"data",
"=",
"$",
"resource",
"->",
"toArray",
"(",
")",
";",
"$",
"client",
"=",
"$",
"this",
"->",
"getRepository",
"(",
")",
"->",
"findOneBy",
"(",
"array",
"(",
"'i... | Removes the Client from the database.
@param \Hal\Resource $resource
@throws NotFoundHttpException if no client with the given id could be found.
@return void | [
"Removes",
"the",
"Client",
"from",
"the",
"database",
"."
] | b5957414e57aeb2223d3b403aff4b108c10fd5cc | https://github.com/Ingewikkeld/oauth-server-bundle/blob/b5957414e57aeb2223d3b403aff4b108c10fd5cc/src/Ingewikkeld/Rest/OAuthServerBundle/ResourceMapper/Client.php#L151-L162 |
236,097 | Ingewikkeld/oauth-server-bundle | src/Ingewikkeld/Rest/OAuthServerBundle/ResourceMapper/Client.php | Client.createResourceFromClient | protected function createResourceFromClient(ClientEntity $client)
{
$resource = new Resource(
$this->generateReadUrl($client->getId()),
array(
'id' => $client->getId(),
'publicId' => $client->getPublicId(),
'secret' ... | php | protected function createResourceFromClient(ClientEntity $client)
{
$resource = new Resource(
$this->generateReadUrl($client->getId()),
array(
'id' => $client->getId(),
'publicId' => $client->getPublicId(),
'secret' ... | [
"protected",
"function",
"createResourceFromClient",
"(",
"ClientEntity",
"$",
"client",
")",
"{",
"$",
"resource",
"=",
"new",
"Resource",
"(",
"$",
"this",
"->",
"generateReadUrl",
"(",
"$",
"client",
"->",
"getId",
"(",
")",
")",
",",
"array",
"(",
"'id... | Creates a new resource from the given Client entity.
@param ClientEntity $client
@return Resource | [
"Creates",
"a",
"new",
"resource",
"from",
"the",
"given",
"Client",
"entity",
"."
] | b5957414e57aeb2223d3b403aff4b108c10fd5cc | https://github.com/Ingewikkeld/oauth-server-bundle/blob/b5957414e57aeb2223d3b403aff4b108c10fd5cc/src/Ingewikkeld/Rest/OAuthServerBundle/ResourceMapper/Client.php#L230-L244 |
236,098 | vgrdominik/VGRElasticsearchHttpFoundationBundle | Security/Http/Firewall/ElasticsearchContextListener.php | ElasticsearchContextListener.handle | public function handle(GetResponseEvent $event)
{
if (!$this->registered && null !== $this->dispatcher && $event->isMasterRequest()) {
$this->dispatcher->addListener(KernelEvents::RESPONSE, array($this, 'onKernelResponse'));
$this->registered = true;
}
$request = $ev... | php | public function handle(GetResponseEvent $event)
{
if (!$this->registered && null !== $this->dispatcher && $event->isMasterRequest()) {
$this->dispatcher->addListener(KernelEvents::RESPONSE, array($this, 'onKernelResponse'));
$this->registered = true;
}
$request = $ev... | [
"public",
"function",
"handle",
"(",
"GetResponseEvent",
"$",
"event",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"registered",
"&&",
"null",
"!==",
"$",
"this",
"->",
"dispatcher",
"&&",
"$",
"event",
"->",
"isMasterRequest",
"(",
")",
")",
"{",
"$"... | Reads the SecurityContext from the session.
@param GetResponseEvent $event A GetResponseEvent instance | [
"Reads",
"the",
"SecurityContext",
"from",
"the",
"session",
"."
] | 06fad4b3619bfaf481b3141800d0b9eb5ae45b07 | https://github.com/vgrdominik/VGRElasticsearchHttpFoundationBundle/blob/06fad4b3619bfaf481b3141800d0b9eb5ae45b07/Security/Http/Firewall/ElasticsearchContextListener.php#L91-L129 |
236,099 | vgrdominik/VGRElasticsearchHttpFoundationBundle | Security/Http/Firewall/ElasticsearchContextListener.php | ElasticsearchContextListener.onKernelResponse | public function onKernelResponse(FilterResponseEvent $event)
{
if (!$event->isMasterRequest()) {
return;
}
if (!$event->getRequest()->hasSession()) {
return;
}
if (null !== $this->logger) {
$this->logger->debug('Write SecurityContext in t... | php | public function onKernelResponse(FilterResponseEvent $event)
{
if (!$event->isMasterRequest()) {
return;
}
if (!$event->getRequest()->hasSession()) {
return;
}
if (null !== $this->logger) {
$this->logger->debug('Write SecurityContext in t... | [
"public",
"function",
"onKernelResponse",
"(",
"FilterResponseEvent",
"$",
"event",
")",
"{",
"if",
"(",
"!",
"$",
"event",
"->",
"isMasterRequest",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"$",
"event",
"->",
"getRequest",
"(",
")",
"->... | Writes the SecurityContext to the session.
@param FilterResponseEvent $event A FilterResponseEvent instance | [
"Writes",
"the",
"SecurityContext",
"to",
"the",
"session",
"."
] | 06fad4b3619bfaf481b3141800d0b9eb5ae45b07 | https://github.com/vgrdominik/VGRElasticsearchHttpFoundationBundle/blob/06fad4b3619bfaf481b3141800d0b9eb5ae45b07/Security/Http/Firewall/ElasticsearchContextListener.php#L136-L164 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.