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
symphonycms/symphony-2
symphony/lib/toolkit/class.emailgateway.php
EmailGateway.setSenderEmailAddress
public function setSenderEmailAddress($email) { if (!$this->validateHeaderFieldValue($email)) { throw new EmailValidationException(__('Sender Email Address can not contain carriage return or newlines.')); } $this->_sender_email_address = $email; }
php
public function setSenderEmailAddress($email) { if (!$this->validateHeaderFieldValue($email)) { throw new EmailValidationException(__('Sender Email Address can not contain carriage return or newlines.')); } $this->_sender_email_address = $email; }
[ "public", "function", "setSenderEmailAddress", "(", "$", "email", ")", "{", "if", "(", "!", "$", "this", "->", "validateHeaderFieldValue", "(", "$", "email", ")", ")", "{", "throw", "new", "EmailValidationException", "(", "__", "(", "'Sender Email Address can no...
Sets the sender-email. @throws EmailValidationException @param string $email The email-address emails will be sent from. @return void
[ "Sets", "the", "sender", "-", "email", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.emailgateway.php#L173-L180
symphonycms/symphony-2
symphony/lib/toolkit/class.emailgateway.php
EmailGateway.setSenderName
public function setSenderName($name) { if (!$this->validateHeaderFieldValue($name)) { throw new EmailValidationException(__('Sender Name can not contain carriage return or newlines.')); } $this->_sender_name = $name; }
php
public function setSenderName($name) { if (!$this->validateHeaderFieldValue($name)) { throw new EmailValidationException(__('Sender Name can not contain carriage return or newlines.')); } $this->_sender_name = $name; }
[ "public", "function", "setSenderName", "(", "$", "name", ")", "{", "if", "(", "!", "$", "this", "->", "validateHeaderFieldValue", "(", "$", "name", ")", ")", "{", "throw", "new", "EmailValidationException", "(", "__", "(", "'Sender Name can not contain carriage ...
Sets the sender-name. @throws EmailValidationException @param string $name The name emails will be sent from. @return void
[ "Sets", "the", "sender", "-", "name", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.emailgateway.php#L190-L197
symphonycms/symphony-2
symphony/lib/toolkit/class.emailgateway.php
EmailGateway.setRecipients
public function setRecipients($email) { if (!is_array($email)) { $email = explode(',', $email); // trim all values array_walk($email, function(&$val) { return $val = trim($val); }); // remove empty elements $email = arra...
php
public function setRecipients($email) { if (!is_array($email)) { $email = explode(',', $email); // trim all values array_walk($email, function(&$val) { return $val = trim($val); }); // remove empty elements $email = arra...
[ "public", "function", "setRecipients", "(", "$", "email", ")", "{", "if", "(", "!", "is_array", "(", "$", "email", ")", ")", "{", "$", "email", "=", "explode", "(", "','", ",", "$", "email", ")", ";", "// trim all values", "array_walk", "(", "$", "em...
Sets the recipients. @param string|array $email The email-address(es) to send the email to. @throws EmailValidationException @return void
[ "Sets", "the", "recipients", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.emailgateway.php#L207-L226
symphonycms/symphony-2
symphony/lib/toolkit/class.emailgateway.php
EmailGateway.setAttachments
public function setAttachments($files) { // Always erase $this->_attachments = array(); // check if we have an input value if ($files == null) { return; } // make sure we are dealing with an array if (!is_array($files)) { $files = arr...
php
public function setAttachments($files) { // Always erase $this->_attachments = array(); // check if we have an input value if ($files == null) { return; } // make sure we are dealing with an array if (!is_array($files)) { $files = arr...
[ "public", "function", "setAttachments", "(", "$", "files", ")", "{", "// Always erase", "$", "this", "->", "_attachments", "=", "array", "(", ")", ";", "// check if we have an input value", "if", "(", "$", "files", "==", "null", ")", "{", "return", ";", "}",...
This function sets one or multiple attachment files to the email. Passing `null` to this function will erase the current values with an empty array. @param string|array $files Accepts the same parameters format as `EmailGateway::addAttachment()` but you can also all multiple values at once if all files are wrap in a ...
[ "This", "function", "sets", "one", "or", "multiple", "attachment", "files", "to", "the", "email", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.emailgateway.php#L276-L303
symphonycms/symphony-2
symphony/lib/toolkit/class.emailgateway.php
EmailGateway.appendAttachment
public function appendAttachment($file) { if (!is_array($file)) { // treat the param as string (old format) $file = array( 'file' => $file, 'filename' => null, 'charset' => null, ); // is array, but not the righ...
php
public function appendAttachment($file) { if (!is_array($file)) { // treat the param as string (old format) $file = array( 'file' => $file, 'filename' => null, 'charset' => null, ); // is array, but not the righ...
[ "public", "function", "appendAttachment", "(", "$", "file", ")", "{", "if", "(", "!", "is_array", "(", "$", "file", ")", ")", "{", "// treat the param as string (old format)", "$", "file", "=", "array", "(", "'file'", "=>", "$", "file", ",", "'filename'", ...
Appends one file attachment to the attachments array. @since Symphony 2.3.5 @param string|array $file Can be a string representing the file path, absolute or relative, i.e. `'http://example.com/foo.txt'` or `'path/to/your/webspace/foo/bar.csv'`. Can also be a keyed array. This will enable more options, like setting ...
[ "Appends", "one", "file", "attachment", "to", "the", "attachments", "array", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.emailgateway.php#L327-L350
symphonycms/symphony-2
symphony/lib/toolkit/class.emailgateway.php
EmailGateway.appendHeaderField
public function appendHeaderField($name, $body) { if (is_array($body)) { throw new EmailGatewayException(__('%s accepts strings only; arrays are not allowed.', array('<code>appendHeaderField</code>'))); } $this->_header_fields[$name] = $body; }
php
public function appendHeaderField($name, $body) { if (is_array($body)) { throw new EmailGatewayException(__('%s accepts strings only; arrays are not allowed.', array('<code>appendHeaderField</code>'))); } $this->_header_fields[$name] = $body; }
[ "public", "function", "appendHeaderField", "(", "$", "name", ",", "$", "body", ")", "{", "if", "(", "is_array", "(", "$", "body", ")", ")", "{", "throw", "new", "EmailGatewayException", "(", "__", "(", "'%s accepts strings only; arrays are not allowed.'", ",", ...
Appends a single header field to the header fields array. The header field should be presented as a name/body pair. @throws EmailGatewayException @param string $name The header field name. Examples are From, Bcc, X-Sender and Reply-to. @param string $body The header field body. @return void
[ "Appends", "a", "single", "header", "field", "to", "the", "header", "fields", "array", ".", "The", "header", "field", "should", "be", "presented", "as", "a", "name", "/", "body", "pair", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.emailgateway.php#L464-L471
symphonycms/symphony-2
symphony/lib/toolkit/class.emailgateway.php
EmailGateway.appendHeaderFields
public function appendHeaderFields(array $header_array = array()) { foreach ($header_array as $name => $body) { $this->appendHeaderField($name, $body); } }
php
public function appendHeaderFields(array $header_array = array()) { foreach ($header_array as $name => $body) { $this->appendHeaderField($name, $body); } }
[ "public", "function", "appendHeaderFields", "(", "array", "$", "header_array", "=", "array", "(", ")", ")", "{", "foreach", "(", "$", "header_array", "as", "$", "name", "=>", "$", "body", ")", "{", "$", "this", "->", "appendHeaderField", "(", "$", "name"...
Appends one or more header fields to the header fields array. Header fields should be presented as an array with name/body pairs. @param array $header_array The header fields. Examples are From, X-Sender and Reply-to. @throws EmailGatewayException @return void
[ "Appends", "one", "or", "more", "header", "fields", "to", "the", "header", "fields", "array", ".", "Header", "fields", "should", "be", "presented", "as", "an", "array", "with", "name", "/", "body", "pairs", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.emailgateway.php#L482-L487
symphonycms/symphony-2
symphony/lib/toolkit/class.emailgateway.php
EmailGateway.validate
public function validate() { if (strlen(trim($this->_subject)) <= 0) { throw new EmailValidationException(__('Email subject cannot be empty.')); } elseif (strlen(trim($this->_sender_email_address)) <= 0) { throw new EmailValidationException(__('Sender email address cannot be ...
php
public function validate() { if (strlen(trim($this->_subject)) <= 0) { throw new EmailValidationException(__('Email subject cannot be empty.')); } elseif (strlen(trim($this->_sender_email_address)) <= 0) { throw new EmailValidationException(__('Sender email address cannot be ...
[ "public", "function", "validate", "(", ")", "{", "if", "(", "strlen", "(", "trim", "(", "$", "this", "->", "_subject", ")", ")", "<=", "0", ")", "{", "throw", "new", "EmailValidationException", "(", "__", "(", "'Email subject cannot be empty.'", ")", ")", ...
Makes sure the Subject, Sender Email and Recipients values are all set and are valid. The message body is checked in `prepareMessageBody` @see prepareMessageBody() @throws EmailValidationException @return boolean
[ "Makes", "sure", "the", "Subject", "Sender", "Email", "and", "Recipients", "values", "are", "all", "set", "and", "are", "valid", ".", "The", "message", "body", "is", "checked", "in", "prepareMessageBody" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.emailgateway.php#L498-L517
symphonycms/symphony-2
symphony/lib/toolkit/class.emailgateway.php
EmailGateway.prepareMessageBody
protected function prepareMessageBody() { $attachments = $this->getSectionAttachments(); if ($attachments) { $this->appendHeaderFields($this->contentInfoArray('multipart/mixed')); if (!empty($this->_text_plain) && !empty($this->_text_html)) { $this->_body = $t...
php
protected function prepareMessageBody() { $attachments = $this->getSectionAttachments(); if ($attachments) { $this->appendHeaderFields($this->contentInfoArray('multipart/mixed')); if (!empty($this->_text_plain) && !empty($this->_text_html)) { $this->_body = $t...
[ "protected", "function", "prepareMessageBody", "(", ")", "{", "$", "attachments", "=", "$", "this", "->", "getSectionAttachments", "(", ")", ";", "if", "(", "$", "attachments", ")", "{", "$", "this", "->", "appendHeaderFields", "(", "$", "this", "->", "con...
Build the message body and the content-describing header fields The result of this building is an updated body variable in the gateway itself. @throws EmailGatewayException @throws Exception @return boolean
[ "Build", "the", "message", "body", "and", "the", "content", "-", "describing", "header", "fields" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.emailgateway.php#L529-L568
symphonycms/symphony-2
symphony/lib/toolkit/class.emailgateway.php
EmailGateway.getSectionMultipartAlternative
protected function getSectionMultipartAlternative() { $output = $this->boundaryDelimiterLine('multipart/alternative') . $this->contentInfoString('text/plain') . $this->getSectionTextPlain() . $this->boundaryDelimiterLine('multipart/alternative') ...
php
protected function getSectionMultipartAlternative() { $output = $this->boundaryDelimiterLine('multipart/alternative') . $this->contentInfoString('text/plain') . $this->getSectionTextPlain() . $this->boundaryDelimiterLine('multipart/alternative') ...
[ "protected", "function", "getSectionMultipartAlternative", "(", ")", "{", "$", "output", "=", "$", "this", "->", "boundaryDelimiterLine", "(", "'multipart/alternative'", ")", ".", "$", "this", "->", "contentInfoString", "(", "'text/plain'", ")", ".", "$", "this", ...
Build multipart email section. Used by sendmail and smtp classes to send multipart email. Will return a string containing the section. Can be used to send to an email server directly. @return string
[ "Build", "multipart", "email", "section", ".", "Used", "by", "sendmail", "and", "smtp", "classes", "to", "send", "multipart", "email", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.emailgateway.php#L578-L590
symphonycms/symphony-2
symphony/lib/toolkit/class.emailgateway.php
EmailGateway.getSectionAttachments
protected function getSectionAttachments() { $output = ''; foreach ($this->_attachments as $key => $file) { $tmp_file = false; // If the attachment is a URL, download the file to a temporary location. // This prevents downloading the file twice - once for info, ...
php
protected function getSectionAttachments() { $output = ''; foreach ($this->_attachments as $key => $file) { $tmp_file = false; // If the attachment is a URL, download the file to a temporary location. // This prevents downloading the file twice - once for info, ...
[ "protected", "function", "getSectionAttachments", "(", ")", "{", "$", "output", "=", "''", ";", "foreach", "(", "$", "this", "->", "_attachments", "as", "$", "key", "=>", "$", "file", ")", "{", "$", "tmp_file", "=", "false", ";", "// If the attachment is a...
Builds the attachment section of a multipart email. Will return a string containing the section. Can be used to send to an email server directly. @throws EmailGatewayException @throws Exception @return string
[ "Builds", "the", "attachment", "section", "of", "a", "multipart", "email", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.emailgateway.php#L602-L652
symphonycms/symphony-2
symphony/lib/toolkit/class.emailgateway.php
EmailGateway.getSectionTextPlain
protected function getSectionTextPlain() { if ($this->_text_encoding == 'quoted-printable') { return EmailHelper::qpContentTransferEncode($this->_text_plain)."\r\n"; } elseif ($this->_text_encoding == 'base64') { // don't add CRLF if using base64 - spam filters don't ...
php
protected function getSectionTextPlain() { if ($this->_text_encoding == 'quoted-printable') { return EmailHelper::qpContentTransferEncode($this->_text_plain)."\r\n"; } elseif ($this->_text_encoding == 'base64') { // don't add CRLF if using base64 - spam filters don't ...
[ "protected", "function", "getSectionTextPlain", "(", ")", "{", "if", "(", "$", "this", "->", "_text_encoding", "==", "'quoted-printable'", ")", "{", "return", "EmailHelper", "::", "qpContentTransferEncode", "(", "$", "this", "->", "_text_plain", ")", ".", "\"\\r...
Builds the text section of a text/plain email. Will return a string containing the section. Can be used to send to an email server directly. @return string
[ "Builds", "the", "text", "section", "of", "a", "text", "/", "plain", "email", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.emailgateway.php#L661-L672
symphonycms/symphony-2
symphony/lib/toolkit/class.emailgateway.php
EmailGateway.getSectionTextHtml
protected function getSectionTextHtml() { if ($this->_text_encoding == 'quoted-printable') { return EmailHelper::qpContentTransferEncode($this->_text_html)."\r\n"; } elseif ($this->_text_encoding == 'base64') { // don't add CRLF if using base64 - spam filters don't ...
php
protected function getSectionTextHtml() { if ($this->_text_encoding == 'quoted-printable') { return EmailHelper::qpContentTransferEncode($this->_text_html)."\r\n"; } elseif ($this->_text_encoding == 'base64') { // don't add CRLF if using base64 - spam filters don't ...
[ "protected", "function", "getSectionTextHtml", "(", ")", "{", "if", "(", "$", "this", "->", "_text_encoding", "==", "'quoted-printable'", ")", "{", "return", "EmailHelper", "::", "qpContentTransferEncode", "(", "$", "this", "->", "_text_html", ")", ".", "\"\\r\\...
Builds the html section of a text/html email. Will return a string containing the section. Can be used to send to an email server directly. @return string
[ "Builds", "the", "html", "section", "of", "a", "text", "/", "html", "email", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.emailgateway.php#L681-L691
symphonycms/symphony-2
symphony/lib/toolkit/class.emailgateway.php
EmailGateway.contentInfoArray
public function contentInfoArray($type = null, $file = null, $filename = null, $charset = null) { // Common descriptions $description = array( 'multipart/mixed' => array( 'Content-Type' => 'multipart/mixed; boundary="' .$this->getBoundary...
php
public function contentInfoArray($type = null, $file = null, $filename = null, $charset = null) { // Common descriptions $description = array( 'multipart/mixed' => array( 'Content-Type' => 'multipart/mixed; boundary="' .$this->getBoundary...
[ "public", "function", "contentInfoArray", "(", "$", "type", "=", "null", ",", "$", "file", "=", "null", ",", "$", "filename", "=", "null", ",", "$", "charset", "=", "null", ")", "{", "// Common descriptions", "$", "description", "=", "array", "(", "'mult...
Builds the right content-type/encoding types based on file and content-type. Will try to match a common description, based on the $type param. If nothing is found, will return a base64 attached file disposition. Can be used to send to an email server directly. @param string $type optional mime-type @param string $fi...
[ "Builds", "the", "right", "content", "-", "type", "/", "encoding", "types", "based", "on", "file", "and", "content", "-", "type", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.emailgateway.php#L709-L757
symphonycms/symphony-2
symphony/lib/toolkit/class.emailgateway.php
EmailGateway.contentInfoString
protected function contentInfoString($type = null, $file = null, $filename = null, $charset = null) { $data = $this->contentInfoArray($type, $file, $filename, $charset); $fields = array(); foreach ($data as $key => $value) { $fields[] = EmailHelper::fold(sprintf('%s: %s', $key, ...
php
protected function contentInfoString($type = null, $file = null, $filename = null, $charset = null) { $data = $this->contentInfoArray($type, $file, $filename, $charset); $fields = array(); foreach ($data as $key => $value) { $fields[] = EmailHelper::fold(sprintf('%s: %s', $key, ...
[ "protected", "function", "contentInfoString", "(", "$", "type", "=", "null", ",", "$", "file", "=", "null", ",", "$", "filename", "=", "null", ",", "$", "charset", "=", "null", ")", "{", "$", "data", "=", "$", "this", "->", "contentInfoArray", "(", "...
Creates the properly formatted InfoString based on the InfoArray. @see EmailGateway::contentInfoArray() @return string|null
[ "Creates", "the", "properly", "formatted", "InfoString", "based", "on", "the", "InfoArray", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.emailgateway.php#L766-L776
symphonycms/symphony-2
symphony/lib/toolkit/class.emailgateway.php
EmailGateway.__toCamel
private function __toCamel($string, $caseFirst = false) { $string = strtolower($string); $a = explode('_', $string); $a = array_map('ucfirst', $a); if (!$caseFirst) { $a[0] = lcfirst($a[0]); } return implode('', $a); }
php
private function __toCamel($string, $caseFirst = false) { $string = strtolower($string); $a = explode('_', $string); $a = array_map('ucfirst', $a); if (!$caseFirst) { $a[0] = lcfirst($a[0]); } return implode('', $a); }
[ "private", "function", "__toCamel", "(", "$", "string", ",", "$", "caseFirst", "=", "false", ")", "{", "$", "string", "=", "strtolower", "(", "$", "string", ")", ";", "$", "a", "=", "explode", "(", "'_'", ",", "$", "string", ")", ";", "$", "a", "...
Internal function to turn underscored variables into camelcase, for use in methods. Because Symphony has a difference in naming between properties and methods (underscored vs camelcased) and the Email class uses the magic __set function to find property-setting-methods, this conversion is needed. @param string $string...
[ "Internal", "function", "to", "turn", "underscored", "variables", "into", "camelcase", "for", "use", "in", "methods", ".", "Because", "Symphony", "has", "a", "difference", "in", "naming", "between", "properties", "and", "methods", "(", "underscored", "vs", "came...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.emailgateway.php#L882-L893
symphonycms/symphony-2
symphony/lib/toolkit/class.emailgateway.php
EmailGateway.__fromCamel
private function __fromCamel($string) { $string[0] = strtolower($string[0]); return preg_replace_callback('/([A-Z])/', function($c) { return "_" . strtolower($c[1]); }, $string); }
php
private function __fromCamel($string) { $string[0] = strtolower($string[0]); return preg_replace_callback('/([A-Z])/', function($c) { return "_" . strtolower($c[1]); }, $string); }
[ "private", "function", "__fromCamel", "(", "$", "string", ")", "{", "$", "string", "[", "0", "]", "=", "strtolower", "(", "$", "string", "[", "0", "]", ")", ";", "return", "preg_replace_callback", "(", "'/([A-Z])/'", ",", "function", "(", "$", "c", ")"...
The reverse of the __toCamel function. @param string $string The string to convert @return string
[ "The", "reverse", "of", "the", "__toCamel", "function", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.emailgateway.php#L902-L909
symphonycms/symphony-2
symphony/lib/toolkit/class.mysql.php
MySQL.flush
public function flush() { $this->_result = null; $this->_lastResult = array(); $this->_lastQuery = null; $this->_lastQueryHash = null; }
php
public function flush() { $this->_result = null; $this->_lastResult = array(); $this->_lastQuery = null; $this->_lastQueryHash = null; }
[ "public", "function", "flush", "(", ")", "{", "$", "this", "->", "_result", "=", "null", ";", "$", "this", "->", "_lastResult", "=", "array", "(", ")", ";", "$", "this", "->", "_lastQuery", "=", "null", ";", "$", "this", "->", "_lastQueryHash", "=", ...
Resets the result, `$this->_lastResult` and `$this->_lastQuery` to their empty values. Called on each query and when the class is destroyed.
[ "Resets", "the", "result", "$this", "-", ">", "_lastResult", "and", "$this", "-", ">", "_lastQuery", "to", "their", "empty", "values", ".", "Called", "on", "each", "query", "and", "when", "the", "class", "is", "destroyed", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.mysql.php#L175-L181
symphonycms/symphony-2
symphony/lib/toolkit/class.mysql.php
MySQL.isConnected
public static function isConnected() { try { $connected = ( isset(self::$_connection['id']) && !is_null(self::$_connection['id']) ); } catch (Exception $ex) { return false; } return $connected; }
php
public static function isConnected() { try { $connected = ( isset(self::$_connection['id']) && !is_null(self::$_connection['id']) ); } catch (Exception $ex) { return false; } return $connected; }
[ "public", "static", "function", "isConnected", "(", ")", "{", "try", "{", "$", "connected", "=", "(", "isset", "(", "self", "::", "$", "_connection", "[", "'id'", "]", ")", "&&", "!", "is_null", "(", "self", "::", "$", "_connection", "[", "'id'", "]"...
Determines if a connection has been made to the MySQL server @return boolean
[ "Determines", "if", "a", "connection", "has", "been", "made", "to", "the", "MySQL", "server" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.mysql.php#L295-L307
symphonycms/symphony-2
symphony/lib/toolkit/class.mysql.php
MySQL.connect
public function connect($host = null, $user = null, $password = null, $port = '3306', $database = null) { self::$_connection = array( 'host' => $host, 'user' => $user, 'pass' => $password, 'port' => $port, 'database' => $database ); ...
php
public function connect($host = null, $user = null, $password = null, $port = '3306', $database = null) { self::$_connection = array( 'host' => $host, 'user' => $user, 'pass' => $password, 'port' => $port, 'database' => $database ); ...
[ "public", "function", "connect", "(", "$", "host", "=", "null", ",", "$", "user", "=", "null", ",", "$", "password", "=", "null", ",", "$", "port", "=", "'3306'", ",", "$", "database", "=", "null", ")", "{", "self", "::", "$", "_connection", "=", ...
Creates a connect to the database server given the credentials. If an error occurs, a `DatabaseException` is thrown, otherwise true is returned @param string $host Defaults to null, which MySQL assumes as localhost. @param string $user Defaults to null @param string $password Defaults to null @param string $port Defau...
[ "Creates", "a", "connect", "to", "the", "database", "server", "given", "the", "credentials", ".", "If", "an", "error", "occurs", "a", "DatabaseException", "is", "thrown", "otherwise", "true", "is", "returned" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.mysql.php#L338-L365
symphonycms/symphony-2
symphony/lib/toolkit/class.mysql.php
MySQL.setTimeZone
public function setTimeZone($timezone = null) { if (is_null($timezone)) { return; } // What is the time now in the install timezone $symphony_date = new DateTime('now', new DateTimeZone($timezone)); // MySQL wants the offset to be in the format +/-H:I, getOffset...
php
public function setTimeZone($timezone = null) { if (is_null($timezone)) { return; } // What is the time now in the install timezone $symphony_date = new DateTime('now', new DateTimeZone($timezone)); // MySQL wants the offset to be in the format +/-H:I, getOffset...
[ "public", "function", "setTimeZone", "(", "$", "timezone", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "timezone", ")", ")", "{", "return", ";", "}", "// What is the time now in the install timezone", "$", "symphony_date", "=", "new", "DateTime", "(...
Sets the MySQL connection to use this timezone instead of the default MySQL server timezone. @throws DatabaseException @link https://dev.mysql.com/doc/refman/5.6/en/time-zone-support.html @link https://github.com/symphonycms/symphony-2/issues/1726 @since Symphony 2.3.3 @param string $timezone Timezone will human reada...
[ "Sets", "the", "MySQL", "connection", "to", "use", "this", "timezone", "instead", "of", "the", "default", "MySQL", "server", "timezone", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.mysql.php#L421-L437
symphonycms/symphony-2
symphony/lib/toolkit/class.mysql.php
MySQL.cleanValue
public static function cleanValue($value) { if (function_exists('mysqli_real_escape_string') && self::isConnected()) { return mysqli_real_escape_string(self::$_connection['id'], $value); } else { return addslashes($value); } }
php
public static function cleanValue($value) { if (function_exists('mysqli_real_escape_string') && self::isConnected()) { return mysqli_real_escape_string(self::$_connection['id'], $value); } else { return addslashes($value); } }
[ "public", "static", "function", "cleanValue", "(", "$", "value", ")", "{", "if", "(", "function_exists", "(", "'mysqli_real_escape_string'", ")", "&&", "self", "::", "isConnected", "(", ")", ")", "{", "return", "mysqli_real_escape_string", "(", "self", "::", "...
This function will clean a string using the `mysqli_real_escape_string` function taking into account the current database character encoding. Note that this function does not encode _ or %. If `mysqli_real_escape_string` doesn't exist, `addslashes` will be used as a backup option @param string $value The string to be ...
[ "This", "function", "will", "clean", "a", "string", "using", "the", "mysqli_real_escape_string", "function", "taking", "into", "account", "the", "current", "database", "character", "encoding", ".", "Note", "that", "this", "function", "does", "not", "encode", "_", ...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.mysql.php#L450-L457
symphonycms/symphony-2
symphony/lib/toolkit/class.mysql.php
MySQL.cleanFields
public static function cleanFields(array &$array) { foreach ($array as $key => $val) { // Handle arrays with more than 1 level if (is_array($val)) { self::cleanFields($val); continue; } elseif (strlen($val) == 0) { $array[$...
php
public static function cleanFields(array &$array) { foreach ($array as $key => $val) { // Handle arrays with more than 1 level if (is_array($val)) { self::cleanFields($val); continue; } elseif (strlen($val) == 0) { $array[$...
[ "public", "static", "function", "cleanFields", "(", "array", "&", "$", "array", ")", "{", "foreach", "(", "$", "array", "as", "$", "key", "=>", "$", "val", ")", "{", "// Handle arrays with more than 1 level", "if", "(", "is_array", "(", "$", "val", ")", ...
This function will apply the `cleanValue` function to an associative array of data, encoding only the value, not the key. This function can handle recursive arrays. This function manipulates the given parameter by reference. @see cleanValue @param array $array The associative array of data to encode, this parameter is...
[ "This", "function", "will", "apply", "the", "cleanValue", "function", "to", "an", "associative", "array", "of", "data", "encoding", "only", "the", "value", "not", "the", "key", ".", "This", "function", "can", "handle", "recursive", "arrays", ".", "This", "fu...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.mysql.php#L470-L484
symphonycms/symphony-2
symphony/lib/toolkit/class.mysql.php
MySQL.query
public function query($query, $type = "OBJECT") { if (empty($query) || self::isConnected() === false) { return false; } $start = precision_timer(); $query = trim($query); $query_type = $this->determineQueryType($query); $query_hash = md5($query.$start); ...
php
public function query($query, $type = "OBJECT") { if (empty($query) || self::isConnected() === false) { return false; } $start = precision_timer(); $query = trim($query); $query_type = $this->determineQueryType($query); $query_hash = md5($query.$start); ...
[ "public", "function", "query", "(", "$", "query", ",", "$", "type", "=", "\"OBJECT\"", ")", "{", "if", "(", "empty", "(", "$", "query", ")", "||", "self", "::", "isConnected", "(", ")", "===", "false", ")", "{", "return", "false", ";", "}", "$", ...
Takes an SQL string and executes it. This function will apply query caching if it is a read operation and if query caching is set. Symphony will convert the `tbl_` prefix of tables to be the one set during installation. A type parameter is provided to specify whether `$this->_lastResult` will be an array of objects or ...
[ "Takes", "an", "SQL", "string", "and", "executes", "it", ".", "This", "function", "will", "apply", "query", "caching", "if", "it", "is", "a", "read", "operation", "and", "if", "query", "caching", "is", "set", ".", "Symphony", "will", "convert", "the", "t...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.mysql.php#L520-L620
symphonycms/symphony-2
symphony/lib/toolkit/class.mysql.php
MySQL.insert
public function insert(array $fields, $table, $updateOnDuplicate = false) { // Multiple Insert if (is_array(current($fields))) { $sql = "INSERT INTO `$table` (`".implode('`, `', array_keys(current($fields))).'`) VALUES '; $rows = array(); foreach ($fields as $ke...
php
public function insert(array $fields, $table, $updateOnDuplicate = false) { // Multiple Insert if (is_array(current($fields))) { $sql = "INSERT INTO `$table` (`".implode('`, `', array_keys(current($fields))).'`) VALUES '; $rows = array(); foreach ($fields as $ke...
[ "public", "function", "insert", "(", "array", "$", "fields", ",", "$", "table", ",", "$", "updateOnDuplicate", "=", "false", ")", "{", "// Multiple Insert", "if", "(", "is_array", "(", "current", "(", "$", "fields", ")", ")", ")", "{", "$", "sql", "=",...
A convenience method to insert data into the Database. This function takes an associative array of data to input, with the keys being the column names and the table. An optional parameter exposes MySQL's ON DUPLICATE KEY UPDATE functionality, which will update the values if a duplicate key is found. @param array $fiel...
[ "A", "convenience", "method", "to", "insert", "data", "into", "the", "Database", ".", "This", "function", "takes", "an", "associative", "array", "of", "data", "to", "input", "with", "the", "keys", "being", "the", "column", "names", "and", "the", "table", "...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.mysql.php#L655-L691
symphonycms/symphony-2
symphony/lib/toolkit/class.mysql.php
MySQL.update
public function update($fields, $table, $where = null) { self::cleanFields($fields); $sql = "UPDATE $table SET "; $rows = array(); foreach ($fields as $key => $val) { $rows[] = " `$key` = $val"; } $sql .= implode(', ', $rows) . (!is_null($where) ? ' WHER...
php
public function update($fields, $table, $where = null) { self::cleanFields($fields); $sql = "UPDATE $table SET "; $rows = array(); foreach ($fields as $key => $val) { $rows[] = " `$key` = $val"; } $sql .= implode(', ', $rows) . (!is_null($where) ? ' WHER...
[ "public", "function", "update", "(", "$", "fields", ",", "$", "table", ",", "$", "where", "=", "null", ")", "{", "self", "::", "cleanFields", "(", "$", "fields", ")", ";", "$", "sql", "=", "\"UPDATE $table SET \"", ";", "$", "rows", "=", "array", "("...
A convenience method to update data that exists in the Database. This function takes an associative array of data to input, with the keys being the column names and the table. A WHERE statement can be provided to select the rows to update @param array $fields An associative array of data to input, with the key's mappi...
[ "A", "convenience", "method", "to", "update", "data", "that", "exists", "in", "the", "Database", ".", "This", "function", "takes", "an", "associative", "array", "of", "data", "to", "input", "with", "the", "keys", "being", "the", "column", "names", "and", "...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.mysql.php#L711-L724
symphonycms/symphony-2
symphony/lib/toolkit/class.mysql.php
MySQL.delete
public function delete($table, $where = null) { $sql = "DELETE FROM `$table`"; if (!is_null($where)) { $sql .= " WHERE $where"; } return $this->query($sql); }
php
public function delete($table, $where = null) { $sql = "DELETE FROM `$table`"; if (!is_null($where)) { $sql .= " WHERE $where"; } return $this->query($sql); }
[ "public", "function", "delete", "(", "$", "table", ",", "$", "where", "=", "null", ")", "{", "$", "sql", "=", "\"DELETE FROM `$table`\"", ";", "if", "(", "!", "is_null", "(", "$", "where", ")", ")", "{", "$", "sql", ".=", "\" WHERE $where\"", ";", "}...
Given a table name and a WHERE statement, delete rows from the Database. @param string $table The table name, including the tbl prefix which will be changed to this Symphony's table prefix in the query function @param string $where A WHERE statement for this DELETE statement, defaults to null, which will delete all ro...
[ "Given", "a", "table", "name", "and", "a", "WHERE", "statement", "delete", "rows", "from", "the", "Database", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.mysql.php#L739-L748
symphonycms/symphony-2
symphony/lib/toolkit/class.mysql.php
MySQL.fetch
public function fetch($query = null, $index_by_column = null) { if (!is_null($query)) { $this->query($query, "ASSOC"); } elseif (is_null($this->_lastResult)) { return array(); } $result = $this->_lastResult; if (!is_null($index_by_column) && isset($r...
php
public function fetch($query = null, $index_by_column = null) { if (!is_null($query)) { $this->query($query, "ASSOC"); } elseif (is_null($this->_lastResult)) { return array(); } $result = $this->_lastResult; if (!is_null($index_by_column) && isset($r...
[ "public", "function", "fetch", "(", "$", "query", "=", "null", ",", "$", "index_by_column", "=", "null", ")", "{", "if", "(", "!", "is_null", "(", "$", "query", ")", ")", "{", "$", "this", "->", "query", "(", "$", "query", ",", "\"ASSOC\"", ")", ...
Returns an associative array that contains the results of the given `$query`. Optionally, the resulting array can be indexed by a particular column. @param string $query The full SQL query to execute. Defaults to null, which will use the _lastResult @param string $index_by_column The name of a column in the table to u...
[ "Returns", "an", "associative", "array", "that", "contains", "the", "results", "of", "the", "given", "$query", ".", "Optionally", "the", "resulting", "array", "can", "be", "indexed", "by", "a", "particular", "column", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.mysql.php#L767-L788
symphonycms/symphony-2
symphony/lib/toolkit/class.mysql.php
MySQL.fetchRow
public function fetchRow($offset = 0, $query = null) { $result = $this->fetch($query); return (empty($result) ? array() : $result[$offset]); }
php
public function fetchRow($offset = 0, $query = null) { $result = $this->fetch($query); return (empty($result) ? array() : $result[$offset]); }
[ "public", "function", "fetchRow", "(", "$", "offset", "=", "0", ",", "$", "query", "=", "null", ")", "{", "$", "result", "=", "$", "this", "->", "fetch", "(", "$", "query", ")", ";", "return", "(", "empty", "(", "$", "result", ")", "?", "array", ...
Returns the row at the specified index from the given query. If no query is given, it will use the `$this->_lastResult`. If no offset is provided, the function will return the first row. This function does not imply any LIMIT to the given `$query`, so for the more efficient use, it is recommended that the `$query` have...
[ "Returns", "the", "row", "at", "the", "specified", "index", "from", "the", "given", "query", ".", "If", "no", "query", "is", "given", "it", "will", "use", "the", "$this", "-", ">", "_lastResult", ".", "If", "no", "offset", "is", "provided", "the", "fun...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.mysql.php#L809-L813
symphonycms/symphony-2
symphony/lib/toolkit/class.mysql.php
MySQL.fetchCol
public function fetchCol($column, $query = null) { $result = $this->fetch($query); if (empty($result)) { return array(); } $rows = array(); foreach ($result as $row) { $rows[] = $row[$column]; } return $rows; }
php
public function fetchCol($column, $query = null) { $result = $this->fetch($query); if (empty($result)) { return array(); } $rows = array(); foreach ($result as $row) { $rows[] = $row[$column]; } return $rows; }
[ "public", "function", "fetchCol", "(", "$", "column", ",", "$", "query", "=", "null", ")", "{", "$", "result", "=", "$", "this", "->", "fetch", "(", "$", "query", ")", ";", "if", "(", "empty", "(", "$", "result", ")", ")", "{", "return", "array",...
Returns an array of values for a specified column in a given query. If no query is given, it will use the `$this->_lastResult`. @param string $column The column name in the query to return the values for @param string $query The full SQL query to execute. Defaults to null, which will use the `$this->_lastResult` @thro...
[ "Returns", "an", "array", "of", "values", "for", "a", "specified", "column", "in", "a", "given", "query", ".", "If", "no", "query", "is", "given", "it", "will", "use", "the", "$this", "-", ">", "_lastResult", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.mysql.php#L829-L843
symphonycms/symphony-2
symphony/lib/toolkit/class.mysql.php
MySQL.fetchVar
public function fetchVar($column, $offset = 0, $query = null) { $result = $this->fetch($query); return (empty($result) ? null : $result[$offset][$column]); }
php
public function fetchVar($column, $offset = 0, $query = null) { $result = $this->fetch($query); return (empty($result) ? null : $result[$offset][$column]); }
[ "public", "function", "fetchVar", "(", "$", "column", ",", "$", "offset", "=", "0", ",", "$", "query", "=", "null", ")", "{", "$", "result", "=", "$", "this", "->", "fetch", "(", "$", "query", ")", ";", "return", "(", "empty", "(", "$", "result",...
Returns the value for a specified column at a specified offset. If no offset is provided, it will return the value for column of the first row. If no query is given, it will use the `$this->_lastResult`. @param string $column The column name in the query to return the values for @param integer $offset The row to use t...
[ "Returns", "the", "value", "for", "a", "specified", "column", "at", "a", "specified", "offset", ".", "If", "no", "offset", "is", "provided", "it", "will", "return", "the", "value", "for", "column", "of", "the", "first", "row", ".", "If", "no", "query", ...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.mysql.php#L864-L868
symphonycms/symphony-2
symphony/lib/toolkit/class.mysql.php
MySQL.tableContainsField
public function tableContainsField($table, $field) { $table = MySQL::cleanValue($table); $field = MySQL::cleanValue($field); $results = $this->fetch("DESC `{$table}` `{$field}`"); return (is_array($results) && !empty($results)); }
php
public function tableContainsField($table, $field) { $table = MySQL::cleanValue($table); $field = MySQL::cleanValue($field); $results = $this->fetch("DESC `{$table}` `{$field}`"); return (is_array($results) && !empty($results)); }
[ "public", "function", "tableContainsField", "(", "$", "table", ",", "$", "field", ")", "{", "$", "table", "=", "MySQL", "::", "cleanValue", "(", "$", "table", ")", ";", "$", "field", "=", "MySQL", "::", "cleanValue", "(", "$", "field", ")", ";", "$",...
This function takes `$table` and `$field` names and returns boolean if the `$table` contains the `$field`. @since Symphony 2.3 @link https://dev.mysql.com/doc/refman/en/describe.html @param string $table The table name @param string $field The field name @throws DatabaseException @return boolean true if `$table` cont...
[ "This", "function", "takes", "$table", "and", "$field", "names", "and", "returns", "boolean", "if", "the", "$table", "contains", "the", "$field", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.mysql.php#L884-L890
symphonycms/symphony-2
symphony/lib/toolkit/class.mysql.php
MySQL.tableExists
public function tableExists($table) { $table = MySQL::cleanValue($table); $results = $this->fetch(sprintf("SHOW TABLES LIKE '%s'", $table)); return (is_array($results) && !empty($results)); }
php
public function tableExists($table) { $table = MySQL::cleanValue($table); $results = $this->fetch(sprintf("SHOW TABLES LIKE '%s'", $table)); return (is_array($results) && !empty($results)); }
[ "public", "function", "tableExists", "(", "$", "table", ")", "{", "$", "table", "=", "MySQL", "::", "cleanValue", "(", "$", "table", ")", ";", "$", "results", "=", "$", "this", "->", "fetch", "(", "sprintf", "(", "\"SHOW TABLES LIKE '%s'\"", ",", "$", ...
This function takes `$table` and returns boolean if it exists or not. @since Symphony 2.3.4 @link https://dev.mysql.com/doc/refman/en/show-tables.html @param string $table The table name @throws DatabaseException @return boolean true if `$table` exists, false otherwise
[ "This", "function", "takes", "$table", "and", "returns", "boolean", "if", "it", "exists", "or", "not", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.mysql.php#L904-L909
symphonycms/symphony-2
symphony/lib/toolkit/class.mysql.php
MySQL.__error
private function __error($type = null) { if ($type == 'connect') { $msg = mysqli_connect_error(); $errornum = mysqli_connect_errno(); } else { $msg = mysqli_error(self::$_connection['id']); $errornum = mysqli_errno(self::$_connection['id']); } ...
php
private function __error($type = null) { if ($type == 'connect') { $msg = mysqli_connect_error(); $errornum = mysqli_connect_errno(); } else { $msg = mysqli_error(self::$_connection['id']); $errornum = mysqli_errno(self::$_connection['id']); } ...
[ "private", "function", "__error", "(", "$", "type", "=", "null", ")", "{", "if", "(", "$", "type", "==", "'connect'", ")", "{", "$", "msg", "=", "mysqli_connect_error", "(", ")", ";", "$", "errornum", "=", "mysqli_connect_errno", "(", ")", ";", "}", ...
If an error occurs in a query, this function is called which logs the last query and the error number and error message from MySQL before throwing a `DatabaseException` @uses QueryExecutionError @throws DatabaseException @param string $type Accepts one parameter, 'connect', which will return the correct error codes wh...
[ "If", "an", "error", "occurs", "in", "a", "query", "this", "function", "is", "called", "which", "logs", "the", "last", "query", "and", "the", "error", "number", "and", "error", "message", "from", "MySQL", "before", "throwing", "a", "DatabaseException" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.mysql.php#L922-L969
symphonycms/symphony-2
symphony/lib/toolkit/class.mysql.php
MySQL.debug
public function debug($type = null) { if (!$type) { return self::$_log; } return ($type == 'error' ? self::$_log['error'] : self::$_log['query']); }
php
public function debug($type = null) { if (!$type) { return self::$_log; } return ($type == 'error' ? self::$_log['error'] : self::$_log['query']); }
[ "public", "function", "debug", "(", "$", "type", "=", "null", ")", "{", "if", "(", "!", "$", "type", ")", "{", "return", "self", "::", "$", "_log", ";", "}", "return", "(", "$", "type", "==", "'error'", "?", "self", "::", "$", "_log", "[", "'er...
Returns all the log entries by type. There are two valid types, error and debug. If no type is given, the entire log is returned, otherwise only log messages for that type are returned @param null|string $type @return array An array of associative array's. Log entries of the error type return the query the error occur...
[ "Returns", "all", "the", "log", "entries", "by", "type", ".", "There", "are", "two", "valid", "types", "error", "and", "debug", ".", "If", "no", "type", "is", "given", "the", "entire", "log", "is", "returned", "otherwise", "only", "log", "messages", "for...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.mysql.php#L984-L991
symphonycms/symphony-2
symphony/lib/toolkit/class.mysql.php
MySQL.getStatistics
public function getStatistics() { $query_timer = 0.0; $slow_queries = array(); foreach (self::$_log as $key => $val) { $query_timer += $val['execution_time']; if ($val['execution_time'] > 0.0999) { $slow_queries[] = $val; } } ...
php
public function getStatistics() { $query_timer = 0.0; $slow_queries = array(); foreach (self::$_log as $key => $val) { $query_timer += $val['execution_time']; if ($val['execution_time'] > 0.0999) { $slow_queries[] = $val; } } ...
[ "public", "function", "getStatistics", "(", ")", "{", "$", "query_timer", "=", "0.0", ";", "$", "slow_queries", "=", "array", "(", ")", ";", "foreach", "(", "self", "::", "$", "_log", "as", "$", "key", "=>", "$", "val", ")", "{", "$", "query_timer", ...
Returns some basic statistics from the MySQL class about the number of queries, the time it took to query and any slow queries. A slow query is defined as one that took longer than 0.0999 seconds This function is used by the Profile devkit @return array An associative array with the number of queries, an array of slow...
[ "Returns", "some", "basic", "statistics", "from", "the", "MySQL", "class", "about", "the", "number", "of", "queries", "the", "time", "it", "took", "to", "query", "and", "any", "slow", "queries", ".", "A", "slow", "query", "is", "defined", "as", "one", "t...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.mysql.php#L1003-L1020
symphonycms/symphony-2
symphony/lib/toolkit/class.mysql.php
MySQL.import
public function import($sql, $force_engine = false) { if ($force_engine) { // Silently attempt to change the storage engine. This prevents INNOdb errors. $this->query('SET default_storage_engine = MYISAM'); } $queries = preg_split('/;[\\r\\n]+/', $sql, -1, PREG_SPLIT...
php
public function import($sql, $force_engine = false) { if ($force_engine) { // Silently attempt to change the storage engine. This prevents INNOdb errors. $this->query('SET default_storage_engine = MYISAM'); } $queries = preg_split('/;[\\r\\n]+/', $sql, -1, PREG_SPLIT...
[ "public", "function", "import", "(", "$", "sql", ",", "$", "force_engine", "=", "false", ")", "{", "if", "(", "$", "force_engine", ")", "{", "// Silently attempt to change the storage engine. This prevents INNOdb errors.", "$", "this", "->", "query", "(", "'SET defa...
Convenience function to allow you to execute multiple SQL queries at once by providing a string with the queries delimited with a `;` @throws DatabaseException @throws Exception @param string $sql A string containing SQL queries delimited by `;` @param boolean $force_engine If set to true, this will set MySQL's defaul...
[ "Convenience", "function", "to", "allow", "you", "to", "execute", "multiple", "SQL", "queries", "at", "once", "by", "providing", "a", "string", "with", "the", "queries", "delimited", "with", "a", ";" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.mysql.php#L1038-L1062
symphonycms/symphony-2
symphony/content/class.sortable.php
Sortable.initialize
public static function initialize(HTMLPage $object, &$result, &$sort, &$order, array $params = array()) { if (isset($_REQUEST['sort'])) { $sort = $_REQUEST['sort']; } else { $sort = null; } if (isset($_REQUEST['order'])) { $order = ($_REQUEST['ord...
php
public static function initialize(HTMLPage $object, &$result, &$sort, &$order, array $params = array()) { if (isset($_REQUEST['sort'])) { $sort = $_REQUEST['sort']; } else { $sort = null; } if (isset($_REQUEST['order'])) { $order = ($_REQUEST['ord...
[ "public", "static", "function", "initialize", "(", "HTMLPage", "$", "object", ",", "&", "$", "result", ",", "&", "$", "sort", ",", "&", "$", "order", ",", "array", "$", "params", "=", "array", "(", ")", ")", "{", "if", "(", "isset", "(", "$", "_R...
This method initializes the `$result`, `$sort` and `$order` variables by using the `$_REQUEST` array. The `$result` is passed by reference, and is return of calling the `$object->sort()` method. It is this method that actually invokes the sorting inside the `$object`. @param HTMLPage $object The object responsible for...
[ "This", "method", "initializes", "the", "$result", "$sort", "and", "$order", "variables", "by", "using", "the", "$_REQUEST", "array", ".", "The", "$result", "is", "passed", "by", "reference", "and", "is", "return", "of", "calling", "the", "$object", "-", ">"...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/content/class.sortable.php#L40-L55
symphonycms/symphony-2
symphony/content/class.sortable.php
Sortable.buildTableHeaders
public static function buildTableHeaders($columns, $sort, $order, $extra_url_params = null) { $aTableHead = array(); foreach ($columns as $c) { if ($c['sortable']) { $label = new XMLElement('span', $c['label']); $label = $label->generate(); ...
php
public static function buildTableHeaders($columns, $sort, $order, $extra_url_params = null) { $aTableHead = array(); foreach ($columns as $c) { if ($c['sortable']) { $label = new XMLElement('span', $c['label']); $label = $label->generate(); ...
[ "public", "static", "function", "buildTableHeaders", "(", "$", "columns", ",", "$", "sort", ",", "$", "order", ",", "$", "extra_url_params", "=", "null", ")", "{", "$", "aTableHead", "=", "array", "(", ")", ";", "foreach", "(", "$", "columns", "as", "$...
This method builds the markup for sorting-aware table headers. It accepts an `$columns` array, as well as the current sorting axis `$sort` and the current sort order, `$order`. If `$extra_url_params` are provided, they are appended to the redirect string upon clicking on a table header. 'label' => 'Column label', 'sor...
[ "This", "method", "builds", "the", "markup", "for", "sorting", "-", "aware", "table", "headers", ".", "It", "accepts", "an", "$columns", "array", "as", "well", "as", "the", "current", "sorting", "axis", "$sort", "and", "the", "current", "sort", "order", "$...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/content/class.sortable.php#L83-L125
symphonycms/symphony-2
symphony/lib/toolkit/fields/field.select.php
FieldSelect.findAndAddDynamicOptions
public function findAndAddDynamicOptions(&$values) { if (!is_array($values)) { $values = array(); } $results = false; // Fixes #1802 if (!Symphony::Database()->tableExists('tbl_entries_data_' . $this->get('dynamic_options'))) { return; } ...
php
public function findAndAddDynamicOptions(&$values) { if (!is_array($values)) { $values = array(); } $results = false; // Fixes #1802 if (!Symphony::Database()->tableExists('tbl_entries_data_' . $this->get('dynamic_options'))) { return; } ...
[ "public", "function", "findAndAddDynamicOptions", "(", "&", "$", "values", ")", "{", "if", "(", "!", "is_array", "(", "$", "values", ")", ")", "{", "$", "values", "=", "array", "(", ")", ";", "}", "$", "results", "=", "false", ";", "// Fixes #1802", ...
/*------------------------------------------------------------------------- Utilities: -------------------------------------------------------------------------
[ "/", "*", "-------------------------------------------------------------------------", "Utilities", ":", "-------------------------------------------------------------------------" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/fields/field.select.php#L127-L175
symphonycms/symphony-2
symphony/lib/toolkit/fields/field.select.php
FieldSelect.findDefaults
public function findDefaults(array &$settings) { if (!isset($settings['allow_multiple_selection'])) { $settings['allow_multiple_selection'] = 'no'; } if (!isset($settings['show_association'])) { $settings['show_association'] = 'no'; } if (!isset($set...
php
public function findDefaults(array &$settings) { if (!isset($settings['allow_multiple_selection'])) { $settings['allow_multiple_selection'] = 'no'; } if (!isset($settings['show_association'])) { $settings['show_association'] = 'no'; } if (!isset($set...
[ "public", "function", "findDefaults", "(", "array", "&", "$", "settings", ")", "{", "if", "(", "!", "isset", "(", "$", "settings", "[", "'allow_multiple_selection'", "]", ")", ")", "{", "$", "settings", "[", "'allow_multiple_selection'", "]", "=", "'no'", ...
/*------------------------------------------------------------------------- Settings: -------------------------------------------------------------------------
[ "/", "*", "-------------------------------------------------------------------------", "Settings", ":", "-------------------------------------------------------------------------" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/fields/field.select.php#L181-L194
symphonycms/symphony-2
symphony/lib/toolkit/fields/field.select.php
FieldSelect.displayPublishPanel
public function displayPublishPanel(XMLElement &$wrapper, $data = null, $flagWithError = null, $fieldnamePrefix = null, $fieldnamePostfix = null, $entry_id = null) { $states = $this->getToggleStates(); $value = isset($data['value']) ? $data['value'] : null; if (!is_array($value)) { ...
php
public function displayPublishPanel(XMLElement &$wrapper, $data = null, $flagWithError = null, $fieldnamePrefix = null, $fieldnamePostfix = null, $entry_id = null) { $states = $this->getToggleStates(); $value = isset($data['value']) ? $data['value'] : null; if (!is_array($value)) { ...
[ "public", "function", "displayPublishPanel", "(", "XMLElement", "&", "$", "wrapper", ",", "$", "data", "=", "null", ",", "$", "flagWithError", "=", "null", ",", "$", "fieldnamePrefix", "=", "null", ",", "$", "fieldnamePostfix", "=", "null", ",", "$", "entr...
/*------------------------------------------------------------------------- Publish: -------------------------------------------------------------------------
[ "/", "*", "-------------------------------------------------------------------------", "Publish", ":", "-------------------------------------------------------------------------" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/fields/field.select.php#L317-L354
symphonycms/symphony-2
symphony/lib/toolkit/fields/field.select.php
FieldSelect.prepareImportValue
public function prepareImportValue($data, $mode, $entry_id = null) { $message = $status = null; $modes = (object)$this->getImportModes(); if (!is_array($data)) { $data = array($data); } if ($mode === $modes->getValue) { if ($this->get('allow_multiple...
php
public function prepareImportValue($data, $mode, $entry_id = null) { $message = $status = null; $modes = (object)$this->getImportModes(); if (!is_array($data)) { $data = array($data); } if ($mode === $modes->getValue) { if ($this->get('allow_multiple...
[ "public", "function", "prepareImportValue", "(", "$", "data", ",", "$", "mode", ",", "$", "entry_id", "=", "null", ")", "{", "$", "message", "=", "$", "status", "=", "null", ";", "$", "modes", "=", "(", "object", ")", "$", "this", "->", "getImportMod...
/*------------------------------------------------------------------------- Import: -------------------------------------------------------------------------
[ "/", "*", "-------------------------------------------------------------------------", "Import", ":", "-------------------------------------------------------------------------" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/fields/field.select.php#L404-L424
symphonycms/symphony-2
symphony/lib/toolkit/fields/field.select.php
FieldSelect.getExportModes
public function getExportModes() { return array( 'listHandle' => ExportableField::LIST_OF + ExportableField::HANDLE, 'listValue' => ExportableField::LIST_OF + ExportableField::VALUE, ...
php
public function getExportModes() { return array( 'listHandle' => ExportableField::LIST_OF + ExportableField::HANDLE, 'listValue' => ExportableField::LIST_OF + ExportableField::VALUE, ...
[ "public", "function", "getExportModes", "(", ")", "{", "return", "array", "(", "'listHandle'", "=>", "ExportableField", "::", "LIST_OF", "+", "ExportableField", "::", "HANDLE", ",", "'listValue'", "=>", "ExportableField", "::", "LIST_OF", "+", "ExportableField", "...
Return a list of supported export modes for use with `prepareExportValue`. @return array
[ "Return", "a", "list", "of", "supported", "export", "modes", "for", "use", "with", "prepareExportValue", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/fields/field.select.php#L435-L447
symphonycms/symphony-2
symphony/lib/toolkit/fields/field.select.php
FieldSelect.displayFilteringOptions
public function displayFilteringOptions(XMLElement &$wrapper) { $existing_options = $this->getToggleStates(); if (is_array($existing_options) && !empty($existing_options)) { $optionlist = new XMLElement('ul'); $optionlist->setAttribute('class', 'tags'); $optionli...
php
public function displayFilteringOptions(XMLElement &$wrapper) { $existing_options = $this->getToggleStates(); if (is_array($existing_options) && !empty($existing_options)) { $optionlist = new XMLElement('ul'); $optionlist->setAttribute('class', 'tags'); $optionli...
[ "public", "function", "displayFilteringOptions", "(", "XMLElement", "&", "$", "wrapper", ")", "{", "$", "existing_options", "=", "$", "this", "->", "getToggleStates", "(", ")", ";", "if", "(", "is_array", "(", "$", "existing_options", ")", "&&", "!", "empty"...
/*------------------------------------------------------------------------- Filtering: -------------------------------------------------------------------------
[ "/", "*", "-------------------------------------------------------------------------", "Filtering", ":", "-------------------------------------------------------------------------" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/fields/field.select.php#L498-L515
symphonycms/symphony-2
symphony/lib/toolkit/fields/field.select.php
FieldSelect.groupRecords
public function groupRecords($records) { if (!is_array($records) || empty($records)) { return; } $groups = array($this->get('element_name') => array()); foreach ($records as $r) { $data = $r->getData($this->get('id')); $value = General::sanitize(...
php
public function groupRecords($records) { if (!is_array($records) || empty($records)) { return; } $groups = array($this->get('element_name') => array()); foreach ($records as $r) { $data = $r->getData($this->get('id')); $value = General::sanitize(...
[ "public", "function", "groupRecords", "(", "$", "records", ")", "{", "if", "(", "!", "is_array", "(", "$", "records", ")", "||", "empty", "(", "$", "records", ")", ")", "{", "return", ";", "}", "$", "groups", "=", "array", "(", "$", "this", "->", ...
/*------------------------------------------------------------------------- Grouping: -------------------------------------------------------------------------
[ "/", "*", "-------------------------------------------------------------------------", "Grouping", ":", "-------------------------------------------------------------------------" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/fields/field.select.php#L521-L545
symphonycms/symphony-2
symphony/lib/toolkit/fields/field.select.php
FieldSelect.getExampleFormMarkup
public function getExampleFormMarkup() { $states = $this->getToggleStates(); $options = array(); foreach ($states as $handle => $v) { $options[] = array($v, null, $v); } $fieldname = 'fields['.$this->get('element_name').']'; if ($this->get('allow_multi...
php
public function getExampleFormMarkup() { $states = $this->getToggleStates(); $options = array(); foreach ($states as $handle => $v) { $options[] = array($v, null, $v); } $fieldname = 'fields['.$this->get('element_name').']'; if ($this->get('allow_multi...
[ "public", "function", "getExampleFormMarkup", "(", ")", "{", "$", "states", "=", "$", "this", "->", "getToggleStates", "(", ")", ";", "$", "options", "=", "array", "(", ")", ";", "foreach", "(", "$", "states", "as", "$", "handle", "=>", "$", "v", ")"...
/*------------------------------------------------------------------------- Events: -------------------------------------------------------------------------
[ "/", "*", "-------------------------------------------------------------------------", "Events", ":", "-------------------------------------------------------------------------" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/fields/field.select.php#L551-L571
symphonycms/symphony-2
symphony/lib/toolkit/class.event.php
Event.getNotificationTemplate
public static function getNotificationTemplate($language) { $langformat = '%s/email.entrycreated.%s.tpl'; $defaultformat = '%s/email.entrycreated.tpl'; if (file_exists($template = sprintf($langformat, WORKSPACE . '/template', $language))) { return $template; } elseif (fi...
php
public static function getNotificationTemplate($language) { $langformat = '%s/email.entrycreated.%s.tpl'; $defaultformat = '%s/email.entrycreated.tpl'; if (file_exists($template = sprintf($langformat, WORKSPACE . '/template', $language))) { return $template; } elseif (fi...
[ "public", "static", "function", "getNotificationTemplate", "(", "$", "language", ")", "{", "$", "langformat", "=", "'%s/email.entrycreated.%s.tpl'", ";", "$", "defaultformat", "=", "'%s/email.entrycreated.tpl'", ";", "if", "(", "file_exists", "(", "$", "template", "...
Returns the path to the email-notification-template by looking at the `WORKSPACE/template/` directory, then at the `TEMPLATES` directory for the convention `notification.*.tpl`. If the template is not found, false is returned @param string $language Language used in system @return mixed String, which is the path to th...
[ "Returns", "the", "path", "to", "the", "email", "-", "notification", "-", "template", "by", "looking", "at", "the", "WORKSPACE", "/", "template", "/", "directory", "then", "at", "the", "TEMPLATES", "directory", "for", "the", "convention", "notification", ".", ...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.event.php#L109-L125
symphonycms/symphony-2
symphony/lib/toolkit/class.sectionmanager.php
SectionManager.add
public static function add(array $settings) { $defaults = array(); $defaults['creation_date'] = $defaults['modification_date'] = DateTimeObj::get('Y-m-d H:i:s'); $defaults['creation_date_gmt'] = $defaults['modification_date_gmt'] = DateTimeObj::getGMT('Y-m-d H:i:s'); $defaults['autho...
php
public static function add(array $settings) { $defaults = array(); $defaults['creation_date'] = $defaults['modification_date'] = DateTimeObj::get('Y-m-d H:i:s'); $defaults['creation_date_gmt'] = $defaults['modification_date_gmt'] = DateTimeObj::getGMT('Y-m-d H:i:s'); $defaults['autho...
[ "public", "static", "function", "add", "(", "array", "$", "settings", ")", "{", "$", "defaults", "=", "array", "(", ")", ";", "$", "defaults", "[", "'creation_date'", "]", "=", "$", "defaults", "[", "'modification_date'", "]", "=", "DateTimeObj", "::", "...
Takes an associative array of Section settings and creates a new entry in the `tbl_sections` table, returning the ID of the Section. The ID of the section is generated using auto_increment and returned as the Section ID. @param array $settings An associative of settings for a section with the key being a column name f...
[ "Takes", "an", "associative", "array", "of", "Section", "settings", "and", "creates", "a", "new", "entry", "in", "the", "tbl_sections", "table", "returning", "the", "ID", "of", "the", "Section", ".", "The", "ID", "of", "the", "section", "is", "generated", ...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.sectionmanager.php#L35-L48
symphonycms/symphony-2
symphony/lib/toolkit/class.sectionmanager.php
SectionManager.edit
public static function edit($section_id, array $settings) { $defaults = array(); $defaults['modification_date'] = DateTimeObj::get('Y-m-d H:i:s'); $defaults['modification_date_gmt'] = DateTimeObj::getGMT('Y-m-d H:i:s'); $defaults['author_id'] = 1; $defaults['modification_auth...
php
public static function edit($section_id, array $settings) { $defaults = array(); $defaults['modification_date'] = DateTimeObj::get('Y-m-d H:i:s'); $defaults['modification_date_gmt'] = DateTimeObj::getGMT('Y-m-d H:i:s'); $defaults['author_id'] = 1; $defaults['modification_auth...
[ "public", "static", "function", "edit", "(", "$", "section_id", ",", "array", "$", "settings", ")", "{", "$", "defaults", "=", "array", "(", ")", ";", "$", "defaults", "[", "'modification_date'", "]", "=", "DateTimeObj", "::", "get", "(", "'Y-m-d H:i:s'", ...
Updates an existing Section given it's ID and an associative array of settings. The array does not have to contain all the settings for the Section as there is no deletion of settings prior to updating the Section @param integer $section_id The ID of the Section to edit @param array $settings An associative of setting...
[ "Updates", "an", "existing", "Section", "given", "it", "s", "ID", "and", "an", "associative", "array", "of", "settings", ".", "The", "array", "does", "not", "have", "to", "contain", "all", "the", "settings", "for", "the", "Section", "as", "there", "is", ...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.sectionmanager.php#L64-L77
symphonycms/symphony-2
symphony/lib/toolkit/class.sectionmanager.php
SectionManager.delete
public static function delete($section_id) { $details = Symphony::Database()->fetchRow(0, sprintf(" SELECT `sortorder` FROM tbl_sections WHERE `id` = %d", $section_id )); // Delete all the entries $entries = Symphony::Database()->fetchCol('id', "SELECT `id` F...
php
public static function delete($section_id) { $details = Symphony::Database()->fetchRow(0, sprintf(" SELECT `sortorder` FROM tbl_sections WHERE `id` = %d", $section_id )); // Delete all the entries $entries = Symphony::Database()->fetchCol('id', "SELECT `id` F...
[ "public", "static", "function", "delete", "(", "$", "section_id", ")", "{", "$", "details", "=", "Symphony", "::", "Database", "(", ")", "->", "fetchRow", "(", "0", ",", "sprintf", "(", "\"\n SELECT `sortorder` FROM tbl_sections WHERE `id` = %d\"", ",", ...
Deletes a Section by Section ID, removing all entries, fields, the Section and any Section Associations in that order @param integer $section_id The ID of the Section to delete @throws DatabaseException @throws Exception @return boolean Returns true when completed
[ "Deletes", "a", "Section", "by", "Section", "ID", "removing", "all", "entries", "fields", "the", "Section", "and", "any", "Section", "Associations", "in", "that", "order" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.sectionmanager.php#L90-L129
symphonycms/symphony-2
symphony/lib/toolkit/class.sectionmanager.php
SectionManager.fetch
public static function fetch($section_id = null, $order = 'ASC', $sortfield = 'name') { $returnSingle = false; $section_ids = array(); if (!is_null($section_id)) { if (!is_array($section_id)) { $returnSingle = true; $section_ids = array($section_i...
php
public static function fetch($section_id = null, $order = 'ASC', $sortfield = 'name') { $returnSingle = false; $section_ids = array(); if (!is_null($section_id)) { if (!is_array($section_id)) { $returnSingle = true; $section_ids = array($section_i...
[ "public", "static", "function", "fetch", "(", "$", "section_id", "=", "null", ",", "$", "order", "=", "'ASC'", ",", "$", "sortfield", "=", "'name'", ")", "{", "$", "returnSingle", "=", "false", ";", "$", "section_ids", "=", "array", "(", ")", ";", "i...
Returns a Section object by ID, or returns an array of Sections if the Section ID was omitted. If the Section ID is omitted, it is possible to sort the Sections by providing a sort order and sort field. By default, Sections will be order in ascending order by their name @param integer|array $section_id The ID of the s...
[ "Returns", "a", "Section", "object", "by", "ID", "or", "returns", "an", "array", "of", "Sections", "if", "the", "Section", "ID", "was", "omitted", ".", "If", "the", "Section", "ID", "is", "omitted", "it", "is", "possible", "to", "sort", "the", "Sections"...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.sectionmanager.php#L150-L207
symphonycms/symphony-2
symphony/lib/toolkit/class.sectionmanager.php
SectionManager.createSectionAssociation
public static function createSectionAssociation($parent_section_id = null, $child_field_id = null, $parent_field_id = null, $show_association = true, $interface = null, $editor = null) { if (is_null($parent_section_id) && (is_null($parent_field_id) || !$parent_field_id)) { return false; ...
php
public static function createSectionAssociation($parent_section_id = null, $child_field_id = null, $parent_field_id = null, $show_association = true, $interface = null, $editor = null) { if (is_null($parent_section_id) && (is_null($parent_field_id) || !$parent_field_id)) { return false; ...
[ "public", "static", "function", "createSectionAssociation", "(", "$", "parent_section_id", "=", "null", ",", "$", "child_field_id", "=", "null", ",", "$", "parent_field_id", "=", "null", ",", "$", "show_association", "=", "true", ",", "$", "interface", "=", "n...
Create an association between a section and a field. @since Symphony 2.3 @param integer $parent_section_id The linked section id. @param integer $child_field_id The field ID of the field that is creating the association @param integer $parent_field_id (optional) The field ID of the linked field in the linked section @...
[ "Create", "an", "association", "between", "a", "section", "and", "a", "field", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.sectionmanager.php#L274-L299
symphonycms/symphony-2
symphony/lib/toolkit/class.sectionmanager.php
SectionManager.fetchAssociatedSections
public static function fetchAssociatedSections($section_id, $respect_visibility = false) { if (Symphony::Log()) { Symphony::Log()->pushDeprecateWarningToLog('SectionManager::fetchAssociatedSections()', 'SectionManager::fetchChildAssociations()'); } self::fetchChildAssociations($s...
php
public static function fetchAssociatedSections($section_id, $respect_visibility = false) { if (Symphony::Log()) { Symphony::Log()->pushDeprecateWarningToLog('SectionManager::fetchAssociatedSections()', 'SectionManager::fetchChildAssociations()'); } self::fetchChildAssociations($s...
[ "public", "static", "function", "fetchAssociatedSections", "(", "$", "section_id", ",", "$", "respect_visibility", "=", "false", ")", "{", "if", "(", "Symphony", "::", "Log", "(", ")", ")", "{", "Symphony", "::", "Log", "(", ")", "->", "pushDeprecateWarningT...
Returns any section associations this section has with other sections linked using fields. Has an optional parameter, `$respect_visibility` that will only return associations that are deemed visible by a field that created the association. eg. An articles section may link to the authors section, but the field that link...
[ "Returns", "any", "section", "associations", "this", "section", "has", "with", "other", "sections", "linked", "using", "fields", ".", "Has", "an", "optional", "parameter", "$respect_visibility", "that", "will", "only", "return", "associations", "that", "are", "dee...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.sectionmanager.php#L359-L365
symphonycms/symphony-2
symphony/lib/toolkit/class.sectionmanager.php
SectionManager.fetchChildAssociations
public static function fetchChildAssociations($section_id, $respect_visibility = false) { return Symphony::Database()->fetch(sprintf(" SELECT * FROM `tbl_sections_association` AS `sa`, `tbl_sections` AS `s` WHERE `sa`.`parent_section_id` = %d AND `s`.`id` = `s...
php
public static function fetchChildAssociations($section_id, $respect_visibility = false) { return Symphony::Database()->fetch(sprintf(" SELECT * FROM `tbl_sections_association` AS `sa`, `tbl_sections` AS `s` WHERE `sa`.`parent_section_id` = %d AND `s`.`id` = `s...
[ "public", "static", "function", "fetchChildAssociations", "(", "$", "section_id", ",", "$", "respect_visibility", "=", "false", ")", "{", "return", "Symphony", "::", "Database", "(", ")", "->", "fetch", "(", "sprintf", "(", "\"\n SELECT *\n FRO...
Returns any section associations this section has with other sections linked using fields, and where this section is the parent in the association. Has an optional parameter, `$respect_visibility` that will only return associations that are deemed visible by a field that created the association. eg. An articles section...
[ "Returns", "any", "section", "associations", "this", "section", "has", "with", "other", "sections", "linked", "using", "fields", "and", "where", "this", "section", "is", "the", "parent", "in", "the", "association", ".", "Has", "an", "optional", "parameter", "$...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.sectionmanager.php#L386-L398
symphonycms/symphony-2
symphony/lib/toolkit/class.sectionmanager.php
SectionManager.fetchParentAssociations
public static function fetchParentAssociations($section_id, $respect_visibility = false) { return Symphony::Database()->fetch(sprintf( "SELECT * FROM `tbl_sections_association` AS `sa`, `tbl_sections` AS `s` WHERE `sa`.`child_section_id` = %d AND `s`.`id` = `s...
php
public static function fetchParentAssociations($section_id, $respect_visibility = false) { return Symphony::Database()->fetch(sprintf( "SELECT * FROM `tbl_sections_association` AS `sa`, `tbl_sections` AS `s` WHERE `sa`.`child_section_id` = %d AND `s`.`id` = `s...
[ "public", "static", "function", "fetchParentAssociations", "(", "$", "section_id", ",", "$", "respect_visibility", "=", "false", ")", "{", "return", "Symphony", "::", "Database", "(", ")", "->", "fetch", "(", "sprintf", "(", "\"SELECT *\n FROM `tbl_sectio...
Returns any section associations this section has with other sections linked using fields, and where this section is the child in the association. Has an optional parameter, `$respect_visibility` that will only return associations that are deemed visible by a field that created the association. eg. An articles section ...
[ "Returns", "any", "section", "associations", "this", "section", "has", "with", "other", "sections", "linked", "using", "fields", "and", "where", "this", "section", "is", "the", "child", "in", "the", "association", ".", "Has", "an", "optional", "parameter", "$r...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.sectionmanager.php#L419-L431
symphonycms/symphony-2
symphony/lib/toolkit/cryptography/class.md5.php
MD5.hash
public static function hash($input) { if (Symphony::Log()) { Symphony::Log()->pushDeprecateWarningToLog('MD5::hash()', 'PBKDF2::hash()', array( 'message-format' => __('The use of `%s` is strongly discouraged due to severe security flaws.'), )); } retur...
php
public static function hash($input) { if (Symphony::Log()) { Symphony::Log()->pushDeprecateWarningToLog('MD5::hash()', 'PBKDF2::hash()', array( 'message-format' => __('The use of `%s` is strongly discouraged due to severe security flaws.'), )); } retur...
[ "public", "static", "function", "hash", "(", "$", "input", ")", "{", "if", "(", "Symphony", "::", "Log", "(", ")", ")", "{", "Symphony", "::", "Log", "(", ")", "->", "pushDeprecateWarningToLog", "(", "'MD5::hash()'", ",", "'PBKDF2::hash()'", ",", "array", ...
Uses `MD5` to create a hash based on some input @param string $input the string to be hashed @return string the hashed string
[ "Uses", "MD5", "to", "create", "a", "hash", "based", "on", "some", "input" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/cryptography/class.md5.php#L24-L32
symphonycms/symphony-2
symphony/lib/toolkit/cryptography/class.md5.php
MD5.file
public static function file($input) { if (Symphony::Log()) { Symphony::Log()->pushDeprecateWarningToLog('MD5::file()', 'PBKDF2::hash()', array( 'message-format' => __('The use of `%s` is strongly discouraged due to severe security flaws.'), )); } retur...
php
public static function file($input) { if (Symphony::Log()) { Symphony::Log()->pushDeprecateWarningToLog('MD5::file()', 'PBKDF2::hash()', array( 'message-format' => __('The use of `%s` is strongly discouraged due to severe security flaws.'), )); } retur...
[ "public", "static", "function", "file", "(", "$", "input", ")", "{", "if", "(", "Symphony", "::", "Log", "(", ")", ")", "{", "Symphony", "::", "Log", "(", ")", "->", "pushDeprecateWarningToLog", "(", "'MD5::file()'", ",", "'PBKDF2::hash()'", ",", "array", ...
Uses `MD5` to create a hash from the contents of a file @param string $input the file to be hashed @return string the hashed string
[ "Uses", "MD5", "to", "create", "a", "hash", "from", "the", "contents", "of", "a", "file" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/cryptography/class.md5.php#L42-L50
symphonycms/symphony-2
symphony/lib/toolkit/cryptography/class.md5.php
MD5.compare
public static function compare($input, $hash, $isHash = false) { if (Symphony::Log()) { Symphony::Log()->pushDeprecateWarningToLog('MD5::compare()', 'PBKDF2::compare()', array( 'message-format' => __('The use of `%s` is strongly discouraged due to severe security flaws.'), ...
php
public static function compare($input, $hash, $isHash = false) { if (Symphony::Log()) { Symphony::Log()->pushDeprecateWarningToLog('MD5::compare()', 'PBKDF2::compare()', array( 'message-format' => __('The use of `%s` is strongly discouraged due to severe security flaws.'), ...
[ "public", "static", "function", "compare", "(", "$", "input", ",", "$", "hash", ",", "$", "isHash", "=", "false", ")", "{", "if", "(", "Symphony", "::", "Log", "(", ")", ")", "{", "Symphony", "::", "Log", "(", ")", "->", "pushDeprecateWarningToLog", ...
Compares a given hash with a cleantext password. @param string $input the cleartext password @param string $hash the hash the password should be checked against @param boolean $isHash @return bool the result of the comparison
[ "Compares", "a", "given", "hash", "with", "a", "cleantext", "password", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/cryptography/class.md5.php#L63-L71
symphonycms/symphony-2
symphony/lib/core/class.symphony.php
Symphony.initialiseErrorHandler
public static function initialiseErrorHandler() { // Initialise logging self::initialiseLog(); GenericExceptionHandler::initialise(self::Log()); GenericErrorHandler::initialise(self::Log()); }
php
public static function initialiseErrorHandler() { // Initialise logging self::initialiseLog(); GenericExceptionHandler::initialise(self::Log()); GenericErrorHandler::initialise(self::Log()); }
[ "public", "static", "function", "initialiseErrorHandler", "(", ")", "{", "// Initialise logging", "self", "::", "initialiseLog", "(", ")", ";", "GenericExceptionHandler", "::", "initialise", "(", "self", "::", "Log", "(", ")", ")", ";", "GenericErrorHandler", "::"...
Setter for the Symphony Log and Error Handling system @since Symphony 2.6.0
[ "Setter", "for", "the", "Symphony", "Log", "and", "Error", "Handling", "system" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/core/class.symphony.php#L119-L125
symphonycms/symphony-2
symphony/lib/core/class.symphony.php
Symphony.Engine
public static function Engine() { if (class_exists('Administration', false)) { return Administration::instance(); } elseif (class_exists('Frontend', false)) { return Frontend::instance(); } else { throw new Exception(__('No suitable engine object found'));...
php
public static function Engine() { if (class_exists('Administration', false)) { return Administration::instance(); } elseif (class_exists('Frontend', false)) { return Frontend::instance(); } else { throw new Exception(__('No suitable engine object found'));...
[ "public", "static", "function", "Engine", "(", ")", "{", "if", "(", "class_exists", "(", "'Administration'", ",", "false", ")", ")", "{", "return", "Administration", "::", "instance", "(", ")", ";", "}", "elseif", "(", "class_exists", "(", "'Frontend'", ",...
Accessor for the Symphony instance, whether it be Frontend or Administration @since Symphony 2.2 @throws Exception @return Symphony
[ "Accessor", "for", "the", "Symphony", "instance", "whether", "it", "be", "Frontend", "or", "Administration" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/core/class.symphony.php#L135-L144
symphonycms/symphony-2
symphony/lib/core/class.symphony.php
Symphony.initialiseConfiguration
public static function initialiseConfiguration(array $data = array()) { if (empty($data)) { // Includes the existing CONFIG file and initialises the Configuration // by setting the values with the setArray function. include CONFIG; $data = $settings; ...
php
public static function initialiseConfiguration(array $data = array()) { if (empty($data)) { // Includes the existing CONFIG file and initialises the Configuration // by setting the values with the setArray function. include CONFIG; $data = $settings; ...
[ "public", "static", "function", "initialiseConfiguration", "(", "array", "$", "data", "=", "array", "(", ")", ")", "{", "if", "(", "empty", "(", "$", "data", ")", ")", "{", "// Includes the existing CONFIG file and initialises the Configuration", "// by setting the va...
Setter for `$Configuration`. This function initialise the configuration object and populate its properties based on the given `$array`. Since Symphony 2.6.5, it will also set Symphony's date constants. @since Symphony 2.3 @param array $data An array of settings to be stored into the Configuration object
[ "Setter", "for", "$Configuration", ".", "This", "function", "initialise", "the", "configuration", "object", "and", "populate", "its", "properties", "based", "on", "the", "given", "$array", ".", "Since", "Symphony", "2", ".", "6", ".", "5", "it", "will", "als...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/core/class.symphony.php#L155-L174
symphonycms/symphony-2
symphony/lib/core/class.symphony.php
Symphony.initialiseLog
public static function initialiseLog($filename = null) { if (self::$Log instanceof Log && self::$Log->getLogPath() == $filename) { return true; } if (is_null($filename)) { $filename = ACTIVITY_LOG; } self::$Log = new Log($filename); self::$Lo...
php
public static function initialiseLog($filename = null) { if (self::$Log instanceof Log && self::$Log->getLogPath() == $filename) { return true; } if (is_null($filename)) { $filename = ACTIVITY_LOG; } self::$Log = new Log($filename); self::$Lo...
[ "public", "static", "function", "initialiseLog", "(", "$", "filename", "=", "null", ")", "{", "if", "(", "self", "::", "$", "Log", "instanceof", "Log", "&&", "self", "::", "$", "Log", "->", "getLogPath", "(", ")", "==", "$", "filename", ")", "{", "re...
Setter for `$Log`. This function uses the configuration settings in the 'log' group in the Configuration to create an instance. Date formatting options are also retrieved from the configuration. @param string $filename (optional) The file to write the log to, if omitted this will default to `ACTIVITY_LOG` @throws Exce...
[ "Setter", "for", "$Log", ".", "This", "function", "uses", "the", "configuration", "settings", "in", "the", "log", "group", "in", "the", "Configuration", "to", "create", "an", "instance", ".", "Date", "formatting", "options", "are", "also", "retrieved", "from",...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/core/class.symphony.php#L219-L238
symphonycms/symphony-2
symphony/lib/core/class.symphony.php
Symphony.initialiseCookie
public static function initialiseCookie() { define_safe('__SYM_COOKIE_PATH__', DIRROOT === '' ? '/' : DIRROOT); define_safe('__SYM_COOKIE_PREFIX_', self::Configuration()->get('cookie_prefix', 'symphony')); define_safe('__SYM_COOKIE_PREFIX__', self::Configuration()->get('cookie_prefix', 'symp...
php
public static function initialiseCookie() { define_safe('__SYM_COOKIE_PATH__', DIRROOT === '' ? '/' : DIRROOT); define_safe('__SYM_COOKIE_PREFIX_', self::Configuration()->get('cookie_prefix', 'symphony')); define_safe('__SYM_COOKIE_PREFIX__', self::Configuration()->get('cookie_prefix', 'symp...
[ "public", "static", "function", "initialiseCookie", "(", ")", "{", "define_safe", "(", "'__SYM_COOKIE_PATH__'", ",", "DIRROOT", "===", "''", "?", "'/'", ":", "DIRROOT", ")", ";", "define_safe", "(", "'__SYM_COOKIE_PREFIX_'", ",", "self", "::", "Configuration", "...
Setter for `$Cookie`. This will use PHP's parse_url function on the current URL to set a cookie using the cookie_prefix defined in the Symphony configuration. The cookie will last two weeks. This function also defines two constants, `__SYM_COOKIE_PATH__` and `__SYM_COOKIE_PREFIX__`. @deprecated Prior to Symphony 2.3....
[ "Setter", "for", "$Cookie", ".", "This", "will", "use", "PHP", "s", "parse_url", "function", "on", "the", "current", "URL", "to", "set", "a", "cookie", "using", "the", "cookie_prefix", "defined", "in", "the", "Symphony", "configuration", ".", "The", "cookie"...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/core/class.symphony.php#L265-L272
symphonycms/symphony-2
symphony/lib/core/class.symphony.php
Symphony.initialiseExtensionManager
public static function initialiseExtensionManager($force=false) { if (!$force && self::$ExtensionManager instanceof ExtensionManager) { return true; } self::$ExtensionManager = new ExtensionManager; if (!(self::$ExtensionManager instanceof ExtensionManager)) { ...
php
public static function initialiseExtensionManager($force=false) { if (!$force && self::$ExtensionManager instanceof ExtensionManager) { return true; } self::$ExtensionManager = new ExtensionManager; if (!(self::$ExtensionManager instanceof ExtensionManager)) { ...
[ "public", "static", "function", "initialiseExtensionManager", "(", "$", "force", "=", "false", ")", "{", "if", "(", "!", "$", "force", "&&", "self", "::", "$", "ExtensionManager", "instanceof", "ExtensionManager", ")", "{", "return", "true", ";", "}", "self"...
Setter for `$ExtensionManager` using the current Symphony instance as the parent. If for some reason this fails, a Symphony Error page will be thrown @param Boolean $force (optional) When set to true, this function will always create a new instance of ExtensionManager, replacing self::$ExtensionManager.
[ "Setter", "for", "$ExtensionManager", "using", "the", "current", "Symphony", "instance", "as", "the", "parent", ".", "If", "for", "some", "reason", "this", "fails", "a", "Symphony", "Error", "page", "will", "be", "thrown" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/core/class.symphony.php#L293-L304
symphonycms/symphony-2
symphony/lib/core/class.symphony.php
Symphony.setDatabase
public static function setDatabase(StdClass $database = null) { if (self::Database()) { return true; } self::$Database = !is_null($database) ? $database : new MySQL; return true; }
php
public static function setDatabase(StdClass $database = null) { if (self::Database()) { return true; } self::$Database = !is_null($database) ? $database : new MySQL; return true; }
[ "public", "static", "function", "setDatabase", "(", "StdClass", "$", "database", "=", "null", ")", "{", "if", "(", "self", "::", "Database", "(", ")", ")", "{", "return", "true", ";", "}", "self", "::", "$", "Database", "=", "!", "is_null", "(", "$",...
Setter for `$Database`, accepts a Database object. If `$database` is omitted, this function will set `$Database` to be of the `MySQL` class. @since Symphony 2.3 @param StdClass $database (optional) The class to handle all Database operations, if omitted this function will set `self::$Database` to be an instance of the...
[ "Setter", "for", "$Database", "accepts", "a", "Database", "object", ".", "If", "$database", "is", "omitted", "this", "function", "will", "set", "$Database", "to", "be", "of", "the", "MySQL", "class", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/core/class.symphony.php#L329-L338
symphonycms/symphony-2
symphony/lib/core/class.symphony.php
Symphony.initialiseDatabase
public static function initialiseDatabase() { self::setDatabase(); $details = self::Configuration()->get('database'); try { if (!self::Database()->connect($details['host'], $details['user'], $details['password'], $details['port'], $details['db'])) { return false;...
php
public static function initialiseDatabase() { self::setDatabase(); $details = self::Configuration()->get('database'); try { if (!self::Database()->connect($details['host'], $details['user'], $details['password'], $details['port'], $details['db'])) { return false;...
[ "public", "static", "function", "initialiseDatabase", "(", ")", "{", "self", "::", "setDatabase", "(", ")", ";", "$", "details", "=", "self", "::", "Configuration", "(", ")", "->", "get", "(", "'database'", ")", ";", "try", "{", "if", "(", "!", "self",...
This will initialise the Database class and attempt to create a connection using the connection details provided in the Symphony configuration. If any errors occur whilst doing so, a Symphony Error Page is displayed. @throws SymphonyErrorPage @return boolean This function will return true if the `$Database` was initia...
[ "This", "will", "initialise", "the", "Database", "class", "and", "attempt", "to", "create", "a", "connection", "using", "the", "connection", "details", "provided", "in", "the", "Symphony", "configuration", ".", "If", "any", "errors", "occur", "whilst", "doing", ...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/core/class.symphony.php#L360-L408
symphonycms/symphony-2
symphony/lib/core/class.symphony.php
Symphony.login
public static function login($username, $password, $isHash = false) { $username = trim(self::Database()->cleanValue($username)); $password = trim(self::Database()->cleanValue($password)); if (strlen($username) > 0 && strlen($password) > 0) { $author = AuthorManager::fetch('id', ...
php
public static function login($username, $password, $isHash = false) { $username = trim(self::Database()->cleanValue($username)); $password = trim(self::Database()->cleanValue($password)); if (strlen($username) > 0 && strlen($password) > 0) { $author = AuthorManager::fetch('id', ...
[ "public", "static", "function", "login", "(", "$", "username", ",", "$", "password", ",", "$", "isHash", "=", "false", ")", "{", "$", "username", "=", "trim", "(", "self", "::", "Database", "(", ")", "->", "cleanValue", "(", "$", "username", ")", ")"...
Attempts to log an Author in given a username and password. If the password is not hashed, it will be hashed using the sha1 algorithm. The username and password will be sanitized before being used to query the Database. If an Author is found, they will be logged in and the sanitized username and password (also hashed) ...
[ "Attempts", "to", "log", "an", "Author", "in", "given", "a", "username", "and", "password", ".", "If", "the", "password", "is", "not", "hashed", "it", "will", "be", "hashed", "using", "the", "sha1", "algorithm", ".", "The", "username", "and", "password", ...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/core/class.symphony.php#L441-L483
symphonycms/symphony-2
symphony/lib/core/class.symphony.php
Symphony.loginFromToken
public static function loginFromToken($token) { $token = self::Database()->cleanValue($token); if (strlen(trim($token)) == 0) { return false; } if (strlen($token) == 6 || strlen($token) == 16) { $row = self::Database()->fetchRow(0, sprintf( "...
php
public static function loginFromToken($token) { $token = self::Database()->cleanValue($token); if (strlen(trim($token)) == 0) { return false; } if (strlen($token) == 6 || strlen($token) == 16) { $row = self::Database()->fetchRow(0, sprintf( "...
[ "public", "static", "function", "loginFromToken", "(", "$", "token", ")", "{", "$", "token", "=", "self", "::", "Database", "(", ")", "->", "cleanValue", "(", "$", "token", ")", ";", "if", "(", "strlen", "(", "trim", "(", "$", "token", ")", ")", "=...
Symphony allows Authors to login via the use of tokens instead of a username and password. A token is derived from concatenating the Author's username and password and applying the sha1 hash to it, from this, a portion of the hash is used as the token. This is a useful feature often used when setting up other Authors a...
[ "Symphony", "allows", "Authors", "to", "login", "via", "the", "use", "of", "tokens", "instead", "of", "a", "username", "and", "password", ".", "A", "token", "is", "derived", "from", "concatenating", "the", "Author", "s", "username", "and", "password", "and",...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/core/class.symphony.php#L500-L545
symphonycms/symphony-2
symphony/lib/core/class.symphony.php
Symphony.isLoggedIn
public static function isLoggedIn() { // Check to see if Symphony exists, or if we already have an Author instance. if (is_null(self::$_instance) || self::$Author) { return true; } // No author instance found, attempt to log in with the cookied credentials return...
php
public static function isLoggedIn() { // Check to see if Symphony exists, or if we already have an Author instance. if (is_null(self::$_instance) || self::$Author) { return true; } // No author instance found, attempt to log in with the cookied credentials return...
[ "public", "static", "function", "isLoggedIn", "(", ")", "{", "// Check to see if Symphony exists, or if we already have an Author instance.", "if", "(", "is_null", "(", "self", "::", "$", "_instance", ")", "||", "self", "::", "$", "Author", ")", "{", "return", "true...
This function determines whether an there is a currently logged in Author for Symphony by using the `$Cookie`'s username and password. If the instance is not found, they will be logged in using the cookied credentials. @see login() @return boolean
[ "This", "function", "determines", "whether", "an", "there", "is", "a", "currently", "logged", "in", "Author", "for", "Symphony", "by", "using", "the", "$Cookie", "s", "username", "and", "password", ".", "If", "the", "instance", "is", "not", "found", "they", ...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/core/class.symphony.php#L567-L576
symphonycms/symphony-2
symphony/lib/core/class.symphony.php
Symphony.getMigrationVersion
public static function getMigrationVersion() { if (self::isInstallerAvailable()) { $migrations = scandir(DOCROOT . '/install/migrations'); $migration_file = end($migrations); $migration_class = 'migration_' . str_replace('.', '', substr($migration_file, 0, -4)); ...
php
public static function getMigrationVersion() { if (self::isInstallerAvailable()) { $migrations = scandir(DOCROOT . '/install/migrations'); $migration_file = end($migrations); $migration_class = 'migration_' . str_replace('.', '', substr($migration_file, 0, -4)); ...
[ "public", "static", "function", "getMigrationVersion", "(", ")", "{", "if", "(", "self", "::", "isInstallerAvailable", "(", ")", ")", "{", "$", "migrations", "=", "scandir", "(", "DOCROOT", ".", "'/install/migrations'", ")", ";", "$", "migration_file", "=", ...
Returns the most recent version found in the `/install/migrations` folder. Returns a version string to be used in `version_compare()` if an updater has been found. Returns `FALSE` otherwise. @since Symphony 2.3.1 @return string|boolean
[ "Returns", "the", "most", "recent", "version", "found", "in", "the", "/", "install", "/", "migrations", "folder", ".", "Returns", "a", "version", "string", "to", "be", "used", "in", "version_compare", "()", "if", "an", "updater", "has", "been", "found", "....
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/core/class.symphony.php#L586-L596
symphonycms/symphony-2
symphony/lib/core/class.symphony.php
Symphony.isUpgradeAvailable
public static function isUpgradeAvailable() { if (self::isInstallerAvailable()) { $migration_version = self::getMigrationVersion(); $current_version = Symphony::Configuration()->get('version', 'symphony'); return version_compare($current_version, $migration_version, '<')...
php
public static function isUpgradeAvailable() { if (self::isInstallerAvailable()) { $migration_version = self::getMigrationVersion(); $current_version = Symphony::Configuration()->get('version', 'symphony'); return version_compare($current_version, $migration_version, '<')...
[ "public", "static", "function", "isUpgradeAvailable", "(", ")", "{", "if", "(", "self", "::", "isInstallerAvailable", "(", ")", ")", "{", "$", "migration_version", "=", "self", "::", "getMigrationVersion", "(", ")", ";", "$", "current_version", "=", "Symphony"...
Checks if an update is available and applicable for the current installation. @since Symphony 2.3.1 @return boolean
[ "Checks", "if", "an", "update", "is", "available", "and", "applicable", "for", "the", "current", "installation", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/core/class.symphony.php#L604-L614
symphonycms/symphony-2
symphony/lib/core/class.symphony.php
Symphony.throwCustomError
public static function throwCustomError($message, $heading = 'Symphony Fatal Error', $status = Page::HTTP_STATUS_ERROR, $template = 'generic', array $additional = array()) { GenericExceptionHandler::$enabled = true; throw new SymphonyErrorPage($message, $heading, $template, $additional, $status); ...
php
public static function throwCustomError($message, $heading = 'Symphony Fatal Error', $status = Page::HTTP_STATUS_ERROR, $template = 'generic', array $additional = array()) { GenericExceptionHandler::$enabled = true; throw new SymphonyErrorPage($message, $heading, $template, $additional, $status); ...
[ "public", "static", "function", "throwCustomError", "(", "$", "message", ",", "$", "heading", "=", "'Symphony Fatal Error'", ",", "$", "status", "=", "Page", "::", "HTTP_STATUS_ERROR", ",", "$", "template", "=", "'generic'", ",", "array", "$", "additional", "=...
A wrapper for throwing a new Symphony Error page. This methods sets the `GenericExceptionHandler::$enabled` value to `true`. @see core.SymphonyErrorPage @param string|XMLElement $message A description for this error, which can be provided as a string or as an XMLElement. @param string $heading A heading for the error...
[ "A", "wrapper", "for", "throwing", "a", "new", "Symphony", "Error", "page", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/core/class.symphony.php#L650-L654
symphonycms/symphony-2
symphony/lib/core/class.symphony.php
Symphony.getPageNamespace
public static function getPageNamespace() { if (self::$namespace !== false) { return self::$namespace; } $page = getCurrentPage(); if (!is_null($page)) { $page = trim($page, '/'); } if (substr($page, 0, 7) == 'publish') { self::$...
php
public static function getPageNamespace() { if (self::$namespace !== false) { return self::$namespace; } $page = getCurrentPage(); if (!is_null($page)) { $page = trim($page, '/'); } if (substr($page, 0, 7) == 'publish') { self::$...
[ "public", "static", "function", "getPageNamespace", "(", ")", "{", "if", "(", "self", "::", "$", "namespace", "!==", "false", ")", "{", "return", "self", "::", "$", "namespace", ";", "}", "$", "page", "=", "getCurrentPage", "(", ")", ";", "if", "(", ...
Returns the page namespace based on the current URL. A few examples: /login /publish /blueprints/datasources [...] /extension/$extension_name/$page_name This method is especially useful in couple with the translation function. @see toolkit#__() @return string The page namespace, without any action string (e.g. "new"...
[ "Returns", "the", "page", "namespace", "based", "on", "the", "current", "URL", ".", "A", "few", "examples", ":" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/core/class.symphony.php#L702-L731
symphonycms/symphony-2
symphony/lib/core/class.symphony.php
SymphonyErrorPageHandler.render
public static function render($e) { // Validate the type, resolve to a 404 if not valid if (!static::isValidThrowable($e)) { $e = new FrontendPageNotFoundException(); } if ($e->getTemplate() === false) { Page::renderStatusCode($e->getHttpStatusCode()); ...
php
public static function render($e) { // Validate the type, resolve to a 404 if not valid if (!static::isValidThrowable($e)) { $e = new FrontendPageNotFoundException(); } if ($e->getTemplate() === false) { Page::renderStatusCode($e->getHttpStatusCode()); ...
[ "public", "static", "function", "render", "(", "$", "e", ")", "{", "// Validate the type, resolve to a 404 if not valid", "if", "(", "!", "static", "::", "isValidThrowable", "(", "$", "e", ")", ")", "{", "$", "e", "=", "new", "FrontendPageNotFoundException", "("...
The render function will take a `SymphonyErrorPage` exception and output a HTML page. This function first checks to see if their is a custom template for this exception otherwise it reverts to using the default `usererror.generic.php` @param Throwable $e The Throwable object @return string An HTML string
[ "The", "render", "function", "will", "take", "a", "SymphonyErrorPage", "exception", "and", "output", "a", "HTML", "page", ".", "This", "function", "first", "checks", "to", "see", "if", "their", "is", "a", "custom", "template", "for", "this", "exception", "ot...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/core/class.symphony.php#L752-L771
symphonycms/symphony-2
symphony/lib/core/class.symphony.php
SymphonyErrorPage.getTemplate
public function getTemplate() { $format = '%s/usererror.%s.php'; if (file_exists($template = sprintf($format, WORKSPACE . '/template', $this->_template))) { return $template; } elseif (file_exists($template = sprintf($format, TEMPLATE, $this->_template))) { return $t...
php
public function getTemplate() { $format = '%s/usererror.%s.php'; if (file_exists($template = sprintf($format, WORKSPACE . '/template', $this->_template))) { return $template; } elseif (file_exists($template = sprintf($format, TEMPLATE, $this->_template))) { return $t...
[ "public", "function", "getTemplate", "(", ")", "{", "$", "format", "=", "'%s/usererror.%s.php'", ";", "if", "(", "file_exists", "(", "$", "template", "=", "sprintf", "(", "$", "format", ",", "WORKSPACE", ".", "'/template'", ",", "$", "this", "->", "_templa...
Returns the path to the current template by looking at the `WORKSPACE/template/` directory, then at the `TEMPLATES` directory for the convention `usererror.*.php`. If the template is not found, `false` is returned @since Symphony 2.3 @return string|false String, which is the path to the template if the template is fou...
[ "Returns", "the", "path", "to", "the", "current", "template", "by", "looking", "at", "the", "WORKSPACE", "/", "template", "/", "directory", "then", "at", "the", "TEMPLATES", "directory", "for", "the", "convention", "usererror", ".", "*", ".", "php", ".", "...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/core/class.symphony.php#L905-L916
symphonycms/symphony-2
symphony/lib/core/class.symphony.php
DatabaseExceptionHandler.render
public static function render($e) { // Validate the type, resolve to a 404 if not valid if (!static::isValidThrowable($e)) { $e = new FrontendPageNotFoundException(); } $trace = $queries = null; foreach ($e->getTrace() as $t) { $trace .= sprintf( ...
php
public static function render($e) { // Validate the type, resolve to a 404 if not valid if (!static::isValidThrowable($e)) { $e = new FrontendPageNotFoundException(); } $trace = $queries = null; foreach ($e->getTrace() as $t) { $trace .= sprintf( ...
[ "public", "static", "function", "render", "(", "$", "e", ")", "{", "// Validate the type, resolve to a 404 if not valid", "if", "(", "!", "static", "::", "isValidThrowable", "(", "$", "e", ")", ")", "{", "$", "e", "=", "new", "FrontendPageNotFoundException", "("...
The render function will take a `DatabaseException` and output a HTML page. @param Throwable $e The Throwable object @return string An HTML string
[ "The", "render", "function", "will", "take", "a", "DatabaseException", "and", "output", "a", "HTML", "page", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/core/class.symphony.php#L947-L994
symphonycms/symphony-2
symphony/lib/toolkit/class.devkit.php
DevKit.buildIncludes
protected function buildIncludes() { $this->addHeaderToPage('Content-Type', 'text/html; charset=UTF-8'); $this->Html->setElementStyle('html'); $this->Html->setDTD('<!DOCTYPE html>'); $this->Html->setAttribute('lang', Lang::get()); $this->addElementToHead(new XMLElement( ...
php
protected function buildIncludes() { $this->addHeaderToPage('Content-Type', 'text/html; charset=UTF-8'); $this->Html->setElementStyle('html'); $this->Html->setDTD('<!DOCTYPE html>'); $this->Html->setAttribute('lang', Lang::get()); $this->addElementToHead(new XMLElement( ...
[ "protected", "function", "buildIncludes", "(", ")", "{", "$", "this", "->", "addHeaderToPage", "(", "'Content-Type'", ",", "'text/html; charset=UTF-8'", ")", ";", "$", "this", "->", "Html", "->", "setElementStyle", "(", "'html'", ")", ";", "$", "this", "->", ...
Builds the Includes for a Devkit and sets the Content Type to be text/html. The default Symphony devkit stylesheet is the only include. The default doctype is enables HTML5
[ "Builds", "the", "Includes", "for", "a", "Devkit", "and", "sets", "the", "Content", "Type", "to", "be", "text", "/", "html", ".", "The", "default", "Symphony", "devkit", "stylesheet", "is", "the", "only", "include", ".", "The", "default", "doctype", "is", ...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.devkit.php#L61-L77
symphonycms/symphony-2
symphony/lib/toolkit/class.devkit.php
DevKit.buildHeader
protected function buildHeader(XMLElement $wrapper) { $this->setTitle(__( '%1$s &ndash; %2$s &ndash; %3$s', array( $this->_pagedata['title'], __($this->_title), __('Symphony') ) )); $h1 = new XMLElement('h1'...
php
protected function buildHeader(XMLElement $wrapper) { $this->setTitle(__( '%1$s &ndash; %2$s &ndash; %3$s', array( $this->_pagedata['title'], __($this->_title), __('Symphony') ) )); $h1 = new XMLElement('h1'...
[ "protected", "function", "buildHeader", "(", "XMLElement", "$", "wrapper", ")", "{", "$", "this", "->", "setTitle", "(", "__", "(", "'%1$s &ndash; %2$s &ndash; %3$s'", ",", "array", "(", "$", "this", "->", "_pagedata", "[", "'title'", "]", ",", "__", "(", ...
This function will build the `<title>` element and create a default `<h1>` with an anchor to this query string @param XMLElement $wrapper The parent `XMLElement` to add the header to @throws InvalidArgumentException
[ "This", "function", "will", "build", "the", "<title", ">", "element", "and", "create", "a", "default", "<h1", ">", "with", "an", "anchor", "to", "this", "query", "string" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.devkit.php#L87-L102
symphonycms/symphony-2
symphony/lib/toolkit/class.devkit.php
DevKit.buildNavigation
protected function buildNavigation(XMLElement $wrapper) { $xml = new DOMDocument(); $xml->preserveWhiteSpace = false; $xml->formatOutput = true; $xml->load(ASSETS . '/xml/devkit_navigation.xml'); $root = $xml->documentElement; $list = new XMLElement('ul'); $li...
php
protected function buildNavigation(XMLElement $wrapper) { $xml = new DOMDocument(); $xml->preserveWhiteSpace = false; $xml->formatOutput = true; $xml->load(ASSETS . '/xml/devkit_navigation.xml'); $root = $xml->documentElement; $list = new XMLElement('ul'); $li...
[ "protected", "function", "buildNavigation", "(", "XMLElement", "$", "wrapper", ")", "{", "$", "xml", "=", "new", "DOMDocument", "(", ")", ";", "$", "xml", "->", "preserveWhiteSpace", "=", "false", ";", "$", "xml", "->", "formatOutput", "=", "true", ";", ...
Using DOMDocument, construct the Navigation list using the `devkit_navigation.xml` file in the `ASSETS` folder. The default navigation file is an empty `<navigation>` element. The `ManipulateDevKitNavigation` delegate allows extensions to inject items into the navigation. The navigation is build by iterating over `<ite...
[ "Using", "DOMDocument", "construct", "the", "Navigation", "list", "using", "the", "devkit_navigation", ".", "xml", "file", "in", "the", "ASSETS", "folder", ".", "The", "default", "navigation", "file", "is", "an", "empty", "<navigation", ">", "element", ".", "T...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.devkit.php#L116-L176
symphonycms/symphony-2
symphony/lib/toolkit/class.devkit.php
DevKit.prepare
public function prepare(XSLTPage $page, array $pagedata, $xml, array $param, $output) { $this->_page = $page; $this->_pagedata = $pagedata; $this->_xml = $xml; $this->_param = $param; $this->_output = $output; if (is_null($this->_title)) { $this->_title =...
php
public function prepare(XSLTPage $page, array $pagedata, $xml, array $param, $output) { $this->_page = $page; $this->_pagedata = $pagedata; $this->_xml = $xml; $this->_param = $param; $this->_output = $output; if (is_null($this->_title)) { $this->_title =...
[ "public", "function", "prepare", "(", "XSLTPage", "$", "page", ",", "array", "$", "pagedata", ",", "$", "xml", ",", "array", "$", "param", ",", "$", "output", ")", "{", "$", "this", "->", "_page", "=", "$", "page", ";", "$", "this", "->", "_pagedat...
The prepare function acts a pseudo constructor for the Devkit, setting some base variables with the given parameters @param XSLTPage $page An instance of the XSLTPage, usually FrontendPage @param array $pagedata An associative array of the details of the Page that is being 'Devkitted'. The majority of this information...
[ "The", "prepare", "function", "acts", "a", "pseudo", "constructor", "for", "the", "Devkit", "setting", "some", "base", "variables", "with", "the", "given", "parameters" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.devkit.php#L250-L261
symphonycms/symphony-2
symphony/lib/toolkit/class.devkit.php
DevKit.build
public function build() { $this->buildIncludes(); $this->_view = General::sanitize($this->_view); $header = new XMLElement('div'); $header->setAttribute('id', 'header'); $jump = new XMLElement('div'); $jump->setAttribute('id', 'jump'); $content = new XMLEleme...
php
public function build() { $this->buildIncludes(); $this->_view = General::sanitize($this->_view); $header = new XMLElement('div'); $header->setAttribute('id', 'header'); $jump = new XMLElement('div'); $jump->setAttribute('id', 'jump'); $content = new XMLEleme...
[ "public", "function", "build", "(", ")", "{", "$", "this", "->", "buildIncludes", "(", ")", ";", "$", "this", "->", "_view", "=", "General", "::", "sanitize", "(", "$", "this", "->", "_view", ")", ";", "$", "header", "=", "new", "XMLElement", "(", ...
Called when page is generated, this function calls each of the other other functions in this page to build the Header, the Navigation, the Jump menu and finally the content. This function calls it's parent generate function @see toolkit.HTMLPage#generate() @throws InvalidArgumentException @return string
[ "Called", "when", "page", "is", "generated", "this", "function", "calls", "each", "of", "the", "other", "other", "functions", "in", "this", "page", "to", "build", "the", "Header", "the", "Navigation", "the", "Jump", "menu", "and", "finally", "the", "content"...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.devkit.php#L273-L297
symphonycms/symphony-2
symphony/lib/toolkit/class.xsltpage.php
XSLTPage.setXML
public function setXML($xml, $isFile = false) { $this->_xml = ($isFile ? file_get_contents($xml) : $xml); }
php
public function setXML($xml, $isFile = false) { $this->_xml = ($isFile ? file_get_contents($xml) : $xml); }
[ "public", "function", "setXML", "(", "$", "xml", ",", "$", "isFile", "=", "false", ")", "{", "$", "this", "->", "_xml", "=", "(", "$", "isFile", "?", "file_get_contents", "(", "$", "xml", ")", ":", "$", "xml", ")", ";", "}" ]
Setter for `$this->_xml`, can optionally load the XML from a file. @param string|XMLElement $xml The XML for this XSLT page @param boolean $isFile If set to true, the XML will be loaded from a file. It is false by default
[ "Setter", "for", "$this", "-", ">", "_xml", "can", "optionally", "load", "the", "XML", "from", "a", "file", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.xsltpage.php#L68-L71
symphonycms/symphony-2
symphony/lib/toolkit/class.xsltpage.php
XSLTPage.setXSL
public function setXSL($xsl, $isFile = false) { $this->_xsl = ($isFile ? file_get_contents($xsl) : $xsl); }
php
public function setXSL($xsl, $isFile = false) { $this->_xsl = ($isFile ? file_get_contents($xsl) : $xsl); }
[ "public", "function", "setXSL", "(", "$", "xsl", ",", "$", "isFile", "=", "false", ")", "{", "$", "this", "->", "_xsl", "=", "(", "$", "isFile", "?", "file_get_contents", "(", "$", "xsl", ")", ":", "$", "xsl", ")", ";", "}" ]
Setter for `$this->_xsl`, can optionally load the XSLT from a file. @param string $xsl The XSLT for this XSLT page @param boolean $isFile If set to true, the XSLT will be loaded from a file. It is false by default
[ "Setter", "for", "$this", "-", ">", "_xsl", "can", "optionally", "load", "the", "XSLT", "from", "a", "file", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.xsltpage.php#L91-L94
symphonycms/symphony-2
symphony/lib/toolkit/class.xsltpage.php
XSLTPage.registerPHPFunction
public function registerPHPFunction($function) { if (is_array($function)) { $this->_registered_php_functions = array_unique( array_merge($this->_registered_php_functions, $function) ); } else { $this->_registered_php_functions[] = $function; ...
php
public function registerPHPFunction($function) { if (is_array($function)) { $this->_registered_php_functions = array_unique( array_merge($this->_registered_php_functions, $function) ); } else { $this->_registered_php_functions[] = $function; ...
[ "public", "function", "registerPHPFunction", "(", "$", "function", ")", "{", "if", "(", "is_array", "(", "$", "function", ")", ")", "{", "$", "this", "->", "_registered_php_functions", "=", "array_unique", "(", "array_merge", "(", "$", "this", "->", "_regist...
Allows the registration of PHP functions to be used on the Frontend by passing the function name or an array of function names @param mixed $function Either an array of function names, or just the function name as a string
[ "Allows", "the", "registration", "of", "PHP", "functions", "to", "be", "used", "on", "the", "Frontend", "by", "passing", "the", "function", "name", "or", "an", "array", "of", "function", "names" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.xsltpage.php#L144-L153
symphonycms/symphony-2
symphony/lib/toolkit/class.xsltpage.php
XSLTPage.generate
public function generate($page = null) { $result = $this->Proc->process($this->_xml, $this->_xsl, $this->_param, $this->_registered_php_functions); if ($this->Proc->isErrors()) { $this->setHttpStatus(Page::HTTP_STATUS_ERROR); return false; } parent::generate...
php
public function generate($page = null) { $result = $this->Proc->process($this->_xml, $this->_xsl, $this->_param, $this->_registered_php_functions); if ($this->Proc->isErrors()) { $this->setHttpStatus(Page::HTTP_STATUS_ERROR); return false; } parent::generate...
[ "public", "function", "generate", "(", "$", "page", "=", "null", ")", "{", "$", "result", "=", "$", "this", "->", "Proc", "->", "process", "(", "$", "this", "->", "_xml", ",", "$", "this", "->", "_xsl", ",", "$", "this", "->", "_param", ",", "$",...
The generate function calls on the `XsltProcess` to transform the XML with the given XSLT passing any parameters or functions If no errors occur, the parent generate function is called to add the page headers and a string containing the transformed result is result. @param null $page @return string
[ "The", "generate", "function", "calls", "on", "the", "XsltProcess", "to", "transform", "the", "XML", "with", "the", "given", "XSLT", "passing", "any", "parameters", "or", "functions", "If", "no", "errors", "occur", "the", "parent", "generate", "function", "is"...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.xsltpage.php#L165-L177
symphonycms/symphony-2
symphony/lib/toolkit/fields/field.taglist.php
FieldTagList.fetchAssociatedEntryCount
public function fetchAssociatedEntryCount($value) { $value = array_map(array($this, 'cleanValue'), explode(',', $value)); $value = implode("','", $value); $count = (int)Symphony::Database()->fetchVar('count', 0, sprintf(" SELECT COUNT(handle) AS `count` FROM `tbl_entr...
php
public function fetchAssociatedEntryCount($value) { $value = array_map(array($this, 'cleanValue'), explode(',', $value)); $value = implode("','", $value); $count = (int)Symphony::Database()->fetchVar('count', 0, sprintf(" SELECT COUNT(handle) AS `count` FROM `tbl_entr...
[ "public", "function", "fetchAssociatedEntryCount", "(", "$", "value", ")", "{", "$", "value", "=", "array_map", "(", "array", "(", "$", "this", ",", "'cleanValue'", ")", ",", "explode", "(", "','", ",", "$", "value", ")", ")", ";", "$", "value", "=", ...
/*------------------------------------------------------------------------- Utilities: -------------------------------------------------------------------------
[ "/", "*", "-------------------------------------------------------------------------", "Utilities", ":", "-------------------------------------------------------------------------" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/fields/field.taglist.php#L77-L90
symphonycms/symphony-2
symphony/lib/toolkit/fields/field.taglist.php
FieldTagList.findRelatedEntries
public function findRelatedEntries($entry_id, $parent_field_id) { // We have the entry_id of the entry that has the referenced tag values // Lets find out what those handles are so we can then referenced the // child section looking for them. $handles = Symphony::Database()->fetchCol...
php
public function findRelatedEntries($entry_id, $parent_field_id) { // We have the entry_id of the entry that has the referenced tag values // Lets find out what those handles are so we can then referenced the // child section looking for them. $handles = Symphony::Database()->fetchCol...
[ "public", "function", "findRelatedEntries", "(", "$", "entry_id", ",", "$", "parent_field_id", ")", "{", "// We have the entry_id of the entry that has the referenced tag values", "// Lets find out what those handles are so we can then referenced the", "// child section looking for them.",...
Find all the entries that reference this entry's tags. @param integer $entry_id @param integer $parent_field_id @return array
[ "Find", "all", "the", "entries", "that", "reference", "this", "entry", "s", "tags", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/fields/field.taglist.php#L124-L142
symphonycms/symphony-2
symphony/lib/toolkit/fields/field.taglist.php
FieldTagList.findParentRelatedEntries
public function findParentRelatedEntries($field_id, $entry_id) { // Get all the `handles` that have been referenced from the // child association. $handles = Symphony::Database()->fetchCol('handle', sprintf(" SELECT `handle` FROM `tbl_entries_data_%d` WHER...
php
public function findParentRelatedEntries($field_id, $entry_id) { // Get all the `handles` that have been referenced from the // child association. $handles = Symphony::Database()->fetchCol('handle', sprintf(" SELECT `handle` FROM `tbl_entries_data_%d` WHER...
[ "public", "function", "findParentRelatedEntries", "(", "$", "field_id", ",", "$", "entry_id", ")", "{", "// Get all the `handles` that have been referenced from the", "// child association.", "$", "handles", "=", "Symphony", "::", "Database", "(", ")", "->", "fetchCol", ...
Find all the entries that contain the tags that have been referenced from this field own entry. @param integer $field_id @param integer $entry_id @return array
[ "Find", "all", "the", "entries", "that", "contain", "the", "tags", "that", "have", "been", "referenced", "from", "this", "field", "own", "entry", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/fields/field.taglist.php#L152-L171
symphonycms/symphony-2
symphony/lib/toolkit/fields/field.taglist.php
FieldTagList.displayPublishPanel
public function displayPublishPanel(XMLElement &$wrapper, $data = null, $flagWithError = null, $fieldnamePrefix = null, $fieldnamePostfix = null, $entry_id = null) { $value = null; if (isset($data['value'])) { $value = (is_array($data['value']) ? self::__tagArrayToString($data['value'])...
php
public function displayPublishPanel(XMLElement &$wrapper, $data = null, $flagWithError = null, $fieldnamePrefix = null, $fieldnamePostfix = null, $entry_id = null) { $value = null; if (isset($data['value'])) { $value = (is_array($data['value']) ? self::__tagArrayToString($data['value'])...
[ "public", "function", "displayPublishPanel", "(", "XMLElement", "&", "$", "wrapper", ",", "$", "data", "=", "null", ",", "$", "flagWithError", "=", "null", ",", "$", "fieldnamePrefix", "=", "null", ",", "$", "fieldnamePostfix", "=", "null", ",", "$", "entr...
/*------------------------------------------------------------------------- Publish: -------------------------------------------------------------------------
[ "/", "*", "-------------------------------------------------------------------------", "Publish", ":", "-------------------------------------------------------------------------" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/fields/field.taglist.php#L344-L385
symphonycms/symphony-2
symphony/lib/toolkit/fields/field.taglist.php
FieldTagList.appendFormattedElement
public function appendFormattedElement(XMLElement &$wrapper, $data, $encode = false, $mode = null, $entry_id = null) { if (!is_array($data) || empty($data) || is_null($data['value'])) { return; } $list = new XMLElement($this->get('element_name')); if (!is_array($data['h...
php
public function appendFormattedElement(XMLElement &$wrapper, $data, $encode = false, $mode = null, $entry_id = null) { if (!is_array($data) || empty($data) || is_null($data['value'])) { return; } $list = new XMLElement($this->get('element_name')); if (!is_array($data['h...
[ "public", "function", "appendFormattedElement", "(", "XMLElement", "&", "$", "wrapper", ",", "$", "data", ",", "$", "encode", "=", "false", ",", "$", "mode", "=", "null", ",", "$", "entry_id", "=", "null", ")", "{", "if", "(", "!", "is_array", "(", "...
/*------------------------------------------------------------------------- Output: -------------------------------------------------------------------------
[ "/", "*", "-------------------------------------------------------------------------", "Output", ":", "-------------------------------------------------------------------------" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/fields/field.taglist.php#L448-L470
symphonycms/symphony-2
symphony/lib/toolkit/fields/field.taglist.php
FieldTagList.prepareExportValue
public function prepareExportValue($data, $mode, $entry_id = null) { $modes = (object)$this->getExportModes(); if (isset($data['handle']) && is_array($data['handle']) === false) { $data['handle'] = array( $data['handle'] ); } if (isset($data[...
php
public function prepareExportValue($data, $mode, $entry_id = null) { $modes = (object)$this->getExportModes(); if (isset($data['handle']) && is_array($data['handle']) === false) { $data['handle'] = array( $data['handle'] ); } if (isset($data[...
[ "public", "function", "prepareExportValue", "(", "$", "data", ",", "$", "mode", ",", "$", "entry_id", "=", "null", ")", "{", "$", "modes", "=", "(", "object", ")", "$", "this", "->", "getExportModes", "(", ")", ";", "if", "(", "isset", "(", "$", "d...
Give the field some data and ask it to return a value using one of many possible modes. @param mixed $data @param integer $mode @param integer $entry_id @return array|null
[ "Give", "the", "field", "some", "data", "and", "ask", "it", "to", "return", "a", "value", "using", "one", "of", "many", "possible", "modes", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/fields/field.taglist.php#L554-L594
symphonycms/symphony-2
symphony/lib/toolkit/fields/field.taglist.php
FieldTagList.displayFilteringOptions
public function displayFilteringOptions(XMLElement &$wrapper) { if ($this->get('pre_populate_source') != null) { $existing_tags = $this->getToggleStates(); if (is_array($existing_tags) && !empty($existing_tags)) { $taglist = new XMLElement('ul'); $tag...
php
public function displayFilteringOptions(XMLElement &$wrapper) { if ($this->get('pre_populate_source') != null) { $existing_tags = $this->getToggleStates(); if (is_array($existing_tags) && !empty($existing_tags)) { $taglist = new XMLElement('ul'); $tag...
[ "public", "function", "displayFilteringOptions", "(", "XMLElement", "&", "$", "wrapper", ")", "{", "if", "(", "$", "this", "->", "get", "(", "'pre_populate_source'", ")", "!=", "null", ")", "{", "$", "existing_tags", "=", "$", "this", "->", "getToggleStates"...
/*------------------------------------------------------------------------- Filtering: -------------------------------------------------------------------------
[ "/", "*", "-------------------------------------------------------------------------", "Filtering", ":", "-------------------------------------------------------------------------" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/fields/field.taglist.php#L600-L619
symphonycms/symphony-2
symphony/lib/toolkit/class.widget.php
Widget.Label
public static function Label($name = null, XMLElement $child = null, $class = null, $id = null, array $attributes = null) { General::ensureType(array( 'name' => array('var' => $name, 'type' => 'string', 'optional' => true), 'class' => array('var' => $class, 'type' => 'string', 'optio...
php
public static function Label($name = null, XMLElement $child = null, $class = null, $id = null, array $attributes = null) { General::ensureType(array( 'name' => array('var' => $name, 'type' => 'string', 'optional' => true), 'class' => array('var' => $class, 'type' => 'string', 'optio...
[ "public", "static", "function", "Label", "(", "$", "name", "=", "null", ",", "XMLElement", "$", "child", "=", "null", ",", "$", "class", "=", "null", ",", "$", "id", "=", "null", ",", "array", "$", "attributes", "=", "null", ")", "{", "General", ":...
Generates a XMLElement representation of `<label>` @param string $name (optional) The text for the resulting `<label>` @param XMLElement $child (optional) An XMLElement that this <label> will become the parent of. Commonly used with `<input>`. @param string $class (optional) The class attribute of the resulting `<labe...
[ "Generates", "a", "XMLElement", "representation", "of", "<label", ">" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.widget.php#L32-L59
symphonycms/symphony-2
symphony/lib/toolkit/class.widget.php
Widget.Input
public static function Input($name, $value = null, $type = 'text', array $attributes = null) { General::ensureType(array( 'name' => array('var' => $name, 'type' => 'string'), 'value' => array('var' => $value, 'type' => 'string', 'optional' => true), 'type' => array('var' ...
php
public static function Input($name, $value = null, $type = 'text', array $attributes = null) { General::ensureType(array( 'name' => array('var' => $name, 'type' => 'string'), 'value' => array('var' => $value, 'type' => 'string', 'optional' => true), 'type' => array('var' ...
[ "public", "static", "function", "Input", "(", "$", "name", ",", "$", "value", "=", "null", ",", "$", "type", "=", "'text'", ",", "array", "$", "attributes", "=", "null", ")", "{", "General", "::", "ensureType", "(", "array", "(", "'name'", "=>", "arr...
Generates a XMLElement representation of `<input>` @param string $name The name attribute of the resulting `<input>` @param string $value (optional) The value attribute of the resulting `<input>` @param string $type The type attribute for this `<input>`, defaults to "text". @param array $attributes (optional) Any addi...
[ "Generates", "a", "XMLElement", "representation", "of", "<input", ">" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.widget.php#L78-L102
symphonycms/symphony-2
symphony/lib/toolkit/class.widget.php
Widget.Checkbox
public static function Checkbox($name, $value, $description = null, XMLElement &$wrapper = null, $help = null) { General::ensureType(array( 'name' => array('var' => $name, 'type' => 'string'), 'value' => array('var' => $value, 'type' => 'string', 'optional' => true), 'des...
php
public static function Checkbox($name, $value, $description = null, XMLElement &$wrapper = null, $help = null) { General::ensureType(array( 'name' => array('var' => $name, 'type' => 'string'), 'value' => array('var' => $value, 'type' => 'string', 'optional' => true), 'des...
[ "public", "static", "function", "Checkbox", "(", "$", "name", ",", "$", "value", ",", "$", "description", "=", "null", ",", "XMLElement", "&", "$", "wrapper", "=", "null", ",", "$", "help", "=", "null", ")", "{", "General", "::", "ensureType", "(", "...
Generates a XMLElement representation of a `<input type='checkbox'>`. This also includes the actual label of the Checkbox and any help text if required. Note that this includes two input fields, one is the hidden 'no' value and the other is the actual checkbox ('yes' value). This is provided so if the checkbox is not c...
[ "Generates", "a", "XMLElement", "representation", "of", "a", "<input", "type", "=", "checkbox", ">", ".", "This", "also", "includes", "the", "actual", "label", "of", "the", "Checkbox", "and", "any", "help", "text", "if", "required", ".", "Note", "that", "t...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.widget.php#L128-L169
symphonycms/symphony-2
symphony/lib/toolkit/class.widget.php
Widget.Textarea
public static function Textarea($name, $rows = 15, $cols = 50, $value = null, array $attributes = null) { General::ensureType(array( 'name' => array('var' => $name, 'type' => 'string'), 'rows' => array('var' => $rows, 'type' => 'int'), 'cols' => array('var' => $cols, 'typ...
php
public static function Textarea($name, $rows = 15, $cols = 50, $value = null, array $attributes = null) { General::ensureType(array( 'name' => array('var' => $name, 'type' => 'string'), 'rows' => array('var' => $rows, 'type' => 'int'), 'cols' => array('var' => $cols, 'typ...
[ "public", "static", "function", "Textarea", "(", "$", "name", ",", "$", "rows", "=", "15", ",", "$", "cols", "=", "50", ",", "$", "value", "=", "null", ",", "array", "$", "attributes", "=", "null", ")", "{", "General", "::", "ensureType", "(", "arr...
Generates a XMLElement representation of `<textarea>` @param string $name The name of the resulting `<textarea>` @param integer $rows (optional) The height of the `<textarea>`, using the rows attribute. Defaults to 15 @param integer $cols (optional) The width of the `<textarea>`, using the cols attribute. Defaults to ...
[ "Generates", "a", "XMLElement", "representation", "of", "<textarea", ">" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.widget.php#L190-L212
symphonycms/symphony-2
symphony/lib/toolkit/class.widget.php
Widget.Anchor
public static function Anchor($value, $href, $title = null, $class = null, $id = null, array $attributes = null) { General::ensureType(array( 'value' => array('var' => $value, 'type' => 'string'), 'href' => array('var' => $href, 'type' => 'string'), 'title' => array('var'...
php
public static function Anchor($value, $href, $title = null, $class = null, $id = null, array $attributes = null) { General::ensureType(array( 'value' => array('var' => $value, 'type' => 'string'), 'href' => array('var' => $href, 'type' => 'string'), 'title' => array('var'...
[ "public", "static", "function", "Anchor", "(", "$", "value", ",", "$", "href", ",", "$", "title", "=", "null", ",", "$", "class", "=", "null", ",", "$", "id", "=", "null", ",", "array", "$", "attributes", "=", "null", ")", "{", "General", "::", "...
Generates a XMLElement representation of `<a>` @param string $value The text of the resulting `<a>` @param string $href The href attribute of the resulting `<a>` @param string $title (optional) The title attribute of the resulting `<a>` @param string $class (optional) The class attribute of the resulting `<a>` @param ...
[ "Generates", "a", "XMLElement", "representation", "of", "<a", ">" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.widget.php#L235-L265
symphonycms/symphony-2
symphony/lib/toolkit/class.widget.php
Widget.Form
public static function Form($action = null, $method = 'post', $class = null, $id = null, array $attributes = null) { General::ensureType(array( 'action' => array('var' => $action, 'type' => 'string', 'optional' => true), 'method' => array('var' => $method, 'type' => 'string'), ...
php
public static function Form($action = null, $method = 'post', $class = null, $id = null, array $attributes = null) { General::ensureType(array( 'action' => array('var' => $action, 'type' => 'string', 'optional' => true), 'method' => array('var' => $method, 'type' => 'string'), ...
[ "public", "static", "function", "Form", "(", "$", "action", "=", "null", ",", "$", "method", "=", "'post'", ",", "$", "class", "=", "null", ",", "$", "id", "=", "null", ",", "array", "$", "attributes", "=", "null", ")", "{", "General", "::", "ensur...
Generates a XMLElement representation of `<form>` @param string $action The text of the resulting `<form>` @param string $method The method attribute of the resulting `<form>`. Defaults to "post". @param string $class (optional) The class attribute of the resulting `<form>` @param string $id (optional) The id attribut...
[ "Generates", "a", "XMLElement", "representation", "of", "<form", ">" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.widget.php#L286-L312
symphonycms/symphony-2
symphony/lib/toolkit/class.widget.php
Widget.Table
public static function Table(XMLElement $header = null, XMLElement $footer = null, XMLElement $body = null, $class = null, $id = null, Array $attributes = null) { General::ensureType(array( 'class' => array('var' => $class, 'type' => 'string', 'optional' => true), 'id' => array('var'...
php
public static function Table(XMLElement $header = null, XMLElement $footer = null, XMLElement $body = null, $class = null, $id = null, Array $attributes = null) { General::ensureType(array( 'class' => array('var' => $class, 'type' => 'string', 'optional' => true), 'id' => array('var'...
[ "public", "static", "function", "Table", "(", "XMLElement", "$", "header", "=", "null", ",", "XMLElement", "$", "footer", "=", "null", ",", "XMLElement", "$", "body", "=", "null", ",", "$", "class", "=", "null", ",", "$", "id", "=", "null", ",", "Arr...
Generates a XMLElement representation of `<table>` This is a simple way to create generic Symphony table wrapper @param XMLElement $header An XMLElement containing the `<thead>`. See Widget::TableHead @param XMLElement $footer An XMLElement containing the `<tfoot>` @param XMLElement $body An XMLElement containing the ...
[ "Generates", "a", "XMLElement", "representation", "of", "<table", ">", "This", "is", "a", "simple", "way", "to", "create", "generic", "Symphony", "table", "wrapper" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.widget.php#L336-L370