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
dawguk/php-garmin-connect
src/dawguk/GarminConnect/Connector.php
Connector.refreshSession
public function refreshSession() { $this->objCurl = curl_init(); $this->arrCurlOptions[CURLOPT_COOKIEJAR] = $this->strCookieFile; $this->arrCurlOptions[CURLOPT_COOKIEFILE] = $this->strCookieFile; curl_setopt_array($this->objCurl, $this->arrCurlOptions); }
php
public function refreshSession() { $this->objCurl = curl_init(); $this->arrCurlOptions[CURLOPT_COOKIEJAR] = $this->strCookieFile; $this->arrCurlOptions[CURLOPT_COOKIEFILE] = $this->strCookieFile; curl_setopt_array($this->objCurl, $this->arrCurlOptions); }
[ "public", "function", "refreshSession", "(", ")", "{", "$", "this", "->", "objCurl", "=", "curl_init", "(", ")", ";", "$", "this", "->", "arrCurlOptions", "[", "CURLOPT_COOKIEJAR", "]", "=", "$", "this", "->", "strCookieFile", ";", "$", "this", "->", "ar...
Create a new curl instance
[ "Create", "a", "new", "curl", "instance" ]
train
https://github.com/dawguk/php-garmin-connect/blob/6b18a307d0853bbd788bd5b2f8060ec5c4a5c24a/src/dawguk/GarminConnect/Connector.php#L71-L77
dawguk/php-garmin-connect
src/dawguk/GarminConnect.php
GarminConnect.checkCookieAuth
private function checkCookieAuth() { if (strlen(trim($this->getUsername())) == 0) { $this->objConnector->cleanupSession(); $this->objConnector->refreshSession(); return false; } return true; }
php
private function checkCookieAuth() { if (strlen(trim($this->getUsername())) == 0) { $this->objConnector->cleanupSession(); $this->objConnector->refreshSession(); return false; } return true; }
[ "private", "function", "checkCookieAuth", "(", ")", "{", "if", "(", "strlen", "(", "trim", "(", "$", "this", "->", "getUsername", "(", ")", ")", ")", "==", "0", ")", "{", "$", "this", "->", "objConnector", "->", "cleanupSession", "(", ")", ";", "$", ...
Try to read the username from the API - if successful, it means we have a valid cookie, and we don't need to auth @return bool @throws UnexpectedResponseCodeException
[ "Try", "to", "read", "the", "username", "from", "the", "API", "-", "if", "successful", "it", "means", "we", "have", "a", "valid", "cookie", "and", "we", "don", "t", "need", "to", "auth" ]
train
https://github.com/dawguk/php-garmin-connect/blob/6b18a307d0853bbd788bd5b2f8060ec5c4a5c24a/src/dawguk/GarminConnect.php#L87-L95
dawguk/php-garmin-connect
src/dawguk/GarminConnect.php
GarminConnect.authorize
private function authorize($strUsername, $strPassword) { $arrParams = array( 'service' => 'https://connect.garmin.com/modern/', 'webhost' => 'https://connect.garmin.com', 'source' => 'https://connect.garmin.com/en-US/signin', 'clientId' => 'GarminConnect', ...
php
private function authorize($strUsername, $strPassword) { $arrParams = array( 'service' => 'https://connect.garmin.com/modern/', 'webhost' => 'https://connect.garmin.com', 'source' => 'https://connect.garmin.com/en-US/signin', 'clientId' => 'GarminConnect', ...
[ "private", "function", "authorize", "(", "$", "strUsername", ",", "$", "strPassword", ")", "{", "$", "arrParams", "=", "array", "(", "'service'", "=>", "'https://connect.garmin.com/modern/'", ",", "'webhost'", "=>", "'https://connect.garmin.com'", ",", "'source'", "...
Because there doesn't appear to be a nice "API" way to authenticate with Garmin Connect, we have to effectively spoof a browser session using some pretty high-level scraping techniques. The connector object does all of the HTTP work, and is effectively a wrapper for CURL-based session handler (via CURLs in-built cookie...
[ "Because", "there", "doesn", "t", "appear", "to", "be", "a", "nice", "API", "way", "to", "authenticate", "with", "Garmin", "Connect", "we", "have", "to", "effectively", "spoof", "a", "browser", "session", "using", "some", "pretty", "high", "-", "level", "s...
train
https://github.com/dawguk/php-garmin-connect/blob/6b18a307d0853bbd788bd5b2f8060ec5c4a5c24a/src/dawguk/GarminConnect.php#L107-L181
dawguk/php-garmin-connect
src/dawguk/GarminConnect.php
GarminConnect.getActivityList
public function getActivityList($intStart = 0, $intLimit = 10, $strActivityType = null) { $arrParams = array( 'start' => $intStart, 'limit' => $intLimit ); if (null !== $strActivityType) { $arrParams['activityType'] = $strActivityType; } ...
php
public function getActivityList($intStart = 0, $intLimit = 10, $strActivityType = null) { $arrParams = array( 'start' => $intStart, 'limit' => $intLimit ); if (null !== $strActivityType) { $arrParams['activityType'] = $strActivityType; } ...
[ "public", "function", "getActivityList", "(", "$", "intStart", "=", "0", ",", "$", "intLimit", "=", "10", ",", "$", "strActivityType", "=", "null", ")", "{", "$", "arrParams", "=", "array", "(", "'start'", "=>", "$", "intStart", ",", "'limit'", "=>", "...
Gets a list of activities @param integer $intStart @param integer $intLimit @param null $strActivityType @return mixed @throws UnexpectedResponseCodeException
[ "Gets", "a", "list", "of", "activities" ]
train
https://github.com/dawguk/php-garmin-connect/blob/6b18a307d0853bbd788bd5b2f8060ec5c4a5c24a/src/dawguk/GarminConnect.php#L210-L232
dawguk/php-garmin-connect
src/dawguk/GarminConnect.php
GarminConnect.getActivityDetails
public function getActivityDetails($intActivityID) { $strResponse = $this->objConnector->get("https://connect.garmin.com/proxy/activity-service/details/" . $intActivityID); if ($this->objConnector->getLastResponseCode() != 200) { throw new UnexpectedResponseCodeException($this->objConnec...
php
public function getActivityDetails($intActivityID) { $strResponse = $this->objConnector->get("https://connect.garmin.com/proxy/activity-service/details/" . $intActivityID); if ($this->objConnector->getLastResponseCode() != 200) { throw new UnexpectedResponseCodeException($this->objConnec...
[ "public", "function", "getActivityDetails", "(", "$", "intActivityID", ")", "{", "$", "strResponse", "=", "$", "this", "->", "objConnector", "->", "get", "(", "\"https://connect.garmin.com/proxy/activity-service/details/\"", ".", "$", "intActivityID", ")", ";", "if", ...
Gets the detailed information for the activity @param integer $intActivityID @return mixed @throws GarminConnect\exceptions\UnexpectedResponseCodeException
[ "Gets", "the", "detailed", "information", "for", "the", "activity" ]
train
https://github.com/dawguk/php-garmin-connect/blob/6b18a307d0853bbd788bd5b2f8060ec5c4a5c24a/src/dawguk/GarminConnect.php#L258-L266
dawguk/php-garmin-connect
src/dawguk/GarminConnect.php
GarminConnect.getDataFile
public function getDataFile($strType, $intActivityID) { switch ($strType) { case self::DATA_TYPE_GPX: case self::DATA_TYPE_TCX: case self::DATA_TYPE_GOOGLE_EARTH: break; default: throw new Exception("Unsupported data type"); ...
php
public function getDataFile($strType, $intActivityID) { switch ($strType) { case self::DATA_TYPE_GPX: case self::DATA_TYPE_TCX: case self::DATA_TYPE_GOOGLE_EARTH: break; default: throw new Exception("Unsupported data type"); ...
[ "public", "function", "getDataFile", "(", "$", "strType", ",", "$", "intActivityID", ")", "{", "switch", "(", "$", "strType", ")", "{", "case", "self", "::", "DATA_TYPE_GPX", ":", "case", "self", "::", "DATA_TYPE_TCX", ":", "case", "self", "::", "DATA_TYPE...
Retrieves the data file for the activity @param string $strType @param $intActivityID @throws GarminConnect\exceptions\UnexpectedResponseCodeException @throws Exception @return mixed
[ "Retrieves", "the", "data", "file", "for", "the", "activity" ]
train
https://github.com/dawguk/php-garmin-connect/blob/6b18a307d0853bbd788bd5b2f8060ec5c4a5c24a/src/dawguk/GarminConnect.php#L289-L308
dawguk/php-garmin-connect
src/dawguk/GarminConnect.php
GarminConnect.getWeightData
public function getWeightData($strFrom = '2019-01-01', $strUntil = '2099-12-31') { $intDateFrom = (strtotime($strFrom) + 86400) * 1000; $intDateUntil = strtotime($strUntil) * 1000; $arrParams = array( 'from' => $intDateFrom, 'until' => $intDateUntil ); ...
php
public function getWeightData($strFrom = '2019-01-01', $strUntil = '2099-12-31') { $intDateFrom = (strtotime($strFrom) + 86400) * 1000; $intDateUntil = strtotime($strUntil) * 1000; $arrParams = array( 'from' => $intDateFrom, 'until' => $intDateUntil ); ...
[ "public", "function", "getWeightData", "(", "$", "strFrom", "=", "'2019-01-01'", ",", "$", "strUntil", "=", "'2099-12-31'", ")", "{", "$", "intDateFrom", "=", "(", "strtotime", "(", "$", "strFrom", ")", "+", "86400", ")", "*", "1000", ";", "$", "intDateU...
Retrieves weight data @param string $strFrom @param string $strUntil @throws GarminConnect\exceptions\UnexpectedResponseCodeException @throws Exception @return mixed
[ "Retrieves", "weight", "data" ]
train
https://github.com/dawguk/php-garmin-connect/blob/6b18a307d0853bbd788bd5b2f8060ec5c4a5c24a/src/dawguk/GarminConnect.php#L333-L354
jacobcyl/Aliyun-oss-storage
src/AliOssAdapter.php
AliOssAdapter.write
public function write($path, $contents, Config $config) { $object = $this->applyPathPrefix($path); $options = $this->getOptions($this->options, $config); if (! isset($options[OssClient::OSS_LENGTH])) { $options[OssClient::OSS_LENGTH] = Util::contentSize($contents); } ...
php
public function write($path, $contents, Config $config) { $object = $this->applyPathPrefix($path); $options = $this->getOptions($this->options, $config); if (! isset($options[OssClient::OSS_LENGTH])) { $options[OssClient::OSS_LENGTH] = Util::contentSize($contents); } ...
[ "public", "function", "write", "(", "$", "path", ",", "$", "contents", ",", "Config", "$", "config", ")", "{", "$", "object", "=", "$", "this", "->", "applyPathPrefix", "(", "$", "path", ")", ";", "$", "options", "=", "$", "this", "->", "getOptions",...
Write a new file. @param string $path @param string $contents @param Config $config Config object @return array|false false on failure file meta data on success
[ "Write", "a", "new", "file", "." ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssAdapter.php#L147-L165
jacobcyl/Aliyun-oss-storage
src/AliOssAdapter.php
AliOssAdapter.writeStream
public function writeStream($path, $resource, Config $config) { $options = $this->getOptions($this->options, $config); $contents = stream_get_contents($resource); return $this->write($path, $contents, $config); }
php
public function writeStream($path, $resource, Config $config) { $options = $this->getOptions($this->options, $config); $contents = stream_get_contents($resource); return $this->write($path, $contents, $config); }
[ "public", "function", "writeStream", "(", "$", "path", ",", "$", "resource", ",", "Config", "$", "config", ")", "{", "$", "options", "=", "$", "this", "->", "getOptions", "(", "$", "this", "->", "options", ",", "$", "config", ")", ";", "$", "contents...
Write a new file using a stream. @param string $path @param resource $resource @param Config $config Config object @return array|false false on failure file meta data on success
[ "Write", "a", "new", "file", "using", "a", "stream", "." ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssAdapter.php#L176-L182
jacobcyl/Aliyun-oss-storage
src/AliOssAdapter.php
AliOssAdapter.update
public function update($path, $contents, Config $config) { if (! $config->has('visibility') && ! $config->has('ACL')) { $config->set(static::$metaMap['ACL'], $this->getObjectACL($path)); } // $this->delete($path); return $this->write($path, $contents, $config); }
php
public function update($path, $contents, Config $config) { if (! $config->has('visibility') && ! $config->has('ACL')) { $config->set(static::$metaMap['ACL'], $this->getObjectACL($path)); } // $this->delete($path); return $this->write($path, $contents, $config); }
[ "public", "function", "update", "(", "$", "path", ",", "$", "contents", ",", "Config", "$", "config", ")", "{", "if", "(", "!", "$", "config", "->", "has", "(", "'visibility'", ")", "&&", "!", "$", "config", "->", "has", "(", "'ACL'", ")", ")", "...
Update a file. @param string $path @param string $contents @param Config $config Config object @return array|false false on failure file meta data on success
[ "Update", "a", "file", "." ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssAdapter.php#L211-L218
jacobcyl/Aliyun-oss-storage
src/AliOssAdapter.php
AliOssAdapter.updateStream
public function updateStream($path, $resource, Config $config) { $contents = stream_get_contents($resource); return $this->update($path, $contents, $config); }
php
public function updateStream($path, $resource, Config $config) { $contents = stream_get_contents($resource); return $this->update($path, $contents, $config); }
[ "public", "function", "updateStream", "(", "$", "path", ",", "$", "resource", ",", "Config", "$", "config", ")", "{", "$", "contents", "=", "stream_get_contents", "(", "$", "resource", ")", ";", "return", "$", "this", "->", "update", "(", "$", "path", ...
Update a file using a stream. @param string $path @param resource $resource @param Config $config Config object @return array|false false on failure file meta data on success
[ "Update", "a", "file", "using", "a", "stream", "." ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssAdapter.php#L229-L233
jacobcyl/Aliyun-oss-storage
src/AliOssAdapter.php
AliOssAdapter.rename
public function rename($path, $newpath) { if (! $this->copy($path, $newpath)){ return false; } return $this->delete($path); }
php
public function rename($path, $newpath) { if (! $this->copy($path, $newpath)){ return false; } return $this->delete($path); }
[ "public", "function", "rename", "(", "$", "path", ",", "$", "newpath", ")", "{", "if", "(", "!", "$", "this", "->", "copy", "(", "$", "path", ",", "$", "newpath", ")", ")", "{", "return", "false", ";", "}", "return", "$", "this", "->", "delete", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssAdapter.php#L238-L245
jacobcyl/Aliyun-oss-storage
src/AliOssAdapter.php
AliOssAdapter.copy
public function copy($path, $newpath) { $object = $this->applyPathPrefix($path); $newObject = $this->applyPathPrefix($newpath); try{ $this->client->copyObject($this->bucket, $object, $this->bucket, $newObject); } catch (OssException $e) { $this->logErr(__FUNCT...
php
public function copy($path, $newpath) { $object = $this->applyPathPrefix($path); $newObject = $this->applyPathPrefix($newpath); try{ $this->client->copyObject($this->bucket, $object, $this->bucket, $newObject); } catch (OssException $e) { $this->logErr(__FUNCT...
[ "public", "function", "copy", "(", "$", "path", ",", "$", "newpath", ")", "{", "$", "object", "=", "$", "this", "->", "applyPathPrefix", "(", "$", "path", ")", ";", "$", "newObject", "=", "$", "this", "->", "applyPathPrefix", "(", "$", "newpath", ")"...
{@inheritdoc}
[ "{" ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssAdapter.php#L250-L262
jacobcyl/Aliyun-oss-storage
src/AliOssAdapter.php
AliOssAdapter.delete
public function delete($path) { $bucket = $this->bucket; $object = $this->applyPathPrefix($path); try{ $this->client->deleteObject($bucket, $object); }catch (OssException $e) { $this->logErr(__FUNCTION__, $e); return false; } retu...
php
public function delete($path) { $bucket = $this->bucket; $object = $this->applyPathPrefix($path); try{ $this->client->deleteObject($bucket, $object); }catch (OssException $e) { $this->logErr(__FUNCTION__, $e); return false; } retu...
[ "public", "function", "delete", "(", "$", "path", ")", "{", "$", "bucket", "=", "$", "this", "->", "bucket", ";", "$", "object", "=", "$", "this", "->", "applyPathPrefix", "(", "$", "path", ")", ";", "try", "{", "$", "this", "->", "client", "->", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssAdapter.php#L267-L280
jacobcyl/Aliyun-oss-storage
src/AliOssAdapter.php
AliOssAdapter.deleteDir
public function deleteDir($dirname) { $dirname = rtrim($this->applyPathPrefix($dirname), '/').'/'; $dirObjects = $this->listDirObjects($dirname, true); if(count($dirObjects['objects']) > 0 ){ foreach($dirObjects['objects'] as $object) { $objects[] = ...
php
public function deleteDir($dirname) { $dirname = rtrim($this->applyPathPrefix($dirname), '/').'/'; $dirObjects = $this->listDirObjects($dirname, true); if(count($dirObjects['objects']) > 0 ){ foreach($dirObjects['objects'] as $object) { $objects[] = ...
[ "public", "function", "deleteDir", "(", "$", "dirname", ")", "{", "$", "dirname", "=", "rtrim", "(", "$", "this", "->", "applyPathPrefix", "(", "$", "dirname", ")", ",", "'/'", ")", ".", "'/'", ";", "$", "dirObjects", "=", "$", "this", "->", "listDir...
{@inheritdoc}
[ "{" ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssAdapter.php#L285-L314
jacobcyl/Aliyun-oss-storage
src/AliOssAdapter.php
AliOssAdapter.listDirObjects
public function listDirObjects($dirname = '', $recursive = false) { $delimiter = '/'; $nextMarker = ''; $maxkeys = 1000; //存储结果 $result = []; while(true){ $options = [ 'delimiter' => $delimiter, 'prefix' => $dirname, ...
php
public function listDirObjects($dirname = '', $recursive = false) { $delimiter = '/'; $nextMarker = ''; $maxkeys = 1000; //存储结果 $result = []; while(true){ $options = [ 'delimiter' => $delimiter, 'prefix' => $dirname, ...
[ "public", "function", "listDirObjects", "(", "$", "dirname", "=", "''", ",", "$", "recursive", "=", "false", ")", "{", "$", "delimiter", "=", "'/'", ";", "$", "nextMarker", "=", "''", ";", "$", "maxkeys", "=", "1000", ";", "//存储结果", "$", "result", "=...
列举文件夹内文件列表;可递归获取子文件夹; @param string $dirname 目录 @param bool $recursive 是否递归 @return mixed @throws OssException
[ "列举文件夹内文件列表;可递归获取子文件夹;" ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssAdapter.php#L323-L392
jacobcyl/Aliyun-oss-storage
src/AliOssAdapter.php
AliOssAdapter.createDir
public function createDir($dirname, Config $config) { $object = $this->applyPathPrefix($dirname); $options = $this->getOptionsFromConfig($config); try { $this->client->createObjectDir($this->bucket, $object, $options); } catch (OssException $e) { $this->logEr...
php
public function createDir($dirname, Config $config) { $object = $this->applyPathPrefix($dirname); $options = $this->getOptionsFromConfig($config); try { $this->client->createObjectDir($this->bucket, $object, $options); } catch (OssException $e) { $this->logEr...
[ "public", "function", "createDir", "(", "$", "dirname", ",", "Config", "$", "config", ")", "{", "$", "object", "=", "$", "this", "->", "applyPathPrefix", "(", "$", "dirname", ")", ";", "$", "options", "=", "$", "this", "->", "getOptionsFromConfig", "(", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssAdapter.php#L397-L410
jacobcyl/Aliyun-oss-storage
src/AliOssAdapter.php
AliOssAdapter.setVisibility
public function setVisibility($path, $visibility) { $object = $this->applyPathPrefix($path); $acl = ( $visibility === AdapterInterface::VISIBILITY_PUBLIC ) ? OssClient::OSS_ACL_TYPE_PUBLIC_READ : OssClient::OSS_ACL_TYPE_PRIVATE; $this->client->putObjectAcl($this->bucket, $object, $acl); ...
php
public function setVisibility($path, $visibility) { $object = $this->applyPathPrefix($path); $acl = ( $visibility === AdapterInterface::VISIBILITY_PUBLIC ) ? OssClient::OSS_ACL_TYPE_PUBLIC_READ : OssClient::OSS_ACL_TYPE_PRIVATE; $this->client->putObjectAcl($this->bucket, $object, $acl); ...
[ "public", "function", "setVisibility", "(", "$", "path", ",", "$", "visibility", ")", "{", "$", "object", "=", "$", "this", "->", "applyPathPrefix", "(", "$", "path", ")", ";", "$", "acl", "=", "(", "$", "visibility", "===", "AdapterInterface", "::", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssAdapter.php#L415-L423
jacobcyl/Aliyun-oss-storage
src/AliOssAdapter.php
AliOssAdapter.has
public function has($path) { $object = $this->applyPathPrefix($path); return $this->client->doesObjectExist($this->bucket, $object); }
php
public function has($path) { $object = $this->applyPathPrefix($path); return $this->client->doesObjectExist($this->bucket, $object); }
[ "public", "function", "has", "(", "$", "path", ")", "{", "$", "object", "=", "$", "this", "->", "applyPathPrefix", "(", "$", "path", ")", ";", "return", "$", "this", "->", "client", "->", "doesObjectExist", "(", "$", "this", "->", "bucket", ",", "$",...
{@inheritdoc}
[ "{" ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssAdapter.php#L428-L433
jacobcyl/Aliyun-oss-storage
src/AliOssAdapter.php
AliOssAdapter.read
public function read($path) { $result = $this->readObject($path); $result['contents'] = (string) $result['raw_contents']; unset($result['raw_contents']); return $result; }
php
public function read($path) { $result = $this->readObject($path); $result['contents'] = (string) $result['raw_contents']; unset($result['raw_contents']); return $result; }
[ "public", "function", "read", "(", "$", "path", ")", "{", "$", "result", "=", "$", "this", "->", "readObject", "(", "$", "path", ")", ";", "$", "result", "[", "'contents'", "]", "=", "(", "string", ")", "$", "result", "[", "'raw_contents'", "]", ";...
{@inheritdoc}
[ "{" ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssAdapter.php#L438-L444
jacobcyl/Aliyun-oss-storage
src/AliOssAdapter.php
AliOssAdapter.readStream
public function readStream($path) { $result = $this->readObject($path); $result['stream'] = $result['raw_contents']; rewind($result['stream']); // Ensure the EntityBody object destruction doesn't close the stream $result['raw_contents']->detachStream(); unset($result[...
php
public function readStream($path) { $result = $this->readObject($path); $result['stream'] = $result['raw_contents']; rewind($result['stream']); // Ensure the EntityBody object destruction doesn't close the stream $result['raw_contents']->detachStream(); unset($result[...
[ "public", "function", "readStream", "(", "$", "path", ")", "{", "$", "result", "=", "$", "this", "->", "readObject", "(", "$", "path", ")", ";", "$", "result", "[", "'stream'", "]", "=", "$", "result", "[", "'raw_contents'", "]", ";", "rewind", "(", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssAdapter.php#L449-L459
jacobcyl/Aliyun-oss-storage
src/AliOssAdapter.php
AliOssAdapter.readObject
protected function readObject($path) { $object = $this->applyPathPrefix($path); $result['Body'] = $this->client->getObject($this->bucket, $object); $result = array_merge($result, ['type' => 'file']); return $this->normalizeResponse($result, $path); }
php
protected function readObject($path) { $object = $this->applyPathPrefix($path); $result['Body'] = $this->client->getObject($this->bucket, $object); $result = array_merge($result, ['type' => 'file']); return $this->normalizeResponse($result, $path); }
[ "protected", "function", "readObject", "(", "$", "path", ")", "{", "$", "object", "=", "$", "this", "->", "applyPathPrefix", "(", "$", "path", ")", ";", "$", "result", "[", "'Body'", "]", "=", "$", "this", "->", "client", "->", "getObject", "(", "$",...
Read an object from the OssClient. @param string $path @return array
[ "Read", "an", "object", "from", "the", "OssClient", "." ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssAdapter.php#L468-L475
jacobcyl/Aliyun-oss-storage
src/AliOssAdapter.php
AliOssAdapter.listContents
public function listContents($directory = '', $recursive = false) { $dirObjects = $this->listDirObjects($directory, true); $contents = $dirObjects["objects"]; $result = array_map([$this, 'normalizeResponse'], $contents); $result = array_filter($result, function ($value) { ...
php
public function listContents($directory = '', $recursive = false) { $dirObjects = $this->listDirObjects($directory, true); $contents = $dirObjects["objects"]; $result = array_map([$this, 'normalizeResponse'], $contents); $result = array_filter($result, function ($value) { ...
[ "public", "function", "listContents", "(", "$", "directory", "=", "''", ",", "$", "recursive", "=", "false", ")", "{", "$", "dirObjects", "=", "$", "this", "->", "listDirObjects", "(", "$", "directory", ",", "true", ")", ";", "$", "contents", "=", "$",...
{@inheritdoc}
[ "{" ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssAdapter.php#L480-L491
jacobcyl/Aliyun-oss-storage
src/AliOssAdapter.php
AliOssAdapter.getMetadata
public function getMetadata($path) { $object = $this->applyPathPrefix($path); try { $objectMeta = $this->client->getObjectMeta($this->bucket, $object); } catch (OssException $e) { $this->logErr(__FUNCTION__, $e); return false; } return $o...
php
public function getMetadata($path) { $object = $this->applyPathPrefix($path); try { $objectMeta = $this->client->getObjectMeta($this->bucket, $object); } catch (OssException $e) { $this->logErr(__FUNCTION__, $e); return false; } return $o...
[ "public", "function", "getMetadata", "(", "$", "path", ")", "{", "$", "object", "=", "$", "this", "->", "applyPathPrefix", "(", "$", "path", ")", ";", "try", "{", "$", "objectMeta", "=", "$", "this", "->", "client", "->", "getObjectMeta", "(", "$", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssAdapter.php#L496-L508
jacobcyl/Aliyun-oss-storage
src/AliOssAdapter.php
AliOssAdapter.getTimestamp
public function getTimestamp($path) { if( $object = $this->getMetadata($path)) $object['timestamp'] = strtotime( $object['last-modified'] ); return $object; }
php
public function getTimestamp($path) { if( $object = $this->getMetadata($path)) $object['timestamp'] = strtotime( $object['last-modified'] ); return $object; }
[ "public", "function", "getTimestamp", "(", "$", "path", ")", "{", "if", "(", "$", "object", "=", "$", "this", "->", "getMetadata", "(", "$", "path", ")", ")", "$", "object", "[", "'timestamp'", "]", "=", "strtotime", "(", "$", "object", "[", "'last-m...
{@inheritdoc}
[ "{" ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssAdapter.php#L533-L538
jacobcyl/Aliyun-oss-storage
src/AliOssAdapter.php
AliOssAdapter.getVisibility
public function getVisibility($path) { $object = $this->applyPathPrefix($path); try { $acl = $this->client->getObjectAcl($this->bucket, $object); } catch (OssException $e) { $this->logErr(__FUNCTION__, $e); return false; } if ($acl...
php
public function getVisibility($path) { $object = $this->applyPathPrefix($path); try { $acl = $this->client->getObjectAcl($this->bucket, $object); } catch (OssException $e) { $this->logErr(__FUNCTION__, $e); return false; } if ($acl...
[ "public", "function", "getVisibility", "(", "$", "path", ")", "{", "$", "object", "=", "$", "this", "->", "applyPathPrefix", "(", "$", "path", ")", ";", "try", "{", "$", "acl", "=", "$", "this", "->", "client", "->", "getObjectAcl", "(", "$", "this",...
{@inheritdoc}
[ "{" ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssAdapter.php#L543-L560
jacobcyl/Aliyun-oss-storage
src/AliOssAdapter.php
AliOssAdapter.getUrl
public function getUrl( $path ) { if (!$this->has($path)) throw new FileNotFoundException($filePath.' not found'); return ( $this->ssl ? 'https://' : 'http://' ) . ( $this->isCname ? ( $this->cdnDomain == '' ? $this->endPoint : $this->cdnDomain ) : $this->bucket . '.' . $this->endPoint ) . '/' . ltr...
php
public function getUrl( $path ) { if (!$this->has($path)) throw new FileNotFoundException($filePath.' not found'); return ( $this->ssl ? 'https://' : 'http://' ) . ( $this->isCname ? ( $this->cdnDomain == '' ? $this->endPoint : $this->cdnDomain ) : $this->bucket . '.' . $this->endPoint ) . '/' . ltr...
[ "public", "function", "getUrl", "(", "$", "path", ")", "{", "if", "(", "!", "$", "this", "->", "has", "(", "$", "path", ")", ")", "throw", "new", "FileNotFoundException", "(", "$", "filePath", ".", "' not found'", ")", ";", "return", "(", "$", "this"...
@param $path @return string
[ "@param", "$path" ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssAdapter.php#L568-L572
jacobcyl/Aliyun-oss-storage
src/AliOssAdapter.php
AliOssAdapter.getObjectACL
protected function getObjectACL($path) { $metadata = $this->getVisibility($path); return $metadata['visibility'] === AdapterInterface::VISIBILITY_PUBLIC ? OssClient::OSS_ACL_TYPE_PUBLIC_READ : OssClient::OSS_ACL_TYPE_PRIVATE; }
php
protected function getObjectACL($path) { $metadata = $this->getVisibility($path); return $metadata['visibility'] === AdapterInterface::VISIBILITY_PUBLIC ? OssClient::OSS_ACL_TYPE_PUBLIC_READ : OssClient::OSS_ACL_TYPE_PRIVATE; }
[ "protected", "function", "getObjectACL", "(", "$", "path", ")", "{", "$", "metadata", "=", "$", "this", "->", "getVisibility", "(", "$", "path", ")", ";", "return", "$", "metadata", "[", "'visibility'", "]", "===", "AdapterInterface", "::", "VISIBILITY_PUBLI...
The the ACL visibility. @param string $path @return string
[ "The", "the", "ACL", "visibility", "." ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssAdapter.php#L581-L586
jacobcyl/Aliyun-oss-storage
src/AliOssAdapter.php
AliOssAdapter.normalizeResponse
protected function normalizeResponse(array $object, $path = null) { $result = ['path' => $path ?: $this->removePathPrefix(isset($object['Key']) ? $object['Key'] : $object['Prefix'])]; $result['dirname'] = Util::dirname($result['path']); if (isset($object['LastModified'])) { $res...
php
protected function normalizeResponse(array $object, $path = null) { $result = ['path' => $path ?: $this->removePathPrefix(isset($object['Key']) ? $object['Key'] : $object['Prefix'])]; $result['dirname'] = Util::dirname($result['path']); if (isset($object['LastModified'])) { $res...
[ "protected", "function", "normalizeResponse", "(", "array", "$", "object", ",", "$", "path", "=", "null", ")", "{", "$", "result", "=", "[", "'path'", "=>", "$", "path", "?", ":", "$", "this", "->", "removePathPrefix", "(", "isset", "(", "$", "object",...
Normalize a result from OSS. @param array $object @param string $path @return array file metadata
[ "Normalize", "a", "result", "from", "OSS", "." ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssAdapter.php#L596-L615
jacobcyl/Aliyun-oss-storage
src/AliOssAdapter.php
AliOssAdapter.getOptions
protected function getOptions(array $options = [], Config $config = null) { $options = array_merge($this->options, $options); if ($config) { $options = array_merge($options, $this->getOptionsFromConfig($config)); } return array(OssClient::OSS_HEADERS => $options); }
php
protected function getOptions(array $options = [], Config $config = null) { $options = array_merge($this->options, $options); if ($config) { $options = array_merge($options, $this->getOptionsFromConfig($config)); } return array(OssClient::OSS_HEADERS => $options); }
[ "protected", "function", "getOptions", "(", "array", "$", "options", "=", "[", "]", ",", "Config", "$", "config", "=", "null", ")", "{", "$", "options", "=", "array_merge", "(", "$", "this", "->", "options", ",", "$", "options", ")", ";", "if", "(", ...
Get options for a OSS call. done @param array $options @return array OSS options
[ "Get", "options", "for", "a", "OSS", "call", ".", "done" ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssAdapter.php#L624-L633
jacobcyl/Aliyun-oss-storage
src/AliOssAdapter.php
AliOssAdapter.getOptionsFromConfig
protected function getOptionsFromConfig(Config $config) { $options = []; foreach (static::$metaOptions as $option) { if (! $config->has($option)) { continue; } $options[static::$metaMap[$option]] = $config->get($option); } if ($vi...
php
protected function getOptionsFromConfig(Config $config) { $options = []; foreach (static::$metaOptions as $option) { if (! $config->has($option)) { continue; } $options[static::$metaMap[$option]] = $config->get($option); } if ($vi...
[ "protected", "function", "getOptionsFromConfig", "(", "Config", "$", "config", ")", "{", "$", "options", "=", "[", "]", ";", "foreach", "(", "static", "::", "$", "metaOptions", "as", "$", "option", ")", "{", "if", "(", "!", "$", "config", "->", "has", ...
Retrieve options from a Config instance. done @param Config $config @return array
[ "Retrieve", "options", "from", "a", "Config", "instance", ".", "done" ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssAdapter.php#L642-L668
jacobcyl/Aliyun-oss-storage
src/AliOssServiceProvider.php
AliOssServiceProvider.boot
public function boot() { //发布配置文件 /* if (function_exists('config_path')) { $this->publishes([ __DIR__ . '/config/config.php' => config_path('alioss.php'), ], 'config'); } */ Storage::extend('oss', function($app, $config) ...
php
public function boot() { //发布配置文件 /* if (function_exists('config_path')) { $this->publishes([ __DIR__ . '/config/config.php' => config_path('alioss.php'), ], 'config'); } */ Storage::extend('oss', function($app, $config) ...
[ "public", "function", "boot", "(", ")", "{", "//发布配置文件", "/*\n if (function_exists('config_path')) {\n $this->publishes([\n __DIR__ . '/config/config.php' => config_path('alioss.php'),\n ], 'config');\n }\n */", "Storage", "::", "extend",...
Bootstrap the application services. @return void
[ "Bootstrap", "the", "application", "services", "." ]
train
https://github.com/jacobcyl/Aliyun-oss-storage/blob/9abd13bfb288d93b85db5a1ddc0d2b6b29b26a03/src/AliOssServiceProvider.php#L21-L59
knpuniversity/oauth2-client-bundle
src/DependencyInjection/ProviderFactory.php
ProviderFactory.createProvider
public function createProvider($class, array $options, $redirectUri, array $redirectParams = [], array $collaborators = []) { $redirectUri = $this->generator ->generate($redirectUri, $redirectParams, UrlGeneratorInterface::ABSOLUTE_URL); $options['redirectUri'] = $redirectUri; ...
php
public function createProvider($class, array $options, $redirectUri, array $redirectParams = [], array $collaborators = []) { $redirectUri = $this->generator ->generate($redirectUri, $redirectParams, UrlGeneratorInterface::ABSOLUTE_URL); $options['redirectUri'] = $redirectUri; ...
[ "public", "function", "createProvider", "(", "$", "class", ",", "array", "$", "options", ",", "$", "redirectUri", ",", "array", "$", "redirectParams", "=", "[", "]", ",", "array", "$", "collaborators", "=", "[", "]", ")", "{", "$", "redirectUri", "=", ...
Creates a provider of the given class. @param string $class @param array $options @param string $redirectUri @param array $redirectParams @param array $collaborators @return mixed
[ "Creates", "a", "provider", "of", "the", "given", "class", "." ]
train
https://github.com/knpuniversity/oauth2-client-bundle/blob/df91439574bb0311770157b9a5b26cca531d5e15/src/DependencyInjection/ProviderFactory.php#L45-L53
knpuniversity/oauth2-client-bundle
src/Security/Helper/FinishRegistrationBehavior.php
FinishRegistrationBehavior.saveUserInfoToSession
protected function saveUserInfoToSession(Request $request, FinishRegistrationException $e) { // save the user information! $request->getSession()->set( 'guard.finish_registration.user_information', $e->getUserInformation() ); }
php
protected function saveUserInfoToSession(Request $request, FinishRegistrationException $e) { // save the user information! $request->getSession()->set( 'guard.finish_registration.user_information', $e->getUserInformation() ); }
[ "protected", "function", "saveUserInfoToSession", "(", "Request", "$", "request", ",", "FinishRegistrationException", "$", "e", ")", "{", "// save the user information!", "$", "request", "->", "getSession", "(", ")", "->", "set", "(", "'guard.finish_registration.user_in...
Call this from within your onAuthenticationFailure() method. @param Request $request @param FinishRegistrationException $e @return RedirectResponse
[ "Call", "this", "from", "within", "your", "onAuthenticationFailure", "()", "method", "." ]
train
https://github.com/knpuniversity/oauth2-client-bundle/blob/df91439574bb0311770157b9a5b26cca531d5e15/src/Security/Helper/FinishRegistrationBehavior.php#L30-L37
knpuniversity/oauth2-client-bundle
src/Client/ClientRegistry.php
ClientRegistry.getClient
public function getClient($key) { if (!isset($this->serviceMap[$key])) { throw new \InvalidArgumentException(sprintf( 'There is no OAuth2 client called "%s". Available are: %s', $key, implode(', ', array_keys($this->serviceMap)) )); ...
php
public function getClient($key) { if (!isset($this->serviceMap[$key])) { throw new \InvalidArgumentException(sprintf( 'There is no OAuth2 client called "%s". Available are: %s', $key, implode(', ', array_keys($this->serviceMap)) )); ...
[ "public", "function", "getClient", "(", "$", "key", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "serviceMap", "[", "$", "key", "]", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf", "(", "'There is no OAuth2 ...
Easy accessor for client objects. @param string $key @return OAuth2Client
[ "Easy", "accessor", "for", "client", "objects", "." ]
train
https://github.com/knpuniversity/oauth2-client-bundle/blob/df91439574bb0311770157b9a5b26cca531d5e15/src/Client/ClientRegistry.php#L41-L52
knpuniversity/oauth2-client-bundle
src/DependencyInjection/KnpUOAuth2ClientExtension.php
KnpUOAuth2ClientExtension.load
public function load(array $configs, ContainerBuilder $container) { $processor = new Processor(); $configuration = new Configuration(); $config = $processor->processConfiguration($configuration, $configs); $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resour...
php
public function load(array $configs, ContainerBuilder $container) { $processor = new Processor(); $configuration = new Configuration(); $config = $processor->processConfiguration($configuration, $configs); $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resour...
[ "public", "function", "load", "(", "array", "$", "configs", ",", "ContainerBuilder", "$", "container", ")", "{", "$", "processor", "=", "new", "Processor", "(", ")", ";", "$", "configuration", "=", "new", "Configuration", "(", ")", ";", "$", "config", "=...
Load the bundle configuration. @param array $configs @param ContainerBuilder $container
[ "Load", "the", "bundle", "configuration", "." ]
train
https://github.com/knpuniversity/oauth2-client-bundle/blob/df91439574bb0311770157b9a5b26cca531d5e15/src/DependencyInjection/KnpUOAuth2ClientExtension.php#L152-L225
knpuniversity/oauth2-client-bundle
src/Client/OAuth2Client.php
OAuth2Client.redirect
public function redirect(array $scopes = [], array $options = []) { if (!empty($scopes)) { $options['scope'] = $scopes; } $url = $this->provider->getAuthorizationUrl($options); // set the state (unless we're stateless) if (!$this->isStateless) { $thi...
php
public function redirect(array $scopes = [], array $options = []) { if (!empty($scopes)) { $options['scope'] = $scopes; } $url = $this->provider->getAuthorizationUrl($options); // set the state (unless we're stateless) if (!$this->isStateless) { $thi...
[ "public", "function", "redirect", "(", "array", "$", "scopes", "=", "[", "]", ",", "array", "$", "options", "=", "[", "]", ")", "{", "if", "(", "!", "empty", "(", "$", "scopes", ")", ")", "{", "$", "options", "[", "'scope'", "]", "=", "$", "sco...
Creates a RedirectResponse that will send the user to the OAuth2 server (e.g. send them to Facebook). @param array $scopes The scopes you want (leave empty to use default) @param array $options Extra options to pass to the "Provider" class @return RedirectResponse
[ "Creates", "a", "RedirectResponse", "that", "will", "send", "the", "user", "to", "the", "OAuth2", "server", "(", "e", ".", "g", ".", "send", "them", "to", "Facebook", ")", "." ]
train
https://github.com/knpuniversity/oauth2-client-bundle/blob/df91439574bb0311770157b9a5b26cca531d5e15/src/Client/OAuth2Client.php#L62-L79
knpuniversity/oauth2-client-bundle
src/Client/OAuth2Client.php
OAuth2Client.getAccessToken
public function getAccessToken() { if (!$this->isStateless) { $expectedState = $this->getSession()->get(self::OAUTH2_SESSION_STATE_KEY); $actualState = $this->getCurrentRequest()->query->get('state'); if (!$actualState || ($actualState !== $expectedState)) { ...
php
public function getAccessToken() { if (!$this->isStateless) { $expectedState = $this->getSession()->get(self::OAUTH2_SESSION_STATE_KEY); $actualState = $this->getCurrentRequest()->query->get('state'); if (!$actualState || ($actualState !== $expectedState)) { ...
[ "public", "function", "getAccessToken", "(", ")", "{", "if", "(", "!", "$", "this", "->", "isStateless", ")", "{", "$", "expectedState", "=", "$", "this", "->", "getSession", "(", ")", "->", "get", "(", "self", "::", "OAUTH2_SESSION_STATE_KEY", ")", ";",...
Call this after the user is redirected back to get the access token. @return \League\OAuth2\Client\Token\AccessToken @throws InvalidStateException @throws MissingAuthorizationCodeException @throws IdentityProviderException If token cannot be fetched
[ "Call", "this", "after", "the", "user", "is", "redirected", "back", "to", "get", "the", "access", "token", "." ]
train
https://github.com/knpuniversity/oauth2-client-bundle/blob/df91439574bb0311770157b9a5b26cca531d5e15/src/Client/OAuth2Client.php#L90-L109
gesdinet/JWTRefreshTokenBundle
DependencyInjection/Compiler/UserCheckerCompilerPass.php
UserCheckerCompilerPass.process
public function process(ContainerBuilder $container) { $userCheckerId = $container->getParameter('gesdinet.jwtrefreshtoken.user_checker.id'); if (!$userCheckerId) { return; } $container->setAlias('gesdinet.jwtrefreshtoken.user_checker', $userCheckerId); }
php
public function process(ContainerBuilder $container) { $userCheckerId = $container->getParameter('gesdinet.jwtrefreshtoken.user_checker.id'); if (!$userCheckerId) { return; } $container->setAlias('gesdinet.jwtrefreshtoken.user_checker', $userCheckerId); }
[ "public", "function", "process", "(", "ContainerBuilder", "$", "container", ")", "{", "$", "userCheckerId", "=", "$", "container", "->", "getParameter", "(", "'gesdinet.jwtrefreshtoken.user_checker.id'", ")", ";", "if", "(", "!", "$", "userCheckerId", ")", "{", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/gesdinet/JWTRefreshTokenBundle/blob/9b9a9f8cf5fdc48dacb012929dc01cdf05b6badf/DependencyInjection/Compiler/UserCheckerCompilerPass.php#L16-L24
gesdinet/JWTRefreshTokenBundle
DependencyInjection/Compiler/ObjectManagerCompilerPass.php
ObjectManagerCompilerPass.process
public function process(ContainerBuilder $container) { $objectManagerId = $container->getParameter('gesdinet.jwtrefreshtoken.object_manager.id'); if (!$objectManagerId) { return; } $container->setAlias('gesdinet.jwtrefreshtoken.object_manager', $objectManagerId); }
php
public function process(ContainerBuilder $container) { $objectManagerId = $container->getParameter('gesdinet.jwtrefreshtoken.object_manager.id'); if (!$objectManagerId) { return; } $container->setAlias('gesdinet.jwtrefreshtoken.object_manager', $objectManagerId); }
[ "public", "function", "process", "(", "ContainerBuilder", "$", "container", ")", "{", "$", "objectManagerId", "=", "$", "container", "->", "getParameter", "(", "'gesdinet.jwtrefreshtoken.object_manager.id'", ")", ";", "if", "(", "!", "$", "objectManagerId", ")", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/gesdinet/JWTRefreshTokenBundle/blob/9b9a9f8cf5fdc48dacb012929dc01cdf05b6badf/DependencyInjection/Compiler/ObjectManagerCompilerPass.php#L16-L24
gesdinet/JWTRefreshTokenBundle
Document/RefreshTokenRepository.php
RefreshTokenRepository.findInvalid
public function findInvalid($datetime = null) { $datetime = (null === $datetime) ? new \DateTime() : $datetime; $queryBuilder = $this->createQueryBuilder() ->field('valid')->lt($datetime); return $queryBuilder->getQuery()->execute(); }
php
public function findInvalid($datetime = null) { $datetime = (null === $datetime) ? new \DateTime() : $datetime; $queryBuilder = $this->createQueryBuilder() ->field('valid')->lt($datetime); return $queryBuilder->getQuery()->execute(); }
[ "public", "function", "findInvalid", "(", "$", "datetime", "=", "null", ")", "{", "$", "datetime", "=", "(", "null", "===", "$", "datetime", ")", "?", "new", "\\", "DateTime", "(", ")", ":", "$", "datetime", ";", "$", "queryBuilder", "=", "$", "this"...
@param null $datetime @return RefreshToken[]
[ "@param", "null", "$datetime" ]
train
https://github.com/gesdinet/JWTRefreshTokenBundle/blob/9b9a9f8cf5fdc48dacb012929dc01cdf05b6badf/Document/RefreshTokenRepository.php#L21-L29
gesdinet/JWTRefreshTokenBundle
Doctrine/RefreshTokenManager.php
RefreshTokenManager.revokeAllInvalid
public function revokeAllInvalid($datetime = null, $andFlush = true) { $invalidTokens = $this->repository->findInvalid($datetime); foreach ($invalidTokens as $invalidToken) { $this->objectManager->remove($invalidToken); } if ($andFlush) { $this->objectManage...
php
public function revokeAllInvalid($datetime = null, $andFlush = true) { $invalidTokens = $this->repository->findInvalid($datetime); foreach ($invalidTokens as $invalidToken) { $this->objectManager->remove($invalidToken); } if ($andFlush) { $this->objectManage...
[ "public", "function", "revokeAllInvalid", "(", "$", "datetime", "=", "null", ",", "$", "andFlush", "=", "true", ")", "{", "$", "invalidTokens", "=", "$", "this", "->", "repository", "->", "findInvalid", "(", "$", "datetime", ")", ";", "foreach", "(", "$"...
@param \DateTime $datetime @param bool $andFlush @return RefreshTokenInterface[]
[ "@param", "\\", "DateTime", "$datetime", "@param", "bool", "$andFlush" ]
train
https://github.com/gesdinet/JWTRefreshTokenBundle/blob/9b9a9f8cf5fdc48dacb012929dc01cdf05b6badf/Doctrine/RefreshTokenManager.php#L102-L115
gesdinet/JWTRefreshTokenBundle
Service/RefreshToken.php
RefreshToken.refresh
public function refresh(Request $request) { try { $preAuthenticatedToken = $this->authenticator->authenticateToken( $this->authenticator->createToken($request, $this->providerKey), $this->provider, $this->providerKey ); } catch ...
php
public function refresh(Request $request) { try { $preAuthenticatedToken = $this->authenticator->authenticateToken( $this->authenticator->createToken($request, $this->providerKey), $this->provider, $this->providerKey ); } catch ...
[ "public", "function", "refresh", "(", "Request", "$", "request", ")", "{", "try", "{", "$", "preAuthenticatedToken", "=", "$", "this", "->", "authenticator", "->", "authenticateToken", "(", "$", "this", "->", "authenticator", "->", "createToken", "(", "$", "...
Refresh token. @param Request $request @return mixed @throws InvalidArgumentException @throws AuthenticationException
[ "Refresh", "token", "." ]
train
https://github.com/gesdinet/JWTRefreshTokenBundle/blob/9b9a9f8cf5fdc48dacb012929dc01cdf05b6badf/Service/RefreshToken.php#L120-L152
gesdinet/JWTRefreshTokenBundle
Entity/AbstractRefreshToken.php
AbstractRefreshToken.setRefreshToken
public function setRefreshToken($refreshToken = null) { $this->refreshToken = null === $refreshToken ? bin2hex(openssl_random_pseudo_bytes(64)) : $refreshToken; return $this; }
php
public function setRefreshToken($refreshToken = null) { $this->refreshToken = null === $refreshToken ? bin2hex(openssl_random_pseudo_bytes(64)) : $refreshToken; return $this; }
[ "public", "function", "setRefreshToken", "(", "$", "refreshToken", "=", "null", ")", "{", "$", "this", "->", "refreshToken", "=", "null", "===", "$", "refreshToken", "?", "bin2hex", "(", "openssl_random_pseudo_bytes", "(", "64", ")", ")", ":", "$", "refreshT...
Set refreshToken. @param string $refreshToken @return AbstractRefreshToken
[ "Set", "refreshToken", "." ]
train
https://github.com/gesdinet/JWTRefreshTokenBundle/blob/9b9a9f8cf5fdc48dacb012929dc01cdf05b6badf/Entity/AbstractRefreshToken.php#L55-L62
gesdinet/JWTRefreshTokenBundle
DependencyInjection/GesdinetJWTRefreshTokenExtension.php
GesdinetJWTRefreshTokenExtension.load
public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); $config = $this->processConfiguration($configuration, $configs); $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load(...
php
public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); $config = $this->processConfiguration($configuration, $configs); $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load(...
[ "public", "function", "load", "(", "array", "$", "configs", ",", "ContainerBuilder", "$", "container", ")", "{", "$", "configuration", "=", "new", "Configuration", "(", ")", ";", "$", "config", "=", "$", "this", "->", "processConfiguration", "(", "$", "con...
{@inheritdoc}
[ "{" ]
train
https://github.com/gesdinet/JWTRefreshTokenBundle/blob/9b9a9f8cf5fdc48dacb012929dc01cdf05b6badf/DependencyInjection/GesdinetJWTRefreshTokenExtension.php#L29-L65
gesdinet/JWTRefreshTokenBundle
DependencyInjection/Compiler/DoctrineMappingsCompilerPass.php
DoctrineMappingsCompilerPass.process
public function process(ContainerBuilder $container) { $config = $container->getExtensionConfig('gesdinet_jwt_refresh_token')[0]; if (!class_exists('Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\DoctrineMongoDBMappingsPass') && (isset($config['manager_type']) && 'mongodb' =...
php
public function process(ContainerBuilder $container) { $config = $container->getExtensionConfig('gesdinet_jwt_refresh_token')[0]; if (!class_exists('Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\DoctrineMongoDBMappingsPass') && (isset($config['manager_type']) && 'mongodb' =...
[ "public", "function", "process", "(", "ContainerBuilder", "$", "container", ")", "{", "$", "config", "=", "$", "container", "->", "getExtensionConfig", "(", "'gesdinet_jwt_refresh_token'", ")", "[", "0", "]", ";", "if", "(", "!", "class_exists", "(", "'Doctrin...
Process Doctrine mappings based on gesdinet_jwt_refresh_token.manager_type and gesdinet_jwt_refresh_token.refresh_token_class config parameters. Depending on the value of manager_type Doctrine's ORM or ODM mappings will be used. If refresh_token_class parameter contains user-defined entity, RefreshToken will be registe...
[ "Process", "Doctrine", "mappings", "based", "on", "gesdinet_jwt_refresh_token", ".", "manager_type", "and", "gesdinet_jwt_refresh_token", ".", "refresh_token_class", "config", "parameters", ".", "Depending", "on", "the", "value", "of", "manager_type", "Doctrine", "s", "...
train
https://github.com/gesdinet/JWTRefreshTokenBundle/blob/9b9a9f8cf5fdc48dacb012929dc01cdf05b6badf/DependencyInjection/Compiler/DoctrineMappingsCompilerPass.php#L29-L52
gesdinet/JWTRefreshTokenBundle
DependencyInjection/Compiler/DoctrineMappingsCompilerPass.php
DoctrineMappingsCompilerPass.getORMCompilerPass
protected function getORMCompilerPass(array $config) { $nameSpace = 'Gesdinet\JWTRefreshTokenBundle\Entity'; $mappings = array( realpath(dirname(dirname(__DIR__)).'/Resources/config/orm/doctrine-orm') => $nameSpace, ); if (isset($config['refresh_token_class']) || isset($...
php
protected function getORMCompilerPass(array $config) { $nameSpace = 'Gesdinet\JWTRefreshTokenBundle\Entity'; $mappings = array( realpath(dirname(dirname(__DIR__)).'/Resources/config/orm/doctrine-orm') => $nameSpace, ); if (isset($config['refresh_token_class']) || isset($...
[ "protected", "function", "getORMCompilerPass", "(", "array", "$", "config", ")", "{", "$", "nameSpace", "=", "'Gesdinet\\JWTRefreshTokenBundle\\Entity'", ";", "$", "mappings", "=", "array", "(", "realpath", "(", "dirname", "(", "dirname", "(", "__DIR__", ")", ")...
@param array $config @return CompilerPassInterface
[ "@param", "array", "$config" ]
train
https://github.com/gesdinet/JWTRefreshTokenBundle/blob/9b9a9f8cf5fdc48dacb012929dc01cdf05b6badf/DependencyInjection/Compiler/DoctrineMappingsCompilerPass.php#L59-L73
gesdinet/JWTRefreshTokenBundle
DependencyInjection/Compiler/DoctrineMappingsCompilerPass.php
DoctrineMappingsCompilerPass.getODMCompilerPass
protected function getODMCompilerPass(array $config) { $nameSpace = 'Gesdinet\JWTRefreshTokenBundle\Document'; $mappings = array( realpath(dirname(__DIR__, 2).'/Resources/config/mongodb/doctrine-mongodb') => $nameSpace, ); if (isset($config['refresh_token_class']) || iss...
php
protected function getODMCompilerPass(array $config) { $nameSpace = 'Gesdinet\JWTRefreshTokenBundle\Document'; $mappings = array( realpath(dirname(__DIR__, 2).'/Resources/config/mongodb/doctrine-mongodb') => $nameSpace, ); if (isset($config['refresh_token_class']) || iss...
[ "protected", "function", "getODMCompilerPass", "(", "array", "$", "config", ")", "{", "$", "nameSpace", "=", "'Gesdinet\\JWTRefreshTokenBundle\\Document'", ";", "$", "mappings", "=", "array", "(", "realpath", "(", "dirname", "(", "__DIR__", ",", "2", ")", ".", ...
@param array $config @return CompilerPassInterface
[ "@param", "array", "$config" ]
train
https://github.com/gesdinet/JWTRefreshTokenBundle/blob/9b9a9f8cf5fdc48dacb012929dc01cdf05b6badf/DependencyInjection/Compiler/DoctrineMappingsCompilerPass.php#L80-L94
gesdinet/JWTRefreshTokenBundle
DependencyInjection/Compiler/CustomUserProviderCompilerPass.php
CustomUserProviderCompilerPass.process
public function process(ContainerBuilder $container) { $customUserProvider = $container->getParameter('gesdinet_jwt_refresh_token.user_provider'); if (!$customUserProvider) { return; } if (!$container->hasDefinition('gesdinet.jwtrefreshtoken.user_provider')) { ...
php
public function process(ContainerBuilder $container) { $customUserProvider = $container->getParameter('gesdinet_jwt_refresh_token.user_provider'); if (!$customUserProvider) { return; } if (!$container->hasDefinition('gesdinet.jwtrefreshtoken.user_provider')) { ...
[ "public", "function", "process", "(", "ContainerBuilder", "$", "container", ")", "{", "$", "customUserProvider", "=", "$", "container", "->", "getParameter", "(", "'gesdinet_jwt_refresh_token.user_provider'", ")", ";", "if", "(", "!", "$", "customUserProvider", ")",...
{@inheritdoc}
[ "{" ]
train
https://github.com/gesdinet/JWTRefreshTokenBundle/blob/9b9a9f8cf5fdc48dacb012929dc01cdf05b6badf/DependencyInjection/Compiler/CustomUserProviderCompilerPass.php#L18-L34
gesdinet/JWTRefreshTokenBundle
Entity/RefreshTokenRepository.php
RefreshTokenRepository.findInvalid
public function findInvalid($datetime = null) { $datetime = (null === $datetime) ? new \DateTime() : $datetime; return $this->createQueryBuilder('u') ->where('u.valid < :datetime') ->setParameter(':datetime', $datetime) ->getQuery() ->getResult(); ...
php
public function findInvalid($datetime = null) { $datetime = (null === $datetime) ? new \DateTime() : $datetime; return $this->createQueryBuilder('u') ->where('u.valid < :datetime') ->setParameter(':datetime', $datetime) ->getQuery() ->getResult(); ...
[ "public", "function", "findInvalid", "(", "$", "datetime", "=", "null", ")", "{", "$", "datetime", "=", "(", "null", "===", "$", "datetime", ")", "?", "new", "\\", "DateTime", "(", ")", ":", "$", "datetime", ";", "return", "$", "this", "->", "createQ...
@param null $datetime @return RefreshToken[]
[ "@param", "null", "$datetime" ]
train
https://github.com/gesdinet/JWTRefreshTokenBundle/blob/9b9a9f8cf5fdc48dacb012929dc01cdf05b6badf/Entity/RefreshTokenRepository.php#L20-L29
gesdinet/JWTRefreshTokenBundle
DependencyInjection/Configuration.php
Configuration.getConfigTreeBuilder
public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('gesdinet_jwt_refresh_token'); $rootNode = method_exists(TreeBuilder::class, 'getRootNode') ? $treeBuilder->getRootNode() : $treeBuilder->root('gesdinet_jwt_refresh_token'); $rootNode ->children() ...
php
public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('gesdinet_jwt_refresh_token'); $rootNode = method_exists(TreeBuilder::class, 'getRootNode') ? $treeBuilder->getRootNode() : $treeBuilder->root('gesdinet_jwt_refresh_token'); $rootNode ->children() ...
[ "public", "function", "getConfigTreeBuilder", "(", ")", "{", "$", "treeBuilder", "=", "new", "TreeBuilder", "(", "'gesdinet_jwt_refresh_token'", ")", ";", "$", "rootNode", "=", "method_exists", "(", "TreeBuilder", "::", "class", ",", "'getRootNode'", ")", "?", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/gesdinet/JWTRefreshTokenBundle/blob/9b9a9f8cf5fdc48dacb012929dc01cdf05b6badf/DependencyInjection/Configuration.php#L27-L64
nelmio/NelmioCorsBundle
Options/Resolver.php
Resolver.getOptions
public function getOptions(Request $request) { $options = array(); foreach ($this->providers as $provider) { $options = array_merge($options, $provider->getOptions($request)); } return $options; }
php
public function getOptions(Request $request) { $options = array(); foreach ($this->providers as $provider) { $options = array_merge($options, $provider->getOptions($request)); } return $options; }
[ "public", "function", "getOptions", "(", "Request", "$", "request", ")", "{", "$", "options", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "providers", "as", "$", "provider", ")", "{", "$", "options", "=", "array_merge", "(", "$", ...
Resolves the options for $request based on {@see $providers} data @param Request $request @return array CORS options
[ "Resolves", "the", "options", "for", "$request", "based", "on", "{", "@see", "$providers", "}", "data" ]
train
https://github.com/nelmio/NelmioCorsBundle/blob/adabee944e6fe52ee566caf1770a29355b1e8d83/Options/Resolver.php#L42-L50
nelmio/NelmioCorsBundle
DependencyInjection/Configuration.php
Configuration.getConfigTreeBuilder
public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('nelmio_cors'); if (method_exists($treeBuilder, 'getRootNode')) { $rootNode = $treeBuilder->getRootNode(); } else { // BC for symfony/config < 4.2 $rootNode = $treeBuilder->root('nelm...
php
public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('nelmio_cors'); if (method_exists($treeBuilder, 'getRootNode')) { $rootNode = $treeBuilder->getRootNode(); } else { // BC for symfony/config < 4.2 $rootNode = $treeBuilder->root('nelm...
[ "public", "function", "getConfigTreeBuilder", "(", ")", "{", "$", "treeBuilder", "=", "new", "TreeBuilder", "(", "'nelmio_cors'", ")", ";", "if", "(", "method_exists", "(", "$", "treeBuilder", ",", "'getRootNode'", ")", ")", "{", "$", "rootNode", "=", "$", ...
{@inheritDoc}
[ "{" ]
train
https://github.com/nelmio/NelmioCorsBundle/blob/adabee944e6fe52ee566caf1770a29355b1e8d83/DependencyInjection/Configuration.php#L28-L72
nelmio/NelmioCorsBundle
DependencyInjection/NelmioCorsExtension.php
NelmioCorsExtension.load
public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); $config = $this->processConfiguration($configuration, $configs); $defaults = array_merge( array( 'allow_origin' => array(), 'allow_credential...
php
public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); $config = $this->processConfiguration($configuration, $configs); $defaults = array_merge( array( 'allow_origin' => array(), 'allow_credential...
[ "public", "function", "load", "(", "array", "$", "configs", ",", "ContainerBuilder", "$", "container", ")", "{", "$", "configuration", "=", "new", "Configuration", "(", ")", ";", "$", "config", "=", "$", "this", "->", "processConfiguration", "(", "$", "con...
{@inheritDoc}
[ "{" ]
train
https://github.com/nelmio/NelmioCorsBundle/blob/adabee944e6fe52ee566caf1770a29355b1e8d83/DependencyInjection/NelmioCorsExtension.php#L27-L81
laravel-notification-channels/webhook
src/WebhookChannel.php
WebhookChannel.send
public function send($notifiable, Notification $notification) { if (! $url = $notifiable->routeNotificationFor('Webhook')) { return; } $webhookData = $notification->toWebhook($notifiable)->toArray(); $response = $this->client->post($url, [ 'body' => json_enc...
php
public function send($notifiable, Notification $notification) { if (! $url = $notifiable->routeNotificationFor('Webhook')) { return; } $webhookData = $notification->toWebhook($notifiable)->toArray(); $response = $this->client->post($url, [ 'body' => json_enc...
[ "public", "function", "send", "(", "$", "notifiable", ",", "Notification", "$", "notification", ")", "{", "if", "(", "!", "$", "url", "=", "$", "notifiable", "->", "routeNotificationFor", "(", "'Webhook'", ")", ")", "{", "return", ";", "}", "$", "webhook...
Send the given notification. @param mixed $notifiable @param \Illuminate\Notifications\Notification $notification @throws \NotificationChannels\Webhook\Exceptions\CouldNotSendNotification
[ "Send", "the", "given", "notification", "." ]
train
https://github.com/laravel-notification-channels/webhook/blob/955762305694542fc5f1d3898c05070423ae4eb5/src/WebhookChannel.php#L31-L48
stof/StofDoctrineExtensionsBundle
Uploadable/UploadableManager.php
UploadableManager.markEntityToUpload
public function markEntityToUpload($entity, $fileInfo) { if (is_object($fileInfo) && $fileInfo instanceof UploadedFile) { $fileInfoClass = $this->fileInfoClass; $fileInfo = new $fileInfoClass($fileInfo); } $this->listener->addEntityFileInfo($entity, $fileInfo); ...
php
public function markEntityToUpload($entity, $fileInfo) { if (is_object($fileInfo) && $fileInfo instanceof UploadedFile) { $fileInfoClass = $this->fileInfoClass; $fileInfo = new $fileInfoClass($fileInfo); } $this->listener->addEntityFileInfo($entity, $fileInfo); ...
[ "public", "function", "markEntityToUpload", "(", "$", "entity", ",", "$", "fileInfo", ")", "{", "if", "(", "is_object", "(", "$", "fileInfo", ")", "&&", "$", "fileInfo", "instanceof", "UploadedFile", ")", "{", "$", "fileInfoClass", "=", "$", "this", "->", ...
This method marks an entity to be uploaded as soon as the "flush" method of your object manager is called. After calling this method, the file info you passed is set for this entity in the listener. This is all it takes to upload a file for an entity in the Uploadable extension. @param object $entity - The entity yo...
[ "This", "method", "marks", "an", "entity", "to", "be", "uploaded", "as", "soon", "as", "the", "flush", "method", "of", "your", "object", "manager", "is", "called", ".", "After", "calling", "this", "method", "the", "file", "info", "you", "passed", "is", "...
train
https://github.com/stof/StofDoctrineExtensionsBundle/blob/9b47596daa0fd33218687d0b91e7d016e5363796/Uploadable/UploadableManager.php#L28-L37
stof/StofDoctrineExtensionsBundle
DependencyInjection/StofDoctrineExtensionsExtension.php
StofDoctrineExtensionsExtension.processObjectManagerConfigurations
private function processObjectManagerConfigurations(array $configs, ContainerBuilder $container, LoaderInterface $loader, array &$loaded, $doctrineSubscriberTag) { $usedManagers = array(); $listenerPriorities = array( 'translatable' => -10, 'loggable' => 5, 'uplo...
php
private function processObjectManagerConfigurations(array $configs, ContainerBuilder $container, LoaderInterface $loader, array &$loaded, $doctrineSubscriberTag) { $usedManagers = array(); $listenerPriorities = array( 'translatable' => -10, 'loggable' => 5, 'uplo...
[ "private", "function", "processObjectManagerConfigurations", "(", "array", "$", "configs", ",", "ContainerBuilder", "$", "container", ",", "LoaderInterface", "$", "loader", ",", "array", "&", "$", "loaded", ",", "$", "doctrineSubscriberTag", ")", "{", "$", "usedMa...
@param array $configs @param ContainerBuilder $container @param LoaderInterface $loader @param array $loaded @param string $doctrineSubscriberTag @return array
[ "@param", "array", "$configs", "@param", "ContainerBuilder", "$container", "@param", "LoaderInterface", "$loader", "@param", "array", "$loaded", "@param", "string", "$doctrineSubscriberTag" ]
train
https://github.com/stof/StofDoctrineExtensionsBundle/blob/9b47596daa0fd33218687d0b91e7d016e5363796/DependencyInjection/StofDoctrineExtensionsExtension.php#L98-L133
stof/StofDoctrineExtensionsBundle
DependencyInjection/Configuration.php
Configuration.getConfigTreeBuilder
public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('stof_doctrine_extensions'); if (\method_exists($treeBuilder, 'getRootNode')) { $rootNode = $treeBuilder->getRootNode(); } else { // BC layer for symfony/config 4.1 and older $rootNode...
php
public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('stof_doctrine_extensions'); if (\method_exists($treeBuilder, 'getRootNode')) { $rootNode = $treeBuilder->getRootNode(); } else { // BC layer for symfony/config 4.1 and older $rootNode...
[ "public", "function", "getConfigTreeBuilder", "(", ")", "{", "$", "treeBuilder", "=", "new", "TreeBuilder", "(", "'stof_doctrine_extensions'", ")", ";", "if", "(", "\\", "method_exists", "(", "$", "treeBuilder", ",", "'getRootNode'", ")", ")", "{", "$", "rootN...
Generates the configuration tree. @return TreeBuilder
[ "Generates", "the", "configuration", "tree", "." ]
train
https://github.com/stof/StofDoctrineExtensionsBundle/blob/9b47596daa0fd33218687d0b91e7d016e5363796/DependencyInjection/Configuration.php#L15-L42
influxdata/influxdb-php
src/InfluxDB/Client.php
Client.query
public function query($database, $query, $parameters = []) { $driver = $this->getDriver(); if (!$driver instanceof QueryDriverInterface) { throw new Exception('The currently configured driver does not support query operations'); } if ($database) { $parameter...
php
public function query($database, $query, $parameters = []) { $driver = $this->getDriver(); if (!$driver instanceof QueryDriverInterface) { throw new Exception('The currently configured driver does not support query operations'); } if ($database) { $parameter...
[ "public", "function", "query", "(", "$", "database", ",", "$", "query", ",", "$", "parameters", "=", "[", "]", ")", "{", "$", "driver", "=", "$", "this", "->", "getDriver", "(", ")", ";", "if", "(", "!", "$", "driver", "instanceof", "QueryDriverInter...
Query influxDB @param string $database @param string $query @param array $parameters @return ResultSet @throws Exception
[ "Query", "influxDB" ]
train
https://github.com/influxdata/influxdb-php/blob/4a1efb43656a4f2b390201865cfe7051c895dff7/src/InfluxDB/Client.php#L163-L198
influxdata/influxdb-php
src/InfluxDB/Client.php
Client.fromDSN
public static function fromDSN($dsn, $timeout = 0, $verifySSL = false, $connectTimeout = 0) { $connParams = parse_url($dsn); if ($connParams === false) { throw new ClientException('Unable to parse the InfluxDB DSN'); } $schemeInfo = explode('+', $connParams['scheme']); ...
php
public static function fromDSN($dsn, $timeout = 0, $verifySSL = false, $connectTimeout = 0) { $connParams = parse_url($dsn); if ($connParams === false) { throw new ClientException('Unable to parse the InfluxDB DSN'); } $schemeInfo = explode('+', $connParams['scheme']); ...
[ "public", "static", "function", "fromDSN", "(", "$", "dsn", ",", "$", "timeout", "=", "0", ",", "$", "verifySSL", "=", "false", ",", "$", "connectTimeout", "=", "0", ")", "{", "$", "connParams", "=", "parse_url", "(", "$", "dsn", ")", ";", "if", "(...
Build the client from a dsn Examples: https+influxdb://username:pass@localhost:8086/databasename udp+influxdb://username:pass@localhost:4444/databasename @param string $dsn @param float $timeout @param bool $verifySSL @param float $connectTimeout @return Client|Database @throws ClientException
[ "Build", "the", "client", "from", "a", "dsn", "Examples", ":" ]
train
https://github.com/influxdata/influxdb-php/blob/4a1efb43656a4f2b390201865cfe7051c895dff7/src/InfluxDB/Client.php#L270-L312
influxdata/influxdb-php
src/InfluxDB/ResultSet.php
ResultSet.getSeries
public function getSeries($queryIndex = 0) { $results = $this->parsedResults['results']; if ($queryIndex !== null && !array_key_exists($queryIndex, $results)) { throw new \InvalidArgumentException('Invalid statement index provided'); } $queryResults = []; foreac...
php
public function getSeries($queryIndex = 0) { $results = $this->parsedResults['results']; if ($queryIndex !== null && !array_key_exists($queryIndex, $results)) { throw new \InvalidArgumentException('Invalid statement index provided'); } $queryResults = []; foreac...
[ "public", "function", "getSeries", "(", "$", "queryIndex", "=", "0", ")", "{", "$", "results", "=", "$", "this", "->", "parsedResults", "[", "'results'", "]", ";", "if", "(", "$", "queryIndex", "!==", "null", "&&", "!", "array_key_exists", "(", "$", "q...
@see: https://influxdb.com/docs/v0.9/concepts/reading_and_writing_data.html results is an array of objects, one for each query, each containing the keys for a series @param int $queryIndex which Nth query result to return. Use null as value if you want all result of multi query results @return array $series @throws C...
[ "@see", ":", "https", ":", "//", "influxdb", ".", "com", "/", "docs", "/", "v0", ".", "9", "/", "concepts", "/", "reading_and_writing_data", ".", "html" ]
train
https://github.com/influxdata/influxdb-php/blob/4a1efb43656a4f2b390201865cfe7051c895dff7/src/InfluxDB/ResultSet.php#L102-L130
influxdata/influxdb-php
src/InfluxDB/Query/Builder.php
Builder.setTimeRange
public function setTimeRange($from, $to) { $fromDate = date('Y-m-d H:i:s', (int) $from); $toDate = date('Y-m-d H:i:s', (int) $to); $this->where(array("time > '$fromDate'", "time < '$toDate'")); return $this; }
php
public function setTimeRange($from, $to) { $fromDate = date('Y-m-d H:i:s', (int) $from); $toDate = date('Y-m-d H:i:s', (int) $to); $this->where(array("time > '$fromDate'", "time < '$toDate'")); return $this; }
[ "public", "function", "setTimeRange", "(", "$", "from", ",", "$", "to", ")", "{", "$", "fromDate", "=", "date", "(", "'Y-m-d H:i:s'", ",", "(", "int", ")", "$", "from", ")", ";", "$", "toDate", "=", "date", "(", "'Y-m-d H:i:s'", ",", "(", "int", ")...
Set's the time range to select data from @param int $from @param int $to @return $this
[ "Set", "s", "the", "time", "range", "to", "select", "data", "from" ]
train
https://github.com/influxdata/influxdb-php/blob/4a1efb43656a4f2b390201865cfe7051c895dff7/src/InfluxDB/Query/Builder.php#L220-L228
influxdata/influxdb-php
src/InfluxDB/Database.php
Database.query
public function query($query, $params = []) { return $this->client->query($this->name, $query, $params); }
php
public function query($query, $params = []) { return $this->client->query($this->name, $query, $params); }
[ "public", "function", "query", "(", "$", "query", ",", "$", "params", "=", "[", "]", ")", "{", "return", "$", "this", "->", "client", "->", "query", "(", "$", "this", "->", "name", ",", "$", "query", ",", "$", "params", ")", ";", "}" ]
Query influxDB @param string $query @param array $params @return ResultSet @throws Exception
[ "Query", "influxDB" ]
train
https://github.com/influxdata/influxdb-php/blob/4a1efb43656a4f2b390201865cfe7051c895dff7/src/InfluxDB/Database.php#L76-L79
influxdata/influxdb-php
src/InfluxDB/Database.php
Database.create
public function create(RetentionPolicy $retentionPolicy = null, $createIfNotExists = false) { if ($createIfNotExists) { trigger_error('The $createIfNotExists parameter to Database::create is deprecated', E_USER_DEPRECATED); } try { $query = sprintf('CREATE DATABASE "%...
php
public function create(RetentionPolicy $retentionPolicy = null, $createIfNotExists = false) { if ($createIfNotExists) { trigger_error('The $createIfNotExists parameter to Database::create is deprecated', E_USER_DEPRECATED); } try { $query = sprintf('CREATE DATABASE "%...
[ "public", "function", "create", "(", "RetentionPolicy", "$", "retentionPolicy", "=", "null", ",", "$", "createIfNotExists", "=", "false", ")", "{", "if", "(", "$", "createIfNotExists", ")", "{", "trigger_error", "(", "'The $createIfNotExists parameter to Database::cre...
Create this database @param RetentionPolicy $retentionPolicy @param bool $createIfNotExists Deprecated parameter - to be removed @return ResultSet @throws DatabaseException
[ "Create", "this", "database" ]
train
https://github.com/influxdata/influxdb-php/blob/4a1efb43656a4f2b390201865cfe7051c895dff7/src/InfluxDB/Database.php#L89-L109
influxdata/influxdb-php
src/InfluxDB/Database.php
Database.writePoints
public function writePoints(array $points, $precision = self::PRECISION_NANOSECONDS, $retentionPolicy = null) { $payload = array_map( function (Point $point) { return (string) $point; }, $points ); return $this->writePayload($payload, $pre...
php
public function writePoints(array $points, $precision = self::PRECISION_NANOSECONDS, $retentionPolicy = null) { $payload = array_map( function (Point $point) { return (string) $point; }, $points ); return $this->writePayload($payload, $pre...
[ "public", "function", "writePoints", "(", "array", "$", "points", ",", "$", "precision", "=", "self", "::", "PRECISION_NANOSECONDS", ",", "$", "retentionPolicy", "=", "null", ")", "{", "$", "payload", "=", "array_map", "(", "function", "(", "Point", "$", "...
Write points into InfluxDB using the current driver. This is the recommended method for inserting data into InfluxDB. @param Point[] $points Array of Point objects @param string $precision The timestamp precision (defaults to nanoseconds). @param string|null $retentionPolicy Specifies an ...
[ "Write", "points", "into", "InfluxDB", "using", "the", "current", "driver", ".", "This", "is", "the", "recommended", "method", "for", "inserting", "data", "into", "InfluxDB", "." ]
train
https://github.com/influxdata/influxdb-php/blob/4a1efb43656a4f2b390201865cfe7051c895dff7/src/InfluxDB/Database.php#L133-L143
influxdata/influxdb-php
src/InfluxDB/Database.php
Database.writePayload
public function writePayload($payload, $precision = self::PRECISION_NANOSECONDS, $retentionPolicy = null) { try { $parameters = [ 'url' => sprintf('write?db=%s&precision=%s', $this->name, $precision), 'database' => $this->name, 'method' => 'post' ...
php
public function writePayload($payload, $precision = self::PRECISION_NANOSECONDS, $retentionPolicy = null) { try { $parameters = [ 'url' => sprintf('write?db=%s&precision=%s', $this->name, $precision), 'database' => $this->name, 'method' => 'post' ...
[ "public", "function", "writePayload", "(", "$", "payload", ",", "$", "precision", "=", "self", "::", "PRECISION_NANOSECONDS", ",", "$", "retentionPolicy", "=", "null", ")", "{", "try", "{", "$", "parameters", "=", "[", "'url'", "=>", "sprintf", "(", "'writ...
Write a payload into InfluxDB using the current driver. This method is similar to <tt>writePoints()</tt>, except it takes a string payload instead of an array of Points. This is useful in the following situations: 1) Performing unique queries that may not conform to the current Point standard. 2) Inserting very large ...
[ "Write", "a", "payload", "into", "InfluxDB", "using", "the", "current", "driver", ".", "This", "method", "is", "similar", "to", "<tt", ">", "writePoints", "()", "<", "/", "tt", ">", "except", "it", "takes", "a", "string", "payload", "instead", "of", "an"...
train
https://github.com/influxdata/influxdb-php/blob/4a1efb43656a4f2b390201865cfe7051c895dff7/src/InfluxDB/Database.php#L162-L179
influxdata/influxdb-php
src/InfluxDB/Point.php
Point.escapeCharacters
private function escapeCharacters(array $arr, $escapeValues) { $returnArr = []; foreach ($arr as $key => $value) { $returnArr[$this->addSlashes($key)] = $escapeValues ? $this->addSlashes($value) : $value; } return $returnArr; }
php
private function escapeCharacters(array $arr, $escapeValues) { $returnArr = []; foreach ($arr as $key => $value) { $returnArr[$this->addSlashes($key)] = $escapeValues ? $this->addSlashes($value) : $value; } return $returnArr; }
[ "private", "function", "escapeCharacters", "(", "array", "$", "arr", ",", "$", "escapeValues", ")", "{", "$", "returnArr", "=", "[", "]", ";", "foreach", "(", "$", "arr", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "returnArr", "[", "$", "...
Escapes invalid characters in both the array key and optionally the array value @param array $arr @param bool $escapeValues @return array
[ "Escapes", "invalid", "characters", "in", "both", "the", "array", "key", "and", "optionally", "the", "array", "value" ]
train
https://github.com/influxdata/influxdb-php/blob/4a1efb43656a4f2b390201865cfe7051c895dff7/src/InfluxDB/Point.php#L188-L197
influxdata/influxdb-php
src/InfluxDB/Driver/Guzzle.php
Guzzle.write
public function write($data = null) { $this->response = $this->httpClient->post($this->parameters['url'], $this->getRequestParameters($data)); }
php
public function write($data = null) { $this->response = $this->httpClient->post($this->parameters['url'], $this->getRequestParameters($data)); }
[ "public", "function", "write", "(", "$", "data", "=", "null", ")", "{", "$", "this", "->", "response", "=", "$", "this", "->", "httpClient", "->", "post", "(", "$", "this", "->", "parameters", "[", "'url'", "]", ",", "$", "this", "->", "getRequestPar...
Send the data @param $data @throws \Exception
[ "Send", "the", "data" ]
train
https://github.com/influxdata/influxdb-php/blob/4a1efb43656a4f2b390201865cfe7051c895dff7/src/InfluxDB/Driver/Guzzle.php#L82-L85
influxdata/influxdb-php
src/InfluxDB/Driver/Guzzle.php
Guzzle.isSuccess
public function isSuccess() { $statuscode = $this->response->getStatusCode(); if(!in_array($statuscode, [200, 204], true)) { throw new Exception('HTTP Code ' . $statuscode . ' ' . $this->response->getBody()); } return true; }
php
public function isSuccess() { $statuscode = $this->response->getStatusCode(); if(!in_array($statuscode, [200, 204], true)) { throw new Exception('HTTP Code ' . $statuscode . ' ' . $this->response->getBody()); } return true; }
[ "public", "function", "isSuccess", "(", ")", "{", "$", "statuscode", "=", "$", "this", "->", "response", "->", "getStatusCode", "(", ")", ";", "if", "(", "!", "in_array", "(", "$", "statuscode", ",", "[", "200", ",", "204", "]", ",", "true", ")", "...
Should return if sending the data was successful @return bool @throws Exception
[ "Should", "return", "if", "sending", "the", "data", "was", "successful" ]
train
https://github.com/influxdata/influxdb-php/blob/4a1efb43656a4f2b390201865cfe7051c895dff7/src/InfluxDB/Driver/Guzzle.php#L116-L126
influxdata/influxdb-php
src/InfluxDB/Driver/Guzzle.php
Guzzle.getRequestParameters
protected function getRequestParameters($data = null) { $requestParameters = ['http_errors' => false]; if ($data) { $requestParameters += ['body' => $data]; } if (isset($this->parameters['auth'])) { $requestParameters += ['auth' => $this->parameters['auth']]...
php
protected function getRequestParameters($data = null) { $requestParameters = ['http_errors' => false]; if ($data) { $requestParameters += ['body' => $data]; } if (isset($this->parameters['auth'])) { $requestParameters += ['auth' => $this->parameters['auth']]...
[ "protected", "function", "getRequestParameters", "(", "$", "data", "=", "null", ")", "{", "$", "requestParameters", "=", "[", "'http_errors'", "=>", "false", "]", ";", "if", "(", "$", "data", ")", "{", "$", "requestParameters", "+=", "[", "'body'", "=>", ...
@param null $data @return array
[ "@param", "null", "$data" ]
train
https://github.com/influxdata/influxdb-php/blob/4a1efb43656a4f2b390201865cfe7051c895dff7/src/InfluxDB/Driver/Guzzle.php#L133-L146
influxdata/influxdb-php
src/InfluxDB/Driver/UDP.php
UDP.write
public function write($data = null) { if (isset($this->stream) === false) { $this->createStream(); } @stream_socket_sendto($this->stream, $data); return true; }
php
public function write($data = null) { if (isset($this->stream) === false) { $this->createStream(); } @stream_socket_sendto($this->stream, $data); return true; }
[ "public", "function", "write", "(", "$", "data", "=", "null", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "stream", ")", "===", "false", ")", "{", "$", "this", "->", "createStream", "(", ")", ";", "}", "@", "stream_socket_sendto", "(", "$...
{@inheritdoc}
[ "{" ]
train
https://github.com/influxdata/influxdb-php/blob/4a1efb43656a4f2b390201865cfe7051c895dff7/src/InfluxDB/Driver/UDP.php#L72-L81
influxdata/influxdb-php
src/InfluxDB/Driver/UDP.php
UDP.createStream
protected function createStream() { $host = sprintf('udp://%s:%d', $this->config['host'], $this->config['port']); // stream the data using UDP and suppress any errors $this->stream = @stream_socket_client($host); }
php
protected function createStream() { $host = sprintf('udp://%s:%d', $this->config['host'], $this->config['port']); // stream the data using UDP and suppress any errors $this->stream = @stream_socket_client($host); }
[ "protected", "function", "createStream", "(", ")", "{", "$", "host", "=", "sprintf", "(", "'udp://%s:%d'", ",", "$", "this", "->", "config", "[", "'host'", "]", ",", "$", "this", "->", "config", "[", "'port'", "]", ")", ";", "// stream the data using UDP a...
Create the resource stream
[ "Create", "the", "resource", "stream" ]
train
https://github.com/influxdata/influxdb-php/blob/4a1efb43656a4f2b390201865cfe7051c895dff7/src/InfluxDB/Driver/UDP.php#L94-L100
influxdata/influxdb-php
src/InfluxDB/Client/Admin.php
Admin.createUser
public function createUser($username, $password, $privilege = null) { $query = sprintf('CREATE USER %s WITH PASSWORD \'%s\'', $username, $password); if ($privilege) { $query .= " WITH $privilege PRIVILEGES"; } return $this->client->query(null, $query); }
php
public function createUser($username, $password, $privilege = null) { $query = sprintf('CREATE USER %s WITH PASSWORD \'%s\'', $username, $password); if ($privilege) { $query .= " WITH $privilege PRIVILEGES"; } return $this->client->query(null, $query); }
[ "public", "function", "createUser", "(", "$", "username", ",", "$", "password", ",", "$", "privilege", "=", "null", ")", "{", "$", "query", "=", "sprintf", "(", "'CREATE USER %s WITH PASSWORD \\'%s\\''", ",", "$", "username", ",", "$", "password", ")", ";", ...
Create a user @param string $username @param string $password @param string $privilege @throws \InfluxDB\Exception @return \InfluxDB\ResultSet
[ "Create", "a", "user" ]
train
https://github.com/influxdata/influxdb-php/blob/4a1efb43656a4f2b390201865cfe7051c895dff7/src/InfluxDB/Client/Admin.php#L44-L53
influxdata/influxdb-php
src/InfluxDB/Client/Admin.php
Admin.grant
public function grant($privilege, $username, $database = null) { return $this->executePrivilege('GRANT', $privilege, $username, $database); }
php
public function grant($privilege, $username, $database = null) { return $this->executePrivilege('GRANT', $privilege, $username, $database); }
[ "public", "function", "grant", "(", "$", "privilege", ",", "$", "username", ",", "$", "database", "=", "null", ")", "{", "return", "$", "this", "->", "executePrivilege", "(", "'GRANT'", ",", "$", "privilege", ",", "$", "username", ",", "$", "database", ...
Grants permissions @param string $privilege @param string $username @param Database|string $database @return \InfluxDB\ResultSet @throws \InfluxDB\Exception
[ "Grants", "permissions" ]
train
https://github.com/influxdata/influxdb-php/blob/4a1efb43656a4f2b390201865cfe7051c895dff7/src/InfluxDB/Client/Admin.php#L101-L104
influxdata/influxdb-php
src/InfluxDB/Client/Admin.php
Admin.revoke
public function revoke($privilege, $username, $database = null) { return $this->executePrivilege('REVOKE', $privilege, $username, $database); }
php
public function revoke($privilege, $username, $database = null) { return $this->executePrivilege('REVOKE', $privilege, $username, $database); }
[ "public", "function", "revoke", "(", "$", "privilege", ",", "$", "username", ",", "$", "database", "=", "null", ")", "{", "return", "$", "this", "->", "executePrivilege", "(", "'REVOKE'", ",", "$", "privilege", ",", "$", "username", ",", "$", "database",...
Revokes permissions @param string $privilege @param string $username @param Database|string $database @throws \InfluxDB\Exception @return \InfluxDB\ResultSet
[ "Revokes", "permissions" ]
train
https://github.com/influxdata/influxdb-php/blob/4a1efb43656a4f2b390201865cfe7051c895dff7/src/InfluxDB/Client/Admin.php#L116-L119
influxdata/influxdb-php
src/InfluxDB/Client/Admin.php
Admin.executePrivilege
private function executePrivilege($type, $privilege, $username, $database = null) { if (!in_array($privilege, [self::PRIVILEGE_READ, self::PRIVILEGE_WRITE, self::PRIVILEGE_ALL], true)) { throw new Exception($privilege . ' is not a valid privileges, allowed privileges: READ, WRITE, ALL'); ...
php
private function executePrivilege($type, $privilege, $username, $database = null) { if (!in_array($privilege, [self::PRIVILEGE_READ, self::PRIVILEGE_WRITE, self::PRIVILEGE_ALL], true)) { throw new Exception($privilege . ' is not a valid privileges, allowed privileges: READ, WRITE, ALL'); ...
[ "private", "function", "executePrivilege", "(", "$", "type", ",", "$", "privilege", ",", "$", "username", ",", "$", "database", "=", "null", ")", "{", "if", "(", "!", "in_array", "(", "$", "privilege", ",", "[", "self", "::", "PRIVILEGE_READ", ",", "se...
@param string $type @param string $privilege @param string $username @param Database|string $database @throws \InfluxDB\Exception @return \InfluxDB\ResultSet
[ "@param", "string", "$type", "@param", "string", "$privilege", "@param", "string", "$username", "@param", "Database|string", "$database" ]
train
https://github.com/influxdata/influxdb-php/blob/4a1efb43656a4f2b390201865cfe7051c895dff7/src/InfluxDB/Client/Admin.php#L130-L158
dauxio/daux.io
libs/Server/Server.php
Server.serve
public static function serve() { $output = new NullOutput(); $daux = new Daux(Daux::LIVE_MODE, $output); $daux->initializeConfiguration(); $class = $daux->getProcessorClass(); if (!empty($class)) { $daux->setProcessor(new $class($daux, $output, 0)); } ...
php
public static function serve() { $output = new NullOutput(); $daux = new Daux(Daux::LIVE_MODE, $output); $daux->initializeConfiguration(); $class = $daux->getProcessorClass(); if (!empty($class)) { $daux->setProcessor(new $class($daux, $output, 0)); } ...
[ "public", "static", "function", "serve", "(", ")", "{", "$", "output", "=", "new", "NullOutput", "(", ")", ";", "$", "daux", "=", "new", "Daux", "(", "Daux", "::", "LIVE_MODE", ",", "$", "output", ")", ";", "$", "daux", "->", "initializeConfiguration",...
Serve the documentation @throws Exception
[ "Serve", "the", "documentation" ]
train
https://github.com/dauxio/daux.io/blob/d02ebe093bcf15bbe32aaa1712370c7c70165f8e/libs/Server/Server.php#L32-L60
dauxio/daux.io
libs/Server/Server.php
Server.getTemporaryFile
private function getTemporaryFile($postfix) { $sysFileName = tempnam(sys_get_temp_dir(), 'daux'); if ($sysFileName === false) { throw new \RuntimeException("Could not create temporary file"); } $newFileName = $sysFileName . $postfix; if ($sysFileName == $newFileName)...
php
private function getTemporaryFile($postfix) { $sysFileName = tempnam(sys_get_temp_dir(), 'daux'); if ($sysFileName === false) { throw new \RuntimeException("Could not create temporary file"); } $newFileName = $sysFileName . $postfix; if ($sysFileName == $newFileName)...
[ "private", "function", "getTemporaryFile", "(", "$", "postfix", ")", "{", "$", "sysFileName", "=", "tempnam", "(", "sys_get_temp_dir", "(", ")", ",", "'daux'", ")", ";", "if", "(", "$", "sysFileName", "===", "false", ")", "{", "throw", "new", "\\", "Runt...
Create a temporary file with the file suffix, for mime type detection. @param string $postfix @return string
[ "Create", "a", "temporary", "file", "with", "the", "file", "suffix", "for", "mime", "type", "detection", "." ]
train
https://github.com/dauxio/daux.io/blob/d02ebe093bcf15bbe32aaa1712370c7c70165f8e/libs/Server/Server.php#L76-L92
dauxio/daux.io
libs/Server/Server.php
Server.handle
public function handle() { $this->params = $this->getParams(); $request = substr($this->request->getRequestUri(), strlen($this->request->getBaseUrl()) + 1); if (substr($request, 0, 7) == 'themes/') { return $this->serveTheme(substr($request, 6)); } if ($request...
php
public function handle() { $this->params = $this->getParams(); $request = substr($this->request->getRequestUri(), strlen($this->request->getBaseUrl()) + 1); if (substr($request, 0, 7) == 'themes/') { return $this->serveTheme(substr($request, 6)); } if ($request...
[ "public", "function", "handle", "(", ")", "{", "$", "this", "->", "params", "=", "$", "this", "->", "getParams", "(", ")", ";", "$", "request", "=", "substr", "(", "$", "this", "->", "request", "->", "getRequestUri", "(", ")", ",", "strlen", "(", "...
Handle an incoming request @return \Todaymade\Daux\Format\Base\Page @throws Exception @throws NotFoundException
[ "Handle", "an", "incoming", "request" ]
train
https://github.com/dauxio/daux.io/blob/d02ebe093bcf15bbe32aaa1712370c7c70165f8e/libs/Server/Server.php#L141-L156
dauxio/daux.io
libs/Server/Server.php
Server.serveTheme
public function serveTheme($request) { $file = $this->getParams()->getThemesPath() . $request; if (file_exists($file)) { return new RawPage($file); } throw new NotFoundException; }
php
public function serveTheme($request) { $file = $this->getParams()->getThemesPath() . $request; if (file_exists($file)) { return new RawPage($file); } throw new NotFoundException; }
[ "public", "function", "serveTheme", "(", "$", "request", ")", "{", "$", "file", "=", "$", "this", "->", "getParams", "(", ")", "->", "getThemesPath", "(", ")", ".", "$", "request", ";", "if", "(", "file_exists", "(", "$", "file", ")", ")", "{", "re...
Handle a request on custom themes @param string $request @return \Todaymade\Daux\Format\Base\Page @throws NotFoundException
[ "Handle", "a", "request", "on", "custom", "themes" ]
train
https://github.com/dauxio/daux.io/blob/d02ebe093bcf15bbe32aaa1712370c7c70165f8e/libs/Server/Server.php#L165-L174
dauxio/daux.io
libs/Format/HTML/HTMLUtils.php
HTMLUtils.copyThemes
public function copyThemes($destination, $local_base) { mkdir($destination . DIRECTORY_SEPARATOR . 'themes'); GeneratorHelper::copyRecursive( $local_base, $destination . DIRECTORY_SEPARATOR . 'themes' ); }
php
public function copyThemes($destination, $local_base) { mkdir($destination . DIRECTORY_SEPARATOR . 'themes'); GeneratorHelper::copyRecursive( $local_base, $destination . DIRECTORY_SEPARATOR . 'themes' ); }
[ "public", "function", "copyThemes", "(", "$", "destination", ",", "$", "local_base", ")", "{", "mkdir", "(", "$", "destination", ".", "DIRECTORY_SEPARATOR", ".", "'themes'", ")", ";", "GeneratorHelper", "::", "copyRecursive", "(", "$", "local_base", ",", "$", ...
Copy all files from $local to $destination @param string $destination @param string $local_base
[ "Copy", "all", "files", "from", "$local", "to", "$destination" ]
train
https://github.com/dauxio/daux.io/blob/d02ebe093bcf15bbe32aaa1712370c7c70165f8e/libs/Format/HTML/HTMLUtils.php#L21-L28
dauxio/daux.io
libs/Format/HTML/ContentTypes/Markdown/TOC/Processor.php
Processor.processDocument
public function processDocument(Document $document) { /** @var TableOfContents[] $tocs */ $tocs = []; $headings = []; $document->heading_ids = []; $walker = $document->walker(); while ($event = $walker->next()) { $node = $event->getNode(); i...
php
public function processDocument(Document $document) { /** @var TableOfContents[] $tocs */ $tocs = []; $headings = []; $document->heading_ids = []; $walker = $document->walker(); while ($event = $walker->next()) { $node = $event->getNode(); i...
[ "public", "function", "processDocument", "(", "Document", "$", "document", ")", "{", "/** @var TableOfContents[] $tocs */", "$", "tocs", "=", "[", "]", ";", "$", "headings", "=", "[", "]", ";", "$", "document", "->", "heading_ids", "=", "[", "]", ";", "$",...
@param Document $document @return void
[ "@param", "Document", "$document" ]
train
https://github.com/dauxio/daux.io/blob/d02ebe093bcf15bbe32aaa1712370c7c70165f8e/libs/Format/HTML/ContentTypes/Markdown/TOC/Processor.php#L37-L73
dauxio/daux.io
libs/Format/HTML/ContentTypes/Markdown/TOC/Processor.php
Processor.escaped
protected function escaped($url) { $url = trim($url); $url = preg_replace('~[^\\pL0-9_]+~u', '-', $url); $url = trim($url, "-"); $url = iconv("utf-8", "ASCII//TRANSLIT//IGNORE", $url); $url = preg_replace('~[^-a-zA-Z0-9_]+~', '', $url); return $url; }
php
protected function escaped($url) { $url = trim($url); $url = preg_replace('~[^\\pL0-9_]+~u', '-', $url); $url = trim($url, "-"); $url = iconv("utf-8", "ASCII//TRANSLIT//IGNORE", $url); $url = preg_replace('~[^-a-zA-Z0-9_]+~', '', $url); return $url; }
[ "protected", "function", "escaped", "(", "$", "url", ")", "{", "$", "url", "=", "trim", "(", "$", "url", ")", ";", "$", "url", "=", "preg_replace", "(", "'~[^\\\\pL0-9_]+~u'", ",", "'-'", ",", "$", "url", ")", ";", "$", "url", "=", "trim", "(", "...
Get an escaped version of the link @param string $url @return string
[ "Get", "an", "escaped", "version", "of", "the", "link" ]
train
https://github.com/dauxio/daux.io/blob/d02ebe093bcf15bbe32aaa1712370c7c70165f8e/libs/Format/HTML/ContentTypes/Markdown/TOC/Processor.php#L80-L88
dauxio/daux.io
libs/Format/HTML/ContentTypes/Markdown/TOC/Processor.php
Processor.generate
public function generate($headings) { /** @var Entry $previous */ $root = $previous = new RootEntry(); foreach ($headings as $heading) { if ($heading->getLevel() < $previous->getLevel()) { $parent = $previous; do { $parent = $pa...
php
public function generate($headings) { /** @var Entry $previous */ $root = $previous = new RootEntry(); foreach ($headings as $heading) { if ($heading->getLevel() < $previous->getLevel()) { $parent = $previous; do { $parent = $pa...
[ "public", "function", "generate", "(", "$", "headings", ")", "{", "/** @var Entry $previous */", "$", "root", "=", "$", "previous", "=", "new", "RootEntry", "(", ")", ";", "foreach", "(", "$", "headings", "as", "$", "heading", ")", "{", "if", "(", "$", ...
Make a tree of the list of headings @param Entry[] $headings @return RootEntry
[ "Make", "a", "tree", "of", "the", "list", "of", "headings" ]
train
https://github.com/dauxio/daux.io/blob/d02ebe093bcf15bbe32aaa1712370c7c70165f8e/libs/Format/HTML/ContentTypes/Markdown/TOC/Processor.php#L151-L182
dauxio/daux.io
libs/Format/HTML/ContentTypes/Markdown/TOC/Processor.php
Processor.setNull
protected function setNull(Heading $object, $property) { $prop = new \ReflectionProperty(get_class($object), $property); $prop->setAccessible(true); $prop->setValue($object, null); }
php
protected function setNull(Heading $object, $property) { $prop = new \ReflectionProperty(get_class($object), $property); $prop->setAccessible(true); $prop->setValue($object, null); }
[ "protected", "function", "setNull", "(", "Heading", "$", "object", ",", "$", "property", ")", "{", "$", "prop", "=", "new", "\\", "ReflectionProperty", "(", "get_class", "(", "$", "object", ")", ",", "$", "property", ")", ";", "$", "prop", "->", "setAc...
Set the specified property to null on the object. @param Heading $object The object to modify @param string $property The property to nullify
[ "Set", "the", "specified", "property", "to", "null", "on", "the", "object", "." ]
train
https://github.com/dauxio/daux.io/blob/d02ebe093bcf15bbe32aaa1712370c7c70165f8e/libs/Format/HTML/ContentTypes/Markdown/TOC/Processor.php#L229-L234
dauxio/daux.io
libs/Tree/Content.php
Content.getAttribute
public function getAttribute($key = null) { if ($this->attributes === null) { $this->parseAttributes(); } if (is_null($key)) { return $this->attributes; } if (!array_key_exists($key, $this->attributes)) { return null; } r...
php
public function getAttribute($key = null) { if ($this->attributes === null) { $this->parseAttributes(); } if (is_null($key)) { return $this->attributes; } if (!array_key_exists($key, $this->attributes)) { return null; } r...
[ "public", "function", "getAttribute", "(", "$", "key", "=", "null", ")", "{", "if", "(", "$", "this", "->", "attributes", "===", "null", ")", "{", "$", "this", "->", "parseAttributes", "(", ")", ";", "}", "if", "(", "is_null", "(", "$", "key", ")",...
Get one or all attributes for the content @param string|null $key @return array|mixed|null
[ "Get", "one", "or", "all", "attributes", "for", "the", "content" ]
train
https://github.com/dauxio/daux.io/blob/d02ebe093bcf15bbe32aaa1712370c7c70165f8e/libs/Tree/Content.php#L138-L153
dauxio/daux.io
libs/Tree/Directory.php
Directory.seekFirstPage
public function seekFirstPage() { if ($this instanceof self) { $index_key = $this->getConfig()['index_key']; if (isset($this->children[$index_key])) { return $this->children[$index_key]; } foreach ($this->children as $node_key => $node) { ...
php
public function seekFirstPage() { if ($this instanceof self) { $index_key = $this->getConfig()['index_key']; if (isset($this->children[$index_key])) { return $this->children[$index_key]; } foreach ($this->children as $node_key => $node) { ...
[ "public", "function", "seekFirstPage", "(", ")", "{", "if", "(", "$", "this", "instanceof", "self", ")", "{", "$", "index_key", "=", "$", "this", "->", "getConfig", "(", ")", "[", "'index_key'", "]", ";", "if", "(", "isset", "(", "$", "this", "->", ...
Seek the first available page from descendants @return Content|null
[ "Seek", "the", "first", "available", "page", "from", "descendants" ]
train
https://github.com/dauxio/daux.io/blob/d02ebe093bcf15bbe32aaa1712370c7c70165f8e/libs/Tree/Directory.php#L160-L180
dauxio/daux.io
libs/Tree/Directory.php
Directory.hasContent
public function hasContent() { foreach ($this->getEntries() as $node) { if ($node instanceof Content) { return true; } elseif ($node instanceof self) { if ($node->hasContent()) { return true; } } ...
php
public function hasContent() { foreach ($this->getEntries() as $node) { if ($node instanceof Content) { return true; } elseif ($node instanceof self) { if ($node->hasContent()) { return true; } } ...
[ "public", "function", "hasContent", "(", ")", "{", "foreach", "(", "$", "this", "->", "getEntries", "(", ")", "as", "$", "node", ")", "{", "if", "(", "$", "node", "instanceof", "Content", ")", "{", "return", "true", ";", "}", "elseif", "(", "$", "n...
Used when creating the navigation. Hides folders without showable content @return bool
[ "Used", "when", "creating", "the", "navigation", ".", "Hides", "folders", "without", "showable", "content" ]
train
https://github.com/dauxio/daux.io/blob/d02ebe093bcf15bbe32aaa1712370c7c70165f8e/libs/Tree/Directory.php#L231-L244
dauxio/daux.io
libs/GeneratorHelper.php
GeneratorHelper.copyRecursive
public static function copyRecursive($source, $destination) { if (!is_dir($destination)) { mkdir($destination); } $dir = opendir($source); if (!$dir) { throw new RuntimeException("Cannot copy '$source' to '$destination'"); } while (false !==...
php
public static function copyRecursive($source, $destination) { if (!is_dir($destination)) { mkdir($destination); } $dir = opendir($source); if (!$dir) { throw new RuntimeException("Cannot copy '$source' to '$destination'"); } while (false !==...
[ "public", "static", "function", "copyRecursive", "(", "$", "source", ",", "$", "destination", ")", "{", "if", "(", "!", "is_dir", "(", "$", "destination", ")", ")", "{", "mkdir", "(", "$", "destination", ")", ";", "}", "$", "dir", "=", "opendir", "("...
Copy files recursively @param string $source @param string $destination
[ "Copy", "files", "recursively" ]
train
https://github.com/dauxio/daux.io/blob/d02ebe093bcf15bbe32aaa1712370c7c70165f8e/libs/GeneratorHelper.php#L34-L59
dauxio/daux.io
libs/Tree/Entry.php
Entry.getParents
public function getParents() { $parents = []; if ($this->parent && !$this->parent instanceof Root) { $parents = $this->parent->getParents(); $parents[] = $this->parent; } return $parents; }
php
public function getParents() { $parents = []; if ($this->parent && !$this->parent instanceof Root) { $parents = $this->parent->getParents(); $parents[] = $this->parent; } return $parents; }
[ "public", "function", "getParents", "(", ")", "{", "$", "parents", "=", "[", "]", ";", "if", "(", "$", "this", "->", "parent", "&&", "!", "$", "this", "->", "parent", "instanceof", "Root", ")", "{", "$", "parents", "=", "$", "this", "->", "parent",...
Return all parents starting with the root @return Directory[]
[ "Return", "all", "parents", "starting", "with", "the", "root" ]
train
https://github.com/dauxio/daux.io/blob/d02ebe093bcf15bbe32aaa1712370c7c70165f8e/libs/Tree/Entry.php#L110-L119
dauxio/daux.io
libs/Tree/Entry.php
Entry.getRelativePath
public function getRelativePath() { $root = $this; while ($root->getParent() != null) { $root = $root->getParent(); } return substr($this->path, strlen($root->getPath()) + 1); }
php
public function getRelativePath() { $root = $this; while ($root->getParent() != null) { $root = $root->getParent(); } return substr($this->path, strlen($root->getPath()) + 1); }
[ "public", "function", "getRelativePath", "(", ")", "{", "$", "root", "=", "$", "this", ";", "while", "(", "$", "root", "->", "getParent", "(", ")", "!=", "null", ")", "{", "$", "root", "=", "$", "root", "->", "getParent", "(", ")", ";", "}", "ret...
Get the path to the file from the root of the documentation @return string
[ "Get", "the", "path", "to", "the", "file", "from", "the", "root", "of", "the", "documentation" ]
train
https://github.com/dauxio/daux.io/blob/d02ebe093bcf15bbe32aaa1712370c7c70165f8e/libs/Tree/Entry.php#L147-L155
dauxio/daux.io
libs/Format/Confluence/ContentTypes/Markdown/ImageRenderer.php
ImageRenderer.render
public function render(AbstractInline $inline, ElementRendererInterface $htmlRenderer) { if (!($inline instanceof Image)) { throw new \InvalidArgumentException('Incompatible inline type: ' . get_class($inline)); } // External Images need special handling if (strpos($inli...
php
public function render(AbstractInline $inline, ElementRendererInterface $htmlRenderer) { if (!($inline instanceof Image)) { throw new \InvalidArgumentException('Incompatible inline type: ' . get_class($inline)); } // External Images need special handling if (strpos($inli...
[ "public", "function", "render", "(", "AbstractInline", "$", "inline", ",", "ElementRendererInterface", "$", "htmlRenderer", ")", "{", "if", "(", "!", "(", "$", "inline", "instanceof", "Image", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(...
@param Image $inline @param ElementRendererInterface $htmlRenderer @return HtmlElement
[ "@param", "Image", "$inline", "@param", "ElementRendererInterface", "$htmlRenderer" ]
train
https://github.com/dauxio/daux.io/blob/d02ebe093bcf15bbe32aaa1712370c7c70165f8e/libs/Format/Confluence/ContentTypes/Markdown/ImageRenderer.php#L16-L32
dauxio/daux.io
libs/Format/HTML/Generator.php
Generator.sanitize
private function sanitize($text) { $text = preg_replace( [ // Remove invisible content '@<head[^>]*?>.*?</head>@siu', '@<style[^>]*?>.*?</style>@siu', '@<script[^>]*?.*?</script>@siu', '@<object[^>]*?.*?</object>@siu...
php
private function sanitize($text) { $text = preg_replace( [ // Remove invisible content '@<head[^>]*?>.*?</head>@siu', '@<style[^>]*?>.*?</style>@siu', '@<script[^>]*?.*?</script>@siu', '@<object[^>]*?.*?</object>@siu...
[ "private", "function", "sanitize", "(", "$", "text", ")", "{", "$", "text", "=", "preg_replace", "(", "[", "// Remove invisible content", "'@<head[^>]*?>.*?</head>@siu'", ",", "'@<style[^>]*?>.*?</style>@siu'", ",", "'@<script[^>]*?.*?</script>@siu'", ",", "'@<object[^>]*?....
Remove HTML tags, including invisible text such as style and script code, and embedded objects. Add line breaks around block-level tags to prevent word joining after tag removal. Also collapse whitespace to single space and trim result. modified from: http://nadeausoftware.com/articles/2007/09/php_tip_how_strip_html_t...
[ "Remove", "HTML", "tags", "including", "invisible", "text", "such", "as", "style", "and", "script", "code", "and", "embedded", "objects", ".", "Add", "line", "breaks", "around", "block", "-", "level", "tags", "to", "prevent", "word", "joining", "after", "tag...
train
https://github.com/dauxio/daux.io/blob/d02ebe093bcf15bbe32aaa1712370c7c70165f8e/libs/Format/HTML/Generator.php#L101-L139
dauxio/daux.io
libs/Format/HTML/Generator.php
Generator.generateRecursive
private function generateRecursive(Directory $tree, $output_dir, $params, $output, $width, $index_pages, $base_url = '') { DauxHelper::rebaseConfiguration($params, $base_url); if ($base_url !== '' && empty($params['entry_page'])) { $params['entry_page'] = $tree->getFirstPage(); ...
php
private function generateRecursive(Directory $tree, $output_dir, $params, $output, $width, $index_pages, $base_url = '') { DauxHelper::rebaseConfiguration($params, $base_url); if ($base_url !== '' && empty($params['entry_page'])) { $params['entry_page'] = $tree->getFirstPage(); ...
[ "private", "function", "generateRecursive", "(", "Directory", "$", "tree", ",", "$", "output_dir", ",", "$", "params", ",", "$", "output", ",", "$", "width", ",", "$", "index_pages", ",", "$", "base_url", "=", "''", ")", "{", "DauxHelper", "::", "rebaseC...
Recursively generate the documentation @param Directory $tree @param string $output_dir @param \Todaymade\Daux\Config $params @param OutputInterface $output @param int $width @param bool $index_pages @param string $base_url @throws \Exception
[ "Recursively", "generate", "the", "documentation" ]
train
https://github.com/dauxio/daux.io/blob/d02ebe093bcf15bbe32aaa1712370c7c70165f8e/libs/Format/HTML/Generator.php#L153-L196
dauxio/daux.io
libs/Daux.php
Daux.getConfigurationOverride
public function getConfigurationOverride($path) { $validPath = DauxHelper::findLocation($path, $this->local_base, 'DAUX_CONFIGURATION', 'file'); if ($validPath === null) { return null; } if (!$validPath) { throw new Exception('The configuration override file...
php
public function getConfigurationOverride($path) { $validPath = DauxHelper::findLocation($path, $this->local_base, 'DAUX_CONFIGURATION', 'file'); if ($validPath === null) { return null; } if (!$validPath) { throw new Exception('The configuration override file...
[ "public", "function", "getConfigurationOverride", "(", "$", "path", ")", "{", "$", "validPath", "=", "DauxHelper", "::", "findLocation", "(", "$", "path", ",", "$", "this", "->", "local_base", ",", "'DAUX_CONFIGURATION'", ",", "'file'", ")", ";", "if", "(", ...
Get the file requested for configuration overrides @param string|null $path @return string|null the path to a file to load for configuration overrides @throws Exception
[ "Get", "the", "file", "requested", "for", "configuration", "overrides" ]
train
https://github.com/dauxio/daux.io/blob/d02ebe093bcf15bbe32aaa1712370c7c70165f8e/libs/Daux.php#L102-L115
dauxio/daux.io
libs/Daux.php
Daux.loadBaseConfiguration
protected function loadBaseConfiguration() { $this->options = new Config(); // Set the default configuration $this->options->merge([ 'docs_directory' => 'docs', 'valid_content_extensions' => ['md', 'markdown'], //Paths and tree 'mode' => $thi...
php
protected function loadBaseConfiguration() { $this->options = new Config(); // Set the default configuration $this->options->merge([ 'docs_directory' => 'docs', 'valid_content_extensions' => ['md', 'markdown'], //Paths and tree 'mode' => $thi...
[ "protected", "function", "loadBaseConfiguration", "(", ")", "{", "$", "this", "->", "options", "=", "new", "Config", "(", ")", ";", "// Set the default configuration", "$", "this", "->", "options", "->", "merge", "(", "[", "'docs_directory'", "=>", "'docs'", "...
Load and validate the global configuration @throws Exception
[ "Load", "and", "validate", "the", "global", "configuration" ]
train
https://github.com/dauxio/daux.io/blob/d02ebe093bcf15bbe32aaa1712370c7c70165f8e/libs/Daux.php#L145-L166
dauxio/daux.io
libs/Daux.php
Daux.generateTree
public function generateTree() { $this->options['valid_content_extensions'] = $this->getContentExtensions(); $this->tree = new Root($this->getParams()); Builder::build($this->tree, $this->options['ignore']); // Apply the language name as Section title if ($this->options->is...
php
public function generateTree() { $this->options['valid_content_extensions'] = $this->getContentExtensions(); $this->tree = new Root($this->getParams()); Builder::build($this->tree, $this->options['ignore']); // Apply the language name as Section title if ($this->options->is...
[ "public", "function", "generateTree", "(", ")", "{", "$", "this", "->", "options", "[", "'valid_content_extensions'", "]", "=", "$", "this", "->", "getContentExtensions", "(", ")", ";", "$", "this", "->", "tree", "=", "new", "Root", "(", "$", "this", "->...
Generate the tree that will be used
[ "Generate", "the", "tree", "that", "will", "be", "used" ]
train
https://github.com/dauxio/daux.io/blob/d02ebe093bcf15bbe32aaa1712370c7c70165f8e/libs/Daux.php#L193-L214
dauxio/daux.io
libs/Daux.php
Daux.getContentExtensions
public function getContentExtensions() { if (!empty($this->validExtensions)) { return $this->validExtensions; } return $this->validExtensions = $this->getContentTypeHandler()->getContentExtensions(); }
php
public function getContentExtensions() { if (!empty($this->validExtensions)) { return $this->validExtensions; } return $this->validExtensions = $this->getContentTypeHandler()->getContentExtensions(); }
[ "public", "function", "getContentExtensions", "(", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "validExtensions", ")", ")", "{", "return", "$", "this", "->", "validExtensions", ";", "}", "return", "$", "this", "->", "validExtensions", "=", ...
Get all content file extensions @return string[]
[ "Get", "all", "content", "file", "extensions" ]
train
https://github.com/dauxio/daux.io/blob/d02ebe093bcf15bbe32aaa1712370c7c70165f8e/libs/Daux.php#L372-L379
dauxio/daux.io
libs/Daux.php
Daux.write
public static function write($messages, $newline = false, $options = 0) { Daux::getOutput()->write($messages, $newline, $options); }
php
public static function write($messages, $newline = false, $options = 0) { Daux::getOutput()->write($messages, $newline, $options); }
[ "public", "static", "function", "write", "(", "$", "messages", ",", "$", "newline", "=", "false", ",", "$", "options", "=", "0", ")", "{", "Daux", "::", "getOutput", "(", ")", "->", "write", "(", "$", "messages", ",", "$", "newline", ",", "$", "opt...
Writes a message to the output. @param string|array $messages The message as an array of lines or a single string @param bool $newline Whether to add a newline @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self:...
[ "Writes", "a", "message", "to", "the", "output", "." ]
train
https://github.com/dauxio/daux.io/blob/d02ebe093bcf15bbe32aaa1712370c7c70165f8e/libs/Daux.php#L396-L398
dauxio/daux.io
libs/Format/Confluence/ContentTypes/Markdown/IndentedCodeRenderer.php
IndentedCodeRenderer.render
public function render(AbstractBlock $block, ElementRendererInterface $htmlRenderer, $inTightList = false) { if (!($block instanceof IndentedCode)) { throw new \InvalidArgumentException('Incompatible block type: ' . get_class($block)); } return $this->getHTMLElement($block->getS...
php
public function render(AbstractBlock $block, ElementRendererInterface $htmlRenderer, $inTightList = false) { if (!($block instanceof IndentedCode)) { throw new \InvalidArgumentException('Incompatible block type: ' . get_class($block)); } return $this->getHTMLElement($block->getS...
[ "public", "function", "render", "(", "AbstractBlock", "$", "block", ",", "ElementRendererInterface", "$", "htmlRenderer", ",", "$", "inTightList", "=", "false", ")", "{", "if", "(", "!", "(", "$", "block", "instanceof", "IndentedCode", ")", ")", "{", "throw"...
@param AbstractBlock $block @param HtmlRendererInterface $htmlRenderer @param bool $inTightList @return HtmlElement
[ "@param", "AbstractBlock", "$block", "@param", "HtmlRendererInterface", "$htmlRenderer", "@param", "bool", "$inTightList" ]
train
https://github.com/dauxio/daux.io/blob/d02ebe093bcf15bbe32aaa1712370c7c70165f8e/libs/Format/Confluence/ContentTypes/Markdown/IndentedCodeRenderer.php#L17-L24