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 |
|---|---|---|---|---|---|---|---|---|---|---|
amphp/byte-stream | lib/InMemoryStream.php | InMemoryStream.read | public function read(): Promise
{
if ($this->contents === null) {
return new Success;
}
$promise = new Success($this->contents);
$this->contents = null;
return $promise;
} | php | public function read(): Promise
{
if ($this->contents === null) {
return new Success;
}
$promise = new Success($this->contents);
$this->contents = null;
return $promise;
} | [
"public",
"function",
"read",
"(",
")",
":",
"Promise",
"{",
"if",
"(",
"$",
"this",
"->",
"contents",
"===",
"null",
")",
"{",
"return",
"new",
"Success",
";",
"}",
"$",
"promise",
"=",
"new",
"Success",
"(",
"$",
"this",
"->",
"contents",
")",
";... | Reads data from the stream.
@return Promise Resolves with the full contents or `null` if the stream has closed / already been consumed. | [
"Reads",
"data",
"from",
"the",
"stream",
"."
] | train | https://github.com/amphp/byte-stream/blob/d5cd42a76516f91672143fa5662df2fdaa4ebe57/lib/InMemoryStream.php#L28-L38 |
amphp/byte-stream | lib/Payload.php | Payload.read | final public function read(): Promise
{
if ($this->promise) {
throw new \Error("Cannot stream message data once a buffered message has been requested");
}
return $this->lastRead = $this->stream->read();
} | php | final public function read(): Promise
{
if ($this->promise) {
throw new \Error("Cannot stream message data once a buffered message has been requested");
}
return $this->lastRead = $this->stream->read();
} | [
"final",
"public",
"function",
"read",
"(",
")",
":",
"Promise",
"{",
"if",
"(",
"$",
"this",
"->",
"promise",
")",
"{",
"throw",
"new",
"\\",
"Error",
"(",
"\"Cannot stream message data once a buffered message has been requested\"",
")",
";",
"}",
"return",
"$"... | @inheritdoc
@throws \Error If a buffered message was requested by calling buffer(). | [
"@inheritdoc"
] | train | https://github.com/amphp/byte-stream/blob/d5cd42a76516f91672143fa5662df2fdaa4ebe57/lib/Payload.php#L60-L67 |
amphp/byte-stream | lib/Payload.php | Payload.buffer | final public function buffer(): Promise
{
if ($this->promise) {
return $this->promise;
}
return $this->promise = call(function () {
$buffer = '';
if ($this->lastRead && null === yield $this->lastRead) {
return $buffer;
}
... | php | final public function buffer(): Promise
{
if ($this->promise) {
return $this->promise;
}
return $this->promise = call(function () {
$buffer = '';
if ($this->lastRead && null === yield $this->lastRead) {
return $buffer;
}
... | [
"final",
"public",
"function",
"buffer",
"(",
")",
":",
"Promise",
"{",
"if",
"(",
"$",
"this",
"->",
"promise",
")",
"{",
"return",
"$",
"this",
"->",
"promise",
";",
"}",
"return",
"$",
"this",
"->",
"promise",
"=",
"call",
"(",
"function",
"(",
... | Buffers the entire message and resolves the returned promise then.
@return Promise<string> Resolves with the entire message contents. | [
"Buffers",
"the",
"entire",
"message",
"and",
"resolves",
"the",
"returned",
"promise",
"then",
"."
] | train | https://github.com/amphp/byte-stream/blob/d5cd42a76516f91672143fa5662df2fdaa4ebe57/lib/Payload.php#L74-L91 |
amphp/byte-stream | lib/ResourceInputStream.php | ResourceInputStream.close | public function close()
{
if ($this->resource) {
// Error suppression, as resource might already be closed
$meta = @\stream_get_meta_data($this->resource);
if ($meta && \strpos($meta["mode"], "+") !== false) {
@\stream_socket_shutdown($this->resource, \ST... | php | public function close()
{
if ($this->resource) {
// Error suppression, as resource might already be closed
$meta = @\stream_get_meta_data($this->resource);
if ($meta && \strpos($meta["mode"], "+") !== false) {
@\stream_socket_shutdown($this->resource, \ST... | [
"public",
"function",
"close",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"resource",
")",
"{",
"// Error suppression, as resource might already be closed",
"$",
"meta",
"=",
"@",
"\\",
"stream_get_meta_data",
"(",
"$",
"this",
"->",
"resource",
")",
";",
"i... | Closes the stream forcefully. Multiple `close()` calls are ignored.
@return void | [
"Closes",
"the",
"stream",
"forcefully",
".",
"Multiple",
"close",
"()",
"calls",
"are",
"ignored",
"."
] | train | https://github.com/amphp/byte-stream/blob/d5cd42a76516f91672143fa5662df2fdaa4ebe57/lib/ResourceInputStream.php#L162-L177 |
amphp/byte-stream | lib/ResourceInputStream.php | ResourceInputStream.free | private function free()
{
$this->readable = false;
if ($this->deferred !== null) {
$deferred = $this->deferred;
$this->deferred = null;
$deferred->resolve();
}
Loop::cancel($this->watcher);
if ($this->immediateWatcher !== null) {
... | php | private function free()
{
$this->readable = false;
if ($this->deferred !== null) {
$deferred = $this->deferred;
$this->deferred = null;
$deferred->resolve();
}
Loop::cancel($this->watcher);
if ($this->immediateWatcher !== null) {
... | [
"private",
"function",
"free",
"(",
")",
"{",
"$",
"this",
"->",
"readable",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"deferred",
"!==",
"null",
")",
"{",
"$",
"deferred",
"=",
"$",
"this",
"->",
"deferred",
";",
"$",
"this",
"->",
"deferre... | Nulls reference to resource, marks stream unreadable, and succeeds any pending read with null. | [
"Nulls",
"reference",
"to",
"resource",
"marks",
"stream",
"unreadable",
"and",
"succeeds",
"any",
"pending",
"read",
"with",
"null",
"."
] | train | https://github.com/amphp/byte-stream/blob/d5cd42a76516f91672143fa5662df2fdaa4ebe57/lib/ResourceInputStream.php#L182-L197 |
amphp/byte-stream | lib/ResourceOutputStream.php | ResourceOutputStream.close | public function close()
{
if ($this->resource) {
// Error suppression, as resource might already be closed
$meta = @\stream_get_meta_data($this->resource);
if ($meta && \strpos($meta["mode"], "+") !== false) {
@\stream_socket_shutdown($this->resource, \ST... | php | public function close()
{
if ($this->resource) {
// Error suppression, as resource might already be closed
$meta = @\stream_get_meta_data($this->resource);
if ($meta && \strpos($meta["mode"], "+") !== false) {
@\stream_socket_shutdown($this->resource, \ST... | [
"public",
"function",
"close",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"resource",
")",
"{",
"// Error suppression, as resource might already be closed",
"$",
"meta",
"=",
"@",
"\\",
"stream_get_meta_data",
"(",
"$",
"this",
"->",
"resource",
")",
";",
"i... | Closes the stream forcefully. Multiple `close()` calls are ignored.
@return void | [
"Closes",
"the",
"stream",
"forcefully",
".",
"Multiple",
"close",
"()",
"calls",
"are",
"ignored",
"."
] | train | https://github.com/amphp/byte-stream/blob/d5cd42a76516f91672143fa5662df2fdaa4ebe57/lib/ResourceOutputStream.php#L233-L247 |
amphp/byte-stream | lib/ResourceOutputStream.php | ResourceOutputStream.free | private function free()
{
$this->resource = null;
$this->writable = false;
if (!$this->writes->isEmpty()) {
$exception = new ClosedException("The socket was closed before writing completed");
do {
/** @var \Amp\Deferred $deferred */
li... | php | private function free()
{
$this->resource = null;
$this->writable = false;
if (!$this->writes->isEmpty()) {
$exception = new ClosedException("The socket was closed before writing completed");
do {
/** @var \Amp\Deferred $deferred */
li... | [
"private",
"function",
"free",
"(",
")",
"{",
"$",
"this",
"->",
"resource",
"=",
"null",
";",
"$",
"this",
"->",
"writable",
"=",
"false",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"writes",
"->",
"isEmpty",
"(",
")",
")",
"{",
"$",
"exception",
"... | Nulls reference to resource, marks stream unwritable, and fails any pending write. | [
"Nulls",
"reference",
"to",
"resource",
"marks",
"stream",
"unwritable",
"and",
"fails",
"any",
"pending",
"write",
"."
] | train | https://github.com/amphp/byte-stream/blob/d5cd42a76516f91672143fa5662df2fdaa4ebe57/lib/ResourceOutputStream.php#L252-L267 |
bowphp/tintin | src/Loader/Filesystem.php | Filesystem.getFileResolvedPath | public function getFileResolvedPath($filename)
{
$filename = str_replace('.', '/', $filename);
return $this->config['path'].'/'.$filename.'.'.$this->getExtension();
} | php | public function getFileResolvedPath($filename)
{
$filename = str_replace('.', '/', $filename);
return $this->config['path'].'/'.$filename.'.'.$this->getExtension();
} | [
"public",
"function",
"getFileResolvedPath",
"(",
"$",
"filename",
")",
"{",
"$",
"filename",
"=",
"str_replace",
"(",
"'.'",
",",
"'/'",
",",
"$",
"filename",
")",
";",
"return",
"$",
"this",
"->",
"config",
"[",
"'path'",
"]",
".",
"'/'",
".",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Loader/Filesystem.php#L31-L36 |
bowphp/tintin | src/Loader/Filesystem.php | Filesystem.getCacheFileResolvedPath | public function getCacheFileResolvedPath($filename)
{
if (!$this->exists($filename)) {
$this->failLoading($filename . ' file not exists !');
}
$md5 = sha1($filename);
$dirname = substr($md5, 0, 2);
return $this->getCachePath().'/'.$dirname.'/'.$md5.'.php';
... | php | public function getCacheFileResolvedPath($filename)
{
if (!$this->exists($filename)) {
$this->failLoading($filename . ' file not exists !');
}
$md5 = sha1($filename);
$dirname = substr($md5, 0, 2);
return $this->getCachePath().'/'.$dirname.'/'.$md5.'.php';
... | [
"public",
"function",
"getCacheFileResolvedPath",
"(",
"$",
"filename",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"exists",
"(",
"$",
"filename",
")",
")",
"{",
"$",
"this",
"->",
"failLoading",
"(",
"$",
"filename",
".",
"' file not exists !'",
")",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Loader/Filesystem.php#L41-L52 |
bowphp/tintin | src/Loader/Filesystem.php | Filesystem.isExpirated | public function isExpirated($filename)
{
if (!$this->isCached($filename)) {
return true;
}
$fileatime = filemtime(
$this->getFileResolvedPath($filename)
);
$cache_filetime = fileatime(
$this->getCacheFileResolvedPath($filename)
);... | php | public function isExpirated($filename)
{
if (!$this->isCached($filename)) {
return true;
}
$fileatime = filemtime(
$this->getFileResolvedPath($filename)
);
$cache_filetime = fileatime(
$this->getCacheFileResolvedPath($filename)
);... | [
"public",
"function",
"isExpirated",
"(",
"$",
"filename",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isCached",
"(",
"$",
"filename",
")",
")",
"{",
"return",
"true",
";",
"}",
"$",
"fileatime",
"=",
"filemtime",
"(",
"$",
"this",
"->",
"getFileR... | {@inheritdoc} | [
"{"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Loader/Filesystem.php#L81-L96 |
bowphp/tintin | src/Loader/Filesystem.php | Filesystem.cache | public function cache($filename, $config)
{
$md5 = sha1($filename);
$dirname = substr($md5, 0, 2);
if (! is_dir($this->getCachePath().'/'.$dirname)) {
mkdir($this->getCachePath().'/'.$dirname);
}
$path = $this->getCachePath().'/'.$dirname.'/'.$md5.'.php';
... | php | public function cache($filename, $config)
{
$md5 = sha1($filename);
$dirname = substr($md5, 0, 2);
if (! is_dir($this->getCachePath().'/'.$dirname)) {
mkdir($this->getCachePath().'/'.$dirname);
}
$path = $this->getCachePath().'/'.$dirname.'/'.$md5.'.php';
... | [
"public",
"function",
"cache",
"(",
"$",
"filename",
",",
"$",
"config",
")",
"{",
"$",
"md5",
"=",
"sha1",
"(",
"$",
"filename",
")",
";",
"$",
"dirname",
"=",
"substr",
"(",
"$",
"md5",
",",
"0",
",",
"2",
")",
";",
"if",
"(",
"!",
"is_dir",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Loader/Filesystem.php#L121-L134 |
bowphp/tintin | src/Stacker/StackManager.php | StackManager.includeFile | public function includeFile($filename, $data = [], $context = [])
{
$this->tintin->pushSharedData(array_merge($context, $data));
$data = $this->tintin->getSharedData();
return $this->tintin->render($filename, $data);
} | php | public function includeFile($filename, $data = [], $context = [])
{
$this->tintin->pushSharedData(array_merge($context, $data));
$data = $this->tintin->getSharedData();
return $this->tintin->render($filename, $data);
} | [
"public",
"function",
"includeFile",
"(",
"$",
"filename",
",",
"$",
"data",
"=",
"[",
"]",
",",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"tintin",
"->",
"pushSharedData",
"(",
"array_merge",
"(",
"$",
"context",
",",
"$",
"data",
... | Include a file to compile
@param string $filename
@param array $data
@param array $context
@return string | [
"Include",
"a",
"file",
"to",
"compile"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Stacker/StackManager.php#L51-L58 |
bowphp/tintin | src/Stacker/StackManager.php | StackManager.startStack | public function startStack($name, $content = null)
{
if (is_null($content)) {
ob_start();
}
$this->stacks[] = $name;
$this->pushes[$name] = $content;
} | php | public function startStack($name, $content = null)
{
if (is_null($content)) {
ob_start();
}
$this->stacks[] = $name;
$this->pushes[$name] = $content;
} | [
"public",
"function",
"startStack",
"(",
"$",
"name",
",",
"$",
"content",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"content",
")",
")",
"{",
"ob_start",
"(",
")",
";",
"}",
"$",
"this",
"->",
"stacks",
"[",
"]",
"=",
"$",
"name",
... | Open the stream for a #block
@param string $name
@param string $content
@return void | [
"Open",
"the",
"stream",
"for",
"a",
"#block"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Stacker/StackManager.php#L68-L77 |
bowphp/tintin | src/Stacker/StackManager.php | StackManager.endStack | public function endStack()
{
$stacks = array_pop($this->stacks);
$stacks = (array) $stacks;
foreach ($stacks as $block) {
$content = $this->pushes[$block];
if (is_null($content)) {
$content = $this->tintin->getCompiler()->compile(ob_get_clean());
... | php | public function endStack()
{
$stacks = array_pop($this->stacks);
$stacks = (array) $stacks;
foreach ($stacks as $block) {
$content = $this->pushes[$block];
if (is_null($content)) {
$content = $this->tintin->getCompiler()->compile(ob_get_clean());
... | [
"public",
"function",
"endStack",
"(",
")",
"{",
"$",
"stacks",
"=",
"array_pop",
"(",
"$",
"this",
"->",
"stacks",
")",
";",
"$",
"stacks",
"=",
"(",
"array",
")",
"$",
"stacks",
";",
"foreach",
"(",
"$",
"stacks",
"as",
"$",
"block",
")",
"{",
... | Closes the current flow
@return void | [
"Closes",
"the",
"current",
"flow"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Stacker/StackManager.php#L84-L99 |
bowphp/tintin | src/Stacker/StackManager.php | StackManager.getStack | public function getStack($name, $default = null)
{
if (array_key_exists($name, $this->pushes)) {
return $this->tintin->renderString(
$this->pushes[$name],
['__tintin' => $this->tintin]
);
}
return $default;
} | php | public function getStack($name, $default = null)
{
if (array_key_exists($name, $this->pushes)) {
return $this->tintin->renderString(
$this->pushes[$name],
['__tintin' => $this->tintin]
);
}
return $default;
} | [
"public",
"function",
"getStack",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"pushes",
")",
")",
"{",
"return",
"$",
"this",
"->",
"tintin",
"->",
"renderStri... | Allows you to retrieve the contents of a stack
@param string $name
@param string $default
@return mixed|null | [
"Allows",
"you",
"to",
"retrieve",
"the",
"contents",
"of",
"a",
"stack"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Stacker/StackManager.php#L109-L119 |
bowphp/tintin | src/Lexique/CompileIf.php | CompileIf.compileIfStack | protected function compileIfStack($expression)
{
foreach (['UnLess', 'If', 'ElseIf', 'ElseIfAlias', 'Else', 'EndIf'] as $token) {
$out = $this->{'compile'.$token}($expression);
if (strlen($out) !== 0) {
$expression = $out;
}
}
return $exp... | php | protected function compileIfStack($expression)
{
foreach (['UnLess', 'If', 'ElseIf', 'ElseIfAlias', 'Else', 'EndIf'] as $token) {
$out = $this->{'compile'.$token}($expression);
if (strlen($out) !== 0) {
$expression = $out;
}
}
return $exp... | [
"protected",
"function",
"compileIfStack",
"(",
"$",
"expression",
")",
"{",
"foreach",
"(",
"[",
"'UnLess'",
",",
"'If'",
",",
"'ElseIf'",
",",
"'ElseIfAlias'",
",",
"'Else'",
",",
"'EndIf'",
"]",
"as",
"$",
"token",
")",
"{",
"$",
"out",
"=",
"$",
"t... | Compile the if statement stack
@param string $expression
@return string | [
"Compile",
"the",
"if",
"statement",
"stack"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Lexique/CompileIf.php#L14-L25 |
bowphp/tintin | src/Lexique/CompileIf.php | CompileIf.compileEndIf | protected function compileEndIf($expression)
{
$output = preg_replace_callback('/\n*(#endif|#endunless)\n*/', function ($match) {
array_shift($match);
return "<?php endif; ?>";
}, $expression);
return $output == $expression ? '' : $output;
} | php | protected function compileEndIf($expression)
{
$output = preg_replace_callback('/\n*(#endif|#endunless)\n*/', function ($match) {
array_shift($match);
return "<?php endif; ?>";
}, $expression);
return $output == $expression ? '' : $output;
} | [
"protected",
"function",
"compileEndIf",
"(",
"$",
"expression",
")",
"{",
"$",
"output",
"=",
"preg_replace_callback",
"(",
"'/\\n*(#endif|#endunless)\\n*/'",
",",
"function",
"(",
"$",
"match",
")",
"{",
"array_shift",
"(",
"$",
"match",
")",
";",
"return",
... | Compile the #endif statement
@param string $expression
@return string | [
"Compile",
"the",
"#endif",
"statement"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Lexique/CompileIf.php#L126-L135 |
bowphp/tintin | src/Lexique/CompileEchos.php | CompileEchos.compileEchoStack | protected function compileEchoStack($expression)
{
foreach (['RawEcho', 'Echo'] as $token) {
$out = $this->{'compile'.$token}($expression);
if (strlen($out) !== 0) {
$expression = $out;
}
}
return $expression;
} | php | protected function compileEchoStack($expression)
{
foreach (['RawEcho', 'Echo'] as $token) {
$out = $this->{'compile'.$token}($expression);
if (strlen($out) !== 0) {
$expression = $out;
}
}
return $expression;
} | [
"protected",
"function",
"compileEchoStack",
"(",
"$",
"expression",
")",
"{",
"foreach",
"(",
"[",
"'RawEcho'",
",",
"'Echo'",
"]",
"as",
"$",
"token",
")",
"{",
"$",
"out",
"=",
"$",
"this",
"->",
"{",
"'compile'",
".",
"$",
"token",
"}",
"(",
"$",... | Compile the echo statement concept
@param string $expression
@return mixed | [
"Compile",
"the",
"echo",
"statement",
"concept"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Lexique/CompileEchos.php#L14-L25 |
bowphp/tintin | src/Lexique/CompileEchos.php | CompileEchos.compileEcho | protected function compileEcho($expression)
{
$regex = sprintf(
'/((?:%s\s*(.+?)\s*%s))+/',
$this->echo_tags[0],
$this->echo_tags[1]
);
$output = preg_replace_callback($regex, function ($match) {
array_shift($match);
return '<?php... | php | protected function compileEcho($expression)
{
$regex = sprintf(
'/((?:%s\s*(.+?)\s*%s))+/',
$this->echo_tags[0],
$this->echo_tags[1]
);
$output = preg_replace_callback($regex, function ($match) {
array_shift($match);
return '<?php... | [
"protected",
"function",
"compileEcho",
"(",
"$",
"expression",
")",
"{",
"$",
"regex",
"=",
"sprintf",
"(",
"'/((?:%s\\s*(.+?)\\s*%s))+/'",
",",
"$",
"this",
"->",
"echo_tags",
"[",
"0",
"]",
",",
"$",
"this",
"->",
"echo_tags",
"[",
"1",
"]",
")",
";",... | Compile the {{ $name }} statement
@param string $expression
@return string | [
"Compile",
"the",
"{{",
"$name",
"}}",
"statement"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Lexique/CompileEchos.php#L34-L49 |
bowphp/tintin | src/Lexique/CompileEchos.php | CompileEchos.compileRawEcho | protected function compileRawEcho($expression)
{
$regex = sprintf(
'/((?:%s\s*(.+?)\s*%s))+/',
$this->raw_echo_tags[0],
$this->raw_echo_tags[1]
);
$output = preg_replace_callback($regex, function ($match) {
array_shift($match);
re... | php | protected function compileRawEcho($expression)
{
$regex = sprintf(
'/((?:%s\s*(.+?)\s*%s))+/',
$this->raw_echo_tags[0],
$this->raw_echo_tags[1]
);
$output = preg_replace_callback($regex, function ($match) {
array_shift($match);
re... | [
"protected",
"function",
"compileRawEcho",
"(",
"$",
"expression",
")",
"{",
"$",
"regex",
"=",
"sprintf",
"(",
"'/((?:%s\\s*(.+?)\\s*%s))+/'",
",",
"$",
"this",
"->",
"raw_echo_tags",
"[",
"0",
"]",
",",
"$",
"this",
"->",
"raw_echo_tags",
"[",
"1",
"]",
... | Compile the {{{ $name }}} statement
@param string $expression
@return string | [
"Compile",
"the",
"{{{",
"$name",
"}}}",
"statement"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Lexique/CompileEchos.php#L58-L73 |
bowphp/tintin | src/Compiler.php | Compiler.compile | public function compile($data)
{
$data = preg_split('/\n|\r\n/', $data);
foreach ($data as $value) {
if (strlen($value) > 0) {
$value = $this->compileToken($value);
$this->result .= strlen($value) == 0 || $value == ' ' ? trim($value) : $value."\n";
... | php | public function compile($data)
{
$data = preg_split('/\n|\r\n/', $data);
foreach ($data as $value) {
if (strlen($value) > 0) {
$value = $this->compileToken($value);
$this->result .= strlen($value) == 0 || $value == ' ' ? trim($value) : $value."\n";
... | [
"public",
"function",
"compile",
"(",
"$",
"data",
")",
"{",
"$",
"data",
"=",
"preg_split",
"(",
"'/\\n|\\r\\n/'",
",",
"$",
"data",
")",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"value",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"value",
")",
... | Launch the compilation
@param array|string $data
@return string | [
"Launch",
"the",
"compilation"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Compiler.php#L113-L126 |
bowphp/tintin | src/Compiler.php | Compiler.compileToken | private function compileToken($value)
{
foreach ($this->tokens as $token) {
$out = $this->{'compile'.$token}($value);
if ($token == 'Comments') {
if (strlen($out) == 0) {
return "";
}
}
if (strlen($out) !==... | php | private function compileToken($value)
{
foreach ($this->tokens as $token) {
$out = $this->{'compile'.$token}($value);
if ($token == 'Comments') {
if (strlen($out) == 0) {
return "";
}
}
if (strlen($out) !==... | [
"private",
"function",
"compileToken",
"(",
"$",
"value",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"tokens",
"as",
"$",
"token",
")",
"{",
"$",
"out",
"=",
"$",
"this",
"->",
"{",
"'compile'",
".",
"$",
"token",
"}",
"(",
"$",
"value",
")",
"... | Compile All define token
@param string $value
@return string | [
"Compile",
"All",
"define",
"token"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Compiler.php#L135-L152 |
bowphp/tintin | src/Compiler.php | Compiler.resetCompilatorAccumulator | private function resetCompilatorAccumulator()
{
$result = $this->result.implode("\n", $this->footer);
$this->result = '';
$this->footer = [];
return $result;
} | php | private function resetCompilatorAccumulator()
{
$result = $this->result.implode("\n", $this->footer);
$this->result = '';
$this->footer = [];
return $result;
} | [
"private",
"function",
"resetCompilatorAccumulator",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"result",
".",
"implode",
"(",
"\"\\n\"",
",",
"$",
"this",
"->",
"footer",
")",
";",
"$",
"this",
"->",
"result",
"=",
"''",
";",
"$",
"this",
... | Reset Compilation accumulatior
@return string | [
"Reset",
"Compilation",
"accumulatior"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Compiler.php#L159-L168 |
bowphp/tintin | src/Compiler.php | Compiler.pushDirective | public function pushDirective($name, $handler, $broken = false)
{
if (in_array($name, $this->directivesProtected)) {
throw new DirectiveNotAllowException('The ' . $name . ' directive is not allow.');
}
$this->directives[$name] = compact('handler', 'broken');
} | php | public function pushDirective($name, $handler, $broken = false)
{
if (in_array($name, $this->directivesProtected)) {
throw new DirectiveNotAllowException('The ' . $name . ' directive is not allow.');
}
$this->directives[$name] = compact('handler', 'broken');
} | [
"public",
"function",
"pushDirective",
"(",
"$",
"name",
",",
"$",
"handler",
",",
"$",
"broken",
"=",
"false",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"directivesProtected",
")",
")",
"{",
"throw",
"new",
"DirectiveN... | Push more directive in template system
@param string $name
@param callable $handler
@param boolean $broken
@return void
@throws DirectiveNotAllowException | [
"Push",
"more",
"directive",
"in",
"template",
"system"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Compiler.php#L180-L187 |
bowphp/tintin | src/Lexique/CompileCustomDirective.php | CompileCustomDirective.compileCustomDirective | protected function compileCustomDirective($expression)
{
$output = preg_replace_callback($this->getCustomDirectivePartern(), function ($match) {
$name = $match[1];
if (!isset($this->directives[$name])) {
return null;
}
$directive = $this->dir... | php | protected function compileCustomDirective($expression)
{
$output = preg_replace_callback($this->getCustomDirectivePartern(), function ($match) {
$name = $match[1];
if (!isset($this->directives[$name])) {
return null;
}
$directive = $this->dir... | [
"protected",
"function",
"compileCustomDirective",
"(",
"$",
"expression",
")",
"{",
"$",
"output",
"=",
"preg_replace_callback",
"(",
"$",
"this",
"->",
"getCustomDirectivePartern",
"(",
")",
",",
"function",
"(",
"$",
"match",
")",
"{",
"$",
"name",
"=",
"... | Compile the custom statement
@param string $expression
@return string | [
"Compile",
"the",
"custom",
"statement"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Lexique/CompileCustomDirective.php#L14-L38 |
bowphp/tintin | src/Laravel/TintinServiceProvider.php | TintinServiceProvider.loadConfiguration | protected function loadConfiguration()
{
$config_path = __DIR__.'/../../config/tintin.php';
if (!$this->isLumen()) {
$this->publishes([
$config_path => config_path('view.php')
], 'config');
}
$this->mergeConfigFrom($config_path, 'view');
... | php | protected function loadConfiguration()
{
$config_path = __DIR__.'/../../config/tintin.php';
if (!$this->isLumen()) {
$this->publishes([
$config_path => config_path('view.php')
], 'config');
}
$this->mergeConfigFrom($config_path, 'view');
... | [
"protected",
"function",
"loadConfiguration",
"(",
")",
"{",
"$",
"config_path",
"=",
"__DIR__",
".",
"'/../../config/tintin.php'",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"isLumen",
"(",
")",
")",
"{",
"$",
"this",
"->",
"publishes",
"(",
"[",
"$",
"con... | Load the configuration files and allow them to be published.
@return void | [
"Load",
"the",
"configuration",
"files",
"and",
"allow",
"them",
"to",
"be",
"published",
"."
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Laravel/TintinServiceProvider.php#L53-L64 |
bowphp/tintin | src/Lexique/CompileComments.php | CompileComments.compileComments | protected function compileComments($value)
{
$pattern = sprintf('/%s(.*?)%s/', $this->comments[0], $this->comments[1]);
return preg_replace($pattern, '', $value);
} | php | protected function compileComments($value)
{
$pattern = sprintf('/%s(.*?)%s/', $this->comments[0], $this->comments[1]);
return preg_replace($pattern, '', $value);
} | [
"protected",
"function",
"compileComments",
"(",
"$",
"value",
")",
"{",
"$",
"pattern",
"=",
"sprintf",
"(",
"'/%s(.*?)%s/'",
",",
"$",
"this",
"->",
"comments",
"[",
"0",
"]",
",",
"$",
"this",
"->",
"comments",
"[",
"1",
"]",
")",
";",
"return",
"... | Compile the {# commentes #} statement
@param string $value
@return string | [
"Compile",
"the",
"{",
"#",
"commentes",
"#",
"}",
"statement"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Lexique/CompileComments.php#L14-L19 |
bowphp/tintin | src/Bow/TintinConfiguration.php | TintinConfiguration.create | public function create(Loader $config)
{
$this->container->bind('view', function () use ($config) {
View::pushEngine('tintin', TintinEngine::class);
View::configure($config);
return View::getInstance();
});
} | php | public function create(Loader $config)
{
$this->container->bind('view', function () use ($config) {
View::pushEngine('tintin', TintinEngine::class);
View::configure($config);
return View::getInstance();
});
} | [
"public",
"function",
"create",
"(",
"Loader",
"$",
"config",
")",
"{",
"$",
"this",
"->",
"container",
"->",
"bind",
"(",
"'view'",
",",
"function",
"(",
")",
"use",
"(",
"$",
"config",
")",
"{",
"View",
"::",
"pushEngine",
"(",
"'tintin'",
",",
"Ti... | {@inheritdoc}
@throws | [
"{"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Bow/TintinConfiguration.php#L16-L25 |
bowphp/tintin | src/Bow/TintinConfiguration.php | TintinConfiguration.run | public function run()
{
$view = $this->container->make('view');
$this->customizer($view->getTemplate()->getTemplate());
} | php | public function run()
{
$view = $this->container->make('view');
$this->customizer($view->getTemplate()->getTemplate());
} | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"container",
"->",
"make",
"(",
"'view'",
")",
";",
"$",
"this",
"->",
"customizer",
"(",
"$",
"view",
"->",
"getTemplate",
"(",
")",
"->",
"getTemplate",
"(",
")",
")... | {@inheritdoc}
@throws | [
"{"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Bow/TintinConfiguration.php#L31-L36 |
bowphp/tintin | src/Lexique/CompileExtends.php | CompileExtends.compileExtendsStack | protected function compileExtendsStack($expression)
{
foreach (['Block', 'EndBlock', 'Include', 'Inject', 'Extends'] as $token) {
$out = $this->{'compile'.$token}($expression);
if (strlen($out) !== 0) {
$expression = $out;
}
}
return $exp... | php | protected function compileExtendsStack($expression)
{
foreach (['Block', 'EndBlock', 'Include', 'Inject', 'Extends'] as $token) {
$out = $this->{'compile'.$token}($expression);
if (strlen($out) !== 0) {
$expression = $out;
}
}
return $exp... | [
"protected",
"function",
"compileExtendsStack",
"(",
"$",
"expression",
")",
"{",
"foreach",
"(",
"[",
"'Block'",
",",
"'EndBlock'",
",",
"'Include'",
",",
"'Inject'",
",",
"'Extends'",
"]",
"as",
"$",
"token",
")",
"{",
"$",
"out",
"=",
"$",
"this",
"->... | Compile the inherit concept statement
@param string $expression
@return string | [
"Compile",
"the",
"inherit",
"concept",
"statement"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Lexique/CompileExtends.php#L14-L25 |
bowphp/tintin | src/Lexique/CompileExtends.php | CompileExtends.compileBlock | protected function compileBlock($expression)
{
$output = preg_replace_callback(
"/\n*\#block\s*\((.+?)(?:,(.+?))?\)\n*/m",
function ($match) {
array_shift($match);
$content = null;
if (count($match) == 2) {
$conten... | php | protected function compileBlock($expression)
{
$output = preg_replace_callback(
"/\n*\#block\s*\((.+?)(?:,(.+?))?\)\n*/m",
function ($match) {
array_shift($match);
$content = null;
if (count($match) == 2) {
$conten... | [
"protected",
"function",
"compileBlock",
"(",
"$",
"expression",
")",
"{",
"$",
"output",
"=",
"preg_replace_callback",
"(",
"\"/\\n*\\#block\\s*\\((.+?)(?:,(.+?))?\\)\\n*/m\"",
",",
"function",
"(",
"$",
"match",
")",
"{",
"array_shift",
"(",
"$",
"match",
")",
"... | Compile the #block statement
@param string $expression
@return string | [
"Compile",
"the",
"#block",
"statement"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Lexique/CompileExtends.php#L34-L57 |
bowphp/tintin | src/Lexique/CompileExtends.php | CompileExtends.compileInclude | protected function compileInclude($expression)
{
$regex = "/\#include\s*\(((?:\n|\s|\t)*(?:.+?)(?:\n|\s|\t)*)\)/sm";
$output = preg_replace_callback($regex, function ($match) {
return "<?php echo \$__tintin->getStackManager()->includeFile({$match[1]}, ['__tintin' => \$__tintin]); ?>";
... | php | protected function compileInclude($expression)
{
$regex = "/\#include\s*\(((?:\n|\s|\t)*(?:.+?)(?:\n|\s|\t)*)\)/sm";
$output = preg_replace_callback($regex, function ($match) {
return "<?php echo \$__tintin->getStackManager()->includeFile({$match[1]}, ['__tintin' => \$__tintin]); ?>";
... | [
"protected",
"function",
"compileInclude",
"(",
"$",
"expression",
")",
"{",
"$",
"regex",
"=",
"\"/\\#include\\s*\\(((?:\\n|\\s|\\t)*(?:.+?)(?:\\n|\\s|\\t)*)\\)/sm\"",
";",
"$",
"output",
"=",
"preg_replace_callback",
"(",
"$",
"regex",
",",
"function",
"(",
"$",
"ma... | Compile the #include statement
@param string $expression
@return string | [
"Compile",
"the",
"#include",
"statement"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Lexique/CompileExtends.php#L82-L91 |
bowphp/tintin | src/Lexique/CompileExtends.php | CompileExtends.compileExtends | protected function compileExtends($expression)
{
$regex = "/\#extends\s*\(((?:\n|\s|\t)*(?:.+?)(?:\n|\s|\t)*)\)/sm";
if (preg_match($regex, $expression, $match)) {
$this->footer[] = "<?php echo \$__tintin->getStackManager()->includeFile({$match[1]}, ['__tintin' => \$__tintin]); ?>";
... | php | protected function compileExtends($expression)
{
$regex = "/\#extends\s*\(((?:\n|\s|\t)*(?:.+?)(?:\n|\s|\t)*)\)/sm";
if (preg_match($regex, $expression, $match)) {
$this->footer[] = "<?php echo \$__tintin->getStackManager()->includeFile({$match[1]}, ['__tintin' => \$__tintin]); ?>";
... | [
"protected",
"function",
"compileExtends",
"(",
"$",
"expression",
")",
"{",
"$",
"regex",
"=",
"\"/\\#extends\\s*\\(((?:\\n|\\s|\\t)*(?:.+?)(?:\\n|\\s|\\t)*)\\)/sm\"",
";",
"if",
"(",
"preg_match",
"(",
"$",
"regex",
",",
"$",
"expression",
",",
"$",
"match",
")",
... | Compile the #extends statement
@param string $expression
@return string | [
"Compile",
"the",
"#extends",
"statement"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Lexique/CompileExtends.php#L100-L111 |
bowphp/tintin | src/Lexique/CompileExtends.php | CompileExtends.compileInject | protected function compileInject($expression)
{
$regex = "/\#inject\s*\(((?:\n|\s|\t)*(?:.+?)(?:\n|\s|\t)*)\)/sm";
$output = preg_replace_callback($regex, function ($match) {
return "<?php echo \$__tintin->getStackManager()->getStack({$match[1]}); ?>";
}, $expression);
... | php | protected function compileInject($expression)
{
$regex = "/\#inject\s*\(((?:\n|\s|\t)*(?:.+?)(?:\n|\s|\t)*)\)/sm";
$output = preg_replace_callback($regex, function ($match) {
return "<?php echo \$__tintin->getStackManager()->getStack({$match[1]}); ?>";
}, $expression);
... | [
"protected",
"function",
"compileInject",
"(",
"$",
"expression",
")",
"{",
"$",
"regex",
"=",
"\"/\\#inject\\s*\\(((?:\\n|\\s|\\t)*(?:.+?)(?:\\n|\\s|\\t)*)\\)/sm\"",
";",
"$",
"output",
"=",
"preg_replace_callback",
"(",
"$",
"regex",
",",
"function",
"(",
"$",
"matc... | Compile the #inject statement
@param string $expression
@return string | [
"Compile",
"the",
"#inject",
"statement"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Lexique/CompileExtends.php#L120-L129 |
bowphp/tintin | src/Tintin.php | Tintin.render | public function render($template, array $data = [])
{
if (is_null($this->loader)) {
return $this->renderString($template, $data);
}
if (! $this->loader->exists($template)) {
$this->loader->failLoading($template .' not found');
}
$this->pushSharedData... | php | public function render($template, array $data = [])
{
if (is_null($this->loader)) {
return $this->renderString($template, $data);
}
if (! $this->loader->exists($template)) {
$this->loader->failLoading($template .' not found');
}
$this->pushSharedData... | [
"public",
"function",
"render",
"(",
"$",
"template",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"loader",
")",
")",
"{",
"return",
"$",
"this",
"->",
"renderString",
"(",
"$",
"template",
",",... | Make template rendering
@param string $template
@param array $data
@return string
@throws | [
"Make",
"template",
"rendering"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Tintin.php#L101-L143 |
bowphp/tintin | src/Tintin.php | Tintin.renderString | public function renderString($template, array $data = [])
{
return $this->executePlainRendering(
trim($this->compiler->compile($template)),
array_merge($data, ['__tintin' => $this])
);
} | php | public function renderString($template, array $data = [])
{
return $this->executePlainRendering(
trim($this->compiler->compile($template)),
array_merge($data, ['__tintin' => $this])
);
} | [
"public",
"function",
"renderString",
"(",
"$",
"template",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"executePlainRendering",
"(",
"trim",
"(",
"$",
"this",
"->",
"compiler",
"->",
"compile",
"(",
"$",
"template",
... | Compile simple template code
@param string $template
@param array $data
@return string | [
"Compile",
"simple",
"template",
"code"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Tintin.php#L153-L159 |
bowphp/tintin | src/Tintin.php | Tintin.executePlainRendering | private function executePlainRendering($content, $data)
{
$this->obFlushAndStar();
extract($data);
$filename = $this->createTmpFile($content);
require $filename;
@unlink($filename);
return $this->obGetContent();
} | php | private function executePlainRendering($content, $data)
{
$this->obFlushAndStar();
extract($data);
$filename = $this->createTmpFile($content);
require $filename;
@unlink($filename);
return $this->obGetContent();
} | [
"private",
"function",
"executePlainRendering",
"(",
"$",
"content",
",",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"obFlushAndStar",
"(",
")",
";",
"extract",
"(",
"$",
"data",
")",
";",
"$",
"filename",
"=",
"$",
"this",
"->",
"createTmpFile",
"(",
"... | Execute plain rendering code
@param string $content
@param array $data
@return string | [
"Execute",
"plain",
"rendering",
"code"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Tintin.php#L169-L182 |
bowphp/tintin | src/Tintin.php | Tintin.createTmpFile | private function createTmpFile($content)
{
$tmp_dir = sys_get_temp_dir().'/__tintin';
if (!is_dir($tmp_dir)) {
mkdir($tmp_dir, 0777);
}
$file = $tmp_dir.'/'.md5(microtime(true)).'.php';
file_put_contents($file, $content);
return $file;
} | php | private function createTmpFile($content)
{
$tmp_dir = sys_get_temp_dir().'/__tintin';
if (!is_dir($tmp_dir)) {
mkdir($tmp_dir, 0777);
}
$file = $tmp_dir.'/'.md5(microtime(true)).'.php';
file_put_contents($file, $content);
return $file;
} | [
"private",
"function",
"createTmpFile",
"(",
"$",
"content",
")",
"{",
"$",
"tmp_dir",
"=",
"sys_get_temp_dir",
"(",
")",
".",
"'/__tintin'",
";",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"tmp_dir",
")",
")",
"{",
"mkdir",
"(",
"$",
"tmp_dir",
",",
"0777",
... | Create tmp compile file
@param string $content
@return string | [
"Create",
"tmp",
"compile",
"file"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Tintin.php#L213-L226 |
bowphp/tintin | src/Tintin.php | Tintin.directive | public function directive($name, $handler, $broken = false)
{
$this->compiler->pushDirective($name, $handler, $broken);
} | php | public function directive($name, $handler, $broken = false)
{
$this->compiler->pushDirective($name, $handler, $broken);
} | [
"public",
"function",
"directive",
"(",
"$",
"name",
",",
"$",
"handler",
",",
"$",
"broken",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"compiler",
"->",
"pushDirective",
"(",
"$",
"name",
",",
"$",
"handler",
",",
"$",
"broken",
")",
";",
"}"
] | Push more directive in template system
@param string $name
@param callable $handler
@param boolean $broken
@return mixed
@throws DirectiveNotAllowException | [
"Push",
"more",
"directive",
"in",
"template",
"system"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Tintin.php#L248-L251 |
bowphp/tintin | src/Bow/TintinEngine.php | TintinEngine.render | public function render($filename, array $data = [])
{
$filename = $this->checkParseFile($filename, false);
return $this->template->render($filename, $data);
} | php | public function render($filename, array $data = [])
{
$filename = $this->checkParseFile($filename, false);
return $this->template->render($filename, $data);
} | [
"public",
"function",
"render",
"(",
"$",
"filename",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"filename",
"=",
"$",
"this",
"->",
"checkParseFile",
"(",
"$",
"filename",
",",
"false",
")",
";",
"return",
"$",
"this",
"->",
"template"... | {@inheritdoc}
@throws | [
"{"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Bow/TintinEngine.php#L50-L55 |
bowphp/tintin | src/Lexique/CompileRawPhp.php | CompileRawPhp.compileRawPhp | protected function compileRawPhp($expression)
{
$expression = trim($expression);
$output = preg_replace_callback(
'/\n*\#raw\s*(\n*(?:.+?)\n*)\#endraw\n*/m',
function ($match) {
array_shift($match);
return "<?php ".trim($match[0])." ?>";
... | php | protected function compileRawPhp($expression)
{
$expression = trim($expression);
$output = preg_replace_callback(
'/\n*\#raw\s*(\n*(?:.+?)\n*)\#endraw\n*/m',
function ($match) {
array_shift($match);
return "<?php ".trim($match[0])." ?>";
... | [
"protected",
"function",
"compileRawPhp",
"(",
"$",
"expression",
")",
"{",
"$",
"expression",
"=",
"trim",
"(",
"$",
"expression",
")",
";",
"$",
"output",
"=",
"preg_replace_callback",
"(",
"'/\\n*\\#raw\\s*(\\n*(?:.+?)\\n*)\\#endraw\\n*/m'",
",",
"function",
"(",... | Compile the #raw...#endraw statement
@param string $expression
@return string | [
"Compile",
"the",
"#raw",
"...",
"#endraw",
"statement"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Lexique/CompileRawPhp.php#L14-L29 |
bowphp/tintin | src/Lexique/CompileLoop.php | CompileLoop.compileLoopStack | protected function compileLoopStack($expression)
{
foreach ($this->getLoopStack() as $token) {
$out = $this->{'compile'.$token}($expression);
if (strlen($out) !== 0) {
$expression = $out;
}
}
return $expression;
} | php | protected function compileLoopStack($expression)
{
foreach ($this->getLoopStack() as $token) {
$out = $this->{'compile'.$token}($expression);
if (strlen($out) !== 0) {
$expression = $out;
}
}
return $expression;
} | [
"protected",
"function",
"compileLoopStack",
"(",
"$",
"expression",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getLoopStack",
"(",
")",
"as",
"$",
"token",
")",
"{",
"$",
"out",
"=",
"$",
"this",
"->",
"{",
"'compile'",
".",
"$",
"token",
"}",
"(... | Compile the loop statement stack
@param string $expression
@return string | [
"Compile",
"the",
"loop",
"statement",
"stack"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Lexique/CompileLoop.php#L33-L44 |
bowphp/tintin | src/Lexique/CompileLoop.php | CompileLoop.compileLoop | private function compileLoop($expression, $lexic, $o_lexic)
{
$regex = sprintf($this->condition_patern, $lexic);
$output = preg_replace_callback($regex, function ($match) use ($o_lexic) {
array_shift($match);
return "<?php $o_lexic ({$match[1]}): ?>";
}, $expression... | php | private function compileLoop($expression, $lexic, $o_lexic)
{
$regex = sprintf($this->condition_patern, $lexic);
$output = preg_replace_callback($regex, function ($match) use ($o_lexic) {
array_shift($match);
return "<?php $o_lexic ({$match[1]}): ?>";
}, $expression... | [
"private",
"function",
"compileLoop",
"(",
"$",
"expression",
",",
"$",
"lexic",
",",
"$",
"o_lexic",
")",
"{",
"$",
"regex",
"=",
"sprintf",
"(",
"$",
"this",
"->",
"condition_patern",
",",
"$",
"lexic",
")",
";",
"$",
"output",
"=",
"preg_replace_callb... | Compile the #loop statement
@param string $expression
@param string $lexic
@param string $o_lexic
@return string | [
"Compile",
"the",
"#loop",
"statement"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Lexique/CompileLoop.php#L55-L66 |
bowphp/tintin | src/Lexique/CompileLoop.php | CompileLoop.compileEndLoop | private function compileEndLoop($expression, $lexic, $o_lexic)
{
$output = preg_replace_callback("/\n*$lexic\n*/", function () use ($o_lexic) {
return "<?php $o_lexic; ?>";
}, $expression);
return $output == $expression ? '' : $output;
} | php | private function compileEndLoop($expression, $lexic, $o_lexic)
{
$output = preg_replace_callback("/\n*$lexic\n*/", function () use ($o_lexic) {
return "<?php $o_lexic; ?>";
}, $expression);
return $output == $expression ? '' : $output;
} | [
"private",
"function",
"compileEndLoop",
"(",
"$",
"expression",
",",
"$",
"lexic",
",",
"$",
"o_lexic",
")",
"{",
"$",
"output",
"=",
"preg_replace_callback",
"(",
"\"/\\n*$lexic\\n*/\"",
",",
"function",
"(",
")",
"use",
"(",
"$",
"o_lexic",
")",
"{",
"r... | Compile the #endloop statement
@param string $expression
@param string $lexic
@param string $o_lexic
@return string | [
"Compile",
"the",
"#endloop",
"statement"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Lexique/CompileLoop.php#L77-L84 |
bowphp/tintin | src/Lexique/CompileLoop.php | CompileLoop.compileBreaker | private function compileBreaker($expression, $lexic, $o_lexic)
{
$output = preg_replace_callback(
"/($lexic *(\(.+?\))|$lexic)/s",
function ($match) use ($lexic, $o_lexic) {
array_shift($match);
if (trim($match[0]) == $lexic) {
ret... | php | private function compileBreaker($expression, $lexic, $o_lexic)
{
$output = preg_replace_callback(
"/($lexic *(\(.+?\))|$lexic)/s",
function ($match) use ($lexic, $o_lexic) {
array_shift($match);
if (trim($match[0]) == $lexic) {
ret... | [
"private",
"function",
"compileBreaker",
"(",
"$",
"expression",
",",
"$",
"lexic",
",",
"$",
"o_lexic",
")",
"{",
"$",
"output",
"=",
"preg_replace_callback",
"(",
"\"/($lexic *(\\(.+?\\))|$lexic)/s\"",
",",
"function",
"(",
"$",
"match",
")",
"use",
"(",
"$"... | Compile the loop breaker statement
@param string $expression
@param string $lexic
@param string $o_lexic
@return string | [
"Compile",
"the",
"loop",
"breaker",
"statement"
] | train | https://github.com/bowphp/tintin/blob/80d7a4d18d1fac01448b97c7d9a9e575f32927df/src/Lexique/CompileLoop.php#L95-L112 |
koolphp/koolreport | src/core/AssetManager.php | AssetManager.publish | public function publish($assetFolder)
{
$widgetSourceAssetPath = dirname(Utility::getClassPath($this->widget))
."/".$assetFolder;
if (!is_dir($widgetSourceAssetPath)) {
throw new \Exception("Widget's assets folder is not existed");
}
$widgetSourceAssetPat... | php | public function publish($assetFolder)
{
$widgetSourceAssetPath = dirname(Utility::getClassPath($this->widget))
."/".$assetFolder;
if (!is_dir($widgetSourceAssetPath)) {
throw new \Exception("Widget's assets folder is not existed");
}
$widgetSourceAssetPat... | [
"public",
"function",
"publish",
"(",
"$",
"assetFolder",
")",
"{",
"$",
"widgetSourceAssetPath",
"=",
"dirname",
"(",
"Utility",
"::",
"getClassPath",
"(",
"$",
"this",
"->",
"widget",
")",
")",
".",
"\"/\"",
".",
"$",
"assetFolder",
";",
"if",
"(",
"!"... | Publish an asset folder to public place
It will ask the report resource manager to check if widget resource
folder is available at public place. If not, then the resource manager
will copy local asset folder of widget to public place
@param string $assetFolder The local asset folder of a widget
@return null | [
"Publish",
"an",
"asset",
"folder",
"to",
"public",
"place"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/AssetManager.php#L96-L108 |
koolphp/koolreport | src/processes/CopyColumn.php | CopyColumn.onInput | public function onInput($data)
{
//Process data here
foreach ($this->params as $copy => $original) {
$data[$copy] = $data[$original];
}
$this->next($data);
} | php | public function onInput($data)
{
//Process data here
foreach ($this->params as $copy => $original) {
$data[$copy] = $data[$original];
}
$this->next($data);
} | [
"public",
"function",
"onInput",
"(",
"$",
"data",
")",
"{",
"//Process data here",
"foreach",
"(",
"$",
"this",
"->",
"params",
"as",
"$",
"copy",
"=>",
"$",
"original",
")",
"{",
"$",
"data",
"[",
"$",
"copy",
"]",
"=",
"$",
"data",
"[",
"$",
"or... | Handle on data input
@param array $data The input data row
@return null | [
"Handle",
"on",
"data",
"input"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/processes/CopyColumn.php#L59-L66 |
koolphp/koolreport | src/core/ProcessGroup.php | ProcessGroup.receiveMeta | public function receiveMeta($metaData,$source)
{
$this->streamingSource = $source;
$this->metaData = $metaData;
$this->startProcess->receiveMeta($metaData, $this);
} | php | public function receiveMeta($metaData,$source)
{
$this->streamingSource = $source;
$this->metaData = $metaData;
$this->startProcess->receiveMeta($metaData, $this);
} | [
"public",
"function",
"receiveMeta",
"(",
"$",
"metaData",
",",
"$",
"source",
")",
"{",
"$",
"this",
"->",
"streamingSource",
"=",
"$",
"source",
";",
"$",
"this",
"->",
"metaData",
"=",
"$",
"metaData",
";",
"$",
"this",
"->",
"startProcess",
"->",
"... | Receive the meta data from source
@param array $metaData Metadata sent from source nodes
@param Process $source The source process
@return null | [
"Receive",
"the",
"meta",
"data",
"from",
"source"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/ProcessGroup.php#L120-L125 |
koolphp/koolreport | src/core/Utility.php | Utility.guessType | static function guessType($value)
{
$map = array(
"float"=>"number",
"double"=>"number",
"int"=>"number",
"integer"=>"number",
"bool"=>"number",
"numeric"=>"number",
"string"=>"string",
);
$type = strtolower... | php | static function guessType($value)
{
$map = array(
"float"=>"number",
"double"=>"number",
"int"=>"number",
"integer"=>"number",
"bool"=>"number",
"numeric"=>"number",
"string"=>"string",
);
$type = strtolower... | [
"static",
"function",
"guessType",
"(",
"$",
"value",
")",
"{",
"$",
"map",
"=",
"array",
"(",
"\"float\"",
"=>",
"\"number\"",
",",
"\"double\"",
"=>",
"\"number\"",
",",
"\"int\"",
"=>",
"\"number\"",
",",
"\"integer\"",
"=>",
"\"number\"",
",",
"\"bool\""... | Try to get type of a value
@param mixed $value A value needed to guess type
@return string Possible type of a value | [
"Try",
"to",
"get",
"type",
"of",
"a",
"value"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Utility.php#L53-L72 |
koolphp/koolreport | src/core/Utility.php | Utility.format | static function format($value,$format)
{
$f = Utility::get($format, "format", true);
if ($f===false) {
return $value;
}
$type = Utility::get($format, "type", "unknown");
switch($type)
{
case "number":
$decimals = Utility::get($... | php | static function format($value,$format)
{
$f = Utility::get($format, "format", true);
if ($f===false) {
return $value;
}
$type = Utility::get($format, "type", "unknown");
switch($type)
{
case "number":
$decimals = Utility::get($... | [
"static",
"function",
"format",
"(",
"$",
"value",
",",
"$",
"format",
")",
"{",
"$",
"f",
"=",
"Utility",
"::",
"get",
"(",
"$",
"format",
",",
"\"format\"",
",",
"true",
")",
";",
"if",
"(",
"$",
"f",
"===",
"false",
")",
"{",
"return",
"$",
... | Format the value with provided format settings
@param mixed $value Value we want to format
@param array $format The format settings of the value
@return string Formatted value in string | [
"Format",
"the",
"value",
"with",
"provided",
"format",
"settings"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Utility.php#L106-L175 |
koolphp/koolreport | src/core/Utility.php | Utility.mark_js_function | static function mark_js_function(&$obj,&$marks=array())
{
foreach ($obj as $k=>&$v) {
switch(gettype($v))
{
case "object":
case "array":
Utility::mark_js_function($v, $marks);
break;
case "string":
$t... | php | static function mark_js_function(&$obj,&$marks=array())
{
foreach ($obj as $k=>&$v) {
switch(gettype($v))
{
case "object":
case "array":
Utility::mark_js_function($v, $marks);
break;
case "string":
$t... | [
"static",
"function",
"mark_js_function",
"(",
"&",
"$",
"obj",
",",
"&",
"$",
"marks",
"=",
"array",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"obj",
"as",
"$",
"k",
"=>",
"&",
"$",
"v",
")",
"{",
"switch",
"(",
"gettype",
"(",
"$",
"v",
")",
... | Traverse through the structure of object and find the js function
@param object $obj The object
@param array $marks The mark
@return array The new marks | [
"Traverse",
"through",
"the",
"structure",
"of",
"object",
"and",
"find",
"the",
"js",
"function"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Utility.php#L200-L222 |
koolphp/koolreport | src/core/Utility.php | Utility.jsonEncode | static function jsonEncode($object,$option=0)
{
$marks = Utility::mark_js_function($object);
$text = json_encode($object, $option);
foreach ($marks as $i=>$js) {
$text = str_replace("\"--js($i)\"", $js, $text);
}
return $text;
} | php | static function jsonEncode($object,$option=0)
{
$marks = Utility::mark_js_function($object);
$text = json_encode($object, $option);
foreach ($marks as $i=>$js) {
$text = str_replace("\"--js($i)\"", $js, $text);
}
return $text;
} | [
"static",
"function",
"jsonEncode",
"(",
"$",
"object",
",",
"$",
"option",
"=",
"0",
")",
"{",
"$",
"marks",
"=",
"Utility",
"::",
"mark_js_function",
"(",
"$",
"object",
")",
";",
"$",
"text",
"=",
"json_encode",
"(",
"$",
"object",
",",
"$",
"opti... | Get the json of an object
@param object $object The object needs to be encoded
@param int $option The json_encode() additional option
@return string The json string of objects | [
"Get",
"the",
"json",
"of",
"an",
"object"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Utility.php#L232-L240 |
koolphp/koolreport | src/core/Utility.php | Utility.isAssoc | static function isAssoc($arr)
{
if (gettype($arr)!="array") {
return false;
}
if ($arr===null || $arr===array()) {
return false;
}
if (array_keys($arr)===range(0, count($arr)-1)) {
return false;
}
return true;
} | php | static function isAssoc($arr)
{
if (gettype($arr)!="array") {
return false;
}
if ($arr===null || $arr===array()) {
return false;
}
if (array_keys($arr)===range(0, count($arr)-1)) {
return false;
}
return true;
} | [
"static",
"function",
"isAssoc",
"(",
"$",
"arr",
")",
"{",
"if",
"(",
"gettype",
"(",
"$",
"arr",
")",
"!=",
"\"array\"",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
"arr",
"===",
"null",
"||",
"$",
"arr",
"===",
"array",
"(",
")",
... | Get wether an array is an associate array
@param array $arr The array that you want to test
@return bool Whether the array is an associate array | [
"Get",
"wether",
"an",
"array",
"is",
"an",
"associate",
"array"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Utility.php#L249-L261 |
koolphp/koolreport | src/core/Utility.php | Utility.get | static function get($arr,$keys,$default=null)
{
if (! is_array($arr)) {
return $default;
}
if (is_array($keys) and count($keys) > 0) {
foreach ($keys as $key) {
$arr = self::get($arr, $key, $default);
}
return $arr;
}
... | php | static function get($arr,$keys,$default=null)
{
if (! is_array($arr)) {
return $default;
}
if (is_array($keys) and count($keys) > 0) {
foreach ($keys as $key) {
$arr = self::get($arr, $key, $default);
}
return $arr;
}
... | [
"static",
"function",
"get",
"(",
"$",
"arr",
",",
"$",
"keys",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"arr",
")",
")",
"{",
"return",
"$",
"default",
";",
"}",
"if",
"(",
"is_array",
"(",
"$",
"keys",... | Get value from array with keys, return default if not found
The function support the list of keys in order as well
@param array $arr The array that you want to test
@param mixed $keys Could be name of key or an array containing list of key path
@param mixed $default Default value if no value for key is found
... | [
"Get",
"value",
"from",
"array",
"with",
"keys",
"return",
"default",
"if",
"not",
"found"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Utility.php#L274-L289 |
koolphp/koolreport | src/core/Utility.php | Utility.init | static function init(&$arr, $key, $default = null)
{
if (! isset($arr[$key])) {
$arr[$key] = $default;
}
return $arr[$key];
} | php | static function init(&$arr, $key, $default = null)
{
if (! isset($arr[$key])) {
$arr[$key] = $default;
}
return $arr[$key];
} | [
"static",
"function",
"init",
"(",
"&",
"$",
"arr",
",",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"arr",
"[",
"$",
"key",
"]",
")",
")",
"{",
"$",
"arr",
"[",
"$",
"key",
"]",
"=",
"$",
"d... | Init an key value inside an array
@param array $arr The array
@param string $key The key
@param mixed $default The default value to fill if key is not found
@return array The array | [
"Init",
"an",
"key",
"value",
"inside",
"an",
"array"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Utility.php#L299-L305 |
koolphp/koolreport | src/core/Utility.php | Utility.getArray | static function getArray($arr,$key,$default=array())
{
$value = Utility::get($arr, $key);
return ($value!=null)?explode(',', $value):$default;
} | php | static function getArray($arr,$key,$default=array())
{
$value = Utility::get($arr, $key);
return ($value!=null)?explode(',', $value):$default;
} | [
"static",
"function",
"getArray",
"(",
"$",
"arr",
",",
"$",
"key",
",",
"$",
"default",
"=",
"array",
"(",
")",
")",
"{",
"$",
"value",
"=",
"Utility",
"::",
"get",
"(",
"$",
"arr",
",",
"$",
"key",
")",
";",
"return",
"(",
"$",
"value",
"!=",... | Get array if the value inside an array is a string
@param array $arr The array
@param string $key The key
@param mixed $default The default value
@return array Return array result | [
"Get",
"array",
"if",
"the",
"value",
"inside",
"an",
"array",
"is",
"a",
"string"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Utility.php#L316-L320 |
koolphp/koolreport | src/core/Utility.php | Utility.filterIn | static function filterIn($arr,$keys)
{
$keys = explode(",", $keys);
$result = array();
foreach ($arr as $key=>$value) {
if (in_array($key, $keys)) {
$result[$key] = $value;
}
}
return $result;
} | php | static function filterIn($arr,$keys)
{
$keys = explode(",", $keys);
$result = array();
foreach ($arr as $key=>$value) {
if (in_array($key, $keys)) {
$result[$key] = $value;
}
}
return $result;
} | [
"static",
"function",
"filterIn",
"(",
"$",
"arr",
",",
"$",
"keys",
")",
"{",
"$",
"keys",
"=",
"explode",
"(",
"\",\"",
",",
"$",
"keys",
")",
";",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"arr",
"as",
"$",
"key",
"=>"... | Get only some of the keys from an array
@param array $arr The array
@param string $keys List of keys in string and separate with comma(,)
@return array The filtered array with only specified keys | [
"Get",
"only",
"some",
"of",
"the",
"keys",
"from",
"an",
"array"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Utility.php#L330-L340 |
koolphp/koolreport | src/core/Utility.php | Utility.strReplace | static function strReplace($str,$params)
{
foreach ($params as $k=>$v) {
$str = str_replace($k, $v, $str);
}
return $str;
} | php | static function strReplace($str,$params)
{
foreach ($params as $k=>$v) {
$str = str_replace($k, $v, $str);
}
return $str;
} | [
"static",
"function",
"strReplace",
"(",
"$",
"str",
",",
"$",
"params",
")",
"{",
"foreach",
"(",
"$",
"params",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"$",
"str",
"=",
"str_replace",
"(",
"$",
"k",
",",
"$",
"v",
",",
"$",
"str",
")",
";... | A mass string replace with parameters
@param string $str The template string
@param array $params An associate array containing key value to replace
@return string The string that is replaced key with value | [
"A",
"mass",
"string",
"replace",
"with",
"parameters"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Utility.php#L369-L375 |
koolphp/koolreport | src/core/Utility.php | Utility.str_replace_first | static function str_replace_first($from, $to, $content)
{
$from = '/'.preg_quote($from, '/').'/';
return preg_replace($from, $to, $content, 1);
} | php | static function str_replace_first($from, $to, $content)
{
$from = '/'.preg_quote($from, '/').'/';
return preg_replace($from, $to, $content, 1);
} | [
"static",
"function",
"str_replace_first",
"(",
"$",
"from",
",",
"$",
"to",
",",
"$",
"content",
")",
"{",
"$",
"from",
"=",
"'/'",
".",
"preg_quote",
"(",
"$",
"from",
",",
"'/'",
")",
".",
"'/'",
";",
"return",
"preg_replace",
"(",
"$",
"from",
... | Return string with replaced first occurerence only
@param string $from The needle
@param string $to The replacement
@param string $content The haystack
@return string String with replaced first occurerence only | [
"Return",
"string",
"with",
"replaced",
"first",
"occurerence",
"only"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Utility.php#L413-L417 |
koolphp/koolreport | src/core/Utility.php | Utility.getDocumentRoot | static function getDocumentRoot()
{
//The old method is to use the document_root from $_SERVER
//Howerver in some hosting the document root is not the same
//with the root folder of the website, so we add backup with
//second way to calculate the document root with script_name
... | php | static function getDocumentRoot()
{
//The old method is to use the document_root from $_SERVER
//Howerver in some hosting the document root is not the same
//with the root folder of the website, so we add backup with
//second way to calculate the document root with script_name
... | [
"static",
"function",
"getDocumentRoot",
"(",
")",
"{",
"//The old method is to use the document_root from $_SERVER",
"//Howerver in some hosting the document root is not the same",
"//with the root folder of the website, so we add backup with",
"//second way to calculate the document root with s... | Get the doument root
@return string the document root path | [
"Get",
"the",
"doument",
"root"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Utility.php#L424-L447 |
koolphp/koolreport | src/core/Utility.php | Utility.getSymbolicPath | static function getSymbolicPath($realpath)
{
$root = $_SERVER['DOCUMENT_ROOT'];
$script = $_SERVER['SCRIPT_FILENAME'];
$root = str_replace('\\', '/', $root);
$script = str_replace('\\', '/', $script);
$realpath = str_replace('\\', '/', $realpath);
$dir = str_... | php | static function getSymbolicPath($realpath)
{
$root = $_SERVER['DOCUMENT_ROOT'];
$script = $_SERVER['SCRIPT_FILENAME'];
$root = str_replace('\\', '/', $root);
$script = str_replace('\\', '/', $script);
$realpath = str_replace('\\', '/', $realpath);
$dir = str_... | [
"static",
"function",
"getSymbolicPath",
"(",
"$",
"realpath",
")",
"{",
"$",
"root",
"=",
"$",
"_SERVER",
"[",
"'DOCUMENT_ROOT'",
"]",
";",
"$",
"script",
"=",
"$",
"_SERVER",
"[",
"'SCRIPT_FILENAME'",
"]",
";",
"$",
"root",
"=",
"str_replace",
"(",
"'\... | Get the dirname
@param string $realpath The real path
@return string Return the symbolic path | [
"Get",
"the",
"dirname"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Utility.php#L481-L503 |
koolphp/koolreport | src/datasources/PdoDataSource.php | PdoDataSource.onInit | protected function onInit()
{
// $this->connection = Util::get($this->params,"connection",null);
$connectionString = Util::get($this->params, "connectionString", "");
$username = Util::get($this->params, "username", "");
$password = Util::get($this->params, "password", "");
$... | php | protected function onInit()
{
// $this->connection = Util::get($this->params,"connection",null);
$connectionString = Util::get($this->params, "connectionString", "");
$username = Util::get($this->params, "username", "");
$password = Util::get($this->params, "password", "");
$... | [
"protected",
"function",
"onInit",
"(",
")",
"{",
"// $this->connection = Util::get($this->params,\"connection\",null);",
"$",
"connectionString",
"=",
"Util",
"::",
"get",
"(",
"$",
"this",
"->",
"params",
",",
"\"connectionString\"",
",",
"\"\"",
")",
";",
"$",
"u... | Datasource initiation
@return null | [
"Datasource",
"initiation"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/datasources/PdoDataSource.php#L94-L115 |
koolphp/koolreport | src/datasources/PdoDataSource.php | PdoDataSource.query | public function query($query,$sqlParams=null)
{
$this->query = (string)$query;
if ($sqlParams!=null) {
$this->sqlParams = $sqlParams;
}
return $this;
} | php | public function query($query,$sqlParams=null)
{
$this->query = (string)$query;
if ($sqlParams!=null) {
$this->sqlParams = $sqlParams;
}
return $this;
} | [
"public",
"function",
"query",
"(",
"$",
"query",
",",
"$",
"sqlParams",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"query",
"=",
"(",
"string",
")",
"$",
"query",
";",
"if",
"(",
"$",
"sqlParams",
"!=",
"null",
")",
"{",
"$",
"this",
"->",
"sqlPa... | Set the query and params
@param string $query The SQL query statement
@param array $sqlParams The parameters of SQL query
@return PdoDataSource This datasource object | [
"Set",
"the",
"query",
"and",
"params"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/datasources/PdoDataSource.php#L125-L132 |
koolphp/koolreport | src/datasources/PdoDataSource.php | PdoDataSource.queryProcessing | public function queryProcessing($queryParams)
{
$driver = strtolower($this->connection->getAttribute(PDO::ATTR_DRIVER_NAME));
//drivers = Array ( [0] => mysql [1] => oci [2] => pgsql [3] => sqlite [4] => sqlsrv )
switch ($driver) {
case 'mysql':
list($this->query, $this-... | php | public function queryProcessing($queryParams)
{
$driver = strtolower($this->connection->getAttribute(PDO::ATTR_DRIVER_NAME));
//drivers = Array ( [0] => mysql [1] => oci [2] => pgsql [3] => sqlite [4] => sqlsrv )
switch ($driver) {
case 'mysql':
list($this->query, $this-... | [
"public",
"function",
"queryProcessing",
"(",
"$",
"queryParams",
")",
"{",
"$",
"driver",
"=",
"strtolower",
"(",
"$",
"this",
"->",
"connection",
"->",
"getAttribute",
"(",
"PDO",
"::",
"ATTR_DRIVER_NAME",
")",
")",
";",
"//drivers = Array ( [0] => mysql [1] => ... | Transform query
@param array $queryParams Parameters of query
@return null | [
"Transform",
"query"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/datasources/PdoDataSource.php#L141-L168 |
koolphp/koolreport | src/datasources/PdoDataSource.php | PdoDataSource.prepareParams | protected function prepareParams($query, $sqlParams)
{
if (empty($sqlParams)) {
$sqlParams = [];
}
uksort(
$sqlParams,
function ($k1, $k2) {
return strlen($k1) < strlen($k2);
}
);
$resultQuery = $query;
$... | php | protected function prepareParams($query, $sqlParams)
{
if (empty($sqlParams)) {
$sqlParams = [];
}
uksort(
$sqlParams,
function ($k1, $k2) {
return strlen($k1) < strlen($k2);
}
);
$resultQuery = $query;
$... | [
"protected",
"function",
"prepareParams",
"(",
"$",
"query",
",",
"$",
"sqlParams",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"sqlParams",
")",
")",
"{",
"$",
"sqlParams",
"=",
"[",
"]",
";",
"}",
"uksort",
"(",
"$",
"sqlParams",
",",
"function",
"(",
... | Prepare SQL statement
@param string $query Query need to bind params
@param array $sqlParams The parameters will be bound to query
@return string Procesed query | [
"Prepare",
"SQL",
"statement"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/datasources/PdoDataSource.php#L191-L216 |
koolphp/koolreport | src/datasources/PdoDataSource.php | PdoDataSource.typeToPDOParamType | protected function typeToPDOParamType($type)
{
switch ($type) {
case "boolean":
return PDO::PARAM_BOOL;
case "integer":
return PDO::PARAM_STR;
case "NULL":
return PDO::PARAM_NULL;
case "resource":
return PDO::PARAM_LOB;
... | php | protected function typeToPDOParamType($type)
{
switch ($type) {
case "boolean":
return PDO::PARAM_BOOL;
case "integer":
return PDO::PARAM_STR;
case "NULL":
return PDO::PARAM_NULL;
case "resource":
return PDO::PARAM_LOB;
... | [
"protected",
"function",
"typeToPDOParamType",
"(",
"$",
"type",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"\"boolean\"",
":",
"return",
"PDO",
"::",
"PARAM_BOOL",
";",
"case",
"\"integer\"",
":",
"return",
"PDO",
"::",
"PARAM_STR",
";",
"cas... | Convert type to PdoParamType
@param string $type Type
@return intger The PDO Param Type | [
"Convert",
"type",
"to",
"PdoParamType"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/datasources/PdoDataSource.php#L225-L241 |
koolphp/koolreport | src/datasources/PdoDataSource.php | PdoDataSource.bindParams | protected function bindParams($stm, $sqlParams)
{
if (empty($sqlParams)) {
$sqlParams = [];
}
uksort(
$sqlParams,
function ($k1, $k2) {
return strlen($k1) < strlen($k2);
}
);
$paramNum = 0;
foreach ($sqlP... | php | protected function bindParams($stm, $sqlParams)
{
if (empty($sqlParams)) {
$sqlParams = [];
}
uksort(
$sqlParams,
function ($k1, $k2) {
return strlen($k1) < strlen($k2);
}
);
$paramNum = 0;
foreach ($sqlP... | [
"protected",
"function",
"bindParams",
"(",
"$",
"stm",
",",
"$",
"sqlParams",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"sqlParams",
")",
")",
"{",
"$",
"sqlParams",
"=",
"[",
"]",
";",
"}",
"uksort",
"(",
"$",
"sqlParams",
",",
"function",
"(",
"$"... | Perform data binding
@param string $stm Query need to bind params
@param array $sqlParams The parameters will be bound to query
@return null | [
"Perform",
"data",
"binding"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/datasources/PdoDataSource.php#L251-L278 |
koolphp/koolreport | src/datasources/PdoDataSource.php | PdoDataSource.guessType | protected function guessType($native_type)
{
$map = array(
"character"=>"string",
"char"=>"string",
"string"=>"string",
"str"=>"string",
"text"=>"string",
"blob"=>"string",
"binary"=>"string",
"enum"=>"string",
... | php | protected function guessType($native_type)
{
$map = array(
"character"=>"string",
"char"=>"string",
"string"=>"string",
"str"=>"string",
"text"=>"string",
"blob"=>"string",
"binary"=>"string",
"enum"=>"string",
... | [
"protected",
"function",
"guessType",
"(",
"$",
"native_type",
")",
"{",
"$",
"map",
"=",
"array",
"(",
"\"character\"",
"=>",
"\"string\"",
",",
"\"char\"",
"=>",
"\"string\"",
",",
"\"string\"",
"=>",
"\"string\"",
",",
"\"str\"",
"=>",
"\"string\"",
",",
... | Guess type
@param string $native_type Native type of PDO
@return string KoolReport type | [
"Guess",
"type"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/datasources/PdoDataSource.php#L287-L323 |
koolphp/koolreport | src/datasources/PdoDataSource.php | PdoDataSource.start | public function start()
{
$metaData = array("columns"=>array());
if ($this->countTotal) {
$totalQuery = $this->prepareParams($this->totalQuery, $this->sqlParams);
$stm = $this->connection->prepare($totalQuery);
$this->bindParams($stm, $this->sqlParams);
... | php | public function start()
{
$metaData = array("columns"=>array());
if ($this->countTotal) {
$totalQuery = $this->prepareParams($this->totalQuery, $this->sqlParams);
$stm = $this->connection->prepare($totalQuery);
$this->bindParams($stm, $this->sqlParams);
... | [
"public",
"function",
"start",
"(",
")",
"{",
"$",
"metaData",
"=",
"array",
"(",
"\"columns\"",
"=>",
"array",
"(",
")",
")",
";",
"if",
"(",
"$",
"this",
"->",
"countTotal",
")",
"{",
"$",
"totalQuery",
"=",
"$",
"this",
"->",
"prepareParams",
"(",... | Start piping data
@return null | [
"Start",
"piping",
"data"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/datasources/PdoDataSource.php#L358-L474 |
koolphp/koolreport | src/processes/DifferenceColumn.php | DifferenceColumn.onMetaReceived | protected function onMetaReceived($metaData)
{
foreach ($this->params as $copy => $original) {
$metaData["columns"][$copy] = $metaData["columns"][$original];
$metaData["columns"][$copy]["type"] = "number";
}
return $metaData;
} | php | protected function onMetaReceived($metaData)
{
foreach ($this->params as $copy => $original) {
$metaData["columns"][$copy] = $metaData["columns"][$original];
$metaData["columns"][$copy]["type"] = "number";
}
return $metaData;
} | [
"protected",
"function",
"onMetaReceived",
"(",
"$",
"metaData",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"params",
"as",
"$",
"copy",
"=>",
"$",
"original",
")",
"{",
"$",
"metaData",
"[",
"\"columns\"",
"]",
"[",
"$",
"copy",
"]",
"=",
"$",
"me... | Handle on meta received
@param array $metaData The meta data
@return array New meta data | [
"Handle",
"on",
"meta",
"received"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/processes/DifferenceColumn.php#L45-L52 |
koolphp/koolreport | src/processes/DifferenceColumn.php | DifferenceColumn.onInput | public function onInput($row)
{
//Process data here
foreach ($this->params as $copy => $original) {
$row[$copy] = $row[$original] - Utility::get($this->previousRow, $original, 0);
}
$this->previousRow = $row;
$this->next($row);
} | php | public function onInput($row)
{
//Process data here
foreach ($this->params as $copy => $original) {
$row[$copy] = $row[$original] - Utility::get($this->previousRow, $original, 0);
}
$this->previousRow = $row;
$this->next($row);
} | [
"public",
"function",
"onInput",
"(",
"$",
"row",
")",
"{",
"//Process data here",
"foreach",
"(",
"$",
"this",
"->",
"params",
"as",
"$",
"copy",
"=>",
"$",
"original",
")",
"{",
"$",
"row",
"[",
"$",
"copy",
"]",
"=",
"$",
"row",
"[",
"$",
"origi... | Handle on data input
@param array $row The input data row
@return null | [
"Handle",
"on",
"data",
"input"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/processes/DifferenceColumn.php#L71-L79 |
koolphp/koolreport | src/processes/ColumnMeta.php | ColumnMeta.onInit | protected function onInit()
{
if (is_array($this->params)) {
$this->override = Utility::get($this->params, "{override}", false);
}
} | php | protected function onInit()
{
if (is_array($this->params)) {
$this->override = Utility::get($this->params, "{override}", false);
}
} | [
"protected",
"function",
"onInit",
"(",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"params",
")",
")",
"{",
"$",
"this",
"->",
"override",
"=",
"Utility",
"::",
"get",
"(",
"$",
"this",
"->",
"params",
",",
"\"{override}\"",
",",
"false... | Handle on initiation
@return null | [
"Handle",
"on",
"initiation"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/processes/ColumnMeta.php#L54-L60 |
koolphp/koolreport | src/processes/ColumnMeta.php | ColumnMeta.onMetaReceived | protected function onMetaReceived($metaData)
{
if (is_array($this->params)) {
foreach ($this->params as $columnName => $columnInfo) {
if (isset($metaData["columns"][$columnName])) {
$newColumnName = Utility::get($columnInfo, "name");
$curre... | php | protected function onMetaReceived($metaData)
{
if (is_array($this->params)) {
foreach ($this->params as $columnName => $columnInfo) {
if (isset($metaData["columns"][$columnName])) {
$newColumnName = Utility::get($columnInfo, "name");
$curre... | [
"protected",
"function",
"onMetaReceived",
"(",
"$",
"metaData",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"params",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"params",
"as",
"$",
"columnName",
"=>",
"$",
"columnInfo",
")",
"{",
... | Handle on meta received
@param array $metaData Meta received
@return array New meta data | [
"Handle",
"on",
"meta",
"received"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/processes/ColumnMeta.php#L69-L108 |
koolphp/koolreport | src/processes/ColumnMeta.php | ColumnMeta.onInput | protected function onInput($data)
{
if (is_array($this->params)) {
foreach ($this->params as $columnName => $columnInfo) {
if (isset($columnInfo["name"])) {
$columnValue = $data[$columnName];
unset($data[$columnName]);
$... | php | protected function onInput($data)
{
if (is_array($this->params)) {
foreach ($this->params as $columnName => $columnInfo) {
if (isset($columnInfo["name"])) {
$columnValue = $data[$columnName];
unset($data[$columnName]);
$... | [
"protected",
"function",
"onInput",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"params",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"params",
"as",
"$",
"columnName",
"=>",
"$",
"columnInfo",
")",
"{",
"if",
"... | Handle on data input
@param array $data The input data row
@return null | [
"Handle",
"on",
"data",
"input"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/processes/ColumnMeta.php#L117-L135 |
koolphp/koolreport | src/core/Widget.php | Widget.clientSideReady | protected function clientSideReady($name=null)
{
//If no name specified then use default $this->name
//If not then if $name=="", understand that there is no passing object
//Otherwise try to pass the custom name
if ($name==null && $this->onReady!=null) {
echo "(".$this->o... | php | protected function clientSideReady($name=null)
{
//If no name specified then use default $this->name
//If not then if $name=="", understand that there is no passing object
//Otherwise try to pass the custom name
if ($name==null && $this->onReady!=null) {
echo "(".$this->o... | [
"protected",
"function",
"clientSideReady",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"//If no name specified then use default $this->name",
"//If not then if $name==\"\", understand that there is no passing object",
"//Otherwise try to pass the custom name",
"if",
"(",
"$",
"name",
... | Render javascript code to implement user's custom script
when widget is ready at client-side
@param string $name The name of widget
@return null | [
"Render",
"javascript",
"code",
"to",
"implement",
"user",
"s",
"custom",
"script",
"when",
"widget",
"is",
"ready",
"at",
"client",
"-",
"side"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Widget.php#L182-L196 |
koolphp/koolreport | src/core/Widget.php | Widget.getResources | protected function getResources($settings=null)
{
$resources = array(
"js"=>array(),
"css"=>array()
);
if ($settings==null) {
$settings = $this->resourceSettings();
}
//Default settings
if ($settings && isset($settings["folder"]))... | php | protected function getResources($settings=null)
{
$resources = array(
"js"=>array(),
"css"=>array()
);
if ($settings==null) {
$settings = $this->resourceSettings();
}
//Default settings
if ($settings && isset($settings["folder"]))... | [
"protected",
"function",
"getResources",
"(",
"$",
"settings",
"=",
"null",
")",
"{",
"$",
"resources",
"=",
"array",
"(",
"\"js\"",
"=>",
"array",
"(",
")",
",",
"\"css\"",
"=>",
"array",
"(",
")",
")",
";",
"if",
"(",
"$",
"settings",
"==",
"null",... | Get the resources for Widget
The method will read the resource settings and
work with report's resource manager
to make widget's resources available to report user.
@param array $settings The resource settings in short form
@return array The list of resource in array | [
"Get",
"the",
"resources",
"for",
"Widget"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Widget.php#L235-L347 |
koolphp/koolreport | src/core/Widget.php | Widget.attachResourceToEnd | protected function attachResourceToEnd(&$destination,$attachment)
{
for ($i=count($destination)-1;$i>-1;$i--) {
if (is_array($destination[$i])) {
if ($this->attachResourceToEnd($destination[$i], $attachment)) {
return true;
}
}
... | php | protected function attachResourceToEnd(&$destination,$attachment)
{
for ($i=count($destination)-1;$i>-1;$i--) {
if (is_array($destination[$i])) {
if ($this->attachResourceToEnd($destination[$i], $attachment)) {
return true;
}
}
... | [
"protected",
"function",
"attachResourceToEnd",
"(",
"&",
"$",
"destination",
",",
"$",
"attachment",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"count",
"(",
"$",
"destination",
")",
"-",
"1",
";",
"$",
"i",
">",
"-",
"1",
";",
"$",
"i",
"--",
")",
"{... | Attach an resource to end of queue line
@param array $destination Destination
@param array $attachment Attachment
@return bool Return true if resource has been attached | [
"Attach",
"an",
"resource",
"to",
"end",
"of",
"queue",
"line"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Widget.php#L357-L368 |
koolphp/koolreport | src/core/Widget.php | Widget.convertHierachicalResources | protected function convertHierachicalResources(&$resources)
{
foreach ($resources as &$resource) {
if (gettype($resource)=="string") {
$resource = $this->getAssetManager()->getAssetUrl($resource);
} else if (gettype($resource)=="array") {
$this->conver... | php | protected function convertHierachicalResources(&$resources)
{
foreach ($resources as &$resource) {
if (gettype($resource)=="string") {
$resource = $this->getAssetManager()->getAssetUrl($resource);
} else if (gettype($resource)=="array") {
$this->conver... | [
"protected",
"function",
"convertHierachicalResources",
"(",
"&",
"$",
"resources",
")",
"{",
"foreach",
"(",
"$",
"resources",
"as",
"&",
"$",
"resource",
")",
"{",
"if",
"(",
"gettype",
"(",
"$",
"resource",
")",
"==",
"\"string\"",
")",
"{",
"$",
"res... | The resources settings from short form will be converted to long form
which include full url to each resource
@param array $resources Resources
@return array $resource Resource settings after converted | [
"The",
"resources",
"settings",
"from",
"short",
"form",
"will",
"be",
"converted",
"to",
"long",
"form",
"which",
"include",
"full",
"url",
"to",
"each",
"resource"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Widget.php#L378-L388 |
koolphp/koolreport | src/core/Widget.php | Widget.useAutoName | protected function useAutoName($prefix="widget")
{
if ($this->name==null) {
$this->name = $prefix.Utility::getUniqueId();
}
} | php | protected function useAutoName($prefix="widget")
{
if ($this->name==null) {
$this->name = $prefix.Utility::getUniqueId();
}
} | [
"protected",
"function",
"useAutoName",
"(",
"$",
"prefix",
"=",
"\"widget\"",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"name",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"name",
"=",
"$",
"prefix",
".",
"Utility",
"::",
"getUniqueId",
"(",
")",
";",
... | Use by descendant widget class to take name settings
If the name is set by user, the method will not change name
If the name is not set then method will set an unique name for it.
@param string $prefix The prefix to the widget name if
the name is generated automatically.
@return null | [
"Use",
"by",
"descendant",
"widget",
"class",
"to",
"take",
"name",
"settings"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Widget.php#L416-L421 |
koolphp/koolreport | src/core/Widget.php | Widget.standardizeDataSource | protected function standardizeDataSource($dataSource, $args)
{
$finalDataSource = null;
if ($dataSource!==null) {
if (is_callable($dataSource)) {
// If datasource is a function then call it and pass all the available
// parameters from useDataSource()
... | php | protected function standardizeDataSource($dataSource, $args)
{
$finalDataSource = null;
if ($dataSource!==null) {
if (is_callable($dataSource)) {
// If datasource is a function then call it and pass all the available
// parameters from useDataSource()
... | [
"protected",
"function",
"standardizeDataSource",
"(",
"$",
"dataSource",
",",
"$",
"args",
")",
"{",
"$",
"finalDataSource",
"=",
"null",
";",
"if",
"(",
"$",
"dataSource",
"!==",
"null",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"dataSource",
")",
... | This function takes $dataSource in all forms and return data source in form of standard
DataStore
@param mixed $dataSource Mixed source include array,collection, DataStore, DataSource, Process
@param array $args Any args will be sent to function used to initiate datasource
@return DataStore A DataStore containi... | [
"This",
"function",
"takes",
"$dataSource",
"in",
"all",
"forms",
"and",
"return",
"data",
"source",
"in",
"form",
"of",
"standard",
"DataStore"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Widget.php#L432-L524 |
koolphp/koolreport | src/core/Widget.php | Widget.useDataSource | protected function useDataSource()
{
$args = func_get_args();
$dataSource = Utility::get(
$this->params,
"dataSource",
Utility::get($this->params, "dataStore")
);
$this->dataStore = $this->standardizeDataSource($dataSource, $args);
} | php | protected function useDataSource()
{
$args = func_get_args();
$dataSource = Utility::get(
$this->params,
"dataSource",
Utility::get($this->params, "dataStore")
);
$this->dataStore = $this->standardizeDataSource($dataSource, $args);
} | [
"protected",
"function",
"useDataSource",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"dataSource",
"=",
"Utility",
"::",
"get",
"(",
"$",
"this",
"->",
"params",
",",
"\"dataSource\"",
",",
"Utility",
"::",
"get",
"(",
"$",
"... | Use by descendant widget class to initiate the datasource
@return null | [
"Use",
"by",
"descendant",
"widget",
"class",
"to",
"initiate",
"the",
"datasource"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Widget.php#L531-L540 |
koolphp/koolreport | src/core/Widget.php | Widget.useLanguage | protected function useLanguage()
{
$this->language = Utility::get($this->params, "language");
if ($this->language!==null) {
if (gettype($this->language)=="string") {
$languageFile = $this->getWidgetFolder()
."/languages/"
.Utility::... | php | protected function useLanguage()
{
$this->language = Utility::get($this->params, "language");
if ($this->language!==null) {
if (gettype($this->language)=="string") {
$languageFile = $this->getWidgetFolder()
."/languages/"
.Utility::... | [
"protected",
"function",
"useLanguage",
"(",
")",
"{",
"$",
"this",
"->",
"language",
"=",
"Utility",
"::",
"get",
"(",
"$",
"this",
"->",
"params",
",",
"\"language\"",
")",
";",
"if",
"(",
"$",
"this",
"->",
"language",
"!==",
"null",
")",
"{",
"if... | Register using language settings for widget
@return null | [
"Register",
"using",
"language",
"settings",
"for",
"widget"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Widget.php#L561-L584 |
koolphp/koolreport | src/core/Widget.php | Widget.render | public function render()
{
if ($this->report->fireEvent("OnBeforeWidgetRender", $this)) {
$type=str_replace('\\', '/', get_class($this));
echo "<krwidget widget-name='$this->name' widget-type='$type'"
.($this->themeCssClass?" class='$this->themeCssClass'":"").">";
... | php | public function render()
{
if ($this->report->fireEvent("OnBeforeWidgetRender", $this)) {
$type=str_replace('\\', '/', get_class($this));
echo "<krwidget widget-name='$this->name' widget-type='$type'"
.($this->themeCssClass?" class='$this->themeCssClass'":"").">";
... | [
"public",
"function",
"render",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"report",
"->",
"fireEvent",
"(",
"\"OnBeforeWidgetRender\"",
",",
"$",
"this",
")",
")",
"{",
"$",
"type",
"=",
"str_replace",
"(",
"'\\\\'",
",",
"'/'",
",",
"get_class",
"(... | Render this widget
@return null | [
"Render",
"this",
"widget"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Widget.php#L670-L680 |
koolphp/koolreport | src/core/Widget.php | Widget.template | protected function template($template=null,$variables=null,$return=false)
{
if (!$template) {
$template = Utility::getClassName($this);
} else if (gettype($template)=="array") {
if (gettype($variables)=="boolean") {
$return = $variables;
}
... | php | protected function template($template=null,$variables=null,$return=false)
{
if (!$template) {
$template = Utility::getClassName($this);
} else if (gettype($template)=="array") {
if (gettype($variables)=="boolean") {
$return = $variables;
}
... | [
"protected",
"function",
"template",
"(",
"$",
"template",
"=",
"null",
",",
"$",
"variables",
"=",
"null",
",",
"$",
"return",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"template",
")",
"{",
"$",
"template",
"=",
"Utility",
"::",
"getClassName",
... | Loading template and inject parameters
@param string $template The template name that will be used
to render widget content.
@param array $variables The variables to fill the template
@param bool $return Whether template will render content or
return the content
@return string It could return html of widget
if... | [
"Loading",
"template",
"and",
"inject",
"parameters"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Widget.php#L706-L745 |
koolphp/koolreport | src/core/Widget.php | Widget.create | static function create($params,$return=false)
{
$class = get_called_class();
$component = new $class($params);
if ($return) {
ob_start();
$component->render();
return ob_get_clean();
} else {
$component->render();
}
} | php | static function create($params,$return=false)
{
$class = get_called_class();
$component = new $class($params);
if ($return) {
ob_start();
$component->render();
return ob_get_clean();
} else {
$component->render();
}
} | [
"static",
"function",
"create",
"(",
"$",
"params",
",",
"$",
"return",
"=",
"false",
")",
"{",
"$",
"class",
"=",
"get_called_class",
"(",
")",
";",
"$",
"component",
"=",
"new",
"$",
"class",
"(",
"$",
"params",
")",
";",
"if",
"(",
"$",
"return"... | Create widget object
@param array $params The settings of widget
@param bool $return Set to true if you want to get html rather than
rendering widget directly
@return string Return html string if $return is set to true | [
"Create",
"widget",
"object"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/core/Widget.php#L755-L766 |
koolphp/koolreport | src/datasources/PostgreSQLDataSource.php | PostgreSQLDataSource.onInit | protected function onInit()
{
$host = Util::get($this->params, "host", "");//host\instanceName
$username = Util::get($this->params, "username", "");
$password = Util::get($this->params, "password", "");
$dbname = Util::get($this->params, "dbname", "");
$connString = "host=$ho... | php | protected function onInit()
{
$host = Util::get($this->params, "host", "");//host\instanceName
$username = Util::get($this->params, "username", "");
$password = Util::get($this->params, "password", "");
$dbname = Util::get($this->params, "dbname", "");
$connString = "host=$ho... | [
"protected",
"function",
"onInit",
"(",
")",
"{",
"$",
"host",
"=",
"Util",
"::",
"get",
"(",
"$",
"this",
"->",
"params",
",",
"\"host\"",
",",
"\"\"",
")",
";",
"//host\\instanceName",
"$",
"username",
"=",
"Util",
"::",
"get",
"(",
"$",
"this",
"-... | DataSource initiation
@return null | [
"DataSource",
"initiation"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/datasources/PostgreSQLDataSource.php#L87-L109 |
koolphp/koolreport | src/datasources/PostgreSQLDataSource.php | PostgreSQLDataSource.queryProcessing | public function queryProcessing($queryParams)
{
list($this->query, $this->totalQuery, $this->filterQuery)
= self::processQuery($this->query, $queryParams);
$this->countTotal = Util::get($queryParams, 'countTotal', false);
$this->countFilter = Util::get($queryParams, 'countFilte... | php | public function queryProcessing($queryParams)
{
list($this->query, $this->totalQuery, $this->filterQuery)
= self::processQuery($this->query, $queryParams);
$this->countTotal = Util::get($queryParams, 'countTotal', false);
$this->countFilter = Util::get($queryParams, 'countFilte... | [
"public",
"function",
"queryProcessing",
"(",
"$",
"queryParams",
")",
"{",
"list",
"(",
"$",
"this",
"->",
"query",
",",
"$",
"this",
"->",
"totalQuery",
",",
"$",
"this",
"->",
"filterQuery",
")",
"=",
"self",
"::",
"processQuery",
"(",
"$",
"this",
... | Transform query
@param array $queryParams Parameters of query
@return PostgreSQLDataSource Return itself for cascade | [
"Transform",
"query"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/datasources/PostgreSQLDataSource.php#L162-L171 |
koolphp/koolreport | src/datasources/PostgreSQLDataSource.php | PostgreSQLDataSource.bindParams | protected function bindParams($query, $sqlParams)
{
if (empty($sqlParams)) {
$sqlParams = [];
}
uksort(
$sqlParams,
function ($k1, $k2) {
return strlen($k1) < strlen($k2);
}
);
foreach ($sqlParams as $key=>$valu... | php | protected function bindParams($query, $sqlParams)
{
if (empty($sqlParams)) {
$sqlParams = [];
}
uksort(
$sqlParams,
function ($k1, $k2) {
return strlen($k1) < strlen($k2);
}
);
foreach ($sqlParams as $key=>$valu... | [
"protected",
"function",
"bindParams",
"(",
"$",
"query",
",",
"$",
"sqlParams",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"sqlParams",
")",
")",
"{",
"$",
"sqlParams",
"=",
"[",
"]",
";",
"}",
"uksort",
"(",
"$",
"sqlParams",
",",
"function",
"(",
"... | Perform data binding
@param string $query Query need to bind params
@param array $sqlParams The parameters will be bound to query
@return string Procesed query | [
"Perform",
"data",
"binding"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/datasources/PostgreSQLDataSource.php#L194-L220 |
koolphp/koolreport | src/datasources/PostgreSQLDataSource.php | PostgreSQLDataSource.mapFieldTypeToBindType | protected function mapFieldTypeToBindType($native_type)
{
$pg_to_php = array(
'bit' => 'number',
'boolean' => 'string',
'box' => 'string',
'character' => 'string',
'char' => 'number',
'bytea' => 'number',
'cidr' => 'string',... | php | protected function mapFieldTypeToBindType($native_type)
{
$pg_to_php = array(
'bit' => 'number',
'boolean' => 'string',
'box' => 'string',
'character' => 'string',
'char' => 'number',
'bytea' => 'number',
'cidr' => 'string',... | [
"protected",
"function",
"mapFieldTypeToBindType",
"(",
"$",
"native_type",
")",
"{",
"$",
"pg_to_php",
"=",
"array",
"(",
"'bit'",
"=>",
"'number'",
",",
"'boolean'",
"=>",
"'string'",
",",
"'box'",
"=>",
"'string'",
",",
"'character'",
"=>",
"'string'",
",",... | Map field type to bind type
@param strng $native_type The type of field
@return string KoolReport type of field | [
"Map",
"field",
"type",
"to",
"bind",
"type"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/datasources/PostgreSQLDataSource.php#L260-L321 |
koolphp/koolreport | src/datasources/PostgreSQLDataSource.php | PostgreSQLDataSource.start | public function start()
{
$metaData = array("columns"=>array());
if ($this->countTotal) {
$totalQuery = $this->bindParams($this->totalQuery, $this->sqlParams);
$totalResult = pg_query($this->connection, $totalQuery);
if (!$totalResult) {
echo pg_l... | php | public function start()
{
$metaData = array("columns"=>array());
if ($this->countTotal) {
$totalQuery = $this->bindParams($this->totalQuery, $this->sqlParams);
$totalResult = pg_query($this->connection, $totalQuery);
if (!$totalResult) {
echo pg_l... | [
"public",
"function",
"start",
"(",
")",
"{",
"$",
"metaData",
"=",
"array",
"(",
"\"columns\"",
"=>",
"array",
"(",
")",
")",
";",
"if",
"(",
"$",
"this",
"->",
"countTotal",
")",
"{",
"$",
"totalQuery",
"=",
"$",
"this",
"->",
"bindParams",
"(",
... | Start piping data
@return null | [
"Start",
"piping",
"data"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/datasources/PostgreSQLDataSource.php#L328-L392 |
koolphp/koolreport | src/processes/OnlyColumn.php | OnlyColumn.onMetaReceived | protected function onMetaReceived($metaData)
{
$meta = $metaData;
$meta["columns"] = array();
foreach ($this->params as $colname) {
if (isset($metaData["columns"][$colname])) {
$meta["columns"][$colname] = $metaData["columns"][$colname];
}
}
... | php | protected function onMetaReceived($metaData)
{
$meta = $metaData;
$meta["columns"] = array();
foreach ($this->params as $colname) {
if (isset($metaData["columns"][$colname])) {
$meta["columns"][$colname] = $metaData["columns"][$colname];
}
}
... | [
"protected",
"function",
"onMetaReceived",
"(",
"$",
"metaData",
")",
"{",
"$",
"meta",
"=",
"$",
"metaData",
";",
"$",
"meta",
"[",
"\"columns\"",
"]",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"params",
"as",
"$",
"colname",
"... | Handle on meta received
@param array $metaData The meta data
@return array New meta data | [
"Handle",
"on",
"meta",
"received"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/processes/OnlyColumn.php#L44-L54 |
koolphp/koolreport | src/processes/OnlyColumn.php | OnlyColumn.onInput | protected function onInput($data)
{
$ndata = array();
foreach ($this->params as $colname) {
if (isset($data[$colname])) {
$ndata[$colname] = $data[$colname];
}
}
$this->next($ndata);
} | php | protected function onInput($data)
{
$ndata = array();
foreach ($this->params as $colname) {
if (isset($data[$colname])) {
$ndata[$colname] = $data[$colname];
}
}
$this->next($ndata);
} | [
"protected",
"function",
"onInput",
"(",
"$",
"data",
")",
"{",
"$",
"ndata",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"params",
"as",
"$",
"colname",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"$",
"colname",
"]"... | Handle on data input
@param array $data The input data row
@return null | [
"Handle",
"on",
"data",
"input"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/processes/OnlyColumn.php#L63-L73 |
koolphp/koolreport | src/widgets/google/Chart.php | Chart.onInit | protected function onInit()
{
$this->useDataSource();
$this->useAutoName("gchart");
$this->clientEvents = Utility::get($this->params, "clientEvents", array());
$this->columns = Utility::get($this->params, "columns", null);
$this->options = Utility::get($this->params, "option... | php | protected function onInit()
{
$this->useDataSource();
$this->useAutoName("gchart");
$this->clientEvents = Utility::get($this->params, "clientEvents", array());
$this->columns = Utility::get($this->params, "columns", null);
$this->options = Utility::get($this->params, "option... | [
"protected",
"function",
"onInit",
"(",
")",
"{",
"$",
"this",
"->",
"useDataSource",
"(",
")",
";",
"$",
"this",
"->",
"useAutoName",
"(",
"\"gchart\"",
")",
";",
"$",
"this",
"->",
"clientEvents",
"=",
"Utility",
"::",
"get",
"(",
"$",
"this",
"->",
... | Return the resource settings for table
@return array The resource settings of table widget | [
"Return",
"the",
"resource",
"settings",
"for",
"table"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/widgets/google/Chart.php#L66-L122 |
koolphp/koolreport | src/widgets/google/Chart.php | Chart.getColumnSettings | protected function getColumnSettings()
{
//If there is the user input columns then parse them to columns from user input
//If the user does not input collumns then take the default by looking at data
// Then mixed with default in meta
$meta = $this->dataStore->meta();
$column... | php | protected function getColumnSettings()
{
//If there is the user input columns then parse them to columns from user input
//If the user does not input collumns then take the default by looking at data
// Then mixed with default in meta
$meta = $this->dataStore->meta();
$column... | [
"protected",
"function",
"getColumnSettings",
"(",
")",
"{",
"//If there is the user input columns then parse them to columns from user input",
"//If the user does not input collumns then take the default by looking at data",
"// Then mixed with default in meta",
"$",
"meta",
"=",
"$",
"th... | Improve the column settings
@return array Collumn section | [
"Improve",
"the",
"column",
"settings"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/widgets/google/Chart.php#L147-L169 |
koolphp/koolreport | src/widgets/google/Chart.php | Chart.prepareData | protected function prepareData()
{
//Now we have $columns contain all real columns settings
$columns = $this->getColumnSettings();
$data = array();
$header = array();
$columnExtraRoles = array("annotation", "annotationText", "certainty", "emphasis", "interval", "scope", "st... | php | protected function prepareData()
{
//Now we have $columns contain all real columns settings
$columns = $this->getColumnSettings();
$data = array();
$header = array();
$columnExtraRoles = array("annotation", "annotationText", "certainty", "emphasis", "interval", "scope", "st... | [
"protected",
"function",
"prepareData",
"(",
")",
"{",
"//Now we have $columns contain all real columns settings",
"$",
"columns",
"=",
"$",
"this",
"->",
"getColumnSettings",
"(",
")",
";",
"$",
"data",
"=",
"array",
"(",
")",
";",
"$",
"header",
"=",
"array",
... | Prepare data
@return null | [
"Prepare",
"data"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/widgets/google/Chart.php#L176-L233 |
koolphp/koolreport | src/widgets/google/Chart.php | Chart.formatValue | protected function formatValue($value, $format, $row = null)
{
$formatValue = Utility::get($format, "formatValue", null);
if (is_string($formatValue)) {
eval('$fv="' . str_replace('@value', '$value', $formatValue) . '";');
return $fv;
} else if (is_callable($formatVa... | php | protected function formatValue($value, $format, $row = null)
{
$formatValue = Utility::get($format, "formatValue", null);
if (is_string($formatValue)) {
eval('$fv="' . str_replace('@value', '$value', $formatValue) . '";');
return $fv;
} else if (is_callable($formatVa... | [
"protected",
"function",
"formatValue",
"(",
"$",
"value",
",",
"$",
"format",
",",
"$",
"row",
"=",
"null",
")",
"{",
"$",
"formatValue",
"=",
"Utility",
"::",
"get",
"(",
"$",
"format",
",",
"\"formatValue\"",
",",
"null",
")",
";",
"if",
"(",
"is_... | Return the formatted value
@param mixed $value The value needed to be formatted
@param array $format The format
@param array $row The row containing this value
@return null | [
"Return",
"the",
"formatted",
"value"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/widgets/google/Chart.php#L244-L256 |
koolphp/koolreport | src/widgets/google/Chart.php | Chart.onRender | protected function onRender()
{
if ($this->dataStore->countData() > 0) {
//Update options
$options = $this->options;
if ($this->title) {
$options["title"] = $this->title;
}
if ($this->colorScheme) {
$options["colors"... | php | protected function onRender()
{
if ($this->dataStore->countData() > 0) {
//Update options
$options = $this->options;
if ($this->title) {
$options["title"] = $this->title;
}
if ($this->colorScheme) {
$options["colors"... | [
"protected",
"function",
"onRender",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"dataStore",
"->",
"countData",
"(",
")",
">",
"0",
")",
"{",
"//Update options",
"$",
"options",
"=",
"$",
"this",
"->",
"options",
";",
"if",
"(",
"$",
"this",
"->",
... | Handle on render
@return null | [
"Handle",
"on",
"render"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/widgets/google/Chart.php#L263-L292 |
koolphp/koolreport | src/processes/Transpose2.php | Transpose2.onInputEnd | protected function onInputEnd()
{
//Send meta
$countRow = count($this->data);
$oldCKeys = array_keys($this->metaData['columns']);
$cMetas = [
'c0' => array("type" => "string"),
];
foreach ($this->data as $row) {
$cMetas[$row[$oldCKeys[0]]] = ['... | php | protected function onInputEnd()
{
//Send meta
$countRow = count($this->data);
$oldCKeys = array_keys($this->metaData['columns']);
$cMetas = [
'c0' => array("type" => "string"),
];
foreach ($this->data as $row) {
$cMetas[$row[$oldCKeys[0]]] = ['... | [
"protected",
"function",
"onInputEnd",
"(",
")",
"{",
"//Send meta",
"$",
"countRow",
"=",
"count",
"(",
"$",
"this",
"->",
"data",
")",
";",
"$",
"oldCKeys",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"metaData",
"[",
"'columns'",
"]",
")",
";",
"$",
... | Handle on data input end
@return null | [
"Handle",
"on",
"data",
"input",
"end"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/processes/Transpose2.php#L76-L105 |
koolphp/koolreport | src/processes/ColumnsSort.php | ColumnsSort.onInit | public function onInit()
{
$this->nameSort = Utility::get($this->params, '{name}', null);
$this->labelSort = Utility::get($this->params, '{label}', null);
$this->fixedColumns = Utility::get($this->params, 'fixedColumns', null);
} | php | public function onInit()
{
$this->nameSort = Utility::get($this->params, '{name}', null);
$this->labelSort = Utility::get($this->params, '{label}', null);
$this->fixedColumns = Utility::get($this->params, 'fixedColumns', null);
} | [
"public",
"function",
"onInit",
"(",
")",
"{",
"$",
"this",
"->",
"nameSort",
"=",
"Utility",
"::",
"get",
"(",
"$",
"this",
"->",
"params",
",",
"'{name}'",
",",
"null",
")",
";",
"$",
"this",
"->",
"labelSort",
"=",
"Utility",
"::",
"get",
"(",
"... | Process initiation
@return null | [
"Process",
"initiation"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/processes/ColumnsSort.php#L49-L54 |
koolphp/koolreport | src/processes/ColumnsSort.php | ColumnsSort.onInput | protected function onInput($row)
{
if (!isset($this->sortedColumns)) {
$columns = array_keys($row);
$columnsToSort = array();
$fixedColumns = isset($this->fixedColumns) ? $this->fixedColumns : array();
foreach ($columns as $i => $colName) {
if ... | php | protected function onInput($row)
{
if (!isset($this->sortedColumns)) {
$columns = array_keys($row);
$columnsToSort = array();
$fixedColumns = isset($this->fixedColumns) ? $this->fixedColumns : array();
foreach ($columns as $i => $colName) {
if ... | [
"protected",
"function",
"onInput",
"(",
"$",
"row",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"sortedColumns",
")",
")",
"{",
"$",
"columns",
"=",
"array_keys",
"(",
"$",
"row",
")",
";",
"$",
"columnsToSort",
"=",
"array",
"(",
"... | Handle on data input
@param array $row The input data row
@return null | [
"Handle",
"on",
"data",
"input"
] | train | https://github.com/koolphp/koolreport/blob/1ffa6c481535eac59df0852a6eeaa9ff87170e98/src/processes/ColumnsSort.php#L76-L156 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.