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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
7,600 | joegreen88/zf1-components-base | src/Zend/Loader/Autoloader.php | Zend_Loader_Autoloader.unregisterNamespace | public function unregisterNamespace($namespace)
{
if (is_string($namespace)) {
$namespace = (array) $namespace;
} elseif (!is_array($namespace)) {
throw new Zend_Loader_Exception('Invalid namespace provided');
}
foreach ($namespace as $ns) {
if (i... | php | public function unregisterNamespace($namespace)
{
if (is_string($namespace)) {
$namespace = (array) $namespace;
} elseif (!is_array($namespace)) {
throw new Zend_Loader_Exception('Invalid namespace provided');
}
foreach ($namespace as $ns) {
if (i... | [
"public",
"function",
"unregisterNamespace",
"(",
"$",
"namespace",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"namespace",
")",
")",
"{",
"$",
"namespace",
"=",
"(",
"array",
")",
"$",
"namespace",
";",
"}",
"elseif",
"(",
"!",
"is_array",
"(",
"$",
... | Unload a registered autoload namespace
@param string|array $namespace
@return Zend_Loader_Autoloader | [
"Unload",
"a",
"registered",
"autoload",
"namespace"
] | d4591a2234c2db3094b54c08bcdc4303f7bf4819 | https://github.com/joegreen88/zf1-components-base/blob/d4591a2234c2db3094b54c08bcdc4303f7bf4819/src/Zend/Loader/Autoloader.php#L228-L242 |
7,601 | joegreen88/zf1-components-base | src/Zend/Loader/Autoloader.php | Zend_Loader_Autoloader.suppressNotFoundWarnings | public function suppressNotFoundWarnings($flag = null)
{
if (null === $flag) {
return $this->_suppressNotFoundWarnings;
}
$this->_suppressNotFoundWarnings = (bool) $flag;
return $this;
} | php | public function suppressNotFoundWarnings($flag = null)
{
if (null === $flag) {
return $this->_suppressNotFoundWarnings;
}
$this->_suppressNotFoundWarnings = (bool) $flag;
return $this;
} | [
"public",
"function",
"suppressNotFoundWarnings",
"(",
"$",
"flag",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"flag",
")",
"{",
"return",
"$",
"this",
"->",
"_suppressNotFoundWarnings",
";",
"}",
"$",
"this",
"->",
"_suppressNotFoundWarnings",
"=... | Get or set the value of the "suppress not found warnings" flag
@param null|bool $flag
@return bool|Zend_Loader_Autoloader Returns boolean if no argument is passed, object instance otherwise | [
"Get",
"or",
"set",
"the",
"value",
"of",
"the",
"suppress",
"not",
"found",
"warnings",
"flag"
] | d4591a2234c2db3094b54c08bcdc4303f7bf4819 | https://github.com/joegreen88/zf1-components-base/blob/d4591a2234c2db3094b54c08bcdc4303f7bf4819/src/Zend/Loader/Autoloader.php#L286-L293 |
7,602 | joegreen88/zf1-components-base | src/Zend/Loader/Autoloader.php | Zend_Loader_Autoloader.getClassAutoloaders | public function getClassAutoloaders($class)
{
$namespace = false;
$autoloaders = array();
// Add concrete namespaced autoloaders
foreach (array_keys($this->_namespaceAutoloaders) as $ns) {
if ('' == $ns) {
continue;
}
if (0 === s... | php | public function getClassAutoloaders($class)
{
$namespace = false;
$autoloaders = array();
// Add concrete namespaced autoloaders
foreach (array_keys($this->_namespaceAutoloaders) as $ns) {
if ('' == $ns) {
continue;
}
if (0 === s... | [
"public",
"function",
"getClassAutoloaders",
"(",
"$",
"class",
")",
"{",
"$",
"namespace",
"=",
"false",
";",
"$",
"autoloaders",
"=",
"array",
"(",
")",
";",
"// Add concrete namespaced autoloaders",
"foreach",
"(",
"array_keys",
"(",
"$",
"this",
"->",
"_na... | Get autoloaders to use when matching class
Determines if the class matches a registered namespace, and, if so,
returns only the autoloaders for that namespace. Otherwise, it returns
all non-namespaced autoloaders.
@param string $class
@return array Array of autoloaders to use | [
"Get",
"autoloaders",
"to",
"use",
"when",
"matching",
"class"
] | d4591a2234c2db3094b54c08bcdc4303f7bf4819 | https://github.com/joegreen88/zf1-components-base/blob/d4591a2234c2db3094b54c08bcdc4303f7bf4819/src/Zend/Loader/Autoloader.php#L327-L369 |
7,603 | joegreen88/zf1-components-base | src/Zend/Loader/Autoloader.php | Zend_Loader_Autoloader.unshiftAutoloader | public function unshiftAutoloader($callback, $namespace = '')
{
$autoloaders = $this->getAutoloaders();
array_unshift($autoloaders, $callback);
$this->setAutoloaders($autoloaders);
$namespace = (array) $namespace;
foreach ($namespace as $ns) {
$autoloaders = $thi... | php | public function unshiftAutoloader($callback, $namespace = '')
{
$autoloaders = $this->getAutoloaders();
array_unshift($autoloaders, $callback);
$this->setAutoloaders($autoloaders);
$namespace = (array) $namespace;
foreach ($namespace as $ns) {
$autoloaders = $thi... | [
"public",
"function",
"unshiftAutoloader",
"(",
"$",
"callback",
",",
"$",
"namespace",
"=",
"''",
")",
"{",
"$",
"autoloaders",
"=",
"$",
"this",
"->",
"getAutoloaders",
"(",
")",
";",
"array_unshift",
"(",
"$",
"autoloaders",
",",
"$",
"callback",
")",
... | Add an autoloader to the beginning of the stack
@param object|array|string $callback PHP callback or Zend_Loader_Autoloader_Interface implementation
@param string|array $namespace Specific namespace(s) under which to register callback
@return Zend_Loader_Autoloader | [
"Add",
"an",
"autoloader",
"to",
"the",
"beginning",
"of",
"the",
"stack"
] | d4591a2234c2db3094b54c08bcdc4303f7bf4819 | https://github.com/joegreen88/zf1-components-base/blob/d4591a2234c2db3094b54c08bcdc4303f7bf4819/src/Zend/Loader/Autoloader.php#L378-L392 |
7,604 | joegreen88/zf1-components-base | src/Zend/Loader/Autoloader.php | Zend_Loader_Autoloader.pushAutoloader | public function pushAutoloader($callback, $namespace = '')
{
$autoloaders = $this->getAutoloaders();
array_push($autoloaders, $callback);
$this->setAutoloaders($autoloaders);
$namespace = (array) $namespace;
foreach ($namespace as $ns) {
$autoloaders = $this->get... | php | public function pushAutoloader($callback, $namespace = '')
{
$autoloaders = $this->getAutoloaders();
array_push($autoloaders, $callback);
$this->setAutoloaders($autoloaders);
$namespace = (array) $namespace;
foreach ($namespace as $ns) {
$autoloaders = $this->get... | [
"public",
"function",
"pushAutoloader",
"(",
"$",
"callback",
",",
"$",
"namespace",
"=",
"''",
")",
"{",
"$",
"autoloaders",
"=",
"$",
"this",
"->",
"getAutoloaders",
"(",
")",
";",
"array_push",
"(",
"$",
"autoloaders",
",",
"$",
"callback",
")",
";",
... | Append an autoloader to the autoloader stack
@param object|array|string $callback PHP callback or Zend_Loader_Autoloader_Interface implementation
@param string|array $namespace Specific namespace(s) under which to register callback
@return Zend_Loader_Autoloader | [
"Append",
"an",
"autoloader",
"to",
"the",
"autoloader",
"stack"
] | d4591a2234c2db3094b54c08bcdc4303f7bf4819 | https://github.com/joegreen88/zf1-components-base/blob/d4591a2234c2db3094b54c08bcdc4303f7bf4819/src/Zend/Loader/Autoloader.php#L401-L415 |
7,605 | joegreen88/zf1-components-base | src/Zend/Loader/Autoloader.php | Zend_Loader_Autoloader.removeAutoloader | public function removeAutoloader($callback, $namespace = null)
{
if (null === $namespace) {
$autoloaders = $this->getAutoloaders();
if (false !== ($index = array_search($callback, $autoloaders, true))) {
unset($autoloaders[$index]);
$this->setAutoloade... | php | public function removeAutoloader($callback, $namespace = null)
{
if (null === $namespace) {
$autoloaders = $this->getAutoloaders();
if (false !== ($index = array_search($callback, $autoloaders, true))) {
unset($autoloaders[$index]);
$this->setAutoloade... | [
"public",
"function",
"removeAutoloader",
"(",
"$",
"callback",
",",
"$",
"namespace",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"namespace",
")",
"{",
"$",
"autoloaders",
"=",
"$",
"this",
"->",
"getAutoloaders",
"(",
")",
";",
"if",
"(",
... | Remove an autoloader from the autoloader stack
@param object|array|string $callback PHP callback or Zend_Loader_Autoloader_Interface implementation
@param null|string|array $namespace Specific namespace(s) from which to remove autoloader
@return Zend_Loader_Autoloader | [
"Remove",
"an",
"autoloader",
"from",
"the",
"autoloader",
"stack"
] | d4591a2234c2db3094b54c08bcdc4303f7bf4819 | https://github.com/joegreen88/zf1-components-base/blob/d4591a2234c2db3094b54c08bcdc4303f7bf4819/src/Zend/Loader/Autoloader.php#L424-L451 |
7,606 | joegreen88/zf1-components-base | src/Zend/Loader/Autoloader.php | Zend_Loader_Autoloader._autoload | protected function _autoload($class)
{
$callback = $this->getDefaultAutoloader();
try {
if ($this->suppressNotFoundWarnings()) {
@call_user_func($callback, $class);
} else {
call_user_func($callback, $class);
}
return $c... | php | protected function _autoload($class)
{
$callback = $this->getDefaultAutoloader();
try {
if ($this->suppressNotFoundWarnings()) {
@call_user_func($callback, $class);
} else {
call_user_func($callback, $class);
}
return $c... | [
"protected",
"function",
"_autoload",
"(",
"$",
"class",
")",
"{",
"$",
"callback",
"=",
"$",
"this",
"->",
"getDefaultAutoloader",
"(",
")",
";",
"try",
"{",
"if",
"(",
"$",
"this",
"->",
"suppressNotFoundWarnings",
"(",
")",
")",
"{",
"@",
"call_user_f... | Internal autoloader implementation
@param string $class
@return bool | [
"Internal",
"autoloader",
"implementation"
] | d4591a2234c2db3094b54c08bcdc4303f7bf4819 | https://github.com/joegreen88/zf1-components-base/blob/d4591a2234c2db3094b54c08bcdc4303f7bf4819/src/Zend/Loader/Autoloader.php#L472-L485 |
7,607 | joegreen88/zf1-components-base | src/Zend/Loader/Autoloader.php | Zend_Loader_Autoloader._getVersionPath | protected function _getVersionPath($path, $version)
{
$type = $this->_getVersionType($version);
if ($type == 'latest') {
$version = 'latest';
}
$availableVersions = $this->_getAvailableVersions($path, $version);
if (empty($availableVersions)) {
throw... | php | protected function _getVersionPath($path, $version)
{
$type = $this->_getVersionType($version);
if ($type == 'latest') {
$version = 'latest';
}
$availableVersions = $this->_getAvailableVersions($path, $version);
if (empty($availableVersions)) {
throw... | [
"protected",
"function",
"_getVersionPath",
"(",
"$",
"path",
",",
"$",
"version",
")",
"{",
"$",
"type",
"=",
"$",
"this",
"->",
"_getVersionType",
"(",
"$",
"version",
")",
";",
"if",
"(",
"$",
"type",
"==",
"'latest'",
")",
"{",
"$",
"version",
"=... | Retrieve the filesystem path for the requested ZF version
@param string $path
@param string $version
@return void | [
"Retrieve",
"the",
"filesystem",
"path",
"for",
"the",
"requested",
"ZF",
"version"
] | d4591a2234c2db3094b54c08bcdc4303f7bf4819 | https://github.com/joegreen88/zf1-components-base/blob/d4591a2234c2db3094b54c08bcdc4303f7bf4819/src/Zend/Loader/Autoloader.php#L508-L523 |
7,608 | joegreen88/zf1-components-base | src/Zend/Loader/Autoloader.php | Zend_Loader_Autoloader._getVersionType | protected function _getVersionType($version)
{
if (strtolower($version) == 'latest') {
return 'latest';
}
$parts = explode('.', $version);
$count = count($parts);
if (1 == $count) {
return 'major';
}
if (2 == $count) {
retu... | php | protected function _getVersionType($version)
{
if (strtolower($version) == 'latest') {
return 'latest';
}
$parts = explode('.', $version);
$count = count($parts);
if (1 == $count) {
return 'major';
}
if (2 == $count) {
retu... | [
"protected",
"function",
"_getVersionType",
"(",
"$",
"version",
")",
"{",
"if",
"(",
"strtolower",
"(",
"$",
"version",
")",
"==",
"'latest'",
")",
"{",
"return",
"'latest'",
";",
"}",
"$",
"parts",
"=",
"explode",
"(",
"'.'",
",",
"$",
"version",
")"... | Retrieve the ZF version type
@param string $version
@return string "latest", "major", "minor", or "specific"
@throws Zend_Loader_Exception if version string contains too many dots | [
"Retrieve",
"the",
"ZF",
"version",
"type"
] | d4591a2234c2db3094b54c08bcdc4303f7bf4819 | https://github.com/joegreen88/zf1-components-base/blob/d4591a2234c2db3094b54c08bcdc4303f7bf4819/src/Zend/Loader/Autoloader.php#L532-L550 |
7,609 | joegreen88/zf1-components-base | src/Zend/Loader/Autoloader.php | Zend_Loader_Autoloader._getAvailableVersions | protected function _getAvailableVersions($path, $version)
{
if (!is_dir($path)) {
throw new Zend_Loader_Exception('Invalid ZF path provided');
}
$path = rtrim($path, '/');
$path = rtrim($path, '\\');
$versionLen = strlen($version);
$versions ... | php | protected function _getAvailableVersions($path, $version)
{
if (!is_dir($path)) {
throw new Zend_Loader_Exception('Invalid ZF path provided');
}
$path = rtrim($path, '/');
$path = rtrim($path, '\\');
$versionLen = strlen($version);
$versions ... | [
"protected",
"function",
"_getAvailableVersions",
"(",
"$",
"path",
",",
"$",
"version",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"path",
")",
")",
"{",
"throw",
"new",
"Zend_Loader_Exception",
"(",
"'Invalid ZF path provided'",
")",
";",
"}",
"$",
"p... | Get available versions for the version type requested
@param string $path
@param string $version
@return array | [
"Get",
"available",
"versions",
"for",
"the",
"version",
"type",
"requested"
] | d4591a2234c2db3094b54c08bcdc4303f7bf4819 | https://github.com/joegreen88/zf1-components-base/blob/d4591a2234c2db3094b54c08bcdc4303f7bf4819/src/Zend/Loader/Autoloader.php#L559-L588 |
7,610 | wollanup/php-api-rest | src/Entity/EntityFactory.php | EntityFactory.create | public function create(
EntityFactoryConfig $config,
ServerRequestInterface $request,
ResponseInterface $response,
callable $next
): ResponseInterface {
$entityRequest = $config->createEntityRequest($request, $this->container);
# make a new empty record
$obj ... | php | public function create(
EntityFactoryConfig $config,
ServerRequestInterface $request,
ResponseInterface $response,
callable $next
): ResponseInterface {
$entityRequest = $config->createEntityRequest($request, $this->container);
# make a new empty record
$obj ... | [
"public",
"function",
"create",
"(",
"EntityFactoryConfig",
"$",
"config",
",",
"ServerRequestInterface",
"$",
"request",
",",
"ResponseInterface",
"$",
"response",
",",
"callable",
"$",
"next",
")",
":",
"ResponseInterface",
"{",
"$",
"entityRequest",
"=",
"$",
... | Create a new instance of activeRecord and add it to Request attributes
@param EntityFactoryConfig $config
@param ServerRequestInterface $request
@param ResponseInterface $response
@param callable $next
@return ResponseInterface | [
"Create",
"a",
"new",
"instance",
"of",
"activeRecord",
"and",
"add",
"it",
"to",
"Request",
"attributes"
] | 185eac8a8412e5997d8e292ebd0e38787ae4b949 | https://github.com/wollanup/php-api-rest/blob/185eac8a8412e5997d8e292ebd0e38787ae4b949/src/Entity/EntityFactory.php#L46-L78 |
7,611 | wollanup/php-api-rest | src/Entity/EntityFactory.php | EntityFactory.fetch | public function fetch(
EntityFactoryConfig $config,
ServerRequestInterface $request,
ResponseInterface $response,
callable $next
): ResponseInterface {
$entityRequest = $config->createEntityRequest($request, $this->container);
# First, we try to determine PK in reque... | php | public function fetch(
EntityFactoryConfig $config,
ServerRequestInterface $request,
ResponseInterface $response,
callable $next
): ResponseInterface {
$entityRequest = $config->createEntityRequest($request, $this->container);
# First, we try to determine PK in reque... | [
"public",
"function",
"fetch",
"(",
"EntityFactoryConfig",
"$",
"config",
",",
"ServerRequestInterface",
"$",
"request",
",",
"ResponseInterface",
"$",
"response",
",",
"callable",
"$",
"next",
")",
":",
"ResponseInterface",
"{",
"$",
"entityRequest",
"=",
"$",
... | Fetch an existing instance of activeRecord and add it to Request attributes
@param EntityFactoryConfig $config
@param ServerRequestInterface $request
@param ResponseInterface $response
@param callable $next
@return ResponseInterface | [
"Fetch",
"an",
"existing",
"instance",
"of",
"activeRecord",
"and",
"add",
"it",
"to",
"Request",
"attributes"
] | 185eac8a8412e5997d8e292ebd0e38787ae4b949 | https://github.com/wollanup/php-api-rest/blob/185eac8a8412e5997d8e292ebd0e38787ae4b949/src/Entity/EntityFactory.php#L90-L145 |
7,612 | wollanup/php-api-rest | src/Entity/EntityFactory.php | EntityFactory.fetchCollection | public function fetchCollection(
EntityRequestInterface $entityRequest,
ServerRequestInterface $request,
ResponseInterface $response,
callable $next,
$nameOfParameterToAdd = null
): ResponseInterface {
$pks = [];
if ($request->getMethod() === 'GET') {
... | php | public function fetchCollection(
EntityRequestInterface $entityRequest,
ServerRequestInterface $request,
ResponseInterface $response,
callable $next,
$nameOfParameterToAdd = null
): ResponseInterface {
$pks = [];
if ($request->getMethod() === 'GET') {
... | [
"public",
"function",
"fetchCollection",
"(",
"EntityRequestInterface",
"$",
"entityRequest",
",",
"ServerRequestInterface",
"$",
"request",
",",
"ResponseInterface",
"$",
"response",
",",
"callable",
"$",
"next",
",",
"$",
"nameOfParameterToAdd",
"=",
"null",
")",
... | Fetch an existing collection of activeRecords and add it to Request attributes
@param EntityRequestInterface $entityRequest
@param ServerRequestInterface $request
@param ResponseInterface $response
@param callable $next
@param $nameOfParameterToAdd
@return ResponseInterface
@throws Propel... | [
"Fetch",
"an",
"existing",
"collection",
"of",
"activeRecords",
"and",
"add",
"it",
"to",
"Request",
"attributes"
] | 185eac8a8412e5997d8e292ebd0e38787ae4b949 | https://github.com/wollanup/php-api-rest/blob/185eac8a8412e5997d8e292ebd0e38787ae4b949/src/Entity/EntityFactory.php#L159-L212 |
7,613 | mszewcz/php-light-framework | src/Html/Form/Form.php | Form.addElement | public function addElement(Element $element): Element
{
if ($element instanceof FormStatus) {
if ($this->hasStatus === true) {
throw new InvalidArgumentException('Form can contain only one FormStatus element');
}
$this->hasStatus = true;
}
... | php | public function addElement(Element $element): Element
{
if ($element instanceof FormStatus) {
if ($this->hasStatus === true) {
throw new InvalidArgumentException('Form can contain only one FormStatus element');
}
$this->hasStatus = true;
}
... | [
"public",
"function",
"addElement",
"(",
"Element",
"$",
"element",
")",
":",
"Element",
"{",
"if",
"(",
"$",
"element",
"instanceof",
"FormStatus",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasStatus",
"===",
"true",
")",
"{",
"throw",
"new",
"InvalidArg... | Adds element to composite. Throws InvalidArgumentException if more than one FormStatus element is added.
@param Element $element
@return Element | [
"Adds",
"element",
"to",
"composite",
".",
"Throws",
"InvalidArgumentException",
"if",
"more",
"than",
"one",
"FormStatus",
"element",
"is",
"added",
"."
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Html/Form/Form.php#L65-L74 |
7,614 | mszewcz/php-light-framework | src/Html/Form/Form.php | Form.generate | public function generate(): string
{
$elements = [];
foreach ($this->hiddens as $hidden) {
$elements[] = $hidden;
}
foreach ($this->elements as $element) {
/** @noinspection PhpUndefinedMethodInspection */
$elements[] = $element->generate();
... | php | public function generate(): string
{
$elements = [];
foreach ($this->hiddens as $hidden) {
$elements[] = $hidden;
}
foreach ($this->elements as $element) {
/** @noinspection PhpUndefinedMethodInspection */
$elements[] = $element->generate();
... | [
"public",
"function",
"generate",
"(",
")",
":",
"string",
"{",
"$",
"elements",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"hiddens",
"as",
"$",
"hidden",
")",
"{",
"$",
"elements",
"[",
"]",
"=",
"$",
"hidden",
";",
"}",
"foreach",
... | Generates from and returns it
@return string | [
"Generates",
"from",
"and",
"returns",
"it"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Html/Form/Form.php#L81-L92 |
7,615 | zepi/turbo-base | Zepi/Web/General/Module.php | Module.getDataObjectBackend | protected function getDataObjectBackend($dataFileName)
{
$path = $this->framework->getRootDirectory() . '/data/' . $dataFileName;
$objectBackend = new \Zepi\Turbo\Backend\FileObjectBackend($path);
return $objectBackend;
} | php | protected function getDataObjectBackend($dataFileName)
{
$path = $this->framework->getRootDirectory() . '/data/' . $dataFileName;
$objectBackend = new \Zepi\Turbo\Backend\FileObjectBackend($path);
return $objectBackend;
} | [
"protected",
"function",
"getDataObjectBackend",
"(",
"$",
"dataFileName",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"framework",
"->",
"getRootDirectory",
"(",
")",
".",
"'/data/'",
".",
"$",
"dataFileName",
";",
"$",
"objectBackend",
"=",
"new",
"\\",... | Returns a data object backend for the given file name
@param string $dataFileName
@return \Zepi\Turbo\Backend\FileObjectBackend | [
"Returns",
"a",
"data",
"object",
"backend",
"for",
"the",
"given",
"file",
"name"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/General/Module.php#L151-L157 |
7,616 | clusterpoint/php-client-api | response.class.php | CPS_Response.getRawDocuments | public function getRawDocuments($returnType)
{
if ($returnType == DOC_TYPE_ARRAY) {
$res = array();
foreach ($this->_documents as $key => $value) {
$res[$key] = CPS_Response::simpleXmlToArray($value);
}
return $res;
} else if ($returnType == DOC_TYPE_STDCLASS) {
$res = ar... | php | public function getRawDocuments($returnType)
{
if ($returnType == DOC_TYPE_ARRAY) {
$res = array();
foreach ($this->_documents as $key => $value) {
$res[$key] = CPS_Response::simpleXmlToArray($value);
}
return $res;
} else if ($returnType == DOC_TYPE_STDCLASS) {
$res = ar... | [
"public",
"function",
"getRawDocuments",
"(",
"$",
"returnType",
")",
"{",
"if",
"(",
"$",
"returnType",
"==",
"DOC_TYPE_ARRAY",
")",
"{",
"$",
"res",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_documents",
"as",
"$",
"key",
"=>",... | Returns the documents from the response
@return array | [
"Returns",
"the",
"documents",
"from",
"the",
"response"
] | 44c98a727271c91bb9b9a70975ec4f69d99e64e7 | https://github.com/clusterpoint/php-client-api/blob/44c98a727271c91bb9b9a70975ec4f69d99e64e7/response.class.php#L289-L305 |
7,617 | clusterpoint/php-client-api | response.class.php | CPS_Response.getRawAggregate | public function getRawAggregate($returnType)
{
if ($returnType == DOC_TYPE_ARRAY) {
$res = array();
foreach ($this->_aggregate as $key => $value) {
if ($value) {
$tmp = CPS_Response::simpleXmlToArray($value);
// multiple or one result - returned data format should be the sa... | php | public function getRawAggregate($returnType)
{
if ($returnType == DOC_TYPE_ARRAY) {
$res = array();
foreach ($this->_aggregate as $key => $value) {
if ($value) {
$tmp = CPS_Response::simpleXmlToArray($value);
// multiple or one result - returned data format should be the sa... | [
"public",
"function",
"getRawAggregate",
"(",
"$",
"returnType",
")",
"{",
"if",
"(",
"$",
"returnType",
"==",
"DOC_TYPE_ARRAY",
")",
"{",
"$",
"res",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_aggregate",
"as",
"$",
"key",
"=>",... | Returns the aggregate data from the response
@return array | [
"Returns",
"the",
"aggregate",
"data",
"from",
"the",
"response"
] | 44c98a727271c91bb9b9a70975ec4f69d99e64e7 | https://github.com/clusterpoint/php-client-api/blob/44c98a727271c91bb9b9a70975ec4f69d99e64e7/response.class.php#L320-L355 |
7,618 | clusterpoint/php-client-api | response.class.php | CPS_Response.getParam | public function getParam($name)
{
//if (in_array($name, self::$_textParamNames)) {
if (in_array($name, $this->_textParamNames)) {
return $this->_textParams[$name];
} else {
throw new CPS_Exception(array(array('long_message' => 'Invalid response parameter', 'code' => ERROR_CODE_INVALID_PARAMETE... | php | public function getParam($name)
{
//if (in_array($name, self::$_textParamNames)) {
if (in_array($name, $this->_textParamNames)) {
return $this->_textParams[$name];
} else {
throw new CPS_Exception(array(array('long_message' => 'Invalid response parameter', 'code' => ERROR_CODE_INVALID_PARAMETE... | [
"public",
"function",
"getParam",
"(",
"$",
"name",
")",
"{",
"//if (in_array($name, self::$_textParamNames)) {",
"if",
"(",
"in_array",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"_textParamNames",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_textParams",
"["... | Returns a response parameter
@param $name parameter name
@return string | [
"Returns",
"a",
"response",
"parameter"
] | 44c98a727271c91bb9b9a70975ec4f69d99e64e7 | https://github.com/clusterpoint/php-client-api/blob/44c98a727271c91bb9b9a70975ec4f69d99e64e7/response.class.php#L380-L388 |
7,619 | clusterpoint/php-client-api | response.class.php | CPS_Response.simpleXmlToArrayHelper | static function simpleXmlToArrayHelper(&$res, &$key, &$value, &$children)
{
if (isset($res[$key])) {
if (is_string($res[$key]) || (is_array($res[$key]) && is_assoc($res[$key]))) {
$res[$key] = array($res[$key]);
}
$res[$key][] = CPS_Response::simpleXmlToArray($value);
} else {
... | php | static function simpleXmlToArrayHelper(&$res, &$key, &$value, &$children)
{
if (isset($res[$key])) {
if (is_string($res[$key]) || (is_array($res[$key]) && is_assoc($res[$key]))) {
$res[$key] = array($res[$key]);
}
$res[$key][] = CPS_Response::simpleXmlToArray($value);
} else {
... | [
"static",
"function",
"simpleXmlToArrayHelper",
"(",
"&",
"$",
"res",
",",
"&",
"$",
"key",
",",
"&",
"$",
"value",
",",
"&",
"$",
"children",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"res",
"[",
"$",
"key",
"]",
")",
")",
"{",
"if",
"(",
"is_st... | Helper function for conversions. Used internally. | [
"Helper",
"function",
"for",
"conversions",
".",
"Used",
"internally",
"."
] | 44c98a727271c91bb9b9a70975ec4f69d99e64e7 | https://github.com/clusterpoint/php-client-api/blob/44c98a727271c91bb9b9a70975ec4f69d99e64e7/response.class.php#L406-L417 |
7,620 | clusterpoint/php-client-api | response.class.php | CPS_Response.simpleXmlToArray | static function simpleXmlToArray(SimpleXMLElement &$source)
{
$res = array();
$children = false;
foreach ($source as $key => $value) {
CPS_Response::simpleXmlToArrayHelper($res, $key, $value, $children);
}
if ($source) {
foreach ($source->children('www.clusterpoint.com') as $key => $... | php | static function simpleXmlToArray(SimpleXMLElement &$source)
{
$res = array();
$children = false;
foreach ($source as $key => $value) {
CPS_Response::simpleXmlToArrayHelper($res, $key, $value, $children);
}
if ($source) {
foreach ($source->children('www.clusterpoint.com') as $key => $... | [
"static",
"function",
"simpleXmlToArray",
"(",
"SimpleXMLElement",
"&",
"$",
"source",
")",
"{",
"$",
"res",
"=",
"array",
"(",
")",
";",
"$",
"children",
"=",
"false",
";",
"foreach",
"(",
"$",
"source",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{... | Converts SimpleXMLElement to an array | [
"Converts",
"SimpleXMLElement",
"to",
"an",
"array"
] | 44c98a727271c91bb9b9a70975ec4f69d99e64e7 | https://github.com/clusterpoint/php-client-api/blob/44c98a727271c91bb9b9a70975ec4f69d99e64e7/response.class.php#L422-L438 |
7,621 | clusterpoint/php-client-api | response.class.php | CPS_Response.simpleXmlToStdClass | static function simpleXmlToStdClass(SimpleXMLElement &$source)
{
$res = new StdClass;
$children = false;
foreach ($source as $key => $value) {
if (isset($res->$key)) {
if (!is_array($res->$key)) {
$res->$key = array($res->$key);
}
$ref = &$res->$key;
$ref[] ... | php | static function simpleXmlToStdClass(SimpleXMLElement &$source)
{
$res = new StdClass;
$children = false;
foreach ($source as $key => $value) {
if (isset($res->$key)) {
if (!is_array($res->$key)) {
$res->$key = array($res->$key);
}
$ref = &$res->$key;
$ref[] ... | [
"static",
"function",
"simpleXmlToStdClass",
"(",
"SimpleXMLElement",
"&",
"$",
"source",
")",
"{",
"$",
"res",
"=",
"new",
"StdClass",
";",
"$",
"children",
"=",
"false",
";",
"foreach",
"(",
"$",
"source",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"... | Converts SimpleXMLElement to stdClass | [
"Converts",
"SimpleXMLElement",
"to",
"stdClass"
] | 44c98a727271c91bb9b9a70975ec4f69d99e64e7 | https://github.com/clusterpoint/php-client-api/blob/44c98a727271c91bb9b9a70975ec4f69d99e64e7/response.class.php#L443-L462 |
7,622 | watoki/collections | src/watoki/collections/Liste.php | Liste.append | public function append($element) {
$this->elements[] = $element;
$this->fire(new ListCreateEvent($element, $this->count() - 1));
return $this;
} | php | public function append($element) {
$this->elements[] = $element;
$this->fire(new ListCreateEvent($element, $this->count() - 1));
return $this;
} | [
"public",
"function",
"append",
"(",
"$",
"element",
")",
"{",
"$",
"this",
"->",
"elements",
"[",
"]",
"=",
"$",
"element",
";",
"$",
"this",
"->",
"fire",
"(",
"new",
"ListCreateEvent",
"(",
"$",
"element",
",",
"$",
"this",
"->",
"count",
"(",
"... | Adds element to end of list.
@param mixed $element
@return static | [
"Adds",
"element",
"to",
"end",
"of",
"list",
"."
] | ff9c866020c7f2daff1b9bc24fe6d64e218af157 | https://github.com/watoki/collections/blob/ff9c866020c7f2daff1b9bc24fe6d64e218af157/src/watoki/collections/Liste.php#L60-L64 |
7,623 | watoki/collections | src/watoki/collections/Liste.php | Liste.unshift | public function unshift($element) {
$this->insert($element, 0);
$this->fire(new ListCreateEvent($element, 0));
return $this;
} | php | public function unshift($element) {
$this->insert($element, 0);
$this->fire(new ListCreateEvent($element, 0));
return $this;
} | [
"public",
"function",
"unshift",
"(",
"$",
"element",
")",
"{",
"$",
"this",
"->",
"insert",
"(",
"$",
"element",
",",
"0",
")",
";",
"$",
"this",
"->",
"fire",
"(",
"new",
"ListCreateEvent",
"(",
"$",
"element",
",",
"0",
")",
")",
";",
"return",
... | Inserts the given element to the beginning of the list.
@param mixed $element
@return static | [
"Inserts",
"the",
"given",
"element",
"to",
"the",
"beginning",
"of",
"the",
"list",
"."
] | ff9c866020c7f2daff1b9bc24fe6d64e218af157 | https://github.com/watoki/collections/blob/ff9c866020c7f2daff1b9bc24fe6d64e218af157/src/watoki/collections/Liste.php#L83-L87 |
7,624 | watoki/collections | src/watoki/collections/Liste.php | Liste.remove | public function remove($index) {
$e = $this->elements[$index];
unset($this->elements[$index]);
$this->clean();
$this->fire(new ListDeleteEvent($e, $index));
return $e;
} | php | public function remove($index) {
$e = $this->elements[$index];
unset($this->elements[$index]);
$this->clean();
$this->fire(new ListDeleteEvent($e, $index));
return $e;
} | [
"public",
"function",
"remove",
"(",
"$",
"index",
")",
"{",
"$",
"e",
"=",
"$",
"this",
"->",
"elements",
"[",
"$",
"index",
"]",
";",
"unset",
"(",
"$",
"this",
"->",
"elements",
"[",
"$",
"index",
"]",
")",
";",
"$",
"this",
"->",
"clean",
"... | Removes and returns the element at given index from list.
@param int $index
@return mixed | [
"Removes",
"and",
"returns",
"the",
"element",
"at",
"given",
"index",
"from",
"list",
"."
] | ff9c866020c7f2daff1b9bc24fe6d64e218af157 | https://github.com/watoki/collections/blob/ff9c866020c7f2daff1b9bc24fe6d64e218af157/src/watoki/collections/Liste.php#L123-L129 |
7,625 | watoki/collections | src/watoki/collections/Liste.php | Liste.pop | public function pop() {
$e = array_pop($this->elements);
$this->fire(new ListDeleteEvent($e, $this->count()));
return $e;
} | php | public function pop() {
$e = array_pop($this->elements);
$this->fire(new ListDeleteEvent($e, $this->count()));
return $e;
} | [
"public",
"function",
"pop",
"(",
")",
"{",
"$",
"e",
"=",
"array_pop",
"(",
"$",
"this",
"->",
"elements",
")",
";",
"$",
"this",
"->",
"fire",
"(",
"new",
"ListDeleteEvent",
"(",
"$",
"e",
",",
"$",
"this",
"->",
"count",
"(",
")",
")",
")",
... | Removes and returns the last element of the list.
@return mixed | [
"Removes",
"and",
"returns",
"the",
"last",
"element",
"of",
"the",
"list",
"."
] | ff9c866020c7f2daff1b9bc24fe6d64e218af157 | https://github.com/watoki/collections/blob/ff9c866020c7f2daff1b9bc24fe6d64e218af157/src/watoki/collections/Liste.php#L144-L148 |
7,626 | watoki/collections | src/watoki/collections/Liste.php | Liste.shift | public function shift() {
$e = array_shift($this->elements);
$this->clean();
$this->fire(new ListDeleteEvent($e, 0));
return $e;
} | php | public function shift() {
$e = array_shift($this->elements);
$this->clean();
$this->fire(new ListDeleteEvent($e, 0));
return $e;
} | [
"public",
"function",
"shift",
"(",
")",
"{",
"$",
"e",
"=",
"array_shift",
"(",
"$",
"this",
"->",
"elements",
")",
";",
"$",
"this",
"->",
"clean",
"(",
")",
";",
"$",
"this",
"->",
"fire",
"(",
"new",
"ListDeleteEvent",
"(",
"$",
"e",
",",
"0"... | Removes and returns the first element of the list.
@return mixed | [
"Removes",
"and",
"returns",
"the",
"first",
"element",
"of",
"the",
"list",
"."
] | ff9c866020c7f2daff1b9bc24fe6d64e218af157 | https://github.com/watoki/collections/blob/ff9c866020c7f2daff1b9bc24fe6d64e218af157/src/watoki/collections/Liste.php#L155-L160 |
7,627 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/image.php | Image.forge | public static function forge($config = array(), $filename = null)
{
!is_array($config) and $config = array();
$config = array_merge(\Config::get('image', array()), $config);
$protocol = ucfirst( ! empty($config['driver']) ? $config['driver'] : 'gd');
$class = 'Image_'.$protocol;
if ($protocol == 'Driver' |... | php | public static function forge($config = array(), $filename = null)
{
!is_array($config) and $config = array();
$config = array_merge(\Config::get('image', array()), $config);
$protocol = ucfirst( ! empty($config['driver']) ? $config['driver'] : 'gd');
$class = 'Image_'.$protocol;
if ($protocol == 'Driver' |... | [
"public",
"static",
"function",
"forge",
"(",
"$",
"config",
"=",
"array",
"(",
")",
",",
"$",
"filename",
"=",
"null",
")",
"{",
"!",
"is_array",
"(",
"$",
"config",
")",
"and",
"$",
"config",
"=",
"array",
"(",
")",
";",
"$",
"config",
"=",
"ar... | Creates a new instance of the image driver
@param array $config
@return Image_Driver | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"image",
"driver"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/image.php#L57-L75 |
7,628 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/image.php | Image.config | public static function config($index = array(), $value = null)
{
if (static::$_instance === null)
{
if ($value !== null)
$index = array($index => $value);
if (is_array($index))
static::$_config = array_merge(static::$_config, $index);
static::instance();
return static::instance();
} else {
... | php | public static function config($index = array(), $value = null)
{
if (static::$_instance === null)
{
if ($value !== null)
$index = array($index => $value);
if (is_array($index))
static::$_config = array_merge(static::$_config, $index);
static::instance();
return static::instance();
} else {
... | [
"public",
"static",
"function",
"config",
"(",
"$",
"index",
"=",
"array",
"(",
")",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"static",
"::",
"$",
"_instance",
"===",
"null",
")",
"{",
"if",
"(",
"$",
"value",
"!==",
"null",
")",
"$",... | Used to set configuration options.
Sending the config options through the static reference initalizes the
instance. If you need to send a driver config through the static reference,
make sure its the first one sent! If errors arise, create a new instance using
forge().
@param array $config An array of configura... | [
"Used",
"to",
"set",
"configuration",
"options",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/image.php#L88-L101 |
7,629 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/image.php | Image.load | public static function load($filename, $return_data = false, $force_extension = false)
{
return static::instance()->load($filename, $return_data, $force_extension);
} | php | public static function load($filename, $return_data = false, $force_extension = false)
{
return static::instance()->load($filename, $return_data, $force_extension);
} | [
"public",
"static",
"function",
"load",
"(",
"$",
"filename",
",",
"$",
"return_data",
"=",
"false",
",",
"$",
"force_extension",
"=",
"false",
")",
"{",
"return",
"static",
"::",
"instance",
"(",
")",
"->",
"load",
"(",
"$",
"filename",
",",
"$",
"ret... | Loads the image and checks if its compatable.
@param string $filename The file to load
@param string $return_data Decides if it should return the images data, or just "$this".
@param mixed $force_extension Whether or not to force the image extension
@return Image_Driver | [
"Loads",
"the",
"image",
"and",
"checks",
"if",
"its",
"compatable",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/image.php#L111-L114 |
7,630 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/image.php | Image.crop | public static function crop($x1, $y1, $x2, $y2)
{
return static::instance()->crop($x1, $y1, $x2, $y2);
} | php | public static function crop($x1, $y1, $x2, $y2)
{
return static::instance()->crop($x1, $y1, $x2, $y2);
} | [
"public",
"static",
"function",
"crop",
"(",
"$",
"x1",
",",
"$",
"y1",
",",
"$",
"x2",
",",
"$",
"y2",
")",
"{",
"return",
"static",
"::",
"instance",
"(",
")",
"->",
"crop",
"(",
"$",
"x1",
",",
"$",
"y1",
",",
"$",
"x2",
",",
"$",
"y2",
... | Crops the image using coordinates or percentages.
Absolute integer or percentages accepted for all 4.
@param integer $x1 X-Coordinate based from the top-left corner.
@param integer $y1 Y-Coordinate based from the top-left corner.
@param integer $x2 X-Coordinate based from the bottom-right corner.
@param ... | [
"Crops",
"the",
"image",
"using",
"coordinates",
"or",
"percentages",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/image.php#L127-L130 |
7,631 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/image.php | Image.resize | public static function resize($width, $height, $keepar = true, $pad = false)
{
return static::instance()->resize($width, $height, $keepar, $pad);
} | php | public static function resize($width, $height, $keepar = true, $pad = false)
{
return static::instance()->resize($width, $height, $keepar, $pad);
} | [
"public",
"static",
"function",
"resize",
"(",
"$",
"width",
",",
"$",
"height",
",",
"$",
"keepar",
"=",
"true",
",",
"$",
"pad",
"=",
"false",
")",
"{",
"return",
"static",
"::",
"instance",
"(",
")",
"->",
"resize",
"(",
"$",
"width",
",",
"$",
... | Resizes the image. If the width or height is null, it will resize retaining the original aspect ratio.
@param integer $width The new width of the image.
@param integer $height The new height of the image.
@param boolean $keepar Defaults to true. If false, allows resizing without keeping AR.
@param boole... | [
"Resizes",
"the",
"image",
".",
"If",
"the",
"width",
"or",
"height",
"is",
"null",
"it",
"will",
"resize",
"retaining",
"the",
"original",
"aspect",
"ratio",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/image.php#L141-L144 |
7,632 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/image.php | Image.rounded | public static function rounded($radius, $sides = null, $antialias = null)
{
return static::instance()->rounded($radius, $sides, $antialias);
} | php | public static function rounded($radius, $sides = null, $antialias = null)
{
return static::instance()->rounded($radius, $sides, $antialias);
} | [
"public",
"static",
"function",
"rounded",
"(",
"$",
"radius",
",",
"$",
"sides",
"=",
"null",
",",
"$",
"antialias",
"=",
"null",
")",
"{",
"return",
"static",
"::",
"instance",
"(",
")",
"->",
"rounded",
"(",
"$",
"radius",
",",
"$",
"sides",
",",
... | Adds rounded corners to the image.
@param integer $radius
@param integer $sides Accepts any combination of "tl tr bl br" seperated by spaces, or null for all sides
@param integer $antialias Sets the antialias range.
@return Image_Driver | [
"Adds",
"rounded",
"corners",
"to",
"the",
"image",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/image.php#L225-L228 |
7,633 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/image.php | Image.save_pa | public static function save_pa($prepend, $append = null, $permissions = null)
{
return static::instance()->save_pa($prepend, $append, $permissions);
} | php | public static function save_pa($prepend, $append = null, $permissions = null)
{
return static::instance()->save_pa($prepend, $append, $permissions);
} | [
"public",
"static",
"function",
"save_pa",
"(",
"$",
"prepend",
",",
"$",
"append",
"=",
"null",
",",
"$",
"permissions",
"=",
"null",
")",
"{",
"return",
"static",
"::",
"instance",
"(",
")",
"->",
"save_pa",
"(",
"$",
"prepend",
",",
"$",
"append",
... | Saves the image, and optionally attempts to set permissions
@param string $prepend The text to add to the beginning of the filename.
@param string $append The text to add to the end of the filename.
@param string $permissions Allows unix style permissions
@return Image_Driver | [
"Saves",
"the",
"image",
"and",
"optionally",
"attempts",
"to",
"set",
"permissions"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/image.php#L260-L263 |
7,634 | znframework/package-image | GDFilter.php | GDFilter.apply | public static function apply($file, $filters)
{
if( ! empty($filters) )
{
$gd = self::getSingletonGDClass();
$gd->canvas($file);
foreach( $filters as $filter )
{
$method = $filter[0];
$parameters = $fi... | php | public static function apply($file, $filters)
{
if( ! empty($filters) )
{
$gd = self::getSingletonGDClass();
$gd->canvas($file);
foreach( $filters as $filter )
{
$method = $filter[0];
$parameters = $fi... | [
"public",
"static",
"function",
"apply",
"(",
"$",
"file",
",",
"$",
"filters",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"filters",
")",
")",
"{",
"$",
"gd",
"=",
"self",
"::",
"getSingletonGDClass",
"(",
")",
";",
"$",
"gd",
"->",
"canvas",
... | Applies the used filters belonging to the GD class.
@param string $file
@param array $filters | [
"Applies",
"the",
"used",
"filters",
"belonging",
"to",
"the",
"GD",
"class",
"."
] | a4eee7468e2c8b9334b121bd358ab8acbccf11a2 | https://github.com/znframework/package-image/blob/a4eee7468e2c8b9334b121bd358ab8acbccf11a2/GDFilter.php#L22-L40 |
7,635 | mindteam/phpci-symfony2-plugin | SymfonyCommands.php | SymfonyCommands.execute | public function execute()
{
$success = true;
foreach ($this->commandList as $command) {
if (!$this->runSingleCommand($command)) {
$success = false;
break;
}
}
return $success;
} | php | public function execute()
{
$success = true;
foreach ($this->commandList as $command) {
if (!$this->runSingleCommand($command)) {
$success = false;
break;
}
}
return $success;
} | [
"public",
"function",
"execute",
"(",
")",
"{",
"$",
"success",
"=",
"true",
";",
"foreach",
"(",
"$",
"this",
"->",
"commandList",
"as",
"$",
"command",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"runSingleCommand",
"(",
"$",
"command",
")",
")",
... | Executes Symfony2 commands
@return boolean plugin work status | [
"Executes",
"Symfony2",
"commands"
] | cf469c3b845aa92ab7897e9c1ff2e64380bcc7b3 | https://github.com/mindteam/phpci-symfony2-plugin/blob/cf469c3b845aa92ab7897e9c1ff2e64380bcc7b3/SymfonyCommands.php#L53-L63 |
7,636 | mindteam/phpci-symfony2-plugin | SymfonyCommands.php | SymfonyCommands.runSingleCommand | public function runSingleCommand($command)
{
$cmd = 'php ' . $this->directory . 'app/console ';
return $this->phpci->executeCommand($cmd . $command, $this->directory);
} | php | public function runSingleCommand($command)
{
$cmd = 'php ' . $this->directory . 'app/console ';
return $this->phpci->executeCommand($cmd . $command, $this->directory);
} | [
"public",
"function",
"runSingleCommand",
"(",
"$",
"command",
")",
"{",
"$",
"cmd",
"=",
"'php '",
".",
"$",
"this",
"->",
"directory",
".",
"'app/console '",
";",
"return",
"$",
"this",
"->",
"phpci",
"->",
"executeCommand",
"(",
"$",
"cmd",
".",
"$",
... | Run one command
@param string $command command for cymfony
@return boolean | [
"Run",
"one",
"command"
] | cf469c3b845aa92ab7897e9c1ff2e64380bcc7b3 | https://github.com/mindteam/phpci-symfony2-plugin/blob/cf469c3b845aa92ab7897e9c1ff2e64380bcc7b3/SymfonyCommands.php#L72-L77 |
7,637 | JaredClemence/binn | src/builders/DecimalBuilder.php | DecimalBuilder.extractMantissa | public function extractMantissa($data) {
$signAndExponent = $this->extractSignAndExponentFromData($data);
$mask = ~$signAndExponent;
$mantissa = $data & $mask;
return $mantissa;
} | php | public function extractMantissa($data) {
$signAndExponent = $this->extractSignAndExponentFromData($data);
$mask = ~$signAndExponent;
$mantissa = $data & $mask;
return $mantissa;
} | [
"public",
"function",
"extractMantissa",
"(",
"$",
"data",
")",
"{",
"$",
"signAndExponent",
"=",
"$",
"this",
"->",
"extractSignAndExponentFromData",
"(",
"$",
"data",
")",
";",
"$",
"mask",
"=",
"~",
"$",
"signAndExponent",
";",
"$",
"mantissa",
"=",
"$"... | Public for unit test | [
"Public",
"for",
"unit",
"test"
] | 838591e7a92c0f257c09a1df141d80737a20f7d9 | https://github.com/JaredClemence/binn/blob/838591e7a92c0f257c09a1df141d80737a20f7d9/src/builders/DecimalBuilder.php#L129-L134 |
7,638 | JaredClemence/binn | src/builders/DecimalBuilder.php | DecimalBuilder.makeFrontSideMask | public function makeFrontSideMask($maskLength, $byteLength) {
$maskValue = 0;
$bitLength = $byteLength * 8;
$maskString = "";
$valueStore = 0;
for ($i = 0; $i < $bitLength; $i++) {
$maskValue <<= 1;
if ($i < $maskLength) {
$maskValue += 1;
... | php | public function makeFrontSideMask($maskLength, $byteLength) {
$maskValue = 0;
$bitLength = $byteLength * 8;
$maskString = "";
$valueStore = 0;
for ($i = 0; $i < $bitLength; $i++) {
$maskValue <<= 1;
if ($i < $maskLength) {
$maskValue += 1;
... | [
"public",
"function",
"makeFrontSideMask",
"(",
"$",
"maskLength",
",",
"$",
"byteLength",
")",
"{",
"$",
"maskValue",
"=",
"0",
";",
"$",
"bitLength",
"=",
"$",
"byteLength",
"*",
"8",
";",
"$",
"maskString",
"=",
"\"\"",
";",
"$",
"valueStore",
"=",
... | This function makes a mask that has one's in the highest bit-values, and 0's in the lower bit-values.
For example, when passed the parameters (3,1) it produces a binary string 0b11100000;
Public function for testing.
@param int $maskLength
@param int $bitLength
@return string | [
"This",
"function",
"makes",
"a",
"mask",
"that",
"has",
"one",
"s",
"in",
"the",
"highest",
"bit",
"-",
"values",
"and",
"0",
"s",
"in",
"the",
"lower",
"bit",
"-",
"values",
"."
] | 838591e7a92c0f257c09a1df141d80737a20f7d9 | https://github.com/JaredClemence/binn/blob/838591e7a92c0f257c09a1df141d80737a20f7d9/src/builders/DecimalBuilder.php#L165-L185 |
7,639 | JaredClemence/binn | src/builders/DecimalBuilder.php | DecimalBuilder.convertBinaryFractionToDecimalFraction | public function convertBinaryFractionToDecimalFraction($mantissaByteString, $integerExponent) {
$bits = $this->mantissaBitLength;
$value = pow(2, $integerExponent);
for ($i = 0; $i < $bits; $i++) {
$curExponent = $integerExponent - 1 - $i;
$bitPosition = $bits - $i - 1;
... | php | public function convertBinaryFractionToDecimalFraction($mantissaByteString, $integerExponent) {
$bits = $this->mantissaBitLength;
$value = pow(2, $integerExponent);
for ($i = 0; $i < $bits; $i++) {
$curExponent = $integerExponent - 1 - $i;
$bitPosition = $bits - $i - 1;
... | [
"public",
"function",
"convertBinaryFractionToDecimalFraction",
"(",
"$",
"mantissaByteString",
",",
"$",
"integerExponent",
")",
"{",
"$",
"bits",
"=",
"$",
"this",
"->",
"mantissaBitLength",
";",
"$",
"value",
"=",
"pow",
"(",
"2",
",",
"$",
"integerExponent",... | Pubic for unit testing only.
@param type $mantissaByteString
@param type $integerExponent | [
"Pubic",
"for",
"unit",
"testing",
"only",
"."
] | 838591e7a92c0f257c09a1df141d80737a20f7d9 | https://github.com/JaredClemence/binn/blob/838591e7a92c0f257c09a1df141d80737a20f7d9/src/builders/DecimalBuilder.php#L200-L211 |
7,640 | JaredClemence/binn | src/builders/DecimalBuilder.php | DecimalBuilder.readBit | public function readBit($byteString, $bitPosition) {
$byteNumber = $this->findByteNumberForBitPosition($bitPosition);
$bitPositionInByte = $bitPosition % 8;
$pos = strlen($byteString) - 1 - $byteNumber;
$targetByte = $byteString[$pos];
$mask = chr(1 << $bitPositionInByte);
... | php | public function readBit($byteString, $bitPosition) {
$byteNumber = $this->findByteNumberForBitPosition($bitPosition);
$bitPositionInByte = $bitPosition % 8;
$pos = strlen($byteString) - 1 - $byteNumber;
$targetByte = $byteString[$pos];
$mask = chr(1 << $bitPositionInByte);
... | [
"public",
"function",
"readBit",
"(",
"$",
"byteString",
",",
"$",
"bitPosition",
")",
"{",
"$",
"byteNumber",
"=",
"$",
"this",
"->",
"findByteNumberForBitPosition",
"(",
"$",
"bitPosition",
")",
";",
"$",
"bitPositionInByte",
"=",
"$",
"bitPosition",
"%",
... | Public for testing
@param type $byteString
@param type $bitPosition
@return type | [
"Public",
"for",
"testing"
] | 838591e7a92c0f257c09a1df141d80737a20f7d9 | https://github.com/JaredClemence/binn/blob/838591e7a92c0f257c09a1df141d80737a20f7d9/src/builders/DecimalBuilder.php#L219-L231 |
7,641 | jakecleary/ultrapress-library | src/Ultra/Helpers/Data.php | Data.spaceToCamelCase | public static function spaceToCamelCase($string, $type = '_', $first_char_caps = false)
{
if($first_char_caps === true)
{
$string[0] = strtoupper($string[0]);
}
$func = create_function('$c', 'return strtoupper($c[1]);');
return preg_replace_callback('/' . $type ... | php | public static function spaceToCamelCase($string, $type = '_', $first_char_caps = false)
{
if($first_char_caps === true)
{
$string[0] = strtoupper($string[0]);
}
$func = create_function('$c', 'return strtoupper($c[1]);');
return preg_replace_callback('/' . $type ... | [
"public",
"static",
"function",
"spaceToCamelCase",
"(",
"$",
"string",
",",
"$",
"type",
"=",
"'_'",
",",
"$",
"first_char_caps",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"first_char_caps",
"===",
"true",
")",
"{",
"$",
"string",
"[",
"0",
"]",
"=",
... | Convert strings with an arbitrary deliminator into CamelCase.
@param string $string The string to convert
@param string $type The deliminator to replace
@param bool $first_char_caps camelCase or CamelCase
@return string The converted string | [
"Convert",
"strings",
"with",
"an",
"arbitrary",
"deliminator",
"into",
"CamelCase",
"."
] | 84ca5d1dae8eb16de8c886787575ea41f9332ae2 | https://github.com/jakecleary/ultrapress-library/blob/84ca5d1dae8eb16de8c886787575ea41f9332ae2/src/Ultra/Helpers/Data.php#L35-L45 |
7,642 | dendevs/plpadaptability | src/NoKernel.php | NoKernel.get_config_value | public function get_config_value( $config_name, $default_value = false )
{
$value = false;
if( array_key_exists( $config_name, $this->_config ) )
{
$value = $this->_config[$config_name];
}
else if( ! $default_value )
{
$value = $default_value;
... | php | public function get_config_value( $config_name, $default_value = false )
{
$value = false;
if( array_key_exists( $config_name, $this->_config ) )
{
$value = $this->_config[$config_name];
}
else if( ! $default_value )
{
$value = $default_value;
... | [
"public",
"function",
"get_config_value",
"(",
"$",
"config_name",
",",
"$",
"default_value",
"=",
"false",
")",
"{",
"$",
"value",
"=",
"false",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"config_name",
",",
"$",
"this",
"->",
"_config",
")",
")",
"{... | Recupere la valeur de l'option demander.
Donne une valeur par default si non trouver et argument 2 exists
@param string $config_name nom de l'option de Configuration a retrouver service.option_name.sous_option
@param string $default_value false par defaut.
@return false|mixed la valeur de l'option | [
"Recupere",
"la",
"valeur",
"de",
"l",
"option",
"demander",
"."
] | 9e1af2912c5b6ee7e409af487279d529e56ecbe1 | https://github.com/dendevs/plpadaptability/blob/9e1af2912c5b6ee7e409af487279d529e56ecbe1/src/NoKernel.php#L48-L61 |
7,643 | dendevs/plpadaptability | src/NoKernel.php | NoKernel.log | public function log( $service_name, $log_name, $level, $message, $context = array() )
{
$ok = false;
$tmp_log_path = $this->get_config_value( 'log_path' );
$log_path = ( $this->get_config_value( 'log_path' ) ) ? $this->get_config_value( 'log_path' ) . '/' . $service_name . '/' : sys_get_tem... | php | public function log( $service_name, $log_name, $level, $message, $context = array() )
{
$ok = false;
$tmp_log_path = $this->get_config_value( 'log_path' );
$log_path = ( $this->get_config_value( 'log_path' ) ) ? $this->get_config_value( 'log_path' ) . '/' . $service_name . '/' : sys_get_tem... | [
"public",
"function",
"log",
"(",
"$",
"service_name",
",",
"$",
"log_name",
",",
"$",
"level",
",",
"$",
"message",
",",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"$",
"ok",
"=",
"false",
";",
"$",
"tmp_log_path",
"=",
"$",
"this",
"->",
... | Ecriture de log basique.
Le logs est ecrit dans /tmp par defaut.
Si la config log_path existe alors l'ecriture ce fait dans ce repertoire nom_plugin.
@param string $log_name nom fichier ( sans ext )
@param string $level niveau du message ( info, debug, ... )
@param string $message message a logger
@param array $conte... | [
"Ecriture",
"de",
"log",
"basique",
"."
] | 9e1af2912c5b6ee7e409af487279d529e56ecbe1 | https://github.com/dendevs/plpadaptability/blob/9e1af2912c5b6ee7e409af487279d529e56ecbe1/src/NoKernel.php#L90-L118 |
7,644 | bashilbers/domain | src/Eventing/When/ConventionBasedWhen.php | ConventionBasedWhen.when | protected function when(DomainEvent $event)
{
$method = 'when' . ClassToString::short($event);
if (is_callable([$this, $method])) {
$this->{$method}($event);
}
} | php | protected function when(DomainEvent $event)
{
$method = 'when' . ClassToString::short($event);
if (is_callable([$this, $method])) {
$this->{$method}($event);
}
} | [
"protected",
"function",
"when",
"(",
"DomainEvent",
"$",
"event",
")",
"{",
"$",
"method",
"=",
"'when'",
".",
"ClassToString",
"::",
"short",
"(",
"$",
"event",
")",
";",
"if",
"(",
"is_callable",
"(",
"[",
"$",
"this",
",",
"$",
"method",
"]",
")"... | Handle a single domain event
@param DomainEvent $event
@return void | [
"Handle",
"a",
"single",
"domain",
"event"
] | 864736b8c409077706554b6ac4c574832678d316 | https://github.com/bashilbers/domain/blob/864736b8c409077706554b6ac4c574832678d316/src/Eventing/When/ConventionBasedWhen.php#L20-L26 |
7,645 | Dhii/di-abstract | src/ServiceCacheAwareTrait.php | ServiceCacheAwareTrait._setServiceCache | protected function _setServiceCache($serviceCache)
{
if ($serviceCache !== null && !($serviceCache instanceof ContainerInterface)) {
throw $this->_createInvalidArgumentException($this->__('Invalid cache'), null, null, $serviceCache);
}
$this->serviceCache = $serviceCache;
} | php | protected function _setServiceCache($serviceCache)
{
if ($serviceCache !== null && !($serviceCache instanceof ContainerInterface)) {
throw $this->_createInvalidArgumentException($this->__('Invalid cache'), null, null, $serviceCache);
}
$this->serviceCache = $serviceCache;
} | [
"protected",
"function",
"_setServiceCache",
"(",
"$",
"serviceCache",
")",
"{",
"if",
"(",
"$",
"serviceCache",
"!==",
"null",
"&&",
"!",
"(",
"$",
"serviceCache",
"instanceof",
"ContainerInterface",
")",
")",
"{",
"throw",
"$",
"this",
"->",
"_createInvalidA... | Assigns a service cache to this instance.
@since [*next-version*]
@param ContainerInterface|null $serviceCache The service cache. | [
"Assigns",
"a",
"service",
"cache",
"to",
"this",
"instance",
"."
] | badfa20def27e5c6883f1c1078c98603b7bee319 | https://github.com/Dhii/di-abstract/blob/badfa20def27e5c6883f1c1078c98603b7bee319/src/ServiceCacheAwareTrait.php#L45-L52 |
7,646 | Palmabit-IT/authenticator | src/Palmabit/Authentication/Classes/SentryAuthenticator.php | SentryAuthenticator.hasGroup | public function hasGroup($name) {
$group = App::make('group_repository')->findByName($name);
$user = $this->getLoggedUser();
if (!$user) {
return false;
}
return $user->inGroup($group);
} | php | public function hasGroup($name) {
$group = App::make('group_repository')->findByName($name);
$user = $this->getLoggedUser();
if (!$user) {
return false;
}
return $user->inGroup($group);
} | [
"public",
"function",
"hasGroup",
"(",
"$",
"name",
")",
"{",
"$",
"group",
"=",
"App",
"::",
"make",
"(",
"'group_repository'",
")",
"->",
"findByName",
"(",
"$",
"name",
")",
";",
"$",
"user",
"=",
"$",
"this",
"->",
"getLoggedUser",
"(",
")",
";",... | Check if the current user has the given group
@param $name
@return mixed | [
"Check",
"if",
"the",
"current",
"user",
"has",
"the",
"given",
"group"
] | 986cfc7e666e0e1b0312e518d586ec61b08cdb42 | https://github.com/Palmabit-IT/authenticator/blob/986cfc7e666e0e1b0312e518d586ec61b08cdb42/src/Palmabit/Authentication/Classes/SentryAuthenticator.php#L129-L137 |
7,647 | devbr/tools | Cli/Key.php | Key.createKeys | private function createKeys()
{
//Create Can Keys
shuffle(Devbr\Can::$base);
shuffle(Devbr\Can::$extra_base);
file_put_contents($this->configKeyPath.'can.key', implode(Devbr\Can::$base)."\n".implode(Devbr\Can::$extra_base));
$SSLcnf = [];
$dn = [];
//get con... | php | private function createKeys()
{
//Create Can Keys
shuffle(Devbr\Can::$base);
shuffle(Devbr\Can::$extra_base);
file_put_contents($this->configKeyPath.'can.key', implode(Devbr\Can::$base)."\n".implode(Devbr\Can::$extra_base));
$SSLcnf = [];
$dn = [];
//get con... | [
"private",
"function",
"createKeys",
"(",
")",
"{",
"//Create Can Keys",
"shuffle",
"(",
"Devbr",
"\\",
"Can",
"::",
"$",
"base",
")",
";",
"shuffle",
"(",
"Devbr",
"\\",
"Can",
"::",
"$",
"extra_base",
")",
";",
"file_put_contents",
"(",
"$",
"this",
"-... | Create Can anda SSL keys
@return void none | [
"Create",
"Can",
"anda",
"SSL",
"keys"
] | f23f35172143b4ab2f45db37274fcc94d32e20e8 | https://github.com/devbr/tools/blob/f23f35172143b4ab2f45db37274fcc94d32e20e8/Cli/Key.php#L132-L167 |
7,648 | bishopb/vanilla | library/core/class.request.php | Gdn_Request.Export | public function Export($Export) {
switch ($Export) {
case 'Environment': return $this->_Environment;
case 'Arguments': return $this->_RequestArguments;
case 'Parsed': return $this->_ParsedRequest;
default: return NULL;
}
} | php | public function Export($Export) {
switch ($Export) {
case 'Environment': return $this->_Environment;
case 'Arguments': return $this->_RequestArguments;
case 'Parsed': return $this->_ParsedRequest;
default: return NULL;
}
} | [
"public",
"function",
"Export",
"(",
"$",
"Export",
")",
"{",
"switch",
"(",
"$",
"Export",
")",
"{",
"case",
"'Environment'",
":",
"return",
"$",
"this",
"->",
"_Environment",
";",
"case",
"'Arguments'",
":",
"return",
"$",
"this",
"->",
"_RequestArgument... | This method allows requests to export their internal data.
Mostly used in conjunction with FromImport()
@param $Export Data group to export
@return mixed | [
"This",
"method",
"allows",
"requests",
"to",
"export",
"their",
"internal",
"data",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.request.php#L144-L151 |
7,649 | bishopb/vanilla | library/core/class.request.php | Gdn_Request.FromEnvironment | public function FromEnvironment() {
$this->WithURI()
->WithArgs(self::INPUT_GET, self::INPUT_POST, self::INPUT_SERVER, self::INPUT_FILES, self::INPUT_COOKIES);
return $this;
} | php | public function FromEnvironment() {
$this->WithURI()
->WithArgs(self::INPUT_GET, self::INPUT_POST, self::INPUT_SERVER, self::INPUT_FILES, self::INPUT_COOKIES);
return $this;
} | [
"public",
"function",
"FromEnvironment",
"(",
")",
"{",
"$",
"this",
"->",
"WithURI",
"(",
")",
"->",
"WithArgs",
"(",
"self",
"::",
"INPUT_GET",
",",
"self",
"::",
"INPUT_POST",
",",
"self",
"::",
"INPUT_SERVER",
",",
"self",
"::",
"INPUT_FILES",
",",
"... | Chainable lazy Environment Bootstrap
Convenience method allowing quick setup of the default request state... from the current environment.
@flow chain
@return Gdn_Request | [
"Chainable",
"lazy",
"Environment",
"Bootstrap"
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.request.php#L174-L179 |
7,650 | bishopb/vanilla | library/core/class.request.php | Gdn_Request.FromImport | public function FromImport($NewRequest) {
// Import Environment
$this->_Environment = $NewRequest->Export('Environment');
// Import Arguments
$this->_RequestArguments = $NewRequest->Export('Arguments');
$this->_HaveParsedRequest = FALSE;
$this->_Parsing = FALSE;
return $... | php | public function FromImport($NewRequest) {
// Import Environment
$this->_Environment = $NewRequest->Export('Environment');
// Import Arguments
$this->_RequestArguments = $NewRequest->Export('Arguments');
$this->_HaveParsedRequest = FALSE;
$this->_Parsing = FALSE;
return $... | [
"public",
"function",
"FromImport",
"(",
"$",
"NewRequest",
")",
"{",
"// Import Environment",
"$",
"this",
"->",
"_Environment",
"=",
"$",
"NewRequest",
"->",
"Export",
"(",
"'Environment'",
")",
";",
"// Import Arguments",
"$",
"this",
"->",
"_RequestArguments",... | Chainable Request Importer
This method allows one method to import the raw information of another request
@param $NewRequest New Request from which to import environment and arguments.
@flow chain
@return Gdn_Request | [
"Chainable",
"Request",
"Importer"
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.request.php#L190-L199 |
7,651 | bishopb/vanilla | library/core/class.request.php | Gdn_Request.Get | public function Get($Key = NULL, $Default = NULL) {
if ($Key === NULL)
return $this->GetRequestArguments (self::INPUT_GET);
else
return $this->GetValueFrom(self::INPUT_GET, $Key, $Default);
} | php | public function Get($Key = NULL, $Default = NULL) {
if ($Key === NULL)
return $this->GetRequestArguments (self::INPUT_GET);
else
return $this->GetValueFrom(self::INPUT_GET, $Key, $Default);
} | [
"public",
"function",
"Get",
"(",
"$",
"Key",
"=",
"NULL",
",",
"$",
"Default",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"Key",
"===",
"NULL",
")",
"return",
"$",
"this",
"->",
"GetRequestArguments",
"(",
"self",
"::",
"INPUT_GET",
")",
";",
"else",
... | Get a value from the GET array or return the entire GET array.
@param string|null $Key The key of the get item or null to return the entire get array.
@param mixed $Default The value to return if the item isn't set.
@return mixed | [
"Get",
"a",
"value",
"from",
"the",
"GET",
"array",
"or",
"return",
"the",
"entire",
"GET",
"array",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.request.php#L208-L213 |
7,652 | bishopb/vanilla | library/core/class.request.php | Gdn_Request.HostAndPort | public function HostAndPort() {
$Host = $this->Host();
$Port = $this->Port();
if (!in_array($Port, array(80, 443)))
return $Host.':'.$Port;
else
return $Host;
} | php | public function HostAndPort() {
$Host = $this->Host();
$Port = $this->Port();
if (!in_array($Port, array(80, 443)))
return $Host.':'.$Port;
else
return $Host;
} | [
"public",
"function",
"HostAndPort",
"(",
")",
"{",
"$",
"Host",
"=",
"$",
"this",
"->",
"Host",
"(",
")",
";",
"$",
"Port",
"=",
"$",
"this",
"->",
"Port",
"(",
")",
";",
"if",
"(",
"!",
"in_array",
"(",
"$",
"Port",
",",
"array",
"(",
"80",
... | Return the host and port together if the port isn't standard.
@return string
@since 2.1 | [
"Return",
"the",
"host",
"and",
"port",
"together",
"if",
"the",
"port",
"isn",
"t",
"standard",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.request.php#L280-L287 |
7,653 | bishopb/vanilla | library/core/class.request.php | Gdn_Request._ParseRequest | protected function _ParseRequest() {
$this->_Parsing = TRUE;
/**
* Resolve final request to send to dispatcher
*/
$Path = $this->_EnvironmentElement('URI');
// Get the dispatch string from the URI
if($Path !== FALSE) {
$this->Path(trim($Path, '/'));
... | php | protected function _ParseRequest() {
$this->_Parsing = TRUE;
/**
* Resolve final request to send to dispatcher
*/
$Path = $this->_EnvironmentElement('URI');
// Get the dispatch string from the URI
if($Path !== FALSE) {
$this->Path(trim($Path, '/'));
... | [
"protected",
"function",
"_ParseRequest",
"(",
")",
"{",
"$",
"this",
"->",
"_Parsing",
"=",
"TRUE",
";",
"/**\n * Resolve final request to send to dispatcher\n */",
"$",
"Path",
"=",
"$",
"this",
"->",
"_EnvironmentElement",
"(",
"'URI'",
")",
";",
"// ... | Parse the Environment data into the ParsedRequest array.
This method analyzes the Request environment and produces the ParsedRequest array which
contains the Path and OutputFormat keys. These are used by the Dispatcher to decide which
controller and method to invoke.
@return void | [
"Parse",
"the",
"Environment",
"data",
"into",
"the",
"ParsedRequest",
"array",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.request.php#L487-L562 |
7,654 | bishopb/vanilla | library/core/class.request.php | Gdn_Request.Post | public function Post($Key = NULL, $Default = NULL) {
if ($Key === NULL)
return $this->GetRequestArguments (self::INPUT_POST);
else
return $this->GetValueFrom(self::INPUT_POST, $Key, $Default);
} | php | public function Post($Key = NULL, $Default = NULL) {
if ($Key === NULL)
return $this->GetRequestArguments (self::INPUT_POST);
else
return $this->GetValueFrom(self::INPUT_POST, $Key, $Default);
} | [
"public",
"function",
"Post",
"(",
"$",
"Key",
"=",
"NULL",
",",
"$",
"Default",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"Key",
"===",
"NULL",
")",
"return",
"$",
"this",
"->",
"GetRequestArguments",
"(",
"self",
"::",
"INPUT_POST",
")",
";",
"else",
... | Get a value from the post array or return the entire POST array.
@param string|null $Key The key of the post item or null to return the entire array.
@param mixed $Default The value to return if the item isn't set.
@return mixed | [
"Get",
"a",
"value",
"from",
"the",
"post",
"array",
"or",
"return",
"the",
"entire",
"POST",
"array",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.request.php#L667-L672 |
7,655 | bishopb/vanilla | library/core/class.request.php | Gdn_Request.Merged | public function Merged($Key = NULL, $Default = NULL) {
$Merged = array();
$QueryOrder = array(
self::INPUT_CUSTOM,
self::INPUT_GET,
self::INPUT_POST,
self::INPUT_FILES,
self::INPUT_SERVER,
self::INPUT_ENV,
self::INPUT_COOKIES
);
$Num... | php | public function Merged($Key = NULL, $Default = NULL) {
$Merged = array();
$QueryOrder = array(
self::INPUT_CUSTOM,
self::INPUT_GET,
self::INPUT_POST,
self::INPUT_FILES,
self::INPUT_SERVER,
self::INPUT_ENV,
self::INPUT_COOKIES
);
$Num... | [
"public",
"function",
"Merged",
"(",
"$",
"Key",
"=",
"NULL",
",",
"$",
"Default",
"=",
"NULL",
")",
"{",
"$",
"Merged",
"=",
"array",
"(",
")",
";",
"$",
"QueryOrder",
"=",
"array",
"(",
"self",
"::",
"INPUT_CUSTOM",
",",
"self",
"::",
"INPUT_GET",
... | Get a value from the merged param array or return the entire merged array
@param string|null $Key The key of the post item or null to return the entire array.
@param mixed $Default The value to return if the item isn't set.
@return mixed | [
"Get",
"a",
"value",
"from",
"the",
"merged",
"param",
"array",
"or",
"return",
"the",
"entire",
"merged",
"array"
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.request.php#L694-L713 |
7,656 | bishopb/vanilla | library/core/class.request.php | Gdn_Request._SetRequestArguments | protected function _SetRequestArguments($ParamsType, $ParamsData = NULL) {
switch ($ParamsType) {
case self::INPUT_GET:
$ArgumentData = $_GET;
break;
case self::INPUT_POST:
$ArgumentData = $_POST;
break;
case self... | php | protected function _SetRequestArguments($ParamsType, $ParamsData = NULL) {
switch ($ParamsType) {
case self::INPUT_GET:
$ArgumentData = $_GET;
break;
case self::INPUT_POST:
$ArgumentData = $_POST;
break;
case self... | [
"protected",
"function",
"_SetRequestArguments",
"(",
"$",
"ParamsType",
",",
"$",
"ParamsData",
"=",
"NULL",
")",
"{",
"switch",
"(",
"$",
"ParamsType",
")",
"{",
"case",
"self",
"::",
"INPUT_GET",
":",
"$",
"ArgumentData",
"=",
"$",
"_GET",
";",
"break",... | Attach an array of request arguments to the request.
@param int $ParamsType type of data to import. One of the self::INPUT_* constants
@param array $ParamsData optional data array to import if ParamsType is INPUT_CUSTOM
@return void | [
"Attach",
"an",
"array",
"of",
"request",
"arguments",
"to",
"the",
"request",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.request.php#L722-L754 |
7,657 | bishopb/vanilla | library/core/class.request.php | Gdn_Request.WithArgs | public function WithArgs() {
$ArgAliasList = func_get_args();
if (count($ArgAliasList))
foreach ($ArgAliasList as $ArgAlias) {
$this->_SetRequestArguments(strtolower($ArgAlias));
}
return $this;
} | php | public function WithArgs() {
$ArgAliasList = func_get_args();
if (count($ArgAliasList))
foreach ($ArgAliasList as $ArgAlias) {
$this->_SetRequestArguments(strtolower($ArgAlias));
}
return $this;
} | [
"public",
"function",
"WithArgs",
"(",
")",
"{",
"$",
"ArgAliasList",
"=",
"func_get_args",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"ArgAliasList",
")",
")",
"foreach",
"(",
"$",
"ArgAliasList",
"as",
"$",
"ArgAlias",
")",
"{",
"$",
"this",
"->",
... | Chainable Superglobal arguments setter
This method expects a variable number of parameters, each of which need to be a defined INPUT_*
constant, and will interpret these as superglobal references. These constants each refer to a
specific PHP superglobal and including them here causes their data to be imported into the... | [
"Chainable",
"Superglobal",
"arguments",
"setter"
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.request.php#L922-L930 |
7,658 | bishopb/vanilla | library/core/class.request.php | Gdn_Request.WithControllerMethod | public function WithControllerMethod($Controller, $Method = NULL, $Args = array()) {
if (is_a($Controller, 'Gdn_Controller')) {
// Convert object to string
$Matches = array();
preg_match('/^(.*)Controller$/',get_class($Controller),$Matches);
$Controller = $Matches[1];
}
... | php | public function WithControllerMethod($Controller, $Method = NULL, $Args = array()) {
if (is_a($Controller, 'Gdn_Controller')) {
// Convert object to string
$Matches = array();
preg_match('/^(.*)Controller$/',get_class($Controller),$Matches);
$Controller = $Matches[1];
}
... | [
"public",
"function",
"WithControllerMethod",
"(",
"$",
"Controller",
",",
"$",
"Method",
"=",
"NULL",
",",
"$",
"Args",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_a",
"(",
"$",
"Controller",
",",
"'Gdn_Controller'",
")",
")",
"{",
"// Convert obje... | Chainable URI Setter, source is a controller + method + args list
@param $Controller Gdn_Controller Object or string controller name.
@param $Method Optional name of the method to call. Omit or NULL for default (Index).
@param $Args Optional argument list to forward to the method. Omit for none.
@flow chain
@return Gd... | [
"Chainable",
"URI",
"Setter",
"source",
"is",
"a",
"controller",
"+",
"method",
"+",
"args",
"list"
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.request.php#L957-L969 |
7,659 | mickrip/fwoot-core | src/Fw/Config.php | Config.load | static function load($filename)
{
if (isset(self::$stack[$filename])) return self::$stack[$filename];
$path = self::get("apppath") . "config" . DS . $filename;
if (!file_exists($path)) throw new \Exception("Config file '$filename' not found'");
$config_data = include($path);
self::set($filename, $config_data... | php | static function load($filename)
{
if (isset(self::$stack[$filename])) return self::$stack[$filename];
$path = self::get("apppath") . "config" . DS . $filename;
if (!file_exists($path)) throw new \Exception("Config file '$filename' not found'");
$config_data = include($path);
self::set($filename, $config_data... | [
"static",
"function",
"load",
"(",
"$",
"filename",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"stack",
"[",
"$",
"filename",
"]",
")",
")",
"return",
"self",
"::",
"$",
"stack",
"[",
"$",
"filename",
"]",
";",
"$",
"path",
"=",
"self"... | Loads a php file which returns an array of config data
@param $filename
@return mixed | [
"Loads",
"a",
"php",
"file",
"which",
"returns",
"an",
"array",
"of",
"config",
"data"
] | 10fae2ee4b2c85454bc91067f0f9adeef64fdd4d | https://github.com/mickrip/fwoot-core/blob/10fae2ee4b2c85454bc91067f0f9adeef64fdd4d/src/Fw/Config.php#L29-L37 |
7,660 | mszewcz/php-light-framework | src/Html/Form/FormStatus.php | FormStatus.generate | public function generate(): string
{
$status = Tags::NBSP;
if ($this->statusData['status-type'] !== '' && $this->statusData['status-text'] !== '') {
$status = [
Tags::div(
$this->getConstant($this->statusData['status-text']),
['clas... | php | public function generate(): string
{
$status = Tags::NBSP;
if ($this->statusData['status-type'] !== '' && $this->statusData['status-text'] !== '') {
$status = [
Tags::div(
$this->getConstant($this->statusData['status-text']),
['clas... | [
"public",
"function",
"generate",
"(",
")",
":",
"string",
"{",
"$",
"status",
"=",
"Tags",
"::",
"NBSP",
";",
"if",
"(",
"$",
"this",
"->",
"statusData",
"[",
"'status-type'",
"]",
"!==",
"''",
"&&",
"$",
"this",
"->",
"statusData",
"[",
"'status-text... | Generates FormStatus and returns it
@return string | [
"Generates",
"FormStatus",
"and",
"returns",
"it"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Html/Form/FormStatus.php#L50-L62 |
7,661 | popy-dev/popy-calendar | src/Parser/ResultMapper/StandardDateFragmented.php | StandardDateFragmented.determineWeekIndex | protected function determineWeekIndex(DateLexerResult $parts)
{
if (null === $w = $parts->get('W')) {
return null;
}
return intval($w) - 1;
} | php | protected function determineWeekIndex(DateLexerResult $parts)
{
if (null === $w = $parts->get('W')) {
return null;
}
return intval($w) - 1;
} | [
"protected",
"function",
"determineWeekIndex",
"(",
"DateLexerResult",
"$",
"parts",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"w",
"=",
"$",
"parts",
"->",
"get",
"(",
"'W'",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"intval",
"(",
"$",
"w... | Determine ISO week index from iso week number.
@param DateLexerResult $parts
@return integer|null | [
"Determine",
"ISO",
"week",
"index",
"from",
"iso",
"week",
"number",
"."
] | 989048be18451c813cfce926229c6aaddd1b0639 | https://github.com/popy-dev/popy-calendar/blob/989048be18451c813cfce926229c6aaddd1b0639/src/Parser/ResultMapper/StandardDateFragmented.php#L112-L119 |
7,662 | wb-crowdfusion/wb-lib | classes/filters/WbjsonFilterer.php | WbjsonFilterer.format | public function format()
{
$json = (string) $this->getParameter('value');
if (empty($json)) {
return '""';
}
$html = (boolean) $this->getParameter('html');
return JSONUtils::format($json, $html);
} | php | public function format()
{
$json = (string) $this->getParameter('value');
if (empty($json)) {
return '""';
}
$html = (boolean) $this->getParameter('html');
return JSONUtils::format($json, $html);
} | [
"public",
"function",
"format",
"(",
")",
"{",
"$",
"json",
"=",
"(",
"string",
")",
"$",
"this",
"->",
"getParameter",
"(",
"'value'",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"json",
")",
")",
"{",
"return",
"'\"\"'",
";",
"}",
"$",
"html",
"=",... | Indents a flat JSON string to make it more human-readable
@return string | [
"Indents",
"a",
"flat",
"JSON",
"string",
"to",
"make",
"it",
"more",
"human",
"-",
"readable"
] | 972b0f1d4aa2fa538ee6c6b436ac84849a579326 | https://github.com/wb-crowdfusion/wb-lib/blob/972b0f1d4aa2fa538ee6c6b436ac84849a579326/classes/filters/WbjsonFilterer.php#L10-L19 |
7,663 | tacowordpress/util | src/Util/Color.php | Color.gauge | public static function gauge($val, $floor = 0)
{
$colors = self::getGaugeColors();
$key_size = 100 / count($colors);
$key = floor($val / $key_size);
return (array_key_exists((int) $key, $colors)) ? $colors[$key] : end($colors);
} | php | public static function gauge($val, $floor = 0)
{
$colors = self::getGaugeColors();
$key_size = 100 / count($colors);
$key = floor($val / $key_size);
return (array_key_exists((int) $key, $colors)) ? $colors[$key] : end($colors);
} | [
"public",
"static",
"function",
"gauge",
"(",
"$",
"val",
",",
"$",
"floor",
"=",
"0",
")",
"{",
"$",
"colors",
"=",
"self",
"::",
"getGaugeColors",
"(",
")",
";",
"$",
"key_size",
"=",
"100",
"/",
"count",
"(",
"$",
"colors",
")",
";",
"$",
"key... | Turn a val to a color for a gauge
@param $val Val from 0 to 100
@return string Hex | [
"Turn",
"a",
"val",
"to",
"a",
"color",
"for",
"a",
"gauge"
] | a27f6f1c3f96a908c7480f359fd44028e89f26c3 | https://github.com/tacowordpress/util/blob/a27f6f1c3f96a908c7480f359fd44028e89f26c3/src/Util/Color.php#L14-L20 |
7,664 | tacowordpress/util | src/Util/Color.php | Color.hexToRgb | public static function hexToRgb($hex)
{
$hex = preg_replace('/[^a-zA-Z0-9]/', '', $hex);
if (strlen($hex) === 3) {
$hex = preg_replace('/([a-f0-9])/i', "$1$1", $hex);
}
return array_combine(array('r','g','b'), array_map('hexdec', str_split($hex, 2)));
} | php | public static function hexToRgb($hex)
{
$hex = preg_replace('/[^a-zA-Z0-9]/', '', $hex);
if (strlen($hex) === 3) {
$hex = preg_replace('/([a-f0-9])/i', "$1$1", $hex);
}
return array_combine(array('r','g','b'), array_map('hexdec', str_split($hex, 2)));
} | [
"public",
"static",
"function",
"hexToRgb",
"(",
"$",
"hex",
")",
"{",
"$",
"hex",
"=",
"preg_replace",
"(",
"'/[^a-zA-Z0-9]/'",
",",
"''",
",",
"$",
"hex",
")",
";",
"if",
"(",
"strlen",
"(",
"$",
"hex",
")",
"===",
"3",
")",
"{",
"$",
"hex",
"=... | Convert hex to RGB values
@param string $hex Hex (3 or 6 chars, with or without leading #)
@return array RGB values with 'r', 'g', and 'b' keys | [
"Convert",
"hex",
"to",
"RGB",
"values"
] | a27f6f1c3f96a908c7480f359fd44028e89f26c3 | https://github.com/tacowordpress/util/blob/a27f6f1c3f96a908c7480f359fd44028e89f26c3/src/Util/Color.php#L61-L68 |
7,665 | tacowordpress/util | src/Util/Color.php | Color.colorToHex | public static function colorToHex($color)
{
$colors = array(
'maroon' => '800000',
'red' => 'FF0000',
'orange' => 'FFA500',
'yellow' => 'FFFF00',
'olive' => '808000',
'purple' => '800080',
'fuchsia' =... | php | public static function colorToHex($color)
{
$colors = array(
'maroon' => '800000',
'red' => 'FF0000',
'orange' => 'FFA500',
'yellow' => 'FFFF00',
'olive' => '808000',
'purple' => '800080',
'fuchsia' =... | [
"public",
"static",
"function",
"colorToHex",
"(",
"$",
"color",
")",
"{",
"$",
"colors",
"=",
"array",
"(",
"'maroon'",
"=>",
"'800000'",
",",
"'red'",
"=>",
"'FF0000'",
",",
"'orange'",
"=>",
"'FFA500'",
",",
"'yellow'",
"=>",
"'FFFF00'",
",",
"'olive'",... | Convert color name to hex
@param string $color Color
@return string | [
"Convert",
"color",
"name",
"to",
"hex"
] | a27f6f1c3f96a908c7480f359fd44028e89f26c3 | https://github.com/tacowordpress/util/blob/a27f6f1c3f96a908c7480f359fd44028e89f26c3/src/Util/Color.php#L76-L111 |
7,666 | marando/phpSOFA | src/Marando/IAU/iauUt1tt.php | iauUt1tt.Ut1tt | public static function Ut1tt($ut11, $ut12, $dt, &$tt1, &$tt2) {
$dtd;
/* Result, safeguarding precision. */
$dtd = $dt / DAYSEC;
if ($ut11 > $ut12) {
$tt1 = $ut11;
$tt2 = $ut12 + $dtd;
}
else {
$tt1 = $ut11 + $dtd;
$tt2 = $ut12;
}
/* Status (always OK). */
r... | php | public static function Ut1tt($ut11, $ut12, $dt, &$tt1, &$tt2) {
$dtd;
/* Result, safeguarding precision. */
$dtd = $dt / DAYSEC;
if ($ut11 > $ut12) {
$tt1 = $ut11;
$tt2 = $ut12 + $dtd;
}
else {
$tt1 = $ut11 + $dtd;
$tt2 = $ut12;
}
/* Status (always OK). */
r... | [
"public",
"static",
"function",
"Ut1tt",
"(",
"$",
"ut11",
",",
"$",
"ut12",
",",
"$",
"dt",
",",
"&",
"$",
"tt1",
",",
"&",
"$",
"tt2",
")",
"{",
"$",
"dtd",
";",
"/* Result, safeguarding precision. */",
"$",
"dtd",
"=",
"$",
"dt",
"/",
"DAYSEC",
... | - - - - - - - - -
i a u U t 1 t t
- - - - - - - - -
Time scale transformation: Universal Time, UT1, to Terrestrial
Time, TT.
This function is part of the International Astronomical Union's
SOFA (Standards of Fundamental Astronomy) software collection.
Status: canonical.
Given:
ut11,ut12 double UT1 as a 2-part... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"U",
"t",
"1",
"t",
"t",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauUt1tt.php#L50-L66 |
7,667 | dlabas/DlcCategory | src/DlcCategory/Mapper/Category.php | Category.getAllRootIds | public function getAllRootIds()
{
$entityClass = $this->getEntityClass();
$query = $this->getObjectManager()->createQuery('SELECT DISTINCT c.root FROM ' . $entityClass . ' c');
$result = $query->getResult();
$rootIds = array();
foreach ($result as $resultArray) {
... | php | public function getAllRootIds()
{
$entityClass = $this->getEntityClass();
$query = $this->getObjectManager()->createQuery('SELECT DISTINCT c.root FROM ' . $entityClass . ' c');
$result = $query->getResult();
$rootIds = array();
foreach ($result as $resultArray) {
... | [
"public",
"function",
"getAllRootIds",
"(",
")",
"{",
"$",
"entityClass",
"=",
"$",
"this",
"->",
"getEntityClass",
"(",
")",
";",
"$",
"query",
"=",
"$",
"this",
"->",
"getObjectManager",
"(",
")",
"->",
"createQuery",
"(",
"'SELECT DISTINCT c.root FROM '",
... | Returns a list of all root category ids
@return array | [
"Returns",
"a",
"list",
"of",
"all",
"root",
"category",
"ids"
] | cd4dbcae8c1c6a373f96fb0ad15ccebad383f256 | https://github.com/dlabas/DlcCategory/blob/cd4dbcae8c1c6a373f96fb0ad15ccebad383f256/src/DlcCategory/Mapper/Category.php#L13-L26 |
7,668 | dlabas/DlcCategory | src/DlcCategory/Mapper/Category.php | Category.findOneByName | public function findOneByName($name)
{
$entityClass = $this->getEntityClass();
return $this->getObjectManager()
->getRepository($entityClass)
->findOneByName($name);
} | php | public function findOneByName($name)
{
$entityClass = $this->getEntityClass();
return $this->getObjectManager()
->getRepository($entityClass)
->findOneByName($name);
} | [
"public",
"function",
"findOneByName",
"(",
"$",
"name",
")",
"{",
"$",
"entityClass",
"=",
"$",
"this",
"->",
"getEntityClass",
"(",
")",
";",
"return",
"$",
"this",
"->",
"getObjectManager",
"(",
")",
"->",
"getRepository",
"(",
"$",
"entityClass",
")",
... | Find one category by it's name
@param string $name | [
"Find",
"one",
"category",
"by",
"it",
"s",
"name"
] | cd4dbcae8c1c6a373f96fb0ad15ccebad383f256 | https://github.com/dlabas/DlcCategory/blob/cd4dbcae8c1c6a373f96fb0ad15ccebad383f256/src/DlcCategory/Mapper/Category.php#L33-L40 |
7,669 | dlabas/DlcCategory | src/DlcCategory/Mapper/Category.php | Category.findOneByTitle | public function findOneByTitle($title)
{
$entityClass = $this->getEntityClass();
return $this->getObjectManager()
->getRepository($entityClass)
->findOneByTitle($title);
} | php | public function findOneByTitle($title)
{
$entityClass = $this->getEntityClass();
return $this->getObjectManager()
->getRepository($entityClass)
->findOneByTitle($title);
} | [
"public",
"function",
"findOneByTitle",
"(",
"$",
"title",
")",
"{",
"$",
"entityClass",
"=",
"$",
"this",
"->",
"getEntityClass",
"(",
")",
";",
"return",
"$",
"this",
"->",
"getObjectManager",
"(",
")",
"->",
"getRepository",
"(",
"$",
"entityClass",
")"... | Find one category by it's title
@param string $title | [
"Find",
"one",
"category",
"by",
"it",
"s",
"title"
] | cd4dbcae8c1c6a373f96fb0ad15ccebad383f256 | https://github.com/dlabas/DlcCategory/blob/cd4dbcae8c1c6a373f96fb0ad15ccebad383f256/src/DlcCategory/Mapper/Category.php#L47-L54 |
7,670 | vinala/kernel | src/Database/Drivers/MysqlDriver.php | MysqlDriver.connect | public static function connect($host = null, $database = null, $user = null, $password = null)
{
if (config('app.setup')) {
self::$connection = new MysqlConnector($host, $database, $user, $password);
self::$server = self::$connection->connector;
}
return self::$serve... | php | public static function connect($host = null, $database = null, $user = null, $password = null)
{
if (config('app.setup')) {
self::$connection = new MysqlConnector($host, $database, $user, $password);
self::$server = self::$connection->connector;
}
return self::$serve... | [
"public",
"static",
"function",
"connect",
"(",
"$",
"host",
"=",
"null",
",",
"$",
"database",
"=",
"null",
",",
"$",
"user",
"=",
"null",
",",
"$",
"password",
"=",
"null",
")",
"{",
"if",
"(",
"config",
"(",
"'app.setup'",
")",
")",
"{",
"self",... | Connect to Mysql database server.
@param string, string, string, string
@return PDO | [
"Connect",
"to",
"Mysql",
"database",
"server",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Database/Drivers/MysqlDriver.php#L31-L39 |
7,671 | vinala/kernel | src/Database/Drivers/MysqlDriver.php | MysqlDriver.getColmuns | public function getColmuns($table)
{
$table = self::table($table);
$columns = [];
//
$data = Database::read("select COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '".Config::get('database.database')."' AND TABLE_NAME = '$table';");
//
foreach ($data ... | php | public function getColmuns($table)
{
$table = self::table($table);
$columns = [];
//
$data = Database::read("select COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '".Config::get('database.database')."' AND TABLE_NAME = '$table';");
//
foreach ($data ... | [
"public",
"function",
"getColmuns",
"(",
"$",
"table",
")",
"{",
"$",
"table",
"=",
"self",
"::",
"table",
"(",
"$",
"table",
")",
";",
"$",
"columns",
"=",
"[",
"]",
";",
"//",
"$",
"data",
"=",
"Database",
"::",
"read",
"(",
"\"select COLUMN_NAME F... | Get columns of data table. | [
"Get",
"columns",
"of",
"data",
"table",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Database/Drivers/MysqlDriver.php#L86-L98 |
7,672 | vinala/kernel | src/Database/Drivers/MysqlDriver.php | MysqlDriver.getNormalColumn | public function getNormalColumn($table)
{
$all = self::getColmuns($table);
$incs = self::getIncrement($table);
//
return Collection::except($incs, $all);
} | php | public function getNormalColumn($table)
{
$all = self::getColmuns($table);
$incs = self::getIncrement($table);
//
return Collection::except($incs, $all);
} | [
"public",
"function",
"getNormalColumn",
"(",
"$",
"table",
")",
"{",
"$",
"all",
"=",
"self",
"::",
"getColmuns",
"(",
"$",
"table",
")",
";",
"$",
"incs",
"=",
"self",
"::",
"getIncrement",
"(",
"$",
"table",
")",
";",
"//",
"return",
"Collection",
... | Get columns of data table without auto increment columns. | [
"Get",
"columns",
"of",
"data",
"table",
"without",
"auto",
"increment",
"columns",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Database/Drivers/MysqlDriver.php#L120-L126 |
7,673 | wearenolte/wp-endpoints-post | src/Post.php | Post.endpoint_callback | public function endpoint_callback( \WP_REST_Request $request ) {
$params = $request->get_params();
$id = $params['id'];
$slug = false === $params['slug'] ? false : trim( $params['slug'], '/' );
if ( false === $id && false === $slug ) {
return new \WP_Error( self::INVALID_PARAMS, 'The request must have eit... | php | public function endpoint_callback( \WP_REST_Request $request ) {
$params = $request->get_params();
$id = $params['id'];
$slug = false === $params['slug'] ? false : trim( $params['slug'], '/' );
if ( false === $id && false === $slug ) {
return new \WP_Error( self::INVALID_PARAMS, 'The request must have eit... | [
"public",
"function",
"endpoint_callback",
"(",
"\\",
"WP_REST_Request",
"$",
"request",
")",
"{",
"$",
"params",
"=",
"$",
"request",
"->",
"get_params",
"(",
")",
";",
"$",
"id",
"=",
"$",
"params",
"[",
"'id'",
"]",
";",
"$",
"slug",
"=",
"false",
... | Get the post.
@param \WP_REST_Request $request The request.
@return array|\WP_Error | [
"Get",
"the",
"post",
"."
] | 11f17af89a3164faade5bd05be714cc3ab6e3c08 | https://github.com/wearenolte/wp-endpoints-post/blob/11f17af89a3164faade5bd05be714cc3ab6e3c08/src/Post.php#L34-L79 |
7,674 | wearenolte/wp-endpoints-post | src/Post.php | Post.get_query_filter_name | private function get_query_filter_name() {
$filter_format = trim( $this->filter_format( $this->endpoint ), '_' );
return sprintf( self::QUERY_FILTER, $filter_format );
} | php | private function get_query_filter_name() {
$filter_format = trim( $this->filter_format( $this->endpoint ), '_' );
return sprintf( self::QUERY_FILTER, $filter_format );
} | [
"private",
"function",
"get_query_filter_name",
"(",
")",
"{",
"$",
"filter_format",
"=",
"trim",
"(",
"$",
"this",
"->",
"filter_format",
"(",
"$",
"this",
"->",
"endpoint",
")",
",",
"'_'",
")",
";",
"return",
"sprintf",
"(",
"self",
"::",
"QUERY_FILTER"... | Makes sure there is no more _ between and after the filter_format
@since 0.2.0
@return String | [
"Makes",
"sure",
"there",
"is",
"no",
"more",
"_",
"between",
"and",
"after",
"the",
"filter_format"
] | 11f17af89a3164faade5bd05be714cc3ab6e3c08 | https://github.com/wearenolte/wp-endpoints-post/blob/11f17af89a3164faade5bd05be714cc3ab6e3c08/src/Post.php#L87-L90 |
7,675 | wearenolte/wp-endpoints-post | src/Post.php | Post.endpoint_args | public function endpoint_args() {
return [
'id' => [
'default' => false,
'validate_callback' => function ( $id ) {
return false === $id || intval( $id ) > 0;
},
],
'slug' => [
'default' => false,
'sanitize_callback' => function ( $slug, $request, $key ) {
return false === $slug ... | php | public function endpoint_args() {
return [
'id' => [
'default' => false,
'validate_callback' => function ( $id ) {
return false === $id || intval( $id ) > 0;
},
],
'slug' => [
'default' => false,
'sanitize_callback' => function ( $slug, $request, $key ) {
return false === $slug ... | [
"public",
"function",
"endpoint_args",
"(",
")",
"{",
"return",
"[",
"'id'",
"=>",
"[",
"'default'",
"=>",
"false",
",",
"'validate_callback'",
"=>",
"function",
"(",
"$",
"id",
")",
"{",
"return",
"false",
"===",
"$",
"id",
"||",
"intval",
"(",
"$",
"... | Callback used for the endpoint
@since 0.1.0 | [
"Callback",
"used",
"for",
"the",
"endpoint"
] | 11f17af89a3164faade5bd05be714cc3ab6e3c08 | https://github.com/wearenolte/wp-endpoints-post/blob/11f17af89a3164faade5bd05be714cc3ab6e3c08/src/Post.php#L97-L112 |
7,676 | Xety/Configurator | src/Configurator.php | Configurator.mergeConfig | public function mergeConfig(array $values, bool $invert = false): Configurator
{
$this->config = ($invert) ? array_merge($values, $this->config) : array_merge($this->config, $values);
return $this;
} | php | public function mergeConfig(array $values, bool $invert = false): Configurator
{
$this->config = ($invert) ? array_merge($values, $this->config) : array_merge($this->config, $values);
return $this;
} | [
"public",
"function",
"mergeConfig",
"(",
"array",
"$",
"values",
",",
"bool",
"$",
"invert",
"=",
"false",
")",
":",
"Configurator",
"{",
"$",
"this",
"->",
"config",
"=",
"(",
"$",
"invert",
")",
"?",
"array_merge",
"(",
"$",
"values",
",",
"$",
"t... | Merge the values to the options array.
@param array $values The values to merge in the config.
@param bool $invert Invert the merge by merging the actual config into the values.
@return \Xety\Configurator\Configurator | [
"Merge",
"the",
"values",
"to",
"the",
"options",
"array",
"."
] | a7bb37a0f7d548df2491b6fd596c940cae81c94e | https://github.com/Xety/Configurator/blob/a7bb37a0f7d548df2491b6fd596c940cae81c94e/src/Configurator.php#L55-L60 |
7,677 | Xety/Configurator | src/Configurator.php | Configurator.flushConfig | public function flushConfig(string ...$filter): Configurator
{
$filter = array_flip($filter);
$this->config = array_diff_key($this->config, $filter);
return $this;
} | php | public function flushConfig(string ...$filter): Configurator
{
$filter = array_flip($filter);
$this->config = array_diff_key($this->config, $filter);
return $this;
} | [
"public",
"function",
"flushConfig",
"(",
"string",
"...",
"$",
"filter",
")",
":",
"Configurator",
"{",
"$",
"filter",
"=",
"array_flip",
"(",
"$",
"filter",
")",
";",
"$",
"this",
"->",
"config",
"=",
"array_diff_key",
"(",
"$",
"this",
"->",
"config",... | Flush a list of options from the config array.
Usage:
```php
$this->flush('key1', 'key2');
```
@param string ...$filter All the options to remove from the config.
@return \Xety\Configurator\Configurator | [
"Flush",
"a",
"list",
"of",
"options",
"from",
"the",
"config",
"array",
"."
] | a7bb37a0f7d548df2491b6fd596c940cae81c94e | https://github.com/Xety/Configurator/blob/a7bb37a0f7d548df2491b6fd596c940cae81c94e/src/Configurator.php#L74-L80 |
7,678 | Xety/Configurator | src/Configurator.php | Configurator.setOption | public function setOption(string $name, $value): Configurator
{
$this->validateName($name);
$this->config[$name] = $value;
return $this;
} | php | public function setOption(string $name, $value): Configurator
{
$this->validateName($name);
$this->config[$name] = $value;
return $this;
} | [
"public",
"function",
"setOption",
"(",
"string",
"$",
"name",
",",
"$",
"value",
")",
":",
"Configurator",
"{",
"$",
"this",
"->",
"validateName",
"(",
"$",
"name",
")",
";",
"$",
"this",
"->",
"config",
"[",
"$",
"name",
"]",
"=",
"$",
"value",
"... | Set a value to the given option.
Usage:
```php
$this->setOption('key', 'value');
$this->setOption('key', ['key2' => ['value2']]);
```
@param string $name The option name.
@param mixed $value The option value.
@return \Xety\Configurator\Configurator | [
"Set",
"a",
"value",
"to",
"the",
"given",
"option",
"."
] | a7bb37a0f7d548df2491b6fd596c940cae81c94e | https://github.com/Xety/Configurator/blob/a7bb37a0f7d548df2491b6fd596c940cae81c94e/src/Configurator.php#L108-L114 |
7,679 | Xety/Configurator | src/Configurator.php | Configurator.hasOption | public function hasOption(string $name): bool
{
$this->validateName($name);
return array_key_exists($name, $this->config);
} | php | public function hasOption(string $name): bool
{
$this->validateName($name);
return array_key_exists($name, $this->config);
} | [
"public",
"function",
"hasOption",
"(",
"string",
"$",
"name",
")",
":",
"bool",
"{",
"$",
"this",
"->",
"validateName",
"(",
"$",
"name",
")",
";",
"return",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"config",
")",
";",
"}"
] | Check if the option exist.
@param string $name The option name to check.
@return bool | [
"Check",
"if",
"the",
"option",
"exist",
"."
] | a7bb37a0f7d548df2491b6fd596c940cae81c94e | https://github.com/Xety/Configurator/blob/a7bb37a0f7d548df2491b6fd596c940cae81c94e/src/Configurator.php#L146-L151 |
7,680 | Xety/Configurator | src/Configurator.php | Configurator.consumeOption | public function consumeOption(string $name)
{
$this->validateName($name);
if (!array_key_exists($name, $this->config)) {
return null;
}
$value = $this->config[$name];
$this->flushOption($name);
return $value;
} | php | public function consumeOption(string $name)
{
$this->validateName($name);
if (!array_key_exists($name, $this->config)) {
return null;
}
$value = $this->config[$name];
$this->flushOption($name);
return $value;
} | [
"public",
"function",
"consumeOption",
"(",
"string",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"validateName",
"(",
"$",
"name",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"config",
")",
")",
"{",
"return... | Read then flush an option.
Exemple:
Config:
```php
$config = [
'key1' => 'value1'
];
```
Usage:
```php
$result = $this->consumeOption('key1');
```
Result:
```php
echo $result; // value1
var_dump($config); // []
```
@param string $name The name of the option to read then flush.
@return mixed | [
"Read",
"then",
"flush",
"an",
"option",
"."
] | a7bb37a0f7d548df2491b6fd596c940cae81c94e | https://github.com/Xety/Configurator/blob/a7bb37a0f7d548df2491b6fd596c940cae81c94e/src/Configurator.php#L178-L190 |
7,681 | Xety/Configurator | src/Configurator.php | Configurator.pushOption | public function pushOption(string $name, array ...$args): Configurator
{
$this->validateName($name);
if (empty($args)) {
throw new InvalidArgumentNumberException();
}
foreach ($args as $arg) {
if (is_array($arg)) {
foreach ($arg as $key => $v... | php | public function pushOption(string $name, array ...$args): Configurator
{
$this->validateName($name);
if (empty($args)) {
throw new InvalidArgumentNumberException();
}
foreach ($args as $arg) {
if (is_array($arg)) {
foreach ($arg as $key => $v... | [
"public",
"function",
"pushOption",
"(",
"string",
"$",
"name",
",",
"array",
"...",
"$",
"args",
")",
":",
"Configurator",
"{",
"$",
"this",
"->",
"validateName",
"(",
"$",
"name",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"args",
")",
")",
"{",
"th... | Push the listed args to the named option.
Usage:
```php
$this->pushOption('key', ['key1' => 'value1'], ['key2' => ['value2' => 'value3']]);
```
Result:
```php
'key' => [
'key1' => 'value1',
'key2' => [
value2 => value3
]
]
```
@param string $name The name of the option.
@param array ...$args A list of values to push ... | [
"Push",
"the",
"listed",
"args",
"to",
"the",
"named",
"option",
"."
] | a7bb37a0f7d548df2491b6fd596c940cae81c94e | https://github.com/Xety/Configurator/blob/a7bb37a0f7d548df2491b6fd596c940cae81c94e/src/Configurator.php#L217-L234 |
7,682 | Xety/Configurator | src/Configurator.php | Configurator.flushOption | public function flushOption(string $name): Configurator
{
$this->validateName($name);
if ($this->hasOption($name)) {
unset($this->config[$name]);
}
return $this;
} | php | public function flushOption(string $name): Configurator
{
$this->validateName($name);
if ($this->hasOption($name)) {
unset($this->config[$name]);
}
return $this;
} | [
"public",
"function",
"flushOption",
"(",
"string",
"$",
"name",
")",
":",
"Configurator",
"{",
"$",
"this",
"->",
"validateName",
"(",
"$",
"name",
")",
";",
"if",
"(",
"$",
"this",
"->",
"hasOption",
"(",
"$",
"name",
")",
")",
"{",
"unset",
"(",
... | Flush an option.
@param string $name The name of the option to flush.
@return \Xety\Configurator\Configurator | [
"Flush",
"an",
"option",
"."
] | a7bb37a0f7d548df2491b6fd596c940cae81c94e | https://github.com/Xety/Configurator/blob/a7bb37a0f7d548df2491b6fd596c940cae81c94e/src/Configurator.php#L243-L252 |
7,683 | CakeCMS/Extensions | src/Plugin.php | Plugin.getInstance | public static function getInstance($name)
{
if (!self::loaded($name)) {
throw new MissingPluginException(['plugin' => $name]);
}
if (!Arr::key($name, self::$_pluginsList)) {
$slug = Str::low($name);
$table = TableRegistry::get('Extensions.Extensions');
... | php | public static function getInstance($name)
{
if (!self::loaded($name)) {
throw new MissingPluginException(['plugin' => $name]);
}
if (!Arr::key($name, self::$_pluginsList)) {
$slug = Str::low($name);
$table = TableRegistry::get('Extensions.Extensions');
... | [
"public",
"static",
"function",
"getInstance",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"loaded",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"MissingPluginException",
"(",
"[",
"'plugin'",
"=>",
"$",
"name",
"]",
")",
";",
"}",... | Get plugin extension instance.
@param string $name Plugin name.
@return Entity | [
"Get",
"plugin",
"extension",
"instance",
"."
] | 5c719a8283ff2bc5499658f2ef3d6932d26c55e6 | https://github.com/CakeCMS/Extensions/blob/5c719a8283ff2bc5499658f2ef3d6932d26c55e6/src/Plugin.php#L46-L68 |
7,684 | znframework/package-services | CDN.php | CDN.get | public static function get(String $configName, String $name) : String
{
$config = Config::default('ZN\Services\CDNDefaultConfiguration')
::get('CDNLinks');
$configData = ! empty($config[$configName]) ? $config[$configName] : '';
if( empty($configData) )
{
... | php | public static function get(String $configName, String $name) : String
{
$config = Config::default('ZN\Services\CDNDefaultConfiguration')
::get('CDNLinks');
$configData = ! empty($config[$configName]) ? $config[$configName] : '';
if( empty($configData) )
{
... | [
"public",
"static",
"function",
"get",
"(",
"String",
"$",
"configName",
",",
"String",
"$",
"name",
")",
":",
"String",
"{",
"$",
"config",
"=",
"Config",
"::",
"default",
"(",
"'ZN\\Services\\CDNDefaultConfiguration'",
")",
"::",
"get",
"(",
"'CDNLinks'",
... | Get cdn data.
@param string $configName
@param string $name
@return string | [
"Get",
"cdn",
"data",
"."
] | d603667191e2e386cbc2119836c5bed9e3ade141 | https://github.com/znframework/package-services/blob/d603667191e2e386cbc2119836c5bed9e3ade141/CDN.php#L88-L111 |
7,685 | konservs/brilliant.framework | libraries/Config/BConfig.php | BConfig.getallfields | public function getallfields(){
$res=array();
foreach($this->categories as $cat){
foreach($cat->groups as $group){
foreach($group->fields as $fld){
$res[$fld->alias]=$fld;
}
}
}
return $res;
} | php | public function getallfields(){
$res=array();
foreach($this->categories as $cat){
foreach($cat->groups as $group){
foreach($group->fields as $fld){
$res[$fld->alias]=$fld;
}
}
}
return $res;
} | [
"public",
"function",
"getallfields",
"(",
")",
"{",
"$",
"res",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"categories",
"as",
"$",
"cat",
")",
"{",
"foreach",
"(",
"$",
"cat",
"->",
"groups",
"as",
"$",
"group",
")",
"{",
"... | Get all fields objects
@return array array of fields objects | [
"Get",
"all",
"fields",
"objects"
] | 95f03f1917f746fee98bea8a906ba0588c87762d | https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/Config/BConfig.php#L42-L52 |
7,686 | konservs/brilliant.framework | libraries/Config/BConfig.php | BConfig.saveconfig | public function saveconfig(){
$fields=$this->getallfields();
foreach($fields as $k=>&$v){
$v->value=BRequest::getVar($k,$v->default);
}
$cfgfile='<?php'.PHP_EOL;
foreach($fields as $fld){
$cfgfile.=$fld->getcfg();
}
$fn_config=BROOTPATH.'config'.DIRECTORY_SEPARATOR.'config.php';
return file_put_... | php | public function saveconfig(){
$fields=$this->getallfields();
foreach($fields as $k=>&$v){
$v->value=BRequest::getVar($k,$v->default);
}
$cfgfile='<?php'.PHP_EOL;
foreach($fields as $fld){
$cfgfile.=$fld->getcfg();
}
$fn_config=BROOTPATH.'config'.DIRECTORY_SEPARATOR.'config.php';
return file_put_... | [
"public",
"function",
"saveconfig",
"(",
")",
"{",
"$",
"fields",
"=",
"$",
"this",
"->",
"getallfields",
"(",
")",
";",
"foreach",
"(",
"$",
"fields",
"as",
"$",
"k",
"=>",
"&",
"$",
"v",
")",
"{",
"$",
"v",
"->",
"value",
"=",
"BRequest",
"::",... | Save configuration file
@return boolean result | [
"Save",
"configuration",
"file"
] | 95f03f1917f746fee98bea8a906ba0588c87762d | https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/Config/BConfig.php#L71-L82 |
7,687 | Briareos/mongodb-odm | lib/Doctrine/ODM/MongoDB/DocumentManager.php | DocumentManager.getDocumentCollection | public function getDocumentCollection($className)
{
$className = ltrim($className, '\\');
$metadata = $this->metadataFactory->getMetadataFor($className);
$collectionName = $metadata->getCollection();
if ( ! $collectionName) {
throw MongoDBException::documentNotMappedToC... | php | public function getDocumentCollection($className)
{
$className = ltrim($className, '\\');
$metadata = $this->metadataFactory->getMetadataFor($className);
$collectionName = $metadata->getCollection();
if ( ! $collectionName) {
throw MongoDBException::documentNotMappedToC... | [
"public",
"function",
"getDocumentCollection",
"(",
"$",
"className",
")",
"{",
"$",
"className",
"=",
"ltrim",
"(",
"$",
"className",
",",
"'\\\\'",
")",
";",
"$",
"metadata",
"=",
"$",
"this",
"->",
"metadataFactory",
"->",
"getMetadataFor",
"(",
"$",
"c... | Returns the MongoCollection instance for a class.
@param string $className The class name.
@throws MongoDBException When the $className param is not mapped to a collection
@return \Doctrine\MongoDB\Collection | [
"Returns",
"the",
"MongoCollection",
"instance",
"for",
"a",
"class",
"."
] | 29e28bed9a265efd7d05473b0a909fb7c83f76e0 | https://github.com/Briareos/mongodb-odm/blob/29e28bed9a265efd7d05473b0a909fb7c83f76e0/lib/Doctrine/ODM/MongoDB/DocumentManager.php#L329-L355 |
7,688 | Briareos/mongodb-odm | lib/Doctrine/ODM/MongoDB/DocumentManager.php | DocumentManager.getRepository | public function getRepository($documentName)
{
$documentName = ltrim($documentName, '\\');
if (isset($this->repositories[$documentName])) {
return $this->repositories[$documentName];
}
$metadata = $this->getClassMetadata($documentName);
$customRepositoryClassNam... | php | public function getRepository($documentName)
{
$documentName = ltrim($documentName, '\\');
if (isset($this->repositories[$documentName])) {
return $this->repositories[$documentName];
}
$metadata = $this->getClassMetadata($documentName);
$customRepositoryClassNam... | [
"public",
"function",
"getRepository",
"(",
"$",
"documentName",
")",
"{",
"$",
"documentName",
"=",
"ltrim",
"(",
"$",
"documentName",
",",
"'\\\\'",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"repositories",
"[",
"$",
"documentName",
"]",
")... | Gets the repository for a document class.
@param string $documentName The name of the Document.
@return DocumentRepository The repository. | [
"Gets",
"the",
"repository",
"for",
"a",
"document",
"class",
"."
] | 29e28bed9a265efd7d05473b0a909fb7c83f76e0 | https://github.com/Briareos/mongodb-odm/blob/29e28bed9a265efd7d05473b0a909fb7c83f76e0/lib/Doctrine/ODM/MongoDB/DocumentManager.php#L506-L526 |
7,689 | Briareos/mongodb-odm | lib/Doctrine/ODM/MongoDB/DocumentManager.php | DocumentManager.flush | public function flush($document = null, array $options = array())
{
if (null !== $document && ! is_object($document) && ! is_array($document)) {
throw new \InvalidArgumentException(gettype($document));
}
$this->errorIfClosed();
$this->unitOfWork->commit($document, $option... | php | public function flush($document = null, array $options = array())
{
if (null !== $document && ! is_object($document) && ! is_array($document)) {
throw new \InvalidArgumentException(gettype($document));
}
$this->errorIfClosed();
$this->unitOfWork->commit($document, $option... | [
"public",
"function",
"flush",
"(",
"$",
"document",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"document",
"&&",
"!",
"is_object",
"(",
"$",
"document",
")",
"&&",
"!",
"is_array",
"... | Flushes all changes to objects that have been queued up to now to the database.
This effectively synchronizes the in-memory state of managed objects with the
database.
@param object $document
@param array $options Array of options to be used with batchInsert(), update() and remove()
@throws \InvalidArgumentException | [
"Flushes",
"all",
"changes",
"to",
"objects",
"that",
"have",
"been",
"queued",
"up",
"to",
"now",
"to",
"the",
"database",
".",
"This",
"effectively",
"synchronizes",
"the",
"in",
"-",
"memory",
"state",
"of",
"managed",
"objects",
"with",
"the",
"database"... | 29e28bed9a265efd7d05473b0a909fb7c83f76e0 | https://github.com/Briareos/mongodb-odm/blob/29e28bed9a265efd7d05473b0a909fb7c83f76e0/lib/Doctrine/ODM/MongoDB/DocumentManager.php#L537-L544 |
7,690 | Briareos/mongodb-odm | lib/Doctrine/ODM/MongoDB/DocumentManager.php | DocumentManager.getReference | public function getReference($documentName, $identifier)
{
/* @var $class \Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo */
$class = $this->metadataFactory->getMetadataFor(ltrim($documentName, '\\'));
// Check identity map first, if its already in there just return it.
if ($documen... | php | public function getReference($documentName, $identifier)
{
/* @var $class \Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo */
$class = $this->metadataFactory->getMetadataFor(ltrim($documentName, '\\'));
// Check identity map first, if its already in there just return it.
if ($documen... | [
"public",
"function",
"getReference",
"(",
"$",
"documentName",
",",
"$",
"identifier",
")",
"{",
"/* @var $class \\Doctrine\\ODM\\MongoDB\\Mapping\\ClassMetadataInfo */",
"$",
"class",
"=",
"$",
"this",
"->",
"metadataFactory",
"->",
"getMetadataFor",
"(",
"ltrim",
"("... | Gets a reference to the document identified by the given type and identifier
without actually loading it.
If partial objects are allowed, this method will return a partial object that only
has its identifier populated. Otherwise a proxy is returned that automatically
loads itself on first access.
@param string $docum... | [
"Gets",
"a",
"reference",
"to",
"the",
"document",
"identified",
"by",
"the",
"given",
"type",
"and",
"identifier",
"without",
"actually",
"loading",
"it",
"."
] | 29e28bed9a265efd7d05473b0a909fb7c83f76e0 | https://github.com/Briareos/mongodb-odm/blob/29e28bed9a265efd7d05473b0a909fb7c83f76e0/lib/Doctrine/ODM/MongoDB/DocumentManager.php#L558-L572 |
7,691 | Briareos/mongodb-odm | lib/Doctrine/ODM/MongoDB/DocumentManager.php | DocumentManager.createDBRef | public function createDBRef($document, array $referenceMapping = null)
{
if ( ! is_object($document)) {
throw new \InvalidArgumentException('Cannot create a DBRef, the document is not an object');
}
$class = $this->getClassMetadata(get_class($document));
$id = $this->uni... | php | public function createDBRef($document, array $referenceMapping = null)
{
if ( ! is_object($document)) {
throw new \InvalidArgumentException('Cannot create a DBRef, the document is not an object');
}
$class = $this->getClassMetadata(get_class($document));
$id = $this->uni... | [
"public",
"function",
"createDBRef",
"(",
"$",
"document",
",",
"array",
"$",
"referenceMapping",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"document",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Cannot create ... | Returns a DBRef array for the supplied document.
@param mixed $document A document object
@param array $referenceMapping Mapping for the field that references the document
@throws \InvalidArgumentException
@return array A DBRef array | [
"Returns",
"a",
"DBRef",
"array",
"for",
"the",
"supplied",
"document",
"."
] | 29e28bed9a265efd7d05473b0a909fb7c83f76e0 | https://github.com/Briareos/mongodb-odm/blob/29e28bed9a265efd7d05473b0a909fb7c83f76e0/lib/Doctrine/ODM/MongoDB/DocumentManager.php#L684-L742 |
7,692 | Laralum/PDF | src/Controllers/PDFController.php | PDFController.download | public function download(Request $request, $name = 'output')
{
$pdf = PDF::loadView('laralum_pdf::pdf', ['text' => $request->text]);
return $pdf->download("$name.pdf");
} | php | public function download(Request $request, $name = 'output')
{
$pdf = PDF::loadView('laralum_pdf::pdf', ['text' => $request->text]);
return $pdf->download("$name.pdf");
} | [
"public",
"function",
"download",
"(",
"Request",
"$",
"request",
",",
"$",
"name",
"=",
"'output'",
")",
"{",
"$",
"pdf",
"=",
"PDF",
"::",
"loadView",
"(",
"'laralum_pdf::pdf'",
",",
"[",
"'text'",
"=>",
"$",
"request",
"->",
"text",
"]",
")",
";",
... | Download the PDF.
@param string $name
@param \Illuminate\Http\Request $request
@return \Illuminate\Http\Response | [
"Download",
"the",
"PDF",
"."
] | b73d5a4b741ba8594820e9aab29ae56d7381766f | https://github.com/Laralum/PDF/blob/b73d5a4b741ba8594820e9aab29ae56d7381766f/src/Controllers/PDFController.php#L30-L35 |
7,693 | Laralum/PDF | src/Controllers/PDFController.php | PDFController.show | public function show(Request $request)
{
$pdf = PDF::loadView('laralum_pdf::pdf', ['text' => $request->text]);
return Response::make($pdf->download('output.pdf'), 200, ['content-type' => 'application/pdf']);
} | php | public function show(Request $request)
{
$pdf = PDF::loadView('laralum_pdf::pdf', ['text' => $request->text]);
return Response::make($pdf->download('output.pdf'), 200, ['content-type' => 'application/pdf']);
} | [
"public",
"function",
"show",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"pdf",
"=",
"PDF",
"::",
"loadView",
"(",
"'laralum_pdf::pdf'",
",",
"[",
"'text'",
"=>",
"$",
"request",
"->",
"text",
"]",
")",
";",
"return",
"Response",
"::",
"make",
"(",... | Display the PDF.
@param \Illuminate\Http\Request $request
@return \Illuminate\Http\Response | [
"Display",
"the",
"PDF",
"."
] | b73d5a4b741ba8594820e9aab29ae56d7381766f | https://github.com/Laralum/PDF/blob/b73d5a4b741ba8594820e9aab29ae56d7381766f/src/Controllers/PDFController.php#L44-L49 |
7,694 | gossi/trixionary | src/model/Base/FunctionPhase.php | FunctionPhase.initRootSkills | public function initRootSkills($overrideExisting = true)
{
if (null !== $this->collRootSkills && !$overrideExisting) {
return;
}
$this->collRootSkills = new ObjectCollection();
$this->collRootSkills->setModel('\gossi\trixionary\model\Skill');
} | php | public function initRootSkills($overrideExisting = true)
{
if (null !== $this->collRootSkills && !$overrideExisting) {
return;
}
$this->collRootSkills = new ObjectCollection();
$this->collRootSkills->setModel('\gossi\trixionary\model\Skill');
} | [
"public",
"function",
"initRootSkills",
"(",
"$",
"overrideExisting",
"=",
"true",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"collRootSkills",
"&&",
"!",
"$",
"overrideExisting",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"collRootSkills... | Initializes the collRootSkills collection.
By default this just sets the collRootSkills collection to an empty array (like clearcollRootSkills());
however, you may wish to override this method in your stub class to provide setting appropriate
to your application -- for example, setting the initial array to the values ... | [
"Initializes",
"the",
"collRootSkills",
"collection",
"."
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/FunctionPhase.php#L1379-L1386 |
7,695 | gossi/trixionary | src/model/Base/FunctionPhase.php | FunctionPhase.getRootSkillsJoinSport | public function getRootSkillsJoinSport(Criteria $criteria = null, ConnectionInterface $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildSkillQuery::create(null, $criteria);
$query->joinWith('Sport', $joinBehavior);
return $this->getRootSkills($query, $con);
} | php | public function getRootSkillsJoinSport(Criteria $criteria = null, ConnectionInterface $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildSkillQuery::create(null, $criteria);
$query->joinWith('Sport', $joinBehavior);
return $this->getRootSkills($query, $con);
} | [
"public",
"function",
"getRootSkillsJoinSport",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
",",
"$",
"joinBehavior",
"=",
"Criteria",
"::",
"LEFT_JOIN",
")",
"{",
"$",
"query",
"=",
"ChildSkillQuery",
":... | If this collection has already been initialized with
an identical criteria, it returns the collection.
Otherwise if this FunctionPhase is new, it will return
an empty collection; or if this FunctionPhase has previously
been saved, it will retrieve related RootSkills from storage.
This method is protected by default in... | [
"If",
"this",
"collection",
"has",
"already",
"been",
"initialized",
"with",
"an",
"identical",
"criteria",
"it",
"returns",
"the",
"collection",
".",
"Otherwise",
"if",
"this",
"FunctionPhase",
"is",
"new",
"it",
"will",
"return",
"an",
"empty",
"collection",
... | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/FunctionPhase.php#L1580-L1586 |
7,696 | gossi/trixionary | src/model/Base/FunctionPhase.php | FunctionPhase.getSyncParent | public function getSyncParent($con = null)
{
$parent = $this->getParentOrCreate($con);
$parent->setType($this->getType());
$parent->setSkillId($this->getSkillId());
$parent->setTitle($this->getTitle());
if ($this->getSkill() && $this->getSkill()->isNew()) {
$paren... | php | public function getSyncParent($con = null)
{
$parent = $this->getParentOrCreate($con);
$parent->setType($this->getType());
$parent->setSkillId($this->getSkillId());
$parent->setTitle($this->getTitle());
if ($this->getSkill() && $this->getSkill()->isNew()) {
$paren... | [
"public",
"function",
"getSyncParent",
"(",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"parent",
"=",
"$",
"this",
"->",
"getParentOrCreate",
"(",
"$",
"con",
")",
";",
"$",
"parent",
"->",
"setType",
"(",
"$",
"this",
"->",
"getType",
"(",
")",
")",
... | Create or Update the parent StructureNode object
And return its primary key
@return int The primary key of the parent object | [
"Create",
"or",
"Update",
"the",
"parent",
"StructureNode",
"object",
"And",
"return",
"its",
"primary",
"key"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/FunctionPhase.php#L1906-L1917 |
7,697 | synapsestudios/synapse-base | src/Synapse/Db/DbServiceProvider.php | DbServiceProvider.register | public function register(Application $app)
{
$app['db'] = $app->share(function ($app) {
return new Adapter($app['config']->load('db'));
});
$app['db.transaction'] = $app->share(function ($app) {
return new Transaction($app['db']);
});
$app->initializ... | php | public function register(Application $app)
{
$app['db'] = $app->share(function ($app) {
return new Adapter($app['config']->load('db'));
});
$app['db.transaction'] = $app->share(function ($app) {
return new Transaction($app['db']);
});
$app->initializ... | [
"public",
"function",
"register",
"(",
"Application",
"$",
"app",
")",
"{",
"$",
"app",
"[",
"'db'",
"]",
"=",
"$",
"app",
"->",
"share",
"(",
"function",
"(",
"$",
"app",
")",
"{",
"return",
"new",
"Adapter",
"(",
"$",
"app",
"[",
"'config'",
"]",... | Register the database adapter
@param Application $app Silex application | [
"Register",
"the",
"database",
"adapter"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Db/DbServiceProvider.php#L22-L41 |
7,698 | synapsestudios/synapse-base | src/Synapse/Db/DbServiceProvider.php | DbServiceProvider.registerMapperInitializer | protected function registerMapperInitializer(Application $app)
{
$initializer = function ($mapper, $app) {
$mapper->setSqlFactory(new SqlFactory);
};
$app->initializer('Synapse\Mapper\AbstractMapper', $initializer);
} | php | protected function registerMapperInitializer(Application $app)
{
$initializer = function ($mapper, $app) {
$mapper->setSqlFactory(new SqlFactory);
};
$app->initializer('Synapse\Mapper\AbstractMapper', $initializer);
} | [
"protected",
"function",
"registerMapperInitializer",
"(",
"Application",
"$",
"app",
")",
"{",
"$",
"initializer",
"=",
"function",
"(",
"$",
"mapper",
",",
"$",
"app",
")",
"{",
"$",
"mapper",
"->",
"setSqlFactory",
"(",
"new",
"SqlFactory",
")",
";",
"}... | Register an initializer that injects a SQL Factory into all AbstractMappers
@param Application $app | [
"Register",
"an",
"initializer",
"that",
"injects",
"a",
"SQL",
"Factory",
"into",
"all",
"AbstractMappers"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Db/DbServiceProvider.php#L58-L65 |
7,699 | zepi/turbo-base | Zepi/Web/AccessControl/src/FilterHandler/RegisterGroupAccessLevels.php | RegisterGroupAccessLevels.execute | public function execute(Framework $framework, RequestAbstract $request, Response $response, $value = null)
{
$accessLevels = $value;
$dataRequest = new DataRequest(1, 0, 'name', 'ASC');
$groups = $this->groupManager->find($dataRequest);
if ($groups === false) {
... | php | public function execute(Framework $framework, RequestAbstract $request, Response $response, $value = null)
{
$accessLevels = $value;
$dataRequest = new DataRequest(1, 0, 'name', 'ASC');
$groups = $this->groupManager->find($dataRequest);
if ($groups === false) {
... | [
"public",
"function",
"execute",
"(",
"Framework",
"$",
"framework",
",",
"RequestAbstract",
"$",
"request",
",",
"Response",
"$",
"response",
",",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"accessLevels",
"=",
"$",
"value",
";",
"$",
"dataRequest",
"=",
... | Registers the groups as access levels.
@access public
@param \Zepi\Turbo\Framework $framework
@param \Zepi\Turbo\Request\RequestAbstract $request
@param \Zepi\Turbo\Response\Response $response
@param mixed $value
@return mixed | [
"Registers",
"the",
"groups",
"as",
"access",
"levels",
"."
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/AccessControl/src/FilterHandler/RegisterGroupAccessLevels.php#L99-L120 |
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.