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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
22,300 | qlake/framework | src/Qlake/Support/Autoload.php | Autoload.load | public static function load($class)
{
$file = static::normalizePath($class);
if (file_exists($path = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.$file))
{
require $path;
return true;
}
foreach (static::$directories ... | php | public static function load($class)
{
$file = static::normalizePath($class);
if (file_exists($path = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.$file))
{
require $path;
return true;
}
foreach (static::$directories ... | [
"public",
"static",
"function",
"load",
"(",
"$",
"class",
")",
"{",
"$",
"file",
"=",
"static",
"::",
"normalizePath",
"(",
"$",
"class",
")",
";",
"if",
"(",
"file_exists",
"(",
"$",
"path",
"=",
"__DIR__",
".",
"DIRECTORY_SEPARATOR",
".",
"'..'",
".... | Search and Include a Class by class name like Qlake\Router\Route.
@param string $class Like Qlake\Router\Route
@return bool | [
"Search",
"and",
"Include",
"a",
"Class",
"by",
"class",
"name",
"like",
"Qlake",
"\\",
"Router",
"\\",
"Route",
"."
] | 0b7bad459ae0721bc5cdd141344f9dfc1acee28a | https://github.com/qlake/framework/blob/0b7bad459ae0721bc5cdd141344f9dfc1acee28a/src/Qlake/Support/Autoload.php#L41-L70 |
22,301 | surebert/surebert-framework | src/sb/Web/Captcha.php | Captcha.createWord | private function createWord()
{
$this->word ='';
for($x=0;$x<rand(5,7);$x++){
$this->word .=$this->allowed_characters[ rand(0, strlen($this->allowed_characters)-1)];
}
return $this->word;
} | php | private function createWord()
{
$this->word ='';
for($x=0;$x<rand(5,7);$x++){
$this->word .=$this->allowed_characters[ rand(0, strlen($this->allowed_characters)-1)];
}
return $this->word;
} | [
"private",
"function",
"createWord",
"(",
")",
"{",
"$",
"this",
"->",
"word",
"=",
"''",
";",
"for",
"(",
"$",
"x",
"=",
"0",
";",
"$",
"x",
"<",
"rand",
"(",
"5",
",",
"7",
")",
";",
"$",
"x",
"++",
")",
"{",
"$",
"this",
"->",
"word",
... | Creates the word from the allowed characters
@return string | [
"Creates",
"the",
"word",
"from",
"the",
"allowed",
"characters"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Web/Captcha.php#L107-L116 |
22,302 | surebert/surebert-framework | src/sb/Web/Captcha.php | Captcha.addInterference | public function addInterference()
{
for($i=0;$i<20;$i++){
$radius = rand(0,150);
imageellipse($this->image, rand(0,200), rand(0,200), $radius, $radius, $this->ink_color);
}
} | php | public function addInterference()
{
for($i=0;$i<20;$i++){
$radius = rand(0,150);
imageellipse($this->image, rand(0,200), rand(0,200), $radius, $radius, $this->ink_color);
}
} | [
"public",
"function",
"addInterference",
"(",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"20",
";",
"$",
"i",
"++",
")",
"{",
"$",
"radius",
"=",
"rand",
"(",
"0",
",",
"150",
")",
";",
"imageellipse",
"(",
"$",
"this",
"->... | Adds interference as circles int he backgroun the make it more difficult to parse. This is optional | [
"Adds",
"interference",
"as",
"circles",
"int",
"he",
"backgroun",
"the",
"make",
"it",
"more",
"difficult",
"to",
"parse",
".",
"This",
"is",
"optional"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Web/Captcha.php#L122-L129 |
22,303 | surebert/surebert-framework | src/sb/Web/Captcha.php | Captcha.draw | public function draw($filters=Array())
{
$word = $this->createWord();
for($j=0;$j<5;$j++){
if(file_exists($this->font)){
imagettftext($this->image, rand(8,18), rand(0,30), rand(0,200), rand(0,200), $this->ink_color, $this->font, 'not the code');
} else {
... | php | public function draw($filters=Array())
{
$word = $this->createWord();
for($j=0;$j<5;$j++){
if(file_exists($this->font)){
imagettftext($this->image, rand(8,18), rand(0,30), rand(0,200), rand(0,200), $this->ink_color, $this->font, 'not the code');
} else {
... | [
"public",
"function",
"draw",
"(",
"$",
"filters",
"=",
"Array",
"(",
")",
")",
"{",
"$",
"word",
"=",
"$",
"this",
"->",
"createWord",
"(",
")",
";",
"for",
"(",
"$",
"j",
"=",
"0",
";",
"$",
"j",
"<",
"5",
";",
"$",
"j",
"++",
")",
"{",
... | Draws the wor text on the image using the true type font specified. If no font is specified than
@param arary $filters AN array of GD filter constants to run on the image
@return resource THe image is returned and can be used with imagepng to display or export to file | [
"Draws",
"the",
"wor",
"text",
"on",
"the",
"image",
"using",
"the",
"true",
"type",
"font",
"specified",
".",
"If",
"no",
"font",
"is",
"specified",
"than"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Web/Captcha.php#L137-L164 |
22,304 | hametuha/wpametu | src/WPametu/API/Controller.php | Controller.nonce_field | public function nonce_field($key = '_wpnonce', $referrer = false, $echo = true){
return wp_nonce_field($this->action, $key, $referrer, $echo);
} | php | public function nonce_field($key = '_wpnonce', $referrer = false, $echo = true){
return wp_nonce_field($this->action, $key, $referrer, $echo);
} | [
"public",
"function",
"nonce_field",
"(",
"$",
"key",
"=",
"'_wpnonce'",
",",
"$",
"referrer",
"=",
"false",
",",
"$",
"echo",
"=",
"true",
")",
"{",
"return",
"wp_nonce_field",
"(",
"$",
"this",
"->",
"action",
",",
"$",
"key",
",",
"$",
"referrer",
... | Echo nonce field
@param string $key Default _wpnonce
@param bool $referrer Default false.
@param bool $echo Default true
@return string | [
"Echo",
"nonce",
"field"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/Controller.php#L152-L154 |
22,305 | hametuha/wpametu | src/WPametu/API/Controller.php | Controller.view | public static function view($slug, $name = '', array $args = []){
$class_name = get_called_class();
/** @var Controller $instance */
$instance = $class_name::get_instance();
$instance->lazy_scripts();
$instance->load_template($slug, $name, $args);
} | php | public static function view($slug, $name = '', array $args = []){
$class_name = get_called_class();
/** @var Controller $instance */
$instance = $class_name::get_instance();
$instance->lazy_scripts();
$instance->load_template($slug, $name, $args);
} | [
"public",
"static",
"function",
"view",
"(",
"$",
"slug",
",",
"$",
"name",
"=",
"''",
",",
"array",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"$",
"class_name",
"=",
"get_called_class",
"(",
")",
";",
"/** @var Controller $instance */",
"$",
"instance",
"="... | Load view template with arguments
@param string $slug
@param string $name
@param array $args | [
"Load",
"view",
"template",
"with",
"arguments"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/Controller.php#L193-L199 |
22,306 | ekuiter/feature-php | FeaturePhp/Generator/ExtendGenerator.php | ExtendGenerator.getExtendableFile | private function getExtendableFile($specification) {
$target = $specification->getTarget();
if (!array_key_exists($target, $this->extendableFiles)) {
if (!$specification->mayCreate())
return null;
$this->extendableFiles[$target] = $this->getExtendableFileFromSpeci... | php | private function getExtendableFile($specification) {
$target = $specification->getTarget();
if (!array_key_exists($target, $this->extendableFiles)) {
if (!$specification->mayCreate())
return null;
$this->extendableFiles[$target] = $this->getExtendableFileFromSpeci... | [
"private",
"function",
"getExtendableFile",
"(",
"$",
"specification",
")",
"{",
"$",
"target",
"=",
"$",
"specification",
"->",
"getTarget",
"(",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"target",
",",
"$",
"this",
"->",
"extendableFiles",
... | Creates an extendable file from a specification.
If the extendable file was already created, returns the cached extendable file.
If the extendable file does not yet exist, create it if it may be created from
this specification.
@param \FeaturePhp\Specification\Specification $specification
@return \FeaturePhp\File\Exten... | [
"Creates",
"an",
"extendable",
"file",
"from",
"a",
"specification",
".",
"If",
"the",
"extendable",
"file",
"was",
"already",
"created",
"returns",
"the",
"cached",
"extendable",
"file",
".",
"If",
"the",
"extendable",
"file",
"does",
"not",
"yet",
"exist",
... | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Generator/ExtendGenerator.php#L41-L50 |
22,307 | ekuiter/feature-php | FeaturePhp/Generator/ExtendGenerator.php | ExtendGenerator.generateFilesForArtifacts | private function generateFilesForArtifacts($artifacts, $fileSettingsGetter, $extend) {
foreach ($artifacts as $artifact) {
$settings = $artifact->getGeneratorSettings(static::getKey());
foreach (call_user_func(array($this, $fileSettingsGetter), $settings) as $file) {
$sp... | php | private function generateFilesForArtifacts($artifacts, $fileSettingsGetter, $extend) {
foreach ($artifacts as $artifact) {
$settings = $artifact->getGeneratorSettings(static::getKey());
foreach (call_user_func(array($this, $fileSettingsGetter), $settings) as $file) {
$sp... | [
"private",
"function",
"generateFilesForArtifacts",
"(",
"$",
"artifacts",
",",
"$",
"fileSettingsGetter",
",",
"$",
"extend",
")",
"{",
"foreach",
"(",
"$",
"artifacts",
"as",
"$",
"artifact",
")",
"{",
"$",
"settings",
"=",
"$",
"artifact",
"->",
"getGener... | Generates the extendable files for a set of artifacts and file settings.
@param \FeaturePhp\Artifact\Artifact[] $artifacts
@param callable $fileSettingsGetter
@param bool $extend | [
"Generates",
"the",
"extendable",
"files",
"for",
"a",
"set",
"of",
"artifacts",
"and",
"file",
"settings",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Generator/ExtendGenerator.php#L58-L77 |
22,308 | ekuiter/feature-php | FeaturePhp/Generator/ExtendGenerator.php | ExtendGenerator._generateFiles | protected function _generateFiles() {
$this->generateFilesForArtifacts($this->selectedArtifacts, "getFileSettingsForSelected", false);
$this->generateFilesForArtifacts($this->deselectedArtifacts, "getFileSettingsForDeselected", false);
$this->generateFilesForArtifacts($this->selectedArt... | php | protected function _generateFiles() {
$this->generateFilesForArtifacts($this->selectedArtifacts, "getFileSettingsForSelected", false);
$this->generateFilesForArtifacts($this->deselectedArtifacts, "getFileSettingsForDeselected", false);
$this->generateFilesForArtifacts($this->selectedArt... | [
"protected",
"function",
"_generateFiles",
"(",
")",
"{",
"$",
"this",
"->",
"generateFilesForArtifacts",
"(",
"$",
"this",
"->",
"selectedArtifacts",
",",
"\"getFileSettingsForSelected\"",
",",
"false",
")",
";",
"$",
"this",
"->",
"generateFilesForArtifacts",
"(",... | Generates the extendable files. | [
"Generates",
"the",
"extendable",
"files",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Generator/ExtendGenerator.php#L82-L91 |
22,309 | zicht/z | src/Zicht/Tool/Packager/Node/Stub.php | Stub.compile | final public function compile(Buffer $buffer)
{
$buffer
->writeln("Phar::mapPhar('z.phar');")
->writeln("define('ZPREFIX', 'phar://z.phar/');")
->writeln("require_once 'phar://z.phar/vendor/autoload.php';")
;
$this->compileInitialization($buffer);
... | php | final public function compile(Buffer $buffer)
{
$buffer
->writeln("Phar::mapPhar('z.phar');")
->writeln("define('ZPREFIX', 'phar://z.phar/');")
->writeln("require_once 'phar://z.phar/vendor/autoload.php';")
;
$this->compileInitialization($buffer);
... | [
"final",
"public",
"function",
"compile",
"(",
"Buffer",
"$",
"buffer",
")",
"{",
"$",
"buffer",
"->",
"writeln",
"(",
"\"Phar::mapPhar('z.phar');\"",
")",
"->",
"writeln",
"(",
"\"define('ZPREFIX', 'phar://z.phar/');\"",
")",
"->",
"writeln",
"(",
"\"require_once '... | Compiles into the specified buffer.
@param \Zicht\Tool\Script\Buffer $buffer
@return void | [
"Compiles",
"into",
"the",
"specified",
"buffer",
"."
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Packager/Node/Stub.php#L43-L56 |
22,310 | surebert/surebert-framework | src/sb/RSS/Feed.php | Feed.createNode | private function createNode($nodeName, $nodeValue, $cdata = false)
{
$node = $this->createElement($nodeName);
if($cdata){
$text = $this->createCDATASection($nodeValue);
} else {
$text = $this->createTextNode($nodeValue);
}
$node->appendChild($text);
... | php | private function createNode($nodeName, $nodeValue, $cdata = false)
{
$node = $this->createElement($nodeName);
if($cdata){
$text = $this->createCDATASection($nodeValue);
} else {
$text = $this->createTextNode($nodeValue);
}
$node->appendChild($text);
... | [
"private",
"function",
"createNode",
"(",
"$",
"nodeName",
",",
"$",
"nodeValue",
",",
"$",
"cdata",
"=",
"false",
")",
"{",
"$",
"node",
"=",
"$",
"this",
"->",
"createElement",
"(",
"$",
"nodeName",
")",
";",
"if",
"(",
"$",
"cdata",
")",
"{",
"$... | Creates and returns a new node with textNode, ready for appending
@param string $nodeName
@param string $nodeValue
@return object DOM node | [
"Creates",
"and",
"returns",
"a",
"new",
"node",
"with",
"textNode",
"ready",
"for",
"appending"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/RSS/Feed.php#L282-L294 |
22,311 | surebert/surebert-framework | src/sb/RSS/Feed.php | Feed.appendItem | private function appendItem(\sb\RSS\Item $item)
{
$new_item = $this->createElement("item");
foreach(get_object_vars($item) as $key=>$val){
if($item->{$key} instanceof \sb\RSS\ItemEnclosure){
$enclosure = $this->createElement('enclosure');
foreach($item->... | php | private function appendItem(\sb\RSS\Item $item)
{
$new_item = $this->createElement("item");
foreach(get_object_vars($item) as $key=>$val){
if($item->{$key} instanceof \sb\RSS\ItemEnclosure){
$enclosure = $this->createElement('enclosure');
foreach($item->... | [
"private",
"function",
"appendItem",
"(",
"\\",
"sb",
"\\",
"RSS",
"\\",
"Item",
"$",
"item",
")",
"{",
"$",
"new_item",
"=",
"$",
"this",
"->",
"createElement",
"(",
"\"item\"",
")",
";",
"foreach",
"(",
"get_object_vars",
"(",
"$",
"item",
")",
"as",... | Takes an \sb\RSS\Item and converts it into a DOMM node followed by inserting it into the feed DOM
@param \sb\RSS\Item $item | [
"Takes",
"an",
"\\",
"sb",
"\\",
"RSS",
"\\",
"Item",
"and",
"converts",
"it",
"into",
"a",
"DOMM",
"node",
"followed",
"by",
"inserting",
"it",
"into",
"the",
"feed",
"DOM"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/RSS/Feed.php#L301-L334 |
22,312 | surebert/surebert-framework | src/sb/RSS/Feed.php | Feed.channelPropertiesToDOM | private function channelPropertiesToDOM()
{
foreach(get_object_vars($this) as $key=>$val){
//parse string based key value pairs
if (is_string($val) && !empty($val)){
$this->channel->appendChild($this->createNode($key, $val, $key == 'description'));
//pa... | php | private function channelPropertiesToDOM()
{
foreach(get_object_vars($this) as $key=>$val){
//parse string based key value pairs
if (is_string($val) && !empty($val)){
$this->channel->appendChild($this->createNode($key, $val, $key == 'description'));
//pa... | [
"private",
"function",
"channelPropertiesToDOM",
"(",
")",
"{",
"foreach",
"(",
"get_object_vars",
"(",
"$",
"this",
")",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",
"//parse string based key value pairs",
"if",
"(",
"is_string",
"(",
"$",
"val",
")",
"&&"... | Converts all the feed object properties into RSS DOM nodes and adds them to the channel node | [
"Converts",
"all",
"the",
"feed",
"object",
"properties",
"into",
"RSS",
"DOM",
"nodes",
"and",
"adds",
"them",
"to",
"the",
"channel",
"node"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/RSS/Feed.php#L340-L393 |
22,313 | xiewulong/yii2-fileupload | oss/libs/symfony/yaml/Symfony/Component/Yaml/Unescaper.php | Unescaper.unescapeCharacter | public function unescapeCharacter($value)
{
switch ($value{1}) {
case '0':
return "\x0";
case 'a':
return "\x7";
case 'b':
return "\x8";
case 't':
return "\t";
case "\t":
... | php | public function unescapeCharacter($value)
{
switch ($value{1}) {
case '0':
return "\x0";
case 'a':
return "\x7";
case 'b':
return "\x8";
case 't':
return "\t";
case "\t":
... | [
"public",
"function",
"unescapeCharacter",
"(",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"value",
"{",
"1",
"}",
")",
"{",
"case",
"'0'",
":",
"return",
"\"\\x0\"",
";",
"case",
"'a'",
":",
"return",
"\"\\x7\"",
";",
"case",
"'b'",
":",
"return",
... | Unescapes a character that was found in a double-quoted string
@param string $value An escaped character
@return string The unescaped character | [
"Unescapes",
"a",
"character",
"that",
"was",
"found",
"in",
"a",
"double",
"-",
"quoted",
"string"
] | 3e75b17a4a18dd8466e3f57c63136de03470ca82 | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/symfony/yaml/Symfony/Component/Yaml/Unescaper.php#L66-L122 |
22,314 | gregoryv/php-logger | src/State.php | State.toggle | public function toggle($flag, $name)
{
switch ($flag) {
case 'on':
$onoff = true;
break;
case 'off':
$onoff = false;
break;
default:
throw new \InvalidArgumentException("Flag must be 'on' or '... | php | public function toggle($flag, $name)
{
switch ($flag) {
case 'on':
$onoff = true;
break;
case 'off':
$onoff = false;
break;
default:
throw new \InvalidArgumentException("Flag must be 'on' or '... | [
"public",
"function",
"toggle",
"(",
"$",
"flag",
",",
"$",
"name",
")",
"{",
"switch",
"(",
"$",
"flag",
")",
"{",
"case",
"'on'",
":",
"$",
"onoff",
"=",
"true",
";",
"break",
";",
"case",
"'off'",
":",
"$",
"onoff",
"=",
"false",
";",
"break",... | Sets the named attribute to true or false
@param string $flag (on|off)
@param string $name (debug|info|notice|warn|error|critical|alert|emergency)
@throws InvalidArgumentException on badly formated $flag or $name | [
"Sets",
"the",
"named",
"attribute",
"to",
"true",
"or",
"false"
] | 0f8ffc360a0233531a9775359929af8876997862 | https://github.com/gregoryv/php-logger/blob/0f8ffc360a0233531a9775359929af8876997862/src/State.php#L26-L67 |
22,315 | OKTOTV/OktolabMediaBundle | Model/FFprobeService.php | FFprobeService.audioCanBeEncoded | private function audioCanBeEncoded($resolution, $metainfo) {
return
// sample rate of file is better or as good as defined in resolution
$resolution['audio_sample_rate'] >= $metainfo['sample_rate'] &&
// bitrate of file is better or as good as defined in resolution
... | php | private function audioCanBeEncoded($resolution, $metainfo) {
return
// sample rate of file is better or as good as defined in resolution
$resolution['audio_sample_rate'] >= $metainfo['sample_rate'] &&
// bitrate of file is better or as good as defined in resolution
... | [
"private",
"function",
"audioCanBeEncoded",
"(",
"$",
"resolution",
",",
"$",
"metainfo",
")",
"{",
"return",
"// sample rate of file is better or as good as defined in resolution",
"$",
"resolution",
"[",
"'audio_sample_rate'",
"]",
">=",
"$",
"metainfo",
"[",
"'sample_r... | determines if the the audiotrack meets minimum standards to be encoded | [
"determines",
"if",
"the",
"the",
"audiotrack",
"meets",
"minimum",
"standards",
"to",
"be",
"encoded"
] | f9c1eac4f6b19d2ab25288b301dd0d9350478bb3 | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Model/FFprobeService.php#L158-L170 |
22,316 | OKTOTV/OktolabMediaBundle | Model/FFprobeService.php | FFprobeService.getMediaType | private function getMediaType($metainfo) {
if (
$metainfo['audio'] != false &&
(
$metainfo['video'] == false ||
$metainfo['video']['codec_name'] == 'png' ||
$metainfo['video']['codec_name'] == 'jpg'
)
) {
ret... | php | private function getMediaType($metainfo) {
if (
$metainfo['audio'] != false &&
(
$metainfo['video'] == false ||
$metainfo['video']['codec_name'] == 'png' ||
$metainfo['video']['codec_name'] == 'jpg'
)
) {
ret... | [
"private",
"function",
"getMediaType",
"(",
"$",
"metainfo",
")",
"{",
"if",
"(",
"$",
"metainfo",
"[",
"'audio'",
"]",
"!=",
"false",
"&&",
"(",
"$",
"metainfo",
"[",
"'video'",
"]",
"==",
"false",
"||",
"$",
"metainfo",
"[",
"'video'",
"]",
"[",
"'... | returns the mediatype depending on given metainfos
MEDIA_TYPE_AUDIO if soundfile,
MEDIA_TYPE_VIDEO if videofile,
MEDIA_TYPE_VIDEO_ONLY if videofile without soundstream. | [
"returns",
"the",
"mediatype",
"depending",
"on",
"given",
"metainfos",
"MEDIA_TYPE_AUDIO",
"if",
"soundfile",
"MEDIA_TYPE_VIDEO",
"if",
"videofile",
"MEDIA_TYPE_VIDEO_ONLY",
"if",
"videofile",
"without",
"soundstream",
"."
] | f9c1eac4f6b19d2ab25288b301dd0d9350478bb3 | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Model/FFprobeService.php#L178-L198 |
22,317 | OKTOTV/OktolabMediaBundle | Model/FFprobeService.php | FFprobeService.getMetainfoForEpisode | private function getMetainfoForEpisode($episode) {
$uri = $this->bprs_asset_helper->getAbsoluteUrl(
$episode->getVideo()
);
if (!$uri) { // can't create uri of episode video
$this->logbook->error(
'oktolab_media.episode_encode_no_streams',
... | php | private function getMetainfoForEpisode($episode) {
$uri = $this->bprs_asset_helper->getAbsoluteUrl(
$episode->getVideo()
);
if (!$uri) { // can't create uri of episode video
$this->logbook->error(
'oktolab_media.episode_encode_no_streams',
... | [
"private",
"function",
"getMetainfoForEpisode",
"(",
"$",
"episode",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"bprs_asset_helper",
"->",
"getAbsoluteUrl",
"(",
"$",
"episode",
"->",
"getVideo",
"(",
")",
")",
";",
"if",
"(",
"!",
"$",
"uri",
")",
... | extracts streaminformations of an episode from its video.
@param object $episode Entity you want the stream infos from
@return false|array if informations can't be extracted,
array of video and audio info | [
"extracts",
"streaminformations",
"of",
"an",
"episode",
"from",
"its",
"video",
"."
] | f9c1eac4f6b19d2ab25288b301dd0d9350478bb3 | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Model/FFprobeService.php#L206-L258 |
22,318 | wearenolte/wp-cpt | src/Cpt.php | Cpt.init | public function init() {
if ( ! post_type_exists( $this->post_type ) ) {
$post_type = register_post_type( $this->post_type, $this->args );
if ( is_wp_error( $post_type ) ) {
return $post_type;
}
}
if ( '' !== $this->title_placeholder ) {
add_filter( 'enter_title_here', array( $this, 'update_placeh... | php | public function init() {
if ( ! post_type_exists( $this->post_type ) ) {
$post_type = register_post_type( $this->post_type, $this->args );
if ( is_wp_error( $post_type ) ) {
return $post_type;
}
}
if ( '' !== $this->title_placeholder ) {
add_filter( 'enter_title_here', array( $this, 'update_placeh... | [
"public",
"function",
"init",
"(",
")",
"{",
"if",
"(",
"!",
"post_type_exists",
"(",
"$",
"this",
"->",
"post_type",
")",
")",
"{",
"$",
"post_type",
"=",
"register_post_type",
"(",
"$",
"this",
"->",
"post_type",
",",
"$",
"this",
"->",
"args",
")",
... | Function that register the CPT first tests if there is no such CPT on
the site.
@since 0.1.0 | [
"Function",
"that",
"register",
"the",
"CPT",
"first",
"tests",
"if",
"there",
"is",
"no",
"such",
"CPT",
"on",
"the",
"site",
"."
] | b6c11946e8f53a7c5ad5b347f66848c6df355812 | https://github.com/wearenolte/wp-cpt/blob/b6c11946e8f53a7c5ad5b347f66848c6df355812/src/Cpt.php#L177-L187 |
22,319 | wearenolte/wp-cpt | src/Cpt.php | Cpt.set_labels | public function set_labels( $labels ) {
$this->merge( $this->labels, $labels );
$this->update_arg( 'labels', $this->labels );
} | php | public function set_labels( $labels ) {
$this->merge( $this->labels, $labels );
$this->update_arg( 'labels', $this->labels );
} | [
"public",
"function",
"set_labels",
"(",
"$",
"labels",
")",
"{",
"$",
"this",
"->",
"merge",
"(",
"$",
"this",
"->",
"labels",
",",
"$",
"labels",
")",
";",
"$",
"this",
"->",
"update_arg",
"(",
"'labels'",
",",
"$",
"this",
"->",
"labels",
")",
"... | Allows to overwrite any of the default labels for this CPT, just
send an associate array with the value you want to update.
@since 0.1.0
@param array $labels The group of labels to update. | [
"Allows",
"to",
"overwrite",
"any",
"of",
"the",
"default",
"labels",
"for",
"this",
"CPT",
"just",
"send",
"an",
"associate",
"array",
"with",
"the",
"value",
"you",
"want",
"to",
"update",
"."
] | b6c11946e8f53a7c5ad5b347f66848c6df355812 | https://github.com/wearenolte/wp-cpt/blob/b6c11946e8f53a7c5ad5b347f66848c6df355812/src/Cpt.php#L229-L232 |
22,320 | wearenolte/wp-cpt | src/Cpt.php | Cpt.set_default_labels | private function set_default_labels() {
$this->labels = array(
'name' => $this->interpolate( '%s', $this->plural ),
'singular_name' => $this->interpolate( '%s', $this->singular ),
'add_new' => $this->interpolate( 'Add New' ),
'all_items' => $this->interpolate( 'All %s', $this-> plural ),
'new_item' => ... | php | private function set_default_labels() {
$this->labels = array(
'name' => $this->interpolate( '%s', $this->plural ),
'singular_name' => $this->interpolate( '%s', $this->singular ),
'add_new' => $this->interpolate( 'Add New' ),
'all_items' => $this->interpolate( 'All %s', $this-> plural ),
'new_item' => ... | [
"private",
"function",
"set_default_labels",
"(",
")",
"{",
"$",
"this",
"->",
"labels",
"=",
"array",
"(",
"'name'",
"=>",
"$",
"this",
"->",
"interpolate",
"(",
"'%s'",
",",
"$",
"this",
"->",
"plural",
")",
",",
"'singular_name'",
"=>",
"$",
"this",
... | Creates the default labels to be used with this CPT.
@since 0.10 | [
"Creates",
"the",
"default",
"labels",
"to",
"be",
"used",
"with",
"this",
"CPT",
"."
] | b6c11946e8f53a7c5ad5b347f66848c6df355812 | https://github.com/wearenolte/wp-cpt/blob/b6c11946e8f53a7c5ad5b347f66848c6df355812/src/Cpt.php#L256-L271 |
22,321 | wearenolte/wp-cpt | src/Cpt.php | Cpt.set_supports | public function set_supports( $support ) {
if ( is_array( $support ) ) {
$this->supports = $support;
$this->update_arg( 'supports', $this->supports );
}
} | php | public function set_supports( $support ) {
if ( is_array( $support ) ) {
$this->supports = $support;
$this->update_arg( 'supports', $this->supports );
}
} | [
"public",
"function",
"set_supports",
"(",
"$",
"support",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"support",
")",
")",
"{",
"$",
"this",
"->",
"supports",
"=",
"$",
"support",
";",
"$",
"this",
"->",
"update_arg",
"(",
"'supports'",
",",
"$",
"th... | Allow to update the default supports values for the CPT.
@since 0.1.0
@param array $support The new array with the supported featurs. | [
"Allow",
"to",
"update",
"the",
"default",
"supports",
"values",
"for",
"the",
"CPT",
"."
] | b6c11946e8f53a7c5ad5b347f66848c6df355812 | https://github.com/wearenolte/wp-cpt/blob/b6c11946e8f53a7c5ad5b347f66848c6df355812/src/Cpt.php#L342-L347 |
22,322 | Eresus/EresusCMS | src/core/Application.php | Eresus_Application.detectFsRoot | protected function detectFsRoot()
{
Eresus_Kernel::log(__METHOD__, LOG_DEBUG, 'start');
switch (true)
{
case Eresus_Kernel::isCLI():
$path = reset($GLOBALS['argv']);
Eresus_Kernel::log(__METHOD__, LOG_DEBUG, 'Using global $argv variable: %s', $path... | php | protected function detectFsRoot()
{
Eresus_Kernel::log(__METHOD__, LOG_DEBUG, 'start');
switch (true)
{
case Eresus_Kernel::isCLI():
$path = reset($GLOBALS['argv']);
Eresus_Kernel::log(__METHOD__, LOG_DEBUG, 'Using global $argv variable: %s', $path... | [
"protected",
"function",
"detectFsRoot",
"(",
")",
"{",
"Eresus_Kernel",
"::",
"log",
"(",
"__METHOD__",
",",
"LOG_DEBUG",
",",
"'start'",
")",
";",
"switch",
"(",
"true",
")",
"{",
"case",
"Eresus_Kernel",
"::",
"isCLI",
"(",
")",
":",
"$",
"path",
"=",... | Trying to determine application root directory
In CLI mode $GLOBALS['argv'][0] used.
In other modes $_SERVER['SCRIPT_FILENAME'] used.
@return string
@see fsRoot, getFsRoot() | [
"Trying",
"to",
"determine",
"application",
"root",
"directory"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Application.php#L115-L135 |
22,323 | xinix-technology/bono-blade | src/Xinix/Blade/BladeView.php | BladeView.resolvePath | protected function resolvePath(array $originalPaths)
{
$paths = array();
foreach ($originalPaths as $key => $path) {
if (count(explode('templates', $path)) == 1) {
$path = $path . DIRECTORY_SEPARATOR . 'templates';
}
if (realpath($path)) {
... | php | protected function resolvePath(array $originalPaths)
{
$paths = array();
foreach ($originalPaths as $key => $path) {
if (count(explode('templates', $path)) == 1) {
$path = $path . DIRECTORY_SEPARATOR . 'templates';
}
if (realpath($path)) {
... | [
"protected",
"function",
"resolvePath",
"(",
"array",
"$",
"originalPaths",
")",
"{",
"$",
"paths",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"originalPaths",
"as",
"$",
"key",
"=>",
"$",
"path",
")",
"{",
"if",
"(",
"count",
"(",
"explode",
... | Build an array for templates path directory
@return void | [
"Build",
"an",
"array",
"for",
"templates",
"path",
"directory"
] | 5b7b03bd3e87cc20d7262192d2b7b9cf334ba92f | https://github.com/xinix-technology/bono-blade/blob/5b7b03bd3e87cc20d7262192d2b7b9cf334ba92f/src/Xinix/Blade/BladeView.php#L97-L113 |
22,324 | xinix-technology/bono-blade | src/Xinix/Blade/BladeView.php | BladeView.setLayout | public function setLayout($layout, array $data = array())
{
if (is_null($layout)) {
$this->layout = null;
return;
}
$this->layout = $this->make($this->resolve($layout), $data);
} | php | public function setLayout($layout, array $data = array())
{
if (is_null($layout)) {
$this->layout = null;
return;
}
$this->layout = $this->make($this->resolve($layout), $data);
} | [
"public",
"function",
"setLayout",
"(",
"$",
"layout",
",",
"array",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"layout",
")",
")",
"{",
"$",
"this",
"->",
"layout",
"=",
"null",
";",
"return",
";",
"}",
"$",
... | Manually set the layout
This method will output the rendered template content, so you can set the layout on the air
@param string $layout name
@return void | [
"Manually",
"set",
"the",
"layout"
] | 5b7b03bd3e87cc20d7262192d2b7b9cf334ba92f | https://github.com/xinix-technology/bono-blade/blob/5b7b03bd3e87cc20d7262192d2b7b9cf334ba92f/src/Xinix/Blade/BladeView.php#L278-L287 |
22,325 | xinix-technology/bono-blade | src/Xinix/Blade/BladeView.php | BladeView.fetch | public function fetch($template, $data = array())
{
$view = $this->render($template, $data);
return ($view) ? $view->render() : '';
} | php | public function fetch($template, $data = array())
{
$view = $this->render($template, $data);
return ($view) ? $view->render() : '';
} | [
"public",
"function",
"fetch",
"(",
"$",
"template",
",",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"render",
"(",
"$",
"template",
",",
"$",
"data",
")",
";",
"return",
"(",
"$",
"view",
")",
"?",
"$",... | Return the contents of a rendered template file
@var string $template The template pathname, relative to the template base directory
@return Illuminate\View\View | [
"Return",
"the",
"contents",
"of",
"a",
"rendered",
"template",
"file"
] | 5b7b03bd3e87cc20d7262192d2b7b9cf334ba92f | https://github.com/xinix-technology/bono-blade/blob/5b7b03bd3e87cc20d7262192d2b7b9cf334ba92f/src/Xinix/Blade/BladeView.php#L308-L313 |
22,326 | xinix-technology/bono-blade | src/Xinix/Blade/BladeView.php | BladeView.render | protected function render($template, $data = array())
{
$view = null;
$data = array_merge_recursive($this->all(), $data);
$data['app'] = $this->app;
$template = $this->resolve($template);
if (! $template) {
return;
}
if (! $this... | php | protected function render($template, $data = array())
{
$view = null;
$data = array_merge_recursive($this->all(), $data);
$data['app'] = $this->app;
$template = $this->resolve($template);
if (! $template) {
return;
}
if (! $this... | [
"protected",
"function",
"render",
"(",
"$",
"template",
",",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"$",
"view",
"=",
"null",
";",
"$",
"data",
"=",
"array_merge_recursive",
"(",
"$",
"this",
"->",
"all",
"(",
")",
",",
"$",
"data",
")",
... | This method will output the rendered template content
@param string $template The path to the Blade template, relative to the Blade templates directory.
@return Illuminate\View\View | [
"This",
"method",
"will",
"output",
"the",
"rendered",
"template",
"content"
] | 5b7b03bd3e87cc20d7262192d2b7b9cf334ba92f | https://github.com/xinix-technology/bono-blade/blob/5b7b03bd3e87cc20d7262192d2b7b9cf334ba92f/src/Xinix/Blade/BladeView.php#L322-L341 |
22,327 | xinix-technology/bono-blade | src/Xinix/Blade/BladeView.php | BladeView.resolve | public function resolve($path)
{
$path = str_replace('/', '.', preg_replace('/\/:\w+/', '', $path));
$finder = $this->container['view.finder'];
try {
$finder->find($path);
} catch (InvalidArgumentException $e) {
$explodedPath = explode('.', $path);
... | php | public function resolve($path)
{
$path = str_replace('/', '.', preg_replace('/\/:\w+/', '', $path));
$finder = $this->container['view.finder'];
try {
$finder->find($path);
} catch (InvalidArgumentException $e) {
$explodedPath = explode('.', $path);
... | [
"public",
"function",
"resolve",
"(",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"str_replace",
"(",
"'/'",
",",
"'.'",
",",
"preg_replace",
"(",
"'/\\/:\\w+/'",
",",
"''",
",",
"$",
"path",
")",
")",
";",
"$",
"finder",
"=",
"$",
"this",
"->",
"cont... | This method will try to find the existing of template file
@param string $path The relative template path
@return string
@throws InvalidArgumentException If we cannot find view | [
"This",
"method",
"will",
"try",
"to",
"find",
"the",
"existing",
"of",
"template",
"file"
] | 5b7b03bd3e87cc20d7262192d2b7b9cf334ba92f | https://github.com/xinix-technology/bono-blade/blob/5b7b03bd3e87cc20d7262192d2b7b9cf334ba92f/src/Xinix/Blade/BladeView.php#L351-L380 |
22,328 | DevGroup-ru/yii2-users-module | src/models/User.php | User.rules | public function rules()
{
$module = UsersModule::module();
$rules = [
[
['phone'],
'safe',
],
[
[
'password',
],
'safe',
'on' => self::SCENARIO_DEFA... | php | public function rules()
{
$module = UsersModule::module();
$rules = [
[
['phone'],
'safe',
],
[
[
'password',
],
'safe',
'on' => self::SCENARIO_DEFA... | [
"public",
"function",
"rules",
"(",
")",
"{",
"$",
"module",
"=",
"UsersModule",
"::",
"module",
"(",
")",
";",
"$",
"rules",
"=",
"[",
"[",
"[",
"'phone'",
"]",
",",
"'safe'",
",",
"]",
",",
"[",
"[",
"'password'",
",",
"]",
",",
"'safe'",
",",
... | Validation rules for this model. | [
"Validation",
"rules",
"for",
"this",
"model",
"."
] | ff0103dc55c3462627ccc704c33e70c96053f750 | https://github.com/DevGroup-ru/yii2-users-module/blob/ff0103dc55c3462627ccc704c33e70c96053f750/src/models/User.php#L118-L190 |
22,329 | DevGroup-ru/yii2-users-module | src/models/User.php | User.afterFind | public function afterFind()
{
parent::afterFind();
$this->username_is_temporary = boolval($this->username_is_temporary);
$this->is_active = boolval($this->is_active);
} | php | public function afterFind()
{
parent::afterFind();
$this->username_is_temporary = boolval($this->username_is_temporary);
$this->is_active = boolval($this->is_active);
} | [
"public",
"function",
"afterFind",
"(",
")",
"{",
"parent",
"::",
"afterFind",
"(",
")",
";",
"$",
"this",
"->",
"username_is_temporary",
"=",
"boolval",
"(",
"$",
"this",
"->",
"username_is_temporary",
")",
";",
"$",
"this",
"->",
"is_active",
"=",
"boolv... | Performs after find action and casts attributes to proper type | [
"Performs",
"after",
"find",
"action",
"and",
"casts",
"attributes",
"to",
"proper",
"type"
] | ff0103dc55c3462627ccc704c33e70c96053f750 | https://github.com/DevGroup-ru/yii2-users-module/blob/ff0103dc55c3462627ccc704c33e70c96053f750/src/models/User.php#L213-L218 |
22,330 | DevGroup-ru/yii2-users-module | src/models/User.php | User.register | public function register()
{
if ($this->getIsNewRecord() == false) {
throw new \RuntimeException('Calling "' . __CLASS__ . '::' . __METHOD__ . '" on existing user');
}
$module = UsersModule::module();
if (empty($this->password) === true) {
$this->password = ... | php | public function register()
{
if ($this->getIsNewRecord() == false) {
throw new \RuntimeException('Calling "' . __CLASS__ . '::' . __METHOD__ . '" on existing user');
}
$module = UsersModule::module();
if (empty($this->password) === true) {
$this->password = ... | [
"public",
"function",
"register",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getIsNewRecord",
"(",
")",
"==",
"false",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Calling \"'",
".",
"__CLASS__",
".",
"'::'",
".",
"__METHOD__",
".",
"'\"... | This method is used to register new user account.
@return bool|User | [
"This",
"method",
"is",
"used",
"to",
"register",
"new",
"user",
"account",
"."
] | ff0103dc55c3462627ccc704c33e70c96053f750 | https://github.com/DevGroup-ru/yii2-users-module/blob/ff0103dc55c3462627ccc704c33e70c96053f750/src/models/User.php#L285-L314 |
22,331 | DevGroup-ru/yii2-users-module | src/models/User.php | User.login | public function login($loginDuration = 0)
{
$loginStatus = Yii::$app->getUser()->login($this, $loginDuration);
if ($loginStatus) {
$this->trigger(User::EVENT_LOGIN);
}
return $loginStatus;
} | php | public function login($loginDuration = 0)
{
$loginStatus = Yii::$app->getUser()->login($this, $loginDuration);
if ($loginStatus) {
$this->trigger(User::EVENT_LOGIN);
}
return $loginStatus;
} | [
"public",
"function",
"login",
"(",
"$",
"loginDuration",
"=",
"0",
")",
"{",
"$",
"loginStatus",
"=",
"Yii",
"::",
"$",
"app",
"->",
"getUser",
"(",
")",
"->",
"login",
"(",
"$",
"this",
",",
"$",
"loginDuration",
")",
";",
"if",
"(",
"$",
"loginS... | Login user.
@param integer $loginDuration
@return bool true if success | [
"Login",
"user",
"."
] | ff0103dc55c3462627ccc704c33e70c96053f750 | https://github.com/DevGroup-ru/yii2-users-module/blob/ff0103dc55c3462627ccc704c33e70c96053f750/src/models/User.php#L321-L328 |
22,332 | SporkCode/Spork | src/CSS/UpdateListener.php | UpdateListener.getFileKey | protected function getFileKey($basePath, \SplFileInfo $file)
{
$baseLength = strlen(rtrim($basePath, DIRECTORY_SEPARATOR));
return substr($file->getPath(), $baseLength) . DIRECTORY_SEPARATOR
. $file->getBasename('.' . $file->getExtension());
} | php | protected function getFileKey($basePath, \SplFileInfo $file)
{
$baseLength = strlen(rtrim($basePath, DIRECTORY_SEPARATOR));
return substr($file->getPath(), $baseLength) . DIRECTORY_SEPARATOR
. $file->getBasename('.' . $file->getExtension());
} | [
"protected",
"function",
"getFileKey",
"(",
"$",
"basePath",
",",
"\\",
"SplFileInfo",
"$",
"file",
")",
"{",
"$",
"baseLength",
"=",
"strlen",
"(",
"rtrim",
"(",
"$",
"basePath",
",",
"DIRECTORY_SEPARATOR",
")",
")",
";",
"return",
"substr",
"(",
"$",
"... | Get relative key for a file
@param string $basepath
@param \SplFileInfo $file | [
"Get",
"relative",
"key",
"for",
"a",
"file"
] | 7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a | https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/CSS/UpdateListener.php#L200-L206 |
22,333 | SporkCode/Spork | src/CSS/UpdateListener.php | UpdateListener.isOutOfDate | protected function isOutOfDate($source, $destination, array $includes = null)
{
$includes = (array) $includes;
$extensions = $this->compiler->getExtensions();
if (!file_exists($destination)) {
return true;
}
if (is_file($source) && is_file($desti... | php | protected function isOutOfDate($source, $destination, array $includes = null)
{
$includes = (array) $includes;
$extensions = $this->compiler->getExtensions();
if (!file_exists($destination)) {
return true;
}
if (is_file($source) && is_file($desti... | [
"protected",
"function",
"isOutOfDate",
"(",
"$",
"source",
",",
"$",
"destination",
",",
"array",
"$",
"includes",
"=",
"null",
")",
"{",
"$",
"includes",
"=",
"(",
"array",
")",
"$",
"includes",
";",
"$",
"extensions",
"=",
"$",
"this",
"->",
"compil... | Test is destination file or folder is out of date from the source.
@param string $source
@param string $destination
@return boolean | [
"Test",
"is",
"destination",
"file",
"or",
"folder",
"is",
"out",
"of",
"date",
"from",
"the",
"source",
"."
] | 7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a | https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/CSS/UpdateListener.php#L215-L264 |
22,334 | SporkCode/Spork | src/CSS/UpdateListener.php | UpdateListener.scanDirectory | protected function scanDirectory($path, $extensions)
{
if (is_file($path)) {
$file = new \SplFileInfo($path);
return array($this->getFileKey($file->getPath(), $file) => $file);
}
$files = array();
$extensions = (array) $extensions;
$iterator =... | php | protected function scanDirectory($path, $extensions)
{
if (is_file($path)) {
$file = new \SplFileInfo($path);
return array($this->getFileKey($file->getPath(), $file) => $file);
}
$files = array();
$extensions = (array) $extensions;
$iterator =... | [
"protected",
"function",
"scanDirectory",
"(",
"$",
"path",
",",
"$",
"extensions",
")",
"{",
"if",
"(",
"is_file",
"(",
"$",
"path",
")",
")",
"{",
"$",
"file",
"=",
"new",
"\\",
"SplFileInfo",
"(",
"$",
"path",
")",
";",
"return",
"array",
"(",
"... | Scan a directory and return a list of files with matching extenstions
@param string $path Directory path to scan
@param string|array $extensions Match files with these extensions | [
"Scan",
"a",
"directory",
"and",
"return",
"a",
"list",
"of",
"files",
"with",
"matching",
"extenstions"
] | 7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a | https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/CSS/UpdateListener.php#L272-L293 |
22,335 | FrenzelGmbH/cm-address | controllers/DefaultController.php | DefaultController.actionCreate | public function actionCreate()
{
$model = new Address(['scenario' => 'create']);
Yii::$app->response->format = Response::FORMAT_JSON;
if ($model->load(Yii::$app->request->post())) {
if ($model->validate()) {
if ($model->save(false)) {
r... | php | public function actionCreate()
{
$model = new Address(['scenario' => 'create']);
Yii::$app->response->format = Response::FORMAT_JSON;
if ($model->load(Yii::$app->request->post())) {
if ($model->validate()) {
if ($model->save(false)) {
r... | [
"public",
"function",
"actionCreate",
"(",
")",
"{",
"$",
"model",
"=",
"new",
"Address",
"(",
"[",
"'scenario'",
"=>",
"'create'",
"]",
")",
";",
"Yii",
"::",
"$",
"app",
"->",
"response",
"->",
"format",
"=",
"Response",
"::",
"FORMAT_JSON",
";",
"if... | Create Address. | [
"Create",
"Address",
"."
] | 4295671dc603beed4bea6c5a7f77dac9846127f3 | https://github.com/FrenzelGmbH/cm-address/blob/4295671dc603beed4bea6c5a7f77dac9846127f3/controllers/DefaultController.php#L46-L63 |
22,336 | FrenzelGmbH/cm-address | controllers/DefaultController.php | DefaultController.actionUpdate | public function actionUpdate($id)
{
$model = $this->findModel($id);
$model->setScenario('update');
Yii::$app->response->format = Response::FORMAT_JSON;
if ($model->load(Yii::$app->request->post())) {
if ($model->validate()) {
if ($model->save(false)) {
... | php | public function actionUpdate($id)
{
$model = $this->findModel($id);
$model->setScenario('update');
Yii::$app->response->format = Response::FORMAT_JSON;
if ($model->load(Yii::$app->request->post())) {
if ($model->validate()) {
if ($model->save(false)) {
... | [
"public",
"function",
"actionUpdate",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"findModel",
"(",
"$",
"id",
")",
";",
"$",
"model",
"->",
"setScenario",
"(",
"'update'",
")",
";",
"Yii",
"::",
"$",
"app",
"->",
"response",
"-... | Update Communication.
@param integer $id Communication ID
@return mixed | [
"Update",
"Communication",
"."
] | 4295671dc603beed4bea6c5a7f77dac9846127f3 | https://github.com/FrenzelGmbH/cm-address/blob/4295671dc603beed4bea6c5a7f77dac9846127f3/controllers/DefaultController.php#L71-L89 |
22,337 | FrenzelGmbH/cm-address | controllers/DefaultController.php | DefaultController.actionFetch | public function actionFetch($id)
{
$model = $this->findModel($id);
$model->setScenario('update');
Yii::$app->response->format = Response::FORMAT_HTML;
return $this->renderAjax('@vendor/frenzelgmbh/cm-address/views/widgets/views/_form_update', ['model' => $model]);
} | php | public function actionFetch($id)
{
$model = $this->findModel($id);
$model->setScenario('update');
Yii::$app->response->format = Response::FORMAT_HTML;
return $this->renderAjax('@vendor/frenzelgmbh/cm-address/views/widgets/views/_form_update', ['model' => $model]);
} | [
"public",
"function",
"actionFetch",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"findModel",
"(",
"$",
"id",
")",
";",
"$",
"model",
"->",
"setScenario",
"(",
"'update'",
")",
";",
"Yii",
"::",
"$",
"app",
"->",
"response",
"->... | fetch Communication.
@param integer $id Communication ID
@return mixed | [
"fetch",
"Communication",
"."
] | 4295671dc603beed4bea6c5a7f77dac9846127f3 | https://github.com/FrenzelGmbH/cm-address/blob/4295671dc603beed4bea6c5a7f77dac9846127f3/controllers/DefaultController.php#L97-L103 |
22,338 | globalis-ms/wp-cubi-robo | src/GitTrait.php | GitTrait.hotfixStart | public function hotfixStart($options = ['semversion' => null, 'type' => 'patch'])
{
if (empty($options['semversion'])) {
$version = $this->getVersion()
->increment($options['type']);
} else {
$version = $options['semversion'];
}
return $this->t... | php | public function hotfixStart($options = ['semversion' => null, 'type' => 'patch'])
{
if (empty($options['semversion'])) {
$version = $this->getVersion()
->increment($options['type']);
} else {
$version = $options['semversion'];
}
return $this->t... | [
"public",
"function",
"hotfixStart",
"(",
"$",
"options",
"=",
"[",
"'semversion'",
"=>",
"null",
",",
"'type'",
"=>",
"'patch'",
"]",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"options",
"[",
"'semversion'",
"]",
")",
")",
"{",
"$",
"version",
"=",
"$... | Start a new hotfix
@option string $semversion Version number
@option string $type Hotfix type (path, minor) | [
"Start",
"a",
"new",
"hotfix"
] | 4acc9d37c77e24a968a950d59b5ba53818c53bc1 | https://github.com/globalis-ms/wp-cubi-robo/blob/4acc9d37c77e24a968a950d59b5ba53818c53bc1/src/GitTrait.php#L36-L45 |
22,339 | globalis-ms/wp-cubi-robo | src/GitTrait.php | GitTrait.hotfixFinish | public function hotfixFinish($options = ['semversion' => null, 'type' => 'patch'])
{
if (empty($options['semversion'])) {
$version = $this->getVersion()
->increment($options['type']);
} else {
$version = $options['semversion'];
}
return $this->... | php | public function hotfixFinish($options = ['semversion' => null, 'type' => 'patch'])
{
if (empty($options['semversion'])) {
$version = $this->getVersion()
->increment($options['type']);
} else {
$version = $options['semversion'];
}
return $this->... | [
"public",
"function",
"hotfixFinish",
"(",
"$",
"options",
"=",
"[",
"'semversion'",
"=>",
"null",
",",
"'type'",
"=>",
"'patch'",
"]",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"options",
"[",
"'semversion'",
"]",
")",
")",
"{",
"$",
"version",
"=",
"... | Finish a hotfix
@option string $semversion Version number
@option string $type Hotfix type (path, minor) | [
"Finish",
"a",
"hotfix"
] | 4acc9d37c77e24a968a950d59b5ba53818c53bc1 | https://github.com/globalis-ms/wp-cubi-robo/blob/4acc9d37c77e24a968a950d59b5ba53818c53bc1/src/GitTrait.php#L53-L62 |
22,340 | globalis-ms/wp-cubi-robo | src/GitTrait.php | GitTrait.releaseStart | public function releaseStart($options = ['semversion' => null, 'type' => 'minor'])
{
if (empty($options['semversion'])) {
$version = $this->getVersion()
->increment($options['type']);
} else {
$version = $options['semversion'];
}
return $this->... | php | public function releaseStart($options = ['semversion' => null, 'type' => 'minor'])
{
if (empty($options['semversion'])) {
$version = $this->getVersion()
->increment($options['type']);
} else {
$version = $options['semversion'];
}
return $this->... | [
"public",
"function",
"releaseStart",
"(",
"$",
"options",
"=",
"[",
"'semversion'",
"=>",
"null",
",",
"'type'",
"=>",
"'minor'",
"]",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"options",
"[",
"'semversion'",
"]",
")",
")",
"{",
"$",
"version",
"=",
"... | Start a new release
@option string $semversion Version number
@option string $type Relase type (minor, major) | [
"Start",
"a",
"new",
"release"
] | 4acc9d37c77e24a968a950d59b5ba53818c53bc1 | https://github.com/globalis-ms/wp-cubi-robo/blob/4acc9d37c77e24a968a950d59b5ba53818c53bc1/src/GitTrait.php#L70-L79 |
22,341 | globalis-ms/wp-cubi-robo | src/GitTrait.php | GitTrait.releaseFinish | public function releaseFinish($options = ['semversion' => null, 'type' => 'minor'])
{
if (empty($options['semversion'])) {
$version = $this->getVersion()
->increment($options['type']);
} else {
$version = $options['semversion'];
}
return $this-... | php | public function releaseFinish($options = ['semversion' => null, 'type' => 'minor'])
{
if (empty($options['semversion'])) {
$version = $this->getVersion()
->increment($options['type']);
} else {
$version = $options['semversion'];
}
return $this-... | [
"public",
"function",
"releaseFinish",
"(",
"$",
"options",
"=",
"[",
"'semversion'",
"=>",
"null",
",",
"'type'",
"=>",
"'minor'",
"]",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"options",
"[",
"'semversion'",
"]",
")",
")",
"{",
"$",
"version",
"=",
... | Finish a release
@option string $semversion Version number
@option string $type Relase type (minor, major) | [
"Finish",
"a",
"release"
] | 4acc9d37c77e24a968a950d59b5ba53818c53bc1 | https://github.com/globalis-ms/wp-cubi-robo/blob/4acc9d37c77e24a968a950d59b5ba53818c53bc1/src/GitTrait.php#L87-L96 |
22,342 | globalis-ms/wp-cubi-robo | src/GitTrait.php | GitTrait.getVersion | protected function getVersion()
{
// Get version from tag
$cmd = new Command('git');
$cmd = $cmd->arg('tag')
->execute();
$output = explode(PHP_EOL, trim($cmd->getOutput()));
$currentVersion = '0.0.0';
foreach ($output as $tag) {
if (preg_match... | php | protected function getVersion()
{
// Get version from tag
$cmd = new Command('git');
$cmd = $cmd->arg('tag')
->execute();
$output = explode(PHP_EOL, trim($cmd->getOutput()));
$currentVersion = '0.0.0';
foreach ($output as $tag) {
if (preg_match... | [
"protected",
"function",
"getVersion",
"(",
")",
"{",
"// Get version from tag",
"$",
"cmd",
"=",
"new",
"Command",
"(",
"'git'",
")",
";",
"$",
"cmd",
"=",
"$",
"cmd",
"->",
"arg",
"(",
"'tag'",
")",
"->",
"execute",
"(",
")",
";",
"$",
"output",
"=... | Return current version
@return SemanticVersion | [
"Return",
"current",
"version"
] | 4acc9d37c77e24a968a950d59b5ba53818c53bc1 | https://github.com/globalis-ms/wp-cubi-robo/blob/4acc9d37c77e24a968a950d59b5ba53818c53bc1/src/GitTrait.php#L183-L199 |
22,343 | xiewulong/yii2-fileupload | oss/libs/guzzle/http/Guzzle/Http/Curl/CurlMultiProxy.php | CurlMultiProxy.getAvailableHandle | protected function getAvailableHandle()
{
// Grab a handle that is not claimed
foreach ($this->handles as $h) {
if (!in_array($h, $this->groups, true)) {
return $h;
}
}
// All are claimed, so create one
$handle = new CurlMulti();
... | php | protected function getAvailableHandle()
{
// Grab a handle that is not claimed
foreach ($this->handles as $h) {
if (!in_array($h, $this->groups, true)) {
return $h;
}
}
// All are claimed, so create one
$handle = new CurlMulti();
... | [
"protected",
"function",
"getAvailableHandle",
"(",
")",
"{",
"// Grab a handle that is not claimed",
"foreach",
"(",
"$",
"this",
"->",
"handles",
"as",
"$",
"h",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"h",
",",
"$",
"this",
"->",
"groups",
",",
... | Get an existing available CurlMulti handle or create a new one
@return CurlMulti | [
"Get",
"an",
"existing",
"available",
"CurlMulti",
"handle",
"or",
"create",
"a",
"new",
"one"
] | 3e75b17a4a18dd8466e3f57c63136de03470ca82 | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/guzzle/http/Guzzle/Http/Curl/CurlMultiProxy.php#L115-L130 |
22,344 | HedronDev/hedron | src/Bootstrap.php | Bootstrap.getConfiguration | public static function getConfiguration(string $input) {
list($oldrev, $newrev, $refname) = explode(' ', $input);
list(,, $branch) = explode('/', $refname);
return new ParserVariableConfiguration($oldrev, $newrev, $refname, $branch);
} | php | public static function getConfiguration(string $input) {
list($oldrev, $newrev, $refname) = explode(' ', $input);
list(,, $branch) = explode('/', $refname);
return new ParserVariableConfiguration($oldrev, $newrev, $refname, $branch);
} | [
"public",
"static",
"function",
"getConfiguration",
"(",
"string",
"$",
"input",
")",
"{",
"list",
"(",
"$",
"oldrev",
",",
"$",
"newrev",
",",
"$",
"refname",
")",
"=",
"explode",
"(",
"' '",
",",
"$",
"input",
")",
";",
"list",
"(",
",",
",",
"$"... | Extracts data from the post-receive hook as configuration for easy use.
@param string $input
Input to the post-receive git hook
@return \Hedron\Configuration\ParserVariableConfiguration
A simple configuration object. | [
"Extracts",
"data",
"from",
"the",
"post",
"-",
"receive",
"hook",
"as",
"configuration",
"for",
"easy",
"use",
"."
] | 3b4adec4912f2d7c0b7e7262dc36515fbc2e8e00 | https://github.com/HedronDev/hedron/blob/3b4adec4912f2d7c0b7e7262dc36515fbc2e8e00/src/Bootstrap.php#L48-L52 |
22,345 | HedronDev/hedron | src/Bootstrap.php | Bootstrap.getEnvironmentVariables | public static function getEnvironmentVariables() {
$dir = shell_exec('pwd');
$dir_parts = explode(DIRECTORY_SEPARATOR, $dir);
$project = trim(array_pop($dir_parts));
$client = trim(array_pop($dir_parts));
$dir = $dir . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '... | php | public static function getEnvironmentVariables() {
$dir = shell_exec('pwd');
$dir_parts = explode(DIRECTORY_SEPARATOR, $dir);
$project = trim(array_pop($dir_parts));
$client = trim(array_pop($dir_parts));
$dir = $dir . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '... | [
"public",
"static",
"function",
"getEnvironmentVariables",
"(",
")",
"{",
"$",
"dir",
"=",
"shell_exec",
"(",
"'pwd'",
")",
";",
"$",
"dir_parts",
"=",
"explode",
"(",
"DIRECTORY_SEPARATOR",
",",
"$",
"dir",
")",
";",
"$",
"project",
"=",
"trim",
"(",
"a... | Bootstraps the environment variables.
@return \Hedron\Configuration\EnvironmentVariables
The environment variables from yaml.
@throws \Hedron\Exception\MissingEnvironmentConfigurationException
If the yaml file is missing, throws this exception. | [
"Bootstraps",
"the",
"environment",
"variables",
"."
] | 3b4adec4912f2d7c0b7e7262dc36515fbc2e8e00 | https://github.com/HedronDev/hedron/blob/3b4adec4912f2d7c0b7e7262dc36515fbc2e8e00/src/Bootstrap.php#L63-L74 |
22,346 | HedronDev/hedron | src/Bootstrap.php | Bootstrap.collectServices | public static function collectServices(ContainerBuilder $container, \Traversable $namespaces) {
$service_directories = [];
foreach ($namespaces as $directory) {
// $directory will correspond to the src dir, so up one level.
$service_directories[] = $directory . DIRECTORY_SEPARATOR . '..';
}
... | php | public static function collectServices(ContainerBuilder $container, \Traversable $namespaces) {
$service_directories = [];
foreach ($namespaces as $directory) {
// $directory will correspond to the src dir, so up one level.
$service_directories[] = $directory . DIRECTORY_SEPARATOR . '..';
}
... | [
"public",
"static",
"function",
"collectServices",
"(",
"ContainerBuilder",
"$",
"container",
",",
"\\",
"Traversable",
"$",
"namespaces",
")",
"{",
"$",
"service_directories",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"namespaces",
"as",
"$",
"directory",
")",... | Iterate through all namespace dirs and add services to the container.
@param \Symfony\Component\DependencyInjection\ContainerBuilder $container
The container builder.
@param \Traversable $namespaces
The namespaces. | [
"Iterate",
"through",
"all",
"namespace",
"dirs",
"and",
"add",
"services",
"to",
"the",
"container",
"."
] | 3b4adec4912f2d7c0b7e7262dc36515fbc2e8e00 | https://github.com/HedronDev/hedron/blob/3b4adec4912f2d7c0b7e7262dc36515fbc2e8e00/src/Bootstrap.php#L84-L92 |
22,347 | HedronDev/hedron | src/Bootstrap.php | Bootstrap.getValidParsers | public static function getValidParsers(ProjectTypeInterface $project, ParserDictionary $parserDictionary, EventDispatcherInterface $dispatcher) {
$parserSet = $project::getFileParsers($parserDictionary);
$event = new ParserSetEvent($project, $parserSet);
$dispatcher->dispatch(ProjectTypeInterface::COLLECT_P... | php | public static function getValidParsers(ProjectTypeInterface $project, ParserDictionary $parserDictionary, EventDispatcherInterface $dispatcher) {
$parserSet = $project::getFileParsers($parserDictionary);
$event = new ParserSetEvent($project, $parserSet);
$dispatcher->dispatch(ProjectTypeInterface::COLLECT_P... | [
"public",
"static",
"function",
"getValidParsers",
"(",
"ProjectTypeInterface",
"$",
"project",
",",
"ParserDictionary",
"$",
"parserDictionary",
",",
"EventDispatcherInterface",
"$",
"dispatcher",
")",
"{",
"$",
"parserSet",
"=",
"$",
"project",
"::",
"getFileParsers... | Gets an array of valid parser plugins for the project type.
@param \Hedron\ProjectTypeInterface $project
The project plugin for the current environment settings.
@param \Hedron\ParserDictionary $parserDictionary
The parser dictionary.
@param \Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher
The e... | [
"Gets",
"an",
"array",
"of",
"valid",
"parser",
"plugins",
"for",
"the",
"project",
"type",
"."
] | 3b4adec4912f2d7c0b7e7262dc36515fbc2e8e00 | https://github.com/HedronDev/hedron/blob/3b4adec4912f2d7c0b7e7262dc36515fbc2e8e00/src/Bootstrap.php#L120-L129 |
22,348 | nathan-fiscaletti/extended-arrays | src/ExtendedArrays/Traits/Restricted.php | Restricted.offsetSet | public function offsetSet($offset, $value)
{
if (is_null($offset)) {
throw new \Exception('Must supply key to modify an associative array.');
} else {
if ($this->_isFillable($offset)) {
$this->_args[$offset] = $value;
} else {
throw... | php | public function offsetSet($offset, $value)
{
if (is_null($offset)) {
throw new \Exception('Must supply key to modify an associative array.');
} else {
if ($this->_isFillable($offset)) {
$this->_args[$offset] = $value;
} else {
throw... | [
"public",
"function",
"offsetSet",
"(",
"$",
"offset",
",",
"$",
"value",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"offset",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Must supply key to modify an associative array.'",
")",
";",
"}",
"else",
... | Override the offsetSet function to enforce
the list of restricted keys.
@param mixed $offset
@param mixed $value
@throws \Exception | [
"Override",
"the",
"offsetSet",
"function",
"to",
"enforce",
"the",
"list",
"of",
"restricted",
"keys",
"."
] | a641856115131f76417521d3e4aa2d951158050a | https://github.com/nathan-fiscaletti/extended-arrays/blob/a641856115131f76417521d3e4aa2d951158050a/src/ExtendedArrays/Traits/Restricted.php#L51-L62 |
22,349 | LordDashMe/wordpress-db-schema-extender | src/SchemaExtender.php | SchemaExtender.setSeedQuery | public function setSeedQuery($key, $value)
{
$index = $this->getSeedQueryIndex();
$this->seedQueries[$index][$key] = $value;
} | php | public function setSeedQuery($key, $value)
{
$index = $this->getSeedQueryIndex();
$this->seedQueries[$index][$key] = $value;
} | [
"public",
"function",
"setSeedQuery",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"index",
"=",
"$",
"this",
"->",
"getSeedQueryIndex",
"(",
")",
";",
"$",
"this",
"->",
"seedQueries",
"[",
"$",
"index",
"]",
"[",
"$",
"key",
"]",
"=",
"$",
... | The stter for the seed queries class property.
@param string $key
@param mixed $value
@return void | [
"The",
"stter",
"for",
"the",
"seed",
"queries",
"class",
"property",
"."
] | 1798435ec064256174b034a16d9683081c0c299f | https://github.com/LordDashMe/wordpress-db-schema-extender/blob/1798435ec064256174b034a16d9683081c0c299f/src/SchemaExtender.php#L219-L224 |
22,350 | LordDashMe/wordpress-db-schema-extender | src/SchemaExtender.php | SchemaExtender.getWordpressDatabaseInstance | protected function getWordpressDatabaseInstance()
{
global $wpdb;
if ((! \class_exists('wpdb')) || (! $wpdb) || (! $wpdb instanceof \wpdb)) {
throw InvalidDatabaseInstanceException::wordpressDatabaseIsNotSet();
}
$this->db = $wpdb;
} | php | protected function getWordpressDatabaseInstance()
{
global $wpdb;
if ((! \class_exists('wpdb')) || (! $wpdb) || (! $wpdb instanceof \wpdb)) {
throw InvalidDatabaseInstanceException::wordpressDatabaseIsNotSet();
}
$this->db = $wpdb;
} | [
"protected",
"function",
"getWordpressDatabaseInstance",
"(",
")",
"{",
"global",
"$",
"wpdb",
";",
"if",
"(",
"(",
"!",
"\\",
"class_exists",
"(",
"'wpdb'",
")",
")",
"||",
"(",
"!",
"$",
"wpdb",
")",
"||",
"(",
"!",
"$",
"wpdb",
"instanceof",
"\\",
... | Tightly coupled to the wordpress database instance.
@throws LordDashMe\Wordpress\DB\Exception\InvalidDatabaseInstance
@return void | [
"Tightly",
"coupled",
"to",
"the",
"wordpress",
"database",
"instance",
"."
] | 1798435ec064256174b034a16d9683081c0c299f | https://github.com/LordDashMe/wordpress-db-schema-extender/blob/1798435ec064256174b034a16d9683081c0c299f/src/SchemaExtender.php#L302-L311 |
22,351 | LordDashMe/wordpress-db-schema-extender | src/SchemaExtender.php | SchemaExtender.table | public function table($name, $callback = null)
{
if (! $callback instanceof \Closure) {
throw InvalidArgumentPassedException::isNotClosure();
}
$this->setTableName($name);
$callback($this);
$tableNamePrefixed = $this->getTableNamePrefix($this->getTab... | php | public function table($name, $callback = null)
{
if (! $callback instanceof \Closure) {
throw InvalidArgumentPassedException::isNotClosure();
}
$this->setTableName($name);
$callback($this);
$tableNamePrefixed = $this->getTableNamePrefix($this->getTab... | [
"public",
"function",
"table",
"(",
"$",
"name",
",",
"$",
"callback",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"callback",
"instanceof",
"\\",
"Closure",
")",
"{",
"throw",
"InvalidArgumentPassedException",
"::",
"isNotClosure",
"(",
")",
";",
"}",
"... | The composer of the database table schema.
@param string $name
@param \Closure $callback
@throws LordDashMe\Wordpress\DB\Exception\InvalidArgumentPassed
@return void | [
"The",
"composer",
"of",
"the",
"database",
"table",
"schema",
"."
] | 1798435ec064256174b034a16d9683081c0c299f | https://github.com/LordDashMe/wordpress-db-schema-extender/blob/1798435ec064256174b034a16d9683081c0c299f/src/SchemaExtender.php#L323-L341 |
22,352 | LordDashMe/wordpress-db-schema-extender | src/SchemaExtender.php | SchemaExtender.buildCreateTableQuery | protected function buildCreateTableQuery($name, $struture, $charsetCollate)
{
$total = $this->totalQueries();
$this->queries[$total] = "CREATE TABLE `{$name}` ({$struture}) {$charsetCollate};";
} | php | protected function buildCreateTableQuery($name, $struture, $charsetCollate)
{
$total = $this->totalQueries();
$this->queries[$total] = "CREATE TABLE `{$name}` ({$struture}) {$charsetCollate};";
} | [
"protected",
"function",
"buildCreateTableQuery",
"(",
"$",
"name",
",",
"$",
"struture",
",",
"$",
"charsetCollate",
")",
"{",
"$",
"total",
"=",
"$",
"this",
"->",
"totalQueries",
"(",
")",
";",
"$",
"this",
"->",
"queries",
"[",
"$",
"total",
"]",
"... | Build a create table query base on the complete details given.
@param string $name The table name with prefix.
@param string $structure The structure of the tables containing columns, etc.
@param string $charsetCollate The character set for the table structure.
@return void | [
"Build",
"a",
"create",
"table",
"query",
"base",
"on",
"the",
"complete",
"details",
"given",
"."
] | 1798435ec064256174b034a16d9683081c0c299f | https://github.com/LordDashMe/wordpress-db-schema-extender/blob/1798435ec064256174b034a16d9683081c0c299f/src/SchemaExtender.php#L382-L387 |
22,353 | LordDashMe/wordpress-db-schema-extender | src/SchemaExtender.php | SchemaExtender.tableSeed | public function tableSeed($tableName, $callback)
{
if (! is_array($callback) && ! ($callback instanceof \Closure)) {
throw InvalidArgumentPassedException::isNotArrayOrClosure();
}
$this->setTableName($tableName);
// Make sure to flush the old seed query index
... | php | public function tableSeed($tableName, $callback)
{
if (! is_array($callback) && ! ($callback instanceof \Closure)) {
throw InvalidArgumentPassedException::isNotArrayOrClosure();
}
$this->setTableName($tableName);
// Make sure to flush the old seed query index
... | [
"public",
"function",
"tableSeed",
"(",
"$",
"tableName",
",",
"$",
"callback",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"callback",
")",
"&&",
"!",
"(",
"$",
"callback",
"instanceof",
"\\",
"Closure",
")",
")",
"{",
"throw",
"InvalidArgumentPasse... | The composer for seeding the given table name.
@param string $tableName
@param array|\Closure $callback
@throws LordDashMe\Wordpress\DB\Exception\InvalidArgumentPassed
@return $this | [
"The",
"composer",
"for",
"seeding",
"the",
"given",
"table",
"name",
"."
] | 1798435ec064256174b034a16d9683081c0c299f | https://github.com/LordDashMe/wordpress-db-schema-extender/blob/1798435ec064256174b034a16d9683081c0c299f/src/SchemaExtender.php#L399-L426 |
22,354 | LordDashMe/wordpress-db-schema-extender | src/SchemaExtender.php | SchemaExtender.iterate | public function iterate($counter)
{
if (! \is_numeric($counter)) {
throw InvalidArgumentPassedException::isNotNumeric();
}
$this->setSeedQuery('iterate', \round($counter));
} | php | public function iterate($counter)
{
if (! \is_numeric($counter)) {
throw InvalidArgumentPassedException::isNotNumeric();
}
$this->setSeedQuery('iterate', \round($counter));
} | [
"public",
"function",
"iterate",
"(",
"$",
"counter",
")",
"{",
"if",
"(",
"!",
"\\",
"is_numeric",
"(",
"$",
"counter",
")",
")",
"{",
"throw",
"InvalidArgumentPassedException",
"::",
"isNotNumeric",
"(",
")",
";",
"}",
"$",
"this",
"->",
"setSeedQuery",
... | The repetition that will apply for the given record.
@param int $counter Total number of repetition for the given record.
@throws LordDashMe\Wordpress\DB\Exception\InvalidArgumentPassed
@return void | [
"The",
"repetition",
"that",
"will",
"apply",
"for",
"the",
"given",
"record",
"."
] | 1798435ec064256174b034a16d9683081c0c299f | https://github.com/LordDashMe/wordpress-db-schema-extender/blob/1798435ec064256174b034a16d9683081c0c299f/src/SchemaExtender.php#L437-L444 |
22,355 | LordDashMe/wordpress-db-schema-extender | src/SchemaExtender.php | SchemaExtender.rawQuery | public function rawQuery($query = '')
{
if (! \is_string($query)) {
throw InvalidArgumentPassedException::isNotString();
}
$total = $this->totalQueries();
$this->queries[$total] = \trim($query);
} | php | public function rawQuery($query = '')
{
if (! \is_string($query)) {
throw InvalidArgumentPassedException::isNotString();
}
$total = $this->totalQueries();
$this->queries[$total] = \trim($query);
} | [
"public",
"function",
"rawQuery",
"(",
"$",
"query",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"\\",
"is_string",
"(",
"$",
"query",
")",
")",
"{",
"throw",
"InvalidArgumentPassedException",
"::",
"isNotString",
"(",
")",
";",
"}",
"$",
"total",
"=",
"$",
... | Allow to compose raw database query.
@param string $query
@throws LordDashMe\Wordpress\DB\Exception\InvalidArgumentPassed
@return void | [
"Allow",
"to",
"compose",
"raw",
"database",
"query",
"."
] | 1798435ec064256174b034a16d9683081c0c299f | https://github.com/LordDashMe/wordpress-db-schema-extender/blob/1798435ec064256174b034a16d9683081c0c299f/src/SchemaExtender.php#L455-L464 |
22,356 | LordDashMe/wordpress-db-schema-extender | src/SchemaExtender.php | SchemaExtender.processQueries | protected function processQueries()
{
if (! \function_exists('dbDelta')) {
throw WPDatabaseUpdateFunctionsNotFoundException::dbDeltaIsNotExist();
}
$queries = '';
foreach ($this->getQueries() as $index => $query) {
$queries .= \trim($query);
}
... | php | protected function processQueries()
{
if (! \function_exists('dbDelta')) {
throw WPDatabaseUpdateFunctionsNotFoundException::dbDeltaIsNotExist();
}
$queries = '';
foreach ($this->getQueries() as $index => $query) {
$queries .= \trim($query);
}
... | [
"protected",
"function",
"processQueries",
"(",
")",
"{",
"if",
"(",
"!",
"\\",
"function_exists",
"(",
"'dbDelta'",
")",
")",
"{",
"throw",
"WPDatabaseUpdateFunctionsNotFoundException",
"::",
"dbDeltaIsNotExist",
"(",
")",
";",
"}",
"$",
"queries",
"=",
"''",
... | Process the queries using the wordpress "dbDelta".
This function is tightly coupled to the wordpress "dbDelta".
@return void | [
"Process",
"the",
"queries",
"using",
"the",
"wordpress",
"dbDelta",
".",
"This",
"function",
"is",
"tightly",
"coupled",
"to",
"the",
"wordpress",
"dbDelta",
"."
] | 1798435ec064256174b034a16d9683081c0c299f | https://github.com/LordDashMe/wordpress-db-schema-extender/blob/1798435ec064256174b034a16d9683081c0c299f/src/SchemaExtender.php#L485-L498 |
22,357 | LordDashMe/wordpress-db-schema-extender | src/SchemaExtender.php | SchemaExtender.processTableSeeds | protected function processTableSeeds()
{
foreach ($this->getSeedQueries() as $index => $query) {
if (isset($query['iterate'])) {
for ($x = 1; $x <= $query['iterate']; $x++) {
$this->db->insert($query['table'], $query['record']);
}
... | php | protected function processTableSeeds()
{
foreach ($this->getSeedQueries() as $index => $query) {
if (isset($query['iterate'])) {
for ($x = 1; $x <= $query['iterate']; $x++) {
$this->db->insert($query['table'], $query['record']);
}
... | [
"protected",
"function",
"processTableSeeds",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getSeedQueries",
"(",
")",
"as",
"$",
"index",
"=>",
"$",
"query",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"query",
"[",
"'iterate'",
"]",
")",
")",
"{",... | Process the seed queries using the wordpress database "insert".
@return void | [
"Process",
"the",
"seed",
"queries",
"using",
"the",
"wordpress",
"database",
"insert",
"."
] | 1798435ec064256174b034a16d9683081c0c299f | https://github.com/LordDashMe/wordpress-db-schema-extender/blob/1798435ec064256174b034a16d9683081c0c299f/src/SchemaExtender.php#L505-L518 |
22,358 | LordDashMe/wordpress-db-schema-extender | src/SchemaExtender.php | SchemaExtender.dropTable | public function dropTable($tableName)
{
$this->db->query('SET FOREIGN_KEY_CHECKS = 0;');
$this->db->query("DROP TABLE IF EXISTS `{$this->getTableNamePrefix($tableName)}`;");
$this->db->query('SET FOREIGN_KEY_CHECKS = 1;');
} | php | public function dropTable($tableName)
{
$this->db->query('SET FOREIGN_KEY_CHECKS = 0;');
$this->db->query("DROP TABLE IF EXISTS `{$this->getTableNamePrefix($tableName)}`;");
$this->db->query('SET FOREIGN_KEY_CHECKS = 1;');
} | [
"public",
"function",
"dropTable",
"(",
"$",
"tableName",
")",
"{",
"$",
"this",
"->",
"db",
"->",
"query",
"(",
"'SET FOREIGN_KEY_CHECKS = 0;'",
")",
";",
"$",
"this",
"->",
"db",
"->",
"query",
"(",
"\"DROP TABLE IF EXISTS `{$this->getTableNamePrefix($tableName)}`... | Process the drop table base on the given table name.
Foreign key checks disable before processing the drop action and
enable it back again after the process.
@param string $tableName
@return void | [
"Process",
"the",
"drop",
"table",
"base",
"on",
"the",
"given",
"table",
"name",
".",
"Foreign",
"key",
"checks",
"disable",
"before",
"processing",
"the",
"drop",
"action",
"and",
"enable",
"it",
"back",
"again",
"after",
"the",
"process",
"."
] | 1798435ec064256174b034a16d9683081c0c299f | https://github.com/LordDashMe/wordpress-db-schema-extender/blob/1798435ec064256174b034a16d9683081c0c299f/src/SchemaExtender.php#L529-L534 |
22,359 | inhere/php-librarys | src/Helpers/JsonHelper.php | JsonHelper.encode | public static function encode($data): string
{
if (PHP_VERSION_ID >= 50400) {
return json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
}
return json_encode($data);
} | php | public static function encode($data): string
{
if (PHP_VERSION_ID >= 50400) {
return json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
}
return json_encode($data);
} | [
"public",
"static",
"function",
"encode",
"(",
"$",
"data",
")",
":",
"string",
"{",
"if",
"(",
"PHP_VERSION_ID",
">=",
"50400",
")",
"{",
"return",
"json_encode",
"(",
"$",
"data",
",",
"JSON_UNESCAPED_SLASHES",
"|",
"JSON_UNESCAPED_UNICODE",
")",
";",
"}",... | encode data to json
@param $data
@return string | [
"encode",
"data",
"to",
"json"
] | e6ca598685469794f310e3ab0e2bc19519cd0ae6 | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Helpers/JsonHelper.php#L24-L31 |
22,360 | dragonmantank/fillet | src/Fillet/Fillet.php | Fillet.parse | public function parse()
{
foreach($this->parser->parse($this->inputFile) as $item) {
$writer = WriterFactory::create($item['type'], $this->config);
if($writer) {
$writer->write($item);
}
}
} | php | public function parse()
{
foreach($this->parser->parse($this->inputFile) as $item) {
$writer = WriterFactory::create($item['type'], $this->config);
if($writer) {
$writer->write($item);
}
}
} | [
"public",
"function",
"parse",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"parser",
"->",
"parse",
"(",
"$",
"this",
"->",
"inputFile",
")",
"as",
"$",
"item",
")",
"{",
"$",
"writer",
"=",
"WriterFactory",
"::",
"create",
"(",
"$",
"item",
... | Calls the parser and generates the files
@throws \Exception | [
"Calls",
"the",
"parser",
"and",
"generates",
"the",
"files"
] | b197947608c05ac2318e8f6b296345494004d9c6 | https://github.com/dragonmantank/fillet/blob/b197947608c05ac2318e8f6b296345494004d9c6/src/Fillet/Fillet.php#L53-L62 |
22,361 | dave-redfern/laravel-doctrine-entity-audit | src/ServiceProvider.php | ServiceProvider.registerEntityAuditConfigurations | protected function registerEntityAuditConfigurations(Repository $config)
{
$this->app->afterResolving(IlluminateRegistry::class, function ($registry) use ($config) {
$table = $config->get('entity_audit.global.table');
$users = $config->get('entity_audit.global.usernam... | php | protected function registerEntityAuditConfigurations(Repository $config)
{
$this->app->afterResolving(IlluminateRegistry::class, function ($registry) use ($config) {
$table = $config->get('entity_audit.global.table');
$users = $config->get('entity_audit.global.usernam... | [
"protected",
"function",
"registerEntityAuditConfigurations",
"(",
"Repository",
"$",
"config",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"afterResolving",
"(",
"IlluminateRegistry",
"::",
"class",
",",
"function",
"(",
"$",
"registry",
")",
"use",
"(",
"$",
"... | Registers auditing to the specified entity managers
@param Repository $config
@return void | [
"Registers",
"auditing",
"to",
"the",
"specified",
"entity",
"managers"
] | ab79e305fe512ceefbc14d585fefe0a40cf911ab | https://github.com/dave-redfern/laravel-doctrine-entity-audit/blob/ab79e305fe512ceefbc14d585fefe0a40cf911ab/src/ServiceProvider.php#L99-L134 |
22,362 | digipolisgent/robo-digipolis-general | src/ReadProperties.php | ReadProperties.parseConfigFiles | protected function parseConfigFiles(Finder $files)
{
$config = [];
foreach ($files as $file) {
// Check if this is part of a Robo package.
$path = $file->getRealPath();
if (!file_exists(dirname($path) . '/RoboFile.php')) {
continue;
}
... | php | protected function parseConfigFiles(Finder $files)
{
$config = [];
foreach ($files as $file) {
// Check if this is part of a Robo package.
$path = $file->getRealPath();
if (!file_exists(dirname($path) . '/RoboFile.php')) {
continue;
}
... | [
"protected",
"function",
"parseConfigFiles",
"(",
"Finder",
"$",
"files",
")",
"{",
"$",
"config",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"files",
"as",
"$",
"file",
")",
"{",
"// Check if this is part of a Robo package.",
"$",
"path",
"=",
"$",
"file",
... | Helper function to parse config files.
@param \Symfony\Component\Finder\Finder $files
The files to parse.
@return array
The parsed config. | [
"Helper",
"function",
"to",
"parse",
"config",
"files",
"."
] | 66f0806c9ed7bd4e5aaf3f57ae1363f6aaae7cd9 | https://github.com/digipolisgent/robo-digipolis-general/blob/66f0806c9ed7bd4e5aaf3f57ae1363f6aaae7cd9/src/ReadProperties.php#L155-L170 |
22,363 | wenbinye/PhalconX | src/Serializer/Serializer.php | Serializer.normalize | public function normalize($obj)
{
$properties = $this->getClassProperties(get_class($obj));
$data = [];
foreach ($properties as $name => $prop) {
if (isset($prop['getter'])) {
$getter = $prop['getter'];
$value = $obj->$getter();
} else ... | php | public function normalize($obj)
{
$properties = $this->getClassProperties(get_class($obj));
$data = [];
foreach ($properties as $name => $prop) {
if (isset($prop['getter'])) {
$getter = $prop['getter'];
$value = $obj->$getter();
} else ... | [
"public",
"function",
"normalize",
"(",
"$",
"obj",
")",
"{",
"$",
"properties",
"=",
"$",
"this",
"->",
"getClassProperties",
"(",
"get_class",
"(",
"$",
"obj",
")",
")",
";",
"$",
"data",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"properties",
"as",... | Normalizes the object into an array of scalars|arrays. | [
"Normalizes",
"the",
"object",
"into",
"an",
"array",
"of",
"scalars|arrays",
"."
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Serializer/Serializer.php#L88-L115 |
22,364 | wenbinye/PhalconX | src/Serializer/Serializer.php | Serializer.getClassProperties | private function getClassProperties($class)
{
$properties = $this->getCache()->get('_PHX.serialze_properties.'. $class);
if (!isset($properties)) {
$classResolver = $this->getClassResolver();
$properties = $this->getReflectionProperties($class);
foreach ($this->ge... | php | private function getClassProperties($class)
{
$properties = $this->getCache()->get('_PHX.serialze_properties.'. $class);
if (!isset($properties)) {
$classResolver = $this->getClassResolver();
$properties = $this->getReflectionProperties($class);
foreach ($this->ge... | [
"private",
"function",
"getClassProperties",
"(",
"$",
"class",
")",
"{",
"$",
"properties",
"=",
"$",
"this",
"->",
"getCache",
"(",
")",
"->",
"get",
"(",
"'_PHX.serialze_properties.'",
".",
"$",
"class",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
... | gets class properties metadata | [
"gets",
"class",
"properties",
"metadata"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Serializer/Serializer.php#L120-L143 |
22,365 | odiaseo/pagebuilder | src/PageBuilder/Entity/Site.php | Site.getSiteFilterQuery | public function getSiteFilterQuery($targetTableAlias)
{
$parent = $this->getParent();
if ($parent and $parentId = $parent->getId()) {
return $targetTableAlias . '.site_id = ' . $parentId;
} elseif ($id = $this->getId()) {
return $targetTableAlias . '.site_id = '... | php | public function getSiteFilterQuery($targetTableAlias)
{
$parent = $this->getParent();
if ($parent and $parentId = $parent->getId()) {
return $targetTableAlias . '.site_id = ' . $parentId;
} elseif ($id = $this->getId()) {
return $targetTableAlias . '.site_id = '... | [
"public",
"function",
"getSiteFilterQuery",
"(",
"$",
"targetTableAlias",
")",
"{",
"$",
"parent",
"=",
"$",
"this",
"->",
"getParent",
"(",
")",
";",
"if",
"(",
"$",
"parent",
"and",
"$",
"parentId",
"=",
"$",
"parent",
"->",
"getId",
"(",
")",
")",
... | Get filter query
@param $targetTableAlias
@return string | [
"Get",
"filter",
"query"
] | 88ef7cccf305368561307efe4ca07fac8e5774f3 | https://github.com/odiaseo/pagebuilder/blob/88ef7cccf305368561307efe4ca07fac8e5774f3/src/PageBuilder/Entity/Site.php#L384-L394 |
22,366 | odiaseo/pagebuilder | src/PageBuilder/Entity/Site.php | Site.sumOfferCount | public function sumOfferCount()
{
$count = $this->getOfferCount();
if ($this->getParent()) {
$count += $this->getParent()->getOfferCount();
}
if ($this->getLinkedSites()->count()) {
/** @var Site $linked */
foreach ($this->getLinkedSites(... | php | public function sumOfferCount()
{
$count = $this->getOfferCount();
if ($this->getParent()) {
$count += $this->getParent()->getOfferCount();
}
if ($this->getLinkedSites()->count()) {
/** @var Site $linked */
foreach ($this->getLinkedSites(... | [
"public",
"function",
"sumOfferCount",
"(",
")",
"{",
"$",
"count",
"=",
"$",
"this",
"->",
"getOfferCount",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getParent",
"(",
")",
")",
"{",
"$",
"count",
"+=",
"$",
"this",
"->",
"getParent",
"(",
")",... | Get sum of all offers
@return mixed | [
"Get",
"sum",
"of",
"all",
"offers"
] | 88ef7cccf305368561307efe4ca07fac8e5774f3 | https://github.com/odiaseo/pagebuilder/blob/88ef7cccf305368561307efe4ca07fac8e5774f3/src/PageBuilder/Entity/Site.php#L451-L472 |
22,367 | zicht/z | src/Zicht/Tool/Script/Node/Script/ForIn.php | ForIn.afterScript | public function afterScript(Buffer $buffer)
{
$buffer->write(sprintf('$z->pop(\'%s\');', $this->key));
$buffer->write(sprintf('$z->pop(\'%s\');', $this->value));
$buffer->indent(-1);
$buffer->writeln('}');
} | php | public function afterScript(Buffer $buffer)
{
$buffer->write(sprintf('$z->pop(\'%s\');', $this->key));
$buffer->write(sprintf('$z->pop(\'%s\');', $this->value));
$buffer->indent(-1);
$buffer->writeln('}');
} | [
"public",
"function",
"afterScript",
"(",
"Buffer",
"$",
"buffer",
")",
"{",
"$",
"buffer",
"->",
"write",
"(",
"sprintf",
"(",
"'$z->pop(\\'%s\\');'",
",",
"$",
"this",
"->",
"key",
")",
")",
";",
"$",
"buffer",
"->",
"write",
"(",
"sprintf",
"(",
"'$... | Allows the annotation to modify the buffer after the script is compiled.
@param Buffer $buffer
@return void | [
"Allows",
"the",
"annotation",
"to",
"modify",
"the",
"buffer",
"after",
"the",
"script",
"is",
"compiled",
"."
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Script/Node/Script/ForIn.php#L58-L64 |
22,368 | sokil/php-mongo-yii | src/Sokil/Mongo/Yii/LogRoute.php | LogRoute._timeToMongoDate | protected function _timeToMongoDate($time)
{
if(!is_numeric($time)) {
$time = strtotime($time);
if(!$time) {
$time = time();
}
}
return new \MongoDate($time);
} | php | protected function _timeToMongoDate($time)
{
if(!is_numeric($time)) {
$time = strtotime($time);
if(!$time) {
$time = time();
}
}
return new \MongoDate($time);
} | [
"protected",
"function",
"_timeToMongoDate",
"(",
"$",
"time",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"time",
")",
")",
"{",
"$",
"time",
"=",
"strtotime",
"(",
"$",
"time",
")",
";",
"if",
"(",
"!",
"$",
"time",
")",
"{",
"$",
"time",... | Convert time in different formats to mongo date
@param mixed $time
@return \MongoDate | [
"Convert",
"time",
"in",
"different",
"formats",
"to",
"mongo",
"date"
] | d41b3b70953bc6521c73fcacc501e1596a9ed7d3 | https://github.com/sokil/php-mongo-yii/blob/d41b3b70953bc6521c73fcacc501e1596a9ed7d3/src/Sokil/Mongo/Yii/LogRoute.php#L16-L26 |
22,369 | sokil/php-mongo-yii | src/Sokil/Mongo/Yii/LogRoute.php | LogRoute.processLogs | protected function processLogs($logs)
{
$logCollection = \Yii::app()
->{$this->serviceName}
->getCollection($this->collectionName);
foreach ($logs as $log) {
// time
$logCollection
->createDocument(array(
... | php | protected function processLogs($logs)
{
$logCollection = \Yii::app()
->{$this->serviceName}
->getCollection($this->collectionName);
foreach ($logs as $log) {
// time
$logCollection
->createDocument(array(
... | [
"protected",
"function",
"processLogs",
"(",
"$",
"logs",
")",
"{",
"$",
"logCollection",
"=",
"\\",
"Yii",
"::",
"app",
"(",
")",
"->",
"{",
"$",
"this",
"->",
"serviceName",
"}",
"->",
"getCollection",
"(",
"$",
"this",
"->",
"collectionName",
")",
"... | Write log messages
@param array $logs list of messages | [
"Write",
"log",
"messages"
] | d41b3b70953bc6521c73fcacc501e1596a9ed7d3 | https://github.com/sokil/php-mongo-yii/blob/d41b3b70953bc6521c73fcacc501e1596a9ed7d3/src/Sokil/Mongo/Yii/LogRoute.php#L32-L52 |
22,370 | phootwork/lang | src/text/CheckerTrait.php | CheckerTrait.isSingular | public function isSingular(Pluralizer $pluralizer = null) {
$pluralizer = $pluralizer ?: new EnglishPluralizer();
return $pluralizer->isSingular($this->string);
} | php | public function isSingular(Pluralizer $pluralizer = null) {
$pluralizer = $pluralizer ?: new EnglishPluralizer();
return $pluralizer->isSingular($this->string);
} | [
"public",
"function",
"isSingular",
"(",
"Pluralizer",
"$",
"pluralizer",
"=",
"null",
")",
"{",
"$",
"pluralizer",
"=",
"$",
"pluralizer",
"?",
":",
"new",
"EnglishPluralizer",
"(",
")",
";",
"return",
"$",
"pluralizer",
"->",
"isSingular",
"(",
"$",
"thi... | Check if a string is singular form.
@param Pluralizer $pluralizer
A custom pluralizer. Default is the EnglishPluralizer
@return boolean | [
"Check",
"if",
"a",
"string",
"is",
"singular",
"form",
"."
] | 2e5dc084d9102bf6b4c60f3ec2acc2ef49861588 | https://github.com/phootwork/lang/blob/2e5dc084d9102bf6b4c60f3ec2acc2ef49861588/src/text/CheckerTrait.php#L101-L105 |
22,371 | phootwork/lang | src/text/CheckerTrait.php | CheckerTrait.isPlural | public function isPlural(Pluralizer $pluralizer = null) {
$pluralizer = $pluralizer ?: new EnglishPluralizer();
return $pluralizer->isPlural($this->string);
} | php | public function isPlural(Pluralizer $pluralizer = null) {
$pluralizer = $pluralizer ?: new EnglishPluralizer();
return $pluralizer->isPlural($this->string);
} | [
"public",
"function",
"isPlural",
"(",
"Pluralizer",
"$",
"pluralizer",
"=",
"null",
")",
"{",
"$",
"pluralizer",
"=",
"$",
"pluralizer",
"?",
":",
"new",
"EnglishPluralizer",
"(",
")",
";",
"return",
"$",
"pluralizer",
"->",
"isPlural",
"(",
"$",
"this",
... | Check if a string is plural form.
@param Pluralizer $pluralizer
A custom pluralizer. Default is the EnglishPluralizer
@return boolean | [
"Check",
"if",
"a",
"string",
"is",
"plural",
"form",
"."
] | 2e5dc084d9102bf6b4c60f3ec2acc2ef49861588 | https://github.com/phootwork/lang/blob/2e5dc084d9102bf6b4c60f3ec2acc2ef49861588/src/text/CheckerTrait.php#L114-L118 |
22,372 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo.php | Dwoo.initRuntimeVars | protected function initRuntimeVars(Dwoo_ITemplate $tpl)
{
$this->runtimePlugins = array();
$this->scope =& $this->data;
$this->scopeTree = array();
$this->stack = array();
$this->curBlock = null;
$this->buffer = '';
} | php | protected function initRuntimeVars(Dwoo_ITemplate $tpl)
{
$this->runtimePlugins = array();
$this->scope =& $this->data;
$this->scopeTree = array();
$this->stack = array();
$this->curBlock = null;
$this->buffer = '';
} | [
"protected",
"function",
"initRuntimeVars",
"(",
"Dwoo_ITemplate",
"$",
"tpl",
")",
"{",
"$",
"this",
"->",
"runtimePlugins",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"scope",
"=",
"&",
"$",
"this",
"->",
"data",
";",
"$",
"this",
"->",
"scopeTr... | re-initializes the runtime variables before each template run
override this method to inject data in the globals array if needed, this
method is called before each template execution
@param Dwoo_ITemplate $tpl the template that is going to be rendered | [
"re",
"-",
"initializes",
"the",
"runtime",
"variables",
"before",
"each",
"template",
"run"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo.php#L443-L451 |
22,373 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo.php | Dwoo.addPlugin | public function addPlugin($name, $callback, $compilable = false)
{
$compilable = $compilable ? self::COMPILABLE_PLUGIN : 0;
if (is_array($callback)) {
if (is_subclass_of(is_object($callback[0]) ? get_class($callback[0]) : $callback[0], 'Dwoo_Block_Plugin')) {
$this->plugins[$name] = array('type'=>self::BLOC... | php | public function addPlugin($name, $callback, $compilable = false)
{
$compilable = $compilable ? self::COMPILABLE_PLUGIN : 0;
if (is_array($callback)) {
if (is_subclass_of(is_object($callback[0]) ? get_class($callback[0]) : $callback[0], 'Dwoo_Block_Plugin')) {
$this->plugins[$name] = array('type'=>self::BLOC... | [
"public",
"function",
"addPlugin",
"(",
"$",
"name",
",",
"$",
"callback",
",",
"$",
"compilable",
"=",
"false",
")",
"{",
"$",
"compilable",
"=",
"$",
"compilable",
"?",
"self",
"::",
"COMPILABLE_PLUGIN",
":",
"0",
";",
"if",
"(",
"is_array",
"(",
"$"... | adds a custom plugin that is not in one of the plugin directories
@param string $name the plugin name to be used in the templates
@param callback $callback the plugin callback, either a function name,
a class name or an array containing an object
or class name and a method name
@param bool $compilable if set to true, ... | [
"adds",
"a",
"custom",
"plugin",
"that",
"is",
"not",
"in",
"one",
"of",
"the",
"plugin",
"directories"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo.php#L466-L486 |
22,374 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo.php | Dwoo.addFilter | public function addFilter($callback, $autoload = false)
{
if ($autoload) {
$class = 'Dwoo_Filter_'.$callback;
if (!class_exists($class, false) && !function_exists($class)) {
try {
$this->getLoader()->loadPlugin($callback);
} catch (Dwoo_Exception $e) {
if (strstr($callback, 'Dwoo_Filter_')) ... | php | public function addFilter($callback, $autoload = false)
{
if ($autoload) {
$class = 'Dwoo_Filter_'.$callback;
if (!class_exists($class, false) && !function_exists($class)) {
try {
$this->getLoader()->loadPlugin($callback);
} catch (Dwoo_Exception $e) {
if (strstr($callback, 'Dwoo_Filter_')) ... | [
"public",
"function",
"addFilter",
"(",
"$",
"callback",
",",
"$",
"autoload",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"autoload",
")",
"{",
"$",
"class",
"=",
"'Dwoo_Filter_'",
".",
"$",
"callback",
";",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"cl... | adds a filter to this Dwoo instance, it will be used to filter the output of all the templates rendered by this instance
@param mixed $callback a callback or a filter name if it is autoloaded from a plugin directory
@param bool $autoload if true, the first parameter must be a filter name from one of the plugin directo... | [
"adds",
"a",
"filter",
"to",
"this",
"Dwoo",
"instance",
"it",
"will",
"be",
"used",
"to",
"filter",
"the",
"output",
"of",
"all",
"the",
"templates",
"rendered",
"by",
"this",
"instance"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo.php#L506-L535 |
22,375 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo.php | Dwoo.removeFilter | public function removeFilter($callback)
{
if (($index = array_search('Dwoo_Filter_'.$callback, $this->filters, true)) !== false) {
unset($this->filters[$index]);
} elseif (($index = array_search($callback, $this->filters, true)) !== false) {
unset($this->filters[$index]);
} else {
$class = 'Dwoo_Filter_... | php | public function removeFilter($callback)
{
if (($index = array_search('Dwoo_Filter_'.$callback, $this->filters, true)) !== false) {
unset($this->filters[$index]);
} elseif (($index = array_search($callback, $this->filters, true)) !== false) {
unset($this->filters[$index]);
} else {
$class = 'Dwoo_Filter_... | [
"public",
"function",
"removeFilter",
"(",
"$",
"callback",
")",
"{",
"if",
"(",
"(",
"$",
"index",
"=",
"array_search",
"(",
"'Dwoo_Filter_'",
".",
"$",
"callback",
",",
"$",
"this",
"->",
"filters",
",",
"true",
")",
")",
"!==",
"false",
")",
"{",
... | removes a filter
@param mixed $callback callback or filter name if it was autoloaded | [
"removes",
"a",
"filter"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo.php#L542-L557 |
22,376 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo.php | Dwoo.addResource | public function addResource($name, $class, $compilerFactory = null)
{
if (strlen($name) < 2) {
throw new Dwoo_Exception('Resource names must be at least two-character long to avoid conflicts with Windows paths');
}
if (!class_exists($class)) {
throw new Dwoo_Exception('Resource class does not exist');
}... | php | public function addResource($name, $class, $compilerFactory = null)
{
if (strlen($name) < 2) {
throw new Dwoo_Exception('Resource names must be at least two-character long to avoid conflicts with Windows paths');
}
if (!class_exists($class)) {
throw new Dwoo_Exception('Resource class does not exist');
}... | [
"public",
"function",
"addResource",
"(",
"$",
"name",
",",
"$",
"class",
",",
"$",
"compilerFactory",
"=",
"null",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"name",
")",
"<",
"2",
")",
"{",
"throw",
"new",
"Dwoo_Exception",
"(",
"'Resource names must be ... | adds a resource or overrides a default one
@param string $name the resource name
@param string $class the resource class (which must implement Dwoo_ITemplate)
@param callback $compilerFactory the compiler factory callback, a function that must return a compiler instance used to compile this resource, if none is provid... | [
"adds",
"a",
"resource",
"or",
"overrides",
"a",
"default",
"one"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo.php#L566-L582 |
22,377 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo.php | Dwoo.getLoader | public function getLoader()
{
if ($this->loader === null) {
$this->loader = new Dwoo_Loader($this->getCompileDir());
}
return $this->loader;
} | php | public function getLoader()
{
if ($this->loader === null) {
$this->loader = new Dwoo_Loader($this->getCompileDir());
}
return $this->loader;
} | [
"public",
"function",
"getLoader",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"loader",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"loader",
"=",
"new",
"Dwoo_Loader",
"(",
"$",
"this",
"->",
"getCompileDir",
"(",
")",
")",
";",
"}",
"return",
"... | returns the current loader object or a default one if none is currently found
@param Dwoo_ILoader | [
"returns",
"the",
"current",
"loader",
"object",
"or",
"a",
"default",
"one",
"if",
"none",
"is",
"currently",
"found"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo.php#L616-L623 |
22,378 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo.php | Dwoo.getCacheDir | public function getCacheDir()
{
if ($this->cacheDir === null) {
$this->setCacheDir(dirname(__FILE__).DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR);
}
return $this->cacheDir;
} | php | public function getCacheDir()
{
if ($this->cacheDir === null) {
$this->setCacheDir(dirname(__FILE__).DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR);
}
return $this->cacheDir;
} | [
"public",
"function",
"getCacheDir",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"cacheDir",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"setCacheDir",
"(",
"dirname",
"(",
"__FILE__",
")",
".",
"DIRECTORY_SEPARATOR",
".",
"'cache'",
".",
"DIRECTORY_SEPAR... | returns the cache directory with a trailing DIRECTORY_SEPARATOR
@return string | [
"returns",
"the",
"cache",
"directory",
"with",
"a",
"trailing",
"DIRECTORY_SEPARATOR"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo.php#L642-L649 |
22,379 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo.php | Dwoo.setCacheDir | public function setCacheDir($dir)
{
$this->cacheDir = rtrim($dir, '/\\').DIRECTORY_SEPARATOR;
if (is_writable($this->cacheDir) === false) {
throw new Dwoo_Exception('The cache directory must be writable, chmod "'.$this->cacheDir.'" to make it writable');
}
} | php | public function setCacheDir($dir)
{
$this->cacheDir = rtrim($dir, '/\\').DIRECTORY_SEPARATOR;
if (is_writable($this->cacheDir) === false) {
throw new Dwoo_Exception('The cache directory must be writable, chmod "'.$this->cacheDir.'" to make it writable');
}
} | [
"public",
"function",
"setCacheDir",
"(",
"$",
"dir",
")",
"{",
"$",
"this",
"->",
"cacheDir",
"=",
"rtrim",
"(",
"$",
"dir",
",",
"'/\\\\'",
")",
".",
"DIRECTORY_SEPARATOR",
";",
"if",
"(",
"is_writable",
"(",
"$",
"this",
"->",
"cacheDir",
")",
"==="... | sets the cache directory and automatically appends a DIRECTORY_SEPARATOR
@param string $dir the cache directory | [
"sets",
"the",
"cache",
"directory",
"and",
"automatically",
"appends",
"a",
"DIRECTORY_SEPARATOR"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo.php#L656-L662 |
22,380 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo.php | Dwoo.getCompileDir | public function getCompileDir()
{
if ($this->compileDir === null) {
$this->setCompileDir(dirname(__FILE__).DIRECTORY_SEPARATOR.'compiled'.DIRECTORY_SEPARATOR);
}
return $this->compileDir;
} | php | public function getCompileDir()
{
if ($this->compileDir === null) {
$this->setCompileDir(dirname(__FILE__).DIRECTORY_SEPARATOR.'compiled'.DIRECTORY_SEPARATOR);
}
return $this->compileDir;
} | [
"public",
"function",
"getCompileDir",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"compileDir",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"setCompileDir",
"(",
"dirname",
"(",
"__FILE__",
")",
".",
"DIRECTORY_SEPARATOR",
".",
"'compiled'",
".",
"DIRECT... | returns the compile directory with a trailing DIRECTORY_SEPARATOR
@return string | [
"returns",
"the",
"compile",
"directory",
"with",
"a",
"trailing",
"DIRECTORY_SEPARATOR"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo.php#L669-L676 |
22,381 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo.php | Dwoo.setCompileDir | public function setCompileDir($dir)
{
$this->compileDir = rtrim($dir, '/\\').DIRECTORY_SEPARATOR;
if (is_writable($this->compileDir) === false) {
throw new Dwoo_Exception('The compile directory must be writable, chmod "'.$this->compileDir.'" to make it writable');
}
} | php | public function setCompileDir($dir)
{
$this->compileDir = rtrim($dir, '/\\').DIRECTORY_SEPARATOR;
if (is_writable($this->compileDir) === false) {
throw new Dwoo_Exception('The compile directory must be writable, chmod "'.$this->compileDir.'" to make it writable');
}
} | [
"public",
"function",
"setCompileDir",
"(",
"$",
"dir",
")",
"{",
"$",
"this",
"->",
"compileDir",
"=",
"rtrim",
"(",
"$",
"dir",
",",
"'/\\\\'",
")",
".",
"DIRECTORY_SEPARATOR",
";",
"if",
"(",
"is_writable",
"(",
"$",
"this",
"->",
"compileDir",
")",
... | sets the compile directory and automatically appends a DIRECTORY_SEPARATOR
@param string $dir the compile directory | [
"sets",
"the",
"compile",
"directory",
"and",
"automatically",
"appends",
"a",
"DIRECTORY_SEPARATOR"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo.php#L683-L689 |
22,382 | ekuiter/feature-php | FeaturePhp/ProductLine/Product.php | Product.getAllGenerators | private function getAllGenerators() {
$allGenerators = array();
foreach (fphp\Generator\Generator::getGeneratorMap() as $key => $klass)
$allGenerators[$key] = new $klass($this->productLine->getGeneratorSettings($key));
return $allGenerators;
} | php | private function getAllGenerators() {
$allGenerators = array();
foreach (fphp\Generator\Generator::getGeneratorMap() as $key => $klass)
$allGenerators[$key] = new $klass($this->productLine->getGeneratorSettings($key));
return $allGenerators;
} | [
"private",
"function",
"getAllGenerators",
"(",
")",
"{",
"$",
"allGenerators",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"fphp",
"\\",
"Generator",
"\\",
"Generator",
"::",
"getGeneratorMap",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"klass",
")",
"$",
... | Returns all generators.
The generators are instantiated with their respective generator settings.
@return \FeaturePhp\Generator\Generator[] | [
"Returns",
"all",
"generators",
".",
"The",
"generators",
"are",
"instantiated",
"with",
"their",
"respective",
"generator",
"settings",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/ProductLine/Product.php#L69-L74 |
22,383 | ekuiter/feature-php | FeaturePhp/ProductLine/Product.php | Product.addArtifactToUsedGenerators | private function addArtifactToUsedGenerators($allGenerators, $feature, $func) {
$artifact = $this->productLine->getArtifact($feature);
foreach ($artifact->getGenerators() as $key => $cfg) {
if (!array_key_exists($key, $allGenerators))
throw new ProductException("\"$key\" is n... | php | private function addArtifactToUsedGenerators($allGenerators, $feature, $func) {
$artifact = $this->productLine->getArtifact($feature);
foreach ($artifact->getGenerators() as $key => $cfg) {
if (!array_key_exists($key, $allGenerators))
throw new ProductException("\"$key\" is n... | [
"private",
"function",
"addArtifactToUsedGenerators",
"(",
"$",
"allGenerators",
",",
"$",
"feature",
",",
"$",
"func",
")",
"{",
"$",
"artifact",
"=",
"$",
"this",
"->",
"productLine",
"->",
"getArtifact",
"(",
"$",
"feature",
")",
";",
"foreach",
"(",
"$... | Adds a feature's artifact to all generators it specifies.
This is done independently from whether the corresponding feature is
selected or deselected to support generating code for both cases.
@param \FeaturePhp\Generator\Generator[] $allGenerators
@param \FeaturePhp\Model\Feature $feature
@param callable $func whether... | [
"Adds",
"a",
"feature",
"s",
"artifact",
"to",
"all",
"generators",
"it",
"specifies",
".",
"This",
"is",
"done",
"independently",
"from",
"whether",
"the",
"corresponding",
"feature",
"is",
"selected",
"or",
"deselected",
"to",
"support",
"generating",
"code",
... | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/ProductLine/Product.php#L84-L91 |
22,384 | ekuiter/feature-php | FeaturePhp/ProductLine/Product.php | Product.getGeneratorElements | private function getGeneratorElements($func) {
$allGenerators = $this->getAllGenerators();
foreach ($this->configuration->getSelectedFeatures() as $feature)
$this->addArtifactToUsedGenerators($allGenerators, $feature, "addSelectedArtifact");
foreach ($this->configuration->getDesele... | php | private function getGeneratorElements($func) {
$allGenerators = $this->getAllGenerators();
foreach ($this->configuration->getSelectedFeatures() as $feature)
$this->addArtifactToUsedGenerators($allGenerators, $feature, "addSelectedArtifact");
foreach ($this->configuration->getDesele... | [
"private",
"function",
"getGeneratorElements",
"(",
"$",
"func",
")",
"{",
"$",
"allGenerators",
"=",
"$",
"this",
"->",
"getAllGenerators",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"configuration",
"->",
"getSelectedFeatures",
"(",
")",
"as",
"$",
... | Returns elements generated for the product.
To do this, every artifact is registered with the generators it specifies.
Then every generator generates some elements. Finally all the elements are merged.
@param callable $func
@return mixed[] | [
"Returns",
"elements",
"generated",
"for",
"the",
"product",
".",
"To",
"do",
"this",
"every",
"artifact",
"is",
"registered",
"with",
"the",
"generators",
"it",
"specifies",
".",
"Then",
"every",
"generator",
"generates",
"some",
"elements",
".",
"Finally",
"... | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/ProductLine/Product.php#L100-L114 |
22,385 | ekuiter/feature-php | FeaturePhp/ProductLine/Product.php | Product.generateFiles | public function generateFiles() {
$files = $this->getGeneratorElements("generateFiles");
$files = fphp\Helper\_Array::assertNoDuplicates($files, "getTarget");
$files = fphp\Helper\_Array::sortByKey($files, "getTarget");
return $files;
} | php | public function generateFiles() {
$files = $this->getGeneratorElements("generateFiles");
$files = fphp\Helper\_Array::assertNoDuplicates($files, "getTarget");
$files = fphp\Helper\_Array::sortByKey($files, "getTarget");
return $files;
} | [
"public",
"function",
"generateFiles",
"(",
")",
"{",
"$",
"files",
"=",
"$",
"this",
"->",
"getGeneratorElements",
"(",
"\"generateFiles\"",
")",
";",
"$",
"files",
"=",
"fphp",
"\\",
"Helper",
"\\",
"_Array",
"::",
"assertNoDuplicates",
"(",
"$",
"files",
... | Generates the product's files.
@return \FeaturePhp\File\File[] | [
"Generates",
"the",
"product",
"s",
"files",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/ProductLine/Product.php#L120-L125 |
22,386 | ekuiter/feature-php | FeaturePhp/ProductLine/Product.php | Product.trace | public function trace() {
$tracingLinks = array_merge(
$this->getGeneratorElements("trace"),
$this->getAllGenerators()["runtime"]->traceRuntimeCalls($this->generateFiles(), $this->productLine)
);
$tracingLinks = fphp\Helper\_Array::sortByKey($tracingLinks, "getFeatureName... | php | public function trace() {
$tracingLinks = array_merge(
$this->getGeneratorElements("trace"),
$this->getAllGenerators()["runtime"]->traceRuntimeCalls($this->generateFiles(), $this->productLine)
);
$tracingLinks = fphp\Helper\_Array::sortByKey($tracingLinks, "getFeatureName... | [
"public",
"function",
"trace",
"(",
")",
"{",
"$",
"tracingLinks",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"getGeneratorElements",
"(",
"\"trace\"",
")",
",",
"$",
"this",
"->",
"getAllGenerators",
"(",
")",
"[",
"\"runtime\"",
"]",
"->",
"traceRuntimeCa... | Returns tracing links for the product.
@return \FeaturePhp\Artifact\TracingLink[] | [
"Returns",
"tracing",
"links",
"for",
"the",
"product",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/ProductLine/Product.php#L131-L138 |
22,387 | ouropencode/dachi | src/Session.php | Session.hasSessionMoved | public static function hasSessionMoved() {
if(!isset($_SESSION['dachi_agent']))
return true;
$agents = $_SESSION['dachi_agent'];
$agentc = $_SERVER['HTTP_USER_AGENT'];
if($agents != $agentc) {
if(strpos($agentc, "Trident") !== false && strpos($agents, "Trident") !== false)
return false;
return t... | php | public static function hasSessionMoved() {
if(!isset($_SESSION['dachi_agent']))
return true;
$agents = $_SESSION['dachi_agent'];
$agentc = $_SERVER['HTTP_USER_AGENT'];
if($agents != $agentc) {
if(strpos($agentc, "Trident") !== false && strpos($agents, "Trident") !== false)
return false;
return t... | [
"public",
"static",
"function",
"hasSessionMoved",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"_SESSION",
"[",
"'dachi_agent'",
"]",
")",
")",
"return",
"true",
";",
"$",
"agents",
"=",
"$",
"_SESSION",
"[",
"'dachi_agent'",
"]",
";",
"$",
"agen... | Has this session moved
Moving is currently defined as "changing user agent".
@return boolean | [
"Has",
"this",
"session",
"moved"
] | a0e1daf269d0345afbb859ce20ef9da6decd7efe | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Session.php#L63-L78 |
22,388 | ouropencode/dachi | src/Session.php | Session.isValid | public static function isValid() {
if(isset($_SESSION['dachi_closed']) && !isset($_SESSION['dachi_expires']))
return false;
if(isset($_SESSION['dachi_expires']) && $_SESSION['dachi_expires'] < time())
return false;
return true;
} | php | public static function isValid() {
if(isset($_SESSION['dachi_closed']) && !isset($_SESSION['dachi_expires']))
return false;
if(isset($_SESSION['dachi_expires']) && $_SESSION['dachi_expires'] < time())
return false;
return true;
} | [
"public",
"static",
"function",
"isValid",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_SESSION",
"[",
"'dachi_closed'",
"]",
")",
"&&",
"!",
"isset",
"(",
"$",
"_SESSION",
"[",
"'dachi_expires'",
"]",
")",
")",
"return",
"false",
";",
"if",
"(",
"... | Is this session still valid?
Sessions are invalidated 10 seconds after regeneration, this is to allow AJAX
requests to complete execution before terminating the session. This method will
return false if the 10 second period has expired.
@return boolean | [
"Is",
"this",
"session",
"still",
"valid?"
] | a0e1daf269d0345afbb859ce20ef9da6decd7efe | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Session.php#L89-L97 |
22,389 | ouropencode/dachi | src/Session.php | Session.regenerate | public static function regenerate() {
if(isset($_SESSION['dachi_closed']) && $_SESSION['dachi_closed'] == true)
return false;
$_SESSION['dachi_closed'] = true;
$_SESSION['dachi_expires'] = time() + 10;
session_regenerate_id(false);
$new_session = session_id();
session_write_close();
session_id($new... | php | public static function regenerate() {
if(isset($_SESSION['dachi_closed']) && $_SESSION['dachi_closed'] == true)
return false;
$_SESSION['dachi_closed'] = true;
$_SESSION['dachi_expires'] = time() + 10;
session_regenerate_id(false);
$new_session = session_id();
session_write_close();
session_id($new... | [
"public",
"static",
"function",
"regenerate",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_SESSION",
"[",
"'dachi_closed'",
"]",
")",
"&&",
"$",
"_SESSION",
"[",
"'dachi_closed'",
"]",
"==",
"true",
")",
"return",
"false",
";",
"$",
"_SESSION",
"[",
... | Regenerate the session for security
There is a 5% random chance on any page request that the session ID will be regenerated
and a new session identity served to the user. This prevents static session IDs that
can be stolen and reused.
This method sets the old session to expire in 10 seconds. This allows for any pendi... | [
"Regenerate",
"the",
"session",
"for",
"security"
] | a0e1daf269d0345afbb859ce20ef9da6decd7efe | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Session.php#L111-L128 |
22,390 | netzmacht/contao-leaflet-geocode-widget | src/Widget/GeocodeWidget.php | GeocodeWidget.buildRadiusOptions | private function buildRadiusOptions()
{
if (!$this->radius || !isset($GLOBALS['TL_DCA'][$this->strTable]['fields'][$this->radius])) {
return null;
}
$options = [
'element' => 'ctrl_' . $this->radius,
'min' => 0,
'max' =>... | php | private function buildRadiusOptions()
{
if (!$this->radius || !isset($GLOBALS['TL_DCA'][$this->strTable]['fields'][$this->radius])) {
return null;
}
$options = [
'element' => 'ctrl_' . $this->radius,
'min' => 0,
'max' =>... | [
"private",
"function",
"buildRadiusOptions",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"radius",
"||",
"!",
"isset",
"(",
"$",
"GLOBALS",
"[",
"'TL_DCA'",
"]",
"[",
"$",
"this",
"->",
"strTable",
"]",
"[",
"'fields'",
"]",
"[",
"$",
"this",
... | Build the radius options.
@return array|null
@SuppressWarnings(PHPMD.Superglobals) | [
"Build",
"the",
"radius",
"options",
"."
] | 08acfbc473696f385d7c6aed6148e51c91443e12 | https://github.com/netzmacht/contao-leaflet-geocode-widget/blob/08acfbc473696f385d7c6aed6148e51c91443e12/src/Widget/GeocodeWidget.php#L143-L166 |
22,391 | laraning/boost | src/Traits/CanCreateMany.php | CanCreateMany.createMany | public static function createMany(array $datasets) : array
{
$models = [];
foreach ($datasets as $dataset) {
$models[] = static::create($dataset);
}
return $models;
} | php | public static function createMany(array $datasets) : array
{
$models = [];
foreach ($datasets as $dataset) {
$models[] = static::create($dataset);
}
return $models;
} | [
"public",
"static",
"function",
"createMany",
"(",
"array",
"$",
"datasets",
")",
":",
"array",
"{",
"$",
"models",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"datasets",
"as",
"$",
"dataset",
")",
"{",
"$",
"models",
"[",
"]",
"=",
"static",
"::",
"... | Creates many Models.
@param array $datasets The data array of arrays.
@return array The created models array. | [
"Creates",
"many",
"Models",
"."
] | a57ac46f93eead7959c6743f5e709b1fb1429053 | https://github.com/laraning/boost/blob/a57ac46f93eead7959c6743f5e709b1fb1429053/src/Traits/CanCreateMany.php#L17-L26 |
22,392 | 99designs/ergo-http | src/ResponseBuilder.php | ResponseBuilder.expires | public function expires($time)
{
if (!empty($time) && is_string($time) && !$timestamp = strtotime($time)) {
throw new \Ergo\Routing\Exception("Invalid expiry time: $timestamp");
} else if (is_numeric($time)) {
$timestamp = $time;
} else if ($time == false) {
... | php | public function expires($time)
{
if (!empty($time) && is_string($time) && !$timestamp = strtotime($time)) {
throw new \Ergo\Routing\Exception("Invalid expiry time: $timestamp");
} else if (is_numeric($time)) {
$timestamp = $time;
} else if ($time == false) {
... | [
"public",
"function",
"expires",
"(",
"$",
"time",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"time",
")",
"&&",
"is_string",
"(",
"$",
"time",
")",
"&&",
"!",
"$",
"timestamp",
"=",
"strtotime",
"(",
"$",
"time",
")",
")",
"{",
"throw",
"new",... | Sets the Expires header based on a Unix timestamp.
@param int Unix timestamp
@chainable | [
"Sets",
"the",
"Expires",
"header",
"based",
"on",
"a",
"Unix",
"timestamp",
"."
] | 979b789f2e011a1cb70a00161e6b7bcd0d2e9c71 | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/ResponseBuilder.php#L171-L184 |
22,393 | jasny/controller | src/Controller/Output.php | Output.created | public function created($location = null)
{
$this->respondWith(201);
if (!empty($location)) {
$this->setResponseHeader('Location', $location);
}
} | php | public function created($location = null)
{
$this->respondWith(201);
if (!empty($location)) {
$this->setResponseHeader('Location', $location);
}
} | [
"public",
"function",
"created",
"(",
"$",
"location",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"respondWith",
"(",
"201",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"location",
")",
")",
"{",
"$",
"this",
"->",
"setResponseHeader",
"(",
"'Locatio... | Response with created 201 code, and optionally the created location
@param string $location Url of created resource | [
"Response",
"with",
"created",
"201",
"code",
"and",
"optionally",
"the",
"created",
"location"
] | 28edf64343f1d8218c166c0c570128e1ee6153d8 | https://github.com/jasny/controller/blob/28edf64343f1d8218c166c0c570128e1ee6153d8/src/Controller/Output.php#L109-L116 |
22,394 | jasny/controller | src/Controller/Output.php | Output.partialContent | public function partialContent($rangeFrom, $rangeTo, $totalSize)
{
$this->respondWith(206);
$this->setResponseHeader('Content-Range', "bytes {$rangeFrom}-{$rangeTo}/{$totalSize}");
$this->setResponseHeader('Content-Length', $rangeTo - $rangeFrom);
} | php | public function partialContent($rangeFrom, $rangeTo, $totalSize)
{
$this->respondWith(206);
$this->setResponseHeader('Content-Range', "bytes {$rangeFrom}-{$rangeTo}/{$totalSize}");
$this->setResponseHeader('Content-Length', $rangeTo - $rangeFrom);
} | [
"public",
"function",
"partialContent",
"(",
"$",
"rangeFrom",
",",
"$",
"rangeTo",
",",
"$",
"totalSize",
")",
"{",
"$",
"this",
"->",
"respondWith",
"(",
"206",
")",
";",
"$",
"this",
"->",
"setResponseHeader",
"(",
"'Content-Range'",
",",
"\"bytes {$range... | Respond with a 206 Partial content with `Content-Range` header
@param int $rangeFrom Beginning of the range in bytes
@param int $rangeTo End of the range in bytes
@param int $totalSize Total size in bytes | [
"Respond",
"with",
"a",
"206",
"Partial",
"content",
"with",
"Content",
"-",
"Range",
"header"
] | 28edf64343f1d8218c166c0c570128e1ee6153d8 | https://github.com/jasny/controller/blob/28edf64343f1d8218c166c0c570128e1ee6153d8/src/Controller/Output.php#L143-L149 |
22,395 | jasny/controller | src/Controller/Output.php | Output.redirect | public function redirect($url, $code = 303)
{
$this->respondWith($code);
$this->setResponseHeader('Location', $url);
$urlHtml = htmlentities($url);
$this->output('You are being redirected to <a href="' . $urlHtml . '">' . $urlHtml . '</a>', 'text/html');
} | php | public function redirect($url, $code = 303)
{
$this->respondWith($code);
$this->setResponseHeader('Location', $url);
$urlHtml = htmlentities($url);
$this->output('You are being redirected to <a href="' . $urlHtml . '">' . $urlHtml . '</a>', 'text/html');
} | [
"public",
"function",
"redirect",
"(",
"$",
"url",
",",
"$",
"code",
"=",
"303",
")",
"{",
"$",
"this",
"->",
"respondWith",
"(",
"$",
"code",
")",
";",
"$",
"this",
"->",
"setResponseHeader",
"(",
"'Location'",
",",
"$",
"url",
")",
";",
"$",
"url... | Redirect to url and output a short message with the link
@param string $url
@param int $code 301 (Moved Permanently), 302 (Found), 303 (See Other) or 307 (Temporary Redirect) | [
"Redirect",
"to",
"url",
"and",
"output",
"a",
"short",
"message",
"with",
"the",
"link"
] | 28edf64343f1d8218c166c0c570128e1ee6153d8 | https://github.com/jasny/controller/blob/28edf64343f1d8218c166c0c570128e1ee6153d8/src/Controller/Output.php#L158-L165 |
22,396 | jasny/controller | src/Controller/Output.php | Output.getContentType | protected function getContentType($format)
{
// Check if it's already MIME
if (\Jasny\str_contains($format, '/')) {
return $format;
}
$repository = new ApacheMimeTypes();
$mime = $repository->findType($format);
if (!isset($mime)) {
th... | php | protected function getContentType($format)
{
// Check if it's already MIME
if (\Jasny\str_contains($format, '/')) {
return $format;
}
$repository = new ApacheMimeTypes();
$mime = $repository->findType($format);
if (!isset($mime)) {
th... | [
"protected",
"function",
"getContentType",
"(",
"$",
"format",
")",
"{",
"// Check if it's already MIME",
"if",
"(",
"\\",
"Jasny",
"\\",
"str_contains",
"(",
"$",
"format",
",",
"'/'",
")",
")",
"{",
"return",
"$",
"format",
";",
"}",
"$",
"repository",
"... | Get MIME type for extension
@param string $format
@return string | [
"Get",
"MIME",
"type",
"for",
"extension"
] | 28edf64343f1d8218c166c0c570128e1ee6153d8 | https://github.com/jasny/controller/blob/28edf64343f1d8218c166c0c570128e1ee6153d8/src/Controller/Output.php#L291-L306 |
22,397 | jasny/controller | src/Controller/Output.php | Output.outputContentType | protected function outputContentType($format)
{
if (!isset($format)) {
$contentType = $this->getResponse()->getHeaderLine('Content-Type');
if (empty($contentType)) {
$format = $this->defaultFormat ?: 'text/html';
}
}
i... | php | protected function outputContentType($format)
{
if (!isset($format)) {
$contentType = $this->getResponse()->getHeaderLine('Content-Type');
if (empty($contentType)) {
$format = $this->defaultFormat ?: 'text/html';
}
}
i... | [
"protected",
"function",
"outputContentType",
"(",
"$",
"format",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"format",
")",
")",
"{",
"$",
"contentType",
"=",
"$",
"this",
"->",
"getResponse",
"(",
")",
"->",
"getHeaderLine",
"(",
"'Content-Type'",
")"... | Set the content type for the output
@param string $format
@return string | [
"Set",
"the",
"content",
"type",
"for",
"the",
"output"
] | 28edf64343f1d8218c166c0c570128e1ee6153d8 | https://github.com/jasny/controller/blob/28edf64343f1d8218c166c0c570128e1ee6153d8/src/Controller/Output.php#L385-L401 |
22,398 | delaneymethod/sharepoint-api | src/Client.php | Client.listFolder | public function listFolder(string $path, bool $recursive = false) : array
{
$path = $this->normalizePath($path);
$requestUrl = $this->siteUrl.'/sites/'.$this->siteName.'/_api/Web/GetFolderByServerRelativeUrl(\''.$this->folderPath.$path.'\')/Folders';
$options = [
'headers' => $this->requestHeaders,
]... | php | public function listFolder(string $path, bool $recursive = false) : array
{
$path = $this->normalizePath($path);
$requestUrl = $this->siteUrl.'/sites/'.$this->siteName.'/_api/Web/GetFolderByServerRelativeUrl(\''.$this->folderPath.$path.'\')/Folders';
$options = [
'headers' => $this->requestHeaders,
]... | [
"public",
"function",
"listFolder",
"(",
"string",
"$",
"path",
",",
"bool",
"$",
"recursive",
"=",
"false",
")",
":",
"array",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"normalizePath",
"(",
"$",
"path",
")",
";",
"$",
"requestUrl",
"=",
"$",
"this"... | Returns the contents of a folder. | [
"Returns",
"the",
"contents",
"of",
"a",
"folder",
"."
] | 1ede2742292a13896f071427da5995abf5e9a545 | https://github.com/delaneymethod/sharepoint-api/blob/1ede2742292a13896f071427da5995abf5e9a545/src/Client.php#L168-L188 |
22,399 | delaneymethod/sharepoint-api | src/Client.php | Client.copy | public function copy(string $fromPath, string $toPath, array $mimeType) : bool
{
$fromPath = $this->normalizePath($fromPath);
$toPath = $this->normalizePath($toPath);
// If plain/text, its a folder
if (substr($mimeType['mimetype'], 0, 4) === 'text') {
$requestUrl = $this->siteUrl.'/sites/'.$this->site... | php | public function copy(string $fromPath, string $toPath, array $mimeType) : bool
{
$fromPath = $this->normalizePath($fromPath);
$toPath = $this->normalizePath($toPath);
// If plain/text, its a folder
if (substr($mimeType['mimetype'], 0, 4) === 'text') {
$requestUrl = $this->siteUrl.'/sites/'.$this->site... | [
"public",
"function",
"copy",
"(",
"string",
"$",
"fromPath",
",",
"string",
"$",
"toPath",
",",
"array",
"$",
"mimeType",
")",
":",
"bool",
"{",
"$",
"fromPath",
"=",
"$",
"this",
"->",
"normalizePath",
"(",
"$",
"fromPath",
")",
";",
"$",
"toPath",
... | Copy a file or folder to a different location.
https://msdn.microsoft.com/en-us/library/office/jj247198%28v=office.15%29.aspx | [
"Copy",
"a",
"file",
"or",
"folder",
"to",
"a",
"different",
"location",
"."
] | 1ede2742292a13896f071427da5995abf5e9a545 | https://github.com/delaneymethod/sharepoint-api/blob/1ede2742292a13896f071427da5995abf5e9a545/src/Client.php#L195-L215 |
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.