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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
21,900 | giftcards/Encryption | CipherText/Rotator/Store/StoreRegistryBuilder.php | StoreRegistryBuilder.addStoreToBuildQueue | private function addStoreToBuildQueue($storeName, $builderName, array $options)
{
if (!$this->factory->getRegistry()->has($builderName)) {
throw new \DomainException(sprintf("Unknown builder: %s", $builderName));
}
$this->buildQueue[$storeName] = array($builderName, $options);
... | php | private function addStoreToBuildQueue($storeName, $builderName, array $options)
{
if (!$this->factory->getRegistry()->has($builderName)) {
throw new \DomainException(sprintf("Unknown builder: %s", $builderName));
}
$this->buildQueue[$storeName] = array($builderName, $options);
... | [
"private",
"function",
"addStoreToBuildQueue",
"(",
"$",
"storeName",
",",
"$",
"builderName",
",",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"factory",
"->",
"getRegistry",
"(",
")",
"->",
"has",
"(",
"$",
"builderName",
")",... | Queues a store to be built
@param string $storeName
@param $builderName
@param array $options
@return StoreRegistryBuilder | [
"Queues",
"a",
"store",
"to",
"be",
"built"
] | a48f92408538e2ffe1c8603f168d57803aad7100 | https://github.com/giftcards/Encryption/blob/a48f92408538e2ffe1c8603f168d57803aad7100/CipherText/Rotator/Store/StoreRegistryBuilder.php#L90-L97 |
21,901 | j-d/draggy | src/Draggy/Loader.php | Loader.getProjectProperties | private function getProjectProperties()
{
$r = '';
$projectOptions = (array)$this->xml->xpath('/draggy/project');
$projectOptions = (array)$projectOptions[0];
$this->checkMandatoryAttributes('Project', $projectOptions, ['language', 'description', 'orm', 'framework']);
$r .... | php | private function getProjectProperties()
{
$r = '';
$projectOptions = (array)$this->xml->xpath('/draggy/project');
$projectOptions = (array)$projectOptions[0];
$this->checkMandatoryAttributes('Project', $projectOptions, ['language', 'description', 'orm', 'framework']);
$r .... | [
"private",
"function",
"getProjectProperties",
"(",
")",
"{",
"$",
"r",
"=",
"''",
";",
"$",
"projectOptions",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"xml",
"->",
"xpath",
"(",
"'/draggy/project'",
")",
";",
"$",
"projectOptions",
"=",
"(",
"array",
... | Get the project properties from the saved file
@return string | [
"Get",
"the",
"project",
"properties",
"from",
"the",
"saved",
"file"
] | 97ffc66e1aacb5f685d7aac5251c4abb8888d4bb | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Loader.php#L91-L107 |
21,902 | j-d/draggy | src/Draggy/Loader.php | Loader.getAutocodeProperties | private function getAutocodeProperties()
{
$r = '';
$autocode = (array)$this->xml->xpath('/draggy/autocode');
$autocode = (array)$autocode[0];
$autocodeProperties = (array)$autocode['properties'];
$autocodeConfigurations = (array)$autocode['configurations'];
$au... | php | private function getAutocodeProperties()
{
$r = '';
$autocode = (array)$this->xml->xpath('/draggy/autocode');
$autocode = (array)$autocode[0];
$autocodeProperties = (array)$autocode['properties'];
$autocodeConfigurations = (array)$autocode['configurations'];
$au... | [
"private",
"function",
"getAutocodeProperties",
"(",
")",
"{",
"$",
"r",
"=",
"''",
";",
"$",
"autocode",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"xml",
"->",
"xpath",
"(",
"'/draggy/autocode'",
")",
";",
"$",
"autocode",
"=",
"(",
"array",
")",
"... | Get the project autocode properties from the saved file
@return string | [
"Get",
"the",
"project",
"autocode",
"properties",
"from",
"the",
"saved",
"file"
] | 97ffc66e1aacb5f685d7aac5251c4abb8888d4bb | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Loader.php#L114-L138 |
21,903 | j-d/draggy | src/Draggy/Loader.php | Loader.getModules | private function getModules()
{
$modules = (array)$this->xml->xpath('/draggy/module');
$r = '';
foreach ($modules as $module) {
$moduleAttributes = (array)$module;
$moduleAttributes = (array)$moduleAttributes['@attributes'];
$this->checkMandatoryAttribu... | php | private function getModules()
{
$modules = (array)$this->xml->xpath('/draggy/module');
$r = '';
foreach ($modules as $module) {
$moduleAttributes = (array)$module;
$moduleAttributes = (array)$moduleAttributes['@attributes'];
$this->checkMandatoryAttribu... | [
"private",
"function",
"getModules",
"(",
")",
"{",
"$",
"modules",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"xml",
"->",
"xpath",
"(",
"'/draggy/module'",
")",
";",
"$",
"r",
"=",
"''",
";",
"foreach",
"(",
"$",
"modules",
"as",
"$",
"module",
"... | Get the project modules
@return string | [
"Get",
"the",
"project",
"modules"
] | 97ffc66e1aacb5f685d7aac5251c4abb8888d4bb | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Loader.php#L145-L168 |
21,904 | j-d/draggy | src/Draggy/Loader.php | Loader.getInterfaces | private function getInterfaces()
{
$r = '';
// Inside interfaces
foreach ($this->modules as $module) {
$interfaces = (array)$this->xml->xpath('/draggy/module[@name=\'' . $module . '\']/interface');
foreach ($interfaces as $interface) {
$interfaceAttr... | php | private function getInterfaces()
{
$r = '';
// Inside interfaces
foreach ($this->modules as $module) {
$interfaces = (array)$this->xml->xpath('/draggy/module[@name=\'' . $module . '\']/interface');
foreach ($interfaces as $interface) {
$interfaceAttr... | [
"private",
"function",
"getInterfaces",
"(",
")",
"{",
"$",
"r",
"=",
"''",
";",
"// Inside interfaces",
"foreach",
"(",
"$",
"this",
"->",
"modules",
"as",
"$",
"module",
")",
"{",
"$",
"interfaces",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"xml",
... | Get the project interfaces
@return string | [
"Get",
"the",
"project",
"interfaces"
] | 97ffc66e1aacb5f685d7aac5251c4abb8888d4bb | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Loader.php#L381-L440 |
21,905 | j-d/draggy | src/Draggy/Loader.php | Loader.getLoaderJS | public function getLoaderJS()
{
if ($this->newFile) {
return '';
}
$r = '';
$r .= $this->getProjectProperties();
// FIRST STEP: Load all modules and entities
$r .= $this->getModules();
$r .= $this->getClasses();
$r .= $this->getAbstracts... | php | public function getLoaderJS()
{
if ($this->newFile) {
return '';
}
$r = '';
$r .= $this->getProjectProperties();
// FIRST STEP: Load all modules and entities
$r .= $this->getModules();
$r .= $this->getClasses();
$r .= $this->getAbstracts... | [
"public",
"function",
"getLoaderJS",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"newFile",
")",
"{",
"return",
"''",
";",
"}",
"$",
"r",
"=",
"''",
";",
"$",
"r",
".=",
"$",
"this",
"->",
"getProjectProperties",
"(",
")",
";",
"// FIRST STEP: Load ... | Returns all the JS code to load the project
@return string | [
"Returns",
"all",
"the",
"JS",
"code",
"to",
"load",
"the",
"project"
] | 97ffc66e1aacb5f685d7aac5251c4abb8888d4bb | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Loader.php#L756-L789 |
21,906 | surebert/surebert-framework | src/sb/Excel/Reader.php | Reader.toArray | public function toArray($sheet = 0)
{
$arr = array();
for ($row = 1; $row <= $this->rowcount($sheet); $row++) {
for ($col = 1; $col <= $this->colcount($sheet); $col++) {
$arr[$row][$col] = $this->val($row, $col, $sheet);
}
}
return $arr;
} | php | public function toArray($sheet = 0)
{
$arr = array();
for ($row = 1; $row <= $this->rowcount($sheet); $row++) {
for ($col = 1; $col <= $this->colcount($sheet); $col++) {
$arr[$row][$col] = $this->val($row, $col, $sheet);
}
}
return $arr;
} | [
"public",
"function",
"toArray",
"(",
"$",
"sheet",
"=",
"0",
")",
"{",
"$",
"arr",
"=",
"array",
"(",
")",
";",
"for",
"(",
"$",
"row",
"=",
"1",
";",
"$",
"row",
"<=",
"$",
"this",
"->",
"rowcount",
"(",
"$",
"sheet",
")",
";",
"$",
"row",
... | export to multi dimensional array
@param integer $sheet
@return array | [
"export",
"to",
"multi",
"dimensional",
"array"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Reader.php#L86-L96 |
21,907 | surebert/surebert-framework | src/sb/Excel/Reader.php | Reader.info | public function info($row, $col, $type = '', $sheet = 0)
{
$col = $this->getCol($col);
if (array_key_exists('cellsInfo', $this->sheets[$sheet])
&& array_key_exists($row, $this->sheets[$sheet]['cellsInfo'])
&& array_key_exists($col, $this->sheets[$sheet]['cellsInfo'][$row])
... | php | public function info($row, $col, $type = '', $sheet = 0)
{
$col = $this->getCol($col);
if (array_key_exists('cellsInfo', $this->sheets[$sheet])
&& array_key_exists($row, $this->sheets[$sheet]['cellsInfo'])
&& array_key_exists($col, $this->sheets[$sheet]['cellsInfo'][$row])
... | [
"public",
"function",
"info",
"(",
"$",
"row",
",",
"$",
"col",
",",
"$",
"type",
"=",
"''",
",",
"$",
"sheet",
"=",
"0",
")",
"{",
"$",
"col",
"=",
"$",
"this",
"->",
"getCol",
"(",
"$",
"col",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"... | Gets info for a specifc cell of a specific sheet
@param int $row
@param int $col
@param string $type
@param int $sheet
@return string | [
"Gets",
"info",
"for",
"a",
"specifc",
"cell",
"of",
"a",
"specific",
"sheet"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Reader.php#L106-L116 |
21,908 | alevilar/ristorantino-vendor | Mesa/Model/Mozo.php | Mozo.mesasAbiertas | public function mesasAbiertas($mozo_id = null, $lastAccess = null){
$conditions = array();
// si vino el mozo por parametro, es porque solo quiero las mesas de ese mozo
if ( !empty($mozo_id) ){
$conditions['Mozo.id'] = $mozo_id;
} else {
... | php | public function mesasAbiertas($mozo_id = null, $lastAccess = null){
$conditions = array();
// si vino el mozo por parametro, es porque solo quiero las mesas de ese mozo
if ( !empty($mozo_id) ){
$conditions['Mozo.id'] = $mozo_id;
} else {
... | [
"public",
"function",
"mesasAbiertas",
"(",
"$",
"mozo_id",
"=",
"null",
",",
"$",
"lastAccess",
"=",
"null",
")",
"{",
"$",
"conditions",
"=",
"array",
"(",
")",
";",
"// si vino el mozo por parametro, es porque solo quiero las mesas de ese mozo",
"if",
"(",
"!",
... | Para todos los mozos activos, me trae sus mesas abiertas
@param int $mozo_id id del mozo, en caso de que no le pase ninguno, me busca todos
@return array Mozos con sus mesas, Comandas, detalleComanda, productos y sabores | [
"Para",
"todos",
"los",
"mozos",
"activos",
"me",
"trae",
"sus",
"mesas",
"abiertas"
] | 6b91a1e20cc0ba09a1968d77e3de6512cfa2d966 | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Mesa/Model/Mozo.php#L103-L161 |
21,909 | alevilar/ristorantino-vendor | Mesa/Model/Mozo.php | Mozo.mesasBorradas | public function mesasBorradas($mozo_id = null, $lastAccess = null){
if ( empty($lastAccess) ) {
return array();
}
$conditions = array();
// si vino el mozo por parametro, es porque solo quiero las mesas de ese mozo
if ( !empty($m... | php | public function mesasBorradas($mozo_id = null, $lastAccess = null){
if ( empty($lastAccess) ) {
return array();
}
$conditions = array();
// si vino el mozo por parametro, es porque solo quiero las mesas de ese mozo
if ( !empty($m... | [
"public",
"function",
"mesasBorradas",
"(",
"$",
"mozo_id",
"=",
"null",
",",
"$",
"lastAccess",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"lastAccess",
")",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"$",
"conditions",
"=",
"array",... | Para todos los mozos activos, me trae sus mesas eliminadas entre cada actualizacion de datos
@param int $mozo_id id del mozo, en caso de que no le pase ninguno, me busca todos
@return array Mozos con sus mesas, Comandas, detalleComanda, productos y sabores | [
"Para",
"todos",
"los",
"mozos",
"activos",
"me",
"trae",
"sus",
"mesas",
"eliminadas",
"entre",
"cada",
"actualizacion",
"de",
"datos"
] | 6b91a1e20cc0ba09a1968d77e3de6512cfa2d966 | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Mesa/Model/Mozo.php#L171-L223 |
21,910 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml/DocBlockConverter.php | DocBlockConverter.addInheritedFromTag | protected function addInheritedFromTag(\DOMElement $docBlock, $descriptor)
{
$parentElement = $descriptor->getInheritedElement();
if (! $parentElement instanceof $descriptor) {
return;
}
$child = new \DOMElement('tag');
$docBlock->appendChild($child);
$r... | php | protected function addInheritedFromTag(\DOMElement $docBlock, $descriptor)
{
$parentElement = $descriptor->getInheritedElement();
if (! $parentElement instanceof $descriptor) {
return;
}
$child = new \DOMElement('tag');
$docBlock->appendChild($child);
$r... | [
"protected",
"function",
"addInheritedFromTag",
"(",
"\\",
"DOMElement",
"$",
"docBlock",
",",
"$",
"descriptor",
")",
"{",
"$",
"parentElement",
"=",
"$",
"descriptor",
"->",
"getInheritedElement",
"(",
")",
";",
"if",
"(",
"!",
"$",
"parentElement",
"instanc... | Adds the 'inherited_from' tag when a Descriptor inherits from another Descriptor.
@param \DOMElement $docBlock
@param DescriptorAbstract $descriptor
@return void | [
"Adds",
"the",
"inherited_from",
"tag",
"when",
"a",
"Descriptor",
"inherits",
"from",
"another",
"Descriptor",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml/DocBlockConverter.php#L137-L153 |
21,911 | frdl/webfan | .ApplicationComposer/lib/webdof/valFormats.php | valFormats._isuuidversion | protected function _isuuidversion($in, $strict = true)
{
if(false !== $strict)
{
$in = strtolower($in );
$alphanums = "a-f";
}else{
$alphanums = "a-z";
}
if(!preg_match("/^[0-9$alphanums]{8}-[0-9$alphanums]{4}-(?<version>[0-9$alphanums]{1})[0-9$alpha... | php | protected function _isuuidversion($in, $strict = true)
{
if(false !== $strict)
{
$in = strtolower($in );
$alphanums = "a-f";
}else{
$alphanums = "a-z";
}
if(!preg_match("/^[0-9$alphanums]{8}-[0-9$alphanums]{4}-(?<version>[0-9$alphanums]{1})[0-9$alpha... | [
"protected",
"function",
"_isuuidversion",
"(",
"$",
"in",
",",
"$",
"strict",
"=",
"true",
")",
"{",
"if",
"(",
"false",
"!==",
"$",
"strict",
")",
"{",
"$",
"in",
"=",
"strtolower",
"(",
"$",
"in",
")",
";",
"$",
"alphanums",
"=",
"\"a-f\"",
";",... | returns UUID version or FALSE if no UUID format | [
"returns",
"UUID",
"version",
"or",
"FALSE",
"if",
"no",
"UUID",
"format"
] | 84d270377685224e891cd9d571b103b36f05b845 | https://github.com/frdl/webfan/blob/84d270377685224e891cd9d571b103b36f05b845/.ApplicationComposer/lib/webdof/valFormats.php#L892-L909 |
21,912 | frdl/webfan | .ApplicationComposer/lib/webdof/valFormats.php | valFormats._ip2long | protected function _ip2long($ip, $getVersion = TRUE)
{
$version = $this->_isip($ip);
if($getVersion === FALSE && $version === FALSE)return FALSE;
if($getVersion === FALSE && $version === 'ipv4')return $this->_ip2long_v4($ip);
if($getVersion === FALSE && $version === 'ipv6')return $this->_ip2long_v6($ip);
... | php | protected function _ip2long($ip, $getVersion = TRUE)
{
$version = $this->_isip($ip);
if($getVersion === FALSE && $version === FALSE)return FALSE;
if($getVersion === FALSE && $version === 'ipv4')return $this->_ip2long_v4($ip);
if($getVersion === FALSE && $version === 'ipv6')return $this->_ip2long_v6($ip);
... | [
"protected",
"function",
"_ip2long",
"(",
"$",
"ip",
",",
"$",
"getVersion",
"=",
"TRUE",
")",
"{",
"$",
"version",
"=",
"$",
"this",
"->",
"_isip",
"(",
"$",
"ip",
")",
";",
"if",
"(",
"$",
"getVersion",
"===",
"FALSE",
"&&",
"$",
"version",
"==="... | IP Addresses...
- php.net | [
"IP",
"Addresses",
"...",
"-",
"php",
".",
"net"
] | 84d270377685224e891cd9d571b103b36f05b845 | https://github.com/frdl/webfan/blob/84d270377685224e891cd9d571b103b36f05b845/.ApplicationComposer/lib/webdof/valFormats.php#L1038-L1050 |
21,913 | Josantonius/WP_Image | src/class-wp-image.php | WP_Image.save | public static function save( $url, $post_ID, $featured = false ) {
$url = filter_var( $url, FILTER_VALIDATE_URL );
if ( false === $url || false === get_post_status( $post_ID ) ) {
return false;
}
$filename = basename( $url );
$filepath = self::upload( $url, $filename );
$attachment = [
'post_mime_... | php | public static function save( $url, $post_ID, $featured = false ) {
$url = filter_var( $url, FILTER_VALIDATE_URL );
if ( false === $url || false === get_post_status( $post_ID ) ) {
return false;
}
$filename = basename( $url );
$filepath = self::upload( $url, $filename );
$attachment = [
'post_mime_... | [
"public",
"static",
"function",
"save",
"(",
"$",
"url",
",",
"$",
"post_ID",
",",
"$",
"featured",
"=",
"false",
")",
"{",
"$",
"url",
"=",
"filter_var",
"(",
"$",
"url",
",",
"FILTER_VALIDATE_URL",
")",
";",
"if",
"(",
"false",
"===",
"$",
"url",
... | Save image and associate it with a specific post.
@param string $url → external url image.
@param int $post_ID → post id.
@param boolean $featured → if image is featured.
@return string|false → URI for an attachment file or false on failure. | [
"Save",
"image",
"and",
"associate",
"it",
"with",
"a",
"specific",
"post",
"."
] | 59a2b7bb79db81e70d7b6c3eb3a5ce603c20e204 | https://github.com/Josantonius/WP_Image/blob/59a2b7bb79db81e70d7b6c3eb3a5ce603c20e204/src/class-wp-image.php#L31-L62 |
21,914 | Josantonius/WP_Image | src/class-wp-image.php | WP_Image.upload | public static function upload( $url, $filename ) {
$dir = wp_upload_dir();
if ( ! isset( $dir['path'], $dir['basedir'] ) ) {
return false;
}
$path = wp_mkdir_p( $dir['path'] ) ? $dir['path'] : $dir['basedir'];
$path = rtrim( $path, '/' ) . '/';
$image_data = @file_get_contents( $url );
if ( $image... | php | public static function upload( $url, $filename ) {
$dir = wp_upload_dir();
if ( ! isset( $dir['path'], $dir['basedir'] ) ) {
return false;
}
$path = wp_mkdir_p( $dir['path'] ) ? $dir['path'] : $dir['basedir'];
$path = rtrim( $path, '/' ) . '/';
$image_data = @file_get_contents( $url );
if ( $image... | [
"public",
"static",
"function",
"upload",
"(",
"$",
"url",
",",
"$",
"filename",
")",
"{",
"$",
"dir",
"=",
"wp_upload_dir",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"dir",
"[",
"'path'",
"]",
",",
"$",
"dir",
"[",
"'basedir'",
"]",
")",... | Upload image to WordPress upload directory.
@since 1.0.2
@param string $url → external url image.
@param string $filename → filename.
@return string|false → path to upload image or false on failure. | [
"Upload",
"image",
"to",
"WordPress",
"upload",
"directory",
"."
] | 59a2b7bb79db81e70d7b6c3eb3a5ce603c20e204 | https://github.com/Josantonius/WP_Image/blob/59a2b7bb79db81e70d7b6c3eb3a5ce603c20e204/src/class-wp-image.php#L74-L92 |
21,915 | Josantonius/WP_Image | src/class-wp-image.php | WP_Image.delete_all_attachment | public static function delete_all_attachment( $post_ID, $force = false ) {
if ( get_post_status( $post_ID ) === false ) {
return false;
}
$counter = 0;
$attachments = get_posts(
[
'post_type' => 'attachment',
'posts_per_page' => 100,
'post_status' => 'any',
'post_mime_type' => '... | php | public static function delete_all_attachment( $post_ID, $force = false ) {
if ( get_post_status( $post_ID ) === false ) {
return false;
}
$counter = 0;
$attachments = get_posts(
[
'post_type' => 'attachment',
'posts_per_page' => 100,
'post_status' => 'any',
'post_mime_type' => '... | [
"public",
"static",
"function",
"delete_all_attachment",
"(",
"$",
"post_ID",
",",
"$",
"force",
"=",
"false",
")",
"{",
"if",
"(",
"get_post_status",
"(",
"$",
"post_ID",
")",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"$",
"counter",
"=",
... | Deletes an attachment and all of its derivatives.
@since 1.0.3
@param int $post_ID → post id.
@param boolean $force → force deletion.
@return int|false → attachments deleted. | [
"Deletes",
"an",
"attachment",
"and",
"all",
"of",
"its",
"derivatives",
"."
] | 59a2b7bb79db81e70d7b6c3eb3a5ce603c20e204 | https://github.com/Josantonius/WP_Image/blob/59a2b7bb79db81e70d7b6c3eb3a5ce603c20e204/src/class-wp-image.php#L104-L129 |
21,916 | caffeinated/beverage | src/Repositories/AbstractEloquentRepository.php | AbstractEloquentRepository.delete | public function delete($id)
{
$this->fireEvent('deleting', [$id]);
$deleted = $this->model->destroy($id);
$this->fireEvent('deleted', [$id, $deleted]);
return $deleted;
} | php | public function delete($id)
{
$this->fireEvent('deleting', [$id]);
$deleted = $this->model->destroy($id);
$this->fireEvent('deleted', [$id, $deleted]);
return $deleted;
} | [
"public",
"function",
"delete",
"(",
"$",
"id",
")",
"{",
"$",
"this",
"->",
"fireEvent",
"(",
"'deleting'",
",",
"[",
"$",
"id",
"]",
")",
";",
"$",
"deleted",
"=",
"$",
"this",
"->",
"model",
"->",
"destroy",
"(",
"$",
"id",
")",
";",
"$",
"t... | Find and delete a resource by ID.
@param int $id
@return bool | [
"Find",
"and",
"delete",
"a",
"resource",
"by",
"ID",
"."
] | c7d612a1d3bc1baddc97fec60ab17224550efaf3 | https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Repositories/AbstractEloquentRepository.php#L68-L77 |
21,917 | caffeinated/beverage | src/Repositories/AbstractEloquentRepository.php | AbstractEloquentRepository.store | public function store($request)
{
$this->fireEvent('creating', [$request]);
$created = $this->model->create($request);
$this->fireEvent('created', [$created]);
return $created;
} | php | public function store($request)
{
$this->fireEvent('creating', [$request]);
$created = $this->model->create($request);
$this->fireEvent('created', [$created]);
return $created;
} | [
"public",
"function",
"store",
"(",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"fireEvent",
"(",
"'creating'",
",",
"[",
"$",
"request",
"]",
")",
";",
"$",
"created",
"=",
"$",
"this",
"->",
"model",
"->",
"create",
"(",
"$",
"request",
")",
";"... | Store a new resource.
@param mixed $request
@return mixed | [
"Store",
"a",
"new",
"resource",
"."
] | c7d612a1d3bc1baddc97fec60ab17224550efaf3 | https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Repositories/AbstractEloquentRepository.php#L143-L152 |
21,918 | caffeinated/beverage | src/Repositories/AbstractEloquentRepository.php | AbstractEloquentRepository.with | public function with($relationships)
{
if (! is_array($relationships)) {
$relationships = explode(', ', $relationships);
}
if (! in_array($relationships, $this->withRelationships)) {
foreach ($relationships as $with) {
$this->withRelationships[] = $wi... | php | public function with($relationships)
{
if (! is_array($relationships)) {
$relationships = explode(', ', $relationships);
}
if (! in_array($relationships, $this->withRelationships)) {
foreach ($relationships as $with) {
$this->withRelationships[] = $wi... | [
"public",
"function",
"with",
"(",
"$",
"relationships",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"relationships",
")",
")",
"{",
"$",
"relationships",
"=",
"explode",
"(",
"', '",
",",
"$",
"relationships",
")",
";",
"}",
"if",
"(",
"!",
"in_... | Assign eager loading relationships.
@param string|array $relationships
@return AbstractEloquentRepository | [
"Assign",
"eager",
"loading",
"relationships",
"."
] | c7d612a1d3bc1baddc97fec60ab17224550efaf3 | https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Repositories/AbstractEloquentRepository.php#L178-L191 |
21,919 | caffeinated/beverage | src/Repositories/AbstractEloquentRepository.php | AbstractEloquentRepository.newQuery | protected function newQuery()
{
$query = $this->model->newQuery();
foreach ($this->withRelationships as $relationship) {
$query->with($relationship);
}
return $query;
} | php | protected function newQuery()
{
$query = $this->model->newQuery();
foreach ($this->withRelationships as $relationship) {
$query->with($relationship);
}
return $query;
} | [
"protected",
"function",
"newQuery",
"(",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"model",
"->",
"newQuery",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"withRelationships",
"as",
"$",
"relationship",
")",
"{",
"$",
"query",
"->",
"with",... | Create a new newQuery instance with eager loaded relationships.
@return newQuery | [
"Create",
"a",
"new",
"newQuery",
"instance",
"with",
"eager",
"loaded",
"relationships",
"."
] | c7d612a1d3bc1baddc97fec60ab17224550efaf3 | https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Repositories/AbstractEloquentRepository.php#L232-L241 |
21,920 | caffeinated/beverage | src/Repositories/AbstractEloquentRepository.php | AbstractEloquentRepository.fireEvent | protected function fireEvent($event, $data)
{
$fireableEvent = isset($this->fireEvents[$event]) ? $this->fireEvents[$event] : null;
if (! is_null($fireableEvent)) {
return $this->event->fire($fireableEvent, $data);
}
return null;
} | php | protected function fireEvent($event, $data)
{
$fireableEvent = isset($this->fireEvents[$event]) ? $this->fireEvents[$event] : null;
if (! is_null($fireableEvent)) {
return $this->event->fire($fireableEvent, $data);
}
return null;
} | [
"protected",
"function",
"fireEvent",
"(",
"$",
"event",
",",
"$",
"data",
")",
"{",
"$",
"fireableEvent",
"=",
"isset",
"(",
"$",
"this",
"->",
"fireEvents",
"[",
"$",
"event",
"]",
")",
"?",
"$",
"this",
"->",
"fireEvents",
"[",
"$",
"event",
"]",
... | Fire off an event if one is defined.
@param string $event
@param array $data
@return mixed | [
"Fire",
"off",
"an",
"event",
"if",
"one",
"is",
"defined",
"."
] | c7d612a1d3bc1baddc97fec60ab17224550efaf3 | https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Repositories/AbstractEloquentRepository.php#L250-L259 |
21,921 | bpolaszek/simple-dbal | src/Model/Adapter/Mysqli/MysqliAsync.php | MysqliAsync.wait | private function wait()
{
do {
if (empty($this->queries)) {
break;
}
$links = $errors = $reject = [];
foreach ($this->queries as $link) {
$links[] = $errors[] = $reject[] = $link['l'];
}
if (!mysqli_poll(... | php | private function wait()
{
do {
if (empty($this->queries)) {
break;
}
$links = $errors = $reject = [];
foreach ($this->queries as $link) {
$links[] = $errors[] = $reject[] = $link['l'];
}
if (!mysqli_poll(... | [
"private",
"function",
"wait",
"(",
")",
"{",
"do",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"queries",
")",
")",
"{",
"break",
";",
"}",
"$",
"links",
"=",
"$",
"errors",
"=",
"$",
"reject",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"... | Wait for pending queries to complete. | [
"Wait",
"for",
"pending",
"queries",
"to",
"complete",
"."
] | 52cb50d326ba5854191814b470f5e84950ebb6e6 | https://github.com/bpolaszek/simple-dbal/blob/52cb50d326ba5854191814b470f5e84950ebb6e6/src/Model/Adapter/Mysqli/MysqliAsync.php#L106-L143 |
21,922 | letyii/yii2-mongo-nested-set | NestedSetsBehavior.php | NestedSetsBehavior.makeRoot | public function makeRoot($runValidation = true, $attributes = null) {
$this->operation = self::OPERATION_MAKE_ROOT;
return $this->owner->save($runValidation, $attributes);
} | php | public function makeRoot($runValidation = true, $attributes = null) {
$this->operation = self::OPERATION_MAKE_ROOT;
return $this->owner->save($runValidation, $attributes);
} | [
"public",
"function",
"makeRoot",
"(",
"$",
"runValidation",
"=",
"true",
",",
"$",
"attributes",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"operation",
"=",
"self",
"::",
"OPERATION_MAKE_ROOT",
";",
"return",
"$",
"this",
"->",
"owner",
"->",
"save",
"(... | Creates the root node if the active record is new or moves it
as the root node.
@param boolean $runValidation
@param array $attributes
@return boolean | [
"Creates",
"the",
"root",
"node",
"if",
"the",
"active",
"record",
"is",
"new",
"or",
"moves",
"it",
"as",
"the",
"root",
"node",
"."
] | cb88a2e8665c62192a013cd7b1cbcd53148f0ec5 | https://github.com/letyii/yii2-mongo-nested-set/blob/cb88a2e8665c62192a013cd7b1cbcd53148f0ec5/NestedSetsBehavior.php#L88-L92 |
21,923 | letyii/yii2-mongo-nested-set | NestedSetsBehavior.php | NestedSetsBehavior.prependTo | public function prependTo($node, $runValidation = true, $attributes = null) {
$this->operation = self::OPERATION_PREPEND_TO;
$this->node = $node;
return $this->owner->save($runValidation, $attributes);
} | php | public function prependTo($node, $runValidation = true, $attributes = null) {
$this->operation = self::OPERATION_PREPEND_TO;
$this->node = $node;
return $this->owner->save($runValidation, $attributes);
} | [
"public",
"function",
"prependTo",
"(",
"$",
"node",
",",
"$",
"runValidation",
"=",
"true",
",",
"$",
"attributes",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"operation",
"=",
"self",
"::",
"OPERATION_PREPEND_TO",
";",
"$",
"this",
"->",
"node",
"=",
... | Creates a node as the first child of the target node if the active
record is new or moves it as the first child of the target node.
@param ActiveRecord $node
@param boolean $runValidation
@param array $attributes
@return boolean | [
"Creates",
"a",
"node",
"as",
"the",
"first",
"child",
"of",
"the",
"target",
"node",
"if",
"the",
"active",
"record",
"is",
"new",
"or",
"moves",
"it",
"as",
"the",
"first",
"child",
"of",
"the",
"target",
"node",
"."
] | cb88a2e8665c62192a013cd7b1cbcd53148f0ec5 | https://github.com/letyii/yii2-mongo-nested-set/blob/cb88a2e8665c62192a013cd7b1cbcd53148f0ec5/NestedSetsBehavior.php#L102-L107 |
21,924 | letyii/yii2-mongo-nested-set | NestedSetsBehavior.php | NestedSetsBehavior.appendTo | public function appendTo($node, $runValidation = true, $attributes = null) {
$this->operation = self::OPERATION_APPEND_TO;
$this->node = $node;
return $this->owner->save($runValidation, $attributes);
} | php | public function appendTo($node, $runValidation = true, $attributes = null) {
$this->operation = self::OPERATION_APPEND_TO;
$this->node = $node;
return $this->owner->save($runValidation, $attributes);
} | [
"public",
"function",
"appendTo",
"(",
"$",
"node",
",",
"$",
"runValidation",
"=",
"true",
",",
"$",
"attributes",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"operation",
"=",
"self",
"::",
"OPERATION_APPEND_TO",
";",
"$",
"this",
"->",
"node",
"=",
"$... | Creates a node as the last child of the target node if the active
record is new or moves it as the last child of the target node.
@param ActiveRecord $node
@param boolean $runValidation
@param array $attributes
@return boolean | [
"Creates",
"a",
"node",
"as",
"the",
"last",
"child",
"of",
"the",
"target",
"node",
"if",
"the",
"active",
"record",
"is",
"new",
"or",
"moves",
"it",
"as",
"the",
"last",
"child",
"of",
"the",
"target",
"node",
"."
] | cb88a2e8665c62192a013cd7b1cbcd53148f0ec5 | https://github.com/letyii/yii2-mongo-nested-set/blob/cb88a2e8665c62192a013cd7b1cbcd53148f0ec5/NestedSetsBehavior.php#L117-L122 |
21,925 | letyii/yii2-mongo-nested-set | NestedSetsBehavior.php | NestedSetsBehavior.insertBefore | public function insertBefore($node, $runValidation = true, $attributes = null) {
$this->operation = self::OPERATION_INSERT_BEFORE;
$this->node = $node;
return $this->owner->save($runValidation, $attributes);
} | php | public function insertBefore($node, $runValidation = true, $attributes = null) {
$this->operation = self::OPERATION_INSERT_BEFORE;
$this->node = $node;
return $this->owner->save($runValidation, $attributes);
} | [
"public",
"function",
"insertBefore",
"(",
"$",
"node",
",",
"$",
"runValidation",
"=",
"true",
",",
"$",
"attributes",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"operation",
"=",
"self",
"::",
"OPERATION_INSERT_BEFORE",
";",
"$",
"this",
"->",
"node",
"... | Creates a node as the previous sibling of the target node if the active
record is new or moves it as the previous sibling of the target node.
@param ActiveRecord $node
@param boolean $runValidation
@param array $attributes
@return boolean | [
"Creates",
"a",
"node",
"as",
"the",
"previous",
"sibling",
"of",
"the",
"target",
"node",
"if",
"the",
"active",
"record",
"is",
"new",
"or",
"moves",
"it",
"as",
"the",
"previous",
"sibling",
"of",
"the",
"target",
"node",
"."
] | cb88a2e8665c62192a013cd7b1cbcd53148f0ec5 | https://github.com/letyii/yii2-mongo-nested-set/blob/cb88a2e8665c62192a013cd7b1cbcd53148f0ec5/NestedSetsBehavior.php#L132-L137 |
21,926 | letyii/yii2-mongo-nested-set | NestedSetsBehavior.php | NestedSetsBehavior.insertAfter | public function insertAfter($node, $runValidation = true, $attributes = null) {
$this->operation = self::OPERATION_INSERT_AFTER;
$this->node = $node;
return $this->owner->save($runValidation, $attributes);
} | php | public function insertAfter($node, $runValidation = true, $attributes = null) {
$this->operation = self::OPERATION_INSERT_AFTER;
$this->node = $node;
return $this->owner->save($runValidation, $attributes);
} | [
"public",
"function",
"insertAfter",
"(",
"$",
"node",
",",
"$",
"runValidation",
"=",
"true",
",",
"$",
"attributes",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"operation",
"=",
"self",
"::",
"OPERATION_INSERT_AFTER",
";",
"$",
"this",
"->",
"node",
"="... | Creates a node as the next sibling of the target node if the active
record is new or moves it as the next sibling of the target node.
@param ActiveRecord $node
@param boolean $runValidation
@param array $attributes
@return boolean | [
"Creates",
"a",
"node",
"as",
"the",
"next",
"sibling",
"of",
"the",
"target",
"node",
"if",
"the",
"active",
"record",
"is",
"new",
"or",
"moves",
"it",
"as",
"the",
"next",
"sibling",
"of",
"the",
"target",
"node",
"."
] | cb88a2e8665c62192a013cd7b1cbcd53148f0ec5 | https://github.com/letyii/yii2-mongo-nested-set/blob/cb88a2e8665c62192a013cd7b1cbcd53148f0ec5/NestedSetsBehavior.php#L147-L152 |
21,927 | letyii/yii2-mongo-nested-set | NestedSetsBehavior.php | NestedSetsBehavior.parents | public function parents($depth = null) {
$condition = [
'and',
[$this->leftAttribute => ['$lt' => $this->owner->getAttribute($this->leftAttribute)]],
[$this->rightAttribute => ['$gt' => $this->owner->getAttribute($this->rightAttribute)]],
];
if ($depth... | php | public function parents($depth = null) {
$condition = [
'and',
[$this->leftAttribute => ['$lt' => $this->owner->getAttribute($this->leftAttribute)]],
[$this->rightAttribute => ['$gt' => $this->owner->getAttribute($this->rightAttribute)]],
];
if ($depth... | [
"public",
"function",
"parents",
"(",
"$",
"depth",
"=",
"null",
")",
"{",
"$",
"condition",
"=",
"[",
"'and'",
",",
"[",
"$",
"this",
"->",
"leftAttribute",
"=>",
"[",
"'$lt'",
"=>",
"$",
"this",
"->",
"owner",
"->",
"getAttribute",
"(",
"$",
"this"... | Gets the parents of the node.
@param integer|null $depth the depth
@return \yii\db\ActiveQuery | [
"Gets",
"the",
"parents",
"of",
"the",
"node",
"."
] | cb88a2e8665c62192a013cd7b1cbcd53148f0ec5 | https://github.com/letyii/yii2-mongo-nested-set/blob/cb88a2e8665c62192a013cd7b1cbcd53148f0ec5/NestedSetsBehavior.php#L223-L237 |
21,928 | letyii/yii2-mongo-nested-set | NestedSetsBehavior.php | NestedSetsBehavior.leaves | public function leaves() {
$condition = [
'and',
[$this->leftAttribute => ['$gt' => $this->owner->getAttribute($this->leftAttribute)]],
[$this->rightAttribute => ['$lt' => $this->owner->getAttribute($this->rightAttribute)]],
['$where' => "this.{$this->rightAt... | php | public function leaves() {
$condition = [
'and',
[$this->leftAttribute => ['$gt' => $this->owner->getAttribute($this->leftAttribute)]],
[$this->rightAttribute => ['$lt' => $this->owner->getAttribute($this->rightAttribute)]],
['$where' => "this.{$this->rightAt... | [
"public",
"function",
"leaves",
"(",
")",
"{",
"$",
"condition",
"=",
"[",
"'and'",
",",
"[",
"$",
"this",
"->",
"leftAttribute",
"=>",
"[",
"'$gt'",
"=>",
"$",
"this",
"->",
"owner",
"->",
"getAttribute",
"(",
"$",
"this",
"->",
"leftAttribute",
")",
... | Gets the leaves of the node.
@return \yii\db\ActiveQuery | [
"Gets",
"the",
"leaves",
"of",
"the",
"node",
"."
] | cb88a2e8665c62192a013cd7b1cbcd53148f0ec5 | https://github.com/letyii/yii2-mongo-nested-set/blob/cb88a2e8665c62192a013cd7b1cbcd53148f0ec5/NestedSetsBehavior.php#L264-L275 |
21,929 | letyii/yii2-mongo-nested-set | NestedSetsBehavior.php | NestedSetsBehavior.prev | public function prev() {
$condition = [$this->rightAttribute => $this->owner->getAttribute($this->leftAttribute) - 1];
$this->applyTreeAttributeCondition($condition);
return $this->owner->find()->andWhere($condition);
} | php | public function prev() {
$condition = [$this->rightAttribute => $this->owner->getAttribute($this->leftAttribute) - 1];
$this->applyTreeAttributeCondition($condition);
return $this->owner->find()->andWhere($condition);
} | [
"public",
"function",
"prev",
"(",
")",
"{",
"$",
"condition",
"=",
"[",
"$",
"this",
"->",
"rightAttribute",
"=>",
"$",
"this",
"->",
"owner",
"->",
"getAttribute",
"(",
"$",
"this",
"->",
"leftAttribute",
")",
"-",
"1",
"]",
";",
"$",
"this",
"->",... | Gets the previous sibling of the node.
@return \yii\db\ActiveQuery | [
"Gets",
"the",
"previous",
"sibling",
"of",
"the",
"node",
"."
] | cb88a2e8665c62192a013cd7b1cbcd53148f0ec5 | https://github.com/letyii/yii2-mongo-nested-set/blob/cb88a2e8665c62192a013cd7b1cbcd53148f0ec5/NestedSetsBehavior.php#L281-L286 |
21,930 | letyii/yii2-mongo-nested-set | NestedSetsBehavior.php | NestedSetsBehavior.isChildOf | public function isChildOf($node) {
$result = $this->owner->getAttribute($this->leftAttribute) > $node->getAttribute($this->leftAttribute) && $this->owner->getAttribute($this->rightAttribute) < $node->getAttribute($this->rightAttribute);
if ($result && $this->treeAttribute !== false) {
$... | php | public function isChildOf($node) {
$result = $this->owner->getAttribute($this->leftAttribute) > $node->getAttribute($this->leftAttribute) && $this->owner->getAttribute($this->rightAttribute) < $node->getAttribute($this->rightAttribute);
if ($result && $this->treeAttribute !== false) {
$... | [
"public",
"function",
"isChildOf",
"(",
"$",
"node",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"owner",
"->",
"getAttribute",
"(",
"$",
"this",
"->",
"leftAttribute",
")",
">",
"$",
"node",
"->",
"getAttribute",
"(",
"$",
"this",
"->",
"leftAttr... | Determines whether the node is child of the parent node.
@param ActiveRecord $node the parent node
@return boolean whether the node is child of the parent node | [
"Determines",
"whether",
"the",
"node",
"is",
"child",
"of",
"the",
"parent",
"node",
"."
] | cb88a2e8665c62192a013cd7b1cbcd53148f0ec5 | https://github.com/letyii/yii2-mongo-nested-set/blob/cb88a2e8665c62192a013cd7b1cbcd53148f0ec5/NestedSetsBehavior.php#L312-L320 |
21,931 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/apc_array.php | ezcCacheStorageFileApcArray.fetchObject | protected function fetchObject( $filename )
{
$data = $this->backend->fetch( $filename );
return ( is_object( $data ) ) ? $data : false;
} | php | protected function fetchObject( $filename )
{
$data = $this->backend->fetch( $filename );
return ( is_object( $data ) ) ? $data : false;
} | [
"protected",
"function",
"fetchObject",
"(",
"$",
"filename",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"backend",
"->",
"fetch",
"(",
"$",
"filename",
")",
";",
"return",
"(",
"is_object",
"(",
"$",
"data",
")",
")",
"?",
"$",
"data",
":",
"f... | Fetches the object from the cache.
@param string $filename The ID/filename from where to fetch the data
@return mixed The fetched object or false on failure | [
"Fetches",
"the",
"object",
"from",
"the",
"cache",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/apc_array.php#L75-L79 |
21,932 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/apc_array.php | ezcCacheStorageFileApcArray.store | public function store( $id, $data, $attributes = array() )
{
// Generates the identifier
$filename = $this->properties['location'] . $this->generateIdentifier( $id, $attributes );
// Purges the Registry Cache
if ( isset( $this->registry[$filename] ) )
{
unset( $t... | php | public function store( $id, $data, $attributes = array() )
{
// Generates the identifier
$filename = $this->properties['location'] . $this->generateIdentifier( $id, $attributes );
// Purges the Registry Cache
if ( isset( $this->registry[$filename] ) )
{
unset( $t... | [
"public",
"function",
"store",
"(",
"$",
"id",
",",
"$",
"data",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"// Generates the identifier",
"$",
"filename",
"=",
"$",
"this",
"->",
"properties",
"[",
"'location'",
"]",
".",
"$",
"this",
"... | Stores data to the cache storage.
@throws ezcBaseFilePermissionException
If the directory to store the cache file could not be created.
This exception means most likely that your cache directory
has been corrupted by external influences (file permission
change).
@throws ezcBaseFileIoException
If an error occured while... | [
"Stores",
"data",
"to",
"the",
"cache",
"storage",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/apc_array.php#L139-L199 |
21,933 | GreenCape/joomla-cli | src/GreenCape/JoomlaCLI/Command.php | Command.handleBasePath | protected function handleBasePath(InputInterface $input, OutputInterface $output)
{
$path = realpath($input->getOption('basepath'));
$this->writeln($output, 'Joomla! installation expected in ' . $path, OutputInterface::VERBOSITY_DEBUG);
return $path;
} | php | protected function handleBasePath(InputInterface $input, OutputInterface $output)
{
$path = realpath($input->getOption('basepath'));
$this->writeln($output, 'Joomla! installation expected in ' . $path, OutputInterface::VERBOSITY_DEBUG);
return $path;
} | [
"protected",
"function",
"handleBasePath",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"path",
"=",
"realpath",
"(",
"$",
"input",
"->",
"getOption",
"(",
"'basepath'",
")",
")",
";",
"$",
"this",
"->",
"write... | Read the base path from the options
@param InputInterface $input An InputInterface instance
@param OutputInterface $output An OutputInterface instance
@return string The base path | [
"Read",
"the",
"base",
"path",
"from",
"the",
"options"
] | 74a6940f27b1f66c99330d4f9e2c5ac314cdd369 | https://github.com/GreenCape/joomla-cli/blob/74a6940f27b1f66c99330d4f9e2c5ac314cdd369/src/GreenCape/JoomlaCLI/Command.php#L106-L112 |
21,934 | infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.ffprobe | private function ffprobe($binary = null)
{
if (is_null($binary))
{
$binary = static::$ffprobe;
}
if (!isset($this->metadata))
{
$cmd = "{$binary} -v quiet -print_format json -show_format -show_streams {$this->file}";
exec($cmd, $output, $returnvalue);
$json = json_decode( implod... | php | private function ffprobe($binary = null)
{
if (is_null($binary))
{
$binary = static::$ffprobe;
}
if (!isset($this->metadata))
{
$cmd = "{$binary} -v quiet -print_format json -show_format -show_streams {$this->file}";
exec($cmd, $output, $returnvalue);
$json = json_decode( implod... | [
"private",
"function",
"ffprobe",
"(",
"$",
"binary",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"binary",
")",
")",
"{",
"$",
"binary",
"=",
"static",
"::",
"$",
"ffprobe",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
... | Runs an ffprobe on the file or returns cached information.
@return array|false | [
"Runs",
"an",
"ffprobe",
"on",
"the",
"file",
"or",
"returns",
"cached",
"information",
"."
] | 924b82e4d60f042fddd6b093b324cfa4bb885a13 | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L36-L63 |
21,935 | infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.ffprobeFormat | private function ffprobeFormat($format)
{
$this->ffprobe();
if (count($this->formats) > 0)
{
$args = func_get_args();
foreach ($args as $arg)
{
if (in_array($arg, $this->formats))
{
return true;
}
}
return null;
}
return false;
} | php | private function ffprobeFormat($format)
{
$this->ffprobe();
if (count($this->formats) > 0)
{
$args = func_get_args();
foreach ($args as $arg)
{
if (in_array($arg, $this->formats))
{
return true;
}
}
return null;
}
return false;
} | [
"private",
"function",
"ffprobeFormat",
"(",
"$",
"format",
")",
"{",
"$",
"this",
"->",
"ffprobe",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"formats",
")",
">",
"0",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"... | Checks requested format against what formats ffprobe returned.
@param string $format The format extenson to check for.
@param string|null $format Option number of additional formats.
@return boolean|null | [
"Checks",
"requested",
"format",
"against",
"what",
"formats",
"ffprobe",
"returned",
"."
] | 924b82e4d60f042fddd6b093b324cfa4bb885a13 | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L72-L92 |
21,936 | infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.ffprobeHasVideo | private function ffprobeHasVideo()
{
if (isset($this->metadata['streams']))
{
foreach ($this->metadata['streams'] as $streamIndex => $stream)
{
if (isset($stream['codec_type']) && $stream['codec_type'] === "video" && $stream['disposition']['attached_pic'] !== 1)
{
return $streamIndex;
... | php | private function ffprobeHasVideo()
{
if (isset($this->metadata['streams']))
{
foreach ($this->metadata['streams'] as $streamIndex => $stream)
{
if (isset($stream['codec_type']) && $stream['codec_type'] === "video" && $stream['disposition']['attached_pic'] !== 1)
{
return $streamIndex;
... | [
"private",
"function",
"ffprobeHasVideo",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"metadata",
"[",
"'streams'",
"]",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"metadata",
"[",
"'streams'",
"]",
"as",
"$",
"streamIndex",
"=>",... | Check our metadata for a video stream.
@return boolean|int Int if video stream index found (CAN BE 0), false if none | [
"Check",
"our",
"metadata",
"for",
"a",
"video",
"stream",
"."
] | 924b82e4d60f042fddd6b093b324cfa4bb885a13 | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L114-L128 |
21,937 | infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.ffprobeHasAudio | private function ffprobeHasAudio()
{
if (isset($this->metadata['streams']))
{
foreach ($this->metadata['streams'] as $streamIndex => $stream)
{
if (isset($stream['codec_type']) && $stream['codec_type'] === "audio")
{
return $streamIndex;
}
}
}
return false;
} | php | private function ffprobeHasAudio()
{
if (isset($this->metadata['streams']))
{
foreach ($this->metadata['streams'] as $streamIndex => $stream)
{
if (isset($stream['codec_type']) && $stream['codec_type'] === "audio")
{
return $streamIndex;
}
}
}
return false;
} | [
"private",
"function",
"ffprobeHasAudio",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"metadata",
"[",
"'streams'",
"]",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"metadata",
"[",
"'streams'",
"]",
"as",
"$",
"streamIndex",
"=>",... | Check our metadata for an audio stream.
@return boolean|int Int if video stream index found (CAN BE 0), false if none | [
"Check",
"our",
"metadata",
"for",
"an",
"audio",
"stream",
"."
] | 924b82e4d60f042fddd6b093b324cfa4bb885a13 | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L135-L149 |
21,938 | infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.lead3GP | protected function lead3GP()
{
$lead = $this->ffprobeFormat("3gp");
if ($lead === true)
{
return $this->closeCase("3gp", "video/3gp", $this->metadata);
}
return null;
} | php | protected function lead3GP()
{
$lead = $this->ffprobeFormat("3gp");
if ($lead === true)
{
return $this->closeCase("3gp", "video/3gp", $this->metadata);
}
return null;
} | [
"protected",
"function",
"lead3GP",
"(",
")",
"{",
"$",
"lead",
"=",
"$",
"this",
"->",
"ffprobeFormat",
"(",
"\"3gp\"",
")",
";",
"if",
"(",
"$",
"lead",
"===",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"closeCase",
"(",
"\"3gp\"",
",",
"\"vide... | Checks if the file is a 3GP.
@return boolean|null | [
"Checks",
"if",
"the",
"file",
"is",
"a",
"3GP",
"."
] | 924b82e4d60f042fddd6b093b324cfa4bb885a13 | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L156-L166 |
21,939 | infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.leadAAC | protected function leadAAC()
{
$lead = $this->ffprobeFormat("aac");
if ($lead === true)
{
return $this->closeCase("aac", "audio/aac", $this->metadata);
}
return null;
} | php | protected function leadAAC()
{
$lead = $this->ffprobeFormat("aac");
if ($lead === true)
{
return $this->closeCase("aac", "audio/aac", $this->metadata);
}
return null;
} | [
"protected",
"function",
"leadAAC",
"(",
")",
"{",
"$",
"lead",
"=",
"$",
"this",
"->",
"ffprobeFormat",
"(",
"\"aac\"",
")",
";",
"if",
"(",
"$",
"lead",
"===",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"closeCase",
"(",
"\"aac\"",
",",
"\"audi... | Checks if the file is a AAC
@return boolean|null | [
"Checks",
"if",
"the",
"file",
"is",
"a",
"AAC"
] | 924b82e4d60f042fddd6b093b324cfa4bb885a13 | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L173-L183 |
21,940 | infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.leadFLV | protected function leadFLV()
{
$lead = $this->ffprobeFormat("flv");
if ($lead === true)
{
return $this->closeCase("flv", "video/x-flv", $this->metadata);
}
return null;
} | php | protected function leadFLV()
{
$lead = $this->ffprobeFormat("flv");
if ($lead === true)
{
return $this->closeCase("flv", "video/x-flv", $this->metadata);
}
return null;
} | [
"protected",
"function",
"leadFLV",
"(",
")",
"{",
"$",
"lead",
"=",
"$",
"this",
"->",
"ffprobeFormat",
"(",
"\"flv\"",
")",
";",
"if",
"(",
"$",
"lead",
"===",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"closeCase",
"(",
"\"flv\"",
",",
"\"vide... | Checks if the file is a FLV.
@return boolean|null | [
"Checks",
"if",
"the",
"file",
"is",
"a",
"FLV",
"."
] | 924b82e4d60f042fddd6b093b324cfa4bb885a13 | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L190-L200 |
21,941 | infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.leadMP3 | protected function leadMP3()
{
$lead = $this->ffprobeFormat("mp1", "mp2", "mp3", "mpg", "mpeg");
if ($lead === true)
{
return $this->closeCase("mp3", "audio/mpeg", $this->metadata);
}
return null;
} | php | protected function leadMP3()
{
$lead = $this->ffprobeFormat("mp1", "mp2", "mp3", "mpg", "mpeg");
if ($lead === true)
{
return $this->closeCase("mp3", "audio/mpeg", $this->metadata);
}
return null;
} | [
"protected",
"function",
"leadMP3",
"(",
")",
"{",
"$",
"lead",
"=",
"$",
"this",
"->",
"ffprobeFormat",
"(",
"\"mp1\"",
",",
"\"mp2\"",
",",
"\"mp3\"",
",",
"\"mpg\"",
",",
"\"mpeg\"",
")",
";",
"if",
"(",
"$",
"lead",
"===",
"true",
")",
"{",
"retu... | Checks if the file is a MP3
@return boolean|null | [
"Checks",
"if",
"the",
"file",
"is",
"a",
"MP3"
] | 924b82e4d60f042fddd6b093b324cfa4bb885a13 | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L207-L217 |
21,942 | infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.leadMP4 | protected function leadMP4()
{
$lead = $this->ffprobeFormat("mp4", "m4a");
if ($lead === true)
{
if ($this->ffprobeHasVideo() !== false)
{
return $this->closeCase("mp4", "video/mp4", $this->metadata);
}
else if ($this->ffprobeHasAudio() !== false)
{
return $this->closeCase("mp... | php | protected function leadMP4()
{
$lead = $this->ffprobeFormat("mp4", "m4a");
if ($lead === true)
{
if ($this->ffprobeHasVideo() !== false)
{
return $this->closeCase("mp4", "video/mp4", $this->metadata);
}
else if ($this->ffprobeHasAudio() !== false)
{
return $this->closeCase("mp... | [
"protected",
"function",
"leadMP4",
"(",
")",
"{",
"$",
"lead",
"=",
"$",
"this",
"->",
"ffprobeFormat",
"(",
"\"mp4\"",
",",
"\"m4a\"",
")",
";",
"if",
"(",
"$",
"lead",
"===",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"ffprobeHasVideo",
"(",
... | Checks if the file is a MP4.
@return boolean|null | [
"Checks",
"if",
"the",
"file",
"is",
"a",
"MP4",
"."
] | 924b82e4d60f042fddd6b093b324cfa4bb885a13 | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L224-L245 |
21,943 | infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.leadMKA | protected function leadMKA()
{
$lead = $this->ffprobeFormat("matroska", "webm");
if ($lead === true)
{
if ($this->ffprobeHasAudio() !== false)
{
return $this->closeCase("mka", "audio/x-matroska", $this->metadata);
}
else
{
return false;
}
}
return null;
} | php | protected function leadMKA()
{
$lead = $this->ffprobeFormat("matroska", "webm");
if ($lead === true)
{
if ($this->ffprobeHasAudio() !== false)
{
return $this->closeCase("mka", "audio/x-matroska", $this->metadata);
}
else
{
return false;
}
}
return null;
} | [
"protected",
"function",
"leadMKA",
"(",
")",
"{",
"$",
"lead",
"=",
"$",
"this",
"->",
"ffprobeFormat",
"(",
"\"matroska\"",
",",
"\"webm\"",
")",
";",
"if",
"(",
"$",
"lead",
"===",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"ffprobeHasAudio",
... | Checks if the file is a MKA.
@return boolean|null | [
"Checks",
"if",
"the",
"file",
"is",
"a",
"MKA",
"."
] | 924b82e4d60f042fddd6b093b324cfa4bb885a13 | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L252-L269 |
21,944 | infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.leadMKV | protected function leadMKV()
{
$lead = $this->ffprobeFormat("matroska", "webm");
if ($lead === true)
{
if ($this->ffprobeHasVideo() !== false)
{
return $this->closeCase("mkv", "video/x-matroska", $this->metadata);
}
else
{
return false;
}
}
return null;
} | php | protected function leadMKV()
{
$lead = $this->ffprobeFormat("matroska", "webm");
if ($lead === true)
{
if ($this->ffprobeHasVideo() !== false)
{
return $this->closeCase("mkv", "video/x-matroska", $this->metadata);
}
else
{
return false;
}
}
return null;
} | [
"protected",
"function",
"leadMKV",
"(",
")",
"{",
"$",
"lead",
"=",
"$",
"this",
"->",
"ffprobeFormat",
"(",
"\"matroska\"",
",",
"\"webm\"",
")",
";",
"if",
"(",
"$",
"lead",
"===",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"ffprobeHasVideo",
... | Checks if the file is a MKV.
@return boolean|null | [
"Checks",
"if",
"the",
"file",
"is",
"a",
"MKV",
"."
] | 924b82e4d60f042fddd6b093b324cfa4bb885a13 | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L276-L293 |
21,945 | infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.leadWAV | protected function leadWAV()
{
$lead = $this->ffprobeFormat("wav");
if ($lead === true)
{
return $this->closeCase("wav", "audio/wave", $this->metadata);
}
return null;
} | php | protected function leadWAV()
{
$lead = $this->ffprobeFormat("wav");
if ($lead === true)
{
return $this->closeCase("wav", "audio/wave", $this->metadata);
}
return null;
} | [
"protected",
"function",
"leadWAV",
"(",
")",
"{",
"$",
"lead",
"=",
"$",
"this",
"->",
"ffprobeFormat",
"(",
"\"wav\"",
")",
";",
"if",
"(",
"$",
"lead",
"===",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"closeCase",
"(",
"\"wav\"",
",",
"\"audi... | Checks if the file is a WAV
@return boolean|null | [
"Checks",
"if",
"the",
"file",
"is",
"a",
"WAV"
] | 924b82e4d60f042fddd6b093b324cfa4bb885a13 | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L328-L338 |
21,946 | infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.on | public static function on()
{
static::fetchBinaries();
return (empty(static::$ffmpeg) ? false : true) && (empty(static::$ffprobe) ? false : true);
} | php | public static function on()
{
static::fetchBinaries();
return (empty(static::$ffmpeg) ? false : true) && (empty(static::$ffprobe) ? false : true);
} | [
"public",
"static",
"function",
"on",
"(",
")",
"{",
"static",
"::",
"fetchBinaries",
"(",
")",
";",
"return",
"(",
"empty",
"(",
"static",
"::",
"$",
"ffmpeg",
")",
"?",
"false",
":",
"true",
")",
"&&",
"(",
"empty",
"(",
"static",
"::",
"$",
"ffp... | Can the system run this Detective?
@return boolean True if we can run, False if not. | [
"Can",
"the",
"system",
"run",
"this",
"Detective?"
] | 924b82e4d60f042fddd6b093b324cfa4bb885a13 | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L406-L410 |
21,947 | eXistenZNL/PermCheck | src/Message/Bag.php | Bag.addMessage | public function addMessage($message, $type)
{
if (!is_string($message)) {
throw new \InvalidArgumentException('Message must be a string');
}
if (!$message) {
throw new \InvalidArgumentException('Message can\'t be empty');
}
if (!is_string($type)) {
... | php | public function addMessage($message, $type)
{
if (!is_string($message)) {
throw new \InvalidArgumentException('Message must be a string');
}
if (!$message) {
throw new \InvalidArgumentException('Message can\'t be empty');
}
if (!is_string($type)) {
... | [
"public",
"function",
"addMessage",
"(",
"$",
"message",
",",
"$",
"type",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"message",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Message must be a string'",
")",
";",
"}",
"if",
... | Add a message to this message bag.
@param string $message The message to add.
@param string $type The type of message to add.
@throws \InvalidArgumentException When the provided data is incorrect.
@return Bag | [
"Add",
"a",
"message",
"to",
"this",
"message",
"bag",
"."
] | f22f2936350f6b440222fb6ea37dfc382fc4550e | https://github.com/eXistenZNL/PermCheck/blob/f22f2936350f6b440222fb6ea37dfc382fc4550e/src/Message/Bag.php#L21-L38 |
21,948 | inhere/php-librarys | src/Helpers/Cli.php | Cli.write | public static function write($message, $nl = true, $quit = false)
{
if (\is_array($message)) {
$message = implode($nl ? PHP_EOL : '', $message);
}
self::stdout(self::renderColor($message), $nl, $quit);
} | php | public static function write($message, $nl = true, $quit = false)
{
if (\is_array($message)) {
$message = implode($nl ? PHP_EOL : '', $message);
}
self::stdout(self::renderColor($message), $nl, $quit);
} | [
"public",
"static",
"function",
"write",
"(",
"$",
"message",
",",
"$",
"nl",
"=",
"true",
",",
"$",
"quit",
"=",
"false",
")",
"{",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"message",
")",
")",
"{",
"$",
"message",
"=",
"implode",
"(",
"$",
"nl",
... | write message to console
@param $message
@param bool $nl
@param bool $quit | [
"write",
"message",
"to",
"console"
] | e6ca598685469794f310e3ab0e2bc19519cd0ae6 | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Helpers/Cli.php#L206-L213 |
21,949 | OpenClassrooms/Cache | src/OpenClassrooms/Cache/Cache/CacheImpl.php | CacheImpl.invalidate | public function invalidate($namespaceId)
{
$namespace = $this->fetch($namespaceId);
if (false === $namespace) {
return false;
}
$newNamespace = rand(0, 10000);
// @codeCoverageIgnoreStart
while ($namespace === $newNamespace) {
$newNamespace =... | php | public function invalidate($namespaceId)
{
$namespace = $this->fetch($namespaceId);
if (false === $namespace) {
return false;
}
$newNamespace = rand(0, 10000);
// @codeCoverageIgnoreStart
while ($namespace === $newNamespace) {
$newNamespace =... | [
"public",
"function",
"invalidate",
"(",
"$",
"namespaceId",
")",
"{",
"$",
"namespace",
"=",
"$",
"this",
"->",
"fetch",
"(",
"$",
"namespaceId",
")",
";",
"if",
"(",
"false",
"===",
"$",
"namespace",
")",
"{",
"return",
"false",
";",
"}",
"$",
"new... | Invalidate a namespace.
@param string $namespaceId The id of the namespace to invalidate.
@return boolean TRUE if the namespace entry was successfully regenerated, FALSE otherwise. | [
"Invalidate",
"a",
"namespace",
"."
] | 7e7bdfd1b1503384f59ff6d5d29ba741a0e18ad6 | https://github.com/OpenClassrooms/Cache/blob/7e7bdfd1b1503384f59ff6d5d29ba741a0e18ad6/src/OpenClassrooms/Cache/Cache/CacheImpl.php#L122-L138 |
21,950 | titledk/silverstripe-uploaddirrules | code/AssetsFolderExtension.php | AssetsFolderExtension.findOrMakeAssetsFolder | public function findOrMakeAssetsFolder($url, $doWrite = true)
{
$owner = $this->owner;
$dir = Folder::find_or_make($url);
$owner->AssetsFolderID = $dir->ID;
if ($doWrite) {
$owner->write();
}
//Special case for when creating a new subsite
//the di... | php | public function findOrMakeAssetsFolder($url, $doWrite = true)
{
$owner = $this->owner;
$dir = Folder::find_or_make($url);
$owner->AssetsFolderID = $dir->ID;
if ($doWrite) {
$owner->write();
}
//Special case for when creating a new subsite
//the di... | [
"public",
"function",
"findOrMakeAssetsFolder",
"(",
"$",
"url",
",",
"$",
"doWrite",
"=",
"true",
")",
"{",
"$",
"owner",
"=",
"$",
"this",
"->",
"owner",
";",
"$",
"dir",
"=",
"Folder",
"::",
"find_or_make",
"(",
"$",
"url",
")",
";",
"$",
"owner",... | Find or make assets folder
called from onBeforeWrite.
@param string $url
@param bool $doWrite
@return Folder|null | [
"Find",
"or",
"make",
"assets",
"folder",
"called",
"from",
"onBeforeWrite",
"."
] | ed8ece7b6a4ca86dcb5dc16ee10ff339f629de3c | https://github.com/titledk/silverstripe-uploaddirrules/blob/ed8ece7b6a4ca86dcb5dc16ee10ff339f629de3c/code/AssetsFolderExtension.php#L89-L106 |
21,951 | titledk/silverstripe-uploaddirrules | code/AssetsFolderExtension.php | AssetsFolderExtension.getAssetsFolderDirName | public function getAssetsFolderDirName()
{
if ($this->owner->getField('AssetsFolderID') != 0) {
$dirObj = $this->owner->AssetsFolder();
$dirName = str_replace('assets/', '', $dirObj->Filename);
return $dirName;
}
} | php | public function getAssetsFolderDirName()
{
if ($this->owner->getField('AssetsFolderID') != 0) {
$dirObj = $this->owner->AssetsFolder();
$dirName = str_replace('assets/', '', $dirObj->Filename);
return $dirName;
}
} | [
"public",
"function",
"getAssetsFolderDirName",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"owner",
"->",
"getField",
"(",
"'AssetsFolderID'",
")",
"!=",
"0",
")",
"{",
"$",
"dirObj",
"=",
"$",
"this",
"->",
"owner",
"->",
"AssetsFolder",
"(",
")",
"... | Name of the associated assets folder.
@return string|null | [
"Name",
"of",
"the",
"associated",
"assets",
"folder",
"."
] | ed8ece7b6a4ca86dcb5dc16ee10ff339f629de3c | https://github.com/titledk/silverstripe-uploaddirrules/blob/ed8ece7b6a4ca86dcb5dc16ee10ff339f629de3c/code/AssetsFolderExtension.php#L113-L121 |
21,952 | simbiosis-group/yii2-helper | actions/CreateAction.php | CreateAction.assignDefaultValues | protected function assignDefaultValues()
{
foreach ($this->defaultValues as $key => $value) {
$this->model[$key] = $value;
}
return true;
} | php | protected function assignDefaultValues()
{
foreach ($this->defaultValues as $key => $value) {
$this->model[$key] = $value;
}
return true;
} | [
"protected",
"function",
"assignDefaultValues",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"defaultValues",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"model",
"[",
"$",
"key",
"]",
"=",
"$",
"value",
";",
"}",
"return"... | Assign default values to model.
@return boolean | [
"Assign",
"default",
"values",
"to",
"model",
"."
] | c85c4204dd06b16e54210e75fe6deb51869d1dd9 | https://github.com/simbiosis-group/yii2-helper/blob/c85c4204dd06b16e54210e75fe6deb51869d1dd9/actions/CreateAction.php#L158-L165 |
21,953 | WellCommerce/AppBundle | Form/Admin/PackageFormBuilder.php | PackageFormBuilder.getPackageVersions | protected function getPackageVersions($id)
{
$localPackage = $this->get('package.repository')->findOneById($id);
$remotePackage = $this->get('package.helper')->getPackage($localPackage->getFullName());
$versions = $remotePackage->getVersions();
$result = [];
... | php | protected function getPackageVersions($id)
{
$localPackage = $this->get('package.repository')->findOneById($id);
$remotePackage = $this->get('package.helper')->getPackage($localPackage->getFullName());
$versions = $remotePackage->getVersions();
$result = [];
... | [
"protected",
"function",
"getPackageVersions",
"(",
"$",
"id",
")",
"{",
"$",
"localPackage",
"=",
"$",
"this",
"->",
"get",
"(",
"'package.repository'",
")",
"->",
"findOneById",
"(",
"$",
"id",
")",
";",
"$",
"remotePackage",
"=",
"$",
"this",
"->",
"g... | Returns version information for package
@param $id
@return array | [
"Returns",
"version",
"information",
"for",
"package"
] | 2add687d1c898dd0b24afd611d896e3811a0eac3 | https://github.com/WellCommerce/AppBundle/blob/2add687d1c898dd0b24afd611d896e3811a0eac3/Form/Admin/PackageFormBuilder.php#L83-L95 |
21,954 | WellCommerce/AppBundle | Form/Admin/PackageFormBuilder.php | PackageFormBuilder.getPackageInfo | protected function getPackageInfo(Version $version, &$result)
{
$date = new \DateTime($version->getTime());
$packageVersion = $version->getVersion();
if ($packageVersion === PackageHelperInterface::DEFAULT_BRANCH_VERSION) {
$result[$packageVersion] = [
'... | php | protected function getPackageInfo(Version $version, &$result)
{
$date = new \DateTime($version->getTime());
$packageVersion = $version->getVersion();
if ($packageVersion === PackageHelperInterface::DEFAULT_BRANCH_VERSION) {
$result[$packageVersion] = [
'... | [
"protected",
"function",
"getPackageInfo",
"(",
"Version",
"$",
"version",
",",
"&",
"$",
"result",
")",
"{",
"$",
"date",
"=",
"new",
"\\",
"DateTime",
"(",
"$",
"version",
"->",
"getTime",
"(",
")",
")",
";",
"$",
"packageVersion",
"=",
"$",
"version... | Adds information about single version to result array
@param Version $version
@param array $result | [
"Adds",
"information",
"about",
"single",
"version",
"to",
"result",
"array"
] | 2add687d1c898dd0b24afd611d896e3811a0eac3 | https://github.com/WellCommerce/AppBundle/blob/2add687d1c898dd0b24afd611d896e3811a0eac3/Form/Admin/PackageFormBuilder.php#L103-L117 |
21,955 | surebert/surebert-framework | src/sb/Password/Hash.php | Hash.create | public static function create($password) {
// format: algorithm:iterations:salt:hash
if(function_exists('random_bytes')){
$salt = random_bytes(self::$salt_byte_size);
} else if(function_exists('openssl_random_pseudo_bytes')){
$salt = openssl_random_pseudo_bytes(self::$sal... | php | public static function create($password) {
// format: algorithm:iterations:salt:hash
if(function_exists('random_bytes')){
$salt = random_bytes(self::$salt_byte_size);
} else if(function_exists('openssl_random_pseudo_bytes')){
$salt = openssl_random_pseudo_bytes(self::$sal... | [
"public",
"static",
"function",
"create",
"(",
"$",
"password",
")",
"{",
"// format: algorithm:iterations:salt:hash",
"if",
"(",
"function_exists",
"(",
"'random_bytes'",
")",
")",
"{",
"$",
"salt",
"=",
"random_bytes",
"(",
"self",
"::",
"$",
"salt_byte_size",
... | Creates the password hash that you would store for comparison.
Make sure to check the size of the output when creating database tables
to store this hash. The defaults produce a 94 char string. Changing the
public static properties may affect the size of the hash returned.
@param string $password
@return string The ... | [
"Creates",
"the",
"password",
"hash",
"that",
"you",
"would",
"store",
"for",
"comparison",
".",
"Make",
"sure",
"to",
"check",
"the",
"size",
"of",
"the",
"output",
"when",
"creating",
"database",
"tables",
"to",
"store",
"this",
"hash",
".",
"The",
"defa... | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Password/Hash.php#L112-L129 |
21,956 | surebert/surebert-framework | src/sb/Password/Hash.php | Hash.validate | public static function validate($password, $hash) {
$params = explode(":", $hash);
if (count($params) < 4)
return false;
$pbkdf2 = base64_decode($params[self::$hash_pbkdf2_index]);
return self::slowEquals(
$pbkdf2, self::calculate(
$params[... | php | public static function validate($password, $hash) {
$params = explode(":", $hash);
if (count($params) < 4)
return false;
$pbkdf2 = base64_decode($params[self::$hash_pbkdf2_index]);
return self::slowEquals(
$pbkdf2, self::calculate(
$params[... | [
"public",
"static",
"function",
"validate",
"(",
"$",
"password",
",",
"$",
"hash",
")",
"{",
"$",
"params",
"=",
"explode",
"(",
"\":\"",
",",
"$",
"hash",
")",
";",
"if",
"(",
"count",
"(",
"$",
"params",
")",
"<",
"4",
")",
"return",
"false",
... | Validates a password against its precalculated hash
@param string $password
@param string $hash
@return boolean
<code>
$bool = \sb\Password\Hash::validate('password', $hash_from_create);
</code> | [
"Validates",
"a",
"password",
"against",
"its",
"precalculated",
"hash"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Password/Hash.php#L140-L150 |
21,957 | kenphp/ken | src/Helpers/Input.php | Input.get | public static function get($name = null, $default = null)
{
$queryParams = app()->request->getQueryParams();
if (is_null($name)) {
return $queryParams;
} elseif (isset($queryParams[$name])) {
return $queryParams[$name];
}
return $default;
} | php | public static function get($name = null, $default = null)
{
$queryParams = app()->request->getQueryParams();
if (is_null($name)) {
return $queryParams;
} elseif (isset($queryParams[$name])) {
return $queryParams[$name];
}
return $default;
} | [
"public",
"static",
"function",
"get",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"queryParams",
"=",
"app",
"(",
")",
"->",
"request",
"->",
"getQueryParams",
"(",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"nam... | Retrieves GET parameter.
@param string $name Name of GET parameter, if null then all parameter will be returned
@param mixed $default Default value returned if *$name* is not null but does not exist in GET query parameters
@return mixed | [
"Retrieves",
"GET",
"parameter",
"."
] | c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb | https://github.com/kenphp/ken/blob/c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb/src/Helpers/Input.php#L17-L28 |
21,958 | kenphp/ken | src/Helpers/Input.php | Input.delete | public static function delete($name = null, $default = null)
{
$parsedBody = app()->request->getParsedBody();
if (is_null($name)) {
return $parsedBody;
}
if (isset($parsedBody[$name])) {
return $parsedBody[$name];
}
return $default;
} | php | public static function delete($name = null, $default = null)
{
$parsedBody = app()->request->getParsedBody();
if (is_null($name)) {
return $parsedBody;
}
if (isset($parsedBody[$name])) {
return $parsedBody[$name];
}
return $default;
} | [
"public",
"static",
"function",
"delete",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"parsedBody",
"=",
"app",
"(",
")",
"->",
"request",
"->",
"getParsedBody",
"(",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"na... | Retrieves DELETE parameter.
@param string $name Name of DELETE parameter, if null then all parameter will be returned
@param mixed $default Default value returned if *$name* is not null but does not exist in DELETE request
@return mixed | [
"Retrieves",
"DELETE",
"parameter",
"."
] | c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb | https://github.com/kenphp/ken/blob/c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb/src/Helpers/Input.php#L61-L74 |
21,959 | kenphp/ken | src/Helpers/Input.php | Input.files | public static function files($name = null)
{
$files = app()->request->getUploadedFiles();
if (is_null($name)) {
return $files;
}
if (isset($files[$name])) {
return $files[$name];
}
return null;
} | php | public static function files($name = null)
{
$files = app()->request->getUploadedFiles();
if (is_null($name)) {
return $files;
}
if (isset($files[$name])) {
return $files[$name];
}
return null;
} | [
"public",
"static",
"function",
"files",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"files",
"=",
"app",
"(",
")",
"->",
"request",
"->",
"getUploadedFiles",
"(",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"name",
")",
")",
"{",
"return",
"$",
... | Retrieves Uploaded Files.
@param string $name Name of Uploaded Files parameter, if null then all value will be returned
@return \Psr\Http\Message\UploadedFileInterface|array|null | [
"Retrieves",
"Uploaded",
"Files",
"."
] | c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb | https://github.com/kenphp/ken/blob/c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb/src/Helpers/Input.php#L106-L119 |
21,960 | petrica/php-statsd-system | Command/NotifyCommand.php | NotifyCommand.getStatsd | protected function getStatsd(InputInterface $input)
{
if (null === $this->statsd) {
$this->statsdConnection = new UdpSocket(
$input->getOption('statsd-host'),
$input->getOption('statsd-port')
);
$this->statsd = new Client(
$... | php | protected function getStatsd(InputInterface $input)
{
if (null === $this->statsd) {
$this->statsdConnection = new UdpSocket(
$input->getOption('statsd-host'),
$input->getOption('statsd-port')
);
$this->statsd = new Client(
$... | [
"protected",
"function",
"getStatsd",
"(",
"InputInterface",
"$",
"input",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"statsd",
")",
"{",
"$",
"this",
"->",
"statsdConnection",
"=",
"new",
"UdpSocket",
"(",
"$",
"input",
"->",
"getOption",
"(... | Statically cache statsd client and return a statsd client
@param InputInterface $input
@return Client | [
"Statically",
"cache",
"statsd",
"client",
"and",
"return",
"a",
"statsd",
"client"
] | c476be3514a631a605737888bb8f6eb096789c9d | https://github.com/petrica/php-statsd-system/blob/c476be3514a631a605737888bb8f6eb096789c9d/Command/NotifyCommand.php#L134-L148 |
21,961 | petrica/php-statsd-system | Command/NotifyCommand.php | NotifyCommand.getGauges | protected function getGauges($config)
{
if (null === $this->gauges) {
$this->gauges = array();
foreach ($config as $path => $details) {
$className = $details['class'];
if (class_exists($className)) {
$reflection = new \ReflectionCl... | php | protected function getGauges($config)
{
if (null === $this->gauges) {
$this->gauges = array();
foreach ($config as $path => $details) {
$className = $details['class'];
if (class_exists($className)) {
$reflection = new \ReflectionCl... | [
"protected",
"function",
"getGauges",
"(",
"$",
"config",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"gauges",
")",
"{",
"$",
"this",
"->",
"gauges",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"config",
"as",
"$",
"path",
"=>",
... | Instantiate selected gauges
@param array $config
@return GaugeInterface[] array | [
"Instantiate",
"selected",
"gauges"
] | c476be3514a631a605737888bb8f6eb096789c9d | https://github.com/petrica/php-statsd-system/blob/c476be3514a631a605737888bb8f6eb096789c9d/Command/NotifyCommand.php#L166-L199 |
21,962 | ClementIV/yii-rest-rbac2.0 | controllers/RuleController.php | RuleController.actionCheckname | public function actionCheckname(){
$request = \Yii::$app->request;
if ($request->getIsOptions()) {
return $this->ResponseOptions($this->verbs()['checkname']);
}
$model = new BizRule(null);
$mo =$model->find(Yii::$app->request->post()['BizRule']['name']);
if($m... | php | public function actionCheckname(){
$request = \Yii::$app->request;
if ($request->getIsOptions()) {
return $this->ResponseOptions($this->verbs()['checkname']);
}
$model = new BizRule(null);
$mo =$model->find(Yii::$app->request->post()['BizRule']['name']);
if($m... | [
"public",
"function",
"actionCheckname",
"(",
")",
"{",
"$",
"request",
"=",
"\\",
"Yii",
"::",
"$",
"app",
"->",
"request",
";",
"if",
"(",
"$",
"request",
"->",
"getIsOptions",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"ResponseOptions",
"(",
... | check is a new item
@return boolan | [
"check",
"is",
"a",
"new",
"item"
] | 435ffceca8d51b4d369182db3a06c20f336e9ac4 | https://github.com/ClementIV/yii-rest-rbac2.0/blob/435ffceca8d51b4d369182db3a06c20f336e9ac4/controllers/RuleController.php#L99-L112 |
21,963 | NuclearCMS/Hierarchy | src/Support/TokenManager.php | TokenManager.setToken | public function setToken($key, $value, $duration = 60)
{
$this->cache->put('reactor.tokens.' . $key, $value, $duration);
} | php | public function setToken($key, $value, $duration = 60)
{
$this->cache->put('reactor.tokens.' . $key, $value, $duration);
} | [
"public",
"function",
"setToken",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"duration",
"=",
"60",
")",
"{",
"$",
"this",
"->",
"cache",
"->",
"put",
"(",
"'reactor.tokens.'",
".",
"$",
"key",
",",
"$",
"value",
",",
"$",
"duration",
")",
";",
... | Setter for token
@param string $key
@param string $value
@param int $duration | [
"Setter",
"for",
"token"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Support/TokenManager.php#L47-L50 |
21,964 | NuclearCMS/Hierarchy | src/Support/TokenManager.php | TokenManager.makeNewToken | public function makeNewToken($key, $duration = 60)
{
$token = str_random(32);
$this->setToken($key, $token, $duration);
return $token;
} | php | public function makeNewToken($key, $duration = 60)
{
$token = str_random(32);
$this->setToken($key, $token, $duration);
return $token;
} | [
"public",
"function",
"makeNewToken",
"(",
"$",
"key",
",",
"$",
"duration",
"=",
"60",
")",
"{",
"$",
"token",
"=",
"str_random",
"(",
"32",
")",
";",
"$",
"this",
"->",
"setToken",
"(",
"$",
"key",
",",
"$",
"token",
",",
"$",
"duration",
")",
... | Creates a new token and returns it
@param string $key
@param int $duration
@return string | [
"Creates",
"a",
"new",
"token",
"and",
"returns",
"it"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Support/TokenManager.php#L59-L66 |
21,965 | NuclearCMS/Hierarchy | src/Support/TokenManager.php | TokenManager.requestHasToken | public function requestHasToken($key)
{
$token = $this->request->input($key, null);
if($token && $token === $this->getToken($key))
{
return true;
}
return false;
} | php | public function requestHasToken($key)
{
$token = $this->request->input($key, null);
if($token && $token === $this->getToken($key))
{
return true;
}
return false;
} | [
"public",
"function",
"requestHasToken",
"(",
"$",
"key",
")",
"{",
"$",
"token",
"=",
"$",
"this",
"->",
"request",
"->",
"input",
"(",
"$",
"key",
",",
"null",
")",
";",
"if",
"(",
"$",
"token",
"&&",
"$",
"token",
"===",
"$",
"this",
"->",
"ge... | Checks if the request has the token
@param string $key
@return bool | [
"Checks",
"if",
"the",
"request",
"has",
"the",
"token"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Support/TokenManager.php#L74-L84 |
21,966 | gpupo/common-schema | src/ORM/Entity/Trading/Order/Order.php | Order.setOrderStatusDetail | public function setOrderStatusDetail(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\OrderStatusDetail $orderStatusDetail = null)
{
$this->order_status_detail = $orderStatusDetail;
return $this;
} | php | public function setOrderStatusDetail(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\OrderStatusDetail $orderStatusDetail = null)
{
$this->order_status_detail = $orderStatusDetail;
return $this;
} | [
"public",
"function",
"setOrderStatusDetail",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Trading",
"\\",
"Order",
"\\",
"OrderStatusDetail",
"$",
"orderStatusDetail",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"order_status_deta... | Set orderStatusDetail.
@param null|\Gpupo\CommonSchema\ORM\Entity\Trading\Order\OrderStatusDetail $orderStatusDetail
@return Order | [
"Set",
"orderStatusDetail",
"."
] | a762d2eb3063b7317c72c69cbb463b1f95b86b0a | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Trading/Order/Order.php#L714-L719 |
21,967 | gpupo/common-schema | src/ORM/Entity/Trading/Order/Order.php | Order.setCustomer | public function setCustomer(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Customer\Customer $customer = null)
{
$this->customer = $customer;
return $this;
} | php | public function setCustomer(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Customer\Customer $customer = null)
{
$this->customer = $customer;
return $this;
} | [
"public",
"function",
"setCustomer",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Trading",
"\\",
"Order",
"\\",
"Customer",
"\\",
"Customer",
"$",
"customer",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"customer",
"=",
"$... | Set customer.
@param null|\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Customer\Customer $customer
@return Order | [
"Set",
"customer",
"."
] | a762d2eb3063b7317c72c69cbb463b1f95b86b0a | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Trading/Order/Order.php#L738-L743 |
21,968 | gpupo/common-schema | src/ORM/Entity/Trading/Order/Order.php | Order.setTrading | public function setTrading(\Gpupo\CommonSchema\ORM\Entity\Trading\Trading $trading = null)
{
$this->trading = $trading;
return $this;
} | php | public function setTrading(\Gpupo\CommonSchema\ORM\Entity\Trading\Trading $trading = null)
{
$this->trading = $trading;
return $this;
} | [
"public",
"function",
"setTrading",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Trading",
"\\",
"Trading",
"$",
"trading",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"trading",
"=",
"$",
"trading",
";",
"return",
"$",
"... | Set trading.
@param null|\Gpupo\CommonSchema\ORM\Entity\Trading\Trading $trading
@return Order | [
"Set",
"trading",
"."
] | a762d2eb3063b7317c72c69cbb463b1f95b86b0a | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Trading/Order/Order.php#L762-L767 |
21,969 | gpupo/common-schema | src/ORM/Entity/Trading/Order/Order.php | Order.addShipping | public function addShipping(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Shipping $shipping)
{
$this->shippings[] = $shipping;
return $this;
} | php | public function addShipping(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Shipping $shipping)
{
$this->shippings[] = $shipping;
return $this;
} | [
"public",
"function",
"addShipping",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Trading",
"\\",
"Order",
"\\",
"Shipping",
"\\",
"Shipping",
"$",
"shipping",
")",
"{",
"$",
"this",
"->",
"shippings",
"[",
"]",
"=",
"$",... | Add shipping.
@param \Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Shipping $shipping
@return Order | [
"Add",
"shipping",
"."
] | a762d2eb3063b7317c72c69cbb463b1f95b86b0a | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Trading/Order/Order.php#L786-L791 |
21,970 | gpupo/common-schema | src/ORM/Entity/Trading/Order/Order.php | Order.removeShipping | public function removeShipping(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Shipping $shipping)
{
return $this->shippings->removeElement($shipping);
} | php | public function removeShipping(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Shipping $shipping)
{
return $this->shippings->removeElement($shipping);
} | [
"public",
"function",
"removeShipping",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Trading",
"\\",
"Order",
"\\",
"Shipping",
"\\",
"Shipping",
"$",
"shipping",
")",
"{",
"return",
"$",
"this",
"->",
"shippings",
"->",
"r... | Remove shipping.
@param \Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Shipping $shipping
@return bool TRUE if this collection contained the specified element, FALSE otherwise | [
"Remove",
"shipping",
"."
] | a762d2eb3063b7317c72c69cbb463b1f95b86b0a | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Trading/Order/Order.php#L800-L803 |
21,971 | gpupo/common-schema | src/ORM/Entity/Trading/Order/Order.php | Order.removeFeedback | public function removeFeedback(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Feedback\Feedback $feedback)
{
return $this->feedbacks->removeElement($feedback);
} | php | public function removeFeedback(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Feedback\Feedback $feedback)
{
return $this->feedbacks->removeElement($feedback);
} | [
"public",
"function",
"removeFeedback",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Trading",
"\\",
"Order",
"\\",
"Feedback",
"\\",
"Feedback",
"$",
"feedback",
")",
"{",
"return",
"$",
"this",
"->",
"feedbacks",
"->",
"r... | Remove feedback.
@param \Gpupo\CommonSchema\ORM\Entity\Trading\Order\Feedback\Feedback $feedback
@return bool TRUE if this collection contained the specified element, FALSE otherwise | [
"Remove",
"feedback",
"."
] | a762d2eb3063b7317c72c69cbb463b1f95b86b0a | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Trading/Order/Order.php#L836-L839 |
21,972 | verdet23/SphinxSearchBundle | DependencyInjection/Configuration.php | Configuration.addIndexerSection | private function addIndexerSection(ArrayNodeDefinition $node)
{
$node
->children()
->arrayNode('indexer')
->addDefaultsIfNotSet()
->children()
->booleanNode('sudo')->defaultValue(false)->end()
... | php | private function addIndexerSection(ArrayNodeDefinition $node)
{
$node
->children()
->arrayNode('indexer')
->addDefaultsIfNotSet()
->children()
->booleanNode('sudo')->defaultValue(false)->end()
... | [
"private",
"function",
"addIndexerSection",
"(",
"ArrayNodeDefinition",
"$",
"node",
")",
"{",
"$",
"node",
"->",
"children",
"(",
")",
"->",
"arrayNode",
"(",
"'indexer'",
")",
"->",
"addDefaultsIfNotSet",
"(",
")",
"->",
"children",
"(",
")",
"->",
"boolea... | Set indexer parameters
@param ArrayNodeDefinition $node | [
"Set",
"indexer",
"parameters"
] | 6452cc3a5fab83647b6c08574164249fb8f03b05 | https://github.com/verdet23/SphinxSearchBundle/blob/6452cc3a5fab83647b6c08574164249fb8f03b05/DependencyInjection/Configuration.php#L36-L49 |
21,973 | verdet23/SphinxSearchBundle | DependencyInjection/Configuration.php | Configuration.addIndexesSection | private function addIndexesSection(ArrayNodeDefinition $node)
{
$node
->children()
->arrayNode('indexes')
->isRequired()
->requiresAtLeastOneElement()
->useAttributeAsKey('key')
->prototype('scalar')->end()
... | php | private function addIndexesSection(ArrayNodeDefinition $node)
{
$node
->children()
->arrayNode('indexes')
->isRequired()
->requiresAtLeastOneElement()
->useAttributeAsKey('key')
->prototype('scalar')->end()
... | [
"private",
"function",
"addIndexesSection",
"(",
"ArrayNodeDefinition",
"$",
"node",
")",
"{",
"$",
"node",
"->",
"children",
"(",
")",
"->",
"arrayNode",
"(",
"'indexes'",
")",
"->",
"isRequired",
"(",
")",
"->",
"requiresAtLeastOneElement",
"(",
")",
"->",
... | Set indexes parameters
@param ArrayNodeDefinition $node | [
"Set",
"indexes",
"parameters"
] | 6452cc3a5fab83647b6c08574164249fb8f03b05 | https://github.com/verdet23/SphinxSearchBundle/blob/6452cc3a5fab83647b6c08574164249fb8f03b05/DependencyInjection/Configuration.php#L56-L67 |
21,974 | verdet23/SphinxSearchBundle | DependencyInjection/Configuration.php | Configuration.addSearchdSection | private function addSearchdSection(ArrayNodeDefinition $node)
{
$node
->children()
->arrayNode('searchd')
->addDefaultsIfNotSet()
->children()
->scalarNode('host')->defaultValue('localhost')->end()
... | php | private function addSearchdSection(ArrayNodeDefinition $node)
{
$node
->children()
->arrayNode('searchd')
->addDefaultsIfNotSet()
->children()
->scalarNode('host')->defaultValue('localhost')->end()
... | [
"private",
"function",
"addSearchdSection",
"(",
"ArrayNodeDefinition",
"$",
"node",
")",
"{",
"$",
"node",
"->",
"children",
"(",
")",
"->",
"arrayNode",
"(",
"'searchd'",
")",
"->",
"addDefaultsIfNotSet",
"(",
")",
"->",
"children",
"(",
")",
"->",
"scalar... | Set search daemon parameters
@param ArrayNodeDefinition $node | [
"Set",
"search",
"daemon",
"parameters"
] | 6452cc3a5fab83647b6c08574164249fb8f03b05 | https://github.com/verdet23/SphinxSearchBundle/blob/6452cc3a5fab83647b6c08574164249fb8f03b05/DependencyInjection/Configuration.php#L74-L87 |
21,975 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/memcache.php | ezcCacheStorageMemcache.setOptions | public function setOptions( $options )
{
switch ( true )
{
case ( $options instanceof ezcCacheStorageMemcacheOptions ):
$this->properties['options'] = $options;
break;
case ( $options instanceof ezcCacheStorageOptions ):
$this->... | php | public function setOptions( $options )
{
switch ( true )
{
case ( $options instanceof ezcCacheStorageMemcacheOptions ):
$this->properties['options'] = $options;
break;
case ( $options instanceof ezcCacheStorageOptions ):
$this->... | [
"public",
"function",
"setOptions",
"(",
"$",
"options",
")",
"{",
"switch",
"(",
"true",
")",
"{",
"case",
"(",
"$",
"options",
"instanceof",
"ezcCacheStorageMemcacheOptions",
")",
":",
"$",
"this",
"->",
"properties",
"[",
"'options'",
"]",
"=",
"$",
"op... | Set new options.
Overwrites the options with the given ones.
@param ezcCacheStorageMemcacheOptions $options The options to set.
@throws ezcBasePropertyNotFoundException
If you tried to set a non-existent option value. The accepted
options depend on the ezcCacheStorage implementation and may
vary.
@throws ezcBaseValu... | [
"Set",
"new",
"options",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/memcache.php#L135-L155 |
21,976 | alevilar/ristorantino-vendor | Fidelization/Model/Cliente.php | Cliente.getResponsabilidadIva | function getResponsabilidadIva($id = 0){
if($id == 0){
$id = $this->id;
}
$ret = $this->find('first',array('conditions'=>array('Cliente.id'=>$id),'contain'=>array('IvaResponsabilidad')));
return $ret;
} | php | function getResponsabilidadIva($id = 0){
if($id == 0){
$id = $this->id;
}
$ret = $this->find('first',array('conditions'=>array('Cliente.id'=>$id),'contain'=>array('IvaResponsabilidad')));
return $ret;
} | [
"function",
"getResponsabilidadIva",
"(",
"$",
"id",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"id",
"==",
"0",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"id",
";",
"}",
"$",
"ret",
"=",
"$",
"this",
"->",
"find",
"(",
"'first'",
",",
"array",
"... | Me devuelve la responsabilidad del cliente frente el IVA
@return array find(first) con Cliente e IvaResponsabilidad | [
"Me",
"devuelve",
"la",
"responsabilidad",
"del",
"cliente",
"frente",
"el",
"IVA"
] | 6b91a1e20cc0ba09a1968d77e3de6512cfa2d966 | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Fidelization/Model/Cliente.php#L344-L350 |
21,977 | alevilar/ristorantino-vendor | Fidelization/Model/Cliente.php | Cliente.filerBySearch | public function filerBySearch($data) {
$filter = $data['search'];
$condition = array(
'OR' => array(
$this->alias . '.nombre LIKE' => '%' . $filter . '%',
$this->alias . '.nrodocumento LIKE' => '%' . $filter . '%',
$this->alias . '.telefono LIK... | php | public function filerBySearch($data) {
$filter = $data['search'];
$condition = array(
'OR' => array(
$this->alias . '.nombre LIKE' => '%' . $filter . '%',
$this->alias . '.nrodocumento LIKE' => '%' . $filter . '%',
$this->alias . '.telefono LIK... | [
"public",
"function",
"filerBySearch",
"(",
"$",
"data",
")",
"{",
"$",
"filter",
"=",
"$",
"data",
"[",
"'search'",
"]",
";",
"$",
"condition",
"=",
"array",
"(",
"'OR'",
"=>",
"array",
"(",
"$",
"this",
"->",
"alias",
".",
"'.nombre LIKE'",
"=>",
"... | Or conditions with like | [
"Or",
"conditions",
"with",
"like"
] | 6b91a1e20cc0ba09a1968d77e3de6512cfa2d966 | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Fidelization/Model/Cliente.php#L354-L366 |
21,978 | surebert/surebert-framework | src/sb/Email/Attachment.php | Attachment.zip | public function zip()
{
if (empty($this->filepath)) {
throw(new \Exception("Must set \sb\Email\Attachment::file_path before zipping attachment"));
}
if (empty($this->name)) {
$this->name = basename($this->filepath);
}
$zip = new \ZipArchive();
... | php | public function zip()
{
if (empty($this->filepath)) {
throw(new \Exception("Must set \sb\Email\Attachment::file_path before zipping attachment"));
}
if (empty($this->name)) {
$this->name = basename($this->filepath);
}
$zip = new \ZipArchive();
... | [
"public",
"function",
"zip",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"filepath",
")",
")",
"{",
"throw",
"(",
"new",
"\\",
"Exception",
"(",
"\"Must set \\sb\\Email\\Attachment::file_path before zipping attachment\"",
")",
")",
";",
"}",
"if... | Zips the attachment before sending and sets the proper mime type | [
"Zips",
"the",
"attachment",
"before",
"sending",
"and",
"sets",
"the",
"proper",
"mime",
"type"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Email/Attachment.php#L125-L161 |
21,979 | OKTOTV/OktolabMediaBundle | Model/MediaService.php | MediaService.addEpisodeJob | public function addEpisodeJob(Keychain $keychain, $uniqID, $overwrite = false, $worker_queue = false ,$first = false)
{
$this->jobService->addJob(
"Oktolab\MediaBundle\Model\ImportEpisodeMetadataJob",
[
'keychain' => $keychain->getUniqID(),
'uniqID' =>... | php | public function addEpisodeJob(Keychain $keychain, $uniqID, $overwrite = false, $worker_queue = false ,$first = false)
{
$this->jobService->addJob(
"Oktolab\MediaBundle\Model\ImportEpisodeMetadataJob",
[
'keychain' => $keychain->getUniqID(),
'uniqID' =>... | [
"public",
"function",
"addEpisodeJob",
"(",
"Keychain",
"$",
"keychain",
",",
"$",
"uniqID",
",",
"$",
"overwrite",
"=",
"false",
",",
"$",
"worker_queue",
"=",
"false",
",",
"$",
"first",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"jobService",
"->",
... | starts an import worker for an episode by uniqID from the given Keychain | [
"starts",
"an",
"import",
"worker",
"for",
"an",
"episode",
"by",
"uniqID",
"from",
"the",
"given",
"Keychain"
] | f9c1eac4f6b19d2ab25288b301dd0d9350478bb3 | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Model/MediaService.php#L92-L104 |
21,980 | OKTOTV/OktolabMediaBundle | Model/MediaService.php | MediaService.addImportSeriesPosterframeJob | public function addImportSeriesPosterframeJob($uniqID, $keychain, $filekey)
{
$this->jobService->addJob(
"Oktolab\MediaBundle\Model\ImportSeriesPosterframeJob",
['uniqID' => $uniqID, 'keychain' => $keychain->getUniqID(), 'key' => $filekey]
);
} | php | public function addImportSeriesPosterframeJob($uniqID, $keychain, $filekey)
{
$this->jobService->addJob(
"Oktolab\MediaBundle\Model\ImportSeriesPosterframeJob",
['uniqID' => $uniqID, 'keychain' => $keychain->getUniqID(), 'key' => $filekey]
);
} | [
"public",
"function",
"addImportSeriesPosterframeJob",
"(",
"$",
"uniqID",
",",
"$",
"keychain",
",",
"$",
"filekey",
")",
"{",
"$",
"this",
"->",
"jobService",
"->",
"addJob",
"(",
"\"Oktolab\\MediaBundle\\Model\\ImportSeriesPosterframeJob\"",
",",
"[",
"'uniqID'",
... | please use addSeriesPosterframeJob in the future.
@deprecated | [
"please",
"use",
"addSeriesPosterframeJob",
"in",
"the",
"future",
"."
] | f9c1eac4f6b19d2ab25288b301dd0d9350478bb3 | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Model/MediaService.php#L313-L319 |
21,981 | wenbinye/PhalconX | src/Db/DbHelper.php | DbHelper.describeColumns | public function describeColumns($conn, $table, $schema = null)
{
$dialect = $this->getDialect($conn);
if (method_exists($dialect, 'showFullColumns')) {
$sql = $this->getDialect($conn)->showFullColumns($table, $schema);
$comments = [];
foreach ($conn->fetchAll($sql... | php | public function describeColumns($conn, $table, $schema = null)
{
$dialect = $this->getDialect($conn);
if (method_exists($dialect, 'showFullColumns')) {
$sql = $this->getDialect($conn)->showFullColumns($table, $schema);
$comments = [];
foreach ($conn->fetchAll($sql... | [
"public",
"function",
"describeColumns",
"(",
"$",
"conn",
",",
"$",
"table",
",",
"$",
"schema",
"=",
"null",
")",
"{",
"$",
"dialect",
"=",
"$",
"this",
"->",
"getDialect",
"(",
"$",
"conn",
")",
";",
"if",
"(",
"method_exists",
"(",
"$",
"dialect"... | Adds comment to column
@param DbAdapter $conn
@param string $table
@param string $schema
@return Column[] | [
"Adds",
"comment",
"to",
"column"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Db/DbHelper.php#L32-L53 |
21,982 | wenbinye/PhalconX | src/Db/DbHelper.php | DbHelper.describeIndexes | public function describeIndexes($conn, $table, $schema = null)
{
$dialect = $conn->getDialectType();
$method = 'describeIndexes' . $dialect;
if (!method_exists($this, $method)) {
throw new Exception("Describe index for $dialect is not implemented yet");
}
return $... | php | public function describeIndexes($conn, $table, $schema = null)
{
$dialect = $conn->getDialectType();
$method = 'describeIndexes' . $dialect;
if (!method_exists($this, $method)) {
throw new Exception("Describe index for $dialect is not implemented yet");
}
return $... | [
"public",
"function",
"describeIndexes",
"(",
"$",
"conn",
",",
"$",
"table",
",",
"$",
"schema",
"=",
"null",
")",
"{",
"$",
"dialect",
"=",
"$",
"conn",
"->",
"getDialectType",
"(",
")",
";",
"$",
"method",
"=",
"'describeIndexes'",
".",
"$",
"dialec... | Describes table indexes
@param DbAdapter $conn
@param string $table
@param string $schema
@return Index[] | [
"Describes",
"table",
"indexes"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Db/DbHelper.php#L63-L71 |
21,983 | wenbinye/PhalconX | src/Db/DbHelper.php | DbHelper.createTable | public function createTable($conn, $table, $schema, array $definition)
{
if (empty($definition['columns'])) {
throw new Exception("The table must contain at least one column");
}
$conn->execute($this->getDialect($conn)->createTable($table, $schema, $definition));
} | php | public function createTable($conn, $table, $schema, array $definition)
{
if (empty($definition['columns'])) {
throw new Exception("The table must contain at least one column");
}
$conn->execute($this->getDialect($conn)->createTable($table, $schema, $definition));
} | [
"public",
"function",
"createTable",
"(",
"$",
"conn",
",",
"$",
"table",
",",
"$",
"schema",
",",
"array",
"$",
"definition",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"definition",
"[",
"'columns'",
"]",
")",
")",
"{",
"throw",
"new",
"Exception",
"(... | creates database table | [
"creates",
"database",
"table"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Db/DbHelper.php#L100-L106 |
21,984 | wenbinye/PhalconX | src/Db/DbHelper.php | DbHelper.getConnection | public static function getConnection($dsn)
{
if (!is_array($dsn)) {
$dsn = self::parseDsn($dsn);
}
if (!isset($dsn['adapter'])) {
throw new Exception("database adapter is missing for " . json_encode($dsn));
}
$class = 'Phalcon\Db\Adapter\Pdo\\' . ucfir... | php | public static function getConnection($dsn)
{
if (!is_array($dsn)) {
$dsn = self::parseDsn($dsn);
}
if (!isset($dsn['adapter'])) {
throw new Exception("database adapter is missing for " . json_encode($dsn));
}
$class = 'Phalcon\Db\Adapter\Pdo\\' . ucfir... | [
"public",
"static",
"function",
"getConnection",
"(",
"$",
"dsn",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"dsn",
")",
")",
"{",
"$",
"dsn",
"=",
"self",
"::",
"parseDsn",
"(",
"$",
"dsn",
")",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$"... | creates database connect by dsn
@param string $dsn
@return DbAdapter | [
"creates",
"database",
"connect",
"by",
"dsn"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Db/DbHelper.php#L159-L170 |
21,985 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php | Dwoo_Adapters_ZendFramework_View.setOptions | public function setOptions(array $opt = array())
{
// BC checks
// TODO remove in 1.1
if (isset($opt['compileDir']) || isset($opt['compile_dir'])) {
trigger_error('Dwoo ZF Adapter: the compile dir should be set in the $options[\'engine\'][\'compileDir\'] value the adapter settings', E_USER_WARNING);
}
if... | php | public function setOptions(array $opt = array())
{
// BC checks
// TODO remove in 1.1
if (isset($opt['compileDir']) || isset($opt['compile_dir'])) {
trigger_error('Dwoo ZF Adapter: the compile dir should be set in the $options[\'engine\'][\'compileDir\'] value the adapter settings', E_USER_WARNING);
}
if... | [
"public",
"function",
"setOptions",
"(",
"array",
"$",
"opt",
"=",
"array",
"(",
")",
")",
"{",
"// BC checks",
"// TODO remove in 1.1",
"if",
"(",
"isset",
"(",
"$",
"opt",
"[",
"'compileDir'",
"]",
")",
"||",
"isset",
"(",
"$",
"opt",
"[",
"'compile_di... | Set object state from options array
- engine = engine class name|engine object|array of options for engine
- dataProvider = data provider class name|data provider object|array of options for data provider
- compiler = compiler class name|compiler object|array of options for compiler
- templateFile =
Arra... | [
"Set",
"object",
"state",
"from",
"options",
"array",
"-",
"engine",
"=",
"engine",
"class",
"name|engine",
"object|array",
"of",
"options",
"for",
"engine",
"-",
"dataProvider",
"=",
"data",
"provider",
"class",
"name|data",
"provider",
"object|array",
"of",
"o... | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php#L93-L139 |
21,986 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php | Dwoo_Adapters_ZendFramework_View.setEngine | public function setEngine($engine)
{
// if param given as an object
if ($engine instanceof Dwoo) {
$this->_engine = $engine;
}
//
elseif (is_subclass_of($engine, 'Dwoo') || 'Dwoo' === $engine) {
$this->_engine = new $engine();
}
else {
throw new Dwoo_Exception("Custom engine must be a subclass o... | php | public function setEngine($engine)
{
// if param given as an object
if ($engine instanceof Dwoo) {
$this->_engine = $engine;
}
//
elseif (is_subclass_of($engine, 'Dwoo') || 'Dwoo' === $engine) {
$this->_engine = new $engine();
}
else {
throw new Dwoo_Exception("Custom engine must be a subclass o... | [
"public",
"function",
"setEngine",
"(",
"$",
"engine",
")",
"{",
"// if param given as an object",
"if",
"(",
"$",
"engine",
"instanceof",
"Dwoo",
")",
"{",
"$",
"this",
"->",
"_engine",
"=",
"$",
"engine",
";",
"}",
"//",
"elseif",
"(",
"is_subclass_of",
... | Sets template engine
@param string|Dwoo Object or name of the class | [
"Sets",
"template",
"engine"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php#L253-L266 |
21,987 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php | Dwoo_Adapters_ZendFramework_View.setDataProvider | public function setDataProvider($data)
{
if ($data instanceof Dwoo_IDataProvider) {
$this->_dataProvider = $data;
}
elseif (is_subclass_of($data, 'Dwoo_Data') || 'Dwoo_Data' == $data) {
$this->_dataProvider = new $data();
}
else {
throw new Dwoo_Exception("Custom data provider must be a subclass of ... | php | public function setDataProvider($data)
{
if ($data instanceof Dwoo_IDataProvider) {
$this->_dataProvider = $data;
}
elseif (is_subclass_of($data, 'Dwoo_Data') || 'Dwoo_Data' == $data) {
$this->_dataProvider = new $data();
}
else {
throw new Dwoo_Exception("Custom data provider must be a subclass of ... | [
"public",
"function",
"setDataProvider",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"data",
"instanceof",
"Dwoo_IDataProvider",
")",
"{",
"$",
"this",
"->",
"_dataProvider",
"=",
"$",
"data",
";",
"}",
"elseif",
"(",
"is_subclass_of",
"(",
"$",
"data",
... | Sets Dwoo data object
@param string|Dwoo_Data Object or name of the class | [
"Sets",
"Dwoo",
"data",
"object"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php#L287-L298 |
21,988 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php | Dwoo_Adapters_ZendFramework_View.setCompiler | public function setCompiler($compiler)
{
// if param given as an object
if ($compiler instanceof Dwoo_ICompiler) {
$this->_compiler = $compiler;
}
// if param given as a string
elseif (is_subclass_of($compiler, 'Dwoo_Compiler') || 'Dwoo_Compiler' == $compiler) {
$this->_compiler = new $compiler;
}
... | php | public function setCompiler($compiler)
{
// if param given as an object
if ($compiler instanceof Dwoo_ICompiler) {
$this->_compiler = $compiler;
}
// if param given as a string
elseif (is_subclass_of($compiler, 'Dwoo_Compiler') || 'Dwoo_Compiler' == $compiler) {
$this->_compiler = new $compiler;
}
... | [
"public",
"function",
"setCompiler",
"(",
"$",
"compiler",
")",
"{",
"// if param given as an object",
"if",
"(",
"$",
"compiler",
"instanceof",
"Dwoo_ICompiler",
")",
"{",
"$",
"this",
"->",
"_compiler",
"=",
"$",
"compiler",
";",
"}",
"// if param given as a str... | Sets Dwoo compiler
@param string|Dwoo_Compiler Object or name of the class | [
"Sets",
"Dwoo",
"compiler"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php#L320-L334 |
21,989 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php | Dwoo_Adapters_ZendFramework_View.getCompiler | public function getCompiler()
{
if (null === $this->_compiler) {
$this->_compiler = Dwoo_Compiler::compilerFactory();
}
return $this->_compiler;
} | php | public function getCompiler()
{
if (null === $this->_compiler) {
$this->_compiler = Dwoo_Compiler::compilerFactory();
}
return $this->_compiler;
} | [
"public",
"function",
"getCompiler",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"_compiler",
")",
"{",
"$",
"this",
"->",
"_compiler",
"=",
"Dwoo_Compiler",
"::",
"compilerFactory",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"_co... | Return the Dwoo compiler object
@return Dwoo_Data | [
"Return",
"the",
"Dwoo",
"compiler",
"object"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php#L341-L348 |
21,990 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php | Dwoo_Adapters_ZendFramework_View.getTemplateFile | public function getTemplateFile($template) {
$templateFileClass = $this->_templateFileClass;
$dwooTemplateFile = new $templateFileClass($template);
if (!($dwooTemplateFile instanceof Dwoo_ITemplate)) {
throw new Dwoo_Exception("Custom templateFile class must be a subclass of Dwoo_ITemplate");
}
fore... | php | public function getTemplateFile($template) {
$templateFileClass = $this->_templateFileClass;
$dwooTemplateFile = new $templateFileClass($template);
if (!($dwooTemplateFile instanceof Dwoo_ITemplate)) {
throw new Dwoo_Exception("Custom templateFile class must be a subclass of Dwoo_ITemplate");
}
fore... | [
"public",
"function",
"getTemplateFile",
"(",
"$",
"template",
")",
"{",
"$",
"templateFileClass",
"=",
"$",
"this",
"->",
"_templateFileClass",
";",
"$",
"dwooTemplateFile",
"=",
"new",
"$",
"templateFileClass",
"(",
"$",
"template",
")",
";",
"if",
"(",
"!... | Initializes Dwoo_ITemplate type of class and sets properties from _templateFileSettings
@param string Template location
@return Dwoo_ITemplate | [
"Initializes",
"Dwoo_ITemplate",
"type",
"of",
"class",
"and",
"sets",
"properties",
"from",
"_templateFileSettings"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php#L356-L372 |
21,991 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php | Dwoo_Adapters_ZendFramework_View.assign | public function assign($name, $val = null)
{
$this->getDataProvider()->assign($name, $val);
return $this;
} | php | public function assign($name, $val = null)
{
$this->getDataProvider()->assign($name, $val);
return $this;
} | [
"public",
"function",
"assign",
"(",
"$",
"name",
",",
"$",
"val",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"getDataProvider",
"(",
")",
"->",
"assign",
"(",
"$",
"name",
",",
"$",
"val",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Passes data to Dwoo_Data object
@see Dwoo_Data::assign()
@param array|string $name
@param mixed $val
@return Dwoo_Adapters_ZendFramework_View | [
"Passes",
"data",
"to",
"Dwoo_Data",
"object"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php#L392-L396 |
21,992 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php | Dwoo_Adapters_ZendFramework_View._run | public function _run()
{
echo $this->_engine->get(
$this->getTemplateFile(func_get_arg(0)),
$this->getDataProvider(),
$this->getCompiler()
);
} | php | public function _run()
{
echo $this->_engine->get(
$this->getTemplateFile(func_get_arg(0)),
$this->getDataProvider(),
$this->getCompiler()
);
} | [
"public",
"function",
"_run",
"(",
")",
"{",
"echo",
"$",
"this",
"->",
"_engine",
"->",
"get",
"(",
"$",
"this",
"->",
"getTemplateFile",
"(",
"func_get_arg",
"(",
"0",
")",
")",
",",
"$",
"this",
"->",
"getDataProvider",
"(",
")",
",",
"$",
"this",... | Processes a view script and outputs it. Output is then
passed through filters.
@param string $name The script script name to process.
@return string The script output. | [
"Processes",
"a",
"view",
"script",
"and",
"outputs",
"it",
".",
"Output",
"is",
"then",
"passed",
"through",
"filters",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php#L444-L451 |
21,993 | surebert/surebert-framework | src/sb/FTP/Client.php | Client.size | public function size($remote_file)
{
$size = @ftp_size($this->connection, $remote_file);
if ($size && $size != -1) {
return $size;
} else {
throw new \Exception("Could not get remote file size: " . $path);
}
} | php | public function size($remote_file)
{
$size = @ftp_size($this->connection, $remote_file);
if ($size && $size != -1) {
return $size;
} else {
throw new \Exception("Could not get remote file size: " . $path);
}
} | [
"public",
"function",
"size",
"(",
"$",
"remote_file",
")",
"{",
"$",
"size",
"=",
"@",
"ftp_size",
"(",
"$",
"this",
"->",
"connection",
",",
"$",
"remote_file",
")",
";",
"if",
"(",
"$",
"size",
"&&",
"$",
"size",
"!=",
"-",
"1",
")",
"{",
"ret... | Gets the size of a remote file
@param string $remote_file path to remote file
@return integer The size of the file in bytes | [
"Gets",
"the",
"size",
"of",
"a",
"remote",
"file"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/FTP/Client.php#L127-L135 |
21,994 | surebert/surebert-framework | src/sb/FTP/Client.php | Client.chmod | public function chmod($remote_file, $mode)
{
$mode = octdec(str_pad($mode, 4, '0', STR_PAD_LEFT));
$mode = (int) $mode;
if (!@ftp_chmod($this->connection, $mode, $remote_file) !== false) {
throw new \Exception("Could not change remote file to mode: " . $mode);
}
... | php | public function chmod($remote_file, $mode)
{
$mode = octdec(str_pad($mode, 4, '0', STR_PAD_LEFT));
$mode = (int) $mode;
if (!@ftp_chmod($this->connection, $mode, $remote_file) !== false) {
throw new \Exception("Could not change remote file to mode: " . $mode);
}
... | [
"public",
"function",
"chmod",
"(",
"$",
"remote_file",
",",
"$",
"mode",
")",
"{",
"$",
"mode",
"=",
"octdec",
"(",
"str_pad",
"(",
"$",
"mode",
",",
"4",
",",
"'0'",
",",
"STR_PAD_LEFT",
")",
")",
";",
"$",
"mode",
"=",
"(",
"int",
")",
"$",
... | Change the file mode of a remote file
@param string $remote_file The path to the remote file
@param integer $mode The file mode e.g. 0644, 0777
@return boolean | [
"Change",
"the",
"file",
"mode",
"of",
"a",
"remote",
"file"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/FTP/Client.php#L143-L153 |
21,995 | webdevvie/pheanstalk-task-queue-bundle | Command/StopWorkerTenderCommand.php | StopWorkerTenderCommand.findWorkerTenderProcessesForTube | private function findWorkerTenderProcessesForTube($tube)
{
$processes = array();
$command = "ps ax ";
$command .= "|grep php ";
$command .= "|grep -v stop ";
$command .= "|grep worker-tender ";
if ($tube !== '') {
$command .= "|grep " . escapeshellarg('use... | php | private function findWorkerTenderProcessesForTube($tube)
{
$processes = array();
$command = "ps ax ";
$command .= "|grep php ";
$command .= "|grep -v stop ";
$command .= "|grep worker-tender ";
if ($tube !== '') {
$command .= "|grep " . escapeshellarg('use... | [
"private",
"function",
"findWorkerTenderProcessesForTube",
"(",
"$",
"tube",
")",
"{",
"$",
"processes",
"=",
"array",
"(",
")",
";",
"$",
"command",
"=",
"\"ps ax \"",
";",
"$",
"command",
".=",
"\"|grep php \"",
";",
"$",
"command",
".=",
"\"|grep -v stop \"... | Returns a list of processes that match the worker-tender
@param string $tube
@return array | [
"Returns",
"a",
"list",
"of",
"processes",
"that",
"match",
"the",
"worker",
"-",
"tender"
] | db5e63a8f844e345dc2e69ce8e94b32d851020eb | https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Command/StopWorkerTenderCommand.php#L69-L92 |
21,996 | sciactive/nymph-server | src/REST.php | REST.run | public function run($method, $action, $data) {
$method = strtoupper($method);
if (is_callable([$this, $method])) {
return $this->$method($action, $data);
}
return $this->httpError(405, 'Method Not Allowed');
} | php | public function run($method, $action, $data) {
$method = strtoupper($method);
if (is_callable([$this, $method])) {
return $this->$method($action, $data);
}
return $this->httpError(405, 'Method Not Allowed');
} | [
"public",
"function",
"run",
"(",
"$",
"method",
",",
"$",
"action",
",",
"$",
"data",
")",
"{",
"$",
"method",
"=",
"strtoupper",
"(",
"$",
"method",
")",
";",
"if",
"(",
"is_callable",
"(",
"[",
"$",
"this",
",",
"$",
"method",
"]",
")",
")",
... | Run the Nymph REST server process.
Note that on failure, an HTTP error status code will be sent, usually
along with a message body.
@param string $method The HTTP method.
@param string $action The Nymph action.
@param string $data The JSON encoded data.
@return bool True on success, false on failure. | [
"Run",
"the",
"Nymph",
"REST",
"server",
"process",
"."
] | 3c18dbf45c2750d07c798e14534dba87387beeba | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/REST.php#L26-L32 |
21,997 | sciactive/nymph-server | src/REST.php | REST.httpError | protected function httpError($errorCode, $message, $exception = null) {
header("HTTP/1.1 $errorCode $message", true, $errorCode);
if ($exception) {
echo json_encode([
'textStatus' => "$errorCode $message",
'exception' => get_class($exception),
'code' => $exception->getCode(),
... | php | protected function httpError($errorCode, $message, $exception = null) {
header("HTTP/1.1 $errorCode $message", true, $errorCode);
if ($exception) {
echo json_encode([
'textStatus' => "$errorCode $message",
'exception' => get_class($exception),
'code' => $exception->getCode(),
... | [
"protected",
"function",
"httpError",
"(",
"$",
"errorCode",
",",
"$",
"message",
",",
"$",
"exception",
"=",
"null",
")",
"{",
"header",
"(",
"\"HTTP/1.1 $errorCode $message\"",
",",
"true",
",",
"$",
"errorCode",
")",
";",
"if",
"(",
"$",
"exception",
")... | Return the request with an HTTP error response.
@param int $errorCode The HTTP status code.
@param string $message The message to place on the HTTP status header line.
@param Exception $exception An optional exception object to report.
@return boolean Always returns false.
@access protected | [
"Return",
"the",
"request",
"with",
"an",
"HTTP",
"error",
"response",
"."
] | 3c18dbf45c2750d07c798e14534dba87387beeba | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/REST.php#L457-L470 |
21,998 | frodeborli/fubber-reactor | src/Host.php | Host.listen | public function listen($request, $response) {
// $this->debug('Host::listen: path='.$request->getPath().'?'.http_build_query($request->getQuery()));
$this->hits++;
$path = '/'.ltrim($request->getPath(), '/');
$endpoint = NULL;
if(isset($this->routes[$path])) {
// Direct lookup
$endpoint = $this->route... | php | public function listen($request, $response) {
// $this->debug('Host::listen: path='.$request->getPath().'?'.http_build_query($request->getQuery()));
$this->hits++;
$path = '/'.ltrim($request->getPath(), '/');
$endpoint = NULL;
if(isset($this->routes[$path])) {
// Direct lookup
$endpoint = $this->route... | [
"public",
"function",
"listen",
"(",
"$",
"request",
",",
"$",
"response",
")",
"{",
"//\t\t$this->debug('Host::listen: path='.$request->getPath().'?'.http_build_query($request->getQuery()));",
"$",
"this",
"->",
"hits",
"++",
";",
"$",
"path",
"=",
"'/'",
".",
"ltrim",... | Handle an incoming request, map it to the correct endpoint using routes and call the listen method on the endpoint | [
"Handle",
"an",
"incoming",
"request",
"map",
"it",
"to",
"the",
"correct",
"endpoint",
"using",
"routes",
"and",
"call",
"the",
"listen",
"method",
"on",
"the",
"endpoint"
] | 3920f86a788c1a73360ebf6a215da15e097a1afa | https://github.com/frodeborli/fubber-reactor/blob/3920f86a788c1a73360ebf6a215da15e097a1afa/src/Host.php#L156-L206 |
21,999 | frodeborli/fubber-reactor | src/Host.php | Host.scanRoutes | protected function scanRoutes($root, $realRoot=NULL) {
if($realRoot === NULL) $realRoot = $root;
$result = array();
$all = glob($root.'/*'); /* */
foreach($all as $path) {
if(!is_dir($path)) {
// This is an endpoint
$res = $this->createRouteFromFile($realRoot, $path);
if($res)
$result[] = $... | php | protected function scanRoutes($root, $realRoot=NULL) {
if($realRoot === NULL) $realRoot = $root;
$result = array();
$all = glob($root.'/*'); /* */
foreach($all as $path) {
if(!is_dir($path)) {
// This is an endpoint
$res = $this->createRouteFromFile($realRoot, $path);
if($res)
$result[] = $... | [
"protected",
"function",
"scanRoutes",
"(",
"$",
"root",
",",
"$",
"realRoot",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"realRoot",
"===",
"NULL",
")",
"$",
"realRoot",
"=",
"$",
"root",
";",
"$",
"result",
"=",
"array",
"(",
")",
";",
"$",
"all",
... | Recursively find all routes within path | [
"Recursively",
"find",
"all",
"routes",
"within",
"path"
] | 3920f86a788c1a73360ebf6a215da15e097a1afa | https://github.com/frodeborli/fubber-reactor/blob/3920f86a788c1a73360ebf6a215da15e097a1afa/src/Host.php#L283-L301 |
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.