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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
195,400 | PieterScheffers/arrr | src/Ar.php | Ar.type | public static function type($array)
{
$last_key = -1;
$type = 'index';
foreach( $array as $key => $val )
{
if( !is_int( $key ) || $key < 0 )
{
return 'assoc';
}
if( $type !== 'sparse' )
{
if( $key !== $last_key + 1 ){
... | php | public static function type($array)
{
$last_key = -1;
$type = 'index';
foreach( $array as $key => $val )
{
if( !is_int( $key ) || $key < 0 )
{
return 'assoc';
}
if( $type !== 'sparse' )
{
if( $key !== $last_key + 1 ){
... | [
"public",
"static",
"function",
"type",
"(",
"$",
"array",
")",
"{",
"$",
"last_key",
"=",
"-",
"1",
";",
"$",
"type",
"=",
"'index'",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",
"if",
"(",
"!",
"is_int",
"(... | Find whether the array is indexed or an associative array
If it is indexed, find if its sparse or not
@return string type of array (index, assoc, sparse) | [
"Find",
"whether",
"the",
"array",
"is",
"indexed",
"or",
"an",
"associative",
"array",
"If",
"it",
"is",
"indexed",
"find",
"if",
"its",
"sparse",
"or",
"not"
] | f920d911ae32641248131f1a510da287929cbd6e | https://github.com/PieterScheffers/arrr/blob/f920d911ae32641248131f1a510da287929cbd6e/src/Ar.php#L400-L422 |
195,401 | Vectrex/vxPHP | src/Session/NativeSessionStorage.php | NativeSessionStorage.start | public function start() {
if(!$this->started) {
// only non-CLI environments are supposed to provide sessions
if(PHP_SAPI !== 'cli') {
// avoid starting an already started session
if (
(PHP_VERSION_ID >= 50400 && session_status() === PHP_SESSION_ACTIVE) ||
(PHP_VERSION_ID < 50400 && s... | php | public function start() {
if(!$this->started) {
// only non-CLI environments are supposed to provide sessions
if(PHP_SAPI !== 'cli') {
// avoid starting an already started session
if (
(PHP_VERSION_ID >= 50400 && session_status() === PHP_SESSION_ACTIVE) ||
(PHP_VERSION_ID < 50400 && s... | [
"public",
"function",
"start",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"started",
")",
"{",
"// only non-CLI environments are supposed to provide sessions",
"if",
"(",
"PHP_SAPI",
"!==",
"'cli'",
")",
"{",
"// avoid starting an already started session",
"if"... | start session and load session data into SessionDataBag
@throws \RuntimeException | [
"start",
"session",
"and",
"load",
"session",
"data",
"into",
"SessionDataBag"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Session/NativeSessionStorage.php#L66-L97 |
195,402 | Vectrex/vxPHP | src/Session/NativeSessionStorage.php | NativeSessionStorage.setSaveHandler | private function setSaveHandler() {
if (PHP_VERSION_ID >= 50400) {
$this->storageEngine = new NativeSessionWrapper();
if(!session_set_save_handler($this->storageEngine, FALSE)) {
throw new \RuntimeException('Could not set session save handler.');
}
}
} | php | private function setSaveHandler() {
if (PHP_VERSION_ID >= 50400) {
$this->storageEngine = new NativeSessionWrapper();
if(!session_set_save_handler($this->storageEngine, FALSE)) {
throw new \RuntimeException('Could not set session save handler.');
}
}
} | [
"private",
"function",
"setSaveHandler",
"(",
")",
"{",
"if",
"(",
"PHP_VERSION_ID",
">=",
"50400",
")",
"{",
"$",
"this",
"->",
"storageEngine",
"=",
"new",
"NativeSessionWrapper",
"(",
")",
";",
"if",
"(",
"!",
"session_set_save_handler",
"(",
"$",
"this",... | set custom save handler for PHP 5.4+
@throws \RuntimeException | [
"set",
"custom",
"save",
"handler",
"for",
"PHP",
"5",
".",
"4",
"+"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Session/NativeSessionStorage.php#L119-L131 |
195,403 | jenskooij/cloudcontrol | src/storage/storage/RedirectsStorage.php | RedirectsStorage.getRedirects | public function getRedirects()
{
$redirects = $this->repository->redirects;
if ($redirects === null) {
$redirects = array();
}
usort($redirects, array($this, 'cmp'));
return $redirects;
} | php | public function getRedirects()
{
$redirects = $this->repository->redirects;
if ($redirects === null) {
$redirects = array();
}
usort($redirects, array($this, 'cmp'));
return $redirects;
} | [
"public",
"function",
"getRedirects",
"(",
")",
"{",
"$",
"redirects",
"=",
"$",
"this",
"->",
"repository",
"->",
"redirects",
";",
"if",
"(",
"$",
"redirects",
"===",
"null",
")",
"{",
"$",
"redirects",
"=",
"array",
"(",
")",
";",
"}",
"usort",
"(... | Get all redirects
@return mixed | [
"Get",
"all",
"redirects"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/storage/RedirectsStorage.php#L18-L26 |
195,404 | jenskooij/cloudcontrol | src/storage/storage/RedirectsStorage.php | RedirectsStorage.addRedirect | public function addRedirect($postValues)
{
$redirectObject = RedirectsFactory::createRedirectFromPostValues($postValues);
$redirects = $this->repository->redirects;
$redirects[] = $redirectObject;
$this->repository->redirects = $redirects;
$this->save();
} | php | public function addRedirect($postValues)
{
$redirectObject = RedirectsFactory::createRedirectFromPostValues($postValues);
$redirects = $this->repository->redirects;
$redirects[] = $redirectObject;
$this->repository->redirects = $redirects;
$this->save();
} | [
"public",
"function",
"addRedirect",
"(",
"$",
"postValues",
")",
"{",
"$",
"redirectObject",
"=",
"RedirectsFactory",
"::",
"createRedirectFromPostValues",
"(",
"$",
"postValues",
")",
";",
"$",
"redirects",
"=",
"$",
"this",
"->",
"repository",
"->",
"redirect... | Add a new redirect
@param $postValues | [
"Add",
"a",
"new",
"redirect"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/storage/RedirectsStorage.php#L32-L39 |
195,405 | jenskooij/cloudcontrol | src/storage/storage/RedirectsStorage.php | RedirectsStorage.getRedirectBySlug | public function getRedirectBySlug($slug)
{
$redirects = $this->repository->redirects;
foreach ($redirects as $redirect) {
if ($redirect->slug == $slug) {
return $redirect;
}
}
return null;
} | php | public function getRedirectBySlug($slug)
{
$redirects = $this->repository->redirects;
foreach ($redirects as $redirect) {
if ($redirect->slug == $slug) {
return $redirect;
}
}
return null;
} | [
"public",
"function",
"getRedirectBySlug",
"(",
"$",
"slug",
")",
"{",
"$",
"redirects",
"=",
"$",
"this",
"->",
"repository",
"->",
"redirects",
";",
"foreach",
"(",
"$",
"redirects",
"as",
"$",
"redirect",
")",
"{",
"if",
"(",
"$",
"redirect",
"->",
... | Get a redirect by it's slug
@param $slug
@return \stdClass|null | [
"Get",
"a",
"redirect",
"by",
"it",
"s",
"slug"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/storage/RedirectsStorage.php#L47-L57 |
195,406 | jenskooij/cloudcontrol | src/storage/storage/RedirectsStorage.php | RedirectsStorage.saveRedirect | public function saveRedirect($slug, $postValues)
{
$redirectObject = RedirectsFactory::createRedirectFromPostValues($postValues);
$redirects = $this->repository->redirects;
foreach ($redirects as $key => $redirect) {
if ($redirect->slug == $slug) {
$redirects[$ke... | php | public function saveRedirect($slug, $postValues)
{
$redirectObject = RedirectsFactory::createRedirectFromPostValues($postValues);
$redirects = $this->repository->redirects;
foreach ($redirects as $key => $redirect) {
if ($redirect->slug == $slug) {
$redirects[$ke... | [
"public",
"function",
"saveRedirect",
"(",
"$",
"slug",
",",
"$",
"postValues",
")",
"{",
"$",
"redirectObject",
"=",
"RedirectsFactory",
"::",
"createRedirectFromPostValues",
"(",
"$",
"postValues",
")",
";",
"$",
"redirects",
"=",
"$",
"this",
"->",
"reposit... | Save a redirect by it's slug
@param $slug
@param $postValues | [
"Save",
"a",
"redirect",
"by",
"it",
"s",
"slug"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/storage/RedirectsStorage.php#L64-L76 |
195,407 | jenskooij/cloudcontrol | src/storage/storage/RedirectsStorage.php | RedirectsStorage.deleteRedirectBySlug | public function deleteRedirectBySlug($slug)
{
$redirects = $this->repository->redirects;
foreach ($redirects as $key => $redirect) {
if ($redirect->slug == $slug) {
unset($redirects[$key]);
}
}
$redirects = array_values($redirects);
$th... | php | public function deleteRedirectBySlug($slug)
{
$redirects = $this->repository->redirects;
foreach ($redirects as $key => $redirect) {
if ($redirect->slug == $slug) {
unset($redirects[$key]);
}
}
$redirects = array_values($redirects);
$th... | [
"public",
"function",
"deleteRedirectBySlug",
"(",
"$",
"slug",
")",
"{",
"$",
"redirects",
"=",
"$",
"this",
"->",
"repository",
"->",
"redirects",
";",
"foreach",
"(",
"$",
"redirects",
"as",
"$",
"key",
"=>",
"$",
"redirect",
")",
"{",
"if",
"(",
"$... | Delete a redirect by it's slug
@param $slug | [
"Delete",
"a",
"redirect",
"by",
"it",
"s",
"slug"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/storage/RedirectsStorage.php#L82-L93 |
195,408 | Linkvalue-Interne/MajoraOAuthServerBundle | src/Majora/Bundle/OAuthServerBundle/DependencyInjection/Configuration.php | Configuration.createTokenNode | private function createTokenNode($tokenName, $defaultClass, $tokenInterface, $defaultTtl)
{
$builder = new TreeBuilder();
$node = $builder->root($tokenName);
$node
->addDefaultsIfNotSet()
->children()
->integerNode('ttl')
->defaultV... | php | private function createTokenNode($tokenName, $defaultClass, $tokenInterface, $defaultTtl)
{
$builder = new TreeBuilder();
$node = $builder->root($tokenName);
$node
->addDefaultsIfNotSet()
->children()
->integerNode('ttl')
->defaultV... | [
"private",
"function",
"createTokenNode",
"(",
"$",
"tokenName",
",",
"$",
"defaultClass",
",",
"$",
"tokenInterface",
",",
"$",
"defaultTtl",
")",
"{",
"$",
"builder",
"=",
"new",
"TreeBuilder",
"(",
")",
";",
"$",
"node",
"=",
"$",
"builder",
"->",
"ro... | Create a token configuration node.
@param string $tokenName
@param string $defaultClass
@param string $tokenInterface
@param string $defaultTtl
@return Node | [
"Create",
"a",
"token",
"configuration",
"node",
"."
] | 3e84e2494c947d1bd5d5c16221a3b9e343ebff92 | https://github.com/Linkvalue-Interne/MajoraOAuthServerBundle/blob/3e84e2494c947d1bd5d5c16221a3b9e343ebff92/src/Majora/Bundle/OAuthServerBundle/DependencyInjection/Configuration.php#L73-L106 |
195,409 | Gundars/HogLog | extra/PlanB.php | PlanB.isInsideJailDir | protected static function isInsideJailDir($path)
{
$jailDir = __DIR__ . '/' . self::$jailDir;
return strpos(realpath($path), realpath($jailDir)) !== false;
} | php | protected static function isInsideJailDir($path)
{
$jailDir = __DIR__ . '/' . self::$jailDir;
return strpos(realpath($path), realpath($jailDir)) !== false;
} | [
"protected",
"static",
"function",
"isInsideJailDir",
"(",
"$",
"path",
")",
"{",
"$",
"jailDir",
"=",
"__DIR__",
".",
"'/'",
".",
"self",
"::",
"$",
"jailDir",
";",
"return",
"strpos",
"(",
"realpath",
"(",
"$",
"path",
")",
",",
"realpath",
"(",
"$",... | Compare users selected path with jaildir path
@param string $path
@return bool | [
"Compare",
"users",
"selected",
"path",
"with",
"jaildir",
"path"
] | 3349f6db3dd3c1f7d334d5e2e44a0f241c76f8a3 | https://github.com/Gundars/HogLog/blob/3349f6db3dd3c1f7d334d5e2e44a0f241c76f8a3/extra/PlanB.php#L86-L90 |
195,410 | Gundars/HogLog | extra/PlanB.php | PlanB.isWhitelisted | protected static function isWhitelisted($file)
{
if (!is_array(self::$whitelist) || count(self::$whitelist) === 0) {
return true;
}
foreach (self::$whitelist as $fileName) {
if (strpos($file, $fileName)) {
return true;
}
}
r... | php | protected static function isWhitelisted($file)
{
if (!is_array(self::$whitelist) || count(self::$whitelist) === 0) {
return true;
}
foreach (self::$whitelist as $fileName) {
if (strpos($file, $fileName)) {
return true;
}
}
r... | [
"protected",
"static",
"function",
"isWhitelisted",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"self",
"::",
"$",
"whitelist",
")",
"||",
"count",
"(",
"self",
"::",
"$",
"whitelist",
")",
"===",
"0",
")",
"{",
"return",
"true",
";"... | Compare users selected filename against whitelist
@param string $file filename + extension
@return bool | [
"Compare",
"users",
"selected",
"filename",
"against",
"whitelist"
] | 3349f6db3dd3c1f7d334d5e2e44a0f241c76f8a3 | https://github.com/Gundars/HogLog/blob/3349f6db3dd3c1f7d334d5e2e44a0f241c76f8a3/extra/PlanB.php#L97-L108 |
195,411 | Gundars/HogLog | extra/PlanB.php | PlanB.parseUrl | protected static function parseUrl($url)
{
$url = isset($url) ? $url : "//$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$url = parse_url($url);
$url['browse'] = './';
if (array_key_exists('browse', self::$requestMethod)
&& !empty(self::$requestMethod['bro... | php | protected static function parseUrl($url)
{
$url = isset($url) ? $url : "//$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$url = parse_url($url);
$url['browse'] = './';
if (array_key_exists('browse', self::$requestMethod)
&& !empty(self::$requestMethod['bro... | [
"protected",
"static",
"function",
"parseUrl",
"(",
"$",
"url",
")",
"{",
"$",
"url",
"=",
"isset",
"(",
"$",
"url",
")",
"?",
"$",
"url",
":",
"\"//$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\"",
";",
"$",
"url",
"=",
"parse_url",
"(",
"$",
"url",
")",
";"... | Pare URL into array
@param $url string URL to parse, protocol is optional
@return array $url
["host" => "www.example.com",
"path" => "/path",
"query" => "name=value",
"browse" => "../app/storage/logs/"] | [
"Pare",
"URL",
"into",
"array"
] | 3349f6db3dd3c1f7d334d5e2e44a0f241c76f8a3 | https://github.com/Gundars/HogLog/blob/3349f6db3dd3c1f7d334d5e2e44a0f241c76f8a3/extra/PlanB.php#L175-L186 |
195,412 | wearenolte/wp-endpoints-static | src/StaticApi/Menus.php | Menus.get_all_locations | public static function get_all_locations() {
$menus = [];
$locations = get_nav_menu_locations();
foreach ( $locations as $location => $menu_id ) {
$menus[ $location ] = [];
$menu_items = wp_get_nav_menu_items( $menu_id );
$menu_items = is_array( $menu_items ) ? $menu_items : [];
foreach ( $menu_it... | php | public static function get_all_locations() {
$menus = [];
$locations = get_nav_menu_locations();
foreach ( $locations as $location => $menu_id ) {
$menus[ $location ] = [];
$menu_items = wp_get_nav_menu_items( $menu_id );
$menu_items = is_array( $menu_items ) ? $menu_items : [];
foreach ( $menu_it... | [
"public",
"static",
"function",
"get_all_locations",
"(",
")",
"{",
"$",
"menus",
"=",
"[",
"]",
";",
"$",
"locations",
"=",
"get_nav_menu_locations",
"(",
")",
";",
"foreach",
"(",
"$",
"locations",
"as",
"$",
"location",
"=>",
"$",
"menu_id",
")",
"{",... | Returns an array of menu locations, with the assigned menu in each.
@return array | [
"Returns",
"an",
"array",
"of",
"menu",
"locations",
"with",
"the",
"assigned",
"menu",
"in",
"each",
"."
] | 23258bba9b65d55b78b3dc3edc123d75009b0825 | https://github.com/wearenolte/wp-endpoints-static/blob/23258bba9b65d55b78b3dc3edc123d75009b0825/src/StaticApi/Menus.php#L14-L38 |
195,413 | Xiphe/THEDEBUG | src/Xiphe/THEDEBUG.php | THEDEBUG.getFirePHP | public static function getFirePHP($options = null)
{
if (!isset(self::$_FirePHP) || !empty($options)) {
if (!class_exists('\FirePHP')) {
throw new THEDEBUGException("FirePHP not available");
}
/* Start output buffer so we can debug after headers would be sent regular */
if (!isset(self::$_FirePHP)) ... | php | public static function getFirePHP($options = null)
{
if (!isset(self::$_FirePHP) || !empty($options)) {
if (!class_exists('\FirePHP')) {
throw new THEDEBUGException("FirePHP not available");
}
/* Start output buffer so we can debug after headers would be sent regular */
if (!isset(self::$_FirePHP)) ... | [
"public",
"static",
"function",
"getFirePHP",
"(",
"$",
"options",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"_FirePHP",
")",
"||",
"!",
"empty",
"(",
"$",
"options",
")",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",... | Retrieve an instance of FirePHP
@param array $options optional global options.
@return FirePHP | [
"Retrieve",
"an",
"instance",
"of",
"FirePHP"
] | 76983738a781cc495241672d57e7650aee57a2db | https://github.com/Xiphe/THEDEBUG/blob/76983738a781cc495241672d57e7650aee57a2db/src/Xiphe/THEDEBUG.php#L160-L179 |
195,414 | Xiphe/THEDEBUG | src/Xiphe/THEDEBUG.php | THEDEBUG.getChromePHP | public static function getChromePHP()
{
if (!isset(self::$_ChromePHP)) {
self::$_ChromePHP = X\THEDEBUG\ChromePhp::getInstance();
}
return self::$_ChromePHP;
} | php | public static function getChromePHP()
{
if (!isset(self::$_ChromePHP)) {
self::$_ChromePHP = X\THEDEBUG\ChromePhp::getInstance();
}
return self::$_ChromePHP;
} | [
"public",
"static",
"function",
"getChromePHP",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"_ChromePHP",
")",
")",
"{",
"self",
"::",
"$",
"_ChromePHP",
"=",
"X",
"\\",
"THEDEBUG",
"\\",
"ChromePhp",
"::",
"getInstance",
"(",
")",
... | Retrieve an instance of ChromePHP
@return Xiphe\THEDEBUG\ChromePHP | [
"Retrieve",
"an",
"instance",
"of",
"ChromePHP"
] | 76983738a781cc495241672d57e7650aee57a2db | https://github.com/Xiphe/THEDEBUG/blob/76983738a781cc495241672d57e7650aee57a2db/src/Xiphe/THEDEBUG.php#L186-L193 |
195,415 | Xiphe/THEDEBUG | src/Xiphe/THEDEBUG.php | THEDEBUG.debug | public static function debug($variable)
{
if (!self::$_enabled) {
return;
}
if (self::$ensureByGet && !isset($_GET['debug'])) {
return;
}
$debug = new THEDEBUG\ADEBUG(func_get_args());
$debug->put();
return $variable;
} | php | public static function debug($variable)
{
if (!self::$_enabled) {
return;
}
if (self::$ensureByGet && !isset($_GET['debug'])) {
return;
}
$debug = new THEDEBUG\ADEBUG(func_get_args());
$debug->put();
return $variable;
} | [
"public",
"static",
"function",
"debug",
"(",
"$",
"variable",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"_enabled",
")",
"{",
"return",
";",
"}",
"if",
"(",
"self",
"::",
"$",
"ensureByGet",
"&&",
"!",
"isset",
"(",
"$",
"_GET",
"[",
"'debug'",... | Create an ADEBUG object and put it.
@param mixed $variable the variable you want to debug.
@param mixed optional string for name/message, integer for type or array containing options
@param mixed optional same as above
@param integer backTraceOffset
@return mixed return the passed variab... | [
"Create",
"an",
"ADEBUG",
"object",
"and",
"put",
"it",
"."
] | 76983738a781cc495241672d57e7650aee57a2db | https://github.com/Xiphe/THEDEBUG/blob/76983738a781cc495241672d57e7650aee57a2db/src/Xiphe/THEDEBUG.php#L216-L230 |
195,416 | Xiphe/THEDEBUG | src/Xiphe/THEDEBUG.php | THEDEBUG.diebug | public static function diebug()
{
if (!self::$_enabled) {
return;
}
if (self::$ensureByGet && !isset($_GET['debug'])) {
return;
}
$args = func_get_args();
$debug = new THEDEBUG\ADEBUG($args);
/* don't debug if no arguments were passed */
if (!empty($args)) {
$debug->put();
}
/* Add ... | php | public static function diebug()
{
if (!self::$_enabled) {
return;
}
if (self::$ensureByGet && !isset($_GET['debug'])) {
return;
}
$args = func_get_args();
$debug = new THEDEBUG\ADEBUG($args);
/* don't debug if no arguments were passed */
if (!empty($args)) {
$debug->put();
}
/* Add ... | [
"public",
"static",
"function",
"diebug",
"(",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"_enabled",
")",
"{",
"return",
";",
"}",
"if",
"(",
"self",
"::",
"$",
"ensureByGet",
"&&",
"!",
"isset",
"(",
"$",
"_GET",
"[",
"'debug'",
"]",
")",
")"... | The "Killer", debug the passed variable die!
@param mixed $variable optional the variable you want to debug.
@param mixed optional string for name/message, integer for type or array containing options
@param mixed optional same as above
@param integer backTraceOffset
@return void | [
"The",
"Killer",
"debug",
"the",
"passed",
"variable",
"die!"
] | 76983738a781cc495241672d57e7650aee57a2db | https://github.com/Xiphe/THEDEBUG/blob/76983738a781cc495241672d57e7650aee57a2db/src/Xiphe/THEDEBUG.php#L242-L270 |
195,417 | Xiphe/THEDEBUG | src/Xiphe/THEDEBUG.php | THEDEBUG.getDebugObject | public static function getDebugObject($variable)
{
if (!self::$_enabled) {
return;
}
if (self::$ensureByGet && !isset($_GET['debug'])) {
return;
}
return new THEDEBUG\ADEBUG(func_get_args());
} | php | public static function getDebugObject($variable)
{
if (!self::$_enabled) {
return;
}
if (self::$ensureByGet && !isset($_GET['debug'])) {
return;
}
return new THEDEBUG\ADEBUG(func_get_args());
} | [
"public",
"static",
"function",
"getDebugObject",
"(",
"$",
"variable",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"_enabled",
")",
"{",
"return",
";",
"}",
"if",
"(",
"self",
"::",
"$",
"ensureByGet",
"&&",
"!",
"isset",
"(",
"$",
"_GET",
"[",
"... | Just return the ADEBUG instance for later usage.
@param mixed $variable
@param mixed optional string for name/message, integer for type or array containing options
@param mixed optional same as above
@param integer backTraceOffset
@return ADEBUG | [
"Just",
"return",
"the",
"ADEBUG",
"instance",
"for",
"later",
"usage",
"."
] | 76983738a781cc495241672d57e7650aee57a2db | https://github.com/Xiphe/THEDEBUG/blob/76983738a781cc495241672d57e7650aee57a2db/src/Xiphe/THEDEBUG.php#L282-L293 |
195,418 | Xiphe/THEDEBUG | src/Xiphe/THEDEBUG.php | THEDEBUG.deprecate | public static function deprecate($alternative = '', $continue = true)
{
if (!self::$_enabled) {
return;
}
if (self::$ensureByGet && !isset($_GET['debug'])) {
return;
}
$debug = new THEDEBUG\ADEBUG();
/* Get the deprecated method/function name */
$scope = $debug->getScope();
/* You can not dep... | php | public static function deprecate($alternative = '', $continue = true)
{
if (!self::$_enabled) {
return;
}
if (self::$ensureByGet && !isset($_GET['debug'])) {
return;
}
$debug = new THEDEBUG\ADEBUG();
/* Get the deprecated method/function name */
$scope = $debug->getScope();
/* You can not dep... | [
"public",
"static",
"function",
"deprecate",
"(",
"$",
"alternative",
"=",
"''",
",",
"$",
"continue",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"_enabled",
")",
"{",
"return",
";",
"}",
"if",
"(",
"self",
"::",
"$",
"ensureByGet",
... | Flag a function as deprecated by placing this method inside it.
@param string $alternative an alternative function that should be used instead.
@param boolean $continue true to die
@return void | [
"Flag",
"a",
"function",
"as",
"deprecated",
"by",
"placing",
"this",
"method",
"inside",
"it",
"."
] | 76983738a781cc495241672d57e7650aee57a2db | https://github.com/Xiphe/THEDEBUG/blob/76983738a781cc495241672d57e7650aee57a2db/src/Xiphe/THEDEBUG.php#L303-L356 |
195,419 | Xiphe/THEDEBUG | src/Xiphe/THEDEBUG.php | THEDEBUG.count | public static function count($message = '') {
if (!self::$_enabled) {
return;
}
if (self::$ensureByGet && !isset($_GET['debug'])) {
return;
}
/* Get a new ADEBUG object */
$debug = new THEDEBUG\ADEBUG(array(1));
/* And its ID (calculated using file and line) */
$ID = $debug->getID();
/*
*... | php | public static function count($message = '') {
if (!self::$_enabled) {
return;
}
if (self::$ensureByGet && !isset($_GET['debug'])) {
return;
}
/* Get a new ADEBUG object */
$debug = new THEDEBUG\ADEBUG(array(1));
/* And its ID (calculated using file and line) */
$ID = $debug->getID();
/*
*... | [
"public",
"static",
"function",
"count",
"(",
"$",
"message",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"_enabled",
")",
"{",
"return",
";",
"}",
"if",
"(",
"self",
"::",
"$",
"ensureByGet",
"&&",
"!",
"isset",
"(",
"$",
"_GET",
"["... | Count how often this line is visited and put the debug at the end of the script.
@param string $message optional message
@return void | [
"Count",
"how",
"often",
"this",
"line",
"is",
"visited",
"and",
"put",
"the",
"debug",
"at",
"the",
"end",
"of",
"the",
"script",
"."
] | 76983738a781cc495241672d57e7650aee57a2db | https://github.com/Xiphe/THEDEBUG/blob/76983738a781cc495241672d57e7650aee57a2db/src/Xiphe/THEDEBUG.php#L365-L415 |
195,420 | Wedeto/HTTP | src/FileUpload.php | FileUpload.traverse | private static function traverse($name, $type, $tmp_name, $error, $size, Dictionary $dict, $path)
{
if (is_array($name))
{
$keys = array_keys($name);
foreach ($keys as $key)
{
$new_path = $path;
$new_path[] = $key;
i... | php | private static function traverse($name, $type, $tmp_name, $error, $size, Dictionary $dict, $path)
{
if (is_array($name))
{
$keys = array_keys($name);
foreach ($keys as $key)
{
$new_path = $path;
$new_path[] = $key;
i... | [
"private",
"static",
"function",
"traverse",
"(",
"$",
"name",
",",
"$",
"type",
",",
"$",
"tmp_name",
",",
"$",
"error",
",",
"$",
"size",
",",
"Dictionary",
"$",
"dict",
",",
"$",
"path",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"name",
")",
... | Helper function to recursively traverse the uploaded files array.
@param array|string $name The name
@param array|string $type The content-type
@param array|string $tmp_name The temporary file name
@param array|int $size The file size
@param Dictionary $dict The dictionary where to store the files
@param array $path Th... | [
"Helper",
"function",
"to",
"recursively",
"traverse",
"the",
"uploaded",
"files",
"array",
"."
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/FileUpload.php#L247-L277 |
195,421 | zewadesign/framework | Zewa/Router.php | Router.baseURL | public function baseURL($path = '')
{
if (is_null($this->baseURL)) {
$self = $_SERVER['PHP_SELF'];
$server = $_SERVER['HTTP_HOST']
. rtrim(str_replace(strstr($self, 'index.php'), '', $self), '/');
if ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] ... | php | public function baseURL($path = '')
{
if (is_null($this->baseURL)) {
$self = $_SERVER['PHP_SELF'];
$server = $_SERVER['HTTP_HOST']
. rtrim(str_replace(strstr($self, 'index.php'), '', $self), '/');
if ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] ... | [
"public",
"function",
"baseURL",
"(",
"$",
"path",
"=",
"''",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"baseURL",
")",
")",
"{",
"$",
"self",
"=",
"$",
"_SERVER",
"[",
"'PHP_SELF'",
"]",
";",
"$",
"server",
"=",
"$",
"_SERVER",
"["... | Return the baseURL
@access public
@return string http://tld.com | [
"Return",
"the",
"baseURL"
] | be74e41c674ac2c2ef924752ed310cfbaafe33b8 | https://github.com/zewadesign/framework/blob/be74e41c674ac2c2ef924752ed310cfbaafe33b8/Zewa/Router.php#L167-L193 |
195,422 | SlabPHP/controllers | src/Redirect.php | Redirect.determineRedirectURL | protected function determineRedirectURL()
{
$this->redirectURL = trim($this->getRoutedParameter('url'));
if (empty($this->redirectURL))
{
$this->setNotReady("Invalid or missing redirect `url` parameter.", null, 404);
}
} | php | protected function determineRedirectURL()
{
$this->redirectURL = trim($this->getRoutedParameter('url'));
if (empty($this->redirectURL))
{
$this->setNotReady("Invalid or missing redirect `url` parameter.", null, 404);
}
} | [
"protected",
"function",
"determineRedirectURL",
"(",
")",
"{",
"$",
"this",
"->",
"redirectURL",
"=",
"trim",
"(",
"$",
"this",
"->",
"getRoutedParameter",
"(",
"'url'",
")",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"redirectURL",
")",
")",... | Determine redirect url | [
"Determine",
"redirect",
"url"
] | a1c4fded0265100a85904dd664b972a7f8687652 | https://github.com/SlabPHP/controllers/blob/a1c4fded0265100a85904dd664b972a7f8687652/src/Redirect.php#L49-L57 |
195,423 | SlabPHP/controllers | src/Redirect.php | Redirect.determineRedirectType | protected function determineRedirectType()
{
$this->redirectType = intval($this->getRoutedParameter('type', $this->redirectType));
if (!in_array($this->redirectType, [301, 302]))
{
$this->setNotReady("Invalid redirect type specified.", null, 404);
}
} | php | protected function determineRedirectType()
{
$this->redirectType = intval($this->getRoutedParameter('type', $this->redirectType));
if (!in_array($this->redirectType, [301, 302]))
{
$this->setNotReady("Invalid redirect type specified.", null, 404);
}
} | [
"protected",
"function",
"determineRedirectType",
"(",
")",
"{",
"$",
"this",
"->",
"redirectType",
"=",
"intval",
"(",
"$",
"this",
"->",
"getRoutedParameter",
"(",
"'type'",
",",
"$",
"this",
"->",
"redirectType",
")",
")",
";",
"if",
"(",
"!",
"in_array... | Determine redirect type | [
"Determine",
"redirect",
"type"
] | a1c4fded0265100a85904dd664b972a7f8687652 | https://github.com/SlabPHP/controllers/blob/a1c4fded0265100a85904dd664b972a7f8687652/src/Redirect.php#L70-L78 |
195,424 | SlabPHP/controllers | src/Redirect.php | Redirect.validateRedirectURL | protected function validateRedirectURL()
{
if (!filter_var($this->redirectURL, FILTER_VALIDATE_URL)) {
// Not a full URL
if (!preg_match('#^/[a-zA-Z0-9_/.-]*#', $this->redirectURL)) {
// Not a valid path either
$this->setNotReady("Invalid redirect URL ... | php | protected function validateRedirectURL()
{
if (!filter_var($this->redirectURL, FILTER_VALIDATE_URL)) {
// Not a full URL
if (!preg_match('#^/[a-zA-Z0-9_/.-]*#', $this->redirectURL)) {
// Not a valid path either
$this->setNotReady("Invalid redirect URL ... | [
"protected",
"function",
"validateRedirectURL",
"(",
")",
"{",
"if",
"(",
"!",
"filter_var",
"(",
"$",
"this",
"->",
"redirectURL",
",",
"FILTER_VALIDATE_URL",
")",
")",
"{",
"// Not a full URL",
"if",
"(",
"!",
"preg_match",
"(",
"'#^/[a-zA-Z0-9_/.-]*#'",
",",
... | Validate redirect URL | [
"Validate",
"redirect",
"URL"
] | a1c4fded0265100a85904dd664b972a7f8687652 | https://github.com/SlabPHP/controllers/blob/a1c4fded0265100a85904dd664b972a7f8687652/src/Redirect.php#L92-L102 |
195,425 | SlabPHP/controllers | src/Redirect.php | Redirect.buildOutputObject | protected function buildOutputObject()
{
$output = new \Slab\Controllers\Response(
static::DEFAULT_REDIRECT_RESOLVER,
$this->data,
$this->redirectType,
$this->displayHeaders
);
return $output;
} | php | protected function buildOutputObject()
{
$output = new \Slab\Controllers\Response(
static::DEFAULT_REDIRECT_RESOLVER,
$this->data,
$this->redirectType,
$this->displayHeaders
);
return $output;
} | [
"protected",
"function",
"buildOutputObject",
"(",
")",
"{",
"$",
"output",
"=",
"new",
"\\",
"Slab",
"\\",
"Controllers",
"\\",
"Response",
"(",
"static",
"::",
"DEFAULT_REDIRECT_RESOLVER",
",",
"$",
"this",
"->",
"data",
",",
"$",
"this",
"->",
"redirectTy... | Build the output object
@return \Slab\Components\Output\ControllerResponseInterface|Response | [
"Build",
"the",
"output",
"object"
] | a1c4fded0265100a85904dd664b972a7f8687652 | https://github.com/SlabPHP/controllers/blob/a1c4fded0265100a85904dd664b972a7f8687652/src/Redirect.php#L135-L145 |
195,426 | hschletz/NADA | src/Factory.php | Factory.getDatabase | static function getDatabase($link)
{
// Determine the database abstraction layer
if ($link instanceof \PDO) {
$class = 'Pdo';
} elseif ($link instanceof \Zend\Db\Adapter\Adapter) {
$class = 'ZendDb2';
} elseif ($link instanceof \Zend_Db_Adapter_Abstract) {
... | php | static function getDatabase($link)
{
// Determine the database abstraction layer
if ($link instanceof \PDO) {
$class = 'Pdo';
} elseif ($link instanceof \Zend\Db\Adapter\Adapter) {
$class = 'ZendDb2';
} elseif ($link instanceof \Zend_Db_Adapter_Abstract) {
... | [
"static",
"function",
"getDatabase",
"(",
"$",
"link",
")",
"{",
"// Determine the database abstraction layer",
"if",
"(",
"$",
"link",
"instanceof",
"\\",
"PDO",
")",
"{",
"$",
"class",
"=",
"'Pdo'",
";",
"}",
"elseif",
"(",
"$",
"link",
"instanceof",
"\\",... | Factory method to create database interface
See class description for usage example.
@param mixed $link Database link
@return \Nada\Database\AbstractDatabase NADA interface
@throws \InvalidArgumentException if no supported DBAL is detected | [
"Factory",
"method",
"to",
"create",
"database",
"interface"
] | 4ead798354089fd360f917ce64dd1432d5650df0 | https://github.com/hschletz/NADA/blob/4ead798354089fd360f917ce64dd1432d5650df0/src/Factory.php#L55-L77 |
195,427 | horntell/php-sdk | lib/guzzle/GuzzleHttp/Post/PostFile.php | PostFile.prepareContent | private function prepareContent($content)
{
$this->content = $content;
if (!($this->content instanceof StreamInterface)) {
$this->content = Stream::factory($this->content);
} elseif ($this->content instanceof MultipartBody) {
if (!$this->hasHeader('Content-Dispositio... | php | private function prepareContent($content)
{
$this->content = $content;
if (!($this->content instanceof StreamInterface)) {
$this->content = Stream::factory($this->content);
} elseif ($this->content instanceof MultipartBody) {
if (!$this->hasHeader('Content-Dispositio... | [
"private",
"function",
"prepareContent",
"(",
"$",
"content",
")",
"{",
"$",
"this",
"->",
"content",
"=",
"$",
"content",
";",
"if",
"(",
"!",
"(",
"$",
"this",
"->",
"content",
"instanceof",
"StreamInterface",
")",
")",
"{",
"$",
"this",
"->",
"conte... | Prepares the contents of a POST file.
@param mixed $content Content of the POST file | [
"Prepares",
"the",
"contents",
"of",
"a",
"POST",
"file",
"."
] | e5205e9396a21b754d5651a8aa5898da5922a1b7 | https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Post/PostFile.php#L66-L85 |
195,428 | horntell/php-sdk | lib/guzzle/GuzzleHttp/Post/PostFile.php | PostFile.prepareDefaultHeaders | private function prepareDefaultHeaders()
{
// Set a default content-disposition header if one was no provided
if (!$this->hasHeader('Content-Disposition')) {
$this->headers['Content-Disposition'] = sprintf(
'form-data; name="%s"; filename="%s"',
$this->nam... | php | private function prepareDefaultHeaders()
{
// Set a default content-disposition header if one was no provided
if (!$this->hasHeader('Content-Disposition')) {
$this->headers['Content-Disposition'] = sprintf(
'form-data; name="%s"; filename="%s"',
$this->nam... | [
"private",
"function",
"prepareDefaultHeaders",
"(",
")",
"{",
"// Set a default content-disposition header if one was no provided",
"if",
"(",
"!",
"$",
"this",
"->",
"hasHeader",
"(",
"'Content-Disposition'",
")",
")",
"{",
"$",
"this",
"->",
"headers",
"[",
"'Conte... | Applies default Content-Disposition and Content-Type headers if needed. | [
"Applies",
"default",
"Content",
"-",
"Disposition",
"and",
"Content",
"-",
"Type",
"headers",
"if",
"needed",
"."
] | e5205e9396a21b754d5651a8aa5898da5922a1b7 | https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Post/PostFile.php#L110-L126 |
195,429 | hiqdev/hidev-license | src/components/License.php | License.getLicense | public function getLicense()
{
if ($this->_license === null) {
$this->_license = $this->take('package')->getLicense();
}
return $this->_license;
} | php | public function getLicense()
{
if ($this->_license === null) {
$this->_license = $this->take('package')->getLicense();
}
return $this->_license;
} | [
"public",
"function",
"getLicense",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_license",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_license",
"=",
"$",
"this",
"->",
"take",
"(",
"'package'",
")",
"->",
"getLicense",
"(",
")",
";",
"}",
"ret... | Get license.
@return string | [
"Get",
"license",
"."
] | 99069ad17eb6d82a500ec2c2ecf1533a957c6a41 | https://github.com/hiqdev/hidev-license/blob/99069ad17eb6d82a500ec2c2ecf1533a957c6a41/src/components/License.php#L39-L46 |
195,430 | phossa/phossa-route | src/Phossa/Route/Route.php | Route.extractDefaultValues | protected function extractDefaultValues(
/*# string */ $pattern
)/*# : string */ {
$regex = '~\{([a-zA-Z][a-zA-Z0-9_]*+)[^\}]*(=[a-zA-Z0-9._]++)\}~';
if (preg_match_all($regex, $pattern, $matches, \PREG_SET_ORDER)) {
$srch = $repl = $vals = [];
foreach ($matches as $m... | php | protected function extractDefaultValues(
/*# string */ $pattern
)/*# : string */ {
$regex = '~\{([a-zA-Z][a-zA-Z0-9_]*+)[^\}]*(=[a-zA-Z0-9._]++)\}~';
if (preg_match_all($regex, $pattern, $matches, \PREG_SET_ORDER)) {
$srch = $repl = $vals = [];
foreach ($matches as $m... | [
"protected",
"function",
"extractDefaultValues",
"(",
"/*# string */",
"$",
"pattern",
")",
"/*# : string */",
"{",
"$",
"regex",
"=",
"'~\\{([a-zA-Z][a-zA-Z0-9_]*+)[^\\}]*(=[a-zA-Z0-9._]++)\\}~'",
";",
"if",
"(",
"preg_match_all",
"(",
"$",
"regex",
",",
"$",
"pattern"... | Extract default values from the pattern
@param string $pattern
@return string
@access protected | [
"Extract",
"default",
"values",
"from",
"the",
"pattern"
] | fdcc1c814b8b1692a60d433d3c085e6c7a923acc | https://github.com/phossa/phossa-route/blob/fdcc1c814b8b1692a60d433d3c085e6c7a923acc/src/Phossa/Route/Route.php#L195-L210 |
195,431 | vukbgit/PHPCraft.Subject | src/Traits/Template.php | Template.setCommonTemplateParameters | private function setCommonTemplateParameters()
{
$this->setTemplateParameter('application', APPLICATION);
$this->setTemplateParameter('area', AREA);
$this->setTemplateParameter('subject', $this->name);
$this->setTemplateParameter('language', LANGUAGE);
$this->setTemplateParam... | php | private function setCommonTemplateParameters()
{
$this->setTemplateParameter('application', APPLICATION);
$this->setTemplateParameter('area', AREA);
$this->setTemplateParameter('subject', $this->name);
$this->setTemplateParameter('language', LANGUAGE);
$this->setTemplateParam... | [
"private",
"function",
"setCommonTemplateParameters",
"(",
")",
"{",
"$",
"this",
"->",
"setTemplateParameter",
"(",
"'application'",
",",
"APPLICATION",
")",
";",
"$",
"this",
"->",
"setTemplateParameter",
"(",
"'area'",
",",
"AREA",
")",
";",
"$",
"this",
"-... | Sets common template parameters | [
"Sets",
"common",
"template",
"parameters"
] | a43ad7868098ff1e7bda6819547ea64f9a853732 | https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/Template.php#L72-L86 |
195,432 | vukbgit/PHPCraft.Subject | src/Traits/Template.php | Template.buildTemplateFunctions | protected function buildTemplateFunctions()
{
//path to area
$this->templateEngine->addFunction('pathToArea', function ($language = false) {
return implode('/', $this->buildPathToArea($language)) . '/';
});
//path to subject
$this->templateEngine->addFunction('pat... | php | protected function buildTemplateFunctions()
{
//path to area
$this->templateEngine->addFunction('pathToArea', function ($language = false) {
return implode('/', $this->buildPathToArea($language)) . '/';
});
//path to subject
$this->templateEngine->addFunction('pat... | [
"protected",
"function",
"buildTemplateFunctions",
"(",
")",
"{",
"//path to area",
"$",
"this",
"->",
"templateEngine",
"->",
"addFunction",
"(",
"'pathToArea'",
",",
"function",
"(",
"$",
"language",
"=",
"false",
")",
"{",
"return",
"implode",
"(",
"'/'",
"... | Builds functions used into templates | [
"Builds",
"functions",
"used",
"into",
"templates"
] | a43ad7868098ff1e7bda6819547ea64f9a853732 | https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/Template.php#L100-L118 |
195,433 | vukbgit/PHPCraft.Subject | src/Traits/Template.php | Template.renderTemplate | protected function renderTemplate($path = false)
{
if(!$this->templateEngine) {
throw new \Exception('template engine not injected');
}
if(!$path) {
$path = sprintf('%s/%s/%s', AREA, $this->name, $this->action);
}
$this->setCommonTemplateParameters();
... | php | protected function renderTemplate($path = false)
{
if(!$this->templateEngine) {
throw new \Exception('template engine not injected');
}
if(!$path) {
$path = sprintf('%s/%s/%s', AREA, $this->name, $this->action);
}
$this->setCommonTemplateParameters();
... | [
"protected",
"function",
"renderTemplate",
"(",
"$",
"path",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"templateEngine",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'template engine not injected'",
")",
";",
"}",
"if",
"(",
"!",
"... | Renders template and writes output to HTTP stream
@param string $path;
@return string HTML content | [
"Renders",
"template",
"and",
"writes",
"output",
"to",
"HTTP",
"stream"
] | a43ad7868098ff1e7bda6819547ea64f9a853732 | https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/Template.php#L125-L137 |
195,434 | inc2734/wp-page-speed-optimization | src/App/Controller/LazyLoad.php | LazyLoad._async_attachment_images | public function _async_attachment_images( $atts, $attachment, $size ) {
if ( ! $this->_is_async_attachment_images() ) {
return $atts;
}
$atts['data-src'] = $atts['src'];
$atts['src'] = wp_get_attachment_image_url( $attachment->ID, 'wppso-minimum-thumbnail' );
if ( isset( $atts['srcset'] ) ) {
$at... | php | public function _async_attachment_images( $atts, $attachment, $size ) {
if ( ! $this->_is_async_attachment_images() ) {
return $atts;
}
$atts['data-src'] = $atts['src'];
$atts['src'] = wp_get_attachment_image_url( $attachment->ID, 'wppso-minimum-thumbnail' );
if ( isset( $atts['srcset'] ) ) {
$at... | [
"public",
"function",
"_async_attachment_images",
"(",
"$",
"atts",
",",
"$",
"attachment",
",",
"$",
"size",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_is_async_attachment_images",
"(",
")",
")",
"{",
"return",
"$",
"atts",
";",
"}",
"$",
"atts",
... | Aync loading of attachment images
@param array $atts
@param WP_Post $attachment
@param string|array $size
@return array | [
"Aync",
"loading",
"of",
"attachment",
"images"
] | 219963582b592eef4bde6cdd4ed1cf0dc71a6114 | https://github.com/inc2734/wp-page-speed-optimization/blob/219963582b592eef4bde6cdd4ed1cf0dc71a6114/src/App/Controller/LazyLoad.php#L91-L106 |
195,435 | inc2734/wp-page-speed-optimization | src/App/Controller/LazyLoad.php | LazyLoad._async_content_images | public function _async_content_images( $content ) {
if ( ! $this->_is_async_content_images() ) {
return $content;
}
if ( ! preg_match_all( '/<img [^>]+>/', $content, $matches ) ) {
return $content;
}
$selected_images = [];
foreach ( $matches[0] as $image ) {
if ( false === strpos( $image, ' decod... | php | public function _async_content_images( $content ) {
if ( ! $this->_is_async_content_images() ) {
return $content;
}
if ( ! preg_match_all( '/<img [^>]+>/', $content, $matches ) ) {
return $content;
}
$selected_images = [];
foreach ( $matches[0] as $image ) {
if ( false === strpos( $image, ' decod... | [
"public",
"function",
"_async_content_images",
"(",
"$",
"content",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_is_async_content_images",
"(",
")",
")",
"{",
"return",
"$",
"content",
";",
"}",
"if",
"(",
"!",
"preg_match_all",
"(",
"'/<img [^>]+>/'",
"... | Aync loading of content images
@param string $content
@return string | [
"Aync",
"loading",
"of",
"content",
"images"
] | 219963582b592eef4bde6cdd4ed1cf0dc71a6114 | https://github.com/inc2734/wp-page-speed-optimization/blob/219963582b592eef4bde6cdd4ed1cf0dc71a6114/src/App/Controller/LazyLoad.php#L114-L141 |
195,436 | inc2734/wp-page-speed-optimization | src/App/Controller/LazyLoad.php | LazyLoad._add_data_src_to_content_image | protected function _add_data_src_to_content_image( $image, $image_id ) {
return preg_replace_callback(
'@(<img decoding="async"[^>]*?) src="([^"]+?)"([^>]*?>)@m',
function( $matches ) use ( $image_id ) {
return sprintf(
'%s src="%s" data-src="%s" %s',
$matches[1],
wp_get_attachment_image_url(... | php | protected function _add_data_src_to_content_image( $image, $image_id ) {
return preg_replace_callback(
'@(<img decoding="async"[^>]*?) src="([^"]+?)"([^>]*?>)@m',
function( $matches ) use ( $image_id ) {
return sprintf(
'%s src="%s" data-src="%s" %s',
$matches[1],
wp_get_attachment_image_url(... | [
"protected",
"function",
"_add_data_src_to_content_image",
"(",
"$",
"image",
",",
"$",
"image_id",
")",
"{",
"return",
"preg_replace_callback",
"(",
"'@(<img decoding=\"async\"[^>]*?) src=\"([^\"]+?)\"([^>]*?>)@m'",
",",
"function",
"(",
"$",
"matches",
")",
"use",
"(",
... | Add data-src to content image
@param string $image
@param int $image_id
@return string | [
"Add",
"data",
"-",
"src",
"to",
"content",
"image"
] | 219963582b592eef4bde6cdd4ed1cf0dc71a6114 | https://github.com/inc2734/wp-page-speed-optimization/blob/219963582b592eef4bde6cdd4ed1cf0dc71a6114/src/App/Controller/LazyLoad.php#L160-L174 |
195,437 | inc2734/wp-page-speed-optimization | src/App/Controller/LazyLoad.php | LazyLoad._add_data_srcset_to_content_image | protected function _add_data_srcset_to_content_image( $image, $image_id ) {
return preg_replace_callback(
'@(<img decoding="async"[^>]*?)srcset="([^"]+?)"([^>]*?>)@m',
function( $matches ) use ( $image_id ) {
return sprintf(
'%s srcset="" data-srcset="%s" %s',
$matches[1],
$matches[2],
$... | php | protected function _add_data_srcset_to_content_image( $image, $image_id ) {
return preg_replace_callback(
'@(<img decoding="async"[^>]*?)srcset="([^"]+?)"([^>]*?>)@m',
function( $matches ) use ( $image_id ) {
return sprintf(
'%s srcset="" data-srcset="%s" %s',
$matches[1],
$matches[2],
$... | [
"protected",
"function",
"_add_data_srcset_to_content_image",
"(",
"$",
"image",
",",
"$",
"image_id",
")",
"{",
"return",
"preg_replace_callback",
"(",
"'@(<img decoding=\"async\"[^>]*?)srcset=\"([^\"]+?)\"([^>]*?>)@m'",
",",
"function",
"(",
"$",
"matches",
")",
"use",
... | Add data-srcset to content image
@param string $image
@param int $image_id
@return string | [
"Add",
"data",
"-",
"srcset",
"to",
"content",
"image"
] | 219963582b592eef4bde6cdd4ed1cf0dc71a6114 | https://github.com/inc2734/wp-page-speed-optimization/blob/219963582b592eef4bde6cdd4ed1cf0dc71a6114/src/App/Controller/LazyLoad.php#L183-L196 |
195,438 | Wedeto/HTTP | src/Forms/Binder.php | Binder.createFormForModel | public function createFormForModel(string $classname, DAO $dao)
{
if (!is_a($classname, Model::class, true))
throw new \InvalidArgumentException("Not a valid Model class provided");
$form = new Form($classname);
$refl = new ReflectionClass($classname);
$fields = $this->g... | php | public function createFormForModel(string $classname, DAO $dao)
{
if (!is_a($classname, Model::class, true))
throw new \InvalidArgumentException("Not a valid Model class provided");
$form = new Form($classname);
$refl = new ReflectionClass($classname);
$fields = $this->g... | [
"public",
"function",
"createFormForModel",
"(",
"string",
"$",
"classname",
",",
"DAO",
"$",
"dao",
")",
"{",
"if",
"(",
"!",
"is_a",
"(",
"$",
"classname",
",",
"Model",
"::",
"class",
",",
"true",
")",
")",
"throw",
"new",
"\\",
"InvalidArgumentExcept... | Create a form based on a database model
@param string $classname The name of the Model class
@param DAO $dao The DAO that provides more information about the class | [
"Create",
"a",
"form",
"based",
"on",
"a",
"database",
"model"
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Forms/Binder.php#L56-L91 |
195,439 | Wedeto/HTTP | src/Forms/Binder.php | Binder.createFormForObject | public function createFormForObject(string $formclass)
{
if (!is_a($formclass, BaseForm::class, true))
throw new \InvalidArgumentException("Not a valid BaseForm class provided");
$form = new Form($formclass);
$refl = new \ReflectionClass($formclass);
$field_validators ... | php | public function createFormForObject(string $formclass)
{
if (!is_a($formclass, BaseForm::class, true))
throw new \InvalidArgumentException("Not a valid BaseForm class provided");
$form = new Form($formclass);
$refl = new \ReflectionClass($formclass);
$field_validators ... | [
"public",
"function",
"createFormForObject",
"(",
"string",
"$",
"formclass",
")",
"{",
"if",
"(",
"!",
"is_a",
"(",
"$",
"formclass",
",",
"BaseForm",
"::",
"class",
",",
"true",
")",
")",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"Not a vali... | Create a form using reflection on a POPO.
The class is inspected for public properties. All properties that have
annotations in doc comments are used in the form, unless they have an
ignore annotation.
Supported annations are @var to provide the type. When @var is array,
you need to specify the type of the elements i... | [
"Create",
"a",
"form",
"using",
"reflection",
"on",
"a",
"POPO",
"."
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Forms/Binder.php#L119-L134 |
195,440 | Wedeto/HTTP | src/Forms/Binder.php | Binder.addFormValidators | protected function addFormValidators(ReflectionClass $refl, array $additional_validators, Form $form)
{
$classdoc = $refl->getDocComment();
if (!empty($classdoc))
{
$classdoc = new DocComment($classdoc);
foreach ($classdoc->getAnnotations('validator') as $validator)
... | php | protected function addFormValidators(ReflectionClass $refl, array $additional_validators, Form $form)
{
$classdoc = $refl->getDocComment();
if (!empty($classdoc))
{
$classdoc = new DocComment($classdoc);
foreach ($classdoc->getAnnotations('validator') as $validator)
... | [
"protected",
"function",
"addFormValidators",
"(",
"ReflectionClass",
"$",
"refl",
",",
"array",
"$",
"additional_validators",
",",
"Form",
"$",
"form",
")",
"{",
"$",
"classdoc",
"=",
"$",
"refl",
"->",
"getDocComment",
"(",
")",
";",
"if",
"(",
"!",
"emp... | Add validators for the whole form
@param ReflectionClass The reflection class to get validators from
@param array $additional_validators Validators to add
@param Form $form The form to add the validators to | [
"Add",
"validators",
"for",
"the",
"whole",
"form"
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Forms/Binder.php#L143-L162 |
195,441 | Wedeto/HTTP | src/Forms/Binder.php | Binder.getAnnotatedFields | protected function getAnnotatedFields(ReflectionClass $class, array $field_validators)
{
$properties = $class->getProperties(ReflectionProperty::IS_PUBLIC);
$fields = [];
foreach ($properties as $prop)
{
$name = $prop->getName();
$comment = $prop->get... | php | protected function getAnnotatedFields(ReflectionClass $class, array $field_validators)
{
$properties = $class->getProperties(ReflectionProperty::IS_PUBLIC);
$fields = [];
foreach ($properties as $prop)
{
$name = $prop->getName();
$comment = $prop->get... | [
"protected",
"function",
"getAnnotatedFields",
"(",
"ReflectionClass",
"$",
"class",
",",
"array",
"$",
"field_validators",
")",
"{",
"$",
"properties",
"=",
"$",
"class",
"->",
"getProperties",
"(",
"ReflectionProperty",
"::",
"IS_PUBLIC",
")",
";",
"$",
"field... | Iterate over all properties and add their values to the form
@param ReflectionClass $class The class to extract properties from
@param array $field_validator Additional validators | [
"Iterate",
"over",
"all",
"properties",
"and",
"add",
"their",
"values",
"to",
"the",
"form"
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Forms/Binder.php#L170-L230 |
195,442 | Wedeto/HTTP | src/Forms/Binder.php | Binder.bindValue | protected function bindValue(FormElement $element, ReflectionClass $refl, $instance)
{
$name = $element->getName(true);
if (substr($name, 0, 1) === "_")
return;
$value = $element->getValue();
$method_name = "set" . strtoupper(substr($name, 0, 1)) . substr($name, 1);
... | php | protected function bindValue(FormElement $element, ReflectionClass $refl, $instance)
{
$name = $element->getName(true);
if (substr($name, 0, 1) === "_")
return;
$value = $element->getValue();
$method_name = "set" . strtoupper(substr($name, 0, 1)) . substr($name, 1);
... | [
"protected",
"function",
"bindValue",
"(",
"FormElement",
"$",
"element",
",",
"ReflectionClass",
"$",
"refl",
",",
"$",
"instance",
")",
"{",
"$",
"name",
"=",
"$",
"element",
"->",
"getName",
"(",
"true",
")",
";",
"if",
"(",
"substr",
"(",
"$",
"nam... | Set a value from a form to an instance of a class
@param FormElement $element The element containing the value
@param ReflectionClass $refl The ReflectionClass of the object being set
@param object $instance The object being set | [
"Set",
"a",
"value",
"from",
"a",
"form",
"to",
"an",
"instance",
"of",
"a",
"class"
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Forms/Binder.php#L393-L427 |
195,443 | PatrolServer/patrolsdk-php | lib/HttpClient.php | HttpClient.buildUrl | private function buildUrl($path) {
$key = $this->patrol->getApiKey();
$secret = $this->patrol->getApiSecret();
$base = $this->patrol->apiBase;
$url = $base . '/' . $path . '?key=' . $key . '&secret=' . $secret;
if ($this->method === "get" && !is_null($this->payload)) {
... | php | private function buildUrl($path) {
$key = $this->patrol->getApiKey();
$secret = $this->patrol->getApiSecret();
$base = $this->patrol->apiBase;
$url = $base . '/' . $path . '?key=' . $key . '&secret=' . $secret;
if ($this->method === "get" && !is_null($this->payload)) {
... | [
"private",
"function",
"buildUrl",
"(",
"$",
"path",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"patrol",
"->",
"getApiKey",
"(",
")",
";",
"$",
"secret",
"=",
"$",
"this",
"->",
"patrol",
"->",
"getApiSecret",
"(",
")",
";",
"$",
"base",
"=",
... | Takes a path and builds the URL with the given key and secret
@param string $path | [
"Takes",
"a",
"path",
"and",
"builds",
"the",
"URL",
"with",
"the",
"given",
"key",
"and",
"secret"
] | 2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2 | https://github.com/PatrolServer/patrolsdk-php/blob/2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2/lib/HttpClient.php#L44-L65 |
195,444 | MinyFramework/Miny-Core | src/Utils/StringUtils.php | StringUtils.compare | public static function compare($known, $user)
{
if (strlen($known) !== strlen($user)) {
return false;
}
$result = 0;
$knownLength = strlen($known);
for ($i = 0; $i < $knownLength; $i++) {
$result |= ord($known[$i]) ^ ord($user[$i]);
}
... | php | public static function compare($known, $user)
{
if (strlen($known) !== strlen($user)) {
return false;
}
$result = 0;
$knownLength = strlen($known);
for ($i = 0; $i < $knownLength; $i++) {
$result |= ord($known[$i]) ^ ord($user[$i]);
}
... | [
"public",
"static",
"function",
"compare",
"(",
"$",
"known",
",",
"$",
"user",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"known",
")",
"!==",
"strlen",
"(",
"$",
"user",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"result",
"=",
"0",
";",
... | Compares two strings securely.
@link http://blog.astrumfutura.com/2010/10/nanosecond-scale-remote-timing-attacks-on-php-applications-time-to-take-them-seriously/ Implementation source
@param string $known
@param string $user
@return boolean | [
"Compares",
"two",
"strings",
"securely",
"."
] | a1bfe801a44a49cf01f16411cb4663473e9c827c | https://github.com/MinyFramework/Miny-Core/blob/a1bfe801a44a49cf01f16411cb4663473e9c827c/src/Utils/StringUtils.php#L30-L42 |
195,445 | ammarfaizi2/icetea-framework | src/System/Crayner.php | Crayner._run | public function _run()
{
if (defined("NOT_FOUND")) {
(new Controller())->load->error(404);
}
if (Configer::manualRoute()) {
$router = Router::getInstance($this->segments);
Configer::loadRoutes();
try {
if ($action = $router->run... | php | public function _run()
{
if (defined("NOT_FOUND")) {
(new Controller())->load->error(404);
}
if (Configer::manualRoute()) {
$router = Router::getInstance($this->segments);
Configer::loadRoutes();
try {
if ($action = $router->run... | [
"public",
"function",
"_run",
"(",
")",
"{",
"if",
"(",
"defined",
"(",
"\"NOT_FOUND\"",
")",
")",
"{",
"(",
"new",
"Controller",
"(",
")",
")",
"->",
"load",
"->",
"error",
"(",
"404",
")",
";",
"}",
"if",
"(",
"Configer",
"::",
"manualRoute",
"("... | Here we go... | [
"Here",
"we",
"go",
"..."
] | dedd832846c3e69b429b18b8612fae50881af180 | https://github.com/ammarfaizi2/icetea-framework/blob/dedd832846c3e69b429b18b8612fae50881af180/src/System/Crayner.php#L71-L109 |
195,446 | Linkvalue-Interne/MajoraFrameworkExtraBundle | src/Majora/Framework/Domain/Action/DynamicActionTrait.php | DynamicActionTrait.setIfDefined | protected function setIfDefined($object, $field)
{
$propertyAccessor = $this->getPropertyAccessor();
if (!$this->_has($field)) {
return $propertyAccessor->isReadable($object, $field) ?
$propertyAccessor->getValue($object, $field) :
null
;
... | php | protected function setIfDefined($object, $field)
{
$propertyAccessor = $this->getPropertyAccessor();
if (!$this->_has($field)) {
return $propertyAccessor->isReadable($object, $field) ?
$propertyAccessor->getValue($object, $field) :
null
;
... | [
"protected",
"function",
"setIfDefined",
"(",
"$",
"object",
",",
"$",
"field",
")",
"{",
"$",
"propertyAccessor",
"=",
"$",
"this",
"->",
"getPropertyAccessor",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"_has",
"(",
"$",
"field",
")",
")",
"... | Define given field on given object, if accessible
@param mixed $object
@param string $field
@return mixed|null | [
"Define",
"given",
"field",
"on",
"given",
"object",
"if",
"accessible"
] | 6f368380cfc39d27fafb0844e9a53b4d86d7c034 | https://github.com/Linkvalue-Interne/MajoraFrameworkExtraBundle/blob/6f368380cfc39d27fafb0844e9a53b4d86d7c034/src/Majora/Framework/Domain/Action/DynamicActionTrait.php#L125-L142 |
195,447 | Danack/Jig | src/Jig/Converter/ParsedTemplate.php | ParsedTemplate.addLocalVariable | public function addLocalVariable($localVariable)
{
$varName = $localVariable;
if (strpos($varName, '$') === 0) {
$varName = substr($localVariable, 1);
}
if (in_array($varName, $this->localVariables) === false) {
$this->localVariables[] = $varName;
}
... | php | public function addLocalVariable($localVariable)
{
$varName = $localVariable;
if (strpos($varName, '$') === 0) {
$varName = substr($localVariable, 1);
}
if (in_array($varName, $this->localVariables) === false) {
$this->localVariables[] = $varName;
}
... | [
"public",
"function",
"addLocalVariable",
"(",
"$",
"localVariable",
")",
"{",
"$",
"varName",
"=",
"$",
"localVariable",
";",
"if",
"(",
"strpos",
"(",
"$",
"varName",
",",
"'$'",
")",
"===",
"0",
")",
"{",
"$",
"varName",
"=",
"substr",
"(",
"$",
"... | Add a local variable so that any usage of it doesn't
trigger trying to fetch it from the ViewModel
@param $localVariable | [
"Add",
"a",
"local",
"variable",
"so",
"that",
"any",
"usage",
"of",
"it",
"doesn",
"t",
"trigger",
"trying",
"to",
"fetch",
"it",
"from",
"the",
"ViewModel"
] | b11106bc7d634add9873bf246eda1dadb059ed7a | https://github.com/Danack/Jig/blob/b11106bc7d634add9873bf246eda1dadb059ed7a/src/Jig/Converter/ParsedTemplate.php#L198-L209 |
195,448 | Danack/Jig | src/Jig/Converter/ParsedTemplate.php | ParsedTemplate.getNamespace | public static function getNamespace($namespaceClass)
{
if (is_object($namespaceClass) === true) {
$namespaceClass = get_class($namespaceClass);
}
$lastSlashPosition = mb_strrpos($namespaceClass, '\\');
if ($lastSlashPosition !== false) {
return mb_su... | php | public static function getNamespace($namespaceClass)
{
if (is_object($namespaceClass) === true) {
$namespaceClass = get_class($namespaceClass);
}
$lastSlashPosition = mb_strrpos($namespaceClass, '\\');
if ($lastSlashPosition !== false) {
return mb_su... | [
"public",
"static",
"function",
"getNamespace",
"(",
"$",
"namespaceClass",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"namespaceClass",
")",
"===",
"true",
")",
"{",
"$",
"namespaceClass",
"=",
"get_class",
"(",
"$",
"namespaceClass",
")",
";",
"}",
"$",... | Get the name space part of a fully namespaced class. Returns empty string
if the class had no namespace part.
@param $namespaceClass
@return string | [
"Get",
"the",
"name",
"space",
"part",
"of",
"a",
"fully",
"namespaced",
"class",
".",
"Returns",
"empty",
"string",
"if",
"the",
"class",
"had",
"no",
"namespace",
"part",
"."
] | b11106bc7d634add9873bf246eda1dadb059ed7a | https://github.com/Danack/Jig/blob/b11106bc7d634add9873bf246eda1dadb059ed7a/src/Jig/Converter/ParsedTemplate.php#L562-L575 |
195,449 | Danack/Jig | src/Jig/Converter/ParsedTemplate.php | ParsedTemplate.getClassName | public static function getClassName($namespaceClass)
{
$lastSlashPosition = mb_strrpos($namespaceClass, '\\');
if ($lastSlashPosition !== false) {
return mb_substr($namespaceClass, $lastSlashPosition + 1);
}
return $namespaceClass;
} | php | public static function getClassName($namespaceClass)
{
$lastSlashPosition = mb_strrpos($namespaceClass, '\\');
if ($lastSlashPosition !== false) {
return mb_substr($namespaceClass, $lastSlashPosition + 1);
}
return $namespaceClass;
} | [
"public",
"static",
"function",
"getClassName",
"(",
"$",
"namespaceClass",
")",
"{",
"$",
"lastSlashPosition",
"=",
"mb_strrpos",
"(",
"$",
"namespaceClass",
",",
"'\\\\'",
")",
";",
"if",
"(",
"$",
"lastSlashPosition",
"!==",
"false",
")",
"{",
"return",
"... | Get the class part of a fully namespaced class name
@param $namespaceClass
@return string | [
"Get",
"the",
"class",
"part",
"of",
"a",
"fully",
"namespaced",
"class",
"name"
] | b11106bc7d634add9873bf246eda1dadb059ed7a | https://github.com/Danack/Jig/blob/b11106bc7d634add9873bf246eda1dadb059ed7a/src/Jig/Converter/ParsedTemplate.php#L591-L600 |
195,450 | Danack/Jig | src/Jig/Converter/ParsedTemplate.php | ParsedTemplate.ensureDirectoryExists | public function ensureDirectoryExists($outputFilename)
{
$directoryName = dirname($outputFilename);
@mkdir($directoryName, 0755, true);
//TODO - double-check umask
if (file_exists($directoryName) === false) {
throw new JigException("Directory $directoryName ... | php | public function ensureDirectoryExists($outputFilename)
{
$directoryName = dirname($outputFilename);
@mkdir($directoryName, 0755, true);
//TODO - double-check umask
if (file_exists($directoryName) === false) {
throw new JigException("Directory $directoryName ... | [
"public",
"function",
"ensureDirectoryExists",
"(",
"$",
"outputFilename",
")",
"{",
"$",
"directoryName",
"=",
"dirname",
"(",
"$",
"outputFilename",
")",
";",
"@",
"mkdir",
"(",
"$",
"directoryName",
",",
"0755",
",",
"true",
")",
";",
"//TODO - double-check... | ensureDirectoryExists by creating it with 0755 permissions and throwing
an exception if it does not exst after that mkdir call.
@param $outputFilename
@throws JigException | [
"ensureDirectoryExists",
"by",
"creating",
"it",
"with",
"0755",
"permissions",
"and",
"throwing",
"an",
"exception",
"if",
"it",
"does",
"not",
"exst",
"after",
"that",
"mkdir",
"call",
"."
] | b11106bc7d634add9873bf246eda1dadb059ed7a | https://github.com/Danack/Jig/blob/b11106bc7d634add9873bf246eda1dadb059ed7a/src/Jig/Converter/ParsedTemplate.php#L608-L618 |
195,451 | wb-crowdfusion/crowdfusion | system/core/classes/mvc/filters/SlugsFilterer.php | SlugsFilterer.create | public function create()
{
$slug = $this->getParameter('value');
$allowSlashes = StringUtils::strToBool($this->getParameter('allowSlashes'));
return SlugUtils::createSlug($slug,$allowSlashes);
} | php | public function create()
{
$slug = $this->getParameter('value');
$allowSlashes = StringUtils::strToBool($this->getParameter('allowSlashes'));
return SlugUtils::createSlug($slug,$allowSlashes);
} | [
"public",
"function",
"create",
"(",
")",
"{",
"$",
"slug",
"=",
"$",
"this",
"->",
"getParameter",
"(",
"'value'",
")",
";",
"$",
"allowSlashes",
"=",
"StringUtils",
"::",
"strToBool",
"(",
"$",
"this",
"->",
"getParameter",
"(",
"'allowSlashes'",
")",
... | Returns a slug for the specified parameter
Expected Parameters:
value string The string to turn into a slug
@return string | [
"Returns",
"a",
"slug",
"for",
"the",
"specified",
"parameter"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/filters/SlugsFilterer.php#L42-L48 |
195,452 | PenoaksDev/Milky-Framework | src/Milky/Mail/MailerServiceResolver.php | MailerServiceResolver.mailer | public function mailer()
{
if ( is_null( $this->mailerInstance ) )
{
// Once we have create the mailer instance, we will set a container instance
// on the mailer. This allows us to resolve mailer classes via containers
// for maximum testability on said classes instead of passing Closures.
$mailer = n... | php | public function mailer()
{
if ( is_null( $this->mailerInstance ) )
{
// Once we have create the mailer instance, we will set a container instance
// on the mailer. This allows us to resolve mailer classes via containers
// for maximum testability on said classes instead of passing Closures.
$mailer = n... | [
"public",
"function",
"mailer",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"mailerInstance",
")",
")",
"{",
"// Once we have create the mailer instance, we will set a container instance",
"// on the mailer. This allows us to resolve mailer classes via containers... | mailer.mailer | [
"mailer",
".",
"mailer"
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Mail/MailerServiceResolver.php#L30-L59 |
195,453 | dms-org/common.structure | src/Table/Form/Builder/TableCellClassDefiner.php | TableCellClassDefiner.withDataCell | public function withDataCell(string $tableDataCellClassName) : TableColumnFieldDefiner
{
if (!is_subclass_of($tableDataCellClassName, TableDataCell::class, true)) {
throw InvalidArgumentException::format(
'Invalid class supplied to %s: expecting subclass of %s, %s given',
... | php | public function withDataCell(string $tableDataCellClassName) : TableColumnFieldDefiner
{
if (!is_subclass_of($tableDataCellClassName, TableDataCell::class, true)) {
throw InvalidArgumentException::format(
'Invalid class supplied to %s: expecting subclass of %s, %s given',
... | [
"public",
"function",
"withDataCell",
"(",
"string",
"$",
"tableDataCellClassName",
")",
":",
"TableColumnFieldDefiner",
"{",
"if",
"(",
"!",
"is_subclass_of",
"(",
"$",
"tableDataCellClassName",
",",
"TableDataCell",
"::",
"class",
",",
"true",
")",
")",
"{",
"... | Defines the cell class for the table.
@see TableDataCell
@param string $tableDataCellClassName
@return TableColumnFieldDefiner
@throws InvalidArgumentException | [
"Defines",
"the",
"cell",
"class",
"for",
"the",
"table",
"."
] | 23f122182f60df5ec847047a81a39c8aab019ff1 | https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/Table/Form/Builder/TableCellClassDefiner.php#L41-L51 |
195,454 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/caching/interfaces/SystemCache.php | SystemCache.put | public function put($key, $value, $duration, $localOnly = false)
{
return parent::put($key, $value, $this->cacheExpiration);
} | php | public function put($key, $value, $duration, $localOnly = false)
{
return parent::put($key, $value, $this->cacheExpiration);
} | [
"public",
"function",
"put",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"duration",
",",
"$",
"localOnly",
"=",
"false",
")",
"{",
"return",
"parent",
"::",
"put",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"this",
"->",
"cacheExpiration",
")... | Writes the cache value to all of our cache stores
@param string $key The cache key to store
@param string $value The value of the cache item
@return boolean True | [
"Writes",
"the",
"cache",
"value",
"to",
"all",
"of",
"our",
"cache",
"stores"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/caching/interfaces/SystemCache.php#L87-L90 |
195,455 | ingro/Rest | src/Ingruz/Rest/Models/RestModel.php | RestModel.boot | public static function boot()
{
parent::boot();
self::saving(function($model)
{
return $model->beforeSave();
});
self::saved(function($model)
{
return $model->afterSave();
});
self::deleting(function($model)
{
... | php | public static function boot()
{
parent::boot();
self::saving(function($model)
{
return $model->beforeSave();
});
self::saved(function($model)
{
return $model->afterSave();
});
self::deleting(function($model)
{
... | [
"public",
"static",
"function",
"boot",
"(",
")",
"{",
"parent",
"::",
"boot",
"(",
")",
";",
"self",
"::",
"saving",
"(",
"function",
"(",
"$",
"model",
")",
"{",
"return",
"$",
"model",
"->",
"beforeSave",
"(",
")",
";",
"}",
")",
";",
"self",
... | Setup the model events | [
"Setup",
"the",
"model",
"events"
] | 922bed071b8ea41feb067d97a3e283f944a86cb8 | https://github.com/ingro/Rest/blob/922bed071b8ea41feb067d97a3e283f944a86cb8/src/Ingruz/Rest/Models/RestModel.php#L90-L113 |
195,456 | ingro/Rest | src/Ingruz/Rest/Models/RestModel.php | RestModel.save | public function save(array $options = array(), $force = false)
{
if ( $force || $this->validate() )
{
return $this->performSave($options);
} else
{
return false;
}
} | php | public function save(array $options = array(), $force = false)
{
if ( $force || $this->validate() )
{
return $this->performSave($options);
} else
{
return false;
}
} | [
"public",
"function",
"save",
"(",
"array",
"$",
"options",
"=",
"array",
"(",
")",
",",
"$",
"force",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"force",
"||",
"$",
"this",
"->",
"validate",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"perform... | Persist the model to the DB if it's valid
@param array $options
@param boolean $force
@return boolean | [
"Persist",
"the",
"model",
"to",
"the",
"DB",
"if",
"it",
"s",
"valid"
] | 922bed071b8ea41feb067d97a3e283f944a86cb8 | https://github.com/ingro/Rest/blob/922bed071b8ea41feb067d97a3e283f944a86cb8/src/Ingruz/Rest/Models/RestModel.php#L142-L151 |
195,457 | ingro/Rest | src/Ingruz/Rest/Models/RestModel.php | RestModel.performSave | protected function performSave(array $options) {
$this->purgeAttributes();
$this->saved = true;
return parent::save($options);
} | php | protected function performSave(array $options) {
$this->purgeAttributes();
$this->saved = true;
return parent::save($options);
} | [
"protected",
"function",
"performSave",
"(",
"array",
"$",
"options",
")",
"{",
"$",
"this",
"->",
"purgeAttributes",
"(",
")",
";",
"$",
"this",
"->",
"saved",
"=",
"true",
";",
"return",
"parent",
"::",
"save",
"(",
"$",
"options",
")",
";",
"}"
] | Save the model on the database
@param array $options
@return boolean | [
"Save",
"the",
"model",
"on",
"the",
"database"
] | 922bed071b8ea41feb067d97a3e283f944a86cb8 | https://github.com/ingro/Rest/blob/922bed071b8ea41feb067d97a3e283f944a86cb8/src/Ingruz/Rest/Models/RestModel.php#L233-L240 |
195,458 | ingro/Rest | src/Ingruz/Rest/Models/RestModel.php | RestModel.validate | protected function validate()
{
$rules = $this->mergeRules();
if ( empty($rules) ) return true;
$data = $this->attributes;
$validator = Validator::make($data, $rules);
$success = $validator->passes();
if ( $success )
{
if ( $this->validationErr... | php | protected function validate()
{
$rules = $this->mergeRules();
if ( empty($rules) ) return true;
$data = $this->attributes;
$validator = Validator::make($data, $rules);
$success = $validator->passes();
if ( $success )
{
if ( $this->validationErr... | [
"protected",
"function",
"validate",
"(",
")",
"{",
"$",
"rules",
"=",
"$",
"this",
"->",
"mergeRules",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"rules",
")",
")",
"return",
"true",
";",
"$",
"data",
"=",
"$",
"this",
"->",
"attributes",
";",
... | Validate the model by the defined rules
@throws \Ingruz\Rest\Exceptions\ValidationErrorException
@return boolean | [
"Validate",
"the",
"model",
"by",
"the",
"defined",
"rules"
] | 922bed071b8ea41feb067d97a3e283f944a86cb8 | https://github.com/ingro/Rest/blob/922bed071b8ea41feb067d97a3e283f944a86cb8/src/Ingruz/Rest/Models/RestModel.php#L248-L274 |
195,459 | ingro/Rest | src/Ingruz/Rest/Models/RestModel.php | RestModel.mergeRules | private function mergeRules()
{
$rules = static::$rules;
$output = array();
if (empty ($rules))
{
return $output;
}
if ($this->exists)
{
$merged = (isset($rules['update'])) ? array_merge_recursive($rules['save'], $rules['update']) : $... | php | private function mergeRules()
{
$rules = static::$rules;
$output = array();
if (empty ($rules))
{
return $output;
}
if ($this->exists)
{
$merged = (isset($rules['update'])) ? array_merge_recursive($rules['save'], $rules['update']) : $... | [
"private",
"function",
"mergeRules",
"(",
")",
"{",
"$",
"rules",
"=",
"static",
"::",
"$",
"rules",
";",
"$",
"output",
"=",
"array",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"rules",
")",
")",
"{",
"return",
"$",
"output",
";",
"}",
"if",
... | Return a single array with the rules for the action required
@return array | [
"Return",
"a",
"single",
"array",
"with",
"the",
"rules",
"for",
"the",
"action",
"required"
] | 922bed071b8ea41feb067d97a3e283f944a86cb8 | https://github.com/ingro/Rest/blob/922bed071b8ea41feb067d97a3e283f944a86cb8/src/Ingruz/Rest/Models/RestModel.php#L323-L353 |
195,460 | ingro/Rest | src/Ingruz/Rest/Models/RestModel.php | RestModel.purgeAttributes | protected function purgeAttributes()
{
$attributes = $this->getPurgeAttributes();
if ( ! empty($attributes) )
{
foreach ( $attributes as $attribute )
{
unset($this->attributes[$attribute]);
}
}
} | php | protected function purgeAttributes()
{
$attributes = $this->getPurgeAttributes();
if ( ! empty($attributes) )
{
foreach ( $attributes as $attribute )
{
unset($this->attributes[$attribute]);
}
}
} | [
"protected",
"function",
"purgeAttributes",
"(",
")",
"{",
"$",
"attributes",
"=",
"$",
"this",
"->",
"getPurgeAttributes",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"attributes",
")",
")",
"{",
"foreach",
"(",
"$",
"attributes",
"as",
"$",
"at... | Purge the attributes that are not a field on the database table to prevent error during the save | [
"Purge",
"the",
"attributes",
"that",
"are",
"not",
"a",
"field",
"on",
"the",
"database",
"table",
"to",
"prevent",
"error",
"during",
"the",
"save"
] | 922bed071b8ea41feb067d97a3e283f944a86cb8 | https://github.com/ingro/Rest/blob/922bed071b8ea41feb067d97a3e283f944a86cb8/src/Ingruz/Rest/Models/RestModel.php#L358-L369 |
195,461 | gplcart/backup | models/Backup.php | Backup.getList | public function getList(array $data = array())
{
$sql = 'SELECT b.*, u.name AS user_name';
if (!empty($data['count'])) {
$sql = 'SELECT COUNT(b.backup_id)';
}
$sql .= ' FROM backup b
LEFT JOIN user u ON(b.user_id = u.user_id)
WHERE b.... | php | public function getList(array $data = array())
{
$sql = 'SELECT b.*, u.name AS user_name';
if (!empty($data['count'])) {
$sql = 'SELECT COUNT(b.backup_id)';
}
$sql .= ' FROM backup b
LEFT JOIN user u ON(b.user_id = u.user_id)
WHERE b.... | [
"public",
"function",
"getList",
"(",
"array",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"$",
"sql",
"=",
"'SELECT b.*, u.name AS user_name'",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"data",
"[",
"'count'",
"]",
")",
")",
"{",
"$",
"sql",
"=",
... | Returns an array of backups or counts them
@param array $data
@return array|integer | [
"Returns",
"an",
"array",
"of",
"backups",
"or",
"counts",
"them"
] | 5838e2f47f0bb8c2e18b6697e20bec5682b71393 | https://github.com/gplcart/backup/blob/5838e2f47f0bb8c2e18b6697e20bec5682b71393/models/Backup.php#L69-L128 |
195,462 | gplcart/backup | models/Backup.php | Backup.add | public function add(array $data)
{
$result = null;
$this->hook->attach('module.backup.add.before', $data, $result, $this);
if (isset($result)) {
return $result;
}
$version = null;
if (isset($data['version'])) {
$version = $data['version'];
... | php | public function add(array $data)
{
$result = null;
$this->hook->attach('module.backup.add.before', $data, $result, $this);
if (isset($result)) {
return $result;
}
$version = null;
if (isset($data['version'])) {
$version = $data['version'];
... | [
"public",
"function",
"add",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"result",
"=",
"null",
";",
"$",
"this",
"->",
"hook",
"->",
"attach",
"(",
"'module.backup.add.before'",
",",
"$",
"data",
",",
"$",
"result",
",",
"$",
"this",
")",
";",
"if",
... | Adds a backup to the database
@param array $data
@return boolean|integer | [
"Adds",
"a",
"backup",
"to",
"the",
"database"
] | 5838e2f47f0bb8c2e18b6697e20bec5682b71393 | https://github.com/gplcart/backup/blob/5838e2f47f0bb8c2e18b6697e20bec5682b71393/models/Backup.php#L135-L162 |
195,463 | gplcart/backup | models/Backup.php | Backup.delete | public function delete($id)
{
$result = null;
$this->hook->attach('module.backup.delete.before', $id, $this);
if (isset($result)) {
return $result;
}
$result = $this->deleteZip($id);
if ($result) {
$this->db->delete('backup', array('backup_i... | php | public function delete($id)
{
$result = null;
$this->hook->attach('module.backup.delete.before', $id, $this);
if (isset($result)) {
return $result;
}
$result = $this->deleteZip($id);
if ($result) {
$this->db->delete('backup', array('backup_i... | [
"public",
"function",
"delete",
"(",
"$",
"id",
")",
"{",
"$",
"result",
"=",
"null",
";",
"$",
"this",
"->",
"hook",
"->",
"attach",
"(",
"'module.backup.delete.before'",
",",
"$",
"id",
",",
"$",
"this",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"r... | Deletes a backup from disk and database
@param integer $id
@return boolean | [
"Deletes",
"a",
"backup",
"from",
"disk",
"and",
"database"
] | 5838e2f47f0bb8c2e18b6697e20bec5682b71393 | https://github.com/gplcart/backup/blob/5838e2f47f0bb8c2e18b6697e20bec5682b71393/models/Backup.php#L180-L197 |
195,464 | gplcart/backup | models/Backup.php | Backup.deleteZip | protected function deleteZip($backup_id)
{
$backup = $this->get($backup_id);
if (empty($backup['path'])) {
return false;
}
$file = gplcart_file_absolute($backup['path']);
return file_exists($file) && unlink($file);
} | php | protected function deleteZip($backup_id)
{
$backup = $this->get($backup_id);
if (empty($backup['path'])) {
return false;
}
$file = gplcart_file_absolute($backup['path']);
return file_exists($file) && unlink($file);
} | [
"protected",
"function",
"deleteZip",
"(",
"$",
"backup_id",
")",
"{",
"$",
"backup",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"backup_id",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"backup",
"[",
"'path'",
"]",
")",
")",
"{",
"return",
"false",
";",... | Deletes a backup ZIP archive
@param integer $backup_id
@return boolean | [
"Deletes",
"a",
"backup",
"ZIP",
"archive"
] | 5838e2f47f0bb8c2e18b6697e20bec5682b71393 | https://github.com/gplcart/backup/blob/5838e2f47f0bb8c2e18b6697e20bec5682b71393/models/Backup.php#L204-L214 |
195,465 | gplcart/backup | models/Backup.php | Backup.exists | public function exists($id, $version = null)
{
$list = $this->getList(array('id' => $id, 'version' => $version));
return !empty($list);
} | php | public function exists($id, $version = null)
{
$list = $this->getList(array('id' => $id, 'version' => $version));
return !empty($list);
} | [
"public",
"function",
"exists",
"(",
"$",
"id",
",",
"$",
"version",
"=",
"null",
")",
"{",
"$",
"list",
"=",
"$",
"this",
"->",
"getList",
"(",
"array",
"(",
"'id'",
"=>",
"$",
"id",
",",
"'version'",
"=>",
"$",
"version",
")",
")",
";",
"return... | Whether a backup already exists
@param string $id
@param null|string $version
@return bool | [
"Whether",
"a",
"backup",
"already",
"exists"
] | 5838e2f47f0bb8c2e18b6697e20bec5682b71393 | https://github.com/gplcart/backup/blob/5838e2f47f0bb8c2e18b6697e20bec5682b71393/models/Backup.php#L244-L248 |
195,466 | gplcart/backup | models/Backup.php | Backup.callHandler | protected function callHandler($handler_id, $method, array $arguments)
{
try {
$handlers = $this->getHandlers();
return Handler::call($handlers, $handler_id, $method, $arguments);
} catch (Exception $ex) {
return $ex->getMessage();
}
} | php | protected function callHandler($handler_id, $method, array $arguments)
{
try {
$handlers = $this->getHandlers();
return Handler::call($handlers, $handler_id, $method, $arguments);
} catch (Exception $ex) {
return $ex->getMessage();
}
} | [
"protected",
"function",
"callHandler",
"(",
"$",
"handler_id",
",",
"$",
"method",
",",
"array",
"$",
"arguments",
")",
"{",
"try",
"{",
"$",
"handlers",
"=",
"$",
"this",
"->",
"getHandlers",
"(",
")",
";",
"return",
"Handler",
"::",
"call",
"(",
"$"... | Cal a handler
@param string $handler_id
@param string $method
@param array $arguments
@return mixed | [
"Cal",
"a",
"handler"
] | 5838e2f47f0bb8c2e18b6697e20bec5682b71393 | https://github.com/gplcart/backup/blob/5838e2f47f0bb8c2e18b6697e20bec5682b71393/models/Backup.php#L285-L293 |
195,467 | Talesoft/tale-framework | src/Tale/Debug/Snapshot.php | Snapshot.diff | public function diff( Snapshot $other ) {
return new self(
$this->_time - $other->getTime(),
$this->_memoryUsage - $other->getMemoryUsage(),
$this->_realMemoryUsage - $other->getRealMemoryUsage(),
( $this->_memoryUsagePeak + $other->getMemoryUsagePeak() ) / 2,
( $this->_realMemoryUsagePeak + $other->g... | php | public function diff( Snapshot $other ) {
return new self(
$this->_time - $other->getTime(),
$this->_memoryUsage - $other->getMemoryUsage(),
$this->_realMemoryUsage - $other->getRealMemoryUsage(),
( $this->_memoryUsagePeak + $other->getMemoryUsagePeak() ) / 2,
( $this->_realMemoryUsagePeak + $other->g... | [
"public",
"function",
"diff",
"(",
"Snapshot",
"$",
"other",
")",
"{",
"return",
"new",
"self",
"(",
"$",
"this",
"->",
"_time",
"-",
"$",
"other",
"->",
"getTime",
"(",
")",
",",
"$",
"this",
"->",
"_memoryUsage",
"-",
"$",
"other",
"->",
"getMemory... | Subtracts a snapshot from another one.
The result will be a snapshot describing the execution metrics between the two snapshots
e.g. execution-time between two snapshots, memory-consumption from one snapshot to another etc.
@param Snapshot $other
@return Snapshot | [
"Subtracts",
"a",
"snapshot",
"from",
"another",
"one",
"."
] | 739a7011c6dad409a51c4bcfbcf4b4ffbc8cba49 | https://github.com/Talesoft/tale-framework/blob/739a7011c6dad409a51c4bcfbcf4b4ffbc8cba49/src/Tale/Debug/Snapshot.php#L148-L157 |
195,468 | Talesoft/tale-framework | src/Tale/Debug/Snapshot.php | Snapshot.create | public static function create() {
return new self(
microtime( true ),
memory_get_usage( false ),
memory_get_usage( true ),
memory_get_peak_usage( false ),
memory_get_peak_usage( true )
);
} | php | public static function create() {
return new self(
microtime( true ),
memory_get_usage( false ),
memory_get_usage( true ),
memory_get_peak_usage( false ),
memory_get_peak_usage( true )
);
} | [
"public",
"static",
"function",
"create",
"(",
")",
"{",
"return",
"new",
"self",
"(",
"microtime",
"(",
"true",
")",
",",
"memory_get_usage",
"(",
"false",
")",
",",
"memory_get_usage",
"(",
"true",
")",
",",
"memory_get_peak_usage",
"(",
"false",
")",
",... | Creates a new snapshot based on current PHP environment metrics
Basically, this fills a new instance of a snapshot with:
microtime( true )
memory_get_usage( false )
memory_get_usage( true )
memory_get_peak_usage( false )
and
memory_get_peak_usage( true )
@return Snapshot | [
"Creates",
"a",
"new",
"snapshot",
"based",
"on",
"current",
"PHP",
"environment",
"metrics"
] | 739a7011c6dad409a51c4bcfbcf4b4ffbc8cba49 | https://github.com/Talesoft/tale-framework/blob/739a7011c6dad409a51c4bcfbcf4b4ffbc8cba49/src/Tale/Debug/Snapshot.php#L172-L181 |
195,469 | agentmedia/phine-core | src/Core/Logic/Logging/Logger.php | Logger.ReportSiteAction | function ReportSiteAction(Site $site, Enums\Action $action)
{
$logItem = $this->CreateLogItem(Enums\ObjectType::Site(), $action);
if (!$action->Equals(Enums\Action::Delete()))
{
$logSite = new LogSite();
$logSite->SetLogItem($logItem);
$logSite->Set... | php | function ReportSiteAction(Site $site, Enums\Action $action)
{
$logItem = $this->CreateLogItem(Enums\ObjectType::Site(), $action);
if (!$action->Equals(Enums\Action::Delete()))
{
$logSite = new LogSite();
$logSite->SetLogItem($logItem);
$logSite->Set... | [
"function",
"ReportSiteAction",
"(",
"Site",
"$",
"site",
",",
"Enums",
"\\",
"Action",
"$",
"action",
")",
"{",
"$",
"logItem",
"=",
"$",
"this",
"->",
"CreateLogItem",
"(",
"Enums",
"\\",
"ObjectType",
"::",
"Site",
"(",
")",
",",
"$",
"action",
")",... | Reports a site action to the log
@param Site $site The site being manipulated
@param Enums\Action $action The operation executed on the site | [
"Reports",
"a",
"site",
"action",
"to",
"the",
"log"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/Logger.php#L52-L62 |
195,470 | agentmedia/phine-core | src/Core/Logic/Logging/Logger.php | Logger.ReportPageAction | function ReportPageAction(Page $page, Enums\Action $action)
{
$logItem = $this->CreateLogItem(Enums\ObjectType::Page(), $action);
if (!$action->Equals(Enums\Action::Delete()))
{
$logPage = new LogPage();
$logPage->SetLogItem($logItem);
$logPage->Set... | php | function ReportPageAction(Page $page, Enums\Action $action)
{
$logItem = $this->CreateLogItem(Enums\ObjectType::Page(), $action);
if (!$action->Equals(Enums\Action::Delete()))
{
$logPage = new LogPage();
$logPage->SetLogItem($logItem);
$logPage->Set... | [
"function",
"ReportPageAction",
"(",
"Page",
"$",
"page",
",",
"Enums",
"\\",
"Action",
"$",
"action",
")",
"{",
"$",
"logItem",
"=",
"$",
"this",
"->",
"CreateLogItem",
"(",
"Enums",
"\\",
"ObjectType",
"::",
"Page",
"(",
")",
",",
"$",
"action",
")",... | Reports a page action with dependencies to the log
@param Page $page The page being manipulated
@param Enums\Action $action The operation executed on the page | [
"Reports",
"a",
"page",
"action",
"with",
"dependencies",
"to",
"the",
"log"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/Logger.php#L70-L84 |
195,471 | agentmedia/phine-core | src/Core/Logic/Logging/Logger.php | Logger.ReportAreaAction | function ReportAreaAction(Area $area, Enums\Action $action)
{
$logItem = $this->CreateLogItem(Enums\ObjectType::Area(), $action);
if (!$action->Equals(Enums\Action::Delete()))
{
$logArea = new LogArea();
$logArea->SetLogItem($logItem);
$logArea->Set... | php | function ReportAreaAction(Area $area, Enums\Action $action)
{
$logItem = $this->CreateLogItem(Enums\ObjectType::Area(), $action);
if (!$action->Equals(Enums\Action::Delete()))
{
$logArea = new LogArea();
$logArea->SetLogItem($logItem);
$logArea->Set... | [
"function",
"ReportAreaAction",
"(",
"Area",
"$",
"area",
",",
"Enums",
"\\",
"Action",
"$",
"action",
")",
"{",
"$",
"logItem",
"=",
"$",
"this",
"->",
"CreateLogItem",
"(",
"Enums",
"\\",
"ObjectType",
"::",
"Area",
"(",
")",
",",
"$",
"action",
")",... | Reports an area action with dependencies to the log
@param Area $area The area being manipulated
@param Enums\Action $action The operation executed on the area | [
"Reports",
"an",
"area",
"action",
"with",
"dependencies",
"to",
"the",
"log"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/Logger.php#L91-L105 |
195,472 | agentmedia/phine-core | src/Core/Logic/Logging/Logger.php | Logger.ReportLayoutAction | function ReportLayoutAction(Layout $layout, Enums\Action $action)
{
$logItem = $this->CreateLogItem(Enums\ObjectType::Layout(), $action);
if (!$action->Equals(Enums\Action::Delete()))
{
$logLayout = new LogLayout();
$logLayout->SetLogItem($logItem);
... | php | function ReportLayoutAction(Layout $layout, Enums\Action $action)
{
$logItem = $this->CreateLogItem(Enums\ObjectType::Layout(), $action);
if (!$action->Equals(Enums\Action::Delete()))
{
$logLayout = new LogLayout();
$logLayout->SetLogItem($logItem);
... | [
"function",
"ReportLayoutAction",
"(",
"Layout",
"$",
"layout",
",",
"Enums",
"\\",
"Action",
"$",
"action",
")",
"{",
"$",
"logItem",
"=",
"$",
"this",
"->",
"CreateLogItem",
"(",
"Enums",
"\\",
"ObjectType",
"::",
"Layout",
"(",
")",
",",
"$",
"action"... | Reports a layout action with dependencies to the log
@param Layout $layout The layout being manipulated
@param Enums\Action $action The operation executed on the layout | [
"Reports",
"a",
"layout",
"action",
"with",
"dependencies",
"to",
"the",
"log"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/Logger.php#L113-L132 |
195,473 | agentmedia/phine-core | src/Core/Logic/Logging/Logger.php | Logger.ReportContainerAction | function ReportContainerAction(Container $container, Enums\Action $action)
{
$logItem = $this->CreateLogItem(Enums\ObjectType::Container(), $action);
if (!$action->Equals(Enums\Action::Delete()))
{
$logContainer = new LogContainer();
$logContainer->SetContainer($conta... | php | function ReportContainerAction(Container $container, Enums\Action $action)
{
$logItem = $this->CreateLogItem(Enums\ObjectType::Container(), $action);
if (!$action->Equals(Enums\Action::Delete()))
{
$logContainer = new LogContainer();
$logContainer->SetContainer($conta... | [
"function",
"ReportContainerAction",
"(",
"Container",
"$",
"container",
",",
"Enums",
"\\",
"Action",
"$",
"action",
")",
"{",
"$",
"logItem",
"=",
"$",
"this",
"->",
"CreateLogItem",
"(",
"Enums",
"\\",
"ObjectType",
"::",
"Container",
"(",
")",
",",
"$"... | Reports a container action with dependencies to the log
@param Container $container The container being manipulated
@param Enums\Action $action The operation executed on the container | [
"Reports",
"a",
"container",
"action",
"with",
"dependencies",
"to",
"the",
"log"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/Logger.php#L139-L150 |
195,474 | agentmedia/phine-core | src/Core/Logic/Logging/Logger.php | Logger.ReportContentAction | function ReportContentAction(Content $content, Enums\Action $action)
{
$logItem = $this->CreateLogItem(Enums\ObjectType::Content(), $action);
if (!$action->Equals(Enums\Action::Delete()))
{
$logContent = new LogContent();
$logContent->SetLogItem($logItem);
... | php | function ReportContentAction(Content $content, Enums\Action $action)
{
$logItem = $this->CreateLogItem(Enums\ObjectType::Content(), $action);
if (!$action->Equals(Enums\Action::Delete()))
{
$logContent = new LogContent();
$logContent->SetLogItem($logItem);
... | [
"function",
"ReportContentAction",
"(",
"Content",
"$",
"content",
",",
"Enums",
"\\",
"Action",
"$",
"action",
")",
"{",
"$",
"logItem",
"=",
"$",
"this",
"->",
"CreateLogItem",
"(",
"Enums",
"\\",
"ObjectType",
"::",
"Content",
"(",
")",
",",
"$",
"act... | Reports a content action with dependencies to the log
@param Content $content The content being manipulated
@param Enums\Action $action The operation executed on the content | [
"Reports",
"a",
"content",
"action",
"with",
"dependencies",
"to",
"the",
"log"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/Logger.php#L157-L182 |
195,475 | agentmedia/phine-core | src/Core/Logic/Logging/Logger.php | Logger.ReportMemberAction | function ReportMemberAction(Member $member, Enums\Action $action)
{
$logItem = $this->CreateLogItem(Enums\ObjectType::Member(), $action);
if (!$action->Equals(Enums\Action::Delete()))
{
$logMember = new LogMember();
$logMember->SetLogItem($logItem);
... | php | function ReportMemberAction(Member $member, Enums\Action $action)
{
$logItem = $this->CreateLogItem(Enums\ObjectType::Member(), $action);
if (!$action->Equals(Enums\Action::Delete()))
{
$logMember = new LogMember();
$logMember->SetLogItem($logItem);
... | [
"function",
"ReportMemberAction",
"(",
"Member",
"$",
"member",
",",
"Enums",
"\\",
"Action",
"$",
"action",
")",
"{",
"$",
"logItem",
"=",
"$",
"this",
"->",
"CreateLogItem",
"(",
"Enums",
"\\",
"ObjectType",
"::",
"Member",
"(",
")",
",",
"$",
"action"... | Reports a member action to the log
@param Member $member The member being manipulated
@param Enums\Action $action The operation executed on the member | [
"Reports",
"a",
"member",
"action",
"to",
"the",
"log"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/Logger.php#L189-L199 |
195,476 | agentmedia/phine-core | src/Core/Logic/Logging/Logger.php | Logger.ReportMemberGroupAction | function ReportMemberGroupAction(Membergroup $memberGroup, Enums\Action $action)
{
$logItem = $this->CreateLogItem(Enums\ObjectType::MemberGroup(), $action);
if (!$action->Equals(Enums\Action::Delete()))
{
$logMemberGroup = new LogMembergroup();
$logMemberGroup... | php | function ReportMemberGroupAction(Membergroup $memberGroup, Enums\Action $action)
{
$logItem = $this->CreateLogItem(Enums\ObjectType::MemberGroup(), $action);
if (!$action->Equals(Enums\Action::Delete()))
{
$logMemberGroup = new LogMembergroup();
$logMemberGroup... | [
"function",
"ReportMemberGroupAction",
"(",
"Membergroup",
"$",
"memberGroup",
",",
"Enums",
"\\",
"Action",
"$",
"action",
")",
"{",
"$",
"logItem",
"=",
"$",
"this",
"->",
"CreateLogItem",
"(",
"Enums",
"\\",
"ObjectType",
"::",
"MemberGroup",
"(",
")",
",... | Reports a member group action to the log
@param Membergroup $memberGroup The member group being manipulated
@param Enums\Action $action The operation executed on the member group | [
"Reports",
"a",
"member",
"group",
"action",
"to",
"the",
"log"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/Logger.php#L206-L216 |
195,477 | agentmedia/phine-core | src/Core/Logic/Logging/Logger.php | Logger.ReportUserAction | function ReportUserAction(User $user, Enums\Action $action)
{
$logItem = $this->CreateLogItem(Enums\ObjectType::User(), $action);
if (!$action->Equals(Enums\Action::Delete()))
{
$logUser = new LogUser();
$logUser->SetLogItem($logItem);
$logUser->Set... | php | function ReportUserAction(User $user, Enums\Action $action)
{
$logItem = $this->CreateLogItem(Enums\ObjectType::User(), $action);
if (!$action->Equals(Enums\Action::Delete()))
{
$logUser = new LogUser();
$logUser->SetLogItem($logItem);
$logUser->Set... | [
"function",
"ReportUserAction",
"(",
"User",
"$",
"user",
",",
"Enums",
"\\",
"Action",
"$",
"action",
")",
"{",
"$",
"logItem",
"=",
"$",
"this",
"->",
"CreateLogItem",
"(",
"Enums",
"\\",
"ObjectType",
"::",
"User",
"(",
")",
",",
"$",
"action",
")",... | Reports a user action to the log
@param User $user The user being manipulated
@param Enums\Action $action The operation executed on the user | [
"Reports",
"a",
"user",
"action",
"to",
"the",
"log"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/Logger.php#L222-L232 |
195,478 | agentmedia/phine-core | src/Core/Logic/Logging/Logger.php | Logger.ReportUserGroupAction | function ReportUserGroupAction(Usergroup $userGroup, Enums\Action $action)
{
$logItem = $this->CreateLogItem(Enums\ObjectType::UserGroup(), $action);
if (!$action->Equals(Enums\Action::Delete()))
{
$logUserGroup = new LogUsergroup();
$logUserGroup->SetLogItem($... | php | function ReportUserGroupAction(Usergroup $userGroup, Enums\Action $action)
{
$logItem = $this->CreateLogItem(Enums\ObjectType::UserGroup(), $action);
if (!$action->Equals(Enums\Action::Delete()))
{
$logUserGroup = new LogUsergroup();
$logUserGroup->SetLogItem($... | [
"function",
"ReportUserGroupAction",
"(",
"Usergroup",
"$",
"userGroup",
",",
"Enums",
"\\",
"Action",
"$",
"action",
")",
"{",
"$",
"logItem",
"=",
"$",
"this",
"->",
"CreateLogItem",
"(",
"Enums",
"\\",
"ObjectType",
"::",
"UserGroup",
"(",
")",
",",
"$"... | Reports a user group action to the log
@param Usergroup $userGroup The user group being manipulated
@param Enums\Action $action The operation executed on the user group | [
"Reports",
"a",
"user",
"group",
"action",
"to",
"the",
"log"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/Logger.php#L239-L249 |
195,479 | agentmedia/phine-core | src/Core/Logic/Logging/Logger.php | Logger.ReportTemplateAction | function ReportTemplateAction($moduleType, $template, Enums\Action $action)
{
$logItem = $this->CreateLogItem(Enums\ObjectType::Template(), $action);
$logTemplate = new LogTemplate;
$logTemplate->SetLogItem($logItem);
$logTemplate->SetModuleType($moduleType);
$logTemplate->Se... | php | function ReportTemplateAction($moduleType, $template, Enums\Action $action)
{
$logItem = $this->CreateLogItem(Enums\ObjectType::Template(), $action);
$logTemplate = new LogTemplate;
$logTemplate->SetLogItem($logItem);
$logTemplate->SetModuleType($moduleType);
$logTemplate->Se... | [
"function",
"ReportTemplateAction",
"(",
"$",
"moduleType",
",",
"$",
"template",
",",
"Enums",
"\\",
"Action",
"$",
"action",
")",
"{",
"$",
"logItem",
"=",
"$",
"this",
"->",
"CreateLogItem",
"(",
"Enums",
"\\",
"ObjectType",
"::",
"Template",
"(",
")",
... | Reports an action on a module template
@param string $moduleType The module type the template belongs to
@param string $template The template file name
@param Enums\Action $action The action | [
"Reports",
"an",
"action",
"on",
"a",
"module",
"template"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/Logger.php#L257-L265 |
195,480 | agentmedia/phine-core | src/Core/Logic/Logging/Logger.php | Logger.CreateLogItem | private function CreateLogItem(Enums\ObjectType $objType, Enums\Action $action)
{
$this->DeleteOldLogItems();
$item = new LogItem();
$item->SetChanged(Date::Now());
$item->SetAction((string)$action);
$item->SetObjectType((string)$objType);
$item->SetUser($this->user);... | php | private function CreateLogItem(Enums\ObjectType $objType, Enums\Action $action)
{
$this->DeleteOldLogItems();
$item = new LogItem();
$item->SetChanged(Date::Now());
$item->SetAction((string)$action);
$item->SetObjectType((string)$objType);
$item->SetUser($this->user);... | [
"private",
"function",
"CreateLogItem",
"(",
"Enums",
"\\",
"ObjectType",
"$",
"objType",
",",
"Enums",
"\\",
"Action",
"$",
"action",
")",
"{",
"$",
"this",
"->",
"DeleteOldLogItems",
"(",
")",
";",
"$",
"item",
"=",
"new",
"LogItem",
"(",
")",
";",
"... | Creates a log item
@param Enums\ObjectType $objType The type of object being manipulated
@param Enums\Action $action The operation executed on the object
@return LogItem Returns a log item, freshly saved to the database | [
"Creates",
"a",
"log",
"item"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/Logger.php#L273-L283 |
195,481 | agentmedia/phine-core | src/Core/Logic/Logging/Logger.php | Logger.DeleteOldLogItems | private function DeleteOldLogItems()
{
$days = SettingsProxy::Singleton()->Settings()->GetLogLifetime();
$deleteBefore = Date::Now();
$deleteBefore->AddDays(-$days);
$tblLogItem = LogItem::Schema()->Table();
$sql = Access::SqlBuilder();
$where = $sql->LT($tblLogItem->... | php | private function DeleteOldLogItems()
{
$days = SettingsProxy::Singleton()->Settings()->GetLogLifetime();
$deleteBefore = Date::Now();
$deleteBefore->AddDays(-$days);
$tblLogItem = LogItem::Schema()->Table();
$sql = Access::SqlBuilder();
$where = $sql->LT($tblLogItem->... | [
"private",
"function",
"DeleteOldLogItems",
"(",
")",
"{",
"$",
"days",
"=",
"SettingsProxy",
"::",
"Singleton",
"(",
")",
"->",
"Settings",
"(",
")",
"->",
"GetLogLifetime",
"(",
")",
";",
"$",
"deleteBefore",
"=",
"Date",
"::",
"Now",
"(",
")",
";",
... | Deletes log items older then the given amount of days
@param int $days The days | [
"Deletes",
"log",
"items",
"older",
"then",
"the",
"given",
"amount",
"of",
"days"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/Logger.php#L289-L298 |
195,482 | Hnto/nuki | src/Handlers/Core/Assist.php | Assist.classNameShort | public static function classNameShort($class) {
$className = self::className($class);
$position = strrpos($className, '\\');
$name = substr($className, $position + 1);
return $name;
} | php | public static function classNameShort($class) {
$className = self::className($class);
$position = strrpos($className, '\\');
$name = substr($className, $position + 1);
return $name;
} | [
"public",
"static",
"function",
"classNameShort",
"(",
"$",
"class",
")",
"{",
"$",
"className",
"=",
"self",
"::",
"className",
"(",
"$",
"class",
")",
";",
"$",
"position",
"=",
"strrpos",
"(",
"$",
"className",
",",
"'\\\\'",
")",
";",
"$",
"name",
... | Returns only the class name
@param object $class
@return string | [
"Returns",
"only",
"the",
"class",
"name"
] | c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c | https://github.com/Hnto/nuki/blob/c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c/src/Handlers/Core/Assist.php#L45-L52 |
195,483 | Hnto/nuki | src/Handlers/Core/Assist.php | Assist.classHasMethod | public static function classHasMethod($method, $class) {
$methods = self::classMethods($class);
if (!in_array($method, $methods)) {
return false;
}
return true;
} | php | public static function classHasMethod($method, $class) {
$methods = self::classMethods($class);
if (!in_array($method, $methods)) {
return false;
}
return true;
} | [
"public",
"static",
"function",
"classHasMethod",
"(",
"$",
"method",
",",
"$",
"class",
")",
"{",
"$",
"methods",
"=",
"self",
"::",
"classMethods",
"(",
"$",
"class",
")",
";",
"if",
"(",
"!",
"in_array",
"(",
"$",
"method",
",",
"$",
"methods",
")... | Check if class has method
@param string $method
@param object|string $class
@return boolean | [
"Check",
"if",
"class",
"has",
"method"
] | c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c | https://github.com/Hnto/nuki/blob/c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c/src/Handlers/Core/Assist.php#L61-L69 |
195,484 | Hnto/nuki | src/Handlers/Core/Assist.php | Assist.hash | public static function hash($data, $file = false) {
$hasher = new \Nuki\Handlers\Security\Hasher(self::getAppAlgorithm(), self::getAppKey());
return $hasher->hash($data, $file);
} | php | public static function hash($data, $file = false) {
$hasher = new \Nuki\Handlers\Security\Hasher(self::getAppAlgorithm(), self::getAppKey());
return $hasher->hash($data, $file);
} | [
"public",
"static",
"function",
"hash",
"(",
"$",
"data",
",",
"$",
"file",
"=",
"false",
")",
"{",
"$",
"hasher",
"=",
"new",
"\\",
"Nuki",
"\\",
"Handlers",
"\\",
"Security",
"\\",
"Hasher",
"(",
"self",
"::",
"getAppAlgorithm",
"(",
")",
",",
"sel... | Hash by data or filename
@param $data
@param bool $file
@return bool|string
@throws \Nuki\Exceptions\Base | [
"Hash",
"by",
"data",
"or",
"filename"
] | c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c | https://github.com/Hnto/nuki/blob/c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c/src/Handlers/Core/Assist.php#L184-L188 |
195,485 | Hnto/nuki | src/Handlers/Core/Assist.php | Assist.encrypt | public static function encrypt($data) : Encrypted {
$crypter = new Crypter();
return $crypter->encrypt($data, self::getAppKey());
} | php | public static function encrypt($data) : Encrypted {
$crypter = new Crypter();
return $crypter->encrypt($data, self::getAppKey());
} | [
"public",
"static",
"function",
"encrypt",
"(",
"$",
"data",
")",
":",
"Encrypted",
"{",
"$",
"crypter",
"=",
"new",
"Crypter",
"(",
")",
";",
"return",
"$",
"crypter",
"->",
"encrypt",
"(",
"$",
"data",
",",
"self",
"::",
"getAppKey",
"(",
")",
")",... | Encrypt data and return an encrypter object
@param $data
@return Encrypted
@throws \Nuki\Exceptions\Base | [
"Encrypt",
"data",
"and",
"return",
"an",
"encrypter",
"object"
] | c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c | https://github.com/Hnto/nuki/blob/c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c/src/Handlers/Core/Assist.php#L218-L222 |
195,486 | Hnto/nuki | src/Handlers/Core/Assist.php | Assist.decrypt | public static function decrypt($data) : string {
$crypter = new Crypter();
return $crypter->decrypt($data, self::getAppKey());
} | php | public static function decrypt($data) : string {
$crypter = new Crypter();
return $crypter->decrypt($data, self::getAppKey());
} | [
"public",
"static",
"function",
"decrypt",
"(",
"$",
"data",
")",
":",
"string",
"{",
"$",
"crypter",
"=",
"new",
"Crypter",
"(",
")",
";",
"return",
"$",
"crypter",
"->",
"decrypt",
"(",
"$",
"data",
",",
"self",
"::",
"getAppKey",
"(",
")",
")",
... | Decrypt data and return the decrypted value
@param $data
@return string
@throws \Nuki\Exceptions\Base | [
"Decrypt",
"data",
"and",
"return",
"the",
"decrypted",
"value"
] | c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c | https://github.com/Hnto/nuki/blob/c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c/src/Handlers/Core/Assist.php#L233-L237 |
195,487 | Hnto/nuki | src/Handlers/Core/Assist.php | Assist.loadCoreView | public static function loadCoreView(string $name) {
$base = __DIR__ . '/../../Views/';
if (!file_exists($base . $name . '.view')) {
throw new \Nuki\Exceptions\Base('The view file "' . $name . '" does not exist.');
}
return file_get_contents($base . $name . '.view');
} | php | public static function loadCoreView(string $name) {
$base = __DIR__ . '/../../Views/';
if (!file_exists($base . $name . '.view')) {
throw new \Nuki\Exceptions\Base('The view file "' . $name . '" does not exist.');
}
return file_get_contents($base . $name . '.view');
} | [
"public",
"static",
"function",
"loadCoreView",
"(",
"string",
"$",
"name",
")",
"{",
"$",
"base",
"=",
"__DIR__",
".",
"'/../../Views/'",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"base",
".",
"$",
"name",
".",
"'.view'",
")",
")",
"{",
"throw",
... | Load the contents of a core view file
@param string $name
@return string
@throws \Nuki\Exceptions\Base | [
"Load",
"the",
"contents",
"of",
"a",
"core",
"view",
"file"
] | c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c | https://github.com/Hnto/nuki/blob/c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c/src/Handlers/Core/Assist.php#L270-L277 |
195,488 | reshadman/php-bijective-shortener | src/BijectiveShortener.php | BijectiveShortener.makeFromInteger | public static function makeFromInteger($integer)
{
if ($integer == 0) return static::$chars[0];
$number = abs($integer);
if ($integer < 0)
throw new \InvalidArgumentException("Can not encode for negative integers");
$string = '';
$base = strlen(static::$chars)... | php | public static function makeFromInteger($integer)
{
if ($integer == 0) return static::$chars[0];
$number = abs($integer);
if ($integer < 0)
throw new \InvalidArgumentException("Can not encode for negative integers");
$string = '';
$base = strlen(static::$chars)... | [
"public",
"static",
"function",
"makeFromInteger",
"(",
"$",
"integer",
")",
"{",
"if",
"(",
"$",
"integer",
"==",
"0",
")",
"return",
"static",
"::",
"$",
"chars",
"[",
"0",
"]",
";",
"$",
"number",
"=",
"abs",
"(",
"$",
"integer",
")",
";",
"if",... | Make a unique string from an Integer
@param $integer
@return string | [
"Make",
"a",
"unique",
"string",
"from",
"an",
"Integer"
] | 76c80defd945ca6890303fc7387ceac593b03019 | https://github.com/reshadman/php-bijective-shortener/blob/76c80defd945ca6890303fc7387ceac593b03019/src/BijectiveShortener.php#L18-L38 |
195,489 | reshadman/php-bijective-shortener | src/BijectiveShortener.php | BijectiveShortener.decodeToInteger | public static function decodeToInteger($string)
{
$stringLength = strlen($string);
$baseLength = strlen(static::$chars);
$id = 0;
for($i = 0; $i < $stringLength; $i++){
$pos = strpos(static::$chars, $string[$i]);
$id = ($id * $baseLength) + $pos;
... | php | public static function decodeToInteger($string)
{
$stringLength = strlen($string);
$baseLength = strlen(static::$chars);
$id = 0;
for($i = 0; $i < $stringLength; $i++){
$pos = strpos(static::$chars, $string[$i]);
$id = ($id * $baseLength) + $pos;
... | [
"public",
"static",
"function",
"decodeToInteger",
"(",
"$",
"string",
")",
"{",
"$",
"stringLength",
"=",
"strlen",
"(",
"$",
"string",
")",
";",
"$",
"baseLength",
"=",
"strlen",
"(",
"static",
"::",
"$",
"chars",
")",
";",
"$",
"id",
"=",
"0",
";"... | Decode the encoded string to Integer
@param $string
@return mixed | [
"Decode",
"the",
"encoded",
"string",
"to",
"Integer"
] | 76c80defd945ca6890303fc7387ceac593b03019 | https://github.com/reshadman/php-bijective-shortener/blob/76c80defd945ca6890303fc7387ceac593b03019/src/BijectiveShortener.php#L56-L73 |
195,490 | wb-crowdfusion/crowdfusion | system/core/classes/systemdb/cmsnavigation/CMSNavItemService.php | CMSNavItemService.getMenu | public function getMenu(DTO $dto=null)
{
if (!$menu = $this->SystemCache->get('cms-menu')) {
$menu = array();
if ($dto === null)
$dto = new DTO();
$dto->setOrderBy('SortOrder', 'ASC');
$dto->setParameter('FlattenChildren', false);
... | php | public function getMenu(DTO $dto=null)
{
if (!$menu = $this->SystemCache->get('cms-menu')) {
$menu = array();
if ($dto === null)
$dto = new DTO();
$dto->setOrderBy('SortOrder', 'ASC');
$dto->setParameter('FlattenChildren', false);
... | [
"public",
"function",
"getMenu",
"(",
"DTO",
"$",
"dto",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"menu",
"=",
"$",
"this",
"->",
"SystemCache",
"->",
"get",
"(",
"'cms-menu'",
")",
")",
"{",
"$",
"menu",
"=",
"array",
"(",
")",
";",
"if",
"... | Returns an array that represents the CMS Navigation menu
@param DTO $dto DTO to pass through to our DAO's findAll()
@return array An array representing the cms nav menu | [
"Returns",
"an",
"array",
"that",
"represents",
"the",
"CMS",
"Navigation",
"menu"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/systemdb/cmsnavigation/CMSNavItemService.php#L61-L82 |
195,491 | TuumPHP/Web | src/Psr7/Respond.php | Respond.asError | public function asError($status = self::INTERNAL_ERROR)
{
if ($this->error_views) {
$stream = $this->error_views->getStream($status);
} else {
$stream = null;
}
return Response::error($status, $this->data, $stream);
} | php | public function asError($status = self::INTERNAL_ERROR)
{
if ($this->error_views) {
$stream = $this->error_views->getStream($status);
} else {
$stream = null;
}
return Response::error($status, $this->data, $stream);
} | [
"public",
"function",
"asError",
"(",
"$",
"status",
"=",
"self",
"::",
"INTERNAL_ERROR",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"error_views",
")",
"{",
"$",
"stream",
"=",
"$",
"this",
"->",
"error_views",
"->",
"getStream",
"(",
"$",
"status",
")",... | return a response with error number.
@param int|string $status
@return Response | [
"return",
"a",
"response",
"with",
"error",
"number",
"."
] | 8f296b6358aa93226ce08d6cc54a309f5b0a9820 | https://github.com/TuumPHP/Web/blob/8f296b6358aa93226ce08d6cc54a309f5b0a9820/src/Psr7/Respond.php#L131-L139 |
195,492 | linpax/microphp-framework | src/mvc/controllers/RichController.php | RichController.switchContentType | protected function switchContentType($data)
{
switch ($this->format) {
case 'application/json':
$data = json_encode(is_object($data) ? (array)$data : $data);
break;
case 'application/xml':
$data = is_object($data) ? (string)$data : $da... | php | protected function switchContentType($data)
{
switch ($this->format) {
case 'application/json':
$data = json_encode(is_object($data) ? (array)$data : $data);
break;
case 'application/xml':
$data = is_object($data) ? (string)$data : $da... | [
"protected",
"function",
"switchContentType",
"(",
"$",
"data",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"format",
")",
"{",
"case",
"'application/json'",
":",
"$",
"data",
"=",
"json_encode",
"(",
"is_object",
"(",
"$",
"data",
")",
"?",
"(",
"array"... | Switch content type
@access protected
@param null|string $data Any content
@return string | [
"Switch",
"content",
"type"
] | 11f3370f3f64c516cce9b84ecd8276c6e9ae8df9 | https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/mvc/controllers/RichController.php#L129-L145 |
195,493 | lasallecms/lasallecms-l5-lasallecmsadmin-pkg | src/FormProcessing/Users/ExtraUserValidation.php | ExtraUserValidation.extraValidation | public function extraValidation($data, $performPhoneValidation=true) {
$this->messages = new MessageBag;
// is the cell number where text messages will be sent ok?
if (
(!$this->userRepository->validatePhoneNumber($data['phone_number']))
&& ($performPhoneValidation)
... | php | public function extraValidation($data, $performPhoneValidation=true) {
$this->messages = new MessageBag;
// is the cell number where text messages will be sent ok?
if (
(!$this->userRepository->validatePhoneNumber($data['phone_number']))
&& ($performPhoneValidation)
... | [
"public",
"function",
"extraValidation",
"(",
"$",
"data",
",",
"$",
"performPhoneValidation",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"messages",
"=",
"new",
"MessageBag",
";",
"// is the cell number where text messages will be sent ok?",
"if",
"(",
"(",
"!",
"... | Perform extra validation
@param array $data
@param bool $performPhoneValidation
@return array | [
"Perform",
"extra",
"validation"
] | 5a4b3375e449273a98e84a566bcf60fd2172cb2d | https://github.com/lasallecms/lasallecms-l5-lasallecmsadmin-pkg/blob/5a4b3375e449273a98e84a566bcf60fd2172cb2d/src/FormProcessing/Users/ExtraUserValidation.php#L85-L131 |
195,494 | Wedeto/DB | src/Query/CustomSQL.php | CustomSQL.toSQL | public function toSQL(Parameters $params, bool $inner_clause)
{
if ($inner_clause)
return '(' . $this->getSQL() . ')';
return $this->getSQL();
} | php | public function toSQL(Parameters $params, bool $inner_clause)
{
if ($inner_clause)
return '(' . $this->getSQL() . ')';
return $this->getSQL();
} | [
"public",
"function",
"toSQL",
"(",
"Parameters",
"$",
"params",
",",
"bool",
"$",
"inner_clause",
")",
"{",
"if",
"(",
"$",
"inner_clause",
")",
"return",
"'('",
".",
"$",
"this",
"->",
"getSQL",
"(",
")",
".",
"')'",
";",
"return",
"$",
"this",
"->... | Add a custom SQL string to the query
@param Parameters $params The query parameters: tables and placeholder values
@return string The generated SQL | [
"Add",
"a",
"custom",
"SQL",
"string",
"to",
"the",
"query"
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Query/CustomSQL.php#L47-L52 |
195,495 | CraryPrimitiveMan/php-resque | src/Resque.php | Resque.redis | public static function redis()
{
// Detect when the PID of the current process has changed (from a fork, etc)
// and force a reconnect to redis.
$pid = getmypid();
if (self::$pid !== $pid) {
self::$redis = null;
self::$pid = $pid;
}
if(!is_n... | php | public static function redis()
{
// Detect when the PID of the current process has changed (from a fork, etc)
// and force a reconnect to redis.
$pid = getmypid();
if (self::$pid !== $pid) {
self::$redis = null;
self::$pid = $pid;
}
if(!is_n... | [
"public",
"static",
"function",
"redis",
"(",
")",
"{",
"// Detect when the PID of the current process has changed (from a fork, etc)",
"// and force a reconnect to redis.",
"$",
"pid",
"=",
"getmypid",
"(",
")",
";",
"if",
"(",
"self",
"::",
"$",
"pid",
"!==",
"$",
"... | Return an instance of the Redis class instantiated for Resque.
@return Redis Instance of Redis. | [
"Return",
"an",
"instance",
"of",
"the",
"Redis",
"class",
"instantiated",
"for",
"Resque",
"."
] | eff3beba81b7f5e8d6fddb8d24c8dcde6553e209 | https://github.com/CraryPrimitiveMan/php-resque/blob/eff3beba81b7f5e8d6fddb8d24c8dcde6553e209/src/Resque.php#L67-L104 |
195,496 | ZendExperts/phpids | lib/IDS/Converter.php | IDS_Converter.runAll | public static function runAll($value)
{
foreach (get_class_methods(__CLASS__) as $method) {
if (strpos($method, 'run') === 0) {
continue;
}
$value = self::$method($value);
}
return $value;
} | php | public static function runAll($value)
{
foreach (get_class_methods(__CLASS__) as $method) {
if (strpos($method, 'run') === 0) {
continue;
}
$value = self::$method($value);
}
return $value;
} | [
"public",
"static",
"function",
"runAll",
"(",
"$",
"value",
")",
"{",
"foreach",
"(",
"get_class_methods",
"(",
"__CLASS__",
")",
"as",
"$",
"method",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"method",
",",
"'run'",
")",
"===",
"0",
")",
"{",
"conti... | Runs all converter functions
Note that if you make use of IDS_Converter::runAll(), existing class
methods will be executed in the same order as they are implemented in the
class tree!
@param string $value the value to convert
@static
@return string | [
"Runs",
"all",
"converter",
"functions"
] | f30df04eea47b94d056e2ae9ec8fea1c626f1c03 | https://github.com/ZendExperts/phpids/blob/f30df04eea47b94d056e2ae9ec8fea1c626f1c03/lib/IDS/Converter.php#L65-L76 |
195,497 | Finesse/QueryScribe | src/QueryBricks/InsertTrait.php | InsertTrait.addInsert | public function addInsert(array $rows): self
{
if (!empty($rows) && !is_array(reset($rows))) {
$rows = [$rows];
}
foreach ($rows as $index => $row) {
if (!is_array($row)) {
return $this->handleException(InvalidArgumentException::create(
... | php | public function addInsert(array $rows): self
{
if (!empty($rows) && !is_array(reset($rows))) {
$rows = [$rows];
}
foreach ($rows as $index => $row) {
if (!is_array($row)) {
return $this->handleException(InvalidArgumentException::create(
... | [
"public",
"function",
"addInsert",
"(",
"array",
"$",
"rows",
")",
":",
"self",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"rows",
")",
"&&",
"!",
"is_array",
"(",
"reset",
"(",
"$",
"rows",
")",
")",
")",
"{",
"$",
"rows",
"=",
"[",
"$",
"rows",
... | Adds a row to insert to the table.
Warning, calling this method removes a given insert from select.
@param mixed[][]|\Closure[][]|Query[][]|StatementInterface[][]|mixed[]|\Closure[]|Query[]|StatementInterface[] $rows
A row or an array of rows. Each row is an associative array where indexes are column names and values... | [
"Adds",
"a",
"row",
"to",
"insert",
"to",
"the",
"table",
"."
] | 4edba721e37693780d142229b3ecb0cd4004c7a5 | https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/QueryBricks/InsertTrait.php#L36-L70 |
195,498 | Finesse/QueryScribe | src/QueryBricks/InsertTrait.php | InsertTrait.addInsertFromSelect | public function addInsertFromSelect($columns, $selectQuery = null): self
{
if ($selectQuery === null) {
$selectQuery = $columns;
$columns = null;
}
if ($columns !== null) {
if (!is_array($columns)) {
return $this->handleException(InvalidAr... | php | public function addInsertFromSelect($columns, $selectQuery = null): self
{
if ($selectQuery === null) {
$selectQuery = $columns;
$columns = null;
}
if ($columns !== null) {
if (!is_array($columns)) {
return $this->handleException(InvalidAr... | [
"public",
"function",
"addInsertFromSelect",
"(",
"$",
"columns",
",",
"$",
"selectQuery",
"=",
"null",
")",
":",
"self",
"{",
"if",
"(",
"$",
"selectQuery",
"===",
"null",
")",
"{",
"$",
"selectQuery",
"=",
"$",
"columns",
";",
"$",
"columns",
"=",
"n... | Adds an instruction that the query should insert values to the table from the select query.
Warning, calling this method removes all the rows set by the `insert` method.
@param string[]|\Closure|self|StatementInterface $columns The list of the columns to which the selected values
should be inserted. You may omit this... | [
"Adds",
"an",
"instruction",
"that",
"the",
"query",
"should",
"insert",
"values",
"to",
"the",
"table",
"from",
"the",
"select",
"query",
"."
] | 4edba721e37693780d142229b3ecb0cd4004c7a5 | https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/QueryBricks/InsertTrait.php#L84-L114 |
195,499 | phpffcms/ffcms-core | src/Arch/Model.php | Model.validate | final public function validate(): bool
{
// validate csrf token if required
if ($this->_tokenRequired && !$this->_tokenOk) {
App::$Session->getFlashBag()->add('warning', __('Hack attention: security token is wrong!'));
return false;
}
// get all rules as array... | php | final public function validate(): bool
{
// validate csrf token if required
if ($this->_tokenRequired && !$this->_tokenOk) {
App::$Session->getFlashBag()->add('warning', __('Hack attention: security token is wrong!'));
return false;
}
// get all rules as array... | [
"final",
"public",
"function",
"validate",
"(",
")",
":",
"bool",
"{",
"// validate csrf token if required",
"if",
"(",
"$",
"this",
"->",
"_tokenRequired",
"&&",
"!",
"$",
"this",
"->",
"_tokenOk",
")",
"{",
"App",
"::",
"$",
"Session",
"->",
"getFlashBag",... | Validate defined rules in app
@return bool
@throws SyntaxException | [
"Validate",
"defined",
"rules",
"in",
"app"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Arch/Model.php#L89-L133 |
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.