repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
KodiComponents/Support | src/Upload.php | Upload.isUploadField | public function isUploadField($key)
{
return array_key_exists($key, $this->uploadGetKeys) || array_key_exists($key, $this->uploadSetKeys);
} | php | public function isUploadField($key)
{
return array_key_exists($key, $this->uploadGetKeys) || array_key_exists($key, $this->uploadSetKeys);
} | [
"public",
"function",
"isUploadField",
"(",
"$",
"key",
")",
"{",
"return",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"uploadGetKeys",
")",
"||",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"uploadSetKeys",
")",
";",
"... | Determine if a set mutator exists for an attribute.
@param string $key
@return bool | [
"Determine",
"if",
"a",
"set",
"mutator",
"exists",
"for",
"an",
"attribute",
"."
] | train | https://github.com/KodiComponents/Support/blob/9090543605a2354c7454d707650a0abdb815b60a/src/Upload.php#L206-L209 |
Erdiko/core | src/Helper.php | Helper.serve | public static function serve($context = null)
{
if(empty($context))
$context = getenv('ERDIKO_CONTEXT');
$routes = static::getRoutes($context);
Toro::serve($routes);
} | php | public static function serve($context = null)
{
if(empty($context))
$context = getenv('ERDIKO_CONTEXT');
$routes = static::getRoutes($context);
Toro::serve($routes);
} | [
"public",
"static",
"function",
"serve",
"(",
"$",
"context",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"context",
")",
")",
"$",
"context",
"=",
"getenv",
"(",
"'ERDIKO_CONTEXT'",
")",
";",
"$",
"routes",
"=",
"static",
"::",
"getRoutes",
... | Serve your site
Loads routes based off of context and serves up the current request
@param string $context optional context defaults to getenv('ERDIKO_CONTEXT') | [
"Serve",
"your",
"site",
"Loads",
"routes",
"based",
"off",
"of",
"context",
"and",
"serves",
"up",
"the",
"current",
"request"
] | train | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Helper.php#L27-L34 |
Erdiko/core | src/Helper.php | Helper.getView | public static function getView($viewName, $data = null, $templateRootFolder = null)
{
$view = new \erdiko\core\View($viewName, $data);
if ($templateRootFolder !== null) {
$view->setTemplateRootFolder($templateRootFolder);
}
return $view->toHtml();
} | php | public static function getView($viewName, $data = null, $templateRootFolder = null)
{
$view = new \erdiko\core\View($viewName, $data);
if ($templateRootFolder !== null) {
$view->setTemplateRootFolder($templateRootFolder);
}
return $view->toHtml();
} | [
"public",
"static",
"function",
"getView",
"(",
"$",
"viewName",
",",
"$",
"data",
"=",
"null",
",",
"$",
"templateRootFolder",
"=",
"null",
")",
"{",
"$",
"view",
"=",
"new",
"\\",
"erdiko",
"\\",
"core",
"\\",
"View",
"(",
"$",
"viewName",
",",
"$"... | Load a view from the current theme with the given data
@param string $viewName
@param array $data | [
"Load",
"a",
"view",
"from",
"the",
"current",
"theme",
"with",
"the",
"given",
"data"
] | train | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Helper.php#L42-L50 |
Erdiko/core | src/Helper.php | Helper.getConfigFile | public static function getConfigFile($filename)
{
$filename = addslashes($filename);
if (is_file($filename)) {
$data = str_replace("\\", "\\\\", file_get_contents($filename));
$json = json_decode($data, true);
if (empty($json)) {
throw new \Except... | php | public static function getConfigFile($filename)
{
$filename = addslashes($filename);
if (is_file($filename)) {
$data = str_replace("\\", "\\\\", file_get_contents($filename));
$json = json_decode($data, true);
if (empty($json)) {
throw new \Except... | [
"public",
"static",
"function",
"getConfigFile",
"(",
"$",
"filename",
")",
"{",
"$",
"filename",
"=",
"addslashes",
"(",
"$",
"filename",
")",
";",
"if",
"(",
"is_file",
"(",
"$",
"filename",
")",
")",
"{",
"$",
"data",
"=",
"str_replace",
"(",
"\"\\\... | Read JSON config file and return array
@param string $file
@return array $config | [
"Read",
"JSON",
"config",
"file",
"and",
"return",
"array"
] | train | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Helper.php#L58-L74 |
Erdiko/core | src/Helper.php | Helper.getConfig | public static function getConfig($name = 'application', $context = null)
{
if($context == null)
$context = getenv('ERDIKO_CONTEXT');
$filename = ERDIKO_APP."/config/{$context}/{$name}.json";
return static::getConfigFile($filename);
} | php | public static function getConfig($name = 'application', $context = null)
{
if($context == null)
$context = getenv('ERDIKO_CONTEXT');
$filename = ERDIKO_APP."/config/{$context}/{$name}.json";
return static::getConfigFile($filename);
} | [
"public",
"static",
"function",
"getConfig",
"(",
"$",
"name",
"=",
"'application'",
",",
"$",
"context",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"context",
"==",
"null",
")",
"$",
"context",
"=",
"getenv",
"(",
"'ERDIKO_CONTEXT'",
")",
";",
"$",
"filen... | Get configuration | [
"Get",
"configuration"
] | train | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Helper.php#L79-L86 |
Erdiko/core | src/Helper.php | Helper.getRoutes | public static function getRoutes($context = null)
{
if($context == null)
$context = getenv('ERDIKO_CONTEXT');
$file = ERDIKO_APP."/config/{$context}/routes.json";
$applicationConfig = static::getConfigFile($file);
return $applicationConfig['routes'];
} | php | public static function getRoutes($context = null)
{
if($context == null)
$context = getenv('ERDIKO_CONTEXT');
$file = ERDIKO_APP."/config/{$context}/routes.json";
$applicationConfig = static::getConfigFile($file);
return $applicationConfig['routes'];
} | [
"public",
"static",
"function",
"getRoutes",
"(",
"$",
"context",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"context",
"==",
"null",
")",
"$",
"context",
"=",
"getenv",
"(",
"'ERDIKO_CONTEXT'",
")",
";",
"$",
"file",
"=",
"ERDIKO_APP",
".",
"\"/config/{$con... | Get the compiled application routes from the config files
@todo cache the loaded/compiled routes | [
"Get",
"the",
"compiled",
"application",
"routes",
"from",
"the",
"config",
"files"
] | train | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Helper.php#L93-L101 |
Erdiko/core | src/Helper.php | Helper.sendEmail | public static function sendEmail($toEmail, $subject, $body, $fromEmail)
{
$headers = "From: $fromEmail\r\n" .
"Reply-To: $fromEmail\r\n" .
"X-Mailer: PHP/" . phpversion();
return mail($toEmail, $subject, $body, $headers);
} | php | public static function sendEmail($toEmail, $subject, $body, $fromEmail)
{
$headers = "From: $fromEmail\r\n" .
"Reply-To: $fromEmail\r\n" .
"X-Mailer: PHP/" . phpversion();
return mail($toEmail, $subject, $body, $headers);
} | [
"public",
"static",
"function",
"sendEmail",
"(",
"$",
"toEmail",
",",
"$",
"subject",
",",
"$",
"body",
",",
"$",
"fromEmail",
")",
"{",
"$",
"headers",
"=",
"\"From: $fromEmail\\r\\n\"",
".",
"\"Reply-To: $fromEmail\\r\\n\"",
".",
"\"X-Mailer: PHP/\"",
".",
"p... | Send email
@todo add ways to swap out ways of sending | [
"Send",
"email"
] | train | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Helper.php#L107-L114 |
Erdiko/core | src/Helper.php | Helper.log | public static function log($level, $message, array $context = array())
{
if(static::$_logObject==null)
{
$erdikoContext = getenv('ERDIKO_CONTEXT');
$config = static::getConfig("application", $erdikoContext);
$logFiles = $config["logs"]["files"][0];
$lo... | php | public static function log($level, $message, array $context = array())
{
if(static::$_logObject==null)
{
$erdikoContext = getenv('ERDIKO_CONTEXT');
$config = static::getConfig("application", $erdikoContext);
$logFiles = $config["logs"]["files"][0];
$lo... | [
"public",
"static",
"function",
"log",
"(",
"$",
"level",
",",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"static",
"::",
"$",
"_logObject",
"==",
"null",
")",
"{",
"$",
"erdikoContext",
"=",
"getenv",
... | log message to log file
If you enter null for level it will default to 'debug'
@usage \Erdiko::log('debug',"Message here...", array())
@param string $level
@param string $message
@param array $context
@return bool $success
@todo refactor how logging is used, eventually remove from helper | [
"log",
"message",
"to",
"log",
"file",
"If",
"you",
"enter",
"null",
"for",
"level",
"it",
"will",
"default",
"to",
"debug"
] | train | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Helper.php#L128-L144 |
Erdiko/core | src/Helper.php | Helper.getCache | public static function getCache($cacheType = "default")
{
$context = getenv('ERDIKO_CONTEXT');
$config = static::getConfig("application");
if (isset($config["cache"][$cacheType])) {
$cacheConfig = $config["cache"][$cacheType];
$class = "erdiko\core\cache\\".$... | php | public static function getCache($cacheType = "default")
{
$context = getenv('ERDIKO_CONTEXT');
$config = static::getConfig("application");
if (isset($config["cache"][$cacheType])) {
$cacheConfig = $config["cache"][$cacheType];
$class = "erdiko\core\cache\\".$... | [
"public",
"static",
"function",
"getCache",
"(",
"$",
"cacheType",
"=",
"\"default\"",
")",
"{",
"$",
"context",
"=",
"getenv",
"(",
"'ERDIKO_CONTEXT'",
")",
";",
"$",
"config",
"=",
"static",
"::",
"getConfig",
"(",
"\"application\"",
")",
";",
"if",
"(",... | Get the configured cache instance using name
@return cache $cache returns the instance of the cache type | [
"Get",
"the",
"configured",
"cache",
"instance",
"using",
"name"
] | train | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Helper.php#L177-L189 |
scherersoftware/cake-monitor | src/Error/ConsoleErrorHandler.php | ConsoleErrorHandler.handleError | public function handleError($code, $description, $file = null, $line = null, $context = null)
{
$exception = new ErrorException($description, 0, $code, $file, $line);
$sentryHandler = new SentryHandler();
$sentryHandler->handle($exception);
return parent::handleError($code, $descript... | php | public function handleError($code, $description, $file = null, $line = null, $context = null)
{
$exception = new ErrorException($description, 0, $code, $file, $line);
$sentryHandler = new SentryHandler();
$sentryHandler->handle($exception);
return parent::handleError($code, $descript... | [
"public",
"function",
"handleError",
"(",
"$",
"code",
",",
"$",
"description",
",",
"$",
"file",
"=",
"null",
",",
"$",
"line",
"=",
"null",
",",
"$",
"context",
"=",
"null",
")",
"{",
"$",
"exception",
"=",
"new",
"ErrorException",
"(",
"$",
"descr... | Set as the default error handler by CakePHP.
@param int $code Code of error
@param string $description Error description
@param string|null $file File on which error occurred
@param int|null $line Line that triggered the error
@param array|null $context Context
@return bool True if error was handled | [
"Set",
"as",
"the",
"default",
"error",
"handler",
"by",
"CakePHP",
"."
] | train | https://github.com/scherersoftware/cake-monitor/blob/dbe07a1aac41b3db15e631d9e59cf26214bf6938/src/Error/ConsoleErrorHandler.php#L20-L26 |
scherersoftware/cake-monitor | src/Error/ConsoleErrorHandler.php | ConsoleErrorHandler.handleException | public function handleException(Exception $exception)
{
$sentryHandler = new SentryHandler();
$sentryHandler->handle($exception);
return parent::handleException($exception);
} | php | public function handleException(Exception $exception)
{
$sentryHandler = new SentryHandler();
$sentryHandler->handle($exception);
return parent::handleException($exception);
} | [
"public",
"function",
"handleException",
"(",
"Exception",
"$",
"exception",
")",
"{",
"$",
"sentryHandler",
"=",
"new",
"SentryHandler",
"(",
")",
";",
"$",
"sentryHandler",
"->",
"handle",
"(",
"$",
"exception",
")",
";",
"return",
"parent",
"::",
"handleE... | Handle uncaught exceptions.
@param \Exception $exception Exception instance.
@return void
@throws \Exception When renderer class not found
@see http://php.net/manual/en/function.set-exception-handler.php | [
"Handle",
"uncaught",
"exceptions",
"."
] | train | https://github.com/scherersoftware/cake-monitor/blob/dbe07a1aac41b3db15e631d9e59cf26214bf6938/src/Error/ConsoleErrorHandler.php#L36-L41 |
ouropencode/dachi | src/Database.php | Database.initialize | public static function initialize() {
$paths = array_merge(
array_filter(glob('src/*'), 'is_dir'),
array_filter(glob('src-*/*'), 'is_dir'),
array_filter(glob(__DIR__ . '/../../*/src/*/'), 'is_dir')
);
$db_params = array(
"url" => Configuration::get("database.uri", "sqlite:///:memory:")
);
$cache... | php | public static function initialize() {
$paths = array_merge(
array_filter(glob('src/*'), 'is_dir'),
array_filter(glob('src-*/*'), 'is_dir'),
array_filter(glob(__DIR__ . '/../../*/src/*/'), 'is_dir')
);
$db_params = array(
"url" => Configuration::get("database.uri", "sqlite:///:memory:")
);
$cache... | [
"public",
"static",
"function",
"initialize",
"(",
")",
"{",
"$",
"paths",
"=",
"array_merge",
"(",
"array_filter",
"(",
"glob",
"(",
"'src/*'",
")",
",",
"'is_dir'",
")",
",",
"array_filter",
"(",
"glob",
"(",
"'src-*/*'",
")",
",",
"'is_dir'",
")",
","... | Initialize the Doctrine database engine.
This will connect to the database uri specified in the configuration.
If the database uri cannot be found, an in-memory sqlite instance will be used.
@return null | [
"Initialize",
"the",
"Doctrine",
"database",
"engine",
"."
] | train | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Database.php#L26-L47 |
ouropencode/dachi | src/Database.php | Database.getRepository | public static function getRepository() {
if(self::$entity_manager == null)
self::initialize();
return call_user_func_array(array(self::$entity_manager, "getRepository"), func_get_args());
} | php | public static function getRepository() {
if(self::$entity_manager == null)
self::initialize();
return call_user_func_array(array(self::$entity_manager, "getRepository"), func_get_args());
} | [
"public",
"static",
"function",
"getRepository",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"entity_manager",
"==",
"null",
")",
"self",
"::",
"initialize",
"(",
")",
";",
"return",
"call_user_func_array",
"(",
"array",
"(",
"self",
"::",
"$",
"entity_ma... | Wrapper to the Doctrine2 getRepository function.
@see http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/index.html
@return EntityRepository | [
"Wrapper",
"to",
"the",
"Doctrine2",
"getRepository",
"function",
"."
] | train | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Database.php#L68-L73 |
ouropencode/dachi | src/Database.php | Database.find | public static function find() {
if(self::$entity_manager == null)
self::initialize();
return call_user_func_array(array(self::$entity_manager, "find"), func_get_args());
} | php | public static function find() {
if(self::$entity_manager == null)
self::initialize();
return call_user_func_array(array(self::$entity_manager, "find"), func_get_args());
} | [
"public",
"static",
"function",
"find",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"entity_manager",
"==",
"null",
")",
"self",
"::",
"initialize",
"(",
")",
";",
"return",
"call_user_func_array",
"(",
"array",
"(",
"self",
"::",
"$",
"entity_manager",
... | Wrapper to the Doctrine2 find function.
This function will call the 'find' function on the Doctrine2 Entity Manager.
@see http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/index.html
@return mixed | [
"Wrapper",
"to",
"the",
"Doctrine2",
"find",
"function",
"."
] | train | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Database.php#L83-L88 |
ouropencode/dachi | src/Database.php | Database.flush | public static function flush() {
if(self::$entity_manager == null)
self::initialize();
return call_user_func_array(array(self::$entity_manager, "flush"), func_get_args());
} | php | public static function flush() {
if(self::$entity_manager == null)
self::initialize();
return call_user_func_array(array(self::$entity_manager, "flush"), func_get_args());
} | [
"public",
"static",
"function",
"flush",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"entity_manager",
"==",
"null",
")",
"self",
"::",
"initialize",
"(",
")",
";",
"return",
"call_user_func_array",
"(",
"array",
"(",
"self",
"::",
"$",
"entity_manager",
... | Wrapper to the Doctrine2 flush function.
This function will call the 'flush' function on the Doctrine2 Entity Manager.
@see http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/index.html
@return null | [
"Wrapper",
"to",
"the",
"Doctrine2",
"flush",
"function",
"."
] | train | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Database.php#L98-L103 |
ouropencode/dachi | src/Database.php | Database.persist | public static function persist() {
if(self::$entity_manager == null)
self::initialize();
return call_user_func_array(array(self::$entity_manager, "persist"), func_get_args());
} | php | public static function persist() {
if(self::$entity_manager == null)
self::initialize();
return call_user_func_array(array(self::$entity_manager, "persist"), func_get_args());
} | [
"public",
"static",
"function",
"persist",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"entity_manager",
"==",
"null",
")",
"self",
"::",
"initialize",
"(",
")",
";",
"return",
"call_user_func_array",
"(",
"array",
"(",
"self",
"::",
"$",
"entity_manager"... | Wrapper to the Doctrine2 persist function.
This function will call the 'persist' function on the Doctrine2 Entity Manager.
@see http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/index.html
@return null | [
"Wrapper",
"to",
"the",
"Doctrine2",
"persist",
"function",
"."
] | train | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Database.php#L113-L118 |
ouropencode/dachi | src/Database.php | Database.remove | public static function remove() {
if(self::$entity_manager == null)
self::initialize();
return call_user_func_array(array(self::$entity_manager, "remove"), func_get_args());
} | php | public static function remove() {
if(self::$entity_manager == null)
self::initialize();
return call_user_func_array(array(self::$entity_manager, "remove"), func_get_args());
} | [
"public",
"static",
"function",
"remove",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"entity_manager",
"==",
"null",
")",
"self",
"::",
"initialize",
"(",
")",
";",
"return",
"call_user_func_array",
"(",
"array",
"(",
"self",
"::",
"$",
"entity_manager",... | Wrapper to the Doctrine2 remove function.
This function will call the 'remove' function on the Doctrine2 Entity Manager.
@see http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/index.html
@return null | [
"Wrapper",
"to",
"the",
"Doctrine2",
"remove",
"function",
"."
] | train | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Database.php#L128-L133 |
ouropencode/dachi | src/Database.php | Database.createQuery | public static function createQuery() {
if(self::$entity_manager == null)
self::initialize();
return call_user_func_array(array(self::$entity_manager, "createQuery"), func_get_args());
} | php | public static function createQuery() {
if(self::$entity_manager == null)
self::initialize();
return call_user_func_array(array(self::$entity_manager, "createQuery"), func_get_args());
} | [
"public",
"static",
"function",
"createQuery",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"entity_manager",
"==",
"null",
")",
"self",
"::",
"initialize",
"(",
")",
";",
"return",
"call_user_func_array",
"(",
"array",
"(",
"self",
"::",
"$",
"entity_mana... | Wrapper to the Doctrine2 createQuery function.
This function will call the 'createQuery' function on the Doctrine2 Entity Manager.
@see http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/index.html
@return mixed | [
"Wrapper",
"to",
"the",
"Doctrine2",
"createQuery",
"function",
"."
] | train | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Database.php#L143-L148 |
ouropencode/dachi | src/Database.php | Database.createQueryBuilder | public static function createQueryBuilder() {
if(self::$entity_manager == null)
self::initialize();
return call_user_func_array(array(self::$entity_manager, "createQueryBuilder"), func_get_args());
} | php | public static function createQueryBuilder() {
if(self::$entity_manager == null)
self::initialize();
return call_user_func_array(array(self::$entity_manager, "createQueryBuilder"), func_get_args());
} | [
"public",
"static",
"function",
"createQueryBuilder",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"entity_manager",
"==",
"null",
")",
"self",
"::",
"initialize",
"(",
")",
";",
"return",
"call_user_func_array",
"(",
"array",
"(",
"self",
"::",
"$",
"enti... | Wrapper to the Doctrine2 createQueryBuilder function.
This function will call the 'createQueryBuilder' function on the Doctrine2 Entity Manager.
@see http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/index.html
@return mixed | [
"Wrapper",
"to",
"the",
"Doctrine2",
"createQueryBuilder",
"function",
"."
] | train | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Database.php#L158-L163 |
ouropencode/dachi | src/Database.php | Database.createNativeQuery | public static function createNativeQuery() {
if(self::$entity_manager == null)
self::initialize();
return call_user_func_array(array(self::$entity_manager, "createNativeQuery"), func_get_args());
} | php | public static function createNativeQuery() {
if(self::$entity_manager == null)
self::initialize();
return call_user_func_array(array(self::$entity_manager, "createNativeQuery"), func_get_args());
} | [
"public",
"static",
"function",
"createNativeQuery",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"entity_manager",
"==",
"null",
")",
"self",
"::",
"initialize",
"(",
")",
";",
"return",
"call_user_func_array",
"(",
"array",
"(",
"self",
"::",
"$",
"entit... | Wrapper to the Doctrine2 createNativeQuery function.
This function will call the 'createNativeQuery' function on the Doctrine2 Entity Manager.
@see http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/index.html
@return mixed | [
"Wrapper",
"to",
"the",
"Doctrine2",
"createNativeQuery",
"function",
"."
] | train | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Database.php#L172-L177 |
ouropencode/dachi | src/Database.php | Database.getReference | public static function getReference() {
if(self::$entity_manager == null)
self::initialize();
return call_user_func_array(array(self::$entity_manager, "getReference"), func_get_args());
} | php | public static function getReference() {
if(self::$entity_manager == null)
self::initialize();
return call_user_func_array(array(self::$entity_manager, "getReference"), func_get_args());
} | [
"public",
"static",
"function",
"getReference",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"entity_manager",
"==",
"null",
")",
"self",
"::",
"initialize",
"(",
")",
";",
"return",
"call_user_func_array",
"(",
"array",
"(",
"self",
"::",
"$",
"entity_man... | Wrapper to the Doctrine2 getReference function.
This function will call the 'getReference' function on the Doctrine2 Entity Manager.
@see http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/index.html
@return mixed | [
"Wrapper",
"to",
"the",
"Doctrine2",
"getReference",
"function",
"."
] | train | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Database.php#L187-L192 |
nabab/bbn | src/bbn/user.php | user._login | private function _login($id){
if ( $this->check() && $id ){
$this
->_authenticate($id)
->_user_info()
->_init_dir(true)
->save_session();
}
return $this;
} | php | private function _login($id){
if ( $this->check() && $id ){
$this
->_authenticate($id)
->_user_info()
->_init_dir(true)
->save_session();
}
return $this;
} | [
"private",
"function",
"_login",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"check",
"(",
")",
"&&",
"$",
"id",
")",
"{",
"$",
"this",
"->",
"_authenticate",
"(",
"$",
"id",
")",
"->",
"_user_info",
"(",
")",
"->",
"_init_dir",
"(",
... | initialize and saves session
@return $this | [
"initialize",
"and",
"saves",
"session"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L225-L234 |
nabab/bbn | src/bbn/user.php | user._user_info | private function _user_info(){
if ( $this->get_id() ){
if ( !empty($this->get_session('cfg')) ){
$this->cfg = $this->get_session('cfg');
$this->id_group = $this->get_session('id_group');
}
else if ( $d = $this->db->rselect(
$this->class_cfg['tables']['users'],
array... | php | private function _user_info(){
if ( $this->get_id() ){
if ( !empty($this->get_session('cfg')) ){
$this->cfg = $this->get_session('cfg');
$this->id_group = $this->get_session('id_group');
}
else if ( $d = $this->db->rselect(
$this->class_cfg['tables']['users'],
array... | [
"private",
"function",
"_user_info",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"get_id",
"(",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"get_session",
"(",
"'cfg'",
")",
")",
")",
"{",
"$",
"this",
"->",
"cfg",
"=",
"$"... | Gathers all the information about a user and puts it in the session
The user's table data can be sent as argument if it has already been fetched
@param array $d The user's table data
@return $this | [
"Gathers",
"all",
"the",
"information",
"about",
"a",
"user",
"and",
"puts",
"it",
"in",
"the",
"session",
"The",
"user",
"s",
"table",
"data",
"can",
"be",
"sent",
"as",
"argument",
"if",
"it",
"has",
"already",
"been",
"fetched"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L244-L271 |
nabab/bbn | src/bbn/user.php | user._sess_info | private function _sess_info($id_session = null){
if ( !str::is_uid($id_session) ){
$id_session = $this->get_id_session();
}
else{
$cfg = $this->_get_session('cfg');
}
if (
empty($cfg) &&
str::is_uid($id_session) &&
($id = $this->get_session('id')) &&
($d = $this->... | php | private function _sess_info($id_session = null){
if ( !str::is_uid($id_session) ){
$id_session = $this->get_id_session();
}
else{
$cfg = $this->_get_session('cfg');
}
if (
empty($cfg) &&
str::is_uid($id_session) &&
($id = $this->get_session('id')) &&
($d = $this->... | [
"private",
"function",
"_sess_info",
"(",
"$",
"id_session",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"str",
"::",
"is_uid",
"(",
"$",
"id_session",
")",
")",
"{",
"$",
"id_session",
"=",
"$",
"this",
"->",
"get_id_session",
"(",
")",
";",
"}",
"else",... | Gathers all the information about the user's session
The session's table data can be sent as argument if it has already been fetched
@param mixed $d The session's table data or its ID
@return $this | [
"Gathers",
"all",
"the",
"information",
"about",
"the",
"user",
"s",
"session",
"The",
"session",
"s",
"table",
"data",
"can",
"be",
"sent",
"as",
"argument",
"if",
"it",
"has",
"already",
"been",
"fetched"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L280-L309 |
nabab/bbn | src/bbn/user.php | user._retrieve_session | private function _retrieve_session(){
if ( !$this->id ){
// The user ID must be in the session
$id_session = $this->get_id_session();
$id = $this->get_session('id');
if ( $id_session && $id ){
$this->_sess_info($id_session);
if (
isset($this->sess_cfg['fingerprint']... | php | private function _retrieve_session(){
if ( !$this->id ){
// The user ID must be in the session
$id_session = $this->get_id_session();
$id = $this->get_session('id');
if ( $id_session && $id ){
$this->_sess_info($id_session);
if (
isset($this->sess_cfg['fingerprint']... | [
"private",
"function",
"_retrieve_session",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"id",
")",
"{",
"// The user ID must be in the session",
"$",
"id_session",
"=",
"$",
"this",
"->",
"get_id_session",
"(",
")",
";",
"$",
"id",
"=",
"$",
"this",
... | Retrieves all user info from its session and populates the object
@return $this | [
"Retrieves",
"all",
"user",
"info",
"from",
"its",
"session",
"and",
"populates",
"the",
"object"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L337-L363 |
nabab/bbn | src/bbn/user.php | user._init_session | private function _init_session(){
// Getting or creating the session is it doesn't exist yet
/** @var user\session */
$this->session = user\session::get_instance();
if ( !$this->session ){
$this->session = new user\session();
}
/** @var int $id_session The ID of the session row in the DB... | php | private function _init_session(){
// Getting or creating the session is it doesn't exist yet
/** @var user\session */
$this->session = user\session::get_instance();
if ( !$this->session ){
$this->session = new user\session();
}
/** @var int $id_session The ID of the session row in the DB... | [
"private",
"function",
"_init_session",
"(",
")",
"{",
"// Getting or creating the session is it doesn't exist yet",
"/** @var user\\session */",
"$",
"this",
"->",
"session",
"=",
"user",
"\\",
"session",
"::",
"get_instance",
"(",
")",
";",
"if",
"(",
"!",
"$",
"t... | Sets the user's session for the first time and creates the session's DB row
@return $this | [
"Sets",
"the",
"user",
"s",
"session",
"for",
"the",
"first",
"time",
"and",
"creates",
"the",
"session",
"s",
"DB",
"row"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L369-L428 |
nabab/bbn | src/bbn/user.php | user._set_session | private function _set_session($attr){
if ( $this->session->has(self::$sn) ){
$args = \func_get_args();
if ( (\count($args) === 2) && \is_string($args[0]) ){
$attr = [$args[0] => $args[1]];
}
foreach ( $attr as $key => $val ){
if ( \is_string($key) ){
$this->session-... | php | private function _set_session($attr){
if ( $this->session->has(self::$sn) ){
$args = \func_get_args();
if ( (\count($args) === 2) && \is_string($args[0]) ){
$attr = [$args[0] => $args[1]];
}
foreach ( $attr as $key => $val ){
if ( \is_string($key) ){
$this->session-... | [
"private",
"function",
"_set_session",
"(",
"$",
"attr",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"session",
"->",
"has",
"(",
"self",
"::",
"$",
"sn",
")",
")",
"{",
"$",
"args",
"=",
"\\",
"func_get_args",
"(",
")",
";",
"if",
"(",
"(",
"\\",
... | Sets the "session" part of the session
@param mixed $attr
@return $this $this | [
"Sets",
"the",
"session",
"part",
"of",
"the",
"session"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L435-L448 |
nabab/bbn | src/bbn/user.php | user._get_session | private function _get_session($attr){
//die(\bbn\x::hdump(self::$sn, $this->session->has(self::$sn), $attr, $this->session->get(self::$sn)));
if ( $this->session->has(self::$sn) ){
return $attr ?
$this->session->get(self::$sn, $attr) :
$this->session->get(self::$sn);
}
} | php | private function _get_session($attr){
//die(\bbn\x::hdump(self::$sn, $this->session->has(self::$sn), $attr, $this->session->get(self::$sn)));
if ( $this->session->has(self::$sn) ){
return $attr ?
$this->session->get(self::$sn, $attr) :
$this->session->get(self::$sn);
}
} | [
"private",
"function",
"_get_session",
"(",
"$",
"attr",
")",
"{",
"//die(\\bbn\\x::hdump(self::$sn, $this->session->has(self::$sn), $attr, $this->session->get(self::$sn)));",
"if",
"(",
"$",
"this",
"->",
"session",
"->",
"has",
"(",
"self",
"::",
"$",
"sn",
")",
")",
... | Gets the "session" part of the session
@param string $attr
@return mixed | [
"Gets",
"the",
"session",
"part",
"of",
"the",
"session"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L455-L462 |
nabab/bbn | src/bbn/user.php | user._check_credentials | private function _check_credentials($params){
if ( $this->check() ){
/** @var array $f The form fields sent to identify the users */
$f =& $this->class_cfg['fields'];
if ( !isset($params[$f['salt']]) ){
$this->set_error(11);
}
else{
if ( !$this->check_salt($params[$f['... | php | private function _check_credentials($params){
if ( $this->check() ){
/** @var array $f The form fields sent to identify the users */
$f =& $this->class_cfg['fields'];
if ( !isset($params[$f['salt']]) ){
$this->set_error(11);
}
else{
if ( !$this->check_salt($params[$f['... | [
"private",
"function",
"_check_credentials",
"(",
"$",
"params",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"check",
"(",
")",
")",
"{",
"/** @var array $f The form fields sent to identify the users */",
"$",
"f",
"=",
"&",
"$",
"this",
"->",
"class_cfg",
"[",
"'... | Checks the credentials of a user
@param array $params
@return mixed | [
"Checks",
"the",
"credentials",
"of",
"a",
"user"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L469-L528 |
nabab/bbn | src/bbn/user.php | user._init_dir | private function _init_dir($create = false){
if ( \defined('BBN_DATA_PATH') && $this->get_id() ){
$this->path = BBN_DATA_PATH.'users/'.$this->get_id().'/';
if ( !\defined('BBN_USER_PATH') ){
define('BBN_USER_PATH', $this->path);
}
if ( $create ){
file\dir::create_path(BBN_USE... | php | private function _init_dir($create = false){
if ( \defined('BBN_DATA_PATH') && $this->get_id() ){
$this->path = BBN_DATA_PATH.'users/'.$this->get_id().'/';
if ( !\defined('BBN_USER_PATH') ){
define('BBN_USER_PATH', $this->path);
}
if ( $create ){
file\dir::create_path(BBN_USE... | [
"private",
"function",
"_init_dir",
"(",
"$",
"create",
"=",
"false",
")",
"{",
"if",
"(",
"\\",
"defined",
"(",
"'BBN_DATA_PATH'",
")",
"&&",
"$",
"this",
"->",
"get_id",
"(",
")",
")",
"{",
"$",
"this",
"->",
"path",
"=",
"BBN_DATA_PATH",
".",
"'us... | If BBN_DATA_PATH is defined creates a directory and removes temp files
@return $this $this | [
"If",
"BBN_DATA_PATH",
"is",
"defined",
"creates",
"a",
"directory",
"and",
"removes",
"temp",
"files"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L534-L546 |
nabab/bbn | src/bbn/user.php | user._authenticate | private function _authenticate($id){
if ( $this->check() && $id ){
$this->id = $id;
$this->auth = 1;
$this->db->update($this->class_cfg['tables']['sessions'], [
$this->class_cfg['arch']['sessions']['id_user'] => $id
], [
$this->class_cfg['arch']['sessions']['id'] => $this->ge... | php | private function _authenticate($id){
if ( $this->check() && $id ){
$this->id = $id;
$this->auth = 1;
$this->db->update($this->class_cfg['tables']['sessions'], [
$this->class_cfg['arch']['sessions']['id_user'] => $id
], [
$this->class_cfg['arch']['sessions']['id'] => $this->ge... | [
"private",
"function",
"_authenticate",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"check",
"(",
")",
"&&",
"$",
"id",
")",
"{",
"$",
"this",
"->",
"id",
"=",
"$",
"id",
";",
"$",
"this",
"->",
"auth",
"=",
"1",
";",
"$",
"this",... | Sets a user as authenticated ($this->auth = 1)
@param int $id
@return $this | [
"Sets",
"a",
"user",
"as",
"authenticated",
"(",
"$this",
"-",
">",
"auth",
"=",
"1",
")"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L553-L564 |
nabab/bbn | src/bbn/user.php | user.get_error | public function get_error(){
if ( $this->error ){
return [
'code' => $this->error,
'text' => $this->class_cfg['errors'][$this->error]
];
}
return false;
} | php | public function get_error(){
if ( $this->error ){
return [
'code' => $this->error,
'text' => $this->class_cfg['errors'][$this->error]
];
}
return false;
} | [
"public",
"function",
"get_error",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"error",
")",
"{",
"return",
"[",
"'code'",
"=>",
"$",
"this",
"->",
"error",
",",
"'text'",
"=>",
"$",
"this",
"->",
"class_cfg",
"[",
"'errors'",
"]",
"[",
"$",
"this... | Returns the last known error and false if there was no error
@return mixed | [
"Returns",
"the",
"last",
"known",
"error",
"and",
"false",
"if",
"there",
"was",
"no",
"error"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L575-L583 |
nabab/bbn | src/bbn/user.php | user.get_print | protected function get_print(string $fp = null){
if ( !$fp ){
$fp = $this->_get_session('fingerprint');
}
if ( $fp ){
return sha1($this->user_agent.$this->accept_lang./*$this->ip_address .*/ $fp);
}
return false;
} | php | protected function get_print(string $fp = null){
if ( !$fp ){
$fp = $this->_get_session('fingerprint');
}
if ( $fp ){
return sha1($this->user_agent.$this->accept_lang./*$this->ip_address .*/ $fp);
}
return false;
} | [
"protected",
"function",
"get_print",
"(",
"string",
"$",
"fp",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"fp",
")",
"{",
"$",
"fp",
"=",
"$",
"this",
"->",
"_get_session",
"(",
"'fingerprint'",
")",
";",
"}",
"if",
"(",
"$",
"fp",
")",
"{",
... | Returns a "print", ie an identifier based on the user agent
@param false|string $fp
@return string | [
"Returns",
"a",
"print",
"ie",
"an",
"identifier",
"based",
"on",
"the",
"user",
"agent"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L590-L598 |
nabab/bbn | src/bbn/user.php | user.record_attempt | protected function record_attempt(){
$this->cfg['num_attempts'] = isset($this->cfg['num_attempts']) ?
$this->cfg['num_attempts']+1 : 1;
$this->_set_session('num_attempts', $this->cfg['num_attempts']);
$this->save_session();
return $this;
} | php | protected function record_attempt(){
$this->cfg['num_attempts'] = isset($this->cfg['num_attempts']) ?
$this->cfg['num_attempts']+1 : 1;
$this->_set_session('num_attempts', $this->cfg['num_attempts']);
$this->save_session();
return $this;
} | [
"protected",
"function",
"record_attempt",
"(",
")",
"{",
"$",
"this",
"->",
"cfg",
"[",
"'num_attempts'",
"]",
"=",
"isset",
"(",
"$",
"this",
"->",
"cfg",
"[",
"'num_attempts'",
"]",
")",
"?",
"$",
"this",
"->",
"cfg",
"[",
"'num_attempts'",
"]",
"+"... | Increment the num_attempt variable
@return $this | [
"Increment",
"the",
"num_attempt",
"variable"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L612-L618 |
nabab/bbn | src/bbn/user.php | user.get_cfg | public function get_cfg($attr = ''){
if ( $this->check() ){
if ( !$this->cfg ){
$this->cfg = $this->session->get('cfg');
}
if ( empty($attr) ){
return $this->cfg;
}
if ( isset($this->cfg[$attr]) ){
return $this->cfg[$attr];
}
return false;
}
} | php | public function get_cfg($attr = ''){
if ( $this->check() ){
if ( !$this->cfg ){
$this->cfg = $this->session->get('cfg');
}
if ( empty($attr) ){
return $this->cfg;
}
if ( isset($this->cfg[$attr]) ){
return $this->cfg[$attr];
}
return false;
}
} | [
"public",
"function",
"get_cfg",
"(",
"$",
"attr",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"check",
"(",
")",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"cfg",
")",
"{",
"$",
"this",
"->",
"cfg",
"=",
"$",
"this",
"->",
"session"... | Returns the current user's configuration.
@param string $attr
@return mixed | [
"Returns",
"the",
"current",
"user",
"s",
"configuration",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L698-L711 |
nabab/bbn | src/bbn/user.php | user.get_fields | public function get_fields(string $table = ''): ?array
{
if ( !empty($this->class_cfg) ){
if ( $table ){
return $this->class_cfg['arch'][$table] ?? null;
}
return $this->class_cfg['arch'];
}
return null;
} | php | public function get_fields(string $table = ''): ?array
{
if ( !empty($this->class_cfg) ){
if ( $table ){
return $this->class_cfg['arch'][$table] ?? null;
}
return $this->class_cfg['arch'];
}
return null;
} | [
"public",
"function",
"get_fields",
"(",
"string",
"$",
"table",
"=",
"''",
")",
":",
"?",
"array",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"class_cfg",
")",
")",
"{",
"if",
"(",
"$",
"table",
")",
"{",
"return",
"$",
"this",
"->",
... | Returns the list of fields of the given table, and if empty the list of fields for each table.
@param string $table
@return array|null | [
"Returns",
"the",
"list",
"of",
"fields",
"of",
"the",
"given",
"table",
"and",
"if",
"empty",
"the",
"list",
"of",
"fields",
"for",
"each",
"table",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L759-L768 |
nabab/bbn | src/bbn/user.php | user.update_info | public function update_info(array $d)
{
if ( $this->check_session() ){
$update = [];
foreach ( $d as $key => $val ){
if (
($key !== $this->fields['id']) &&
($key !== $this->fields['cfg']) &&
($key !== 'auth') &&
($key !== 'pass') &&
\in_array($... | php | public function update_info(array $d)
{
if ( $this->check_session() ){
$update = [];
foreach ( $d as $key => $val ){
if (
($key !== $this->fields['id']) &&
($key !== $this->fields['cfg']) &&
($key !== 'auth') &&
($key !== 'pass') &&
\in_array($... | [
"public",
"function",
"update_info",
"(",
"array",
"$",
"d",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"check_session",
"(",
")",
")",
"{",
"$",
"update",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"d",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",... | Changes the data in the user's table.
@param array $d The new data
@return bool | [
"Changes",
"the",
"data",
"in",
"the",
"user",
"s",
"table",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L777-L804 |
nabab/bbn | src/bbn/user.php | user.set_session | public function set_session($attr){
if ( $this->session->has(self::$un) ){
$args = \func_get_args();
if ( (\count($args) === 2) && \is_string($args[0]) ){
$attr = [$args[0] => $args[1]];
}
foreach ( $attr as $key => $val ){
if ( \is_string($key) ){
$this->session->s... | php | public function set_session($attr){
if ( $this->session->has(self::$un) ){
$args = \func_get_args();
if ( (\count($args) === 2) && \is_string($args[0]) ){
$attr = [$args[0] => $args[1]];
}
foreach ( $attr as $key => $val ){
if ( \is_string($key) ){
$this->session->s... | [
"public",
"function",
"set_session",
"(",
"$",
"attr",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"session",
"->",
"has",
"(",
"self",
"::",
"$",
"un",
")",
")",
"{",
"$",
"args",
"=",
"\\",
"func_get_args",
"(",
")",
";",
"if",
"(",
"(",
"\\",
"c... | Sets the given attribute(s) in the user's session.
@return $this | [
"Sets",
"the",
"given",
"attribute",
"(",
"s",
")",
"in",
"the",
"user",
"s",
"session",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L833-L846 |
nabab/bbn | src/bbn/user.php | user.get_session | public function get_session($attr = null){
if ( $this->session->has(self::$un) ){
return $attr ? $this->session->get(self::$un, $attr) : $this->session->get(self::$un);
}
} | php | public function get_session($attr = null){
if ( $this->session->has(self::$un) ){
return $attr ? $this->session->get(self::$un, $attr) : $this->session->get(self::$un);
}
} | [
"public",
"function",
"get_session",
"(",
"$",
"attr",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"session",
"->",
"has",
"(",
"self",
"::",
"$",
"un",
")",
")",
"{",
"return",
"$",
"attr",
"?",
"$",
"this",
"->",
"session",
"->",
"get"... | Returns session property from the session's user array.
@param null|string The property to get
@return mixed | [
"Returns",
"session",
"property",
"from",
"the",
"session",
"s",
"user",
"array",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L854-L858 |
nabab/bbn | src/bbn/user.php | user.save_session | public function save_session(): self
{
$id_session = $this->get_id_session();
//die(var_dump($id_session, $this->check()));
if ( $id_session && $this->check() ){
$p =& $this->class_cfg['arch']['sessions'];
$this->db->update($this->class_cfg['tables']['sessions'], [
$p['id_user'] => $th... | php | public function save_session(): self
{
$id_session = $this->get_id_session();
//die(var_dump($id_session, $this->check()));
if ( $id_session && $this->check() ){
$p =& $this->class_cfg['arch']['sessions'];
$this->db->update($this->class_cfg['tables']['sessions'], [
$p['id_user'] => $th... | [
"public",
"function",
"save_session",
"(",
")",
":",
"self",
"{",
"$",
"id_session",
"=",
"$",
"this",
"->",
"get_id_session",
"(",
")",
";",
"//die(var_dump($id_session, $this->check()));",
"if",
"(",
"$",
"id_session",
"&&",
"$",
"this",
"->",
"check",
"(",
... | Saves the session config in the database.
@return $this | [
"Saves",
"the",
"session",
"config",
"in",
"the",
"database",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L893-L915 |
nabab/bbn | src/bbn/user.php | user.close_session | public function close_session($with_session = false): self
{
$p =& $this->class_cfg['arch']['sessions'];
$this->db->update($this->class_cfg['tables']['sessions'], [
$p['ip_address'] => $this->ip_address,
$p['user_agent'] => $this->user_agent,
$p['opened'] => 0,
$p['last_activit... | php | public function close_session($with_session = false): self
{
$p =& $this->class_cfg['arch']['sessions'];
$this->db->update($this->class_cfg['tables']['sessions'], [
$p['ip_address'] => $this->ip_address,
$p['user_agent'] => $this->user_agent,
$p['opened'] => 0,
$p['last_activit... | [
"public",
"function",
"close_session",
"(",
"$",
"with_session",
"=",
"false",
")",
":",
"self",
"{",
"$",
"p",
"=",
"&",
"$",
"this",
"->",
"class_cfg",
"[",
"'arch'",
"]",
"[",
"'sessions'",
"]",
";",
"$",
"this",
"->",
"db",
"->",
"update",
"(",
... | Closes the session in the database, and if $with_session is true, deletes also the session information.
@param bool $with_session
@return user | [
"Closes",
"the",
"session",
"in",
"the",
"database",
"and",
"if",
"$with_session",
"is",
"true",
"deletes",
"also",
"the",
"session",
"information",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L923-L946 |
nabab/bbn | src/bbn/user.php | user.check_attempts | public function check_attempts(): bool
{
if ( !isset($this->cfg) ){
return false;
}
//die(var_dump($this->session->get('num_attempts'), $this->sess_cfg, $this->session->get('attempts')));
if ( isset($this->cfg['num_attempts']) && $this->cfg['num_attempts'] > $this->class_cfg['max_attempts'] ){
... | php | public function check_attempts(): bool
{
if ( !isset($this->cfg) ){
return false;
}
//die(var_dump($this->session->get('num_attempts'), $this->sess_cfg, $this->session->get('attempts')));
if ( isset($this->cfg['num_attempts']) && $this->cfg['num_attempts'] > $this->class_cfg['max_attempts'] ){
... | [
"public",
"function",
"check_attempts",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"cfg",
")",
")",
"{",
"return",
"false",
";",
"}",
"//die(var_dump($this->session->get('num_attempts'), $this->sess_cfg, $this->session->get('attempts'... | Returns false if the max number of connections attempts has been reached
@return bool | [
"Returns",
"false",
"if",
"the",
"max",
"number",
"of",
"connections",
"attempts",
"has",
"been",
"reached"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L952-L963 |
nabab/bbn | src/bbn/user.php | user.save_cfg | public function save_cfg()
{
if ( $this->check() ){
$this->db->update(
$this->class_cfg['tables']['users'],
[$this->fields['cfg'] => json_encode($this->cfg)],
[$this->fields['id'] => $this->id]);
}
return $this;
} | php | public function save_cfg()
{
if ( $this->check() ){
$this->db->update(
$this->class_cfg['tables']['users'],
[$this->fields['cfg'] => json_encode($this->cfg)],
[$this->fields['id'] => $this->id]);
}
return $this;
} | [
"public",
"function",
"save_cfg",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"check",
"(",
")",
")",
"{",
"$",
"this",
"->",
"db",
"->",
"update",
"(",
"$",
"this",
"->",
"class_cfg",
"[",
"'tables'",
"]",
"[",
"'users'",
"]",
",",
"[",
"$",
... | Saves the user's config in the cfg field of the users' table
return connection | [
"Saves",
"the",
"user",
"s",
"config",
"in",
"the",
"cfg",
"field",
"of",
"the",
"users",
"table",
"return",
"connection"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L969-L978 |
nabab/bbn | src/bbn/user.php | user.set_cfg | public function set_cfg($attr){
if ( null !== $this->cfg ){
$args = \func_get_args();
if ( (\count($args) === 2) && \is_string($attr) ){
/** @var array $attr */
$attr = [$args[0] => $args[1]];
}
foreach ( $attr as $key => $val ){
if ( \is_string($key) ){
$th... | php | public function set_cfg($attr){
if ( null !== $this->cfg ){
$args = \func_get_args();
if ( (\count($args) === 2) && \is_string($attr) ){
/** @var array $attr */
$attr = [$args[0] => $args[1]];
}
foreach ( $attr as $key => $val ){
if ( \is_string($key) ){
$th... | [
"public",
"function",
"set_cfg",
"(",
"$",
"attr",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"cfg",
")",
"{",
"$",
"args",
"=",
"\\",
"func_get_args",
"(",
")",
";",
"if",
"(",
"(",
"\\",
"count",
"(",
"$",
"args",
")",
"===",
"2",... | return connection | [
"return",
"connection"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L983-L998 |
nabab/bbn | src/bbn/user.php | user.set_password | public function set_password($old_pass, $new_pass){
if ( $this->auth ){
$pwt = $this->class_cfg['tables']['passwords'];
$pwa = $this->class_cfg['arch']['passwords'];
$stored_pass = $this->db->select_one($pwt, $pwa['pass'], [
$this->class_cfg['arch']['passwords']['id_user'] => $this->id
... | php | public function set_password($old_pass, $new_pass){
if ( $this->auth ){
$pwt = $this->class_cfg['tables']['passwords'];
$pwa = $this->class_cfg['arch']['passwords'];
$stored_pass = $this->db->select_one($pwt, $pwa['pass'], [
$this->class_cfg['arch']['passwords']['id_user'] => $this->id
... | [
"public",
"function",
"set_password",
"(",
"$",
"old_pass",
",",
"$",
"new_pass",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"auth",
")",
"{",
"$",
"pwt",
"=",
"$",
"this",
"->",
"class_cfg",
"[",
"'tables'",
"]",
"[",
"'passwords'",
"]",
";",
"$",
"p... | Change the password in the database after checking the current one
@return boolean | [
"Change",
"the",
"password",
"in",
"the",
"database",
"after",
"checking",
"the",
"current",
"one"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L1143-L1157 |
nabab/bbn | src/bbn/user.php | user.force_password | public function force_password($pass, $id){
if ( $this->check() ){
return $this->db->insert($this->class_cfg['tables']['passwords'], [
$this->class_cfg['arch']['passwords']['pass'] => $this->_crypt($pass),
$this->class_cfg['arch']['passwords']['id_user'] => $id,
$this->class_cfg['arch'... | php | public function force_password($pass, $id){
if ( $this->check() ){
return $this->db->insert($this->class_cfg['tables']['passwords'], [
$this->class_cfg['arch']['passwords']['pass'] => $this->_crypt($pass),
$this->class_cfg['arch']['passwords']['id_user'] => $id,
$this->class_cfg['arch'... | [
"public",
"function",
"force_password",
"(",
"$",
"pass",
",",
"$",
"id",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"check",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"db",
"->",
"insert",
"(",
"$",
"this",
"->",
"class_cfg",
"[",
"'tables'",
... | Change the password in the database
@return boolean | [
"Change",
"the",
"password",
"in",
"the",
"database"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L1163-L1172 |
nabab/bbn | src/bbn/user.php | user.get_name | public function get_name($usr = null){
if ( $this->auth ){
if ( \is_null($usr) ){
$usr = $this->get_session();
}
else if ( str::is_uid($usr) ){
$mgr = $this->get_manager();
$usr = $mgr->get_user($usr);
}
if ( isset($usr[$this->class_cfg['show']]) ){
retu... | php | public function get_name($usr = null){
if ( $this->auth ){
if ( \is_null($usr) ){
$usr = $this->get_session();
}
else if ( str::is_uid($usr) ){
$mgr = $this->get_manager();
$usr = $mgr->get_user($usr);
}
if ( isset($usr[$this->class_cfg['show']]) ){
retu... | [
"public",
"function",
"get_name",
"(",
"$",
"usr",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"auth",
")",
"{",
"if",
"(",
"\\",
"is_null",
"(",
"$",
"usr",
")",
")",
"{",
"$",
"usr",
"=",
"$",
"this",
"->",
"get_session",
"(",
")",
... | Returns the written name of this or a user
@return string|false | [
"Returns",
"the",
"written",
"name",
"of",
"this",
"or",
"a",
"user"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user.php#L1178-L1192 |
atoum/autoloop-extension | classes/configuration.php | configuration.unserialize | public static function unserialize(array $config)
{
$configuration = new static;
if (false !== ($clientConfiguration = unserialize($config['watched_files']))) {
$configuration->set($clientConfiguration);
}
return $configuration;
} | php | public static function unserialize(array $config)
{
$configuration = new static;
if (false !== ($clientConfiguration = unserialize($config['watched_files']))) {
$configuration->set($clientConfiguration);
}
return $configuration;
} | [
"public",
"static",
"function",
"unserialize",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"configuration",
"=",
"new",
"static",
";",
"if",
"(",
"false",
"!==",
"(",
"$",
"clientConfiguration",
"=",
"unserialize",
"(",
"$",
"config",
"[",
"'watched_files'",... | @param array $config
@return configuration | [
"@param",
"array",
"$config"
] | train | https://github.com/atoum/autoloop-extension/blob/0aaf1c4e01540607a5f25af9f09ddb1be8cc17b7/classes/configuration.php#L27-L36 |
php-lug/lug | src/Bundle/ResourceBundle/AbstractResourceBundle.php | AbstractResourceBundle.getResources | public function getResources()
{
if ($this->resources === null) {
$this->resources = $this->createResources($this->driver);
}
return $this->resources;
} | php | public function getResources()
{
if ($this->resources === null) {
$this->resources = $this->createResources($this->driver);
}
return $this->resources;
} | [
"public",
"function",
"getResources",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"resources",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"resources",
"=",
"$",
"this",
"->",
"createResources",
"(",
"$",
"this",
"->",
"driver",
")",
";",
"}",
"retu... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/AbstractResourceBundle.php#L45-L52 |
AOEpeople/Aoe_Layout | app/code/local/Aoe/Layout/Block/Widget/Grid/Column/Renderer/Action.php | Aoe_Layout_Block_Widget_Grid_Column_Renderer_Action.render | public function render(Varien_Object $row)
{
$renderActions = [];
$actions = $this->getColumn()->getActions();
if (is_array($actions)) {
foreach ($actions as $action) {
if (isset($action['checks'])) {
$fail = false;
$checks... | php | public function render(Varien_Object $row)
{
$renderActions = [];
$actions = $this->getColumn()->getActions();
if (is_array($actions)) {
foreach ($actions as $action) {
if (isset($action['checks'])) {
$fail = false;
$checks... | [
"public",
"function",
"render",
"(",
"Varien_Object",
"$",
"row",
")",
"{",
"$",
"renderActions",
"=",
"[",
"]",
";",
"$",
"actions",
"=",
"$",
"this",
"->",
"getColumn",
"(",
")",
"->",
"getActions",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
... | Renders column
@param Varien_Object $row
@return string | [
"Renders",
"column"
] | train | https://github.com/AOEpeople/Aoe_Layout/blob/d88ba3406cf12dbaf09548477133c3cb27d155ed/app/code/local/Aoe/Layout/Block/Widget/Grid/Column/Renderer/Action.php#L12-L65 |
endroid/import-bundle | src/DependencyInjection/EndroidImportExtension.php | EndroidImportExtension.load | public function load(array $configs, ContainerBuilder $container)
{
$processor = new Processor();
$config = $processor->processConfiguration(new Configuration(), $configs);
$taggedServices = $container->findTaggedServiceIds('endroid.import.importer');
foreach ($taggedServices as $i... | php | public function load(array $configs, ContainerBuilder $container)
{
$processor = new Processor();
$config = $processor->processConfiguration(new Configuration(), $configs);
$taggedServices = $container->findTaggedServiceIds('endroid.import.importer');
foreach ($taggedServices as $i... | [
"public",
"function",
"load",
"(",
"array",
"$",
"configs",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"processor",
"=",
"new",
"Processor",
"(",
")",
";",
"$",
"config",
"=",
"$",
"processor",
"->",
"processConfiguration",
"(",
"new",
"Conf... | {@inheritdoc} | [
"{"
] | train | https://github.com/endroid/import-bundle/blob/637f29720822432192efad6993f505adc9dd4af4/src/DependencyInjection/EndroidImportExtension.php#L23-L35 |
mothership-ec/composer | src/Composer/Config.php | Config.merge | public function merge($config)
{
// override defaults with given config
if (!empty($config['config']) && is_array($config['config'])) {
foreach ($config['config'] as $key => $val) {
if (in_array($key, array('github-oauth', 'http-basic')) && isset($this->config[$key])) {
... | php | public function merge($config)
{
// override defaults with given config
if (!empty($config['config']) && is_array($config['config'])) {
foreach ($config['config'] as $key => $val) {
if (in_array($key, array('github-oauth', 'http-basic')) && isset($this->config[$key])) {
... | [
"public",
"function",
"merge",
"(",
"$",
"config",
")",
"{",
"// override defaults with given config",
"if",
"(",
"!",
"empty",
"(",
"$",
"config",
"[",
"'config'",
"]",
")",
"&&",
"is_array",
"(",
"$",
"config",
"[",
"'config'",
"]",
")",
")",
"{",
"for... | Merges new config values with the existing ones (overriding)
@param array $config | [
"Merges",
"new",
"config",
"values",
"with",
"the",
"existing",
"ones",
"(",
"overriding",
")"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Config.php#L106-L144 |
mothership-ec/composer | src/Composer/Config.php | Config.get | public function get($key, $flags = 0)
{
switch ($key) {
case 'vendor-dir':
case 'bin-dir':
case 'process-timeout':
case 'cache-dir':
case 'cache-files-dir':
case 'cache-repo-dir':
case 'cache-vcs-dir':
// con... | php | public function get($key, $flags = 0)
{
switch ($key) {
case 'vendor-dir':
case 'bin-dir':
case 'process-timeout':
case 'cache-dir':
case 'cache-files-dir':
case 'cache-repo-dir':
case 'cache-vcs-dir':
// con... | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"flags",
"=",
"0",
")",
"{",
"switch",
"(",
"$",
"key",
")",
"{",
"case",
"'vendor-dir'",
":",
"case",
"'bin-dir'",
":",
"case",
"'process-timeout'",
":",
"case",
"'cache-dir'",
":",
"case",
"'cac... | Returns a setting
@param string $key
@param int $flags Options (see class constants)
@throws \RuntimeException
@return mixed | [
"Returns",
"a",
"setting"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Config.php#L162-L257 |
mothership-ec/composer | src/Composer/Config.php | Config.realpath | private function realpath($path)
{
if (substr($path, 0, 1) === '/' || substr($path, 1, 1) === ':') {
return $path;
}
return $this->baseDir . '/' . $path;
} | php | private function realpath($path)
{
if (substr($path, 0, 1) === '/' || substr($path, 1, 1) === ':') {
return $path;
}
return $this->baseDir . '/' . $path;
} | [
"private",
"function",
"realpath",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"path",
",",
"0",
",",
"1",
")",
"===",
"'/'",
"||",
"substr",
"(",
"$",
"path",
",",
"1",
",",
"1",
")",
"===",
"':'",
")",
"{",
"return",
"$",
"pa... | Turns relative paths in absolute paths without realpath()
Since the dirs might not exist yet we can not call realpath or it will fail.
@param string $path
@return string | [
"Turns",
"relative",
"paths",
"in",
"absolute",
"paths",
"without",
"realpath",
"()"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Config.php#L318-L325 |
CalderaWP/metaplate-core | src/data.php | data.get_active_metaplates | public static function get_active_metaplates( ) {
global $post;
if( empty( $post ) ){ return; } // no post - return
// GET METAPLATEs
$metaplates = self::get_registry();
$meta_stack = array();
if ( is_array( $metaplates ) ) {
foreach ( $metaplates as $metaplate_try ) {
$is_plate = self::get_metapl... | php | public static function get_active_metaplates( ) {
global $post;
if( empty( $post ) ){ return; } // no post - return
// GET METAPLATEs
$metaplates = self::get_registry();
$meta_stack = array();
if ( is_array( $metaplates ) ) {
foreach ( $metaplates as $metaplate_try ) {
$is_plate = self::get_metapl... | [
"public",
"static",
"function",
"get_active_metaplates",
"(",
")",
"{",
"global",
"$",
"post",
";",
"if",
"(",
"empty",
"(",
"$",
"post",
")",
")",
"{",
"return",
";",
"}",
"// no post - return",
"// GET METAPLATEs",
"$",
"metaplates",
"=",
"self",
"::",
"... | Get the metaplates for the post
@return array active metaplates for this post type | [
"Get",
"the",
"metaplates",
"for",
"the",
"post"
] | train | https://github.com/CalderaWP/metaplate-core/blob/15ede9c4250ab23112a32f8e45d5393f8278bbb8/src/data.php#L31-L65 |
CalderaWP/metaplate-core | src/data.php | data.get_custom_field_data | public static function get_custom_field_data( $post_id ) {
global $post;
if ( ! is_object( $post ) ) {
$post = get_post( $post_id );
}
$raw_data = get_post_meta( $post_id );
if ( ! is_array( $raw_data ) ) {
return;
}
// init the data array
$template_data = array();
// add taxonomies i... | php | public static function get_custom_field_data( $post_id ) {
global $post;
if ( ! is_object( $post ) ) {
$post = get_post( $post_id );
}
$raw_data = get_post_meta( $post_id );
if ( ! is_array( $raw_data ) ) {
return;
}
// init the data array
$template_data = array();
// add taxonomies i... | [
"public",
"static",
"function",
"get_custom_field_data",
"(",
"$",
"post_id",
")",
"{",
"global",
"$",
"post",
";",
"if",
"(",
"!",
"is_object",
"(",
"$",
"post",
")",
")",
"{",
"$",
"post",
"=",
"get_post",
"(",
"$",
"post_id",
")",
";",
"}",
"$",
... | Merge in Custom field data, meta and post data
@return array array with merged data | [
"Merge",
"in",
"Custom",
"field",
"data",
"meta",
"and",
"post",
"data"
] | train | https://github.com/CalderaWP/metaplate-core/blob/15ede9c4250ab23112a32f8e45d5393f8278bbb8/src/data.php#L72-L154 |
CalderaWP/metaplate-core | src/data.php | data.get_metaplate | public static function get_metaplate( $id ) {
$metaplates = self::get_registry();
if ( array_key_exists( $id, $metaplates ) ) {
$metaplate = get_option( $id );
}
else {
$metaplate = self::get_metaplate_id_by_slug( $id );
if ( is_string( $metaplate ) ) {
$metaplate = self::get_metaplate( $metaplate ... | php | public static function get_metaplate( $id ) {
$metaplates = self::get_registry();
if ( array_key_exists( $id, $metaplates ) ) {
$metaplate = get_option( $id );
}
else {
$metaplate = self::get_metaplate_id_by_slug( $id );
if ( is_string( $metaplate ) ) {
$metaplate = self::get_metaplate( $metaplate ... | [
"public",
"static",
"function",
"get_metaplate",
"(",
"$",
"id",
")",
"{",
"$",
"metaplates",
"=",
"self",
"::",
"get_registry",
"(",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"id",
",",
"$",
"metaplates",
")",
")",
"{",
"$",
"metaplate",
"=",... | Get a metaplate by ID or slug
@param string $id
@return array|bool | [
"Get",
"a",
"metaplate",
"by",
"ID",
"or",
"slug"
] | train | https://github.com/CalderaWP/metaplate-core/blob/15ede9c4250ab23112a32f8e45d5393f8278bbb8/src/data.php#L163-L189 |
CalderaWP/metaplate-core | src/data.php | data.code | private static function code( $metaplate ) {
foreach ( array( 'html', 'js', 'css' ) as $field ) {
if ( isset( $metaplate[ $field ] ) ) {
if ( is_object( $metaplate[ $field ] ) ) {
$value = $metaplate[ $field ];
$value = $value->code;
unset( $metaplate[ $field ] );
$metaplate[ $field ]['code... | php | private static function code( $metaplate ) {
foreach ( array( 'html', 'js', 'css' ) as $field ) {
if ( isset( $metaplate[ $field ] ) ) {
if ( is_object( $metaplate[ $field ] ) ) {
$value = $metaplate[ $field ];
$value = $value->code;
unset( $metaplate[ $field ] );
$metaplate[ $field ]['code... | [
"private",
"static",
"function",
"code",
"(",
"$",
"metaplate",
")",
"{",
"foreach",
"(",
"array",
"(",
"'html'",
",",
"'js'",
",",
"'css'",
")",
"as",
"$",
"field",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"metaplate",
"[",
"$",
"field",
"]",
")",
... | Make sure the code fields are arrays not objects and are set
@param array $metaplate The metaplate
@return array The metaplate with the code fields as arrays | [
"Make",
"sure",
"the",
"code",
"fields",
"are",
"arrays",
"not",
"objects",
"and",
"are",
"set"
] | train | https://github.com/CalderaWP/metaplate-core/blob/15ede9c4250ab23112a32f8e45d5393f8278bbb8/src/data.php#L198-L216 |
CalderaWP/metaplate-core | src/data.php | data.get_metaplate_id_by_slug | public static function get_metaplate_id_by_slug( $slug, $metaplates = null ) {
if ( is_null( $metaplates ) ) {
$metaplates = self::get_registry();
}
if ( is_array( $metaplates ) ) {
$search = wp_list_pluck( $metaplates, 'slug' );
return array_search( $slug, $search );
}
return false;
} | php | public static function get_metaplate_id_by_slug( $slug, $metaplates = null ) {
if ( is_null( $metaplates ) ) {
$metaplates = self::get_registry();
}
if ( is_array( $metaplates ) ) {
$search = wp_list_pluck( $metaplates, 'slug' );
return array_search( $slug, $search );
}
return false;
} | [
"public",
"static",
"function",
"get_metaplate_id_by_slug",
"(",
"$",
"slug",
",",
"$",
"metaplates",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"metaplates",
")",
")",
"{",
"$",
"metaplates",
"=",
"self",
"::",
"get_registry",
"(",
")",
";",... | Get a metaplate's ID using its slug
@param string $slug The metaplate's slug.
@param null|array $metaplates Optional. The metaplate registry to look in.
@return bool|array | [
"Get",
"a",
"metaplate",
"s",
"ID",
"using",
"its",
"slug"
] | train | https://github.com/CalderaWP/metaplate-core/blob/15ede9c4250ab23112a32f8e45d5393f8278bbb8/src/data.php#L235-L247 |
CalderaWP/metaplate-core | src/data.php | data.update_registry | public static function update_registry( $new_value, $id ) {
$registry = self::get_registry();
$registry[ $id ] = $new_value;
return update_option( self::$registry_option_name, $registry );
} | php | public static function update_registry( $new_value, $id ) {
$registry = self::get_registry();
$registry[ $id ] = $new_value;
return update_option( self::$registry_option_name, $registry );
} | [
"public",
"static",
"function",
"update_registry",
"(",
"$",
"new_value",
",",
"$",
"id",
")",
"{",
"$",
"registry",
"=",
"self",
"::",
"get_registry",
"(",
")",
";",
"$",
"registry",
"[",
"$",
"id",
"]",
"=",
"$",
"new_value",
";",
"return",
"update_o... | Update registry of metaplates
Note: Does not save the metaplate itself.
@param array $new_value The new item to add.
@param string $id Id of new item to add.
@return bool | [
"Update",
"registry",
"of",
"metaplates"
] | train | https://github.com/CalderaWP/metaplate-core/blob/15ede9c4250ab23112a32f8e45d5393f8278bbb8/src/data.php#L259-L265 |
zhouyl/mellivora | Mellivora/Support/Facades/Facade.php | Facade.resolveFacadeInstance | protected static function resolveFacadeInstance($name)
{
if (is_object($name)) {
return $name;
}
if (isset(static::$resolvedInstance[$name])) {
return static::$resolvedInstance[$name];
}
return static::$resolvedInstance[$name] = static::$app->getCont... | php | protected static function resolveFacadeInstance($name)
{
if (is_object($name)) {
return $name;
}
if (isset(static::$resolvedInstance[$name])) {
return static::$resolvedInstance[$name];
}
return static::$resolvedInstance[$name] = static::$app->getCont... | [
"protected",
"static",
"function",
"resolveFacadeInstance",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"name",
")",
")",
"{",
"return",
"$",
"name",
";",
"}",
"if",
"(",
"isset",
"(",
"static",
"::",
"$",
"resolvedInstance",
"[",
"$"... | Resolve the facade root instance from the container.
@param object|string $name
@return mixed | [
"Resolve",
"the",
"facade",
"root",
"instance",
"from",
"the",
"container",
"."
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Support/Facades/Facade.php#L55-L66 |
mothership-ec/composer | src/Composer/DependencyResolver/Pool.php | Pool.whatProvides | public function whatProvides($name, LinkConstraintInterface $constraint = null, $mustMatchName = false)
{
$key = ((int) $mustMatchName).$constraint;
if (isset($this->providerCache[$name][$key])) {
return $this->providerCache[$name][$key];
}
return $this->providerCache[$n... | php | public function whatProvides($name, LinkConstraintInterface $constraint = null, $mustMatchName = false)
{
$key = ((int) $mustMatchName).$constraint;
if (isset($this->providerCache[$name][$key])) {
return $this->providerCache[$name][$key];
}
return $this->providerCache[$n... | [
"public",
"function",
"whatProvides",
"(",
"$",
"name",
",",
"LinkConstraintInterface",
"$",
"constraint",
"=",
"null",
",",
"$",
"mustMatchName",
"=",
"false",
")",
"{",
"$",
"key",
"=",
"(",
"(",
"int",
")",
"$",
"mustMatchName",
")",
".",
"$",
"constr... | Searches all packages providing the given package name and match the constraint
@param string $name The package name to be searched for
@param LinkConstraintInterface $constraint A constraint that all returned
packages must match or null to return all
@param bool $mus... | [
"Searches",
"all",
"packages",
"providing",
"the",
"given",
"package",
"name",
"and",
"match",
"the",
"constraint"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/DependencyResolver/Pool.php#L173-L181 |
mothership-ec/composer | src/Composer/DependencyResolver/Pool.php | Pool.match | private function match($candidate, $name, LinkConstraintInterface $constraint = null)
{
$candidateName = $candidate->getName();
$candidateVersion = $candidate->getVersion();
$isDev = $candidate->getStability() === 'dev';
$isAlias = $candidate instanceof AliasPackage;
if (!$i... | php | private function match($candidate, $name, LinkConstraintInterface $constraint = null)
{
$candidateName = $candidate->getName();
$candidateVersion = $candidate->getVersion();
$isDev = $candidate->getStability() === 'dev';
$isAlias = $candidate instanceof AliasPackage;
if (!$i... | [
"private",
"function",
"match",
"(",
"$",
"candidate",
",",
"$",
"name",
",",
"LinkConstraintInterface",
"$",
"constraint",
"=",
"null",
")",
"{",
"$",
"candidateName",
"=",
"$",
"candidate",
"->",
"getName",
"(",
")",
";",
"$",
"candidateVersion",
"=",
"$... | Checks if the package matches the given constraint directly or through
provided or replaced packages
@param array|PackageInterface $candidate
@param string $name Name of the package to be matched
@param LinkConstraintInterface $constraint The constraint to verify
@return int ... | [
"Checks",
"if",
"the",
"package",
"matches",
"the",
"given",
"constraint",
"directly",
"or",
"through",
"provided",
"or",
"replaced",
"packages"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/DependencyResolver/Pool.php#L317-L369 |
ekuiter/feature-php | FeaturePhp/Model/Feature.php | Feature.fromNode | public static function fromNode($node, $parent) {
if (is_null($node["value"]))
return new Feature($node, $parent, $node->children());
else
return new ValueFeature($node, $parent, $node->children());
} | php | public static function fromNode($node, $parent) {
if (is_null($node["value"]))
return new Feature($node, $parent, $node->children());
else
return new ValueFeature($node, $parent, $node->children());
} | [
"public",
"static",
"function",
"fromNode",
"(",
"$",
"node",
",",
"$",
"parent",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"node",
"[",
"\"value\"",
"]",
")",
")",
"return",
"new",
"Feature",
"(",
"$",
"node",
",",
"$",
"parent",
",",
"$",
"node",... | Creates a feature from an XML node.
@param \SimpleXMLElement $node
@param \SimpleXMLElement $parent
@return Feature | [
"Creates",
"a",
"feature",
"from",
"an",
"XML",
"node",
"."
] | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Model/Feature.php#L94-L99 |
ekuiter/feature-php | FeaturePhp/Model/Feature.php | Feature.findByName | public static function findByName($features, $featureName, $permissive = false) {
if ($permissive)
$featureName = self::_getPermissiveName($featureName);
return fphp\Helper\_Array::findByKey($features, $permissive ? "getPermissiveName" : "getName", $featureName);
} | php | public static function findByName($features, $featureName, $permissive = false) {
if ($permissive)
$featureName = self::_getPermissiveName($featureName);
return fphp\Helper\_Array::findByKey($features, $permissive ? "getPermissiveName" : "getName", $featureName);
} | [
"public",
"static",
"function",
"findByName",
"(",
"$",
"features",
",",
"$",
"featureName",
",",
"$",
"permissive",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"permissive",
")",
"$",
"featureName",
"=",
"self",
"::",
"_getPermissiveName",
"(",
"$",
"featureN... | Finds a feature by its name in a list of features.
Permissive search ignores case and substitutes hyphens.
@param Feature[] $features
@param string $featureName
@param bool $permissive
@return Feature | [
"Finds",
"a",
"feature",
"by",
"its",
"name",
"in",
"a",
"list",
"of",
"features",
".",
"Permissive",
"search",
"ignores",
"case",
"and",
"substitutes",
"hyphens",
"."
] | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Model/Feature.php#L198-L202 |
mergado/mergado-api-client-php | src/mergadoclient/ApiClient.php | ApiClient.get | public function get()
{
$builtUrl = $this->urlBuilder->buildUrl();
$this->urlBuilder->resetUrl();
return $this->http->request($builtUrl, 'GET');
} | php | public function get()
{
$builtUrl = $this->urlBuilder->buildUrl();
$this->urlBuilder->resetUrl();
return $this->http->request($builtUrl, 'GET');
} | [
"public",
"function",
"get",
"(",
")",
"{",
"$",
"builtUrl",
"=",
"$",
"this",
"->",
"urlBuilder",
"->",
"buildUrl",
"(",
")",
";",
"$",
"this",
"->",
"urlBuilder",
"->",
"resetUrl",
"(",
")",
";",
"return",
"$",
"this",
"->",
"http",
"->",
"request"... | Get resource
@return string | [
"Get",
"resource"
] | train | https://github.com/mergado/mergado-api-client-php/blob/6c13b994a81bf5a3d6f3f791ea1dfbe2c420565f/src/mergadoclient/ApiClient.php#L75-L80 |
kinnngg/swat4query | src/Kinnngg/Swat4query/Server.php | Server.GetItemInfo | public static function GetItemInfo($itemname, $itemchunks)
{
$retval = "-";
for ($i=0;$i<count($itemchunks);$i++)
if (strcasecmp($itemchunks[$i], $itemname) == 0) $retval = $itemchunks[$i+1];
return $retval;
} | php | public static function GetItemInfo($itemname, $itemchunks)
{
$retval = "-";
for ($i=0;$i<count($itemchunks);$i++)
if (strcasecmp($itemchunks[$i], $itemname) == 0) $retval = $itemchunks[$i+1];
return $retval;
} | [
"public",
"static",
"function",
"GetItemInfo",
"(",
"$",
"itemname",
",",
"$",
"itemchunks",
")",
"{",
"$",
"retval",
"=",
"\"-\"",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"count",
"(",
"$",
"itemchunks",
")",
";",
"$",
"i",
"++"... | A Helper Function.
Returns Item Info from chunk.
@param [type] $itemname [description]
@param [type] $itemchunks [description] | [
"A",
"Helper",
"Function",
".",
"Returns",
"Item",
"Info",
"from",
"chunk",
"."
] | train | https://github.com/kinnngg/swat4query/blob/d01ce8595228f2e3e13f63b138611604a483a982/src/Kinnngg/Swat4query/Server.php#L145-L151 |
kinnngg/swat4query | src/Kinnngg/Swat4query/Server.php | Server.FontCodes | public static function FontCodes($text,$advanced=TRUE,$charset='utf-8'){
//special chars
$text = htmlspecialchars($text, ENT_QUOTES,$charset);
/**
* This array contains the main static bbcode
* @var array $basic_bbcode
*/
$basic_bbcode = array(
'[b]', '[/b]',
... | php | public static function FontCodes($text,$advanced=TRUE,$charset='utf-8'){
//special chars
$text = htmlspecialchars($text, ENT_QUOTES,$charset);
/**
* This array contains the main static bbcode
* @var array $basic_bbcode
*/
$basic_bbcode = array(
'[b]', '[/b]',
... | [
"public",
"static",
"function",
"FontCodes",
"(",
"$",
"text",
",",
"$",
"advanced",
"=",
"TRUE",
",",
"$",
"charset",
"=",
"'utf-8'",
")",
"{",
"//special chars",
"$",
"text",
"=",
"htmlspecialchars",
"(",
"$",
"text",
",",
"ENT_QUOTES",
",",
"$",
"char... | Helper Function
Convery SWAT4 Server font codes into html tags
@param string $data
@return string | [
"Helper",
"Function",
"Convery",
"SWAT4",
"Server",
"font",
"codes",
"into",
"html",
"tags"
] | train | https://github.com/kinnngg/swat4query/blob/d01ce8595228f2e3e13f63b138611604a483a982/src/Kinnngg/Swat4query/Server.php#L161-L214 |
kinnngg/swat4query | src/Kinnngg/Swat4query/Server.php | Server.FixNickname | public static function FixNickname($nick) {
$nick=str_replace('&','&',$nick);
$nick=str_replace('<','<',$nick);
$nick=str_replace('>','>',$nick);
return $nick;
} | php | public static function FixNickname($nick) {
$nick=str_replace('&','&',$nick);
$nick=str_replace('<','<',$nick);
$nick=str_replace('>','>',$nick);
return $nick;
} | [
"public",
"static",
"function",
"FixNickname",
"(",
"$",
"nick",
")",
"{",
"$",
"nick",
"=",
"str_replace",
"(",
"'&'",
",",
"'&'",
",",
"$",
"nick",
")",
";",
"$",
"nick",
"=",
"str_replace",
"(",
"'<'",
",",
"'<'",
",",
"$",
"nick",
")",
"... | Helper Function
Returns fixed names for html.
@param string $nick
@return string | [
"Helper",
"Function",
"Returns",
"fixed",
"names",
"for",
"html",
"."
] | train | https://github.com/kinnngg/swat4query/blob/d01ce8595228f2e3e13f63b138611604a483a982/src/Kinnngg/Swat4query/Server.php#L264-L269 |
kinnngg/swat4query | src/Kinnngg/Swat4query/Server.php | Server.SortPlayers | public static function SortPlayers($a,$b,$co,$jak) {
if($co=="name") {
$a2=strtolower($a['name']);
$b2=strtolower($b['name']);
if($a2==$b2) return 0;
if((($jak=="+")&&($a2>$b2))||(($jak=="-")&&($a2<$b2))) return 1; else return -1;
} else {
if($a[$co]==$b[$co]) return 0;
if((($jak=="+")&&($... | php | public static function SortPlayers($a,$b,$co,$jak) {
if($co=="name") {
$a2=strtolower($a['name']);
$b2=strtolower($b['name']);
if($a2==$b2) return 0;
if((($jak=="+")&&($a2>$b2))||(($jak=="-")&&($a2<$b2))) return 1; else return -1;
} else {
if($a[$co]==$b[$co]) return 0;
if((($jak=="+")&&($... | [
"public",
"static",
"function",
"SortPlayers",
"(",
"$",
"a",
",",
"$",
"b",
",",
"$",
"co",
",",
"$",
"jak",
")",
"{",
"if",
"(",
"$",
"co",
"==",
"\"name\"",
")",
"{",
"$",
"a2",
"=",
"strtolower",
"(",
"$",
"a",
"[",
"'name'",
"]",
")",
";... | A Helper Function
This function will sort players.
@param [type] $a [description]
@param [type] $b [description]
@param [type] $co [description]
@param [type] $jak [description] | [
"A",
"Helper",
"Function",
"This",
"function",
"will",
"sort",
"players",
"."
] | train | https://github.com/kinnngg/swat4query/blob/d01ce8595228f2e3e13f63b138611604a483a982/src/Kinnngg/Swat4query/Server.php#L280-L290 |
kinnngg/swat4query | src/Kinnngg/Swat4query/Server.php | Server.LinkImageSort | function LinkImageSort($_by,$sby,$soby,$soby2,$stitle) {
if($_by==$sby)
return <<<EOF
<a href="{$_SERVER['PHP_SELF']}?sort={$soby}&by={$sby}" class="formfont" onmouseover="if(document.getElementById('so{$sby}')){ document.getElementById('so{$sby}').src='./swat4query/images/server_{$soby}.gif'; }" onmouseou... | php | function LinkImageSort($_by,$sby,$soby,$soby2,$stitle) {
if($_by==$sby)
return <<<EOF
<a href="{$_SERVER['PHP_SELF']}?sort={$soby}&by={$sby}" class="formfont" onmouseover="if(document.getElementById('so{$sby}')){ document.getElementById('so{$sby}').src='./swat4query/images/server_{$soby}.gif'; }" onmouseou... | [
"function",
"LinkImageSort",
"(",
"$",
"_by",
",",
"$",
"sby",
",",
"$",
"soby",
",",
"$",
"soby2",
",",
"$",
"stitle",
")",
"{",
"if",
"(",
"$",
"_by",
"==",
"$",
"sby",
")",
"return",
" <<<EOF\n <a href=\"{$_SERVER['PHP_SELF']}?sort={$soby}&by={$sby}\" ... | Helper Function
Can be used to created a link to sort data accordingly.
@param [type] $_by [description]
@param [type] $sby [description]
@param [type] $soby [description]
@param [type] $soby2 [description]
@param [type] $stitle [description] | [
"Helper",
"Function",
"Can",
"be",
"used",
"to",
"created",
"a",
"link",
"to",
"sort",
"data",
"accordingly",
"."
] | train | https://github.com/kinnngg/swat4query/blob/d01ce8595228f2e3e13f63b138611604a483a982/src/Kinnngg/Swat4query/Server.php#L342-L348 |
garf/laravel-title | src/Title.php | Title.render | public function render($delimiter = null, $no_additions = false)
{
$delimiter = is_null($delimiter) ? config('laravel-title.delimiter') : $delimiter;
$suffix = $no_additions ? '' : config('laravel-title.suffix');
$prefix = $no_additions ? '' : config('laravel-title.prefix');
$on_empt... | php | public function render($delimiter = null, $no_additions = false)
{
$delimiter = is_null($delimiter) ? config('laravel-title.delimiter') : $delimiter;
$suffix = $no_additions ? '' : config('laravel-title.suffix');
$prefix = $no_additions ? '' : config('laravel-title.prefix');
$on_empt... | [
"public",
"function",
"render",
"(",
"$",
"delimiter",
"=",
"null",
",",
"$",
"no_additions",
"=",
"false",
")",
"{",
"$",
"delimiter",
"=",
"is_null",
"(",
"$",
"delimiter",
")",
"?",
"config",
"(",
"'laravel-title.delimiter'",
")",
":",
"$",
"delimiter",... | Implode all segments into one string. | [
"Implode",
"all",
"segments",
"into",
"one",
"string",
"."
] | train | https://github.com/garf/laravel-title/blob/54b939b67fdd48d1579c9231d3a13a505279e1cd/src/Title.php#L53-L61 |
garf/laravel-title | src/Title.php | Title.make | public function make(array $segments, $delimiter = ' - ', $suffix = '', $prefix = '', $on_empty = '')
{
$result = implode($delimiter, $segments);
if ($this->has()) {
return $prefix . $result . $suffix;
} else {
return $on_empty;
}
} | php | public function make(array $segments, $delimiter = ' - ', $suffix = '', $prefix = '', $on_empty = '')
{
$result = implode($delimiter, $segments);
if ($this->has()) {
return $prefix . $result . $suffix;
} else {
return $on_empty;
}
} | [
"public",
"function",
"make",
"(",
"array",
"$",
"segments",
",",
"$",
"delimiter",
"=",
"' - '",
",",
"$",
"suffix",
"=",
"''",
",",
"$",
"prefix",
"=",
"''",
",",
"$",
"on_empty",
"=",
"''",
")",
"{",
"$",
"result",
"=",
"implode",
"(",
"$",
"d... | Check if any segments added
@param array $segments - array of segment pieces
@param string $delimiter - delimiter for implosion
@param string $suffix - addition to the end
@param string $prefix - addition to beginning
@param string $on_empty - print if segments is empty
@return string | [
"Check",
"if",
"any",
"segments",
"added"
] | train | https://github.com/garf/laravel-title/blob/54b939b67fdd48d1579c9231d3a13a505279e1cd/src/Title.php#L127-L138 |
wenbinye/PhalconX | src/Helper/FileHelper.php | FileHelper.find | public static function find($dir, array $options = null)
{
$options = array_merge([
'excludeHiddenFiles' => true,
], $options);
$it = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dir));
foreach ($it as $file => $fileInfo) {
$name = $fileInfo... | php | public static function find($dir, array $options = null)
{
$options = array_merge([
'excludeHiddenFiles' => true,
], $options);
$it = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dir));
foreach ($it as $file => $fileInfo) {
$name = $fileInfo... | [
"public",
"static",
"function",
"find",
"(",
"$",
"dir",
",",
"array",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"[",
"'excludeHiddenFiles'",
"=>",
"true",
",",
"]",
",",
"$",
"options",
")",
";",
"$",
"it",
"=",... | Finds file | [
"Finds",
"file"
] | train | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Helper/FileHelper.php#L11-L36 |
wenbinye/PhalconX | src/Helper/FileHelper.php | FileHelper.recursiveRemove | public static function recursiveRemove($path)
{
if (is_dir($path)) {
$files = scandir($path);
foreach ($files as $file) {
if ($file != "." && $file != "..") {
self::recursiveRemove("$path/$file");
}
}
if (!rm... | php | public static function recursiveRemove($path)
{
if (is_dir($path)) {
$files = scandir($path);
foreach ($files as $file) {
if ($file != "." && $file != "..") {
self::recursiveRemove("$path/$file");
}
}
if (!rm... | [
"public",
"static",
"function",
"recursiveRemove",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"is_dir",
"(",
"$",
"path",
")",
")",
"{",
"$",
"files",
"=",
"scandir",
"(",
"$",
"path",
")",
";",
"foreach",
"(",
"$",
"files",
"as",
"$",
"file",
")",
"... | rm -r path | [
"rm",
"-",
"r",
"path"
] | train | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Helper/FileHelper.php#L53-L70 |
wenbinye/PhalconX | src/Helper/FileHelper.php | FileHelper.recursiveCopy | public static function recursiveCopy($src, $dst)
{
if (is_dir($src)) {
if (!is_dir($dst) && !mkdir($dst)) {
throw new IOException("Cannot mkdir '$dst'", 0, null, $path);
}
$files = scandir($src);
foreach ($files as $file) {
if (... | php | public static function recursiveCopy($src, $dst)
{
if (is_dir($src)) {
if (!is_dir($dst) && !mkdir($dst)) {
throw new IOException("Cannot mkdir '$dst'", 0, null, $path);
}
$files = scandir($src);
foreach ($files as $file) {
if (... | [
"public",
"static",
"function",
"recursiveCopy",
"(",
"$",
"src",
",",
"$",
"dst",
")",
"{",
"if",
"(",
"is_dir",
"(",
"$",
"src",
")",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"dst",
")",
"&&",
"!",
"mkdir",
"(",
"$",
"dst",
")",
")",
"... | cp -r | [
"cp",
"-",
"r"
] | train | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Helper/FileHelper.php#L75-L92 |
wenbinye/PhalconX | src/Helper/FileHelper.php | FileHelper.absolutePath | public static function absolutePath($path, $relative_to = null)
{
if (self::isWindows()) {
$is_absolute = preg_match('/^[A-Za-z]+:/', $path);
} else {
$is_absolute = !strncmp($path, DIRECTORY_SEPARATOR, 1);
}
if (!$is_absolute) {
if (!$relative_to... | php | public static function absolutePath($path, $relative_to = null)
{
if (self::isWindows()) {
$is_absolute = preg_match('/^[A-Za-z]+:/', $path);
} else {
$is_absolute = !strncmp($path, DIRECTORY_SEPARATOR, 1);
}
if (!$is_absolute) {
if (!$relative_to... | [
"public",
"static",
"function",
"absolutePath",
"(",
"$",
"path",
",",
"$",
"relative_to",
"=",
"null",
")",
"{",
"if",
"(",
"self",
"::",
"isWindows",
"(",
")",
")",
"{",
"$",
"is_absolute",
"=",
"preg_match",
"(",
"'/^[A-Za-z]+:/'",
",",
"$",
"path",
... | Canonicalize a path by resolving it relative to some directory (by
default PWD), following parent symlinks and removing artifacts. If the
path is itself a symlink it is left unresolved.
@param string Path, absolute or relative to PWD.
@return string Canonical, absolute path.
@task path | [
"Canonicalize",
"a",
"path",
"by",
"resolving",
"it",
"relative",
"to",
"some",
"directory",
"(",
"by",
"default",
"PWD",
")",
"following",
"parent",
"symlinks",
"and",
"removing",
"artifacts",
".",
"If",
"the",
"path",
"is",
"itself",
"a",
"symlink",
"it",
... | train | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Helper/FileHelper.php#L118-L164 |
blast-project/BaseEntitiesBundle | src/EventListener/TimestampableListener.php | TimestampableListener.loadClassMetadata | public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs)
{
/** @var ClassMetadata $metadata */
$metadata = $eventArgs->getClassMetadata();
$reflectionClass = $metadata->getReflectionClass();
if (!$reflectionClass || !$this->hasTrait($reflectionClass, 'Blast\BaseEnti... | php | public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs)
{
/** @var ClassMetadata $metadata */
$metadata = $eventArgs->getClassMetadata();
$reflectionClass = $metadata->getReflectionClass();
if (!$reflectionClass || !$this->hasTrait($reflectionClass, 'Blast\BaseEnti... | [
"public",
"function",
"loadClassMetadata",
"(",
"LoadClassMetadataEventArgs",
"$",
"eventArgs",
")",
"{",
"/** @var ClassMetadata $metadata */",
"$",
"metadata",
"=",
"$",
"eventArgs",
"->",
"getClassMetadata",
"(",
")",
";",
"$",
"reflectionClass",
"=",
"$",
"metadat... | define Timestampable mapping at runtime.
@param LoadClassMetadataEventArgs $eventArgs | [
"define",
"Timestampable",
"mapping",
"at",
"runtime",
"."
] | train | https://github.com/blast-project/BaseEntitiesBundle/blob/abd06891fc38922225ab7e4fcb437a286ba2c0c4/src/EventListener/TimestampableListener.php#L53-L93 |
blast-project/BaseEntitiesBundle | src/EventListener/TimestampableListener.php | TimestampableListener.prePersist | public function prePersist(LifecycleEventArgs $eventArgs)
{
$entity = $eventArgs->getObject();
if (!$this->hasTrait($entity, 'Blast\BaseEntitiesBundle\Entity\Traits\Timestampable')) {
return;
}
$this->logger->debug(
'[TimestampableListener] Entering Timestam... | php | public function prePersist(LifecycleEventArgs $eventArgs)
{
$entity = $eventArgs->getObject();
if (!$this->hasTrait($entity, 'Blast\BaseEntitiesBundle\Entity\Traits\Timestampable')) {
return;
}
$this->logger->debug(
'[TimestampableListener] Entering Timestam... | [
"public",
"function",
"prePersist",
"(",
"LifecycleEventArgs",
"$",
"eventArgs",
")",
"{",
"$",
"entity",
"=",
"$",
"eventArgs",
"->",
"getObject",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"hasTrait",
"(",
"$",
"entity",
",",
"'Blast\\BaseEntities... | sets Timestampable dateTime (createdAt and updatedAt) information when persisting entity.
@param LifecycleEventArgs $eventArgs | [
"sets",
"Timestampable",
"dateTime",
"(",
"createdAt",
"and",
"updatedAt",
")",
"information",
"when",
"persisting",
"entity",
"."
] | train | https://github.com/blast-project/BaseEntitiesBundle/blob/abd06891fc38922225ab7e4fcb437a286ba2c0c4/src/EventListener/TimestampableListener.php#L100-L115 |
blast-project/BaseEntitiesBundle | src/EventListener/TimestampableListener.php | TimestampableListener.preUpdate | public function preUpdate(LifecycleEventArgs $eventArgs)
{
$entity = $eventArgs->getObject();
if (!$this->hasTrait($entity, 'Blast\BaseEntitiesBundle\Entity\Traits\Timestampable')) {
return;
}
$this->logger->debug(
'[TimestampableListener] Entering Timestamp... | php | public function preUpdate(LifecycleEventArgs $eventArgs)
{
$entity = $eventArgs->getObject();
if (!$this->hasTrait($entity, 'Blast\BaseEntitiesBundle\Entity\Traits\Timestampable')) {
return;
}
$this->logger->debug(
'[TimestampableListener] Entering Timestamp... | [
"public",
"function",
"preUpdate",
"(",
"LifecycleEventArgs",
"$",
"eventArgs",
")",
"{",
"$",
"entity",
"=",
"$",
"eventArgs",
"->",
"getObject",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"hasTrait",
"(",
"$",
"entity",
",",
"'Blast\\BaseEntitiesB... | sets Timestampable dateTime (updatedAt) information when updating entity.
@param LifecycleEventArgs $eventArgs | [
"sets",
"Timestampable",
"dateTime",
"(",
"updatedAt",
")",
"information",
"when",
"updating",
"entity",
"."
] | train | https://github.com/blast-project/BaseEntitiesBundle/blob/abd06891fc38922225ab7e4fcb437a286ba2c0c4/src/EventListener/TimestampableListener.php#L122-L136 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/pop3/pop3_transport.php | ezcMailPop3Transport.disconnect | public function disconnect()
{
if ( $this->state != self::STATE_NOT_CONNECTED )
{
$this->connection->sendData( 'QUIT' );
$this->connection->getLine(); // discard
$this->state = self::STATE_UPDATE;
$this->connection->close();
$this->connect... | php | public function disconnect()
{
if ( $this->state != self::STATE_NOT_CONNECTED )
{
$this->connection->sendData( 'QUIT' );
$this->connection->getLine(); // discard
$this->state = self::STATE_UPDATE;
$this->connection->close();
$this->connect... | [
"public",
"function",
"disconnect",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_NOT_CONNECTED",
")",
"{",
"$",
"this",
"->",
"connection",
"->",
"sendData",
"(",
"'QUIT'",
")",
";",
"$",
"this",
"->",
"connection",
... | Disconnects the transport from the POP3 server. | [
"Disconnects",
"the",
"transport",
"from",
"the",
"POP3",
"server",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/pop3/pop3_transport.php#L308-L320 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/pop3/pop3_transport.php | ezcMailPop3Transport.authenticate | public function authenticate( $user, $password, $method = null )
{
if ( $this->state != self::STATE_AUTHORIZATION )
{
throw new ezcMailTransportException( "Tried to authenticate when there was no connection or when already authenticated." );
}
if ( is_null( $method ) )
... | php | public function authenticate( $user, $password, $method = null )
{
if ( $this->state != self::STATE_AUTHORIZATION )
{
throw new ezcMailTransportException( "Tried to authenticate when there was no connection or when already authenticated." );
}
if ( is_null( $method ) )
... | [
"public",
"function",
"authenticate",
"(",
"$",
"user",
",",
"$",
"password",
",",
"$",
"method",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_AUTHORIZATION",
")",
"{",
"throw",
"new",
"ezcMailTransportException"... | Authenticates the user to the POP3 server with $user and $password.
You can choose the authentication method with the $method parameter.
The default is to use plaintext username and password (specified in the
ezcMailPop3TransportOptions class).
This method should be called directly after the construction of this
obje... | [
"Authenticates",
"the",
"user",
"to",
"the",
"POP3",
"server",
"with",
"$user",
"and",
"$password",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/pop3/pop3_transport.php#L350-L404 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/pop3/pop3_transport.php | ezcMailPop3Transport.listMessages | public function listMessages()
{
if ( $this->state != self::STATE_TRANSACTION )
{
throw new ezcMailTransportException( "Can't call listMessages() on the POP3 transport when not successfully logged in." );
}
// send the command
$this->connection->sendData( "LIST" ... | php | public function listMessages()
{
if ( $this->state != self::STATE_TRANSACTION )
{
throw new ezcMailTransportException( "Can't call listMessages() on the POP3 transport when not successfully logged in." );
}
// send the command
$this->connection->sendData( "LIST" ... | [
"public",
"function",
"listMessages",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_TRANSACTION",
")",
"{",
"throw",
"new",
"ezcMailTransportException",
"(",
"\"Can't call listMessages() on the POP3 transport when not successfully logged... | Returns an array of the message numbers on the server and the size of the
messages in bytes.
The format of the returned array is:
<code>
array( message_id => message_size );
</code>
Example:
<code>
array( 2 => 1700, 5 => 1450, 6 => 21043 );
</code>
Before calling this method, a connection to the POP3 server must be
... | [
"Returns",
"an",
"array",
"of",
"the",
"message",
"numbers",
"on",
"the",
"server",
"and",
"the",
"size",
"of",
"the",
"messages",
"in",
"bytes",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/pop3/pop3_transport.php#L429-L452 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/pop3/pop3_transport.php | ezcMailPop3Transport.listUniqueIdentifiers | public function listUniqueIdentifiers( $msgNum = null )
{
if ( $this->state != self::STATE_TRANSACTION )
{
throw new ezcMailTransportException( "Can't call ListUniqueIdentifiers() on the POP3 transport when not successfully logged in." );
}
// send the command
$r... | php | public function listUniqueIdentifiers( $msgNum = null )
{
if ( $this->state != self::STATE_TRANSACTION )
{
throw new ezcMailTransportException( "Can't call ListUniqueIdentifiers() on the POP3 transport when not successfully logged in." );
}
// send the command
$r... | [
"public",
"function",
"listUniqueIdentifiers",
"(",
"$",
"msgNum",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_TRANSACTION",
")",
"{",
"throw",
"new",
"ezcMailTransportException",
"(",
"\"Can't call ListUniqueIdentifier... | Returns the unique identifiers for messages on the POP3 server.
You can fetch the unique identifier for a specific message by providing
the $msgNum parameter.
The unique identifier can be used to recognize mail from servers
between requests. In contrast to the message numbers the unique numbers
assigned to an email u... | [
"Returns",
"the",
"unique",
"identifiers",
"for",
"messages",
"on",
"the",
"POP3",
"server",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/pop3/pop3_transport.php#L486-L529 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/pop3/pop3_transport.php | ezcMailPop3Transport.status | public function status( &$numMessages, &$sizeMessages )
{
if ( $this->state != self::STATE_TRANSACTION )
{
throw new ezcMailTransportException( "Can't call status() on the POP3 transport when not successfully logged in." );
}
$this->connection->sendData( "STAT" );
... | php | public function status( &$numMessages, &$sizeMessages )
{
if ( $this->state != self::STATE_TRANSACTION )
{
throw new ezcMailTransportException( "Can't call status() on the POP3 transport when not successfully logged in." );
}
$this->connection->sendData( "STAT" );
... | [
"public",
"function",
"status",
"(",
"&",
"$",
"numMessages",
",",
"&",
"$",
"sizeMessages",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_TRANSACTION",
")",
"{",
"throw",
"new",
"ezcMailTransportException",
"(",
"\"Can't call s... | Returns information about the messages on the server.
The information returned through the parameters is:
- $numMessages = number of messages
- $sizeMessages = sum of the messages sizes
Before calling this method, a connection to the POP3 server must be
established and a user must be authenticated successfully.
Exam... | [
"Returns",
"information",
"about",
"the",
"messages",
"on",
"the",
"server",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/pop3/pop3_transport.php#L559-L579 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/pop3/pop3_transport.php | ezcMailPop3Transport.delete | public function delete( $msgNum )
{
if ( $this->state != self::STATE_TRANSACTION )
{
throw new ezcMailTransportException( "Can't call delete() on the POP3 transport when not successfully logged in." );
}
$this->connection->sendData( "DELE {$msgNum}" );
$response ... | php | public function delete( $msgNum )
{
if ( $this->state != self::STATE_TRANSACTION )
{
throw new ezcMailTransportException( "Can't call delete() on the POP3 transport when not successfully logged in." );
}
$this->connection->sendData( "DELE {$msgNum}" );
$response ... | [
"public",
"function",
"delete",
"(",
"$",
"msgNum",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_TRANSACTION",
")",
"{",
"throw",
"new",
"ezcMailTransportException",
"(",
"\"Can't call delete() on the POP3 transport when not successfully... | Deletes the message with the message number $msgNum from the server.
The message number must be a valid identifier fetched with (example)
{@link listMessages()}.
Any future reference to the message-number associated with the message
in a command generates an error.
Before calling this method, a connection to the POP... | [
"Deletes",
"the",
"message",
"with",
"the",
"message",
"number",
"$msgNum",
"from",
"the",
"server",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/pop3/pop3_transport.php#L599-L613 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/pop3/pop3_transport.php | ezcMailPop3Transport.top | public function top( $msgNum, $numLines = 0 )
{
if ( $this->state != self::STATE_TRANSACTION )
{
throw new ezcMailTransportException( "Can't call top() on the POP3 transport when not successfully logged in." );
}
// send the command
$this->connection->sendData( "... | php | public function top( $msgNum, $numLines = 0 )
{
if ( $this->state != self::STATE_TRANSACTION )
{
throw new ezcMailTransportException( "Can't call top() on the POP3 transport when not successfully logged in." );
}
// send the command
$this->connection->sendData( "... | [
"public",
"function",
"top",
"(",
"$",
"msgNum",
",",
"$",
"numLines",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_TRANSACTION",
")",
"{",
"throw",
"new",
"ezcMailTransportException",
"(",
"\"Can't call top() on the ... | Returns the headers and the $numLines first lines of the body of the mail with
the message number $msgNum.
If the command failed or if it was not supported by the server an empty string is
returned.
Note: POP3 servers are not required to support this command and it may fail.
Before calling this method, a connection ... | [
"Returns",
"the",
"headers",
"and",
"the",
"$numLines",
"first",
"lines",
"of",
"the",
"body",
"of",
"the",
"mail",
"with",
"the",
"message",
"number",
"$msgNum",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/pop3/pop3_transport.php#L651-L673 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/pop3/pop3_transport.php | ezcMailPop3Transport.fetchAll | public function fetchAll( $deleteFromServer = false )
{
$messages = $this->listMessages();
return new ezcMailPop3Set( $this->connection, array_keys( $messages ), $deleteFromServer );
} | php | public function fetchAll( $deleteFromServer = false )
{
$messages = $this->listMessages();
return new ezcMailPop3Set( $this->connection, array_keys( $messages ), $deleteFromServer );
} | [
"public",
"function",
"fetchAll",
"(",
"$",
"deleteFromServer",
"=",
"false",
")",
"{",
"$",
"messages",
"=",
"$",
"this",
"->",
"listMessages",
"(",
")",
";",
"return",
"new",
"ezcMailPop3Set",
"(",
"$",
"this",
"->",
"connection",
",",
"array_keys",
"(",... | Returns an ezcMailPop3Set with all the messages on the server.
If $deleteFromServer is set to true the mail will be removed from the
server after retrieval. If not it will be left.
Before calling this method, a connection to the POP3 server must be
established and a user must be authenticated successfully.
Example:
... | [
"Returns",
"an",
"ezcMailPop3Set",
"with",
"all",
"the",
"messages",
"on",
"the",
"server",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/pop3/pop3_transport.php#L707-L711 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/pop3/pop3_transport.php | ezcMailPop3Transport.fetchByMessageNr | public function fetchByMessageNr( $number, $deleteFromServer = false )
{
$messages = $this->listMessages();
if ( !isset( $messages[$number] ) )
{
throw new ezcMailNoSuchMessageException( $number );
}
return new ezcMailPop3Set( $this->connection, array( $number ), ... | php | public function fetchByMessageNr( $number, $deleteFromServer = false )
{
$messages = $this->listMessages();
if ( !isset( $messages[$number] ) )
{
throw new ezcMailNoSuchMessageException( $number );
}
return new ezcMailPop3Set( $this->connection, array( $number ), ... | [
"public",
"function",
"fetchByMessageNr",
"(",
"$",
"number",
",",
"$",
"deleteFromServer",
"=",
"false",
")",
"{",
"$",
"messages",
"=",
"$",
"this",
"->",
"listMessages",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"messages",
"[",
"$",
"number... | Returns an ezcMailPop3Set containing only the $number -th message from
the server.
If $deleteFromServer is set to true the mail will be removed from the
server after retrieval. If not it will be left.
Note: for POP3 the first message is 1 (so for $number = 0 the exception
will be thrown).
Before calling this method,... | [
"Returns",
"an",
"ezcMailPop3Set",
"containing",
"only",
"the",
"$number",
"-",
"th",
"message",
"from",
"the",
"server",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/pop3/pop3_transport.php#L746-L754 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/pop3/pop3_transport.php | ezcMailPop3Transport.fetchFromOffset | public function fetchFromOffset( $offset, $count = 0, $deleteFromServer = false )
{
if ( $count < 0 )
{
throw new ezcMailInvalidLimitException( $offset, $count );
}
$messages = array_keys( $this->listMessages() );
if ( $count == 0 )
{
$range = ... | php | public function fetchFromOffset( $offset, $count = 0, $deleteFromServer = false )
{
if ( $count < 0 )
{
throw new ezcMailInvalidLimitException( $offset, $count );
}
$messages = array_keys( $this->listMessages() );
if ( $count == 0 )
{
$range = ... | [
"public",
"function",
"fetchFromOffset",
"(",
"$",
"offset",
",",
"$",
"count",
"=",
"0",
",",
"$",
"deleteFromServer",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"count",
"<",
"0",
")",
"{",
"throw",
"new",
"ezcMailInvalidLimitException",
"(",
"$",
"offset... | Returns an ezcMailPop3Set with $count messages starting from $offset from
the server.
Fetches $count messages starting from the $offset and returns them as a
ezcMailPop3Set. If $count is not specified or if it is 0, it fetches
all messages starting from the $offset.
Before calling this method, a connection to the POP... | [
"Returns",
"an",
"ezcMailPop3Set",
"with",
"$count",
"messages",
"starting",
"from",
"$offset",
"from",
"the",
"server",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/pop3/pop3_transport.php#L790-L810 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/pop3/pop3_transport.php | ezcMailPop3Transport.noop | public function noop()
{
if ( $this->state != self::STATE_TRANSACTION )
{
throw new ezcMailTransportException( "Can't call noop() on the POP3 transport when not successfully logged in." );
}
// send the command
$this->connection->sendData( "NOOP" );
$resp... | php | public function noop()
{
if ( $this->state != self::STATE_TRANSACTION )
{
throw new ezcMailTransportException( "Can't call noop() on the POP3 transport when not successfully logged in." );
}
// send the command
$this->connection->sendData( "NOOP" );
$resp... | [
"public",
"function",
"noop",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_TRANSACTION",
")",
"{",
"throw",
"new",
"ezcMailTransportException",
"(",
"\"Can't call noop() on the POP3 transport when not successfully logged in.\"",
")",
... | Sends a NOOP command to the server, use it to keep the connection alive.
Before calling this method, a connection to the POP3 server must be
established and a user must be authenticated successfully.
@throws ezcMailTransportException
if there was no connection to the server
or if not authenticated
or if the server se... | [
"Sends",
"a",
"NOOP",
"command",
"to",
"the",
"server",
"use",
"it",
"to",
"keep",
"the",
"connection",
"alive",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/pop3/pop3_transport.php#L823-L837 |
tequila/mongodb-odm | src/Proxy/Traits/RootProxyTrait.php | RootProxyTrait.addAllToSet | public function addAllToSet(string $field, array $values)
{
$this->update()->addToSet($field, ['$each' => $values]);
return $this;
} | php | public function addAllToSet(string $field, array $values)
{
$this->update()->addToSet($field, ['$each' => $values]);
return $this;
} | [
"public",
"function",
"addAllToSet",
"(",
"string",
"$",
"field",
",",
"array",
"$",
"values",
")",
"{",
"$",
"this",
"->",
"update",
"(",
")",
"->",
"addToSet",
"(",
"$",
"field",
",",
"[",
"'$each'",
"=>",
"$",
"values",
"]",
")",
";",
"return",
... | @param string $field
@param array $values
@return $this | [
"@param",
"string",
"$field",
"@param",
"array",
"$values"
] | train | https://github.com/tequila/mongodb-odm/blob/501d58529bbcb23ad7839680462f62d5c3466d23/src/Proxy/Traits/RootProxyTrait.php#L92-L97 |
tequila/mongodb-odm | src/Proxy/Traits/RootProxyTrait.php | RootProxyTrait.addToSet | public function addToSet(string $field, $value)
{
$this->update();
$this->mongoDbUpdate['$addToSet'][$field] = $value;
return $this;
} | php | public function addToSet(string $field, $value)
{
$this->update();
$this->mongoDbUpdate['$addToSet'][$field] = $value;
return $this;
} | [
"public",
"function",
"addToSet",
"(",
"string",
"$",
"field",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"update",
"(",
")",
";",
"$",
"this",
"->",
"mongoDbUpdate",
"[",
"'$addToSet'",
"]",
"[",
"$",
"field",
"]",
"=",
"$",
"value",
";",
"re... | @param string $field
@param mixed $value
@return $this | [
"@param",
"string",
"$field",
"@param",
"mixed",
"$value"
] | train | https://github.com/tequila/mongodb-odm/blob/501d58529bbcb23ad7839680462f62d5c3466d23/src/Proxy/Traits/RootProxyTrait.php#L105-L111 |
tequila/mongodb-odm | src/Proxy/Traits/RootProxyTrait.php | RootProxyTrait.pullAll | public function pullAll(string $field, array $values)
{
$this->update();
$this->mongoDbUpdate['$pullAll'][$field] = $values;
return $this;
} | php | public function pullAll(string $field, array $values)
{
$this->update();
$this->mongoDbUpdate['$pullAll'][$field] = $values;
return $this;
} | [
"public",
"function",
"pullAll",
"(",
"string",
"$",
"field",
",",
"array",
"$",
"values",
")",
"{",
"$",
"this",
"->",
"update",
"(",
")",
";",
"$",
"this",
"->",
"mongoDbUpdate",
"[",
"'$pullAll'",
"]",
"[",
"$",
"field",
"]",
"=",
"$",
"values",
... | @param string $field
@param array $values
@return $this | [
"@param",
"string",
"$field",
"@param",
"array",
"$values"
] | train | https://github.com/tequila/mongodb-odm/blob/501d58529bbcb23ad7839680462f62d5c3466d23/src/Proxy/Traits/RootProxyTrait.php#L145-L151 |
tequila/mongodb-odm | src/Proxy/Traits/RootProxyTrait.php | RootProxyTrait.pull | public function pull(string $field, $condition)
{
$this->update();
$this->mongoDbUpdate['$pull'][$field] = $condition;
return $this;
} | php | public function pull(string $field, $condition)
{
$this->update();
$this->mongoDbUpdate['$pull'][$field] = $condition;
return $this;
} | [
"public",
"function",
"pull",
"(",
"string",
"$",
"field",
",",
"$",
"condition",
")",
"{",
"$",
"this",
"->",
"update",
"(",
")",
";",
"$",
"this",
"->",
"mongoDbUpdate",
"[",
"'$pull'",
"]",
"[",
"$",
"field",
"]",
"=",
"$",
"condition",
";",
"re... | @param string $field
@param array|mixed $condition - a condition to specify values to delete, or a value to delete
@return $this | [
"@param",
"string",
"$field",
"@param",
"array|mixed",
"$condition",
"-",
"a",
"condition",
"to",
"specify",
"values",
"to",
"delete",
"or",
"a",
"value",
"to",
"delete"
] | train | https://github.com/tequila/mongodb-odm/blob/501d58529bbcb23ad7839680462f62d5c3466d23/src/Proxy/Traits/RootProxyTrait.php#L159-L165 |
tequila/mongodb-odm | src/Proxy/Traits/RootProxyTrait.php | RootProxyTrait.pushAll | public function pushAll(string $field, array $values)
{
$this->update()->push($field, ['$each' => $values]);
return $this;
} | php | public function pushAll(string $field, array $values)
{
$this->update()->push($field, ['$each' => $values]);
return $this;
} | [
"public",
"function",
"pushAll",
"(",
"string",
"$",
"field",
",",
"array",
"$",
"values",
")",
"{",
"$",
"this",
"->",
"update",
"(",
")",
"->",
"push",
"(",
"$",
"field",
",",
"[",
"'$each'",
"=>",
"$",
"values",
"]",
")",
";",
"return",
"$",
"... | @param string $field
@param array $values
@return $this | [
"@param",
"string",
"$field",
"@param",
"array",
"$values"
] | train | https://github.com/tequila/mongodb-odm/blob/501d58529bbcb23ad7839680462f62d5c3466d23/src/Proxy/Traits/RootProxyTrait.php#L183-L188 |
tequila/mongodb-odm | src/Proxy/Traits/RootProxyTrait.php | RootProxyTrait.increment | public function increment(string $field, $value)
{
$this->update();
$this->mongoDbUpdate['$inc'][$field] = $value;
return $this;
} | php | public function increment(string $field, $value)
{
$this->update();
$this->mongoDbUpdate['$inc'][$field] = $value;
return $this;
} | [
"public",
"function",
"increment",
"(",
"string",
"$",
"field",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"update",
"(",
")",
";",
"$",
"this",
"->",
"mongoDbUpdate",
"[",
"'$inc'",
"]",
"[",
"$",
"field",
"]",
"=",
"$",
"value",
";",
"return... | @param string $field
@param int|float $value
@return $this | [
"@param",
"string",
"$field",
"@param",
"int|float",
"$value"
] | train | https://github.com/tequila/mongodb-odm/blob/501d58529bbcb23ad7839680462f62d5c3466d23/src/Proxy/Traits/RootProxyTrait.php#L214-L220 |
tequila/mongodb-odm | src/Proxy/Traits/RootProxyTrait.php | RootProxyTrait.multiply | public function multiply(string $field, $value)
{
$this->update();
$this->mongoDbUpdate['$mul'][$field] = $value;
return $this;
} | php | public function multiply(string $field, $value)
{
$this->update();
$this->mongoDbUpdate['$mul'][$field] = $value;
return $this;
} | [
"public",
"function",
"multiply",
"(",
"string",
"$",
"field",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"update",
"(",
")",
";",
"$",
"this",
"->",
"mongoDbUpdate",
"[",
"'$mul'",
"]",
"[",
"$",
"field",
"]",
"=",
"$",
"value",
";",
"return"... | @param string $field
@param int|float $value
@return $this | [
"@param",
"string",
"$field",
"@param",
"int|float",
"$value"
] | train | https://github.com/tequila/mongodb-odm/blob/501d58529bbcb23ad7839680462f62d5c3466d23/src/Proxy/Traits/RootProxyTrait.php#L228-L234 |
tequila/mongodb-odm | src/Proxy/Traits/RootProxyTrait.php | RootProxyTrait.min | public function min(string $field, $value)
{
$this->update();
$this->mongoDbUpdate['$min'][$field] = $value;
return $this;
} | php | public function min(string $field, $value)
{
$this->update();
$this->mongoDbUpdate['$min'][$field] = $value;
return $this;
} | [
"public",
"function",
"min",
"(",
"string",
"$",
"field",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"update",
"(",
")",
";",
"$",
"this",
"->",
"mongoDbUpdate",
"[",
"'$min'",
"]",
"[",
"$",
"field",
"]",
"=",
"$",
"value",
";",
"return",
"... | @param string $field
@param int|float $value
@return $this | [
"@param",
"string",
"$field",
"@param",
"int|float",
"$value"
] | train | https://github.com/tequila/mongodb-odm/blob/501d58529bbcb23ad7839680462f62d5c3466d23/src/Proxy/Traits/RootProxyTrait.php#L242-L248 |
tequila/mongodb-odm | src/Proxy/Traits/RootProxyTrait.php | RootProxyTrait.max | public function max(string $field, $value)
{
$this->update();
$this->mongoDbUpdate['$max'][$field] = $value;
return $this;
} | php | public function max(string $field, $value)
{
$this->update();
$this->mongoDbUpdate['$max'][$field] = $value;
return $this;
} | [
"public",
"function",
"max",
"(",
"string",
"$",
"field",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"update",
"(",
")",
";",
"$",
"this",
"->",
"mongoDbUpdate",
"[",
"'$max'",
"]",
"[",
"$",
"field",
"]",
"=",
"$",
"value",
";",
"return",
"... | @param string $field
@param int|float $value
@return $this | [
"@param",
"string",
"$field",
"@param",
"int|float",
"$value"
] | train | https://github.com/tequila/mongodb-odm/blob/501d58529bbcb23ad7839680462f62d5c3466d23/src/Proxy/Traits/RootProxyTrait.php#L256-L262 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.