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
ezra-obiwale/dSCore
src/Core/Engine.php
Engine.getDefaultAction
public static function getDefaultAction($module = null, $exception = false) { $module = ($module === null) ? static::getDefaultModule() : $module; return static::getConfig('modules', $module, 'defaults', 'action', $exception); }
php
public static function getDefaultAction($module = null, $exception = false) { $module = ($module === null) ? static::getDefaultModule() : $module; return static::getConfig('modules', $module, 'defaults', 'action', $exception); }
[ "public", "static", "function", "getDefaultAction", "(", "$", "module", "=", "null", ",", "$", "exception", "=", "false", ")", "{", "$", "module", "=", "(", "$", "module", "===", "null", ")", "?", "static", "::", "getDefaultModule", "(", ")", ":", "$",...
Fetches the default action from the config @param string $module @param boolean $exception Indicates whether to throw an exception if not found @return string
[ "Fetches", "the", "default", "action", "from", "the", "config" ]
train
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/Engine.php#L301-L305
ezra-obiwale/dSCore
src/Core/Engine.php
Engine.getControllerClass
protected static function getControllerClass($live = true) { $class = static::getModule() . '\Controllers\\' . static::getController() . 'Controller'; if (!class_exists($class)) ControllerException::notFound($class); if (!in_array('DScribe\Core\AController', class_p...
php
protected static function getControllerClass($live = true) { $class = static::getModule() . '\Controllers\\' . static::getController() . 'Controller'; if (!class_exists($class)) ControllerException::notFound($class); if (!in_array('DScribe\Core\AController', class_p...
[ "protected", "static", "function", "getControllerClass", "(", "$", "live", "=", "true", ")", "{", "$", "class", "=", "static", "::", "getModule", "(", ")", ".", "'\\Controllers\\\\'", ".", "static", "::", "getController", "(", ")", ".", "'Controller'", ";", ...
Creates an instance of the current controller class @return AController @throws Exception
[ "Creates", "an", "instance", "of", "the", "current", "controller", "class" ]
train
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/Engine.php#L340-L351
ezra-obiwale/dSCore
src/Core/Engine.php
Engine.authenticate
protected static function authenticate($controller, $action, $params) { $auth = new Authenticate(static::$userId, $controller, $action); if (!$auth->execute()) { $controller->accessDenied($action, $params); exit; } }
php
protected static function authenticate($controller, $action, $params) { $auth = new Authenticate(static::$userId, $controller, $action); if (!$auth->execute()) { $controller->accessDenied($action, $params); exit; } }
[ "protected", "static", "function", "authenticate", "(", "$", "controller", ",", "$", "action", ",", "$", "params", ")", "{", "$", "auth", "=", "new", "Authenticate", "(", "static", "::", "$", "userId", ",", "$", "controller", ",", "$", "action", ")", "...
Authenticates the current user against the controller and action @param string $controller @param string $action
[ "Authenticates", "the", "current", "user", "against", "the", "controller", "and", "action" ]
train
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/Engine.php#L358-L364
ezra-obiwale/dSCore
src/Core/Engine.php
Engine.resetUserIdentity
public static function resetUserIdentity(AUser $user = NULL, $duration = null) { static::$userId = new UserIdentity($user, $duration); if (!$user) Session::reset(); static::saveSession(); }
php
public static function resetUserIdentity(AUser $user = NULL, $duration = null) { static::$userId = new UserIdentity($user, $duration); if (!$user) Session::reset(); static::saveSession(); }
[ "public", "static", "function", "resetUserIdentity", "(", "AUser", "$", "user", "=", "NULL", ",", "$", "duration", "=", "null", ")", "{", "static", "::", "$", "userId", "=", "new", "UserIdentity", "(", "$", "user", ",", "$", "duration", ")", ";", "if",...
Resets the user to guest @param AUser $user @param int $duration Duration for which the identity should be valid
[ "Resets", "the", "user", "to", "guest" ]
train
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/Engine.php#L371-L376
ezra-obiwale/dSCore
src/Core/Engine.php
Engine.init
public static function init(array $config) { static::$config = $config; static::checkConfig($config); static::fetchSession(); if (static::$userId === null) static::$userId = new UserIdentity(); static::$inject = include CONFIG . 'inject.php'; }
php
public static function init(array $config) { static::$config = $config; static::checkConfig($config); static::fetchSession(); if (static::$userId === null) static::$userId = new UserIdentity(); static::$inject = include CONFIG . 'inject.php'; }
[ "public", "static", "function", "init", "(", "array", "$", "config", ")", "{", "static", "::", "$", "config", "=", "$", "config", ";", "static", "::", "checkConfig", "(", "$", "config", ")", ";", "static", "::", "fetchSession", "(", ")", ";", "if", "...
Initializes the engine @param array $config
[ "Initializes", "the", "engine" ]
train
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/Engine.php#L415-L425
ezra-obiwale/dSCore
src/Core/Engine.php
Engine.run
public static function run(array $config) { static::init($config); static::moduleIsActivated(); $cache = static::canCache(); $name = join('/', static::getUrls()); if ($cache && $out = $cache->fetch($name)) { echo $out; } else { $view = new...
php
public static function run(array $config) { static::init($config); static::moduleIsActivated(); $cache = static::canCache(); $name = join('/', static::getUrls()); if ($cache && $out = $cache->fetch($name)) { echo $out; } else { $view = new...
[ "public", "static", "function", "run", "(", "array", "$", "config", ")", "{", "static", "::", "init", "(", "$", "config", ")", ";", "static", "::", "moduleIsActivated", "(", ")", ";", "$", "cache", "=", "static", "::", "canCache", "(", ")", ";", "$",...
Starts the engine @param array $config @todo Check caching controller actions
[ "Starts", "the", "engine" ]
train
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/Engine.php#L476-L525
miaoxing/file
src/Service/Cdn.php
Cdn.download
public function download($remoteFile) { // 获取文件内容 $http = wei()->http([ 'url' => $remoteFile, 'timeout' => 10000, 'referer' => true, 'throwException' => false, ]); if (!$http->isSuccess()) { return false; } ...
php
public function download($remoteFile) { // 获取文件内容 $http = wei()->http([ 'url' => $remoteFile, 'timeout' => 10000, 'referer' => true, 'throwException' => false, ]); if (!$http->isSuccess()) { return false; } ...
[ "public", "function", "download", "(", "$", "remoteFile", ")", "{", "// 获取文件内容", "$", "http", "=", "wei", "(", ")", "->", "http", "(", "[", "'url'", "=>", "$", "remoteFile", ",", "'timeout'", "=>", "10000", ",", "'referer'", "=>", "true", ",", "'throwE...
下载文件到本地 @param string $remoteFile @return bool|string
[ "下载文件到本地" ]
train
https://github.com/miaoxing/file/blob/5855a7e83992c1ba465943f1ed5ad09dd4536192/src/Service/Cdn.php#L121-L143
miaoxing/file
src/Service/Cdn.php
Cdn.upload
public function upload($remoteFile) { // 调用ueditor接口下载图片,确保图片只在一台服务器中 $app = wei()->app->getNamespace(); $url = wei()->ueditor->getOption('imageUrl') . $this->url->append('/ueditor/get-remote-image', ['app' => $app]); $http = wei()->http([ 'url' => $url, 'data...
php
public function upload($remoteFile) { // 调用ueditor接口下载图片,确保图片只在一台服务器中 $app = wei()->app->getNamespace(); $url = wei()->ueditor->getOption('imageUrl') . $this->url->append('/ueditor/get-remote-image', ['app' => $app]); $http = wei()->http([ 'url' => $url, 'data...
[ "public", "function", "upload", "(", "$", "remoteFile", ")", "{", "// 调用ueditor接口下载图片,确保图片只在一台服务器中", "$", "app", "=", "wei", "(", ")", "->", "app", "->", "getNamespace", "(", ")", ";", "$", "url", "=", "wei", "(", ")", "->", "ueditor", "->", "getOption",...
上传图片到CDN @param string $remoteFile @return bool|string @todo 独立为服务
[ "上传图片到CDN" ]
train
https://github.com/miaoxing/file/blob/5855a7e83992c1ba465943f1ed5ad09dd4536192/src/Service/Cdn.php#L152-L181
miaoxing/file
src/Service/Cdn.php
Cdn.convertToVirtualUrl
public function convertToVirtualUrl($content) { // 如果替换的key为空,strtr会返回false if (!$this->realUrl) { return $content; } if (is_array($content)) { return array_map([$this, __METHOD__], $content); } return strtr($content, [$this->realUrl => $this-...
php
public function convertToVirtualUrl($content) { // 如果替换的key为空,strtr会返回false if (!$this->realUrl) { return $content; } if (is_array($content)) { return array_map([$this, __METHOD__], $content); } return strtr($content, [$this->realUrl => $this-...
[ "public", "function", "convertToVirtualUrl", "(", "$", "content", ")", "{", "// 如果替换的key为空,strtr会返回false", "if", "(", "!", "$", "this", "->", "realUrl", ")", "{", "return", "$", "content", ";", "}", "if", "(", "is_array", "(", "$", "content", ")", ")", "...
更新内容中的地址为虚拟地址,用于存储 @param string|array $content @return string|array
[ "更新内容中的地址为虚拟地址", "用于存储" ]
train
https://github.com/miaoxing/file/blob/5855a7e83992c1ba465943f1ed5ad09dd4536192/src/Service/Cdn.php#L189-L200
miaoxing/file
src/Service/Cdn.php
Cdn.convertToRealUrl
public function convertToRealUrl($content) { if (is_array($content)) { return array_map([$this, __METHOD__], $content); } // 构造替换的数据,允许没有旧地址的情况 $replaces = [$this->virtualUrl => $this->realUrl]; if ($this->oldUrl) { $replaces[$this->oldUrl] = $this->r...
php
public function convertToRealUrl($content) { if (is_array($content)) { return array_map([$this, __METHOD__], $content); } // 构造替换的数据,允许没有旧地址的情况 $replaces = [$this->virtualUrl => $this->realUrl]; if ($this->oldUrl) { $replaces[$this->oldUrl] = $this->r...
[ "public", "function", "convertToRealUrl", "(", "$", "content", ")", "{", "if", "(", "is_array", "(", "$", "content", ")", ")", "{", "return", "array_map", "(", "[", "$", "this", ",", "__METHOD__", "]", ",", "$", "content", ")", ";", "}", "// 构造替换的数据,允许...
更新内容中的地址为真实地址(如CDN地址),用于展示 @param string|array $content @return string|array
[ "更新内容中的地址为真实地址", "(", "如CDN地址", ")", "用于展示" ]
train
https://github.com/miaoxing/file/blob/5855a7e83992c1ba465943f1ed5ad09dd4536192/src/Service/Cdn.php#L208-L221
togucms/AnnotationBundle
Metadata/PropertyMetadata.php
PropertyMetadata.getValue
public function getValue($object) { if(null === $this->reflectionClass) { $this->reflectionClass = new \ReflectionClass($this->class); } $method = $this->reflectionClass->getMethod($this->getter); return $method->invoke($object); }
php
public function getValue($object) { if(null === $this->reflectionClass) { $this->reflectionClass = new \ReflectionClass($this->class); } $method = $this->reflectionClass->getMethod($this->getter); return $method->invoke($object); }
[ "public", "function", "getValue", "(", "$", "object", ")", "{", "if", "(", "null", "===", "$", "this", "->", "reflectionClass", ")", "{", "$", "this", "->", "reflectionClass", "=", "new", "\\", "ReflectionClass", "(", "$", "this", "->", "class", ")", "...
@param object $obj @return mixed
[ "@param", "object", "$obj" ]
train
https://github.com/togucms/AnnotationBundle/blob/386141ea9c6e220fdf2e012ada2b5b081ec34d61/Metadata/PropertyMetadata.php#L64-L70
zhaoxianfang/tools
src/Qqlogin/Oauth.php
Oauth.qq_login
public function qq_login() { //-------生成唯一随机串防CSRF攻击 $state = md5(uniqid(rand(), true)); session('state', $state); //-------构造请求参数列表 $keysArr = array( "response_type" => "code", "client_id" => $this->appid, "redirect_uri" => $this->c...
php
public function qq_login() { //-------生成唯一随机串防CSRF攻击 $state = md5(uniqid(rand(), true)); session('state', $state); //-------构造请求参数列表 $keysArr = array( "response_type" => "code", "client_id" => $this->appid, "redirect_uri" => $this->c...
[ "public", "function", "qq_login", "(", ")", "{", "//-------生成唯一随机串防CSRF攻击", "$", "state", "=", "md5", "(", "uniqid", "(", "rand", "(", ")", ",", "true", ")", ")", ";", "session", "(", "'state'", ",", "$", "state", ")", ";", "//-------构造请求参数列表", "$", "k...
QQ登录 @Author ZhaoXianFang @DateTime 2018-05-31 @param string $jump [跳转地址] @return [type] [description]
[ "QQ登录" ]
train
https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Qqlogin/Oauth.php#L64-L83
Linkvalue-Interne/MajoraOAuthServerBundle
src/Majora/Component/OAuth/Server/Server.php
Server.createLoginAttempt
protected function createLoginAttempt(array $data, array $headers, array $query) { // validate grant_type manually (needed to guess specialized option resolver) if (empty($data['grant_type'])) { throw new \InvalidArgumentException('Any grant_type given.'); } $grantType = ...
php
protected function createLoginAttempt(array $data, array $headers, array $query) { // validate grant_type manually (needed to guess specialized option resolver) if (empty($data['grant_type'])) { throw new \InvalidArgumentException('Any grant_type given.'); } $grantType = ...
[ "protected", "function", "createLoginAttempt", "(", "array", "$", "data", ",", "array", "$", "headers", ",", "array", "$", "query", ")", "{", "// validate grant_type manually (needed to guess specialized option resolver)", "if", "(", "empty", "(", "$", "data", "[", ...
Validate given request parameters and build a LoginAttempt object with it. @param array $data @param array $headers @param array $query @return LoginAttempt
[ "Validate", "given", "request", "parameters", "and", "build", "a", "LoginAttempt", "object", "with", "it", "." ]
train
https://github.com/Linkvalue-Interne/MajoraOAuthServerBundle/blob/3e84e2494c947d1bd5d5c16221a3b9e343ebff92/src/Majora/Component/OAuth/Server/Server.php#L119-L146
Linkvalue-Interne/MajoraOAuthServerBundle
src/Majora/Component/OAuth/Server/Server.php
Server.loadApplication
protected function loadApplication(LoginAttempt $loginAttempt) { // retrieve Application if (!$application = $this->applicationLoader->retrieveByApiKeyAndSecret( $loginAttempt->getData('client_api_key'), $loginAttempt->getData('client_secret') )) { throw n...
php
protected function loadApplication(LoginAttempt $loginAttempt) { // retrieve Application if (!$application = $this->applicationLoader->retrieveByApiKeyAndSecret( $loginAttempt->getData('client_api_key'), $loginAttempt->getData('client_secret') )) { throw n...
[ "protected", "function", "loadApplication", "(", "LoginAttempt", "$", "loginAttempt", ")", "{", "// retrieve Application", "if", "(", "!", "$", "application", "=", "$", "this", "->", "applicationLoader", "->", "retrieveByApiKeyAndSecret", "(", "$", "loginAttempt", "...
Loads application for given login attempt. @param LoginAttempt $loginAttempt @return ApplicationInterface @throws InvalidGrantException
[ "Loads", "application", "for", "given", "login", "attempt", "." ]
train
https://github.com/Linkvalue-Interne/MajoraOAuthServerBundle/blob/3e84e2494c947d1bd5d5c16221a3b9e343ebff92/src/Majora/Component/OAuth/Server/Server.php#L157-L171
Linkvalue-Interne/MajoraOAuthServerBundle
src/Majora/Component/OAuth/Server/Server.php
Server.loadAccount
protected function loadAccount( ApplicationInterface $application, LoginAttempt $loginAttempt ) { // run grant extension result return $this->grantExtensions ->get($loginAttempt->getData('grant_type')) ->grant($application, $loginAttempt) ; }
php
protected function loadAccount( ApplicationInterface $application, LoginAttempt $loginAttempt ) { // run grant extension result return $this->grantExtensions ->get($loginAttempt->getData('grant_type')) ->grant($application, $loginAttempt) ; }
[ "protected", "function", "loadAccount", "(", "ApplicationInterface", "$", "application", ",", "LoginAttempt", "$", "loginAttempt", ")", "{", "// run grant extension result", "return", "$", "this", "->", "grantExtensions", "->", "get", "(", "$", "loginAttempt", "->", ...
Runs grant extension to load accounts. @param ApplicationInterface $application @param LoginAttempt $loginAttempt @return AccountInterface @throws \InvalidArgumentException @throws UnknownGrantTypeException
[ "Runs", "grant", "extension", "to", "load", "accounts", "." ]
train
https://github.com/Linkvalue-Interne/MajoraOAuthServerBundle/blob/3e84e2494c947d1bd5d5c16221a3b9e343ebff92/src/Majora/Component/OAuth/Server/Server.php#L184-L193
Linkvalue-Interne/MajoraOAuthServerBundle
src/Majora/Component/OAuth/Server/Server.php
Server.grant
public function grant(array $data, array $headers = array(), array $query = array()) { // create and validate login attempt from given data $loginAttempt = $this->createLoginAttempt( $data, $headers, $query ); // load application / account $account = $this->loadA...
php
public function grant(array $data, array $headers = array(), array $query = array()) { // create and validate login attempt from given data $loginAttempt = $this->createLoginAttempt( $data, $headers, $query ); // load application / account $account = $this->loadA...
[ "public", "function", "grant", "(", "array", "$", "data", ",", "array", "$", "headers", "=", "array", "(", ")", ",", "array", "$", "query", "=", "array", "(", ")", ")", "{", "// create and validate login attempt from given data", "$", "loginAttempt", "=", "$...
Grant given credentials, or throws an exception if invalid credentials for application or account. @param array $data login request data @param array $headers optionnal login request headers @param array $query optionnal login request query @return AccessTokenInterface
[ "Grant", "given", "credentials", "or", "throws", "an", "exception", "if", "invalid", "credentials", "for", "application", "or", "account", "." ]
train
https://github.com/Linkvalue-Interne/MajoraOAuthServerBundle/blob/3e84e2494c947d1bd5d5c16221a3b9e343ebff92/src/Majora/Component/OAuth/Server/Server.php#L205-L247
yuncms/yuncms-composer
ManifestManager.php
ManifestManager.build
public function build() { $packages = []; if (file_exists($installed = $this->vendorPath . '/composer/installed.json')) { $packages = json_decode(file_get_contents($installed), true); } $frontendManifest = []; $backendManifest = []; $translateManifest = []...
php
public function build() { $packages = []; if (file_exists($installed = $this->vendorPath . '/composer/installed.json')) { $packages = json_decode(file_get_contents($installed), true); } $frontendManifest = []; $backendManifest = []; $translateManifest = []...
[ "public", "function", "build", "(", ")", "{", "$", "packages", "=", "[", "]", ";", "if", "(", "file_exists", "(", "$", "installed", "=", "$", "this", "->", "vendorPath", ".", "'/composer/installed.json'", ")", ")", "{", "$", "packages", "=", "json_decode...
Build the manifest file.
[ "Build", "the", "manifest", "file", "." ]
train
https://github.com/yuncms/yuncms-composer/blob/ba2aa1e7b7e25bb30b991d315b8036c454e8f324/ManifestManager.php#L44-L91
yuncms/yuncms-composer
ManifestManager.php
ManifestManager.write
public function write($file, array $manifest) { $file = $this->vendorPath . '/' . $file; $array = var_export($manifest, true); file_put_contents($file, "<?php\n\nreturn $array;\n"); $this->opcacheInvalidate($file); }
php
public function write($file, array $manifest) { $file = $this->vendorPath . '/' . $file; $array = var_export($manifest, true); file_put_contents($file, "<?php\n\nreturn $array;\n"); $this->opcacheInvalidate($file); }
[ "public", "function", "write", "(", "$", "file", ",", "array", "$", "manifest", ")", "{", "$", "file", "=", "$", "this", "->", "vendorPath", ".", "'/'", ".", "$", "file", ";", "$", "array", "=", "var_export", "(", "$", "manifest", ",", "true", ")",...
Write the manifest array to a file. @param string $file @param array $manifest
[ "Write", "the", "manifest", "array", "to", "a", "file", "." ]
train
https://github.com/yuncms/yuncms-composer/blob/ba2aa1e7b7e25bb30b991d315b8036c454e8f324/ManifestManager.php#L98-L104
MatiasNAmendola/slimpower-auth-core
src/Callables/LoginNullAuthenticator.php
LoginNullAuthenticator.authenticate
public function authenticate($username, $password) { $enc = hash(self::DEFAULT_ALG, $username . $password); $ret = array("user" => $username, "id" => $enc); return $ret; }
php
public function authenticate($username, $password) { $enc = hash(self::DEFAULT_ALG, $username . $password); $ret = array("user" => $username, "id" => $enc); return $ret; }
[ "public", "function", "authenticate", "(", "$", "username", ",", "$", "password", ")", "{", "$", "enc", "=", "hash", "(", "self", "::", "DEFAULT_ALG", ",", "$", "username", ".", "$", "password", ")", ";", "$", "ret", "=", "array", "(", "\"user\"", "=...
Authenticate @param string $username Username @param string $password Password @return array|null User data or null
[ "Authenticate" ]
train
https://github.com/MatiasNAmendola/slimpower-auth-core/blob/550ab85d871de8451cb242eaa17f4041ff320b7c/src/Callables/LoginNullAuthenticator.php#L55-L59
judus/minimal-config
src/Config.php
Config.exists
public function exists($name, $else = null, $literal = false) { $literal || $item = $this->find($name, $this->items); isset($item) || $item = isset($this->items[$name]) ? $this->items[$name] : $else; return $item; }
php
public function exists($name, $else = null, $literal = false) { $literal || $item = $this->find($name, $this->items); isset($item) || $item = isset($this->items[$name]) ? $this->items[$name] : $else; return $item; }
[ "public", "function", "exists", "(", "$", "name", ",", "$", "else", "=", "null", ",", "$", "literal", "=", "false", ")", "{", "$", "literal", "||", "$", "item", "=", "$", "this", "->", "find", "(", "$", "name", ",", "$", "this", "->", "items", ...
@param $name @param null $else @param bool $literal @return mixed|null @throws KeyDoesNotExistException
[ "@param", "$name", "@param", "null", "$else", "@param", "bool", "$literal" ]
train
https://github.com/judus/minimal-config/blob/bd72c1a6bf46f3a17da4c6ac38e43c271be679ca/src/Config.php#L71-L79
judus/minimal-config
src/Config.php
Config.item
public function item($name, $value = null, $literal = null) { $literal = is_null($literal) ? $this->isLiteral() : $literal; func_num_args() < 2 || $this->items[$name] = $value; if (!$literal) { return $this->find($name, $this->items); } isset($this->items[$name...
php
public function item($name, $value = null, $literal = null) { $literal = is_null($literal) ? $this->isLiteral() : $literal; func_num_args() < 2 || $this->items[$name] = $value; if (!$literal) { return $this->find($name, $this->items); } isset($this->items[$name...
[ "public", "function", "item", "(", "$", "name", ",", "$", "value", "=", "null", ",", "$", "literal", "=", "null", ")", "{", "$", "literal", "=", "is_null", "(", "$", "literal", ")", "?", "$", "this", "->", "isLiteral", "(", ")", ":", "$", "litera...
@param $name @param null $value @param null|bool $literal @return mixed @throws KeyDoesNotExistException
[ "@param", "$name", "@param", "null", "$value", "@param", "null|bool", "$literal" ]
train
https://github.com/judus/minimal-config/blob/bd72c1a6bf46f3a17da4c6ac38e43c271be679ca/src/Config.php#L89-L102
judus/minimal-config
src/Config.php
Config.find
public function find($name, $array, $throw = false, $parent = null) { list($key, $child) = array_pad(explode('.', $name, 2), 2, null); if (!isset($array[$key]) && !$throw) { return null; } isset($array[$key]) || $this->throwKeyDoesNotExist($name); return $child...
php
public function find($name, $array, $throw = false, $parent = null) { list($key, $child) = array_pad(explode('.', $name, 2), 2, null); if (!isset($array[$key]) && !$throw) { return null; } isset($array[$key]) || $this->throwKeyDoesNotExist($name); return $child...
[ "public", "function", "find", "(", "$", "name", ",", "$", "array", ",", "$", "throw", "=", "false", ",", "$", "parent", "=", "null", ")", "{", "list", "(", "$", "key", ",", "$", "child", ")", "=", "array_pad", "(", "explode", "(", "'.'", ",", "...
@param $name @param $array @param null $parent @param bool $throw @return mixed @throws KeyDoesNotExistException
[ "@param", "$name", "@param", "$array", "@param", "null", "$parent", "@param", "bool", "$throw" ]
train
https://github.com/judus/minimal-config/blob/bd72c1a6bf46f3a17da4c6ac38e43c271be679ca/src/Config.php#L164-L175
goncalomb/asbestos
src/classes/Page.php
Page.start
public static function start() { if (self::$_page) { return null; } self::$_page = new Html\Document(); self::$_zones['head'] = self::$_page->head(); self::$_zones['body'] = self::$_page->body(); ob_start(); return self::$_page; }
php
public static function start() { if (self::$_page) { return null; } self::$_page = new Html\Document(); self::$_zones['head'] = self::$_page->head(); self::$_zones['body'] = self::$_page->body(); ob_start(); return self::$_page; }
[ "public", "static", "function", "start", "(", ")", "{", "if", "(", "self", "::", "$", "_page", ")", "{", "return", "null", ";", "}", "self", "::", "$", "_page", "=", "new", "Html", "\\", "Document", "(", ")", ";", "self", "::", "$", "_zones", "["...
Initialize page. @return \Asbestos\Html\Document
[ "Initialize", "page", "." ]
train
https://github.com/goncalomb/asbestos/blob/14a875b6c125cfeefe4eb1c3c524500eb8a51d04/src/classes/Page.php#L56-L66
goncalomb/asbestos
src/classes/Page.php
Page.createZone
public static function createZone($zoneName, $tag='div') { if (self::$_page && !isset(self::$_zones[$zoneName])) { $element = new Html\Element($tag); self::$_zones[$zoneName] = $element; self::append(self::$_outputZone, $element); return $element; } ...
php
public static function createZone($zoneName, $tag='div') { if (self::$_page && !isset(self::$_zones[$zoneName])) { $element = new Html\Element($tag); self::$_zones[$zoneName] = $element; self::append(self::$_outputZone, $element); return $element; } ...
[ "public", "static", "function", "createZone", "(", "$", "zoneName", ",", "$", "tag", "=", "'div'", ")", "{", "if", "(", "self", "::", "$", "_page", "&&", "!", "isset", "(", "self", "::", "$", "_zones", "[", "$", "zoneName", "]", ")", ")", "{", "$...
Create a new page zone. @param string $zoneName Zone name. @param string $tag Tag name (defaults to div). @return \Asbestos\Html\Element
[ "Create", "a", "new", "page", "zone", "." ]
train
https://github.com/goncalomb/asbestos/blob/14a875b6c125cfeefe4eb1c3c524500eb8a51d04/src/classes/Page.php#L75-L84
goncalomb/asbestos
src/classes/Page.php
Page.getZone
public static function getZone($zoneName=null) { if ($zoneName === null) { $zoneName = self::$_outputZone; } return (isset(self::$_zones[$zoneName]) ? self::$_zones[$zoneName] : null); }
php
public static function getZone($zoneName=null) { if ($zoneName === null) { $zoneName = self::$_outputZone; } return (isset(self::$_zones[$zoneName]) ? self::$_zones[$zoneName] : null); }
[ "public", "static", "function", "getZone", "(", "$", "zoneName", "=", "null", ")", "{", "if", "(", "$", "zoneName", "===", "null", ")", "{", "$", "zoneName", "=", "self", "::", "$", "_outputZone", ";", "}", "return", "(", "isset", "(", "self", "::", ...
Get zone element. @param string $zoneName Zone name (defaults to current zone). @return \Asbestos\Html\Element
[ "Get", "zone", "element", "." ]
train
https://github.com/goncalomb/asbestos/blob/14a875b6c125cfeefe4eb1c3c524500eb8a51d04/src/classes/Page.php#L92-L98
goncalomb/asbestos
src/classes/Page.php
Page.startZone
public static function startZone($zoneName) { if (isset(self::$_zones[$zoneName])) { self::flushBuffer(); self::$_zoneStack[] = self::$_outputZone; self::$_outputZone = $zoneName; return true; } return false; }
php
public static function startZone($zoneName) { if (isset(self::$_zones[$zoneName])) { self::flushBuffer(); self::$_zoneStack[] = self::$_outputZone; self::$_outputZone = $zoneName; return true; } return false; }
[ "public", "static", "function", "startZone", "(", "$", "zoneName", ")", "{", "if", "(", "isset", "(", "self", "::", "$", "_zones", "[", "$", "zoneName", "]", ")", ")", "{", "self", "::", "flushBuffer", "(", ")", ";", "self", "::", "$", "_zoneStack", ...
Set the current output zone (pushes last to stack). @param string $zoneName Zone name. @return boolean
[ "Set", "the", "current", "output", "zone", "(", "pushes", "last", "to", "stack", ")", "." ]
train
https://github.com/goncalomb/asbestos/blob/14a875b6c125cfeefe4eb1c3c524500eb8a51d04/src/classes/Page.php#L117-L126
goncalomb/asbestos
src/classes/Page.php
Page.endZone
public static function endZone() { $zoneName = array_pop(self::$_zoneStack); if ($zoneName !== null && isset(self::$_zones[$zoneName])) { self::flushBuffer(); self::$_outputZone = $zoneName; return true; } return false; }
php
public static function endZone() { $zoneName = array_pop(self::$_zoneStack); if ($zoneName !== null && isset(self::$_zones[$zoneName])) { self::flushBuffer(); self::$_outputZone = $zoneName; return true; } return false; }
[ "public", "static", "function", "endZone", "(", ")", "{", "$", "zoneName", "=", "array_pop", "(", "self", "::", "$", "_zoneStack", ")", ";", "if", "(", "$", "zoneName", "!==", "null", "&&", "isset", "(", "self", "::", "$", "_zones", "[", "$", "zoneNa...
Resets current output zone (removes last from stack). @return boolean
[ "Resets", "current", "output", "zone", "(", "removes", "last", "from", "stack", ")", "." ]
train
https://github.com/goncalomb/asbestos/blob/14a875b6c125cfeefe4eb1c3c524500eb8a51d04/src/classes/Page.php#L133-L142
goncalomb/asbestos
src/classes/Page.php
Page.append
public static function append($zoneName, ...$data) { if (isset(self::$_zones[$zoneName])) { self::flushBuffer(); call_user_func_array(array(self::$_zones[$zoneName], 'append'), $data); return true; } return false; }
php
public static function append($zoneName, ...$data) { if (isset(self::$_zones[$zoneName])) { self::flushBuffer(); call_user_func_array(array(self::$_zones[$zoneName], 'append'), $data); return true; } return false; }
[ "public", "static", "function", "append", "(", "$", "zoneName", ",", "...", "$", "data", ")", "{", "if", "(", "isset", "(", "self", "::", "$", "_zones", "[", "$", "zoneName", "]", ")", ")", "{", "self", "::", "flushBuffer", "(", ")", ";", "call_use...
Append data to to zone. @param string $zoneName Zone name. @param mixed $data Data to be appended. @return boolean
[ "Append", "data", "to", "to", "zone", "." ]
train
https://github.com/goncalomb/asbestos/blob/14a875b6c125cfeefe4eb1c3c524500eb8a51d04/src/classes/Page.php#L151-L159
goncalomb/asbestos
src/classes/Page.php
Page.flushBuffer
public static function flushBuffer() { if (self::$_page && ob_get_length()) { self::$_zones[self::$_outputZone]->append(ob_get_clean()); ob_start(); return true; } return false; }
php
public static function flushBuffer() { if (self::$_page && ob_get_length()) { self::$_zones[self::$_outputZone]->append(ob_get_clean()); ob_start(); return true; } return false; }
[ "public", "static", "function", "flushBuffer", "(", ")", "{", "if", "(", "self", "::", "$", "_page", "&&", "ob_get_length", "(", ")", ")", "{", "self", "::", "$", "_zones", "[", "self", "::", "$", "_outputZone", "]", "->", "append", "(", "ob_get_clean"...
Flushes the output buffer to the current zone element. @return boolean
[ "Flushes", "the", "output", "buffer", "to", "the", "current", "zone", "element", "." ]
train
https://github.com/goncalomb/asbestos/blob/14a875b6c125cfeefe4eb1c3c524500eb8a51d04/src/classes/Page.php#L166-L174
goncalomb/asbestos
src/classes/Page.php
Page.metaTag
public static function metaTag($name, $content) { if (self::$_page) { self::$_page->metaTag($name, $content); } }
php
public static function metaTag($name, $content) { if (self::$_page) { self::$_page->metaTag($name, $content); } }
[ "public", "static", "function", "metaTag", "(", "$", "name", ",", "$", "content", ")", "{", "if", "(", "self", "::", "$", "_page", ")", "{", "self", "::", "$", "_page", "->", "metaTag", "(", "$", "name", ",", "$", "content", ")", ";", "}", "}" ]
Set meta tag. @param string $name Meta tag name. @param string $content Meta tag content.
[ "Set", "meta", "tag", "." ]
train
https://github.com/goncalomb/asbestos/blob/14a875b6c125cfeefe4eb1c3c524500eb8a51d04/src/classes/Page.php#L194-L199
goncalomb/asbestos
src/classes/Page.php
Page.ogTags
public static function ogTags($data, $merge=true, $prefix='og') { if (self::$_page) { self::$_page->ogTags($data, $merge, $prefix); } }
php
public static function ogTags($data, $merge=true, $prefix='og') { if (self::$_page) { self::$_page->ogTags($data, $merge, $prefix); } }
[ "public", "static", "function", "ogTags", "(", "$", "data", ",", "$", "merge", "=", "true", ",", "$", "prefix", "=", "'og'", ")", "{", "if", "(", "self", "::", "$", "_page", ")", "{", "self", "::", "$", "_page", "->", "ogTags", "(", "$", "data", ...
Set Open Graph tags. @param array $data Tag names and values. @param bool $merge Merge with current tags. @param string $prefix Tag name prefix.
[ "Set", "Open", "Graph", "tags", "." ]
train
https://github.com/goncalomb/asbestos/blob/14a875b6c125cfeefe4eb1c3c524500eb8a51d04/src/classes/Page.php#L208-L213
goncalomb/asbestos
src/classes/Page.php
Page.scriptFile
public static function scriptFile($src, $end=false) { if (self::$_page) { self::$_page->scriptFile($src, $end); } }
php
public static function scriptFile($src, $end=false) { if (self::$_page) { self::$_page->scriptFile($src, $end); } }
[ "public", "static", "function", "scriptFile", "(", "$", "src", ",", "$", "end", "=", "false", ")", "{", "if", "(", "self", "::", "$", "_page", ")", "{", "self", "::", "$", "_page", "->", "scriptFile", "(", "$", "src", ",", "$", "end", ")", ";", ...
Add script file. @param string $src The script location. @param bool $end Add script to end of body instead of head.
[ "Add", "script", "file", "." ]
train
https://github.com/goncalomb/asbestos/blob/14a875b6c125cfeefe4eb1c3c524500eb8a51d04/src/classes/Page.php#L221-L226
goncalomb/asbestos
src/classes/Page.php
Page.setMetadata
public static function setMetadata($title=null, $data=[], $merge=true) { if (self::$_page) { // format the title $simple_title = $title; if ($title) { $title = str_replace('{}', $title, Config::get('site.title-format', '{}')); } else { ...
php
public static function setMetadata($title=null, $data=[], $merge=true) { if (self::$_page) { // format the title $simple_title = $title; if ($title) { $title = str_replace('{}', $title, Config::get('site.title-format', '{}')); } else { ...
[ "public", "static", "function", "setMetadata", "(", "$", "title", "=", "null", ",", "$", "data", "=", "[", "]", ",", "$", "merge", "=", "true", ")", "{", "if", "(", "self", "::", "$", "_page", ")", "{", "// format the title", "$", "simple_title", "="...
Set page title and metadata using the config (see site.metadata config). @param string $title The document title. @param array $data The metadata array. @param bool $merge Merge with current tags.
[ "Set", "page", "title", "and", "metadata", "using", "the", "config", "(", "see", "site", ".", "metadata", "config", ")", "." ]
train
https://github.com/goncalomb/asbestos/blob/14a875b6c125cfeefe4eb1c3c524500eb8a51d04/src/classes/Page.php#L248-L291
goncalomb/asbestos
src/classes/Page.php
Page.end
public static function end() { if (!self::$_page || ErrorHandling::lastError()) { return; } self::$_zones[self::$_outputZone]->append(ob_get_clean()); self::$_page->output(); // reset class self::$_page = null; self::$_zones = array(); sel...
php
public static function end() { if (!self::$_page || ErrorHandling::lastError()) { return; } self::$_zones[self::$_outputZone]->append(ob_get_clean()); self::$_page->output(); // reset class self::$_page = null; self::$_zones = array(); sel...
[ "public", "static", "function", "end", "(", ")", "{", "if", "(", "!", "self", "::", "$", "_page", "||", "ErrorHandling", "::", "lastError", "(", ")", ")", "{", "return", ";", "}", "self", "::", "$", "_zones", "[", "self", "::", "$", "_outputZone", ...
Finalize and output page.
[ "Finalize", "and", "output", "page", "." ]
train
https://github.com/goncalomb/asbestos/blob/14a875b6c125cfeefe4eb1c3c524500eb8a51d04/src/classes/Page.php#L326-L343
Innmind/Compose
src/Definition/Argument.php
Argument.validate
public function validate($value): void { if (!$this->type->accepts($value)) { throw new InvalidArgument((string) $this->name); } }
php
public function validate($value): void { if (!$this->type->accepts($value)) { throw new InvalidArgument((string) $this->name); } }
[ "public", "function", "validate", "(", "$", "value", ")", ":", "void", "{", "if", "(", "!", "$", "this", "->", "type", "->", "accepts", "(", "$", "value", ")", ")", "{", "throw", "new", "InvalidArgument", "(", "(", "string", ")", "$", "this", "->",...
@param mixed $value @throws InvalidArgument
[ "@param", "mixed", "$value" ]
train
https://github.com/Innmind/Compose/blob/1a833d7ba2f6248e9c472c00cd7aca041c1a2ba9/src/Definition/Argument.php#L71-L76
yuncms/yii2-article
frontend/models/ManageSearch.php
ManageSearch.search
public function search($params) { $query = Article::find()->where(['user_id' => Yii::$app->user->id]); // add conditions that should always apply here $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); $this->load($params); if (!$this->val...
php
public function search($params) { $query = Article::find()->where(['user_id' => Yii::$app->user->id]); // add conditions that should always apply here $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); $this->load($params); if (!$this->val...
[ "public", "function", "search", "(", "$", "params", ")", "{", "$", "query", "=", "Article", "::", "find", "(", ")", "->", "where", "(", "[", "'user_id'", "=>", "Yii", "::", "$", "app", "->", "user", "->", "id", "]", ")", ";", "// add conditions that ...
Creates data provider instance with search query applied @param array $params @return ActiveDataProvider
[ "Creates", "data", "provider", "instance", "with", "search", "query", "applied" ]
train
https://github.com/yuncms/yii2-article/blob/177ec4d3d143b2f2a69bce760e873485cf3df192/frontend/models/ManageSearch.php#L42-L78
cloudtek/dynamodm
lib/Cloudtek/DynamoDM/Type/TypeFactory.php
TypeFactory.getType
public static function getType($type) { if (!isset(self::$typesMap[$type])) { throw new \InvalidArgumentException(sprintf('Invalid type specified "%s".', $type)); } if (!isset(self::$typeObjects[$type])) { $className = self::$typesMap[$type]; ...
php
public static function getType($type) { if (!isset(self::$typesMap[$type])) { throw new \InvalidArgumentException(sprintf('Invalid type specified "%s".', $type)); } if (!isset(self::$typeObjects[$type])) { $className = self::$typesMap[$type]; ...
[ "public", "static", "function", "getType", "(", "$", "type", ")", "{", "if", "(", "!", "isset", "(", "self", "::", "$", "typesMap", "[", "$", "type", "]", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf", "(", "'Invalid t...
Get a Type instance. @param string $type The type name. @return Type $type @throws \InvalidArgumentException
[ "Get", "a", "Type", "instance", "." ]
train
https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Type/TypeFactory.php#L78-L89
cloudtek/dynamodm
lib/Cloudtek/DynamoDM/Type/TypeFactory.php
TypeFactory.getTypeFromPHPVariable
public static function getTypeFromPHPVariable($variable) { if ($variable === null) { throw ODMException::cannotInferTypeFromNullValue(); } $phpType = gettype($variable); if ($phpType === 'string') { if ($variable === '') { throw new \...
php
public static function getTypeFromPHPVariable($variable) { if ($variable === null) { throw ODMException::cannotInferTypeFromNullValue(); } $phpType = gettype($variable); if ($phpType === 'string') { if ($variable === '') { throw new \...
[ "public", "static", "function", "getTypeFromPHPVariable", "(", "$", "variable", ")", "{", "if", "(", "$", "variable", "===", "null", ")", "{", "throw", "ODMException", "::", "cannotInferTypeFromNullValue", "(", ")", ";", "}", "$", "phpType", "=", "gettype", ...
Get a Type instance based on the type of the passed php variable. Adapted from {@see \Aws\DynamoDb\Marshaler} @param mixed $variable @return Type $type @throws ODMException
[ "Get", "a", "Type", "instance", "based", "on", "the", "type", "of", "the", "passed", "php", "variable", "." ]
train
https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Type/TypeFactory.php#L102-L165
cloudtek/dynamodm
lib/Cloudtek/DynamoDM/Type/TypeFactory.php
TypeFactory.overrideType
public static function overrideType($name, $className) { if (!isset(self::$typesMap[$name])) { throw MappingException::typeNotFound($name); } self::$typesMap[$name] = $className; }
php
public static function overrideType($name, $className) { if (!isset(self::$typesMap[$name])) { throw MappingException::typeNotFound($name); } self::$typesMap[$name] = $className; }
[ "public", "static", "function", "overrideType", "(", "$", "name", ",", "$", "className", ")", "{", "if", "(", "!", "isset", "(", "self", "::", "$", "typesMap", "[", "$", "name", "]", ")", ")", "{", "throw", "MappingException", "::", "typeNotFound", "("...
Overrides an already defined type to use a different implementation. @param string $name @param string $className @throws MappingException
[ "Overrides", "an", "already", "defined", "type", "to", "use", "a", "different", "implementation", "." ]
train
https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Type/TypeFactory.php#L198-L205
pluf/discount
src/Discount/Service.php
Discount_Service.discountIsValid
public static function discountIsValid($code) { $discount = Discount_Shortcuts_GetDiscountByCodeOrNull($code); if ($discount == null) return false; $engine = Discount_Shortcuts_GetEngineOrNull($discount->get_type()); if ($engine == null) return false; ...
php
public static function discountIsValid($code) { $discount = Discount_Shortcuts_GetDiscountByCodeOrNull($code); if ($discount == null) return false; $engine = Discount_Shortcuts_GetEngineOrNull($discount->get_type()); if ($engine == null) return false; ...
[ "public", "static", "function", "discountIsValid", "(", "$", "code", ")", "{", "$", "discount", "=", "Discount_Shortcuts_GetDiscountByCodeOrNull", "(", "$", "code", ")", ";", "if", "(", "$", "discount", "==", "null", ")", "return", "false", ";", "$", "engine...
Checks if discount with given code is valid. @param string $code @return boolean
[ "Checks", "if", "discount", "with", "given", "code", "is", "valid", "." ]
train
https://github.com/pluf/discount/blob/b0006d6b25dd61241f51b5b098d7d546b470de26/src/Discount/Service.php#L49-L58
pluf/discount
src/Discount/Service.php
Discount_Service.getPrice
public static function getPrice($originPrice, $discountCode, $request) { $discount = Discount_Shortcuts_GetDiscountByCodeOr404($discountCode); $engine = $discount->get_engine(); return $engine->getPrice($originPrice, $discount, $request); }
php
public static function getPrice($originPrice, $discountCode, $request) { $discount = Discount_Shortcuts_GetDiscountByCodeOr404($discountCode); $engine = $discount->get_engine(); return $engine->getPrice($originPrice, $discount, $request); }
[ "public", "static", "function", "getPrice", "(", "$", "originPrice", ",", "$", "discountCode", ",", "$", "request", ")", "{", "$", "discount", "=", "Discount_Shortcuts_GetDiscountByCodeOr404", "(", "$", "discountCode", ")", ";", "$", "engine", "=", "$", "disco...
Computes and returns new price after using given discount @param integer $originPrice @param string $discountCode @param Pluf_HTTP_Request $request @return integer
[ "Computes", "and", "returns", "new", "price", "after", "using", "given", "discount" ]
train
https://github.com/pluf/discount/blob/b0006d6b25dd61241f51b5b098d7d546b470de26/src/Discount/Service.php#L68-L73
pluf/discount
src/Discount/Service.php
Discount_Service.consumeDiscount
public static function consumeDiscount($discountCode) { $discount = Discount_Shortcuts_GetDiscountByCodeOr404($discountCode); $engine = $discount->get_engine(); $engine->consumeDiscount($discount); return $discount; }
php
public static function consumeDiscount($discountCode) { $discount = Discount_Shortcuts_GetDiscountByCodeOr404($discountCode); $engine = $discount->get_engine(); $engine->consumeDiscount($discount); return $discount; }
[ "public", "static", "function", "consumeDiscount", "(", "$", "discountCode", ")", "{", "$", "discount", "=", "Discount_Shortcuts_GetDiscountByCodeOr404", "(", "$", "discountCode", ")", ";", "$", "engine", "=", "$", "discount", "->", "get_engine", "(", ")", ";", ...
Decrease one unit of given discount. If discount is one-time-use it will be invalid after this function. @param string $discountCode @return Discount_Discount
[ "Decrease", "one", "unit", "of", "given", "discount", ".", "If", "discount", "is", "one", "-", "time", "-", "use", "it", "will", "be", "invalid", "after", "this", "function", "." ]
train
https://github.com/pluf/discount/blob/b0006d6b25dd61241f51b5b098d7d546b470de26/src/Discount/Service.php#L82-L88
nhlm/pipechain
src/InvokerProcessors/Traits/StackProcessingTrait.php
StackProcessingTrait.processStack
public function processStack($payload, PipeChainCollectionInterface $pipeChainCollection) { foreach ( $pipeChainCollection as $stage => $fallback ) { $payload = $this->process($payload, $stage, $fallback); } return $payload; }
php
public function processStack($payload, PipeChainCollectionInterface $pipeChainCollection) { foreach ( $pipeChainCollection as $stage => $fallback ) { $payload = $this->process($payload, $stage, $fallback); } return $payload; }
[ "public", "function", "processStack", "(", "$", "payload", ",", "PipeChainCollectionInterface", "$", "pipeChainCollection", ")", "{", "foreach", "(", "$", "pipeChainCollection", "as", "$", "stage", "=>", "$", "fallback", ")", "{", "$", "payload", "=", "$", "th...
processes a PipeChainCollection with the provided payload. @param mixed $payload @param PipeChainCollectionInterface $pipeChainCollection @return mixed payload
[ "processes", "a", "PipeChainCollection", "with", "the", "provided", "payload", "." ]
train
https://github.com/nhlm/pipechain/blob/7f67b54372415a66c42ce074bc359c55fda218a5/src/InvokerProcessors/Traits/StackProcessingTrait.php#L25-L32
wb-crowdfusion/crowdfusion
system/core/classes/libraries/http/HttpRequest.php
HttpRequest.fetchJSON
public function fetchJSON($url, $followRedirects = true, $username = null, $password = null, $headers = array()) { $contents = $this->fetchURL($url, $followRedirects, $username, $password, $headers); return JSONUtils::decode($contents,true); }
php
public function fetchJSON($url, $followRedirects = true, $username = null, $password = null, $headers = array()) { $contents = $this->fetchURL($url, $followRedirects, $username, $password, $headers); return JSONUtils::decode($contents,true); }
[ "public", "function", "fetchJSON", "(", "$", "url", ",", "$", "followRedirects", "=", "true", ",", "$", "username", "=", "null", ",", "$", "password", "=", "null", ",", "$", "headers", "=", "array", "(", ")", ")", "{", "$", "contents", "=", "$", "t...
Fetch the contents of a URL as a JSON array @param string $url Fully-qualified URL to request @param bool $followRedirects If true, follow redirects to default max of 5 @param string $username Username to use in http authentication header @param string $password Password to use in http authentication header @param a...
[ "Fetch", "the", "contents", "of", "a", "URL", "as", "a", "JSON", "array" ]
train
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/http/HttpRequest.php#L63-L67
wb-crowdfusion/crowdfusion
system/core/classes/libraries/http/HttpRequest.php
HttpRequest.headURL
public function headURL($url, $followRedirects = true, $username = null, $password = null, $headers = array()) { if (function_exists('curl_init')) { $contents = $this->curlRequest($url, true, $followRedirects, $username, $password, $headers); return $contents; } el...
php
public function headURL($url, $followRedirects = true, $username = null, $password = null, $headers = array()) { if (function_exists('curl_init')) { $contents = $this->curlRequest($url, true, $followRedirects, $username, $password, $headers); return $contents; } el...
[ "public", "function", "headURL", "(", "$", "url", ",", "$", "followRedirects", "=", "true", ",", "$", "username", "=", "null", ",", "$", "password", "=", "null", ",", "$", "headers", "=", "array", "(", ")", ")", "{", "if", "(", "function_exists", "("...
Fetch the headers of a URL @param string $url Fully-qualified URL to request @param bool $followRedirects If true, follow redirects to default max of 5 @param string $username Username to use in http authentication header @param string $password Password to use in http authentication header @param array $headers A...
[ "Fetch", "the", "headers", "of", "a", "URL" ]
train
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/http/HttpRequest.php#L81-L94
wb-crowdfusion/crowdfusion
system/core/classes/libraries/http/HttpRequest.php
HttpRequest.postURL
public function postURL($url, $postData, $username = null, $password = null, $headers = array(), &$responseHeaders = false) { $c = curl_init(); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); curl_setopt($c, CURLOPT_URL, $url); if ($this->timeout != null) { curl_setopt($c, ...
php
public function postURL($url, $postData, $username = null, $password = null, $headers = array(), &$responseHeaders = false) { $c = curl_init(); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); curl_setopt($c, CURLOPT_URL, $url); if ($this->timeout != null) { curl_setopt($c, ...
[ "public", "function", "postURL", "(", "$", "url", ",", "$", "postData", ",", "$", "username", "=", "null", ",", "$", "password", "=", "null", ",", "$", "headers", "=", "array", "(", ")", ",", "&", "$", "responseHeaders", "=", "false", ")", "{", "$"...
Posts the data to the given URL @param string $url Fully-qualified URL to request @param mixed $postData The full data to post in a HTTP "POST" operation. To post a file, prepend a filename with @ and use the full path. This can either be passed as a urlencoded string like 'para1=val1&para2=val2&...' or as an array wi...
[ "Posts", "the", "data", "to", "the", "given", "URL" ]
train
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/http/HttpRequest.php#L183-L258
wb-crowdfusion/crowdfusion
system/core/classes/libraries/http/HttpRequest.php
HttpRequest.fetchURL
public function fetchURL($url, $followRedirects = true, $username = null, $password = null, $headers = array()) { if (function_exists('curl_init')) { $contents = $this->curlRequest($url, false, $followRedirects, $username, $password, $headers); return $contents; } else { ...
php
public function fetchURL($url, $followRedirects = true, $username = null, $password = null, $headers = array()) { if (function_exists('curl_init')) { $contents = $this->curlRequest($url, false, $followRedirects, $username, $password, $headers); return $contents; } else { ...
[ "public", "function", "fetchURL", "(", "$", "url", ",", "$", "followRedirects", "=", "true", ",", "$", "username", "=", "null", ",", "$", "password", "=", "null", ",", "$", "headers", "=", "array", "(", ")", ")", "{", "if", "(", "function_exists", "(...
Fetch the contents of a URL @param string $url Fully-qualified URL to request @param bool $followRedirects If true, follow redirects to default max of 5 @param string $username Username to use in http authentication header @param string $password Password to use in http authentication header @param array $headers ...
[ "Fetch", "the", "contents", "of", "a", "URL" ]
train
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/http/HttpRequest.php#L274-L320
sil-project/SeedBatchBundle
src/CodeGenerator/SeedBatchCodeGenerator.php
SeedBatchCodeGenerator.generate
public static function generate($seedBatch) { if (!$seedFarm = $seedBatch->getSeedFarm()) { throw new InvalidEntityCodeException('librinfo.error.missing_seed_farm'); } if (!$seedFarmCode = $seedFarm->getCode()) { throw new InvalidEntityCodeException('librinfo.error.mi...
php
public static function generate($seedBatch) { if (!$seedFarm = $seedBatch->getSeedFarm()) { throw new InvalidEntityCodeException('librinfo.error.missing_seed_farm'); } if (!$seedFarmCode = $seedFarm->getCode()) { throw new InvalidEntityCodeException('librinfo.error.mi...
[ "public", "static", "function", "generate", "(", "$", "seedBatch", ")", "{", "if", "(", "!", "$", "seedFarm", "=", "$", "seedBatch", "->", "getSeedFarm", "(", ")", ")", "{", "throw", "new", "InvalidEntityCodeException", "(", "'librinfo.error.missing_seed_farm'",...
@param SeedBatch $seedBatch @return string @throws InvalidEntityCodeException
[ "@param", "SeedBatch", "$seedBatch" ]
train
https://github.com/sil-project/SeedBatchBundle/blob/a2640b5359fe31d3bdb9c9fa2f72141ac841729c/src/CodeGenerator/SeedBatchCodeGenerator.php#L44-L101
kambalabs/KmbBase
src/KmbBase/Widget/AbstractWidgetAction.php
AbstractWidgetAction.setPluginManager
public function setPluginManager(PluginManager $plugins) { $this->plugins = $plugins; $this->plugins->setController($this->controller); return $this; }
php
public function setPluginManager(PluginManager $plugins) { $this->plugins = $plugins; $this->plugins->setController($this->controller); return $this; }
[ "public", "function", "setPluginManager", "(", "PluginManager", "$", "plugins", ")", "{", "$", "this", "->", "plugins", "=", "$", "plugins", ";", "$", "this", "->", "plugins", "->", "setController", "(", "$", "this", "->", "controller", ")", ";", "return",...
Set plugin manager @param PluginManager $plugins @return AbstractWidgetAction
[ "Set", "plugin", "manager" ]
train
https://github.com/kambalabs/KmbBase/blob/ca420f247e9e4063266005e30afc4c8af492a33b/src/KmbBase/Widget/AbstractWidgetAction.php#L80-L86
OxfordInfoLabs/kinikit-core
src/Util/Annotation/Annotation.php
Annotation.getValues
public function getValues() { $exploded = explode(",", $this->getValue()); $values = array(); foreach ($exploded as $entry){ $values[] = trim($entry); } return $values; }
php
public function getValues() { $exploded = explode(",", $this->getValue()); $values = array(); foreach ($exploded as $entry){ $values[] = trim($entry); } return $values; }
[ "public", "function", "getValues", "(", ")", "{", "$", "exploded", "=", "explode", "(", "\",\"", ",", "$", "this", "->", "getValue", "(", ")", ")", ";", "$", "values", "=", "array", "(", ")", ";", "foreach", "(", "$", "exploded", "as", "$", "entry"...
Return value as an array split by ","
[ "Return", "value", "as", "an", "array", "split", "by" ]
train
https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/Annotation/Annotation.php#L62-L70
davewwww/Ispec
src/Dwo/Ispec/Cache/FindAllManager.php
FindAllManager.findAllByIp
public function findAllByIp($ip) { $ip = ip2long($ip); $ipInfos = []; foreach($this->ipInfosLong as $data) { if($ip >= $data[0] && $ip <= $data[1]) { $ipInfos[] = $data[2]; } } return $ipInfos; }
php
public function findAllByIp($ip) { $ip = ip2long($ip); $ipInfos = []; foreach($this->ipInfosLong as $data) { if($ip >= $data[0] && $ip <= $data[1]) { $ipInfos[] = $data[2]; } } return $ipInfos; }
[ "public", "function", "findAllByIp", "(", "$", "ip", ")", "{", "$", "ip", "=", "ip2long", "(", "$", "ip", ")", ";", "$", "ipInfos", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "ipInfosLong", "as", "$", "data", ")", "{", "if", "(", "$...
{@inheritdoc}
[ "{" ]
train
https://github.com/davewwww/Ispec/blob/06e40344eaad27715c87c8f6830ab4894e89736d/src/Dwo/Ispec/Cache/FindAllManager.php#L44-L56
goncalomb/asbestos
src/classes/Http/Request.php
Request.fromGlobals
public static function fromGlobals() { $request = new self(); foreach ([ 'Accept', 'Accept-Charset', 'Accept-Encoding', 'Accept-Language', 'Connection', 'Host', 'Referer', 'User-Agent' ] as $name) { $key = 'HTTP_' . str_replace('-', '_', strtoupper($name)...
php
public static function fromGlobals() { $request = new self(); foreach ([ 'Accept', 'Accept-Charset', 'Accept-Encoding', 'Accept-Language', 'Connection', 'Host', 'Referer', 'User-Agent' ] as $name) { $key = 'HTTP_' . str_replace('-', '_', strtoupper($name)...
[ "public", "static", "function", "fromGlobals", "(", ")", "{", "$", "request", "=", "new", "self", "(", ")", ";", "foreach", "(", "[", "'Accept'", ",", "'Accept-Charset'", ",", "'Accept-Encoding'", ",", "'Accept-Language'", ",", "'Connection'", ",", "'Host'", ...
Create request from PHP globals.
[ "Create", "request", "from", "PHP", "globals", "." ]
train
https://github.com/goncalomb/asbestos/blob/14a875b6c125cfeefe4eb1c3c524500eb8a51d04/src/classes/Http/Request.php#L61-L90
offworks/laraquent
src/Support/Exedra/Wizard.php
Wizard.executeMigrate
public function executeMigrate() { $this->app->eloquent->getConnection()->useDefaultSchemaGrammar(); $file = $this->app->path['app']->file($this->app->config->get('db.schema_path', 'database/schema.php')); if(!$file->isExists()) throw new \Exception('['.$file.'] does not exists.'); $file->load(array( ...
php
public function executeMigrate() { $this->app->eloquent->getConnection()->useDefaultSchemaGrammar(); $file = $this->app->path['app']->file($this->app->config->get('db.schema_path', 'database/schema.php')); if(!$file->isExists()) throw new \Exception('['.$file.'] does not exists.'); $file->load(array( ...
[ "public", "function", "executeMigrate", "(", ")", "{", "$", "this", "->", "app", "->", "eloquent", "->", "getConnection", "(", ")", "->", "useDefaultSchemaGrammar", "(", ")", ";", "$", "file", "=", "$", "this", "->", "app", "->", "path", "[", "'app'", ...
Migrate eloquent schema Use db.schema_path config if configured @description Migrate eloquent schema
[ "Migrate", "eloquent", "schema", "Use", "db", ".", "schema_path", "config", "if", "configured" ]
train
https://github.com/offworks/laraquent/blob/74cbc6258acfda8f7213c701887a7b223aff954f/src/Support/Exedra/Wizard.php#L13-L25
staticka/staticka
src/Filter/InlineMinifier.php
InlineMinifier.filter
public function filter($code) { $elements = (array) $this->elements($code); foreach ((array) $elements as $element) { $original = (string) $element->nodeValue; $minified = $this->minify($original); $minified = preg_replace('/\s+/', ' ', $minified); ...
php
public function filter($code) { $elements = (array) $this->elements($code); foreach ((array) $elements as $element) { $original = (string) $element->nodeValue; $minified = $this->minify($original); $minified = preg_replace('/\s+/', ' ', $minified); ...
[ "public", "function", "filter", "(", "$", "code", ")", "{", "$", "elements", "=", "(", "array", ")", "$", "this", "->", "elements", "(", "$", "code", ")", ";", "foreach", "(", "(", "array", ")", "$", "elements", "as", "$", "element", ")", "{", "$...
Filters the specified code. @param string $code @return string
[ "Filters", "the", "specified", "code", "." ]
train
https://github.com/staticka/staticka/blob/6e3b814c391ed03b0bd409803e11579bae677ce4/src/Filter/InlineMinifier.php#L34-L52
staticka/staticka
src/Filter/InlineMinifier.php
InlineMinifier.elements
protected function elements($code) { libxml_use_internal_errors(true); $doc = new \DOMDocument; $doc->loadHTML((string) $code); $tag = (string) $this->tagname; $items = $doc->getElementsByTagName($tag); $items = iterator_to_array($items); return count($i...
php
protected function elements($code) { libxml_use_internal_errors(true); $doc = new \DOMDocument; $doc->loadHTML((string) $code); $tag = (string) $this->tagname; $items = $doc->getElementsByTagName($tag); $items = iterator_to_array($items); return count($i...
[ "protected", "function", "elements", "(", "$", "code", ")", "{", "libxml_use_internal_errors", "(", "true", ")", ";", "$", "doc", "=", "new", "\\", "DOMDocument", ";", "$", "doc", "->", "loadHTML", "(", "(", "string", ")", "$", "code", ")", ";", "$", ...
Returns elements by a tag name. @param string $code @return \DOMNodeList
[ "Returns", "elements", "by", "a", "tag", "name", "." ]
train
https://github.com/staticka/staticka/blob/6e3b814c391ed03b0bd409803e11579bae677ce4/src/Filter/InlineMinifier.php#L60-L75
staticka/staticka
src/Filter/InlineMinifier.php
InlineMinifier.minify
protected function minify($code) { $pattern = (string) '!/\*[^*]*\*+([^/][^*]*\*+)*/!'; $minified = preg_replace('/^\\s+/m', '', $code); $minified = preg_replace($pattern, '', $minified); $minified = preg_replace('/( )?}( )?/', '}', $minified); $minified = preg_replace('/...
php
protected function minify($code) { $pattern = (string) '!/\*[^*]*\*+([^/][^*]*\*+)*/!'; $minified = preg_replace('/^\\s+/m', '', $code); $minified = preg_replace($pattern, '', $minified); $minified = preg_replace('/( )?}( )?/', '}', $minified); $minified = preg_replace('/...
[ "protected", "function", "minify", "(", "$", "code", ")", "{", "$", "pattern", "=", "(", "string", ")", "'!/\\*[^*]*\\*+([^/][^*]*\\*+)*/!'", ";", "$", "minified", "=", "preg_replace", "(", "'/^\\\\s+/m'", ",", "''", ",", "$", "code", ")", ";", "$", "minif...
Minifies the specified code. @param string $code @return string
[ "Minifies", "the", "specified", "code", "." ]
train
https://github.com/staticka/staticka/blob/6e3b814c391ed03b0bd409803e11579bae677ce4/src/Filter/InlineMinifier.php#L83-L102
phpactor/completion-rpc-extension
lib/CompletionRpcExtension.php
CompletionRpcExtension.load
public function load(ContainerBuilder $container) { $container->register('completion_rpc.handler', function (Container $container) { return new CompleteHandler($container->get(CompletionExtension::SERVICE_REGISTRY)); }, [ RpcExtension::TAG_RPC_HANDLER => ['name' => CompleteHandler::NAME]...
php
public function load(ContainerBuilder $container) { $container->register('completion_rpc.handler', function (Container $container) { return new CompleteHandler($container->get(CompletionExtension::SERVICE_REGISTRY)); }, [ RpcExtension::TAG_RPC_HANDLER => ['name' => CompleteHandler::NAME]...
[ "public", "function", "load", "(", "ContainerBuilder", "$", "container", ")", "{", "$", "container", "->", "register", "(", "'completion_rpc.handler'", ",", "function", "(", "Container", "$", "container", ")", "{", "return", "new", "CompleteHandler", "(", "$", ...
{@inheritDoc}
[ "{" ]
train
https://github.com/phpactor/completion-rpc-extension/blob/0968cd63d4408905e4a4df646986de5a6822343e/lib/CompletionRpcExtension.php#L25-L30
lightwerk/SurfTasks
Classes/Lightwerk/SurfTasks/Task/Transfer/AssureConnectionTask.php
AssureConnectionTask.execute
public function execute(Node $node, Application $application, Deployment $deployment, array $options = []) { if ($node->isLocalhost()) { $deployment->getLogger()->log('node seems not to be a remote node', LOG_DEBUG); } else { $username = $node->hasOption('username') ? $node->...
php
public function execute(Node $node, Application $application, Deployment $deployment, array $options = []) { if ($node->isLocalhost()) { $deployment->getLogger()->log('node seems not to be a remote node', LOG_DEBUG); } else { $username = $node->hasOption('username') ? $node->...
[ "public", "function", "execute", "(", "Node", "$", "node", ",", "Application", "$", "application", ",", "Deployment", "$", "deployment", ",", "array", "$", "options", "=", "[", "]", ")", "{", "if", "(", "$", "node", "->", "isLocalhost", "(", ")", ")", ...
Executes this task. @param Node $node @param Application $application @param Deployment $deployment @param array $options @throws TaskExecutionException
[ "Executes", "this", "task", "." ]
train
https://github.com/lightwerk/SurfTasks/blob/8a6e4c85e42c762ad6515778c3fc7e19052cd9d1/Classes/Lightwerk/SurfTasks/Task/Transfer/AssureConnectionTask.php#L52-L74
Nicklas766/Comment
src/Comment/Modules/Vote.php
Vote.getVote
public function getVote($sql, $params) { $likes = $this->findAllWhere("$sql", $params); // Return users of the ones who have upvoted. $score = array_reduce($likes, function ($carry, $item) { $carry += $item->upVote - $item->downVote; return $carry; }); ...
php
public function getVote($sql, $params) { $likes = $this->findAllWhere("$sql", $params); // Return users of the ones who have upvoted. $score = array_reduce($likes, function ($carry, $item) { $carry += $item->upVote - $item->downVote; return $carry; }); ...
[ "public", "function", "getVote", "(", "$", "sql", ",", "$", "params", ")", "{", "$", "likes", "=", "$", "this", "->", "findAllWhere", "(", "\"$sql\"", ",", "$", "params", ")", ";", "// Return users of the ones who have upvoted.", "$", "score", "=", "array_re...
Return a vote @param string $sql @param array $params @return object
[ "Return", "a", "vote", "@param", "string", "$sql", "@param", "array", "$params" ]
train
https://github.com/Nicklas766/Comment/blob/1483eaf1ebb120b8bd6c2a1552c084b3a288ff25/src/Comment/Modules/Vote.php#L36-L49
Nicklas766/Comment
src/Comment/Modules/Vote.php
Vote.saveVote
public function saveVote($user, $parentId, $parentType, $voteType = "like") { $vote = $this->findAllWhere("parentId = ? AND parentType = ? AND user = ?", [$parentId, $parentType, $user])[0]; if ($vote != null) { $vote->setDb($this->db); } if ($vote == null) { ...
php
public function saveVote($user, $parentId, $parentType, $voteType = "like") { $vote = $this->findAllWhere("parentId = ? AND parentType = ? AND user = ?", [$parentId, $parentType, $user])[0]; if ($vote != null) { $vote->setDb($this->db); } if ($vote == null) { ...
[ "public", "function", "saveVote", "(", "$", "user", ",", "$", "parentId", ",", "$", "parentType", ",", "$", "voteType", "=", "\"like\"", ")", "{", "$", "vote", "=", "$", "this", "->", "findAllWhere", "(", "\"parentId = ? AND parentType = ? AND user = ?\"", ","...
Checks if vote already exists, then either create new or update @param array $params @return bool
[ "Checks", "if", "vote", "already", "exists", "then", "either", "create", "new", "or", "update", "@param", "array", "$params" ]
train
https://github.com/Nicklas766/Comment/blob/1483eaf1ebb120b8bd6c2a1552c084b3a288ff25/src/Comment/Modules/Vote.php#L57-L84
Nicklas766/Comment
src/Comment/Modules/Vote.php
Vote.like
public function like($user, $parentId, $parentType) { $likes = $this->findAllWhere("parentId = ? AND parentType = ?", [$parentId, $parentType]); // Return users of the ones who have upvoted. $users = array_map(function ($like) { return $like->upVote != null ? $like->user : ""; ...
php
public function like($user, $parentId, $parentType) { $likes = $this->findAllWhere("parentId = ? AND parentType = ?", [$parentId, $parentType]); // Return users of the ones who have upvoted. $users = array_map(function ($like) { return $like->upVote != null ? $like->user : ""; ...
[ "public", "function", "like", "(", "$", "user", ",", "$", "parentId", ",", "$", "parentType", ")", "{", "$", "likes", "=", "$", "this", "->", "findAllWhere", "(", "\"parentId = ? AND parentType = ?\"", ",", "[", "$", "parentId", ",", "$", "parentType", "]"...
Control if user has already liked or not @param string $user @param array $params @return bool
[ "Control", "if", "user", "has", "already", "liked", "or", "not", "@param", "string", "$user", "@param", "array", "$params" ]
train
https://github.com/Nicklas766/Comment/blob/1483eaf1ebb120b8bd6c2a1552c084b3a288ff25/src/Comment/Modules/Vote.php#L93-L106
phossa/phossa-config
src/Phossa/Config/Loader/JsonLoader.php
JsonLoader.load
public static function load(/*# string */ $path)/*# : array */ { if (!is_readable($path)) { throw new LogicException( Message::get(Message::CONFIG_LOAD_ERROR, $path), Message::CONFIG_LOAD_ERROR ); } $data = @json_decode(file_get_co...
php
public static function load(/*# string */ $path)/*# : array */ { if (!is_readable($path)) { throw new LogicException( Message::get(Message::CONFIG_LOAD_ERROR, $path), Message::CONFIG_LOAD_ERROR ); } $data = @json_decode(file_get_co...
[ "public", "static", "function", "load", "(", "/*# string */", "$", "path", ")", "/*# : array */", "{", "if", "(", "!", "is_readable", "(", "$", "path", ")", ")", "{", "throw", "new", "LogicException", "(", "Message", "::", "get", "(", "Message", "::", "C...
{@inheritDoc}
[ "{" ]
train
https://github.com/phossa/phossa-config/blob/fdb90831da06408bb674ab777754e67025604bed/src/Phossa/Config/Loader/JsonLoader.php#L34-L58
ZFrapid/zfrapid-library
src/View/Helper/H1.php
H1.toString
public function toString($indent = null) { $output = parent::toString($indent); $output = str_replace( ['<title>', '</title>'], ['<h1>', '</h1>'], $output ); return $output; }
php
public function toString($indent = null) { $output = parent::toString($indent); $output = str_replace( ['<title>', '</title>'], ['<h1>', '</h1>'], $output ); return $output; }
[ "public", "function", "toString", "(", "$", "indent", "=", "null", ")", "{", "$", "output", "=", "parent", "::", "toString", "(", "$", "indent", ")", ";", "$", "output", "=", "str_replace", "(", "[", "'<title>'", ",", "'</title>'", "]", ",", "[", "'<...
Turn helper into string @param string|null $indent @return string
[ "Turn", "helper", "into", "string" ]
train
https://github.com/ZFrapid/zfrapid-library/blob/3eca4f465dd1f2dee889532892c5052e830bc03c/src/View/Helper/H1.php#L51-L59
Vectrex/vxPHP
src/Application/Config.php
Config.dumpXmlErrors
private function dumpXmlErrors($xmlFile) { $severity = [LIBXML_ERR_WARNING => 'Warning', LIBXML_ERR_ERROR => 'Error', LIBXML_ERR_FATAL => 'Fatal']; $errors = []; foreach(libxml_get_errors() as $error) { $errors[] = sprintf("Row %d, column %d: %s (%d) %s", $error->line, $error->column, $severity[$error->level...
php
private function dumpXmlErrors($xmlFile) { $severity = [LIBXML_ERR_WARNING => 'Warning', LIBXML_ERR_ERROR => 'Error', LIBXML_ERR_FATAL => 'Fatal']; $errors = []; foreach(libxml_get_errors() as $error) { $errors[] = sprintf("Row %d, column %d: %s (%d) %s", $error->line, $error->column, $severity[$error->level...
[ "private", "function", "dumpXmlErrors", "(", "$", "xmlFile", ")", "{", "$", "severity", "=", "[", "LIBXML_ERR_WARNING", "=>", "'Warning'", ",", "LIBXML_ERR_ERROR", "=>", "'Error'", ",", "LIBXML_ERR_FATAL", "=>", "'Fatal'", "]", ";", "$", "errors", "=", "[", ...
Create formatted output of XML errors @param string $xmlFile @throws ConfigException
[ "Create", "formatted", "output", "of", "XML", "errors" ]
train
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Config.php#L173-L184
Vectrex/vxPHP
src/Application/Config.php
Config.includeIncludes
private function includeIncludes(\DOMDocument $doc, $filepath) { $path = rtrim(dirname(realpath($filepath)), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; if(in_array($filepath, $this->parsedXmlFiles)) { throw new ConfigException(sprintf("File %s has already been used.", $filepath)); } $this->parsedXmlFil...
php
private function includeIncludes(\DOMDocument $doc, $filepath) { $path = rtrim(dirname(realpath($filepath)), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; if(in_array($filepath, $this->parsedXmlFiles)) { throw new ConfigException(sprintf("File %s has already been used.", $filepath)); } $this->parsedXmlFil...
[ "private", "function", "includeIncludes", "(", "\\", "DOMDocument", "$", "doc", ",", "$", "filepath", ")", "{", "$", "path", "=", "rtrim", "(", "dirname", "(", "realpath", "(", "$", "filepath", ")", ")", ",", "DIRECTORY_SEPARATOR", ")", ".", "DIRECTORY_SEP...
recursively include XML files in include tags to avoid circular references any file can only be included once @param \DOMDocument $doc @param string $filepath @throws ConfigException
[ "recursively", "include", "XML", "files", "in", "include", "tags", "to", "avoid", "circular", "references", "any", "file", "can", "only", "be", "included", "once" ]
train
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Config.php#L194-L267
Vectrex/vxPHP
src/Application/Config.php
Config.parseConfig
private function parseConfig(\DOMDocument $config) { try { // determine server context, missing SERVER_ADDR assumes localhost/CLI $this->isLocalhost = !isset($_SERVER['SERVER_ADDR']) || !!preg_match('/^(?:127|192|1|0)(?:\.\d{1,3}){3}$/', $_SERVER['SERVER_ADDR']); $rootNode = $config->firstChild; // a...
php
private function parseConfig(\DOMDocument $config) { try { // determine server context, missing SERVER_ADDR assumes localhost/CLI $this->isLocalhost = !isset($_SERVER['SERVER_ADDR']) || !!preg_match('/^(?:127|192|1|0)(?:\.\d{1,3}){3}$/', $_SERVER['SERVER_ADDR']); $rootNode = $config->firstChild; // a...
[ "private", "function", "parseConfig", "(", "\\", "DOMDocument", "$", "config", ")", "{", "try", "{", "// determine server context, missing SERVER_ADDR assumes localhost/CLI", "$", "this", "->", "isLocalhost", "=", "!", "isset", "(", "$", "_SERVER", "[", "'SERVER_ADDR'...
iterates through the top level nodes (sections) of the config file; if a method matching the section name is found this method is called to parse the section @param \DOMDocument $config @throws ConfigException @return void
[ "iterates", "through", "the", "top", "level", "nodes", "(", "sections", ")", "of", "the", "config", "file", ";", "if", "a", "method", "matching", "the", "section", "name", "is", "found", "this", "method", "is", "called", "to", "parse", "the", "section" ]
train
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Config.php#L278-L324
Vectrex/vxPHP
src/Application/Config.php
Config.parseDbSettings
private function parseDbSettings(\DOMNode $db) { $context = $this->isLocalhost ? 'local' : 'remote'; $xpath = new \DOMXPath($db->ownerDocument); $d = $xpath->query("db_connection[@context='$context']", $db); if(!$d->length) { $d = $db->getElementsByTagName('db_connection'); } if($d->length) { $t...
php
private function parseDbSettings(\DOMNode $db) { $context = $this->isLocalhost ? 'local' : 'remote'; $xpath = new \DOMXPath($db->ownerDocument); $d = $xpath->query("db_connection[@context='$context']", $db); if(!$d->length) { $d = $db->getElementsByTagName('db_connection'); } if($d->length) { $t...
[ "private", "function", "parseDbSettings", "(", "\\", "DOMNode", "$", "db", ")", "{", "$", "context", "=", "$", "this", "->", "isLocalhost", "?", "'local'", ":", "'remote'", ";", "$", "xpath", "=", "new", "\\", "DOMXPath", "(", "$", "db", "->", "ownerDo...
parse db settings @deprecated will be replaced by datasource settings @param DOMNode $db
[ "parse", "db", "settings" ]
train
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Config.php#L335-L363
Vectrex/vxPHP
src/Application/Config.php
Config.parseVxpdoSettings
private function parseVxpdoSettings(\DOMNode $vxpdo) { if(is_null($this->vxpdo)) { $this->vxpdo = []; } foreach($vxpdo->getElementsByTagName('datasource') as $datasource) { $name = $datasource->getAttribute('name') ?: 'default'; if(array_key_exists($name, $this->vxpdo)) { throw new ConfigExcepti...
php
private function parseVxpdoSettings(\DOMNode $vxpdo) { if(is_null($this->vxpdo)) { $this->vxpdo = []; } foreach($vxpdo->getElementsByTagName('datasource') as $datasource) { $name = $datasource->getAttribute('name') ?: 'default'; if(array_key_exists($name, $this->vxpdo)) { throw new ConfigExcepti...
[ "private", "function", "parseVxpdoSettings", "(", "\\", "DOMNode", "$", "vxpdo", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "vxpdo", ")", ")", "{", "$", "this", "->", "vxpdo", "=", "[", "]", ";", "}", "foreach", "(", "$", "vxpdo", "->"...
parse datasource settings @param \DOMNode $datasources @throws ConfigException
[ "parse", "datasource", "settings" ]
train
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Config.php#L371-L410
Vectrex/vxPHP
src/Application/Config.php
Config.parsePropelSettings
private function parsePropelSettings(\DOMNode $propel) { if(!class_exists('\\PropelConfiguration')) { throw new ConfigException("Class 'PropelConfiguration' not found."); } var_dump(json_decode(json_encode((array) $propel)), true); }
php
private function parsePropelSettings(\DOMNode $propel) { if(!class_exists('\\PropelConfiguration')) { throw new ConfigException("Class 'PropelConfiguration' not found."); } var_dump(json_decode(json_encode((array) $propel)), true); }
[ "private", "function", "parsePropelSettings", "(", "\\", "DOMNode", "$", "propel", ")", "{", "if", "(", "!", "class_exists", "(", "'\\\\PropelConfiguration'", ")", ")", "{", "throw", "new", "ConfigException", "(", "\"Class 'PropelConfiguration' not found.\"", ")", "...
@todo @param \DOMNode $propel @throws ConfigException
[ "@todo" ]
train
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Config.php#L418-L426
Vectrex/vxPHP
src/Application/Config.php
Config.parseMailSettings
private function parseMailSettings(\DOMNode $mail) { if(($mailer = $mail->getElementsByTagName('mailer')->item(0))) { if(is_null($this->mail)) { $this->mail = new \stdClass(); $this->mail->mailer = new \stdClass(); } if(!($class = $mailer->getAttribute('class'))) { throw new ConfigException('...
php
private function parseMailSettings(\DOMNode $mail) { if(($mailer = $mail->getElementsByTagName('mailer')->item(0))) { if(is_null($this->mail)) { $this->mail = new \stdClass(); $this->mail->mailer = new \stdClass(); } if(!($class = $mailer->getAttribute('class'))) { throw new ConfigException('...
[ "private", "function", "parseMailSettings", "(", "\\", "DOMNode", "$", "mail", ")", "{", "if", "(", "(", "$", "mailer", "=", "$", "mail", "->", "getElementsByTagName", "(", "'mailer'", ")", "->", "item", "(", "0", ")", ")", ")", "{", "if", "(", "is_n...
parses all (optional) mail settings @param \DOMNode $mail @throws ConfigException
[ "parses", "all", "(", "optional", ")", "mail", "settings" ]
train
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Config.php#L434-L460
Vectrex/vxPHP
src/Application/Config.php
Config.parseBinariesSettings
private function parseBinariesSettings(\DOMNode $binaries) { $context = $this->isLocalhost ? 'local' : 'remote'; $xpath = new \DOMXPath($binaries->ownerDocument); $e = $xpath->query("db_connection[@context='$context']", $binaries); if(!$e->length) { $e = $xpath->query('executables'); } if($e->length...
php
private function parseBinariesSettings(\DOMNode $binaries) { $context = $this->isLocalhost ? 'local' : 'remote'; $xpath = new \DOMXPath($binaries->ownerDocument); $e = $xpath->query("db_connection[@context='$context']", $binaries); if(!$e->length) { $e = $xpath->query('executables'); } if($e->length...
[ "private", "function", "parseBinariesSettings", "(", "\\", "DOMNode", "$", "binaries", ")", "{", "$", "context", "=", "$", "this", "->", "isLocalhost", "?", "'local'", ":", "'remote'", ";", "$", "xpath", "=", "new", "\\", "DOMXPath", "(", "$", "binaries", ...
parse settings for binaries @todo clean up code @param \DOMNode $binaries @throws ConfigException
[ "parse", "settings", "for", "binaries", "@todo", "clean", "up", "code" ]
train
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Config.php#L469-L504
Vectrex/vxPHP
src/Application/Config.php
Config.parseSiteSettings
private function parseSiteSettings(\DOMNode $site) { if(is_null($this->site)) { $this->site = new \stdClass; $this->site->use_nice_uris = FALSE; } foreach($site->childNodes as $node) { if($node->nodeType !== XML_ELEMENT_NODE) { continue; } $v = trim($node->nodeValue); $k = $node->nodeN...
php
private function parseSiteSettings(\DOMNode $site) { if(is_null($this->site)) { $this->site = new \stdClass; $this->site->use_nice_uris = FALSE; } foreach($site->childNodes as $node) { if($node->nodeType !== XML_ELEMENT_NODE) { continue; } $v = trim($node->nodeValue); $k = $node->nodeN...
[ "private", "function", "parseSiteSettings", "(", "\\", "DOMNode", "$", "site", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "site", ")", ")", "{", "$", "this", "->", "site", "=", "new", "\\", "stdClass", ";", "$", "this", "->", "site", "...
parse general website settings @param \DOMNode $site
[ "parse", "general", "website", "settings" ]
train
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Config.php#L511-L560
Vectrex/vxPHP
src/Application/Config.php
Config.parseTemplatingSettings
private function parseTemplatingSettings(\DOMNode $templating) { if(is_null($this->templating)) { $this->templating = new \stdClass; $this->templating->filters = []; } $xpath = new \DOMXPath($templating->ownerDocument); foreach($xpath->query("filters/filter", $templating) as $filter) { $id = $filte...
php
private function parseTemplatingSettings(\DOMNode $templating) { if(is_null($this->templating)) { $this->templating = new \stdClass; $this->templating->filters = []; } $xpath = new \DOMXPath($templating->ownerDocument); foreach($xpath->query("filters/filter", $templating) as $filter) { $id = $filte...
[ "private", "function", "parseTemplatingSettings", "(", "\\", "DOMNode", "$", "templating", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "templating", ")", ")", "{", "$", "this", "->", "templating", "=", "new", "\\", "stdClass", ";", "$", "this...
parse templating configuration currently only filters for SimpleTemplate templates and their configuration are parsed @param \DOMNode $templating
[ "parse", "templating", "configuration", "currently", "only", "filters", "for", "SimpleTemplate", "templates", "and", "their", "configuration", "are", "parsed" ]
train
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Config.php#L568-L607
Vectrex/vxPHP
src/Application/Config.php
Config.parsePathsSettings
private function parsePathsSettings(\DOMNode $paths) { if(is_null($this->paths)) { $this->paths = []; } foreach($paths->getElementsByTagName('path') as $path) { $id = $path->getAttribute('id'); $subdir = $path->getAttribute('subdir') ?: ''; if(!$id || !$subdir) { continue; } $subdir = '...
php
private function parsePathsSettings(\DOMNode $paths) { if(is_null($this->paths)) { $this->paths = []; } foreach($paths->getElementsByTagName('path') as $path) { $id = $path->getAttribute('id'); $subdir = $path->getAttribute('subdir') ?: ''; if(!$id || !$subdir) { continue; } $subdir = '...
[ "private", "function", "parsePathsSettings", "(", "\\", "DOMNode", "$", "paths", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "paths", ")", ")", "{", "$", "this", "->", "paths", "=", "[", "]", ";", "}", "foreach", "(", "$", "paths", "->"...
parse various path setting @param \DOMNode $paths
[ "parse", "various", "path", "setting" ]
train
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Config.php#L614-L637
Vectrex/vxPHP
src/Application/Config.php
Config.parsePagesSettings
private function parsePagesSettings(\DOMNode $pages) { $scriptName = $pages->getAttribute('script'); if(!$scriptName) { if($this->site) { $scriptName = $this->site->root_document ?: 'index.php'; } else { $scriptName = 'index.php'; } } $redirect = $pages->getAttribute('default_redirect'); ...
php
private function parsePagesSettings(\DOMNode $pages) { $scriptName = $pages->getAttribute('script'); if(!$scriptName) { if($this->site) { $scriptName = $this->site->root_document ?: 'index.php'; } else { $scriptName = 'index.php'; } } $redirect = $pages->getAttribute('default_redirect'); ...
[ "private", "function", "parsePagesSettings", "(", "\\", "DOMNode", "$", "pages", ")", "{", "$", "scriptName", "=", "$", "pages", "->", "getAttribute", "(", "'script'", ")", ";", "if", "(", "!", "$", "scriptName", ")", "{", "if", "(", "$", "this", "->",...
parse page routes called seperately for differing script attributes @param \DOMNode $pages @throws ConfigException
[ "parse", "page", "routes", "called", "seperately", "for", "differing", "script", "attributes" ]
train
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Config.php#L646-L803
Vectrex/vxPHP
src/Application/Config.php
Config.parseMenusSettings
private function parseMenusSettings(\DOMNode $menus) { foreach ((new \DOMXPath($menus->ownerDocument))->query('menu', $menus) as $menu) { $id = $menu->getAttribute('id') ?: Menu::DEFAULT_ID; if(isset($this->menus[$id])) { $this->appendMenuEntries($menu->childNodes, $this->menus[$id]); } else { ...
php
private function parseMenusSettings(\DOMNode $menus) { foreach ((new \DOMXPath($menus->ownerDocument))->query('menu', $menus) as $menu) { $id = $menu->getAttribute('id') ?: Menu::DEFAULT_ID; if(isset($this->menus[$id])) { $this->appendMenuEntries($menu->childNodes, $this->menus[$id]); } else { ...
[ "private", "function", "parseMenusSettings", "(", "\\", "DOMNode", "$", "menus", ")", "{", "foreach", "(", "(", "new", "\\", "DOMXPath", "(", "$", "menus", "->", "ownerDocument", ")", ")", "->", "query", "(", "'menu'", ",", "$", "menus", ")", "as", "$"...
parse menu tree if menus share the same id entries of later menus are appended to the first; other menu attributes are left unchanged @param \DOMNode $menus @throws ConfigException
[ "parse", "menu", "tree", "if", "menus", "share", "the", "same", "id", "entries", "of", "later", "menus", "are", "appended", "to", "the", "first", ";", "other", "menu", "attributes", "are", "left", "unchanged" ]
train
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Config.php#L814-L829
Vectrex/vxPHP
src/Application/Config.php
Config.parseServicesSettings
private function parseServicesSettings(\DOMNode $services) { if(is_null($this->services)) { $this->services = []; } foreach($services->getElementsByTagName('service') as $service) { if(!($id = $service->getAttribute('id'))) { throw new ConfigException('Service without id found.'); } if(isset($...
php
private function parseServicesSettings(\DOMNode $services) { if(is_null($this->services)) { $this->services = []; } foreach($services->getElementsByTagName('service') as $service) { if(!($id = $service->getAttribute('id'))) { throw new ConfigException('Service without id found.'); } if(isset($...
[ "private", "function", "parseServicesSettings", "(", "\\", "DOMNode", "$", "services", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "services", ")", ")", "{", "$", "this", "->", "services", "=", "[", "]", ";", "}", "foreach", "(", "$", "se...
parse settings for services only service id, class and parameters are parsed lazy initialization is handled by Application instance @param \DOMNode $services @throws ConfigException
[ "parse", "settings", "for", "services", "only", "service", "id", "class", "and", "parameters", "are", "parsed", "lazy", "initialization", "is", "handled", "by", "Application", "instance" ]
train
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Config.php#L839-L885
Vectrex/vxPHP
src/Application/Config.php
Config.parsePluginsSettings
private function parsePluginsSettings(\DOMNode $plugins) { if(is_null($this->services)) { $this->services = []; } foreach($plugins->getElementsByTagName('plugin') as $plugin) { if(!($id = $plugin->getAttribute('id'))) { throw new ConfigException('Plugin without id found.'); } if(isset($this->p...
php
private function parsePluginsSettings(\DOMNode $plugins) { if(is_null($this->services)) { $this->services = []; } foreach($plugins->getElementsByTagName('plugin') as $plugin) { if(!($id = $plugin->getAttribute('id'))) { throw new ConfigException('Plugin without id found.'); } if(isset($this->p...
[ "private", "function", "parsePluginsSettings", "(", "\\", "DOMNode", "$", "plugins", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "services", ")", ")", "{", "$", "this", "->", "services", "=", "[", "]", ";", "}", "foreach", "(", "$", "plug...
parses settings for plugins plugin id, class, events and parameters are parsed initialization (not lazy) is handled by Application instance @param \DOMNode $plugins @throws ConfigException
[ "parses", "settings", "for", "plugins", "plugin", "id", "class", "events", "and", "parameters", "are", "parsed", "initialization", "(", "not", "lazy", ")", "is", "handled", "by", "Application", "instance" ]
train
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Config.php#L895-L941
Vectrex/vxPHP
src/Application/Config.php
Config.parseMenu
private function parseMenu(\DOMNode $menu) { $root = $menu->getAttribute('script'); if(!$root) { if($this->site) { $root= $this->site->root_document ?: 'index.php'; } else { $root= 'index.php'; } } $type = $menu->getAttribute('type') === 'dynamic' ? 'dynamic' : 'static'; $service = $men...
php
private function parseMenu(\DOMNode $menu) { $root = $menu->getAttribute('script'); if(!$root) { if($this->site) { $root= $this->site->root_document ?: 'index.php'; } else { $root= 'index.php'; } } $type = $menu->getAttribute('type') === 'dynamic' ? 'dynamic' : 'static'; $service = $men...
[ "private", "function", "parseMenu", "(", "\\", "DOMNode", "$", "menu", ")", "{", "$", "root", "=", "$", "menu", "->", "getAttribute", "(", "'script'", ")", ";", "if", "(", "!", "$", "root", ")", "{", "if", "(", "$", "this", "->", "site", ")", "{"...
Parse XML menu entries and creates menu instance @param \DOMNode $menu @return Menu @throws ConfigException
[ "Parse", "XML", "menu", "entries", "and", "creates", "menu", "instance" ]
train
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Config.php#L950-L994
Vectrex/vxPHP
src/Application/Config.php
Config.appendMenuEntries
private function appendMenuEntries(\DOMNodeList $entries, Menu $menu) { foreach($entries as $entry) { if($entry->nodeType !== XML_ELEMENT_NODE || 'menuentry' !== $entry->nodeName) { continue; } // read additional attributes which are passed to menu entry constructor $attributes = []; foreach($...
php
private function appendMenuEntries(\DOMNodeList $entries, Menu $menu) { foreach($entries as $entry) { if($entry->nodeType !== XML_ELEMENT_NODE || 'menuentry' !== $entry->nodeName) { continue; } // read additional attributes which are passed to menu entry constructor $attributes = []; foreach($...
[ "private", "function", "appendMenuEntries", "(", "\\", "DOMNodeList", "$", "entries", ",", "Menu", "$", "menu", ")", "{", "foreach", "(", "$", "entries", "as", "$", "entry", ")", "{", "if", "(", "$", "entry", "->", "nodeType", "!==", "XML_ELEMENT_NODE", ...
append menu entries of configuration to a previously created Menu instance @param \DOMNodeList $entries @param Menu $menu @throws ConfigException
[ "append", "menu", "entries", "of", "configuration", "to", "a", "previously", "created", "Menu", "instance" ]
train
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Config.php#L1004-L1099
Vectrex/vxPHP
src/Application/Config.php
Config.createConst
public function createConst() { $properties = get_object_vars($this); if(isset($properties['db'])) { foreach($properties['db'] as $k => $v) { if(is_scalar($v)) { $k = strtoupper($k); if(!defined("DB$k")) { define("DB$k", $v); } } } } if(isset($properties['site'])) { foreach($proper...
php
public function createConst() { $properties = get_object_vars($this); if(isset($properties['db'])) { foreach($properties['db'] as $k => $v) { if(is_scalar($v)) { $k = strtoupper($k); if(!defined("DB$k")) { define("DB$k", $v); } } } } if(isset($properties['site'])) { foreach($proper...
[ "public", "function", "createConst", "(", ")", "{", "$", "properties", "=", "get_object_vars", "(", "$", "this", ")", ";", "if", "(", "isset", "(", "$", "properties", "[", "'db'", "]", ")", ")", "{", "foreach", "(", "$", "properties", "[", "'db'", "]...
create constants for simple access to certain configuration settings
[ "create", "constants", "for", "simple", "access", "to", "certain", "configuration", "settings" ]
train
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Config.php#L1105-L1140
Vectrex/vxPHP
src/Application/Config.php
Config.getPaths
public function getPaths($access = 'rw') { $paths = []; foreach($this->paths as $p) { if($p['access'] === $access) { array_push($paths, $p); } } return $paths; }
php
public function getPaths($access = 'rw') { $paths = []; foreach($this->paths as $p) { if($p['access'] === $access) { array_push($paths, $p); } } return $paths; }
[ "public", "function", "getPaths", "(", "$", "access", "=", "'rw'", ")", "{", "$", "paths", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "paths", "as", "$", "p", ")", "{", "if", "(", "$", "p", "[", "'access'", "]", "===", "$", "access"...
returns all paths matching access criteria @param string $access @return paths
[ "returns", "all", "paths", "matching", "access", "criteria" ]
train
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Config.php#L1148-L1156
Vectrex/vxPHP
src/Application/Config.php
Config.getServerConfig
private function getServerConfig() { $this->server['apc_on'] = extension_loaded('apc') && function_exists('apc_add') && ini_get('apc.enabled') && ini_get('apc.rfc1867'); $fs = ini_get('upload_max_filesize'); $suffix = strtoupper(substr($fs, -1)); switch($suffix) { case 'K': $mult = 1024; break; case...
php
private function getServerConfig() { $this->server['apc_on'] = extension_loaded('apc') && function_exists('apc_add') && ini_get('apc.enabled') && ini_get('apc.rfc1867'); $fs = ini_get('upload_max_filesize'); $suffix = strtoupper(substr($fs, -1)); switch($suffix) { case 'K': $mult = 1024; break; case...
[ "private", "function", "getServerConfig", "(", ")", "{", "$", "this", "->", "server", "[", "'apc_on'", "]", "=", "extension_loaded", "(", "'apc'", ")", "&&", "function_exists", "(", "'apc_add'", ")", "&&", "ini_get", "(", "'apc.enabled'", ")", "&&", "ini_get...
add particular information regarding server configuration, like PHP extensions
[ "add", "particular", "information", "regarding", "server", "configuration", "like", "PHP", "extensions" ]
train
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Config.php#L1161-L1180
Raphhh/puppy-application
src/Application.php
Application.run
public function run() { $request = $this->getService('requestStack')->getMasterRequest(); $this->getPreProcesses()->execute($request); $response = $this->getFrontController()->call($request); $this->getPostProcesses()->execute($response); $response->send(); }
php
public function run() { $request = $this->getService('requestStack')->getMasterRequest(); $this->getPreProcesses()->execute($request); $response = $this->getFrontController()->call($request); $this->getPostProcesses()->execute($response); $response->send(); }
[ "public", "function", "run", "(", ")", "{", "$", "request", "=", "$", "this", "->", "getService", "(", "'requestStack'", ")", "->", "getMasterRequest", "(", ")", ";", "$", "this", "->", "getPreProcesses", "(", ")", "->", "execute", "(", "$", "request", ...
Sends the http response
[ "Sends", "the", "http", "response" ]
train
https://github.com/Raphhh/puppy-application/blob/9291543cd28e19a2986abd7fb146898ca5f5f5da/src/Application.php#L62-L69
Raphhh/puppy-application
src/Application.php
Application.initModules
public function initModules(IModulesLoader $modulesLoader) { foreach ($modulesLoader->getModules() as $module) { $this->addModule($module); } }
php
public function initModules(IModulesLoader $modulesLoader) { foreach ($modulesLoader->getModules() as $module) { $this->addModule($module); } }
[ "public", "function", "initModules", "(", "IModulesLoader", "$", "modulesLoader", ")", "{", "foreach", "(", "$", "modulesLoader", "->", "getModules", "(", ")", "as", "$", "module", ")", "{", "$", "this", "->", "addModule", "(", "$", "module", ")", ";", "...
Init the modules of the current project. @param IModulesLoader $modulesLoader
[ "Init", "the", "modules", "of", "the", "current", "project", "." ]
train
https://github.com/Raphhh/puppy-application/blob/9291543cd28e19a2986abd7fb146898ca5f5f5da/src/Application.php#L76-L81
Raphhh/puppy-application
src/Application.php
Application.get
public function get($uriPattern, callable $controller) { return new IRoutePatternSetterAdapter( $this->getFrontController()->addController($uriPattern, $controller, 'get')->getPattern() ); }
php
public function get($uriPattern, callable $controller) { return new IRoutePatternSetterAdapter( $this->getFrontController()->addController($uriPattern, $controller, 'get')->getPattern() ); }
[ "public", "function", "get", "(", "$", "uriPattern", ",", "callable", "$", "controller", ")", "{", "return", "new", "IRoutePatternSetterAdapter", "(", "$", "this", "->", "getFrontController", "(", ")", "->", "addController", "(", "$", "uriPattern", ",", "$", ...
Adds a controller called by http GET method. @param string $uriPattern @param callable $controller @return IRoutePatternSetter
[ "Adds", "a", "controller", "called", "by", "http", "GET", "method", "." ]
train
https://github.com/Raphhh/puppy-application/blob/9291543cd28e19a2986abd7fb146898ca5f5f5da/src/Application.php#L101-L106
Raphhh/puppy-application
src/Application.php
Application.post
public function post($uriPattern, callable $controller) { return new IRoutePatternSetterAdapter( $this->getFrontController()->addController($uriPattern, $controller, 'post')->getPattern() ); }
php
public function post($uriPattern, callable $controller) { return new IRoutePatternSetterAdapter( $this->getFrontController()->addController($uriPattern, $controller, 'post')->getPattern() ); }
[ "public", "function", "post", "(", "$", "uriPattern", ",", "callable", "$", "controller", ")", "{", "return", "new", "IRoutePatternSetterAdapter", "(", "$", "this", "->", "getFrontController", "(", ")", "->", "addController", "(", "$", "uriPattern", ",", "$", ...
Adds a controller called by http POST method. @param string $uriPattern @param callable $controller @return IRoutePatternSetter
[ "Adds", "a", "controller", "called", "by", "http", "POST", "method", "." ]
train
https://github.com/Raphhh/puppy-application/blob/9291543cd28e19a2986abd7fb146898ca5f5f5da/src/Application.php#L115-L120
Raphhh/puppy-application
src/Application.php
Application.json
public function json($uriPattern, callable $controller) { return new IRoutePatternSetterAdapter( $this->getFrontController()->addController($uriPattern, $controller, '', 'application/json')->getPattern() ); }
php
public function json($uriPattern, callable $controller) { return new IRoutePatternSetterAdapter( $this->getFrontController()->addController($uriPattern, $controller, '', 'application/json')->getPattern() ); }
[ "public", "function", "json", "(", "$", "uriPattern", ",", "callable", "$", "controller", ")", "{", "return", "new", "IRoutePatternSetterAdapter", "(", "$", "this", "->", "getFrontController", "(", ")", "->", "addController", "(", "$", "uriPattern", ",", "$", ...
Adds a controller with a json format. @param string $uriPattern @param callable $controller @return IRoutePatternSetter
[ "Adds", "a", "controller", "with", "a", "json", "format", "." ]
train
https://github.com/Raphhh/puppy-application/blob/9291543cd28e19a2986abd7fb146898ca5f5f5da/src/Application.php#L129-L134
Raphhh/puppy-application
src/Application.php
Application.any
public function any($uriPattern, callable $controller) { return new IRoutePatternSetterAdapter( $this->getFrontController()->addController($uriPattern, $controller)->getPattern() ); }
php
public function any($uriPattern, callable $controller) { return new IRoutePatternSetterAdapter( $this->getFrontController()->addController($uriPattern, $controller)->getPattern() ); }
[ "public", "function", "any", "(", "$", "uriPattern", ",", "callable", "$", "controller", ")", "{", "return", "new", "IRoutePatternSetterAdapter", "(", "$", "this", "->", "getFrontController", "(", ")", "->", "addController", "(", "$", "uriPattern", ",", "$", ...
Adds a controller called by any http method or format. @param string $uriPattern @param callable $controller @return IRoutePatternSetter
[ "Adds", "a", "controller", "called", "by", "any", "http", "method", "or", "format", "." ]
train
https://github.com/Raphhh/puppy-application/blob/9291543cd28e19a2986abd7fb146898ca5f5f5da/src/Application.php#L143-L148
Raphhh/puppy-application
src/Application.php
Application.filter
public function filter(callable $filter, callable $controller) { $pattern = $this->getFrontController()->addController(':all', $controller)->getPattern(); $pattern->addFilter($filter); return new IRoutePatternSetterAdapter($pattern); }
php
public function filter(callable $filter, callable $controller) { $pattern = $this->getFrontController()->addController(':all', $controller)->getPattern(); $pattern->addFilter($filter); return new IRoutePatternSetterAdapter($pattern); }
[ "public", "function", "filter", "(", "callable", "$", "filter", ",", "callable", "$", "controller", ")", "{", "$", "pattern", "=", "$", "this", "->", "getFrontController", "(", ")", "->", "addController", "(", "':all'", ",", "$", "controller", ")", "->", ...
Adds a controller with a special filter. This filter receive the current Request as first param. @param callable $filter @param callable $controller @return IRoutePatternSetter
[ "Adds", "a", "controller", "with", "a", "special", "filter", ".", "This", "filter", "receive", "the", "current", "Request", "as", "first", "param", "." ]
train
https://github.com/Raphhh/puppy-application/blob/9291543cd28e19a2986abd7fb146898ca5f5f5da/src/Application.php#L158-L163
Raphhh/puppy-application
src/Application.php
Application.mirror
public function mirror($uriPattern, $mirror) { return $this->any( $uriPattern, function (AppController $appController, array $args) use ($mirror) { return $appController->call($mirror, $args); } ); }
php
public function mirror($uriPattern, $mirror) { return $this->any( $uriPattern, function (AppController $appController, array $args) use ($mirror) { return $appController->call($mirror, $args); } ); }
[ "public", "function", "mirror", "(", "$", "uriPattern", ",", "$", "mirror", ")", "{", "return", "$", "this", "->", "any", "(", "$", "uriPattern", ",", "function", "(", "AppController", "$", "appController", ",", "array", "$", "args", ")", "use", "(", "...
Adds a mirror of a route. @param string $uriPattern @param string $mirror @return IRoutePatternSetterAdapter
[ "Adds", "a", "mirror", "of", "a", "route", "." ]
train
https://github.com/Raphhh/puppy-application/blob/9291543cd28e19a2986abd7fb146898ca5f5f5da/src/Application.php#L183-L191
Raphhh/puppy-application
src/Application.php
Application.before
public function before(callable $process) { if ($process instanceof \Closure) { $process = \Closure::bind($process, $this); } $this->preProcesses[] = $process; }
php
public function before(callable $process) { if ($process instanceof \Closure) { $process = \Closure::bind($process, $this); } $this->preProcesses[] = $process; }
[ "public", "function", "before", "(", "callable", "$", "process", ")", "{", "if", "(", "$", "process", "instanceof", "\\", "Closure", ")", "{", "$", "process", "=", "\\", "Closure", "::", "bind", "(", "$", "process", ",", "$", "this", ")", ";", "}", ...
adds a process before the call stack. $process will receive the master request as first arg. @param callable $process
[ "adds", "a", "process", "before", "the", "call", "stack", ".", "$process", "will", "receive", "the", "master", "request", "as", "first", "arg", "." ]
train
https://github.com/Raphhh/puppy-application/blob/9291543cd28e19a2986abd7fb146898ca5f5f5da/src/Application.php#L199-L205
AnonymPHP/Anonym-Database
Mode/ModeManager.php
ModeManager.getQuery
public function getQuery() { $strings = $this->string; $query = $this->buildQuery($this->getPattern($this->getChieldPattern()), $strings); return $query; }
php
public function getQuery() { $strings = $this->string; $query = $this->buildQuery($this->getPattern($this->getChieldPattern()), $strings); return $query; }
[ "public", "function", "getQuery", "(", ")", "{", "$", "strings", "=", "$", "this", "->", "string", ";", "$", "query", "=", "$", "this", "->", "buildQuery", "(", "$", "this", "->", "getPattern", "(", "$", "this", "->", "getChieldPattern", "(", ")", ")...
Yeni bir query Sorgusu olu�turur @return \Anonym\Components\Database\Builders\BuildManager
[ "Yeni", "bir", "query", "Sorgusu", "olu�turur" ]
train
https://github.com/AnonymPHP/Anonym-Database/blob/4d034219e0e3eb2833fa53204e9f52a74a9a7e4b/Mode/ModeManager.php#L126-L133
AnonymPHP/Anonym-Database
Mode/ModeManager.php
ModeManager.build
public function build() { $query = $this->getQuery(); $manager = new BuildManager($this->getBase()->getConnection()); $manager->setPage($this->page); $manager->setQuery($query); $manager->setParams($this->string['parameters']); return $manager; }
php
public function build() { $query = $this->getQuery(); $manager = new BuildManager($this->getBase()->getConnection()); $manager->setPage($this->page); $manager->setQuery($query); $manager->setParams($this->string['parameters']); return $manager; }
[ "public", "function", "build", "(", ")", "{", "$", "query", "=", "$", "this", "->", "getQuery", "(", ")", ";", "$", "manager", "=", "new", "BuildManager", "(", "$", "this", "->", "getBase", "(", ")", "->", "getConnection", "(", ")", ")", ";", "$", ...
Sorguyu buildManager ��ine atar @return \Anonym\Components\Database\Builders\BuildManager
[ "Sorguyu", "buildManager", "��ine", "atar" ]
train
https://github.com/AnonymPHP/Anonym-Database/blob/4d034219e0e3eb2833fa53204e9f52a74a9a7e4b/Mode/ModeManager.php#L140-L150
AnonymPHP/Anonym-Database
Mode/ModeManager.php
ModeManager.doWhere
private function doWhere($where, $type) { switch ($type) { case 'and': $where = $this->useBuilder('where') ->where($where, $this->getCield()); break; case 'or': $where = $this->useBuilder('where') ...
php
private function doWhere($where, $type) { switch ($type) { case 'and': $where = $this->useBuilder('where') ->where($where, $this->getCield()); break; case 'or': $where = $this->useBuilder('where') ...
[ "private", "function", "doWhere", "(", "$", "where", ",", "$", "type", ")", "{", "switch", "(", "$", "type", ")", "{", "case", "'and'", ":", "$", "where", "=", "$", "this", "->", "useBuilder", "(", "'where'", ")", "->", "where", "(", "$", "where", ...
Where tetiklenir @param mixed $args @param string $type
[ "Where", "tetiklenir" ]
train
https://github.com/AnonymPHP/Anonym-Database/blob/4d034219e0e3eb2833fa53204e9f52a74a9a7e4b/Mode/ModeManager.php#L245-L267
AnonymPHP/Anonym-Database
Mode/ModeManager.php
ModeManager.where
public function where($where, $controll = null) { if (!is_array($where) && !is_null($controll)) { $where = [ [$where, '=', $controll] ]; } elseif (is_array($where) && isset($where[0]) && isset($where[1])) { if (is_string($where[1])) { ...
php
public function where($where, $controll = null) { if (!is_array($where) && !is_null($controll)) { $where = [ [$where, '=', $controll] ]; } elseif (is_array($where) && isset($where[0]) && isset($where[1])) { if (is_string($where[1])) { ...
[ "public", "function", "where", "(", "$", "where", ",", "$", "controll", "=", "null", ")", "{", "if", "(", "!", "is_array", "(", "$", "where", ")", "&&", "!", "is_null", "(", "$", "controll", ")", ")", "{", "$", "where", "=", "[", "[", "$", "whe...
Where sorgusu @param mixed $where @param null controll @return $this
[ "Where", "sorgusu" ]
train
https://github.com/AnonymPHP/Anonym-Database/blob/4d034219e0e3eb2833fa53204e9f52a74a9a7e4b/Mode/ModeManager.php#L276-L297
AnonymPHP/Anonym-Database
Mode/ModeManager.php
ModeManager.pagination
public function pagination($perPage = 15) { $currentPageFinder = Paginator::getCurrentPageFinder(); $pathFinder = Paginator::getRequestPathFinder(); $pagination = new Paginator($perPage, call_user_func($currentPageFinder), [ 'pageName' => 'page', 'path' => call_use...
php
public function pagination($perPage = 15) { $currentPageFinder = Paginator::getCurrentPageFinder(); $pathFinder = Paginator::getRequestPathFinder(); $pagination = new Paginator($perPage, call_user_func($currentPageFinder), [ 'pageName' => 'page', 'path' => call_use...
[ "public", "function", "pagination", "(", "$", "perPage", "=", "15", ")", "{", "$", "currentPageFinder", "=", "Paginator", "::", "getCurrentPageFinder", "(", ")", ";", "$", "pathFinder", "=", "Paginator", "::", "getRequestPathFinder", "(", ")", ";", "$", "pag...
create a instance for standart pagination @param int $perPage @return Paginator
[ "create", "a", "instance", "for", "standart", "pagination" ]
train
https://github.com/AnonymPHP/Anonym-Database/blob/4d034219e0e3eb2833fa53204e9f52a74a9a7e4b/Mode/ModeManager.php#L305-L323
AnonymPHP/Anonym-Database
Mode/ModeManager.php
ModeManager.simplePagination
public function simplePagination($perPage = 15){ $pegination = $this->pagination($perPage); $pegination->setMode(Paginator::MODE_SIMPLE); return $pegination; }
php
public function simplePagination($perPage = 15){ $pegination = $this->pagination($perPage); $pegination->setMode(Paginator::MODE_SIMPLE); return $pegination; }
[ "public", "function", "simplePagination", "(", "$", "perPage", "=", "15", ")", "{", "$", "pegination", "=", "$", "this", "->", "pagination", "(", "$", "perPage", ")", ";", "$", "pegination", "->", "setMode", "(", "Paginator", "::", "MODE_SIMPLE", ")", ";...
create a paginaton instance and return it @param int $perPage @return Paginator
[ "create", "a", "paginaton", "instance", "and", "return", "it" ]
train
https://github.com/AnonymPHP/Anonym-Database/blob/4d034219e0e3eb2833fa53204e9f52a74a9a7e4b/Mode/ModeManager.php#L332-L337
zineinc/floppy-client
src/Floppy/Client/FileTypeGuesser.php
FileTypeGuesser.guessFileType
public function guessFileType(FileId $fileId) { $extension = strtolower(\pathinfo($fileId->id(), PATHINFO_EXTENSION)); foreach($this->fileTypeExtensions as $fileType => $extensions) { if(in_array($extension, $extensions)) { return $fileType; } } ...
php
public function guessFileType(FileId $fileId) { $extension = strtolower(\pathinfo($fileId->id(), PATHINFO_EXTENSION)); foreach($this->fileTypeExtensions as $fileType => $extensions) { if(in_array($extension, $extensions)) { return $fileType; } } ...
[ "public", "function", "guessFileType", "(", "FileId", "$", "fileId", ")", "{", "$", "extension", "=", "strtolower", "(", "\\", "pathinfo", "(", "$", "fileId", "->", "id", "(", ")", ",", "PATHINFO_EXTENSION", ")", ")", ";", "foreach", "(", "$", "this", ...
Guess file type code @param FileId $fileId @return string
[ "Guess", "file", "type", "code" ]
train
https://github.com/zineinc/floppy-client/blob/24a4e72756ef88de561d08d71090bcf4c00be845/src/Floppy/Client/FileTypeGuesser.php#L23-L34
werx/core
src/Input.php
Input.post
public function post($key = null, $default = null, $deep = true) { if (!empty($key)) { return $this->request->request->get($key, $default, $deep); } else { return $this->request->request->all(); } }
php
public function post($key = null, $default = null, $deep = true) { if (!empty($key)) { return $this->request->request->get($key, $default, $deep); } else { return $this->request->request->all(); } }
[ "public", "function", "post", "(", "$", "key", "=", "null", ",", "$", "default", "=", "null", ",", "$", "deep", "=", "true", ")", "{", "if", "(", "!", "empty", "(", "$", "key", ")", ")", "{", "return", "$", "this", "->", "request", "->", "reque...
Fetch items from the $_POST array. @param null $key @param null $default @param bool $deep @return array|mixed
[ "Fetch", "items", "from", "the", "$_POST", "array", "." ]
train
https://github.com/werx/core/blob/9ab7a9f7a8c02e1d41ca40301afada8129ea0a79/src/Input.php#L31-L38