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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
229,400 | milesj/utility | View/Helper/UtilityHelper.php | UtilityHelper.enum | public function enum($model, $field, $value = null, $domain = null) {
$enum = ClassRegistry::init($model)->enum($field);
list($plugin, $model) = pluginSplit($model);
// Set domain
if (!$domain) {
if ($plugin) {
$domain = Inflector::underscore($plugin... | php | public function enum($model, $field, $value = null, $domain = null) {
$enum = ClassRegistry::init($model)->enum($field);
list($plugin, $model) = pluginSplit($model);
// Set domain
if (!$domain) {
if ($plugin) {
$domain = Inflector::underscore($plugin... | [
"public",
"function",
"enum",
"(",
"$",
"model",
",",
"$",
"field",
",",
"$",
"value",
"=",
"null",
",",
"$",
"domain",
"=",
"null",
")",
"{",
"$",
"enum",
"=",
"ClassRegistry",
"::",
"init",
"(",
"$",
"model",
")",
"->",
"enum",
"(",
"$",
"field... | Retrieve an enum list for a Models field and translate the values.
@param string $model
@param string $field
@param mixed $value
@param string $domain
@return string|array | [
"Retrieve",
"an",
"enum",
"list",
"for",
"a",
"Models",
"field",
"and",
"translate",
"the",
"values",
"."
] | 146318ff0a882917defab7f4918b0d198eb5a3c0 | https://github.com/milesj/utility/blob/146318ff0a882917defab7f4918b0d198eb5a3c0/View/Helper/UtilityHelper.php#L35-L75 |
229,401 | milesj/utility | View/Helper/UtilityHelper.php | UtilityHelper.gravatar | public function gravatar($email, array $options = array(), array $attributes = array()) {
$options = $options + array(
'default' => 'mm',
'size' => 80,
'rating' => 'g',
'hash' => 'md5',
'secure' => env('HTTPS')
);
$email = Sec... | php | public function gravatar($email, array $options = array(), array $attributes = array()) {
$options = $options + array(
'default' => 'mm',
'size' => 80,
'rating' => 'g',
'hash' => 'md5',
'secure' => env('HTTPS')
);
$email = Sec... | [
"public",
"function",
"gravatar",
"(",
"$",
"email",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
",",
"array",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"$",
"options",
"=",
"$",
"options",
"+",
"array",
"(",
"'default'",
"=>",
... | Render out a gravatar thumbnail based on an email.
@param string $email
@param array $options
@param array $attributes
@return string | [
"Render",
"out",
"a",
"gravatar",
"thumbnail",
"based",
"on",
"an",
"email",
"."
] | 146318ff0a882917defab7f4918b0d198eb5a3c0 | https://github.com/milesj/utility/blob/146318ff0a882917defab7f4918b0d198eb5a3c0/View/Helper/UtilityHelper.php#L85-L110 |
229,402 | mustafaaloko/elasticquent5 | src/ElasticquentTrait.php | ElasticquentTrait.getElasticSearchClient | public function getElasticSearchClient()
{
$config = [];
if (\Config::has('elasticquent.config')) {
$config = \Config::get('elasticquent.config');
}
return new \Elasticsearch\Client($config);
} | php | public function getElasticSearchClient()
{
$config = [];
if (\Config::has('elasticquent.config')) {
$config = \Config::get('elasticquent.config');
}
return new \Elasticsearch\Client($config);
} | [
"public",
"function",
"getElasticSearchClient",
"(",
")",
"{",
"$",
"config",
"=",
"[",
"]",
";",
"if",
"(",
"\\",
"Config",
"::",
"has",
"(",
"'elasticquent.config'",
")",
")",
"{",
"$",
"config",
"=",
"\\",
"Config",
"::",
"get",
"(",
"'elasticquent.co... | Get ElasticSearch Client.
@return \Elasticsearch\Client | [
"Get",
"ElasticSearch",
"Client",
"."
] | 63975ab98c786c58dc241f922e3126a192cbe294 | https://github.com/mustafaaloko/elasticquent5/blob/63975ab98c786c58dc241f922e3126a192cbe294/src/ElasticquentTrait.php#L56-L65 |
229,403 | mustafaaloko/elasticquent5 | src/ElasticquentTrait.php | ElasticquentTrait.getBasicEsParams | public function getBasicEsParams($getIdIfPossible = true, $getSourceIfPossible = false, $getTimestampIfPossible = false, $limit = null, $offset = null)
{
$params = [
'index' => $this->getIndexName(),
'type' => $this->getTypeName(),
];
if ($getIdIfPossible an... | php | public function getBasicEsParams($getIdIfPossible = true, $getSourceIfPossible = false, $getTimestampIfPossible = false, $limit = null, $offset = null)
{
$params = [
'index' => $this->getIndexName(),
'type' => $this->getTypeName(),
];
if ($getIdIfPossible an... | [
"public",
"function",
"getBasicEsParams",
"(",
"$",
"getIdIfPossible",
"=",
"true",
",",
"$",
"getSourceIfPossible",
"=",
"false",
",",
"$",
"getTimestampIfPossible",
"=",
"false",
",",
"$",
"limit",
"=",
"null",
",",
"$",
"offset",
"=",
"null",
")",
"{",
... | Get Basic Elasticsearch Params.
Most Elasticsearch API calls need the index and
type passed in a parameter array.
@param bool $getIdIfPossible
@param bool $getSourceIfPossible
@param bool $getTimestampIfPossible
@param int $limit
@param int $offset
@return array | [
"Get",
"Basic",
"Elasticsearch",
"Params",
"."
] | 63975ab98c786c58dc241f922e3126a192cbe294 | https://github.com/mustafaaloko/elasticquent5/blob/63975ab98c786c58dc241f922e3126a192cbe294/src/ElasticquentTrait.php#L362-L396 |
229,404 | mustafaaloko/elasticquent5 | src/ElasticquentTrait.php | ElasticquentTrait.getMapping | public static function getMapping()
{
$instance = new static();
$params = $instance->getBasicEsParams();
return $instance->getElasticSearchClient()->indices()->getMapping($params);
} | php | public static function getMapping()
{
$instance = new static();
$params = $instance->getBasicEsParams();
return $instance->getElasticSearchClient()->indices()->getMapping($params);
} | [
"public",
"static",
"function",
"getMapping",
"(",
")",
"{",
"$",
"instance",
"=",
"new",
"static",
"(",
")",
";",
"$",
"params",
"=",
"$",
"instance",
"->",
"getBasicEsParams",
"(",
")",
";",
"return",
"$",
"instance",
"->",
"getElasticSearchClient",
"(",... | Get Mapping.
@return void | [
"Get",
"Mapping",
"."
] | 63975ab98c786c58dc241f922e3126a192cbe294 | https://github.com/mustafaaloko/elasticquent5/blob/63975ab98c786c58dc241f922e3126a192cbe294/src/ElasticquentTrait.php#L417-L424 |
229,405 | mustafaaloko/elasticquent5 | src/ElasticquentTrait.php | ElasticquentTrait.putMapping | public static function putMapping($ignoreConflicts = false)
{
$instance = new static();
$mapping = $instance->getBasicEsParams();
$params = [
'_source' => ['enabled' => true],
'properties' => $instance->getMappingProperties(),
];
$mapping['... | php | public static function putMapping($ignoreConflicts = false)
{
$instance = new static();
$mapping = $instance->getBasicEsParams();
$params = [
'_source' => ['enabled' => true],
'properties' => $instance->getMappingProperties(),
];
$mapping['... | [
"public",
"static",
"function",
"putMapping",
"(",
"$",
"ignoreConflicts",
"=",
"false",
")",
"{",
"$",
"instance",
"=",
"new",
"static",
"(",
")",
";",
"$",
"mapping",
"=",
"$",
"instance",
"->",
"getBasicEsParams",
"(",
")",
";",
"$",
"params",
"=",
... | Put Mapping.
@param bool $ignoreConflicts
@return array | [
"Put",
"Mapping",
"."
] | 63975ab98c786c58dc241f922e3126a192cbe294 | https://github.com/mustafaaloko/elasticquent5/blob/63975ab98c786c58dc241f922e3126a192cbe294/src/ElasticquentTrait.php#L433-L447 |
229,406 | mustafaaloko/elasticquent5 | src/ElasticquentTrait.php | ElasticquentTrait.createIndex | public static function createIndex($shards = null, $replicas = null)
{
$instance = new static();
$client = $instance->getElasticSearchClient();
$index = [
'index' => $instance->getIndexName(),
];
if ($shards) {
$index['body']['settings']['number... | php | public static function createIndex($shards = null, $replicas = null)
{
$instance = new static();
$client = $instance->getElasticSearchClient();
$index = [
'index' => $instance->getIndexName(),
];
if ($shards) {
$index['body']['settings']['number... | [
"public",
"static",
"function",
"createIndex",
"(",
"$",
"shards",
"=",
"null",
",",
"$",
"replicas",
"=",
"null",
")",
"{",
"$",
"instance",
"=",
"new",
"static",
"(",
")",
";",
"$",
"client",
"=",
"$",
"instance",
"->",
"getElasticSearchClient",
"(",
... | Create Index.
@param int $shards
@param int $replicas
@return array | [
"Create",
"Index",
"."
] | 63975ab98c786c58dc241f922e3126a192cbe294 | https://github.com/mustafaaloko/elasticquent5/blob/63975ab98c786c58dc241f922e3126a192cbe294/src/ElasticquentTrait.php#L494-L513 |
229,407 | fecshop/yii2-fec | component/redisqueue/Queue.php | Queue.buildPrefix | public function buildPrefix($name = null)
{
if (empty($name)) {
$name = 'default';
} elseif ($name && preg_match('/[^[:alnum:]]/', $name)) {
$name = md5($name);
}
return $this->queuePrefix . ':' . $name;
} | php | public function buildPrefix($name = null)
{
if (empty($name)) {
$name = 'default';
} elseif ($name && preg_match('/[^[:alnum:]]/', $name)) {
$name = md5($name);
}
return $this->queuePrefix . ':' . $name;
} | [
"public",
"function",
"buildPrefix",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"name",
")",
")",
"{",
"$",
"name",
"=",
"'default'",
";",
"}",
"elseif",
"(",
"$",
"name",
"&&",
"preg_match",
"(",
"'/[^[:alnum:]]/'",
",",
... | Builds queue prefix
@param string|null $name Queue name
@return string | [
"Builds",
"queue",
"prefix"
] | fda0e381f931bc503e493bec90185162109018e6 | https://github.com/fecshop/yii2-fec/blob/fda0e381f931bc503e493bec90185162109018e6/component/redisqueue/Queue.php#L19-L27 |
229,408 | fecshop/yii2-fec | component/redisqueue/Queue.php | Queue.push | public function push($job, $data = null, $queue = null, $options = [])
{
return $this->pushInternal($this->createPayload($job, $data), $queue, $options);
} | php | public function push($job, $data = null, $queue = null, $options = [])
{
return $this->pushInternal($this->createPayload($job, $data), $queue, $options);
} | [
"public",
"function",
"push",
"(",
"$",
"job",
",",
"$",
"data",
"=",
"null",
",",
"$",
"queue",
"=",
"null",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"pushInternal",
"(",
"$",
"this",
"->",
"createPayload",
"(",
... | Push job to the queue
@param string $job Fully qualified class name of the job
@param mixed $data Data for the job
@param string|null $queue Queue name
@return string ID of the job | [
"Push",
"job",
"to",
"the",
"queue"
] | fda0e381f931bc503e493bec90185162109018e6 | https://github.com/fecshop/yii2-fec/blob/fda0e381f931bc503e493bec90185162109018e6/component/redisqueue/Queue.php#L36-L39 |
229,409 | fecshop/yii2-fec | component/redisqueue/Queue.php | Queue.createPayload | protected function createPayload($job, $data)
{
$payload = [
'job' => $job,
'data' => $data
];
$payload = $this->setMeta($payload, 'id', $this->getRandomId());
return $payload;
} | php | protected function createPayload($job, $data)
{
$payload = [
'job' => $job,
'data' => $data
];
$payload = $this->setMeta($payload, 'id', $this->getRandomId());
return $payload;
} | [
"protected",
"function",
"createPayload",
"(",
"$",
"job",
",",
"$",
"data",
")",
"{",
"$",
"payload",
"=",
"[",
"'job'",
"=>",
"$",
"job",
",",
"'data'",
"=>",
"$",
"data",
"]",
";",
"$",
"payload",
"=",
"$",
"this",
"->",
"setMeta",
"(",
"$",
"... | Create job array
@param string $job Fully qualified class name of the job
@param mixed $data Data for the job
@return array | [
"Create",
"job",
"array"
] | fda0e381f931bc503e493bec90185162109018e6 | https://github.com/fecshop/yii2-fec/blob/fda0e381f931bc503e493bec90185162109018e6/component/redisqueue/Queue.php#L57-L65 |
229,410 | fuelphp/common | src/Table/Render.php | Render.renderTable | public function renderTable(Table $table)
{
//Generate each row
$rows = $this->buildRows($table);
$headerRows = $this->buildHeaders($table);
$footerRows = $this->buildFooters($table);
return $this->container($table, $rows, $headerRows, $footerRows);
} | php | public function renderTable(Table $table)
{
//Generate each row
$rows = $this->buildRows($table);
$headerRows = $this->buildHeaders($table);
$footerRows = $this->buildFooters($table);
return $this->container($table, $rows, $headerRows, $footerRows);
} | [
"public",
"function",
"renderTable",
"(",
"Table",
"$",
"table",
")",
"{",
"//Generate each row",
"$",
"rows",
"=",
"$",
"this",
"->",
"buildRows",
"(",
"$",
"table",
")",
";",
"$",
"headerRows",
"=",
"$",
"this",
"->",
"buildHeaders",
"(",
"$",
"table",... | Renders the given table into a string. Output depends on the subclass
@param Table $table
@return string | [
"Renders",
"the",
"given",
"table",
"into",
"a",
"string",
".",
"Output",
"depends",
"on",
"the",
"subclass"
] | ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40 | https://github.com/fuelphp/common/blob/ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40/src/Table/Render.php#L31-L41 |
229,411 | fuelphp/common | src/Table/Render.php | Render.buildRows | protected function buildRows(Table $table)
{
//Generate each row
$rows = array();
foreach ( $table->getRows() as $row )
{
//Build the cells for each row
$cells = array();
foreach ( $row as $cell )
{
$cells[] = $this->cell($cell);
}
$rows[] = $this->row($row, $cells);
}
return $row... | php | protected function buildRows(Table $table)
{
//Generate each row
$rows = array();
foreach ( $table->getRows() as $row )
{
//Build the cells for each row
$cells = array();
foreach ( $row as $cell )
{
$cells[] = $this->cell($cell);
}
$rows[] = $this->row($row, $cells);
}
return $row... | [
"protected",
"function",
"buildRows",
"(",
"Table",
"$",
"table",
")",
"{",
"//Generate each row",
"$",
"rows",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"table",
"->",
"getRows",
"(",
")",
"as",
"$",
"row",
")",
"{",
"//Build the cells for each ro... | Renders the main body rows for the table
@param Table $table
@return array | [
"Renders",
"the",
"main",
"body",
"rows",
"for",
"the",
"table"
] | ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40 | https://github.com/fuelphp/common/blob/ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40/src/Table/Render.php#L50-L69 |
229,412 | fuelphp/common | src/Table/Render.php | Render.buildHeaders | protected function buildHeaders(Table $table)
{
//Generate each row
$rows = array();
foreach ( $table->getHeaderRows() as $row )
{
//Build the cells for each row
$cells = array();
foreach ( $row as $cell )
{
$cells[] = $this->headerCell($cell);
}
$rows[] = $this->headerRow($row, $cells... | php | protected function buildHeaders(Table $table)
{
//Generate each row
$rows = array();
foreach ( $table->getHeaderRows() as $row )
{
//Build the cells for each row
$cells = array();
foreach ( $row as $cell )
{
$cells[] = $this->headerCell($cell);
}
$rows[] = $this->headerRow($row, $cells... | [
"protected",
"function",
"buildHeaders",
"(",
"Table",
"$",
"table",
")",
"{",
"//Generate each row",
"$",
"rows",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"table",
"->",
"getHeaderRows",
"(",
")",
"as",
"$",
"row",
")",
"{",
"//Build the cells fo... | Renders the header rows for the table
@param Table $table
@return array | [
"Renders",
"the",
"header",
"rows",
"for",
"the",
"table"
] | ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40 | https://github.com/fuelphp/common/blob/ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40/src/Table/Render.php#L78-L97 |
229,413 | fuelphp/common | src/Table/Render.php | Render.buildFooters | protected function buildFooters(Table $table)
{
//Generate each row
$rows = array();
foreach ( $table->getFooterRows() as $row )
{
//Build the cells for each row
$cells = array();
foreach ( $row as $cell )
{
$cells[] = $this->footerCell($cell);
}
$rows[] = $this->footerRow($row, $cells... | php | protected function buildFooters(Table $table)
{
//Generate each row
$rows = array();
foreach ( $table->getFooterRows() as $row )
{
//Build the cells for each row
$cells = array();
foreach ( $row as $cell )
{
$cells[] = $this->footerCell($cell);
}
$rows[] = $this->footerRow($row, $cells... | [
"protected",
"function",
"buildFooters",
"(",
"Table",
"$",
"table",
")",
"{",
"//Generate each row",
"$",
"rows",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"table",
"->",
"getFooterRows",
"(",
")",
"as",
"$",
"row",
")",
"{",
"//Build the cells fo... | Renders the footer rows for the table
@param Table $table
@return array | [
"Renders",
"the",
"footer",
"rows",
"for",
"the",
"table"
] | ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40 | https://github.com/fuelphp/common/blob/ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40/src/Table/Render.php#L106-L125 |
229,414 | odan/database | src/Database/FunctionBuilder.php | FunctionBuilder.sum | public function sum(string $field): FunctionExpression
{
$quoter = $this->db->getQuoter();
$expression = sprintf('SUM(%s)', $quoter->quoteName($field));
return new FunctionExpression($expression, $quoter);
} | php | public function sum(string $field): FunctionExpression
{
$quoter = $this->db->getQuoter();
$expression = sprintf('SUM(%s)', $quoter->quoteName($field));
return new FunctionExpression($expression, $quoter);
} | [
"public",
"function",
"sum",
"(",
"string",
"$",
"field",
")",
":",
"FunctionExpression",
"{",
"$",
"quoter",
"=",
"$",
"this",
"->",
"db",
"->",
"getQuoter",
"(",
")",
";",
"$",
"expression",
"=",
"sprintf",
"(",
"'SUM(%s)'",
",",
"$",
"quoter",
"->",... | Calculate a sum. The arguments will be treated as literal values.
@param string $field Field name
@return FunctionExpression Expression | [
"Calculate",
"a",
"sum",
".",
"The",
"arguments",
"will",
"be",
"treated",
"as",
"literal",
"values",
"."
] | e514fb45ab72718a77b34ed2c44906f5159e8278 | https://github.com/odan/database/blob/e514fb45ab72718a77b34ed2c44906f5159e8278/src/Database/FunctionBuilder.php#L36-L42 |
229,415 | odan/database | src/Database/FunctionBuilder.php | FunctionBuilder.call | public function call(string $name, ...$parameters): FunctionExpression
{
$quoter = $this->db->getQuoter();
$list = implode(', ', $quoter->quoteArray($parameters));
$expression = sprintf('%s(%s)', strtoupper($name), $list);
return new FunctionExpression($expression, $quoter);
} | php | public function call(string $name, ...$parameters): FunctionExpression
{
$quoter = $this->db->getQuoter();
$list = implode(', ', $quoter->quoteArray($parameters));
$expression = sprintf('%s(%s)', strtoupper($name), $list);
return new FunctionExpression($expression, $quoter);
} | [
"public",
"function",
"call",
"(",
"string",
"$",
"name",
",",
"...",
"$",
"parameters",
")",
":",
"FunctionExpression",
"{",
"$",
"quoter",
"=",
"$",
"this",
"->",
"db",
"->",
"getQuoter",
"(",
")",
";",
"$",
"list",
"=",
"implode",
"(",
"', '",
","... | Create custom SQL function call.
@param string $name The name of the function
@param mixed ...$parameters The parameters for the function
@return FunctionExpression Expression | [
"Create",
"custom",
"SQL",
"function",
"call",
"."
] | e514fb45ab72718a77b34ed2c44906f5159e8278 | https://github.com/odan/database/blob/e514fb45ab72718a77b34ed2c44906f5159e8278/src/Database/FunctionBuilder.php#L122-L130 |
229,416 | softark/creole | block/HeadlineTrait.php | HeadlineTrait.consumeHeadline | protected function consumeHeadline($lines, $current)
{
$line = trim($lines[$current]);
$level = 1;
while (isset($line[$level]) && $line[$level] === '=' && $level < 6) {
$level++;
}
$block = [
'headline',
// parse headline content. The leading and trailing '='s are removed.
'content' => $this->par... | php | protected function consumeHeadline($lines, $current)
{
$line = trim($lines[$current]);
$level = 1;
while (isset($line[$level]) && $line[$level] === '=' && $level < 6) {
$level++;
}
$block = [
'headline',
// parse headline content. The leading and trailing '='s are removed.
'content' => $this->par... | [
"protected",
"function",
"consumeHeadline",
"(",
"$",
"lines",
",",
"$",
"current",
")",
"{",
"$",
"line",
"=",
"trim",
"(",
"$",
"lines",
"[",
"$",
"current",
"]",
")",
";",
"$",
"level",
"=",
"1",
";",
"while",
"(",
"isset",
"(",
"$",
"line",
"... | Consume lines for a headline | [
"Consume",
"lines",
"for",
"a",
"headline"
] | f56f267e46fa45df1fab01f5d9f1c2bfb0394a9b | https://github.com/softark/creole/blob/f56f267e46fa45df1fab01f5d9f1c2bfb0394a9b/block/HeadlineTrait.php#L31-L45 |
229,417 | odan/database | src/Database/Compression.php | Compression.compress | public function compress($value)
{
if ($value === null || $value === '') {
return $value;
}
return pack('L', strlen($value)) . gzcompress($value);
} | php | public function compress($value)
{
if ($value === null || $value === '') {
return $value;
}
return pack('L', strlen($value)) . gzcompress($value);
} | [
"public",
"function",
"compress",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
"||",
"$",
"value",
"===",
"''",
")",
"{",
"return",
"$",
"value",
";",
"}",
"return",
"pack",
"(",
"'L'",
",",
"strlen",
"(",
"$",
"value",
")... | Compress compatible with MySQL COMPRESS.
@param string|mixed $value data to compress
@return string|null compressed data | [
"Compress",
"compatible",
"with",
"MySQL",
"COMPRESS",
"."
] | e514fb45ab72718a77b34ed2c44906f5159e8278 | https://github.com/odan/database/blob/e514fb45ab72718a77b34ed2c44906f5159e8278/src/Database/Compression.php#L32-L39 |
229,418 | aedart/testing-laravel | src/Traits/ApplicationInitiatorTrait.php | ApplicationInitiatorTrait.startApplication | public function startApplication() : void
{
if ($this->hasApplicationBeenStarted()) {
throw new ApplicationRunningException(sprintf('Application has already been started. Please stop the application, before invoking start!'));
}
$this->refreshApplication();
if (!$this->... | php | public function startApplication() : void
{
if ($this->hasApplicationBeenStarted()) {
throw new ApplicationRunningException(sprintf('Application has already been started. Please stop the application, before invoking start!'));
}
$this->refreshApplication();
if (!$this->... | [
"public",
"function",
"startApplication",
"(",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"hasApplicationBeenStarted",
"(",
")",
")",
"{",
"throw",
"new",
"ApplicationRunningException",
"(",
"sprintf",
"(",
"'Application has already been started. Please stop... | Start the application
@return void
@throws ApplicationRunningException If an application has already been started / initialised and running | [
"Start",
"the",
"application"
] | a17886c66358318a88226fc67cb85c6f7ccc0a99 | https://github.com/aedart/testing-laravel/blob/a17886c66358318a88226fc67cb85c6f7ccc0a99/src/Traits/ApplicationInitiatorTrait.php#L64-L75 |
229,419 | aedart/testing-laravel | src/Traits/ApplicationInitiatorTrait.php | ApplicationInitiatorTrait.stopApplication | public function stopApplication() : void
{
if ($this->hasApplicationBeenStarted()) {
foreach ($this->beforeApplicationDestroyedCallbacks as $callback) {
call_user_func($callback);
}
$this->app->flush();
$this->app = null;
Facade::... | php | public function stopApplication() : void
{
if ($this->hasApplicationBeenStarted()) {
foreach ($this->beforeApplicationDestroyedCallbacks as $callback) {
call_user_func($callback);
}
$this->app->flush();
$this->app = null;
Facade::... | [
"public",
"function",
"stopApplication",
"(",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"hasApplicationBeenStarted",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"beforeApplicationDestroyedCallbacks",
"as",
"$",
"callback",
")",
"{",
"ca... | Stop the application
@return void | [
"Stop",
"the",
"application"
] | a17886c66358318a88226fc67cb85c6f7ccc0a99 | https://github.com/aedart/testing-laravel/blob/a17886c66358318a88226fc67cb85c6f7ccc0a99/src/Traits/ApplicationInitiatorTrait.php#L82-L95 |
229,420 | fecshop/yii2-fec | lib/PHPExcel/PHPExcel/Worksheet.php | PHPExcel_Worksheet.rangeToArray | public function rangeToArray($pRange = 'A1', $nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false) {
// Returnvalue
$returnValue = array();
// Identify the range that we need to extract from the worksheet
list($rangeStart, $rangeEnd) = PHPExcel_Cell... | php | public function rangeToArray($pRange = 'A1', $nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false) {
// Returnvalue
$returnValue = array();
// Identify the range that we need to extract from the worksheet
list($rangeStart, $rangeEnd) = PHPExcel_Cell... | [
"public",
"function",
"rangeToArray",
"(",
"$",
"pRange",
"=",
"'A1'",
",",
"$",
"nullValue",
"=",
"null",
",",
"$",
"calculateFormulas",
"=",
"true",
",",
"$",
"formatData",
"=",
"true",
",",
"$",
"returnCellRef",
"=",
"false",
")",
"{",
"// Returnvalue",... | Create array from a range of cells
@param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
@param mixed $nullValue Value returned in the array entry if a cell doesn't exist
@param boolean $calculateFormulas Should formulas be calculated?
@param boolean $formatData Should formatting be applie... | [
"Create",
"array",
"from",
"a",
"range",
"of",
"cells"
] | fda0e381f931bc503e493bec90185162109018e6 | https://github.com/fecshop/yii2-fec/blob/fda0e381f931bc503e493bec90185162109018e6/lib/PHPExcel/PHPExcel/Worksheet.php#L2429-L2486 |
229,421 | netgen/NetgenOpenGraphBundle | bundle/Handler/FieldType/Image.php | Image.getFallbackValue | protected function getFallbackValue($tagName, array $params = array())
{
if (!empty($params[2]) && ($request = $this->requestStack->getCurrentRequest()) !== null) {
return $request->getUriForPath('/' . ltrim($params[2], '/'));
}
return '';
} | php | protected function getFallbackValue($tagName, array $params = array())
{
if (!empty($params[2]) && ($request = $this->requestStack->getCurrentRequest()) !== null) {
return $request->getUriForPath('/' . ltrim($params[2], '/'));
}
return '';
} | [
"protected",
"function",
"getFallbackValue",
"(",
"$",
"tagName",
",",
"array",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"params",
"[",
"2",
"]",
")",
"&&",
"(",
"$",
"request",
"=",
"$",
"this",
"->",
"... | Returns fallback value.
@param string $tagName
@param array $params
@return string | [
"Returns",
"fallback",
"value",
"."
] | fcaad267742492cfa4049adbf075343c262c4767 | https://github.com/netgen/NetgenOpenGraphBundle/blob/fcaad267742492cfa4049adbf075343c262c4767/bundle/Handler/FieldType/Image.php#L111-L118 |
229,422 | softark/creole | Creole.php | Creole.isParagraphEnd | protected function isParagraphEnd($line)
{
if (empty($line) ||
ltrim($line) === '' ||
$this->identifyHeadline($line) ||
$this->identifyHr($line) ||
$this->identifyUl($line) ||
$this->identifyOl($line) ||
$this->identifyTable($line) ||
$this->identifyCode($line) ||
$this->identifyRawHtml($line... | php | protected function isParagraphEnd($line)
{
if (empty($line) ||
ltrim($line) === '' ||
$this->identifyHeadline($line) ||
$this->identifyHr($line) ||
$this->identifyUl($line) ||
$this->identifyOl($line) ||
$this->identifyTable($line) ||
$this->identifyCode($line) ||
$this->identifyRawHtml($line... | [
"protected",
"function",
"isParagraphEnd",
"(",
"$",
"line",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"line",
")",
"||",
"ltrim",
"(",
"$",
"line",
")",
"===",
"''",
"||",
"$",
"this",
"->",
"identifyHeadline",
"(",
"$",
"line",
")",
"||",
"$",
"thi... | Checks if the paragraph ends
@param $line
@return bool true if end of paragraph | [
"Checks",
"if",
"the",
"paragraph",
"ends"
] | f56f267e46fa45df1fab01f5d9f1c2bfb0394a9b | https://github.com/softark/creole/blob/f56f267e46fa45df1fab01f5d9f1c2bfb0394a9b/Creole.php#L64-L79 |
229,423 | odan/database | src/Database/SelectQuery.php | SelectQuery.union | public function union(SelectQuery $query): self
{
$this->union[] = ['', $query->build(false)];
return $this;
} | php | public function union(SelectQuery $query): self
{
$this->union[] = ['', $query->build(false)];
return $this;
} | [
"public",
"function",
"union",
"(",
"SelectQuery",
"$",
"query",
")",
":",
"self",
"{",
"$",
"this",
"->",
"union",
"[",
"]",
"=",
"[",
"''",
",",
"$",
"query",
"->",
"build",
"(",
"false",
")",
"]",
";",
"return",
"$",
"this",
";",
"}"
] | UNION is used to combine the result from multiple
SELECT statements into a single result set.
@param SelectQuery $query the query to combine
@return self | [
"UNION",
"is",
"used",
"to",
"combine",
"the",
"result",
"from",
"multiple",
"SELECT",
"statements",
"into",
"a",
"single",
"result",
"set",
"."
] | e514fb45ab72718a77b34ed2c44906f5159e8278 | https://github.com/odan/database/blob/e514fb45ab72718a77b34ed2c44906f5159e8278/src/Database/SelectQuery.php#L174-L179 |
229,424 | odan/database | src/Database/SelectQuery.php | SelectQuery.leftJoinRaw | public function leftJoinRaw(string $table, string $conditions): self
{
$this->join[] = ['left', $table, new RawExp($conditions), null, null, null];
return $this;
} | php | public function leftJoinRaw(string $table, string $conditions): self
{
$this->join[] = ['left', $table, new RawExp($conditions), null, null, null];
return $this;
} | [
"public",
"function",
"leftJoinRaw",
"(",
"string",
"$",
"table",
",",
"string",
"$",
"conditions",
")",
":",
"self",
"{",
"$",
"this",
"->",
"join",
"[",
"]",
"=",
"[",
"'left'",
",",
"$",
"table",
",",
"new",
"RawExp",
"(",
"$",
"conditions",
")",
... | Left join with complex conditions.
@param string $table Table name
@param string $conditions The ON conditions e.g. 'user.id = article.user_id'
@return self | [
"Left",
"join",
"with",
"complex",
"conditions",
"."
] | e514fb45ab72718a77b34ed2c44906f5159e8278 | https://github.com/odan/database/blob/e514fb45ab72718a77b34ed2c44906f5159e8278/src/Database/SelectQuery.php#L283-L288 |
229,425 | odan/database | src/Database/SelectQuery.php | SelectQuery.whereRaw | public function whereRaw(string $condition): self
{
$this->condition->where([new RawExp($condition)]);
return $this;
} | php | public function whereRaw(string $condition): self
{
$this->condition->where([new RawExp($condition)]);
return $this;
} | [
"public",
"function",
"whereRaw",
"(",
"string",
"$",
"condition",
")",
":",
"self",
"{",
"$",
"this",
"->",
"condition",
"->",
"where",
"(",
"[",
"new",
"RawExp",
"(",
"$",
"condition",
")",
"]",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Add a raw AND WHERE condition.
@param string $condition The raw where conditions e.g. 'user.id = article.user_id'
@return self | [
"Add",
"a",
"raw",
"AND",
"WHERE",
"condition",
"."
] | e514fb45ab72718a77b34ed2c44906f5159e8278 | https://github.com/odan/database/blob/e514fb45ab72718a77b34ed2c44906f5159e8278/src/Database/SelectQuery.php#L313-L318 |
229,426 | odan/database | src/Database/SelectQuery.php | SelectQuery.orWhereRaw | public function orWhereRaw(string $condition): self
{
$this->condition->orWhere([new RawExp($condition)]);
return $this;
} | php | public function orWhereRaw(string $condition): self
{
$this->condition->orWhere([new RawExp($condition)]);
return $this;
} | [
"public",
"function",
"orWhereRaw",
"(",
"string",
"$",
"condition",
")",
":",
"self",
"{",
"$",
"this",
"->",
"condition",
"->",
"orWhere",
"(",
"[",
"new",
"RawExp",
"(",
"$",
"condition",
")",
"]",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Add a raw OR WHERE condition.
@param string $condition The raw where conditions e.g. 'user.id = article.user_id'
@return self | [
"Add",
"a",
"raw",
"OR",
"WHERE",
"condition",
"."
] | e514fb45ab72718a77b34ed2c44906f5159e8278 | https://github.com/odan/database/blob/e514fb45ab72718a77b34ed2c44906f5159e8278/src/Database/SelectQuery.php#L343-L348 |
229,427 | odan/database | src/Database/SelectQuery.php | SelectQuery.orHavingRaw | public function orHavingRaw(string $condition): self
{
$this->condition->orHaving([new RawExp($condition)]);
return $this;
} | php | public function orHavingRaw(string $condition): self
{
$this->condition->orHaving([new RawExp($condition)]);
return $this;
} | [
"public",
"function",
"orHavingRaw",
"(",
"string",
"$",
"condition",
")",
":",
"self",
"{",
"$",
"this",
"->",
"condition",
"->",
"orHaving",
"(",
"[",
"new",
"RawExp",
"(",
"$",
"condition",
")",
"]",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Add OR having condition.
@param string $condition The raw HAVING conditions e.g. 'user.id = article.user_id'
@return self | [
"Add",
"OR",
"having",
"condition",
"."
] | e514fb45ab72718a77b34ed2c44906f5159e8278 | https://github.com/odan/database/blob/e514fb45ab72718a77b34ed2c44906f5159e8278/src/Database/SelectQuery.php#L465-L470 |
229,428 | josegonzalez/cakephp-wysiwyg | View/Helper/WysiwygAppHelper.php | WysiwygAppHelper.input | public function input($fieldName, $options = array(), $helperOptions = array()) {
$helperOptions = Set::merge($this->_helperOptions, $helperOptions);
return $this->Form->input($fieldName, $options) . $this->_build($fieldName, $helperOptions);
} | php | public function input($fieldName, $options = array(), $helperOptions = array()) {
$helperOptions = Set::merge($this->_helperOptions, $helperOptions);
return $this->Form->input($fieldName, $options) . $this->_build($fieldName, $helperOptions);
} | [
"public",
"function",
"input",
"(",
"$",
"fieldName",
",",
"$",
"options",
"=",
"array",
"(",
")",
",",
"$",
"helperOptions",
"=",
"array",
"(",
")",
")",
"{",
"$",
"helperOptions",
"=",
"Set",
"::",
"merge",
"(",
"$",
"this",
"->",
"_helperOptions",
... | Creates an fckeditor input field
@param string $fieldName This should be "Modelname.fieldname"
@param array $options Each type of input takes different options.
@param array $helperOptions Each type of wysiwyg helper takes different options.
@return string An HTML input element with Wysiwyg Js | [
"Creates",
"an",
"fckeditor",
"input",
"field"
] | c4909d29e8942797fa360946507768066a47adb0 | https://github.com/josegonzalez/cakephp-wysiwyg/blob/c4909d29e8942797fa360946507768066a47adb0/View/Helper/WysiwygAppHelper.php#L81-L84 |
229,429 | josegonzalez/cakephp-wysiwyg | View/Helper/WysiwygAppHelper.php | WysiwygAppHelper._initialize | protected function _initialize($options = array()) {
if ($this->_initialized) {
return;
}
$this->_initialized = true;
if (!empty($options['_css'])) {
foreach ((array)$options['_css'] as $css) {
$this->Html->css($css, null, array('inline' => false));
}
}
if (!empty($options['_cssText'])) {
... | php | protected function _initialize($options = array()) {
if ($this->_initialized) {
return;
}
$this->_initialized = true;
if (!empty($options['_css'])) {
foreach ((array)$options['_css'] as $css) {
$this->Html->css($css, null, array('inline' => false));
}
}
if (!empty($options['_cssText'])) {
... | [
"protected",
"function",
"_initialize",
"(",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_initialized",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"_initialized",
"=",
"true",
";",
"if",
"(",
"!",
"empty",
... | Initialize the helper css and js for a given input field
@param array $options array of css files, javascript files, and css text to enqueue
@return void | [
"Initialize",
"the",
"helper",
"css",
"and",
"js",
"for",
"a",
"given",
"input",
"field"
] | c4909d29e8942797fa360946507768066a47adb0 | https://github.com/josegonzalez/cakephp-wysiwyg/blob/c4909d29e8942797fa360946507768066a47adb0/View/Helper/WysiwygAppHelper.php#L105-L133 |
229,430 | josegonzalez/cakephp-wysiwyg | View/Helper/WysiwygAppHelper.php | WysiwygAppHelper._initializationOptions | protected function _initializationOptions($options = array()) {
$defaults = array(
'_buffer' => true,
'_css' => true,
'_cssText' => true,
'_scripts' => true,
'_scriptBlock' => false,
'_editor' => true,
'_inline' => true,
);
return json_encode(array_diff_key(array_merge(
$defaults,
(arr... | php | protected function _initializationOptions($options = array()) {
$defaults = array(
'_buffer' => true,
'_css' => true,
'_cssText' => true,
'_scripts' => true,
'_scriptBlock' => false,
'_editor' => true,
'_inline' => true,
);
return json_encode(array_diff_key(array_merge(
$defaults,
(arr... | [
"protected",
"function",
"_initializationOptions",
"(",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"defaults",
"=",
"array",
"(",
"'_buffer'",
"=>",
"true",
",",
"'_css'",
"=>",
"true",
",",
"'_cssText'",
"=>",
"true",
",",
"'_scripts'",
"=>",
... | Returns a json string containing helper settings
@param array $options array of Wysiwyg editor settings
@return string json_encoded array of options | [
"Returns",
"a",
"json",
"string",
"containing",
"helper",
"settings"
] | c4909d29e8942797fa360946507768066a47adb0 | https://github.com/josegonzalez/cakephp-wysiwyg/blob/c4909d29e8942797fa360946507768066a47adb0/View/Helper/WysiwygAppHelper.php#L141-L156 |
229,431 | netgen/NetgenOpenGraphBundle | bundle/MetaTag/Renderer.php | Renderer.render | public function render(array $metaTags = array())
{
$html = '';
foreach ($metaTags as $metaTag) {
if (!$metaTag instanceof Item) {
throw new InvalidArgumentException('metaTags', 'Cannot render meta tag, not an instance of \Netgen\Bundle\OpenGraphBundle\MetaTag\Item');
... | php | public function render(array $metaTags = array())
{
$html = '';
foreach ($metaTags as $metaTag) {
if (!$metaTag instanceof Item) {
throw new InvalidArgumentException('metaTags', 'Cannot render meta tag, not an instance of \Netgen\Bundle\OpenGraphBundle\MetaTag\Item');
... | [
"public",
"function",
"render",
"(",
"array",
"$",
"metaTags",
"=",
"array",
"(",
")",
")",
"{",
"$",
"html",
"=",
"''",
";",
"foreach",
"(",
"$",
"metaTags",
"as",
"$",
"metaTag",
")",
"{",
"if",
"(",
"!",
"$",
"metaTag",
"instanceof",
"Item",
")"... | Renders provided meta tags.
@param \Netgen\Bundle\OpenGraphBundle\MetaTag\Item[]
@throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException If meta tag is not an instance of
\Netgen\Bundle\OpenGraphBundle\MetaTag\Item
@return string | [
"Renders",
"provided",
"meta",
"tags",
"."
] | fcaad267742492cfa4049adbf075343c262c4767 | https://github.com/netgen/NetgenOpenGraphBundle/blob/fcaad267742492cfa4049adbf075343c262c4767/bundle/MetaTag/Renderer.php#L19-L37 |
229,432 | fuelphp/common | src/Inflector.php | Inflector.humanize | public function humanize($str, $sep = '_', $lowercase = true)
{
// Allow dash, otherwise default to underscore
$sep = $sep != '-' ? '_' : $sep;
if ($lowercase === true)
{
$str = $this->str->ucfirst($str);
}
return str_replace($sep, " ", strval($str));
} | php | public function humanize($str, $sep = '_', $lowercase = true)
{
// Allow dash, otherwise default to underscore
$sep = $sep != '-' ? '_' : $sep;
if ($lowercase === true)
{
$str = $this->str->ucfirst($str);
}
return str_replace($sep, " ", strval($str));
} | [
"public",
"function",
"humanize",
"(",
"$",
"str",
",",
"$",
"sep",
"=",
"'_'",
",",
"$",
"lowercase",
"=",
"true",
")",
"{",
"// Allow dash, otherwise default to underscore",
"$",
"sep",
"=",
"$",
"sep",
"!=",
"'-'",
"?",
"'_'",
":",
"$",
"sep",
";",
... | Turns an underscore or dash separated word and turns it into a human looking string.
@param string the word
@param string the separator (either _ or -)
@param bool lowercare string and upper case first
@return string the human version of given string | [
"Turns",
"an",
"underscore",
"or",
"dash",
"separated",
"word",
"and",
"turns",
"it",
"into",
"a",
"human",
"looking",
"string",
"."
] | ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40 | https://github.com/fuelphp/common/blob/ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40/src/Inflector.php#L334-L345 |
229,433 | fuelphp/common | src/Inflector.php | Inflector.classify | public function classify($name, $force_singular = true)
{
$class = ($force_singular) ? $this->singularize($name) : $name;
return $this->wordsToUpper($class);
} | php | public function classify($name, $force_singular = true)
{
$class = ($force_singular) ? $this->singularize($name) : $name;
return $this->wordsToUpper($class);
} | [
"public",
"function",
"classify",
"(",
"$",
"name",
",",
"$",
"force_singular",
"=",
"true",
")",
"{",
"$",
"class",
"=",
"(",
"$",
"force_singular",
")",
"?",
"$",
"this",
"->",
"singularize",
"(",
"$",
"name",
")",
":",
"$",
"name",
";",
"return",
... | Takes a table name and creates the class name.
@param string the table name
@param bool whether to singularize the table name or not
@return string the class name | [
"Takes",
"a",
"table",
"name",
"and",
"creates",
"the",
"class",
"name",
"."
] | ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40 | https://github.com/fuelphp/common/blob/ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40/src/Inflector.php#L426-L430 |
229,434 | fuelphp/common | src/Inflector.php | Inflector.isCountable | public function isCountable($word)
{
return ! (\in_array($this->str->lower(\strval($word)), $this->uncountableWords));
} | php | public function isCountable($word)
{
return ! (\in_array($this->str->lower(\strval($word)), $this->uncountableWords));
} | [
"public",
"function",
"isCountable",
"(",
"$",
"word",
")",
"{",
"return",
"!",
"(",
"\\",
"in_array",
"(",
"$",
"this",
"->",
"str",
"->",
"lower",
"(",
"\\",
"strval",
"(",
"$",
"word",
")",
")",
",",
"$",
"this",
"->",
"uncountableWords",
")",
"... | Checks if the given word has a plural version.
@param string the word to check
@return bool if the word is countable | [
"Checks",
"if",
"the",
"given",
"word",
"has",
"a",
"plural",
"version",
"."
] | ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40 | https://github.com/fuelphp/common/blob/ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40/src/Inflector.php#L455-L458 |
229,435 | joomla-framework/datetime | src/Getter/DateTimeGetter.php | DateTimeGetter.get | public function get(DateTime $datetime, $name)
{
$value = null;
switch ($name)
{
case 'daysinmonth':
$value = $datetime->format('t');
break;
case 'dayofweek':
$value = $datetime->format('N');
break;
case 'dayofyear':
$value = $datetime->format('z');
break;
case 'isleapyear... | php | public function get(DateTime $datetime, $name)
{
$value = null;
switch ($name)
{
case 'daysinmonth':
$value = $datetime->format('t');
break;
case 'dayofweek':
$value = $datetime->format('N');
break;
case 'dayofyear':
$value = $datetime->format('z');
break;
case 'isleapyear... | [
"public",
"function",
"get",
"(",
"DateTime",
"$",
"datetime",
",",
"$",
"name",
")",
"{",
"$",
"value",
"=",
"null",
";",
"switch",
"(",
"$",
"name",
")",
"{",
"case",
"'daysinmonth'",
":",
"$",
"value",
"=",
"$",
"datetime",
"->",
"format",
"(",
... | Return a value of the property.
@param DateTime $datetime The DateTime object.
@param string $name The name of the property.
@return string
@since 2.0.0 | [
"Return",
"a",
"value",
"of",
"the",
"property",
"."
] | 732fb60f054fa6aceaef93ff9a12d939d2a4797c | https://github.com/joomla-framework/datetime/blob/732fb60f054fa6aceaef93ff9a12d939d2a4797c/src/Getter/DateTimeGetter.php#L30-L90 |
229,436 | fuelphp/common | src/Table/Render/SimpleTable.php | SimpleTable.container | protected function container(Table $table, array $rows, array $headers, array $footers)
{
$html = '<table';
$this->addAttributes($html, $table->getAttributes());
$html .= '><thead>';
$html .= implode("\n", $headers);
$html .= '</thead><tbody>';
$html .= implode("\n", $rows);
$html .= '</tbody><tfoot>';
... | php | protected function container(Table $table, array $rows, array $headers, array $footers)
{
$html = '<table';
$this->addAttributes($html, $table->getAttributes());
$html .= '><thead>';
$html .= implode("\n", $headers);
$html .= '</thead><tbody>';
$html .= implode("\n", $rows);
$html .= '</tbody><tfoot>';
... | [
"protected",
"function",
"container",
"(",
"Table",
"$",
"table",
",",
"array",
"$",
"rows",
",",
"array",
"$",
"headers",
",",
"array",
"$",
"footers",
")",
"{",
"$",
"html",
"=",
"'<table'",
";",
"$",
"this",
"->",
"addAttributes",
"(",
"$",
"html",
... | Generates a "correct" table tag to contain the rendered rows
@param Table $table
@param array $rows
@param array $headers
@param array $footers
@return string | [
"Generates",
"a",
"correct",
"table",
"tag",
"to",
"contain",
"the",
"rendered",
"rows"
] | ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40 | https://github.com/fuelphp/common/blob/ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40/src/Table/Render/SimpleTable.php#L39-L52 |
229,437 | fuelphp/common | src/Table/Render/SimpleTable.php | SimpleTable.row | protected function row(Row $row, array $cells)
{
$html = '<tr';
$this->addAttributes($html, $row->getAttributes());
$html .= '>' . implode('', $cells) . '</tr>';
return $html;
} | php | protected function row(Row $row, array $cells)
{
$html = '<tr';
$this->addAttributes($html, $row->getAttributes());
$html .= '>' . implode('', $cells) . '</tr>';
return $html;
} | [
"protected",
"function",
"row",
"(",
"Row",
"$",
"row",
",",
"array",
"$",
"cells",
")",
"{",
"$",
"html",
"=",
"'<tr'",
";",
"$",
"this",
"->",
"addAttributes",
"(",
"$",
"html",
",",
"$",
"row",
"->",
"getAttributes",
"(",
")",
")",
";",
"$",
"... | Generates a tr with the given rendered cells
@param Row $row
@param array $cells
@return string | [
"Generates",
"a",
"tr",
"with",
"the",
"given",
"rendered",
"cells"
] | ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40 | https://github.com/fuelphp/common/blob/ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40/src/Table/Render/SimpleTable.php#L62-L69 |
229,438 | fuelphp/common | src/Table/Render/SimpleTable.php | SimpleTable.cell | protected function cell(Cell $cell)
{
$html = '<td';
$this->addAttributes($html, $cell->getAttributes());
$html .= '>' . $cell->getContent() . '</td>';
return $html;
} | php | protected function cell(Cell $cell)
{
$html = '<td';
$this->addAttributes($html, $cell->getAttributes());
$html .= '>' . $cell->getContent() . '</td>';
return $html;
} | [
"protected",
"function",
"cell",
"(",
"Cell",
"$",
"cell",
")",
"{",
"$",
"html",
"=",
"'<td'",
";",
"$",
"this",
"->",
"addAttributes",
"(",
"$",
"html",
",",
"$",
"cell",
"->",
"getAttributes",
"(",
")",
")",
";",
"$",
"html",
".=",
"'>'",
".",
... | Creates a td tag using the given Cell
@param Cell $cell
@return string | [
"Creates",
"a",
"td",
"tag",
"using",
"the",
"given",
"Cell"
] | ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40 | https://github.com/fuelphp/common/blob/ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40/src/Table/Render/SimpleTable.php#L78-L85 |
229,439 | fuelphp/common | src/Table/Render/SimpleTable.php | SimpleTable.addAttributes | protected function addAttributes(&$html, array $attributes)
{
if ( count($attributes) > 0 )
{
$attributes = Html::arrayToAttributes($attributes);
$html .= ' ' . $attributes;
}
} | php | protected function addAttributes(&$html, array $attributes)
{
if ( count($attributes) > 0 )
{
$attributes = Html::arrayToAttributes($attributes);
$html .= ' ' . $attributes;
}
} | [
"protected",
"function",
"addAttributes",
"(",
"&",
"$",
"html",
",",
"array",
"$",
"attributes",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"attributes",
")",
">",
"0",
")",
"{",
"$",
"attributes",
"=",
"Html",
"::",
"arrayToAttributes",
"(",
"$",
"attri... | Helper function to convert an array into a list of attributes and append
them to a string
@param string $html
@param array $attributes | [
"Helper",
"function",
"to",
"convert",
"an",
"array",
"into",
"a",
"list",
"of",
"attributes",
"and",
"append",
"them",
"to",
"a",
"string"
] | ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40 | https://github.com/fuelphp/common/blob/ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40/src/Table/Render/SimpleTable.php#L94-L102 |
229,440 | joomla-framework/datetime | src/DateInterval.php | DateInterval.add | public function add(DateInterval $interval)
{
$years = $this->y + $interval->y;
$months = $this->m + $interval->m;
$days = $this->d + $interval->d;
$hours = $this->h + $interval->h;
$minutes = $this->i + $interval->i;
$seconds = $this->s + $interval->s;
$spec = sprintf('P%sY%sM%sDT%sH%sM%sS', $y... | php | public function add(DateInterval $interval)
{
$years = $this->y + $interval->y;
$months = $this->m + $interval->m;
$days = $this->d + $interval->d;
$hours = $this->h + $interval->h;
$minutes = $this->i + $interval->i;
$seconds = $this->s + $interval->s;
$spec = sprintf('P%sY%sM%sDT%sH%sM%sS', $y... | [
"public",
"function",
"add",
"(",
"DateInterval",
"$",
"interval",
")",
"{",
"$",
"years",
"=",
"$",
"this",
"->",
"y",
"+",
"$",
"interval",
"->",
"y",
";",
"$",
"months",
"=",
"$",
"this",
"->",
"m",
"+",
"$",
"interval",
"->",
"m",
";",
"$",
... | Creates a DateInterval object by adding another interval into it.
Uses absolute values for addition process.
@param DateInterval $interval The interval to be added.
@return DateInterval
@since 2.0.0 | [
"Creates",
"a",
"DateInterval",
"object",
"by",
"adding",
"another",
"interval",
"into",
"it",
".",
"Uses",
"absolute",
"values",
"for",
"addition",
"process",
"."
] | 732fb60f054fa6aceaef93ff9a12d939d2a4797c | https://github.com/joomla-framework/datetime/blob/732fb60f054fa6aceaef93ff9a12d939d2a4797c/src/DateInterval.php#L70-L82 |
229,441 | joomla-framework/datetime | src/DateInterval.php | DateInterval.equals | public function equals(DateInterval $interval)
{
$years = $this->y == $interval->y;
$months = $this->m == $interval->m;
$days = $this->d == $interval->d;
$hours = $this->h == $interval->h;
$minutes = $this->i == $interval->i;
$seconds = $this->s == $interval->s;
$invert = $this->invert == $inter... | php | public function equals(DateInterval $interval)
{
$years = $this->y == $interval->y;
$months = $this->m == $interval->m;
$days = $this->d == $interval->d;
$hours = $this->h == $interval->h;
$minutes = $this->i == $interval->i;
$seconds = $this->s == $interval->s;
$invert = $this->invert == $inter... | [
"public",
"function",
"equals",
"(",
"DateInterval",
"$",
"interval",
")",
"{",
"$",
"years",
"=",
"$",
"this",
"->",
"y",
"==",
"$",
"interval",
"->",
"y",
";",
"$",
"months",
"=",
"$",
"this",
"->",
"m",
"==",
"$",
"interval",
"->",
"m",
";",
"... | Checks if the current interval is equals to the interval given as parameter.
@param DateInterval $interval The interval to compare.
@return boolean
@since 2.0.0 | [
"Checks",
"if",
"the",
"current",
"interval",
"is",
"equals",
"to",
"the",
"interval",
"given",
"as",
"parameter",
"."
] | 732fb60f054fa6aceaef93ff9a12d939d2a4797c | https://github.com/joomla-framework/datetime/blob/732fb60f054fa6aceaef93ff9a12d939d2a4797c/src/DateInterval.php#L93-L104 |
229,442 | joomla-framework/datetime | src/DateInterval.php | DateInterval.invert | public function invert()
{
$interval = $this->copy($this->interval);
$interval->invert = $interval->invert ? 0 : 1;
return new DateInterval($interval);
} | php | public function invert()
{
$interval = $this->copy($this->interval);
$interval->invert = $interval->invert ? 0 : 1;
return new DateInterval($interval);
} | [
"public",
"function",
"invert",
"(",
")",
"{",
"$",
"interval",
"=",
"$",
"this",
"->",
"copy",
"(",
"$",
"this",
"->",
"interval",
")",
";",
"$",
"interval",
"->",
"invert",
"=",
"$",
"interval",
"->",
"invert",
"?",
"0",
":",
"1",
";",
"return",
... | Creates a DateInterval object by inverting the value of the current one.
@return DateInterval
@since 2.0.0 | [
"Creates",
"a",
"DateInterval",
"object",
"by",
"inverting",
"the",
"value",
"of",
"the",
"current",
"one",
"."
] | 732fb60f054fa6aceaef93ff9a12d939d2a4797c | https://github.com/joomla-framework/datetime/blob/732fb60f054fa6aceaef93ff9a12d939d2a4797c/src/DateInterval.php#L113-L119 |
229,443 | joomla-framework/datetime | src/DateInterval.php | DateInterval.copy | private function copy(\DateInterval $interval)
{
$copy = new \DateInterval($interval->format('P%yY%mM%dDT%hH%iM%sS'));
$copy->invert = $interval->invert;
return $copy;
} | php | private function copy(\DateInterval $interval)
{
$copy = new \DateInterval($interval->format('P%yY%mM%dDT%hH%iM%sS'));
$copy->invert = $interval->invert;
return $copy;
} | [
"private",
"function",
"copy",
"(",
"\\",
"DateInterval",
"$",
"interval",
")",
"{",
"$",
"copy",
"=",
"new",
"\\",
"DateInterval",
"(",
"$",
"interval",
"->",
"format",
"(",
"'P%yY%mM%dDT%hH%iM%sS'",
")",
")",
";",
"$",
"copy",
"->",
"invert",
"=",
"$",... | Creates a copy of PHP DateInterval object.
@param \DateInterval $interval The object to copy.
@return \DateInterval
@since 2.0.0 | [
"Creates",
"a",
"copy",
"of",
"PHP",
"DateInterval",
"object",
"."
] | 732fb60f054fa6aceaef93ff9a12d939d2a4797c | https://github.com/joomla-framework/datetime/blob/732fb60f054fa6aceaef93ff9a12d939d2a4797c/src/DateInterval.php#L170-L176 |
229,444 | thelia-modules/Paybox | EventListener/SendConfirmationEmail.php | SendConfirmationEmail.updateOrderStatus | public function updateOrderStatus(OrderEvent $event)
{
$paybox = new Paybox();
if ($event->getOrder()->isPaid() && $paybox->isPaymentModuleFor($event->getOrder())) {
$contact_email = ConfigQuery::read('store_email', false);
Tlog::getInstance()->debug(
"Order... | php | public function updateOrderStatus(OrderEvent $event)
{
$paybox = new Paybox();
if ($event->getOrder()->isPaid() && $paybox->isPaymentModuleFor($event->getOrder())) {
$contact_email = ConfigQuery::read('store_email', false);
Tlog::getInstance()->debug(
"Order... | [
"public",
"function",
"updateOrderStatus",
"(",
"OrderEvent",
"$",
"event",
")",
"{",
"$",
"paybox",
"=",
"new",
"Paybox",
"(",
")",
";",
"if",
"(",
"$",
"event",
"->",
"getOrder",
"(",
")",
"->",
"isPaid",
"(",
")",
"&&",
"$",
"paybox",
"->",
"isPay... | Checks if we are the payment module for the order, and if the order is paid,
then send a confirmation email to the customer.
@param OrderEvent $event
@throws \Exception | [
"Checks",
"if",
"we",
"are",
"the",
"payment",
"module",
"for",
"the",
"order",
"and",
"if",
"the",
"order",
"is",
"paid",
"then",
"send",
"a",
"confirmation",
"email",
"to",
"the",
"customer",
"."
] | 08b9f4478ecbdb234fc373d6540010af34d2d87c | https://github.com/thelia-modules/Paybox/blob/08b9f4478ecbdb234fc373d6540010af34d2d87c/EventListener/SendConfirmationEmail.php#L61-L96 |
229,445 | thelia-modules/Paybox | EventListener/SendConfirmationEmail.php | SendConfirmationEmail.checkSendOrderConfirmationMessageToCustomer | public function checkSendOrderConfirmationMessageToCustomer(OrderEvent $event)
{
if (Paybox::getConfigValue('send_confirmation_email_on_successful_payment', false)) {
$paybox = new Paybox();
if ($paybox->isPaymentModuleFor($event->getOrder())) {
if (!$event->getOrder... | php | public function checkSendOrderConfirmationMessageToCustomer(OrderEvent $event)
{
if (Paybox::getConfigValue('send_confirmation_email_on_successful_payment', false)) {
$paybox = new Paybox();
if ($paybox->isPaymentModuleFor($event->getOrder())) {
if (!$event->getOrder... | [
"public",
"function",
"checkSendOrderConfirmationMessageToCustomer",
"(",
"OrderEvent",
"$",
"event",
")",
"{",
"if",
"(",
"Paybox",
"::",
"getConfigValue",
"(",
"'send_confirmation_email_on_successful_payment'",
",",
"false",
")",
")",
"{",
"$",
"paybox",
"=",
"new",... | Send the confirmation message only if the order is paid.
@param OrderEvent $event | [
"Send",
"the",
"confirmation",
"message",
"only",
"if",
"the",
"order",
"is",
"paid",
"."
] | 08b9f4478ecbdb234fc373d6540010af34d2d87c | https://github.com/thelia-modules/Paybox/blob/08b9f4478ecbdb234fc373d6540010af34d2d87c/EventListener/SendConfirmationEmail.php#L103-L114 |
229,446 | michaeljs1990/jmem | src/Jmem/JsonLoader.php | JsonLoader.setFile | public function setFile($file) {
$f = $file;
if (preg_match('#^compress\.(.*)://(.*)#', $file, $r)) {
$f = $r[2];
}
if(is_readable($f)) {
$open = fopen($file, "rb");
$this->file = $open;
} else {
$this->handleError("{$file} is not r... | php | public function setFile($file) {
$f = $file;
if (preg_match('#^compress\.(.*)://(.*)#', $file, $r)) {
$f = $r[2];
}
if(is_readable($f)) {
$open = fopen($file, "rb");
$this->file = $open;
} else {
$this->handleError("{$file} is not r... | [
"public",
"function",
"setFile",
"(",
"$",
"file",
")",
"{",
"$",
"f",
"=",
"$",
"file",
";",
"if",
"(",
"preg_match",
"(",
"'#^compress\\.(.*)://(.*)#'",
",",
"$",
"file",
",",
"$",
"r",
")",
")",
"{",
"$",
"f",
"=",
"$",
"r",
"[",
"2",
"]",
"... | Set the file and open up a steam. If the file
cannot be opened for reading throw an error.
@param $file
@throws \Exception | [
"Set",
"the",
"file",
"and",
"open",
"up",
"a",
"steam",
".",
"If",
"the",
"file",
"cannot",
"be",
"opened",
"for",
"reading",
"throw",
"an",
"error",
"."
] | 3252fa2cccc90e564cf7295abf8625e07b52f908 | https://github.com/michaeljs1990/jmem/blob/3252fa2cccc90e564cf7295abf8625e07b52f908/src/Jmem/JsonLoader.php#L40-L52 |
229,447 | netgen/NetgenOpenGraphBundle | bundle/Handler/FieldType/Handler.php | Handler.validateField | protected function validateField($fieldIdentifier)
{
$field = $this->translationHelper->getTranslatedField($this->content, $fieldIdentifier);
if (!$field instanceof Field) {
throw new InvalidArgumentException('$params[0]', 'Field \'' . $fieldIdentifier . '\' does not exist in content.');... | php | protected function validateField($fieldIdentifier)
{
$field = $this->translationHelper->getTranslatedField($this->content, $fieldIdentifier);
if (!$field instanceof Field) {
throw new InvalidArgumentException('$params[0]', 'Field \'' . $fieldIdentifier . '\' does not exist in content.');... | [
"protected",
"function",
"validateField",
"(",
"$",
"fieldIdentifier",
")",
"{",
"$",
"field",
"=",
"$",
"this",
"->",
"translationHelper",
"->",
"getTranslatedField",
"(",
"$",
"this",
"->",
"content",
",",
"$",
"fieldIdentifier",
")",
";",
"if",
"(",
"!",
... | Validates field by field identifier.
@param string $fieldIdentifier
@throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException If field does not exist, or the handler does not support it
@returns \eZ\Publish\API\Repository\Values\Content\Field | [
"Validates",
"field",
"by",
"field",
"identifier",
"."
] | fcaad267742492cfa4049adbf075343c262c4767 | https://github.com/netgen/NetgenOpenGraphBundle/blob/fcaad267742492cfa4049adbf075343c262c4767/bundle/Handler/FieldType/Handler.php#L124-L139 |
229,448 | milesj/utility | View/Helper/DecodaHelper.php | DecodaHelper.parse | public function parse($string, array $whitelist = array(), $wrap = true) {
$parsed = $this->getDecoda()->reset($string)->whitelist($whitelist)->parse();
if ($wrap) {
return $this->Html->div('decoda', $parsed);
}
return $parsed;
} | php | public function parse($string, array $whitelist = array(), $wrap = true) {
$parsed = $this->getDecoda()->reset($string)->whitelist($whitelist)->parse();
if ($wrap) {
return $this->Html->div('decoda', $parsed);
}
return $parsed;
} | [
"public",
"function",
"parse",
"(",
"$",
"string",
",",
"array",
"$",
"whitelist",
"=",
"array",
"(",
")",
",",
"$",
"wrap",
"=",
"true",
")",
"{",
"$",
"parsed",
"=",
"$",
"this",
"->",
"getDecoda",
"(",
")",
"->",
"reset",
"(",
"$",
"string",
"... | Reset the Decoda instance, apply any whitelisted tags and executes the parsing process.
@param string $string
@param array $whitelist
@param bool $wrap
@return string | [
"Reset",
"the",
"Decoda",
"instance",
"apply",
"any",
"whitelisted",
"tags",
"and",
"executes",
"the",
"parsing",
"process",
"."
] | 146318ff0a882917defab7f4918b0d198eb5a3c0 | https://github.com/milesj/utility/blob/146318ff0a882917defab7f4918b0d198eb5a3c0/View/Helper/DecodaHelper.php#L125-L133 |
229,449 | milesj/utility | View/Helper/DecodaHelper.php | DecodaHelper.strip | public function strip($string, $html = false) {
return $this->getDecoda()->reset($string)->strip($html);
} | php | public function strip($string, $html = false) {
return $this->getDecoda()->reset($string)->strip($html);
} | [
"public",
"function",
"strip",
"(",
"$",
"string",
",",
"$",
"html",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"getDecoda",
"(",
")",
"->",
"reset",
"(",
"$",
"string",
")",
"->",
"strip",
"(",
"$",
"html",
")",
";",
"}"
] | Reset the Decoda instance and strip out any Decoda tags and HTML.
@param string $string
@param bool $html
@return string | [
"Reset",
"the",
"Decoda",
"instance",
"and",
"strip",
"out",
"any",
"Decoda",
"tags",
"and",
"HTML",
"."
] | 146318ff0a882917defab7f4918b0d198eb5a3c0 | https://github.com/milesj/utility/blob/146318ff0a882917defab7f4918b0d198eb5a3c0/View/Helper/DecodaHelper.php#L142-L144 |
229,450 | medz/oss-stream-wrapper | src/AliyunOssStream.php | AliyunOssStream._getOssClient | protected function _getOssClient($path)
{
if ($this->_oss === null) {
$url = explode(':', $path);
if (empty($url)) {
throw new Exception("Unable to parse URL $path");
}
$this->_oss = AliyunOSS::getWrapperClient($url[0]);
if (!$th... | php | protected function _getOssClient($path)
{
if ($this->_oss === null) {
$url = explode(':', $path);
if (empty($url)) {
throw new Exception("Unable to parse URL $path");
}
$this->_oss = AliyunOSS::getWrapperClient($url[0]);
if (!$th... | [
"protected",
"function",
"_getOssClient",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_oss",
"===",
"null",
")",
"{",
"$",
"url",
"=",
"explode",
"(",
"':'",
",",
"$",
"path",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"url",
")",
"... | Retrieve client for this stream type.
@param string $path
@return oss
@author Seven Du <lovevipdsw@outlook.com>
@homepage http://medz.cn | [
"Retrieve",
"client",
"for",
"this",
"stream",
"type",
"."
] | 0630ed71351c6b804a815cff553fd0f57509ab54 | https://github.com/medz/oss-stream-wrapper/blob/0630ed71351c6b804a815cff553fd0f57509ab54/src/AliyunOssStream.php#L55-L72 |
229,451 | medz/oss-stream-wrapper | src/AliyunOssStream.php | AliyunOssStream._getNamePart | protected function _getNamePart($path)
{
$url = parse_url($path);
if ($url['host']) {
return !empty($url['path']) ? $url['host'].$url['path'] : $url['host'];
}
return '';
} | php | protected function _getNamePart($path)
{
$url = parse_url($path);
if ($url['host']) {
return !empty($url['path']) ? $url['host'].$url['path'] : $url['host'];
}
return '';
} | [
"protected",
"function",
"_getNamePart",
"(",
"$",
"path",
")",
"{",
"$",
"url",
"=",
"parse_url",
"(",
"$",
"path",
")",
";",
"if",
"(",
"$",
"url",
"[",
"'host'",
"]",
")",
"{",
"return",
"!",
"empty",
"(",
"$",
"url",
"[",
"'path'",
"]",
")",
... | Extract object name from URL.
@param string $path
@return string | [
"Extract",
"object",
"name",
"from",
"URL",
"."
] | 0630ed71351c6b804a815cff553fd0f57509ab54 | https://github.com/medz/oss-stream-wrapper/blob/0630ed71351c6b804a815cff553fd0f57509ab54/src/AliyunOssStream.php#L81-L89 |
229,452 | medz/oss-stream-wrapper | src/AliyunOssStream.php | AliyunOssStream.stream_open | public function stream_open($path, $mode, $options, &$opened_path)
{
$name = $this->_getNamePart($path);
// If we open the file for writing, just return true. Create the object
// on fflush call
if (strpbrk($mode, 'wax')) {
$this->_objectName = $name;
$this->_... | php | public function stream_open($path, $mode, $options, &$opened_path)
{
$name = $this->_getNamePart($path);
// If we open the file for writing, just return true. Create the object
// on fflush call
if (strpbrk($mode, 'wax')) {
$this->_objectName = $name;
$this->_... | [
"public",
"function",
"stream_open",
"(",
"$",
"path",
",",
"$",
"mode",
",",
"$",
"options",
",",
"&",
"$",
"opened_path",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"_getNamePart",
"(",
"$",
"path",
")",
";",
"// If we open the file for writing, just... | Open the stream.
@param string $path
@param string $mode
@param int $options
@param string $opened_path
@return bool | [
"Open",
"the",
"stream",
"."
] | 0630ed71351c6b804a815cff553fd0f57509ab54 | https://github.com/medz/oss-stream-wrapper/blob/0630ed71351c6b804a815cff553fd0f57509ab54/src/AliyunOssStream.php#L101-L134 |
229,453 | medz/oss-stream-wrapper | src/AliyunOssStream.php | AliyunOssStream.stream_close | public function stream_close()
{
$this->_objectName = null;
$this->_objectBuffer = null;
$this->_objectSize = 0;
$this->_position = 0;
$this->_writeBuffer = false;
unset($this->_oss);
} | php | public function stream_close()
{
$this->_objectName = null;
$this->_objectBuffer = null;
$this->_objectSize = 0;
$this->_position = 0;
$this->_writeBuffer = false;
unset($this->_oss);
} | [
"public",
"function",
"stream_close",
"(",
")",
"{",
"$",
"this",
"->",
"_objectName",
"=",
"null",
";",
"$",
"this",
"->",
"_objectBuffer",
"=",
"null",
";",
"$",
"this",
"->",
"_objectSize",
"=",
"0",
";",
"$",
"this",
"->",
"_position",
"=",
"0",
... | Close the stream.
@return void | [
"Close",
"the",
"stream",
"."
] | 0630ed71351c6b804a815cff553fd0f57509ab54 | https://github.com/medz/oss-stream-wrapper/blob/0630ed71351c6b804a815cff553fd0f57509ab54/src/AliyunOssStream.php#L141-L149 |
229,454 | medz/oss-stream-wrapper | src/AliyunOssStream.php | AliyunOssStream.stream_read | public function stream_read($count)
{
if (!$this->_objectName) {
return '';
}
// make sure that count doesn't exceed object size
if ($count + $this->_position > $this->_objectSize) {
$count = $this->_objectSize - $this->_position;
}
$range_st... | php | public function stream_read($count)
{
if (!$this->_objectName) {
return '';
}
// make sure that count doesn't exceed object size
if ($count + $this->_position > $this->_objectSize) {
$count = $this->_objectSize - $this->_position;
}
$range_st... | [
"public",
"function",
"stream_read",
"(",
"$",
"count",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_objectName",
")",
"{",
"return",
"''",
";",
"}",
"// make sure that count doesn't exceed object size",
"if",
"(",
"$",
"count",
"+",
"$",
"this",
"->",
"... | Read from the stream.
http://bugs.php.net/21641 - stream_read() is always passed PHP's
internal read buffer size (8192) no matter what is passed as $count
parameter to fread().
@param int $count
@return string | [
"Read",
"from",
"the",
"stream",
"."
] | 0630ed71351c6b804a815cff553fd0f57509ab54 | https://github.com/medz/oss-stream-wrapper/blob/0630ed71351c6b804a815cff553fd0f57509ab54/src/AliyunOssStream.php#L162-L191 |
229,455 | medz/oss-stream-wrapper | src/AliyunOssStream.php | AliyunOssStream.stream_write | public function stream_write($data)
{
if (!$this->_objectName) {
return 0;
}
$len = strlen($data);
$this->_objectBuffer .= $data;
$this->_objectSize += $len;
// TODO: handle current position for writing!
return $len;
} | php | public function stream_write($data)
{
if (!$this->_objectName) {
return 0;
}
$len = strlen($data);
$this->_objectBuffer .= $data;
$this->_objectSize += $len;
// TODO: handle current position for writing!
return $len;
} | [
"public",
"function",
"stream_write",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_objectName",
")",
"{",
"return",
"0",
";",
"}",
"$",
"len",
"=",
"strlen",
"(",
"$",
"data",
")",
";",
"$",
"this",
"->",
"_objectBuffer",
".=",
... | Write to the stream.
@param string $data
@return int | [
"Write",
"to",
"the",
"stream",
"."
] | 0630ed71351c6b804a815cff553fd0f57509ab54 | https://github.com/medz/oss-stream-wrapper/blob/0630ed71351c6b804a815cff553fd0f57509ab54/src/AliyunOssStream.php#L200-L210 |
229,456 | medz/oss-stream-wrapper | src/AliyunOssStream.php | AliyunOssStream.stream_flush | public function stream_flush()
{
// If the stream wasn't opened for writing, just return false
if (!$this->_writeBuffer) {
return false;
}
$ret = $this->_oss->putObject(AliyunOSS::getBucket(), $this->_objectName, $this->_objectBuffer);
$this->_objectBuffer = null;... | php | public function stream_flush()
{
// If the stream wasn't opened for writing, just return false
if (!$this->_writeBuffer) {
return false;
}
$ret = $this->_oss->putObject(AliyunOSS::getBucket(), $this->_objectName, $this->_objectBuffer);
$this->_objectBuffer = null;... | [
"public",
"function",
"stream_flush",
"(",
")",
"{",
"// If the stream wasn't opened for writing, just return false",
"if",
"(",
"!",
"$",
"this",
"->",
"_writeBuffer",
")",
"{",
"return",
"false",
";",
"}",
"$",
"ret",
"=",
"$",
"this",
"->",
"_oss",
"->",
"p... | Flush current cached stream data to storage.
@return bool | [
"Flush",
"current",
"cached",
"stream",
"data",
"to",
"storage",
"."
] | 0630ed71351c6b804a815cff553fd0f57509ab54 | https://github.com/medz/oss-stream-wrapper/blob/0630ed71351c6b804a815cff553fd0f57509ab54/src/AliyunOssStream.php#L302-L312 |
229,457 | medz/oss-stream-wrapper | src/AliyunOssStream.php | AliyunOssStream.stream_stat | public function stream_stat()
{
if (!$this->_objectName) {
return [];
}
$stat = [];
$stat['dev'] = 0;
$stat['ino'] = 0;
$stat['mode'] = 0777;
$stat['nlink'] = 0;
$stat['uid'] = 0;
$stat['gid'] = 0;
$stat['rdev'] = 0;
... | php | public function stream_stat()
{
if (!$this->_objectName) {
return [];
}
$stat = [];
$stat['dev'] = 0;
$stat['ino'] = 0;
$stat['mode'] = 0777;
$stat['nlink'] = 0;
$stat['uid'] = 0;
$stat['gid'] = 0;
$stat['rdev'] = 0;
... | [
"public",
"function",
"stream_stat",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_objectName",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"stat",
"=",
"[",
"]",
";",
"$",
"stat",
"[",
"'dev'",
"]",
"=",
"0",
";",
"$",
"stat",
"[",
"'... | Returns data array of stream variables.
@return array | [
"Returns",
"data",
"array",
"of",
"stream",
"variables",
"."
] | 0630ed71351c6b804a815cff553fd0f57509ab54 | https://github.com/medz/oss-stream-wrapper/blob/0630ed71351c6b804a815cff553fd0f57509ab54/src/AliyunOssStream.php#L319-L355 |
229,458 | medz/oss-stream-wrapper | src/AliyunOssStream.php | AliyunOssStream.unlink | public function unlink($path)
{
return $this->_getOssClient($path)->deleteObject(AliyunOSS::getBucket(), $this->_getNamePart($path));
} | php | public function unlink($path)
{
return $this->_getOssClient($path)->deleteObject(AliyunOSS::getBucket(), $this->_getNamePart($path));
} | [
"public",
"function",
"unlink",
"(",
"$",
"path",
")",
"{",
"return",
"$",
"this",
"->",
"_getOssClient",
"(",
"$",
"path",
")",
"->",
"deleteObject",
"(",
"AliyunOSS",
"::",
"getBucket",
"(",
")",
",",
"$",
"this",
"->",
"_getNamePart",
"(",
"$",
"pat... | Attempt to delete the item.
@param string $path
@return bool | [
"Attempt",
"to",
"delete",
"the",
"item",
"."
] | 0630ed71351c6b804a815cff553fd0f57509ab54 | https://github.com/medz/oss-stream-wrapper/blob/0630ed71351c6b804a815cff553fd0f57509ab54/src/AliyunOssStream.php#L364-L367 |
229,459 | medz/oss-stream-wrapper | src/AliyunOssStream.php | AliyunOssStream.dir_readdir | public function dir_readdir()
{
$object = current($this->_bucketList);
if ($object !== false) {
next($this->_bucketList);
}
return $object;
} | php | public function dir_readdir()
{
$object = current($this->_bucketList);
if ($object !== false) {
next($this->_bucketList);
}
return $object;
} | [
"public",
"function",
"dir_readdir",
"(",
")",
"{",
"$",
"object",
"=",
"current",
"(",
"$",
"this",
"->",
"_bucketList",
")",
";",
"if",
"(",
"$",
"object",
"!==",
"false",
")",
"{",
"next",
"(",
"$",
"this",
"->",
"_bucketList",
")",
";",
"}",
"r... | Return the next filename in the directory.
@return string | [
"Return",
"the",
"next",
"filename",
"in",
"the",
"directory",
"."
] | 0630ed71351c6b804a815cff553fd0f57509ab54 | https://github.com/medz/oss-stream-wrapper/blob/0630ed71351c6b804a815cff553fd0f57509ab54/src/AliyunOssStream.php#L417-L425 |
229,460 | medz/oss-stream-wrapper | src/AliyunOssStream.php | AliyunOssStream.dir_opendir | public function dir_opendir($path, $options)
{
$dirName = $this->_getNamePart($path).'/';
if (preg_match('@^([a-z0-9+.]|-)+://$@', $path) || $dirName == '/') {
$list = $this->_getOssClient($path)->listObjects(AliyunOSS::getBucket());
} else {
$list = $this
... | php | public function dir_opendir($path, $options)
{
$dirName = $this->_getNamePart($path).'/';
if (preg_match('@^([a-z0-9+.]|-)+://$@', $path) || $dirName == '/') {
$list = $this->_getOssClient($path)->listObjects(AliyunOSS::getBucket());
} else {
$list = $this
... | [
"public",
"function",
"dir_opendir",
"(",
"$",
"path",
",",
"$",
"options",
")",
"{",
"$",
"dirName",
"=",
"$",
"this",
"->",
"_getNamePart",
"(",
"$",
"path",
")",
".",
"'/'",
";",
"if",
"(",
"preg_match",
"(",
"'@^([a-z0-9+.]|-)+://$@'",
",",
"$",
"p... | Attempt to open a directory.
@param string $path
@param int $options
@return bool | [
"Attempt",
"to",
"open",
"a",
"directory",
"."
] | 0630ed71351c6b804a815cff553fd0f57509ab54 | https://github.com/medz/oss-stream-wrapper/blob/0630ed71351c6b804a815cff553fd0f57509ab54/src/AliyunOssStream.php#L435-L461 |
229,461 | medz/oss-stream-wrapper | src/AliyunOssStream.php | AliyunOssStream.url_stat | public function url_stat($path, $flags)
{
$stat = [
'dev' => 0,
'ino' => 0,
'mode' => 0777,
'nlink' => 0,
'uid' => 0,
'gid' => 0,
'rdev' => 0,
'size' => 0,
'atime' => 0,
... | php | public function url_stat($path, $flags)
{
$stat = [
'dev' => 0,
'ino' => 0,
'mode' => 0777,
'nlink' => 0,
'uid' => 0,
'gid' => 0,
'rdev' => 0,
'size' => 0,
'atime' => 0,
... | [
"public",
"function",
"url_stat",
"(",
"$",
"path",
",",
"$",
"flags",
")",
"{",
"$",
"stat",
"=",
"[",
"'dev'",
"=>",
"0",
",",
"'ino'",
"=>",
"0",
",",
"'mode'",
"=>",
"0777",
",",
"'nlink'",
"=>",
"0",
",",
"'uid'",
"=>",
"0",
",",
"'gid'",
... | Return array of URL variables.
@param string $path
@param int $flags
@return array | [
"Return",
"array",
"of",
"URL",
"variables",
"."
] | 0630ed71351c6b804a815cff553fd0f57509ab54 | https://github.com/medz/oss-stream-wrapper/blob/0630ed71351c6b804a815cff553fd0f57509ab54/src/AliyunOssStream.php#L471-L504 |
229,462 | milesj/utility | Model/Behavior/ValidateableBehavior.php | ValidateableBehavior.validate | public function validate(Model $model, $set) {
if (!isset($model->validations[$set])) {
throw new OutOfBoundsException(sprintf('Validation set %s does not exist', $set));
}
$rules = $model->validations[$set];
$settings = $this->settings[$model->alias];
// Ad... | php | public function validate(Model $model, $set) {
if (!isset($model->validations[$set])) {
throw new OutOfBoundsException(sprintf('Validation set %s does not exist', $set));
}
$rules = $model->validations[$set];
$settings = $this->settings[$model->alias];
// Ad... | [
"public",
"function",
"validate",
"(",
"Model",
"$",
"model",
",",
"$",
"set",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"model",
"->",
"validations",
"[",
"$",
"set",
"]",
")",
")",
"{",
"throw",
"new",
"OutOfBoundsException",
"(",
"sprintf",
"("... | Set the validation set to use.
@param Model $model
@param string $set
@return Model
@throws OutOfBoundsException | [
"Set",
"the",
"validation",
"set",
"to",
"use",
"."
] | 146318ff0a882917defab7f4918b0d198eb5a3c0 | https://github.com/milesj/utility/blob/146318ff0a882917defab7f4918b0d198eb5a3c0/Model/Behavior/ValidateableBehavior.php#L121-L138 |
229,463 | milesj/utility | Model/Behavior/ValidateableBehavior.php | ValidateableBehavior.invalid | public function invalid(Model $model, $field, $message, $params = array()) {
$model->invalidate($field, __d($model->validationDomain ?: 'default', $message, $params));
return false;
} | php | public function invalid(Model $model, $field, $message, $params = array()) {
$model->invalidate($field, __d($model->validationDomain ?: 'default', $message, $params));
return false;
} | [
"public",
"function",
"invalid",
"(",
"Model",
"$",
"model",
",",
"$",
"field",
",",
"$",
"message",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"model",
"->",
"invalidate",
"(",
"$",
"field",
",",
"__d",
"(",
"$",
"model",
"->",
"... | Convenience method to invalidate a field and translate the custom message.
@param Model $model
@param string $field
@param string $message
@param array $params
@return bool | [
"Convenience",
"method",
"to",
"invalidate",
"a",
"field",
"and",
"translate",
"the",
"custom",
"message",
"."
] | 146318ff0a882917defab7f4918b0d198eb5a3c0 | https://github.com/milesj/utility/blob/146318ff0a882917defab7f4918b0d198eb5a3c0/Model/Behavior/ValidateableBehavior.php#L149-L153 |
229,464 | milesj/utility | Model/Behavior/ValidateableBehavior.php | ValidateableBehavior.beforeValidate | public function beforeValidate(Model $model, $options = array()) {
$default = $this->settings[$model->alias]['defaultSet'];
if (empty($model->validate) && isset($model->validations[$default])) {
$this->validate($model, $default);
}
return true;
} | php | public function beforeValidate(Model $model, $options = array()) {
$default = $this->settings[$model->alias]['defaultSet'];
if (empty($model->validate) && isset($model->validations[$default])) {
$this->validate($model, $default);
}
return true;
} | [
"public",
"function",
"beforeValidate",
"(",
"Model",
"$",
"model",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"default",
"=",
"$",
"this",
"->",
"settings",
"[",
"$",
"model",
"->",
"alias",
"]",
"[",
"'defaultSet'",
"]",
";",
"if",... | If validate is empty and a default set exists, apply the rules.
@param Model $model
@param array $options
@return bool | [
"If",
"validate",
"is",
"empty",
"and",
"a",
"default",
"set",
"exists",
"apply",
"the",
"rules",
"."
] | 146318ff0a882917defab7f4918b0d198eb5a3c0 | https://github.com/milesj/utility/blob/146318ff0a882917defab7f4918b0d198eb5a3c0/Model/Behavior/ValidateableBehavior.php#L162-L170 |
229,465 | milesj/utility | Model/Behavior/ValidateableBehavior.php | ValidateableBehavior._applyMessages | protected function _applyMessages(Model $model, array $rules) {
foreach ($rules as $key => $value) {
if (is_array($value)) {
if ($key !== 'rule') {
$rules[$key] = $this->_applyMessages($model, $value);
}
// Collapsed rules
... | php | protected function _applyMessages(Model $model, array $rules) {
foreach ($rules as $key => $value) {
if (is_array($value)) {
if ($key !== 'rule') {
$rules[$key] = $this->_applyMessages($model, $value);
}
// Collapsed rules
... | [
"protected",
"function",
"_applyMessages",
"(",
"Model",
"$",
"model",
",",
"array",
"$",
"rules",
")",
"{",
"foreach",
"(",
"$",
"rules",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"if"... | Apply and set default messages if they are missing.
@param Model $model
@param array $rules
@return array | [
"Apply",
"and",
"set",
"default",
"messages",
"if",
"they",
"are",
"missing",
"."
] | 146318ff0a882917defab7f4918b0d198eb5a3c0 | https://github.com/milesj/utility/blob/146318ff0a882917defab7f4918b0d198eb5a3c0/Model/Behavior/ValidateableBehavior.php#L193-L224 |
229,466 | softark/creole | block/ListTrait.php | ListTrait.isParentItem | protected function isParentItem($line)
{
if ($this->_listDepth === 1 || ($marker = $line[0]) !== '*' && $marker !== '#') {
return false;
}
$depthMax = $this->_listDepth - 1;
if (preg_match('/^(#{1,' . $depthMax . '})[^#]+/', $line, $matches)) {
return $this->_nestedListTypes[strlen($matches[1])] === 'ol'... | php | protected function isParentItem($line)
{
if ($this->_listDepth === 1 || ($marker = $line[0]) !== '*' && $marker !== '#') {
return false;
}
$depthMax = $this->_listDepth - 1;
if (preg_match('/^(#{1,' . $depthMax . '})[^#]+/', $line, $matches)) {
return $this->_nestedListTypes[strlen($matches[1])] === 'ol'... | [
"protected",
"function",
"isParentItem",
"(",
"$",
"line",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_listDepth",
"===",
"1",
"||",
"(",
"$",
"marker",
"=",
"$",
"line",
"[",
"0",
"]",
")",
"!==",
"'*'",
"&&",
"$",
"marker",
"!==",
"'#'",
")",
"{"... | check if a line is an item that belongs to a parent list
@param $line
@return bool true if the line is an item of a parent list | [
"check",
"if",
"a",
"line",
"is",
"an",
"item",
"that",
"belongs",
"to",
"a",
"parent",
"list"
] | f56f267e46fa45df1fab01f5d9f1c2bfb0394a9b | https://github.com/softark/creole/blob/f56f267e46fa45df1fab01f5d9f1c2bfb0394a9b/block/ListTrait.php#L48-L61 |
229,467 | softark/creole | block/ListTrait.php | ListTrait.isSiblingItem | protected function isSiblingItem($line)
{
$siblingMarker = $this->_nestedListTypes[$this->_listDepth] == 'ol' ? '*' : '#';
if ($line[0] !== $siblingMarker) {
return false;
}
return
($siblingMarker === '#' && preg_match('/^#{' . $this->_listDepth . '}[^#]+/', $line)) ||
($siblingMarker === '*' && preg_... | php | protected function isSiblingItem($line)
{
$siblingMarker = $this->_nestedListTypes[$this->_listDepth] == 'ol' ? '*' : '#';
if ($line[0] !== $siblingMarker) {
return false;
}
return
($siblingMarker === '#' && preg_match('/^#{' . $this->_listDepth . '}[^#]+/', $line)) ||
($siblingMarker === '*' && preg_... | [
"protected",
"function",
"isSiblingItem",
"(",
"$",
"line",
")",
"{",
"$",
"siblingMarker",
"=",
"$",
"this",
"->",
"_nestedListTypes",
"[",
"$",
"this",
"->",
"_listDepth",
"]",
"==",
"'ol'",
"?",
"'*'",
":",
"'#'",
";",
"if",
"(",
"$",
"line",
"[",
... | check if a line is an item that belongs to a sibling list
@param $line
@return bool true if the line is an item of a sibling list | [
"check",
"if",
"a",
"line",
"is",
"an",
"item",
"that",
"belongs",
"to",
"a",
"sibling",
"list"
] | f56f267e46fa45df1fab01f5d9f1c2bfb0394a9b | https://github.com/softark/creole/blob/f56f267e46fa45df1fab01f5d9f1c2bfb0394a9b/block/ListTrait.php#L68-L77 |
229,468 | milesj/utility | Model/Behavior/SpamBlockerBehavior.php | SpamBlockerBehavior.notify | public function notify(Model $model, $data, $status, $points = 0) {
$settings = $this->settings[$model->alias];
$columnMap = $settings['columnMap'];
if ($settings['model'] && $settings['link'] && $settings['email']) {
$Article = ClassRegistry::init(Inflector::classify($settings['mod... | php | public function notify(Model $model, $data, $status, $points = 0) {
$settings = $this->settings[$model->alias];
$columnMap = $settings['columnMap'];
if ($settings['model'] && $settings['link'] && $settings['email']) {
$Article = ClassRegistry::init(Inflector::classify($settings['mod... | [
"public",
"function",
"notify",
"(",
"Model",
"$",
"model",
",",
"$",
"data",
",",
"$",
"status",
",",
"$",
"points",
"=",
"0",
")",
"{",
"$",
"settings",
"=",
"$",
"this",
"->",
"settings",
"[",
"$",
"model",
"->",
"alias",
"]",
";",
"$",
"colum... | Sends out an email notifying you of a new comment.
@param Model $model
@param array $data
@param int $status
@param int $points | [
"Sends",
"out",
"an",
"email",
"notifying",
"you",
"of",
"a",
"new",
"comment",
"."
] | 146318ff0a882917defab7f4918b0d198eb5a3c0 | https://github.com/milesj/utility/blob/146318ff0a882917defab7f4918b0d198eb5a3c0/Model/Behavior/SpamBlockerBehavior.php#L330-L393 |
229,469 | milesj/utility | Console/Command/BaseInstallShell.php | BaseInstallShell.main | public function main() {
$this->stdout->styles('success', array('text' => 'green'));
$this->hr(1);
$this->out(sprintf('%s Steps:', $this->name));
$counter = 1;
foreach ($this->steps as $method) {
$this->steps($counter);
try {
if (!call_... | php | public function main() {
$this->stdout->styles('success', array('text' => 'green'));
$this->hr(1);
$this->out(sprintf('%s Steps:', $this->name));
$counter = 1;
foreach ($this->steps as $method) {
$this->steps($counter);
try {
if (!call_... | [
"public",
"function",
"main",
"(",
")",
"{",
"$",
"this",
"->",
"stdout",
"->",
"styles",
"(",
"'success'",
",",
"array",
"(",
"'text'",
"=>",
"'green'",
")",
")",
";",
"$",
"this",
"->",
"hr",
"(",
"1",
")",
";",
"$",
"this",
"->",
"out",
"(",
... | Execute installer and cycle through all steps. | [
"Execute",
"installer",
"and",
"cycle",
"through",
"all",
"steps",
"."
] | 146318ff0a882917defab7f4918b0d198eb5a3c0 | https://github.com/milesj/utility/blob/146318ff0a882917defab7f4918b0d198eb5a3c0/Console/Command/BaseInstallShell.php#L95-L118 |
229,470 | milesj/utility | Console/Command/BaseInstallShell.php | BaseInstallShell.checkDbConfig | public function checkDbConfig() {
if (!$this->dbConfig || !$this->db) {
$dbConfigs = array_keys(get_class_vars('DATABASE_CONFIG'));
$this->out('Available database configurations:');
foreach ($dbConfigs as $i => $db) {
$this->out(sprintf('[%s] <info>%s</info>... | php | public function checkDbConfig() {
if (!$this->dbConfig || !$this->db) {
$dbConfigs = array_keys(get_class_vars('DATABASE_CONFIG'));
$this->out('Available database configurations:');
foreach ($dbConfigs as $i => $db) {
$this->out(sprintf('[%s] <info>%s</info>... | [
"public",
"function",
"checkDbConfig",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"dbConfig",
"||",
"!",
"$",
"this",
"->",
"db",
")",
"{",
"$",
"dbConfigs",
"=",
"array_keys",
"(",
"get_class_vars",
"(",
"'DATABASE_CONFIG'",
")",
")",
";",
"$",... | Check the database status before installation.
@return bool | [
"Check",
"the",
"database",
"status",
"before",
"installation",
"."
] | 146318ff0a882917defab7f4918b0d198eb5a3c0 | https://github.com/milesj/utility/blob/146318ff0a882917defab7f4918b0d198eb5a3c0/Console/Command/BaseInstallShell.php#L125-L163 |
229,471 | milesj/utility | Console/Command/BaseInstallShell.php | BaseInstallShell.checkRequiredTables | public function checkRequiredTables() {
if ($this->requiredTables) {
$this->out(sprintf('The following tables are required: <info>%s</info>', implode(', ', $this->requiredTables)));
$this->out('<success>Checking tables...</success>');
$tables = $this->db->listSources();
... | php | public function checkRequiredTables() {
if ($this->requiredTables) {
$this->out(sprintf('The following tables are required: <info>%s</info>', implode(', ', $this->requiredTables)));
$this->out('<success>Checking tables...</success>');
$tables = $this->db->listSources();
... | [
"public",
"function",
"checkRequiredTables",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"requiredTables",
")",
"{",
"$",
"this",
"->",
"out",
"(",
"sprintf",
"(",
"'The following tables are required: <info>%s</info>'",
",",
"implode",
"(",
"', '",
",",
"$",
... | Check that all the required tables exist in the database.
@return bool | [
"Check",
"that",
"all",
"the",
"required",
"tables",
"exist",
"in",
"the",
"database",
"."
] | 146318ff0a882917defab7f4918b0d198eb5a3c0 | https://github.com/milesj/utility/blob/146318ff0a882917defab7f4918b0d198eb5a3c0/Console/Command/BaseInstallShell.php#L170-L192 |
229,472 | milesj/utility | Console/Command/BaseInstallShell.php | BaseInstallShell.checkUsersModel | public function checkUsersModel() {
if (!$this->usersModel) {
$this->setUsersModel($this->in('What is the name of your users model?'));
}
$this->out(sprintf('Users Model: <info>%s</info>', $this->usersModel));
$answer = strtoupper($this->in('Is this correct?', array('Y', 'N... | php | public function checkUsersModel() {
if (!$this->usersModel) {
$this->setUsersModel($this->in('What is the name of your users model?'));
}
$this->out(sprintf('Users Model: <info>%s</info>', $this->usersModel));
$answer = strtoupper($this->in('Is this correct?', array('Y', 'N... | [
"public",
"function",
"checkUsersModel",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"usersModel",
")",
"{",
"$",
"this",
"->",
"setUsersModel",
"(",
"$",
"this",
"->",
"in",
"(",
"'What is the name of your users model?'",
")",
")",
";",
"}",
"$",
... | Determine the users model to use.
@return bool | [
"Determine",
"the",
"users",
"model",
"to",
"use",
"."
] | 146318ff0a882917defab7f4918b0d198eb5a3c0 | https://github.com/milesj/utility/blob/146318ff0a882917defab7f4918b0d198eb5a3c0/Console/Command/BaseInstallShell.php#L222-L235 |
229,473 | milesj/utility | Console/Command/BaseInstallShell.php | BaseInstallShell.checkUsersTable | public function checkUsersTable() {
if (!$this->usersTable) {
$this->setUsersTable($this->in('What is the name of your users table?'));
}
$this->out(sprintf('Users Table: <info>%s</info>', $this->usersTable));
$answer = strtoupper($this->in('Is this correct?', array('Y', 'N... | php | public function checkUsersTable() {
if (!$this->usersTable) {
$this->setUsersTable($this->in('What is the name of your users table?'));
}
$this->out(sprintf('Users Table: <info>%s</info>', $this->usersTable));
$answer = strtoupper($this->in('Is this correct?', array('Y', 'N... | [
"public",
"function",
"checkUsersTable",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"usersTable",
")",
"{",
"$",
"this",
"->",
"setUsersTable",
"(",
"$",
"this",
"->",
"in",
"(",
"'What is the name of your users table?'",
")",
")",
";",
"}",
"$",
... | Determine the users table to use.
@return bool | [
"Determine",
"the",
"users",
"table",
"to",
"use",
"."
] | 146318ff0a882917defab7f4918b0d198eb5a3c0 | https://github.com/milesj/utility/blob/146318ff0a882917defab7f4918b0d198eb5a3c0/Console/Command/BaseInstallShell.php#L242-L262 |
229,474 | milesj/utility | Console/Command/BaseInstallShell.php | BaseInstallShell.createTables | public function createTables() {
$answer = strtoupper($this->in('Existing tables will be deleted, continue?', array('Y', 'N')));
if ($answer === 'N') {
return false;
}
$schemas = glob(CakePlugin::path($this->plugin) . '/Config/Schema/*.sql');
$executed = 0;
... | php | public function createTables() {
$answer = strtoupper($this->in('Existing tables will be deleted, continue?', array('Y', 'N')));
if ($answer === 'N') {
return false;
}
$schemas = glob(CakePlugin::path($this->plugin) . '/Config/Schema/*.sql');
$executed = 0;
... | [
"public",
"function",
"createTables",
"(",
")",
"{",
"$",
"answer",
"=",
"strtoupper",
"(",
"$",
"this",
"->",
"in",
"(",
"'Existing tables will be deleted, continue?'",
",",
"array",
"(",
"'Y'",
",",
"'N'",
")",
")",
")",
";",
"if",
"(",
"$",
"answer",
... | Create the database tables based off the schemas.
@return bool | [
"Create",
"the",
"database",
"tables",
"based",
"off",
"the",
"schemas",
"."
] | 146318ff0a882917defab7f4918b0d198eb5a3c0 | https://github.com/milesj/utility/blob/146318ff0a882917defab7f4918b0d198eb5a3c0/Console/Command/BaseInstallShell.php#L269-L304 |
229,475 | milesj/utility | Console/Command/BaseInstallShell.php | BaseInstallShell.createUser | public function createUser() {
$data = array();
foreach ($this->userFields as $base => $field) {
$data[$field] = $this->getFieldInput($base);
}
$model = ClassRegistry::init($this->usersModel);
$model->create();
$model->save($data, false);
$this->con... | php | public function createUser() {
$data = array();
foreach ($this->userFields as $base => $field) {
$data[$field] = $this->getFieldInput($base);
}
$model = ClassRegistry::init($this->usersModel);
$model->create();
$model->save($data, false);
$this->con... | [
"public",
"function",
"createUser",
"(",
")",
"{",
"$",
"data",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"userFields",
"as",
"$",
"base",
"=>",
"$",
"field",
")",
"{",
"$",
"data",
"[",
"$",
"field",
"]",
"=",
"$",
"this",
... | Gather all the data for creating a new user.
@return int | [
"Gather",
"all",
"the",
"data",
"for",
"creating",
"a",
"new",
"user",
"."
] | 146318ff0a882917defab7f4918b0d198eb5a3c0 | https://github.com/milesj/utility/blob/146318ff0a882917defab7f4918b0d198eb5a3c0/Console/Command/BaseInstallShell.php#L311-L329 |
229,476 | milesj/utility | Console/Command/BaseInstallShell.php | BaseInstallShell.executeSchema | public function executeSchema($path, $track = true) {
if (!file_exists($path)) {
throw new DomainException(sprintf('<error>Schema %s does not exist</error>', basename($path)));
}
$contents = file_get_contents($path);
$contents = String::insert($contents, array('prefix' => $t... | php | public function executeSchema($path, $track = true) {
if (!file_exists($path)) {
throw new DomainException(sprintf('<error>Schema %s does not exist</error>', basename($path)));
}
$contents = file_get_contents($path);
$contents = String::insert($contents, array('prefix' => $t... | [
"public",
"function",
"executeSchema",
"(",
"$",
"path",
",",
"$",
"track",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"path",
")",
")",
"{",
"throw",
"new",
"DomainException",
"(",
"sprintf",
"(",
"'<error>Schema %s does not exist</erro... | Execute a schema SQL file using the loaded datasource.
@param string $path
@param bool $track
@return int
@throws DomainException | [
"Execute",
"a",
"schema",
"SQL",
"file",
"using",
"the",
"loaded",
"datasource",
"."
] | 146318ff0a882917defab7f4918b0d198eb5a3c0 | https://github.com/milesj/utility/blob/146318ff0a882917defab7f4918b0d198eb5a3c0/Console/Command/BaseInstallShell.php#L339-L372 |
229,477 | milesj/utility | Console/Command/BaseInstallShell.php | BaseInstallShell.findUser | public function findUser() {
$model = ClassRegistry::init($this->usersModel);
$id = trim($this->in('User ID:'));
if (!$id) {
$this->out('<error>Invalid ID, please try again</error>');
return $this->findUser();
}
$result = $model->find('first', array(
... | php | public function findUser() {
$model = ClassRegistry::init($this->usersModel);
$id = trim($this->in('User ID:'));
if (!$id) {
$this->out('<error>Invalid ID, please try again</error>');
return $this->findUser();
}
$result = $model->find('first', array(
... | [
"public",
"function",
"findUser",
"(",
")",
"{",
"$",
"model",
"=",
"ClassRegistry",
"::",
"init",
"(",
"$",
"this",
"->",
"usersModel",
")",
";",
"$",
"id",
"=",
"trim",
"(",
"$",
"this",
"->",
"in",
"(",
"'User ID:'",
")",
")",
";",
"if",
"(",
... | Find a user within the users table.
@return int | [
"Find",
"a",
"user",
"within",
"the",
"users",
"table",
"."
] | 146318ff0a882917defab7f4918b0d198eb5a3c0 | https://github.com/milesj/utility/blob/146318ff0a882917defab7f4918b0d198eb5a3c0/Console/Command/BaseInstallShell.php#L379-L401 |
229,478 | milesj/utility | Console/Command/BaseInstallShell.php | BaseInstallShell.setDbConfig | public function setDbConfig($config) {
$this->dbConfig = $config;
$this->db = ConnectionManager::getDataSource($config);
$this->db->cacheSources = false;
return $this;
} | php | public function setDbConfig($config) {
$this->dbConfig = $config;
$this->db = ConnectionManager::getDataSource($config);
$this->db->cacheSources = false;
return $this;
} | [
"public",
"function",
"setDbConfig",
"(",
"$",
"config",
")",
"{",
"$",
"this",
"->",
"dbConfig",
"=",
"$",
"config",
";",
"$",
"this",
"->",
"db",
"=",
"ConnectionManager",
"::",
"getDataSource",
"(",
"$",
"config",
")",
";",
"$",
"this",
"->",
"db",
... | Set the database config to use and load the data source.
@param string $config
@return BaseInstallShell | [
"Set",
"the",
"database",
"config",
"to",
"use",
"and",
"load",
"the",
"data",
"source",
"."
] | 146318ff0a882917defab7f4918b0d198eb5a3c0 | https://github.com/milesj/utility/blob/146318ff0a882917defab7f4918b0d198eb5a3c0/Console/Command/BaseInstallShell.php#L476-L483 |
229,479 | milesj/utility | Console/Command/BaseInstallShell.php | BaseInstallShell.setRequiredTables | public function setRequiredTables(array $tables) {
$this->requiredTables = array_unique(array_merge($this->requiredTables, $tables));
return $this;
} | php | public function setRequiredTables(array $tables) {
$this->requiredTables = array_unique(array_merge($this->requiredTables, $tables));
return $this;
} | [
"public",
"function",
"setRequiredTables",
"(",
"array",
"$",
"tables",
")",
"{",
"$",
"this",
"->",
"requiredTables",
"=",
"array_unique",
"(",
"array_merge",
"(",
"$",
"this",
"->",
"requiredTables",
",",
"$",
"tables",
")",
")",
";",
"return",
"$",
"thi... | Set the required tables.
@param array $tables
@return BaseInstallShell | [
"Set",
"the",
"required",
"tables",
"."
] | 146318ff0a882917defab7f4918b0d198eb5a3c0 | https://github.com/milesj/utility/blob/146318ff0a882917defab7f4918b0d198eb5a3c0/Console/Command/BaseInstallShell.php#L491-L495 |
229,480 | milesj/utility | Console/Command/BaseInstallShell.php | BaseInstallShell.setUserFields | public function setUserFields(array $fields) {
$clean = array();
foreach ($fields as $base => $field) {
if (is_numeric($base)) {
$base = $field;
}
$clean[$base] = $field;
}
$this->userFields = $clean;
return $this;
} | php | public function setUserFields(array $fields) {
$clean = array();
foreach ($fields as $base => $field) {
if (is_numeric($base)) {
$base = $field;
}
$clean[$base] = $field;
}
$this->userFields = $clean;
return $this;
} | [
"public",
"function",
"setUserFields",
"(",
"array",
"$",
"fields",
")",
"{",
"$",
"clean",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"fields",
"as",
"$",
"base",
"=>",
"$",
"field",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"base",
")",... | Set the user fields mapping.
@param array $fields
@return BaseInstallShell | [
"Set",
"the",
"user",
"fields",
"mapping",
"."
] | 146318ff0a882917defab7f4918b0d198eb5a3c0 | https://github.com/milesj/utility/blob/146318ff0a882917defab7f4918b0d198eb5a3c0/Console/Command/BaseInstallShell.php#L532-L546 |
229,481 | milesj/utility | Console/Command/BaseInstallShell.php | BaseInstallShell.steps | public function steps($step = 0) {
$this->hr(1);
$counter = 1;
foreach ($this->steps as $title => $method) {
if ($counter < $step) {
$this->out('[x] ' . $title);
} else {
$this->out(sprintf('[%s] <info>%s</info>', $counter, $title));
... | php | public function steps($step = 0) {
$this->hr(1);
$counter = 1;
foreach ($this->steps as $title => $method) {
if ($counter < $step) {
$this->out('[x] ' . $title);
} else {
$this->out(sprintf('[%s] <info>%s</info>', $counter, $title));
... | [
"public",
"function",
"steps",
"(",
"$",
"step",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"hr",
"(",
"1",
")",
";",
"$",
"counter",
"=",
"1",
";",
"foreach",
"(",
"$",
"this",
"->",
"steps",
"as",
"$",
"title",
"=>",
"$",
"method",
")",
"{",
"i... | Table of contents.
@param int $step | [
"Table",
"of",
"contents",
"."
] | 146318ff0a882917defab7f4918b0d198eb5a3c0 | https://github.com/milesj/utility/blob/146318ff0a882917defab7f4918b0d198eb5a3c0/Console/Command/BaseInstallShell.php#L577-L593 |
229,482 | thelia-modules/Paybox | Paybox.php | Paybox.doPay | protected function doPay(Order $order)
{
if ('TEST' == Paybox::getConfigValue('mode', false)) {
$platformUrl = Paybox::getConfigValue('url_serveur_test', false);
} else {
$platformUrl = Paybox::getConfigValue('url_serveur', false);
}
// Be sure to hav... | php | protected function doPay(Order $order)
{
if ('TEST' == Paybox::getConfigValue('mode', false)) {
$platformUrl = Paybox::getConfigValue('url_serveur_test', false);
} else {
$platformUrl = Paybox::getConfigValue('url_serveur', false);
}
// Be sure to hav... | [
"protected",
"function",
"doPay",
"(",
"Order",
"$",
"order",
")",
"{",
"if",
"(",
"'TEST'",
"==",
"Paybox",
"::",
"getConfigValue",
"(",
"'mode'",
",",
"false",
")",
")",
"{",
"$",
"platformUrl",
"=",
"Paybox",
"::",
"getConfigValue",
"(",
"'url_serveur_t... | Payment gateway invocation
@param Order $order processed order
@return Response the HTTP response | [
"Payment",
"gateway",
"invocation"
] | 08b9f4478ecbdb234fc373d6540010af34d2d87c | https://github.com/thelia-modules/Paybox/blob/08b9f4478ecbdb234fc373d6540010af34d2d87c/Paybox.php#L137-L179 |
229,483 | thelia-modules/Paybox | Paybox.php | Paybox.getCurrencyIso4217NumericCode | protected function getCurrencyIso4217NumericCode($textCurrencyCode)
{
$currencies = null;
$localIso417data = __DIR__ . DS . "Config" . DS . "iso4217.xml";
$currencyXmlDataUrl = "http://www.currency-iso.org/dam/downloads/lists/list_one.xml";
$xmlData = @file_get_contents($c... | php | protected function getCurrencyIso4217NumericCode($textCurrencyCode)
{
$currencies = null;
$localIso417data = __DIR__ . DS . "Config" . DS . "iso4217.xml";
$currencyXmlDataUrl = "http://www.currency-iso.org/dam/downloads/lists/list_one.xml";
$xmlData = @file_get_contents($c... | [
"protected",
"function",
"getCurrencyIso4217NumericCode",
"(",
"$",
"textCurrencyCode",
")",
"{",
"$",
"currencies",
"=",
"null",
";",
"$",
"localIso417data",
"=",
"__DIR__",
".",
"DS",
".",
"\"Config\"",
".",
"DS",
".",
"\"iso4217.xml\"",
";",
"$",
"currencyXml... | Get the numeric ISO 4217 code of a currency
@param string $textCurrencyCode currency textual code, like EUR or USD
@return string the algorithm
@throw \RuntimeException if no algorithm was found. | [
"Get",
"the",
"numeric",
"ISO",
"4217",
"code",
"of",
"a",
"currency"
] | 08b9f4478ecbdb234fc373d6540010af34d2d87c | https://github.com/thelia-modules/Paybox/blob/08b9f4478ecbdb234fc373d6540010af34d2d87c/Paybox.php#L270-L320 |
229,484 | thelia-modules/Paybox | Paybox.php | Paybox.getHashAlgorithm | protected function getHashAlgorithm()
{
// Possible hashes
$hashes = [
'sha512',
'sha256',
'sha384',
'ripemd160',
'sha224',
'mdc2'
];
$hashEnabled = hash_algos();
foreach ($hashes as $hash... | php | protected function getHashAlgorithm()
{
// Possible hashes
$hashes = [
'sha512',
'sha256',
'sha384',
'ripemd160',
'sha224',
'mdc2'
];
$hashEnabled = hash_algos();
foreach ($hashes as $hash... | [
"protected",
"function",
"getHashAlgorithm",
"(",
")",
"{",
"// Possible hashes\r",
"$",
"hashes",
"=",
"[",
"'sha512'",
",",
"'sha256'",
",",
"'sha384'",
",",
"'ripemd160'",
",",
"'sha224'",
",",
"'mdc2'",
"]",
";",
"$",
"hashEnabled",
"=",
"hash_algos",
"(",... | Find a suitable hashing algorithm
@return string the algorithm
@throw \RuntimeException if no algorithm was found. | [
"Find",
"a",
"suitable",
"hashing",
"algorithm"
] | 08b9f4478ecbdb234fc373d6540010af34d2d87c | https://github.com/thelia-modules/Paybox/blob/08b9f4478ecbdb234fc373d6540010af34d2d87c/Paybox.php#L328-L353 |
229,485 | fuelphp/common | src/Table.php | Table.addCell | public function addCell($content, $attributes = array())
{
$currentRow = $this->getCurrentRow();
//If we have been given a Cell then just add it, else create a new cell
if ( $content instanceof Cell )
{
$currentRow[] = $content;
}
else
{
$currentRow[] = $this->constructCell($content, $attributes);
... | php | public function addCell($content, $attributes = array())
{
$currentRow = $this->getCurrentRow();
//If we have been given a Cell then just add it, else create a new cell
if ( $content instanceof Cell )
{
$currentRow[] = $content;
}
else
{
$currentRow[] = $this->constructCell($content, $attributes);
... | [
"public",
"function",
"addCell",
"(",
"$",
"content",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"$",
"currentRow",
"=",
"$",
"this",
"->",
"getCurrentRow",
"(",
")",
";",
"//If we have been given a Cell then just add it, else create a new cell",
"i... | Adds a Cell to the current Row
@param mixed $content Anything that is not a Cell will be added as content to a new Cell
@param array $attributes The array of attributes to assign the new Cell
@return $this | [
"Adds",
"a",
"Cell",
"to",
"the",
"current",
"Row"
] | ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40 | https://github.com/fuelphp/common/blob/ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40/src/Table.php#L59-L73 |
229,486 | fuelphp/common | src/Table.php | Table.constructCell | protected function constructCell($content = null, $attributes = array())
{
$cell = new Cell($content);
$cell->setAttributes($attributes);
return $cell;
} | php | protected function constructCell($content = null, $attributes = array())
{
$cell = new Cell($content);
$cell->setAttributes($attributes);
return $cell;
} | [
"protected",
"function",
"constructCell",
"(",
"$",
"content",
"=",
"null",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"$",
"cell",
"=",
"new",
"Cell",
"(",
"$",
"content",
")",
";",
"$",
"cell",
"->",
"setAttributes",
"(",
"$",
"attri... | Creates a new Cell with the given content
@param mixed $content The content for the new Cell
@param array $attributes The attributes for the Cell
@return Cell | [
"Creates",
"a",
"new",
"Cell",
"with",
"the",
"given",
"content"
] | ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40 | https://github.com/fuelphp/common/blob/ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40/src/Table.php#L83-L89 |
229,487 | fuelphp/common | src/Table.php | Table.createRow | public function createRow($type = EnumRowType::Body)
{
$this->currentRow = new Row;
$this->currentRow->setType($type);
return $this;
} | php | public function createRow($type = EnumRowType::Body)
{
$this->currentRow = new Row;
$this->currentRow->setType($type);
return $this;
} | [
"public",
"function",
"createRow",
"(",
"$",
"type",
"=",
"EnumRowType",
"::",
"Body",
")",
"{",
"$",
"this",
"->",
"currentRow",
"=",
"new",
"Row",
";",
"$",
"this",
"->",
"currentRow",
"->",
"setType",
"(",
"$",
"type",
")",
";",
"return",
"$",
"th... | Creates a new Row object and assigns it as the currently active row
@param EnumRowType $type The type of the new row, uses Body by default
@return $this | [
"Creates",
"a",
"new",
"Row",
"object",
"and",
"assigns",
"it",
"as",
"the",
"currently",
"active",
"row"
] | ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40 | https://github.com/fuelphp/common/blob/ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40/src/Table.php#L98-L104 |
229,488 | fuelphp/common | src/Table.php | Table.addRow | public function addRow()
{
switch ( $this->currentRow->getType() )
{
case EnumRowType::Body:
$this->rows[] = $this->currentRow;
break;
case EnumRowType::Header:
$this->headerRows[] = $this->currentRow;
break;
case EnumRowType::Footer:
$this->footerRows[] = $this->currentRow;
break;... | php | public function addRow()
{
switch ( $this->currentRow->getType() )
{
case EnumRowType::Body:
$this->rows[] = $this->currentRow;
break;
case EnumRowType::Header:
$this->headerRows[] = $this->currentRow;
break;
case EnumRowType::Footer:
$this->footerRows[] = $this->currentRow;
break;... | [
"public",
"function",
"addRow",
"(",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"currentRow",
"->",
"getType",
"(",
")",
")",
"{",
"case",
"EnumRowType",
"::",
"Body",
":",
"$",
"this",
"->",
"rows",
"[",
"]",
"=",
"$",
"this",
"->",
"currentRow",
... | Adds the Row that's currently being constructed to the list of finished Rows
@return $this | [
"Adds",
"the",
"Row",
"that",
"s",
"currently",
"being",
"constructed",
"to",
"the",
"list",
"of",
"finished",
"Rows"
] | ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40 | https://github.com/fuelphp/common/blob/ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40/src/Table.php#L111-L131 |
229,489 | fecshop/yii2-fec | component/redisqueue/QueueController.php | QueueController.actionListen | public function actionListen($queueName = null, $queueObjectName = 'queue')
{
while (true) {
if ($this->timeout !==null) {
if ($this->timeout<time()) {
return true;
}
}
if (!$this->process($queueName, $queueObjec... | php | public function actionListen($queueName = null, $queueObjectName = 'queue')
{
while (true) {
if ($this->timeout !==null) {
if ($this->timeout<time()) {
return true;
}
}
if (!$this->process($queueName, $queueObjec... | [
"public",
"function",
"actionListen",
"(",
"$",
"queueName",
"=",
"null",
",",
"$",
"queueObjectName",
"=",
"'queue'",
")",
"{",
"while",
"(",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"timeout",
"!==",
"null",
")",
"{",
"if",
"(",
"$",
"this",... | Continuously process jobs
@param string $queueName
@param string $queueObjectName
@throws \Exception | [
"Continuously",
"process",
"jobs"
] | fda0e381f931bc503e493bec90185162109018e6 | https://github.com/fecshop/yii2-fec/blob/fda0e381f931bc503e493bec90185162109018e6/component/redisqueue/QueueController.php#L33-L45 |
229,490 | rougin/spark-plug | src/Instance.php | Instance.create | public static function create($path = '', array $server = array(), array $globals = array())
{
$globals = empty($globals) ? $GLOBALS : $globals;
$server = empty($server) ? $_SERVER : $server;
$sparkplug = new SparkPlug($globals, $server, $path);
return $sparkplug->getCodeIgniter()... | php | public static function create($path = '', array $server = array(), array $globals = array())
{
$globals = empty($globals) ? $GLOBALS : $globals;
$server = empty($server) ? $_SERVER : $server;
$sparkplug = new SparkPlug($globals, $server, $path);
return $sparkplug->getCodeIgniter()... | [
"public",
"static",
"function",
"create",
"(",
"$",
"path",
"=",
"''",
",",
"array",
"$",
"server",
"=",
"array",
"(",
")",
",",
"array",
"$",
"globals",
"=",
"array",
"(",
")",
")",
"{",
"$",
"globals",
"=",
"empty",
"(",
"$",
"globals",
")",
"?... | Creates an instance of CodeIgniter based on the application path.
@param string $path
@param array $server
@param array $globals
@return \CI_Controller | [
"Creates",
"an",
"instance",
"of",
"CodeIgniter",
"based",
"on",
"the",
"application",
"path",
"."
] | a9189c80ddcbafb3b21ea3b491b664c8e860c584 | https://github.com/rougin/spark-plug/blob/a9189c80ddcbafb3b21ea3b491b664c8e860c584/src/Instance.php#L23-L32 |
229,491 | fuelphp/common | src/Num.php | Num.formatBytes | public function formatBytes($bytes = 0, $decimals = 0)
{
static $quant = array(
'TB' => 1099511627776, // pow( 1024, 4)
'GB' => 1073741824, // pow( 1024, 3)
'MB' => 1048576, // pow( 1024, 2)
'KB' => 1024, // pow( 1024, 1)
'B ' => 1, // pow( 1024, 0)
);
foreach (... | php | public function formatBytes($bytes = 0, $decimals = 0)
{
static $quant = array(
'TB' => 1099511627776, // pow( 1024, 4)
'GB' => 1073741824, // pow( 1024, 3)
'MB' => 1048576, // pow( 1024, 2)
'KB' => 1024, // pow( 1024, 1)
'B ' => 1, // pow( 1024, 0)
);
foreach (... | [
"public",
"function",
"formatBytes",
"(",
"$",
"bytes",
"=",
"0",
",",
"$",
"decimals",
"=",
"0",
")",
"{",
"static",
"$",
"quant",
"=",
"array",
"(",
"'TB'",
"=>",
"1099511627776",
",",
"// pow( 1024, 4)",
"'GB'",
"=>",
"1073741824",
",",
"// pow( 1024, 3... | Converts a number of bytes to a human readable number by taking the
number of that unit that the bytes will go into it. Supports TB value.
Note: Integers in PHP are limited to 32 bits, unless they are on 64 bit
architectures, then they have 64 bit size. If you need to place the
larger size then what the PHP integer ty... | [
"Converts",
"a",
"number",
"of",
"bytes",
"to",
"a",
"human",
"readable",
"number",
"by",
"taking",
"the",
"number",
"of",
"that",
"unit",
"that",
"the",
"bytes",
"will",
"go",
"into",
"it",
".",
"Supports",
"TB",
"value",
"."
] | ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40 | https://github.com/fuelphp/common/blob/ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40/src/Num.php#L174-L193 |
229,492 | fuelphp/common | src/Num.php | Num.format | public function format($string, $format)
{
if(empty($format) or empty($string))
{
return $string;
}
$result = '';
$fpos = 0;
$spos = 0;
while ((strlen($format) - 1) >= $fpos)
{
if (ctype_alnum(substr($format, $fpos, 1)))
{
$result .= substr($string, $spos, 1);
$spos++;
}
else
... | php | public function format($string, $format)
{
if(empty($format) or empty($string))
{
return $string;
}
$result = '';
$fpos = 0;
$spos = 0;
while ((strlen($format) - 1) >= $fpos)
{
if (ctype_alnum(substr($format, $fpos, 1)))
{
$result .= substr($string, $spos, 1);
$spos++;
}
else
... | [
"public",
"function",
"format",
"(",
"$",
"string",
",",
"$",
"format",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"format",
")",
"or",
"empty",
"(",
"$",
"string",
")",
")",
"{",
"return",
"$",
"string",
";",
"}",
"$",
"result",
"=",
"''",
";",
"... | Formats a number by injecting non-numeric characters in a specified
format into the string in the positions they appear in the format.
Usage:
<code>
$num = new \Fuel\Common\Num();
echo $num->format('1234567890', '(000) 000-0000'); // (123) 456-7890
echo $num->format('1234567890', '000.000.0000'); // 123.456.7890
</cod... | [
"Formats",
"a",
"number",
"by",
"injecting",
"non",
"-",
"numeric",
"characters",
"in",
"a",
"specified",
"format",
"into",
"the",
"string",
"in",
"the",
"positions",
"they",
"appear",
"in",
"the",
"format",
"."
] | ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40 | https://github.com/fuelphp/common/blob/ddb6b9ced050f1ae7b22326d9c8c32b0dabdbf40/src/Num.php#L251-L278 |
229,493 | joomla-framework/datetime | src/Since/DateTimeSince.php | DateTimeSince.calc | private function calc(DateTime $base, DateTime $datetime = null, $detailLevel = 1)
{
$this->translator = $base->getTranslator();
$datetime = is_null($datetime) ? DateTime::now() : $datetime;
$detailLevel = intval($detailLevel);
$diff = $this->diffInUnits($base->diff($datetime, true), $detailLevel);
$item ... | php | private function calc(DateTime $base, DateTime $datetime = null, $detailLevel = 1)
{
$this->translator = $base->getTranslator();
$datetime = is_null($datetime) ? DateTime::now() : $datetime;
$detailLevel = intval($detailLevel);
$diff = $this->diffInUnits($base->diff($datetime, true), $detailLevel);
$item ... | [
"private",
"function",
"calc",
"(",
"DateTime",
"$",
"base",
",",
"DateTime",
"$",
"datetime",
"=",
"null",
",",
"$",
"detailLevel",
"=",
"1",
")",
"{",
"$",
"this",
"->",
"translator",
"=",
"$",
"base",
"->",
"getTranslator",
"(",
")",
";",
"$",
"da... | Calculates the difference between dates.
@param DateTime $base The base date.
@param DateTime $datetime The date to compare to. Default is null and this means that
the base date will be compared to the current time.
@param integer $detailLevel The level of detail to retrieve.
@return array
@... | [
"Calculates",
"the",
"difference",
"between",
"dates",
"."
] | 732fb60f054fa6aceaef93ff9a12d939d2a4797c | https://github.com/joomla-framework/datetime/blob/732fb60f054fa6aceaef93ff9a12d939d2a4797c/src/Since/DateTimeSince.php#L80-L97 |
229,494 | joomla-framework/datetime | src/Since/DateTimeSince.php | DateTimeSince.diffInUnits | private function diffInUnits(DateInterval $interval, $detailLevel)
{
$units = array('y' => 'year', 'm' => 'month', 'd' => 'day',
'h' => 'hour', 'i' => 'minute', 's' => 'second'
);
$diff = array();
foreach ($units as $format => $unit)
{
$amount = $interval->format('%' . $format);
/** Adding suppor... | php | private function diffInUnits(DateInterval $interval, $detailLevel)
{
$units = array('y' => 'year', 'm' => 'month', 'd' => 'day',
'h' => 'hour', 'i' => 'minute', 's' => 'second'
);
$diff = array();
foreach ($units as $format => $unit)
{
$amount = $interval->format('%' . $format);
/** Adding suppor... | [
"private",
"function",
"diffInUnits",
"(",
"DateInterval",
"$",
"interval",
",",
"$",
"detailLevel",
")",
"{",
"$",
"units",
"=",
"array",
"(",
"'y'",
"=>",
"'year'",
",",
"'m'",
"=>",
"'month'",
",",
"'d'",
"=>",
"'day'",
",",
"'h'",
"=>",
"'hour'",
"... | Calculates the difference between dates for all units of a time.
@param DateInterval $interval The difference between dates.
@param integer $detailLevel The level of detail to retrieve.
@return array
@since 2.0.0 | [
"Calculates",
"the",
"difference",
"between",
"dates",
"for",
"all",
"units",
"of",
"a",
"time",
"."
] | 732fb60f054fa6aceaef93ff9a12d939d2a4797c | https://github.com/joomla-framework/datetime/blob/732fb60f054fa6aceaef93ff9a12d939d2a4797c/src/Since/DateTimeSince.php#L109-L152 |
229,495 | joomla-framework/datetime | src/Since/DateTimeSince.php | DateTimeSince.parseUnits | private function parseUnits($diff, $allowAlmost = false)
{
if (empty($diff))
{
return '';
}
$isAlmost = false;
$string = array();
foreach ($diff as $time)
{
if ($allowAlmost)
{
$isAlmost = $this->isAlmost($time);
}
$string[] = $this->translator->choice($time['unit'], $time['amount']... | php | private function parseUnits($diff, $allowAlmost = false)
{
if (empty($diff))
{
return '';
}
$isAlmost = false;
$string = array();
foreach ($diff as $time)
{
if ($allowAlmost)
{
$isAlmost = $this->isAlmost($time);
}
$string[] = $this->translator->choice($time['unit'], $time['amount']... | [
"private",
"function",
"parseUnits",
"(",
"$",
"diff",
",",
"$",
"allowAlmost",
"=",
"false",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"diff",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"isAlmost",
"=",
"false",
";",
"$",
"string",
"=",
"array",
... | Parses an array of units into a string.
@param array $diff An array of differences for every unit of a time.
@param boolean $allowAlmost Do you want to get an almost difference?
@return string
@since 2.0.0 | [
"Parses",
"an",
"array",
"of",
"units",
"into",
"a",
"string",
"."
] | 732fb60f054fa6aceaef93ff9a12d939d2a4797c | https://github.com/joomla-framework/datetime/blob/732fb60f054fa6aceaef93ff9a12d939d2a4797c/src/Since/DateTimeSince.php#L164-L202 |
229,496 | hubzero/orcid-php | src/Profile.php | Profile.email | public function email()
{
$this->raw();
$email = null;
$person = $this->person();
if (isset($person->emails)) {
if (isset($person->emails->email)) {
if (is_array($person->emails->email) && isset($person->emails->email[0])) {
$email = ... | php | public function email()
{
$this->raw();
$email = null;
$person = $this->person();
if (isset($person->emails)) {
if (isset($person->emails->email)) {
if (is_array($person->emails->email) && isset($person->emails->email[0])) {
$email = ... | [
"public",
"function",
"email",
"(",
")",
"{",
"$",
"this",
"->",
"raw",
"(",
")",
";",
"$",
"email",
"=",
"null",
";",
"$",
"person",
"=",
"$",
"this",
"->",
"person",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"person",
"->",
"emails",
")",
... | Grabs the users email if it's set and available
@return string|null | [
"Grabs",
"the",
"users",
"email",
"if",
"it",
"s",
"set",
"and",
"available"
] | 2b9a31bd3932af0e18d4b80029901c8ec84a0861 | https://github.com/hubzero/orcid-php/blob/2b9a31bd3932af0e18d4b80029901c8ec84a0861/src/Profile.php#L81-L97 |
229,497 | hubzero/orcid-php | src/Profile.php | Profile.fullName | public function fullName()
{
$this->raw();
$details = $this->person()->name;
// "given-names" is a required field on ORCID profiles.
// "family-name", however, may or may not be available.
// https://members.orcid.org/api/tutorial/reading-xml#names
return $details->{... | php | public function fullName()
{
$this->raw();
$details = $this->person()->name;
// "given-names" is a required field on ORCID profiles.
// "family-name", however, may or may not be available.
// https://members.orcid.org/api/tutorial/reading-xml#names
return $details->{... | [
"public",
"function",
"fullName",
"(",
")",
"{",
"$",
"this",
"->",
"raw",
"(",
")",
";",
"$",
"details",
"=",
"$",
"this",
"->",
"person",
"(",
")",
"->",
"name",
";",
"// \"given-names\" is a required field on ORCID profiles.",
"// \"family-name\", however, may ... | Grabs the raw name elements to create fullname
@return string | [
"Grabs",
"the",
"raw",
"name",
"elements",
"to",
"create",
"fullname"
] | 2b9a31bd3932af0e18d4b80029901c8ec84a0861 | https://github.com/hubzero/orcid-php/blob/2b9a31bd3932af0e18d4b80029901c8ec84a0861/src/Profile.php#L104-L113 |
229,498 | gridonic/hapi | src/Harvest/Model/Range.php | Range.today | public static function today($timeZone = null)
{
$now = null;
$before = null;
if ( is_null($timeZone) ) {
$now = new \DateTime();
$before = new \DateTime();
} else {
$now = new \DateTime( "now", new \DateTimeZone( $timeZone ) );
$before... | php | public static function today($timeZone = null)
{
$now = null;
$before = null;
if ( is_null($timeZone) ) {
$now = new \DateTime();
$before = new \DateTime();
} else {
$now = new \DateTime( "now", new \DateTimeZone( $timeZone ) );
$before... | [
"public",
"static",
"function",
"today",
"(",
"$",
"timeZone",
"=",
"null",
")",
"{",
"$",
"now",
"=",
"null",
";",
"$",
"before",
"=",
"null",
";",
"if",
"(",
"is_null",
"(",
"$",
"timeZone",
")",
")",
"{",
"$",
"now",
"=",
"new",
"\\",
"DateTim... | return Range object set to today
<code>
$range = Range::today( "EST" );
</code>
@param string $timeZone User Time Zone
@return Range | [
"return",
"Range",
"object",
"set",
"to",
"today"
] | 018c05b548428aa3e8d1040e0e2b1ec75b85adfe | https://github.com/gridonic/hapi/blob/018c05b548428aa3e8d1040e0e2b1ec75b85adfe/src/Harvest/Model/Range.php#L85-L99 |
229,499 | gridonic/hapi | src/Harvest/Model/Range.php | Range.thisWeek | public static function thisWeek($timeZone = null, $startOfWeek = 0)
{
$now = null;
$before = null;
if ( is_null($timeZone) ) {
$now = new \DateTime();
$before = new \DateTime();
} else {
$now = new \DateTime( "now", new \DateTimeZone( $timeZone ) )... | php | public static function thisWeek($timeZone = null, $startOfWeek = 0)
{
$now = null;
$before = null;
if ( is_null($timeZone) ) {
$now = new \DateTime();
$before = new \DateTime();
} else {
$now = new \DateTime( "now", new \DateTimeZone( $timeZone ) )... | [
"public",
"static",
"function",
"thisWeek",
"(",
"$",
"timeZone",
"=",
"null",
",",
"$",
"startOfWeek",
"=",
"0",
")",
"{",
"$",
"now",
"=",
"null",
";",
"$",
"before",
"=",
"null",
";",
"if",
"(",
"is_null",
"(",
"$",
"timeZone",
")",
")",
"{",
... | return Range object set to this week
<code>
$range = Range::thisWeek( "EST", Range::SUNDAY );
</code>
@param string $timeZone User Time Zone
@param int $startOfWeek Starting day of the week
@return Range | [
"return",
"Range",
"object",
"set",
"to",
"this",
"week"
] | 018c05b548428aa3e8d1040e0e2b1ec75b85adfe | https://github.com/gridonic/hapi/blob/018c05b548428aa3e8d1040e0e2b1ec75b85adfe/src/Harvest/Model/Range.php#L112-L129 |
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.