query
stringlengths 9
43.3k
| document
stringlengths 17
1.17M
| metadata
dict | negatives
listlengths 0
30
| negative_scores
listlengths 0
30
| document_score
stringlengths 5
10
| document_rank
stringclasses 2
values |
---|---|---|---|---|---|---|
/ verify (and remove) the digital signature on a file returns 0 if OK | function verify_digital_signature($fname) {
global $g;
return mwexec("/usr/bin/gzsig verify " .
escapeshellarg("{$g['etc_path']}/id_rsa.pub") . " " .
escapeshellarg($fname));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function verify_signature($file) {\n $dds = new WebService_DigiDocService_DigiDocService();\n $file[\"content\"] = File::readLocalFile($file[\"tmp_name\"]);\n unlink($file[\"tmp_name\"]);\n\n if ($file[\"format\"] === \"bdoc\") {\n $ret = $dds->StartSession(\"\", base64_encode($file[\"content\"]), FALSE, \"\");\n } else {\n $parser = new DigiDoc_Parser($file[\"content\"]);\n $ret = $dds->StartSession(\"\", $parser->getDigiDoc(TRUE), FALSE, \"\");\n }\n\n if (PEAR::isError($ret)) {\n return \"ERROR: \" . $ret->getMessage();\n }\n $sig_info = $ret[\"SignedDocInfo\"]->SignatureInfo;\n if (is_array($sig_info)) {\n return \"ERROR: The claim can have only one signature.\";\n }\n\n if ($sig_info->Status !== \"OK\") {\n $error = $sig_info->Error;\n return \"ERROR: The signature is invalid - $error->Description ($error->Code).\";\n }\n return \"OK\";\n}",
"private function verify($fileName = \"\", $fileContent = \"\"){\n if (empty($fileName) && empty($fileContent)){\n throw new Exception(\"Filename and fileContent can not be empty simultaneously.\");\n }\n if (!empty($fileName) && !empty($fileContent)){\n throw new Exception(\"Filename and fileContent can not be passed simultaneously.\");\n }\n if (!empty($fileName) && !file_exists($fileName)){\n throw new Exception(\"File with given filename does not exist.\");\n }\n if (! file_exists($this->tmpDir) || ! is_writable($this->tmpDir)){\n throw new Exception(\"Tmp dir does not exist or is not writable.\");\n }\n\n $randomId = uniqid();\n if (!empty($fileContent)){\n $fileName = sprintf(\"%s/%s.pdf\", $this->tmpDir, $randomId);\n file_put_contents($fileName, $fileContent);\n }\n\n $file = file_get_contents($fileName);\n\n $filters = $this->getFilters($file);\n if (empty($filters)){\n throw new Exception(\"Filter section in given file was not found.\");\n }\n\n $byteRange = $this->getByteRange($file);\n if (empty($byteRange)){\n throw new Exception(\"ByteRange section in given file was not found.\");\n }\n\n $binarySignature = $this->getBinarySignature($file);\n if (empty($binarySignature)){\n throw new Exception(\"Signature section in given file was not found.\");\n }\n\n $extFile = sprintf(\"%s/%s.ext.pdf\", $this->tmpDir, $randomId);\n if (! $this->removeSigatureFromPdf($fileName, $extFile, $byteRange)){\n throw new Exception(\"Extracting a signature from given file was not successfull.\");\n }\n\n $certPem = sprintf(\"%s/%s.pem\", $this->tmpDir, $randomId);\n $certPkcs7 = sprintf(\"%s/%s.pkcs7\", $this->tmpDir, $randomId);\n if (! $this->createPKCS7FromSignature($binarySignature, $certPem, $certPkcs7)){\n throw new Exception(\"Creating a certificate from signature was not successfull.\");\n }\n\n $certDer = sprintf(\"%s/%s.der\", $this->tmpDir, $randomId);\n if (! $this->convertPKCS7ToDER($certPkcs7, $certDer)){\n throw new Exception(\"Conversion of a certificate from PKCS7 to DER was not successfull.\");\n }\n\n $countCertsSignature = $this->convertPKCS7ToPEM($certPkcs7, $certPem);\n if ($countCertsSignature <= 0){\n throw new Exception(\"Conversion of a certificate from PKCS7 to PEM was not successfull.\");\n }\n\n// if($countCertsSignature>1) $countCertsSignature = 1; //onma, je problem s vice certifikaty, v PDF je vetsinou hned prvni soukromy klic\n for ($pocet=0; $pocet<$countCertsSignature; $pocet++ ) {\n $parsedCert = $this->parseCert(sprintf(\"%s.%d\", $certPem, $pocet));\n $cislo = $parsedCert['subject']['serial'];\n if ($cislo<>'') $pocet = 999999; //vyskocime\n }\n// $parsedCert = $this->parseCert(sprintf(\"%s.%d\", $certPem, $countCertsSignature - 1));\n\n\n $digest = sprintf(\"%s/%s.dig.bin\", $this->tmpDir, $randomId);\n $digests = $this->extractSignedDigest($certDer, $digest);\n if (empty($digests) || (empty($digests[\"rsaEncoded\"]) && empty($digests[\"messageDigest\"]) && empty($digests[\"PKCS7Data\"]))){\n throw new Exception(\"Extracting of a signed digest from certificate was not successfull.\");\n }\n\n $publicKey = sprintf(\"%s/%s.pubkey.pem\", $this->tmpDir, $randomId);\n\n $fileHashes = array(\n \"sha256\" => hash_file(\"sha256\", $extFile),\n \"sha1\" => hash_file(\"sha1\", $extFile),\n \"md5\" => hash_file(\"md5\", $extFile)\n );\n $signedHashes = array();\n\n if(!empty($digests[\"rsaEncoded\"])){\n if (! $this->createPublicKeyFromPEM($certPem, $publicKey)){\n throw new Exception(\"Creating of a public key from certificate was not successfull.\");\n }\n\n foreach($digests[\"rsaEncoded\"] as $dg){\n if(!empty($dg)){\n $decDigest = sprintf(\"%s.dec\", $dg);\n if (! $this->decryptBinaryDigest($dg, $decDigest, $publicKey)){\n throw new Exception(\"Decryption of a signed digest from certificate was not successfull.\");\n }\n if(file_exists($decDigest)){\n $signedHashes[] = strtolower(substr(bin2hex(file_get_contents($decDigest)), self::MAGIC));\n }\n }\n }\n }\n\n if(!empty($digests[\"messageDigest\"])){\n foreach($digests[\"messageDigest\"] as $md){\n $signedHashes[] = strtolower($md);\n }\n }\n\n if(!empty($digests[\"PKCS7Data\"])){\n foreach($digests[\"PKCS7Data\"] as $md){\n $signedHashes[] = strtolower($md);\n }\n }\n\n if(self::ENABLE_CLEANING){\n $this->rm($extFile);\n $this->rm($certPem);\n $this->rm($certPkcs7);\n $this->rm($certDer);\n $this->rm($publicKey);\n $this->rm($digest);\n if($countCertsSignature > 0){\n for($i = 0; $i < $countCertsSignature; $i++){\n $this->rm(sprintf(\"%s.%d\", $certPem, $i));\n }\n }\n if(!empty($digests[\"rsaEncoded\"])){\n foreach($digests[\"rsaEncoded\"] as $rsa){\n $this->rm(sprintf(\"%s\", $rsa));\n $this->rm(sprintf(\"%s.dec\", $rsa));\n }\n }\n if(!empty($fileContent)){\n $this->rm($fileName);\n }\n }\n\n foreach ($fileHashes as $algo => $hash) {\n if(in_array($hash, $signedHashes)){\n $r = array(\n \"result\" => true,\n \"alg\" => $algo,\n \"hash\" => $hash\n );\n return array_merge($r, $parsedCert);\n }\n }\n\n return array(\n \"result\" => false,\n \"fileHashes\" => $fileHashes,\n \"signedHashes\" => $signedHashes\n );\n }",
"function handle_claim() {\n $file = $_FILES[\"claim\"];\n\n if (!check_upload(&$file)) {\n header(\"HTTP/1.1 400 Bad Request\");\n echo \"Uploaded file missing or of wrong type!\\n\";\n return false;\n }\n\n if (($err = verify_signature(&$file)) !== \"OK\") {\n header(\"HTTP/1.1 400 Bad Request\");\n echo \"The claim's signature is invalid!\\n$err\\n\";\n return false;\n }\n\n extract_claim($file);\n return true;\n}",
"function cleanFile($a_filepath, $a_origname = \"\")\n\t{\n\t\t// This function should:\n\t\t// - call the external cleaner\n\t\t// - set cleanFilePath to a_filepath\n\t\t// - set cleanFileOrigName to a_origname\n\t\t// - set cleanFileIsCleaned according the clean result\n\t\t// - set cleanResult to the cleaner output message\n\t\t// - call logCleanResult in any case\n\t\t// - return the cleanResult, if file is cleaned\n\t\t// - return an empty string, if file is not cleaned\n\n\t\t$this->cleanFilePath = $a_filepath;\n\t\t$this->cleanFileOrigName = $a_origname;\n\n\t\t// Call of sweep from Sophos (www.sophos.com)\n\t\t// -di: Disinfect infected items\n\t\t// -nc: Don't ask for confirmation before disinfection/deletion\n\t\t// -ss: Don't display anything except on error or virus\n\t\t// -eec: Use extended error codes\n\t\t// -archive: sweep inside archives\n\t\t\n\t\t$cmd = $this->cleanCommand . \" -di -nc -ss -eec -archive \" . $a_filepath . \" 2>&1\";\n\t\texec($cmd, $out, $ret);\n\t\t$this->cleanResult = implode(\"\\n\", $out). \" [\". $ret. \"]\";\n\n\t\t// always log the result from a clean attempt\n\t\t$this->logCleanResult();\n\n\t\t// Extended error codes from sweep:\n\t\t// 0 If no errors are encountered and no viruses are found.\n\t\t// 8 If survivable errors have occurred.\n\t\t// 12 If compressed files have been found and decompressed.\n\t\t// 16 If compressed files have been found and not decompressed.\n\t\t// 20 If viruses have been found and disinfected.\n\t\t// 24 If viruses have been found and not disinfected.\n\t\t// 28 If viruses have been found in memory.\n\t\t// 32 If there has been an integrity check failure.\n\t\t// 36 If unsurvivable errors have occurred.\n\t\t// 40 If execution has been interrupted.\n\t\tif ($ret == 20)\n\t\t{\n\t\t\t$this->cleanFileIsCleaned = true;\n\t\t\treturn $this->cleanResult;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->cleanFileIsCleaned = false;\n\t\t\treturn \"\";\n\t\t}\n\t}",
"abstract public function verify($data, $signature);",
"public function checkSig($sigfile) {\n\t\tif (!is_file($sigfile)) {\n\t\t\tthrow new \\Exception(sprintf(_(\"checkSig was given %s, which is not a file\"),$sigfile));\n\t\t}\n\n\t\t$out = $this->runGPG(\"--output - \".escapeshellarg($sigfile));\n\n\t\t// Check to see if we don't know about this signature..\n\t\tif (isset($out['status'][2]) && preg_match('/NO_PUBKEY (.+)/', $out['status'][2], $keyarr)) {\n\t\t\t// We don't. Try to grab it.\n\t\t\ttry {\n\t\t\t\t$this->getKey($keyarr[1]);\n\t\t\t} catch (\\Exception $e) {\n\t\t\t\t// Couldn't download the key.\n\t\t\t\treturn array(\"status\" => self::STATE_INVALID);\n\t\t\t}\n\t\t\t// And now run the validation again.\n\t\t\t$out = $this->runGPG(\"--output - \".escapeshellarg($sigfile));\n\t\t}\n\n\t\t$status = $this->checkStatus($out['status']);\n\t\tif (!$status['trust']) {\n\t\t\t$longkey = substr($this->freepbxkey, -16);\n\t\t\t$sigout = $this->runGPG(\"--keyid-format long --with-colons --check-sigs \".$status['signedby']);\n\t\t\tif(preg_match('/^rev:!::1:'.$longkey.'/m',$sigout['stdout'])) {\n\t\t\t\treturn array(\"status\" => self::STATE_REVOKED, 'trustdetails' => array(\"Signed by Revoked Key\"));\n\t\t\t}\n\t\t\t$status['parsedout'] = @parse_ini_string($out['stdout'], true);\n\t\t\treturn $status;\n\t\t}\n\t\t// Silence warnings about '# not a valid comment'.\n\t\t// This should be removed after 12beta is finished.\n\t\t$modules = @parse_ini_string($out['stdout'], true);\n\t\t$modules['rawstatus'] = $status;\n\t\treturn $modules;\n\t}",
"public function verifyFile($filename, $retry = true) {\n\t\tif (!file_exists($filename)) {\n\t\t\tthrow new \\Exception(sprintf(_(\"Unable to open file %s\"),$filename));\n\t\t}\n\n\t\t$out = $this->runGPG(\"--verify \".escapeshellarg($filename));\n\t\tif (strpos($out['status'][0], \"[GNUPG:] BADSIG\") === 0) {\n\t\t\t// File has been tampered.\n\t\t\treturn false;\n\t\t}\n\t\tif (strpos($out['status'][1], \"[GNUPG:] NO_PUBKEY\") === 0) {\n\t\t\t// This should never happen, as we try to auto-download\n\t\t\t// the keys. However, if the keyserver timed out, or,\n\t\t\t// was out of date, we'll try it manually.\n\t\t\t//\n\t\t\t// strlen(\"[GNUPG:] NO_PUBKEY \") == 19.\n\t\t\t//\n\t\t\tif ($retry && $this->getKey(substr($out['status'][1], 19))) {\n\t\t\t\treturn $this->verifyFile($filename, false);\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Now, how does it check out?\n\t\t$status = $this->checkStatus($out['status']);\n\t\tif ($status['trust'] == true) {\n\t\t\t// It's trusted! For the interim, we want to make sure that it's signed\n\t\t\t// by the FreePBX Key, or, by a key that's been signed by the FreePBX Key.\n\t\t\t// This is going above-and-beyond the web of trust thing, and we may end up\n\t\t\t// removing it.\n\t\t\tarray_pop($out['status']); // Remove leading blank line.\n\t\t\t$validline = explode(\" \", array_pop($out['status']));\n\t\t\t$thissig = $validline[2];\n\t\t\t$longkey = substr($this->freepbxkey, -16);\n\t\t\t$allsigs = $this->runGPG(\"--keyid-format long --with-colons --check-sigs \".escapeshellarg($thissig));\n\t\t\t$isvalid = false;\n\t\t\tforeach (explode(\"\\n\", $allsigs['stdout']) as $line) {\n\t\t\t\tif (!$line) {\n\t\t\t\t\tcontinue; // Ignore blank lines\n\t\t\t\t}\n\t\t\t\t$tmparr = explode(\":\", $line);\n\t\t\t\tif ($tmparr[4] == $longkey) {\n\t\t\t\t\t$isvalid = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $isvalid;\n\t\t} // else\n\t\treturn false;\n\t}",
"function verifyDeletion($filename, $target_file)\n{\n // Check if file exists\n if (!file_exists($target_file))\n {\n echo \"File not found.<br>\";\n return false;\n }\n\n // check if file in list\n $list = read_file_list();\n\n if(!in_array($filename, $list)) {\n echo \"Not an image.<br>\";\n return false;\n }\n \n return true;\n}",
"function verifyMessage($certfile, $data, $signature) {\r\n\r\n // $data and $signature are assumed to contain the data and the signature\r\n $ok=0;\r\n // fetch public key from certificate and ready it\r\n $fp = fopen( \"security/\" . $certfile, \"r\");\r\n \r\n if(!$fp) {\r\n return false;\r\n }\r\n \r\n $cert = fread($fp, 8192);\r\n fclose($fp);\r\n $pubkeyid = openssl_get_publickey($cert);\r\n\r\n // state whether signature is okay or not\r\n $ok = openssl_verify($data, $signature, $pubkeyid);\r\n \r\n // free the key from memory\r\n openssl_free_key($pubkeyid);\r\n\r\n return $ok;\r\n\r\n }",
"function serendipity_verifyFTPChecksums() {\n global $serendipity;\n\n $badsums = array();\n\n // Load the checksums\n $f = S9Y_INCLUDE_PATH . 'checksums.inc.php';\n\n if (!file_exists($f) || filesize($f) < 1) {\n return $badsums;\n }\n\n require_once $f;\n // Verify that every file in the checksum list was uploaded correctly\n $basedir = realpath(dirname(__FILE__) . '/../');\n\n if (!is_array($serendipity['checksums_' . $serendipity['version']])) {\n return $badsums;\n }\n\n foreach ($serendipity['checksums_' . $serendipity['version']] as $prel => $sum) {\n $path = $basedir . '/' . $prel;\n // Don't take checksums of directories\n if (is_dir($path)) {\n // Weird that it's even here.\n continue;\n }\n\n // Can't checksum unreadable or nonexistent files\n if (!is_readable($path)) {\n $badsums[$prel] = 'missing';\n continue;\n }\n\n // Validate checksum\n $calcsum = serendipity_FTPChecksum($path);\n if ($sum != $calcsum) {\n $badsums[$prel] = $calcsum;\n continue;\n }\n }\n\n return $badsums;\n}",
"private function checkSignature()\n {\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \n $token = TOKEN;\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n \n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }",
"private function removeSigatureFromPdf($srcFileName, $dstFileName, $byteRange){\n if (empty($srcFileName)){\n throw new Exception(\"Given param SRCFILENAME can not be empty.\");\n }\n if (empty($dstFileName)){\n throw new Exception(\"Given param DSTFILENAME can not be empty.\");\n }\n if (empty($byteRange)){\n throw new Exception(\"Given param BYTERANGE can not be empty.\");\n }\n\n $src = fopen($srcFileName, \"r\");\n fseek($src, 0);\n $beforeSignature = fread($src, $byteRange[1]);\n fseek($src, $byteRange[2]);\n $afterSignature = fread($src, $byteRange[3]);\n\n if (file_exists($dstFileName)){\n unlink($dstFileName);\n }\n $dst = fopen($dstFileName, \"a+\");\n fwrite($dst, $beforeSignature);\n fwrite($dst, $afterSignature);\n\n fclose($dst);\n fclose($src);\n\n return true;\n }",
"function openssl_cms_verify(string $input_filename, int $flags = 0, ?string $certificates, array $ca_info = [], ?string $untrusted_certificates_filename, ?string $content, ?string $pk7, ?string $sigfile, int $encoding = OPENSSL_ENCODING_SMIME): bool {}",
"public function check_signature($file, $signature) {\n if (!file_exists($file) || !file_exists($signature)) {\n return false;\n }\n\n $content = file_get_contents($file);\n $signContent = hex2bin(file_get_contents($signature));\n\n return openssl_verify($content, $signContent, $this->get_certificate()) == 1;\n }",
"function isVerified($filePath, $publicKeys = array(), $fileSign = null){\n $result = $this->verify($filePath, $publicKeys, $fileSign);\n\n if(count($result)==0){\n return false;\n }\n\n foreach($result as $sign)\n if(!$sign['verified'])\n return false;\n\n return true;\n }",
"private function checkSignature()\n {\n \tif (!defined(\"TOKEN\")) {\n \t\tthrow new Exception('TOKEN is not defined!');\n \t}\n\n \t$signature = $_GET[\"signature\"];\n \t$timestamp = $_GET[\"timestamp\"];\n \t$nonce = $_GET[\"nonce\"];\n\n \t$token = TOKEN;\n \t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n \tsort($tmpArr, SORT_STRING);\n \t$tmpStr = implode( $tmpArr );\n \t$tmpStr = sha1( $tmpStr );\n\n \tif( $tmpStr == $signature ){\n \t\treturn true;\n \t}else{\n \t\treturn false;\n \t}\n }",
"function verify($filePath, $publicKeys = array(), $fileSign = null){\n $payload = \"\";\n if($fileSign!=null){\n if(file_exists($fileSign))\n $payload = file_get_contents($fileSign);\n else{\n // if not file then it is a payload\n $payload = $fileSign;\n }\n }else{\n $payload = file_get_contents($filePath.'.jwt.sign');\n }\n if($publicKeys==null)\n $publicKeys = array();\n\n $result = array();\n $signs = explode(\"\\n\",str_replace(\"\\r\",'',$payload));\n\n foreach($signs as $temp){\n //sign array 0 is email 1 is jwt\n $sign = explode(\" \",$temp);\n //if it email then process\n if (filter_var($sign[0], FILTER_VALIDATE_EMAIL)) {\n //get public key from payload if publicKeys not provided\n if(!isset($publicKeys[$sign[0]])){\n $tmp = explode(\".\",$sign[1]);\n $data = json_decode(base64_decode($tmp[1]),true);\n $publicKey = $data['key'];\n }else{\n $publicKey = $publicKeys[$sign[0]];\n }\n try{\n $res = (array) JWT::decode($sign[1], $publicKey, array('RS256'));\n foreach($res as $k => $v){\n $result[$sign[0]][$k] = $v;\n }\n $path = ($filePath!=null && file_exists($filePath))? $filePath : $res['file'];\n if(!file_exists($path)){\n $result[$sign[0]]['verified'] = false;\n $result[$sign[0]]['error'] = 'File not found';\n }else{\n $result[$sign[0]]['sha256_verified'] = ($res['sha256']==hash_file(\"sha256\",$path));\n $result[$sign[0]]['sha1_verified'] = ($res['sha1']==sha1_file($path));\n $result[$sign[0]]['md5_verified'] = ($res['md5']==md5_file($path));\n if($result[$sign[0]]['sha256_verified'] && $result[$sign[0]]['sha1_verified'] && \n $result[$sign[0]]['md5_verified']){\n $result[$sign[0]]['verified'] = true;\n }else{\n $result[$sign[0]]['verified'] = false;\n }\n }\n }catch(\\Exception $e){\n $result[$sign[0]]['verified'] = false;\n $result[$sign[0]]['error'] = 'Signature invalid, '.$e->getMessage();\n }\n }\n }\n return $result;\n }",
"function handle_upload_signature(){\r\n\t\t$config = array();\r\n\t\t$config['upload_path'] = './assets/image_uploads/signature';\r\n\t\t$config['allowed_types'] = 'gif|jpg|png';\r\n\r\n\t\t$this->load->library('upload', $config);\r\n\t\t$this->upload->initialize($config);\r\n\t\tif (isset($_FILES['signature']) && !empty($_FILES['signature']['name'])){\r\n\t\t\tif ($this->upload->do_upload('signature')){\r\n\t\t\t\t// set a $_POST value for 'image' that we can use later\r\n\t\t\t\t$upload_data = $this->upload->data();\r\n\t\t\t\t$_POST['old_signature'] = $upload_data['file_name'];\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\t// possibly do some clean up ... then throw an error\r\n\t\t\t\t$this->form_validation->set_message('handle_upload_signature', $this->upload->display_errors());\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private function checkSignature()\n {\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n $token = TOKEN;\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }",
"public static function verifySignature(string $certificatePem): int\n {\n /* In case we receive a DER file and have to convert it to PEM\n if (strpos($certificateDer, '-----BEGIN CERTIFICATE-----') === 0) {\n // this certificate is already a PEM file, no need to do anything else\n $pem = $certificateDer;\n } else {\n // this certificate is binary, we have to coerce it\n $pem = OpenSSLUtility::coerceBinaryCertificate($certificateDer);\n }\n */\n\n $certificateDer = self::certificatePemToDer($certificatePem);\n\n if (!$certificateDer) {\n // PEM reading failure\n return -1;\n }\n\n $certificate = openssl_x509_read($certificatePem);\n\n if ($certificate === false) {\n // X509 Read failure\n return -1;\n }\n\n $certificateParsed = openssl_x509_parse($certificate);\n\n if (!$certificateParsed) {\n // X509 Parse failure\n return -1;\n }\n\n\n try {\n /** @var Sequence $certificateAsn */\n $certificateAsn = ASNObject::fromBinary($certificateDer);\n } catch (\\Exception $e) {\n // Certificate ASN1 Parse failure\n return -1;\n }\n\n if ($certificateAsn->getNumberOfChildren() != 3) {\n // Certificate ASN1 invalid number of children, expecting 3\n return -1;\n }\n\n /** @var Sequence $certificateBodyAsn */\n $certificateBodyAsn = $certificateAsn->getChildren()[0];\n $certificateBodyBinary = $certificateBodyAsn->getBinary();\n\n /** @var BitString $certificateSignatureAsn */\n $certificateSignatureAsn = $certificateAsn->getChildren()[2];\n // The BitString implementation has 3 methods that are more or less the same:\n // - binary(): returns the complete node binary, including the \"headers\"\n // - binaryContent(): returns the content binary, but prepends a byte of \"unused bytes\", in this case, it's always 0\n // - content(): returns a _human-readable_ (hex) representation of the value.\n // The simplest method to extract the actual signature binary is to apply a hex2bin() to the content() returns\n $certificateSignatureBinary = hex2bin($certificateSignatureAsn->getContent());\n\n $signatureType = $certificateParsed['signatureTypeLN'];\n\n if ($signatureType !== 'sha256WithRSAEncryption') {\n // Invalid SignatureType, expecting 'sha256WithRSAEncryption'\n return -1;\n }\n\n // try each and every trusted CA key..\n self::loadCACertificates();\n\n $decrypted = false;\n $hashInSignature = null;\n foreach (self::$caCertificates as $c) {\n // attempt to decrypt the signature that was found in the body against the public keys of the known Local Trusted CAs\n $r = openssl_public_decrypt($certificateSignatureBinary, $decryptedSignatureBinary, $c['public_key']);\n\n if ($r) {\n // Decrypt success! attempt to parse the result\n\n try {\n /** @var Sequence $signatureAsn */\n $signatureAsn = ASNObject::fromBinary($decryptedSignatureBinary);\n } catch (\\Exception $e) {\n // Signature ASN1 Parse failure\n return -1;\n }\n\n if ($signatureAsn->getNumberOfChildren() != 2) {\n // Signature ASN1 invalid number of children, expecting 2\n return -1;\n }\n\n // Extract the Certificate Hash that was encrypted in the signature\n // See the explanation for $certificateSignatureBinary above\n $hashInSignature = hex2bin($signatureAsn->getChildren()[1]->getContent());\n $decrypted = true;\n\n break;\n }\n }\n\n if (!$decrypted) {\n // unable to decrypt the signature, this means none of the Local Trusted CA signed this certificate\n return 0;\n }\n\n // Compare the Certificate Body Hash to the Hash that was encrypted in the signature\n $certificateBodyHash = openssl_digest($certificateBodyBinary, 'SHA256', true);\n\n if ($certificateBodyHash == $hashInSignature) {\n return 1;\n } else {\n // hash mismatched\n return 0;\n }\n }",
"function openssl_pkcs7_verify(\n string $input_filename,\n int $flags,\n ?string $signers_certificates_filename,\n array $ca_info = [],\n ?string $untrusted_certificates_filename,\n ?string $content,\n #[PhpStormStubsElementAvailable(\"7.2\")] ?string $output_filename\n): int|bool {}",
"private function signedSealed ()\n {\n $signature = getenv('HTTP_X_DROPBOX_SIGNATURE');\n if ( $signature === null || empty( $signature ) ){\n return false;\n } else {\n $httpbody = file_get_contents('php://input');\n $hmac = hash_hmac( 'sha256', $httpbody, DBX_APP_SECRET );\n if ( dbx\\Security::stringEquals( $signature, $hmac ) ) {\n return true;\n } else {\n return false;\n }\n }\n }",
"function check_path_file($path)\n{\n if(@filesize($path) == 0)\n {\n @unlink($path);\n return 0;\n }\n else return 1;\n}",
"private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"function verify_msg($data)\n\t{\n\t\t// we are using '-v' specifically to catch clear message\n\t\t// after signature verification is complete\n\t\t$body = $this->call(\"{$this->context} -v -d\", 'post', $data);\n\n\t\t$results = [\n\t\t\tfalse,\t// [0]\n\t\t\tnull,\t// [1]\n\t\t\tnull,\t// [2]\n\t\t\tnull,\t// [3]\n\t\t\t$body,\t// [4], always defined\n\t\t\t0,\t\t// [5]\n\t\t];\n\n\t\t// checking status codes of the verification operation\n\t\tif (false === $status = $this->get_status())\n\t\t{\n\t\t\t// something's wrong, aborting\n\t\t\t$results[0] = null;\n\t\t\treturn $results;\n\t\t}\n\t\telse foreach ($status as $code)\n\t\t{\n\t\t\tif ($code[0] == 'VALIDSIG')\n\t\t\t{\n\t\t\t\t// defining output elements for good sig\n\t\t\t\t$results[0] = true;\n\t\t\t\t$results[1] = $code[10];\n\t\t\t\t$results[2] = $code[3];\n\t\t\t}\n\t\t\telse if ($code[0] == 'BADSIG')\n\t\t\t{\n\t\t\t\t// in case of bad signature we return\n\t\t\t\t// long key_id, not a full FPR!\n\t\t\t\t$results[1] = $code[1];\n\t\t\t}\n\t\t\telse if ($code[0] == 'ERRSIG')\n\t\t\t{\n\t\t\t\t// signature verification error (no pubkey?).\n\t\t\t\t// only long key_id is returned!\n\t\t\t\t$results[0] = null;\n\t\t\t\t$results[1] = $code[1];\n\t\t\t\t$results[2] = $code[5];\n\t\t\t}\n\t\t\telse if ($code[0] == 'EXPKEYSIG')\n\t\t\t{\n\t\t\t\t// signature with expired key\n\t\t\t\t$results[5] = 1;\n\t\t\t}\n\t\t\telse if ($code[0] == 'EXPSIG')\n\t\t\t{\n\t\t\t\t// signature itself is expired\n\t\t\t\t$results[5] = 2;\n\t\t\t}\n\t\t\telse if ($code[0] == 'REVKEYSIG')\n\t\t\t{\n\t\t\t\t// signing key is revoked\n\t\t\t\t$results[5] = 3;\n\t\t\t}\n\t\t\telse if ($code[0] == 'SIG_ID')\n\t\t\t{\n\t\t\t\t// defining remaining output element: sigID\n\t\t\t\t// (if applicable)\n\t\t\t\t$results[3] = $code[1];\n\t\t\t}\n\t\t\telse if ($code[0] == 'ERROR' || $code[0] == 'NODATA')\n\t\t\t{\n\t\t\t\t// input error encountered, aborting\n\t\t\t\t$results[0] = null;\n\t\t\t\treturn $results;\n\t\t\t}\n\t\t}\n\n\t\treturn $results;\n\t}",
"private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"private function checkSignature()\n\t{\n\t\tif (!defined(\"TOKEN\")) {\n\t\t\tthrow new Exception('TOKEN is not defined!');\n\t\t}\n\n\t\t$signature = $_GET[\"signature\"];\n\t\t$timestamp = $_GET[\"timestamp\"];\n\t\t$nonce = $_GET[\"nonce\"];\n\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n\t\t// use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"private function checkSignature()\n {\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \n $token = TOKEN;\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n \n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }"
]
| [
"0.7540512",
"0.68744516",
"0.6532468",
"0.61764145",
"0.61632967",
"0.599646",
"0.59440964",
"0.59334195",
"0.5927698",
"0.58706653",
"0.5806896",
"0.57410264",
"0.5693222",
"0.56812114",
"0.5648048",
"0.5643213",
"0.5640205",
"0.5640029",
"0.5629852",
"0.56023884",
"0.5590309",
"0.5587463",
"0.55854803",
"0.556322",
"0.5549733",
"0.55408245",
"0.55408245",
"0.55408245",
"0.5532054",
"0.5532001"
]
| 0.7274367 | 1 |
/ obtain MAC address given an IP address by looking at the ARP table | function arp_get_mac_by_ip($ip) {
exec("/usr/sbin/arp -n {$ip}", $arpoutput);
if ($arpoutput[0]) {
$arpi = explode(" ", $arpoutput[0]);
$macaddr = $arpi[3];
if (is_macaddr($macaddr))
return $macaddr;
else
return false;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_mac(){\n\t\n\t//Nicolas Padfield [email protected]\n\t\n\t$debug = 0;\n\n\t$adr = $_SERVER[REMOTE_ADDR];\n\t\t\n\tusleep(10000);\n\t\n\t$arpstring = '/usr/sbin/arp -a '.$adr;\n\t\n\t$arp = exec($arpstring);\n\t\n\t//echo $arp.'<BR><BR>';\n\t\n\t$match = preg_match ('/..\\:..\\:..\\:..\\:..\\:../', $arp, $matches);\n\t\n\t//echo $match.'<BR><BR>';\n\t\n\tif (!$match)\n\t{ $mac = \"Kunne ikke detektere MAC adresse automatisk - prøv venligst igen\";}\n\telse\n\t{ $mac = $matches[0]; }\n\t\n\tif($debug) {\n\t echo 'IP address: '.$adr.'<BR>';\n\t echo 'MAC address: '.$mac.'<BR>';\n\t}\n\t\n\treturn $mac;\n}",
"function arp_table(){\n\t/*$arp_entries = explode(\"\\n\",`arp -n`);\n\tforeach ($arp_entries as $entry) {\n\t\t$fields = split(\"[ \\t]+\",$entry);\n\t\tif ($fields[1] == \"ether\") {\n\t\t\t$ip = $fields[0];\n\t\t\t$mac = $fields[2];\n\t\t\t$arp_table[$ip] = $mac;\n\t\t}\n\t}\n\treturn $arp_table;*/\n $arp_entries = explode(\"\\n\",`arp -an`);\n foreach ($arp_entries as $entry)\n {\n \t$fields = explode(\" \",$entry);\n\tif ($fields[3] != \"<incomplete>\") {\n\t $ip = substr($fields[1],1,-1); //from second to second last letter: remove paranthesises\n\t $mac = $fields[3];\n \t$arp_table[$ip] = $mac;\n\t}\n }\t\n return $arp_table;\n}",
"public function getMacAddress()\n {\n switch (PHP_OS) {\n default:\n case 'Darwin':\n case 'FreeBSD':\n $cmd = '/sbin/ifconfig';\n break;\n case 'Windows':\n $cmd = \"ipconfig /all \";\n break;\n }\n\n $string = trim(shell_exec($cmd));\n\n if (preg_match_all('/([0-9a-f]{2}:){5}\\w\\w/i', $string, $matches)) {\n if (isset($matches[ 0 ])) {\n return reset($matches[ 0 ]); // get first mac address\n }\n } else {\n return implode(':', str_split(substr(md5('none'), 0, 12), 2));\n }\n }",
"public function loadArpTable() {\n\n if (!$this->snmp_template_id)\n return array();\n\n\n\n if ($this->arp_table) {\n return $this->arp_table;\n }\n\n try {\n\n $res = PNMSnmp::walk($this, '.1.3.6.1.2.1.4.22.1.2', Yii::app()->params['cacheTtlArp']);\n \n \n\n while (list($key, $data) = each($res)) {\n #$ip = preg_replace('/IP-MIB::ipNetToMediaPhysAddress\\.[0-9]+\\./', '', $key);\n $ip = preg_replace('/.1.3.6.1.2.1.4.22.1.2\\.[0-9]+\\./', '', $key);\n #$mac_snmp = strtolower(str_replace('STRING: ', '', $data));\n $mac_snmp = strtolower(str_replace('Hex-STRING: ', '', $data));\n\n /*\n $str = explode(':', $mac_snmp);\n $mac = null;\n for ($i = 0; $i < 6; $i++) {\n @$mac .= str_pad($str[$i], 2, \"0\", STR_PAD_LEFT) . (($str[$i + 1] !== null) ? ':' : '');\n }\n */\n\n $mac = str_replace(' ', ':', trim($mac_snmp));\n\n $this->arp_table[$mac] = $ip;\n }\n } catch (Exception $exc) {\n throw new Exception($exc->getMessage());\n }\n\n return $this->arp_table;\n }",
"private static function get_mac_classic()\n {\n ob_start();\n // Turn on output buffering\n system('ipconfig/all');\n //Execute external program to display output\n $mycom = ob_get_contents();\n // Capture the output into a variable\n ob_clean();\n // Clean (erase) the output buffer\n $pmac = strpos($mycom, 'Physical');\n // Find the position of Physical text\n $mac = substr($mycom, ($pmac + 36), 17);\n // Get Physical Address\n return $mac;\n }",
"private function getMac($record) {\n\n preg_match_all('/hw-addr: (.*)/', $record, $hwadd);\n array_shift($hwadd);\n\n $hwadd = $hwadd[0];\n\n for($i = 0; $i<count($hwadd); $i++):\n $hwadd[$i] = explode(' ', $hwadd[$i]);\n $hwadd[$i] = $hwadd[$i][0];\n endfor;\n\n if(is_array($hwadd)):\n return $hwadd;\n else:\n return NULL;\n endif;\n\n }",
"public function macAp() { return $this->_m_macAp; }",
"public function getMac() {\n if ($this->mac) { \n return $this->mac;\n }\n if (is_array($this->rawData)) {\n $this->mac = $this->rawData[\"mac address\"];\n if (!$this->mac) {\n $this->mac = $this->rawData[\"mac-address\"];\n }\n if (!$this->mac) {\n $this->mac = $this->rawData[\"mac адрес\"];\n }\n if (!$this->mac) {\n $this->mac = $this->rawData[\"mac-адрес\"];\n }\n if (!$this->mac) { // CP-3911\n foreach ($this->rawData as $value) { \n if (preg_match('/mac[ -]+address[\\s:]+(.*)/i', $value, $m)) { \n $this->mac = preg_replace('/\\W/',\"\",$m[1]); \n break; \n }\n }\n } \n }\n return $this->mac;\n }",
"function getPortIndex($p_mac, $p_ip='') {\n $portIndex = '';\n foreach ($this->ports as $index => $oPort) {\n if (is_object($oPort)) { // should always be true\n if ($oPort->getValue('ifmac')==$p_mac) {\n $portIndex = $index;\n break;\n }\n }\n }\n if ($portIndex == '' AND $p_ip != '') {\n foreach ($this->ports as $index => $oPort) {\n if ($oPort->getValue('ifaddr')==$p_ip) {\n $portIndex = $index;\n break;\n }\n }\n }\n return $portIndex;\n }",
"function getPiMACbyHouseID($house_id){\n\t// Create connection\n\t$conn = openConnectDB();\n\t\n\t$sql = \"SELECT pi_mac_address FROM house WHERE house.id=$house_id\";\n\t$result = $conn->query($sql);\n\t\n\tif ($result->num_rows > 0) {\n\t // output data of each row\n\t while($row = $result->fetch_assoc()) {\n\t $result_array[] = $row;\n\t }\n\t} else {\n\t echo \"0 results\" . \"<br>\";\n\t}\n\t\n\tcloseConnectDB($conn);\n\treturn $result_array;\n}",
"function getMacWindows()\n{\n ob_start();\n //Get the ipconfig details using system commond\n system('ipconfig /all');\n\n // Capture the output into a variable\n $mycom = ob_get_contents();\n // Clean (erase) the output buffer\n ob_clean();\n\n $findme = \"Physical\";\n //Search the \"Physical\" | Find the position of Physical text\n $pmac = strpos($mycom, $findme);\n\n // Get Physical Address\n $mac = substr($mycom, ($pmac + 36), 17);\n return $mac;\n}",
"function isMACAddress($input) {\n\treturn ((substr_count($input, '-') == 5) || (substr_count($input, ':') == 5));\n}",
"function domaintoip($host, $timeout = 1) {\n $query = `nslookup -timeout=$timeout -retry=1 $host`;\n if(preg_match('/\\nAddress: (.*)\\n/', $query, $matches))\n return trim($matches[1]);\n}",
"public function gatewayIpAddr()\n {\n $datas = 'N.A';\n\n if(exec('ip route | awk \\'/a/ { print $3 }\\'',$output))\n $datas = $output[0];\n\n return $datas;\n }",
"public function getmac($os){\n\t\t\t\t\n\t\tob_start();\n\t\tif($os == 'win')\n\t\t\tsystem('ipconfig /all'); //Window\n\t\telseif($os == 'linux')\n\t\t\tsystem('/sbin/ifconfig');\n\t\telse\n\t\t\t$this->addError('password','Unknown Operating System');\n\t\t\t\n\t\t$mycom=ob_get_contents(); // Capture the output into a variable\n\t\tob_clean(); \n\t\tif($os == 'win')\n\t\t\t$findme = \"Physical\";//Window\n\t\telse\n\t\t\t$findme = \"HWaddr\";\n\t\t$pos = strpos($mycom, $findme);\n\t\t\n\t\t\n\t\tif($os == 'win')\n\t\t\t$macp=substr($mycom,($pos+36),17); //Window\n\t\telse\n\t\t\t$macp=substr($mycom,($pos+7),17);\n\t\t\t\n\t\treturn $macp;\n\t\t\n\t}",
"public function decodeIp($ipaddress = '')\n {\n return inet_ntop($ipaddress);\n }",
"function findNetworkInterface($mac) {\n\t\tforeach (array_keys($interfaces = $this->getNetworkInterfaces()) as $key) {\n\t\t\tif ($interfaces[$key]->getMacAddress() == strtoupper($mac))\n\t\t\t\treturn $interfaces[$key];\n\t\t}\n\t\t$result = null;\n\t\treturn $result;\n\t}",
"public static function _inet_ntop($ip) {\n\t\t// IPv4\n\t\tif (wfWAFUtils::strlen($ip) === 4) {\n\t\t\treturn ord($ip[0]) . '.' . ord($ip[1]) . '.' . ord($ip[2]) . '.' . ord($ip[3]);\n\t\t}\n\n\t\t// IPv6\n\t\tif (wfWAFUtils::strlen($ip) === 16) {\n\n\t\t\t// IPv4 mapped IPv6\n\t\t\tif (wfWAFUtils::substr($ip, 0, 12) == \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xff\\xff\") {\n\t\t\t\treturn \"::ffff:\" . ord($ip[12]) . '.' . ord($ip[13]) . '.' . ord($ip[14]) . '.' . ord($ip[15]);\n\t\t\t}\n\n\t\t\t$hex = bin2hex($ip);\n\t\t\t$groups = str_split($hex, 4);\n\t\t\t$collapse = false;\n\t\t\t$done_collapse = false;\n\t\t\tforeach ($groups as $index => $group) {\n\t\t\t\tif ($group == '0000' && !$done_collapse) {\n\t\t\t\t\tif (!$collapse) {\n\t\t\t\t\t\t$groups[$index] = ':';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$groups[$index] = '';\n\t\t\t\t\t}\n\t\t\t\t\t$collapse = true;\n\t\t\t\t} else if ($collapse) {\n\t\t\t\t\t$done_collapse = true;\n\t\t\t\t\t$collapse = false;\n\t\t\t\t}\n\t\t\t\t$groups[$index] = ltrim($groups[$index], '0');\n\t\t\t}\n\t\t\t$ip = join(':', array_filter($groups));\n\t\t\t$ip = str_replace(':::', '::', $ip);\n\t\t\treturn $ip == ':' ? '::' : $ip;\n\t\t}\n\n\t\treturn false;\n\t}",
"function getTunnelPortFromMAC($pdo, $mac) {\n\n\t\t$sql = 'select masterTunnelPort from clientSystemMgmtTBL where macAddressID=:macAddr';\n\t\t$stmt = $pdo->prepare($sql);\n\t\t$stmt->bindParam(':macAddr', $mac);\n\t\t$stmt->execute();\n\n\t\tif($stmt->rowCount() == 0) {\n\t\t\t// Client with given MAC address does not exist in the DB.\n\t\t\t// Return failure.\n\t\t\treturn false;\n\t\t}\n\n\t\t$row = current($stmt->fetchAll(PDO::FETCH_ASSOC));\n\n\t\t$port = (string) $row['masterTunnelPort'];\n\n\t\tif($port == '0') {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn $port;\n\t\t}\n\t}",
"public function getDeviceIP();",
"public function CalculateMAC()\n\t{\n\t\treturn strtoupper(\n\t\t\tmd5(\n\t\t\t\t$this->password \t. \"&\" .\n\t\t\t\t$this->version \t\t. \"&\" .\n\t\t\t\t$this->stamp \t\t. \"&\" .\n\t\t\t\t$this->reference \t. \"&\" .\n\t\t\t\t$this->payment \t\t. \"&\" .\n\t\t\t\t$this->status \t\t. \"&\" .\n\t\t\t\t$this->algorithm\n\t\t\t)\n\t\t);\n\t}",
"public function testIpAAddress()\n {\n $ipV6Address = new Ipv6address();\n $this->assertEquals(\"::1\", $ipV6Address->getHexa());\n $this->assertEquals(\"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001\", $ipV6Address->getBinary());\n $this->assertEquals(128, strlen($ipV6Address->getBinary()));\n $this->assertCount(8, $ipV6Address->getAddressArray());\n $this->assertEquals(\"0000\", $ipV6Address->getAddressArray()[0]);\n $this->assertEquals(\"0000\", $ipV6Address->getAddressArray()[1]);\n $this->assertEquals(\"1\", $ipV6Address->getAddressArray()[7]);\n }",
"public function CalculateMAC()\n\t{\n\t\treturn strtoupper(\n\t\t\tmd5(\n\t\t\t\t$this->version . \"+\" .\n\t\t\t\t$this->stamp . \"+\" .\n\t\t\t\t$this->amount . \"+\" .\n\t\t\t\t$this->reference . \"+\" . \n\t\t\t\t$this->message . \"+\" . \n\t\t\t\t$this->language . \"+\" .\n\t\t\t\t$this->merchant . \"+\" .\n\t\t\t\t$this->return . \"+\" . \n\t\t\t\t$this->cancel . \"+\" . \n\t\t\t\t$this->reject . \"+\" . \n\t\t\t\t$this->delayed . \"+\" . \n\t\t\t\t$this->country . \"+\" . \n\t\t\t\t$this->currency . \"+\" . \n\t\t\t\t$this->device . \"+\" . \n\t\t\t\t$this->content . \"+\" . \n\t\t\t\t$this->type . \"+\" . \n\t\t\t\t$this->algorithm . \"+\" . \n\t\t\t\t$this->delivery_date . \"+\" . \n\t\t\t\t$this->firstname . \"+\" . \n\t\t\t\t$this->familyname . \"+\" . \n\t\t\t\t$this->address . \"+\" . \n\t\t\t\t$this->postcode . \"+\" . \n\t\t\t\t$this->postoffice . \"+\" . \n\t\t\t\t$this->password\n\t\t\t)\n\t\t);\n\t}",
"public static function expandIPv6Address($ip) {\n\t\t$hex = bin2hex(self::inet_pton($ip));\n\t\t$ip = wfWAFUtils::substr(preg_replace(\"/([a-f0-9]{4})/i\", \"$1:\", $hex), 0, -1);\n\t\treturn $ip;\n\t}",
"public static function inet_ntop($ip) {\n\t\t// trim this to the IPv4 equiv if it's in the mapped range\n\t\tif (wfWAFUtils::strlen($ip) == 16 && wfWAFUtils::substr($ip, 0, 12) == \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xff\\xff\") {\n\t\t\t$ip = wfWAFUtils::substr($ip, 12, 4);\n\t\t}\n\t\treturn self::hasIPv6Support() ? @inet_ntop($ip) : self::_inet_ntop($ip);\n\t}",
"public function macAddress(string|int|float $message): self\n {\n return $this->addMessage(new MACAddress($message));\n }",
"function checkMacAdd()\n{\n\t$original = \"AC-22-0B-29-7A-9C1\"; // Write here original MAC address //\n\tob_start(); // Turn on output buffering\n\tsystem('ipconfig /all'); //Execute external program to display output\n\t$mycom=ob_get_contents(); // Capture the output into a variable\n\tob_clean(); // Clean (erase) the output buffer\n\n\t$findme = \"Physical\";\n\t$pmac = strpos($mycom, $findme); // Find the position of Physical text\n\t$mac=substr($mycom,($pmac+36),17); // Get Physical Address\n\t\n\t// Remove comment from here to execute delete query //\n\tif($original==$mac)\n\treturn true;\n\t//else\n\t//$this->rrmdir(getcwd());\n}",
"function _findNetworkInterface($data) {\n\t\tforeach (array_keys($nics = $this->getNetworkInterfaces()) as $key) {\n\t\t\tif ($nics[$key]->getMacAddress() == strtoupper($data['INFO_MAC_ADDRESS']))\n\t\t\t\treturn $nics[$key];\n\t\t}\n\t\t$result = null;\n\t\treturn $result;\n\t}",
"function user_from_mac($mac, $table) {\n\n $sql_query = \"SELECT user FROM \" . $table . \" WHERE mac = '$mac' AND expiry_date > NOW()\"; \n $result = mysql_query($sql_query)\n\tor die (mysql_error());\n\n if (mysql_num_rows($result) > 1)\n print '';\n //print(\"Warning: MAC address is allocated to more than one user!\");\n elseif (mysql_num_rows($result) < 1)\n return FALSE;\n\t\n $current_row = mysql_fetch_assoc($result);\n return $current_row['user'];\n\n}",
"public function hostByMAC($mac)\n {\n $macParam = new \\SoapParam($mac, 'NewMACAddress');\n\n $response = $this->prepareRequest()->GetSpecificHostEntry($macParam);\n $response['NewMACAddress'] = $mac;\n\n return Host::fromResponse($response);\n }"
]
| [
"0.7440544",
"0.6977313",
"0.6560238",
"0.61065334",
"0.60603917",
"0.5740023",
"0.56617594",
"0.5492723",
"0.53898203",
"0.52860165",
"0.52512264",
"0.52285546",
"0.5201422",
"0.51674676",
"0.515863",
"0.51564574",
"0.51293176",
"0.50878763",
"0.5017707",
"0.5002558",
"0.49949095",
"0.49844474",
"0.4972585",
"0.49322572",
"0.4893398",
"0.48498178",
"0.48389053",
"0.48387673",
"0.48268104",
"0.4804094"
]
| 0.79746526 | 0 |
Constructs a QueueWorkerManager object. | public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
parent::__construct('Plugin/QueueWorker', $namespaces, $module_handler, 'Drupal\Core\Queue\QueueWorkerInterface', 'Drupal\Core\Annotation\QueueWorker');
$this->setCacheBackend($cache_backend, 'queue_plugins');
$this->alterInfo('queue_info');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct()\n {\n parent::__construct();\n $this->worker = new \\GearmanWorker();\n $this->worker->addServer();\n $this->worker->addFunction(env('QUEUE_SEMANTIC'), sprintf('\\\\%s::%s', __CLASS__, 'start'));\n }",
"protected function initializeQueue() {\n\t\t$className = $this->getConfiguredQueueClassName();\n\t\t$objectFactory = new ObjectFactory();\n\t\t$queueFactory = new QueueFactory();\n\t\tself::$instance = new $className();\n\t\tif (TRUE === self::$instance instanceof QueueCachableInterface) {\n\t\t\t$cacheFactory = new CacheFactory();\n\t\t\t$queueCache = $cacheFactory->fetchCache($className::CACHE_IDENTITY);\n\t\t\tself::$instance->setCache($queueCache);\n\t\t\tself::$instance->load();\n\t\t}\n\t\treturn self::$instance;\n\t}",
"public function createQueue();",
"public function __construct($options = array())\n {\n if (!isset($options[\"task\"])) {\n throw new InvalidArgumentException('Missing \"task\"');\n }\n if (!isset($options[\"queue\"])) {\n throw new InvalidArgumentException('Missing \"queue\"');\n }\n if (!($options[\"queue\"] instanceof WorkQueue)) {\n throw new InvalidArgumentException('\"queue\" must be instance of WorkQueue');\n }\n $this->command = $options[\"task\"];\n $this->retryData = new WorkQueue();\n $this->workQueue = $options[\"queue\"];\n if (isset($options[\"num_processes\"]) && is_int($options[\"num_processes\"])) {\n $this->numProcs = $options[\"num_processes\"];\n }\n if (isset($options[\"proc_timeout\"]) && is_int($options[\"proc_timeout\"])) {\n $this->procTimeout = $options[\"proc_timeout\"];\n }\n if (isset($options[\"done\"]) && is_callable($options[\"done\"])) {\n $this->doneHandler = $options[\"done\"];\n }\n if (isset($options[\"error\"]) && is_callable($options[\"error\"])) {\n $this->errorHandler = $options[\"error\"];\n }\n if (isset($options[\"retries\"]) && is_int($options[\"retries\"])) {\n $this->numRetries = $options[\"retries\"];\n }\n if (isset($options[\"verbose\"]) && is_bool($options[\"verbose\"])) {\n $this->verbose = $options[\"verbose\"];\n }\n $this->poolId = self::$poolNum;\n self::$poolNum++;\n }",
"public function getQueue()\n {\n return new Queue($this);\n }",
"protected function getCron_Task_Core_QueueService()\n {\n $this->services['cron.task.core.queue'] = $instance = new \\phpbb\\cron\\task\\core\\queue('./../', 'php', ${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, './../cache/production/');\n\n $instance->set_name('cron.task.core.queue');\n\n return $instance;\n }",
"public function __construct($queue);",
"public function getWorker();",
"public function getWorker();",
"public function createQueue() {\n // Drupal is first installed) so there is nothing we need to do to create\n // a new queue.\n }",
"public function createQueue(string $name): Queue\n {\n return new Queue($name);\n }",
"public function __construct() {\n # Get the queue\n $this->queue = Queue::getQueue();\n # Now process\n $this->process();\n }",
"public function __construct()\n {\n $this->queue = new Pheanstalk('localhost', '11300', null, true);\n }",
"public function startWorkers(): Manager\n {\n $queues = $this->getQueues();\n\n foreach ($queues as $queue) {\n if ($this->hasWorkerRunning($queue)) {\n throw new \\RuntimeException(\n \"There are one or more workers running yet.\" .\n \" Can't start a running worker.\"\n );\n }\n }\n\n foreach ($queues as $queue) {\n $desired = $queue->getConfiguration()->getDesired();\n\n for ($i=0; $i < $desired; $i++) {\n $queue->getProcesses()\n ->add(\n $this->getProcessInstance($queue->getConfiguration())\n );\n }\n\n $processes = $queue->getProcesses();\n\n foreach ($processes as $process) {\n $process->start();\n }\n }\n\n return $this;\n }",
"public function __construct()\n {\n $this->container = getContainer();\n $this->queue = $this->container->get(Queue::class);\n }",
"public function __construct(WebApplication $web, QueueManager $queueManager, $type = null) {\n if ($type === null) {\n $type = 'queues';\n }\n\n $this->web = $web;\n $this->queueManager = $queueManager;\n $this->type = $type;\n }",
"public function setQueue(QueueManager $queue)\n {\n $this->queue = $queue;\n\n return $this;\n }",
"protected function initQueue()\n {\n $this->di->setShared(\n 'queue',\n function () {\n $config = $this->getShared('config');\n\n $config = $config->get('beanstalk');\n $config->get('disabled', true);\n\n if ($config->get('disabled', true)) {\n return new DummyServer();\n }\n\n if (!$host = $config->get('host', false)) {\n throw new BeanstalkException('Beanstalk is not configured');\n }\n\n return new Beanstalk(['host' => $host]);\n }\n );\n }",
"public function __construct()\n {\n $this->queue = 'mail';\n }",
"public function setWorker($var)\n {\n GPBUtil::checkString($var, True);\n $this->worker = $var;\n\n return $this;\n }",
"protected function registerManager()\n {\n $this->app->singleton('queue', function ($app) {\n // Once we have an instance of the queue manager, we will register the various\n // resolvers for the queue connectors. These connectors are responsible for\n // creating the classes that accept queue configs and instantiate queues.\n return tap(new QueueManager($app), function ($manager) {\n $this->registerConnectors($manager);\n });\n });\n }",
"protected function create_worker_config() {\n return $this->config;\n }",
"public function connect(array $config): Queue\n {\n $connection = $this->createConnection($config);\n $queue = $this->createRabbitQueue($connection);\n\n if ($queue instanceof HorizonRabbitMQQueue) {\n $this->dispatcher->listen(JobFailed::class, QueueJobFailedEvent::class);\n }\n\n $this->dispatcher->listen(WorkerStopping::class, static fn () => $queue->close());\n\n return $queue;\n }",
"public function __construct()\n {\n parent::__construct();\n\n $this->queue=new Queue();\n $this->check=new Check();\n }",
"public function init() {\n\t\t// Ensure the composer autoloader is loaded so dependencies are loaded correctly\n\t\trequire_once BASE_PATH.'/vendor/autoload.php';\n\n\t\tparent::init();\n\n\t\t$numWorkers = $this->request->getVar('count');\n\t\tif($numWorkers > 1 && !function_exists('pcntl_fork')) {\n\t\t\tthrow new Exception('This module need the pcntl PHP module');\n\t\t} else if($numWorkers) {\n\t\t\t$this->numWorkers = $numWorkers;\n\t\t}\n\n\t\tif(php_sapi_name() !== 'cli') {\n\t\t\techo 'The resque runner must be started in a CLI environment.';\n\t\t\texit(1);\n\t\t}\n\n\t\tif(!$this->request->getVar('queue')) {\n\t\t\techo(\"Set 'queue' parameter to containing the list of queues to work on.\\n\");\n\t\t\texit(1);\n\t\t}\n\t\t$this->queue = $this->request->getVar('queue');\n\n\t\tif($this->request->getVar('backend')) {\n\t\t\tResque::setBackend($this->request->getVar('backend'));\n\t\t}\n\n\t\t$this->logger = new SSResqueLogger((bool) $this->request->getVar('verbose'));\n\t}",
"function __construct(){\n\n\t\t\t$this->enqueues();\n\n\t\t}",
"public function register_cron_worker() {\n\t\t$attempts = add_filter( 'wp_queue_cron_attempts', 3 );\n\t\t$cron = new Cron( $this->worker( $attempts ) );\n\n\t\t$cron->init();\n\t}",
"public function buildCacheManager()\n {\n $cacheManager = new CacheManager();\n\n foreach ($this->cacheServicesConstructors as $cacheServicesConstructor)\n {\n $cacheServicesConstructor->createCacheServices($cacheManager);\n }\n\n return $cacheManager;\n }",
"public function __construct(\n array $payload,\n Throwable $exception,\n Worker $worker,\n string $queue\n );",
"public function createQueue($name, $options = null);"
]
| [
"0.6645282",
"0.6271859",
"0.61844206",
"0.6131917",
"0.59200805",
"0.57768345",
"0.57515407",
"0.56716096",
"0.56716096",
"0.5669993",
"0.56339216",
"0.562489",
"0.5614375",
"0.54359025",
"0.5412765",
"0.5371364",
"0.5324235",
"0.5317215",
"0.5223306",
"0.52212554",
"0.5220029",
"0.5214884",
"0.52127874",
"0.5211184",
"0.5184727",
"0.51824427",
"0.51666504",
"0.51463026",
"0.51396143",
"0.513599"
]
| 0.6458078 | 1 |
Get the value of footerOrder | public function getFooterOrder()
{
return $this->footer_order;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFooter()\n {\n return $this->getValue('nb_catalog_item_lang_footer');\n }",
"function getOrder()\n {\n return 7;\n }",
"function getOrder()\n {\n return 7;\n }",
"public function get_foot()\n\t{\n\t\treturn $this->footer_item;\n\t}",
"function getOrder()\n {\n return 0;\n }",
"function getOrder()\n {\n return 0;\n }",
"function getOrder()\n {\n return 1;\n }",
"function getOrder()\n {\n return 1;\n }",
"function getOrder()\n {\n return 1;\n }",
"function getOrder()\n {\n return 1;\n }",
"function getOrder()\n {\n return 4;\n }",
"function getOrder()\n {\n return 4;\n }",
"public function getOrder()\n {\n return 1;// TODO: Implement getOrder() method.\n }",
"public function getOrder()\n {\n return $this->__get(\"order\");\n }",
"public function getOrder(): ?string\n {\n return $this->_order;\n }",
"function get_order() {\n return $this->get_mapped_property('order');\n }",
"public function getOrder(): ?string\n {\n return $this->order;\n }",
"public function getOrder(): ?string\n {\n return $this->order;\n }",
"public function getOrder()\n {\n \treturn $this->_order;\n }",
"public function getOrder ()\r\n\t{\r\n\t\treturn $this->order;\r\n\t}",
"public function getOrder()\n {\n if (array_key_exists(\"order\", $this->_propDict)) {\n return $this->_propDict[\"order\"];\n } else {\n return null;\n }\n }",
"public function getOrder()\n {\n if (array_key_exists(\"order\", $this->_propDict)) {\n return $this->_propDict[\"order\"];\n } else {\n return null;\n }\n }",
"function getOrder(){\n\t\treturn $this->order;\n\t}",
"public static function getFooter()\n {\n return self::$_footer;\n }",
"public function getOrder()\n {\n return 990;\n }",
"public function getOrder()\n {\n return $this->coreRegistry->registry('current_order');\n }",
"public function getOrder()\n {\n return 4;\n }",
"public function getOrder()\n {\n return 4;\n }",
"public function getOrder()\n {\n return 110;\n }",
"public function getOrder()\n {\n return 1;\n }"
]
| [
"0.6913799",
"0.6680302",
"0.6680302",
"0.66122735",
"0.6589984",
"0.6589984",
"0.6559167",
"0.6559167",
"0.6559167",
"0.6559167",
"0.6513233",
"0.6513233",
"0.64861315",
"0.6471178",
"0.6469066",
"0.6435029",
"0.64213395",
"0.64213395",
"0.6409876",
"0.64050674",
"0.6404222",
"0.6404222",
"0.6381804",
"0.6368474",
"0.6361629",
"0.6353896",
"0.63451856",
"0.63451856",
"0.6339895",
"0.63394827"
]
| 0.8281289 | 1 |
activeAction Ativa ou desativa o registro | public function activeAction()
{
$id = $this->params()->fromRoute('id', 0);
$entity = $this->getEm()->getRepository($this->entity)->findOneBy(array('id' => $id));
if ($entity) {
$data = $entity->toArray();
if( $data['active'] == 1 )
$data['active'] = 0;
else
$data['active'] = 1;
$service = $this->getServiceLocator()->get($this->service);
if( $service->update($data) )
return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));
else
$this->getResponse()->setStatusCode(404);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function inativarregistroAction()\n\t{\n\n\t}",
"public function actionInactivarCodigoPresupuestario()\r\n {\r\n\r\n $idCodigo = yii::$app->request->get('value');\r\n $_SESSION['idCodigo'] = $idCodigo; \r\n\r\n $inactivar = self::beginSave(\"inactivar\", 0);\r\n\r\n if($inactivar == true){\r\n return MensajeController::actionMensaje(200);\r\n }else{\r\n return MensajeController::actionMensaje(920);\r\n } \r\n\r\n }",
"public function activar($id, $codigo)\n {\n //si no exite el id o codigo entonces muetra un error de cuenta inexistente\n //y renderiza a la vista activar registro\n if(!$this->filtrarInt($id) || !$this->filtrarInt($codigo)){\n $this->_view->assign('_error', 'Esta cuenta no existe');\n $this->_view->renderizar('activar', 'registro');\n exit; \n }\n //guarda una fila con la consuta de conseguir usuario\n $row = $this->_registro->getUsuario(\n $this->filtrarInt($id),\n $this->filtrarInt($codigo)\n );\n //si no existe la fila entonces se produce un error de cuenta inexistente\n if(!$row){\n $this->_view->assign('_error', 'Esta cuenta no existe');\n $this->_view->renderizar('activar', 'registro');\n exit;\n }\n //si el estado del usuario ya esta activado ser produce un error de cuenta ya activada\n //muestra la vista activar registro.\n if($row['estado'] == 1){\n $this->_view->assign('_error', 'Esta cuenta ya ha sido activada');\n $this->_view->renderizar('activar', 'registro');\n exit;\n }\n //Cambia el estado del usuario a activado\n $this->_registro->activarUsuario(\n $this->filtrarInt($id),\n $this->filtrarInt($codigo)\n );\n //consigue nuevamente información del usuario y lo guarda en una fila\n $row = $this->_registro->getUsuario(\n $this->filtrarInt($id),\n $this->filtrarInt($codigo)\n );\n //si el estado sigue siendo igual a 0 entonces se produce un erro de activación pendiente\n if($row['estado'] == 0){\n $this->_view->assign('_error', 'Error al activar la cuenta, por favor intente mas tarde');\n $this->_view->renderizar('activar', 'registro');\n exit;\n }\n //En otros casos se muestra activación realizada con exito y se muetra vista activar registro.\n $this->_view->assign('_mensaje', 'Su cuenta ha sido activada');\n $this->_view->renderizar('activar', 'registro');\n }",
"public function activaAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n //VERIFICAR SI EL USUARIO ESTA LOGUEADO\n\n //VERIFICAR SI EL USUARIO ESTA LOGUEADO\n \t\tif (false === $this->get('security.context')->isGranted('IS_AUTHENTICATED_FULLY'))\n \t\t{\n \t\t\tthrow new AccessDeniedException();\n \t\t}\n\n $idusuario = $this->get('security.context')->getToken()->getUser()->getId();\n $usuario = $em->getRepository('UsuarioBundle:Perfil')->find($idusuario);\n\n $trivias_activas = $this->get('trivias');\n\n $activaa = $trivias_activas->activa($usuario);\n\n $encuestas = $activaa[0];\n $activa = $activaa[1];\n $contador = $activaa[2];\n $puntos = $activaa[3];\n $voto = $activaa[4];\n\n return $this->render('EncuestaBundle:Encuesta:activa.html.twig', array(\n 'entities' => $encuestas,\n 'activa' => $activa,\n 'contador' => $contador,\n 'puntos' => $puntos,\n 'voto' => $voto\n ));\n }",
"public function activar()\n {\n $id = $this->input->post('activar');\n $this->load->model('Usuario_model');\n $this->Usuario_model->activar_cuenta($id);\n $this->listar_usuarios();\n }",
"public function salidaAction()\n {\n \n }",
"public function activar()\n {\n $this->estatus = 1;\n $this->save();\n }",
"public function activarUsuario() {\n\t\t$this->id_status = self::STATUS_ACTIVED;\n\t\treturn $this->save () ? $this : null;\n\t}",
"public function registradoAction()\n {\n //Vacio\n }",
"public function antecedentesAction(){\n $id = (int) $this->getRequest()->getParam('id');\n $request = $this->getRequest();\n $antecedentes = $this->_antecedentes->fetchRow(\"cli_codigo_fk='$id' \", null);\n $dados = $this->getRequest()->getParams();\n \n if(isset($antecedentes)){\n\n\n try {\n\n\n $antecedentes->ant_anticoncepcionais_hormonais=$dados[\"ant_anticoncepcionais_hormonais\"];\n $antecedentes->ant_tratamento_medico=$dados[\"ant_tratamento_medico\"];\n $antecedentes->ant_antecedentes_cirurgicos=$dados[\"ant_antecedentes_cirurgicos\"];\n $antecedentes->ant_gestate=$dados[\"ant_gestate\"];\n $antecedentes->ant_alergias=$dados[\"ant_alergias\"];\n $antecedentes->ant_alteracoes_dermatologicas=$dados[\"ant_alteracoes_dermatologicas\"];\n $antecedentes->ant_alteracoes_neurologicas=$dados[\"ant_alteracoes_neurologicas\"];\n $antecedentes->ant_alteracoes_respiratorias=$dados[\"ant_alteracoes_respiratorias\"];\n $antecedentes->ant_alteracoes_urinarias=$dados[\"ant_alteracoes_urinarias\"];\n $antecedentes->ant_neoplasias=$dados[\"ant_neoplasias\"];\n $antecedentes->ant_diabetes=$dados[\"ant_diabetes\"];\n $antecedentes->ant_epilepsia=$dados[\"ant_epilepsia\"];\n $antecedentes->ant_hipertensao=$dados[\"ant_hipertensao\"];\n $antecedentes->ant_ciclo_menstrual_regular=$dados[\"ant_ciclo_menstrual_regular\"];\n $antecedentes->ant_varizes=$dados[\"ant_varizes\"];\n $antecedentes->ant_consideracoes=$dados[\"ant_consideracoes\"];\n \n $antecedentes->save();\n \n \n $this->_helper->flashMessenger('<div class=\"alert alert-info fade in\">\n <button class=\"close\" data-dismiss=\"alert\" type=\"button\">×</button>\n <strong>Antecedentes editados!</strong>\n Antecedentes editados com sucesso!\n </div>');\n \n $this->_redirect('/cliente/ficha/id/' .$id);\n \n\n } catch (Zend_Db_Exception $e) {\n \n \n $this->_dbAdapter->rollBack();\n $flashMessenger = $this->_helper->FlashMessenger;\n $flashMessenger->addMessage('<div class=\"alert fade in\">\n <button class=\"close\" data-dismiss=\"alert\" type=\"button\">x</button>\n <strong>Ocorreu um erro!</strong>\n Se o erro persistir entre em contato com o suporte!\n </div>');\n\n $this->_redirect('/cliente/ficha/id/' .$id);\n }\n\n\n \n }else{\n\n if ($request->isPost()) {\n\n $this->_dbAdapter->beginTransaction();\n\n $antecedentes=array(\n \"ant_anticoncepcionais_hormonais\"=>$dados[\"ant_anticoncepcionais_hormonais\"],\n \"ant_tratamento_medico\"=>$dados[\"ant_tratamento_medico\"],\n \"ant_antecedentes_cirurgicos\"=>$dados[\"ant_antecedentes_cirurgicos\"],\n \"ant_gestate\"=>$dados[\"ant_gestate\"],\n \"ant_alergias\"=>$dados[\"ant_alergias\"],\n \"ant_alteracoes_dermatologicas\"=>$dados[\"ant_alteracoes_dermatologicas\"],\n \"ant_alteracoes_neurologicas\"=>$dados[\"ant_alteracoes_neurologicas\"],\n \"ant_alteracoes_respiratorias\"=>$dados[\"ant_alteracoes_respiratorias\"],\n \"ant_alteracoes_urinarias\"=>$dados[\"ant_alteracoes_urinarias\"],\n \"ant_neoplasias\"=>$dados[\"ant_neoplasias\"],\n \"ant_diabetes\"=>$dados[\"ant_diabetes\"],\n \"ant_epilepsia\"=>$dados[\"ant_epilepsia\"],\n \"ant_hipertensao\"=>$dados[\"ant_hipertensao\"],\n \"ant_ciclo_menstrual_regular\"=>$dados[\"ant_ciclo_menstrual_regular\"],\n \"ant_varizes\"=>$dados[\"ant_varizes\"],\n \"ant_consideracoes\"=>$dados[\"ant_consideracoes\"],\n \"cli_codigo_fk\"=>$id,\n );\n\n try {\n \n \n $lastId = $this->_antecedentes->insert($antecedentes);\n\n $this->_dbAdapter->commit();\n \n \n $flashMessenger = $this->_helper->FlashMessenger;\n $flashMessenger->addMessage('<div class=\"alert alert-info fade in\">\n <button class=\"close\" data-dismiss=\"alert\" type=\"button\">×</button>\n <strong>Antecedentes adicionados!</strong>\n Antecedentes adicionados com sucesso!\n </div>');\n \n $this->_redirect('/cliente/ficha/id/' . $id);\n exit;\n \n } catch (Zend_Db_Exception $e) {\n \n // echo $e->getMessage();\n // exit;\n \n $this->_dbAdapter->rollBack();\n $flashMessenger = $this->_helper->FlashMessenger;\n $flashMessenger->addMessage('<div class=\"alert fade in\">\n <button class=\"close\" data-dismiss=\"alert\" type=\"button\">x</button>\n <strong>Ocorreu um erro!</strong>\n Se o erro persistir entre em contato com o suporte!\n </div>');\n\n $this->_helper->redirector('index');\n }\n\n }\n\n }\n\n \n }",
"public function annimalEditAction()\n {\n }",
"function _active($info)\n\t{\n\t // Gan trang thai xac thuc\n\t $data = array();\n\t $data['status'] = mod('order')->status('completed');\n\t\n\t // Cap nhat du lieu vao data\n\t model('user_bank')->update($info->id, $data);\n\t // Gui thong bao\n\t set_message(lang('notice_update_success'));\n\t return TRUE;\n\t}",
"public function getActivo()\n {\n return $this->activo;\n }",
"public function activeAction()\n {\n $this->initialize();\n\n $all = $this->users->query()\n ->where('active IS NOT NULL')\n ->andWhere('deleted is NULL')\n ->execute();\n \n $this->theme->setTitle(\"Users that are active\");\n $this->views->add('users/list-all', [\n 'users' => $all,\n 'title' => \"Users that are active\",\n ]);\n }",
"public function statusAction()\n {\n $ctrlRow = new Admin_Model_DbRow_Controller($this->dbCtrl->find($this->checkControllerIdParam()));\n $ctrlRow->set('enabled', $ctrlRow->get('enabled') == 1 ? 0 : 1);\n $this->dbCtrl->update($ctrlRow->toDbArray(array('enabled')), $ctrlRow->get('id'));\n\n // disabled all actions too, they are relevant in the ACL\n IF($ctrlRow->get('enabled') === 0) {\n $actionRow = new Admin_Model_DbRow_Action(array(\n 'enabled' => 0\n ));\n $actionDbModel = new Admin_Model_DbTable_Acl_Action;\n $actionDbModel->updateWithControllerId($actionRow->toDbArray(array('enabled')), $ctrlRow->get('id'));\n }\n\n $this->_redirect('admin/controller/index');\n \n }",
"public function serviceActiveByAdmin($active){\n $sql = \"UPDATE servicii_prestate SET\n isActive=:isActive\n WHERE id = :id\";\n\n $stmt = $this->db->pdo->prepare($sql);\n $stmt->bindValue(':isActive', 1);\n $stmt->bindValue(':id', $active);\n $result = $stmt->execute();\n if ($result) {\n echo \"<script>location.href='service.php';</script>\";\n Session::set('msg', '<div class=\"alert alert-success alert-dismissible mt-3\" id=\"flash-msg\">\n <a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">×</a>\n <strong>Success !</strong> Serviciu activat cu succes!</div>');\n }else{\n echo \"<script>location.href='service.php';</script>\";\n Session::set('msg', '<div class=\"alert alert-danger alert-dismissible mt-3\" id=\"flash-msg\">\n <a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">×</a>\n <strong>Error !</strong> Serviciile nu sunt activate!</div>');\n }\n }",
"public function actionActivar($id)\n {\n $model = $this->findModel($id);\n $auth = Yii::$app->authManager;\n if($model->activo==True)\n {\n $model->activo=False;\n $auth->revokeAll($model->fk_usuario);\n $authorRole = $auth->getRole('Invitado');\n $auth->assign($authorRole, $model->fk_usuario);\n Yii::$app->getSession()->setFlash('warning',\"Se desactivó el usuario.\");\n }\n else\n {\n $model->activo=True;\n $auth->revokeAll($model->fk_usuario);\n $authorRole = $auth->getRole('Usuario');\n $auth->assign($authorRole, $model->fk_usuario);\n Yii::$app->getSession()->setFlash('success',\"Se activó el usuario.\");\n //Se crea una notificación por correo\n \\Yii::$app->mailer->compose()\n ->setTo($model->fkUsuario->email)\n ->setFrom([\\Yii::$app->params['supportEmail'] => \\Yii::$app->name . ' robot'])\n ->setSubject('Activación por el admin de legalitas')\n ->setTextBody(\"\n Fue activado por el admin de legalitas, ya puede utilizar el sistema\"\n )\n ->send();\n }\n $model->save();\n return $this->redirect('index');\n }",
"public function getAction(){\n \t$user=Doctrine_Query::create()\n\t\t ->select(\"u.ID, u.nome,u.cognome,u.user,u.active,u.data_iscrizione,u.ID_role\")\n\t\t ->from(\"Users u\")\n\t\t ->addWhere(\"u.ID=?\",$this->getRequest()->getParam('id'))\n\t\t ->fetchOne(null,Doctrine::HYDRATE_ARRAY);\n $this->emitLoadData($user);\n }",
"public function activeAction(Request $request, $id)\n\n {\n\n $resut = [];\n\n\n $em = $this->getDoctrine()->getManager();\n $query = $em->createQuery(\"UPDATE testtestBundle:Offre u SET u.active=:pay WHERE u.id =:pay2\")\n ->setParameter('pay', 1)->setParameter('pay2', $id);\n $resut = $query->getResult();\n $em1 = $this->getDoctrine()->getManager();\n $modeles1 = $em1->getRepository(Offre::class)->findAll();\n\n $this->addFlash(\"success\", \"offre activé avec success\");\n\n return $this->render('testtestBundle:Default:listeoffre.html.twig', array('modeles' => $modeles1));\n\n\n }",
"public function regiuniActiveByAdmin($active){\n $sql = \"UPDATE regiune SET\n isActive=:isActive\n WHERE id = :id\";\n\n $stmt = $this->db->pdo->prepare($sql);\n $stmt->bindValue(':isActive', 1);\n $stmt->bindValue(':id', $active);\n $result = $stmt->execute();\n if ($result) {\n echo \"<script>location.href='regiune.php';</script>\";\n Session::set('msg', '<div class=\"alert alert-success alert-dismissible mt-3\" id=\"flash-msg\">\n <a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">×</a>\n <strong>Success !</strong> Regiunea activat cu succes!</div>');\n }else{\n echo \"<script>location.href='regiune.php';</script>\";\n Session::set('msg', '<div class=\"alert alert-danger alert-dismissible mt-3\" id=\"flash-msg\">\n <a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">×</a>\n <strong>Error !</strong> Regiunea nu sunt activate!</div>');\n }\n }",
"public function perimetriaAction(){\n $id = (int) $this->getRequest()->getParam('id');\n $request = $this->getRequest();\n $perimetria = $this->_perimetria->fetchRow(\"cli_codigo_fk='$id' \", null);\n $dados = $this->getRequest()->getParams();\n \n if(isset($perimetria)){\n\n\n try {\n\n\n $perimetria->per_busto=$dados[\"per_busto\"];\n $perimetria->per_cicatriz_umbilical=$dados[\"per_cicatriz_umbilical\"];\n $perimetria->per_cintura=$dados[\"per_cintura\"];\n $perimetria->per_5_cm_acima=$dados[\"per_5_cm_acima\"];\n $perimetria->per_gluteos=$dados[\"per_gluteos\"];\n $perimetria->per_mse_braco=$dados[\"per_mse_braco\"];\n $perimetria->per_mse_antebraco=$dados[\"per_mse_antebraco\"];\n $perimetria->per_msd_braco=$dados[\"per_msd_braco\"];\n $perimetria->per_msd_antebraco=$dados[\"per_msd_antebraco\"];\n $perimetria->per_mie_coxa=$dados[\"per_mie_coxa\"];\n $perimetria->per_mie_perna=$dados[\"per_mie_perna\"];\n $perimetria->per_mid_coxa=$dados[\"per_mid_coxa\"];\n $perimetria->per_mid_perna=$dados[\"per_mid_perna\"];\n $perimetria->per_consideracoes=$dados[\"per_consideracoes\"];\n \n $perimetria->save();\n \n \n $this->_helper->flashMessenger('<div class=\"alert alert-info fade in\">\n <button class=\"close\" data-dismiss=\"alert\" type=\"button\">×</button>\n <strong>Perimetria editada!</strong>\n Perimetria editada com sucesso!\n </div>');\n \n $this->_redirect('/cliente/ficha/id/' .$id);\n \n\n } catch (Zend_Db_Exception $e) {\n \n echo $e->getMessage();\n exit;\n \n $this->_dbAdapter->rollBack();\n $flashMessenger = $this->_helper->FlashMessenger;\n $flashMessenger->addMessage('<div class=\"alert fade in\">\n <button class=\"close\" data-dismiss=\"alert\" type=\"button\">x</button>\n <strong>Ocorreu um erro!</strong>\n Se o erro persistir entre em contato com o suporte!\n </div>');\n\n $this->_redirect('/cliente/ficha/id/' .$id);\n }\n\n\n \n }else{\n\n if ($request->isPost()) {\n\n $this->_dbAdapter->beginTransaction();\n\n $perimetria=array(\n \"per_busto\"=>$dados[\"per_busto\"],\n \"per_cicatriz_umbilical\"=>$dados[\"per_cicatriz_umbilical\"],\n \"per_cintura\"=>$dados[\"per_cintura\"],\n \"per_5_cm_acima\"=>$dados[\"per_5_cm_acima\"],\n \"per_gluteos\"=>$dados[\"per_gluteos\"],\n \"per_mse_braco\"=>$dados[\"per_mse_braco\"],\n \"per_mse_antebraco\"=>$dados[\"per_mse_antebraco\"],\n \"per_msd_braco\"=>$dados[\"per_msd_braco\"],\n \"per_msd_antebraco\"=>$dados[\"per_msd_antebraco\"],\n \"per_mie_coxa\"=>$dados[\"per_mie_coxa\"],\n \"per_mie_perna\"=>$dados[\"per_mie_perna\"],\n \"per_mid_coxa\"=>$dados[\"per_mid_coxa\"],\n \"per_mid_perna\"=>$dados[\"per_mid_perna\"],\n \"per_consideracoes\"=>$dados[\"per_consideracoes\"],\n \"cli_codigo_fk\"=>$id,\n );\n\n try {\n \n \n $lastId = $this->_perimetria->insert($perimetria);\n\n $this->_dbAdapter->commit();\n \n \n $flashMessenger = $this->_helper->FlashMessenger;\n $flashMessenger->addMessage('<div class=\"alert alert-info fade in\">\n <button class=\"close\" data-dismiss=\"alert\" type=\"button\">×</button>\n <strong>Perimetria adicionada!</strong>\n Perimetria adicionada com sucesso!\n </div>');\n \n $this->_redirect('/cliente/ficha/id/' . $id);\n exit;\n \n } catch (Zend_Db_Exception $e) {\n \n echo $e->getMessage();\n exit;\n \n $this->_dbAdapter->rollBack();\n $flashMessenger = $this->_helper->FlashMessenger;\n $flashMessenger->addMessage('<div class=\"alert fade in\">\n <button class=\"close\" data-dismiss=\"alert\" type=\"button\">x</button>\n <strong>Ocorreu um erro!</strong>\n Se o erro persistir entre em contato com o suporte!\n </div>');\n\n $this->_helper->redirector('index');\n }\n\n }\n\n }\n\n }",
"public function reescalarActi(){\n }",
"function getActive() {return $this->_active;}",
"protected function ExecAction() {\r\n if (self::$sAction == \"new\")\r\n //self::$sAction = \"edit\";\r\n self::$sAction = \"add\";\r\n\r\n // Ищем контроллер\r\n $sControllerPath = \"/var/www/ad/app/controllers/\".self::$sController.\"_controller.php\";\r\n if (file_exists($sControllerPath)) {\r\n require_once($sControllerPath);\r\n\r\n $aClassPathComponents = explode(\"/\",self::$sController);\r\n $sClass = $aClassPathComponents[count($aClassPathComponents)-1];\r\n $sClass = ucfirst($sClass);\r\n $sClass = preg_replace_callback('/_([a-z])/', create_function('$c', 'return strtoupper($c[1]);'), $sClass);\r\n $sControllerClass = $sClass.\"Controller\";\r\n\r\n $this->oController = new $sControllerClass(self::$sController,self::$sAction);\r\n $this->oController->parameters = self::$aParameters;\r\n\r\n foreach(self::$aObjects as $oObject) {\r\n $sName = strtolower(get_class($oObject));\r\n $this->oController->$sName = $oObject;\r\n }\r\n call_user_func_array(array($this->oController,self::$sAction),self::$aObjects);\r\n\r\n return true;\r\n }\r\n }",
"public function activeAction()\n {\n $all = $this->users->query()\n ->where('active IS NOT NULL')\n ->andWhere('deleted is NULL')\n ->execute();\n \n $this->theme->setTitle(\"Users that are active\");\n $this->views->add('users/list-all', [\n 'users' => $all,\n 'title' => \"Users that are active\",\n ]);\n }",
"public function pesquisarAction() {\r\n \r\n }",
"public function isEditAction() {}",
"public function actionIndex()\n {\n///\n$nombre=Yii::$app->user->identity->username;\n$connection = \\Yii::$app->db;\n$db = $connection->createCommand(\"INSERT INTO auditoria (id, user, modelo, accion, fechahora) VALUES (NULL, '$nombre', 'PropiedadDet', 'Index', NOW());\")->execute();\n///\n\n $searchModel = new PropiedadDetSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"function getActa()\n {\n if (!isset($this->sacta) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->sacta;\n }",
"function getActa()\n {\n if (!isset($this->sacta) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->sacta;\n }"
]
| [
"0.65525573",
"0.6396103",
"0.6382768",
"0.63138586",
"0.63048446",
"0.62731546",
"0.6261571",
"0.62521154",
"0.62453735",
"0.613975",
"0.6127525",
"0.6077752",
"0.6061349",
"0.60095936",
"0.5994248",
"0.5986853",
"0.5921785",
"0.59157324",
"0.5898901",
"0.58850175",
"0.58756024",
"0.58750415",
"0.5865493",
"0.584787",
"0.58405054",
"0.5793301",
"0.5776207",
"0.5769905",
"0.5765897",
"0.5765897"
]
| 0.64587784 | 1 |
Prepare a new or cached presenter instance. | public function present()
{
if (! $this->presenter) {
throw new Exception('Please set the $presenter property to your presenter path.');
}
if (! class_exists($this->presenter)) {
throw new Exception("The presenter class [{$this->presenter}] does not exists.");
}
if (! $this->presenterInstance) {
$this->presenterInstance = Container::getInstance()->make($this->presenter);
if (! $this->presenterInstance instanceof Presenter) {
throw new Exception("The presenter [{$this->presenter}] must be an instance of [".Presenter::class.']');
}
$this->presenterInstance->setModel($this);
}
return $this->presenterInstance;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function present()\n {\n if (! isset($this->presenterInstance)) {\n $this->presenterInstance = (new ReflectionClass($this->presenter))\n ->newInstanceArgs([$this]);\n }\n\n return $this->presenterInstance;\n }",
"public function preparePresenter(\n string $presenterName,\n string $action,\n ?array $params = [],\n ?array $baseParams = [],\n bool $newInstance = false\n ): BasePresenter {\n if ($newInstance) {\n $presenter = $this->presenterFactory->createPresenter($presenterName);\n } else {\n $presenter = $this->getCachePresenter($presenterName);\n }\n if (!$presenter instanceof BasePresenter) {\n throw new BadTypeException(BasePresenter::class, $presenter);\n }\n\n unset($baseParams[Presenter::ACTION_KEY]);\n foreach ($params as $key => $value) {\n $baseParams[$key] = $value;\n }\n $presenter->loadState($baseParams);\n $presenter->changeAction($action);\n\n return $presenter;\n }",
"protected function prepareForPresentation()\n {\n if ($this->prepared) {\n return;\n }\n\n $this->permissionGroups = new Collection;\n $this->ungroupedPermissions = [];\n $this->groupedPermissionIndex = [];\n\n $this->loadPermissionsFromModules()\n ->loadCustomPermissions()\n ->loadCustomPermissionGroups()\n ->addUngroupedPermissionGroup()\n ->filterEmptyGroups();\n }",
"protected function prepareViewMock()\n {\n /** @var Mockery\\Mock $viewMock */\n $viewMock = Mockery::mock(Factory::class);\n $viewMock->shouldReceive('make')->andReturn('testing');\n $viewMock->shouldReceive('share')->andReturnSelf();\n\n $this->app->instance(Factory::class, $viewMock);\n }",
"public function setPresenter($presenter)\n\t{\n\t\t$this->presenter = $presenter;\n\t}",
"public function presenter()\n {\n return null;\n }",
"public function presenter(){\n \treturn new OrderReturnPresenter($this);\n }",
"protected function createPresentation($presenter, $report)\n {\n /** @var \\Orkestra\\Bundle\\ReportBundle\\ReportFactory $factory */\n $factory = $this->get('orkestra.report_factory');\n\n if (!is_object($presenter)) {\n $presenter = $factory->getPresenter($presenter);\n }\n\n if (!is_object($report)) {\n $report = $factory->getReport($report);\n }\n\n $preso = $factory->createPresentation($presenter, $report);\n\n if ($report instanceof AbstractOfficeReport) {\n $preso->prependFilter(new OfficeFilter($this->getCurrentOffice()));\n }\n\n return $preso;\n }",
"public function getInstancePrepare()\n {\n return $this->get(self::_INSTANCE_PREPARE);\n }",
"public function prepare() {\n if (!isset($this->Created))\n $this->Created = date('YmdHis', time());\n\n if (isset($this->ConfirmPassword))\n unset($this->ConfirmPassword);\n\n $this->Password = Auth::getHash($this->Password);\n// $this->ProfileImage = $this->_processProfileImage();\n }",
"public function __construct(AutoPresenter $autoPresenter)\n {\n $this->autoPresenter = $autoPresenter;\n }",
"private function init($pagePresenter, $pageElementPresenters, $requestedPageName)\n {\n $model = new Main\\MainModel();\n $view = new Main\\MainView($this->rootDir);\n $presenter = new Main\\MainPresenter();\n\n // link vars for main\n $presenter->setView($view);\n $presenter->setModel($model);\n $presenter->setPageElementPresenters($pageElementPresenters);\n $presenter->setPagePresenter($pagePresenter);\n $view->setPresenter($presenter);\n\n // link models\n $model->setDb($this->ettc->getDb());\n $pagePresenter->getModel()->setMainModel($model);\n foreach ($pageElementPresenters as $elementPresenter) {\n $elementPresenter->getModel()->setMainModel($model);\n }\n\n // tell page presenter about any subpage\n $subPage = substr(strstr($requestedPageName, '/', false), 1);\n $continue = $pagePresenter->setSubPage($subPage);\n // return false if the presenter does not know this subpage\n if (!$continue) {\n return false;\n }\n\n // init all views\n $pagePresenter->getView()->init();\n foreach ($pageElementPresenters as $elementPresenter) {\n $elementPresenter->getView()->init();\n }\n $presenter->getView()->init();\n\n // init all models\n $pagePresenter->getModel()->init();\n foreach ($pageElementPresenters as $elementPresenter) {\n $elementPresenter->getModel()->init();\n }\n $presenter->getModel()->init();\n\n // init all presenters\n $pagePresenter->setMainPresenter($presenter);\n $pagePresenter->initPage();\n $pagePresenter->init();\n foreach ($pageElementPresenters as $elementPresenter) {\n $elementPresenter->init();\n }\n $presenter->init();\n\n $this->presenter = $presenter;\n\n return true;\n }",
"public function prepare()\n {\n $this->timeTracker = $this->getInjector()->inject('TimeTracker');\n $this->env = $this->getInjector()->inject('Environment');\n $this->env->parseFile(__DIR__.'/../environment.json');\n $this->toggleShowErrors();\n return $this;\n }",
"protected function prepareContainer()\n {\n $this -> container\n -> set('app', new InstanceService($this))\n -> set('config', new InstanceService($this -> config));\n }",
"protected function get_presenter( $reason ) {\n\t\tif ( $reason === Indexing_Reasons::REASON_INDEXING_FAILED ) {\n\t\t\t$presenter = new Indexing_Failed_Notification_Presenter( $this->product_helper );\n\t\t}\n\t\telse {\n\t\t\t$total_unindexed = $this->indexing_helper->get_filtered_unindexed_count();\n\t\t\t$presenter = new Indexing_Notification_Presenter( $this->short_link_helper, $total_unindexed, $reason );\n\t\t}\n\n\t\treturn $presenter;\n\t}",
"function construct() {\n if (!$this->cacheGet()) {\n $this->prepare();\n $this->build();\n $this->expand();\n $this->populate();\n }\n }",
"public function prepareShow()\n {\n $this->location();\n $this->type;\n $this->amenityIds();\n $this->utilityIds();\n $this->reviewCount();\n $this->user->location();\n $this->user->profilePicture();\n $this->user->reviewCount();\n $this->reviews = $this->reviews()->select('reviews.*')->withReviewer()->get();\n $this->coordinates;\n $this->imageRoutes();\n $this->image_ids = $this->images->pluck('id');\n }",
"public function present(){\n return new MessagePresenter($this);\n }",
"public function prepare()\n {\n $this->_getResource()->prepare($this);\n return $this;\n }",
"protected function prepare()\n {\n $this->slug = $this->getSubmittedSlug();\n\n if ($this->isNew()) {\n $this->prepForNewEntry();\n } else {\n $this->prepForExistingEntry();\n }\n\n // As part of the prep, we'll apply the date and slug. We'll remove them\n // from the fields array since we don't want it to be in the YAML.\n unset($this->fields['date'], $this->fields['slug']);\n\n $this->fieldset = $this->content->fieldset()->withTaxonomies();\n }",
"public function __construct(Presenter $presenter, Validator $validator, MemoryManager $memory)\n {\n $this->presenter = $presenter;\n $this->validator = $validator;\n $this->memory = $memory->make('primary');\n }",
"public function presenter()\n {\n return VoteDetailsPresenter::class;\n }",
"public function getPresenterClass()\n {\n return TemplatePresenter::class;\n }",
"protected function prepare(Zend_View $view)\r\n {\n $view = clone $view;\n /* @var $view Zend_View */\n $view->setScriptPath($this->getScriptPaths());\r\n return $view;\r\n }",
"public function __construct()\n {\n View::share('metaData', Chapter::getMetaData());\n }",
"private function _populatePromotor()\n {\n return $this->promotor->create(\n $this->promotorData['dealer_ID'], \n $this->promotorData['phone'], \n Hash::make($this->promotorData['password']), \n $this->promotorData['name'], \n $this->promotorData['gender'], \n $this->promotorData['type'], \n $this->promotorData['parent_ID']\n );\n }",
"protected function prepare()\n {\n parent::prepare();\n\n // parent must be a test_entry_transcribe widget\n if( is_null( $this->parent ) )\n throw lib::create( 'exception\\runtime', 'This class must have a parent', __METHOD__ );\n \n $db_test_entry = $this->parent->get_record();\n\n $db_test = $db_test_entry->get_test();\n $heading = $db_test->name . ' test entry form';\n\n //TODO put this somewhere else\n if( $db_test_entry->deferred )\n $heading = $heading . ' NOTE: this test is currently deferred';\n\n $this->set_heading( $heading );\n }",
"public function getPresenter()\n {\n if (is_null($this->presenter)) {\n return false;\n }\n\n return $this->presenter;\n }",
"public final function prep(){\n\n //disable apache from append session ids to requests\n ini_set('session.use_trans_sid',0);\n //only allow sessions to be used with cookies\n ini_set('session.use_only_cookies',1);\n\n //base directory of application\n //$this->path = dirname($_SERVER['DOCUMENT_ROOT']);\n $this->path = dirname(dirname(dirname(dirname(dirname(__DIR__)))));\n \n //load the appropriate application production configuration \n //and override with any dev config.\n if(is_file($this->path.'/.config.php')){\n $this->config = require($this->path.'/.config.php');\n if($this->config['APP_MODE']!='PROD' && is_file($this->path.'/.dev.config.php')){\n $this->config = array_merge($this->config,require($this->path.'/.dev.config.php'));\n }//if\n }//if\n \n //if the COMPOSER PATH isn't set then resort to the default installer path \"vendor/\"\n if(!isset($this->config['COMPOSER_PATH'])){\n $this->config['COMPOSER_PATH'] = 'vendor';\n }//if\n\n }",
"public function setPresenter(Closure $callback)\n {\n $this->presenter = $callback;\n\n return $this;\n }"
]
| [
"0.6369922",
"0.62461257",
"0.5737017",
"0.53875667",
"0.5309868",
"0.5284631",
"0.52795506",
"0.5232121",
"0.51701754",
"0.50530994",
"0.50328237",
"0.50238883",
"0.4997379",
"0.49586245",
"0.49026635",
"0.4860052",
"0.48388055",
"0.48282573",
"0.48272365",
"0.4820075",
"0.4804157",
"0.4796272",
"0.4789388",
"0.47249803",
"0.46458963",
"0.4643881",
"0.46412957",
"0.4638243",
"0.46288097",
"0.46045005"
]
| 0.6270391 | 1 |
Function that register author info widget | function kvell_edge_register_author_info_widget( $widgets ) {
$widgets[] = 'KvellEdgeAuthorInfoWidget';
return $widgets;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wpb_author_info_box( $content ) {\n \n\tglobal $post;\n\t \n\t// Detect if it is a single post with a post author\n\tif ( is_single() && isset( $post->post_author ) ) {\n\t \n\t\t// Get author's display name \n\t\t$display_name = get_the_author_meta( 'display_name', $post->post_author );\n\t \n\t// If display name is not available then use nickname as display name\n\tif ( empty( $display_name ) )\n\t$display_name = get_the_author_meta( 'nickname', $post->post_author );\n\t \n\t\t// Get author's biographical information or description\n\t\t$user_description = get_the_author_meta( 'user_description', $post->post_author );\n\t\t \n\t\t// Get author's website URL \n\t\t$user_website = get_the_author_meta('url', $post->post_author);\n\t\t \n\t\t// Get link to the author archive page\n\t\t$user_posts = get_author_posts_url( get_the_author_meta( 'ID' , $post->post_author));\n\t \n\tif ( ! empty( $display_name ) )\n\n\t\t// If author has a biography, display the bio box...\n\t\tif (get_the_author_meta('description')) {\n\t\t\t\t$author_details = '<div class=\"panel-title\"><p class=\"author_name\">Posted by <a class=\"blue-color\" href=\"'. $user_posts .'\"> ' . $display_name . '</a></p></div>';\n\t \t\t}\n\n\tif ( ! empty( $user_description ) )\n\t\n\t\t// If author bio is not blank...\n\t\tif (get_the_author_meta('description')) {\n\t\t\t// Author avatar and bio\n\t\t\t$author_details .= '<p class=\"author_details\">' . get_avatar( get_the_author_meta('user_email') , 90 ) . nl2br( $user_description ). '</p>';\n\t\t}\n\n\t\t// If author bio is not blank... \n\t\t\tif (get_the_author_meta('description')) {\n\t\t\t\t// Pass all this info to post content \n\t\t\t\t$content = $content . '<footer class=\"author_bio_section\" >' . $author_details . '</footer>';\n\t\t\t}\n\t\t}\n\n\treturn $content;\n\n\t}",
"function devlySimpleAuthor() { \n\n\t$authID = get_the_author_meta('ID'); \n\t$size\t= '78';\n\t\n\t?>\n\n\t<div id=\"authorBioContainer\">\n\t\t\n\t\t<div class=\"gravatar\"><?php echo get_avatar($authID, $size); ?></div>\n\t\t\n\t\t<div class=\"aboutAuthor\">\n\t\t\t<h3 class=\"authorName\"><?php the_author(); ?></h3>\n\t\t\t<p><?php echo get_the_author_meta('description') ?></p>\n\t\t</div>\n\t\t\n\t</div>\n\t\n\t<?php\n\n}",
"function print_author_tag() {\n\t\t\n\t\techo \"<meta name='author' content='{$this->options->site_author}' />\\r\\n\";\n\t}",
"function da_add_author_page() {\n\t$author_id = get_the_author_meta( 'ID' );\n\t$user_posts = get_author_posts_url( get_the_author_meta( 'ID' ) );\n\t$display_name = get_the_author_meta( 'display_name' );\n\t$darole = get_author_role( $author_id );\n\techo '<div class=\"archive-description\"><h1 class=\"archive-title\">All articles by ' . esc_html( $display_name ) . '</h1></div>';\n}",
"function register_block_core_post_author_biography()\n {\n }",
"function showAuthor()\n {\n $this->out->elementStart('div', 'author');\n\n $this->out->elementStart('span', 'vcard author');\n\n $attrs = array('href' => $this->profile->profileurl,\n 'class' => 'url',\n 'title' => $this->profile->nickname);\n\n $this->out->elementStart('a', $attrs);\n $this->showAvatar();\n $this->out->text(' ');\n $user = common_current_user();\n if (!empty($user) && $user->streamNicknames()) {\n $this->out->element('span',array('class' => 'fn'),\n $this->profile->nickname);\n } else {\n $this->out->element('span',array('class' => 'fn'),\n $this->profile->getBestName());\n }\n $this->out->elementEnd('a');\n\n $this->out->elementEnd('span');\n\n $this->showAddressees();\n\n $this->out->elementEnd('div');\n }",
"public function author()\n {\n $this->renderView('author.twig',['articleList' => $this->articleList]);\n }",
"public function author();",
"function get_author_link($display, $author_id, $author_nicename = '')\n {\n }",
"function register_block_core_post_author()\n {\n }",
"function kdw_the_author_info($id = ''){\r\n \r\n if ($id != ''){ \r\n $userID = $id;\r\n } else { \r\n $userID = get_the_author_meta('ID');\r\n }\r\n \r\n // do not show user if he opted out\r\n if ( get_field('kdw_user_hidden', 'user_'.$userID )){ return; }\r\n \r\n \r\n echo '<div class=\"author-info-wrapper\">';\r\n \r\n $AuthorImgID = get_field('kdw_user_img', 'user_'.$userID );\r\n $InstagramURL = get_field('kdw_user_instagram', 'user_'.$userID );\r\n $FacebookURL = get_field('kdw_user_facebook', 'user_'.$userID );\r\n $TwitterURL = get_field('kdw_user_twitter', 'user_'.$userID );\r\n $PinterestURL = get_field('kdw_user_pinterest', 'user_'.$userID );\r\n \r\n if ($AuthorImgID){ \r\n $bg_img = wp_get_attachment_image_src( $AuthorImgID , 'thumbnail-stylists');\r\n $tile_bg = 'background-image:url('.$bg_img[0].');'; \r\n echo '<a href=\"'.get_author_posts_url( $userID ).'\" class=\"author-info-img\" style=\"'.$tile_bg.'\"></a>';\r\n } else {\r\n // empty avatar -> fallback?\r\n echo '<div class=\"author-info-img author-info-img-empty\"></div>'; \r\n } \r\n \r\n echo '<div class=\"author-info-content\">';\r\n \r\n if (is_singular(array('post','page'))){\r\n echo '<h3><a href=\"'.get_author_posts_url( $userID ).'\">'.get_the_author_meta('display_name',$userID).'</a></h3>'; \r\n echo '<div class=\"entry-content small grey\">';\r\n echo wpautop(get_the_author_meta('description',$userID));\r\n echo '</div>'; \r\n } else {\r\n echo '<h1>'.get_the_author_meta('display_name', $userID).'</h1>'; \r\n echo '<div class=\"entry-content\">';\r\n echo wpautop(get_the_author_meta('description', $userID)); \r\n echo '</div>';\r\n }\r\n // social media_buttons\r\n echo '<ul class=\"user-social-media\">';\r\n if($FacebookURL){\r\n echo '<li class=\"instagram\"><a href=\"'.$InstagramURL.'\">Instagram</a></li>';\r\n }\r\n if($FacebookURL){\r\n echo '<li class=\"facebook\"><a href=\"'.$FacebookURL.'\">Facebook</a></li>';\r\n }\r\n if($FacebookURL){\r\n echo '<li class=\"twitter\"><a href=\"'.$TwitterURL.'\">Twitter</a></li>';\r\n }\r\n if($FacebookURL){\r\n echo '<li class=\"pinterest\"><a href=\"'.$PinterestURL.'\">Pinterest</a></li>';\r\n }\r\n echo '</ul>'; \r\n \r\n echo '</div>';\r\n \r\n echo '</div>';\r\n}",
"function pantomime_author_box(){\n\tif ( is_single() ) :\n\t// Get the author email -> for Gravatar\n\t$author_email = get_the_author_meta('user_email');\n\t\t\n\t// Get the author description\n\t$author_description = get_the_author_meta('description');\t\n\t?>\n\n\t<div id=\"author-box\" class=\"emboss\">\n\t\t<h4 class=\"section-title\"><?php _e('About The Author', 'pantomime'); ?></h4>\n\t\t<?php\n\t\t\techo get_avatar($author_email, 50, '');\n\t\t\techo '<p>' . get_the_author_link() . ' - ' . $author_description . '</p>';\n\t\t?>\n\t</div>\n\t\n\t<?php\n\tendif;\n}",
"function smamo_rest_post_author() {\n\tif ( function_exists( 'register_rest_field' ) ) {\n\t\tregister_rest_field( 'post',\n\t\t\t'authors',\n\t\t\tarray(\n\t\t\t\t'get_callback' => 'smamo_rest_get_post_author',\n\t\t\t\t'schema' => null,\n\t\t\t)\n\t\t);\n\t} elseif ( function_exists( 'register_api_field' ) ) {\n\t\tregister_api_field( 'post',\n\t\t\t'authors',\n\t\t\tarray(\n\t\t\t\t'get_callback' => 'smamo_rest_get_post_author',\n\t\t\t\t'schema' => null,\n\t\t\t)\n\t\t);\n\t}\n}",
"function the_author_aim()\n {\n }",
"function get_the_author_aim()\n {\n }",
"function praise_meta_init(){\n add_meta_box(\"praise_author_name\", \"Author\", \"praise_author_meta\", \"praise\", \"normal\", \"low\");\n}",
"function the_author_login()\n {\n }",
"protected function _syncAuthor() {}",
"function register_block_core_post_author_name()\n {\n }",
"function the_author_link()\n {\n }",
"function get_the_author_link()\n {\n }",
"private function maybe_render_author_box() {\n\t\t$author_description = get_the_author_meta( 'description' );\n\t\tif ( empty( $author_description ) ) {\n\t\t\treturn;\n\t\t}\n\t\t?>\n\t\t<div class=\"card card-profile card-plain\">\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-md-2\">\n\t\t\t\t\t<div class=\"card-avatar\">\n\t\t\t\t\t\t<a href=\"<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>\"\n\t\t\t\t\t\t\t\ttitle=\"<?php echo esc_attr( get_the_author() ); ?>\"><?php echo get_avatar( get_the_author_meta( 'ID' ), 100 ); ?></a>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"col-md-10\">\n\t\t\t\t\t<h4 class=\"card-title\"><?php the_author(); ?></h4>\n\t\t\t\t\t<p class=\"description\"><?php the_author_meta( 'description' ); ?></p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}",
"function pixelgrade_the_author_info_box() {\n\tif ( pixelgrade_user_has_access( 'pro-features' ) ) {\n\t\techo pixelgrade_get_the_author_info_box(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t}\n}",
"function the_author_yim()\n {\n }",
"function master_sidebar_author_meta_box() {\n\n\t$admin_page_name = 'appearance_page_custom_theme_sidebars';\n\n\tadd_meta_box( \n\t\t'master-add-author-archive-metabox', \n\t\t__('Author Archives'), \n\t\t'master_sidebar_render_author_meta_box', \n\t\t$admin_page_name, \n\t\t'side', \n\t\t'default'\n\t);\n}",
"function circle_author_biography() {\n\tif ( ! circle_option( 'display_author_bio' ) ) {\n\t\treturn;\n\t}\n\tget_template_part( 'template-parts/biography' );\n}",
"function the_author_url()\n {\n }",
"function newsdot_posted_by() {\n\t\tif ( get_theme_mod( 'newsdot_show_post_author', true ) ) :\n\t\t\t?>\n\t\t\t<span class=\"byline\">\n\t\t\t\t<i class=\"far fa-user-circle\"></i>\n\t\t\t\t<span class=\"author vcard\"><a class=\"url fn n\" href=\"<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>\"><?php echo esc_html( get_the_author() ); ?></a></span>\n\t\t\t</span>\n\t\t\t<?php\n\t\tendif;\n\t}",
"public function addAuthor()\n\t{\n\t\t$this->load->view('add_author');\n\t}",
"function GetAuthor()\n {\n return 'calguy1000';\n }"
]
| [
"0.7156015",
"0.71499044",
"0.7084426",
"0.70430976",
"0.70321",
"0.6887577",
"0.68404245",
"0.6784591",
"0.67786646",
"0.67687845",
"0.6762314",
"0.67525744",
"0.67349064",
"0.67312586",
"0.67290795",
"0.67080355",
"0.6705859",
"0.6695264",
"0.66529626",
"0.6634235",
"0.6621486",
"0.66146225",
"0.6610024",
"0.66053426",
"0.65968144",
"0.6586339",
"0.6550913",
"0.6548645",
"0.6523702",
"0.650864"
]
| 0.7912472 | 0 |
Transcodes a media file | function transcode($fileName, $newName, $extraInfo = array())
{
if (!file_exists($fileName))
{
throw new Exception("File not found: '$fileName'");
}
elseif (filesize($fileName) == 0)
{
throw new Exception("Don't know how to transcode an empty file: '$fileName'");
}
$this->_extraInfo = $extraInfo;
$this->_originalName = $newName;
$outputFile = $this->_removeDirsAndSuffix($newName);
$mime = $this->_getMime($fileName);
$this->_detectedMime = $mime;
if ($this->_isVideo($fileName, $mime))
{
return $this->_transcodeVideo($fileName, $this->_outputBaseDir."video/".$outputFile, $mime);
}
else if ($this->_isAudio($fileName, $mime))
{
return $this->_transcodeAudio($fileName, $this->_outputBaseDir."audio/".$outputFile, $mime);
}
throw new Exception("Unrecognised media format: File:".$fileName."<br />".
"TranscoderMime: ".$mime."<br />".
"UploadedMime: ".$this->_extraInfo["suggested_mime"]."<br />".
"ExtraFileDetails: ".$this->_getFileType($fileName)."<br />".
"Extension: ".$this->_getFileSuffix());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function loadTranscodedFiles(){\n\t\t$source = false;\n\t\tif(!$source && $this->SourceID){ $source = $this->Source(); }\n\t\tif(!$source && $this->MP4ID){ $source = $this->MP4(); }\n\t\tif(!$source && $this->WEBMID){ $source = $this->WEBM(); }\n\t\tif(!$source && $this->OGVID){ $source = $this->OGV(); }\n\t\t\n\t\t$ext = pathinfo($source->getFilename(), PATHINFO_EXTENSION);\n\t\t$vid_name = basename($source->getFilename(), \".\".$ext); // with extension stripped\n\t\t$vid_path = Config::inst()->get('Transcoding', 'transcode_relative_video_path_base');\n\t\t\n\t\t$poster_path = \"$vid_path$vid_name-01.jpg\";\n\t\t$mp4_path = \"$vid_path$vid_name.mp4\";\n\t\t$webm_path = \"$vid_path$vid_name.webm\";\n\t\t$ogv_path = \"$vid_path$vid_name.ogv\";\n\t\t\n\t\tif(!$this->PosterID && file_exists(BASE_PATH.\"/\".$poster_path)){ \n\t\t\t$file = new Image();\n\t\t\t$file->setFilename($poster_path);\n\t\t\t$file->write();\n\t\t\t$this->PosterID = $file->ID;\n\t\t}\n\t\tif(!$this->MP4ID && file_exists(BASE_PATH.\"/\".$mp4_path)){ \n\t\t\t$file = new File();\n\t\t\t$file->setFilename($mp4_path);\n\t\t\t$file->write();\n\t\t\t$this->MP4ID = $file->ID;\n\t\t}\n\t\tif(!$this->WEBMID && file_exists(BASE_PATH.\"/\".$webm_path)){ \n\t\t\t$file = new File();\n\t\t\t$file->setFilename($webm_path);\n\t\t\t$file->write();\n\t\t\t$this->WEBMID = $file->ID;\n\t\t}\n\t\tif(!$this->OGVID && file_exists(BASE_PATH.\"/\".$ogv_path)){ \n\t\t\t$file = new File();\n\t\t\t$file->setFilename($ogv_path);\n\t\t\t$file->write();\n\t\t\t$this->OGVID = $file->ID;\n\t\t}\n\t\t$this->write();\n\t}",
"private function _transcodeAudio($fileName, $outputFilePath, $mime)\n {\n $outputFilePath .= '.mp3';\n \n if ($mime == self::MIME_CONTENT_TYPE_MPEG)\n {\n // MP3 - Don't need to transcode FIX should we recode?\n // FIX check that it actually is a MPEG-1 Audio Layer 3 file\n // FIX check for errors!\n copy($fileName, $outputFilePath);\n }\n // We use mplayer with wma files to dump wav before encoding to mp3 with lame\n else //if ($this->_isWma($fileName))\n {\n \n if ($this->_isMidi($fileName) !== false)\n {\n $midiToWaveCmd = sprintf(str_replace(\"transcoder.class.php\", 'transcode/transcodeMidi.sh', __file__). \" %s %s %s %s %s > /dev/null 2>&1 &\",\n self::TRANSCODE_TIMIDITY_CMD,\n self::TRANSCODE_FFMPEG_CMD,\n escapeshellarg($fileName),\n escapeshellarg($outputFilePath),\n str_replace(\"transcoder.class.php\", 'transcode/transcodeaudio.sh', __file__));\n \n exec($midiToWaveCmd, $cmdOutput, $exitCode);\n } else\n {\n $transcodeWmaCommand = sprintf(str_replace(\"transcoder.class.php\", 'transcode/transcodeaudio.sh', __file__).' %s %s %s >/dev/null 2>&1 &',\n self::TRANSCODE_FFMPEG_CMD,\n escapeshellarg($fileName),\n escapeshellarg($outputFilePath));\n //echo $transcodeWmaCommand.\"<br /><br />\";\n exec($transcodeWmaCommand, $cmdOutput, $exitCode);\n file_put_contents($fileName.\".log\",$cmdOutput);\n }\n/*foreach($cmdOutput as $line)\n {\n echo $line.\"<br />\\n\";\n }\n die();*/\n }\n /*else\n {\n \n $pcmFile = $fileName;\n $pcmIsTmp = false;\n if ($mime != self::MIME_CONTENT_TYPE_WAV)\n {\n $pcmFile = tempnam(self::TRANSCODE_TMP_DIR, 'transcode');\n $this->_decodeAudio($fileName, $pcmFile);\n $pcmIsTmp = true;\n }\n \n $transcodeMp3Cmd = sprintf('%s --quiet --abr 192 %s %s 2>&1',\n self::TRANSCODE_LAME_CMD, $pcmFile, \n escapeshellarg($outputFilePath));\n \n // FIX check for errors!\n exec($transcodeMp3Cmd); \n\n if ($pcmIsTmp) \n {\n unlink($pcmFile);\n }\n\n }*/\n \n return array('newFileName' => basename($outputFilePath), \n 'convertedMime' => 'audio/mpeg',\n 'detectedMime' => $this->_detectedMime);\n }",
"private function _transcodeVideo($fileName, $outputFilePath, $mime)\n {\n $outputFilePath .= '.flv';\n \n if ($this->_isFlv($fileName, $mime))\n {\n // Don't need to transcode FIX should we recode?\n // FIX check for errors!\n copy($fileName, $outputFilePath);\n }\n else \n {\n // FIX Does the -ar param nprint $fileName;eed to be set according to input file?\n /*$transcodeCmd = sprintf('%s -map_meta_data infile:outfile -i %s -acodec libmp3lame -ab 192 -ar 44100 %s > /dev/null 2>&1',\n self::TRANSCODE_FFMPEG_CMD, \n escapeshellarg($fileName), \n escapeshellarg($outputFilePath));\n \n $flvtoolCmd = sprintf(\"%s -U %s > /dev/null 2>&1 &\", \n self::TRANSCODE_FLVTOOL2_CMD, \n escapeshellarg($outputFilePath));\n \n */;\n $exitCode = false;\n file_put_contents($outputFilePath.\".log\",'');\n $execCommand = sprintf(str_replace(\"transcoder.class.php\", 'transcode/transcodevideo.sh', __file__).' %s %s %s %s %s > '.$outputFilePath.'.log 2>&1 &', \n self::TRANSCODE_FFMPEG_CMD,\n escapeshellarg($fileName),\n escapeshellarg($outputFilePath),\n self::TRANSCODE_FLVTOOL2_CMD,\n\t$mime\n);\n \n \n \n exec($execCommand, $cmdOutput, $exitCode);\n \n \n \n if ($exitCode !== 0) \n {\n throw new Exception(\"Transcode failed!\\nTranscode Output:\\n\" . $exitCode);\n }\n //unset($cmdOutput);\n //exec($flvtoolCmd, $cmdOutput, $exitCode);\n }\n \n return array('newFileName' => basename($outputFilePath), \n 'convertedMime' => 'video/flv',\n 'detectedMime' => $this->_detectedMime,\n );\n }",
"public function action_media($file) {\n\t\t// Find the file extension\n\t\t$ext = pathinfo($file, PATHINFO_EXTENSION);\n\n\t\t// Remove the extension from the filename\n\t\t$file = substr($file, 0, -(strlen($ext) + 1));\n\n\t\tif ($file = Kohana::find_file('media', $file, $ext))\n\t\t{\n\t\t\t// Send the file content as the response\n\t\t\t$this->request->response = file_get_contents($file);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Return a 404 status\n\t\t\t$this->request->status = 404;\n\t\t}\n\n\t\t// Set the content type for this extension\n\t\t$this->request->headers['Content-Type'] = File::mime_by_ext($ext);\n\t}",
"private function parseMo() {\n /*\n * TODO: gucken, ob file existiert\n */\n $content = file_get_contents(BASE_PATH.'/lang/'.LANGUAGE.'.mo');\n\t $fileSize = strlen($content);\n\t \n\t // Find the byte order of the MO file creator\n\t $byteOrder = substr($content, 0, 4);\n\t \n\t // Little endian\n\t if ($byteOrder == \"\\xde\\x12\\x04\\x95\") {\n\t \t$tmpl = \"V\";\n\t // Big endian\n\t } elseif ($byteOrder == \"\\x95\\x04\\x12\\xde\") {\n\t $tmpl = \"N\";\n\t // Wrong magic number. Not a valid MO file.\n\t } else {\n\t return 'wrong magic number';\n\t }\n\t \n\t // Check the MO format revision number\n\t $revision = unpack($tmpl, substr($content, 4, 4));\n\t if ($revision[1] > 0) return 'wrong revision';\n\t \n\t // Number of strings\n\t $numberOfStrings = unpack($tmpl, substr($content, 8, 4));\n\t \n\t // Offset to the beginning of the original strings\n\t $offo = unpack($tmpl, substr($content, 12, 4));\n\t \n\t // Offset to the beginning of the translated strings\n\t $offt = unpack($tmpl, substr($content, 16, 4));\n\t \n\t $trans = array();\n\t for ($i = 0; $i < $numberOfStrings[1]; $i++) {\n\t // The first word is the length of the string\n\t $len = unpack($tmpl, substr($content, $offo[1]+($i*8), 4));\n\t \n\t // The second word is the offset of the string\n\t $off = unpack($tmpl, substr($content, $offo[1]+($i*8)+4, 4));\n\t \n\t // Original string\n\t $stro = substr($content, $off[1], $len[1]);\n\t \n\t // The first word is the length of the string\n\t $len = unpack($tmpl, substr($content, $offt[1]+($i*8), 4));\n\t \n\t // The second word is the offset of the string\n\t $off = unpack($tmpl, substr($content, $offt[1]+($i*8)+4, 4));\n\t \n\t // Translated string\n\t $strt = substr($content, $off[1], $len[1]);\n\t \n\t // Hash it baby\n\t $trans[$stro] = $strt;\n\t \n\t }\n\t \n\t return $trans;\n }",
"public function transcodeFile($file) : void{\n\t\t\n\t\t$file = $this -> fixOrientation($file);\n\t\t\n\t\tif($file) {\n\t\t\t\n\t\t\t$storageProdiver = $this -> _storageService;\n\t\t\t$storage_service = new $storageProdiver;\n\t\t\t$mime_type = \\FileManager::getFileMimeType($file);\n\t\t\t$extension = $this -> getExtension($mime_type);\n\t\t\t$save_location = '';\n\t\t\t\n\t\t\tif($this -> _localStorage) {\n\t\t\t\t$save_location = SITE_PATH.'/public_html/img/uploads/'.$this -> image_id.$extension;\n\t\t\t} else {\n\t\t\t\t$save_location = $this -> image_id.$extension;\n\t\t\t}\n\t\t\t\n\t\t\t$uploaded_file = $storage_service ->upload( $save_location , file_get_contents($file) , $mime_type);\n\t\t\t\n\t\t\tif($uploaded_file) {\n\t\t\t\t\n\t\t\t\t$this -> update(array(\n\t\t\t\t\t'image_original_url' => $uploaded_file\n\t\t\t\t));\t\n\t\t\t\t\n\t\t\t\t$this -> scaleImage(800, 600, $file, 'image_large_url', 'image_large_square_url');\n\t\t\t\t$this -> scaleImage(500, 334, $file, 'image_medium_url', 'image_medium_square_url');\n\t\t\t\t$this -> scaleImage(240, 160, $file, 'image_small_url', 'image_small_square_url');\n\t\t\t\t$this -> scaleImage(100, 100, $file, 'image_thumbnail_url', 'image_thumbnail_square_url');\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(file_exists($file)) {\n\t\t\t\t\tunlink($file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function media_upload_file()\n {\n }",
"public function convert(Media $media, Conversion $conversion = null) : string;",
"function decodeFile($file, $strict = false);",
"public function execute(Media $filename): Media;",
"public static function decodeFromFile($path);",
"public function media();",
"public function downloadMediaFile($m){\n $file_path = null;\n $response = [];\n $media = Media::load($m->mid);\n if(empty($media)){\n $response = ['vid' => $m->video_id, 'cmd' => 'Copy media file to temporary directory!', 'output_file' => null, 'output_value' => 'Couldn\\'t load media.', 'return_value' => 1];\n $this->trackProcessingStage($response, 'Copy-to-temp-directory');\n }else{\n $fid = null;\n $file_uri = null;\n $type = $media->bundle();\n // image\n if(($type == 'image') && !empty($media->field_media_image->entity)) {\n $fid = $media->field_media_image->target_id;\n $file_uri = $media->field_media_image->entity->getFileUri();\n }\n // video\n if(($type == 'video') && !empty($media->field_media_video_file->entity)) {\n $fid = $media->field_media_video_file->target_id;\n $file_uri = $media->field_media_video_file->entity->getFileUri();\n }\n // audio\n if(($type == 'audio') && !empty($media->field_media_audio_file->entity)) {\n $fid = $media->field_media_audio_file->target_id;\n $file_uri = $media->field_media_audio_file->entity->getFileUri();\n }\n \n if(empty($fid)){\n $response = ['vid' => $m->video_id, 'cmd' => 'Copy media file to temporary directory!', 'output_file' => null, 'output_value' => 'File doesn\\'t exists.', 'return_value' => 1];\n $this->trackProcessingStage($response, 'Copy-to-temp-directory');\n }else{\n $file = File::load($fid);\n $file_name = $file->getFilename();\n $destination = $this->createTmpDir($m->video_id) . '/' . $file_name;\n if($file = file_copy($file, $destination, FILE_EXISTS_REPLACE)) {\n // update media table\n \\Drupal::database()->update('vmt_media')\n ->condition('id', $m->id)\n ->condition('video_id', $m->video_id)\n ->fields(['fid' => $fid, 'type' => $type, 'file_uri' => $file_uri])\n ->execute();\n $file_path = drupal_realpath($destination);\n }else {\n $response = ['vid' => $m->video_id, 'cmd' => 'Copy media file to temporary directory!', 'output_file' => null, 'output_value' => 'Couldn\\'t copy the file into temporary directory.', 'return_value' => 1];\n $this->trackProcessingStage($response, 'Copy-to-temp-directory');\n }\n }\n }\n \n return $file_path;\n }",
"function media_upload()\r\n{\r\n\tglobal $DIR_MEDIA, $member, $CONF, $manager;\r\n\r\n\t$uploadInfo = postFileInfo('uploadfile');\r\n\r\n\t$filename = $uploadInfo['name'];\r\n\t$filetype = $uploadInfo['type'];\r\n\t$filesize = $uploadInfo['size'];\r\n\t$filetempname = $uploadInfo['tmp_name'];\r\n\t$fileerror = intval($uploadInfo['error']);\r\n\t$mediatocu = $manager->getPlugin('NP_Mediatocu');\r\n// added yama 20080131\r\n\tif ($mediatocu->getOption('filename_rule') == \"ascii\") {\r\n\t\t$path_parts = pathinfo($filename);\r\n\t\t$filename = time() . \".\" . $path_parts['extension'];\r\n\t}\r\n// end\r\n\t\r\n\tswitch ($fileerror) {\r\n\t\tcase 0: // = UPLOAD_ERR_OK\r\n\t\t\tbreak;\r\n\t\tcase 1: // = UPLOAD_ERR_INI_SIZE\r\n\t\tcase 2: // = UPLOAD_ERR_FORM_SIZE\r\n\t\t\tmedia_doError(_ERROR_FILE_TOO_BIG);\r\n\t\t\tbreak;\r\n\t\tcase 3: // = UPLOAD_ERR_PARTIAL\r\n\t\tcase 4: // = UPLOAD_ERR_NO_FILE\r\n\t\tcase 6: // = UPLOAD_ERR_NO_TMP_DIR\r\n\t\tcase 7: // = UPLOAD_ERR_CANT_WRITE\r\n\t\tdefault:\r\n\t\t\t// include error code for debugging\r\n\t\t\t// (see http://www.php.net/manual/en/features.file-upload.errors.php)\r\n\t\t\tmedia_doError(_ERROR_BADREQUEST . ' (' . $fileerror . ')');\r\n\t\t\tbreak;\r\n\t}\r\n\t// T.Kosugi add 2006.9.1\r\n\tif (stristr($filename, '%00')) {\r\n\t\tmedia_doError(_MEDIA_PHP_38);\r\n\t}\r\n\t// T.Kosugi add end\r\n\tif (strpos($filename,\"\\0\") !== false) {\r\n\t\tmedia_doError(_MEDIA_PHP_38);\r\n\t}\r\n\tif ($filesize > $CONF['MaxUploadSize']) {\r\n\t\tmedia_doError(_ERROR_FILE_TOO_BIG);\r\n\t}\r\n\r\n\t// check file type against allowed types\r\n\t$ok = 0;\r\n\t$allowedtypes = explode (',', $CONF['AllowedTypes']);\r\n\tforeach ( $allowedtypes as $type ) {\r\n\t\tif (eregi(\"\\.\" .$type. \"$\",$filename)) {\r\n\t\t\t$ok = 1;\r\n\t\t}\r\n\t}\r\n\tif (!$ok) {\r\n\t\tmedia_doError(_ERROR_BADFILETYPE);\r\n\t}\r\n\r\n\tif (!is_uploaded_file($filetempname)) {\r\n\t\tmedia_doError(_ERROR_BADREQUEST);\r\n\t}\r\n\r\n\t// prefix filename with current date (YYYY-MM-DD-)\r\n\t// this to avoid nameclashes\r\n\tif ($CONF['MediaPrefix']) {\r\n\t\t$filename = strftime(\"%Y%m%d-\", time()) . $filename;\r\n\t}\r\n\r\n\t// Filename should not contain '/' or '\\'.\r\n\tif (preg_match('#(/|\\\\\\\\)#',$filename)) media_doError(_ERROR_DISALLOWED);\r\n\r\n\t$collection = media_requestVar('collection');\r\n\t$res = MEDIA::addMediaObject($collection, $filetempname, $filename);\r\n\r\n\tif ($res != '') {\r\n\t\tmedia_doError($res);\r\n\t}\r\n\t$uppath = $DIR_MEDIA.$collection . \"/\";\r\n\t$upfile = $DIR_MEDIA.$collection . \"/\" . $filename;\r\n\r\n\t$res = move_uploaded_file($filetempname, $upfile);\r\n\tif ($res != '') {\r\n\t media_doError($res);\r\n\t}\r\n\r\n\tmake_thumbnail($DIR_MEDIA, $collection, $upfile, $filename);\r\n\r\n\t// shows updated list afterwards\r\n\tmedia_select();\r\n}",
"private static function media()\n {\n $files = ['QR'];\n $folder = static::$root.'Media'.'/';\n\n self::call($files, $folder);\n }",
"function convert($filename);",
"function Converter($uploaded_file,$max_size=5120) {\n\t\t$tmp_file = $uploaded_file['tmp_name'];\n\n\t\tif(empty($tmp_file)) {\n\t\t\treturn 'You haven\\'t upload any file. Please try again';\n\t\t} else {\n\t\t\tset_time_limit(0);\n\n\t\t\t$file_name = $uploaded_file['name'];\n\t\t\t$file_type = $uploaded_file['type'];\n\t\t\t$type = $this->TypeofFile($uploaded_file);\n\n\t\t\tif($type=='ogg') {\n\t\t\t\tunlink($tmp_file);\n\t\t\t\treturn '<b>'.$file_name.'</b> is '.$file_type.' file. You don\\'t need to convert it';\n\t\t\t} elseif($type=='forbidden') {\n\t\t\t\tunlink($tmp_file);\n\t\t\t\treturn '<b>'.$file_name.'</b> is not an audio or a video file';\n\t\t\t} else {\t\t\t\n\t\t\t\t$size = round($uploaded_file['size']/1024,2);\n\t\t\t\tif($size<1024) {\n\t\t\t\t\t$file_size = $size.' KB';\n\t\t\t\t} else {\n\t\t\t\t\t$file_size = round($size/1024,2).' MB';\n\t\t\t\t}\n\n\t\t\t\tif($max_size!=0 && $size>$max_size) {\n\t\t\t\t\tif($max_size<1024) {\n\t\t\t\t\t\t$max_size = $max_size.' KB';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$max_size = round($max_size/1024,2).' MB';\n\t\t\t\t\t}\n\t\t\t\t\tunlink($tmp_file);\n\t\t\t\t\treturn '<b>'.$file_name.' ['.$file_size.']</b> is too large to be converted. Allowed max. size is '.$max_size;\n\t\t\t\t} else {\n\t\t\t\t\tif(!file_exists('ffmpeg2theora.exe')) {\n\t\t\t\t\t\tunlink($tmp_file);\n\t\t\t\t\t\treturn '<b>ffmpeg2theora.exe</b> does not exist. If there is a similar file with a different name, please rename it to <b>ffmpeg2theora.exe</b>. Please check and try again';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$source_file = str_replace(' ','-',$file_name);\n\t\t\t\t\t\tmove_uploaded_file($tmp_file,$source_file);\n\n\t\t\t\t\t\t$file_ext = strrchr($file_name,'.');\n\t\t\t\t\t\t$file_basename = str_replace($file_ext,'',$file_name);\n\t\t\t\t\t\t$file_basename1 = str_replace($file_ext,'',$source_file);\n\n\t\t\t\t\t\tif($type=='video') {\n\t\t\t\t\t\t\t$ext = '.ogv';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($type=='audio') {\n\t\t\t\t\t\t\t$ext = '.oga';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$new_file = $file_basename.$ext;\n\t\t\t\t\t\t$new_file1 = $file_basename1.$ext;\n\n\t\t\t\t\t\t$execute = shell_exec('ffmpeg2theora -o '.$new_file1.' '.$source_file);\n\t\t\t\t\t\tif($execute) {\n\t\t\t\t\t\t\trename($new_file1,$new_file);\n\t\t\t\t\t\t\t$new_size = round(filesize($new_file)/1024,2);\n\t\t\t\t\t\t\tif($new_size<1024) {\n\t\t\t\t\t\t\t\t$new_file_size = $new_size.' KB';\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$new_file_size = round($new_size/1024,2).' MB';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$dir = 'output';\n\t\t\t\t\t\t\tif(!is_dir($dir)) {\n\t\t\t\t\t\t\t\tmkdir($dir,0777);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$output_file = $dir.'/'.$new_file;\n\t\t\t\t\t\t\t$output_name = $new_file;\n\n\t\t\t\t\t\t\tif(file_exists($output_file)) {\n\t\t\t\t\t\t\t\t$finished = false;\n\t\t\t\t\t\t\t\t$i = 0;\n\t\t\t\t\t\t\t\twhile(!$finished) {\n\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t$output_name = $file_basename.' ('.$i.')'.$ext;\n\t\t\t\t\t\t\t\t\t$output_file = $dir.'/'.$output_name;\n\t\t\t\t\t\t\t\t\tif(!file_exists($output_file)) {\n\t\t\t\t\t\t\t\t\t\t$finished = true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcopy($new_file,$output_file);\n\t\t\t\t\t\t\tunlink($source_file);\n\t\t\t\t\t\t\tunlink($new_file);\n\t\t\t\t\t\t\treturn '<b>'.$file_name.' ['.$file_size.']</b> is successfull converted to <b>'.$output_name.' ['.$new_file_size.']</b><br />\n\t\t\t\t\t\t\tclick <a href=\"output/'.$new_file.'\" target=\"_blank\">here</a> to download it';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tunlink($source_file);\n\t\t\t\t\t\t\treturn '<b>[Error Operation]</b>. Please try again';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tflush();\n\t\t}\n\t}",
"static function EncodeMp3($filepath)\n\t\t{\n\t\t\t// --------------------------------------------------------\n\t\t\t// Increase the memory limit for complete file allocation.\n\t\t\t// Earlier 8 MB now 25 MB\n\t\t\t// --------------------------------------------------------\n\t\t\tini_set(\"memory_limit\",\"80M\");\n\t\t\t// --------------------------------------------------------\n\t\t\t\n\t\t\t$temp_name = $filepath.\"_write\" ;\n\t\t\t\n\t\t\t// Create a file with temp name.\n\t\t\t$to_write = fopen($temp_name, \"xb\") ;\n\t\t\t$filedata = file_get_contents($filepath, FILE_BINARY) ;\n\t\t\t\n\t\t\t// Write 2 chars MX into the file\n\t\t\tfputs($to_write, \"MX\".CUtils::GetRandString(50)) ;\n\t\t\t\n\t\t\t// Now write complete file to temp file.\n\t\t\tfwrite($to_write, $filedata) ;\n\t\t\t\n\t\t\t// Close file handle.\n\t\t\tfclose($to_write) ;\n\t\t\t\n\t\t\t// Delete uploaded file.\n\t\t\tunlink($filepath) ;\n\t\t\t\n\t\t\t// Rename encoded file.\n\t\t\trename($temp_name, $filepath) ;\n\t\t}",
"private function _decodeAudio($fileName, $outputFileName)\n {\n if (strpos($this->_getFileType($fileName), 'Standard MIDI data') !== false)\n {\n $transcodeWavCmd = sprintf('%s -Ow -o %s %s 2>&1',\n self::TRANSCODE_TIMIDITY_CMD, $outputFileName, \n escapeshellarg($fileName));\n \n }\n else\n {\n $transcodeWavCmd = sprintf('/usr/bin/env MPLAYER_VERBOSE=-2 %s -msglevel all=5 -nolirc -nojoystick -vo null -vc null -ao pcm:fast:waveheader:file=%s %s 2>&',\n self::TRANSCODE_MPLAYER_CMD,\n $outputFileName, \n escapeshellarg($fileName));\n \n /* MPlayer doesn't seem to give any exit status codes :( */\n }\n // FIX check for errors!\n exec($transcodeWavCmd);\n }",
"function wp_read_audio_metadata($file)\n {\n }",
"function media_upload_audio()\n {\n }",
"protected function _handleMediaFileUpload()\n {\n\n if (empty($this->files)\n || !isset($this->files['file_upload'])) {\n // nothing to do\n return false;\n }\n\n if ($this->files['file_upload']['error'] != UPLOAD_ERR_OK) {\n throw new UNL_MediaHub_Manager_PostHandler_UploadException($this->files['file_upload']['error'], 500);\n }\n\n // Verify extension\n if (!self::validMediaFileName($this->files['file_upload']['name'])) {\n throw new UNL_MediaHub_Manager_PostHandler_UploadException('Invalid file extension uploaded '.$this->files['file_upload']['name'], 500);\n }\n\n $extension = strtolower(pathinfo($this->files['file_upload']['name'], PATHINFO_EXTENSION));\n\n //3gp doesnt work with mediaelement. Right now call it an mp4 (won't always work because 3gps are not always h264.)\n //TODO: Handle this better. perhaps check the file encoding or convert it instead of just renaming it.\n if ($extension == '3gp') {\n $extension = 'mp4';\n }\n \n $filename = md5(microtime() + rand()) . '.'. $extension;\n\n // Copy file to uploads diretory\n if (false == copy($this->files['file_upload']['tmp_name'],\n UNL_MediaHub_Manager::getUploadDirectory()\n . DIRECTORY_SEPARATOR .$filename)) {\n throw new UNL_MediaHub_Manager_PostHandler_UploadException('Error copying file from temp location to permanent location', 500);\n }\n\n return UNL_MediaHub_Controller::$url.'uploads/'.$filename;\n }",
"public function testMediaContentExample()\n {\n $expected = file_get_contents(__DIR__.'/resources/MediaContent.draft12.ubj');\n $json = json_decode(file_get_contents(__DIR__.'/resources/MediaContent.json'), true);\n $result = $this->Encoder->encode($json);\n\n file_put_contents(__DIR__.'/resources/MediaContent.draft12.ubj', $result);\n\n $this->assertEquals($expected, $result);\n }",
"public static function create(TranscodeInterface $media, array $options = []);",
"private function parseFile()\n {\n $this->size = filesize($this->sourceFilePath);\n $this->extension = getFileExtension($this->sourceFilePath);\n if ($this->extension != \"mp4\" || $this->extension != \"mkv\" ) {\n $this->extension = \"mp4\";\n }\n $this->fileNameWithExt = str_replace($this->baseSourceFolder, '', $this->sourceFilePath);\n $this->fileName = str_replace('.'.$this->extension, '', $this->fileNameWithExt);\n $this->destinationFilePath = $this->baseDestinationFolder.$this->fileName.'.'.$this->extension;\n if (preg_match('^/^', $this->fileNameWithExt)) {\n $tmp = explode('/', $this->fileNameWithExt);\n $partsCount = count($tmp);\n if ($partsCount > 2) {\n $pathFolderStr = '';\n $j = 0;\n $this->isNested = true;\n foreach ($tmp as $i => $part) {\n $maxCount = $partsCount - 1;\n if ($part != '' && $j < $maxCount) {\n $pathFolderStr .= $part.'/';\n $this->nestedArray[] = $part;\n if (!is_dir($this->baseDestinationFolder.$pathFolderStr)) {\n // mkdir($this->baseDestinationFolder.$pathFolderStr);\n }\n }\n $j++;\n }\n // Set the below values to allow for nested folders\n $this->fileNameWithExt = $tmp[$partsCount - 1];\n $this->fileName = str_replace('.'.$this->extension, '', $this->fileNameWithExt);\n if ($this->preserverNesting) {\n $this->destinationFilePath = $this->baseDestinationFolder.$pathFolderStr.$this->fileName.'.'.$this->extension;\n }else {\n $this->isNested = false;\n $this->destinationFilePath = $this->baseDestinationFolder.$this->fileName.'.'.$this->extension;\n }\n\n }else {\n if ($this->fileNameWithExt[0] == '/') {\n $this->fileNameWithExt = str_replace('/', '', $this->fileNameWithExt);\n $this->fileName = str_replace('/', '', $this->fileName);\n $this->destinationFilePath = $this->baseDestinationFolder.$this->fileName.'.'.$this->extension;\n }\n }\n }\n }",
"function encodage($source,$options){\n\tinclude_spip('plugins/installer');\n\t$ret = array();\n\tspip_log('On encode le document : '.$source['id_document'],'spipmotion');\n\t/**\n\t * Si le chemin vers le binaire FFMpeg n'existe pas,\n\t * la configuration du plugin crée une meta spipmotion_casse\n\t */\n\tif($GLOBALS['meta']['spipmotion_casse'] == 'oui'){\n\t\t$ret['success'] = false;\n\t\t$ret['erreur'] = 'spipmotion_casse';\n\t\treturn false;\n\t}\n\n\tinclude_spip('inc/config');\n\t$spipmotion_compiler = @unserialize($GLOBALS['spipmotion_metas']['spipmotion_compiler']);\n\t$ffmpeg_version = $spipmotion_compiler['ffmpeg_version'] ? $spipmotion_compiler['ffmpeg_version'] : '0.7';\n\t$rep_dest = sous_repertoire(_DIR_VAR, 'cache-spipmotion');\n\n\t$extension_attente = $options['format'];\n\n\t$encodeur = lire_config(\"spipmotion/encodeur_$extension_attente\",'');\n\n\t$ffmpeg2theora = @unserialize($GLOBALS['spipmotion_metas']['spipmotion_ffmpeg2theora']);\n\n\tif(\n\t\t($source['rotation'] == '90')\n\t\t OR ($encodeur == 'ffmpeg2theora' && !$ffmpeg2theora['version'])){\n\t\t$encodeur = 'ffmpeg';\n\t}\n\n\tinclude_spip('inc/documents');\n\t$chemin = get_spip_doc($source['fichier']);\n\t$fichier = basename($source['fichier']);\n\tspip_log(\"encodage de $chemin\",\"spipmotion\");\n\n\t/**\n\t * Génération des noms temporaires et finaux\n\t * - Le nom du dossier temporaire (tmp/spipmotion)\n\t * - Le nom du fichier final (nom_du_fichier-encoded.ext)\n\t * - Le nom du fichier temporaire durant l'encodage\n\t * - Le nom du fichier de log généré pour chaque fichier\n\t */\n\t$query = \"$fichier-$extension_attente-\".date('Y_m_d_H-i-s');\n\t$dossier = sous_repertoire(_DIR_VAR, 'cache-spipmotion');\n\t$fichier_final = substr($fichier,0,-(strlen($source['extension'])+1)).'-encoded.'.$extension_attente;\n\t$fichier_temp = \"$dossier$query.$extension_attente\";\n\t$fichier_log = \"$dossier$query.log\";\n\n\t/**\n\t * Si on n'a pas l'info hasaudio c'est que la récupération d'infos n'a pas eu lieu\n\t * On relance la récupération d'infos sur le document\n\t * On refais une requête pour récupérer les nouvelles infos\n\t */\n\tif(!$source['hasaudio'] OR !$source['hasvideo']){\n\t\t$recuperer_infos = charger_fonction('spipmotion_recuperer_infos','inc');\n\t\t$recuperer_infos($source['id_document']);\n\t\t$source = sql_fetsel('*','spip_documents','id_document ='.intval($source['id_document']));\n\t\tif(!$source['hasaudio'] OR !$source['hasvideo']){\n\t\t\tspip_log('La source n a ni audio ni video','spipmotion');\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * $texte est le contenu du fichier de preset que l'on passe à la commande\n\t * Certaines valeurs ne fonctionnent pas (et doivent être passées à la commande directement)\n\t * comme:\n\t * s = la taille\n\t * r = le nombre de frames par secondes\n\t * ac = le nombre de channels audio (ne provoquent pas d'erreurs mais ne passent pas)\n\t * \n\t * $infos_sup_normal correspond aux paramètres supplémentaires envoyés à la commande, \n\t * spécifique en fonction de plusieurs choses :\n\t * - rotation;\n\t */\n\t$texte = $infos_sup_normal = '';\n\n\t/**\n\t * Quelques définitions communes aux videos et sons\n\t * Vérifications de certaines options afin qu'elles ne cassent pas les encodages\n\t */\n\n\t/**\n\t * Correction des paramètres audio\n\t * Uniquement s'il y a une piste audio\n\t * -* codec à utiliser\n\t * -* bitrate\n\t * -* samplerate\n\t * -* nombre de canaux\n\t */\n\tif($source['hasaudio'] == 'oui'){\n\t\t$codec_audio = lire_config(\"spipmotion/acodec_$extension_attente\");\n\t\tif($extension_attente == \"mp3\")\n\t\t\t$codec_audio = \"libmp3lame\";\n\t\telse if(in_array($extension_attente,array('ogg','oga')))\n\t\t\t$codec_audio = \"libvorbis\";\n\t\telse if(!$codec_audio){\n\t\t\tif($extension_attente == 'ogv')\n\t\t\t\t$codec_audio = \"libvorbis\";\n\t\t}\n\t\t$acodec = $codec_audio ? \"--acodec \".$codec_audio :'';\n\n\t\t/**\n\t\t * Forcer libvorbis si on utilise ffmpeg\n\t\t */\n\t\tif(($encodeur == \"ffmpeg\") && ($acodec == \"--acodec vorbis\"))\n\t\t\t$acodec = '--acodec libvorbis';\n\n\t\tif(in_array($codec_audio,array('vorbis','libvorbis'))){\n\t\t\t$qualite = lire_config(\"spipmotion/qualite_audio_$extension_attente\",'4');\n\t\t\t$audiobitrate_ffmpeg2theora = $audiobitrate_ffmpeg = \"--audioquality $qualite\";\n\t\t}else{\n\t\t\t/**\n\t\t\t * S'assurer que le bitrate choisi fonctionne\n\t\t\t */\n\t\t\tif(intval($source['audiobitrate']) && (intval($source['audiobitrate']) < (lire_config(\"spipmotion/bitrate_audio_$extension_attente\",\"64\")*1000))){\n\t\t\t\t$audiobitrates = array('32000','64000','96000','128000','192000','256000');\n\t\t\t\tif(!in_array($source['audiobitrate'],$audiobitrates)){\n\t\t\t\t\t$abitrate = min($audiobitrates);\n\t\t\t\t\tforeach($audiobitrates as $bitrate){\n\t\t\t\t\t\tif($source['audiobitrate'] >= $bitrate){\n\t\t\t\t\t\t\t$abitrate = $bitrate;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else\n\t\t\t\t\t$abitrate = $source['audiobitrate'];\n\n\t\t\t\t$abitrate = floor($abitrate/1000);\n\t\t\t}else\n\t\t\t\t$abitrate = lire_config(\"spipmotion/bitrate_audio_$extension_attente\",\"64\");\n\t\t\t$texte .= \"ab=\".$abitrate.\"000\\n\";\n\t\t\t$audiobitrate_ffmpeg = $audiobitrate_ffmpeg2theora = \"--audiobitrate \".$abitrate;\n\t\t}\n\n\t\t/**\n\t\t * Vérification des samplerates\n\t\t */\n\t\tif(intval($source['audiosamplerate']) && (intval($source['audiosamplerate']) < lire_config(\"spipmotion/frequence_audio_$extension_attente\",\"22050\"))){\n\t\t\t/**\n\t\t\t * libmp3lame ne gère pas tous les samplerates\n\t\t\t * ni libfaac\n\t\t\t */\n\t\t\tif($acodec == '--acodec libmp3lame')\n\t\t\t\t$audiosamplerates = array('11025','22050','44100');\n\t\t\telse if($acodec == '--acodec libfaac')\n\t\t\t\t$audiosamplerates = array('22050','24000','32000','44100','48000');\n\t\t\telse\n\t\t\t\t$audiosamplerates = array('4000','8000','11025','16000','22050','24000','32000','44100','48000');\n\t\t\t/**\n\t\t\t * ffmpeg ne peut resampler\n\t\t\t * On force le codec audio à aac s'il était à libmp3lame et que le nombre de canaux était > 2\n\t\t\t */\n\t\t\tif(($source['audiochannels'] > 2) && ($encodeur != 'ffmpeg2theora')){\n\t\t\t\t$samplerate = $source['audiosamplerate'];\n\t\t\t\tif($acodec == '--acodec libmp3lame'){\n\t\t\t\t\t$acodec = '--acodec libfaac';\n\t\t\t\t\t$audiobitrate_ffmpeg = $audiobitrate_ffmpeg2theora = \"--audiobitrate 128\";\n\t\t\t\t}\n\t\t\t}else if(!in_array($source['audiosamplerate'],$audiosamplerates)){\n\t\t\t\t$samplerate = min($audiosamplerates);\n\t\t\t\tforeach($audiosamplerates as $audiosamplerate){\n\t\t\t\t\tif($source['audiosamplerate'] >= $audiosamplerate){\n\t\t\t\t\t\t$samplerate = $audiosamplerate;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else\n\t\t\t\t$samplerate = $source['audiosamplerate'];\n\t\t}else{\n\t\t\tif(($source['audiochannels'] > 2) && ($encodeur != 'ffmpeg2theora')){\n\t\t\t\t$samplerate = $source['audiosamplerate'];\n\t\t\t\tif($acodec == '--acodec libmp3lame'){\n\t\t\t\t\t$acodec = '--acodec libfaac';\n\t\t\t\t\t$audiobitrate_ffmpeg = $audiobitrate_ffmpeg2theora = \"--audiobitrate 128\";\n\t\t\t\t}\n\t\t\t}else\n\t\t\t\t$samplerate = lire_config(\"spipmotion/frequence_audio_$extension_attente\",\"22050\");\n\t\t}\n\t\tif($samplerate){\n\t\t\t$audiofreq = \"--audiofreq \".$samplerate;\n\t\t\t$texte .= \"ar=$samplerate\\n\";\n\t\t}\n\t\t/**\n\t\t * On passe en stereo ce qui a plus de 2 canaux et ce qui a un canal et dont\n\t\t * le format choisi est vorbis (l'encodeur vorbis de ffmpeg ne gère pas le mono)\n\t\t */\n\t\tif(in_array($extension_attente,array('ogg','ogv','oga')) && ($source['audiochannels'] < 2)\n\t\t\t&& ($encodeur != 'ffmpeg2theora')){\n\t\t\t$audiochannels = 2;\n\t\t}else\n\t\t\t$audiochannels = $source['audiochannels'];\n\n\t\tif(intval($audiochannels) >= 1){\n\t\t\t/**\n\t\t\t * Apparemment le mp3 n'aime pas trop le 5.1 channels des AC3 donc on downgrade en 2 channels en attendant\n\t\t\t */\n\t\t\tif($extension_attente == 'mp3'){\n\t\t\t\t$texte .= \"ac=2\\n\";\n\t\t\t\t$audiochannels_ffmpeg = \"--ac 2\";\n\t\t\t}else{\n\t\t\t\t$texte .= \"ac=$audiochannels\\n\";\n\t\t\t\t$audiochannels_ffmpeg = \"--ac $audiochannels\";\n\t\t\t}\n\t\t}\n\t\t$ss_audio = '';\n\t}else\n\t\t$ss_audio = '-an';\n\n\tif($GLOBALS['spipmotion_metas']['spipmotion_safe_mode'] == 'oui')\n\t\t$spipmotion_sh = $GLOBALS['spipmotion_metas']['spipmotion_safe_mode_exec_dir'].'/spipmotion.sh'; \n\telse\n\t\t$spipmotion_sh = find_in_path('script_bash/spipmotion.sh');\n\n\t/**\n\t * Encodage\n\t * Cas d'un fichier audio\n\t */\n\tif(in_array($source['extension'],lire_config('spipmotion/fichiers_audios_encodage',array()))){\n\t\t/**\n\t\t * Encodage du son\n\t\t */\n\t\t$encodage = $spipmotion_sh.' --e '.$chemin.' --s '.$fichier_temp.' '.$acodec.' '.$audiobitrate_ffmpeg.' '.$audiofreq.' '.$audiochannels_ffmpeg.' --log '.$fichier_log;\n\t\tspip_log(\"$encodage\",'spipmotion');\n\t\t$lancement_encodage = exec($encodage,$retour,$retour_int);\n\t\tif($retour_int == 0){\n\t\t\t$ret['success'] = true;\n\t\t}else if($retour_int >= 126){\n\t\t\t$ret['success'] = false;\n\t\t\t$ret['erreur'] = _T('spipmotion:erreur_script_spipmotion_non_executable');\n\t\t\tecrire_fichier($fichier_log,$ret['erreur']);\n\t\t}\n\t}\n\n\t/**\n\t * Encodage\n\t * Cas d'un fichier vidéo\n\t *\n\t * On corrige les paramètres video avant de lancer l'encodage\n\t */\n\tif(in_array($source['extension'],lire_config('spipmotion/fichiers_videos_encodage',array()))){\n\t\t$format = lire_config(\"spipmotion/format_$extension_attente\");\n\t\tif($source['rotation'] == '90'){\n\t\t\t$width = $source['hauteur'];\n\t\t\t$height = $source['largeur'];\n\t\t}else{\n\t\t\t$width = $source['largeur'];\n\t\t\t$height = $source['hauteur'];\n\t\t}\n\t\t$width_finale = lire_config(\"spipmotion/width_$extension_attente\",480);\n\n\t\t/**\n\t\t * Les ipod/iphones 3Gs et inférieur ne supportent pas de résolutions > à 640x480\n\t\t */\n\t\tif($format == 'ipod' && ($width_finale > 640))\n\t\t\t$width_finale = 640;\n\n\t\t/**\n\t\t * On n'agrandit jamais la taille\n\t\t * si la taille demandée est supérieure à la taille originale\n\t\t */\n\t\tif($width < $width_finale){\n\t\t\t$width_finale = $width;\n\t\t\t$height_finale = $height;\n\t\t}\n\t\t/**\n\t\t * Calcul de la hauteur en fonction de la largeur souhaitée\n\t\t * et de la taille de la video originale\n\t\t */\n\t\telse\n\t\t\t$height_finale = intval(round($height/($width/$width_finale)));\n\n\t\t/**\n\t\t * Pour certains codecs (libx264 notemment), width et height doivent être\n\t\t * divisibles par 2\n\t\t * On le fait pour tous les cas pour éviter toute erreur\n\t\t */\n\t\tif(!is_int($width_finale/2))\n\t\t\t$width_finale = $width_finale +1;\n\t\tif(!is_int($height_finale/2))\n\t\t\t$height_finale = $height_finale +1;\n\n\t\t$video_size = \"--size \".$width_finale.\"x\".$height_finale;\n\n\t\t/**\n\t\t * Définition du framerate d'encodage\n\t\t * - Si le framerate de la source est supérieur à celui de la configuration souhaité, on prend celui de la configuration\n\t\t * - Sinon on garde le même que la source\n\t\t */\n\t\t$texte .= lire_config(\"spipmotion/vcodec_$extension_attente\") ? \"vcodec=\".lire_config(\"spipmotion/vcodec_$extension_attente\").\"\\n\":'';\n\t\t$vcodec .= lire_config(\"spipmotion/vcodec_$extension_attente\") ? \"--vcodec \".lire_config(\"spipmotion/vcodec_$extension_attente\") :'';\n\n\t\t$fps_conf = (intval(lire_config(\"spipmotion/fps_$extension_attente\",\"30\")) > 0) ? lire_config(\"spipmotion/fps_$extension_attente\",\"30\") : ((intval($source['framerate']) > 0) ? intval($source['framerate']) : 24);\n\t\tif(intval($source['framerate']) && (intval($source['framerate']) < $fps_conf))\n\t\t\t$fps_num = $source['framerate'];\n\t\telse\n\t\t\t$fps_num = (intval($fps_conf) > 0) ? $fps_conf : $source['framerate'];\n\n\t\t$fps = \"--fps $fps_num\";\n\n\t\t/**\n\t\t * Définition des bitrates\n\t\t * On vérifie ceux de la source et on compare à ceux souhaités dans la conf\n\t\t * Si la source est inférieure, on utilise ceux de la source en utilisant l'option -qscale 0\n\t\t * ffmpeg2theora lui a besoin d'une estimation de bitrate\n\t\t */\n\t\tif(intval($source['videobitrate']) && (intval($source['videobitrate']) < (lire_config(\"spipmotion/bitrate_$extension_attente\",\"600\"))*1000)){\n\t\t\tif(($encodeur == 'ffmpeg2theora') OR ($vcodec == '--vcodec libtheora'))\n\t\t\t\t$vbitrate = $source['videobitrate'];\n\t\t\telse{\n\t\t\t\t$vbitrate = null;\n\t\t\t\tif(spip_version_compare($ffmpeg_version,'1.0.0','<'))\n\t\t\t\t\t$infos_sup_normal .= ' -sameq ';\n\t\t\t\telse\n\t\t\t\t\t$infos_sup_normal .= ' -q:v 0 ';\n\t\t\t}\n\t\t\t$bitrate = \"--bitrate \".$source['videobitrate'];\n\t\t}else{\n\t\t\t$vbitrate = lire_config(\"spipmotion/bitrate_$extension_attente\",\"600\");\n\t\t\t$bitrate = \"--bitrate $vbitrate\";\n\t\t}\n\n\t\t$texte .= intval($vbitrate) ? \"vb=\".$vbitrate.\"000\\n\" : '';\n\t\t$bitrate = intval($vbitrate) ? \"--bitrate \".$vbitrate : '';\n\n\t\t$configuration = array();\n\t\tif(is_array($spipmotion_compiler['configuration']))\n\t\t\t$configuration = $spipmotion_compiler['configuration'];\n\n\t\t/**\n\t\t * Paramètres supplémentaires pour encoder en h264\n\t\t */\n\t\tif($vcodec == '--vcodec libx264'){\n\t\t\t$preset_quality = lire_config(\"spipmotion/vpreset_$extension_attente\",'slow');\n\t\t\tif(in_array('--enable-pthreads',$configuration))\n\t\t\t\t$infos_sup_normal .= \" -threads 0 \";\n\n\t\t\t/**\n\t\t\t * Encodage pour Ipod/Iphone (<= 3G)\n\t\t\t */\n\t\t\tif($format == 'ipod'){\n\t\t\t\tif(spip_version_compare($ffmpeg_version,'0.7.20','<'))\n\t\t\t\t\t$infos_sup_normal .= ' -vpre baseline -vpre ipod640 -bf 0';\n\t\t\t\telse\n\t\t\t\t\t$infos_sup_normal .= ' -profile:v baseline -vpre ipod640 -bf 0';\t\n\t\t\t}\n\t\t\t/**\n\t\t\t * Encodage pour PSP\n\t\t\t * http://rob.opendot.cl/index.php/useful-stuff/psp-video-guide/\n\t\t\t */\n\t\t\telse if($format == 'psp')\n\t\t\t\t$infos_sup_normal .= ' -vpre main -level 21 -refs 2';\n\t\t}\n\t\tif(($vcodec == \"--vcodec libtheora\") && ($encodeur != 'ffmpeg2theora')){\n\t\t\tif(in_array('--enable-pthreads',$configuration))\n\t\t\t\t$infos_sup_normal .= \" -threads 0 \";\n\t\t}\n\n\t\tif($source['rotation'] != 90){\n\t\t\t$aspect = $source['aspect_ratio'] ? $source['aspect_ratio']: \"$width_finale:$height_finale\";\n\t\t\t$infos_sup_normal .= \" -aspect $aspect\";\n\t\t}\n\n\t\t$fichier_texte = \"$dossier$query.txt\";\n\n\t\tecrire_fichier($fichier_texte,$texte);\n\n\t\t/**\n\t\t * Encodage de la video\n\t\t * Si l'encodeur choisi est ffmpeg2theora et qu'il existe toujours, on l'utilise\n\t\t * sinon on utilise notre script pour ffmpeg\n\t\t */\n\t\t$passes = lire_config(\"spipmotion/passes_$extension_attente\",'1');\n\t\t$pass_log_file = $dossier.$query.'-pass';\n\n\t\tif(($encodeur == 'ffmpeg2theora') && ($ffmpeg2theora['version'] > 0)){\n\t\t\tif($passes == 2) $deux_passes = '--two-pass';\n\t\t\t$encodage = $spipmotion_sh.\" --force true $video_size --e $chemin --videoquality \".lire_config('spipmotion/qualite_video_ffmpeg2theora_'.$extension_attente,7).\" $fps $bitrate $audiofreq $audiobitrate_ffmpeg2theora $audiochannels_ffmpeg2theora --s $fichier_temp $deux_passes --log $fichier_log --encodeur ffmpeg2theora\";\n\t\t\tspip_log($encodage,'spipmotion');\n\t\t\t$lancement_encodage = exec($encodage,$retour,$retour_int);\n\t\t}else{\n\t\t\tif(($passes == \"2\") && ((($vcodec == '--vcodec libx264') && ($preset_quality != 'hq')) OR ($vcodec == '--vcodec flv') OR ($vcodec == '--vcodec libtheora') OR ($extension_attente == 'webm'))){\n\t\t\t\tspip_log('Premiere passe','spipmotion');\n\t\t\t\tif (spip_version_compare($ffmpeg_version,'1.0.0','<')){\n\t\t\t\t\t$preset_1 = $preset_quality ? ' -vpre '.$preset_quality.'_firstpass' : '';\n\t\t\t\t}else\n\t\t\t\t\t$preset_1 = $preset_quality ? ' -preset '.$preset_quality : '';\n\n\t\t\t\tif($source['rotation'] == '90'){\n\t\t\t\t\t$metadatas = '';\n\t\t\t\t\tif (spip_version_compare($ffmpeg_version,'1.0.0','<')){\n\t\t\t\t\t\t$rotation = \"-vf transpose=1\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$metadatas = \"-metadata:s:v:0 rotate=0\";\n\t\t\t\t\t\t$rotation = \"-filter:v transpose=1\";\n\t\t\t\t\t}\n\t\t\t\t\t$infos_sup_normal .= \"$rotation $metadatas\";\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Même si dans tous les tutos il est spécifié de mettre -an pour ne pas utiliser l'audio dans la première passe\n\t\t\t\t * Il s'avère que dans certains cas (source désynchronisée), l'encodage plante\n\t\t\t\t * Du coup on utilise exactement les mêmes réglages dans les 2 passes\n\t\t\t\t */\n\t\t\t\t$infos_sup_normal_1 = \"--params_supp \\\"$preset_1 -passlogfile $pass_log_file $infos_sup_normal\\\"\";\n\t\t\t\t$encodage_1 = $spipmotion_sh.\" --force true --pass 1 $audiofreq $audiobitrate_ffmpeg $audiochannels_ffmpeg $video_size --e $chemin $vcodec $fps $bitrate $infos_sup_normal_1 --s $fichier_temp --log $fichier_log\";\n\t\t\t\tspip_log($encodage_1,'spipmotion');\n\t\t\t\t$lancement_encodage_1 = exec($encodage_1,$retour_1,$retour_int_1);\n\t\t\t\t/**\n\t\t\t\t * La première passe est ok \n\t\t\t\t * On lance la seconde\n\t\t\t\t */\n\t\t\t\tif($retour_int_1 == 0){\n\t\t\t\t\tspip_log('Seconde passe','spipmotion');\n\n\t\t\t\t\tif (spip_version_compare($ffmpeg_version,'0.7.20','<'))\n\t\t\t\t\t\t$preset_2 = $preset_quality ? \" -vpre $preset_quality\":'';\n\t\t\t\t\telse\n\t\t\t\t\t\t$preset_2 = $preset_quality ? \" -preset $preset_quality\":'';\n\n\t\t\t\t\t$infos_sup_normal_2 = \"--params_supp \\\"-passlogfile $pass_log_file $ss_audio $preset_2 $infos_sup_normal $metadatas\\\"\";\n\t\t\t\t\t$encodage = $spipmotion_sh.\" --force true --pass 2 $audiofreq $audiobitrate_ffmpeg $audiochannels_ffmpeg $video_size --e $chemin $acodec $vcodec $fps $bitrate $infos_sup_normal_2 --fpre $fichier_texte --s $fichier_temp --log $fichier_log\";\n\t\t\t\t\tspip_log($encodage,'spipmotion');\n\t\t\t\t\t$lancement_encodage = exec($encodage,$retour,$retour_int);\n\t\t\t\t}else{\n\t\t\t\t\tspip_log('SPIPMOTION Erreur : Le retour de l encodage est revenu en erreur','spipmotion'._LOG_CRITICAL);\n\t\t\t\t\t$retour_int = 1;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$metadatas = $metadatas_supp = \"\";\n\t\t\t\t$infos_sup_normal .= \" $ss_audio \";\n\t\t\t\tif (spip_version_compare($ffmpeg_version,'0.7.0','<'))\n\t\t\t\t\t$infos_sup_normal .= $preset_quality ? \" -vpre $preset_quality\":'';\n\t\t\t\telse\n\t\t\t\t\t$infos_sup_normal .= $preset_quality ? \" -preset $preset_quality\":'';\n\n\t\t\t\tif($source['rotation'] == '90'){\n\t\t\t\t\t$metadatas = \"\";\n\t\t\t\t\tif (spip_version_compare($ffmpeg_version,'1.0.0','<')){\n\t\t\t\t\t\t$rotation = \"-vf transpose=1\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$metadatas = \"-metadata:s:v:0 rotate=0\";\n\t\t\t\t\t\t$rotation = \"-filter:v transpose=1\";\n\t\t\t\t\t}\n\t\t\t\t\t$infos_sup_normal .= \" $rotation $metadatas\";\n\t\t\t\t}\n\n\t\t\t\tif(strlen($infos_sup_normal) > 1)\n\t\t\t\t\t$infos_sup_normal = \"--params_supp \\\"$infos_sup_normal\\\"\";\n\t\t\t\t$encodage = $spipmotion_sh.\" --force true $audiofreq $video_size --e $chemin $acodec $vcodec $fps $audiobitrate_ffmpeg $audiochannels_ffmpeg $bitrate $infos_sup_normal --s $fichier_temp --fpre $fichier_texte --log $fichier_log\";\n\t\t\t\tspip_log($encodage,'spipmotion');\n\t\t\t\t$lancement_encodage = exec($encodage,$retour,$retour_int);\n\t\t\t}\n\t\t}\n\n\t\tif($retour_int == 0){\n\t\t\t$ret['success'] = true;\n\t\t}else if($retour_int >= 126){\n\t\t\t$ret['success'] = false;\n\t\t\t$ret['erreur'] = _T('spipmotion:erreur_script_spipmotion_non_executable');\n\t\t\tecrire_fichier($fichier_log,$ret['erreur']);\n\t\t}\n\t}\n\n\tif($ret['success'] && file_exists(get_spip_doc($source['fichier']))){\n\t\tif(!sql_getfetsel('id_document','spip_documents','id_document='.intval($source['id_document']))){\n\t\t\tspip_connect_db('mysql-master','','mediaspip','zjX5uPfP','mu_filmscanece5','mysql', 'spip','');\n\t\t}\n\t\t/**\n\t\t * Ajout du nouveau document dans la base de donnée de SPIP\n\t\t * NB : la récupération des infos et du logo est faite automatiquement par\n\t\t * le pipeline post-edition appelé par l'ajout du document\n\t\t */\n\t\t$mode = 'conversion';\n\t\tspip_log('Ajout du document en base','spipmotion');\n\t\t$ajouter_documents = charger_fonction('ajouter_documents', 'action');\n\t\t$doc = array(array('tmp_name'=>$fichier_temp,'name'=>$fichier_final,'mode'=>$mode));\n\n\t\t/**\n\t\t * Tentative de récupération d'un logo du document original\n\t\t * si pas déjà de vignette\n\t\t */\n\t\tif($source['id_vignette'] > 0){\n\t\t\t$vignette = sql_fetsel('fichier,extension','spip_documents','id_document='.intval($source['id_vignette']));\n\t\t\t$fichier_vignette = get_spip_doc($vignette['fichier']);\n\t\t\t$vignette = array(array('tmp_name'=>$fichier_vignette,'name'=>$fichier_vignette));\n\t\t\t$x2 = $ajouter_documents('new', $vignette, '', 0, 'vignette');\n\t\t\t$id_vignette = reset($x2);\n\t\t\tif (is_numeric($id_vignette))\n\t\t\t \t$source['id_vignette'] = $id_vignette;\n\t\t}else\n\t\t\t$source['id_vignette'] = $id_vignette;\n\n\t\t/**\n\t\t * Champs que l'on souhaite réinjecter depuis l'original ni depuis un ancien encodage\n\t\t */\n\t\t$champs_recup = array('titre' => '','descriptif' => '');\n\t\tif(defined('_DIR_PLUGIN_PODCAST')){\n\t\t\t$champs_recup['podcast'] = 0;\n\t\t\t$champs_recup['explicit'] = 'non';\n\t\t}if(defined('_DIR_PLUGIN_LICENCES'))\n\t\t\t$champs_recup['id_licence'] = 0;\n\t\t$champs_recup['credits'] = '';\n\t\t$champs_recup['id_vignette'] = '';\n\n\t\t$modifs = array_intersect_key($source, $champs_recup);\n\t\tforeach($modifs as $champs=>$val){\n\t\t\tset_request($champs,$val);\n\t\t}\n\n\t\t$x = $ajouter_documents('new',$doc, 'document', $source['id_document'], $mode);\n\t\t$x = reset($x);\n\t\tif(intval($x) > 1){\n\t\t\tsupprimer_fichier($fichier_temp);\n\t\t\t$ret['id_document'] = $x;\n\t\t\t$ret['success'] = true;\n\t\t}else{\n\t\t\tspip_log('Il y a une erreur, le fichier n est pas copié','spipmotion');\n\t\t\t$ret['erreur'] = 'Il y a une erreur, le fichier n est pas copié';\n\t\t\t$ret['success'] = false;\n\t\t}\n\t}else if(!file_exists(get_spip_doc($source['fichier']))){\n\t\tspip_log('Le document original a été supprimé entre temps','spipmotion');\n\t\tsupprimer_fichier($fichier_temp);\n\t\t$ret['erreur'] = 'Le document original a été supprimé entre temps';\n\t\t$ret['success'] = false;\n\t}\n\t/**\n\t * Si l'encodage n'est pas ok ...\n\t * On donne un statut \"erreur\" dans la file afin de ne pas la bloquer\n\t */\n\telse{\n\t\t$infos_encodage['fin_encodage'] = time();\n\t\t$infos_encodage['log'] = spip_file_get_contents($fichier_log);\n\t\t$ret['infos'] = $infos_encodage;\n\t\t$ret['erreur'] = 'Encodage en erreur';\n\t\t$ret['success'] = false;\n\t}\n\n\t/**\n\t * On supprime les différents fichiers temporaires qui auraient pu être créés\n\t * si on a une réussite\n\t */\n\tif($ret['success']){\n\t\t$files = array(\n\t\t\t\t\t$fichier_temp,\n\t\t\t\t\t$fichier_texte,\n\t\t\t\t\t$pass_log_file.'-0.log',\n\t\t\t\t\t$pass_log_file.'.mbtree',\n\t\t\t\t\t$pass_log_file.'-0.log.mbtree',\n\t\t\t\t\t_DIR_RACINE.$query.'.mbtree',\n\t\t\t\t\t_DIR_RACINE.$query.'-pass'\n\t\t\t\t);\n\t\tforeach($files as $file){\n\t\t\tif(file_exists($file)) supprimer_fichier($file);\n\t\t}\n\t}\n\tpipeline('post_spipmotion_encodage',\n\t\t\t\tarray(\n\t\t\t\t\t'args' => array(\n\t\t\t\t\t\t'id_document' => $x,\n\t\t\t\t\t\t'id_document_orig' => $source['id_document'],\n\t\t\t\t\t\t'reussite' => $reussite\n\t\t\t\t\t),\n\t\t\t\t\t'data' => ''\n\t\t\t\t)\n\t\t\t);\n\n\tif ($notifications = charger_fonction('notifications', 'inc')) {\n\t\t$notifications('spipmotion_encodage', intval($options['id_facd_conversion']),\n\t\t\tarray(\n\t\t\t\t'id_document' => $x,\n\t\t\t\t'source' => $source,\n\t\t\t\t'fichier_log' => $fichier_log,\n\t\t\t)\n\t\t);\n\t}\n\treturn $ret;\n}",
"public static function file() {\n return new Media_File();\n }",
"public function mediableSave(\n string $media,\n string $field = 'picture',\n string $upload = null,\n bool $convert = true,\n bool $deleteOriginal = true\n ): void {\n $ext = pathinfo($media, PATHINFO_EXTENSION);\n $hasExt = ! empty($ext);\n $path = null;\n $content = null;\n $isPath = false;\n\n if ($hasExt) {\n $path = $media;\n\n if (! file_exists($path)) {\n // throw new \\Exception(\"File {$path} not found\");\n error_log(\"File {$path} not found\");\n\n return;\n }\n\n $content = file_get_contents($path);\n $isPath = true;\n } else {\n $content = $media;\n }\n\n $meta = MetaClassItem::make(get_class($this));\n $directory = $meta->getClassSlugPlural();\n\n if ($upload) {\n $directory = $upload;\n }\n\n if ($isPath) {\n $basename = basename($path);\n } else {\n $basename = uniqid().'.'.$ext;\n }\n\n $basePath = public_path(\"storage/{$directory}\");\n $fullPath = \"{$basePath}/{$basename}\";\n\n if (file_exists($fullPath)) {\n $name = uniqid().'-'.$basename;\n $fullPath = \"{$basePath}/{$name}\";\n }\n\n $dirname = dirname($fullPath);\n\n if (! file_exists($dirname)) {\n mkdir($dirname, 0775, true);\n }\n\n $extConvert = StewardConfig::mediableFormat();\n\n if ($convert && $ext !== StewardConfig::mediableFormat()) {\n $path = $this->convertTo(file_get_contents($path));\n $fullPath = str_replace($ext, $extConvert, $fullPath);\n }\n\n File::copy($path, $fullPath);\n $relativePath = explode('storage/', $fullPath);\n\n if ($deleteOriginal) {\n File::delete($path);\n }\n\n $this->{$field} = $relativePath[1] ?? null;\n $this->save();\n }",
"public function get_media()\n {\n }",
"public function testEncoding() {\n $content = utf8_decode(self::ENCODING_CONTENT);\n file_put_contents($this->destination_encoding_file, $content);\n //The first time, the file should be converted, as its content is not utf8 encoded.\n $this->assertTrue(HermesHelper::encodeUTF8($this->destination_encoding_file));\n //The next time, the file should be already converted, and nothing should be done.\n $this->assertFalse(HermesHelper::encodeUTF8($this->destination_encoding_file));\n }"
]
| [
"0.6641736",
"0.62608904",
"0.6189192",
"0.5828183",
"0.5746362",
"0.5678643",
"0.5674915",
"0.5556759",
"0.5543629",
"0.54714334",
"0.5448034",
"0.54406554",
"0.54277575",
"0.5406221",
"0.53902143",
"0.53660935",
"0.5341972",
"0.53367037",
"0.5270062",
"0.5239653",
"0.5200134",
"0.51552624",
"0.5141268",
"0.5131425",
"0.51284",
"0.5115141",
"0.5082931",
"0.50768304",
"0.50617313",
"0.5035984"
]
| 0.6294209 | 1 |
Checks if a file is a flv file. | private function _isFlv($fileName, $mime)
{
if (strpos($this->_getFileType($fileName), 'Macromedia Flash Video') !== false)
{
$this->_detectedMime = "video/x-flv";
return true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function checkFileType($fileType){\n \t\tif ($fileType == \"application/octet-stream\"){\n \t\t\treturn true;\n \t\t}else{\n \t\t\treturn false;\n \t\t}\n \t}",
"public function isFile();",
"public function isFile()\n {\n return ( $this->fileStructure->type == self::IS_FILE );\n }",
"public function isFile() : bool;",
"public function is_file($file)\n {\n }",
"public function is_file($file)\n {\n }",
"public function is_file($file)\n {\n }",
"public function is_file($file)\n {\n }",
"public function is_file($file)\n {\n }",
"public function is_file($file);",
"public static function isFile($_file)\r\n {\r\n return is_file($_file);\r\n }",
"public static function isFile($file) { \n $file = strval(str_replace(\"\\0\", \"\", $file)); return is_file($file); \n }",
"public function isFile(): bool;",
"protected function isFile() {}",
"public function isFile($file)\r\n\t{\r\n\t\treturn is_file($file);\r\n\t}",
"public static function isFile($file)\n\t{\n\t\treturn is_file($file);\n\t}",
"private function isFileValid(): bool\n {\n return FileHelper::isExpectedExtensions($this->getPath(), $this->getFileExtensions());\n }",
"public function checkIsFile($path);",
"public function isFile()\n {\n $this->is_file = false;\n\n try {\n\n if (@ftp_get($this->getConnection(), $this->temp, $this->path, Ftp_ASCII, 0)) {\n $this->is_file = true;\n }\n\n } catch (\\Exception $e) {\n }\n\n return;\n }",
"public function file($file): bool\n\t{\n if (is_array($file['error'])) {\n $error = (int)$file['error'][0];\n } else {\n $error = (int)$file['error'];\n }\n\n return $error !== 4;\n }",
"function isFile() {\n\t\treturn $this->repoObj->lobSubType == 'document';\n\t}",
"private function checkSupportedFile($file_type) {\n return true;\n\n\n }",
"public function isFile(string $file): bool\n {\n return is_file($file);\n }",
"static function isFileObject($var){\n if(self::isInstanceOf($var, 'Webiny\\Component\\StdLib\\StdObject\\FileObject\\FileObject')){\n return true;\n }\n\n return false;\n }",
"public function hasFile()\n {\n foreach ($this->fields() as $field) {\n if ($field instanceof Field\\File) {\n return true;\n }\n }\n\n return false;\n }",
"public function notFakeFile() {\n\t $check = filesize($this->value[\"tmp_name\"]);\n\t if($check !== false) {\n\t return true;\n\t } else {\n\t \treturn false;\n\t }\n\t}",
"public function isFile(): bool {\n\t\t$isFile = (bool) pathinfo($this->getPath(), PATHINFO_EXTENSION);\n\t\t$originalUriHasSlash = substr($this->originalUri, - 1) === '/';\n\n\t\treturn $isFile && ! $originalUriHasSlash;\n\t}",
"function isFile($path);",
"function isFile($file=null)\r\n{\r\n\treturn (!empty($file) && file_exists($file) && is_file($file));\r\n}",
"public function isFile() {\n return $this->_is_file;\n }"
]
| [
"0.7078647",
"0.6710713",
"0.65079916",
"0.6504107",
"0.6496639",
"0.6496639",
"0.6495546",
"0.6495546",
"0.6495546",
"0.6430178",
"0.6393551",
"0.6342653",
"0.63175035",
"0.6314375",
"0.6312383",
"0.6227384",
"0.6155113",
"0.6151545",
"0.6126405",
"0.6057475",
"0.6018103",
"0.6011086",
"0.60058045",
"0.6003585",
"0.59766454",
"0.59612566",
"0.59296906",
"0.5911201",
"0.59051394",
"0.58923846"
]
| 0.70284545 | 1 |
Checks if a file is a Ogg/Theora file | private function _isOggTheora($fileName, $mime)
{
if ($mime == self::MIME_CONTENT_TYPE_OGG
&& strpos($this->_getFileType($fileName), 'Theora video') !== false)
{
$this->_detectedMime = "video/ogg-theora";
return true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isFile();",
"function isFile() {\n\t\treturn $this->repoObj->lobSubType == 'document';\n\t}",
"public function is_file($file);",
"public function isFile() : bool;",
"public function isFile(): bool;",
"function check_upload($file) {\n if (preg_match(\":^application/vnd.bdoc-:\", $file[\"type\"])) {\n $file[\"format\"] = \"bdoc\";\n } else if ($file[\"type\"] === \"application/x-ddoc\") {\n $file[\"format\"] = \"ddoc\";\n } else {\n return FALSE;\n }\n\n return is_uploaded_file($file[\"tmp_name\"]);\n}",
"private function isGoogleDocFile($file) {\n\t\treturn $this->getGoogleDocExtension($file->getMimeType()) !== '';\n\t}",
"public function is_file($file)\n {\n }",
"public function is_file($file)\n {\n }",
"public function is_file($file)\n {\n }",
"public function is_file($file)\n {\n }",
"public function is_file($file)\n {\n }",
"function accouk_is_valid_text_file($path) {\n\n // Use finfo to detect mime type\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $mime = finfo_file($finfo, $path);\n finfo_close($finfo);\n if($mime !== \"text/plain\") return false;\n\n // Check file extension\n $filename_length = strlen($path);\n if(substr($path, $filename_length-4, $filename_length) !== \".txt\") return false;\n\n return true;\n}",
"public static function isFile($file) { \n $file = strval(str_replace(\"\\0\", \"\", $file)); return is_file($file); \n }",
"public function isFile()\n {\n return ( $this->fileStructure->type == self::IS_FILE );\n }",
"function isFile($file=null)\r\n{\r\n\treturn (!empty($file) && file_exists($file) && is_file($file));\r\n}",
"protected function isFile() {}",
"function gz_is_file($filename)\r\n{\r\n $ret = is_file(\"$filename.gz\") || is_file($filename);\r\n return $ret;\r\n}",
"public function isFile($file)\r\n\t{\r\n\t\treturn is_file($file);\r\n\t}",
"public static function isFile($_file)\r\n {\r\n return is_file($_file);\r\n }",
"public function isFile(): bool {\n\t\t$isFile = (bool) pathinfo($this->getPath(), PATHINFO_EXTENSION);\n\t\t$originalUriHasSlash = substr($this->originalUri, - 1) === '/';\n\n\t\treturn $isFile && ! $originalUriHasSlash;\n\t}",
"public static function isFile($file)\n\t{\n\t\treturn is_file($file);\n\t}",
"function isFile($path);",
"function fileChecker($nome_file){\n \n // controllo che sia stato inviato un file altrimenti restituisco false\n if(empty($_FILES['file'])){\n return false;\n }\n \n // memorizzo l'estensione\n $ext = trim(strtolower(end($nome_file)));\n \n // verifico che sia stato inviato un file contente un foto i formati disponibili sono jpg png jpeg\n if(!preg_match(VALID_FILE_FORMAT, $ext)){\n return false;\n }\n \n return true;\n}",
"public function extens(){\n $this->typefl = pathinfo($this->filename, PATHINFO_EXTENSION);\n\n if(!in_array($this->typefl, $this->type)){\n echo \"Wrong extension!!!\";\n return false;\n }\n else{\n return true;\n }\n }",
"private function checkSupportedFile($file_type) {\n return true;\n\n\n }",
"function file_tester($file){\n if (htmlentities($file['filename']['type']) == 'text/plain')\n return true;\n else {\n echo \"Please submit correct file type (.txt)\";\n return false;\n }\n}",
"public function checkFile($filename){\n $ext = substr($filename, strrpos($filename, '.') + 1);\n if($ext==\"jpg\"||$ext==\"png\"||$ext==\"svg\"||$ext==\"jpeg\"){\n return true;\n }else{\n return false;\n }\n }",
"function fileExtension($nameFile) {\n\t$format = substr($nameFile, -4);\n\treturn ($format == \".pat\");\n}",
"public function checkIsFile($path);"
]
| [
"0.68947136",
"0.6813303",
"0.67338127",
"0.6572073",
"0.65385395",
"0.6507109",
"0.6480352",
"0.6453699",
"0.6453699",
"0.6452405",
"0.6452405",
"0.6452405",
"0.6435394",
"0.6430347",
"0.64270574",
"0.64123565",
"0.63797295",
"0.63490844",
"0.634338",
"0.62971544",
"0.62966436",
"0.62694424",
"0.6257215",
"0.6221923",
"0.61987555",
"0.61811227",
"0.6158157",
"0.6152928",
"0.61068195",
"0.6093498"
]
| 0.70400596 | 0 |
Checks if a file is a WMV file. | private function _isWmv($fileName)
{
if ($this->_isWmx($fileName, 'wmv'))
{
$this->_detectedMime = " audio/x-ms-wmv";
return;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _isWmx($fileName, $type)\n {\n return strpos($this->_getFileType($fileName), 'Microsoft ASF') !== false\n && strcasecmp($this->_getFileSuffix(), $type) == 0;\n }",
"private function _isWma($fileName)\n {\n if ($this->_isWmx($fileName, 'wma'))\n {\n $this->_detectedMime = \"audio/x-ms-wma\";\n return true;\n }\n }",
"public function checkFileType($fileType){\n \t\tif ($fileType == \"application/octet-stream\"){\n \t\t\treturn true;\n \t\t}else{\n \t\t\treturn false;\n \t\t}\n \t}",
"private function is_file_ok($file) {\n\t\tif (!file_exists($file)) {\n\t\t\tthrow new \\Exception('Video worker: File not exist! ('.$file.')', 0);\n\t\t\treturn false;\n\t\t}\n\t\tif (!is_file($file)) {\n\t\t\tthrow new \\Exception('Video worker: This is not a file! ('.$file.')', 0);\n\t\t\treturn false;\n\t\t}\n\t\tif (!is_readable($file)) {\n\t\t\tthrow new \\Exception('Video worker: This file is not readable! ('.$file.')', 0);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"private function isFileValid(): bool\n {\n return FileHelper::isExpectedExtensions($this->getPath(), $this->getFileExtensions());\n }",
"public static function isFile($file) { \n $file = strval(str_replace(\"\\0\", \"\", $file)); return is_file($file); \n }",
"public static function detect($file)\n {\n if ($file instanceof File) {\n $file = $file->getPath();\n }\n if (file_exists($file) && is_file($file)) {\n return mime_content_type($file);\n }\n\n return false;\n }",
"public function isFile();",
"protected function checkType($file) {\n if (in_array($file['type'], $this->_permitted)) {\n return true;\n } else {\n if (!empty($file['type'])) {\n $this->_messages[] = '4' . $file['name'] . ' is not a permitted file type.';\n }\n return false;\n }\n }",
"public function isFile()\n {\n return ( $this->fileStructure->type == self::IS_FILE );\n }",
"function isFile() {\n\t\treturn $this->repoObj->lobSubType == 'document';\n\t}",
"public function isFile() : bool;",
"private function isValidImageType(string $file)\r\n {\r\n return in_array(pathinfo($file, PATHINFO_EXTENSION), $this->supported);\r\n }",
"public static function isFile($_file)\r\n {\r\n return is_file($_file);\r\n }",
"function check_upload($file) {\n if (preg_match(\":^application/vnd.bdoc-:\", $file[\"type\"])) {\n $file[\"format\"] = \"bdoc\";\n } else if ($file[\"type\"] === \"application/x-ddoc\") {\n $file[\"format\"] = \"ddoc\";\n } else {\n return FALSE;\n }\n\n return is_uploaded_file($file[\"tmp_name\"]);\n}",
"public function canProcess(File $file): bool\n {\n $fileExtension = strtolower($file->getProperty('extension'));\n return in_array($fileExtension, $this->supportedFileExtensions);\n }",
"public function is_file($file);",
"private function checkSupportedFile($file_type) {\n return true;\n\n\n }",
"public function isFile(): bool;",
"public function checkExtensions()\r\n\t{\r\n\t\treturn (strcasecmp(pathinfo($this->targetFile, PATHINFO_EXTENSION), pathinfo($this->referenceFile, PATHINFO_EXTENSION)) === 0);\r\n\t}",
"private function checkUploadFileMIME($file)\n {\n $flag = 0;\n $file_array = explode(\".\", $file [\"name\"]);\n $file_extension = strtolower(array_pop($file_array));\n\n // 2.through the binary content to detect the file\n switch ($file_extension) {\n case \"xls\" :\n // 2003 excel\n $fh = fopen($file [\"tmp_name\"], \"rb\");\n $bin = fread($fh, 8);\n fclose($fh);\n $strinfo = @unpack(\"C8chars\", $bin);\n $typecode = \"\";\n foreach ($strinfo as $num) {\n $typecode .= dechex($num);\n }\n if ($typecode == \"d0cf11e0a1b11ae1\") {\n $flag = 1;\n }\n break;\n case \"xlsx\" :\n // 2007 excel\n $fh = fopen($file [\"tmp_name\"], \"rb\");\n $bin = fread($fh, 4);\n fclose($fh);\n $strinfo = @unpack(\"C4chars\", $bin);\n $typecode = \"\";\n foreach ($strinfo as $num) {\n $typecode .= dechex($num);\n }\n echo $typecode . 'test';\n if ($typecode == \"504b34\") {\n $flag = 1;\n }\n break;\n }\n // 3.return the flag\n return $flag;\n }",
"function check_file_type($source)\n{\n $file_info = check_mime_type($source);\n\n switch ($file_info) {\n case 'application/pdf':\n return true;\n break;\n\n case 'application/msword':\n return true;\n break;\n\n case 'application/rtf':\n return true;\n break;\n case 'application/vnd.ms-excel':\n return true;\n break;\n\n case 'application/vnd.ms-powerpoint':\n return true;\n break;\n\n case 'application/vnd.oasis.opendocument.text':\n return true;\n break;\n\n case 'application/vnd.oasis.opendocument.spreadsheet':\n return true;\n break;\n \n case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':\n return true;\n break;\n\n case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':\n return true;\n break;\n \n case 'image/gif':\n return true;\n break;\n\n case 'image/jpeg':\n return true;\n break;\n\n case 'image/png':\n return true;\n break;\n\n case 'image/wbmp':\n return true;\n break;\n\n default:\n return false;\n break;\n }\n}",
"protected function isFile() {}",
"public function isFile($file)\r\n\t{\r\n\t\treturn is_file($file);\r\n\t}",
"function verifyUpload( $file ){\n $passed = false; //\tVariável de controle\n if( is_uploaded_file( $file[ \"tmp_name\" ] ) ){\n $ext = $this->getExt( $file[ \"name\" ] );\n if( ( count( $this->allowedExtensions ) == 0 ) || ( in_array( $ext, $this->allowedExtensions ) ) ){\n $passed = true;\n }\n }\n return $passed;\n }",
"public function is_file($file)\n {\n }",
"public function is_file($file)\n {\n }",
"public function is_file($file)\n {\n }",
"public function is_file($file)\n {\n }",
"public function is_file($file)\n {\n }"
]
| [
"0.6760817",
"0.641697",
"0.6143109",
"0.60762745",
"0.59956425",
"0.59712064",
"0.5945115",
"0.58920515",
"0.5795296",
"0.57814187",
"0.5765982",
"0.5747238",
"0.57104903",
"0.57011664",
"0.56970143",
"0.56900626",
"0.56774074",
"0.56698185",
"0.56629246",
"0.5660778",
"0.5656704",
"0.5610662",
"0.55798477",
"0.55767953",
"0.5567683",
"0.55612135",
"0.55612135",
"0.5560641",
"0.5560641",
"0.5560641"
]
| 0.7274902 | 0 |
Checks if a file is a WMA file. | private function _isWma($fileName)
{
if ($this->_isWmx($fileName, 'wma'))
{
$this->_detectedMime = "audio/x-ms-wma";
return true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _isWmx($fileName, $type)\n {\n return strpos($this->_getFileType($fileName), 'Microsoft ASF') !== false\n && strcasecmp($this->_getFileSuffix(), $type) == 0;\n }",
"public static function is_wma( $filename = null, $signature = null ) {\r\n\t\t\treturn self::is_wma( $filename, $signature );\r\n\t\t}",
"private function _isWmv($fileName)\n {\n if ($this->_isWmx($fileName, 'wmv'))\n {\n $this->_detectedMime = \"\taudio/x-ms-wmv\";\n return;\n }\n }",
"function check_file_is_audio( $tmp ) \n{\n $allowed = array(\n 'audio/mpeg', 'audio/x-mpeg', 'audio/mpeg3', 'audio/x-mpeg-3', 'audio/aiff', \n 'audio/mid', 'audio/x-aiff', 'audio/x-mpequrl','audio/midi', 'audio/x-mid', \n 'audio/x-midi','audio/wav','audio/x-wav','audio/xm','audio/x-aac','audio/basic',\n 'audio/flac','audio/mp4','audio/x-matroska','audio/ogg','audio/s3m','audio/x-ms-wax',\n 'audio/xm'\n );\n \n // check REAL MIME type\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $type = finfo_file($finfo, $tmp );\n finfo_close($finfo);\n \n // check to see if REAL MIME type is inside $allowed array\n if( in_array($type, $allowed) ) {\n return $type;\n } else {\n return false;\n }\n}",
"private function isFileValid(): bool\n {\n return FileHelper::isExpectedExtensions($this->getPath(), $this->getFileExtensions());\n }",
"private function is_file_ok($file) {\n\t\tif (!file_exists($file)) {\n\t\t\tthrow new \\Exception('Video worker: File not exist! ('.$file.')', 0);\n\t\t\treturn false;\n\t\t}\n\t\tif (!is_file($file)) {\n\t\t\tthrow new \\Exception('Video worker: This is not a file! ('.$file.')', 0);\n\t\t\treturn false;\n\t\t}\n\t\tif (!is_readable($file)) {\n\t\t\tthrow new \\Exception('Video worker: This file is not readable! ('.$file.')', 0);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"protected function checkType($file) {\n if (in_array($file['type'], $this->_permitted)) {\n return true;\n } else {\n if (!empty($file['type'])) {\n $this->_messages[] = '4' . $file['name'] . ' is not a permitted file type.';\n }\n return false;\n }\n }",
"protected function hasApplicableFontFile()\n {\n if (is_string($this->file)) {\n return file_exists($this->file);\n }\n\n return false;\n }",
"public static function isFile($file) { \n $file = strval(str_replace(\"\\0\", \"\", $file)); return is_file($file); \n }",
"public function isFile() : bool;",
"public function file($file): bool\n\t{\n if (is_array($file['error'])) {\n $error = (int)$file['error'][0];\n } else {\n $error = (int)$file['error'];\n }\n\n return $error !== 4;\n }",
"public function isFile()\n {\n return ( $this->fileStructure->type == self::IS_FILE );\n }",
"public function isFile();",
"public function supports(string $file): bool;",
"public function isMatriculationFNIWW(): bool\n {\n $pattern = '^(?!0)[0-9]{1,4}(?:\\s|-)?WW[A-HJ-NP-TV-Z]?(?:\\s|-)?(?!20)(?:97[1-6]|0[1-9]|[1-8][0-9]|9[0-5]|2[AB])$';\n\n return 1 === preg_match('/'.$pattern.'/i', $this->matriculation);\n }",
"private function validWBMP(string $data): bool\n {\n return ord($data[0]) === 0 && ord($data[1]) === 0 && $data !== substr(TypeJp2::JPEG_2000_SIGNATURE, 0, self::LONG_SIZE);\n }",
"public function isFile(): bool;",
"public static function validatePrint($file) {\n //$workingDir = dirname(__DIR__) . \"/../addons/upload/files/\";\n\n $executable = false;\n $desc = false;\n\n $fullFile = realpath($file);\n\n $zip = new \\ZipArchive();\n $res = $zip->open($fullFile);\n if($res === TRUE) {\n for ($i = 0; $i < $zip->numFiles; $i++) {\n $filename = $zip->getNameIndex($i);\n $filename = strtolower($filename);\n\n if($filename == \"server.cs\" || $filename == \"client.cs\") {\n $executable = true;\n }\n\n if($filename == \"description.txt\") {\n $desc = true;\n }\n }\n } else {\n return false;\n }\n\n return (!$executable && $desc);\n }",
"public function canProcess(File $file): bool\n {\n $fileExtension = strtolower($file->getProperty('extension'));\n return in_array($fileExtension, $this->supportedFileExtensions);\n }",
"function isAllowedFile($file) {\n\t\t$path = pathinfo($file);\n\t\t$dir = preg_replace('#[\\./]*(.*)/*#', '$1', $path['dirname']);\n\t\t$file = $path['basename'];\n\t\tif ($dir == '' && $file == '.htaccess') return true;\n\t\tif ($dir == '' && $file == 'index.php') return true;\n\t\tif ($dir == '' && $file == 'documentation.txt') return true;\n\t\tif ($dir == 'data' && $file == 'hypha.html') return true;\n\t\tif ($dir == 'data' && $file == 'hypha.css') return true;\n\t\tif ($dir == 'system/core') return true;\n\t\tif ($dir == 'system/datatypes') return true;\n\t\tif ($dir == 'system/languages') return true;\n\t\tif ($dir == 'system/php-dom-wrapper') return true;\n\t\tif ($dir == 'system/wymeditor') return true;\n\t\treturn false;\n\t}",
"public function checkFileType($fileType){\n \t\tif ($fileType == \"application/octet-stream\"){\n \t\t\treturn true;\n \t\t}else{\n \t\t\treturn false;\n \t\t}\n \t}",
"function accouk_is_valid_text_file($path) {\n\n // Use finfo to detect mime type\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $mime = finfo_file($finfo, $path);\n finfo_close($finfo);\n if($mime !== \"text/plain\") return false;\n\n // Check file extension\n $filename_length = strlen($path);\n if(substr($path, $filename_length-4, $filename_length) !== \".txt\") return false;\n\n return true;\n}",
"private function checkSupportedFile($file_type) {\n return true;\n\n\n }",
"private function checkUploadFileMIME($file)\n {\n $flag = 0;\n $file_array = explode(\".\", $file [\"name\"]);\n $file_extension = strtolower(array_pop($file_array));\n\n // 2.through the binary content to detect the file\n switch ($file_extension) {\n case \"xls\" :\n // 2003 excel\n $fh = fopen($file [\"tmp_name\"], \"rb\");\n $bin = fread($fh, 8);\n fclose($fh);\n $strinfo = @unpack(\"C8chars\", $bin);\n $typecode = \"\";\n foreach ($strinfo as $num) {\n $typecode .= dechex($num);\n }\n if ($typecode == \"d0cf11e0a1b11ae1\") {\n $flag = 1;\n }\n break;\n case \"xlsx\" :\n // 2007 excel\n $fh = fopen($file [\"tmp_name\"], \"rb\");\n $bin = fread($fh, 4);\n fclose($fh);\n $strinfo = @unpack(\"C4chars\", $bin);\n $typecode = \"\";\n foreach ($strinfo as $num) {\n $typecode .= dechex($num);\n }\n echo $typecode . 'test';\n if ($typecode == \"504b34\") {\n $flag = 1;\n }\n break;\n }\n // 3.return the flag\n return $flag;\n }",
"function isTextFile($fileName = '')\n{\n $finfo = new finfo(FILEINFO_MIME_TYPE);\n $mime = $finfo->file($fileName);\n return 0 === strncmp($mime, 'text', 4);\n}",
"protected static function fileIsValid(string $file): bool\r\n {\r\n return is_file($file) && is_writable($file);\r\n }",
"public function hasFile(string $name): bool {}",
"public function is_file($file);",
"public static function isFile($_file)\r\n {\r\n return is_file($_file);\r\n }",
"public function isAllowedMIMEType()\n {\n if (!empty($this->allowed_upload_mime_type)) {\n if (!is_array($this->allowed_upload_mime_type)) {\n NUCLEUS_Exceptions::catcher(MIME_TYPE_LIST_ERROR);\n return false;\n }\n else {\n if (!in_array($this->_file_info['type'], $this->allowed_upload_mime_type)) {\n NUCLEUS_Exceptions::catcher(UPLOAD_MIME_TYPE_DENIED);\n return false;\n }\n }\n }\n\n return true;\n }"
]
| [
"0.7300719",
"0.699845",
"0.66643155",
"0.61192554",
"0.59084654",
"0.58887625",
"0.5855663",
"0.58147043",
"0.5737235",
"0.57012033",
"0.5700837",
"0.569391",
"0.5690614",
"0.56878006",
"0.56785303",
"0.5673167",
"0.5660464",
"0.5638226",
"0.55853546",
"0.55846727",
"0.5584255",
"0.558137",
"0.5569701",
"0.55623597",
"0.55620354",
"0.5544206",
"0.5499435",
"0.5470798",
"0.5466559",
"0.54600716"
]
| 0.7946108 | 0 |
$mesg= "_getFileType=".$this>_getFileType($fileName)." strpos_result=". strpos($this>_getFileType($fileName), 'MIDI'); | private function _isMidi($fileName)
{
//sfLoader::loadHelpers(array("Debug")); log_message($mesg);
if (strpos($this->_getFileType($fileName), 'Standard MIDI data') !== false)
{
$this->_detectedMime = "audio/midi";
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function typeoffile($file){ //list( $mutes, $date, $type, $ext) = explode( '.', $file );\n $type= explode( '.', $file )[2];\n return $type;\n}",
"private function _getFileType($fileName)\n {\n $safeFileName = escapeshellarg($fileName);\n return trim(exec(\"file -b $safeFileName\"));\n\n//return $this->getFileType2($fileName);\n }",
"function find_file( $ServerID, $AsteriskID, $QMUserID, $QMUserName ) {\n\tglobal $FILE_FOUND;\n\tglobal $FILE_LISTEN_URL;\n\tglobal $FILE_LENGTH;\n\tglobal $FILE_ENCODING;\n\tglobal $FILE_DURATION;\n\n\t$FILE_FOUND = true;\n\n\t// if found single file...\n\t// note that the parameters returned are just strings, so you can put anything in them\n\t$FILE_LISTEN_URL = \"http://listennow.server/$ServerID/$AsteriskID/$QMUserID/$QMUserName\";\n\t$FILE_LENGTH = \"125k\";\n\t$FILE_ENCODING = \"mp3\";\t\n\t$FILE_DURATION = \"1:12\"; \t\n\n\t// if found multiple files\n\t// add MULTI: to FILE_LISTEN_URL\n\t// separate entries with a space\n\t// add the same number of entries for each record\n\t//$FILE_LISTEN_URL = \"MULTI:http://listennow.server/$ServerID/$AsteriskID/$QMUserID/$QMUserName http://file2 http://file3\";\n\t//$FILE_LENGTH = \"125000 100 200\";\n\t//$FILE_ENCODING = \"mp3 - -\";\t\n\t//$FILE_DURATION = \"1:12 1:10 -\"; \t\n\n}",
"public function testFind() {\n\t\t$this->assertEquals('3.txt', $this->_object->find()->getFilename());\n\t}",
"private function fileTest($file) {\n $test_result = strripos($file, USER_FILE_EXT);\n return $test_result;\n }",
"abstract protected function _getFileName();",
"public function get_position()\n {\n\n if ( $file = fopen($this->path,\"r\") ) {\n\n $string_number = 0;\n $position = 0;\n while(($line = fgets($file,4096)) !== false && !$position) {\n\n $string_number++;\n if(strpos($line,$this->str) !== false) {\n\n $position = strpos($line,$this->str);\n }\n }\n echo 'номер строки: ' . $string_number . ', позиция: ' . ($position+1);\n\n } else {\n\n echo 'ничего не вышло';\n\n }\n\n }",
"function ft_hook_filename($file) {}",
"public function tell(): int;",
"public function hasFileName(){\n return $this->_has(3);\n }",
"function get_file_description($file)\n {\n }",
"function trace()\n\t{$trace=debug_backtrace();\n\tforeach($trace as $t)\n\t{\n\t\tif (in_array($t['function'], \n\t\t\t\t\t array('include', 'include_once', 'require', 'require_once')))\n\t\t{\n\t\t\t$file_path=$t['file'];//gesamter Pfad inkl. Filename und Extention.\n\t\t\t\n\t\t\t//Filenamen\n\t\t\t$parts = pathinfo($file_path);//Vorbereitung\n\t\t\t$filename = $parts['basename'];//Filename incl. extention.\n\t\t\t$filetype = $parts['extension'];//Nur die extention.\n\t\t\t$path_only = $parts['dirname'];//Nur der Pfad.\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn ($filename);\n}",
"function debugMP($type,$hdr,$msg='') {\n\t\tglobal $slplus_plugin;\n\t\tif (!is_object($slplus_plugin)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (($type === 'msg') && ($msg!=='')) {\n\t\t\t$msg = esc_html($msg);\n\t\t}\n\t\tif (($hdr!=='')) {\n\t\t\t$hdr = 'GFM: ' . $hdr;\n\t\t}\n\t\t$slplus_plugin->AddOns->instances[SLP_GFL_FREE_SLUG]->debugMP($type,$hdr,$msg,NULL,NULL,true);\n\t}",
"function system_guess_mime($filename)\n{\n $mime_map = system_mime_map();\n $ext = pathinfo($filename,PATHINFO_EXTENSION);\n return array_search($ext,$mime_map);\n}",
"function findexts($filename) { \n$filename \t= strtolower($filename) ; \n$exts \t\t= split(\"[/\\\\.]\", $filename) ; \n$n \t\t\t= count($exts)-1; \n$exts \t\t= $exts[$n]; \nreturn $exts; \n}",
"function check_files($this_file)\n{\n// if you want to search for other strings replace base64_decode with the string you want to search for.\n \n $str_to_find=$_POST['val']; // the string(code/text) to search for \n \n if(!($content = file_get_contents($this_file))) { echo(\"<p>Could not check $this_file</p>\\n\"); }\n else { if(stristr($content, $str_to_find)) { echo(\"<p>$this_file -> contains $str_to_find</p> <p><a href='\".substr($this_file,1).\"' target='_blank'>Open File</a></p>\\n\"); }}\n\t\n unset($content); \n}",
"static function chkFileExtension($str='') {\n $match= preg_match('/.swf/i', $str);\n if($match>0){\n return \"yes\";\n }else{\n return \"no\";\n }\n }",
"function privCalculateStoredFilename(&$p_filedescr, &$p_options)\n {\n }",
"function strposa( $haystack, $needles = array( ), $offset = 0 ) {\n$chr = array( );\nforeach ( $needles as $needle )\n {\n $res = strpos( $haystack, $needle, $offset );\n if ( $res !== false )\n return $needle;\n }\nreturn 'no';\n}",
"function ms_file_constants()\n {\n }",
"function get_name_value($fname) {\n global $pagina_resumen; // Uso el keyword global para poder acceder a la variable global $pagina_resumen\n $pos_name = strpos($pagina_resumen,$fname); //Ubico donde esta el nombre \n echo $pos_name;\n\t\t$pos_value = strpos($pagina_resumen,\"value\",$pos_name); //Ubibo la posicion de la palabra valor asociado al nombre\n\t\techo $pos_value;\n\t\t$comilla = chr(34);//The chr() function returns a character from the specified ASCII value.\n\t\t$pos_value_comilla_1 = strpos($pagina_resumen,$comilla,$pos_value);\n\t\techo $pos_value_comilla_1;\n\t\t$pos_value_comilla_2 = strpos($pagina_resumen,$comilla,$pos_value_comilla_1+1);\n\t\techo $pos_value_comilla_2;\n\t\t$pos_value_dif_comilla = $pos_value_comilla_2-$pos_value_comilla_1 ;\n\t\techo $pos_value_dif_comilla;\n\t\t$pos_valor = substr($pagina_resumen, $pos_value_comilla_1+1,$pos_value_dif_comilla-1);\n\t echo $pos_valor;\n }",
"function getStatus($type = \"playback\"){\n\t\tglobal $jbArr;\n\t\t\n\t\treturn \"\";\n\t}",
"function findexts ($filename) {\r\n\t \t$filename=strtolower($filename);\r\n\t \t$exts=split(\"[/\\\\.]\", $filename);\r\n\t \t$n=count($exts)-1;\r\n\t \t$exts=$exts[$n];\r\n\t \treturn $exts;\r\n\t }",
"function findKeyword() {\n \n }",
"function get_file_info($namafile) {\n $tmp = explode(\".\",$namafile);\n $nama = $tmp[0];\n $tipe = strtolower(end($tmp));\n $info = array(\n \"file_name\" => $nama,\n \"file_type\" => $tipe\n );\n return $info;\n }",
"public function sound_mp3()\n\t{\n\t\tif (preg_match('/.+[-_\\s]{0,3}[\\(\\[]\\d+\\/\\d+[\\)\\]][-_\\s]{0,3}\"(.+)' . $this->e0 .\n\t\t\t\t\t '[ _-]{0,3}\\d+[.,]\\d+ [kKmMgG][bB][ _-]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //\"Terraplane Sun - Funnel of Love.mp3\" - 21.55 MB - (1/6) - yEnc\n\t\tif (preg_match('/^\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t '[ _-]{0,3}\\d+[.,]\\d+ [kKmMgG][bB][ _-]{0,3}\\(\\d+\\/(\\d+\\))[ _-]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //trtk09920 - [01/12] - \"Guido Negraszus - Night Cafe Iii (Freedom Travellers) (2012)(320).par2\" yEnc\n\t\tif (preg_match('/^trtk\\d+[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(????) [001/153] - \"C4 House Party Horse Meat Disco Set 6.nfo\" C4 House Party Horse Meat Disco Set 6 yEnc\n\t\tif (preg_match('/^\\(\\?+\\) \\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . '.+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(????) [19/22] - C.K.N. Demo 85 \"19-rotten system.mp3\" yEnc\n\t\tif (preg_match('/^\\(\\?+\\) \\[\\d+\\/\\d+\\] - (.+)[-_\\s]{0,3}\".+?' . $this->e0 . '.+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(LUNATIC SOUL - IMPRESSIONS) [00/18] - \"Lunatic Soul - Impressions 2011.nzb\" yEnc\n\t\tif (preg_match('/^\\(.+\\)[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[1/8] - \"Black Market Flowers - Bind (1993).sfv\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//[1/1] - (150 MP3 Album Charts) - \"Atlantean Kodex - The White Goddess.rar\" yEnc\n\t\t//[1/1] - (MP3 Album Charts) - \"Black Sabbath - 13.rar\" yEnc\n\t\t//[1/1] - (Top100 Album Charts) - \"Bastille - Pompeii.rar\" yEnc\n\t\t//[1/1] - (Top100 Charts) - \"Beatrice Egli - Gluecksgefuehle.rar\" yEnc\n\t\t//[1/1] - (Top100 Single Charts) - \"Alicia Keys - Girl On Fire.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}\\(((Top)?\\d+ )?(MP3 )?((Album|Single) )?Charts\\)[ -]{0,4}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[6];\n\t\t} //[1/1] - (Album Top 100) - \"[Dance] David Guetta - One Love (2010) .rar\" yEnc\n\t\t//[1/1] - (Album Top 100) - \"Aerosmith - Music From Another Dimension.rar\" yEnc\n\t\t//[1/1] - Album Top 100 - \"ACDC - Live At River Plate.rar\" yEnc\n\t\t//[1/1] (Album Top 100 - 2012) - \"Alicia Keys - Girl On Fire.rar\" yEnc\n\t\t//[1/1] (Album Top 100 2012) - \"Asaf Avidan And The Mojos - One Day.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}(\\()?(Album|Single) Top \\d+ ([- ]{0,2}\\d+)?(\\))? - \"(\\[.+?\\] )?(.+?)' .\n\t\t\t\t\t $this->e0 . ' {1,4}yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[6];\n\t\t} //[1/1] - Top 100 Album Charts 2012 - \"Aura Dione feat. Rock Mafia - Friends.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}Top \\d+ Album Charts \\d+[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' {1,4}yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //<>usenet-piraten.info<>partner<>ssl-news.info<> - [10/10] - \"Overexposed (Deluxe Version).vol31+23.par2\" yEnc\n\t\tif (preg_match('/^.+usenet-piraten\\.info.+ - \\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(1/1) \"Adam Levine (Maroon 5) & Alicia Keys - Daylight & Girl on fire LIVE 55TH GRAMMY AWARDS 320Kpbs.mp3\" yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(1/4) - VERBAteam present - \"Avril Lavigne - Rock 'N Roll (Official Audio).mp3\" - 5,80 MB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) - VERBAteam present - \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[1/1] - (Album Top 1000) - \"Davis, Miles - Complete Live at the Plugged Nickel 1965.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}\\(Album Top \\d+\\)[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[1/1] - Album Top 100 - \"Rammstein - Made In Germany 1995-2011.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}Album Top \\d+[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Andrea Berg - My Danish Collection (2013) by dem verrückten Lordi (14/27) \"Andrea Berg - My Danish Collection (2013).par2\" - 132,74 MB 150920134 yEnc\n\t\t//Der Deutsche Beat Mix Teil 2 auf wunsch (by dem verrückten Lordi) (2/9) \"Der Deutsche Beat Mix Teil 3 Back.jpg\" - 117,84 MB 13.11.05 yEnc\n\t\tif (preg_match('/^(.+?) (\\()?by dem verrückten Lordi(\\))? {1,2}\\(\\d+\\/\\d+\\) \".+?' .\n\t\t\t\t\t $this->e0 . '[-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB].+yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Christian Anders - Tief in dir (15/24) \"Christian Anders - Tief In Dir Back.jpg\" - 58,56 MB by dem verrückten Lordi 0703123 yEnc\n\t\tif (preg_match('/^(.+?) \\(\\d+\\/\\d+\\) \".+?' . $this->e0 .\n\t\t\t\t\t '[-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB] {1,2}by dem verrückten Lordi.+yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Der etwas andere Mix - Wilde Herzenmix (auf wunsch) neu (by dem verrückten Lordi) (1/8) \"Der etwas andere Mix - Wilde Herzenmix.par2\" yEnc\n\t\tif (preg_match('/^Der etwas.+ - (.+) \\(\\d+\\/\\d+\\) \".+?' . $this->e0 . '.+yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Full Discography - The Cranberries (01/47) \"Full Discography - The Cranberries.par2\" - 3,52 GB 2812111 yEnc\n\t\tif (preg_match('/^(.+?) \\(\\d+\\/\\d+\\) \".+?' . $this->e0 .\n\t\t\t\t\t '[-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB] {1,2}\\d+ yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //jean ferrat année 1967 à 1969 meil29 \"17 Rien à voir.mp3\" yEnc\n\t\tif (preg_match('/^(.+?) meil29 \".+?' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //Selected Songs by Various Artists - Depeche Mode - Personal Jesus (Acoustic Version).mp3 yEnc\n\t\tif (preg_match('/^Selected Songs by Various Artists - (.+?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4}) yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}",
"function varDeclarationConvert()\n {\n // $strposdolar = strpos();\n }",
"function has_hq($vdetails,$is_file=false)\r\n{\r\n if(!$is_file)\r\n $file = get_hq_video_file($vdetails);\r\n else\r\n $file = $vdetails;\r\n\r\n if(getext($file)=='mp4')\r\n return $file;\r\n else\r\n return false;\r\n}",
"function _testFFmpeg() {\r\n \tglobal $output, $status;\r\n @exec('ffmpeg -h', $output, $status);\r\n if (!empty($output[0])) {\r\n if (preg_match(\"/ffmpeg.*(\\.[0-9])/i\",$output[0],$matches)) {\r\n return $matches[0];\r\n }\r\n }\r\n unset($output, $status);\r\n }",
"function seachString($name,$str)\n\t{\n\t\t$result='';\n\t\t$result = strpos($name,$str);\n\t\tif ($result != '') {\n\t\t\techo \"True\";\n\t\t}\n\t\telse{\n\t\t\techo\"Flase\";\n\t\t}\n\n\t}"
]
| [
"0.5611674",
"0.53372055",
"0.53366554",
"0.5276791",
"0.5246804",
"0.52198726",
"0.52158225",
"0.52117425",
"0.5188782",
"0.512096",
"0.50234836",
"0.4977696",
"0.49749538",
"0.49454302",
"0.49435905",
"0.49429077",
"0.4939081",
"0.49383676",
"0.4924258",
"0.49207976",
"0.49054208",
"0.48960724",
"0.4895015",
"0.48939168",
"0.48859408",
"0.48826072",
"0.4873575",
"0.48684606",
"0.48608318",
"0.48598424"
]
| 0.62880254 | 0 |
Checks if a file is a WMA or WMV file. Helper for _isWmv() and _isWma(). | private function _isWmx($fileName, $type)
{
return strpos($this->_getFileType($fileName), 'Microsoft ASF') !== false
&& strcasecmp($this->_getFileSuffix(), $type) == 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _isWmv($fileName)\n {\n if ($this->_isWmx($fileName, 'wmv'))\n {\n $this->_detectedMime = \"\taudio/x-ms-wmv\";\n return;\n }\n }",
"private function _isWma($fileName)\n {\n if ($this->_isWmx($fileName, 'wma'))\n {\n $this->_detectedMime = \"audio/x-ms-wma\";\n return true;\n }\n }",
"public static function is_wma( $filename = null, $signature = null ) {\r\n\t\t\treturn self::is_wma( $filename, $signature );\r\n\t\t}",
"private function isFileValid(): bool\n {\n return FileHelper::isExpectedExtensions($this->getPath(), $this->getFileExtensions());\n }",
"private function checkSupportedFile($file_type) {\n return true;\n\n\n }",
"public function checkExtensions()\r\n\t{\r\n\t\treturn (strcasecmp(pathinfo($this->targetFile, PATHINFO_EXTENSION), pathinfo($this->referenceFile, PATHINFO_EXTENSION)) === 0);\r\n\t}",
"public function canProcess(File $file): bool\n {\n $fileExtension = strtolower($file->getProperty('extension'));\n return in_array($fileExtension, $this->supportedFileExtensions);\n }",
"public static function isFile($file) { \n $file = strval(str_replace(\"\\0\", \"\", $file)); return is_file($file); \n }",
"protected function isAllowedFile($file)\n {\n $extension = strtolower(pathinfo($file, PATHINFO_EXTENSION));\n if ($extension == $file) {\n return false;\n }\n if (!in_array($extension, $this->allowedExtensions[$this->currentType])\n && !in_array('*', $this->allowedExtensions[$this->currentType])\n ) {\n return false;\n }\n return true;\n }",
"function isAllowedFile($file) {\n\t\t$path = pathinfo($file);\n\t\t$dir = preg_replace('#[\\./]*(.*)/*#', '$1', $path['dirname']);\n\t\t$file = $path['basename'];\n\t\tif ($dir == '' && $file == '.htaccess') return true;\n\t\tif ($dir == '' && $file == 'index.php') return true;\n\t\tif ($dir == '' && $file == 'documentation.txt') return true;\n\t\tif ($dir == 'data' && $file == 'hypha.html') return true;\n\t\tif ($dir == 'data' && $file == 'hypha.css') return true;\n\t\tif ($dir == 'system/core') return true;\n\t\tif ($dir == 'system/datatypes') return true;\n\t\tif ($dir == 'system/languages') return true;\n\t\tif ($dir == 'system/php-dom-wrapper') return true;\n\t\tif ($dir == 'system/wymeditor') return true;\n\t\treturn false;\n\t}",
"public static function isWindows()\n {\n return substr(strtolower(PHP_OS), 0, 3) == 'win';\n }",
"public function isFile();",
"public function checkFileType($fileType){\n \t\tif ($fileType == \"application/octet-stream\"){\n \t\t\treturn true;\n \t\t}else{\n \t\t\treturn false;\n \t\t}\n \t}",
"function check_file_type($source)\n{\n $file_info = check_mime_type($source);\n\n switch ($file_info) {\n case 'application/pdf':\n return true;\n break;\n\n case 'application/msword':\n return true;\n break;\n\n case 'application/rtf':\n return true;\n break;\n case 'application/vnd.ms-excel':\n return true;\n break;\n\n case 'application/vnd.ms-powerpoint':\n return true;\n break;\n\n case 'application/vnd.oasis.opendocument.text':\n return true;\n break;\n\n case 'application/vnd.oasis.opendocument.spreadsheet':\n return true;\n break;\n \n case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':\n return true;\n break;\n\n case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':\n return true;\n break;\n \n case 'image/gif':\n return true;\n break;\n\n case 'image/jpeg':\n return true;\n break;\n\n case 'image/png':\n return true;\n break;\n\n case 'image/wbmp':\n return true;\n break;\n\n default:\n return false;\n break;\n }\n}",
"public function isFile()\n {\n return ( $this->fileStructure->type == self::IS_FILE );\n }",
"private function is_file_ok($file) {\n\t\tif (!file_exists($file)) {\n\t\t\tthrow new \\Exception('Video worker: File not exist! ('.$file.')', 0);\n\t\t\treturn false;\n\t\t}\n\t\tif (!is_file($file)) {\n\t\t\tthrow new \\Exception('Video worker: This is not a file! ('.$file.')', 0);\n\t\t\treturn false;\n\t\t}\n\t\tif (!is_readable($file)) {\n\t\t\tthrow new \\Exception('Video worker: This file is not readable! ('.$file.')', 0);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"protected function checkType($file) {\n if (in_array($file['type'], $this->_permitted)) {\n return true;\n } else {\n if (!empty($file['type'])) {\n $this->_messages[] = '4' . $file['name'] . ' is not a permitted file type.';\n }\n return false;\n }\n }",
"public function isWindows()\n {\n return strtoupper(substr(PHP_OS, 0, 3)) == 'WIN';\n }",
"function check_file_is_audio( $tmp ) \n{\n $allowed = array(\n 'audio/mpeg', 'audio/x-mpeg', 'audio/mpeg3', 'audio/x-mpeg-3', 'audio/aiff', \n 'audio/mid', 'audio/x-aiff', 'audio/x-mpequrl','audio/midi', 'audio/x-mid', \n 'audio/x-midi','audio/wav','audio/x-wav','audio/xm','audio/x-aac','audio/basic',\n 'audio/flac','audio/mp4','audio/x-matroska','audio/ogg','audio/s3m','audio/x-ms-wax',\n 'audio/xm'\n );\n \n // check REAL MIME type\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $type = finfo_file($finfo, $tmp );\n finfo_close($finfo);\n \n // check to see if REAL MIME type is inside $allowed array\n if( in_array($type, $allowed) ) {\n return $type;\n } else {\n return false;\n }\n}",
"public static function isFile($_file)\r\n {\r\n return is_file($_file);\r\n }",
"public function supports(string $file): bool;",
"public function isFile() : bool;",
"private static function checkOsIsWindows(){\n if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\n //windows\n return true;\n }\n\n //probably linux\n return false;\n }",
"function isFile($file=null)\r\n{\r\n\treturn (!empty($file) && file_exists($file) && is_file($file));\r\n}",
"private static function isWindows()\n {\n return strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';\n }",
"public function checkMimeType()\n {\n if (empty($this->mediaRealType) && empty($this->allowUnknownTypes)) {\n $this->setErrors(\\XoopsLocale::E_FILE_TYPE_REJECTED);\n return false;\n }\n\n if ((!empty($this->allowedMimeTypes)\n && !in_array($this->mediaRealType, $this->allowedMimeTypes))\n || (!empty($this->deniedMimeTypes)\n && in_array($this->mediaRealType, $this->deniedMimeTypes))\n ) {\n $this->setErrors(sprintf(\\XoopsLocale::EF_FILE_MIME_TYPE_NOT_ALLOWED, $this->mediaType));\n return false;\n }\n return true;\n }",
"public static function isWindows() {\n $osType = strtoupper(PHP_OS);\n\n switch ($osType) {\n case 'WIN32':\n case 'WINNT':\n return true;\n default:\n return false;\n }\n }",
"public function extens(){\n $this->typefl = pathinfo($this->filename, PATHINFO_EXTENSION);\n\n if(!in_array($this->typefl, $this->type)){\n echo \"Wrong extension!!!\";\n return false;\n }\n else{\n return true;\n }\n }",
"function isWindows() {\n if (substr(PHP_OS,0,3) == \"WIN\") {\n return true;\n } else {\n return false;\n }\n }",
"public function isFile(): bool;"
]
| [
"0.7353117",
"0.7099147",
"0.60212135",
"0.60021013",
"0.5865357",
"0.58383274",
"0.5829093",
"0.5798766",
"0.57722104",
"0.5764892",
"0.57619107",
"0.5734998",
"0.5724438",
"0.57128686",
"0.56886256",
"0.56868386",
"0.5677869",
"0.5636764",
"0.56340766",
"0.5632966",
"0.5629223",
"0.5624146",
"0.56025904",
"0.55825245",
"0.5565107",
"0.5541307",
"0.55412495",
"0.55393213",
"0.5538892",
"0.55309147"
]
| 0.72308195 | 1 |
Checks if a file is Ogg/Vorbis. | private function _isOggVorbis($fileName, $mime)
{
if ($mime == self::MIME_CONTENT_TYPE_OGG
&& strpos($this->_getFileType($fileName), 'Vorbis audio') !== false)
{
$this->_detectedMime = "application/ogg";
return true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function check_file_is_audio( $tmp ) \n{\n $allowed = array(\n 'audio/mpeg', 'audio/x-mpeg', 'audio/mpeg3', 'audio/x-mpeg-3', 'audio/aiff', \n 'audio/mid', 'audio/x-aiff', 'audio/x-mpequrl','audio/midi', 'audio/x-mid', \n 'audio/x-midi','audio/wav','audio/x-wav','audio/xm','audio/x-aac','audio/basic',\n 'audio/flac','audio/mp4','audio/x-matroska','audio/ogg','audio/s3m','audio/x-ms-wax',\n 'audio/xm'\n );\n \n // check REAL MIME type\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $type = finfo_file($finfo, $tmp );\n finfo_close($finfo);\n \n // check to see if REAL MIME type is inside $allowed array\n if( in_array($type, $allowed) ) {\n return $type;\n } else {\n return false;\n }\n}",
"private function _isOggTheora($fileName, $mime)\n {\n if ($mime == self::MIME_CONTENT_TYPE_OGG \n && strpos($this->_getFileType($fileName), 'Theora video') !== false)\n {\n $this->_detectedMime = \"video/ogg-theora\";\n return true;\n }\n }",
"function check_upload($file) {\n if (preg_match(\":^application/vnd.bdoc-:\", $file[\"type\"])) {\n $file[\"format\"] = \"bdoc\";\n } else if ($file[\"type\"] === \"application/x-ddoc\") {\n $file[\"format\"] = \"ddoc\";\n } else {\n return FALSE;\n }\n\n return is_uploaded_file($file[\"tmp_name\"]);\n}",
"function validate_picture_file($path) {\n $acceptableTypes = array(IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_GIF);\n $detectedType = exif_imagetype($path); // WARNING: This will only work if the\n // EXIF extension is enabled.\n return in_array($detectedType, $acceptableTypes);\n}",
"public function isAudio(): bool\n {\n $originalUrl = mb_strtolower($this->getOriginalUrl(), 'utf-8');\n\n if (Str::endsWith($originalUrl, ['oga', 'mp3', 'wav'])) {\n return true;\n }\n\n if (Str::endsWith($originalUrl, 'ogg')) {\n return !Str::contains($this->getMime(), 'video');\n }\n\n return false;\n }",
"public function checkFormatAllowed() {\n\t\t$imageFileType = pathinfo(basename($this->value[\"name\"]),PATHINFO_EXTENSION);\n\t\tif((($this->extension == \"\") && ($imageFileType == \"jpg\" || $imageFileType == \"png\" || $imageFileType == \"jpeg\"\n\t\t|| $imageFileType == \"gif\")) || ($this->extension == \"pdf\" && $imageFileType == \"pdf\" )) {\n\t\t return true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"function isFile() {\n\t\treturn $this->repoObj->lobSubType == 'document';\n\t}",
"private function checkSupportedFile($file_type) {\n return true;\n\n\n }",
"private function isValidImageType(string $file)\r\n {\r\n return in_array(pathinfo($file, PATHINFO_EXTENSION), $this->supported);\r\n }",
"private function _isAudio($fileName, $mime)\n {\n \n /*return strpos($mime, self::MIME_CONTENT_TYPE_CATEGORY_AUDIO) === 0\n || $this->_isOggVorbis($fileName, $mime)\n || $this->_getContainerType($fileName)==\"audio\"\n || $this->_isWma($fileName);\n// Functions _isOggVorbis and _isWma below, are executed to handle backward compatibility (they converts mimeType) - Needs to be improved\n*/\n\t\n\t\n $this->_isOggVorbis($fileName, $mime);\n $this->_isWma($fileName);\n//echo $this->_getContainerType($fileName)==\"audio\".$this->_isMidi($fileName).\"wojak\";\n\n return $this->_getContainerType($fileName)==\"audio\" || $this->_isMidi($fileName);\n\n }",
"public function checkFile($filename){\n $ext = substr($filename, strrpos($filename, '.') + 1);\n if($ext==\"jpg\"||$ext==\"png\"||$ext==\"svg\"||$ext==\"jpeg\"){\n return true;\n }else{\n return false;\n }\n }",
"public function checkFileType($fileType){\n \t\tif ($fileType == \"application/octet-stream\"){\n \t\t\treturn true;\n \t\t}else{\n \t\t\treturn false;\n \t\t}\n \t}",
"function checkFileType($imageFileType)\n{\n\n if ($imageFileType == \"c\"||$imageFileType==\"C\"){\n echo \"C file detected!\";\n return 1;\n }\n if ($imageFileType ==\"py\"||$imageFileType==\"PY\"){\n echo \"Python file detected!\";\n return 2;\n\n }\n else{\n echo \"File is not allowed\";\n return 0;\n\n }\n}",
"public function isAudio($ext=null){\n global $VALID_AUDIO;\n if (!$ext)\n $ext = $this->ext; \n return (in_array( $ext, $VALID_AUDIO )); \n }",
"function fileChecker($nome_file){\n \n // controllo che sia stato inviato un file altrimenti restituisco false\n if(empty($_FILES['file'])){\n return false;\n }\n \n // memorizzo l'estensione\n $ext = trim(strtolower(end($nome_file)));\n \n // verifico che sia stato inviato un file contente un foto i formati disponibili sono jpg png jpeg\n if(!preg_match(VALID_FILE_FORMAT, $ext)){\n return false;\n }\n \n return true;\n}",
"public function isFile();",
"function isPhoto($path) \n {\n $exploded = explode('.', $path);\n $ext = strtolower(end($exploded));\n // Define the photos extensions\n $photoExtensions = ['png', 'jpg', 'jpeg', 'gif', 'jfif', 'tif', 'webp'];\n // Check if this extension belongs to the extensions we defined\n if (in_array($ext, $photoExtensions)) {\n return true;\n }\n return false;\n }",
"public function extens(){\n $this->typefl = pathinfo($this->filename, PATHINFO_EXTENSION);\n\n if(!in_array($this->typefl, $this->type)){\n echo \"Wrong extension!!!\";\n return false;\n }\n else{\n return true;\n }\n }",
"function file_is_image($filename) {\n return in_array(get_file_extension($filename), get_image_file_types());\n }",
"public function is_file($file);",
"private function isFileValid(): bool\n {\n return FileHelper::isExpectedExtensions($this->getPath(), $this->getFileExtensions());\n }",
"protected function validateOwner()\n {\n $value = $this->owner->getValue();\n if (!isset($value['error']) || UPLOAD_ERR_NO_FILE == $value['error']) {\n return true;\n }\n $mime = $this->getConfig();\n return is_array($mime)? in_array($value['type'], $mime):\n $value['type'] == $mime;\n }",
"function isSupportedType($type, $src_file) {\n if ($type !== \"jpg\" && $type !== \"jpeg\" && $type !== \"png\") {\n return zmgToolboxPlugin::registerError($src_file, 'GD 1.x: Source file is not an image or image type is not supported.');\n }\n return true;\n }",
"public function coverIsFile()\n {\n return $this['cover'] instanceof \\Illuminate\\Http\\Testing\\File || is_uploaded_file($this->file('cover'));\n }",
"function is_file_an_image($filepath)\n{\n\t$a = getimagesize($filepath);\n\t$image_type = $a[2];\n\t \n\tif(in_array($image_type , array(IMAGETYPE_GIF , IMAGETYPE_JPEG ,IMAGETYPE_PNG , IMAGETYPE_BMP)))\n\t{\n\t return true;\n\t}\n\treturn false;\n}",
"public function isAudio()\n {\n $mime_type = $this->getMimeType() ?: $this->detectMimeType();\n\n return (strpos($mime_type, 'audio') === 0);\n }",
"function gz_is_file($filename)\r\n{\r\n $ret = is_file(\"$filename.gz\") || is_file($filename);\r\n return $ret;\r\n}",
"function is_valid_audio_extension ($ext) {\n switch ($ext = strtolower($ext)) {\n //Sounds (HTML5 <audio> formats)\n case 'mp3':\n case 'ogg':\n case 'aac':\n case 'wav':\n case 'wave':\n return true;\n\n //Denied extension\n default:\n return false;\n }\n }",
"public function supports(string $file): bool;",
"private function isAsset($file) {\n\t\t$tmp = explode('.', $file);\n\t\t\n\t\treturn in_array(strtolower(end($tmp)), $this->formatAssets);\n\t}"
]
| [
"0.62763304",
"0.6210141",
"0.60143346",
"0.5886614",
"0.58464634",
"0.57831895",
"0.57785255",
"0.5777448",
"0.57678777",
"0.57376474",
"0.5727184",
"0.57150304",
"0.5708083",
"0.5701376",
"0.5681684",
"0.5680559",
"0.56274265",
"0.5609916",
"0.56022215",
"0.5595986",
"0.5594628",
"0.5587422",
"0.5586253",
"0.5579388",
"0.5570262",
"0.5548331",
"0.55432874",
"0.55341095",
"0.55314696",
"0.55298936"
]
| 0.76214486 | 0 |
Removes directories and the suffix from a file name. | private function _removeDirsAndSuffix($filePath)
{
$filePath = basename($filePath);
if (strrpos($filePath, '.'))
{
$filePath = substr($filePath, 0, strrpos($filePath, '.'));
}
return $filePath;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function cleanFilename($fileName)\r\n {\r\n $fileName = str_replace('../', '', $fileName);\r\n $fileName = str_replace('./', '', $fileName);\r\n $fileName = str_replace(' ', '_', $fileName);\r\n return $fileName;\r\n }",
"public static function cleanNameToFilename($s) {\n return str_replace(['/', '_',], ['-', '-'], $s);\n }",
"function file_ext_strip($filename){\n\t return preg_replace('/.[^.]*$/', '', $filename);\n\t}",
"function _strip_template_file_suffix($template_file)\n {\n }",
"public static function cleanFilename($dirty_filename) {\n $split = explode('.', $dirty_filename);\n $ext = array_pop($split);\n return \\Str::slug(urldecode( implode('.', $split) )).'.'.$ext;\n }",
"public function cleanFilename($filename)\n {\n $filename = str_replace('\\\\', '/', $filename ?? '');\n\n // Since we use double underscore to delimit variants, eradicate them from filename\n return preg_replace('/_{2,}/', '_', $filename ?? '');\n }",
"private function trimFilename($file)\n {\n return ltrim(str_replace($this->basePath, '', $file->getPathname()), '/');\n }",
"function cleanFileName($str) {\n $str = strtolower($str);\n $ext_point = strrpos($str,\".\");\n if ($ext_point===false) return false;\n $ext = substr($str,$ext_point,strlen($str));\n $str = substr($str,0,$ext_point);\n\n return preg_replace(\"/[^a-z0-9-]/\",\"_\",$str).$ext;\n}",
"public function cleanFilename($filename)\n {\n $filename = str_replace('\\\\', '/', $filename);\n\n // There's not really any relevant cleaning rule for legacy. It's not important any way because we won't be\n // generating legacy URLs, aside from maybe for testing.\n return $filename;\n }",
"public function cleanFileName($fileName)\n {\n // Handle UTF-8 characters\n if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem']) {\n // allow \".\", \"-\", 0-9, a-z, A-Z and everything beyond U+C0 (latin capital letter a with grave)\n $cleanFileName = preg_replace('/[' . self::UNSAFE_FILENAME_CHARACTER_EXPRESSION . ']/u', '_', trim($fileName));\n } else {\n $fileName = GeneralUtility::makeInstance(CharsetConverter::class)->specCharsToASCII('utf-8', $fileName);\n // Replace unwanted characters by underscores\n $cleanFileName = preg_replace('/[' . self::UNSAFE_FILENAME_CHARACTER_EXPRESSION . '\\\\xC0-\\\\xFF]/', '_', trim($fileName));\n }\n // Strip trailing dots and return\n return rtrim($cleanFileName, '.');\n }",
"function trim_file_name($name, $type) \n\t{\n\t\t// into different directories or replacing hidden system files.\n\t\t// Also remove control characters and spaces (\\x00..\\x20) around the filename:\n\t\t$file_name = trim(basename(stripslashes($name)), \".\\x00..\\x20\");\n\t\t// Add missing file extension for known image types:\n\t\tif (strpos($file_name, '.') === false &&\n\t\t\tpreg_match('/^image\\/(gif|jpe?g|png)/', $type, $matches)) \n\t\t{\n\t\t\t$file_name .= '.'.$matches[1];\n\t\t}\n\t\treturn $file_name;\n\t}",
"protected function trim_file_name($name, $type) {\n\t\t// into different directories or replacing hidden system files.\n\t\t// Also remove control characters and spaces (\\x00..\\x20) around the filename:\n\t\t$name = trim(basename(stripslashes($name)), \".\\x00..\\x20\");\n\t\t// Add missing file extension for known image types:\n\t\tif (strpos($name, '.') === false &&\n\t\t\tpreg_match('/^image\\/(gif|jpe?g|png)/', $type, $matches)) {\n\t\t\t$name .= '.'.$matches[1];\n\t\t}\n\t\t$name = preg_replace('[\\s+]','', $name);\n\t\treturn $name;\n\t}",
"private function cleanFilename($filename)\n\t{\n\t\t$filenameParts = explode('.', $filename);\n\t\t$filenameParts[0] = str_slug($filenameParts[0]);\n\n\t\treturn implode('.', $filenameParts);\n\t}",
"function stripExt($file) {\n return preg_replace('#\\.[^.]*$#', '', $file);\n }",
"function removeExtension($filename) {\n $file = substr($filename, 0,strrpos($filename,'.')); \n return $file;\n }",
"protected function normalizeName(string $name): string\n {\n if ($this->filesystem->getExtension($name) === $this->extension) {\n $name = \\substr($name, 0, -(\\strlen($this->extension) + 1));\n }\n\n return $name;\n }",
"function filter_filename($name) {\n $name = str_replace(array_merge(\n array_map('chr', range(0, 31)),\n array('<', '>', ':', '\"', '/', '\\\\', '|', '?', '*','\\'')\n ), '', $name);\n // maximise filename length to 255 bytes http://serverfault.com/a/9548/44086\n $ext = pathinfo($name, PATHINFO_EXTENSION);\n $name= mb_strcut(pathinfo($name, PATHINFO_FILENAME), 0, 255 - ($ext ? strlen($ext) + 1 : 0), mb_detect_encoding($name)) . ($ext ? '.' . $ext : '');\n return $name;\n}",
"function clean_filename($filename)\n\t{\n//replaces all characters that are not alphanumeric with the exception of the . for filename usage\n\t\t$realname = preg_replace(\"/[^a-zA-Z0-9\\.]/\", \"\", strtolower($filename));\n\t\treturn $realname;\n\t}",
"public function removePrefixFromPath()\n {\n $this->fileStructure->path = $this->getPathWithoutPrefix( $this->fileStructure->path, $this->prefix );\n $this->prefix = \"\";\n }",
"public static function cleanFilename($file_name, $extension = \"\")\n {\n $clean_filename = preg_replace(\"/[?*:;{}\\\\ \\\"'\\/@#!%^()<>.]+/\", \"_\", $file_name);\n if ($extension) {\n return $clean_filename . \".\" . $extension;\n }\n return $clean_filename;\n }",
"public function sanitizedName($name)\r\n\t{\r\n\t\t$cut_name = explode('_', $name);\r\n\t\t$fileName = array_slice($cut_name, 1);\r\n\t\treturn implode(\"_\", $fileName);\r\n\t}",
"function clean_filename($filename, $dir_id, $parameters = array())\n\t{\n\t\t// at one time the third parameter was (bool) $dupe_check\n\t\tif ( ! is_array($parameters))\n\t\t{\n\t\t\t$parameters = array('ignore_dupes' => ! $parameters);\n\t\t}\n\n\t\t// Establish the default parameters\n\t\t$default_parameters = array(\n\t\t\t'convert_spaces' => TRUE,\n\t\t\t'ignore_dupes' => TRUE\n\t\t);\n\n\t\t// Get the actual set of parameters and go\n\t\t$parameters = array_merge($default_parameters, $parameters);\n\n\t\t$prefs = $this->fetch_upload_dir_prefs($dir_id);\n\n\t\t$i = 1;\n\t\t$ext = '';\n\t\t$path = $prefs['server_path'];\n\n\t\t// clean up the filename\n\t\tif ($parameters['convert_spaces'] === TRUE)\n\t\t{\n\t\t\t$filename = preg_replace(\"/\\s+/\", \"_\", $filename);\n\t\t}\n\n\t\t$filename = ee()->security->sanitize_filename($filename);\n\n\t\tif (strpos($filename, '.') !== FALSE)\n\t\t{\n\t\t\t$parts\t\t= explode('.', $filename);\n\t\t\t$ext\t\t= array_pop($parts);\n\n\t\t\t// @todo prevent security issues with multiple extensions\n\t\t\t// http://httpd.apache.org/docs/1.3/mod/mod_mime.html#multipleext\n\t\t\t$filename\t= implode('.', $parts);\n\t\t}\n\n\t\t$ext = '.'.$ext;\n\n\t\t// Figure out a unique filename\n\t\tif ($parameters['ignore_dupes'] === FALSE)\n\t\t{\n\t\t\t$basename = $filename;\n\n\t\t\twhile (file_exists($path.$filename.$ext))\n\t\t\t{\n\t\t\t\t$filename = $basename.'_'.$i++;\n\t\t\t}\n\t\t}\n\n\t\treturn $path.$filename.$ext;\n\t}",
"function cleanPath($path) {\n // files////janko/mika\n\n while (strpos($path, \"//\") !== FALSE) {\n $path = str_replace(\"//\", \"/\", $path);\n }\n\n return $path;\n}",
"public function removeFileSuffix(string $suffix): void\n {\n $lastIndex = count($this->fileSuffixes) - 1;\n if ($this->fileSuffixes[$lastIndex] === $suffix) {\n unset($this->fileSuffixes[$lastIndex]);\n }\n }",
"private function _getFileSuffix()\n {\n if (strrpos($this->_originalName, '.'))\n {\n return substr($this->_originalName, strrpos($this->_originalName, '.') +1);\n }\n else \n {\n return '';\n }\n }",
"function txt_filename_clean( $t )\n\t{\n\t\t$t = $this->txt_alphanumerical_clean( $t, '.' );\n\t\t$t = preg_replace( '#\\.{1,}#s', '.', $t );\n\t\t\n\t\treturn $t;\n }",
"function cleanFileName($fileName)\n {\n // remove all special chars and keep only alphanumeric chars\n $fileName = preg_replace(\"/[^a-zA-Z0-9- .]/\", \"\", trim($fileName));\n // replace multiple white spaces with single white space\n $fileName = preg_replace(\"/\\s+/\", \" \", $fileName);\n // replace multiple dashes with single dash\n $fileName = preg_replace('/-+/', '-', $fileName);\n // again remove special chars from the beginning of the string in case it contains\n // special chars in the beginning after clean-up\n $fileName = preg_replace('/(^([^a-zA-Z0-9])*|([^a-zA-Z0-9])*$)/', '', $fileName);\n return $fileName;\n }",
"private static function _formatPathName($name)\n {\n $name = str_replace('\\\\', DIRECTORY_SEPARATOR, $name);\n $name = str_replace('/', DIRECTORY_SEPARATOR, $name);\n $name = rtrim($name, DIRECTORY_SEPARATOR);\n\n // Strip the extension\n if (substr($name, -strlen(self::LOAD_EXTENSION)) == self::LOAD_EXTENSION)\n {\n $name = substr($name, 0, -strlen(self::LOAD_EXTENSION));\n }\n\n return $name;\n }",
"private function removeFileExtensionFromPath($path)\n {\n if (strrpos($path, '.') !== false) {\n $path = substr($path, 0, strrpos($path, '.'));\n }\n\n return $path;\n }",
"private function removeFileExtensionFromPath($path)\n {\n if (strrpos($path, '.') !== false) {\n $path = substr($path, 0, strrpos($path, '.'));\n }\n\n return $path;\n }"
]
| [
"0.65443355",
"0.635319",
"0.6342299",
"0.62415695",
"0.61810607",
"0.61378807",
"0.60897845",
"0.6033048",
"0.59857965",
"0.59564394",
"0.5956306",
"0.5951679",
"0.5945282",
"0.58885187",
"0.58369577",
"0.58221644",
"0.5795457",
"0.577604",
"0.5775568",
"0.57698774",
"0.5743646",
"0.5725058",
"0.5723329",
"0.5714649",
"0.57146096",
"0.56664336",
"0.56625456",
"0.5649275",
"0.56386197",
"0.56386197"
]
| 0.6703396 | 0 |
Returns the suffix part of a file name | private function _getFileSuffix()
{
if (strrpos($this->_originalName, '.'))
{
return substr($this->_originalName, strrpos($this->_originalName, '.') +1);
}
else
{
return '';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function getSuffix() : string\n {\n return $this->getSubjectConfiguration()->getFileResolver()->getSuffix();\n }",
"protected function getSuffix() : string\n {\n return $this->getFileResolverConfiguration()->getSuffix();\n }",
"public function getSuffix() {}",
"public function getFileSuffix()\n {\n return '_'.$this->sqlData['cmsident'];\n }",
"public function getBaseName($path, $suffix = null);",
"public function getNameSuffix ();",
"public function getSuffix()\n\t{\n\t\treturn $this->suffix;\n\t}",
"protected function getSuffix()\n\t{\n\t\treturn 1;\n\t}",
"function wp_basename($path, $suffix = '')\n {\n }",
"public function getSuffix(){\n\t\treturn $this->suffix;\n\t}",
"public function get_suffix()\n {\n }",
"public function basename() {\n\t\t// @version 1.2.0 Use filename then fallback to path\n\t\t$path = $this->data('name') ?: $this->path();\n\n\t\treturn pathinfo($path, PATHINFO_BASENAME);\n\t}",
"private function generateSuffix() {\n $seg = strtoupper($this->_fileSegmentation);\n $separator = \"_\";\n $suffix = null;\n if ($seg === 'YEAR') {\n $suffix = $separator . date('Y');\n } else if ($seg === 'MONTH') {\n $suffix = $separator . date('Y_F');\n } else if ($seg === 'DAY') {\n $suffix = $separator . date('Y-m-d');\n } else if ($seg === 'HOUR') {\n $suffix = $separator . date('Y-m-d_H');\n } else if ($seg === 'MINUTE') {\n $suffix = $separator . date('Y-m-d_Hi');\n } else if ($seg === 'SECOND') {\n $suffix = $separator . date('Y-m-d_His');\n } else {\n $suffix = null;\n }\n\n return $suffix;\n }",
"function file_get_filename($filename)\r\n\t{\r\n\t\treturn substr($filename, 0, strrpos($filename, \".\"));\r\n\t}",
"public function basename();",
"function getBasename () {\n\t\treturn substr($this->info['basename'], 0, strpos($this->info['basename'], \".\"));\n\t}",
"public function getFileSuffix(){\n return $this->cfg_extension;\n }",
"public function getNameSuffix()\n {\n return $this->nameSuffix;\n }",
"function get_table_annexe_suffix($name) {\r\n\t\t$arr = @split(\"_\",$name);\r\n\r\n\t\treturn $arr[count($arr)-1];\r\n}",
"function getFileBasename() {\n\t\treturn basename($this->getFilename());\n\t}",
"public function getBaseName()\n {\n return basename($this->file);\n }",
"function getSuffixPath() {\r\n\t$url = $_SERVER['REQUEST_URI']; // \"/some/app/script.php/cid/c1/seg/1234-init.mp4\r\n\t$idx = strpos($url, \".php/\", 0);\r\n\tif($idx===false) return \"\";\r\n\t$url = substr($url, $idx+1); // script.php/cid/c1/seg/1234-init.mp4\r\n\t$path= substr($url, strpos($url, \"/\",0)+1); // cid/c1/seg/1234-init.mp4\r\n\treturn $path;\r\n}",
"public function getSuffix()\n {\n return $this->__get(self::FIELD_SUFFIX);\n }",
"function wp_basename( $path, $suffix = '' ) {\r\n\t\treturn urldecode( basename( str_replace( '%2F', '/', urlencode( $path ) ), $suffix ) );\r\n\t}",
"protected function getFileName() {\n // Full file path.\n $path = $this->urls[$this->activeUrl];\n\n // Explode with the '/' to get the last element.\n $files = explode('/', $path);\n\n // File name without extension.\n $file_name = explode('.', end($files))[0];\n return $file_name;\n }",
"public function basename($ext = true) {\n\t\t$basename = parent::get('basename'); \n\t\tif(!$ext) $basename = basename($basename, \".\" . $this->ext());\n\t\treturn $basename;\n\t}",
"function getEndFile($fileName) {\n\treturn substr(strrchr($fileName, '_'), 1);\n}",
"public static function basename($path, $suffix = '') {\n if (($len = mb_strlen($suffix)) > 0 && mb_substr($path, -$len) === $suffix) {\n $path = mb_substr($path, 0, -$len);\n }\n $path = rtrim(str_replace('\\\\', '/', $path), '/\\\\');\n if (($pos = mb_strrpos($path, '/')) !== false) {\n return mb_substr($path, $pos + 1);\n }\n return $path;\n }",
"public function suffix()\n\t\t{\n\t\t\tif (!$this->suff) {\n\t\t\t\t$this->suff = self::get_suffix_from_name($this->name());\n\t\t\t}\n\n\t\t\treturn $this->suff;\n\t\t}",
"public static function mb_basename($path, $suffix = '')\n {\n }"
]
| [
"0.7976123",
"0.7874822",
"0.7753751",
"0.7708719",
"0.7516133",
"0.7462964",
"0.7389194",
"0.7351735",
"0.73277456",
"0.73253876",
"0.73133683",
"0.7255621",
"0.72187674",
"0.7202748",
"0.72000724",
"0.71424395",
"0.7138476",
"0.70605874",
"0.70393413",
"0.703483",
"0.7029228",
"0.70279855",
"0.701888",
"0.70105386",
"0.7005463",
"0.6995636",
"0.6994339",
"0.6993169",
"0.6971028",
"0.6969583"
]
| 0.8463182 | 0 |
Transcodes a audio file to mp3 | private function _transcodeAudio($fileName, $outputFilePath, $mime)
{
$outputFilePath .= '.mp3';
if ($mime == self::MIME_CONTENT_TYPE_MPEG)
{
// MP3 - Don't need to transcode FIX should we recode?
// FIX check that it actually is a MPEG-1 Audio Layer 3 file
// FIX check for errors!
copy($fileName, $outputFilePath);
}
// We use mplayer with wma files to dump wav before encoding to mp3 with lame
else //if ($this->_isWma($fileName))
{
if ($this->_isMidi($fileName) !== false)
{
$midiToWaveCmd = sprintf(str_replace("transcoder.class.php", 'transcode/transcodeMidi.sh', __file__). " %s %s %s %s %s > /dev/null 2>&1 &",
self::TRANSCODE_TIMIDITY_CMD,
self::TRANSCODE_FFMPEG_CMD,
escapeshellarg($fileName),
escapeshellarg($outputFilePath),
str_replace("transcoder.class.php", 'transcode/transcodeaudio.sh', __file__));
exec($midiToWaveCmd, $cmdOutput, $exitCode);
} else
{
$transcodeWmaCommand = sprintf(str_replace("transcoder.class.php", 'transcode/transcodeaudio.sh', __file__).' %s %s %s >/dev/null 2>&1 &',
self::TRANSCODE_FFMPEG_CMD,
escapeshellarg($fileName),
escapeshellarg($outputFilePath));
//echo $transcodeWmaCommand."<br /><br />";
exec($transcodeWmaCommand, $cmdOutput, $exitCode);
file_put_contents($fileName.".log",$cmdOutput);
}
/*foreach($cmdOutput as $line)
{
echo $line."<br />\n";
}
die();*/
}
/*else
{
$pcmFile = $fileName;
$pcmIsTmp = false;
if ($mime != self::MIME_CONTENT_TYPE_WAV)
{
$pcmFile = tempnam(self::TRANSCODE_TMP_DIR, 'transcode');
$this->_decodeAudio($fileName, $pcmFile);
$pcmIsTmp = true;
}
$transcodeMp3Cmd = sprintf('%s --quiet --abr 192 %s %s 2>&1',
self::TRANSCODE_LAME_CMD, $pcmFile,
escapeshellarg($outputFilePath));
// FIX check for errors!
exec($transcodeMp3Cmd);
if ($pcmIsTmp)
{
unlink($pcmFile);
}
}*/
return array('newFileName' => basename($outputFilePath),
'convertedMime' => 'audio/mpeg',
'detectedMime' => $this->_detectedMime);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function sound_mp3()\n\t{\n\t\tif (preg_match('/.+[-_\\s]{0,3}[\\(\\[]\\d+\\/\\d+[\\)\\]][-_\\s]{0,3}\"(.+)' . $this->e0 .\n\t\t\t\t\t '[ _-]{0,3}\\d+[.,]\\d+ [kKmMgG][bB][ _-]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //\"Terraplane Sun - Funnel of Love.mp3\" - 21.55 MB - (1/6) - yEnc\n\t\tif (preg_match('/^\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t '[ _-]{0,3}\\d+[.,]\\d+ [kKmMgG][bB][ _-]{0,3}\\(\\d+\\/(\\d+\\))[ _-]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //trtk09920 - [01/12] - \"Guido Negraszus - Night Cafe Iii (Freedom Travellers) (2012)(320).par2\" yEnc\n\t\tif (preg_match('/^trtk\\d+[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(????) [001/153] - \"C4 House Party Horse Meat Disco Set 6.nfo\" C4 House Party Horse Meat Disco Set 6 yEnc\n\t\tif (preg_match('/^\\(\\?+\\) \\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . '.+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(????) [19/22] - C.K.N. Demo 85 \"19-rotten system.mp3\" yEnc\n\t\tif (preg_match('/^\\(\\?+\\) \\[\\d+\\/\\d+\\] - (.+)[-_\\s]{0,3}\".+?' . $this->e0 . '.+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(LUNATIC SOUL - IMPRESSIONS) [00/18] - \"Lunatic Soul - Impressions 2011.nzb\" yEnc\n\t\tif (preg_match('/^\\(.+\\)[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[1/8] - \"Black Market Flowers - Bind (1993).sfv\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//[1/1] - (150 MP3 Album Charts) - \"Atlantean Kodex - The White Goddess.rar\" yEnc\n\t\t//[1/1] - (MP3 Album Charts) - \"Black Sabbath - 13.rar\" yEnc\n\t\t//[1/1] - (Top100 Album Charts) - \"Bastille - Pompeii.rar\" yEnc\n\t\t//[1/1] - (Top100 Charts) - \"Beatrice Egli - Gluecksgefuehle.rar\" yEnc\n\t\t//[1/1] - (Top100 Single Charts) - \"Alicia Keys - Girl On Fire.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}\\(((Top)?\\d+ )?(MP3 )?((Album|Single) )?Charts\\)[ -]{0,4}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[6];\n\t\t} //[1/1] - (Album Top 100) - \"[Dance] David Guetta - One Love (2010) .rar\" yEnc\n\t\t//[1/1] - (Album Top 100) - \"Aerosmith - Music From Another Dimension.rar\" yEnc\n\t\t//[1/1] - Album Top 100 - \"ACDC - Live At River Plate.rar\" yEnc\n\t\t//[1/1] (Album Top 100 - 2012) - \"Alicia Keys - Girl On Fire.rar\" yEnc\n\t\t//[1/1] (Album Top 100 2012) - \"Asaf Avidan And The Mojos - One Day.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}(\\()?(Album|Single) Top \\d+ ([- ]{0,2}\\d+)?(\\))? - \"(\\[.+?\\] )?(.+?)' .\n\t\t\t\t\t $this->e0 . ' {1,4}yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[6];\n\t\t} //[1/1] - Top 100 Album Charts 2012 - \"Aura Dione feat. Rock Mafia - Friends.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}Top \\d+ Album Charts \\d+[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' {1,4}yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //<>usenet-piraten.info<>partner<>ssl-news.info<> - [10/10] - \"Overexposed (Deluxe Version).vol31+23.par2\" yEnc\n\t\tif (preg_match('/^.+usenet-piraten\\.info.+ - \\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(1/1) \"Adam Levine (Maroon 5) & Alicia Keys - Daylight & Girl on fire LIVE 55TH GRAMMY AWARDS 320Kpbs.mp3\" yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(1/4) - VERBAteam present - \"Avril Lavigne - Rock 'N Roll (Official Audio).mp3\" - 5,80 MB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) - VERBAteam present - \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[1/1] - (Album Top 1000) - \"Davis, Miles - Complete Live at the Plugged Nickel 1965.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}\\(Album Top \\d+\\)[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[1/1] - Album Top 100 - \"Rammstein - Made In Germany 1995-2011.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}Album Top \\d+[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Andrea Berg - My Danish Collection (2013) by dem verrückten Lordi (14/27) \"Andrea Berg - My Danish Collection (2013).par2\" - 132,74 MB 150920134 yEnc\n\t\t//Der Deutsche Beat Mix Teil 2 auf wunsch (by dem verrückten Lordi) (2/9) \"Der Deutsche Beat Mix Teil 3 Back.jpg\" - 117,84 MB 13.11.05 yEnc\n\t\tif (preg_match('/^(.+?) (\\()?by dem verrückten Lordi(\\))? {1,2}\\(\\d+\\/\\d+\\) \".+?' .\n\t\t\t\t\t $this->e0 . '[-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB].+yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Christian Anders - Tief in dir (15/24) \"Christian Anders - Tief In Dir Back.jpg\" - 58,56 MB by dem verrückten Lordi 0703123 yEnc\n\t\tif (preg_match('/^(.+?) \\(\\d+\\/\\d+\\) \".+?' . $this->e0 .\n\t\t\t\t\t '[-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB] {1,2}by dem verrückten Lordi.+yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Der etwas andere Mix - Wilde Herzenmix (auf wunsch) neu (by dem verrückten Lordi) (1/8) \"Der etwas andere Mix - Wilde Herzenmix.par2\" yEnc\n\t\tif (preg_match('/^Der etwas.+ - (.+) \\(\\d+\\/\\d+\\) \".+?' . $this->e0 . '.+yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Full Discography - The Cranberries (01/47) \"Full Discography - The Cranberries.par2\" - 3,52 GB 2812111 yEnc\n\t\tif (preg_match('/^(.+?) \\(\\d+\\/\\d+\\) \".+?' . $this->e0 .\n\t\t\t\t\t '[-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB] {1,2}\\d+ yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //jean ferrat année 1967 à 1969 meil29 \"17 Rien à voir.mp3\" yEnc\n\t\tif (preg_match('/^(.+?) meil29 \".+?' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //Selected Songs by Various Artists - Depeche Mode - Personal Jesus (Acoustic Version).mp3 yEnc\n\t\tif (preg_match('/^Selected Songs by Various Artists - (.+?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4}) yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}",
"static function EncodeMp3($filepath)\n\t\t{\n\t\t\t// --------------------------------------------------------\n\t\t\t// Increase the memory limit for complete file allocation.\n\t\t\t// Earlier 8 MB now 25 MB\n\t\t\t// --------------------------------------------------------\n\t\t\tini_set(\"memory_limit\",\"80M\");\n\t\t\t// --------------------------------------------------------\n\t\t\t\n\t\t\t$temp_name = $filepath.\"_write\" ;\n\t\t\t\n\t\t\t// Create a file with temp name.\n\t\t\t$to_write = fopen($temp_name, \"xb\") ;\n\t\t\t$filedata = file_get_contents($filepath, FILE_BINARY) ;\n\t\t\t\n\t\t\t// Write 2 chars MX into the file\n\t\t\tfputs($to_write, \"MX\".CUtils::GetRandString(50)) ;\n\t\t\t\n\t\t\t// Now write complete file to temp file.\n\t\t\tfwrite($to_write, $filedata) ;\n\t\t\t\n\t\t\t// Close file handle.\n\t\t\tfclose($to_write) ;\n\t\t\t\n\t\t\t// Delete uploaded file.\n\t\t\tunlink($filepath) ;\n\t\t\t\n\t\t\t// Rename encoded file.\n\t\t\trename($temp_name, $filepath) ;\n\t\t}",
"private function _decodeAudio($fileName, $outputFileName)\n {\n if (strpos($this->_getFileType($fileName), 'Standard MIDI data') !== false)\n {\n $transcodeWavCmd = sprintf('%s -Ow -o %s %s 2>&1',\n self::TRANSCODE_TIMIDITY_CMD, $outputFileName, \n escapeshellarg($fileName));\n \n }\n else\n {\n $transcodeWavCmd = sprintf('/usr/bin/env MPLAYER_VERBOSE=-2 %s -msglevel all=5 -nolirc -nojoystick -vo null -vc null -ao pcm:fast:waveheader:file=%s %s 2>&',\n self::TRANSCODE_MPLAYER_CMD,\n $outputFileName, \n escapeshellarg($fileName));\n \n /* MPlayer doesn't seem to give any exit status codes :( */\n }\n // FIX check for errors!\n exec($transcodeWavCmd);\n }",
"public function mp3()\n\t{\n\t\tif (preg_match('/\"([\\w. -]{8,})\"[-_\\s]{0,3}[\\(\\[]\\d+\\/(\\d+[\\)\\]])[-_\\s]{0,3}\".+' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//( Albert Cummings Albums 6x By Dready Niek (1999-2012) ) ( ** By Dready Niek ** ) [11/20] - \"Albert Cummings Albums 6x By Dready Niek (1999-2012).part10.rar\" yEnc\n\t\t//( Fat Freddy's Drop - Blackbird (2013) -- By Dready Niek ) -- By Dready Niek ) [01/15] - \"Fat Freddy's Drop - Blackbird (2013) -- By Dready Niek.par2\" yEnc\n\t\tif (preg_match('/\\( ([\\w. -]{8,}) \\)[-_\\s]{0,3}( |\\().+\\)[-_\\s]{0,3}[\\(\\[]\\d+\\/(\\d+[\\)\\]])[-_\\s]{0,3}\".+(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //<<<Old but Sold>>> <<< >< >< \"German Top 50 ODC - 12.08.2013.nfo\" >< 02/33 (541,61 MB) >< 10,93 kB > yEnc\n\t\tif (preg_match('/^.+Old but Sold.+>< \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' >< \\d+\\/\\d+ \\(\\d+[.,]\\d+ [kKmMgG][bB]\\).+ yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Musikjunkie-The.Voice.Of.Germany.2013.The.Best.of.Liveshows.4.CD.Box.Set.VBR [15/28]\"voice.part13.rar\" yEnc\n\t\tif (preg_match('/^Musikjunkie-([\\w. -]{8,})[-_\\s]{0,3}\\[\\d+\\/\\d+\\]\".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Metallica - Ride The Lightning \"01 - Fight Fire With Fire.mp3\" yEnc\n\t\tif (preg_match('/^([\\w. -]{8,})[-_\\s]{0,3}(\"|#34;)(.+?)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //::: Usejunkies.tk ::: - [08/11] - \"DJ Shog - DNA - HD 720p.vol00+1.par2\" - 47,76 MB yEnc\n\t\tif (preg_match('/^.+Usejunkies\\.tk.+[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //\"AnyDVD 7.0.0.0.rar\" poc yEnc\n\t\tif (preg_match('/^\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t '[-_\\s]{0,3}poc[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //\"A Produce & Loren Nerell - Intangible.nzb\" yEnc\n\t\tif (preg_match('/^\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(01/12) \"Sunfly Hits April (2013) SF326 [Skytwohigh].par2\" - 109.59 MB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\)[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(01/15) - Description - \"Goldene Schlager - Erinnerungen Folge 3.par2\" - 126,08 MB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\)[-_\\s]{0,3}Description[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(Musica - House&Dance - mix 1 - april 2014 1) [00/45] - \"Musica - House&Dance mix 1 april.nzb\" yEnc\n\t\tif (preg_match('/^\\(([^.]{8,})\\) \\[\\d+\\/\\d+\\][-_\\s]{0,3}\".+?' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[04/17] - \"Schlager.am.laufenden.Band.-.Vol.13.part02.rar\" - 622,46 MB yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //\"Karate Andi - Pilsator Platin 2014.nfo.nfo Karate Andi - Pilsator Platin 2014 by PsyDealer yEnc\n\t\tif (preg_match('/^\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar|\\.7z)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4}) [\\w.,& ()\\[\\]\\'\\`-]{8,}?\\b.?( by )?PsyDealer yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(????) [089/100] - \"090-florence_and_the_machine_-_spectrum_(say_my_name)_(calvin_harris_edit).mp3 Top 100 Single Charts 13.05.2013\" yEnc\n\t\tif (preg_match('/^\\(\\?+\\)[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"[\\w.,& ()\\[\\]\\'\\`-]{8,}?\\b.?\\.[A-Za-z0-9]{2,4} (Top \\d+ Single Charts \\d+\\.\\d+\\.\\d+)\"[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(????) [02/26] - \"8Cursed.rar\" yEnc\n\t\tif (preg_match('/^\\(\\?+\\)[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(????) [00/34] - \"The Official UK Top 40 Singles Chart 15-06-2014.nzb\"otfINWnjfg7856fghj yEnc\n\t\tif (preg_match('/^\\(\\?+\\)[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . '\\w+[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(01/24) VA - Now Thats What I Call Disco 2013 - \"VA - Now Thats What I Call Disco 2013.7z.001\" - 487.23 MB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) ([\\w.,& ()\\[\\]\\'\\`-]{8,}?)[-_\\s]{0,3}\"[\\w.,& ()\\[\\]\\'\\`-]{8,}?\\b.?' .\n\t\t\t\t\t $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(102400) [06/13] - \"Time Life - The Teen Years.part05.rar\" yEnc\n\t\tif (preg_match('/^\\(102400\\) \\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(18 Gouden Piraten Hits Deel 2 [03/11] - \"18 Gouden Piraten Hits Deel 2.part2.rar\" yEnc\n\t\tif (preg_match('/^\\([\\w.,& ()\\[\\]\\'\\`-]{8,} \\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(Amigos - Ihre Lieblingshits - Folge 2 - 2013 - by Taekwondo145)[00/62] - \"Amigos - Ihre Lieblingshits - Folge 2 - 2013.nzb\" yEnc\n\t\tif (preg_match('/^\\([\\w.,& ()\\[\\]\\'\\`-]{8,}\\)\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(German TOP100 Single Jahrescharts-2013 - by Taekwondo456([67/70] - \"German TOP100 Single Jahrescharts-2013.vol041+41.PAR2\" yEnc\n\t\tif (preg_match('/^\\([\\w.,& ()\\[\\]\\'\\`-]{8,} - by Taekwondo(\\d+\\()?\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //(Liedjes uit de film De Grote Patriottische Oorlog..o.a. Rod McK ) ( ** By Dready Niek ** ) [02/11] - \"Liedjes uit de film De Grote Patriottische Oorlog..o.a. Rod McKuen - By Dready Niek.part1.rar\" yEnc\n\t\tif (preg_match('/^\\( ?([\\w.,& ()\\[\\]\\'\\`-]{8,}) ?\\)[-_\\s]{0,3}\\(.+Dready Niek.+\\)[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"[\\w.,& ()\\[\\]\\'\\`-]{8,}?' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[21/23] - \"JNEQ3_20130413_028.vol0+1.par2\" - 282,65 MB <-> Partner of secretusenet.com <-> yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 .\n\t\t\t\t\t '[-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB] <-> Partner of secretusenet\\.com <->[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Yogi_and_Husky--Nu_Sound_EP-(RSR021)-WEB-2012-dh - \"Yogi_and_Husky--Nu_Sound_EP-(RSR021)-WEB-2012-dh.r00\" yEnc\n\t\tif (preg_match('/^[\\w.,& ()\\[\\]\\'\\`-]{8,}?[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Zido.Alben.All.in.One.Read.NFO-Ren & Stimpy - [35/43] - \"Zydo.part33.rar\" yEnc\n\t\tif (preg_match('/^([\\w.,& ()\\[\\]\\'\\`-]{8,}?)[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //! ! !! - h311b0y101022014 - !! ! ! [01/14] - \"h311b0y101022014.par2\" yEnc\n\t\tif (preg_match('/(h311b0y|Hellboy).+\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}",
"function wp_read_audio_metadata($file)\n {\n }",
"function getMp3FromM3u8($url) {\n // Not a m3u8 url\n if (!strpos($url, \"index.m3u8?\")) {\n return $url;\n }\n if (strpos($url, \"/audios/\")) {\n return preg_replace('~^(.+?)/[^/]+?/audios/([^/]+)/.+$~', '\\\\1/audios/\\\\2.mp3', $url);\n } else {\n return preg_replace('~^(.+?)/(p[0-9]+)/[^/]+?/([^/]+)/.+$~', '\\\\1/\\\\2/\\\\3.mp3', $url);\n }\n}",
"public function sounds_mp3()\n\t{\n\t\tif (preg_match('/^\\(dream-of-usenet\\.info\\) - \\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //http://dream-of-usenet.org empfehlen newsconnection.eu - [02/32] - \"Adam_Ant-Manners_and_Physique-(MCAD-6315)-CD-FLAC-1989-2Eleven.par2\" yEnc\n\t\tif (preg_match('/^http:\\/\\/dream-of-usenet\\.org .+? - \\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //trtk09920 - [01/12] - \"Guido Negraszus - Night Cafe Iii (Freedom Travellers) (2012)(320).par2\" yEnc\n\t\tif (preg_match('/^trtk\\d+[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //>>> CREATIVE COMMONS NZB <<< \"dexter romweber duo-lookout\" - File 1 of 9: \"creative_commons_nzb_dexter_romweber_duo-lookout.rar\" yEnc\n\t\tif (preg_match('/^>>> CREATIVE COMMONS NZB <<< \"(.+?)\" - File \\d+ of \\d+: \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //<<<usenet-space-cowboys.info>>> <<<Powered by https://secretusenet.com>< \"Justin_Bieber-Believe_Acoustic-2013-pLAN9_usenet-space-cowbys.info.rar\" >< 4/6 (78.65 MB) >< 60.84 MB > yEnc\n\t\tif (preg_match('/^.+?usenet-space.+?Powered by.+? \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 .\n\t\t\t\t\t '.+? \\d+\\/\\d+ \\(\\d+[.,]\\d+ [kKmMgG][bB]\\) .+? \\d+[.,]\\d+ [kKmMgG][bB] .+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //\"The Absence - Riders Of The Plague\" [00/14] - \"the_absence-riders_of_the_plague.nzb\" yEnc\n\t\tif (preg_match('/\"(.+)\"[-_\\s]{0,3}[\\(\\[]\\d+\\/(\\d+[\\)\\]])[-_\\s]{0,3}\".+(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//( Albert Cummings Albums 6x By Dready Niek (1999-2012) ) ( ** By Dready Niek ** ) [11/20] - \"Albert Cummings Albums 6x By Dready Niek (1999-2012).part10.rar\" yEnc\n\t\t//( Fat Freddy's Drop - Blackbird (2013) -- By Dready Niek ) -- By Dready Niek ) [01/15] - \"Fat Freddy's Drop - Blackbird (2013) -- By Dready Niek.par2\" yEnc\n\t\tif (preg_match('/\\( (.+?)\\)[-_\\s]{0,3}( |\\().+\\)[-_\\s]{0,3}[\\(\\[]\\d+\\/(\\d+[\\)\\]])[-_\\s]{0,3}\".+(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //( Addison_Road-Addison_Road-2008 ) [01/10] - \"01. Addison Road - This Could Be Our Day.mp3\" yEnc\n\t\tif (preg_match('/\\( (.+?) \\)[-_\\s]{0,3}[\\(\\[]\\d+\\/(\\d+[\\)\\]])[-_\\s]{0,3}\".+(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(????) [0/8] - Crionics Post - Alice In Chains - Dirt REPOST\"Alice In Chains - Dirt.nzb\" yEnc\n\t\tif (preg_match('/^.+?\\[\\d+\\/(\\d+\\][-_\\s]{0,3}.+?)[-_\\s]{0,3}(\"|#34;)(.+?)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}(\"|#34;))[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[3];\n\t\t} //(????) [001/153] - \"C4 House Party Horse Meat Disco Set 6.nfo\" C4 House Party Horse Meat Disco Set 6 yEnc\n\t\tif (preg_match('/^\\(\\?+\\) \\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . '.+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(????) [19/22] - C.K.N. Demo 85 \"19-rotten system.mp3\" yEnc\n\t\tif (preg_match('/^\\(\\?+\\) \\[\\d+\\/\\d+\\] - (.+)[-_\\s]{0,3}\".+?' . $this->e0 . '.+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(03/11) \"Europe - Discography (1983 - 2009) (320 kbps CBR) www.brothers-of-usenet.org - empfehlen - Newsconnection.par2\" yEnc\n\t\t//(03/11) \"Evanescence Diskographie (1998-2011) www.brothers-of-usenet.org - empfehlen - Newsconnection.par2\" yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\)[-_\\s]{0,3}\"(.+?) {1,3}www\\.brothers-of-usenet\\.org - empfehlen - Newsconnection' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(107/123) - \"Mark.EG.M.Zone.Rave.Tape.Packs.Hard.Trance.1990s.vol006+04.PAR2\" - 11.39 GB yEnc\n\t\t//(12/16) \"Horrid Henry The Movie - Original Soundtrack.vol00+01.PAR2\" - 102.32 MB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\)[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[002/123] - \"Mark.EG.M.Zone.Rave.Tape.Packs.Hard.Trance.1990s.part001.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //< usenetrevolution > <-> Partner of ssl-news.info <-> Anastacia.-.It's.a.Mans.World [04/15] - \"Anastacia.-.It's.a.Mans.World.part01.rar\" - 100,47 MB - yEnc\n\t\tif (preg_match('/^.+usenetrevolution.+Partner of ssl-news\\.info.+\\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //<<<Old but Sold>>> <<< >< >< \"German Top 50 ODC - 12.08.2013.nfo\" >< 02/33 (541,61 MB) >< 10,93 kB > yEnc\n\t\tif (preg_match('/^.+Old but Sold.+>< \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' >< \\d+\\/\\d+ \\(\\d+[.,]\\d+ [kKmMgG][bB]\\).+ yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //<<< <ghost-of-usenet.org> <\"MC Basstard Diskographie 16CDs 2000-2011 MP3 - Ghost.part08.rar\"> >www.SSL-News.info< - (10/43) - 1,69 GB yEnc\n\t\t//<<< <ghost-of-usenet.org> >\"UltraTraxx Rare Remixes - Vol 011 MP3 192kbps.par2\"> >www.SSL-News.info< - (1/9) - 120,82 MB yEnc\n\t\tif (preg_match('/^.+ghost-of-usenet.org[<>] [><]\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 .\n\t\t\t\t\t '> >www\\.SSL-News\\.info< - \\(\\d+\\/\\d+\\)[-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB][-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //BY REQ:........! - \"Keith Whitley - All American Country - .par2\" [06/22] yEnc\n\t\tif (preg_match('/^BY REQ.+ - \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t ' \\[\\d+\\/\\d+\\] yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Der etwas andere Mix - Wilde Herzenmix (auf wunsch) neu (by dem verrückten Lordi) (1/8) \"Der etwas andere Mix - Wilde Herzenmix.par2\" yEnc\n\t\tif (preg_match('/^Der etwas.+ \\(\\d+\\/\\d+\\) \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . '.+yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //DJ Inferno Beatport Xtreme September 2011[63/66] - \"DJ Inferno Beatport Xtreme September 2011.vol073+55.PAR2\" upp o-o yEnc\n\t\t//Kastelruther Spatzen - Weihnachten Bei Uns Daheim (2011) (22/25) \"Kastelruther Spatzen - Weihnachten Bei Uns Daheim (2011).vol00+1.PAR2\" - 113,03 MB - Tapier 13.11.02 yEnc\n\t\tif (preg_match('/^.+[\\[\\(]\\d+\\/\\d+[\\)\\]][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . '.+yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //\"8 Wenn ich einmal gross bin .mp3\" Koelschefetz postet.Die Filue -Immer Wigger yEnc\n\t\tif (preg_match('/^\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 . '.+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Queens Of The Stone Age - Rated R (2000) (10th Anniversary Deluxe Edition 2010) [EAC/Lame V0] \"QU2 - Queens of the Stone Age - Rated R.M3u\" yEnc\n\t\tif (preg_match('/^.+\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 . '.+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //squeeze-east side story-nmr- [01/14] - 01-squeeze-in quintessence.mp3 yEnc\n\t\tif (preg_match('/^(.+?)- [\\[\\(]\\d+\\/\\d+[\\)\\]][-_\\s]{0,3}\\d\\d.+?([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4}) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}",
"function sotf_AudioFile($path)\n\n\t{\n\n\t\t$parent = get_parent_class($this);\n\n\t\tparent::$parent($path);\t\t// Call the constructor of the parent class. lk. super()\n\n\t\t// CHANGED BY BUDDHAFLY 06-05-12\n\t\t$getID3 = new getID3();\n\t\t$fileinfo = $getID3->analyze($this->path);\n\t\tgetid3_lib::CopyTagsToComments($fileinfo);\n\t\t\n\t\t//$fileinfo = GetAllFileInfo($this->path);\n\n $this->allInfo = $fileInfo;\n\t\n\t\t//if ($audioinfo[\"fileformat\"] == 'mp3' || $audioinfo[\"fileformat\"] == 'ogg') {\n\n //debug(\"finfo\", $fileinfo);\n\t\n\n if (isset($fileinfo['audio'])) {\n\n $audioinfo = $fileinfo['audio'];\n\n\t\t\t$this->type = \"audio\";\n\n\t\t\t$this->format = $fileinfo[\"fileformat\"];\n\n\t\t\tif ($audioinfo[\"bitrate_mode\"] == 'vbr')\n\n\t\t\t\t$this->bitrate = \"VBR\";\n\n $this->bitrate = round($audioinfo[\"bitrate\"]/1000);\n\n\t\t\t$this->average_bitrate = round($audioinfo[\"bitrate\"]/1000);\n\n\t\t\t$this->samplerate = $audioinfo[\"sample_rate\"];\n\n\t\t\t$this->channels = $audioinfo[\"channels\"];\n\n\t\t\t$this->duration = round($fileinfo[\"playtime_seconds\"]);\n\n\t\t\t$this->mimetype = $this->determineMimeType($this->format);\n\n\t\t}\n\n\t}",
"public function getTranscodedMp3Url(): string|false\n {\n $originalUrl = $this->getOriginalUrl();\n $originalUrlLowercased = mb_strtolower($originalUrl, 'utf-8');\n\n if (!$this->isAudio() || Str::endsWith($originalUrlLowercased, 'mp3')) {\n return false;\n }\n\n $start = preg_quote('://upload.wikimedia.org/wikipedia', '/');\n if (!preg_match(\"/(.*?{$start}\\/.*?)\\/(.*)/i\", $originalUrl, $matches)) {\n return false;\n }\n\n $name = basename($originalUrl);\n\n return \"{$matches[1]}/transcoded/{$matches[2]}/{$name}.mp3\";\n }",
"function _audio($src, $atts = array()) {\n $files = array();\n $isExternal = media_isexternal($src);\n\n if ($isExternal) {\n // take direct source for external files\n list(/*ext*/, $srcMime) = mimetype($src);\n $files[$srcMime] = $src;\n } else {\n // prepare alternative formats\n $extensions = array('ogg', 'mp3', 'wav');\n $files = media_alternativefiles($src, $extensions);\n }\n\n $out = '';\n // open audio tag\n $out .= '<audio '.buildAttributes($atts).' controls=\"controls\">'.NL;\n $fallback = '';\n\n // output source for each alternative audio format\n foreach($files as $mime => $file) {\n if ($isExternal) {\n $url = $file;\n $linkType = 'externalmedia';\n } else {\n $url = ml($file, '', true, '&');\n $linkType = 'internalmedia';\n }\n $title = $atts['title'] ? $atts['title'] : $this->_xmlEntities(utf8_basename(noNS($file)));\n\n $out .= '<source src=\"'.hsc($url).'\" type=\"'.$mime.'\" />'.NL;\n // alternative content (just a link to the file)\n $fallback .= $this->$linkType($file, $title, null, null, null, $cache = null, $linking = 'linkonly', $return = true);\n }\n\n // finish\n $out .= $fallback;\n $out .= '</audio>'.NL;\n return $out;\n }",
"function media_upload_audio()\n {\n }",
"function mp3_func( $atts ) {\n $a = shortcode_atts( array(\n 0 => 'http://missing'\n ), $atts );\n\n\t$mp3url = str_replace(\"www.dropbox\", \"dl.dropbox\", str_replace(\"?dl=0\", \"?\", $a[0]));\n return \"<audio controls style='width: 100%'><source src='{$mp3url}' type='audio/mpeg'>Your browser does not support the audio element.</audio>\";\n}",
"function getmp3($data){\n // $ContentString = $obj -> getGoogleTTS($data);\n // $randfilestring = 'mp3/' . time() . '_' . sprintf('%02d', rand(0, 999)) . \".mp3\";\n // return rtrim(C('site_url'), '/') . $randfilestring;\n return \"\";\n}",
"public function getAudioCodec() {}",
"public function store(Request $request)\n {\n if($request->user()->is_admin == 0)\n {\n return response()->json([\n 'message'=> 'Unauthorized'\n ], 401);\n }\n\n $request->validate([\n 'title'=> 'required|string',\n 'album_title' => 'required|string',\n //'song_file' => 'required|mimeTypes:mp3'\n ]);\n\n //To find the album id from the album title.\n $album = Album::query()->where('title','=',$request->album_title)->get()->first();\n if($album == null)\n {\n return response()->json([\n 'message'=> 'There is no album with title ' . $request->album_title\n ],400);\n }\n\n //generate track_number for the song\n $track_number_string = Song::query()->select('track_number')->where('album_id','=',$album->id)->get()->max();\n if($track_number_string == null){\n $track_number_int = 0;\n }\n else{\n $track_number_int = (int)$track_number_string['track_number'];\n }\n $track_number_int++;\n\n\n $song_file_name = $album->id . '_' . $track_number_int . '_' . $request->title . '.mp3';\n $song_public_path = \"albums/\" . $album->title . \"/\";\n\n //upload the song\n $song_file = $request->file('song_file');\n\n $path = $request->file('song_file')->move(public_path($song_public_path),$song_file_name);\n\n $song_full_url= $song_public_path . $song_file_name;\n\n\n //-----------------Start trimming-----------------\n $trimmed_song_public_path = \"albums/\" . $album->title . \"/\" . 'trimmed/';\n $trimmed_song_full_path = $trimmed_song_public_path . $song_file_name;\n\n //To create the directory trimmed if not created.\n if( File::exists($trimmed_song_public_path)== false)\n {\n File::makeDirectory($trimmed_song_public_path);\n }\n\n MpegAudio::fromFile($song_full_url)->trim(0,30)->saveFile($trimmed_song_full_path);\n //-----------------End trimming-----------------\n\n\n\n\n //-----------------Start calculating duration-----------------\n $song_duration_in_seconds = MpegAudio::fromFile($song_full_url)->getTotalDuration();\n $song_duration_as_time = gmdate('H:i:s', $song_duration_in_seconds);\n\n //-----------------End calculating duration-------------------\n\n $song = new Song([\n 'title'=> $request->title,\n 'album_id' => $album->id,\n 'track_number' => $track_number_int,\n 'duration' => $song_duration_as_time,\n 'file' => $trimmed_song_full_path,\n 'original_file' => $song_full_url,\n ]);\n\n $song->save();\n\n\n //-----------------Start 10s trimming-----------------\n $trimmed_song_public_path_10s = \"songs_10s/\";\n $trimmed_song_full_path_10s = $trimmed_song_public_path_10s . $song->id . '.mp3';\n\n MpegAudio::fromFile($song_full_url)->trim(0,10)->saveFile($trimmed_song_full_path_10s);\n //-----------------End 10s trimming-----------------\n\n return response()->json([\n 'message'=> 'The song was added'\n ], 201);\n }",
"private function agregarMP3($idCancion){\n\t\t$config['upload_path'] = './songs/';\n\t\t$config['allowed_types'] = 'mp3'; \n\t\t$config['file_name'] = $idCancion;\n\n\t\t$config['overwrite'] = true;\n\t\t$this->load->library('upload', $config);\n\t\t$exito = false;\n\t\tif($this->upload->do_upload('cancion')){\n\t\t\t$exito = true;\n\t\t\t$data = $this->upload->data();\n\n\t\t\t\t\t\t\n\t\t\t//Borra el archivo original\n\t\t\t//unlink($file_path);\n\t\t\t\n\t\t}\n\t\treturn $exito;\n\t}",
"static function DecodeAndDumpMp3($filepath)\n\t\t{\n\t\t\t// --------------------------------------------------------\n\t\t\t// Increase the memory limit for complete file allocation.\n\t\t\t// Earlier 8 MB now 25 MB\n\t\t\t// --------------------------------------------------------\n\t\t\tini_set(\"memory_limit\",\"25M\");\n\t\t\t// --------------------------------------------------------\n\t\t\t\n\t\t\techo(file_get_contents($filepath, FILE_BINARY, null, 52)) ;\n\t\t}",
"function receiveAudio($title,$path_upload, $author, $maxfilebytes)\r\n {\r\n \r\n global $xoopsUser, $xoopsDB, $_POST, $_FILES;\r\n //busca id do user logado\r\n $uid = $xoopsUser->getVar('uid');\r\n //create a hash so it does not erase another file\r\n //$hash1 = date();\r\n //$hash = substr($hash1,0,4);\r\n \r\n // mimetypes and settings put this in admin part later\r\n $allowed_mimetypes = array( \"audio/mp3\" , \"audio/x-mp3\", \"audio/mpeg\");\r\n $maxfilesize = $maxfilebytes;\r\n \r\n // create the object to upload\r\n $uploader = new XoopsMediaUploader($path_upload, $allowed_mimetypes, $maxfilesize);\r\n // fetch the media\r\n if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {\r\n //lets create a name for it\r\n $uploader->setPrefix('aud_'.$uid.'_');\r\n //now let s upload the file\r\n if (!$uploader->upload()) {\r\n // if there are errors lets return them\r\n echo \"<div style=\\\"color:#FF0000; background-color:#FFEAF4; border-color:#FF0000; border-width:thick; border-style:solid; text-align:center\\\"><p>\".$uploader->getErrors().\"</p></div>\";\r\n return false;\r\n } else {\r\n // now let s create a new object audio and set its variables\r\n //echo \"passei aqui\";\r\n $audio = $this->create();\r\n $url = $uploader->getSavedFileName();\r\n $audio->setVar(\"url\",$url);\r\n $audio->setVar(\"title\",$title);\r\n $audio->setVar(\"author\",$author);\r\n $uid = $xoopsUser->getVar('uid');\r\n $audio->setVar(\"uid_owner\",$uid);\r\n $this->insert($audio);\r\n $saved_destination = $uploader->getSavedDestination();\r\n //print_r($_FILES);\r\n }\r\n } else {\r\n echo \"<div style=\\\"color:#FF0000; background-color:#FFEAF4; border-color:#FF0000; border-width:thick; border-style:solid; text-align:center\\\"><p>\".$uploader->getErrors().\"</p></div>\";\r\n return false;\r\n }\r\n return true;\r\n }",
"function synthesizeOnline($vocalwareLID, $vocalwareVID, $text, $filename)\n {\n $error = false;\n $errormessage = null;\n $errorcode = 0;\n $output = array();\n \n $curl = curl_init();\n\n\n\t\t// A Vocalware account is needed\n $url = \"\";\n $secret_phrase = \"\";\n\n // Vocalware API identification is required\n $data = array(\n 'EID' => '2',\n 'LID' => $vocalwareLID,\n 'VID' => $vocalwareVID,\n 'TXT' => $text,\n 'EXT' => 'mp3',\n 'ACC' => '', // required\n 'API' => '' // required \n );\n\n $data['CS'] = md5($data['EID'].$data['LID'].$data['VID'].$data['TXT'].$data['EXT'].$data['ACC'].$data['API'].$secret_phrase);\n\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n $result = curl_exec($curl);\n\n curl_close($curl);\n \n // if no error occurred (we assume there's an error if the mp3 data is less than 1000 characters)\n if ($result && !strpos($result, \"Error: \") && (strlen($result) > 1000)) {\n\n try {\n $filenamewrite = \"mp3/\".$filename.\".mp3\";\n $fitxertxtwrite = fopen($filenamewrite,\"w+b\");\n\n if (flock($fitxertxtwrite, LOCK_EX)) {\n fwrite($fitxertxtwrite, $result);\n flock($fitxertxtwrite, LOCK_UN);\n fclose($fitxertxtwrite);\n }\n } catch (Exception $ex) {\n $error = true;\n $errormessage = \"Error. An error occurred while writing the audio file.\";\n $errorcode = 108;\n }\n }\n // if there was an error\n else {\n $error = true;\n $errormessage = \"Error. An error occurred while contacting the online voice service. Try again.\";\n $errorcode = 109;\n }\n \n $output[0] = $error;\n $output[1] = $errormessage;\n $output[2] = $errorcode;\n return $output;\n }",
"function uploadAudioFile($objectType, $objectID){\r\n\t\t$fileOldNameKey = $objectType . \"AudioFile\";\r\n\t\t$fileOldName = basename($_FILES[$fileOldNameKey]['name']);\r\n\t\t$fileExt = substr(strrchr($fileOldName, '.'), 1);\r\n\t\t$fileNewPath = \"audio/\" . $objectType . \"s/\";\r\n\t\t$fileNewName = getNextAudioFileName($objectID, $objectType);\r\n\t\t$targetAudioPath = $fileNewPath . $fileNewName . \".\" . $fileExt;\r\n\t\r\n\t\tif(move_uploaded_file($_FILES[$fileOldNameKey]['tmp_name'], $targetAudioPath)) {\r\n\t\t\techo \"The file \". $fileOldName . \" has been uploaded.\";\r\n\t\t\t//Now we must update the audioFile table to reflect our new file\r\n\t\t\tinsertIntoTable(\"audioFile\", array(\"linguisticObjectID\" => $objectID, \"linguisticObjectTypeID\" => getLinguisticObjectTypeID($objectType), \"audioFileName\" => \"'\".$fileNewName.\"'\", \"audioFileFormatID\" => getAudioFileFormatID($fileExt), \"audioFilePath\" => \"'\".$fileNewPath.\"'\"));\r\n\t\t} \r\n\t\telse{\r\n\t\t\techo \"There was a non-fatal error uploading the audio.\";\r\n\t\t}\r\n}",
"function synthesizeAudio($md5, $text, $voice, $type, $language, $rate)\n { \n \t\n // DEBUG\n \t// echo \"T: \".$text.\"; V: \".$voice.\"; Ty: \".$type.\"; L: \".$language;\n \t\n $CI = &get_instance();\n $CI->load->model('Audio_model');\n \n $output = array();\n $error = false;\n $errormessage = null;\n $errorcode = 0;\n $filename = null;\n $extension = \"mp3\";\n \n // if it's an online voice\n if ($type == \"online\") {\n \n // default voice ES masc (Jorge)\n $vocalwareLID = 2;\n $vocalwareVID = 6;\n \n // if it's a default interface voice\n if (preg_match(\"/DEFAULT \\(/i\", $voice)) {\n $isfem = true;\n if (preg_match(\"/DEFAULT \\(masc\\)/i\", $voice)) $isfem = false;\n \n // get default values for the interface voice in each language\n switch ($language) {\n \n // CA\n case 1:\n $vocalwareLID = 5;\n if ($isfem) $vocalwareVID = 1;\n else $vocalwareVID = 2;\n break;\n \n // ES\n case 2:\n $vocalwareLID = 2;\n if ($isfem) $vocalwareVID = 1;\n else $vocalwareVID = 6;\n break;\n \n // EN\n case 3:\n $vocalwareLID = 1;\n if ($isfem) $vocalwareVID = 1;\n else $vocalwareVID = 2;\n break;\n \n default:\n $error = true;\n $errormessage = \"Error. Default voice not found for this language.\";\n $errorcode = 106;\n break;\n } \n }\n // the voice is the id of the voice in the database\n else {\n // we get the info of the voice from the database\n $auxrow = $CI->Audio_model->getOnlineVoices((int) $voice);\n $voiceinfo = $auxrow[0];\n \n $vocalwareLID = $voiceinfo->vocalwareIdLang;\n $vocalwareVID = $voiceinfo->vocalwareVoiceId;\n }\n \n if (!$error) {\n $auxresponse = $this->synthesizeOnline($vocalwareLID, $vocalwareVID, $text, $md5);\n // if there was an error\n if ($auxresponse[0]) {\n $error = true;\n $errormessage = $auxresponse[1];\n $errorcode = $auxresponse[2];\n }\n }\n \n }\n // si la veu és offline\n else {\n $user_agent = $this->getOS();\n \n switch ($user_agent) {\n case \"Mac OS X\":\n $extension = \"m4a\";\n \n $auxresponse = $this->synthesizeMacOSX($voice, $text, $md5, $rate);\n // if there was an error\n if ($auxresponse[0]) {\n $error = true;\n $errormessage = $auxresponse[1];\n $errorcode = $auxresponse[2];\n }\n\n break;\n \n case \"Windows\":\n \n $auxresponse = $this->synthesizeWindows($voice, $text, $md5);\n // if there was an error\n if ($auxresponse[0]) {\n $error = true;\n $errormessage = $auxresponse[1];\n $errorcode = $auxresponse[2];\n }\n \n break;\n\n default:\n $error = true;\n $errormessage = \"Error. Your OS is not compatible with offline voices. \"\n . \"Change your voices in your user configuration settings.\";\n $errorcode = 107;\n break;\n }\n }\n \n if (!$error) {\n $filename = $md5.\".\".$extension;\n $CI->Audio_model->saveAudioFileToDatabase($text, $md5, $filename);\n }\n \n $output[0] = $filename;\n $output[1] = $error;\n $output[2] = $errormessage;\n $output[3] = $errorcode;\n \n return $output;\n }",
"function getEncodedString($type, $file) {\n\treturn 'data:audio/' . $type . ';base64,' . base64_encode(file_get_contents($file));\n}",
"private function _isAudio($fileName, $mime)\n {\n \n /*return strpos($mime, self::MIME_CONTENT_TYPE_CATEGORY_AUDIO) === 0\n || $this->_isOggVorbis($fileName, $mime)\n || $this->_getContainerType($fileName)==\"audio\"\n || $this->_isWma($fileName);\n// Functions _isOggVorbis and _isWma below, are executed to handle backward compatibility (they converts mimeType) - Needs to be improved\n*/\n\t\n\t\n $this->_isOggVorbis($fileName, $mime);\n $this->_isWma($fileName);\n//echo $this->_getContainerType($fileName)==\"audio\".$this->_isMidi($fileName).\"wojak\";\n\n return $this->_getContainerType($fileName)==\"audio\" || $this->_isMidi($fileName);\n\n }",
"function copyFileToLocal($fileid){\n#set target path for storing audio files on the server\n$audio_upload_path = \"/home/dingz/dataset/audiofiles/0/\" .$fileid. \".wav\";\n#get and store uploaded audio files on the server\nif(copy($_FILES['uploadedfile']['tmp_name'], $audio_upload_path)) {\n #echo \"File uploaded!\\n\";\n return TRUE;\n} else{\n echo \"There was an error uploading the file...\\nThe developer is notified with this problem. Sorry for the inconvenience!\\n\";\n #error_log(\"Attendance System:\\nVerification: Uploading file failed!\", 1, \"[email protected]\");\n\treturn FALSE;\n}\n}",
"function sp_audio_sc( $atts ) {\n\n\textract( shortcode_atts( array(\n\t\t'mp3' => '',\n\t\t'ogg' => '',\n\t\t'width' => '',\n\t\t'height' => '',\n\t\t'preload' => false,\n\t\t'autoplay' => false,\n\t), $atts ) );\n\n\tglobal $post;\n\n\tif ( $mp3 )\n\t\t$mp3 = '<source src=\"' . $mp3 . '\" type=\"audio/mp3\" />';\n\n\tif ( $ogg )\n\t\t$ogg = '<source src=\"' . $ogg . '\" type=\"audio/ogg\" />';\n\n\tif ( $preload )\n\t\t$preload = 'preload=\"' . $preload . '\"';\n\n\tif ( $autoplay )\n\t\t$autoplay = 'autoplay';\n\n\t$output = \"<audio id='AudioPlayerV1-id-$post->ID' class='AudioPlayerV1' width='100%' height='29' controls {$preload} {$autoplay} data-fallback='\" . SP_BASE_URL . \"js/audioplayerv1.swf'>\n\t\t\t\t\t{$mp3}\n\t\t\t\t\t{$ogg}\n\t\t\t\t</audio>\";\n\n\treturn $output;\n\n}",
"public function downloadAudioFile($vid, $mid){\n $file_path = null;\n $response = [];\n \n $media = Media::load($mid);\n if(empty($media)){\n $response = ['vid' => $m->video_id, 'cmd' => 'Copy media file to temporary directory!', 'output_file' => null, 'output_value' => 'Couldn\\'t load audio file.', 'return_value' => 1];\n $this->trackProcessingStage($response, 'Copy-to-temp-directory');\n }else{\n $fid = null;\n $file_uri = null;\n $type = $media->bundle(); \n // audio\n if(($type == 'audio') && !empty($media->field_media_audio_file->entity)) {\n $fid = $media->field_media_audio_file->target_id;\n $file_uri = $media->field_media_audio_file->entity->getFileUri();\n }\n \n if(empty($fid)){\n $response = ['vid' => $vid, 'cmd' => 'Copy audio file to temporary directory!', 'output_file' => null, 'output_value' => 'File doesn\\'t exists.', 'return_value' => 1];\n $this->trackProcessingStage($response, 'Copy-to-temp-directory');\n }else{\n $file = File::load($fid);\n $file_name = $file->getFilename();\n $destination = $this->createTmpDir($vid) . '/' . $file_name;\n if($file = file_copy($file, $destination, FILE_EXISTS_REPLACE)) {\n $file_path = drupal_realpath($destination);\n }else {\n $response = ['vid' => $vid, 'cmd' => 'Copy audio file to temporary directory!', 'output_file' => null, 'output_value' => 'Couldn\\'t copy the file into temporary directory.', 'return_value' => 1];\n $this->trackProcessingStage($response, 'Copy-to-temp-directory');\n }\n }\n }\n \n return $file_path;\n }",
"function dahz_get_audio_transcript( $post_id = 0 ) {\n\n\tif ( empty( $post_id ) )\n\t\t$post_id = get_the_ID();\n\n\t/* Set up some default variables and get the image metadata. */\n\t$lyrics = '';\n\t$meta = wp_get_attachment_metadata( $post_id );\n\n\t/* Look for the 'unsynchronised_lyric' tag. */\n\tif ( isset( $meta['unsynchronised_lyric'] ) )\n\t\t$lyrics = $meta['unsynchronised_lyric'];\n\n\t/* Seen this misspelling of the id3 tag. */\n\telseif ( isset( $meta['unsychronised_lyric'] ) )\n\t\t$lyrics = $meta['unsychronised_lyric'];\n\n\t/* Apply filters for the transcript. */\n\treturn apply_filters( 'dahz_audio_transcript', $lyrics );\n}",
"function getAudio($office,$name){\n echo '<audio controls>';\n echo ' <source src=\"../' . $office . '-audio/' . $name . '.ogg\" />';\n echo ' <source src=\"../' . $office . '-audio/' . $name . '.mp3\" />';\n echo '</audio><br />'; \n }",
"public function playerAudio($item) {\r\n\t\t$link_audio = ConfigVO::getUrlAudio().$item;\r\n \t$html_player = \"<object type=\\\"application/x-shockwave-flash\\\" data=\\\"\".ConfigVO::URL_SITE.\"FlowPlayerDark.swf\\\" width=\\\"320\\\" height=\\\"29\\\" id=\\\"FlowPlayer\\\"><param name=\\\"allowScriptAccess\\\" value=\\\"sameDomain\\\" /><param name=\\\"movie\\\" value=\\\"\".ConfigVO::URL_SITE.\"FlowPlayerDark.swf\\\" /><param name=\\\"quality\\\" value=\\\"high\\\" /><param name=\\\"scale\\\" value=\\\"noScale\\\" /><param name=\\\"wmode\\\" value=\\\"transparent\\\" /><param name=\\\"flashvars\\\" value=\\\"config={videoFile: '\".$link_audio.\"', autoBuffering: false, streamingServer: 'lighttpd', initialScale: 'orig', loop: false }\\\" /></object>\";\r\n return $html_player;\r\n }",
"function updateAudioFile($audioFileID, $fileName = '', $fileExt = 'mp3', $filePath = 'audio/'){\r\n\t$audioFileFormatDiscoveryQuery = \"SELECT audioFileFormatID FROM audioFileFormat WHERE audioFileFormatExtension = '\" . $fileExt . \"'\";\r\n\tif(!$audioFileFormatDiscoveryResult = mysql_query($audioFileFormatDiscoveryQuery)){ echo ('Query failed: ' . mysql_error()) . \"Query Text: \" . $audioFileFormatDiscoveryQuery; mysql_query(\"ROLLBACK\");die();}\r\n\tif(mysql_num_rows($audioFileFormatDiscoveryResult) > 0){\r\n\t\t$audioFileFormatDiscoveryRow = mysql_fetch_array($audioFileFormatDiscoveryResult);\r\n\t\t$audioFileFormatID = $audioFileFormatDiscoveryRow['audioFileFormatID'];\r\n\t}\r\n\telse{\r\n\t\t$audioFileFormatID = insertIntoTable(\"audioFileFormat\", array(\"audioFileFormatExtension\" => \"'\".$fileExt.\"'\"));\r\n\t}\r\n\t//Now, we see whether or not this audio file is already extant in the table somewhere\r\n\t$audioFileDiscoveryQuery = \"SELECT audioFileID FROM audioFile WHERE audioFileName = '\" . \r\n\t\t$fileName . \"' AND audioFilePath = '\" . \r\n\t\t$filePath . \"' AND audioFileFormatID = \" . \r\n\t\t$audioFileFormatID;\r\n\tif(!$audioFileDiscoveryResult = mysql_query($audioFileDiscoveryQuery)){ echo ('Query failed: ' . mysql_error()) . \"Query Text: \" . $audioFileDiscoveryQuery; mysql_query(\"ROLLBACK\");die();}\r\n\tif(mysql_num_rows($audioFileDiscoveryResult) > 0){\r\n\t//If it is extant, we must delete it! Otherwise we'll get a uniqueness constraint failure when we update our autogen.\r\n\t\t$audioFileDiscoveryRow = mysql_fetch_array($audioFileDiscoveryResult);\r\n\t\tdeleteFromTable(\"audioFile\", $audioFileDiscoveryRow['audioFileID'], \"audioFileID\");\r\n\t}\r\n\t//Next, update the audio file with the new info\r\n\t$audioFileUpdateQuery = \"UPDATE audioFile SET audioFileName = '\" .\r\n\t\tmysql_real_escape_string($fileName) . \"', audioFilePath = '\" .\r\n\t\tmysql_real_escape_string($filePath) . \"', audioFileFormatID = \" .\r\n\t\t$audioFileFormatID . \" WHERE audioFileID = \" . \r\n\t\tmysql_real_escape_string($audioFileID);\r\n\tif(!$audioFileUpdateResult = mysql_query($audioFileUpdateQuery)){echo ('Query failed: ' . mysql_error() . \"QUERY TEXT: \" . $audioFileUpdateQuery); mysql_query(\"ROLLBACK\");die();} \r\n}"
]
| [
"0.6702458",
"0.66679907",
"0.6605065",
"0.6211908",
"0.6114414",
"0.61138326",
"0.6086373",
"0.6075781",
"0.6043667",
"0.59063613",
"0.5867819",
"0.5796195",
"0.5764879",
"0.57427394",
"0.5725373",
"0.56024104",
"0.5587688",
"0.5540693",
"0.5316218",
"0.53105104",
"0.5253088",
"0.52459985",
"0.5220364",
"0.5191668",
"0.5179836",
"0.5129602",
"0.5106997",
"0.5100129",
"0.5080677",
"0.50717586"
]
| 0.7738703 | 0 |
Decodes an audio file into a PCM WAV file. | private function _decodeAudio($fileName, $outputFileName)
{
if (strpos($this->_getFileType($fileName), 'Standard MIDI data') !== false)
{
$transcodeWavCmd = sprintf('%s -Ow -o %s %s 2>&1',
self::TRANSCODE_TIMIDITY_CMD, $outputFileName,
escapeshellarg($fileName));
}
else
{
$transcodeWavCmd = sprintf('/usr/bin/env MPLAYER_VERBOSE=-2 %s -msglevel all=5 -nolirc -nojoystick -vo null -vc null -ao pcm:fast:waveheader:file=%s %s 2>&',
self::TRANSCODE_MPLAYER_CMD,
$outputFileName,
escapeshellarg($fileName));
/* MPlayer doesn't seem to give any exit status codes :( */
}
// FIX check for errors!
exec($transcodeWavCmd);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _transcodeAudio($fileName, $outputFilePath, $mime)\n {\n $outputFilePath .= '.mp3';\n \n if ($mime == self::MIME_CONTENT_TYPE_MPEG)\n {\n // MP3 - Don't need to transcode FIX should we recode?\n // FIX check that it actually is a MPEG-1 Audio Layer 3 file\n // FIX check for errors!\n copy($fileName, $outputFilePath);\n }\n // We use mplayer with wma files to dump wav before encoding to mp3 with lame\n else //if ($this->_isWma($fileName))\n {\n \n if ($this->_isMidi($fileName) !== false)\n {\n $midiToWaveCmd = sprintf(str_replace(\"transcoder.class.php\", 'transcode/transcodeMidi.sh', __file__). \" %s %s %s %s %s > /dev/null 2>&1 &\",\n self::TRANSCODE_TIMIDITY_CMD,\n self::TRANSCODE_FFMPEG_CMD,\n escapeshellarg($fileName),\n escapeshellarg($outputFilePath),\n str_replace(\"transcoder.class.php\", 'transcode/transcodeaudio.sh', __file__));\n \n exec($midiToWaveCmd, $cmdOutput, $exitCode);\n } else\n {\n $transcodeWmaCommand = sprintf(str_replace(\"transcoder.class.php\", 'transcode/transcodeaudio.sh', __file__).' %s %s %s >/dev/null 2>&1 &',\n self::TRANSCODE_FFMPEG_CMD,\n escapeshellarg($fileName),\n escapeshellarg($outputFilePath));\n //echo $transcodeWmaCommand.\"<br /><br />\";\n exec($transcodeWmaCommand, $cmdOutput, $exitCode);\n file_put_contents($fileName.\".log\",$cmdOutput);\n }\n/*foreach($cmdOutput as $line)\n {\n echo $line.\"<br />\\n\";\n }\n die();*/\n }\n /*else\n {\n \n $pcmFile = $fileName;\n $pcmIsTmp = false;\n if ($mime != self::MIME_CONTENT_TYPE_WAV)\n {\n $pcmFile = tempnam(self::TRANSCODE_TMP_DIR, 'transcode');\n $this->_decodeAudio($fileName, $pcmFile);\n $pcmIsTmp = true;\n }\n \n $transcodeMp3Cmd = sprintf('%s --quiet --abr 192 %s %s 2>&1',\n self::TRANSCODE_LAME_CMD, $pcmFile, \n escapeshellarg($outputFilePath));\n \n // FIX check for errors!\n exec($transcodeMp3Cmd); \n\n if ($pcmIsTmp) \n {\n unlink($pcmFile);\n }\n\n }*/\n \n return array('newFileName' => basename($outputFilePath), \n 'convertedMime' => 'audio/mpeg',\n 'detectedMime' => $this->_detectedMime);\n }",
"public function getAudioCodec() {}",
"function ReceivedAudio($f, $t, $d, $byteRateAdjust)\n {\n $this->ok = 0;\n $this->dbg = $d;\n $this->chunksParsed = 0;\n $this->calcStart($t);\n $this->fileName = $f;\n if (!($fp = fopen($f, \"rb\")))\n {\n echo (\"Failed to open \" . $f);\n return;\n }\n $str = fread($fp, 4);\n if ($str == \"RIFF\") // all .WAV files must have this\n {\n $str = fread($fp, 4);\n for ($i = 3; $i >=0; $i--)\n {\n $this->hdrSize *= 256;\n $this->hdrSize += ord($str[$i]);\n }\n if ($this->dbg) echo (\"hdrSize = \" . $this->hdrSize . \"<br/>\");\n\n $str = fread($fp, 4);\n if ($str == \"WAVE\") // all .WAV files must have this\n {\n $str = fread($fp, 4); $this->fmt = $str;\n if ($str == \"fmt \") // all .WAV files must have this\n {\n $str = fread($fp, 4); $this->fmt .= $str;\n $chunkSize = 0;\n for ($i = 3; $i >=0; $i--)\n {\n $chunkSize *= 256;\n $chunkSize += ord($str[$i]);\n }\n $str = fread($fp, 2); $this->fmt .= $str;\n $this->waveFormat = ord($str[0]) + 256 * ord($str[1]);\n if ($this->dbg) echo (\"File has format: \" . $this->waveFormat . \"<br/>\");\n $str = fread($fp, 2); $this->fmt .= $str;\n $this->numChannels = ord($str[1]);\n $this->numChannels *= 256;\n $this->numChannels += ord($str[0]);\n if ($this->dbg) echo (\"File has \" . $this->numChannels . \" channels<br/>\");\n $str = fread($fp, 4); $this->fmt .= $str;\n for ($i = 3; $i >=0; $i--)\n {\n $this->sampleRate *= 256;\n $this->sampleRate += ord($str[$i]);\n }\n if ($this->dbg) echo (\"File has \" . $this->sampleRate . \" sample rate<br/>\");\n $str = fread($fp, 4); $this->fmt .= $str;\n for ($i = 3; $i >=0; $i--)\n {\n $this->byteRate *= 256;\n $this->byteRate += ord($str[$i]);\n }\n if ($this->dbg) echo (\"File has \" . $this->byteRate . \" byteRate<br/>\");\n $this->byteRateAdjusted = $this->byteRate * $byteRateAdjust;\n $str = fread($fp, 2); $this->fmt .= $str;\n $this->blockAlign = ord($str[0]) + 256 * ord($str[1]);\n if ($this->dbg) echo (\"File has \" . $this->blockAlign . \" blockAlign<br/>\");\n $str = fread($fp, 2); $this->fmt .= $str;\n $this->bitsPerSample = ord($str[0]) + 256 * ord($str[1]);\n if ($this->dbg) echo (\"File has \" . $this->bitsPerSample . \" bitsPerSample<br/>\");\n if ($chunkSize > 16)\n {\n $this->extraFmt = fread($fp, $chunkSize-16); // keep whole fmt\n $this->fmt .= $this->extraFmt;\n }\n $this->firstData = ftell($fp);\n $str = fread($fp, 4);\n if ($str == \"data\")\n {\n $this->ok = 1;\n if ($this->dbg) echo (\"File \" . $f . \" is OK<br/>\");\n } else {if ($this->dbg) echo (\"File \" . $f . \" error on data block<br/>\");}\n } else {if ($this->dbg) echo (\"File \" . $f . \" is not 'fmt' file<br/>\"); }\n } else {if ($this->dbg) echo (\"File \" . $f . \" is not a WAVE file<br/>\"); }\n } else {if ($this->dbg) echo (\"File \" . $f . \" is wrong format<br/>\"); }\n \n fclose($fp);\n $this->approxLenSec = $this->hdrSize / $this->byteRateAdjusted;\n if ($this->dbg) echo (\"approxLenSec = \" . $this->approxLenSec . \"<br/>\");\n }",
"static function DecodeAndDumpMp3($filepath)\n\t\t{\n\t\t\t// --------------------------------------------------------\n\t\t\t// Increase the memory limit for complete file allocation.\n\t\t\t// Earlier 8 MB now 25 MB\n\t\t\t// --------------------------------------------------------\n\t\t\tini_set(\"memory_limit\",\"25M\");\n\t\t\t// --------------------------------------------------------\n\t\t\t\n\t\t\techo(file_get_contents($filepath, FILE_BINARY, null, 52)) ;\n\t\t}",
"function wp_read_audio_metadata($file)\n {\n }",
"public static function decodeFromFile($path);",
"private function decode($filename)\n {\n $this->decoding = true;\n $this->clearvariables();\n $this->loadfile($filename);\n $this->get_gif_header();\n $this->get_graphics_extension(0);\n $this->get_application_data();\n $this->get_application_data();\n $this->get_image_block(0);\n $this->get_graphics_extension(1);\n $this->get_comment_data();\n $this->get_application_data();\n $this->get_image_block(1);\n $f = 0;\n while (!$this->checkbyte(0x3b) && !$this->checkEOF()) {\n $f++;\n $this->get_comment_data();\n $this->get_graphics_extension(2);\n $this->get_image_block(2);\n }\n $this->writeframes(time());\n $this->closefile();\n $this->decoding = false;\n }",
"public function setAudioCodec($val)\n {\n $this->_propDict[\"audioCodec\"] = $val;\n return $this;\n }",
"public function run() {\n $data = [\n ['codec' => 'AAC 2.0'],\n ['codec' => 'FLAC 2.0'],\n ['codec' => 'FLAC 5.1'],\n ['codec' => 'FLAC 7.1'],\n ['codec' => 'DTS-HD MA 2.0'],\n ['codec' => 'DTS-HD MA 5.1'],\n ['codec' => 'DTS-HD MA 7.1'],\n ['codec' => 'TrueHD 2.0'],\n ['codec' => 'TrueHD 5.1'],\n ['codec' => 'TrueHD 7.1'],\n ['codec' => 'TrueHD 5.1 Atmos'],\n ['codec' => 'TrueHD 7.1 Atmos'],\n ];\n\n foreach ($data as $item) {\n CodecAudio::create($item);\n }\n }",
"function decodeFile($file, $strict = false);",
"public function downloadAudioFile($vid, $mid){\n $file_path = null;\n $response = [];\n \n $media = Media::load($mid);\n if(empty($media)){\n $response = ['vid' => $m->video_id, 'cmd' => 'Copy media file to temporary directory!', 'output_file' => null, 'output_value' => 'Couldn\\'t load audio file.', 'return_value' => 1];\n $this->trackProcessingStage($response, 'Copy-to-temp-directory');\n }else{\n $fid = null;\n $file_uri = null;\n $type = $media->bundle(); \n // audio\n if(($type == 'audio') && !empty($media->field_media_audio_file->entity)) {\n $fid = $media->field_media_audio_file->target_id;\n $file_uri = $media->field_media_audio_file->entity->getFileUri();\n }\n \n if(empty($fid)){\n $response = ['vid' => $vid, 'cmd' => 'Copy audio file to temporary directory!', 'output_file' => null, 'output_value' => 'File doesn\\'t exists.', 'return_value' => 1];\n $this->trackProcessingStage($response, 'Copy-to-temp-directory');\n }else{\n $file = File::load($fid);\n $file_name = $file->getFilename();\n $destination = $this->createTmpDir($vid) . '/' . $file_name;\n if($file = file_copy($file, $destination, FILE_EXISTS_REPLACE)) {\n $file_path = drupal_realpath($destination);\n }else {\n $response = ['vid' => $vid, 'cmd' => 'Copy audio file to temporary directory!', 'output_file' => null, 'output_value' => 'Couldn\\'t copy the file into temporary directory.', 'return_value' => 1];\n $this->trackProcessingStage($response, 'Copy-to-temp-directory');\n }\n }\n }\n \n return $file_path;\n }",
"static function EncodeMp3($filepath)\n\t\t{\n\t\t\t// --------------------------------------------------------\n\t\t\t// Increase the memory limit for complete file allocation.\n\t\t\t// Earlier 8 MB now 25 MB\n\t\t\t// --------------------------------------------------------\n\t\t\tini_set(\"memory_limit\",\"80M\");\n\t\t\t// --------------------------------------------------------\n\t\t\t\n\t\t\t$temp_name = $filepath.\"_write\" ;\n\t\t\t\n\t\t\t// Create a file with temp name.\n\t\t\t$to_write = fopen($temp_name, \"xb\") ;\n\t\t\t$filedata = file_get_contents($filepath, FILE_BINARY) ;\n\t\t\t\n\t\t\t// Write 2 chars MX into the file\n\t\t\tfputs($to_write, \"MX\".CUtils::GetRandString(50)) ;\n\t\t\t\n\t\t\t// Now write complete file to temp file.\n\t\t\tfwrite($to_write, $filedata) ;\n\t\t\t\n\t\t\t// Close file handle.\n\t\t\tfclose($to_write) ;\n\t\t\t\n\t\t\t// Delete uploaded file.\n\t\t\tunlink($filepath) ;\n\t\t\t\n\t\t\t// Rename encoded file.\n\t\t\trename($temp_name, $filepath) ;\n\t\t}",
"public function setAudio($var)\n {\n GPBUtil::checkMessage($var, \\Volc\\Service\\Vod\\Models\\Business\\Audio::class);\n $this->Audio = $var;\n\n return $this;\n }",
"public function getAudioCodec()\n {\n if (array_key_exists(\"audioCodec\", $this->_propDict)) {\n if (is_a($this->_propDict[\"audioCodec\"], \"\\Microsoft\\Graph\\CallRecords\\Model\\AudioCodec\") || is_null($this->_propDict[\"audioCodec\"])) {\n return $this->_propDict[\"audioCodec\"];\n } else {\n $this->_propDict[\"audioCodec\"] = new AudioCodec($this->_propDict[\"audioCodec\"]);\n return $this->_propDict[\"audioCodec\"];\n }\n }\n return null;\n }",
"public function getAudio()\n {\n return $this->audio;\n }",
"private function _isAudio($fileName, $mime)\n {\n \n /*return strpos($mime, self::MIME_CONTENT_TYPE_CATEGORY_AUDIO) === 0\n || $this->_isOggVorbis($fileName, $mime)\n || $this->_getContainerType($fileName)==\"audio\"\n || $this->_isWma($fileName);\n// Functions _isOggVorbis and _isWma below, are executed to handle backward compatibility (they converts mimeType) - Needs to be improved\n*/\n\t\n\t\n $this->_isOggVorbis($fileName, $mime);\n $this->_isWma($fileName);\n//echo $this->_getContainerType($fileName)==\"audio\".$this->_isMidi($fileName).\"wojak\";\n\n return $this->_getContainerType($fileName)==\"audio\" || $this->_isMidi($fileName);\n\n }",
"public function createMediaData($field, $file, $logger = null)\n\t{\n\t\t// Setup Logger if not registered already done\n\t\tif (!$logger)\n\t\t{\n\t\t\t$this->_setUpLogger($logger);\n\t\t}\n\n\t\t// Absolute file path (or URL ?)\n\t\t$full_path = $file->full_path;\n\n\t\t// Get the extension to record it in the DB\n\t\t$ext = strtolower(flexicontent_upload::getExt($full_path));\n\n\n\t\t/**\n\t\t * Get and check file path of ffprobe\n\t\t */\n\t\t$ffprobe_path = $field->parameters->get('mm_ffprobe_path', '');\n\n\t\tif ($ffprobe_path && !file_exists($ffprobe_path))\n\t\t{\n\t\t\t$error_mssg = $file->filename . ' : Failed to open ffprobe path: ' . $ffprobe_path;\n\t\t\t$this->setError($error_mssg);\n\t\t\tJLog::add($error_mssg, JLog::ERROR, $logger->namespace);\n\t\t\t$ffprobe_path = '';\n\t\t}\n\n\n\t\t/**\n\t\t * Create audio preview file\n\t\t */\n\t\tif ($ffprobe_path && in_array($ext, array('wav', 'mp3', 'aiff', 'mp4', 'mpg', 'mpeg', 'avi')))\n\t\t{\n\t\t\t$disabled_funcs = [];\n\t\t\tif (FLEXIUtilities::funcIsDisabled('escapeshellarg')) $disabled_funcs[] = \"escapeshellarg\";\n\t\t\tif (FLEXIUtilities::funcIsDisabled('shell_exec')) $disabled_funcs[] = \"shell_exec\";\n\n\t\t\tif ($disabled_funcs)\n\t\t\t{\n\t\t\t\t$error_mssg = \"Cannot detect audio properties. Function(s): \" . implode(', ', $disabled_funcs) . \" are disabled. \\n\";\n\t\t\t\t$this->setError($error_mssg);\n\t\t\t\tJLog::add($error_mssg, JLog::ERROR, $logger->namespace);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Default options\n\t\t\t$options = '-loglevel quiet -show_format -show_streams -print_format json';\n\t\t\t//$options .= ' -pretty';\n\n\t\t\t// Avoid escapeshellarg() issues with UTF-8 filenames\n\t\t\tsetlocale(LC_CTYPE, 'en_US.UTF-8');\n\n\t\t\t// Run the ffprobe, save the JSON output then decode\n\t\t\t//ffprobe -v error -show_format -show_streams input.mp4\n\t\t\t$json_cmd = sprintf($ffprobe_path.' %s %s', $options, escapeshellarg($full_path));\n\t\t\t$json_data = shell_exec($json_cmd);\n\t\t\t$json = json_decode($json_data);\n\n\t\t\tif (!isset($json->format))\n\t\t\t{\n\t\t\t\t$error_mssg = \"Unsupported file type. Cannot detect audio properties.\\nOR bad output\";\n\t\t\t\t$this->setError($error_mssg);\n\t\t\t\tJLog::add($error_mssg\t. \"\\nCommand: \" . $json_cmd . \"\\nCommand output is:\\n\". $json_data, JLog::ERROR, $logger->namespace);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// `media_type` int(11) NOT NULL default 0, /* 0: audio , 1: video */\n\t\t\t\t// `media_format` varchar(255) NULL, /* e.g 'video', 'wav', 'audio' */\n\t\t\t\t// `codec_type` varchar(255) NULL, /* e.g 'audio' */\n\t\t\t\t// `codec_name` varchar(255) NULL, /* e.g 'mp3', 'pcm_s24le' */\n\t\t\t\t// `codec_long_name` varchar(255) NULL, /* e.g 'PCM signed 24-bit little-endian' , 'MP3 (MPEG audio layer 3)' */\n\t\t\t\t// `resolution` varchar(255) NULL, /* e.g. 1280x720, 1920x1080 */\n\t\t\t\t// `fps` double NULL, /* e.g. 50 (frames per second) */\n\t\t\t\t// `bit_rate` int(11) NULL, /* e.g. 256000 , 320000 (bps) */\n\t\t\t\t// `bits_per_sample` int(11) NULL, /* e.g. 16, 24, 32 (# bits) */\n\t\t\t\t// `sample_rate` int(11) NULL, /* e.g. 44100 (HZ) */\n\t\t\t\t// `duration` int(11) NOT NULL, /* e.g. 410 (seconds) */\n\t\t\t\t// `channels` varchar(255) NULL, /* e.g. 1, 2, 4 (number of channels) */\n\t\t\t\t// `channel_layout` varchar(255) NULL, /* e.g. 'stereo', 'mono' */\n\n\t\t\t\t$md_obj = new stdClass;\n\t\t\t\t$md_obj->id = 0;\n\t\t\t\t$md_obj->file_id = $file->id;\n\t\t\t\t$md_obj->state = 1;\n\n\t\t\t\t$md_obj->media_type = $json->streams[0]->codec_type === 'video' ? 1 : 0; //media_type, 0: audio , 1: video\n\t\t\t\t$md_obj->media_format = $json->streams[0]->codec_type === 'video' ? 'video' : ($json->streams[0]->bits_per_sample ? 'wav' : 'mp3');\n\t\t\t\t$md_obj->media_format = in_array($json->streams[0]->codec_name, array('pcm_s16be', 'pcm_s24be')) ? 'aiff' : $md_obj->media_format;\n\n\t\t\t\t$md_obj->codec_type = $json->streams[0]->codec_type;\n\t\t\t\t$md_obj->codec_name = $json->streams[0]->codec_name;\n\t\t\t\t$md_obj->codec_long_name = $json->streams[0]->codec_long_name;\n\n\t\t\t\t$md_obj->duration = isset($json->streams[0]->duration) ? ceil($json->streams[0]->duration) : 0;\n\t\t\t\t$md_obj->resolution = 0; // TODO\n\t\t\t\t$md_obj->fps = 0; // TODO\n\n\t\t\t\t$md_obj->bit_rate = isset($json->streams[0]->bit_rate) ? $json->streams[0]->bit_rate : 0;\n\t\t\t\t$md_obj->bits_per_sample = isset($json->streams[0]->bits_per_sample) ? $json->streams[0]->bits_per_sample : 0;\n\t\t\t\t$md_obj->sample_rate = isset($json->streams[0]->sample_rate) ? $json->streams[0]->sample_rate : 0;\n\n\t\t\t\t$md_obj->channels = isset($json->streams[0]->channels) ? $json->streams[0]->channels : 0;\n\t\t\t\t$md_obj->channel_layout = isset($json->streams[0]->channel_layout) ? $json->streams[0]->channel_layout : '';\n\n\t\t\t\t// Insert file record in DB\n\t\t\t\t$this->_db->insertObject('#__flexicontent_mediadatas', $md_obj);\n\n\t\t\t\t// Get id of new file record\n\t\t\t\t$md_obj->id = (int) $this->_db->insertid();\n\n\t\t\t\t// Reference the media data object, maybe useful during preview file creation\n\t\t\t\t$file->mediaData = $md_obj;\n\n\t\t\t\t//print_r($json, true);\n\t\t\t\t$logger->detailed_log\n\t\t\t\t\t? JLog::add($full_path . \"\\n\" . print_r($json->streams[0], true), JLog::INFO, $logger->namespace)\n\t\t\t\t\t: JLog::add($full_path . \"\\n\" .\n\t\t\t\t\t\t'media_type: ' . $md_obj->media_type . ', media_format: ' . $md_obj->media_format . ', channels: ' . $md_obj->channels . ', channel_layout: ' . $md_obj->channel_layout . \"\\n\" .\n\t\t\t\t\t\t'codec_name: ' . $md_obj->codec_name . ', codec_name: ' . $md_obj->codec_name . ', codec_long_name: ' . $md_obj->codec_long_name . \"\\n\" .\n\t\t\t\t\t\t'duration: ' . $md_obj->duration . ', resolution: ' . $md_obj->resolution . ', fps: ' . $md_obj->fps . \"\\n\" .\n\t\t\t\t\t\t'bit_rate: ' . $md_obj->bit_rate . ', bits_per_sample: ' . $md_obj->bits_per_sample . ', sample_rate: ' . $md_obj->sample_rate . \"\\n\"\n\t\t\t\t\t, JLog::INFO, $logger->namespace);\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"public function getAvailableAudioCodecs()\n\t{\n\t\treturn array();\n\t}",
"public function Decode($filename)\n\t\t{\n\t\t\treturn mb_convert_encoding($filename, 'utf-8', $this->library->codepage);\n\t\t}",
"function SERVICE_RESAMPLE($file, $name, $resample){\n\t\tglobal $path_to_lame, $path_to_flac, $path_to_mpc, $path_to_wavunpack, \n\t\t \t $path_to_oggdec, $lame_cmd, $path_to_wmadec, $path_to_shn,\n\t\t\t\t $path_to_mplayer, $mplayer_opts, $path_to_faad, $path_to_macpipe, $path_to_ofr;\n\t\t\n\n\t\t$jzSERVICES = new jzServices();\n\t\t$jzSERVICES->loadStandardServices();\n\t\t// Now let's add the proper options to the lame command\n\t\t$lame_cmd .= $resample . ' -f -';\n\t\t\n\t\t//Now let's figure out the file type\n\t\t$extArr = explode(\".\",$file);\n\t\t$ext = $extArr[count($extArr)-1];\n\n\t\t// Now if we're on Windows we need to change the slashes for the command line\n\t\tif (stristr($_ENV['OS'],\"win\")){\n\t\t\t$file = str_replace(\"/\",\"\\\\\",$file);\n\t\t}\n\t\t\n\t\tswitch ($ext){\n\t\t\tcase \"mp3\":\n\t\t\t $meta = $jzSERVICES->getTagData($file);\n\t\t\t if ($meta['bitrate'] <= $resample) {\n\t\t\t header(\"Content-Type: audio/x-mp3\");\n\t\t\t streamFile($file,$meta['artist'] . $meta['title'], $resample);\n\t\t\t exit();\n\t\t\t } else {\n\t\t\t $command = $path_to_lame. \" --mp3input -S --silent --quiet --lowpass 12.0 --resample 22.05 -m j -b \". $resample. ' - < \"'. $file. '\" -';\n\t\t\t }\n\t\t\tbreak;\n\t\t\tcase \"flac\":\n\t\t\t $command = $path_to_flac. ' -d -c --totally-silent \"'. $file. '\" | '. $lame_cmd;\n\t\t\tbreak;\n\t\t\tcase \"mpc\":\n\t\t\t $command = $path_to_mpc. ' --wav \"'. $file. '\" | '. $lame_cmd;\n\t\t\tbreak;\n\t\t\tcase \"wv\":\n\t\t\t $command = $path_to_wavunpack. ' -q \"'. $file. '\" - | '. $lame_cmd;\n\t\t\tbreak;\n\t\t\tcase \"ogg\":\n\t\t\t // Ok, are they using oggdec or ogg123?\n\t\t\t if (stristr($path_to_oggdec,\"oggdec\")){\n\t\t\t //$command = $path_to_oggdec. ' --stdout \"'. $file. '\" | '. $lame_cmd;\n\t\t\t $command = $path_to_oggdec. ' -Q \"'. $file. '\" -o - | '. $lame_cmd;\n\t\t\t } else {\n\t\t\t \t$command = $path_to_oggdec. ' --skip 1 -q -d wav -f - \"'. $file. '\" | '. $lame_cmd;\n\t\t\t }\n\t\t\tbreak;\n\t\t\tcase \"wav\":\n\t\t\t $command = $path_to_lame. \" -S --silent --quiet --lowpass 12.0 --resample 22.05 -m j -b \". $resample. ' - < \"'. $file. '\" -';\n\t\t\tbreak;\n\t\t\tcase \"shn\":\n\t\t\t\tif (stristr($_ENV['OS'],\"win\")){\n\t\t\t\t\t$command = $path_to_shn. ' -x \"' . $file. '\" - | '. str_replace(\" -S --silent\",\" -x -S --silent\",$lame_cmd);\n\t\t\t\t} else {\n\t\t\t\t\t$command = $path_to_shn. ' -x \"' . $file. '\" - | '. $lame_cmd;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase \"wma\":\n\t\t\t\t$command = $path_to_wmadec. ' -w \"' . $file. '\" | '. $lame_cmd;\n\t\t\tbreak;\n\t\t\tcase \"ape\":\n\t\t\t\t$command = $path_to_macpipe. ' \"' . $file. '\" - -d | '. $lame_cmd;\n\t\t\tbreak;\n\t\t\tcase \"ofr\":\n\t\t\t\t$command = $path_to_ofr. ' --decode --silent \"' . $file. '\" --output - | '. str_replace(\" -S --silent\",\" -x -S --silent\",$lame_cmd);\n\t\t\tbreak;\n\t\t\tcase \"ra\":\n\t\t\tcase \"ram\":\n\t\t\tcase \"rm\":\n\t\t\tcase \"m4a\":\n\t\t\t\tif (stristr($_ENV['OS'],\"win\")){\n\t\t\t\t\t$command = $path_to_faad. ' -w \"' . $file. '\" | '. str_replace(\" -S --silent\",\" -x -S --silent\",$lame_cmd);\n\t\t\t\t} else {\n\t\t\t\t\t$command = $path_to_mplayer. ' ' . $mplayer_opts . ' \"' . $file . '\" | '. $lame_cmd;\n\t\t\t\t}\n\t\t\tbreak; \n\t\t\tdefault:\n\t\t\t exit();\n\t\t\tbreak;\n\t\t}\n\n\t\t// Let's log the command we just passed\n\t\twriteLogData(\"resample-command\",$command);\n\t\t\n\t\t// Now let's send the resampled data\n\t\tsendResampledFile($command,$name);\n\t\texit();\n\t}",
"function _audio($src, $atts = array()) {\n $files = array();\n $isExternal = media_isexternal($src);\n\n if ($isExternal) {\n // take direct source for external files\n list(/*ext*/, $srcMime) = mimetype($src);\n $files[$srcMime] = $src;\n } else {\n // prepare alternative formats\n $extensions = array('ogg', 'mp3', 'wav');\n $files = media_alternativefiles($src, $extensions);\n }\n\n $out = '';\n // open audio tag\n $out .= '<audio '.buildAttributes($atts).' controls=\"controls\">'.NL;\n $fallback = '';\n\n // output source for each alternative audio format\n foreach($files as $mime => $file) {\n if ($isExternal) {\n $url = $file;\n $linkType = 'externalmedia';\n } else {\n $url = ml($file, '', true, '&');\n $linkType = 'internalmedia';\n }\n $title = $atts['title'] ? $atts['title'] : $this->_xmlEntities(utf8_basename(noNS($file)));\n\n $out .= '<source src=\"'.hsc($url).'\" type=\"'.$mime.'\" />'.NL;\n // alternative content (just a link to the file)\n $fallback .= $this->$linkType($file, $title, null, null, null, $cache = null, $linking = 'linkonly', $return = true);\n }\n\n // finish\n $out .= $fallback;\n $out .= '</audio>'.NL;\n return $out;\n }",
"public function getAudio()\n {\n return $this->Audio;\n }",
"function receiveAudio($title,$path_upload, $author, $maxfilebytes)\r\n {\r\n \r\n global $xoopsUser, $xoopsDB, $_POST, $_FILES;\r\n //busca id do user logado\r\n $uid = $xoopsUser->getVar('uid');\r\n //create a hash so it does not erase another file\r\n //$hash1 = date();\r\n //$hash = substr($hash1,0,4);\r\n \r\n // mimetypes and settings put this in admin part later\r\n $allowed_mimetypes = array( \"audio/mp3\" , \"audio/x-mp3\", \"audio/mpeg\");\r\n $maxfilesize = $maxfilebytes;\r\n \r\n // create the object to upload\r\n $uploader = new XoopsMediaUploader($path_upload, $allowed_mimetypes, $maxfilesize);\r\n // fetch the media\r\n if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {\r\n //lets create a name for it\r\n $uploader->setPrefix('aud_'.$uid.'_');\r\n //now let s upload the file\r\n if (!$uploader->upload()) {\r\n // if there are errors lets return them\r\n echo \"<div style=\\\"color:#FF0000; background-color:#FFEAF4; border-color:#FF0000; border-width:thick; border-style:solid; text-align:center\\\"><p>\".$uploader->getErrors().\"</p></div>\";\r\n return false;\r\n } else {\r\n // now let s create a new object audio and set its variables\r\n //echo \"passei aqui\";\r\n $audio = $this->create();\r\n $url = $uploader->getSavedFileName();\r\n $audio->setVar(\"url\",$url);\r\n $audio->setVar(\"title\",$title);\r\n $audio->setVar(\"author\",$author);\r\n $uid = $xoopsUser->getVar('uid');\r\n $audio->setVar(\"uid_owner\",$uid);\r\n $this->insert($audio);\r\n $saved_destination = $uploader->getSavedDestination();\r\n //print_r($_FILES);\r\n }\r\n } else {\r\n echo \"<div style=\\\"color:#FF0000; background-color:#FFEAF4; border-color:#FF0000; border-width:thick; border-style:solid; text-align:center\\\"><p>\".$uploader->getErrors().\"</p></div>\";\r\n return false;\r\n }\r\n return true;\r\n }",
"function getEncodedString($type, $file) {\n\treturn 'data:audio/' . $type . ';base64,' . base64_encode(file_get_contents($file));\n}",
"public function getWave()\n {\n return $this->get(self::_WAVE);\n }",
"public function detect(SplFileObject $file): ?AudioType\n {\n $bytes = (string)$file->fread(4);\n\n return $bytes === '.snd' ? new AudioType(\n AudioFormat::AU,\n AudioMimeType::AUDIO_AU\n ) : null;\n }",
"public function getAudio()\n\t{\n\n\t\treturn $this->audio;\n\t}",
"function sotf_AudioFile($path)\n\n\t{\n\n\t\t$parent = get_parent_class($this);\n\n\t\tparent::$parent($path);\t\t// Call the constructor of the parent class. lk. super()\n\n\t\t// CHANGED BY BUDDHAFLY 06-05-12\n\t\t$getID3 = new getID3();\n\t\t$fileinfo = $getID3->analyze($this->path);\n\t\tgetid3_lib::CopyTagsToComments($fileinfo);\n\t\t\n\t\t//$fileinfo = GetAllFileInfo($this->path);\n\n $this->allInfo = $fileInfo;\n\t\n\t\t//if ($audioinfo[\"fileformat\"] == 'mp3' || $audioinfo[\"fileformat\"] == 'ogg') {\n\n //debug(\"finfo\", $fileinfo);\n\t\n\n if (isset($fileinfo['audio'])) {\n\n $audioinfo = $fileinfo['audio'];\n\n\t\t\t$this->type = \"audio\";\n\n\t\t\t$this->format = $fileinfo[\"fileformat\"];\n\n\t\t\tif ($audioinfo[\"bitrate_mode\"] == 'vbr')\n\n\t\t\t\t$this->bitrate = \"VBR\";\n\n $this->bitrate = round($audioinfo[\"bitrate\"]/1000);\n\n\t\t\t$this->average_bitrate = round($audioinfo[\"bitrate\"]/1000);\n\n\t\t\t$this->samplerate = $audioinfo[\"sample_rate\"];\n\n\t\t\t$this->channels = $audioinfo[\"channels\"];\n\n\t\t\t$this->duration = round($fileinfo[\"playtime_seconds\"]);\n\n\t\t\t$this->mimetype = $this->determineMimeType($this->format);\n\n\t\t}\n\n\t}",
"public function getAudioBitRate() {}",
"function decodeFormatFilename($filename) {\n\n preg_match('/(\\d+)kbps_(\\d)chn_(\\d+)Hz.(.*)/', $filename, $matches);\n\n return array('bitrate' => $matches[1],\n\n 'channels' => $matches[2],\n\n 'samplerate' => $matches[3],\n\n 'format' => $matches[4]);\n\n }"
]
| [
"0.6474454",
"0.5905486",
"0.5412156",
"0.5172678",
"0.51709366",
"0.5005753",
"0.4834532",
"0.48289227",
"0.48215052",
"0.48207617",
"0.48172328",
"0.4804717",
"0.47579485",
"0.46861696",
"0.4664187",
"0.46436274",
"0.4634852",
"0.45915595",
"0.45911878",
"0.45905378",
"0.4590483",
"0.4589351",
"0.45798594",
"0.457523",
"0.45635504",
"0.45489955",
"0.45368963",
"0.45148745",
"0.44971305",
"0.4490097"
]
| 0.7163842 | 0 |
Form element validation handler for 'value' element. Tests updating of cached form storage during validation. | public function elementValidateValueCached($element, FormStateInterface $form_state) {
// If caching is enabled and we receive a certain value, change the storage.
// This presumes that another submitted form value triggers a validation error
// elsewhere in the form. Form API should still update the cached form storage
// though.
if ($this->getRequest()->get('cache') && $form_state->getValue('value') == 'change_title') {
$form_state->set(['thing', 'changed'], TRUE);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function validateValue($value);",
"protected abstract function doValidate($value);",
"protected abstract function doValidate($value);",
"public function validateValue($value)\n {\n }",
"public static function Validate($value) { self::__Validate($value,self::Values(),__CLASS__); }",
"public function validate(ValueContext $valueContext);",
"function validate_value($valid, $value, $field, $input)\n {\n }",
"function validate_value($valid, $value, $field, $input)\n {\n }",
"function validate_value($valid, $value, $field, $input)\n {\n }",
"function validate_value($valid, $value, $field, $input)\n {\n }",
"abstract protected function isValidValue($value);",
"public function validate($value);",
"public function validate($value);",
"public static function validate($value);",
"abstract public function getIsValidValue($value);",
"public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }",
"public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }",
"public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }",
"abstract public function validate($value, Result $result);",
"public function test_field_has_correct_value_attribute_when_changed()\n {\n $this->Field->attributes->value = $this->test_value;\n $dom = HtmlDomParser::str_get_html($this->Field->makeView()->render());\n $input = current($dom->find('input'));\n\n // A password field should never have a value even if one is set.\n $this->assertSame(true, $input->value);\n }",
"public function testValueValid() {\n $config = [\n 'success' => 1,\n 'data' => 'example'\n ];\n $this->assertEmpty($this->getValidator()->validate($config));\n }",
"function acf_validate_value($value, $field, $input)\n{\n}",
"abstract public function validate(\n $value\n ): bool;",
"public function validate(BLW_PSP_EditableValueHolder $valueHolder, $value = null);",
"abstract protected function checkValue( &$value );",
"protected function validate()\r\n\t{\r\n\t\tif (!$this->isFetched())\r\n\t\t{\r\n\t\t\treturn;\r\n }\r\n \r\n\t\tif ($this->validationInfo)\r\n\t\t{\r\n\t\t\t$this->validationInfo->validate($this->normalizedValue);\r\n\t\t}\r\n\t\t$this->isValid = true;\r\n\t}",
"public function testFillingValue()\n {\n $_GET['somename'] = 'a value';\n\n $valuable = $this->getMockForTrait('Koenvu\\Forms\\Components\\Valuable');\n $field = $this->getMockForAbstractClass('Koenvu\\FormTests\\Stubs\\TestableField');\n $field->set('field.name', 'somename');\n\n $valuable->fillValues([$field]);\n\n $this->assertRegExp('/value\\s*=\\s*([\\'\"])a value\\1/', $field->attr('field'));\n }",
"public function validate( $value, $validator )\n {\n \n \n }",
"public function doValidation($value){\r\n $args = array (\r\n\t\t\t'ip' => $_SERVER['REMOTE_ADDR'],\r\n\t\t\t'id' => $value[\"spamCaptcherSessionID\"],\r\n\t\t\t'ftma' => ($this->forceTrustMeAccount ? \"1\" : \"0\"),\r\n\t\t\t'atma' => ($this->allowTrustMeAccount ? \"1\" : \"0\"),\r\n\t\t\t'ogtmas' => ($this->overwriteGlobalTMASettings ? \"1\" : \"0\"),\r\n\t\t\t'spamCaptcherAnswer' => $value[\"spamCaptcherAnswer\"]\r\n\t\t);\r\n $this->sessionID = $value[\"spamCaptcherSessionID\"];\r\n return $this->validate($args);\r\n }",
"public function validate($value) {\n return TRUE;\n }"
]
| [
"0.687416",
"0.67202264",
"0.67202264",
"0.65016323",
"0.6442089",
"0.6438526",
"0.6399104",
"0.6399104",
"0.6399104",
"0.6399104",
"0.63601065",
"0.62609726",
"0.62609726",
"0.614476",
"0.61343217",
"0.61090124",
"0.60868996",
"0.60868996",
"0.6041344",
"0.60208416",
"0.60117406",
"0.5996458",
"0.5959229",
"0.594651",
"0.5911041",
"0.5804131",
"0.57847613",
"0.5736769",
"0.56994843",
"0.5669097"
]
| 0.6928119 | 0 |
Lists all grupaKursow entities. | public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$grupaKursows = $em->getRepository('ModelBundle:GrupaKursow')->findAll();
return $this->render('@Przedmiot/grupakursow/index.html.twig', array(
'grupaKursows' => $grupaKursows,
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function index()\n {\n //\n return Grupos::all();\n }",
"public function index()\n {\n return Kolekcija::all();\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SCRUMSwiftairBundle:Klasses')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $groupes = $em->getRepository('AppBundle:Groupe')->findAll(array(), array('nom' => 'ASC'));\n\n return $this->render('@App/groupe/tableau.html.twig', array(\n 'groupes' => $groupes,\n ));\n }",
"public function indexAction()\n {\n if (!$this->get('security.context')->isGranted('ROLE_ADMIN') ) {\n return $this->redirect($this->generateUrl('error'), 302); \n }\n $em = $this->getDoctrine()->getManager(); \n $entities = $em->getRepository('SytemSGBundle:Grupos')->findAll();\n\n return $this->render('SytemSGBundle:Grupos:index.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $groupes = $em->getRepository('PlanBundle:Groupe')->findAll();\n\n return $this->render('@Plan/groupe/index.html.twig', array(\n 'groupes' => $groupes,\n ));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('GarnetTaxiBeBundle:Ligne')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function obtenerGruposController()\n\t\t{\n\t\t\t$respuesta = Datos::vistaGruposModel(\"grupo\");\n\n\t\t\t#El constructor foreach proporciona un modo sencillo de iterar sobre arrays. foreach funciona sólo sobre arrays y objetos, y emitirá un error al intentar usarlo con una variable de un tipo diferente de datos o una variable no inicializada.\n\n\t\t\tforeach($respuesta as $row => $item)\n\t\t\t{\n\t\t\t\techo'<option value='.$item[\"id_grupo\"].'>'.$item[\"nombre_grupo\"].'</option>';\n\t\t\t}\n\n\t\t}",
"public function actionIndex()\n {\n $listaClaseActive = Grupaelevi::find()->all();\n $dataProvider = new ActiveDataProvider([\n 'query' => Ora::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n 'listaClaseActive'=>$listaClaseActive,\n ]);\n }",
"public function indexAction()\r\n {\r\n $em = $this->getDoctrine()->getManager();\r\n\r\n $entities = $em->getRepository('GaleriasBundle:Galeria')->findAll();\r\n\r\n return array(\r\n 'entities' => $entities,\r\n );\r\n }",
"public function index()\n {\n return Guru::all();\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SCRUMSwiftairBundle:Vluchten')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction()\n {\n $manager = $this->container->get('app_manager_userlistkdo');\n $data = array(\n 'manager' => $manager,\n 'dir' => 'AppBundle:UserListKdo',\n 'show' => 'appbundle_userlistkdo_show',\n 'edit' => 'appbundle_userlistkdo_edit'\n );\n\n return $this->gridList($data);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $gardes = $em->getRepository('KidzyBundle:Garde')->findAll();\n\n return $this->render('@Kidzy/garde/index.html.twig', array(\n 'gardes' => $gardes,\n ));\n }",
"public function indexAction ()\n {\n $em = $this->getDoctrine()->getManager();\n\n $maileguaks = $em->getRepository( 'AppBundle:Maileguak' )->findAll();\n\n return $this->render(\n 'maileguak/index.html.twig',\n array (\n 'maileguaks' => $maileguaks,\n )\n );\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $clasificaciontgs = $em->getRepository('UdecAppBundle:Clasificaciontg')->findAll();\n\n return $this->render('clasificaciontg/index.html.twig', array(\n 'clasificaciontgs' => $clasificaciontgs,\n ));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $lsDefAssociationGroupings = $em->getRepository('CftfBundle:LsDefAssociationGrouping')->findAll();\n\n return [\n 'lsDefAssociationGroupings' => $lsDefAssociationGroupings,\n ];\n }",
"public function getGrupos(){\n\t\t$filasPagina = 7;//registros mostrados por página\n\n\t\tif(isset($_GET['pagina'])){//si le pasamos el valor \"pagina\" de la url (si el usuario da click en la paginación)\n\t\t\t\tif($_GET['pagina']==1){\n\t\t\t\t$pagina=1; \n\t\t\t\theader(\"Location: principal.php?c=controlador&a=muestraGrupos\");\n\t\t\t\t}else{\n\t\t\t\t\t$pagina=$_GET['pagina'];//índice que indica página actual\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$pagina=1;//índice que indica página actual\n\t\t\t}\n\n\t\t\t$empezarDesde = ($pagina-1) * $filasPagina;\n\n\t\t\t$sql = \" SELECT * FROM grupos \";\n\n\t\t\t$resultado = $this->db->query($sql);\n\n\t\t\t$resultado->execute(array());\n\n\t\t\t$numFilas = $resultado->rowCount();//número de registos totales de la consulta\n\n\t\t\t//ceil — Redondear fracciones hacia arriba\n\t\t\t$totalPaginas = ceil($numFilas / $filasPagina);//calcula cuántas páginas serán en total para mostrar todos los registros\n\n\t\t\t$resultado->closeCursor();\n\n\t\t//------------------------- Consulta para mostrar los resultados ---------------------------\n\n\t\t\t$sql_limite = \" SELECT * FROM grupos LIMIT $empezarDesde , $filasPagina \";\n\n\t\t\t$resultado = $this->db->query($sql_limite);//ejecutando la consulta con la conexión establecida\n\n\t\t\twhile($row = $resultado->fetch(PDO::FETCH_ASSOC)){\n\t\t\t\t$this->objeto[] = $row;//llenando array con valores de la consulta\n\t\t\t}\n\n\t\treturn $this->objeto;\n\t}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $gifts = $em->getRepository('ApiSikaBundle:Gift')->findAll();\n\n return $this->render('gift/index.html.twig', array(\n 'gifts' => $gifts,\n ));\n }",
"public function index()\n {\n $grupos = Grupo::all();\n return view('academico.grupo.list')\n ->with('location', 'academico')\n ->with('grupos', $grupos);\n }",
"public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n $countriesRepository = $em->getRepository('ShopBundle:Countries');\n\n $countryList = $countriesRepository->findBy(\n array(),\n array('country' => 'ASC')\n );\n\n return array(\n 'countryList' => $countryList,\n );\n }",
"public function index()\n {\n $groups = Group::paginate(10);\n\n return $this->showAll($groups);\n }",
"function index()\n {\n $data['grup_kuisioner'] = $this->Grup_kuisioner_model->get_all_grup_kuisioner();\n \n $data['_view'] = 'grup_kuisioner/index';\n $this->load->view('layouts/main',$data);\n }",
"public function listAction(){\n $r=$this->getRequest();\n $query=Doctrine_Query::create()\n ->select(\"uo.orgid, u.ID, u.nome,u.cognome,u.user,u.active,u.data_iscrizione,r.role\")\n ->from(\"Users u\")\n ->leftJoin(\"u.Role r\")\n ->leftJoin(\"u.UsersOrganizations uo\")\n ->where(\"uo.orgid=\".$r->getParam('orgid'))\n ->addWhere(\"uo.active=\".Constants::UTENTE_ATTIVO);\n list($users,$total)=DBUtils::pageQuery($query,array(),$this->getLimit(),$this->getOffset());\n $this->emitTableResult($users,$total);\n }",
"public function index()\n {\n return GrupoResource::collection(Grupo::paginate());\n }",
"public function indexAction()\n {\n\n $manager = $this->container->get('app_manager_listkdo');\n $data = array(\n 'manager' => $manager,\n 'dir' => 'AppBundle:ListKdo',\n 'show' => 'appbundle_listkdo_show',\n 'edit' => 'appbundle_listkdo_edit'\n );\n\n return $this->gridList($data);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('CrudforgeBundle:Users')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"function SHOWALL(){\n\n $stmt = $this->db->prepare(\"SELECT * FROM centro\");\n $stmt->execute();\n $centros_db = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $allcentros = array(); //array para almacenar los datos de todos los centros\n\n //Recorremos todos las filas de centros devueltas por la sentencia sql\n foreach ($centros_db as $centro){\n //Introducimos uno a uno los grupos recuperados de la BD\n array_push($allcentros,\n new CENTRO_Model(\n $centro['centro_id'],$centro['nombre_centro'],$centro['edificio_centro']\n )\n );\n }\n return $allcentros;\n }",
"public function index()\n {\n \n return GroupLga::all();\n \n }",
"public function index()\n {\n return AlokasiKelas::all();\n }"
]
| [
"0.6820715",
"0.63522756",
"0.6326514",
"0.6241569",
"0.6185324",
"0.6139122",
"0.61094517",
"0.60370564",
"0.600264",
"0.59980476",
"0.5978973",
"0.5891443",
"0.58890146",
"0.5869702",
"0.58172494",
"0.5816918",
"0.5800125",
"0.57978195",
"0.5797562",
"0.5789919",
"0.5774783",
"0.5756595",
"0.5755342",
"0.57496816",
"0.5748697",
"0.5746068",
"0.57445836",
"0.57396257",
"0.57381505",
"0.5735446"
]
| 0.730458 | 0 |
Creates a form to delete a grupaKursow entity. | private function createDeleteForm(GrupaKursow $grupaKursow)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('grupakursow_delete', array('id' => $grupaKursow->getId())))
->setMethod('DELETE')
->getForm()
;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function createDeleteForm ( Maileguak $maileguak )\n {\n return $this->createFormBuilder()\n ->setAction( $this->generateUrl( 'maileguak_delete', array ('id' => $maileguak->getId()) ) )\n ->setMethod( 'DELETE' )\n ->getForm();\n }",
"private function createDeleteForm($id,$idcupo)\n {\n\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('liquidaciones_delete', array('id' => $id,'idcupo'=>$idcupo)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete','attr' => array('class' => 'form-control')))\n ->getForm()\n ;\n }",
"private function createDeleteForm(Clasificaciontg $clasificaciontg)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('clasificaciontg_delete', array('id' => $clasificaciontg->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Produits $produit) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('produits_delete', array('id' => $produit->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Covoiturage $covoiturage)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('personnel_covoiturage_delete', array('id' => $covoiturage->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }",
"private function createDeleteForm(FroFacTransferencia $froFacTransferencium)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('frofactransferencia_delete', array('id' => $froFacTransferencium->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Kategorija $kategorija)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('kategorija_delete', array('id' => $kategorija->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Restricciones $restriccione)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('restricciones_delete', array('id' => $restriccione->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(ProgramKsztalcenia $programKsztalcenium)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('programksztalcenia_delete', array('id' => $programKsztalcenium->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }",
"private function createDeleteForm(voyageur $voyageur)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('voyageur_delete', array('id' => $voyageur->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(NatureOp $priorite)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('back_natureop_delete', array('id' => $priorite->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Groupe $groupe)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('groupe_delete', array('idGroup' => $groupe->getIdgroup())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Contabilizar $contabilizar)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('contabilizar_delete', array('id' => $contabilizar->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Proeflessen $proeflessen)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_proeflessen_delete', array('id' => $proeflessen->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Groupe $groupe)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('groupe_delete', array('id' => $groupe->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Reglement $reglement)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('reglement_delete', array('codeRegl' => $reglement->getCoderegl())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Estancia $estancium)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('estancia_delete', array('id' => $estancium->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(CargoSubDivisao $vaga)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('pessoal_gerenciar_vagas_delete', array('id' => $vaga->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }",
"private function createDeleteForm(Scenaristes $scenariste)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('scenaristes_delete', array('id' => $scenariste->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Indicateur $indicateur) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('indicateur_delete', array('id' => $indicateur->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Fratura $fratura)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('fratura_delete', array('id' => $fratura->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(GrupoDiagnostico $grupoDiagnostico)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('grupodiagnostico_delete', array('id' => $grupoDiagnostico->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Frequencia $frequencium)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cadastro_frequencia_delete', array('id' => $frequencium->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Undergraduate $undergraduate)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('undergraduate_delete', array('id' => $undergraduate->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Acteur $acteur)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('acteur_delete_homepage', array('id' => $acteur->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }",
"private function createDeleteForm($id) {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('rubrique_delete', array('id' => $id)))\r\n// ->setMethod('DELETE')\r\n ->add('submit', SubmitType::class, array('label' => 'Supprimer la rubrique courante'))\r\n ->getForm()\r\n ;\r\n }",
"private function createDeleteForm(Categorie_Produit $categorie_Produit)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('categorie_produit_delete', array('id' => $categorie_Produit->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Projecte $projecte)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('projecte_delete', array('id' => $projecte->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Ingrerut $ingrerut)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('ingresorut_delete', array('id' => $ingrerut->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(SvCfgDisenio $SvCfgDisenio)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('Svcfgdisenio_delete', array('id' => $SvCfgDisenio->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }"
]
| [
"0.7138623",
"0.69323355",
"0.69190586",
"0.6903037",
"0.68393606",
"0.6820432",
"0.6814909",
"0.68024355",
"0.6790657",
"0.6779321",
"0.67647034",
"0.67234",
"0.67188746",
"0.6706314",
"0.67008805",
"0.6696658",
"0.6693432",
"0.66811305",
"0.66768",
"0.66667736",
"0.6665392",
"0.6638559",
"0.6638503",
"0.66273504",
"0.6626367",
"0.66162175",
"0.65951747",
"0.658642",
"0.65680146",
"0.65676534"
]
| 0.80273515 | 0 |
Gets all registered indexes | public function getAllIndexes()
{
return $this->indexes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexes()\r\n {\r\n return $this->indexes;\r\n }",
"public function getIndexList() {\n return self::$indexes;\n }",
"public function getIndexes()\n {\n\treturn $this->indexes;\n }",
"public function getIndexes()\n {\n return $this->indexes;\n }",
"protected function getIndexes() {\n $server_indices = array();\n $indices = search_api_index_load_multiple(FALSE);\n foreach ($indices as $index) {\n if ($index->server == $this->server->machine_name) {\n $server_indices[] = $index;\n }\n }\n return $server_indices;\n }",
"public function getIndexes()\n\t{\n $result = $this->fetchingData(array(\n 'query' => \"SHOW INDEX FROM `$this->table`\"\n ));\n\n return $result;\n\t}",
"function &getIndexes(){\n\t\treturn array();\n\t}",
"public function indexes()\n {\n if (isset($this->options['indexes'])) {\n return array_intersect_key(static::$indexes, $this->options['indexes']);\n }\n return static::$indexes;\n }",
"public function getAllIndexes() {\n return array_merge(\n [ $this->primaryKeys, ],\n $this->uniqueKeys,\n $this->indexes\n );\n }",
"public function getIndexNodes(): array\n {\n return $this->organize()->indexes;\n }",
"private function getDbIndexes()\n\t{\n\t\t$r = $this->source->query(\"SHOW INDEXES FROM `{$this->table}`\");\n\t\treturn $r;\n\t}",
"public function defineIndexes()\n\t{\n\t\treturn array();\n\t}",
"public function getIndexing(): array {\n\t\treturn $this->_indexing;\n\t}",
"public function getIndexes() \n {\n \n if (!count($this->indexes)) {\n /** \n * If a prefix has been set, use that with a wild card.\n * If a prefix has not been set use some wildcards while \n * diregarding elastic system indexes with \"-.*\"\n */\n return !strlen(config('scout.prefix')) ? '*,-.*' : config('scout.prefix') . '*';\n }\n return implode(',', $this->indexes);\n }",
"public function listIndexes() : array\n {\n // see here:\n // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html\n\n $url = $this->getHostUrlString() . '/_stats';\n $request = new \\GuzzleHttp\\Psr7\\Request('GET', $url);\n $response = $this->sendWithCredentials($request);\n\n $httpcode = $response->getStatusCode();\n $result = (string)$response->getBody();\n if ($httpcode < 200 || $httpcode > 299)\n throw new \\Flexio\\Base\\Exception(\\Flexio\\Base\\Error::READ_FAILED);\n\n $result = json_decode($result, true);\n\n $indexes = [];\n\n if (isset($result['indices']))\n {\n $indices = $result['indices'];\n foreach ($indices as $index_name => $index_info)\n {\n // only show indices that aren't hidden\n //if (substr($index_name, 0, 1) === '.')\n // continue;\n\n // TODO: include other information from the stats\n $indexes[] = array('name' => $index_name,\n 'path' => '/' . $index_name,\n 'size' => null,\n 'modified' => null,\n 'hash' => '', // TODO: available?\n 'type' => 'FILE');\n }\n }\n\n return $indexes;\n }",
"public function getAllIndexes($moduleName = '')\n {\n return $this->indexStrategy->getAllIndexes($moduleName);\n }",
"function index_all(){\n\t\t$this->_clear_tmp(0);\n\t\t$this->del_results();\n\t\treturn $this->index(0,true);\n\t}",
"public function analyticsIndexes(): AnalyticsIndexManager\n {\n throw new UnsupportedOperationException();\n }",
"public function getIndices()\n {\n return $this->indices;\n }",
"protected static function initIndexes()\n {\n static::$indexes = [];\n foreach (static::$indexesConf as $name => &$index) {\n if (!isset($index['type'])) {\n $index['type'] = 'Generic';\n }\n $index['name'] = $name;\n $index['modelClass'] = static::class;\n\n $class = ClassFinder::getNamespace(\\Zer0\\Model\\Indexes\\AbstractIndex::class) . '\\\\' . $index['type'];\n\n static::$indexes[$name] = new $class($index);\n }\n }",
"public function getAll(Index $index): iterable;",
"public function getIndexConfigurations()\n {\n if (null === $this->indexConfigurations) {\n foreach ($this->searchIndexes as $indexName => $indexConfiguration) {\n $this->indexConfigurations[$indexName] = new IndexConfiguration(\n $indexName,\n $indexConfiguration['icon'],\n $this->translator->trans($indexConfiguration['name'], [], 'admin'),\n new Route($indexConfiguration['view']['name'], $indexConfiguration['view']['result_to_view']),\n isset($indexConfiguration['security_context']) ? $indexConfiguration['security_context'] : null,\n isset($indexConfiguration['contexts']) ? $indexConfiguration['contexts'] : []\n );\n }\n }\n\n return $this->indexConfigurations;\n }",
"function indexes($table)\n{\n\treturn $this->drv->indexes($table);\n}",
"function masterAllIndexes() {\n $this->db_master->executeSQL(\"SELECT \" . $this->idx_master . \" from \" . $this->db_master->database . \".\" . $this->table_master);\n }",
"public function getIndices() {\n $indices = Elastic::getIndices();\n return \\Response::json($indices);\n }",
"public function getIndex()\n {\n return $this->get(self::_INDEX);\n }",
"function getIndexes($table) {\n return mysql_query(sprintf('SHOW INDEX FROM %s', $table));\n }",
"public function getIndexesToAdd() {\n return $this->indexToAdd;\n }",
"protected function getIndex()\n {\n if (!$this->indexes) {\n $this->addIndex();\n }\n $index = end($this->indexes);\n return $index['xml'];\n }",
"function slaveAllIndexes() {\n $this->db_slave->executeSQL(\"SELECT \" . $this->idx_slave . \" from \" . $this->db_slave->database . \".\" . $this->table_slave);\n }"
]
| [
"0.8174619",
"0.793244",
"0.7853825",
"0.78466034",
"0.771348",
"0.7547633",
"0.749083",
"0.7423228",
"0.74145186",
"0.7305068",
"0.7266405",
"0.7260031",
"0.71059155",
"0.7019986",
"0.69190484",
"0.68035835",
"0.67576975",
"0.6722061",
"0.671148",
"0.6628822",
"0.66256386",
"0.66249055",
"0.6596857",
"0.6591598",
"0.65892065",
"0.6525483",
"0.65241396",
"0.65078443",
"0.6486875",
"0.6424177"
]
| 0.8171849 | 1 |
Gets the default index | public function getDefaultIndex()
{
return $this->defaultIndex;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getIndex()\n {\n return isset($this->index) ? $this->index : null;\n }",
"public static function _index()\n\t{\n\t\treturn self::$_index;\n\t}",
"public function getDefaultCardIndex()\n {\n return $this->reel->aliases['_default'];\n }",
"public function index(): int\n {\n return $this->index;\n }",
"public function getIndex() {\r\n\t\treturn $this->_index;\r\n\t}",
"public static function getIndex(): int\n {\n return static::$index;\n }",
"public function getIndex() {\r\n\t\t\treturn $this->index;\r\n\t\t}",
"public function getIndex() {\n\t\treturn $this->index;\n\t}",
"public function getIndex() {\n\t\treturn $this->index;\n\t}",
"public function getIndex() {\n\t\treturn $this->index;\n\t}",
"public function getIndex() {\n\t\treturn $this->index;\n\t}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {\n \treturn $this->index;\n }",
"public function getIndex() {return $this->index;}",
"public function getIndex() : ?string\n {\n return $this->index;\n }",
"public function getIndex()\n\t\t{\n\t\t\treturn $this->_index;\n\t\t}",
"public function getIdx()\n {\n return $this->get(self::_IDX);\n }",
"public function getIndex()\n {\n return $this->index;\n }",
"public function getIndex()\n {\n return $this->index;\n }",
"public function getIndex()\n {\n return $this->index;\n }",
"public function getIndex()\n {\n return $this->index;\n }",
"public function getIndex() {\n return $this->index;\n }"
]
| [
"0.73023814",
"0.71758014",
"0.715008",
"0.7104482",
"0.7078497",
"0.70654535",
"0.7065195",
"0.70523286",
"0.70523286",
"0.70523286",
"0.70523286",
"0.7029544",
"0.7029544",
"0.7029544",
"0.702938",
"0.70286846",
"0.70286846",
"0.70286846",
"0.70285743",
"0.70285743",
"0.7026344",
"0.7008743",
"0.69776005",
"0.69772106",
"0.6960334",
"0.69559735",
"0.69559735",
"0.69559735",
"0.69559735",
"0.69524944"
]
| 0.90596086 | 0 |
$parentWork = new ParentWork(); | function __construct(){
GLOBAL $parentWork;
$this->rootDirectory = $parentWork->rootDirectory;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function doWorkChildImpl();",
"private function doWorkParent() {\n Log5PHP_MDC::put('Generation', 'parent');\n\n global $run;\n global $reload;\n global $workers;\n\n $this->parentSetup();\n\n while ($run && count($workers) > 0) {\n if ($reload) {\n gosUtility_parallel::$logger->info(\"Parent saw reload, restarting workers\");\n\n $reload = false;\n $this->killAllWorkers();\n $this->startAllWorkers();\n } else {\n $this->checkWorkers();\n }\n\n // Sleep 4 seconds\n usleep(4000000);\n }\n\n $this->parentCleanup();\n $this->killAllWorkers();\n pcntl_wait($status);\n }",
"public function work()\n {\n }",
"abstract public function parent();",
"public function parent() { }",
"protected function retrieveParent()\n {\n }",
"abstract public function makeJob();",
"abstract public function makeJob();",
"function work()\n {\n }",
"private function fork()\n\t{\n\t\t$pid = pcntl_fork();\n\n\t\tswitch ( $pid ) {\n\t\t\tcase -1:\n\t\t\t\t// exception\n\t\t\t\texit;\n\t\t\t\tbreak;\n\n\t\t\tcase 0:\n\t\t\t\ttry {\n\t\t\t\t\t// init worker instance\n\t\t\t\t\t$worker = new Worker( [\n\t\t\t\t\t\t'type' => 'worker',\n\t\t\t\t\t\t'pipe_dir' => $this->pipeDir,\n\t\t\t\t\t\t'tmp_dir' => $this->tmpDir,\n\t\t\t\t\t\t'app_name' => $this->appName,\n\t\t\t\t\t] );\n\t\t\t\t\t$worker->setProcessName();\n\t\t\t\t\t$worker->pipeMake();\n\t\t\t\t\t$worker->hangup( $this->workBusinessClosure );\n\t\t\t\t} catch ( Exception $e ) {\n\t\t\t\t\tProcessException::error( [\n\t\t\t\t\t\t'msg' => [\n\t\t\t\t\t\t\t'msg' => $e->getMessage(),\n\t\t\t\t\t\t\t'file' => $e->getFile(),\n\t\t\t\t\t\t\t'line' => $e->getLine(),\n\t\t\t\t\t\t],\n\t\t\t\t\t] );\n\t\t\t\t}\n\n\t\t\t\t// worker exit\n\t\t\t\texit;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\ttry {\n\t\t\t\t\t$worker = new Worker( [\n\t\t\t\t\t\t'type' => 'worker',\n\t\t\t\t\t\t'pid' => $pid,\n\t\t\t\t\t\t'pipe_dir' => $this->pipeDir,\n\t\t\t\t\t\t'tmp_dir' => $this->tmpDir,\n\t\t\t\t\t\t'app_name' => $this->appName,\n\t\t\t\t\t] );\n\t\t\t\t\t$this->workers[ $pid ] = $worker;\n\t\t\t\t} catch ( Exception $e ) {\n\t\t\t\t\tProcessException::error( [\n\t\t\t\t\t\t'msg' => [\n\t\t\t\t\t\t\t'msg' => $e->getMessage(),\n\t\t\t\t\t\t\t'file' => $e->getFile(),\n\t\t\t\t\t\t\t'line' => $e->getLine(),\n\t\t\t\t\t\t],\n\t\t\t\t\t] );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public function getWorker();",
"public function getWorker();",
"public function __invoke()\n {\n return $this->getParent();\n }",
"private function doWorkChild() {\n Log5PHP_MDC::put('Generation', 'child');\n $this->doWorkChildImpl();\n $this->childCleanup();\n exit();\n }",
"public function __construct()\n {\n //to be extended by children\n }",
"public function parent()\n {\n }",
"public function __construct(){\n parent::__construct();\n echo \"i am start working from child2\";\n }",
"public function getParent()\n {\n }",
"public function __construct()\n {\n // for example creates \"thread\"\n }",
"public function work(Job $job);",
"public function work(Job $job);",
"public function parent()\n {\n return $this->building();\n }",
"public function work()\n {\n return $this->belongsTo(Work::class, 'work_id');\n }",
"public function getWorkers()\n {\n }",
"public function startWorking(){\r\n }",
"public function getParent() {}",
"public function getParent() {}",
"public function getParent() {}",
"public function getParent() {}",
"public function getParent() {}"
]
| [
"0.6336358",
"0.6316345",
"0.6278568",
"0.62313265",
"0.61399025",
"0.6084739",
"0.58728725",
"0.58728725",
"0.5854174",
"0.58276856",
"0.5797289",
"0.5797289",
"0.5751258",
"0.56885463",
"0.5649531",
"0.56461704",
"0.56223375",
"0.5599971",
"0.5568774",
"0.5562069",
"0.5562069",
"0.55426013",
"0.5505392",
"0.5502291",
"0.54606456",
"0.54590607",
"0.54590607",
"0.54590607",
"0.54590607",
"0.54590607"
]
| 0.6367156 | 0 |
Simplify the "carousel images" format | public function simplify_carousel_images( $images ) {
if ( ! is_array( $images ) || empty( $images ) ) {
return;
}
$carousel_images = [];
foreach ( $images as $image ) {
array_push(
$carousel_images,
[
'sizes' => [
'thumbnail' => $image['sizes']['thumbnail'],
'medium' => $image['sizes']['medium'],
'medium_square' => $image['sizes']['medium_square'],
'medium_rectangle' => $image['sizes']['medium_rectangle'],
'medium_large' => $image['sizes']['medium_large'],
'large' => $image['sizes']['large'],
],
'url' => $image['url'],
'title' => $image['title'],
'mime_type' => $image['mime_type'],
]
);
}
return $carousel_images;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function druplex_field__field_portfolio_images($variables) {\n\n $output = '<div class=\"flexslider\"><ul class=\"slides\">';\n\n foreach ($variables['items'] as $delta => $item) {\n $output .= '<li>' . drupal_render($item) . '</li>';\n }\n\n $output .= '</ul></div>';\n \n return $output;\n}",
"function druplex_field__field_blog_images($variables) {\n\n $output = '<div class=\"flexslider\"><ul class=\"slides\">';\n\n foreach ($variables['items'] as $delta => $item) {\n $output .= '<li>' . drupal_render($item) . '</li>';\n }\n\n $output .= '</ul></div>';\n \n return $output;\n}",
"private function generateThumbnailImagick(){\n\t}",
"protected function combineImages() {}",
"function htheme_imgcarousel_shortcode( $atts ) {\r\n\r\n\t\t#SETUP CONTENT CLASS\r\n\t\t$htheme_data = $this->htheme_content->htheme_image_carousel($atts);\r\n\r\n\t\t#RETURN DATA/HTML\r\n\t\treturn $htheme_data;\r\n\r\n\t}",
"function druplex_field__field_image($variables) {\n\n $output = '<div class=\"flexslider\"><ul class=\"slides\">';\n\n foreach ($variables['items'] as $delta => $item) {\n $output .= '<li>' . drupal_render($item) . '</li>';\n }\n\n $output .= '</ul></div>';\n \n return $output;\n}",
"public function image_carousel($category) {\n\t\t$str = \"\";\n\t\t$cols = array();\n\t\t$image_list = NULL;\n\n\t\tif (is_string($category)) {\n\t\t\t$image_list = $this->images[$category];\n\t\t} else if (is_array($category)) {\n\t\t\t$image_list = $this->images[$category[0]];\n\n\t\t\tfor ($i = 1; $i < count($category); $i++) {\n\t\t\t\t$image_list = array_merge($image_list, $this->images[$category[$i]]);\n\t\t\t}\n\t\t}\n\n\t\tforeach ($image_list as $idx => $image) {\n\t\t\tarray_push($cols, Builder::child(\"div\", array(\"class\" => \"col\"),\n\t\t\t\tBuilder::child(\"a\", array(\"href\" => $image, \"data-toggle\" => \"lightbox\", \"data-gallery\" => implode(\"-\", array($this->id, implode(\"-\", (array)$category)))),\n\t\t\t\t\tBuilder::child(\"img\", array(\"src\" => $image, \"class\" => \"img-fluid img-thumbnail\"))\n\t\t\t\t)\n\t\t\t));\n\n\t\t\tif (($idx + 1) % 3 == 0) {\n\t\t\t\t$str .= Builder::root(\"div\", array(\"class\" => \"row\"), $cols)->saveHTML();\n\t\t\t\t$str .= \"<br>\";\n\t\t\t\t$cols = array();\n\t\t\t}\n\t\t}\n\n\t\tif (count($cols) > 0) {\n\t\t\t$str .= Builder::root(\"div\", array(\"class\" => \"row\"), $cols)->saveHTML();\n\t\t}\n\n\t\treturn $str;\n\t}",
"function dt_sc_carousel($attrs, $content = null) {\n\t\textract ( shortcode_atts ( array (\n\t\t\t\t'columns' => '2'\n\t\t), $attrs ) );\n\n\t\t$min = 1;\n\t\t$max = $width = \"\";\n\t\tif( $columns == 2 ):\n\t\t\t$max = 2;\n\t\t\t$width = 520;\n\t\telseif( $columns == 3 ):\n\t\t\t$max = 3;\n\t\t\t$width = 340;\n\t\telseif( $columns == 4 ):\n\t\t\t$max = 4;\n\t\t\t$width = 250;\n\t\telseif( $columns == 5 ):\n\t\t\t$max = 5;\n\t\t\t$width = 195;\n\t\telse:\n\t\t\t$max = 2;\n\t\t\t$width = 520;\n\t\tendif;\n\n\t\t\n\t\t$content = DTCoreShortcodesDefination::dtShortcodeHelper ( $content );\n\t\t$content = str_replace( '<ul>', \"<ul class='dt-sc-images-carousel'>\", $content );\n\t\t\n\t\t\n\t\t$out = \"<div class='dt-sc-images-carousel-wrapper' data-min='{$min}' data-max='{$max}' data-width='{$width}'>\";\n\t\t$out .= $content;\n\t\t$out .= '<div class=\"carousel-arrows\">';\n\t\t$out .= '\t<a href=\"\" class=\"images-carousel-prev\"> <span class=\"fa fa-angle-left\"> </span> </a>';\n\t\t$out .= '\t<a href=\"\" class=\"images-carousel-next\"> <span class=\"fa fa-angle-right\"> </span> </a>';\n\t\t$out .= '</div>';\n\t\t$out .= '</div>';\n\t\treturn $out;\n\t}",
"function getSlider_images()\n\t\t{\n\t\t\t$slider_images = $this->manage_content->getValue('slider_info','*');\n\t\t\tforeach($slider_images as $slider_image)\n\t\t\t{\n\t\t\t\tif($slider_image['slider_status'] == 1)\n\t\t\t\t{\n\t\t\t\t\techo '<a href=\"'.$slider_image[\"slider_link\"].'\"><img src=\"images/'.$slider_image[\"slider_image\"].'\" style=\"width:692px;height:210px;\"/></a>';\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"function add_images($images, $count) {\n // Make sure we have at least 3 images for carousel\n for ($i=0; $i < $count; $i++) {\n echo $images[$i];\n }\n}",
"function spiplistes_corrige_img_pack ($img) {\n\tif(preg_match(\",^<img src='dist/images,\", $img)) {\n\t\t$img = preg_replace(\",^<img src='dist/images,\", \"<img src='../dist/images\", $img);\n\t}\n\treturn($img);\n}",
"protected function scaleImages() {}",
"public function setSOnHandImgs(){\n $sOnHandImgs=\"\";\n if(!empty($this->sOnHand)){\n $komas=explode(\",\",$this->sOnHand);\n $class=\"\";\n foreach($komas as $koma){\n $pngimg=$this->filePathKoma;\n $pngimg.=\"S\";\n $komatopng=$this->komatopng($koma);\n $komadata=$this->komatopng(strtolower($koma));\n $pngimg.=$komatopng;\n $imageTag= $this->makeImageTag($class,$pngimg,$komadata);\n $sOnHandImgs.=$imageTag;\n }}\n return $sOnHandImgs;\n }",
"public function actionCarouselImages() {\n\n // # Cache result forever\n $cached = Cache::rememberForever( 'actionCarouselImages', function () {\n\n // # Conatiner init\n $container = [];\n\n // # Directory iterator\n $iterator = new \\DirectoryIterator( \"./images/carousel\" );\n\n // # Loop through files and dir\n foreach( $iterator as $item ) {\n\n // # Avoid dirs\n if( is_dir( $item ) ) {\n continue;\n }\n\n // # Get pathname\n $path = ltrim( $item->getPathname(), \".\" );\n $tmp[ 'src' ] = $path;\n $tmp[ 'thumb' ] = $path;\n $container[] = $tmp;\n }\n\n // # toJson\n return json_encode($container);\n });\n\n return response()->make( $cached );\n\n }",
"function shop_uc_product_image($variables) {\n static $rel_count = 0;\n $images = $variables['images'];\n\n // Get the current product image widget.\n $image_widget = uc_product_get_image_widget();\n\n $first = array_shift($images);\n\n //$output = '<div class=\"product-image\"><div class=\"main-product-image\">'; // Sudhakar\n $output = '<div class=\"product_img_big\">';\n $output .= '<a href=\"' . image_style_url('uc_product_full', $first['uri']) . '\" title=\"' . $first['title'] . '\"';\n if ($image_widget) {\n $image_widget_func = $image_widget['callback'];\n $output .= $image_widget_func($rel_count);\n } \n $output .= '>';\n $output .= theme('image_style', array(\n 'style_name' => 'uc_product',\n 'path' => $first['uri'],\n 'alt' => $first['alt'],\n 'title' => $first['title'],\n\t'width' => 100, // Sudhakar\n\t'height' => 92, // Sudhakar\n ));\n // $output .= '</a></div>'; // Sudhakar\n $output .= '</a>';\n\n if (!empty($images)) {\n $output .= '<div class=\"more-product-images\">';\n foreach ($images as $thumbnail) {\n // Node preview adds extra values to $images that aren't files.\n if (!is_array($thumbnail) || empty($thumbnail['uri'])) {\n continue;\n }\n $output .= '<a href=\"' . image_style_url('uc_product_full', $thumbnail['uri']) . '\" title=\"' . $thumbnail['title'] . '\"';\n if ($image_widget) {\n $output .= $image_widget_func($rel_count);\n }\n $output .= '>';\n $output .= theme('image_style', array(\n 'style_name' => 'uc_thumbnail',\n 'path' => $thumbnail['uri'],\n 'alt' => $thumbnail['alt'],\n 'title' => $thumbnail['title'],\n ));\n $output .= '</a>';\n }\n $output .= '</div>';\n }\n\n $output .= '</div>';\n $rel_count++;\n\n return $output;\n}",
"protected function buildSlides() {\n $this->sortSlidesByWeight();\n\n $slides = [];\n foreach ($this->configuration['slides'] as $slide) {\n if ($slide['mid'] !== NULL) {\n $slides[] = [\n 'image' => $this->fileUrlFromMediaId($slide['mid']),\n 'caption' => $slide['caption'],\n ];\n }\n }\n return $slides;\n }",
"function _circ1($options)\n\t{\n\t\n\t\tif ( isset ( $options['ww_header_style'] ) && !empty ( $options['ww_header_style'] ) ) { \n\t\t\t$style = 'uh_'.$options['ww_header_style'];\n\t\t} else { \n\t\t\t$style = '';\n\t\t}\n\t\n\t?>\n <div id=\"slideshow\" class=\"<?php echo $style; ?>\">\n\t\t\n\t\t\t<div class=\"bgback\"></div>\n\t\t\t<div data-images=\"<?php echo IMAGES_URL; ?>/\" id=\"sparkles\"></div>\n\t\t\n\t\t\t<div class=\"container zn_slideshow\">\n\n\t\t\t\t<div id=\"ca-container\" class=\"ca-container\">\n <div class=\"ca-wrapper\">\n <?php\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( isset ( $options['single_circ1'] ) && is_array ( $options['single_circ1'] ) ) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$i = 1;\n\t\t\t\t\t\t\t$thumbs = '';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach ( $options['single_circ1'] as $slide ) {\t\t\t\t\t\n\n\t\t\t\t\t\t\t\techo '<div class=\"ca-item ca-item-'.$i.'\">';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\techo '<div class=\"ca-item-main\">';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"background\"></div><!-- background color -->';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_image'] ) && !empty ( $slide['ww_slide_image'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"ca-icon\">';\n\t\t\t\t\t\t\t\t\t\t\t\t$image = vt_resize( '',$slide['ww_slide_image'] , '336','200', true );\n\t\t\t\t\t\t\t\t\t\t\t\techo '<img src=\"'.$image['url'].'\" width=\"'.$image['width'].'\" height=\"'.$image['height'].'\" />';\n\t\t\t\t\t\t\t\t\t\t\techo '</div>';\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// TITle\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_title'] ) && !empty ( $slide['ww_slide_title'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<h3>'. $slide['ww_slide_title'].'</h3>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// DESC\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_desc'] ) && !empty ( $slide['ww_slide_desc'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<h4>'. $slide['ww_slide_desc'].'</h4>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// DESC\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_read_text'] ) && !empty ( $slide['ww_slide_read_text'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"#\" class=\"ca-more\">'.$slide['ww_slide_read_text'].' <span class=\"icon-chevron-right icon-white\"></span></a>';\n\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// Bottom Title\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_bottom_title'] ) && !empty ( $slide['ww_slide_bottom_title'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<span class=\"ca-starting\">'. $slide['ww_slide_bottom_title'].'</span>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\techo '<div class=\"ca-content-wrapper\">';\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"ca-content\">';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// Content Title\n\t\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_content_title'] ) && !empty ( $slide['ww_slide_content_title'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '<h6>'.$slide['ww_slide_content_title'].'</h6>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"#\" class=\"ca-close\"><span class=\"icon-remove\"></span></a>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// Content description\n\t\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_desc_full'] ) && !empty ( $slide['ww_slide_desc_full'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"ca-content-text\">';\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\techo $slide['ww_slide_desc_full'];\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// Link\n\t\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_read_text_content'] ) && !empty ( $slide['ww_slide_read_text_content'] ) && isset ( $slide['ww_slide_link']['url'] ) && !empty ( $slide['ww_slide_link']['url'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"'.$slide['ww_slide_link']['url'].'\" target=\"'.$slide['ww_slide_link']['target'].'\">'.$slide['ww_slide_read_text_content'].'</a>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\techo '</div><!-- end ca-item -->';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t?>\n\n </div><!-- end ca-wrapper -->\n </div><!-- end circular content carousel -->\n\n\t\t\t</div>\n\t\t\t\n\t\t\t<div class=\"zn_header_bottom_style\"></div><!-- header bottom style -->\n\t\t\t\n </div><!-- end slideshow -->\n\t<?php\n\t}",
"function ShowImageList()\n{\n\techo('<div class=\"panel panel-primary\"><div class=\"panel-heading\">');\n\t\techo('<h3 class=\"panel-title\">');\n\t\techo(\"\".getPara('imagelist','value2'));\n\t\techo('</h3></div>');\n\t\techo('<div class=\"panel-body\">');\n\t\t\n\t\t\techo('<div id=\"myCarousel\" class=\"carousel slide\">\n\t\t\t\t\t <div class=\"carousel-inner\">');\n\t\t\t$str2=\"select * from imagelist order by imageid desc\";\n\t\t\t$result2=mysql_query($str2) or die(mysql_error());\n\t\t\t$k=0;\n\t\t\twhile ($row2=mysql_fetch_array($result2))\n\t\t\t{\n\t\t\t\tif($k==1)\n\t\t\t\t{\n\t\t\t\t\t echo('<div class=\"active item\">\n\t\t\t\t\t <img class=\"img-responsive\" src=\"'.$row2['file'].'\"/>\n\t\t\t\t\t </div>');\n\t\t\t\t}else{\n\t\t\t\t\n\t\t\t\t\t echo('<div class=\"item\">\n\t\t\t\t\t \t<img class=\"img-responsive\" src=\"'.$row2['file'].'\"\"/>\t\t\t\t \t\n\t\t\t\t\t </div>');\n\t\t\t\t\t }\n\t\t\t\t$k++;\t \n\t\t\t\t}\n\t\t\t\techo('</div>\n\t\t\t\t\t <!-- Carousel nav -->\n\t\t\t\t\t <a class=\"carousel-control left\" href=\"#myCarousel\" data-slide=\"prev\">‹</a>\n\t\t\t\t\t <a class=\"carousel-control right\" href=\"#myCarousel\" data-slide=\"next\">›</a>\n\t\t\t\t\t</div>');\n\t\t\techo(\"</div>\");\n\t\t\techo(\"</div>\");\n}",
"function create_bootstrap_carousel($string)\n{\n# Nur zum Debug:\n# return \"hier soll mal ein Slider rein\";\n# enthaelt teilweise noch Code, der aktuell nicht benötigt wird, ggf fuer Ausbau\n global $settings, $template;\n $page = isset($GLOBALS['parent_page']) && $GLOBALS['parent_page'] ? $GLOBALS['parent_page'] : PAGE;\n $template->assign('contains_thumbnails', true);\n $template->assign('page', $page);\n $string = explode('|',$string[1]);\n $bootstrap_carousel = $string[0];\n #if(isset($string[1])) $img_class = $string[1];\n $bootstrap_carousel = new Gallery($bootstrap_carousel);\n if($bootstrap_carousel->photos)\n {\n $template->assign('number_of_photos', $bootstrap_carousel->number_of_photos);\n $template->assign('photos', $bootstrap_carousel->photos);\n }\n #$template->assign('lang', Localization::$lang);\n $bootstrap_carousel = $template->fetch(BASE_PATH.'cms/templates/subtemplates/bootstrap-carousel.inc.tpl');\n return $bootstrap_carousel;\n}",
"public static function theme_images() {\r\n add_image_size('slideshow-980', 980, 420, true);\r\n add_image_size('slideshow-1200', 1180, 550, true);\r\n add_image_size('slideshow-1560', 1540, 550, true);\r\n add_image_size('slideshow-720', 600, 550, true);\r\n add_image_size('grid-thumbnail', 370, 270, true);\r\n add_image_size('icon-60', 60, 60, true);\r\n add_image_size('icon-100', 100, 100, true);\r\n add_image_size('icon-40', 40, 40, true);\r\n }",
"function _partners_logos( $options )\n\t{\n\t\n\t\t\n\t\t$element_size = zn_get_size( $options['_sizer'] );\n\t\n\t\tpreg_match('|\\d+|', $element_size['sizer'] , $new_size);\n\t\t$new_size = $new_size[0]-2;\n\t?>\n\t\t<div class=\"span2 partners_carousel\">\n\t\t<?php\n\t\t\tif ( !empty ( $options['pl_title'] ) && $options['pl_title_style'] == 'style1' ) {\n\t\t\t\techo '<h5 class=\"title\"><span>'.$options['pl_title'].'</span></h5>';\n\t\t\t}\n\t\t\telseif ( !empty ( $options['pl_title'] ) && $options['pl_title_style'] == 'style2' ) {\n\t\t\t\techo '<h4 class=\"m_title\"><span>'.$options['pl_title'].'</span></h4>';\n\t\t\t}\n\t\t?>\n\t\t\t<div class=\"controls\">\n\t\t\t\t<a href=\"#\" class=\"prev\"><span class=\"icon-chevron-left\"></span></a>\n\t\t\t\t<a href=\"#\" class=\"next\"><span class=\"icon-chevron-right\"></span></a>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"span<?php echo $new_size;?> partners_carousel\">\n\t\t\t<ul id=\"partners_carousel\" class=\"fixclear partners_carousel_trigger\">\n\t\t\t\n\t\t\t\t<?php\n\t\t\t\t\tif ( !empty ( $options['partners_single'] ) && is_array ( $options['partners_single'] ) ) {\n\t\t\t\t\t\n\t\t\t\t\t\tforeach ( $options['partners_single'] as $partner ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$link_start = '<a href=\"#\">';\n\t\t\t\t\t\t\t$link_end = '</a>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( !empty ( $partner['lp_single_logo'] ) ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\techo '<li>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ( !empty ( $partner['lp_link']['url'] ) ) {\n\t\t\t\t\t\t\t\t\t$link_start = '<a href=\"'.$partner['lp_link']['url'].'\" target=\"'.$partner['lp_link']['target'].'\">';\n\t\t\t\t\t\t\t\t\t$link_end = '</a>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\techo $link_start;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\techo '<img src=\"'.$partner['lp_single_logo'].'\" alt=\"\" />';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\techo $link_end;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\techo '</li>';\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\n\t\t\t</ul>\n\t\t</div>\n\t<?php\n\t}",
"function createItems($data) { ?>\n\t\t<div class=\"item active\">\n\t\t\t<img src=\"layout/gallery/default.png\" alt=\"<?= $data[$i][\"header\"] ?>\" \n\t\t\t\tstyle=\"height: 500px; margin-left: auto; margin-right: auto;\">\n\t\t\t<div class=\"carousel-caption custom-caption\">\n\t\t\t\t<h3>Chapter House</h3>\n\t\t\t\t<p>View of the house from 47th street.</p>\n\t\t\t</div> \n\t\t</div> <?PHP\n\t\tfor ($i = 0; $i < count($data); $i++) { ?>\n\t\t\t<div class=\"item\">\n\t\t\t\t<img src=\"layout/gallery/<?= $data[$i][\"id\"] ?>.png\" alt=\"<?= $data[$i][\"header\"] ?>\" \n\t\t\t\t\tstyle=\"height: 500px; margin-left: auto; margin-right: auto;\">\n\t\t\t\t<div class=\"carousel-caption custom-caption\">\n\t\t\t\t\t<h3><?= $data[$i][\"header\"]; ?></h3>\n\t\t\t\t\t<p><?= $data[$i][\"content\"]; ?></p>\n\t\t\t\t</div> \n\t\t\t</div> <?PHP\n\t\t}\n\t}",
"public function getSliderImageNameAttribute(){\n $photo_src=explode('.',$this->attributes['name']);\n if(count($photo_src)>1)\n {\n $photo_details = pathinfo($this->attributes['name']); \n $name = @$photo_details['filename'].'_1440x960.'.@$photo_details['extension'];\n return url('/').'/images/multiple_rooms/'.$this->attributes['multiple_room_id'].'/'.$name;\n }\n else\n {\n $options['secure']=TRUE;\n $options['width']=1440;\n $options['height']=960;\n $options['crop']='fill';\n return $src=\\Cloudder::show($this->attributes['name'],$options);\n }\n }",
"function cool_carousel_activation(){}",
"private function generateThumbnailGD(){\n\t\t\n\t}",
"function mob_images() {\n\tupdate_option( 'thumbnail_size_w', 360 );\n\tupdate_option( 'thumbnail_size_h', 220 );\n\tupdate_option( 'thumbnail_crop', 1 );\n\n\tupdate_option( 'medium_size_w', 654 );\n\tupdate_option( 'medium_size_h', 9999 );\n\tupdate_option( 'medium_crop', 0 );\n\n\tupdate_option( 'medium_large_size_w', 0 );\n\tupdate_option( 'medium_large_size_h', 0 );\n\n\tupdate_option( 'large_size_w', 850 );\n\tupdate_option( 'large_size_h', 400 );\n\tupdate_option( 'large_crop', 1 );\n\n\tadd_image_size( 'archive-blog', 360, 170, true );\t\n}",
"function _circ2($options)\n\t{\n\t\n\t\tif ( isset ( $options['ww_header_style'] ) && !empty ( $options['ww_header_style'] ) ) { \n\t\t\t$style = 'uh_'.$options['ww_header_style'];\n\t\t} else { \n\t\t\t$style = '';\n\t\t}\n\t\n\t?>\n <div id=\"slideshow\" class=\"<?php echo $style; ?>\">\n\t\t\n\t\t\t<div class=\"bgback\"></div>\n\t\t\t<div data-images=\"<?php echo IMAGES_URL; ?>/\" id=\"sparkles\"></div>\n\t\t\n\t\t\t<div class=\"container zn_slideshow\">\n\n\t\t\t\t<div id=\"ca-container\" class=\"ca-container\">\n <div class=\"ca-wrapper\">\n <?php\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( isset ( $options['single_circ2'] ) && is_array ( $options['single_circ2'] ) ) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$i = 1;\n\t\t\t\t\t\t\t$thumbs = '';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach ( $options['single_circ2'] as $slide ) {\t\t\t\t\t\n\n\t\t\t\t\t\t\t\techo '<div class=\"ca-item ca-item-'.$i.'\">';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\techo '<div class=\"ca-item-main\">';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_image'] ) && !empty ( $slide['ww_slide_image'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"ca-icon\">';\n\t\t\t\t\t\t\t\t\t\t\t\t$image = vt_resize( '',$slide['ww_slide_image'] , '376','440', true );\n\t\t\t\t\t\t\t\t\t\t\t\t$bg = 'style=\"background-image:url('.$image['url'].');\"';\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\techo '</div>';\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"background\" '.$bg.'></div><!-- background color -->';\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// TITle\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_title'] ) && !empty ( $slide['ww_slide_title'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_title_left'] ) && !empty ( $slide['ww_slide_title_left'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t$title_pos_l = 'left:'.$slide['ww_slide_title_left'].'px;';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_title_top'] ) && !empty ( $slide['ww_slide_title_top'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t$title_pos_t = 'top:'.$slide['ww_slide_title_top'].'px;';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"title_circle\" style=\"'.$title_pos_t.' '.$title_pos_l.'\" data-size=\"'.$slide['ww_slide_title_size'].'\">';\n\t\t\t\t\t\t\t\t\t\t\t\techo '<span>'.$slide['ww_slide_title'].'</span>';\n\t\t\t\t\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// DESC\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_desc'] ) && !empty ( $slide['ww_slide_desc'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<h4>'. $slide['ww_slide_desc'].'</h4>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// DESC\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_read_text'] ) && !empty ( $slide['ww_slide_read_text'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"#\" class=\"ca-more\">'.$slide['ww_slide_read_text'].' <span class=\"icon-chevron-right icon-white\"></span></a>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// Bottom Title\n\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_bottom_title'] ) && !empty ( $slide['ww_slide_bottom_title'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\techo '<span class=\"ca-starting\">'. $slide['ww_slide_bottom_title'].'</span>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\techo '<div class=\"ca-content-wrapper\">';\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"ca-content\">';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// Content Title\n\t\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_content_title'] ) && !empty ( $slide['ww_slide_content_title'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '<h6>'.$slide['ww_slide_content_title'].'</h6>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"#\" class=\"ca-close\"><span class=\"icon-remove\"></span></a>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// Content description\n\t\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_desc_full'] ) && !empty ( $slide['ww_slide_desc_full'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"ca-content-text\">';\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\techo $slide['ww_slide_desc_full'];\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// Link\n\t\t\t\t\t\t\t\t\t\t\tif ( isset ( $slide['ww_slide_read_text_content'] ) && !empty ( $slide['ww_slide_read_text_content'] ) && isset ( $slide['ww_slide_link']['url'] ) && !empty ( $slide['ww_slide_link']['url'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"'.$slide['ww_slide_link']['url'].'\" target=\"'.$slide['ww_slide_link']['target'].'\">'.$slide['ww_slide_read_text_content'].'</a>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\techo '</div><!-- end ca-item -->';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t?>\n\n </div><!-- end ca-wrapper -->\n </div><!-- end circular content carousel -->\n\n\t\t\t</div>\n\t\t\t\n\t\t\t<div class=\"zn_header_bottom_style\"></div><!-- header bottom style -->\n\t\t\t\n </div><!-- end slideshow -->\n\t<?php\n\t}",
"public function htheme_imgcarousel_element(){\r\n\r\n\t\t//SETUP VC MAP\r\n\t\tvc_map(\r\n\t\t\tarray(\r\n\t\t\t\t\"name\" => esc_html__( \"Basic Image Carousel\", \"js_composer\" ),\r\n\t\t\t\t\"base\" => \"htheme_imgcarousel_slug\",\r\n\t\t\t\t\"class\" => \"\",\r\n\t\t\t\t'icon' => 'htheme_imgcarousel_icon',\r\n\t\t\t\t\"category\" => esc_html__( \"WooCommerce\", \"js_composer\"),\r\n\t\t\t\t'description' => esc_html__( \"Add an image carousel to your site.\", \"js_composer\" ),\r\n\t\t\t\t\"params\" => array(\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\"type\" => \"attach_images\",\r\n\t\t\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\t\t\"class\" => \"htheme_element_class\",\r\n\t\t\t\t\t\t\"heading\" => esc_html__( \"Images\", \"js_composer\" ),\r\n\t\t\t\t\t\t\"param_name\" => \"htheme_imgcarousel_images\",\r\n\t\t\t\t\t\t\"value\" => __( \"\", \"js_composer\" ),\r\n\t\t\t\t\t\t\"description\" => esc_html__( \"Add multiple images for you image carousel.\", \"js_composer\" )\r\n\t\t\t\t\t),\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\"type\" => \"dropdown\",\r\n\t\t\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\t\t\"class\" => \"htheme_element_class\",\r\n\t\t\t\t\t\t\"heading\" => esc_html__( \"Image sizing\", \"js_composer\" ),\r\n\t\t\t\t\t\t\"param_name\" => \"htheme_image_carousel_size\",\r\n\t\t\t\t\t\t\"value\" => array(\r\n\t\t\t\t\t\t\t'Contain' => 'contain',\r\n\t\t\t\t\t\t\t'Cover' => 'cover',\r\n\t\t\t\t\t\t\t'Auto' => 'auto'\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'std' => '',\r\n\t\t\t\t\t\t\"description\" => esc_html__( \"Choose the image sizing.\", \"js_composer\" ),\r\n\t\t\t\t\t),\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\"type\" => \"dropdown\",\r\n\t\t\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\t\t\"class\" => \"htheme_element_class\",\r\n\t\t\t\t\t\t\"heading\" => esc_html__( \"Layout\", \"js_composer\" ),\r\n\t\t\t\t\t\t\"param_name\" => \"htheme_image_carousel_layout\",\r\n\t\t\t\t\t\t\"value\" => array(\r\n\t\t\t\t\t\t\t'Full row carousel' => 'full_row',\r\n\t\t\t\t\t\t\t'Contained carousel' => 'contained_row'\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'std' => '',\r\n\t\t\t\t\t\t\"description\" => esc_html__( \"Choose the layout for your image carousel.\", \"js_composer\" ),\r\n\t\t\t\t\t),\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\"type\" => \"dropdown\",\r\n\t\t\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\t\t\"class\" => \"htheme_element_class\",\r\n\t\t\t\t\t\t\"heading\" => esc_html__( \"Carousel height\", \"js_composer\" ),\r\n\t\t\t\t\t\t\"param_name\" => \"htheme_image_carousel_height\",\r\n\t\t\t\t\t\t\"value\" => array(\r\n\t\t\t\t\t\t\t'100px' => 100,\r\n\t\t\t\t\t\t\t'200px' => 200,\r\n\t\t\t\t\t\t\t'300px' => 300,\r\n\t\t\t\t\t\t\t'400px' => 400,\r\n\t\t\t\t\t\t\t'500px' => 500,\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'std' => '',\r\n\t\t\t\t\t\t\"description\" => esc_html__( \"Set the height for your image carousel.\", \"js_composer\" ),\r\n\t\t\t\t\t),\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t}",
"function createCarousel($data) {\n\n\t\tif (is_array($data)) {\n\t\t\t$unq = uniqid();\n\t\t\t$this->id = $unq;\n\t\t\t\n\t\t\t$output = \"<div class='carousel' id='carousel\".$unq.\"'\";\n\t\t\t$output .= (!MOBILE) ? \" style='width:\".$this->width.\"px'>\" : \">\";\n\t\t\t\t$output .= \"<div class='carousel_left' onclick=\\\"carousel('\".$unq.\"', 'left')\\\">\";\n\t\t\t\t$output .= \"</div>\"; //<p><a onclick=\\\"carousel('\".$unq.\"', 'first')\\\">Start</a></p>\";\n\t\t\t\t$output .= \"<div class='carousel_inner'\";\n\t\t\t\t$output .= (!MOBILE) ? \" style='width:\".($this->width).\"px'>\" : \">\";\n\t\t\t\t\t$output .= \"<div class='carousel_slider'\";\n\t\t\t\t\t$output .= (!MOBILE) ? \" style='width:\".(($this->elm_width+25)*count($data)).\"px'>\" : \">\";\n\t\t\t\t\tforeach ($data as $key=>$elm) {\n\t\t\t\t\t\t$output .= \"<div class='carousel_element' style='max-width:\".$this->elm_width.\"px'>\";\n\t\t\t\t\t\t$output .= $elm;\n\t\t\t\t\t\t$output .= \"</div>\";\n\t\t\t\t\t}\n\t\t\t\t\t$output .= \"</div>\";\n\t\t\t\t$output .= \"</div>\";\n\t\t\t\t$output .= \"<div class='carousel_right' onclick=\\\"carousel('\".$unq.\"', 'right')\\\">\";\n\t\t\t\t$output .= \"</div>\";\n\t\t\t//$output .= \"</div><p style='float:right; font-size:11px;'><a onclick=\\\"carousel('\".$unq.\"', 'last')\\\">Skip to end</a></p>\";\n\t\t\t$output .= \"<script type='text/javascript'>$(document).ready(function(){carousel_skip=\".($this->elm_width+20).\"});</script>\";\n\t\t\t\n\t\t} else {\n\t\t\t$output = \"<p><em>please supply at least one element to create carousel</em></p>\";\n\t\t}\n\t\t\n\t\treturn $output;\n\t}",
"function img_responsive($content){\n return str_replace('<img class=\"','<img class=\"lazyload ',$content);\n}"
]
| [
"0.6121079",
"0.599014",
"0.5984086",
"0.59743446",
"0.5921296",
"0.5918254",
"0.5910496",
"0.59044397",
"0.5776806",
"0.57734877",
"0.57530934",
"0.5728378",
"0.5719865",
"0.5695549",
"0.5692439",
"0.5646025",
"0.5631394",
"0.56229764",
"0.5611005",
"0.56021136",
"0.559295",
"0.55668736",
"0.55147165",
"0.55129623",
"0.55073905",
"0.5505954",
"0.55011976",
"0.5489304",
"0.5468789",
"0.54586595"
]
| 0.6382109 | 0 |
Static utility to get all materials | public static function all() {
$material_helper = new Material();
return $material_helper->get_all();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getMaterials()\n {\n return $this->materials;\n }",
"public function getMaterials()\n {\n return $this->materials;\n }",
"public function materialList(){\n $materials = $this->getAll();\n $options = [];\n foreach($materials as $material){\n $options[$material->material_name] = $material->id;\n } \n \treturn $options;\n }",
"public static function getMaterials()\n\t\t{\n\t\t\t$supplier_id = $_POST['supplierID'];\n\t\t\t\n\t\t\t$stageDBO = DatabaseObjectFactory::build('material');\n\t\t\t$arr = ['material_id','supplier_id','unit_price','name'];\n\t\t\t$stageDBO->SetJoin(['[><]item' => 'item_id']);\n\t\t\t$materials = $stageDBO->getRecords($arr, ['supplier_id' => $supplier_id]);\n\n\t\t\t$stageDBO = DatabaseObjectFactory::build('supplier_discount');\n\t\t\t$arr = ['material_id','supplier_id','min_qty','discount_percent'];\n\t\t\t$discounts = $stageDBO->getRecords($arr, ['supplier_id' => $supplier_id]);\n\n\n\t\t\trequire_once('views/pages/orderMaterials2.php');\n\t\t}",
"public function materialsAction() {\n\t$materials = new Materials();\n\t$this->view->materials = $materials->getMaterials();\n\t}",
"public function getAdditionalMaterials()\n {\n return $this->additionalMaterials;\n }",
"public function materiallist()\n {\n $objMaterial = new Material();\n $materials = $objMaterial->getMaterialList();\n return Datatables::of($materials)\n ->addColumn('action', function ($material) {\n return $this->generateAction($material);\n })\n ->addColumn('viewlink', function ($material) {\n return $this->generateMaterialLink($material);\n })\n ->addColumn('statusurl', function ($material) {\n return $this->fngenerateoptions($material);\n })\n ->addColumn('deloption',function($material){\n return $this->fngenerateTeacherDeleteOptions($material);\n })\n ->make(true);\n }",
"public function materials()\n {\n return $this->hasMany('App\\Material');\n }",
"public function materials()\n {\n return $this->hasMany('App\\Material', 'supplier_id', 'id');\n }",
"public function queryAll(){\r\n\t\t$sql = 'SELECT * FROM material';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\treturn $this->getList($sqlQuery);\r\n\t}",
"public function getMaterials($returnJson = false)\n\t{\n\t\t$result = array();\n\t\t$piArray = ProductInfo::getAllByCriteria('productId = ? and typeId = ? and entityName = ?', array($this->getId(), ProductInfoType::ID_MATERIAL, ProductInfoType::ENTITY_NAME_MATERIAL));\n\t\tforeach($piArray as $pi)\n\t\t{\n\t\t\tif(($material = Material::get(intval($pi->getEntityId()))) instanceof Material)\n\t\t\t{\n\t\t\t\tif($returnJson === false)\n\t\t\t\t\t$result[] = array('material' => $material, 'qty' => $pi->getValue() );\n\t\t\t\telse\n\t\t\t\t\t$result[] = $pi->getJson(array('material' => $material->getJson(), 'qty' => $pi->getValue()));\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}",
"public static function ordermaterials()\n\t\t{\t\n\t\t\t//This function gets all the SupplierIDs and Company names to be used on the order materials page.\n\t\t\t$stageDBO = DatabaseObjectFactory::build('supplier');\n\t\t\t$arr = ['supplier_id','company_name'];\n\t\t\t$suppliers = $stageDBO->getRecords($arr);\n\t\t\trequire_once('views/pages/orderMaterials.php');\n\t\t}",
"public function initMaterials()\n\t{\n\t\tif ($this->collMaterials === null) {\n\t\t\t$this->collMaterials = array();\n\t\t}\n\t}",
"public function getMaterial()\n\t{\n\t\t$this->loadManyToOne('material');\n\t\treturn $this->material;\n\t}",
"public function materialAction() {\n\tif($this->_getParam('id',false)) {\n\t$materials = new Materials();\n\t$this->view->materials = $materials->getMaterialDetails($this->_getParam('id'));\n\t} else {\n throw new Pas_Exception_Param($this->_missingParameter);\n\t}\n\t}",
"public function index()\n {\n $materials = Material::all();\n return view('catalog.material.index',['materials' => $materials]);\n }",
"public function index() {\n $materials = Material::withCount('parts')->get();\n if($materials) {\n return response()->json([\n 'success' => true,\n 'post' => [\n 'materials' => $materials,\n ],\n 'message' => '已获取所有材质信息'\n ]);\n } else {\n return response()->json([\n 'success' => false,\n 'post' => null,\n 'message' => '获取材质信息失败'\n ]);\n }\n }",
"public function index()\n {\n $materials = Material::all();\n return view('backend.material.index')->withMaterials($materials);\n }",
"public static function getMaterials($printerId) {\n\n $materials = DAOFactory::getMaterialDAO()->queryMaterialsByPrinterId($printerId);\n\n return $materials;\n }",
"public function listCourseMaterials()\n\t{\n\t\t$allCourseMaterials = courseMaterial::getCourseMaterials();\n\t\treturn view('admin/course_materials/list')->with('data', array('allCourseMaterials' => $allCourseMaterials));\n\t}",
"public function productMaterials()\n {\n return $this->hasMany('App\\ProductMaterial');\n }",
"public function setMaterials($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->materials = $arr;\n\n return $this;\n }",
"public function setMaterials($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->materials = $arr;\n\n return $this;\n }",
"public function index()\n {\n //\n $materials = Material::all();\n return view('Material.index')->with('materials',$materials);\n }",
"public function getMaterials($criteria = null, $con = null)\n\t{\n\t\t// include the Peer class\n\t\tinclude_once 'lib/model/om/BaseMaterialPeer.php';\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria();\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collMaterials === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collMaterials = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(MaterialPeer::MM_ID, $this->getId());\n\n\t\t\t\tMaterialPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collMaterials = MaterialPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(MaterialPeer::MM_ID, $this->getId());\n\n\t\t\t\tMaterialPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastMaterialCriteria) || !$this->lastMaterialCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collMaterials = MaterialPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastMaterialCriteria = $criteria;\n\t\treturn $this->collMaterials;\n\t}",
"public function materials()\n\t{\n\t\treturn $this->belongsToMany(Material::class, Helper::prefixTable('inventory_material'))\n\t\t\t\t\t->using(InventoryMaterial::class)\n\t\t\t\t\t->withPivot('value', 'unit_id', 'price');\n\t}",
"function getMaterials($refresh = false) {\n\n if (!$refresh && $this->courses_materials) {\n return $this->courses_materials;\n }\n\n $results = get_records('block_courseprefs_materials', 'usersid', $this->id);\n $this->courses_materials = array();\n\n if (!empty($results)) { \n foreach ($results as $result) {\n $this->courses_materials[$result->id] = new CoursePrefsMaterial($result->coursesid,\n $result->usersid, $result->create_flag, $result->id);\n }\n }\n return $this->courses_materials;\n }",
"function listaMaterial(){\n //Construimos la consulta\n $sql=\"SELECT * from material_entregado\";\n //Realizamos la consulta\n $resultado=$this->realizarConsulta($sql);\n if($resultado!=null){\n //Montamos la tabla de resultados\n $tabla=[];\n while($fila=$resultado->fetch_assoc()){\n $tabla[]=$fila;\n }\n return $tabla;\n }else{\n return null;\n }\n }",
"public function getMaterial() : ?string ;",
"public function getServiceMaterials(): ?array\n {\n return $this->serviceMaterials;\n }"
]
| [
"0.789449",
"0.789449",
"0.74833924",
"0.73451406",
"0.7062001",
"0.70555806",
"0.7049826",
"0.69052845",
"0.6792745",
"0.6716401",
"0.65188915",
"0.64405614",
"0.6403207",
"0.6384388",
"0.6354466",
"0.6319616",
"0.62296534",
"0.6198059",
"0.6196402",
"0.61860687",
"0.6166134",
"0.6131488",
"0.6131488",
"0.6125888",
"0.6120745",
"0.61106044",
"0.608027",
"0.60687774",
"0.6054201",
"0.6032793"
]
| 0.81972843 | 0 |
Checks if this class can handle a specific job | public function canHandleJob(JobData $jobData); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasJob(): bool;",
"public function hasJob($name);",
"public function isJobRequest()\n {\n return array_key_exists(\"job\", $this->request->all());\n }",
"protected function isJobLimit(): bool\n {\n return $this->jobCount >= $this->options->jobLimit;\n }",
"function can_do_listinstancejobs() {\n if (has_capability('block/php_report:manageschedules', get_context_instance(CONTEXT_SYSTEM))) {\n //user can manage schedules globally, so allow access\n return true;\n }\n\n //obtain the report shortname and instance\n $report_shortname = $this->required_param('report', PARAM_ALPHAEXT);\n $report_instance = php_report::get_default_instance($report_shortname, NULL, php_report::EXECUTION_MODE_SCHEDULED);\n\n //false is returned in the case of permissions failure\n return $report_instance !== false;\n }",
"abstract public function canHandle(Task $task);",
"public function isJobsNeeded($className)\n {\n $result = false;\n\n switch ($className) {\n case MeetingStartSoon::class:\n $result = $this->status === self::STATUS_ACCEPTED;\n break;\n case MeetingConfirmationCode::class:\n $result = $this->status === self::STATUS_ACCEPTED && $this->safe_deal_only;\n break;\n case MeetingRateNeededNotificationSend::class:\n $result = $this->status === self::STATUS_CONFIRMED;\n break;\n case MeetingRequestDelete::class:\n $result = $this->status === self::STATUS_NEW;\n break;\n case MeetingFailedStatusChange::class:\n $result = $this->status !== self::STATUS_CONFIRMED;\n break;\n default:\n break;\n }\n\n return $result;\n }",
"public function isJobReadyToBeExecuted(QueueControl $job)\n {\n $children = $job->getChildren();\n\n echo 'I have '.count($children).' children'.PHP_EOL;\n\n if (empty($children)) {\n return true;\n }\n\n foreach ($children as $childJob) {\n $childStatus = $childJob->getQueueStatus()->getId();\n echo 'My child status is '.$childStatus.PHP_EOL;\n\n if (!in_array($childStatus, array(self::STATUS_COMPLETED, self::STATUS_FAILED, self::STATUS_NEW))) {\n //Forced to query DB again by dea\n $this->entityManager->detach($job);\n echo 'Still have incompleted jobs '.$childStatus.PHP_EOL;\n return false;\n }\n }\n\n return true;\n\n\n\n }",
"protected function verifyCompliance()\n {\n // Get the policy based on the job name\n $policyClass = sprintf('%sPolicy', str_replace('Jobs', 'JobPolicies', get_class($this)));\n\n // Job complies if no policy exists\n if (! class_exists($policyClass)) {\n return true;\n }\n\n // Instantiate the policy\n $policy = app($policyClass);\n\n // Policy will either return true or throw an exception\n return $policy->complies($this);\n }",
"public function isAvailable()\n {\n return $this->job instanceof ImportInterface;\n }",
"public function authorize()\n {\n $job = Job::findOrFail($this->route('id'));\n\n return $job->state_id == State::FINISHED;\n }",
"private function check()\n {\n foreach ($this->scheduler->getQueuedJobs() as $job) {\n if ($job->isDue(new DateTime()) === true) {\n\n $this->executeIfNotOverlapped($job);\n }\n }\n }",
"public function hasJobs()\n {\n if($this->numJobs() > 0)\n {\n return true;\n }\n return false;\n }",
"public static function does_job_exist($job ='')\n\t{\n\t\t$jobs = self::get_jobs();\n\t\tif(in_array($job,$jobs))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function exists()\n {\n try {\n $this->connection->getJob($this->identity + ['fields' => 'jobReference']);\n } catch (NotFoundException $ex) {\n return false;\n }\n\n return true;\n }",
"function cemhub_cron_should_perform_job() {\n $last_cron_run_day = variable_get('cemhub_last_cron_run', date('Ymd', strtotime(\"yesterday\")));\n $current_day = date('Ymd');\n\n $is_in_scheduled_hour_range = (variable_get('cemhub_batch_run_time') == date('H', REQUEST_TIME));\n $hasnt_ran_today = ($last_cron_run_day < $current_day);\n\n $should_perform_job = ($is_in_scheduled_hour_range && $hasnt_ran_today);\n\n return $should_perform_job;\n}",
"abstract public function canHandle(): bool;",
"public function canHandleRequest() {}",
"public function canHandleRequest() {}",
"public function canHandleRequest() {}",
"public function canHandleRequest() {}",
"private static function process\n\t(\n\t\t$jobData\t\t/* <array> The job array. */\n\t)\t\t\t\t\t/* RETURNS <bool> TRUE on success, FALSE on failure. */\n\t\n\t// Job::process($jobData)\n\t{\n\t\t// Process the Job\n\t\tif(isset($jobData['class']) && isset($jobData['method']))\n\t\t{\n\t\t\tif(class_exists($jobData['class']) && method_exists($jobData['class'], $jobData['method']))\n\t\t\t{\n\t\t\t\techo \"Job Processed\";\n\t\t\t\tvar_dump($jobData);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public function canExecute($record) {\n\t\tif(!$this->Enabled)\n\t\t\treturn false;\n\n\t\tif(!isset(self::$matched[$this->ID][$record->ID]) || !self::$matched[$this->ID][$record->ID])\n\t\t\treturn false;\n\t\t\n\t\tif(isset(self::$executed[$this->ID][$record->ID]) && !$this->AllowSelfTrigger)\n\t\t\treturn false;\n\t\t\n\t\tif($this->ExecutionLimitID) {\n\t\t\treturn $this->ExecutionLimit()->canExecute($this, $record);\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}",
"function canProcessRequests()\n\t{\n\t\tif ($this->getRequestMode() != -1) return true;\n\t\treturn false;\n\t}",
"public function canHandleRequest();",
"public function canHandleRequest();",
"protected function handlerShouldBeQueued($className)\n {\n try {\n return with(new ReflectionClass($className))->implementsInterface('Nova\\Queue\\ShouldQueueInterface');\n }\n catch (Exception $e) {\n return false;\n }\n }",
"static function isExistsIncompleteJobOfType( $jobName ) {\n global $wpdb;\n $resultset = $wpdb->get_results($wpdb->prepare(\n \"SELECT job_id\n FROM wp_lh_jobs\n WHERE classname = %s \n AND status IN ( %s, %s )\", $jobName, self::STATUS_SUBMITTED, self::STATUS_PROCESSING ));\n\n return ! empty( $resultset ); \n }",
"protected function shouldExecute()\n {\n return !$this->job->isDryRun() || $this->get('executeInPreview');\n }",
"public function canWork(Builder $schema, array $args);"
]
| [
"0.7281487",
"0.650604",
"0.6322152",
"0.63194793",
"0.62938404",
"0.6192587",
"0.61811846",
"0.6034697",
"0.6032906",
"0.5910168",
"0.5875923",
"0.58277607",
"0.5827017",
"0.57971543",
"0.57641983",
"0.57384163",
"0.572013",
"0.569658",
"0.569658",
"0.569658",
"0.569658",
"0.56911397",
"0.5655465",
"0.56355494",
"0.55804706",
"0.55804706",
"0.5552764",
"0.5526291",
"0.5517444",
"0.5513834"
]
| 0.7565444 | 0 |
Data provider for testMergeProductOptions | public function mergeProductOptionsDataProvider()
{
return [
'options are not array, empty array is returned' => [
null,
[],
[],
],
'replacement is not array, original options are returned' => [
['val'],
null,
['val'],
],
'ids do not match, no replacement occurs' => [
[
[
'option_id' => '3',
'key1' => 'val1',
'default_key1' => 'val2'
]
],
[4 => ['key1' => '1']],
[
[
'option_id' => '3',
'key1' => 'val1',
'default_key1' => 'val2'
]
]
],
'key2 is replaced, key1 is not (checkbox is not checked)' => [
[
[
'option_id' => '5',
'key1' => 'val1',
'key2' => 'val2',
'default_key1' => 'val3',
'default_key2' => 'val4'
]
],
[5 => ['key1' => '0', 'key2' => '1']],
[
[
'option_id' => '5',
'key1' => 'val1',
'key2' => 'val4',
'default_key1' => 'val3',
'default_key2' => 'val4'
]
]
],
'key1 is replaced, key2 has no default value' => [
[
[
'option_id' => '7',
'key1' => 'val1',
'key2' => 'val2',
'default_key1' => 'val3'
]
],
[7 => ['key1' => '1', 'key2' => '1']],
[
[
'option_id' => '7',
'key1' => 'val3',
'key2' => 'val2',
'default_key1' => 'val3'
]
],
],
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function bundleItemOptionsDataProvider(): array\n {\n return [\n [\n 'optionQty0' => '10',\n 'optionQty1' => '1',\n 'expectedOptionQty0' => '10',\n 'expectedOptionQty1' => '1',\n ],\n [\n 'optionQty0' => '5',\n 'optionQty1' => '5',\n 'expectedOptionQty0' => '5',\n 'expectedOptionQty1' => '1',\n ],\n ];\n }",
"public function testGetOrderWithProductOption(): void\n {\n $expected = [\n 'extension_attributes' => [\n 'bundle_options' => [\n [\n 'option_id' => 1,\n 'option_selections' => [1],\n 'option_qty' => 1\n ]\n ]\n ]\n ];\n $result = $this->makeServiceCall(self::ORDER_INCREMENT_ID);\n\n $bundleProduct = $this->getBundleProduct($result['items']);\n self::assertNotEmpty($bundleProduct, '\"Bundle Product\" should not be empty.');\n self::assertNotEmpty($bundleProduct['product_option'], '\"Product Option\" should not be empty.');\n self::assertEquals($expected, $bundleProduct['product_option']);\n }",
"public function getProductOption();",
"public function Mytestmethod( $observer )\n {\n $item = $observer->getQuoteItem();\n $qty = $item->getQty();\n $productId = $item->getProductId();\n $helper = Mage::helper( 'catalog/product_configuration' );\n $productModel = Mage::getModel( 'catalog/product' );\n //$attr = $productModel->getResource()->getAttribute('Size');\n $maal = $helper->getOptions( $item );\n $attribute_model = Mage::getModel( 'eav/entity_attribute' );\n $superAttr = array();\n $options = array();\n //Mage::log('all options');\n //Mage::log($item->getItemId());\n\n foreach( $maal as $key ) {\n $count = count( $key );\n if( $count < 2 ) {\n //Mage::log( 'fucker' );\n }\n if( $count > 2 ) {\n $labelcode = $key['option_id'];\n $valuecode = $key['value'];\n //$arr =$arrayName = array( $labelcode =>$valuecode);\n //array_push($superAttr,$arr);\n $options[$labelcode] = $valuecode;\n } else {\n $label = $key['label'];\n $labelcode = $attribute_model->getIdByCode( 'catalog_product', $label );\n $value = $key['value'];\n $attr = $productModel->getResource()->getAttribute( $label );\n if( $attr->usesSource() ) {\n $valuecode = $attr->getSource()->getOptionId( $value );\n //$arr =$arrayName = array( $labelcode =>$valuecode);\n //array_push($options,$arr);\n $superAttr[$labelcode] = $valuecode;\n }\n }\n }\n $final = array(\n 'super_attribute' => $superAttr,\n 'options' => $options \n );\n $final2 = http_build_query( $final );\n $coup = Mage::helper( 'webengage_coup' )->couponPost();\n $final3 = 'qty=' . $qty . '&' . 'product=' . $productId . '&' . $final2;\n //$attr = $productModel->getResource()->getAttribute('Test Custom Options');\n //$valuecode = $attr->getSource()->getOptionId('model 2');\n ////Mage::log($valuecode);\n $_SESSION['raku'] = $final3 . '&coup=' . $coup;\n }",
"public function buildDataProvider()\n {\n $name = 'company * product';\n $phone = '333-22-22-333';\n $url = 'https://test.url.mage.com';\n return [\n [\n 'descriptors' => [\n 'name' => $name,\n 'phone' => $phone,\n 'url' => $url,\n ],\n 'expected' => [\n 'descriptor' => [\n 'name' => $name,\n 'phone' => $phone,\n 'url' => $url,\n ],\n ],\n ],\n [\n 'descriptors' => [\n 'name' => $name,\n 'phone' => $phone,\n ],\n 'expected' => [\n 'descriptor' => [\n 'name' => $name,\n 'phone' => $phone,\n ],\n ],\n ],\n [\n 'descriptors' => [\n 'name' => $name,\n ],\n 'expected' => [\n 'descriptor' => [\n 'name' => $name,\n ],\n ],\n ],\n [\n 'descriptors' => [],\n 'expected' => [],\n ],\n ];\n }",
"public function providerCreate()\n {\n $data = array(\n // None.\n array(null, null, '\\\\UnicornFail\\\\PhpOption\\\\None'),\n\n // SomeFloat.\n array('3.33', 3.33, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeFloat'),\n array('-42.9', -42.9, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeFloat'),\n array('-9.25', -9.25, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeFloat'),\n array(3.33, 3.33, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeFloat'),\n array(-42.9, -42.9, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeFloat'),\n array(-9.25, -9.25, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeFloat'),\n\n // SomeInteger.\n array(0, 0, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeInteger'),\n array(1, 1, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeInteger'),\n array('0', 0, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeInteger'),\n array('1', 1, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeInteger'),\n\n // SomeBoolean.\n array(true, true, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array(false, false, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('on', true, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('ON', true, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('off', false, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('OFF', false, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('true', true, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('TRUE', true, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('false', false, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('FALSE', false, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('yes', true, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('YES', true, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('no', false, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('NO', false, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n\n // SomeArray.\n array(array(), array(), '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeArray'),\n array(array(1, 2, 3), array(1, 2, 3), '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeArray'),\n array('foo,bar,baz', array('foo', 'bar', 'baz'), '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeArray'),\n array('foo=bar,baz=quz', array('foo' => 'bar', 'baz' => 'quz'), '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeArray'),\n\n // SomeString.\n array('', '', '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeString'),\n array('string', 'string', '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeString'),\n array('foo=bar', 'foo=bar', '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeString'),\n );\n\n $index = 0;\n return array_combine(array_map(function ($item) use (&$index) {\n $item = array_map(function ($value) {\n if (is_string($value) && (is_callable($value) || class_exists($value))) {\n $parts = explode('\\\\', $value);\n return array_pop($parts);\n }\n return json_encode($value);\n }, $item);\n $label = implode(' : ', array_merge(array('#' . $index++), $item));\n return $label;\n }, $data), $data);\n }",
"public function correctDataProvider(): array\n {\n return [\n 'default values' => $this->prepareDefaultValuesTestData(),\n 'overridden_values' => $this->prepareOverriddenValuesTestData(),\n 'multi_results' => $this->prepareMultiResultTestData(),\n ];\n }",
"public function gpMergedDataProvider() {}",
"public function testTypeMergeParam()\n {\n // chart type merge param\n $this->chart->setMergeParams(array('cht' => 'foo'));\n $this->chart->render();\n }",
"public function dataProvider()\n {\n $mockTaxableBuilder = $this->getMockBuilder('CommerceGuys\\Tax\\TaxableInterface');\n $physicalTaxable = $mockTaxableBuilder->getMock();\n $physicalTaxable->expects($this->any())\n ->method('isPhysical')\n ->will($this->returnValue(true));\n $digitalTaxable = $mockTaxableBuilder->getMock();\n\n $mockAddressBuilder = $this->getMockBuilder('CommerceGuys\\Addressing\\Address');\n $serbianAddress = $mockAddressBuilder->getMock();\n $serbianAddress->expects($this->any())\n ->method('getCountryCode')\n ->will($this->returnValue('RS'));\n $frenchAddress = $mockAddressBuilder->getMock();\n $frenchAddress->expects($this->any())\n ->method('getCountryCode')\n ->will($this->returnValue('FR'));\n $germanAddress = $mockAddressBuilder->getMock();\n $germanAddress->expects($this->any())\n ->method('getCountryCode')\n ->will($this->returnValue('DE'));\n $usAddress = $mockAddressBuilder->getMock();\n $usAddress->expects($this->any())\n ->method('getCountryCode')\n ->will($this->returnValue('US'));\n\n $date1 = new \\DateTime('2014-02-24');\n $date2 = new \\DateTime('2015-02-24');\n $notApplicable = EuTaxTypeResolver::NO_APPLICABLE_TAX_TYPE;\n\n return [\n // German customer, French store, VAT number provided.\n [$physicalTaxable, $this->getContext($germanAddress, $frenchAddress, '123'), 'eu_ic_vat'],\n // French customer, French store, VAT number provided.\n [$physicalTaxable, $this->getContext($frenchAddress, $frenchAddress, '123'), 'fr_vat'],\n // German customer, French store, physical product.\n [$physicalTaxable, $this->getContext($germanAddress, $frenchAddress), 'fr_vat'],\n // German customer, French store registered for German VAT, physical product.\n [$physicalTaxable, $this->getContext($germanAddress, $frenchAddress, '', ['DE']), 'de_vat'],\n // German customer, French store, digital product before Jan 1st 2015.\n [$digitalTaxable, $this->getContext($germanAddress, $frenchAddress, '', [], $date1), 'fr_vat'],\n // German customer, French store, digital product.\n [$digitalTaxable, $this->getContext($germanAddress, $frenchAddress, '', [], $date2), 'de_vat'],\n // German customer, US store, digital product\n [$digitalTaxable, $this->getContext($germanAddress, $usAddress, '', [], $date2), []],\n // German customer, US store registered in FR, digital product.\n [$digitalTaxable, $this->getContext($germanAddress, $usAddress, '', ['FR'], $date2), 'de_vat'],\n // German customer with VAT number, US store registered in FR, digital product.\n [$digitalTaxable, $this->getContext($germanAddress, $usAddress, '123', ['FR'], $date2), $notApplicable],\n // Serbian customer, French store, physical product.\n [$physicalTaxable, $this->getContext($serbianAddress, $frenchAddress), []],\n // French customer, Serbian store, physical product.\n [$physicalTaxable, $this->getContext($frenchAddress, $serbianAddress), []],\n ];\n }",
"public function testOptionMerge()\n {\n $argv = [\n '/Users/tom/Sites/_MyCode/PHP/twRobo/src/tg',\n 'list',\n ];\n\n\n $merger = new Merger();\n $merger->setArgs($argv, $this->configfile);\n $merged = $merger->merge();\n\n $this->assertCount(3, $merged);\n $this->assertEquals('--format=xml', $merged[2]);\n }",
"public static function getProductOptions()\n {\n return self::get('product') ?: [];\n }",
"function fn_divido_after_options_calculation(&$mode, &$data)\n{\n if ($mode == 'options' && $product = Tygh::$app['view']->getTemplateVars('product')) {\n if (empty($product['divido_data'])) {\n $product['divido_data'] = array();\n }\n $product['divido_data']['show_calculator'] = !empty($product['divido_data']['price']) && !empty($product['divido_data']['api_key']);\n\n Tygh::$app['view']->assign('product', $product);\n }\n}",
"public function testGetProductCategories() {\n \n }",
"public function __construct(\n protected ProductRepository $productRepository,\n protected ProductBundleOptionProductRepository $productBundleOptionProductRepository,\n protected ProductGroupedProductRepository $productGroupedProductRepository,\n protected Indexer $indexer\n )\n {\n }",
"public function testOptionMergeWithAdditional()\n {\n $argv = [\n '/Users/tom/Sites/_MyCode/PHP/twRobo/src/tg',\n 'list',\n '--raw'\n ];\n\n\n $merger = new Merger();\n $merger->setArgs($argv, $this->configfile);\n $merged = $merger->merge();\n\n $this->assertCount(4, $merged);\n $this->assertEquals('--raw', $merged[2]);\n $this->assertEquals('--format=xml', $merged[3]);\n }",
"public function testCreateProductStore()\n {\n\n }",
"public function testMergeParams()\n {\n $instance = $this->getMockForTrait(DuplicationComponent::class);\n $reflex = new \\ReflectionClass($instance);\n\n $mergeParam = $reflex->getMethod('mergeParam');\n $mergeParam->setAccessible(true);\n\n $result = $mergeParam->invoke(\n $instance,\n ['hello'=>'world', 'hella' => 'warld'],\n ['hello' => 'torvald'],\n false\n );\n $this->getTestCase()->assertEquals(['hello'=>'torvald', 'hella' => 'warld'], $result);\n\n $result = $mergeParam->invoke(\n $instance,\n ['hello'=>'world', 'hella' => 'warld'],\n ['hello' => 'torvald'],\n true\n );\n $this->getTestCase()->assertEquals(['hello' => 'torvald'], $result);\n }",
"private function set_options_metadata($productId){\n\t\t$options = $this->getDoctrine()\n\t\t\t->getRepository('FgmsShopifyBundle:OptionsMeta')\n\t\t\t->findBy(array('productId'=>$productId),array('optionOrder'=>'ASC'));\n\t\t$output_array = array();\n\t\tforeach ($options as $option ){\n\t\t\t$output_array[] = $option->getOptionId(). '||' . $option->getOptionType() .'||'. $option->getOptionEnable(). '||' .$option->getPublishOn()->getTimestamp() . '||'. $option->getPublishOff()->getTimestamp() ;\n\t\t}\n\t\t$metaData = $this->shopify->call('GET','/admin/products/'.$productId.'/metafields.json');\n\t\t$metaId = 0;\n\t\t//$this->logger->notice('Metadata '.print_R($metaData,true));\n\t\tforeach ($metaData as $meta){\n\t\t\tif (($meta['namespace'] == 'FGMS') && ($meta['key']== 'options') ) {\n\t\t\t\t$metaId = $meta['id'];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$str_data = implode('%%',$output_array);\n\t\t$request = $this->get('request');\n\t\t$request->query->set('action',($metaId == 0 ? 'create':'update'));\n\t\n\t\t$request->query->set('metaId',$metaId);\n\t\t$request->query->set('productId',$productId);\n\t\t$this->logger->notice('option str ' .' metaid ' . $metaId . ' '.$str_data);\n\t\t$params = array('value'=>(ShopifyClient::clean_data($str_data)));\n\t\tif ($metaId == 0){\n\t\t\t$params['namespace'] = 'FGMS';\n\t\t\t$params['key'] = 'options';\n\t\t\t$params['value_type'] = 'string';\n\t\t}\t\n\t\t$this->logger->notice('___________________' . print_R(ShopifyClient::update_metadata($this->shopify, $request, $params),true));\n\t}",
"public function saveDataProvider()\n {\n return [\n [\n 'skus' => [\n 'newSku' => [\n 'sku_assoc1' => ['entity_id' => 1],\n 'productsku' => ['entity_id' => 3, 'attr_set_code' => 'Default', 'type_id' => 'grouped']\n ],\n 'oldSku' => ['sku_assoc2' => ['entity_id' => 2]]\n ],\n 'bunch' => [\n 'associated_skus' => 'sku_assoc1=1, sku_assoc2=2',\n 'sku' => 'productsku',\n 'product_type' => 'grouped'\n ]\n ],\n [\n 'skus' => [\n 'newSku' => [\n 'productsku' => ['entity_id' => 1, 'attr_set_code' => 'Default', 'type_id' => 'grouped']\n ],\n 'oldSku' => []\n ],\n 'bunch' => [\n 'associated_skus' => '',\n 'sku' => 'productsku',\n 'product_type' => 'grouped'\n ]\n ],\n [\n 'skus' => ['newSku' => [],'oldSku' => []],\n 'bunch' => [\n 'associated_skus' => 'sku_assoc1=1, sku_assoc2=2',\n 'sku' => 'productsku',\n 'product_type' => 'grouped'\n ]\n ],\n [\n 'skus' => [\n 'newSku' => [\n 'sku_assoc1' => ['entity_id' => 1],\n 'productsku' => ['entity_id' => 3, 'attr_set_code' => 'Default', 'type_id' => 'grouped']\n ],\n 'oldSku' => []\n ],\n 'bunch' => [\n 'associated_skus' => 'sku_assoc1=1',\n 'sku' => 'productsku',\n 'product_type' => 'simple'\n ]\n ]\n ];\n }",
"public function testCatalogGetProduct()\n {\n\n }",
"public function getJsonConfig()\n {\n /* @var $product \\Magento\\Catalog\\Model\\Product */\n $product = $this->getProduct();\n\n if (!$this->hasOptions()) {\n $config = [\n 'productId' => $product->getId(),\n 'priceFormat' => $this->_localeFormat->getPriceFormat()\n ];\n return $this->_jsonEncoder->encode($config);\n }\n\n $tierPrices = [];\n $tierPricesList = $product->getPriceInfo()->getPrice('tier_price')->getTierPriceList();\n foreach ($tierPricesList as $tierPrice) {\n $tierPrices[] = $tierPrice['price']->getValue();\n }\n\n //qxd testing lo de los productos */\n\n $qxd_config = null;\n\n /*$writer = new \\Zend\\Log\\Writer\\Stream(BP . '/var/log/configurable.log');\n $logger = new \\Zend\\Log\\Logger();\n $logger->addWriter($writer);\n $logger->info(print_r($product->getTypeId(),true));\n $logger->info(print_r('nuevo',true));*/\n\n switch ($product->getTypeId()) {\n case 'bundle': \n //$bundle_block= $this->getLayout()->createBlock('Magento\\Bundle\\Block\\Catalog\\Product\\View\\Type\\Bundle');\n\n //$qxd_config = $bundle_block->getJsonConfig();\n break;\n\n case 'configurable':\n\n $qxd_config = $price_config = json_decode($product->getPriceRangeConfig(), true); \n /*$configurable_block= $this->getLayout()->createBlock('Magento\\ConfigurableProduct\\Block\\Product\\View\\Type\\Configurable');\n\n $configurable_config = $configurable_block->getJsonConfig();\n if($configurable_config){\n $configurable_config = json_decode($configurable_config, true);\n $options = $configurable_config[\"optionPrices\"];\n\n $first_option = reset($options);\n $higherRegular = $first_option[\"oldPrice\"]['amount'];\n $lowerRegular = $first_option[\"oldPrice\"]['amount'];\n $regularPrice = $first_option[\"oldPrice\"]['amount'];\n $specialPrices = [];\n\n $hasSameRegularPrice = true;\n $hasSameSpecialPrice = true;\n\n $hasSpecialPrice = false;\n foreach ($options as $price) {\n //regular\n\n //get higher\n if($price[\"oldPrice\"]['amount'] > $higherRegular)\n $higherRegular = $price[\"oldPrice\"]['amount'];\n\n //get lower\n if($price[\"oldPrice\"]['amount'] < $lowerRegular)\n $lowerRegular = $price[\"oldPrice\"]['amount'];\n\n if($price[\"oldPrice\"]['amount'] != $regularPrice)\n $hasSameRegularPrice = false;\n\n\n //special\n\n if($price[\"finalPrice\"]['amount'] < $price[\"oldPrice\"]['amount']){\n $hasSpecialPrice = true;\n $specialPrices[] = $price[\"finalPrice\"]['amount'];\n }\n }\n\n if(empty($specialPrices)){\n $qxd_config['hasSpecialPrice'] = false;\n }else{\n $qxd_config['hasSpecialPrice'] = true;\n sort($specialPrices);\n $hasSameSpecialPrice = count(array_unique($specialPrices)) == 1;\n $qxd_config['rangeSpecial'] = [\"lower\" => $specialPrices[0], \"higher\" => $specialPrices[count($specialPrices) - 1]];\n \n }\n\n $qxd_config['rangeRegular'] = [\"lower\" => $lowerRegular, \"higher\" => $higherRegular];\n $qxd_config['hasSameSpecialPrice'] = $hasSameSpecialPrice;\n $qxd_config['hasSameRegularPrice'] = $hasSameRegularPrice; \n\n\n }*/\n break;\n \n default:\n break;\n }\n\n $qxd_price = [\n 'amount' => 0,\n 'adjustments' => [],\n 'data' => $qxd_config\n ];\n\n $config = [\n 'productId' => $product->getId(),\n 'priceFormat' => $this->_localeFormat->getPriceFormat(),\n 'prices' => [\n 'oldPrice' => [\n 'amount' => $product->getPriceInfo()->getPrice('regular_price')->getAmount()->getValue(),\n 'adjustments' => []\n ],\n 'basePrice' => [\n 'amount' => $product->getPriceInfo()->getPrice('final_price')->getAmount()->getBaseAmount(),\n 'adjustments' => []\n ],\n 'finalPrice' => [\n 'amount' => $product->getPriceInfo()->getPrice('final_price')->getAmount()->getValue(),\n 'adjustments' => []\n ]\n ],\n 'idSuffix' => '_clone',\n 'tierPrices' => $tierPrices,\n 'qxd_price' => $qxd_price\n ];\n\n $responseObject = new \\Magento\\Framework\\DataObject();\n $this->_eventManager->dispatch('catalog_product_view_config', ['response_object' => $responseObject]);\n if (is_array($responseObject->getAdditionalOptions())) {\n foreach ($responseObject->getAdditionalOptions() as $option => $value) {\n $config[$option] = $value;\n }\n }\n\n return $this->_jsonEncoder->encode($config);\n }",
"public function getSetDataProvider() {}",
"public function testGetCustomerOrderBundleProduct(): void\n {\n $qty = 1;\n $bundleSku = 'bundle-product-single-dropdown-option';\n /** @var CustomerPlaceOrder $bundleProductOrderFixture */\n $bundleProductOrderFixture = Bootstrap::getObjectManager()->create(CustomerPlaceOrder::class);\n $bundleProductOrderFixture->placeOrderWithBundleProduct(\n ['email' => '[email protected]', 'password' => 'password'],\n ['sku' => $bundleSku, 'quantity' => $qty]\n );\n $customerOrderResponse = $this->getCustomerOrderQueryBundleProduct();\n $customerOrderItems = $customerOrderResponse[0];\n $this->assertEquals(\"Pending\", $customerOrderItems['status']);\n $bundledItemInTheOrder = $customerOrderItems['items'][0];\n $this->assertEquals(\n 'bundle-product-single-dropdown-option-simple1',\n $bundledItemInTheOrder['product_sku']\n );\n $this->assertArrayHasKey('bundle_options', $bundledItemInTheOrder);\n $bundleOptionsFromResponse = $bundledItemInTheOrder['bundle_options'];\n $this->assertNotEmpty($bundleOptionsFromResponse);\n $this->assertEquals(1, count($bundleOptionsFromResponse));\n $expectedBundleOptions =\n [\n ['__typename' => 'ItemSelectedBundleOption',\n 'label' => 'Drop Down Option 1',\n 'values' => [\n [\n 'product_name' => 'Simple Product1',\n 'product_sku' => 'simple1',\n 'price' => [\n 'value' => 1,\n 'currency' => 'USD'\n ]\n ]\n ]\n ],\n ];\n $this->assertEquals($expectedBundleOptions, $bundleOptionsFromResponse);\n }",
"public function createConfigProduct($type,$data=[],$attribute_set_id,$sku){\n\n $data['type_id'] = $type;\n $data['attribute_set_id'] = $attribute_set_id;\n $data['sku'] = $sku;\n\n /*foreach($data['additional_attributes']['single_data'] as $item){\n $data['custom_attributes'][] = [ \"attribute_code\" => $item['key'], \"value\" => $item['value'] ];\n }*/\n $data['custom_attributes'] = [];\n $data['custom_attributes'][] = [ \"attribute_code\" => \"description\", \"value\" => $data['description'] ];\n $data['custom_attributes'][] = [ \"attribute_code\" => \"short_description\", \"value\" => $data['short_description'] ];\n array_push( $data['custom_attributes'] , ['attribute_code' => 'category_ids', 'value' => $data['categories']] );\n array_push( $data['custom_attributes'] , ['attribute_code' => 'url_key', 'value' => Inflector::slug($data['name'].' '.$sku)] );\n unset( $data['categories'], $data['website_ids'], $data['description'], $data['short_description'], $data['tax_class_id'], $data['associated_skus'], $data['price'], $data['price_changes'], $data['configurable_attributes'], $data['stock_data'] );\n\n $result = $this->curlRequest(\"/rest/V1/products/\", 1, json_encode([\"product\" => $data]));\n\n return $result;\n \n \n }",
"public function getConfigurableProductOptions($product, $storeId) {\n // get product price\n $finalPrice = $product->getFinalPrice ();\n \n // Load all used configurable attributes\n $configurableAttributeCollection = $product->getTypeInstance ( true )->getConfigurableAttributes ( $product );\n \n $allProducts = $product->getTypeInstance ( true )->getUsedProducts ( null, $product );\n foreach ( $allProducts as $product ) {\n $products [] = $product;\n }\n \n $options = array ();\n $result = array ();\n $i = 0;\n foreach ( $configurableAttributeCollection as $productAttribute ) {\n $options [$i] [static::TITLE] = $productAttribute ['label'];\n $options [$i] ['code'] = $productAttribute->getProductAttribute ()->getAttributeCode ();\n $options [$i] [static::ATTRIBUTE_ID] = $productAttribute [static::ATTRIBUTE_ID];\n $i ++;\n }\n $result ['config'] = $options;\n $resultattr = array ();\n // Get combinations\n foreach ( $products as $product ) {\n $attr = array ();\n // get produt stock qty for simple product\n /**\n *\n * @var $stockItem Mage_CatalogInventory_Model_Stock_Item\n */\n $stockItem = $product->getStockItem ();\n if (! $stockItem) {\n $stockItem = Mage::getModel ( static::CATSTOCK );\n $stockItem->loadByProduct ( $product );\n }\n $stockQty = floor ( $stockItem->getQty () );\n $is_stock = $stockItem->getIsInStock ();\n $j = 0;\n $valuearry ['product_id'] = $product->getId ();\n // get product stock details\n $inventoryDetail = Mage::getModel ( static::LOGIN_FUNCTIONS )->getinventoryDetail ( $product, $storeId );\n // get stock qty\n $valuearry [static::STOCK_QTY] = $inventoryDetail [static::STOCK_QTY];\n $valuearry [static::MIN_SALE_QTY] = $inventoryDetail [static::MIN_SALE_QTY];\n $valuearry [static::MAX_SALE_QTY] = $inventoryDetail [static::MAX_SALE_QTY];\n $valuearry [static::QTY_INCR] = $inventoryDetail [static::QTY_INCR];\n $valuearry [static::IS_QTY_DECIMAL] = $inventoryDetail [static::IS_QTY_DECIMAL];\n foreach ( $configurableAttributeCollection as $attribute ) {\n \n $productAttribute = $attribute->getProductAttribute ();\n $attrCode = $productAttribute->getAttributeCode ();\n $attributeValue = $product->getData ( $attrCode );\n \n /* getting option text value */\n if ($productAttribute->usesSource ()) {\n $label = $productAttribute->setStoreId ( $storeId )->getSource ()->getOptionText ( $attributeValue );\n } else {\n $label = '';\n }\n \n /**\n * Get price for associated product\n */\n $prices = $attribute->getPrices ();\n $value = $product->getData ( $attribute->getProductAttribute ()->getAttributeCode () );\n \n $valuearry ['label'] = $label;\n $valuearry ['code'] = $attrCode;\n $valuearry ['config_id'] = $attributeValue;\n $valuearry [static::ISSTOCK] = $is_stock;\n $valuearry ['stock_qty'] = $stockQty;\n $valuearry [static::PRICE] = $this->calculateCustumPrice ( $prices, $value, $finalPrice );\n \n $val [$options [$j] ['code']] = $attributeValue;\n $j ++;\n array_push ( $attr, $valuearry );\n }\n // get configurable product options\n $attr = $this->getAttrColl ( $val, $attr );\n \n $resultattr = array_merge ( $resultattr, $attr );\n }\n $result ['attr'] = $resultattr;\n return $result;\n }",
"public function testDataProvider()\n {\n $out = [];\n\n // Case #0, without any request parameters.\n $out[] = [\n 'request' => new Request(),\n 'expectedChoices' => [\n 'Color' => [\n 'Green' => 2,\n 'Red' => 2,\n 'Black' => 1,\n ],\n 'Made in' => [\n 'USA' => 3,\n 'China' => 4,\n 'Germany' => 3,\n 'Lithuania' => 1,\n ],\n 'Designed in' => [\n 'USA' => 3,\n 'Germany' => 2,\n ],\n 'Condition' => [\n 'Excelent' => 2,\n 'Fair' => 2,\n 'Good' => 2,\n ],\n 'Group' => [\n 'Accessories' => 3,\n 'Utilities' => 2,\n 'Maintenance' => 1,\n ],\n ],\n 'filter' => 'dynamic_aggregate_filter'\n ];\n\n // Case #1, with color red\n $out[] = [\n 'request' => new Request(['dynamic_aggregate' => ['Color' => 'Red']]),\n 'expectedChoices' => [\n 'Color' => [\n 'Green' => 2,\n 'Red' => 2,\n 'Black' => 1,\n ],\n 'Made in' => [\n 'USA' => 1,\n 'China' => 1,\n ],\n 'Condition' => [\n 'Fair' => 1,\n ],\n 'Designed in' => [\n 'Germany' => 2,\n ]\n ],\n 'filter' => 'dynamic_aggregate_filter'\n ];\n\n // Case #2, with color red, with zero choices\n $out[] = [\n 'request' => new Request(['zero_aggregate' => ['Color' => 'Red']]),\n 'expectedChoices' => [\n 'Color' => [\n 'Green' => 2,\n 'Red' => 2,\n 'Black' => 1,\n ],\n 'Made in' => [\n 'USA' => 1,\n 'China' => 1,\n 'Lithuania' => 0,\n 'Germany' => 0,\n ],\n 'Designed in' => [\n 'USA' => 0,\n 'Germany' => 2,\n ],\n 'Condition' => [\n 'Fair' => 1,\n 'Good' => 0,\n 'Excelent' => 0,\n ],\n 'Group' => [\n 'Accessories' => 0,\n 'Utilities' => 0,\n 'Maintenance' => 0,\n ],\n ],\n 'filter' => 'dynamic_aggregate_with_zero_choice_filter'\n ];\n\n return $out;\n }",
"public function testAfterGetOptions()\n {\n $result = [\n ['label' => 'Option 1', 'value' => 1],\n ['label' => 'Option 2', 'value' => 2],\n ['label' => 'Store Credit', 'value' => 3],\n ];\n $select = $this->createMock(\\Magento\\Rma\\Block\\Form\\Renderer\\Select::class);\n $attribute = $this->createMock(\\Magento\\Eav\\Model\\Attribute::class);\n $select->expects($this->once())->method('getAttributeObject')->willReturn($attribute);\n $attribute->expects($this->once())->method('getAttributeCode')->willReturn('resolution');\n $order = $this->createMock(\\Magento\\Sales\\Api\\Data\\OrderInterface::class);\n $orderPayment = $this->createMock(\\Magento\\Sales\\Api\\Data\\OrderPaymentInterface::class);\n $this->coreRegistry->expects($this->once())->method('registry')->with('current_order')->willReturn($order);\n $order->expects($this->once())->method('getPayment')->willReturn($orderPayment);\n $orderPayment->expects($this->once())\n ->method('getMethod')\n ->willReturn(\\Magento\\CompanyCredit\\Model\\CompanyCreditPaymentConfigProvider::METHOD_NAME);\n $this->assertEquals(array_slice($result, 0, 2), $this->selectPlugin->afterGetOptions($select, $result));\n }",
"private function setUpTwitterData() {\n $plugin_id = 1;\n $namespace = OptionDAO::PLUGIN_OPTIONS . '-' .$plugin_id;\n $builder_plugin_option1 =\n FixtureBuilder::build('options',\n array('namespace' => $namespace, 'option_name' => 'oauth_consumer_key', 'option_value' => 'token'));\n $builder_plugin_option2 =\n FixtureBuilder::build('options',\n array('namespace' => $namespace, 'option_name' => 'oauth_consumer_secret', 'option_value' => 'secret'));\n return array($builder_plugin_option1, $builder_plugin_option2);\n }",
"public function testStoreSupplierGroup()\n {\n }"
]
| [
"0.62682873",
"0.62046826",
"0.57701874",
"0.57623965",
"0.5636875",
"0.5623095",
"0.55194324",
"0.55058634",
"0.5486327",
"0.54500043",
"0.544983",
"0.53982395",
"0.53678024",
"0.53650403",
"0.5354086",
"0.5338604",
"0.53240913",
"0.5317941",
"0.53134674",
"0.5310408",
"0.5308137",
"0.5283869",
"0.5270134",
"0.52453566",
"0.5242077",
"0.5234607",
"0.5227124",
"0.5215471",
"0.52103925",
"0.5200778"
]
| 0.67632127 | 0 |
Sets all the indicators at once for a type | private function setIndicators($type) {
$this->setIndicator($type, 'left');
$this->setIndicator($type, 'right');
$this->setIndicator($type, 'separator');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function setIndicator($type, $indicatorType) {\n $type = strtolower($type);\n $indicatorType = strtolower($indicatorType);\n $func = 'get' . ucfirst($type) . ucfirst($indicatorType) . 'Indicator';\n $indicator = _SUGAR::getGlobalConfiguration()->$func();\n\n $arrayKey = $type . ucfirst($indicatorType);\n if (!array_key_exists($arrayKey, $this->sugarTemplateIndicators)) {\n throw new SugarExecutionException;\n }\n\n $this->sugarTemplateIndicators[$arrayKey] = $indicator !== null ?\n $indicator :\n $this->sugarTemplateIndicators[$arrayKey];\n }",
"private function setValues()\n {\n foreach($this->data as $type => $values)\n if(!preg_match('/(library)/i', $type))\n foreach($values as $key => $value)\n $this->{strtolower($type)}[$key] = $value;\n }",
"public function setType($type){ }",
"public function setType( Quantifier $type ): void {\n\t\t\t$this->type = $type;\n\t\t}",
"function setTypes($types){\n\t\t$this->types=explode(\",\",$types);\n\t}",
"abstract public function setMetas();",
"public function setType(?string $type): void;",
"public function setType($type) {}",
"function callbackSetType($value) {\n \n if ($this->type == $value) {\n return;\n }\n $this->widgets['type']->set_text($value);\n $this->type = $value;\n $this->setVisable();\n $this->table->database->dirty=true;\n $this->dirty = true;\n $this->table->database->save();\n \n }",
"private function loadTypes() : void {\n\t\t$this->types[DuelType::DUEL_TYPE_1V1] = new DuelType($this, DuelType::DUEL_TYPE_1V1, LanguageUtils::translateColors(\"&l&31v1\"), Item::get(Item::MOB_HEAD, Skull::TYPE_HUMAN, 1), \"http://jacknoordhuis.net/minecraft/icons/items/397-3.png\", 2, 2);\n\t\t$this->types[DuelType::DUEL_TYPE_2v2] = new DuelType($this, DuelType::DUEL_TYPE_2v2, LanguageUtils::translateColors(\"&l&32v2\"), Item::get(Item::MOB_HEAD, Skull::TYPE_HUMAN, 2), \"http://jacknoordhuis.net/minecraft/icons/items/397-3.png\", 4, 4);\n\t\t$this->types[DuelType::DUEL_TYPE_FFA] = new DuelType($this, DuelType::DUEL_TYPE_FFA, LanguageUtils::translateColors(\"&l&3FFA\"), Item::get(Item::MOB_HEAD, Skull::TYPE_DRAGON, 1), \"http://jacknoordhuis.net/minecraft/icons/items/397-5.png\", 24, 2);\n\t}",
"public function setType($type);",
"public function setType($type);",
"public function setType($type);",
"public function setType($type);",
"public function setType($type);",
"public function setType($type);",
"public function setType($type);",
"public function setType($type);",
"function setType($a_type)\n\t{\n\t\t$this->il_type = $a_type;\n\t}",
"function setType($type) {\n $this->type = $type;\n }",
"public function setType($type) {\n\t\t$this->data['type'] = $type;\n\t}",
"public function setTypes($types){\n\t\tif(!is_array($types)) return;\n\t\t\n\t\tforeach($types as $field_name => $type){\n\t\t\tif(isset($this->Fields[$field_name])){\n\t\t\t\t$this->Fields[$field_name]->type = $type;\n\t\t\t}\n\t\t}\n\t}",
"public function setType($type)\n {\n parent::setAttr(\"type\", $type);\n }",
"protected function setType(int $type):void {\r\n\t\t$this->type = $type;\r\n\t}",
"public function setType(?string $type): void\n {\n }",
"function setType($type) {\n\t\t$this->_type = $type;\n\t}",
"function setType($type) {\n\t\t$this->_type = $type;\n\t}",
"protected function setTypes($types)\n\t{\n\t\tif (is_array($types))\n\t\t{\n\t\t\t$this->originalTypes = implode('|', $types);\n\t\t\t$types = $types;\n\t\t}\n\t\telse if (is_scalar($types))\n\t\t{\n\t\t\t$this->originalTypes = $types;\n\t\t\t$types = explode('|', $types);\n\t\t}\n\n\t\tstatic $alliases = array(\n\t\t\t'void' => 'null',\n\t\t\t'double' => 'float',\n\t\t\t'real' => 'float',\n\t\t\t'numeric' => 'float',\n\t\t\t'number' => 'float',\n\t\t\t'integer' => 'int',\n\t\t\t'boolean' => 'bool',\n\t\t\t'text' => 'string',\n\t\t);\n\n\t\t$tmp = array();\n\t\tforeach ($types as $k => $type)\n\t\t{\n\t\t\t$type = strtolower(trim($type));\n\t\t\tif (isset($alliases[$type]))\n\t\t\t{\n\t\t\t\t$type = $alliases[$type];\n\t\t\t}\n\t\t\t$tmp[$type] = $type;\n\t\t}\n\t\t$types = $tmp;\n\n\t\tif (isset($types['mixed']) OR $types === array('' => '') OR !$types) $types = array('mixed' => 'mixed', 'null' => 'null');\n\t\tunset($types['']);\n\n\t\t$this->data['types'] = $types;\n\n\t\treturn $this;\n\t}",
"private function setOptions($type)\n {\n // set a options index based on the requested type\n $actions = [\n 'get' => [\n 'setUrl', 'setHeader', 'setReturnTransfer', 'setHttpHeader',\n ],\n 'create' => [\n 'setUrl', 'setHeader', 'setReturnTransfer', ['setHttpHeader' => true], 'setPost',\n ],\n 'edit' => [\n 'setUrl', 'setHeader', 'setReturnTransfer', ['setHttpHeader' => true], 'setCustomRequestPath',\n ],\n 'delete' => [\n 'setUrl', 'setHeader', 'setReturnTransfer', 'setHttpHeader', 'setCustomRequestDelete',\n ],\n ];\n\n if (isset($actions[$type])) {\n\n foreach ($actions[$type] as $options) {\n\n if (is_array($options)) {\n\n $this->{key($options)}($options[key($options)]);\n } else {\n\n $this->$options();\n }\n }\n }\n }",
"protected static function set_($type, $id, $args) {\n //Macro function for setting attributes of both orders and trades\n\t\t\tswitch ($type) {\n case 'order':\n return self::order_set($id, $args);\n case 'trade':\n return self::trade_set($id, $args);\n\t\t\t}\n\t\t}"
]
| [
"0.5926646",
"0.5542421",
"0.528559",
"0.5247751",
"0.5206525",
"0.52031296",
"0.5193099",
"0.5159069",
"0.5138638",
"0.5131378",
"0.51134795",
"0.51134795",
"0.51134795",
"0.51134795",
"0.51134795",
"0.51134795",
"0.51134795",
"0.51134795",
"0.509915",
"0.50826526",
"0.5080871",
"0.5069183",
"0.50476676",
"0.50476",
"0.5017587",
"0.50080806",
"0.50080806",
"0.49878633",
"0.49546173",
"0.4950132"
]
| 0.70243615 | 0 |
Merge the given view into the current one | public function mergeView(SugarView $view, $tag) {
if (isset($this->subViews[$tag])) {
throw new SubViewAlreadyDefinedException(self::childClass(), $view::childClass(), $tag);
}
$this->subViews[$tag] = $view;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function append(\\View $view) {\n $this->appendViews[] = $view;\n return $this;\n }",
"public function &push(&$view)\n {\n if ($view->isValid()) {\n $this->_views[count($this->_views)] =& $view;\n $this->_view =& $view;\n $result =& $view;\n } else {\n $result = null;\n }\n return $result;\n }",
"public function insertView()\n\t{\n\t\t$viewPath = $this->getViewDirectory() . '/view.' . strtolower($this->current_action) . '.php';\n\t\tif (FileSystem::checkFile($viewPath))\n\t\t{\n\t\t\tEventHandler::trigger(EventTypes::ORION_BEFORE_VIEW, $this);\n\t\t\tinclude($viewPath);\n\t\t\tEventHandler::trigger(EventTypes::ORION_AFTER_VIEW, $this);\n\t\t}\n\t}",
"public function compose(View $view)\n {\n //$program = Program::where('id',(int)session()->get('user.program'))->first();\n $page = Page::first();\n $view->with(compact('page'));\n }",
"public function compose(View $view)\n {\n $view->with('sidebar', $this->sidebar);\n }",
"public function compose(View $view)\n {\n $currentMenu = $this->getCurrentMenu();\n $menu = auth()->user()->role_id == 1 ? $this->menuAdmin : $this->menuUser;\n $view->with(compact('menu', 'currentMenu'));\n }",
"function view2($view, $vars = array(), $return = FALSE) {\n\t\t$vars = $this->_add_layout_vars($vars);\n\t\treturn $this->view($view,$vars,$return);\n\t}",
"public function compose(View $view)\n {\n $view->with('mainMenu', $this->mainMenu->getAllWithAllRelation());\n }",
"protected function resolveView() {}",
"protected function resolveView() {}",
"public function compose(View $view)\n {\n $obs = Observation::orderBy('ob_date','desc')->paginate(5);\n $obs->load('kid');\n $view->with('obs', $obs);\n }",
"public function compose(View $view)\n {\n $cur_lang = Language::where('lang_key', Session::get('lang'))->first();\n $langs = Language::all();\n $categories = Vw_category::fromViewShowed()->orderBy('parent_id')->orderBy('order_num', 'asc');\n\n $banner = new Banner;\n $banner = $banner->orderBy('banner_id','desc')->first();\n\n $fb = Link::byType('facebook')->first();\n $tw = Link::byType('twitter')->first();\n\n $title = Vw_title::where('lang', \\Session::get(\"lang\"))->first();\n\n return $view->with(compact('categories', 'langs', 'cur_lang', 'banner','fb','tw', 'title'));\n }",
"public function compose(View $view)\n {\n $view->with([\n 'reading_menus' => $this->reading_menus,\n 'listen_menus' => $this->listen_menus,\n 'video_menus' => $this->video_menus\n ]);\n }",
"public function compose(View $view)\n {\n $view_data_arr = [\n 'sidebar_data_arr' => [\n 'username' => session('username'),\n 'permission_arr' => session('permission_arr'),\n 'menu_navigations' => session('menu_navigation_arr'), \n 'menus' => session('menu_arr'),\n ]\n ]; \n $view->with($view_data_arr);\n\n }",
"public function compose(View $view)\n {\n $view->with('sliders',Slider::orderBy('id','desc')->get());\n\n }",
"public function prepend(\\View $view) {\n $this->prependViews[] = $view;\n return $this;\n }",
"public function compose(View $view)\n {\n //get the user information\n if (str_contains(url()->current(),'/parent/')) {\n $view->with('user_info',\n $this->parent->where('id_number',Auth::user()->id_number)->first()\n );\n }\n\n }",
"public function compose(View $view)\n {\n $view->with('route', $this->route);\n }",
"public function compose(View $view)\n {\n $_currentUrl = str_replace(URL::to('/').'/', '', url()->current());\n $currentUrl = ucfirst($_currentUrl);\n\n $_path = explode('/',$_currentUrl);\n\n\n\n $_2ndPath = '.index';\n\n // if(count($_path) > 1) {\n // $_2ndPath = '.'.$_path[1];\n // }\n\n $cssPath = 'common.css.' . $_path[0]. $_2ndPath;\n $jsPath = 'common.js.' . $_path[0]. $_2ndPath;\n\n $view->with('mainPath', $_path[0]);\n $view->with('cssPath', $cssPath);\n $view->with('jsPath', $jsPath);\n\n $userLogin = UserUtil::login();\n UserUtil::checkApiKey();\n $userInfo = UserUtil::getUserInfo();\n $userRole = Auth::user()->getUserRole();\n\n $view->with('_currentUrl', $_currentUrl);\n $view->with('currentUrl', $currentUrl);\n $view->with('userLogin', $userLogin);\n $view->with('userInfo', $userInfo);\n $view->with('userRole', $userRole);\n }",
"public function compose(View $view)\n {\n $view->with('category', $this->category->all());\n }",
"public function compose(View $view)\n {\n /*\n $latestPages = Page::orderBy('created_at', 'DESC')->take(3)->get();\n $latestVideos = Video::orderBy('created_at', 'DESC')->take(3)->get();\n $tags = Tag::get();\n $view->with(compact('latestPages', 'latestVideos', 'tags'));\n */\n }",
"public function withView($view = null, $data = [], $mergeData = []): RespondScope\n {\n $this->with(\n view(...func_get_args())\n );\n\n return $this;\n }",
"public function compose(View $view): void\n {\n $view->with('latest_events', $this->event_service->getLatestForFixedBlock());\n $view->with('latest_news', $this->news_item_service->getLatestForFixedBlock());\n $view->with('latest_services', $this->service_service->getLatestForFixedBlock());\n }",
"protected function consolidate(HTMLView $subView){\n\t \n }",
"public function compose(View $view)\n {\n $view->with('menusTree', $this->menus);\n }",
"public function setView($view);",
"public function compose(View $view)\n {\n $view->with([\n 'user' => ($user = auth()->user()),\n 'pageTitle' => $this->getTitle(),\n ]);\n }",
"public function compose(View $view)\n {\n $view->with('sidebar_menus', $this->admin->get());\n }",
"public function compose(View $view)\n {\n $view->with('menus', $this->menus);\n }",
"public function compose(View $view)\n {\n $view->with([\n \"categoriess\" => $this->categoriess,\n\n\n\n\n ]);\n }"
]
| [
"0.65158045",
"0.63281304",
"0.6140872",
"0.60482174",
"0.6023103",
"0.59865963",
"0.59288657",
"0.59254116",
"0.5898333",
"0.5898333",
"0.5888499",
"0.5872237",
"0.5864337",
"0.58505934",
"0.58425397",
"0.5836109",
"0.5831576",
"0.582625",
"0.58246934",
"0.5820855",
"0.58022624",
"0.5795335",
"0.5785354",
"0.57783854",
"0.5763865",
"0.57598215",
"0.5759217",
"0.57538074",
"0.5738929",
"0.5735011"
]
| 0.653082 | 0 |
Remove a given subView, given its tag or the View object itself | public function removeView($view) {
if (is_string($view)) {
if (!isset($this->subViews[$view])) {
throw new SubViewNotDefinedException(self::childClass(), $view);
}
unset($this->subViews[$view]);
} else if (is_object($view) && $view instanceof SugarView) {
$keysToRemove = array_keys($this->subViews, $view, true);
if (empty($keysToRemove)) {
throw new SubViewNotDefinedException(self::childClass(), $view);
}
foreach ($keysToRemove as $key) {
unset($this->subViews[$key]);
}
} else {
throw new InvalidArgumentException('Invalid argument for function SugarView::removeView, expected SugarView or string.');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function remove($viewname)\n {\n if (true === $viewname) {\n $this->_children = [];\n\n return $this;\n }\n foreach ($this->_children as $i => $child) {\n if ($child['name'] == $viewname) {\n unset($this->_children[$i]);\n break;\n }\n }\n\n return $this;\n }",
"public function remove($viewname)\n {\n if (true === $viewname) {\n $this->_children = array();\n\n return $this;\n }\n foreach ($this->_children as $i => $child) {\n if ($child['name'] == $viewname) {\n unset($this->_children[$i]);\n break;\n }\n }\n\n return $this;\n }",
"public function dropView($viewName, $schemaName, $ifExists=null){ }",
"private function removeTag($tagName)\n\t{\n\t\tif (is_null($tagName) || $tagName == '') return;\n\n $tag = Tag::where('tag', '=', $tagName)->first();\n\n\t\tif (is_object($tag))\n\t\t{\n\t\t\tif ($tag->count > 0) TagUtil::decrementCount($tagName, 1, $tag);\n\n\t\t\t// return collection object\n\t\t\t$tagPivot = $this->tags()->wherePivot('tag_id', '=', $tag->id)->get();\n\t\t\t\n\t if ($tagPivot->count()) $this->tags()->detach($tag->id);\n\t\t}\n\t}",
"public function delete_tag($tag);",
"public function dropView($model)\n {\n\t$modelName= is_object($model) ? $model->getTableName() : $model;\n\t$hash= $this->fetchSingle('select hash from [views] where [name] = %s ',\n\t $modelName);\n\t$sql= array();\n\t$sql[] = $this->sql('delete from [views] where [name] = %s;', $modelName );\n\n\t$this->queue(\n\t PerfORMStorage::VIEW_DROP,\n\t $modelName,\n\t $sql,\n\t array(\n\t\t'model' => $model)\n\t );\n\n\n\t$key= $hash;\n\tif ( key_exists($key, $this->renamedViews))\n\t{\n\t $array= $this->renamedViews[$key];\n\t $array->counter++;\n\t $array->from= $modelName;\n\t}\n\telse\n\t{\n\t $this->renamedViews[$key]= (object) array(\n\t 'counter' => 1,\n\t 'from' => $modelName,\n\t );\n\t}\n }",
"public function destroy( RequestInterface $request, $view );",
"public function onRemove();",
"public function remove($tag) { //+\n\t\tunset($this->arShortcodes[$tag]);\n\t}",
"public function removeAction()\n {\n Zend_Controller_Action_HelperBroker::removeHelper('Layout');\n $this->view->id = $this->_getParam(\"id\");\n }",
"function TestRun_remove_tag($run_id, $tag_name) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestRun.remove_tag', array(new xmlrpcval($run_id, \"int\"), new xmlrpcval($tag_name, \"string\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"public function mergeView(SugarView $view, $tag) {\n if (isset($this->subViews[$tag])) {\n throw new SubViewAlreadyDefinedException(self::childClass(), $view::childClass(), $tag);\n }\n $this->subViews[$tag] = $view;\n }",
"public function removeTag(string $name);",
"public function removeTag()\n\t{\n\t\tif(isset($this->primarySearchData[$this->ref_tag]))\n\t\t{\n\t\t\tunset($this->primarySearchData[$this->ref_tag]);\n\t\t}\n\t}",
"public function remove();",
"public function remove();",
"public function remove();",
"public function remove();",
"protected function _linkRemoveTag($tag)\n {\n return Horde::url('browse.php')\n ->add(array('actionID' => 'remove', 'tag' => $tag));\n }",
"function TestCase_remove_tag($case_id, $tag_name) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.remove_tag', array(new xmlrpcval($case_id, \"int\"), new xmlrpcval($tag_name, \"string\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"public function dropView(string $viewName, string $schemaName = null, bool $ifExists = true) : string\n {\n $view = $this->prepareTable($viewName, $schemaName);\n\n if ($ifExists) {\n $sql = 'DROP VIEW IF EXISTS '.$view;\n } else {\n $sql = 'DROP VIEW '.$view;\n }\n\n return $sql;\n }",
"public function removeInner($selector);",
"public function removeVariable($tv);",
"public function remove($element);",
"abstract public function remove();",
"abstract public function remove();",
"abstract public function remove();",
"public function removeAt($key);",
"protected function removeFormObjectFromViewHelperVariableContainer() {}",
"abstract public function remove($id);"
]
| [
"0.5928957",
"0.59188503",
"0.56199396",
"0.5612733",
"0.54387504",
"0.5387637",
"0.53819185",
"0.53513855",
"0.5334633",
"0.5318107",
"0.5284341",
"0.5234135",
"0.5228691",
"0.52231836",
"0.5215226",
"0.5215226",
"0.5215226",
"0.5215226",
"0.51667917",
"0.5101129",
"0.5048711",
"0.50199693",
"0.50136614",
"0.50123733",
"0.49947345",
"0.49947345",
"0.49947345",
"0.49936828",
"0.4947652",
"0.4944228"
]
| 0.70000625 | 0 |
Loads a file containing some PHP content, execute the PHP within the output_buffer and return the resulting content. | public function fileGetContentsExecPHP($filePath) {
ob_start();
include $filePath;
return ob_get_clean();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_php ($filename) {\n ob_start(); \n include($filename);\n $buf = ob_get_contents();\n ob_end_clean(); \n return $buf;\n}",
"private function getPhpContents($filename) {\n if (is_file($filename)) {\n ob_start();\n require_once $filename;\n $contents = ob_get_contents();\n ob_end_clean();\n return $contents;\n }\n else {\n syslog(LOG_ERR, \"error: file \" . $filename . \" does not exists\");\n }\n return FALSE;\n }",
"function fetch($_file = null) {\r\n if(!$_file) $_file = $this->file;\r\n\r\n extract($this->vars); // Extract the vars to local namespace\r\n ob_start(); // Start output buffering\r\n\t\tinclude($_file); // Include the file\r\n $_contents = ob_get_contents(); // Get the contents of the buffer\r\n ob_end_clean(); // End buffering and discard\r\n return $_contents; // Return the contents\r\n }",
"static function return_output($file){\n ob_start();\n include $file;\n return ob_get_clean();\n }",
"public function Fetch_Php()\n {\n if ( 0 == count($this->_Template) )\n return '';\n\n $path = [];\n foreach ($this->_Template as $template)\n {\n $path = self::Search_Template_Extension($template, '.php');\n if ( $path )\n {\n break;\n }\n }\n if ( !$path )\n {\n Zero_Logs::Set_Message_Error('NOT FOUND view [' . implode(', ', $this->_Template) . ']');\n return '';\n }\n extract($this->_Data);\n $this->_Data = [];\n return require $path;\n }",
"private function filterPHP($file) {\n ob_start();\n\n // The variable $template can be used in the script as $this is used here\n $template = $this;\n require $file;\n\n // Return the script's output\n return ob_get_clean();\n }",
"private function exec() {\n extract($this->data);\n\n ob_start();\n $error = eval(' ?>' . $this->file .'<?php ');\n if($error === false) {\n ob_end_clean();\n throw new \\Exception('Error en la plantilla');\n }\n return ob_get_clean();\n }",
"function st_get_content($file,$data= array(),$settings = array(),$html = false){\r if(!is_file($file)){\r return false;\r }\r ob_start();\r $old_cont = ob_get_contents();\r ob_end_clean();\r ob_start();\r include($file);\r $content = ob_get_contents();\r ob_end_clean();\r echo $old_cont;\r\r return $content;\r}",
"function fetch($file = null){\n\t\tif(! $file) {\n\t\t\t$file = $this->file;\n\t\t}\n\n\t\textract($this->vars); // Extract the vars to local namespace\n\t\tob_start(); // Start output buffering\n\t\tinclude ($file); // Include the file\n\t\t$contents = ob_get_contents(); // Get the contents of the buffer\n\t\tob_end_clean(); // End buffering and discard\n\t\treturn $contents; // Return the contents\n\t}",
"public function fetch( $file ) {\n extract( $this->vars ); // Extract the vars to local namespace\n ob_start(); // Start output buffering\n include( $file ); // Include the file\n $contents = ob_get_contents(); // Get the contents of the buffer\n ob_end_clean(); // End buffering and discard\n return $contents; // Return the contents\n }",
"public function get_output_content();",
"public function run()\n {\n $this->renderContent();\n echo ob_get_clean();\n }",
"function runphp($data, $filename) { \r\n\tglobal $config;\r\n\t$return=\"\";\r\n\t$reporting=error_reporting();\r\n\tif($config['debug']===false)\r\n\t\terror_reporting(0);\r\n\tif($config['writecodetofile']===true){\r\n\t\t@ob_start();\r\n\t\t//$filename = 'cache/tmp.inc.php';\r\n\t\t@unlink($filename);\r\n\t\twritetofile($filename,'w',$data);\t\t\t\t\r\n\t\tinclude($filename);\r\n\t\t@unlink($filename);\r\n\t\t$return=@ob_get_clean();\r\n\t} else {\r\n\t\t$offset=0;\r\n\t\t$pos=stripos($data,\"<?php\");\r\n\t\twhile ($pos>-1) {\t\r\n\t\t\t$return.=substr($data,$offset,$pos-$offset);\r\n\t\t\t$offset=stripos($data,\"?>\",$pos)+2;\r\n\t\t\t$php=substr($data,$pos+2,3);\r\n\t\t\t$code=substr($data,$pos+5);\r\n\t\t\tif(!($pos>-1)) { break; }\r\n\t\t\t$code=substr($code,0,stripos($code,\"?>\"));\r\n\t\t\t@ob_start();\r\n\t\t\tif($config['debug'])\r\n\t\t\t\teval($code);\r\n\t\t\telse\r\n\t\t\t\t@eval($code);\r\n\t\t\t$replace=@ob_get_clean();\r\n\t\t\t$return.= $replace;\r\n\t\t\t$pos=stripos($data,\"<?php\",$offset);\r\n\t\t}\t\r\n\t\t$return.=substr($data,$offset);\r\n\t}\r\n\terror_reporting($reporting);\r\n\treturn $return;\r\n}",
"function abp01_wrapper_process_script($filePath) {\n $bom = pack('H*','EFBBBF');\n \n $contents = @file_get_contents($filePath);\n $contents = trim(preg_replace(\"/^$bom/\", '', $contents));\n\n return (\n '(function (L) {' . PHP_EOL .\n $contents . PHP_EOL .\n '})(window.' . ABP01_WRAPPED_LEAFLET_CONTEXT . ');'\n );\n}",
"public function parse($href) {\n\t\t// File init\n\t\t$file = new WTemplateFile($href, $this->baseDir, $this->compileDir);\n\n\t\t// Compilation (if needed)\n\t\t$code = $file->compile($this->compiler);\n\n\t\t// Buffer\n\t\tob_start();\n\n\t\t// Define a soft handler for undefined variables\n\t\tset_error_handler(function($errno, $errstr, $errfile, $errline) {\n\t\t\techo str_replace(array('Undefined index: ', 'Undefined variable: '), 'WT!', $errstr);\n\t\t}, E_NOTICE);\n\n\t\ttry { // Critical section\n\t\t\t// Adds the php close balise at the begining because it is a whole php file being evaluated\n\t\t\t$eval_result = eval('?>'.$code);\n\t\t} catch (Exception $e) {\n\t\t\t// Just stores the exception into $e to throw it later\n\t\t}\n\n\t\trestore_error_handler();\n\n\t\t$buffer = ob_get_contents();\n\t\tob_end_clean();\n\n\t\t// Throw exception if any\n\t\tif (!empty($e)) {\n\t\t\tthrow $e;\n\t\t} else if ($eval_result === false) {\n\t\t\tthrow new Exception(\"WTemplate::parse(): File $href encountered an error during evaluation :\".$buffer);\n\t\t}\n\n\t\treturn $buffer;\n\t}",
"public function generateContents()\n {\n ob_start();\n include $this->getTemplateFile();\n $output = ob_get_contents();\n ob_end_clean();\n return $output;\n }",
"function php_to_html( $output_dir_path = null, $template_path = null, $output_filename = null ) {\r\n $output_dir_path = $output_dir_path ? $output_dir_path : dirname( __FILE__ ) . '/html';\r\n $template_path = $template_path ? $template_path : dirname( __FILE__ );\r\n\r\n if ( !file_exists( $output_dir_path ) )\r\n mkdir( $output_dir_path );\r\n\r\n foreach ( (array) $this->templates as $template ) {\r\n $filename = $output_filename ? $output_filename : $template;\r\n\r\n ob_start();\r\n\r\n require_once( $template_path . '/' . $template . '.php' );\r\n\r\n if ( ob_get_length() > 0 ) {\r\n $html = ob_get_contents();\r\n }\r\n\r\n ob_end_clean();\r\n\r\n file_put_contents( $output_dir_path . '/' . $filename . '.html', $html );\r\n\r\n if ( !isset( $html ) ) {\r\n echo \"error: file $template_path/$template.php can't be read\";\r\n } else {\r\n echo \"<p>File <em>{$template}.php</em> ouput succesfully at <em>\" . $output_dir_path . \"/{$filename}.html</em></p>\";\r\n }\r\n }\r\n }",
"function ahr_render_tpl( $path, $data = array() ) {\r\n \r\n ob_start();\r\n include( $path );\r\n $output = ob_get_clean();\r\n echo $output;\r\n \r\n}",
"function fetch($tpl_name = null) {\n if(!$tpl_name) {\n $file = $this->file;\n } else {\n $file = $this->_get_path($tpl_name);\n }\n extract($this->vars); // Extract the vars to local namespace\n ob_start(); // Start output buffering\n include($file); // Include the file\n $contents = ob_get_contents(); // Get the contents of the buffer\n ob_end_clean(); // End buffering and discard\n return $contents; // Return the contents\n }",
"function renderPhpToString($file, $vars = null) {\n if (is_array($vars) && !empty($vars)) {\n extract($vars);\n }\n ob_start();\n include $file;\n $template_content = ob_get_contents();\n ob_end_clean();\n return $template_content;\n}",
"public function get_content()\n {\n extract($this->_keystore);\n ob_start();\n include($this->_file);\n return ob_get_clean();\n }",
"public function render()\n {\n $data = $this->data;\n\n ob_start();\n include $this->path;\n $content = ob_get_clean();\n\n return $content;\n }",
"function parse_php($string) {\n ob_start();\n eval('?>'.$string);\n $string = ob_get_contents();\n ob_end_clean();\n return $string;\n}",
"public static function render()\n {\n $data = self::parse();\n ob_start();\n include(__DIR__.'/phpinfo.php');\n $buf = ob_get_contents();\n ob_end_clean();\n\n return $buf;\n }",
"protected function compile()\n\t{\n\t\t$lexer = new Lexer($this->template->getEnvironment());\n\t\t$stream = $lexer->tokenize(file_get_contents($this->filename), basename($this->filename));\n\n\t\t// unique class based on the filename\n\t\t// @todo fix problem with '-' in classes\n\t\t$class = $this->template->getEnvironment()->getCacheFilename($this->filename);\n\t\t$class = 'S' . substr($class, 0, -8) . '_Template';\n\n\t\t// writer object which contains the parsed PHP code\n\t\t$writer = new Writer();\n\t\t$writer->write(\"<?php\\n\");\n\t\t$writer->write(\"\\n\");\n\t\t$writer->write('namespace Spoon\\Template;' . \"\\n\");\n\t\t$writer->write(\"\\n\");\n\t\t$writer->write('/* ' . $this->filename . ' */' . \"\\n\");\n\t\t$writer->write(\"class $class extends Renderer\\n\");\n\t\t$writer->write(\"{\\n\");\n\t\t$writer->indent();\n\t\t$writer->write('protected function display(array $context)' . \"\\n\");\n\t\t$writer->write(\"{\\n\");\n\t\t$writer->indent();\n\n\t\t$tags = $this->template->getEnvironment()->getTags();\n\n\t\t$token = $stream->getCurrent();\n\t\twhile(!$stream->isEof())\n\t\t{\n\t\t\tswitch($token->getType())\n\t\t\t{\n\t\t\t\tcase Token::TEXT:\n\t\t\t\t\t$text = new TextNode($stream, $this->template->getEnvironment());\n\t\t\t\t\t$text->compile($writer);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase Token::VAR_START:\n\t\t\t\t\t$stream->next();\n\t\t\t\t\t$variable = new VariableNode($stream, $this->template->getEnvironment());\n\t\t\t\t\t$variable->compile($writer);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase Token::BLOCK_START:\n\t\t\t\t\t$token = $stream->next();\n\n\t\t\t\t\t// validate tag existence\n\t\t\t\t\tif(!isset($tags[$token->getValue()]))\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\tsprintf('There is no such template tag \"%s\"', $token->getValue()),\n\t\t\t\t\t\t\t$token->getLine(),\n\t\t\t\t\t\t\t$this->filename\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$node = new $tags[$token->getValue()]($stream, $this->template->getEnvironment());\n\t\t\t\t\t$node->compile($writer);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif($token->getType() !== Token::EOF)\n\t\t\t{\n\t\t\t\t$token = $stream->next();\n\t\t\t}\n\n\t\t\telse break;\n\t\t}\n\n\t\t$writer->outdent();\n\t\t$writer->write(\"}\\n\");\n\t\t$writer->outdent();\n\t\t$writer->write(\"}\\n\");\n\t\treturn $writer->getSource();\n\t}",
"public function getOutput(){\n\n if (is_null($this->output)) {\n\n ob_start();\n\n extract($this->data);\n\n require $this->view;\n\n $this->output = ob_get_clean();\n\n return $this->output;\n }\n }",
"public function fetch($templateFile='',$content='',$prefix='') {\n if(empty($content)) {\n // Template file parsing tags\n tag('view_template',$templateFile);\n // Template file does not exist return directly\n if(!is_file($templateFile)) return NULL;\n }\n // Page cache\n ob_start();\n ob_implicit_flush(0);\n if('php' == strtolower(C('TMPL_ENGINE_TYPE'))) { // Using native PHP template\n // Template array variable decomposed into independent variable\n extract($this->tVar, EXTR_OVERWRITE);\n // PHP template loaded directly\n empty($content)?include $templateFile:eval('?>'.$content);\n }else{\n // View Resolution tab\n $params = array('var'=>$this->tVar,'file'=>$templateFile,'content'=>$content,'prefix'=>$prefix);\n tag('view_parse',$params);\n }\n // Obtain and empty the cache\n $content = ob_get_clean();\n // Content Filtering tab\n tag('view_filter',$content);\n // Output template file\n return $content;\n }",
"function get_contents(){\r\n\t\t$cmds=array('striptabs','beginnextbuffer');\r\n\t\tglobal $gcontents;\r\n\t\tunset($gcontents);\r\n\t\tif($a=func_get_args()){\r\n\t\t\tforeach($a as $v){\r\n\t\t\t\tif(in_array(strtolower($v),$cmds)){\r\n\t\t\t\t\t$v=strtolower($v);\r\n\t\t\t\t\t$$v=true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$gcontents['out']=ob_get_contents();\r\n\t\tob_end_clean();\r\n\t\tif($striptabs)$gcontents['out']=str_replace(\"\\t\",'',$gcontents['out']);\r\n\t\tif($beginnextbuffer){\r\n\t\t\tob_start();\r\n\t\t}else{\r\n\t\t\treturn $gcontents['out'];\r\n\t\t}\r\n\t}",
"function make($filename, $data){\n\n extract($data);\n //turn on output buffering\n ob_start(); //this is to store the data in an internal buffer and not the browser\n\n //include the template\n include(__DIR__ .'/../../resources/views/emails/' .$filename .'.php');\n\n //to get the contents out of the file\n\n $content = ob_get_contents();\n\n //erase the content and turn off output buffering\n ob_end_clean();\n\n return $content;\n}",
"function betterEval($code) {\n $result = [];\n $tmp = tmpfile ();//file resource\n //we'll need to uri to include the file:\n $tmpMeta = stream_get_meta_data ( $tmp );\n $uri = $tmpMeta ['uri'];\n fwrite ( $tmp, $code );\n \n ob_start();\n $start = microtime(true);\n //anonymously, so our scope will not be polluted (very optimistic here, ofc)\n call_user_func(function() use ($uri) {\n include ($uri);\n }); \n \n $result['time'] = microtime(true) - $start;\n $result['output'] = ob_get_clean(); \n $result['length'] = strlen($result['output']);\n $result['lengthCharacters'] = mb_strlen($result['output']);\n $result['dbg'] = [\n 'fileUri' => $uri\n ];\n fclose ( $tmp );\n return $result;\n}"
]
| [
"0.68275726",
"0.6421664",
"0.60976267",
"0.6072186",
"0.60540384",
"0.60243785",
"0.5805944",
"0.5792723",
"0.57652515",
"0.575666",
"0.5732853",
"0.5714333",
"0.570898",
"0.5682141",
"0.5672971",
"0.5669074",
"0.560835",
"0.5602336",
"0.5583066",
"0.55531216",
"0.55478853",
"0.5514063",
"0.5497832",
"0.5497189",
"0.5483899",
"0.5477472",
"0.5468202",
"0.5451632",
"0.5432498",
"0.54239273"
]
| 0.69429725 | 0 |
/ Get remain to defined goal | public function RemainToGoal() {
if (!empty($this->activities)) {
$goal = intval($this->activities['goals']['steps']);
$steps = intval($this->Steps());
if ($goal > $steps) {
return $goal - $steps;
}
}
return 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function makeGoal()\n\t\t{\n\t\t\t$this->estimated = 0;\n\t\t}",
"public function setGoal()\n {\n }",
"public function getGoal()\n{\nreturn $this->goal;\n}",
"public function get_goal() {\r\n\t\tif ( ! isset( $this->goal ) ) {\r\n\t\t\t$this->goal = $this->has_goal() ? $this->get( 'goal' ) : false;\r\n\t\t}\r\n\r\n\t\treturn $this->goal;\r\n\t}",
"private function getGoal() {\r\n $goalid = is_numeric($this->goal) ? $this->goal : 0;\r\n return self::getGoals($goalid);\r\n }",
"public function setGoal($goal)\n{\n$this->goal = $goal;\n\nreturn $this;\n}",
"private function setPrimaryGoal() {\r\n $q1 = $this->db->select('count(*) AS cnt')\r\n ->from('collection_goals')\r\n ->where('collection_goal_id', $this->goal)\r\n ->where('status', 1)\r\n ->get();\r\n\r\n if ($q1->num_rows() <= 0 || $q1->row()->cnt == 0) {\r\n return FALSE;\r\n }\r\n\r\n //$old_goalid = $q2->num_rows() <= 0 ? FALSE : $q2->row()->collection_goal_id;\r\n $this->db->where('landingpage_collectionid', $this->project)\r\n ->update('collection_goals', array('level' => 0));\r\n\r\n $this->db->where('collection_goal_id', $this->goal)\r\n ->update('collection_goals', array('level' => 1));\r\n\r\n self::updatePageStatistics($this->currentPrimaryGoalId);\r\n $this->optimisation->flushKpiResultsForCollection($this->project);\r\n $this->optimisation->evaluateImpact($this->project);\r\n $this->optimisation->flushCollectionCache($this->project);\r\n }",
"public function has_goal() {\r\n\t\treturn 0 < $this->get( 'goal' );\r\n\t}",
"function zg_ai_do_goal($bot, $goal, $last_result) {\n\n global $last_value;\n\n if (!is_array($goal)) {\n $goal = [$goal];\n }\n\n $result = [\n 'original goal' => $goal,\n ];\n\n if (!is_array($last_result)) {\n $last_result = [$last_result];\n }\n\n zg_ai_out($last_result, 'last result');\n if (array_key_exists('return value', $last_result)) {\n $last_value = zg_ai_get_data($last_result);\n }\n else {\n $last_value = [];\n }\n zg_ai_out($last_value, 'last value');\n\n $goal_function = 'zg_ai_' . str_replace(' ', '_', reset($goal));\n $args = array_slice($goal, 1);\n array_unshift($args, $bot);\n// zg_ai_out($args, 'args');\n\n if (!function_exists($goal_function)) {\n zg_ai_out($goal, \"*FIXME: MISSING* $goal_function\");\n $result['error'] = \"Missing function $goal_function()\";\n $result['success'] = FALSE;\n return $result;\n }\n\n zg_ai_out('calling ' . $goal_function . '($bot, ' . implode(', ', array_slice($args, 1)) . ')');\n $return = call_user_func_array($goal_function, $args);\n// zg_ai_out('returned: ' . zg_print_r($return));\n\n $result['return value'] = $return;\n $result['success'] = TRUE;\n// zg_ai_out('result: ' . zg_print_r($result));\n return $result;\n}",
"public function getGoalsAgainst()\n {\n return $this->goalsAgainst;\n }",
"function takeObjective() {\n return Engine::send('takeObjective');\n}",
"public function givenNoPriorActivity();",
"public function embargoUntilPublished();",
"private function setDefaultPrimaryGoalIfNotSet() {\r\n $q1 = $this->db->select('count(*) AS cnt')\r\n ->from('collection_goals')\r\n ->where('landingpage_collectionid', $this->project)\r\n ->where('status', 1)\r\n ->where('level', 1)\r\n ->get();\r\n\r\n if ($q1->num_rows() > 0 && $q1->row()->cnt > 0) {\r\n return FALSE;\r\n }\r\n\r\n $this->db->where('landingpage_collectionid', $this->project)\r\n ->update('collection_goals', array('level' => 0));\r\n\r\n $this->db->where('landingpage_collectionid', $this->project)\r\n ->where('status', 1)\r\n ->limit(1)\r\n ->update('collection_goals', array('level' => 1));\r\n }",
"function getGoalPercent(){\n $goal = $GLOBALS['GOAL_STEPS'];\n $cursteps = getCurrentSteps();\n $percent = ( $cursteps[0]['steps'] / $goal ) * 100;\n return round($percent);\n}",
"private function getCurrentPrimaryGoal() {\r\n $q = $this->db->select('collection_goal_id')\r\n ->from('collection_goals')\r\n ->where('landingpage_collectionid', $this->project)\r\n ->where('level', 1)\r\n ->where('status', 1)\r\n ->get();\r\n if ($q->num_rows() > 0) {\r\n $this->currentPrimaryGoalId = $q->row()->collection_goal_id;\r\n }\r\n }",
"public function has_achieved_goal() {\r\n\t\treturn $this->get_donated_amount() >= $this->get_goal();\r\n\t}",
"public function forward()\n {\n $steps = array_reverse($this->getSteps());\n $current = $this->current();\n foreach ($steps as $i => $step) {\n if ($step == $current) {\n return isset($steps[$i - 1]) ? $steps[$i - 1] : $steps[$i];\n }\n }\n }",
"public function embargoIndefinitely();",
"function zg_move_ai() {\n\n // Turn off AI moves for now.\n return;\n\n global $game, $ai_output, $bt_skip;\n\n include drupal_get_path('module', 'zg') . '/includes/' . $game . '_defs.inc';\n $game_user = zg_fetch_user();\n\n // PRE failed? return.\n if (!zg_pre_move_ai($game, $game_user, $game_name_full, $ai_output)) {\n return $ai_output;\n };\n\n// $ai_goals = [\n// ['need_bots_num_type', 9, 'protester'],\n// 'protest',\n// 'build',\n// ];\n\n [$bot, $goals, $results] = zg_ai_get_bot_goals_results();\n zg_ai_out(zg_ai_show_bot_brief_stats($bot));\n zg_ai_out($goals, 'goals pre-do');\n $results[] = $result = zg_ai_do_goal($bot, reset($goals), end($results));\n zg_ai_out($result, 'result from zg_ai_do_goal');\n\n if (zg_ai_is_goals_type($result)) {\n $goals = zg_ai_expand_goals($result, $goals);\n }\n\n if (zg_ai_is_data_type($result)) {\n $goals = zg_ai_remove_successful_goal($goals);\n }\n\n if ($result['success'] === FALSE) {\n $goals = zg_ai_remove_failed_goal($goals);\n }\n\n// zg_ai_do_goal($bot, ['web request', 'home'], []);\n// $bot = zg_fetch_user_by_id($bot->phone_id);\n// zg_ai_out(zg_ai_show_bot_brief_stats($bot));\n zg_ai_out($goals, 'goals post-do');\n zg_ai_set_bot_goals_results($bot, $goals, $results);\n\n // zg_ai_do('have_num_interns', 21) && zg_ai_do('build');\n // zg_ai_do('have_num_members', 18) && zg_ai_do('build');\n // zg_ai_do('have_num_treasurers', 2) && zg_ai_do('build');\n // zg_ai_do('have_num_alders', 1) && zg_ai_do('build');.\n\n zg_post_move_ai($game, $game_user, $ai_output);\n return $ai_output;\n}",
"public function tourSuivant() {\n\t\t\t$this -> turn = ($this-> turn == $this -> j1) ? $this -> j2 : $this -> j1 ;\n\t\t}",
"function goal($name, $progress, $goal){\n\treturn array(\n\t\t\"name\"=>$name,\n\t\t\"progress\"=>($progress*100).\"%\",\n\t\t\"goal\" => $goal\n\t);\n}",
"public function passes();",
"public function getGoalsFor()\n {\n return $this->goalsFor;\n }",
"function getTransferInfoWithOnePlayerInvolved($location_from, $location_to, $bottom_to, $you_must, $player_must, $player_name, $number, $cards, $targetable_players) {\n if ($location_from == $location_to && $location_from = 'board') { // Used only for Self service\n $message_for_player = clienttranslate('{You must} choose {number} other top {card} from your board');\n $message_for_others = clienttranslate('{player must} choose {number} other top {card} from his board'); \n }\n else if ($targetable_players !== null) { // Used when several players can be targeted\n switch($location_from . '->' . $location_to) {\n case 'score->deck':\n $message_for_player = clienttranslate('{You must} return {number} {card} from the score pile of {targetable_players}');\n $message_for_others = clienttranslate('{player must} return {number} {card} from the score pile of {targetable_players}');\n break;\n \n case 'board->deck':\n $message_for_player = clienttranslate('{You must} return {number} top {card} from the board of {targetable_players}');\n $message_for_others = clienttranslate('{player must} return {number} top {card} from the board of {targetable_players}');\n break;\n\n case 'board->score':\n $message_for_player = clienttranslate('{You must} transfer {number} top {card} from the board of {targetable_players} to your score pile');\n $message_for_others = clienttranslate('{player must} transfer {number} top {card} from the board of {targetable_players} to his score pile');\n break;\n \n default:\n break;\n }\n }\n else {\n switch($location_from . '->' . $location_to) { \n case 'hand->deck':\n $message_for_player = clienttranslate('{You must} return {number} {card} from your hand');\n $message_for_others = clienttranslate('{player must} return {number} {card} from his hand');\n break;\n case 'hand->hand':\n // Impossible case\n break; \n case 'hand->board':\n if ($bottom_to) {\n $message_for_player = clienttranslate('{You must} tuck {number} {card} from your hand');\n $message_for_others = clienttranslate('{player must} tuck {number} {card} from his hand');\n }\n else {\n $message_for_player = clienttranslate('{You must} meld {number} {card} from your hand');\n $message_for_others = clienttranslate('{player must} meld {number} {card} from his hand');\n }\n break;\n case 'hand->score':\n $message_for_player = clienttranslate('{You must} score {number} {card} from your hand');\n $message_for_others = clienttranslate('{player must} score {number} {card} from his hand');\n break;\n case 'hand->revealed':\n $message_for_player = clienttranslate('{You must} reveal {number} {card} from your hand');\n $message_for_others = clienttranslate('{player must} reveal {number} {card} from his hand');\n break;\n case 'hand->achievements':\n // Impossible case\n break;\n \n case 'board->deck':\n $message_for_player = clienttranslate('{You must} return {number} top {card} from your board');\n $message_for_others = clienttranslate('{player must} return {number} top {card} from his board');\n break;\n case 'board->hand':\n $message_for_player = clienttranslate('{You must} take back {number} top {card} from your board to your hand');\n $message_for_others = clienttranslate('{player must} take back {number} top {card} from his board to his hand');\n break;\n case 'board->board':\n // Impossible case\n break;\n case 'board->score':\n $message_for_player = clienttranslate('{You must} score {number} top {card} from your board');\n $message_for_others = clienttranslate('{player must} score {number} top {card} from his board');\n break;\n case 'board->revealed':\n // Impossible case\n break;\n case 'board->achievements':\n // Impossible case\n break;\n \n case 'score->deck':\n $message_for_player = clienttranslate('{You must} return {number} {card} from your score pile');\n $message_for_others = clienttranslate('{player must} return {number} {card} from his score pile');\n break;\n case 'score->hand':\n $message_for_player = clienttranslate('{You must} transfer {number} {card} from your score pile to your hand');\n $message_for_others = clienttranslate('{player must} transfer {number} {card} from his score pile to his hand');\n break;\n case 'score->board':\n if ($bottom_to) {\n $message_for_player = clienttranslate('{You must} tuck {number} {card} from your score pile');\n $message_for_others = clienttranslate('{player must} tucks {number} {card} from his score pile');\n }\n else {\n $message_for_player = clienttranslate('{You must} meld {number} {card} from your score pile');\n $message_for_others = clienttranslate('{player must} meld {number} {card} from his score pile');\n }\n break;\n case 'score->score':\n // Impossible case\n break;\n case 'score->revealed':\n // Impossible case\n break;\n case 'score->achievements':\n // Impossible case\n break;\n \n case 'revealed->deck':\n $message_for_player = clienttranslate('{You must} return {number} {card} you revealed');\n $message_for_others = clienttranslate('{player must} return {number} {card} he revealed');\n break; \n case 'revealed->hand':\n // Impossible case\n break;\n case 'revealed->board':\n // Impossible case\n break;\n case 'revealed->score':\n // Impossible case\n break;\n case 'revealed->revealed':\n // Impossible case\n break;\n case 'revealed->achievements':\n // Impossible case\n break;\n \n case 'achievements->deck':\n // Impossible case\n break;\n case 'achievements->hand':\n // Impossible case\n break;\n case 'achievements->board':\n // Impossible case\n break;\n case 'achievements->score':\n // Impossible case\n break;\n case 'achievements->revealed':\n // Impossible case\n break;\n case 'achievements->achievements': // That is: unclaimed achievement to achievement claimed by player\n // Impossible case\n break;\n \n case 'revealed,hand->deck': // Alchemy, Physics\n $message_for_player = clienttranslate('{You must} return {number} {card} you revealed and {number} {card} in your hand');\n $message_for_others = clienttranslate('{player must} return {number} {card} he revealed and {number} {card} in his hand');\n break;\n \n case 'hand->revealed,deck': // Measurement\n $message_for_player = clienttranslate('{You must} reveal and return {number} {card} from your hand');\n $message_for_others = clienttranslate('{player must} reveal and return {number} {card} from his hand');\n break;\n \n case 'pile->deck': // Skyscrapers\n $message_for_player = clienttranslate('{You must} return {number} {card} from your board');\n $message_for_others = clienttranslate('{player must} return {number} {card} from his board');\n break;\n \n default:\n break;\n }\n }\n $message_for_player = self::format($message_for_player, array('You must' => $you_must, 'number' => $number, 'card' => $cards, 'targetable_players' => $targetable_players));\n $message_for_others = self::format($message_for_others, array('player must' => $player_must, 'number' => $number, 'card' => $cards, 'targetable_players' => $targetable_players));\n \n return array(\n 'message_for_player' => $message_for_player,\n 'message_for_others' => $message_for_others\n );\n }",
"public function getDoneTurn() {\n\t\treturn $this->doneTurn;\t\n\t}",
"function getFinal()\n {\n }",
"public function liftUp();",
"abstract public function withholdTargets();",
"private function _ensureGoalStateRetrieved()\n {\n if (is_null($this->_currentGoalState) || !$this->_keepOpen) {\n $inputStream = $this->_inputChannel->getInputStream($this->_endpoint);\n $this->_goalStateDeserializer->initialize($inputStream);\n }\n\n $goalState = $this->_goalStateDeserializer->deserialize();\n if (is_null($goalState)) {\n return;\n }\n\n $this->_currentGoalState = $goalState;\n\n if (!is_null($goalState->getEnvironmentPath())) {\n $this->_currentEnvironmentData = null;\n }\n\n $this->_currentStateClient->setEndpoint(\n $this->_currentGoalState->getCurrentStateEndpoint()\n );\n\n if (!$this->_keepOpen) {\n $this->_inputChannel->closeInputStream();\n }\n }"
]
| [
"0.646459",
"0.62788564",
"0.61905724",
"0.6156753",
"0.6070552",
"0.59069306",
"0.5687432",
"0.56021285",
"0.5578996",
"0.5405403",
"0.5379138",
"0.5280449",
"0.52764493",
"0.52719104",
"0.52680296",
"0.5218052",
"0.5184009",
"0.5168646",
"0.5140985",
"0.5118869",
"0.51158357",
"0.50983554",
"0.50880027",
"0.5085463",
"0.5041146",
"0.49880445",
"0.4984653",
"0.4971792",
"0.49555632",
"0.49528822"
]
| 0.6524567 | 0 |
/ Get avarage daily steps | public function AverageDailySteps() {
if (!empty($this->profil)) {
return $this->profil['user']['averageDailySteps'];
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDailySteps(){\n $time = array();\n $steps = array();\n $prevNum = 0;\n $mysqli = $GLOBALS['mysqli'];\n $result = $mysqli->query(\"SELECT DATE_FORMAT(time, '%H:%i') AS time,steps FROM steps WHERE DATE(`time`) = CURDATE()\");\n while($row = $result->fetch_assoc()) {\n $diff = $row['steps'] - $prevNum;\n $prevNum = $row['steps'];\n $time[] = $row['time'];\n $steps[] = $diff;\n }\n return array($time, $steps);\n}",
"function getMaxDailySteps(){\n $time = array();\n $steps = array();\n $mysqli = $GLOBALS['mysqli'];\n $result = $mysqli->query(\"SELECT DATE(time) AS time, MAX(steps) AS steps FROM steps GROUP BY DAY(time)\");\n $rows = array();\n while($row = $result->fetch_assoc()) {\n $time[] = $row['time'];\n $steps[] = $row['steps'];\n }\n return array($time, $steps);\n}",
"function getTotalDays();",
"public abstract function getSteps();",
"public function days() {\n //TODO prediction\n }",
"function getTotalSetps(){\n $sum = 0;\n $mysqli = $GLOBALS['mysqli'];\n $result = $mysqli->query(\"SELECT DATE(time) AS time, MAX(steps) AS steps FROM steps GROUP BY DAY(time)\");\n while($row = $result->fetch_assoc()) {\n $sum = $sum + $row['steps'];\n }\n return $sum;\n}",
"function live_get_current_daily(): array\r\n{\r\n\tglobal $DATABASE;\r\n\tglobal $UNIX_TIMESTAMP;\r\n\t\r\n\t$out = [];\r\n\t$group = $DATABASE->execute_query('SELECT MAX(daily_category), MIN(daily_category) FROM `daily_rotation`')[0];\r\n\t$max_group = $group[0];\r\n\t$min_group = $group[1];\r\n\t\r\n\tfor($i = $min_group; $i <= $max_group; $i++)\r\n\t{\r\n\t\t$current_days = intdiv($UNIX_TIMESTAMP, 86400);\r\n\t\t$current_rot = $DATABASE->execute_query(\"SELECT live_id FROM `daily_rotation` WHERE daily_category = $i\");\r\n\t\t$out[] = $current_rot[$current_days % count($current_rot)][0];\r\n\t}\r\n\t\r\n\treturn $out;\r\n}",
"public function daily()\n {\n $days = [];\n if ($this->daily) {\n setlocale(LC_ALL, 'sv_SV');\n $comingDays = array_slice($this->daily[\"data\"], 1, 30);\n foreach ($comingDays as $i => $data) {\n if ($data[\"time\"]) {\n $this->parseDate(\"daily\", $i, $data[\"time\"]);\n $days[$i] = $this->pushInfo(\n $this->daily[\"data\"][$i],\n [\n \"weekday\",\n \"date\",\n \"icon\",\n \"summary\",\n \"temperatureMax\",\n \"apparentTemperatureMax\",\n \"temperatureMin\",\n \"apparentTemperatureMin\",\n \"time\"\n ]\n );\n }\n }\n }\n return $days;\n }",
"public function getStepHistory();",
"public function days() {\n\t\tforeach ( self::$_days as $day => $day_title ) {\n\t\t\t$day_weather = $this->_weather [$day];\n\t\t\t$condition = $day_weather ['condition'];\n\t\t\t$temp = $day_weather ['temp'];\n\t\t\t$wind = $day_weather ['wind'];\n\t\t\t$pm25 = isset ( $day_weather ['pm25'] ) ? ( int ) $day_weather ['pm25'] : 0;\n\t\t\tempty ( $pm25 ) && $pm25 = '未知';\n\t\t\t$date = $day_weather ['date'];\n\t\t\t$time = $day_weather ['time'];\n\t\t\t$icon = $day_weather ['imgs'] [0];\n\t\t\tif (isset ( $this->_workflow )) {\n\t\t\t\t$this->_workflow->result ( 'weather_' . $day, $day_weather ['link'], \"{$time} {$day_title},{$condition}\", \"气温{$temp},{$wind},PM2.5:{$pm25},{$date}\", 'icon/' . $icon . '.jpg' );\n\t\t\t}\n\t\t}\n\t}",
"public static function getDays()\n\t {\n\t\t $days=array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31);\n\t\t return $days;\n\t }",
"public function get_days() {\n\t\t\treturn iterator_to_array( $this->days );\n\t\t}",
"function getFirstSteps(){\n $rows = array();\n $mysqli = $GLOBALS['mysqli'];\n $result = $mysqli->query(\"SELECT DATE(time) AS time,steps from steps ORDER BY id LIMIT 1\");\n while($r = $result->fetch_assoc()) {\n $rows[] = $r;\n }\n return $rows;\n}",
"function getReportPerDay(&$analytics, $dia, $report){\n\n\t\t$this->Respiro($this->contador);\n\t\t$TABLE_ID = $report->GAMarcaInfo->TableId;//ga:ViewId -> TableId\n\n\t\t$retornoDay = $analytics->data_ga->get(\n\t\t\t$TABLE_ID,\n\t\t\t$dia,\n\t\t\t$dia,\n\t\t\t\"ga:sessions,ga:pageviews,ga:pageviewsPerSession,ga:avgTimeOnPage,ga:bounces,ga:bounceRate,ga:users,ga:newUsers,ga:timeOnPage,ga:exits\"\n\t\t\t);\n\n\t\t$this->contador++;\n\n\t\treturn $retornoDay;\n\t}",
"public function testReport(){\n // $autoTaskTools->checkTask('AutoDaySessReport');\n // $date = array(\n // date_to_int('-',date('Y-m-01', strtotime('-1 month'))),\n // date_to_int('-',date('Y-m-t', strtotime('-1 month'))),\n // );\n\n $reportTools = new ReportTools();\n $reportTools->saveReportList('AutoDaySessReport');\n\n\n $BeginDate = date('Y-m-01', strtotime(date(\"Y-m-d\")));\n $date = array(\n date_to_int('-',$BeginDate),\n date_to_int('-',date('Y-m-d', strtotime(\"$BeginDate +1 month -1 day\"))),\n );\n $month = date('Y-m-01', strtotime('-1 month'));\n $month1 = date('Y-m-t', strtotime('-1 month'));\n dump($month);\n dump($month1);\n $mytime = date(\"Y-01-01\", strtotime(\"-1 year\"));\n dump($mytime);\n $monthEndDays = cal_days_in_month(CAL_GREGORIAN, 12, date(\"Y\", strtotime(\"-1 year\")));\n $year = date(\"Y-12-\".$monthEndDays, strtotime(\"-1 year\"));\n echo 'year:' . $year;\n $monthDays = cal_days_in_month(CAL_GREGORIAN, date('m',strtotime('-1 month')), date('Y'));\n dump($monthDays);\n echo 'n:' . date('n');\n $season = ceil((date('n'))/3)-1;\n echo '<br>上季度起始时间:<br>';\n echo date('Y-m-d H:i:s', mktime(0, 0, 0,$season*3-3+1,1,date('Y'))),\"\\n\";\n echo date('Y-m-d H:i:s', mktime(23,59,59,$season*3,date('t',mktime(0, 0 , 0,$season*3,1,date(\"Y\"))),date('Y'))),\"\\n\";\n //获取第几季度\n // $season = ceil((date('n'))/3);\n // echo date('m', mktime(0, 0, 0,$season*3-3+1,1,date('Y'))),\"\\n\";\n // echo date('Y-m-d', mktime(23,59,59,$season*3,date('t',mktime(0, 0 , 0,$season*3,1,date(\"Y\"))),date('Y'))),\"\\n\";\n dump($season);\n // $daySessReportTools = new DaySessReportTools();\n // $daySessReportTools->getDateList($date);\n // $daySessReportTools->daySessExcelGen($date);\n //\n // $dayErrorReportTools = new DayErrorReportTools();\n // $dayErrorReportTools->dayErrorExcelGen($date);\n // $daySessReportTools->getDateList($date);\n $str = stristr('DaySuccessReport_UID_2017-06-29.xlsx','_',true);\n dump($str);\n $this->display();\n }",
"public function getStep();",
"public function calculateTimeMachine()\n {\n $days = array();\n for ($i=1; $i < 31; $i++) {\n $date = date('c', strtotime(\"-$i days\"));\n array_push($days, strtotime($date));\n }\n return $days;\n }",
"public function getDays()\n\t{\n\t\treturn $this->days;\n\t}",
"function getReadDays($day = null){\n\t\t\tif (get_class($day)=='rupu_timestamp'){\n\t\t\t\t$day = $day->getDate();\n\t\t\t}\n\t\t\t\n\t\t\t$readPapers = new newspaperSet();\n\t\t\t$dates = $this->getActivityDates();\n\t\t\tforeach ($dates as $date){\n\t\t\t\tif ($day){\n\t\t\t\t\tif ($date == $day){\n\t\t\t\t\t\t$d = new newspaper($date,$this,$this->db);\n\t\t\t\t\t\t$readPapers->add($d);\n\t\t\t\t\t}\t\t\n\t\t\t\t} else {\n\t\t\t\t\t$d = new newspaper($date,$this,$this->db);\n\t\t\t\t\t$readPapers->add($d);\t\t\t\t\t\n\t\t\t\t}\t\t\t\n\t\t\t}\t\t\t\n\t\t\treturn $readPapers;\n\t\t}",
"public function get_day_permastruct()\n {\n }",
"function get_scheduled_days() {\n\t\treturn Clean::ids( $this->get_option( 'scheduled_day' ) );\n\t}",
"public function getSteps(): array\n {\n return $this->steps;\n }",
"public function getTotalDifferenceInDays();",
"public function getStep() : int;",
"public function calculateStageDate(){\n $rallyService = parent::getService('rally','rally');\n $teamService = parent::getService('team','team');\n $leagueService = parent::getService('league','league');\n \n $allRallies = $rallyService->getAllRallies();\n foreach($allRallies as $rally):\n $date = new DateTime($rally['date']);\n foreach($rally['Stages'] as $key => $stage):\n if($key!=0){\n $date->add(new DateInterval('PT15M'));\n }\n $stage->set('date',$date->format('Y-m-d H:i:s'));\n if($date->format('Y-m-d H:i:s')<date('Y-m-d H:i:s')){\n $stage->set('finished',1);\n }\n $stage->save();\n// var_dump($stage->toArray());exit;\n endforeach;\n endforeach;\n echo \"pp\";exit;\n }",
"function lecturesInNextDays($survey, $daysInFuture=1,$kritter=0) {\n\t\tif ($daysInFuture>0) {\n\t\t\t$dateLimit = time() + $daysInFuture*24*60*60;\n\t\t\t$dateLimitWhere = ' AND eval_date_fixed<'.$dateLimit.' ';\n\t\t}\n\t\telse $dateLimitWhere = '';\n\n\t\t$res = $GLOBALS['TYPO3_DB']->sql_query('SELECT *\n\t\t\t\t\t\t\t\t\t\t\t\tFROM tx_fsmivkrit_lecture\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE deleted=0 AND hidden=0\n\t\t\t\t\t\t\t\t\t\t\t\t AND survey='.$survey.\n\t\t\t\t\t\t\t\t\t\t\t\t $dateLimitWhere.'\n\t\t\t\t\t\t\t\t\t\t\t\t AND eval_date_fixed > '.time().'\n\t\t\t\t\t\t\t\t\t\t\t\t ORDER BY eval_date_fixed');\n\n\t\t$lectures = array ();\n\t\twhile ($res && $row = mysql_fetch_assoc($res))\n\t\t\t$lectures[] = $row['uid'];\n\n\t\treturn $lectures;\n\t}",
"function getDays( $date )\r\n\t{\r\n\t\t$days = array( );\r\n\t\t\r\n\t\t$days[0] = date( 'Y-m-d', strtotime( $date ) );\r\n\t\t$days[1] = date( 'Y-m-d', strtotime( $date . ' +1 day' ) );\r\n\t\t$days[2] = date( 'Y-m-d', strtotime( $date . ' +2 days' ) );\r\n\t\t\r\n\t\treturn $days;\r\n\t}",
"public function getThrendsDaily(Request $request) {\n\n\n if (($request->has('fr') && $request->has('to')) && (is_iso_date($request->input('fr')) && is_iso_date($request->input('to')))) {\n\n $this->dr->fr = carbonCheckorNow($request->input('fr'));\n $this->dr->to = carbonCheckorNow($request->input('to'));\n\n if ($this->dr->fr->gt($this->dr->to))\n return 'fr is gt to';\n\n $len = $this->dr->to->diffInDays($this->dr->fr);\n } else {\n\n $date = carbonCheckorNow($request->input('date'));\n $len = 6;\n if ($request->has('len') && $request->input('len')>0 && $request->input('len')<90)\n $len = $request->input('len');\n\n $this->dr->to = $date;\n $this->dr->fr = $date->copy()->subDays($len);\n } \n\n $datas = [];\n\n\n // return $this->dr->to->diffInDays($this->dr->fr);\n\n // return $this->dr->fr;\n // return $this->dr->fr->copy()->subDay();\n\n $dailysales = $this->repo\n // ->skipCache()\n ->getAllByDr($this->dr->fr->copy()->subDay(), $this->dr->to, ['sales', 'branchid', 'date']);\n\n // $branchs = \\App\\Models\\Boss\\Branch::select(['code', 'descriptor', 'id'])->active()->orderBy('code')->get();\n $branchs = \\App\\Models\\Branch::select(['code', 'descriptor', 'id'])->whereIn('id', collect($dailysales->pluck('branchid'))->unique()->toArray())->orderBy('code')->get();\n\n foreach($branchs as $key => $branch) {\n $datas[$key]['code'] = $branch->code;\n $datas[$key]['descriptor'] = $branch->descriptor;\n\n $to_date = $this->dr->to->copy();\n for ($i=0; $i<=$len+1; $i++) {\n $to = $to_date->copy()->subDay($i);\n \n $datas[$key]['dss'][$i]['date'] = $to;\n\n $filtered = $dailysales->filter(function ($item) use ($to, $branch) {\n return ($item->branchid == $branch->id) && ($item->date->format('Y-m-d') == $to->format('Y-m-d'))\n ? $item : null;\n });\n\n $f = $filtered->first();\n\n $datas[$key]['dss'][$i]['sales'] = is_null($f) ? NULL : $f->sales;\n }\n }\n\n\n // return $datas;\n\n\n foreach($datas as $j => $data) {\n foreach($data['dss'] as $k => $ds) {\n if ($k==0 && is_null($datas[$j]['dss'][$k]['sales'])) {\n $prev_sales = NULL;\n } else {\n if (($k)<=$len)\n $prev_sales = is_null($datas[$j]['dss'][($k+1)]['sales']) ? 0 : $datas[$j]['dss'][($k+1)]['sales'];\n else\n $prev_sales = 0;\n }\n $datas[$j]['dss'][$k]['prev_sales'] = $prev_sales;\n $datas[$j]['dss'][$k]['diff'] = $datas[$j]['dss'][$k]['sales'] - $prev_sales;\n $datas[$j]['dss'][$k]['pct'] = $prev_sales>0 ? ($datas[$j]['dss'][$k]['diff']/$prev_sales)*100 : 0;\n }\n }\n\n foreach($datas as $l => $data) {\n unset($datas[$l]['dss'][$len+1]);\n }\n\n // return $datas;\n\n /*\n if (!in_array($request->user()->id, ['41F0FB56DFA811E69815D19988DDBE1E', '11E943EA14DDA9E4EAAFBD26C5429A67'])) {\n\n $email = [\n 'body' => $request->user()->name.' '.$this->dr->fr->format('Y-m-d').' '.$this->dr->to->format('Y-m-d')\n ];\n\n \\Mail::queue('emails.notifier', $email, function ($m) {\n $m->from('[email protected]', 'GI App - Boss');\n $m->to('[email protected]')->subject('Sales Trend');\n });\n }\n */\n\n\n $view = view('report.trends-all-daily')\n ->with('datas', $datas);\n return $this->setViewWithDR($view);\n\n return $datas[0]['dss'];\n }",
"function todaysactivities()\n {\n $variables = array();\n $userdetails = $this->userInfo();\n $paitent_id = $userdetails['user_id'];\n $day = $this->getPaitentCurrentDay($paitent_id);\n $day = ($day % 7) + 1;\n $variables['currday'] = $day;\n\n $video = $this->getPaitentVideoByDay($paitent_id, $day);\n $total_count = count($video);\n $variables['total_items'] = $total_count;\n //print_r($video);\n\n $this->output = $this->build_template($this->get_template('todaysactivities'), $variables);\n }",
"public function getDaysusage()\n {\n return $this->daysusage;\n }"
]
| [
"0.6703037",
"0.63167024",
"0.60859567",
"0.60497534",
"0.6044134",
"0.57635736",
"0.56931394",
"0.569268",
"0.5609489",
"0.5607603",
"0.5554658",
"0.55529976",
"0.55464673",
"0.5523743",
"0.5399061",
"0.536371",
"0.53498375",
"0.533122",
"0.53292924",
"0.5329139",
"0.5327836",
"0.53250265",
"0.53247344",
"0.53188914",
"0.53069526",
"0.52835536",
"0.5278575",
"0.5275012",
"0.52724683",
"0.5261009"
]
| 0.6430292 | 1 |
Get details for a particular campaign signup from Phoenix. | public function getSignup($signup_id)
{
$path = 'signups/'.$signup_id;
return $this->get($path);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCampaign();",
"public function fetchCampaign() {\n return $this->QueryAPI(\"current_user/campaigns?include=rewards,creator,goals\");\n }",
"public function show($campaign)\n {\n //\n $clpGuid = config('appsettings.clpGUID');\n\n\n $data = new HomeCampaign($campaign);\n VisitManager::visit($campaign,\"Home\");\n return view(\"campaign\",['Data' => $data]);\n }",
"public function show(Campaign $campaign)\n {\n //\n }",
"public function show(signUp $signUp)\n {\n //\n }",
"public function show(Campaign $campaign)\n\t\t{\n\t\t\t \n\t\t}",
"public function show(Campaign $campaign)\n {\n if (Auth::user()->id == $campaign->created_by){\n return view('campaign.show', compact('campaign'));\n }\n return redirect()->back()->with(['message'=>'You don\\'t have permission']);\n }",
"public function getCampaign()\n {\n return $this->campaign;\n }",
"public function createCampaign()\n\t{\n\t\treturn view('social.campaign');\n\t}",
"public function getBillingProfile();",
"public function fetchCampaign_and_patrons() {\n return $this->QueryAPI(\"current_user/campaigns?include=rewards,creator,goals,pledges\");\n }",
"function getCampaignInfo ($id) {\n\t\treturn $this->gateway->execCommad('getCampaignInfo',array('id' => $id));\n\t}",
"public function get_campaigns() {\n return $this->linkemperor_exec(null, null,\"/api/v2/customers/campaigns.json\");\n }",
"public function index()\n {\n $campaigns = Campaign::where('user_id', Auth::id())->get();\n return view('admin.list-campaign')->with('campaigns', $campaigns);\n }",
"function lf_email_util_get_campaign_details( $id ) {\n\n\tglobal $wpdb;\n\n\t$table_campaigns = $wpdb->prefix . 'lf_campaigns';\n\n\t// Set Query\n\t$sql = \"SELECT * FROM $table_campaigns WHERE id = $id\";\n\n\t// Get Results\n\t$results = $wpdb->get_results( $sql, ARRAY_A );\n\n\t// Format Results\n\t$details;\n\tif ( count( $results ) > 0 ) {\n\t\t$details = $results[0];\n\t} // end if\n\n\treturn $details;\n}",
"public function get()\n {\n $queryString = '{\"MaxResults\":0,\"MatchAll\":true,\"InstitutionID\":null}';\n return $this->performRequest('GET', '/service/CupsService.svc/cups/get', $queryString);\n }",
"public function getAccountDetails(){\n\t\t$url = \"/account/details/\";\n\t\t$method='get';\n\t\treturn $this->request($url , $method);\n\t}",
"public function index(Campaign $campaign)\n {\n $campaigns = $campaign->owned()->orderBy('id','asc')->get();\n// dump($campaigns);\n return view('campaign.index',compact('campaigns'));\n }",
"public function campaignList(){\n return view('user.campaign.list');\n }",
"public function getCampaignId()\n {\n return $this->campaign_id;\n }",
"public function campaign()\n {\n return $this->belongsTo(Campaign::class);\n }",
"public function campaign()\n {\n return $this->belongsTo(Campaign::class);\n }",
"function _campaign_resource_signup($nid, $values) {\n global $user;\n if (!isset($values['uid'])) {\n $values['uid'] = $user->uid;\n }\n if (!isset($values['source'])) {\n $values['source'] = NULL;\n }\n if (DOSOMETHING_SIGNUP_LOG_SIGNUPS) {\n watchdog('dosomething_api', '_campaign_resource_signup values:' . json_encode($values));\n }\n // @todo: Pass parameter into signup_create whether or not to send SMS.\n // Since SMS campaign signups would hit this endpoint, would not want \n // to send an additional \"You've signed up text\".\n return dosomething_signup_create($nid, $values['uid'], $values['source']);\n}",
"public function campaigns()\n {\n $campaigns = App::get('database')->getAll('campaigns');\n\n echo json_encode($campaigns);\n }",
"public function campaign()\n {\n return $this->belongsTo(Campaign::class, self::PIVOT_CAMPAIGN_ID);\n }",
"public function show($id)\n {\n $user_campaigns = Auth::user()->campaigns;\n $campaign = $user_campaigns->firstWhere(\"id\", $id);\n if($campaign == null)\n return self::responseErrors(\"Campaign with id \".$id.\" not found or doesn't belong to you\", 404);\n return self::responseData(new CampaignResource($campaign));\n }",
"function getCampaignList() {\n\t\treturn $this->gateway->execCommad('getCampaignList',\"\");\n\t}",
"public function index()\n {\n $campaign = UserCampaign::orderByDesc('id')\n ->paginate(20);\n $viewData = [\n 'campaign' => $campaign\n ];\n return view('admin::pages.campaign.index', $viewData);\n }",
"public function campaign()\n {\n return $this->hasOne(Campaign::class);\n }",
"public function show(Campaign $campaign)\n {\n $data = ['campaign' => $campaign];\n \n return view('campaigns.show', $data);\n }"
]
| [
"0.6248012",
"0.62014246",
"0.6181665",
"0.61804944",
"0.5947227",
"0.5870081",
"0.58253944",
"0.5540232",
"0.5523174",
"0.54895097",
"0.54222065",
"0.530759",
"0.5264886",
"0.52215517",
"0.5206767",
"0.5165017",
"0.5160185",
"0.51590204",
"0.5152937",
"0.5094501",
"0.5070556",
"0.5070556",
"0.5070197",
"0.5064595",
"0.50264204",
"0.5020231",
"0.50108284",
"0.4983731",
"0.49736217",
"0.49733043"
]
| 0.6347347 | 0 |
Returns the value of field questionlab | public function getQuestionlab()
{
return $this->questionlab;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFaqQuestion () {\n\t$preValue = $this->preGetValue(\"faqQuestion\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->faqQuestion;\n\treturn $data;\n}",
"public function getFaqAnswer () {\n\t$preValue = $this->preGetValue(\"faqAnswer\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"faqAnswer\")->preGetData($this);\n\treturn $data;\n}",
"public function question()\n\t{\n\t\tif($db = $this->module->db())\n\t\t{\n\t\t\tif($result = $db->query(\"SELECT\n\t\t\t\ts_question\n\t\t\t\tFROM\n\t\t\t\t\".$db->getPrefix().\"faq\n\t\t\t\tWHERE\n\t\t\t\tid=\".$this->id.\";\"))\n\t\t\t{\n\t\t\t\twhile( $line = mysql_fetch_array( $result ) )\n\t\t\t\t{\n\t\t\t\t\treturn urldecode($line[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn NULL;\n\t}",
"public function getQuestionText() {\n\t\treturn $this->questionText;\n\t}",
"function getFlexFormValue($sheet, $field) {\n\t\t$flexform = $this->PA['row']['pi_flexform'];\n\t\t$ffArray = t3lib_div::xml2array($flexform);\n\n\t\tif(is_array($ffArray)) {\n\t\t\t$value = $ffArray['data'][$sheet]['lDEF'][$key]['vDEF'];\n\t\t}\n\t\t \n\t\treturn $value;\n\t}",
"function question()\r\n {\r\n return $this->Question;\r\n }",
"function getValue() { return $this->readText(); }",
"public function get_question() {\n\t\t\treturn $this->question;\n\t\t}",
"function getValue() { return $this->readText(); }",
"public function getFaqsequence () {\n\t$preValue = $this->preGetValue(\"faqsequence\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->faqsequence;\n\treturn $data;\n}",
"public function getQuestion(): string\n {\n return $this->question;\n }",
"function readDataFieldValue()\r\n {\r\n $result=false;\r\n if ($this->hasValidDataField())\r\n {\r\n $fname=$this->DataField;\r\n $value=$this->_datasource->Dataset->fieldget($fname);\r\n $result=$value;\r\n }\r\n return($result);\r\n }",
"function getfield(){\r\n // Талбаруудын утгыг авах\r\n }",
"public function getQuestionData()\n {\n return $this->_coreRegistry->registry('current_question');\n }",
"public function getQuestion() {\n return $this->question;\n }",
"public function getSubmittedValue();",
"public function getSubmittedValue();",
"function getFieldValue($field);",
"public function getQuestionText()\n {\n return Html::encode($this->text);\n }",
"public function getValue()\n {\n return $this->_fields['Value']['FieldValue'];\n }",
"public function getFieldValue()\n {\n return $this->value;\n }",
"public function getQuestion() {\n\t\t\treturn $this->question;\n\t\t}",
"private function Value()\n\t{\n\t\t$peek = $this->lexer->glimpse();\n\n\t\tif ( DocLexer::T_EQUALS === $peek['type'] )\n\t\t\treturn $this->FieldAssignment();\n\n\t\treturn $this->PlainValue();\n\t}",
"public function getValue(): mixed\n {\n return $this->field?->getValue();\n }",
"public function getQuestion()\n {\n // TODO: Implement getQuestion() method.\n }",
"function getAnswerText(){\r\n\t\tif($this->inDB==false||$this->answer==null){\r\n\t\t\t$type = $this->dbq->getAnswerType($this->answer_id);\r\n\t\t\tif($type==3 || $type==7 || $type==8){\r\n\t\t\t\t$io = new FileIOHandler();\r\n\t\t\t\t$this->answer=$io->MediaRead($type,$this->answer_id);\r\n\t\t\t}else{\r\n\t\t\t\t$temp = $this->dbq->getAnswer($this->answer_id);\r\n\t\t\t\t$num=mysql_numrows($temp);\r\n\t\t\t\t\tif($num==1){\r\n\t\t\t\t\t\tif($type==1){\r\n\t\t\t\t\t\t\t$this->answer=mysql_result($temp,0,\"text\");\r\n\t\t\t\t\t\t}elseif($type== 2 || $type==4 || $type==5 || $type==9){\r\n\t\t\t\t\t\t\t$this->answer=mysql_result($temp,0,\"num\");\t\t\t\t\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\treturn $this->answer;\t\t\r\n\t}",
"function findAnswer($question, $userValue)\n{\n if(!isset($question[\"form_answers\"])) return null;\n\n $ans = null;\n foreach ($question[\"form_answers\"] as $ans)\n if(matchStrings($userValue, $ans[\"label\"]))\n return $ans;\n if(@$ans[\"data_type\"]) return $ans;\n return null;\n}",
"function getValue($fieldname)\n\t{\n\t\tif ($this->id == 'new')\n\t\t\treturn \"\";\n\t\t\t\n\t\tif (isset($this->record->values[$fieldname]->value))\n\t\t\treturn $this->record->values[$fieldname]->value;\n\t\telse\n\t\t\treturn NULL;\n// \t\t\ttrigger_error(\"No value is set for the field: $fieldname\");\n\t}",
"public function answer()\n\t{\n\t\tif($db = $this->module->db())\n\t\t{\n\t\t\tif($result = $db->query(\"SELECT\n\t\t\t\ts_answer\n\t\t\t\tFROM\n\t\t\t\t\".$db->getPrefix().\"faq\n\t\t\t\tWHERE\n\t\t\t\tid=\".$this->id.\";\"))\n\t\t\t{\n\t\t\t\twhile( $line = mysql_fetch_array( $result ) )\n\t\t\t\t{\n\t\t\t\t\treturn urldecode($line[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn NULL;\n\t}",
"function get_correct_answer(){\n return $this->correct_answer;\n }"
]
| [
"0.7048341",
"0.70253956",
"0.656746",
"0.638988",
"0.63607806",
"0.62467635",
"0.61562747",
"0.6139949",
"0.61342347",
"0.6111277",
"0.6088293",
"0.6011833",
"0.59915423",
"0.5986641",
"0.59673756",
"0.59481245",
"0.59481245",
"0.5934327",
"0.58809024",
"0.5849877",
"0.5848605",
"0.58134407",
"0.5788118",
"0.5778216",
"0.57731813",
"0.5762657",
"0.57513624",
"0.5742103",
"0.5739231",
"0.57382697"
]
| 0.740329 | 0 |
Creates the initial Forward, based on the given request. | public function determineInitialForward(Request $request); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function initForward()\n {\n if (empty($this->_beforeForwardInfo)) {\n parent::initForward();\n $this->_beforeForwardInfo['route_name'] = $this->getRouteName();\n return $this;\n }\n\n return parent::initForward();\n }",
"protected function forwardToReferringRequest() {}",
"public function __construct($requestName, \\Fortissimo\\ExecutionContext $cxt = NULL, $allowInternal = TRUE) {\n $this->destination = $requestName;\n $this->cxt = $cxt;\n $this->internal = $allowInternal;\n parent::__construct('Request forward.');\n }",
"public function __construct(Request $request)\n {\n $this->incomingRequest = new IncomingIlluminateRequest($request);\n $this->outgoingResponse = new OutgoingResponse();\n }",
"public static function forward() {\n\t\t\t\n\t\t\t$url = HttpRequest::parsedQuery();\n\t\t\t\n\t\t\tif ( isset($url[0]) ) {\n\t\t\t\n\t\t\t\t$url[0] = ucwords($url[0]);\n\t\t\t\t\n\t\t\t\tif ( file_exists(path('application').'controllers'.DS.$url[0].'.php') ) {\n\t\t\t\t\t\n\t\t\t\t\tstatic::$_controller = $url[0];\n\t\t\t\t\t\n\t\t\t\t\tunset($url[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\trequire_once( path('application').'controllers'.DS.static::$_controller.'.php' );\n\t\t\t\n\t\t\tstatic::$_controller = new static::$_controller();\n\t\t\t\n\t\t\tif ( isset($url[1]) ) {\n\t\t\t\t\n\t\t\t\t$url[1] = strtolower($url[1]);\n\t\t\t\t\n\t\t\t\tif ( method_exists(static::$_controller, $url[1]) ) {\n\n\t\t\t\t\tstatic::$_action = $url[1];\n\t\t\t\t\t\n\t\t\t\t\tunset($url[1]);\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t\t\n\t\t\tstatic::$_parameters = $url ? array_values($url) : [];\n\t\t\t\n\t\t\tunset($url);\n\t\t\t\n\t\t\tcall_user_func_array([static::$_controller, static::$_action], static::$_parameters);\n\t\t}",
"public function forward($forward);",
"public function proxy(Request $request)\n {\n return $this\n ->getHttpProxy()\n ->forwardRequest(\n $request->path(),\n $request\n );\n }",
"public function __construct( $request )\n\t{\n\t\t$this->buildSiteArray( );\n\t\t$this->buildRequestArray( $request );\n\n\t\t/**\n\t\t * Is this an API request to a client API that we need to proxy along?\n\t\t */\n\t\tif ( $this->isClientApiRequest( ) === true )\n\t\t{\n\t\t\t\\OriginAPI::makeClientAPIRequest( $this->request, file_get_contents( 'php://input' ) );\n\t\t}\n\n\t\tif ( $this->isPage( ) === true )\n\t\t{\n\t\t\t/**\n\t\t\t * Might have the mobile cookie, and just need to get redirected to mobile file on disk\n\t\t\t * For dynamic mobile page, always let dynamic page handle it.\n\t\t\t */\n\t\t\tif (\n\t\t\t\t$this->request['mobile'] === true &&\n\t\t\t\tfile_exists( \\BASE_DOCROOT_DIR . '/mobile/' . $this->request['file'] ) === true\n\t\t\t) {\n\t\t\t\t\\setcookie( 'is_mobile', 1, time( ) + 2592000, '/' );\n\t\t\t\tif ($this->isDynamicPage() === false) {\n\t\t\t\t\t\\Output::sendHeader('Location: ' . $this->request['file']);\n\t\t\t\t\t$this->isRedirect = true;\n\t\t\t\t\t$this->finalizeOutput();\n\t\t\t\t\texit();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Do we have it in the page hierarchy, or is it a dynamic page? Go get it from Origin\n\t\t\t */\n\t\t\tif ($this->isPageInPublishedData( $this->request['file'] ) === true || $this->isDynamicPage( ) === true )\n\t\t\t{\n\t\t\t\t$this->isDynamicStandardPage(); // update request with isDynamic if needed\n\t\t\t\t$response = \\OriginRequest::getObject( $this->request );\n\t\t\t\t$this->handleOriginResponse( $response );\n\t\t\t} else {\n\t\t\t\t\\Output::render404( );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Should we try a simple redirect from .htm to .html?\n\t\t\t */\n\t\t\tif ( $this->isPageInPublishedData( $this->request['file'] . 'l' ) === true )\n\t\t\t{\n\t\t\t\tif ( file_exists( \\BASE_DOCROOT_DIR . '/' . $this->request['file'] ) === true )\n\t\t\t\t{\n\t\t\t\t\t\\Output::sendHeader( 'Location: ' . $this->request['file'] . 'l' );\n\t\t\t\t\t$this->isRedirect = true;\n\t\t\t\t\t$this->finalizeOutput();\n\t\t\t\t\texit( );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t/**\n\t\t\t\t\t * Don't have it yet, go get it before forwarding\n\t\t\t\t\t */\n\t\t\t\t\t$this->request['file'] .= 'l';\n\t\t\t\t\t$this->isDynamicStandardPage(); // update request with isDynamic if needed\n\t\t\t\t\t$response = \\OriginRequest::getObject( $this->request );\n\t\t\t\t\t$this->handleOriginResponse( $response );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/**\n\t\t\t * Not a page, we have to use benefit of the doubt here for checking origin\n\t\t\t */\n\t\t\t// Assets files.\n\t\t\t// Set default memory_limit so wServer will send back retryRaw message for file larger than 1MB.\n\t\t\t// Not setting it means it's remote server published before this change,\n\t\t\t// then wServer will always return old type of response. (no retryRaw mechanism)\n\t\t\t$this->request['memory_limit'] = MEMORY_LIMIT;\n\t\t\t$response = \\OriginRequest::getObject( $this->request );\n\t\t\t$this->handleOriginResponse( $response );\n\t\t}\n\n\t\t// if redirect header, then add text to prevent some ftp server's firewall from block pure header redirect.\n\t\t$this->finalizeOutput();\n\t}",
"public static function factory()\n {\n $request = new Request();\n static::$_current = $request;\n return $request;\n }",
"public function toRequest(): Request\n {\n // Create URI\n $uri = new Uri(sprintf($this->uriTemplate, $this->shop));\n\n // Create headers\n $authenticatedRequestHeader = $this->accessTokenTransformer\n ->toAuthenticatedRequestHeader($this->accessToken);\n\n // Create headers\n $headers = array_merge($this->headers, $authenticatedRequestHeader);\n\n // Create request\n return new Request($this->httpMethod, $uri, $headers);\n }",
"protected function init(Request $request) {\n\t\tUrlGeneratorUtil::constructInstance($request);\n\t}",
"abstract public function populateRequest(PHPFrame_Request $request);",
"abstract public function initFromRequest(\\App\\Request $request);",
"public function __construct(Kohana_Request $request)\r\n {\r\n if(! Site::conf('facebook.registration.active', FALSE))\r\n {\r\n Header( \"HTTP/1.1 301 Moved Permanently\" );\r\n Header( \"Location: \".Site::conf('base') );\r\n }\r\n\r\n parent::__construct($request);\r\n }",
"protected function buildWebRequest()\n {\n $args = $_REQUEST;\n $params = array();\n\n $route = $_SERVER['REQUEST_URI'];\n $posQuestionMark = strpos($route, '?');\n if ($posQuestionMark !== false) {\n $route = substr($route, 0, $posQuestionMark);\n }\n \n $posIndex = strpos($route, 'index.php');\n if ($posIndex !== false) {\n $route = substr($route, $posIndex + strlen('index.php'));\n }\n \n // Transform the arguments\n foreach ($args as $key => $value) {\n if (is_numeric($value)) {\n // Transform the value into the correct data type\n $value = $value * 1;\n }\n \n $params[$key] = $value;\n }\n\n // Generate the full url and extract the base\n $scheme = $this->getScheme();\n $fullUrl = $scheme . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\n $isSsl = false;\n if ($scheme == 'https') {\n $isSsl = true;\n }\n \n $routePosition = strlen($fullUrl);\n if ($route !== '' && $route !== '/') {\n $routePosition = strpos($fullUrl, $route);\n }\n \n $method = $_SERVER['REQUEST_METHOD'];\n $requestedUrl = $this->getRequestedUrl();\n $base = substr($fullUrl, 0, $routePosition);\n $headers = $this->getHeaders($_SERVER);\n $protocol = $_SERVER['SERVER_PROTOCOL'];\n \n $locale = 'en_US';\n if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\n $locale = $this->getLocale($_SERVER['HTTP_ACCEPT_LANGUAGE']);\n }\n \n $operatingSystem = $this->getOperatingSystem();\n\n return new WebRequest($method, $requestedUrl, $route, $params, $base, $locale, $operatingSystem, $isSsl, $headers, $protocol);\n }",
"protected function initRequest()\n {\n $context = new RequestContext();\n $context->fromRequest(self::$request);\n $matcher = new UrlMatcher($this->routCollection, $context);\n\n try {\n $attributes = $matcher->match(self::$request->getPathInfo());\n $response = $this->callController($attributes);\n } catch (ResourceNotFoundException $e) {\n $response = new Response('Not Found', 404);\n } catch (Exception $e) {\n $response = new Response('An error occurred', 500);\n }\n\n $response->send();\n }",
"public function createRequest(Request $request)\n {\n $body = ConnectClient::getInstance()->fulfillment->sendRequest('POST', '/requests', $request);\n return Model::modelize('Request', json_decode($body));\n }",
"protected function createRequest()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n $this->call('wizard:request', $params);\n }",
"public function create(FeadbackRequests $request)\n {\n // TODO\n }",
"public function __construct(){\n\t\t$this->headers = apache_request_headers();\n\t\t// Save the special x-RESTProxy-* headers\n\t\t$this->Host = $this->Host? $this->Host : $this->headers['x-RESTProxy-Host'];\n\t\t$this->Port = $this->headers['x-RESTProxy-Port'] ? ':'.$this->headers['x-RESTProxy-Port'] : \"\";\n\t\t$this->Https = ($this->headers['x-RESTProxy-HTTPS'])? $this->headers['x-RESTProxy-HTTPS'] : false;\n\t\t// Create a temp file in memory\n\t\t$this->fp = fopen('php://temp/maxmemory:256000','w');\n\t\tif (!$this->fp){\n\t\t\t$this->Error(100);\n\t\t}\n\t\t// Write the input into the in-memory tempfile\n\t\t$this->input = file_get_contents(\"php://input\");\n\t\tfwrite($this->fp,$this->input);\n\t\tfseek($this->fp,0);\n\n\t\t//Get the REST Path\n\t\tif(!empty($_SERVER['PATH_INFO'])){\n\t\t $this->_G = substr($_SERVER['PATH_INFO'], 1);\n\t\t //$this->_G = explode('/', $_mGET);\n\t\t }\n\t\t \n\t\t // Get the raw GET request\n\t\t $tmp = explode('?',$_SERVER['REQUEST_URI']);\n\t\t if ($tmp[1]) {\n\t\t \t$this->_RawGET = $tmp[1];\n\t\t } else {\n\t\t \t$this->_RawGET = \"\";\n\t\t }\n\t \n\t}",
"private function mapRequest(ReactRequest $request)\n {\n return new DiactorosRequest(\n $_SERVER,\n $request->getFiles(),\n $request->getUrl(),\n $request->getMethod(),\n $this->getBodyStreamFrom($request),\n $request->getHeaders(),\n $this->getCookiesFrom($request),\n $request->getQuery(),\n $request->getPost(),\n $request->getHttpVersion()\n );\n }",
"public function __construct($request)\n {\n // Verify system requirements\n Requirements::verify();\n\n // Retrieve the library from request\n $request = $this->getRequestClass($request);\n\n // Validate the requested library\n $this->validate($request);\n\n // Initialize the Request library\n $this->requestCtx = new $request();\n\n // Initialize the Network\n $this->networkCtx = new Network();\n\n // Initialize Response Object\n $this->responseCtx = new Response();\n }",
"public function __construct($request)\n {\n /**\n * This is a very (VERY) simple example of parsing\n * the request. We use the $_SERVER superglobal to\n * grab the URI.\n */\n $this->request = $request;\n }",
"function init_request($request)\n {\n }",
"function init_request($request)\n {\n }",
"protected function processForwardConfig(Aloi_Serphlet_Application_HttpRequest $request, Aloi_Serphlet_Application_HttpResponse $response, $forward) {\r\n\t\tif (is_null($forward)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (self::$log->isDebugEnabled()) {\r\n\t\t\tself::$log->debug('processForwardConfig(' . $forward . ')');\r\n\t\t}\r\n\t\t\r\n\t\t// Add back in support for calling 'nextActionPath' in the forward config\r\n\t\t$nextActionPath = $forward->getNextActionPath();\r\n\t\tif(!empty($nextActionPath)) $forwardPath = (substr($nextActionPath, 0, 1) == '/' ? '' : '/') . $nextActionPath . '.do'; // TODO: Base on current mapping\r\n\t\telse $forwardPath = $forward->getPath();\r\n\r\n\t\tif ($forward->getRedirect()) {\r\n\t\t\t// Build the forward path with a forward context relative URL\r\n\t\t\t$contextRelative = $forward->getContextRelative();\r\n\t\t\tif($contextRelative) {\r\n\t\t\t\t$forwardPath = $request->getContextPath() . $forwardPath;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$response->sendRedirect($response->encodeRedirectURL($forwardPath));\r\n\t\t} else {\r\n\t\t\t$this->doForward($forwardPath, $request, $response);\r\n\t\t}\r\n\t}",
"protected function doForward($uri, Aloi_Serphlet_Application_HttpRequest $request, Aloi_Serphlet_Application_HttpResponse $response) {\r\n\t\t// Identify configured action chaining\r\n\t\tif (preg_match('/(\\/[A-z0-9]+)\\.do$/', $uri, $matches)) { // TODO: Base on current servlet mapping\r\n\t\t\tif (self::$log->isDebugEnabled()) {\r\n\t\t\t\tself::$log->debug(' Forward identified as an action chain request');\r\n\t\t\t}\r\n\t\t\t// Set the action do path in the request and then process\r\n\t\t\t$newPath = $matches[1];\r\n\t\t\t$servletConfig = $this->servlet->getServletConfig();\r\n\t\t\t$request->setPathInfo($newPath);\r\n\t\t\t$this->process($request, $response);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$rd = $this->servlet->getServletContext()->getRequestDispatcher($uri);\r\n\t\tif (is_null($rd)) {\r\n\t\t\t$response->sendError(Aloi_Serphlet_Application_HttpResponse::SC_INTERNAL_SERVER_ERROR, $this->getInternal()->getMessage(null, 'requestDispatcher', $uri));\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$rd->doForward($request, $response);\r\n\t}",
"protected function __construct(Request $request)\n\t{\n\t\t// Store the request for this instance\n\t\t$this->request = $request;\n\t\t\n\t\t// Get the user (via Auth)\n\t\t$this->user = Auth::instance()->get_user();\n\t\tif ( ! $this->user)\n\t\t{\n\t\t\t$this->user = ORM::factory('user');\n\t\t}\n\n\t\t// Initialize the rule\n\t\t$this->initialize_rule();\n\t}",
"public function __construct(Octopus_Request $request) {\n\n if (!$request instanceof Octopus_Request) {\n throw new Octopus_Exception('$request must be an Octopus_Request');\n }\n\n $this->_request = $request;\n $this->reset();\n }",
"public function createRequest();"
]
| [
"0.63299686",
"0.6036237",
"0.5677408",
"0.56692946",
"0.55701494",
"0.55417913",
"0.54636145",
"0.5449767",
"0.54329693",
"0.5393548",
"0.53307956",
"0.53244776",
"0.5174394",
"0.5140815",
"0.5134711",
"0.5131913",
"0.5124884",
"0.5104006",
"0.5065815",
"0.5042558",
"0.5039897",
"0.50385225",
"0.49985492",
"0.49900106",
"0.49900106",
"0.49587235",
"0.49537325",
"0.493678",
"0.49271366",
"0.4923542"
]
| 0.7356065 | 0 |
Sets a new documentationReferences | public function setDocumentationReferences(array $documentationReferences)
{
$this->documentationReferences = $documentationReferences;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setReferences($val)\n {\n $this->_propDict[\"references\"] = $val;\n return $this;\n }",
"public function setRef($ref)\n {\n $this->_ref = $ref;\n }",
"public function setRef($ref);",
"public function setRefToSomething($refToSomething)\r\n {\r\n $this->refToSomething = $refToSomething;\r\n }",
"public function setDocumentReference(array $documentReference)\n {\n $this->documentReference = $documentReference;\n return $this;\n }",
"function setRefFields($val) {\n $this->_refFields = $val;\n }",
"public function setReference(string $reference):void\n {\n $this->reference = $reference;\n }",
"public function testSetDocumentLinks()\n {\n $this->document->setDocumentLinks([\n Link::SELF => new Link($selfUrl = 'selfUrl'),\n Link::FIRST => new Link($firstUrl = 'firstUrl'),\n Link::LAST => new Link($lastUrl = 'lastUrl'),\n Link::PREV => new Link($prevUrl = 'prevUrl'),\n Link::NEXT => new Link($nextUrl = 'nextUrl'),\n ]);\n\n $expected = <<<EOL\n {\n \"links\" : {\n \"self\" : \"selfUrl\",\n \"first\" : \"firstUrl\",\n \"last\" : \"lastUrl\",\n \"prev\" : \"prevUrl\",\n \"next\" : \"nextUrl\"\n },\n \"data\" : null\n }\nEOL;\n $this->check($expected);\n }",
"public function setReference( &$ref ) {\n\t\t$this->items = $ref;\n\t\treturn $this;\n\t}",
"public function setDocumentation($documentation)\n {\n return $this->addMeta(self::META_DOCUMENTATION, is_array($documentation) ? $documentation : array($documentation));\n }",
"public function setReference($reference) {\n $this->reference = $reference;\n }",
"public function setDescriptionRef($descriptionRef)\n {\n $this->descriptionRef = $descriptionRef;\n }",
"public function setDocuments($documents) {\n $this->_documents = $documents;\n }",
"public function set_reference ($reference) {\n $this->reference = $reference;\n }",
"public function set_questionReferences (array $questionReferences) {\n $this->questionReferences = $questionReferences;\n }",
"public function setReferenceTo(array $referenceTo)\n {\n $this->referenceTo = $referenceTo;\n return $this;\n }",
"public function setReference (Reference $reference){\n $this->references->add($reference);\n }",
"public function setReference($reference = true)\n {\n $this->reference = $reference;\n }",
"public function setExternalDocs(array $externalDocs): void\n {\n $this->externalDocs = $externalDocs;\n }",
"public function setCustomerReferences(?array $customerReferences): self\n {\n $this->initialized['customerReferences'] = true;\n $this->customerReferences = $customerReferences;\n\n return $this;\n }",
"function setReference($reference) {\n $this->checkChange();\n\n $this->reference = $reference;\n return $this;\n }",
"public function setRef1($ref1) {\n $this->_ref1 = $ref1;\n }",
"private function ref($text_reference)\n {\n $this->ref = $text_reference;\n\n return $this;\n }",
"public function setReferenceMap(array $referenceMap)\n {\n $this->_referenceMap = $referenceMap;\n\n return $this;\n }",
"public function setClasspathref(Reference $reference)\n\t{\n\t\t$this->createClasspath()->setRefid($reference);\n\t}",
"public function setRefPoint(array $refPoint)\n {\n $this->refPoint = $refPoint;\n return $this;\n }",
"public function setReferenceDependencies(array &$definitions) {\n if (empty($this->collectedReferences)) {\n return;\n }\n\n $collectedSubDependencies = [];\n\n foreach ($definitions as $definitionId => $definition) {\n if (!isset($this->collectedReferences[$definitionId])) {\n continue;\n }\n\n $references = $this->collectedReferences[$definitionId];\n\n foreach ($references as $element => $target) {\n $subDependencies = [];\n\n foreach ($target as $reference) {\n $subDefinition = $this->buildMigrationDefinition(\n [\n 'projectId' => $reference['base_data']['projectId'],\n 'templateId' => $reference['base_data']['templateId'],\n 'entityType' => $reference['base_data']['entityType'],\n 'contentType' => $reference['base_data']['contentType'],\n ],\n $reference['data'],\n 'entity_reference_revisions'\n );\n\n $subDependencies[$subDefinition['id']] = $subDefinition;\n\n $key = implode('_', [\n $reference['base_data']['projectId'],\n $reference['base_data']['templateId'],\n $reference['base_data']['entityType'],\n $reference['base_data']['contentType'],\n ]);\n $collectedSubDependencies[$key][$subDefinition['id']] = $subDefinition;\n }\n $this->setReferenceDependencies($subDependencies);\n\n $collected = [];\n\n foreach ($subDependencies as $subDefinitionId => $subDefinition) {\n $this->migrationDefinitionIds[] = $subDefinitionId;\n\n $definitions[$definitionId]['migration_dependencies']['optional'][] = $subDefinitionId;\n $definitions[$definitionId]['process']['collect_' . $subDefinitionId] = [\n 'plugin' => 'migration_lookup',\n 'migration' => $subDefinitionId,\n 'source' => 'id',\n ];\n\n $collected[] = '@collect_' . $subDefinitionId;\n }\n\n if (!empty($collected)) {\n $definitions[$definitionId]['process']['get_collected_' . $element] = [\n 'plugin' => 'get',\n 'source' => $collected,\n ];\n\n $definitions[$definitionId]['process'][$element] = [\n [\n 'plugin' => 'gather_content_reference_revision',\n 'source' => '@get_collected_' . $element,\n ],\n [\n 'plugin' => 'sub_process',\n 'process' => [\n 'target_id' => [\n 'plugin' => 'extract',\n 'source' => 'id',\n 'index' => [0],\n ],\n 'target_revision_id' => [\n 'plugin' => 'extract',\n 'source' => 'id',\n 'index' => [1],\n ],\n ],\n ],\n ];\n }\n }\n }\n\n foreach ($collectedSubDependencies as $dependencies) {\n $this->setLanguageDefinitions($dependencies);\n\n foreach ($dependencies as $subDefinitionId => $subDefinition) {\n $migration = Migration::create($subDefinition);\n $migration->save();\n }\n }\n }",
"public function setCacheReferencedObjects($cacheReferencedObjects) {}",
"function setLinks($link) \n {\n $this->links = $link;\n }",
"public function & setDataRef( & $a_data )\n\t{\n\t\t$this->m_data->setDataRef($a_data);\n\t\treturn $this;\n\t}"
]
| [
"0.60777646",
"0.59781533",
"0.59345883",
"0.5765877",
"0.5711518",
"0.56681365",
"0.5649106",
"0.56406116",
"0.562447",
"0.55771124",
"0.5539284",
"0.5488165",
"0.54749453",
"0.54406023",
"0.54236084",
"0.5403669",
"0.53893644",
"0.5374419",
"0.53537196",
"0.53110594",
"0.52596366",
"0.5211485",
"0.51461196",
"0.5100971",
"0.50634736",
"0.50346965",
"0.5020538",
"0.49965015",
"0.49907976",
"0.4975921"
]
| 0.7100294 | 0 |
function to check borrower status | function check_borrower_status($obj, $borrower){
$result = $obj->db->query($obj->Query_reader->get_query_by_code('check_borrower', array('borrower' => $borrower)));
if($result->num_rows() > 0)
return $result->num_rows();
else
return 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function check_biller_status() {\n\t\t$user_id = $_REQUEST['user_id'];\n\t\tif (!empty($user_id)) {\n\t\t\t$biller_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\tif (!empty($biller_records)) {\n\t\t\t\t$biller_status = $biller_records[0]['biller_status'];\n\t\t\t\t$user_id = $biller_records[0]['user_id'];\n\t\t\t\t$biller_id = $biller_records[0]['biller_id'];\n\t\t\t\t$post = array('status' => \"true\", \"biller_status\" => $biller_status, 'user_id' => $user_id, 'biller_id' => $biller_id);\n\t\t\t} else {\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Invalid user id\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Missing parameter\", 'user_id' => $user_id);\n\t\t}\n\t\techo $this -> json($post);\n\t}",
"public function checkStatus()\n {\n echo 'All Branch of Bank is Opened at 9:30 AM<br>';\n }",
"public abstract function hasWaitingLobby(): bool;",
"function checkIfValid(Customer $customer , $books){\n return $customer->getAmountToBorrow() >= count($books);\n }",
"function getIsAvailable() ;",
"public function isInHoldingStatus()\n\t\t{\n\t\t\t$disallowed_statuses = array();\n\n\t\t\t$asf = ECash::getFactory()->getReferenceList('ApplicationStatusFlat');\n\n\t\t\t$disallowed_statuses[] = $asf->toId('hold::arrangements::collections::customer::*root');\n\t\t\t$disallowed_statuses[] = $asf->toId('unverified::bankruptcy::collections::customer::*root');\n\t\t\t$disallowed_statuses[] = $asf->toId('verified::bankruptcy::collections::customer::*root');\n\t\t\t$disallowed_statuses[] = $asf->toId('amortization::bankruptcy::collections::customer::*root');\n\t\t\t$disallowed_statuses[] = $asf->toId('skip_trace::collections::customer::*root');\n\n\t\t\t$db = ECash_Config::getMasterDbConnection();\n\n\t\t\t$query = \"\n\t\t\t\tSELECT application_status_id, is_watched\n\t\t\t\tFROM application\n\t\t\t\tWHERE application_id = ?\";\n\n\t\t\t$st = DB_Util_1::queryPrepared($this->db, $query, array($this->application_id));\n\t\t\t$row = $st->fetch(PDO::FETCH_OBJ);\n\n\t\t\treturn ((\n\t\t\t\tin_array($row->application_status_id, $disallowed_statuses))\n\t\t\t\t|| $row->is_watched == 'yes');\n\t\t}",
"public function checkLock() {\n\t\t$this->autoRender = false;\n\t\t\n\t\t$HttpSocket = new HttpSocket();\n\t\t$results = $HttpSocket->get('https://api.dropbox.com/1/search/auto/',\n\t\t\tarray(\n\t\t\t\t'query' => 'SystemIsLocked',\n\t\t\t\t'access_token' => 'YOUR_ACCESS_TOKEN'\n\t\t\t)\n\t\t);\n\t\t\n\t\tif(empty(json_decode($results->body))) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"private function is_locked(){\n\t\t//return $batch_txt_file_object->exists();\n\t\treturn \"no\";\n\t\t\n\t}",
"function is_in_holding_status($parameters) \n\t{\n\t\t$application_id = $parameters->application_id;\n\n\t\t// If the account is in 2nd Tier\n\t\tif($this->acct_in_second_tier($parameters))\n\t\t\treturn 2;\n\n\t\t// Watch Checks -- Go to 24 if true\n\t\tif($this->is_watched($parameters))\n\t\t\treturn 3;\n\t\t\t\n\t\t// If the account is in Bankruptcy, Watch, Arrangements Hold, Ammortization\n\t\tif(In_Holding_Status($application_id)) \n\t\t{\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn 0;\n\t}",
"function checkBookings() {\n\t\t// Load Transitions Pool\n\t\t$this->initTransitions();\n\t\t\n\t\t$sim = false;\n\t\twhile(!$sim) {\n\t\t\t$ts = clone $this->transitions;\n\t\t\t$ts->reverse();\n\t\t\t\n\t\t\t// New Simulation\n\t\t\t$rs = new ReservationSimulator();\n\t\t\twhile($_res = $ts->pop())\n\t\t\t\t$rs->addTransition($_res);\n\t\t\t$sim = $rs->simulate();\n\t\t\t\n\t\t\t// pop the last transition on failure recheck bookings\n\t\t\tif(!$sim) $this->dismissedTrans->push($this->transitions->pop());\n\t\t}\n\t\t\n\t\treturn $this->finish();\n\t\t\n\n\t\twhile($o = $this->dismissedTrans->pop())\n\t\t\t_debug($o->getId());\n\t\t\t\n\t}",
"function checkBan(){\r\n\r\n\t#obtain codeigniter object.\r\n\t$ci =& get_instance();\r\n\r\n\t#see if user is suspended.\r\n\tif($ci->suspend_length > 0){\r\n\t\t#see if user is still suspended.\r\n\t\t$math = 3600 * $ci->suspend_length;\r\n\t\t$suspend_date = $ci->suspend_time + $math;\r\n\t\t$today = time() - $math;\r\n\r\n\t\tif($suspend_date > $today){\r\n\t\t\texit(show_error($ci->lang->line('suspended')));\r\n\t\t}\r\n\t}\r\n\t#see if the IP of the user is banned.\r\n\t$uip = detectProxy();\r\n\r\n\t$ci->db->distinct('ban_item')->from('ebb_banlist')->where('ban_type', 'IP')->like('ban_item', $uip)->limit(1);\r\n\t$banChk = $ci->db->count_all_results();\r\n\r\n\t#output an error msg.\r\n\tif($banChk == 1){\r\n\t\texit(show_error($ci->lang->line('banned')));\r\n\t}\r\n}",
"public function getLockStatus() {}",
"public function isOwnerBooking()\n {\n return ($this->getStatus() == 'O');\n }",
"function isAvailable() ;",
"function isAvailable() ;",
"public function check();",
"public function check();",
"public function check();",
"public function check();",
"public function check();",
"public function IsBookable()\n\t{\treturn $this->details['tqty'] > $this->details['tbooked'];\n\t}",
"public static function something_useful_happened() {\n\n\t\tglobal $updraftplus;\n\t\n\t\tself::record_still_alive();\n\n\t\tif (!$updraftplus->something_useful_happened) {\n\t\t\n\t\t\t// Update the record of when something useful happened\n\t\t\t$useful_checkins = $updraftplus->jobdata_get('useful_checkins');\n\t\t\tif (!is_array($useful_checkins)) $useful_checkins = array();\n\t\t\tif (!in_array($updraftplus->current_resumption, $useful_checkins)) {\n\t\t\t\t$useful_checkins[] = $updraftplus->current_resumption;\n\t\t\t\t$updraftplus->jobdata_set('useful_checkins', $useful_checkins);\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t$updraftplus->something_useful_happened = true;\n\n\t\t$clone_job = $updraftplus->jobdata_get('clone_job');\n\n\t\tif (!empty($clone_job)) {\n\t\t\tstatic $last_call = false;\n\n\t\t\t// Check we haven't yet made a call or that 15 minutes has passed before we make another call\n\t\t\tif (!$last_call || time() - $last_call > 900) {\n\t\t\t\t$last_call = time();\n\t\t\t\t$clone_id = $updraftplus->jobdata_get('clone_id');\n\t\t\t\t$secret_token = $updraftplus->jobdata_get('secret_token');\n\t\t\t\t$log_data = $updraftplus->get_last_log_chunk($updraftplus->file_nonce);\n\t\t\t\t$log_contents = isset($log_data['log_contents']) ? $log_data['log_contents'] : '';\n\t\t\t\t$first_byte = isset($log_data['first_byte']) ? $log_data['first_byte'] : 0;\n\t\t\t\t$response = $updraftplus->get_updraftplus_clone()->backup_checkin(array('clone_id' => $clone_id, 'secret_token' => $secret_token, 'first_byte' => $first_byte, 'log_contents' => $log_contents));\n\t\t\t\tif (!isset($response['status']) || 'success' != $response['status']) {\n\t\t\t\t\t$updraftplus->log(\"UpdraftClone backup check-in failed.\");\n\t\t\t\t} else {\n\t\t\t\t\t$updraftplus->log(\"UpdraftClone backup check-in made successfully.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$updraft_dir = $updraftplus->backups_dir_location();\n\t\tif (file_exists($updraft_dir.'/deleteflag-'.$updraftplus->nonce.'.txt')) {\n\t\t\t$updraftplus->log(\"User request for abort: backup job will be immediately halted\");\n\t\t\t@unlink($updraft_dir.'/deleteflag-'.$updraftplus->nonce.'.txt');// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged\n\t\t\t$updraftplus->backup_finish(true, true, true);\n\t\t\tdie;\n\t\t}\n\t\t\n\t\tif ($updraftplus->current_resumption >= 9 && false == $updraftplus->newresumption_scheduled) {\n\t\t\t$updraftplus->log(\"This is resumption \".$updraftplus->current_resumption.\", but meaningful activity is still taking place; so a new one will be scheduled\");\n\t\t\t// We just use max here to make sure we get a number at all\n\t\t\t$resume_interval = max($updraftplus->jobdata_get('resume_interval'), 75);\n\t\t\t// Don't consult the minimum here\n\t\t\t// if (!is_numeric($resume_interval) || $resume_interval<300) { $resume_interval = 300; }\n\t\t\t$schedule_for = time()+$resume_interval;\n\t\t\t$updraftplus->newresumption_scheduled = $schedule_for;\n\t\t\twp_schedule_single_event($schedule_for, 'updraft_backup_resume', array($updraftplus->current_resumption + 1, $updraftplus->nonce));\n\t\t} else {\n\t\t\tself::reschedule_if_needed();\n\t\t}\n\t}",
"public function inactiveCheck()\n\t\t{\n\t\t\t$schedule = $this->getSchedule();\n\t\t\tif ($schedule->getAnalyzer()->getBalance() <= 0)\n\t\t\t{\n\t\t\t\t$as = $_SESSION['current_app']; // App Status can be grabbed from here\n\n\t\t\t\tif ($as->level1 == 'external_collections')\n\t\t\t\t{\n\t\t\t\t\tUpdate_Status(NULL, $this->getId(), array(\"recovered\",\"external_collections\",\"*root\"));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tUpdate_Status(NULL, $this->getId(), array(\"paid\",\"customer\",\"*root\"));\n\t\t\t\t}\n\n\t\t\t\t$this->Affiliations->expireAll();\n\t\t\t\t$schedule->removeScheduledTransactions();\n\t\t\t\t$schedule->save();\n\n\t\t\t\t$queue_manager = ECash::getFactory()->getQueueManager();\n\t\t\t\t$queue_item = new ECash_Queues_BasicQueueItem($this->getId());\n\t\t\t\t$queue_manager->getQueueGroup('automated')->remove($queue_item);\n\n\t\t\t\treturn TRUE;\n\t\t\t}\n\n\t\t\treturn FALSE;\n\n\t\t}",
"function checkQM() {\n try {\n $results = $db->query(\"SELECT * FROM borrower_tbl WHERE id='\" . $borrowerId . \"';\" );\n } catch (Exception $e) {\n echo \"Could not connect to database!: \" . $e->getMessage();\n exit;\n }\n $borrower = $results->fetchAll(PDO::FETCH_ASSOC);\n \n \n \n \n }",
"function eth_check_burn($addr, $txid) {\n\n\treturn -1;\n}",
"function check_ban ($database, $mpre, $spre, $email, $ip, $type)\n{\n\t// Expire old bans fist\n\t$time = time();\n\t$qry = \"SELECT id FROM {$spre}banlist WHERE expire<'$time' AND expire!='0' AND active='1'\";\n $result = $database->openConnectionWithReturn($qry);\n while (list($bid) = mysql_fetch_array($result))\n {\n \t$qry2 = \"UPDATE {$spre}banlist SET active='0' WHERE id='$bid' OR alias='$bid'\";\n \t$database->openConnectionNoReturn($qry2);\n\t}\n\n\t$qry = \"SELECT date, auth, reason, alias, level\n \t\tFROM {$spre}banlist\n WHERE ( (email='$email' AND email!='') OR (ip='$ip' AND ip!='') )\n \tAND active='1'\";\n $result = $database->openConnectionWithReturn($qry);\n\n if (!mysql_num_rows($result))\n {\n\t // Check wildcard IPs\n\t $qry2 = \"SELECT ip FROM {$spre}banlist WHERE ip LIKE '%*%' AND active='1'\";\n\t $result2 = $database->openConnectionWithReturn($qry2);\n\t list($banip) = mysql_fetch_array($result2);\n while ($banip && !$wildcard)\n\t {\n\t $wildcard = check_wild_IP($ip, $banip);\n\t if ($wildcard)\n {\n\t $qry = \"SELECT date, auth, reason, alias, level\n\t FROM {$spre}banlist WHERE ip='$banip'\";\n\t $result = $database->openConnectionWithReturn($qry);\n }\n list($banip) = mysql_fetch_array($result2);\n\t }\n }\n\n // If a result was returned, then this person's banned!\n if (mysql_num_rows($result))\n {\n \tlist ($date, $auth, $reason, $alias, $level) = mysql_fetch_array($result);\n\n // {$alias != \"0\"} indicates that the matched ban actually\n // links to a different ban (ie, multiple email/IPs)\n if ($alias != \"0\")\n {\n $qry = \"SELECT date, auth, reason FROM {$spre}banlist WHERE id='$alias'\";\n $result = $database->openConnectionWithReturn($qry);\n list ($date, $auth, $reason) = mysql_fetch_array($result);\n }\n\n\t\t// If it's a command ban, then we need to make sure it's a command app\n if ( ($level == \"command\" && ($type == \"ship\" || $type == \"command\")) ||\n\t\t\t $level != \"command\")\n {\n \t $reason = date(\"F j, Y\", $date) . \"<br /><br />\" . $reason . \"\\n\";\n\t\t\t$reason = \"Authorized by: \" . $auth . \"<br /><br />\" . $reason . \"\\n\";\n\t return $reason;\t\t\t// Returns positive\n }\n }\n // No results - person's not banned\n return;\n}",
"public function getIsAvailable() {}",
"function getStatus() ;",
"function getStatus() ;",
"function getStatus() ;"
]
| [
"0.621047",
"0.59746146",
"0.57220125",
"0.5715727",
"0.5707241",
"0.5673731",
"0.56693923",
"0.5648313",
"0.5646482",
"0.564052",
"0.56299525",
"0.56277144",
"0.5607676",
"0.5595498",
"0.5595498",
"0.5592767",
"0.5592767",
"0.5592767",
"0.5592767",
"0.5592767",
"0.5581883",
"0.5576052",
"0.55649126",
"0.55445623",
"0.5529892",
"0.5525461",
"0.551822",
"0.5505533",
"0.5505533",
"0.55054307"
]
| 0.782596 | 0 |
Makes FALSE values empty strings in the URL data obtained | function clean_url_data($urldata)
{
$new_urldata = array();
foreach($urldata AS $key=>$value)
{
if($value === FALSE || trim($value) == '')
{
$new_urldata[$key] = '';
}
else
{
$new_urldata[$key] = $value;
}
}
return $new_urldata;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _fix_data() {\n\t\tif (isset($this->url) && $this->url) $this->_parse_url($this->url);\n\n\t\treturn true;\n\t}",
"function dataConsideredEmpty($data, $repeatCounter)\r\n\t{\r\n\t\t$data = strip_tags($data);\r\n\t\tif (trim($data) == '' || $data == '<a target=\"_self\" href=\"\"></a>') {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function stripget($check_url) {\n \t$return = false;\n \tif (is_array($check_url)) {\n \t\tforeach ($check_url as $value) {\n \t\t\tif ($this->stripget($value) == true) {\n \t\t\t\treturn true;\n \t\t\t}\n \t\t}\n \t} else {\n \t\t$check_url = str_replace(array(\"\\\"\", \"\\'\"), array(\"\", \"\"), urldecode($check_url));\n \t\tif (preg_match(\"/<[^<>]+>/i\", $check_url)) {\n \t\t\treturn true;\n \t\t}\n \t}\n \treturn $return;\n }",
"function check_url($url){\n\n $data = file_get_contents($url);\n\n if (empty($data)) {\n return \"false\";\n } else {\n return \"true\";\n }\n\n\n \n}",
"function fixRedirectorUnparsedEquals($buffer)\n{\n return preg_replace('#\\[url-disabled].*\\[/url-disabled]#U', '', $buffer);\n}",
"function valid_get($data) {\n\t\t\t$data = trim($data); //trim - функция удаляет пробелы до и после слова но в самом слове пробелы не удаляет\n\t\t\t$data = stripslashes($data); //stripslashes — Удаляет экранирование символов\n\t\t\t$data = strip_tags($data); //strip_tags — Удаляет теги HTML и PHP из строки\n\t\t\t$data = htmlspecialchars($data); //htmlspecialchars — Преобразует специальные символы в HTML-сущности\n\t\t\treturn $data;\n\t }",
"public function getNonEmptyData($data){\n if(empty($data)){\n \t$validData= FALSE;\n }\n\t\telse {\n\t\t\t$validData = $this->sanitizeString($data);\n\t\t}\n \treturn $validData;\n }",
"public function sanitizeLocalUrlInvalidDataProvider() {}",
"function checkurl($url){\n if(!filter_var($url, FILTER_VALIDATE_URL)){\n return \" \";\n }\n else{\n return $url;\n }\n }",
"public function getPublicUrlReturnsValidUrlContainingSpecialCharacters_dataProvider() {}",
"public function testParse_request_url__null() {\n\t$result = $this->object->parse_request_url(null);\n $this->assertTrue($result==array(),\n\t '$result did not match:'.print_r($result,1)\n\t);\n }",
"function ghostpool_validate_url() {\n\t\tglobal $post;\n\t\t$gp_page_url = esc_url( home_url() );\n\t\t$gp_urlget = strpos( $gp_page_url, '?' );\n\t\tif ( $gp_urlget === false ) {\n\t\t\t$gp_concate = \"?\";\n\t\t} else {\n\t\t\t$gp_concate = \"&\";\n\t\t}\n\t\treturn $gp_page_url . $gp_concate;\n\t}",
"protected function cleanUrlsEnabled()\n {\n return $this->cleanUrlsEnabled;\n }",
"public function validateRedirectUrlKeepsCleanUrlDataProvider() {}",
"public function sanitizeLocalUrlValidUrlsDataProvider() {}",
"function trimData($data) {\n $data = trim($data);\n $data = urlencode($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}",
"public function is_true_body_empty()\n {\n return $this->get_true_body() === '' || $this->get_true_body() === null;\n }",
"public function contentNotGiven()\n {\n return empty($this->content);\n }",
"protected function __getPostRemoveEmpty(){\r\n if($this->request->isPost()){\r\n foreach($this->request->getPost() as $key => $value){\r\n if(empty($value) || is_null($value)){\r\n unset($_POST[$key]);\r\n }\r\n }\r\n }\r\n else{\r\n foreach($this->request->getQuery() as $key => $value){\r\n if(empty($value) || is_null($value)){\r\n unset($_GET[$key]);\r\n }\r\n }\r\n }\r\n }",
"function __return_empty_string()\n {\n }",
"public function nonEmpty();",
"function urlOk ($url) {\r\n return filter_var($url, FILTER_VALIDATE_URL);\r\n }",
"function filter_any_data($data){\n\t\t\t$data = trim($data);\n\t\t\t$data = stripslashes($data);\n\t\t\t$data = htmlspecialchars($data);\n\t\t\treturn $data;\n\t\t}",
"private function checkDataInURL() {\n $html = @file_get_contents($this->url);\n if ($html === FALSE) throw new Exception('Unable to get html from URL.');\n return strpos($html, $this->data) !== FALSE;\n }",
"public function hasUrl()\n {\n return ! empty($this->url);\n }",
"private function cleanParams(){\n $brokenUrl = explode(\"&\", iWeb::currentUrl());\n unset($brokenUrl[0]);\n $brokenUrl = array_values($brokenUrl);\n foreach ($brokenUrl as $param){\n $paramaters = explode(\"=\",$param);\n $this->params[$paramaters[0]] = $paramaters[1];\n }\n\n }",
"function dataConsideredEmpty($data, $repeatCounter)\n\t{\n\t\t$data = str_replace(null,'',$data);\n\t\tif (strstr($data, ',')) {\n\t\t\t$data = explode(',', $data);\n\t\t}\n\t\t$data = (array) $data;\n\t\tforeach ($data as $d) {\n\t\t\tif (trim($d) == '') {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"function urlDeclined()\r\n\t{\r\n\t\t$input_def['id'] = 'urlDeclined';\r\n\t\t$input_def['name'] = 'urlDeclined';\r\n\t\t$input_def['type'] = 'text';\r\n\t\t$inputValue = '';\r\n\t\tif(isset($_POST[$input_def['name']]) && (wpklikandpay_option::getStoreConfigOption('wpklikandpay_store_urloption', $input_def['name']) == ''))\r\n\t\t{\r\n\t\t\t$inputValue = wpklikandpay_tools::varSanitizer($_POST[$input_def['name']], '');\r\n\t\t}\r\n\t\telseif(wpklikandpay_option::getStoreConfigOption('wpklikandpay_store_urloption', $input_def['name']) != '')\r\n\t\t{\r\n\t\t\t$inputValue = wpklikandpay_option::getStoreConfigOption('wpklikandpay_store_urloption', $input_def['name']);\r\n\t\t}\r\n\t\t$input_def['value'] = $inputValue;\r\n\r\n\t\techo wpklikandpay_form::check_input_type($input_def);\r\n\t}",
"function cleanVal ($val)\n{\n return encodeURI($val);\n}",
"public function globalStringConditionMatchesOnEmptyExpressionWithValueSetToEmptyString() {}"
]
| [
"0.68044204",
"0.6325207",
"0.6318152",
"0.61596113",
"0.5991571",
"0.58718026",
"0.5775476",
"0.56922245",
"0.56870526",
"0.5641665",
"0.5632168",
"0.5623872",
"0.562056",
"0.5561195",
"0.5559709",
"0.54964054",
"0.54666173",
"0.54619265",
"0.54614204",
"0.5452605",
"0.5443107",
"0.54311675",
"0.54239136",
"0.5401524",
"0.5397244",
"0.5383476",
"0.538055",
"0.5353776",
"0.535323",
"0.53422326"
]
| 0.7385187 | 0 |
Returns a number with two decimal places and a comma after three places | function add_commas($number, $number_of_decimals)
{
# Default to zero if the number is not set
if(!isset($number) || $number == "" || $number <= 0)
{
$number = "0";
}
return number_format($number, $number_of_decimals, '.', ',');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Cantidades_cd($valor){\t\n\n return number_format($valor,3,',','.');\n\n}",
"function Cantidades_sd($valor){\t\n\n return number_format($valor,0,',','.');\n\n}",
"public function FMoney($v) { return number_format($v,2,',','.'); }",
"function Formato1($val){\r\n return number_format($val,0,\",\",\".\");\r\n }",
"function add_commas($number)\n{\n $parts = explode('.', $number);\n $parts[0] = number_format($number);\n $number = implode('.', $parts);\n return $number;\n}",
"function Valores_cd($valor){\t\n\n return '$ '.number_format($valor,4,',','.');\n\n}",
"function formatAmountSimply($v,$t=1){\n return number_format($v,2,'.',',');\n}",
"function dinheiroParaBr($valor) {\n \t$valor = number_format($valor, 2, ',', '.');\n \treturn $valor;\n}",
"function display_money_format($money)\n\t{\n\t\t$money_r = $this->money_split($money);\n\t\t$money_r = number_format($money_r, 2, ',', '.');\n\t\treturn $money_r; // output : 5.000,00\n\t}",
"function FormataValor4($valor) {\r\n if ($valor != \"\" && !is_null($valor)) {\r\n return number_format($valor, 4, ',', '.');\r\n } else {\r\n return \"\";\r\n }\r\n}",
"function Valores_sd($valor){\t\n\n return '$ '.number_format($valor,0,',','.');\n\n}",
"function number_format( $price, $decimals = 2 ) {\n return number_format_i18n( floatval($price), $decimals );\n }",
"public function peso_cesta_formato(){\r\n\t\t\t$p = $this->peso_cesta();\r\n\t\t\treturn number_format($p,2,\",\",\".\");\r\n\t\t}",
"function convertToDollar($localAmount, $rate){\n return round ($localAmount/$rate, 3);\n //return number_format(round ($localAmount/$rate, 3), 3, \".\", \",\");\n\n}",
"function carton_format_decimal( $number, $dp = '' ) {\n\tif ( $dp == '' )\n\t\t$dp = intval( get_option( 'carton_price_num_decimals' ) );\n\n\t$number = number_format( (float) $number, (int) $dp, '.', '' );\n\n\tif ( strstr( $number, '.' ) )\n\t\t$number = rtrim( rtrim( $number, '0' ), '.' );\n\n\treturn $number;\n}",
"function value()\r\n {\r\n return number_format( $this->Value, 4, \".\", \"\" );\r\n }",
"function formatPrice($vlprice)\n{\n\tif(!$vlprice>0) $vlprice = 0;//trantando nao tem nada no carrinho, o valor do frete vem NULL e assim daria erro\n\treturn number_format($vlprice, 2, \",\", \".\");\n}",
"function formatMontantCompta($valeur)\n {\n \t$prix_ok = number_format($valeur,2, ',', ' ');\n\n\t\treturn $prix_ok;\n\n }",
"function smarty_modifier_commify($string, $decimals=-1, $dec_point='.', $thousands_sep=',')\n{\n\tif ($decimals == -1) {\n\t\tif (preg_match('/(.*)\\.(\\d+.*)/', $string, $matches)) \n\t\t\treturn number_format($matches[1], 0, $dec_point, $thousands_sep) . $dec_point . $matches[2];\n\t\telse \n\t\t\treturn number_format($string);\n\t}\n\telse \n\t\treturn number_format($string, $decimals, $dec_point, $thousands_sep);\n}",
"function convertNum($x){\n\treturn number_format($x, 2, '.', ',');\n}",
"function convertNum($x){\n\treturn number_format($x, 2, '.', ',');\n}",
"function rupiah($n) {\n\t\treturn number_format($n,2,',','.');\n\t}",
"function format_price($price)\n{\n $price = number_format(ceil($price), 0, \".\", \" \");\n return $price . \" \" . \"₽\";\n}",
"private function formatNumber($number)\n {\n return number_format($number, 0, ',', '.');\n }",
"function formatTotal($input,$decimal=2){\n return number_format($input,1,'.','');\n }",
"static function currency_format($value) {\n $value = number_format($value, 2, ',', '.');\n $value = str_replace(',00', '', $value);\n return $value;\n }",
"function money($price,$decimals = 2)\n {\n return number_format($price,$decimals);\n }",
"function carton_format_total( $number ) {\n\treturn number_format( (float) $number, (int) get_option( 'carton_price_num_decimals' ), '.', '' );\n}",
"function currency_format($amount) {\n\t$amount_ok = number_format($amount,2,',','.');\n\treturn $amount_ok;\n}",
"function smarty_modifier_number_format($string, $places=2, $dec=\",\", $thoussep=\" \")\n{\n if (!$string) return $string;\n return number_format($string, $places, $dec, $thoussep);\n}"
]
| [
"0.8092363",
"0.75498044",
"0.7505238",
"0.72125727",
"0.7188758",
"0.71110827",
"0.7068377",
"0.70139813",
"0.7008954",
"0.69865936",
"0.69687134",
"0.6960053",
"0.69575465",
"0.68705034",
"0.67891777",
"0.67727226",
"0.6743098",
"0.6682155",
"0.66817796",
"0.6625571",
"0.6625571",
"0.661387",
"0.66079354",
"0.6606285",
"0.66059864",
"0.6604486",
"0.659787",
"0.65882546",
"0.6586671",
"0.65671617"
]
| 0.75785184 | 1 |
Function to pick all continents | function get_all_continents($obj = '')
{
$continent_result = $obj->db->query($obj->Query_reader->get_query_by_code('get_continents_list', array()));
return $continent_result->result_array();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getContinents() {\n $db = database::getDB();\n $query = \"SELECT DISTINCT continent FROM countries ORDER BY id\";\n $data = $db->query($query);\n return $data;\n }",
"public function getContestants() {\n if (property_exists($this, 'is_new') && $this->is_new) return array();\n\n foreach ($this->getTournaments() as $tourney) {\n $this->contestants = array_merge($this->contestants, $tourney->getContestants());\n }\n\n return $this->contestants;\n }",
"public function selectAllConstellationID()\n {\n $selectSQL = \"select distinct(ic_id) from nrd\";\n $result = $this->sdb->query($selectSQL, array());\n $all = array();\n while ($row = $this->sdb->fetchrow($result)) {\n array_push($all, $row['ic_id']);\n }\n return $all;\n }",
"public function getAllContatti() {\r\n $res = Model::getDB()->query(self::$GET_ALL_CONTATTI);\r\n $contatti = array();\r\n if($res){\r\n while ($obj = $res->fetch_assoc()) {\r\n $contatto = new Contatto($obj['valore'], $obj['tipologia'], $obj['utente_matricola']);\r\n $contatto->setId($obj['id']);\r\n $contatti[] = $contatto;\r\n }\r\n }\r\n return $contatti;\r\n }",
"public function getContestsByGame($game);",
"private function getProjectCandidates($contract) {\n $candidates = array();\n $team = TeamCache::getInstance()->getTeam($contract->getTeamid());\n\n $projList = $team->getProjects();\n $currentProjects = $contract->getProjects();\n\n foreach ($projList as $projectid => $name) {\n if (($team->isSideTasksProject($projectid)) &&\n (!array_key_exists($projectid, $currentProjects))) {\n $candidates[$projectid] = $name;\n }\n }\n return $candidates;\n }",
"public function selectAll();",
"public function getCc(): iterable;",
"protected function _createSubset() {}",
"protected function _prepareSubset() {}",
"public function getAllConstituents(){\n $stmt = $this->con->prepare(\"SELECT * FROM constituency ORDER BY constituency ASC\");\n $stmt->execute();\n $constituents = $stmt->get_result();\n $stmt->close();\n return $constituents;\n }",
"public function getCandidates()\n {\n foreach ($this->cand_ids as $id) {\n // Use a generator to save on memory/resources\n // load accounts from DB one at a time only when required\n yield (new CandidateModel())->load($id);\n }\n }",
"public function allConductores(){\n global $baseDatos;\n $listaConductores = array();\n if ($this->existeConductor()){\n $sql = \"SELECT * FROM `conductores`\";\n $resultado = $baseDatos->query($sql);\n $conductores = $resultado->fetch_all(MYSQLI_ASSOC);\n foreach ($conductores as $con){\n $conductor = new Conductor();\n $conductor->constructorConductor($con);\n $listaConductores[] = $conductor;\n }\n return $listaConductores;\n }else{\n return null;\n }\n }",
"public static function selectAll()\n {\n $retourne = parent::selectAll();\n return $retourne;\n }",
"function get_all_countries($obj, $continent='')\n{\n\t$country_result = $obj->db->query($obj->Query_reader->get_query_by_code('get_countries_list', array('continent'=>$continent)));\n\t\n\treturn $country_result->result_array();\n}",
"function return_clients($tri, $sens, $selection, $all = false)\n{\n $tab = getClients($tri, $sens, string2Tab($selection), $all);\n return $tab;\n}",
"public function ciutats() {\n $sql =\"SELECT DISTINCT ciutat FROM hotels ORDER BY ciutat ASC\";\n $query=$this->db->prepare($sql);\n $query->execute();\n $res=$query->fetchAll();\n \n return $res;\n }",
"public function intersect(): self;",
"public function findAll()\n {\n $pdo = Database::getPDO();\n \n $sql = ' \n SELECT * FROM `continent`;\n ';\n\n $pdoStatement = $pdo->query($sql);\n \n $continentList = $pdoStatement->fetchAll(PDO::FETCH_CLASS, static::class);\n \n return $continentList;\n }",
"public function getAllContatti($num_voci = null, $start = null) {\n\t\t$this->db->order_by('data_e_ora', 'ASC');\n\t\t$query = $this->db->get($this->tabella_contatti, $num_voci, $start);\n\t\t\n\t\tif( $query->num_rows() > 0 ) {\n\t\t\treturn $query->result();\n\t\t} else {\n\t\t\treturn NULL;\n\t\t}\n\t}",
"public function getNorthAmericaCountries()\n {\n $result = array();\n $countryCodes = array('US','CA','AI', 'AG', 'AW', 'BS', 'BB', 'BZ', 'BM', 'VG', 'KY', 'CR', 'CU', 'DM', 'DO', 'SV', 'GL', 'GD', 'GP', 'GT', 'HT', 'HN', 'JM', 'MQ', 'MX', 'MS', 'AN', 'NI', 'PA', 'PR', 'BL', 'KN', 'LC', 'MF', 'PM', 'VC', 'TT', 'TC', 'VI');\n $allCountries = $this->getSwitchableCountries();\n\n foreach ($allCountries as $country) {\n if (in_array($country['value'], $countryCodes)) {\n $result[] = $country;\n }\n\n }\n\n return $result;\n }",
"public function getCandidates()\n {\n foreach ($this->candidates as $id) {\n $this->numOfCandidates++;\n // Use a generator to save on memory/resources\n // load accounts from DB one at a time only when required\n yield (new CandidateModel())->load($id);\n }\n }",
"public function selectAll()\n {\n return $this->contractor->all(['name', 'id']);\n }",
"public static function all();",
"public static function all();",
"public static function all();",
"public function all(): \\Iterator;",
"public static function OptAllTowns()\n {\n $data = Town::find()->orderBy('region_id')->with('region')->all();\n $region = ArrayHelper::map($data,'region_id','region.name');\n\n $allarr = [];\n foreach ($region as $key=>$val)\n {\n $arr = [];\n foreach ($data as $value)\n {\n if ($value->region_id==$key)\n {\n $arr[$value->id] = $value->name;\n }\n }\n $allarr[$val] = $arr;\n }\n return $allarr;\n }",
"public function getListadoCattareas()\r\n {\r\n return $this->conexionCattarea->listaLlaves(\"correlativo\", \"ASC\");\r\n }",
"abstract public function all();"
]
| [
"0.64373016",
"0.5657625",
"0.56055886",
"0.5352657",
"0.5257569",
"0.5255755",
"0.5161219",
"0.5153101",
"0.5146909",
"0.51442695",
"0.5135184",
"0.5107922",
"0.5097919",
"0.50911766",
"0.5058621",
"0.5047014",
"0.5023132",
"0.5013043",
"0.49677947",
"0.49567926",
"0.49132204",
"0.4912646",
"0.4896564",
"0.48913983",
"0.48913983",
"0.48913983",
"0.4875149",
"0.48675346",
"0.4845588",
"0.48406094"
]
| 0.6417824 | 1 |
Function to pick all specialities | function get_all_specialities($obj, $idlist=array())
{
if(!empty($idlist))
{
$condition = " categorystamp IN ('".implode("','", $idlist)."') ";
}
else
{
$condition = " 1=1 ";
}
$speciality_result = $obj->db->query($obj->Query_reader->get_query_by_code('get_speciality_list', array('condition'=>$condition)));
return $speciality_result->result_array();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSpecifics() {}",
"public static function allSpecial()\n {\n return [\n self::SPECIAL_EVERYTHING,\n self::SPECIAL_NOTHING\n ];\n }",
"public function specialties($id)\n {\n //\n $clinic = Clinic::findOrFail($id);\n $specialties = $clinic->specialties()->onlyName()->get();\n \n return $specialties;\n }",
"public function getSpecials($categoryId){\n if($categoryId == 2){\n $specials = Continent::all();\n return $specials;\n }else if($categoryId == 3){\n $specials = Artelement::all();\n return $specials;\n }else if($categoryId == 4){\n $specials = Sportelement::all();\n return $specials;\n }\n else if($categoryId == 5){\n $specials = Businesselement::all();\n return $specials;\n }\n else if($categoryId == 6){\n $specials = Healthelement::all();\n return $specials;\n }\n else if($categoryId == 7){\n $specials = Foodelement::all();\n return $specials;\n }\n else if($categoryId == 10){\n $specials = Bookelement::all();\n return $specials;\n }\n else if($categoryId == 11){\n $specials = Stylelement::all();\n return $specials;\n }\n else if($categoryId == 12){\n $specials = Opinonelement::all();\n return $specials;\n }\n else if($categoryId == 13){\n $specials = Sienceelement::all();\n return $specials;\n }\n }",
"private static function getNonSpecialPageTypes() {\n \t\treturn tx_newspaper::selectRows(\n \t\t\t'DISTINCT get_var', tx_newspaper::getTable('tx_newspaper_PageType'),\n \t\t\t'get_var != \\'' . tx_newspaper::GET_pagetype() .'\\' AND ' .\n \t\t\t'get_var != \\'' . tx_newspaper::GET_article() .'\\' AND ' .\n \t\t\t'get_var != \\'\\''\n \t\t);\n\t\t\n\t}",
"function generateSpecialAbilityPool(){\r\n\t$this->Specs = $this->Player['spec'].\"\\n\".$this->MS['spec'].\"\\n\".$this->Eq['A']['spec'].\"\\n\".$this->Tactics['spec'];\r\n\tif ($this->Eq['D']['spec'])\t\t\t$this->Specs .= \"\\n\".$this->Eq['D']['spec'];\r\n\tif ($this->Eq['E']['spec'])\t\t\t$this->Specs .= \"\\n\".$this->Eq['E']['spec'];\r\n\tif ($this->Tactics['spec'] == 'AllWepStirke')\t$this->Specs .= \"\\n\".$this->Eq['B']['spec'].\"\\n\".$this->Eq['C']['spec'];\r\n\r\n}",
"public static function getSpecialClasses() {\n return self::$special_classes;\n }",
"public function getSpecialisatie()\n {\n return $this->specialisatie;\n }",
"function generateByOtherFeature($heading)\n{\n\t$recipe = array();\n\t$recipeSelector = new Recipe;\n\t\n\t$candidates = $recipeSelector->selectByOtherFeature($heading);\n\t\n\tif (count($candidates) != 0)\n\t{\n\t\t$recipe = selectRandomCandidate($candidates);\n\t}\n\t\n\telse \n\t{\n\t\t$recipe = null;\n\t}\n\t\n\treturn $recipe;\n}",
"protected function _prepareSubset() {}",
"function get_specializations() {\n $db = new Database();\n $doctors = new Doctors($db->connect());\n\n $specializations = $doctors->get_specializations();\n\n return $specializations;\n}",
"function multiclean(array $pattern, $characters = false) {\n \n //enlève les personnages absents\n\n \n //TODO : deux conf successices identiques\n\n \n //TODO : entracte\n\n $array = array();\n foreach ($pattern as $kconfiguration => $configuration) {\n foreach ($configuration as $id => $character) {\n \n if ($character) {\n $array[$kconfiguration][] = $characters ? $characters[$id] : $id;\n }\n }\n }\n return $array;\n}",
"public function getAllMiscellaneous() : array {\n $query='SELECT * FROM Publication WHERE categorie_id=5 ORDER BY ID;';\n $this->connection->executeQuery($query);\n \n return $this->connection->getResults();\n }",
"public function getSpecialty()\n {\n return $this->specialty;\n }",
"function genreopties(){\r\n\t\tglobal $pdo;\r\n\t\t\t//maken sql query\r\n\t\t$sql = \"SELECT DISTINCT genre_name FROM Genre\";\r\n\t\t\t//afschieten query\r\n\t\t$result = $pdo->query($sql)->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t\r\n\t\tforeach($result as $row){\r\n\t\t\tforeach($row as $genre){\r\n\t\t\t\techo '<option value='.$genre.'>'.$genre.'</option>';\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function specialty_person($specialty_id, $connection, $start = 0)\n{\n\t$db_selected = mysql_select_db(Secure::DB_DATABASE, $connection);\n\t$sql = \"select person.person_id, person.first_name , person.last_name from person where person_id in (select person_specialty.person_id from person_specialty where specialty_id ={$specialty_id}) and remove_approved = 0\";\n\t$sql = $sql.\" limit {$start},\".LIMIT;\n\tif(!($resource = @ mysql_query($sql, $connection)))\n\t\tshowerror();\n\t\t//echo $sql;\n\telse\n\t\treturn $resource;\n}",
"public static function all() : WorkingJorneyCollection\n {\n return (new static)->get(...func_get_args());\n }",
"public function fewSelection()\n {\n $selection = func_num_args() > 0 ? func_get_args() : $this->fewSelection;\n\n return call_user_func_array([$this, 'select'], $selection);\n }",
"function selectSpecialSkinType($id) {\n global $special;\n $special = strtolower($id);\n}",
"public function getAllPossibleArticulations()\n {\n // Get the SEs filtered by Permissible Articulations for that appropriate Bone type\n $sb = $this->skeletalbone()->first();\n $sb_articluations = $sb->articulations;\n $articluations_list = null;\n if ($sb_articluations->count()) {\n $query = SkeletalElement::whereIn(\"sb_id\", $sb_articluations->pluck('id'))\n ->where(\"side\", \"!=\", $this->getOppositeSide()) // not opposite side\n ->where(\"id\", \"!=\", $this->id); // not the same se (for bones that can articulate to themselves such as unseriated cervical vertebra)\n $articluations_list = $query->latest()->get();\n }\n return $articluations_list;\n }",
"function generateByMealType($heading)\n{\n\t$recipe = array();\n\t$recipeSelector = new Recipe;\n\t$mealType = \"\";\n\t$candidates = array();\n\t\n\tarray(\"Jump-Start the Day\", \"Breakfast Ideas\", \"Delicious Desserts\", \"Sweet Treats\", \"Time for Dessert\", \"Lunch Time\", \"Lovable Lunches\", \"Dinner Dining\", \"Supper Time\", \n\t\t\t\t\t\t\t\"Appetizers\", \"Starters\", \"Snacks\", \"Snack Ideas\", \"Adult Drinks\", \"Alcoholic Beverages\", \"Quench Your Thirst!\", \"Tasty Beverages\");\n\n\t//get recipe based on given meal category\n\tswitch ($heading)\n\t{\n\t\tcase \"Jump-Start the Day\":\n\t\t{\n\t\t\t$candidates = $recipeSelector->selectByMealType(\"Breakfast\");\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcase \"Breakfast Ideas\":\n\t\t{\n\t\t\t$candidates = $recipeSelector->selectByMealType(\"Breakfast\");\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcase \"Delicious Desserts\":\n\t\t{\n\t\t\t$candidates = $recipeSelector->selectByMealType(\"Dessert\");\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcase \"Sweet Treats\":\n\t\t{\n\t\t\t$candidates = $recipeSelector->selectByMealType(\"Dessert\");\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcase \"Time for Dessert\":\n\t\t{\n\t\t\t$candidates = $recipeSelector->selectByMealType(\"Dessert\");\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcase \"Lunch Time\":\n\t\t{\n\t\t\t$candidates = $recipeSelector->selectByMealType(\"Lunch\");\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcase \"Lovable Lunches\":\n\t\t{\n\t\t\t$candidates = $recipeSelector->selectByMealType(\"Lunch\");\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcase \"Dinner Dining\":\n\t\t{\n\t\t\t$candidates = $recipeSelector->selectByMealType(\"Dinner\");\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcase \"Supper Time\":\n\t\t{\n\t\t\t$candidates = $recipeSelector->selectByMealType(\"Dinner\");\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Appetizers\":\n\t\t{\n\t\t\t$candidates = $recipeSelector->selectByMealType(\"Appetizer\");\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcase \"Starters\":\n\t\t{\n\t\t\t$candidates = $recipeSelector->selectByMealType(\"Appetizer\");\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcase \"Snacks\":\n\t\t{\n\t\t\t$candidates = $recipeSelector->selectByMealType(\"Snack\");\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcase \"Snack Ideas\":\n\t\t{\n\t\t\t$candidates = $recipeSelector->selectByMealType(\"Snack\");\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcase \"Adult Drinks\":\n\t\t{\n\t\t\t$candidates = $recipeSelector->selectByMealType(\"Alcohol\");\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcase \"Alcoholic Beverages\":\n\t\t{\n\t\t\t$candidates = $recipeSelector->selectByMealType(\"Alcohol\");\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcase \"Quench Your Thirst!\":\n\t\t{\n\t\t\t$candidates = $recipeSelector->selectByMealType(\"Beverage\");\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcase \"Tasty Beverages\":\n\t\t{\n\t\t\t$candidates = $recipeSelector->selectByMealType(\"Beverage\");\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tif (count($candidates) != 0)\n\t{\n\t\t$recipe = selectRandomCandidate($candidates);\n\t}\n\t\n\telse \n\t{\n\t\t$recipe = null;\n\t}\n\n\treturn $recipe;\n}",
"public function getAllGenres($activeOnly = false) {\n\t\t$ret = null;\n\n\t\tif ($activeOnly) {\n\t\t\t$res = $this->pdo->query(\"SELECT title FROM genres WHERE disabled = 0 AND type = 6000 ORDER BY title\");\n\t\t} else {\n\t\t\t$res = $this->pdo->query(\"SELECT title FROM genres WHERE disabled = 1 AND type = 6000 ORDER BY title\");\n\t\t}\n\n\t\tforeach ($res as $arr => $value) {\n\t\t\t$ret[] = $value['title'];\n\t\t}\n\t\treturn $ret;\n\t}",
"public function getSpecialItemType() {\r\n\t\t$this->db->from('invoice_special_item_type');\r\n\t\t$this->db->order_by('type_id');\r\n\r\n\t\t$data = array();\r\n\t\t$query = $this->db->get();\r\n\r\n\t\tif($query->num_rows() > 0) {\r\n\t\t\tforeach($query->result_array() as $row) {\r\n\t\t\t\t$data[$row['type_id']] = $row;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $data; //array\r\n\t}",
"protected function getSpecials( $language_id, $min_id=null, $max_id=null ) {\n\t\t$exist_table_user_group_description = false;\n\t\t$query = $this->db->query( \"SHOW TABLES LIKE '\".DB_PREFIX.\"user_group_description'\" );\n\t\t$exist_table_user_group_description = ($query->num_rows > 0);\n\n\t\t// get the instrument specials\n\t\t$sql = \"SELECT ps.*, \";\n\t\t$sql .= ($exist_table_user_group_description) ? \"cgd.name \" : \"cg.name \";\n\t\t$sql .= \"FROM `\".DB_PREFIX.\"instrument_special` ps \";\n\t\tif ($exist_table_user_group_description) {\n\t\t\t$sql .= \"LEFT JOIN `\".DB_PREFIX.\"user_group_description` cgd ON cgd.user_group_id=ps.user_group_id \";\n\t\t\t$sql .= \" AND cgd.language_id=$language_id \";\n\t\t} else {\n\t\t\t$sql .= \"LEFT JOIN `\".DB_PREFIX.\"user_group` cg ON cg.user_group_id=ps.user_group_id \";\n\t\t}\n\t\tif (isset($min_id) && isset($max_id)) {\n\t\t\t$sql .= \"WHERE ps.instrument_id BETWEEN $min_id AND $max_id \";\n\t\t}\n\t\t$sql .= \"ORDER BY ps.instrument_id, name, ps.priority\";\n\t\t$result = $this->db->query( $sql );\n\t\treturn $result->rows;\n\t}",
"function getDriverRestrictions() ;",
"public function getSpecies();",
"public function getPossibleSpecials($post, $start_limit, $load_all = false)\n {\n function getSQLWhereCondition($query_header, $post, $config_language_id)\n {\n $sql = \" WHERE pd.language_id = '\" . (int) $config_language_id . \"' \";\n\n // Filter by categories\n if (isset($post['categories'])) {\n $category_ids = array_map('intval', $post['categories']);\n $category_ids = implode(\",\", $category_ids);\n\n $sql .= \" AND p2c.category_id IN (\" . $category_ids . \") \";\n }\n\n // Filter by manufacturers\n if (isset($post['manufacturers'])) {\n $manufacturer_ids = array_map('intval', $post['manufacturers']);\n $manufacturer_ids = implode(\",\", $manufacturer_ids);\n\n $sql .= \" AND p.manufacturer_id IN (\" . $manufacturer_ids . \") \";\n }\n\n // Filter by special_groups\n if (isset($post['special_groups'])) {\n $special_groups_ids = array_map('intval', $post['special_groups']);\n $special_groups_ids = implode(\",\", $special_groups_ids);\n\n $sql .= \" AND ps.product_special_group_id IN (\" . $special_groups_ids . \") \";\n }\n\n // Attach additional chosen products\n if (isset($post['products'])) {\n $product_ids = array_map('intval', $post['products']['id']);\n\n $sql .= \" UNION \" . $query_header;\n $sql .= \" WHERE ps.product_id IN (\" . implode(\",\", $product_ids) . \") AND pd.language_id = '\" . (int) $config_language_id . \"' \";\n }\n\n return $sql;\n }\n\n $sql_join_conditions = \" FROM `\" . DB_PREFIX . \"product_special` as ps \";\n $sql_join_conditions .= \" LEFT JOIN `\" . DB_PREFIX . \"product` as p ON (ps.product_id = p.product_id) \";\n $sql_join_conditions .= \" LEFT JOIN `\" . DB_PREFIX . \"product_description` as pd ON (ps.product_id = pd.product_id) \";\n $sql_join_conditions .= \" LEFT JOIN `\" . DB_PREFIX . \"product_to_category` as p2c ON (ps.product_id = p2c.product_id) \";\n $sql_join_conditions .= \" LEFT JOIN `\" . DB_PREFIX . \"product_special_group` as psg ON (ps.product_special_group_id = psg.product_special_group_id) \";\n\n $query_header = \" SELECT\n DISTINCT(ps.product_special_id),\n ps.product_id,\n ps.priority,\n ps.customer_group_id,\n ps.date_start,\n ps.date_end,\n ps.price as `special_price`,\n p.price as `old_price`,\n IFNULL(psg.name, '-') AS 'special_group_name',\n ps.timer AS 'timer_status',\n p.image,\n p.quantity,\n p.status,\n pd.name \";\n\n if ($this->hours_days_status) {\n $query_header .= \", ps.weekdays, ps.hours \";\n }\n\n $query_header .= $sql_join_conditions;\n\n // As we use\n $sql = \"SELECT * FROM (\" . $query_header . getSQLWhereCondition($query_header, $post, $this->config->get('config_language_id')) . \") as temp_table \";\n $sql .= \" ORDER BY name, product_id \";\n\n // Show only 100 products each time\n if (!$load_all) {\n $limit = 100;\n $sql .= \" LIMIT \" . $start_limit . \", \" . $limit;\n }\n\n $query = $this->db->query($sql);\n $specials = $query->rows;\n\n /**\n *\n * Count total num-r of possible products for given filters\n *\n */\n $query_header = \" SELECT DISTINCT(ps.product_special_id) \";\n $query_header .= $sql_join_conditions;\n\n $sql = \"SELECT COUNT(*) as total FROM (\" . $query_header . getSQLWhereCondition($query_header, $post, $this->config->get('config_language_id')) . \") as temp_table\";\n\n $query = $this->db->query($sql);\n $total = $query->row['total'];\n\n // return total # of possible products, and their info\n return array(\n 'total' => $total,\n 'specials' => $specials,\n );\n }",
"function allTerritoryTypestoCombo() {\n $this->load->model('territory/territory_model');\n $fetchAllTerritoryType = $this->territory_model->fetchFromAnyTable(\"tbl_territory_type\", null, null, null, 10000, 0, \"RESULTSET\", array('territory_type_status' => 1), null);\n $pushdata = array('territory' => $fetchAllTerritoryType);\n $this->template->draw('territory/allTerritoryTypeCombo', false, $pushdata);\n }",
"public function isSpecial();",
"public static function OptAllTowns()\n {\n $data = Town::find()->orderBy('region_id')->with('region')->all();\n $region = ArrayHelper::map($data,'region_id','region.name');\n\n $allarr = [];\n foreach ($region as $key=>$val)\n {\n $arr = [];\n foreach ($data as $value)\n {\n if ($value->region_id==$key)\n {\n $arr[$value->id] = $value->name;\n }\n }\n $allarr[$val] = $arr;\n }\n return $allarr;\n }"
]
| [
"0.62598956",
"0.62146866",
"0.5731981",
"0.5641947",
"0.5602302",
"0.5514348",
"0.5402668",
"0.5353125",
"0.5324611",
"0.5322502",
"0.5318287",
"0.5286436",
"0.52846617",
"0.5273559",
"0.5257529",
"0.51954764",
"0.5187065",
"0.5134808",
"0.51236534",
"0.5090881",
"0.5075944",
"0.50604934",
"0.5051629",
"0.5033814",
"0.50123036",
"0.5010351",
"0.50078547",
"0.49793828",
"0.49676874",
"0.49639362"
]
| 0.6262997 | 0 |
Returns an array with all the basic colors | function get_all_colors()
{
$colors = array(
"000000" => "Black",
"0000FF" => "Blue",
"804000" => "Brown",
"736F6E" => "Gray",
"00FF00" => "Green",
"FF8040" => "Orange",
"FF00FF" => "Pink",
"8E35EF" => "Purple",
"FF0000" => "Red",
"FFFF00" => "Yellow",
"FFFFFF" => "White",
);
return $colors;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function colors()\n {\n $color = $this->backgroundColor();\n return array($color, Kronolith::foregroundColor($color));\n }",
"public function getColors()\n\t{\n\t\treturn [\n\t\t\t'AliceBlue',\n\t\t\t'AntiqueWhite',\n\t\t\t'Aqua',\n\t\t\t'Aquamarine',\n\t\t\t'Azure',\n\t\t\t'Beige',\n\t\t\t'Bisque',\n\t\t\t'Black',\n\t\t\t'BlanchedAlmond',\n\t\t\t'Blue',\n\t\t\t'BlueViolet',\n\t\t\t'Brown',\n\t\t\t'BurlyWood',\n\t\t\t'CadetBlue',\n\t\t\t'Chartreuse',\n\t\t\t'Chocolate',\n\t\t\t'Coral',\n\t\t\t'CornflowerBlue',\n\t\t\t'Cornsilk',\n\t\t\t'Crimson',\n\t\t\t'Cyan',\n\t\t\t'DarkBlue',\n\t\t\t'DarkCyan',\n\t\t\t'DarkGoldenRod',\n\t\t\t'DarkGray',\n\t\t\t'DarkGreen',\n\t\t\t'DarkKhaki',\n\t\t\t'DarkMagenta',\n\t\t\t'DarkOliveGreen',\n\t\t\t'Darkorange',\n\t\t\t'DarkOrchid',\n\t\t\t'DarkRed',\n\t\t\t'DarkSalmon',\n\t\t\t'DarkSeaGreen',\n\t\t\t'DarkSlateBlue',\n\t\t\t'DarkSlateGray',\n\t\t\t'DarkTurquoise',\n\t\t\t'DarkViolet',\n\t\t\t'DeepPink',\n\t\t\t'DeepSkyBlue',\n\t\t\t'DimGray',\n\t\t\t'DodgerBlue',\n\t\t\t'FireBrick',\n\t\t\t'FloralWhite',\n\t\t\t'ForestGreen',\n\t\t\t'Fuchsia',\n\t\t\t'Gainsboro',\n\t\t\t'GhostWhite',\n\t\t\t'Gold',\n\t\t\t'GoldenRod',\n\t\t\t'Gray',\n\t\t\t'Green',\n\t\t\t'GreenYellow',\n\t\t\t'HoneyDew',\n\t\t\t'HotPink',\n\t\t\t'IndianRed',\n\t\t\t'Indigo',\n\t\t\t'Ivory',\n\t\t\t'Khaki',\n\t\t\t'Lavender',\n\t\t\t'LavenderBlush',\n\t\t\t'LawnGreen',\n\t\t\t'LemonChiffon',\n\t\t\t'LightBlue',\n\t\t\t'LightCoral',\n\t\t\t'LightCyan',\n\t\t\t'LightGoldenRodYellow',\n\t\t\t'LightGreen',\n\t\t\t'LightGrey',\n\t\t\t'LightPink',\n\t\t\t'LightSalmon',\n\t\t\t'LightSeaGreen',\n\t\t\t'LightSkyBlue',\n\t\t\t'LightSlateGray',\n\t\t\t'LightSteelBlue',\n\t\t\t'LightYellow',\n\t\t\t'Lime',\n\t\t\t'LimeGreen',\n\t\t\t'Linen',\n\t\t\t'Magenta',\n\t\t\t'Maroon',\n\t\t\t'MediumAquaMarine',\n\t\t\t'MediumBlue',\n\t\t\t'MediumOrchid',\n\t\t\t'MediumPurple',\n\t\t\t'MediumSeaGreen',\n\t\t\t'MediumSlateBlue',\n\t\t\t'MediumSpringGreen',\n\t\t\t'MediumTurquoise',\n\t\t\t'MediumVioletRed',\n\t\t\t'MidnightBlue',\n\t\t\t'MintCream',\n\t\t\t'MistyRose',\n\t\t\t'Moccasin',\n\t\t\t'NavajoWhite',\n\t\t\t'Navy',\n\t\t\t'OldLace',\n\t\t\t'Olive',\n\t\t\t'OliveDrab',\n\t\t\t'Orange',\n\t\t\t'OrangeRed',\n\t\t\t'Orchid',\n\t\t\t'PaleGoldenRod',\n\t\t\t'PaleGreen',\n\t\t\t'PaleTurquoise',\n\t\t\t'PaleVioletRed',\n\t\t\t'PapayaWhip',\n\t\t\t'PeachPuff',\n\t\t\t'Peru',\n\t\t\t'Pink',\n\t\t\t'Plum',\n\t\t\t'PowderBlue',\n\t\t\t'Purple',\n\t\t\t'Red',\n\t\t\t'RosyBrown',\n\t\t\t'RoyalBlue',\n\t\t\t'SaddleBrown',\n\t\t\t'Salmon',\n\t\t\t'SandyBrown',\n\t\t\t'SeaGreen',\n\t\t\t'SeaShell',\n\t\t\t'Sienna',\n\t\t\t'Silver',\n\t\t\t'SkyBlue',\n\t\t\t'SlateBlue',\n\t\t\t'SlateGray',\n\t\t\t'Snow',\n\t\t\t'SpringGreen',\n\t\t\t'SteelBlue',\n\t\t\t'Tan',\n\t\t\t'Teal',\n\t\t\t'Thistle',\n\t\t\t'Tomato',\n\t\t\t'Turquoise',\n\t\t\t'Violet',\n\t\t\t'Wheat',\n\t\t\t'White',\n\t\t\t'WhiteSmoke',\n\t\t\t'Yellow',\n\t\t\t'YellowGreen',\n\t\t];\n\t}",
"public static function colors()\n {\n $path = __DIR__ . '/output/colors_names.php';\n return file_exists($path) ? require $path : [];\n }",
"public static function getColors()\n {\n $db = DataBase::connect();\n\n $result = $db->query('SELECT * FROM `color`');\n\n $colors = [];\n\n $i = 1;\n\n while($row = $result->fetch()) {\n $colors[$i]['color'] = $row['color'];\n $colors[$i]['ukr_title'] = $row['ukr_title'];\n $colors[$i]['upper_ukr_title'] = $row['upper_ukr_title'];\n $colors[$i]['default'] = $row['default'];\n\n $i++;\n }\n return $colors;\n }",
"public static function RGBColors()\n {\n $colors = [0];\n for ($color = 1; $color < 256; ++$color) {\n $colors[$color] = self::colorToRGB($color);\n }\n \n return $colors;\n }",
"public function colorsCombo()\n\t{\n\t\t$colors = getSetting('good_colors');\n\t\t$array = [];\n\t\tif(!$colors or !is_array($colors)) {\n\t\t\treturn [];\n\t\t}\n\n\t\tforeach($colors as $color) {\n\t\t\t$array[] = [$color, trans(\"colors.$color\")];\n\t\t}\n\n\t\treturn $array;\n\t}",
"public function getColors()\n {\n return $this->colors;\n }",
"public function getColorList()\n {\n return $this->colorList;\n }",
"public function colorsArray():array\n {\n $colors = [];\n if (!empty($this->colors)) {\n $colors = json_decode($this->colors, true);\n }\n return $colors;\n }",
"public static function RGBStringColors()\n {\n $colors = [];\n for ($color = 0; $color < 256; ++$color) {\n $colors[$color] = self::colorToRGBString($color);\n }\n \n return $colors;\n }",
"public function getColorComponents() {}",
"public function getColorComponents() {}",
"public function getColorComponents() {}",
"public function getColorComponents() {}",
"public function getColorComponents() {}",
"public function getColorComponents() {}",
"public function getColorComponents() {}",
"function getColors($which = null){\n\t// Process to get real data, for this example\n\t// it is just a static array\n\t$colors = array(\n\t\t'responseMsg' \t=> setResponse(), \n\t\t'allColors' \t=> array('blue', 'green', 'black', 'white', 'yellow', 'red', 'beige')\n\t); \n\t\n\treturn $colors; \n}",
"public function color()\n {\n $color = $this->customer->color;\n\n $r = substr($color, 1, 2);\n $g = substr($color, 3, 2);\n $b = substr($color, 5, 2);\n $luma = (float)0.2126 * hexdec($r)\n + 0.7152 * hexdec($g)\n + 0.0722 * hexdec($b);\n\n return ['color' => $this->customer->color, 'luma' => $luma];\n }",
"public function colorList() {}",
"public function getBackgroundColors(): array\n {\n\t\treturn array_keys($this->backgroundColors);\n\t}",
"function colorMap(): array\n{\n return [\n 'black' => 'white',\n 'red' => 'white',\n 'green' => 'black',\n 'yellow' => 'black',\n 'blue' => 'white',\n 'magenta' => 'white',\n 'cyan' => 'black',\n 'white' => 'black',\n 'default' => 'white',\n ];\n}",
"private function getColors(): array\n {\n $colors = $this->website->getConfiguration()->getColors();\n $choices = [];\n foreach ($colors as $color) {\n if ($color->getCategory() === \"background\" && $color->getIsActive()) {\n $choices[$color->getAdminName()] = $color->getSlug();\n $this->colors[$color->getSlug()] = $color->getColor();\n }\n }\n return $choices;\n }",
"public function backgroundColorProvider()\n {\n return [[\"#fff\"], [\"#000\"]];\n }",
"public function backgroundColorProvider()\n {\n return [[\"#fff\"], [\"#000\"]];\n }",
"private function getDataColorArray() {\n\t\treturn $this->dataColorArray;\n\t}",
"public static function getBackgroundColors() {\n\t\treturn array_keys( self::background_colors );\n\t}",
"public function getBackgroundColors() {\n return array_keys($this->background_colors);\n }",
"public function getBackgroundColors() {\n\t\treturn array_keys($this->background_colors);\n\t}",
"public function getBackgroundColors() {\n\t\treturn array_keys($this->background_colors);\n\t}"
]
| [
"0.80006003",
"0.78241116",
"0.7659754",
"0.7641081",
"0.7618703",
"0.74857455",
"0.74524075",
"0.7450922",
"0.74363834",
"0.73707944",
"0.73685485",
"0.7368508",
"0.7368508",
"0.7368508",
"0.7368508",
"0.7368508",
"0.7368508",
"0.7343271",
"0.7341565",
"0.7302173",
"0.7251624",
"0.72421986",
"0.7219553",
"0.7151379",
"0.7151379",
"0.7138633",
"0.70754176",
"0.70707136",
"0.7043053",
"0.7043053"
]
| 0.7974992 | 1 |
Function to get the difference between two multi dimensional arrays [up to 4 levels] It is assumed all items of an array are one data type | function multi_array_diff($array1, $array2)
{
$diff = array();
#Do a foreach only if there are more than one levels of array below the current value (first value in array)
if(contains_an_array($array1))#is_array(current($array1))
{
foreach($array1 AS $key_1=>$array1_1)
{
if(contains_an_array($array1_1))#is_array(current($array1_1))
{
#3 DIMENSIONAL ARRAYS
foreach($array1_1 AS $key_1_2=>$array1_1_2)
{
#echo "<br>KEY: ".$key_1_2." --- "; print_r($array1_1_2);
if(array_key_exists($key_1, $array2) && array_key_exists($key_1_2, $array2[$key_1])){
if(is_array($array1_1_2) && is_array($array2[$key_1][$key_1_2])){
if(count(array_diff_assoc($array1_1_2, $array2[$key_1][$key_1_2])) != 0){
$diff[$key_1][$key_1_2] = array_diff_assoc($array1_1_2, $array2[$key_1][$key_1_2]);
}
}
else if(strcasecmp($array1_1_2, $array2[$key_1][$key_1_2]) != 0)
{
$diff[$key_1][$key_1_2] = $array1_1_2;
}
}
else
{
$diff[$key_1][$key_1_2] = $array1_1_2;
}
}
}
#2 DIMENSIONAL ARRAYS
else
{
#echo "<br>KEY: ".$key_1." --- "; print_r($array1_1);
if(array_key_exists($key_1, $array2)){
if(is_array($array1_1) && is_array($array2[$key_1])){
if(count(array_diff($array1_1, $array2[$key_1])) != 0){
$diff[$key_1] = array_diff($array1_1, $array2[$key_1]);
}
}
else if(strcasecmp($array1_1, $array2[$key_1]) != 0)
{
$diff[$key_1] = $array1_1;
}
}
else
{
$diff[$key_1] = $array1_1;
}
}
}
}
#1 DIMENSIONAL ARRAYS
else
{
$diff = array_diff($array1, $array2);
}
#echo "<br><br><br><br>";
return $diff;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function multidimensional_array_diff($a, $b) { \n\t\t\treturn $a['start'] - $b['start']; }",
"function multidimensional_array_diff2($a, $b) { \n\t\t\treturn $a['start'] - $b['start']; }",
"function arrayRecursiveDiff($a1, $a2) {\n $result = array();\n\n foreach($a1 as $va1) {\n $found = false;\n foreach($a2 as $va2) {\n try{\n //echo \"va1: \".$va1.\" va2: \".$va2.\"<br>\";\n // if its a single value we need to convert to a singleton array \n if (!is_array($va1)){\n $va1 = compact($va1);\n }\n if (!is_array($va2)){\n $va2 = compact($va2);\n } \n\n $x = array_diff($va1, $va2);\n if (empty($x)) {\n $found = true;\n } \n }\n catch (Exception $e){\n echo \"va1: \".$va1.\" va2: \".$va2.\", Exception Line 45: \".$e->getMessage();\n }\n }\n if (!$found) { \n $result[] = $va1;\n }\n }\n\n foreach($a2 as $va2) {\n $found = false;\n foreach($a1 as $va1) {\n try{\n //echo \"va1: \".$va1.\" va2: \".$va2.\"<br>\";\n // if its a single value we need to convert to a singleton array \n if (!is_array($va1)){\n $va1 = compact($va1);\n }\n if (!is_array($va2)){\n $va2 = compact($va2);\n } \n\n $x = array_diff($va2, $va1);\n if (empty($x)) {\n $found = true;\n } \n }\n catch (Exception $e){\n echo \"va1: \".$va1.\" va2: \".$va2.\", Exception Line 63: \".$e->getMessage();\n }\n }\n if (!$found) { \n $result[] = $va2;\n }\n }\n \n return $result;\n }",
"abstract public function diffWith(array $array);",
"function array_multi_diff($a1,$a2) {\n\t$diff = array();\n\t\n\tforeach($a1 as $k=>$v){\n\t\t$dv = null;\n\t\tif(is_int($k)){\n\t\t\t// Compare values\n\t\t\tif(array_search($v,$a2)===false) $dv=$v;\n\t\t\telse if(is_array($v)) $dv = array_multi_diff($v,$a2[$k]);\n\t\t\tif($dv) $diff[]=$dv;\n\t\t} else {\n\t\t\t// Compare noninteger keys\n\t\t\tif(!$a2[$k]) $dv=$v;\n\t\t\telse if(is_array($v)) $dv = array_multi_diff($v,$a2[$k]);\n\t\t\tif($dv) $diff[$k]=$dv;\n\t\t}\n\t}\n\t\n\treturn $diff;\n}",
"function arrayDiff(array $a, array $b):array {\n \n}",
"function arr_diff($a1,$a2){\n\t\t\tforeach($a1 as $k=>$v){\n\t\t\t\tunset($dv);\n\t\t\t\tif(is_int($k)){\n\t\t\t\t\t// Compare values\n\t\t\t\t\tif(array_search($v,$a2)===false) $dv=$v;\n\t\t\t\t\telse if(is_array($v)) $dv=arr_diff($v,$a2[$k]);\n\t\t\t\t\tif($dv) $diff[]=$dv;\n\t\t\t\t} else {\n\t\t\t\t\t// Compare noninteger keys\n\t\t\t\t\tif(!$a2[$k]) $dv=$v;\n\t\t\t\t\telse if(is_array($v)) $dv=arr_diff($v,$a2[$k]);\n\t\t\t\t\tif($dv) $diff[$k]=$dv;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $diff;\n\t\t}",
"function array_diff_multi($array1, $array2)\n {\n $result = [];\n foreach ($array1 as $key => $val) {\n if (isset($array2[$key])) {\n if (is_array($val) && $array2[$key]) {\n $diff = array_diff_multi($val, $array2[$key]);\n if ($diff) {\n $result[$key] = $diff;\n }\n }\n } else {\n $result[$key] = $val;\n }\n }\n\n return $result;\n }",
"function atkArrayDiff($array1, $array2)\n{\n\tforeach($array1 as $key => $value)\n\t{\n\t\tif(is_array($value))\n\t\t{\n\t\t\tif(!is_array($array2[$key]))\n\t\t\t{\n\t\t\t\t$difference[$key] = $value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$new_diff = atkArrayDiff($value, $array2[$key]);\n\t\t\t\tif($new_diff != FALSE)\n\t\t\t\t{\n\t\t\t\t\t$difference[$key] = $new_diff;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telseif(!isset($array2[$key]) || $array2[$key] != $value)\n\t\t{\n\t\t\t$difference[$key] = $value;\n\t\t}\n\t}\n\n\treturn !isset($difference) ? false : $difference;\n}",
"public function diff(array $a, array $b): array;",
"function ary_diff( $ary_1, $ary_2 ) {\n // get differences that in ary_1 but not in ary_2\n // get difference that in ary_2 but not in ary_1\n // return the unique difference between value of 2 array\n $diff = array();\n\n // get differences that in ary_1 but not in ary_2\n foreach ( $ary_1 as $v1 ) {\n $flag = 0;\n foreach ( $ary_2 as $v2 ) {\n $flag |= ( $v1 == $v2 );\n if ( $flag ) break;\n }\n if ( !$flag ) array_push( $diff, $v1 );\n }\n\n return $diff;\n }",
"public static function array_diff($a, $b) {\n\t $map = $out = array();\n\t foreach($a as $val) $map[$val] = 1;\n\t foreach($b as $val) if(isset($map[$val])) $map[$val] = 0;\n\t foreach($map as $val => $ok) if($ok) $out[] = $val;\n\t return $out;\n\t}",
"function diff($arr1, $arr2)\n{\n $res = array();\n $r = 0;\n foreach ($arr1 as & $av) {\n if (!in_array($av, $arr2)) {\n $res[$r] = $av;\n $r++;\n }\n }\n\n return $res;\n}",
"public function testDifference() {\n\t\t$array = array(1, 2, 3, 4, 5);\n\t\t$result = _::difference($array, array(6));\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(5, $result);\n\t\t$this->assertEquals(1, $result[0]);\n\t\t$this->assertEquals(2, $result[1]);\n\t\t$this->assertEquals(3, $result[2]);\n\t\t$this->assertEquals(4, $result[3]);\n\t\t$this->assertEquals(5, $result[4]);\n\n\t\t// test removing a single element\n\t\t$result = _::difference($array, array(3));\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(4, $result);\n\t\t$this->assertEquals(1, $result[0]);\n\t\t$this->assertEquals(2, $result[1]);\n\t\t$this->assertEquals(4, $result[3]);\n\t\t$this->assertEquals(5, $result[4]);\n\n\t\t// test removing multiple elements\n\t\t$result = _::difference($array, array(1, 2, 3));\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(2, $result);\n\t\t$this->assertEquals(4, $result[3]);\n\t\t$this->assertEquals(5, $result[4]);\n\n\t\t// test removing all elements\n\t\t$result = _::difference($array, array(1, 2, 3, 4, 5));\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(0, $result);\n\t}",
"function diff($array1,$array2,$options=array('strict'=>false,'numberChange'=>false)) {\n\t\t$changes=array();\n\n\t\tforeach ($array2 as $columnName=>$columnValue) {\n\t\t\t$oldColumnValue=$array1[$columnName];\n\t\t\tif ($columnValue!=$oldColumnValue) {\n\t\t\t\tif ($options['numberChange']===true and (is_numeric($columnValue) or empty($columnValue)) and \n\t\t\t\t\t(is_numeric($oldColumnValue) or empty($oldColumnValue))) {\n\t\t\t\t\t$changes[$columnName]=intval($columnValue)-intval($oldColumnValue);\n\t\t\t\t} else {\n\t\t\t\t\t$changes[$columnName]=$columnValue;\n\t\t\t\t}\n\t\t\t\t// $columnName.'='.$changes[$columnName].'|'.$oldColumnValue.' -> '.$columnValue.'<br/>';\n\t\t\t}\n\t\t}\n\n\t\treturn $changes;\n\t}",
"function arrayDiff($a, $b) {\n $arr = [];\n for ($i = 0; $i < count($a); $i++) {\n if (!in_array($a[$i], $b)) {\n array_push($arr, $a[$i]);\n }\n }\n return $arr;\n }",
"static function arrayDiff() {\n\n //removing items which are already in the database\n //taking realty ids which are already in the database\n $realty_id_raw = Offers::find()->select(\"realty_id\")->asArray()->all();\n $realty_id=[];\n foreach ($realty_id_raw as $v) {\n $realty_id[] = intval ($v[\"realty_id\"]);\n }\n\n if (!empty($realty_id)) {\n $diff_id =\n //array_merge(array_diff($realty_id, $_SESSION[\"data_id\"]),\n array_diff($_SESSION[\"data_id\"],$realty_id)\n //)\n ;\n } else {\n $diff_id = $_SESSION[\"data_id\"];\n }\n\n return [\"diff_id\"=>$diff_id,\"realty_id\"=>$realty_id];\n\n }",
"public function getArrayDiff(array $init) : array;",
"function differences($a1, $a2, $same = true){\n\t \n\t\t$result = new stdClass();\n\n\t\t$result->add = array_diff_key($a2, $a1);\n\t\t$result->delete = array_diff_key($a1, $a2);\n\n\t\t$both = array_intersect_key($a1, $a2);\n\t\tif($same) $result->same = array();\n\t\t$result->update = array();\n\t\tforeach($both as $id=>$val){\n\t\t\tif($a1[$id] !== $a2[$id])\n\t\t\t\t$result->update[$id] = $a2[$id];\n\t\t\telseif($same)\n\t\t\t\t$result->same[$id] = $a2[$id];\n\t\t}\n\n\t\t$result->differences = count($result->add) + count($result->update) + count($result->delete);\n\n\t\treturn $result;\n\t}",
"public function difference(array $array, $options = []) {\n\t\tif ($options instanceof Closure) {\n\t\t\t$options = array('callback' => $options);\n\n\t\t} else if (is_bool($options)) {\n\t\t\t$options = array('strict' => $options);\n\t\t}\n\n\t\t$options = (array) $options + array(\n\t\t\t'strict' => true,\n\t\t\t'callback' => null,\n\t\t\t'valueCallback' => null,\n\t\t\t'on' => 'values'\n\t\t);\n\n\t\t$callback = $options['callback'];\n\t\t$valueCallback = $options['valueCallback'];\n\n\t\t// Prepare array\n\t\t$value = Hash::filter($this->_value, false, function($val) {\n\t\t\treturn !is_array($val);\n\t\t});\n\n\t\t// Values\n\t\tif ($options['on'] === 'values') {\n\n\t\t\t// Compare with callback\n\t\t\tif ($valueCallback instanceof Closure) {\n\t\t\t\tif ($callback instanceof Closure) {\n\t\t\t\t\treturn array_udiff_uassoc($value, $array, $valueCallback, $callback);\n\n\t\t\t\t} else if ($options['strict']) {\n\t\t\t\t\treturn array_udiff_assoc($value, $array, $valueCallback);\n\n\t\t\t\t} else {\n\t\t\t\t\treturn array_udiff($value, $array, $valueCallback);\n\t\t\t\t}\n\n\t\t\t// Compare regular\n\t\t\t} else {\n\t\t\t\tif ($options['strict']) {\n\t\t\t\t\tif ($callback instanceof Closure) {\n\t\t\t\t\t\treturn array_diff_uassoc($value, $array, $callback);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn array_diff_assoc($value, $array);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn array_diff($value, $array);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Keys\n\t\t} else {\n\t\t\tif ($callback instanceof Closure) {\n\t\t\t\treturn array_diff_ukey($value, $array, $callback);\n\n\t\t\t} else {\n\t\t\t\treturn array_diff_key($value, $array);\n\t\t\t}\n\t\t}\n\t}",
"public static function removedFromArray($old_array, $new_array) {\r\n\r\n/*\tThis function returns those values that exist in the old \r\n\tarray, but are no longer found in the new one. Those \r\n\tvalues have essentially been \"removed\" to the old array. */\r\n\r\n $removed = array_diff($old_array, $new_array);\r\n return $removed;\r\n \r\n}",
"public function difference($values);",
"function diagonalDifference($arr) {\n$length = count($arr);\n$primaryDiagonal = 0;\n$secondaryDiagonal = 0;\n$last = $length - 1;\nfor ($i = 0;$i<$length;$i++)\n{\n $primaryDiagonal+=$arr[$i][$i];\n $secondaryDiagonal+=$arr[$i][$last--];\n}\n return abs($primaryDiagonal - $secondaryDiagonal);\n}",
"public function diffAssoc($array1)\n {\n return $this->combineCallback('array_diff_assoc', func_get_args());\n }",
"private function arrayDiffAssocRecursive(array $changed, array $original)\n\t{\n\t\t$changed = $this->arrayValuesToString($changed);\n\t\t$original = $this->arrayValuesToString($original);\n\n\t\t$difference = array_map(\n\t\t\t'unserialize',\n\t\t\tarray_diff_assoc(\n\t\t\t\tarray_map('serialize', $changed),\n\t\t\t\tarray_map('serialize', $original)\n\t\t\t)\n\t\t);\n\n\t\treturn $difference;\n\t}",
"public function array_compare( $array1, $array2 )\n {\n $diff = false;\n\n foreach( $array1 as $key => $value )\n {\n if( ! array_key_exists( $key, $array2 ) )\n {\n $diff[0][$key] = $value;\n } elseif ( is_array( $value ) )\n {\n if ( ! is_array( $array2[$key] ) )\n {\n $diff[0][$key] = $value;\n $diff[1][$key] = $array2[$key];\n } else\n {\n $new = self::array_compare( $value, $array2[$key] );\n\n if ( $new !== false )\n {\n if ( isset( $new[0] ) )\n $diff[0][$key] = $new[0];\n\n if ( isset( $new[1] ) )\n $diff[1][$key] = $new[1];\n }\n }\n } elseif ( $array2[$key] !== $value )\n {\n $diff[0][$key] = $value;\n $diff[1][$key] = $array2[$key];\n }\n }\n\n foreach ( $array2 as $key => $value )\n {\n if ( ! array_key_exists( $key, $array1 ) )\n $diff[1][$key] = $value;\n }\n\n return $diff;\n }",
"public function difference()\n {\n $result = null;\n foreach ($this->data as $value) {\n if (isset($result)) {\n $result = $result - $value;\n\n } else {\n $result = $value;\n }\n }\n\n return $result;\n }",
"private function array_diff_schema(array $array)\r\n {\r\n $schema = $this->schema();\r\n $retval = array();\r\n foreach($schema as $field => $metadata){\r\n if( isset($array[$field]) )\r\n $retval[$field] = $array[$field];\r\n }\r\n return $retval;\r\n }",
"public static function differenceAssoc(array $array, array ...$arrays): array\n {\n if (empty($arrays)) {\n throw new InvalidArgumentException('You need at least 2 arrays for computing difference');\n }\n\n $array = static::clearNestedEmptyArrays(\n static::dot($array)\n );\n\n $arrays = array_map(function ($array) {\n return static::clearNestedEmptyArrays(\n static::dot($array)\n );\n }, $arrays);\n\n return static::undot(array_diff_assoc($array, ...$arrays));\n }",
"protected function createDiff(array $a, array $b)\n\t{\n\t\t$indexA = 0;\n\t\t$indexB = 0;\n\t\t$result = array();\n\t\twhile ($indexA < count($a) || $indexB < count($b))\n\t\t{\n\t\t\tif (($indexA < count($a)) && (!$this->modifiedA[$indexA]) && ($indexB < count($b)) && (!$this->modifiedB[$indexB]))\n\t\t\t{\n\t\t\t\t// equal lines\n\t\t\t\t$indexA++;\n\t\t\t\t$indexB++;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// maybe deleted and/or inserted lines\n\t\t\t\t$startA = $indexA;\n\t\t\t\t$startB = $indexB;\n\n\t\t\t\twhile ($indexA < count($a) && ($indexB >= count($b) || $this->modifiedA[$indexA]))\n\t\t\t\t{\n\t\t\t\t\t$indexA++;\n\t\t\t\t}\n\n\t\t\t\twhile ($indexB < count($b) && ($indexA >= count($a) || $this->modifiedB[$indexB]))\n\t\t\t\t{\n\t\t\t\t\t$indexB++;\n\t\t\t\t}\n\n\t\t\t\tif (($startA < $indexA) || ($startB < $indexB))\n\t\t\t\t{\n\t\t\t\t\t// store a new difference-item\n\t\t\t\t\t$result[] = array(\"startA\" => $startA, \"startB\" => $startB, \"deletedA\" => $indexA - $startA, \"insertedB\" => $indexB - $startB);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}"
]
| [
"0.74694604",
"0.7467136",
"0.7258899",
"0.72422934",
"0.7198493",
"0.71195877",
"0.7095401",
"0.70381874",
"0.7016628",
"0.69871783",
"0.6617435",
"0.63961744",
"0.6296222",
"0.6261182",
"0.61597115",
"0.61359274",
"0.612986",
"0.6112056",
"0.5995006",
"0.59021854",
"0.58668584",
"0.5842471",
"0.5831109",
"0.5828567",
"0.582447",
"0.5802909",
"0.5773905",
"0.57672715",
"0.57338464",
"0.5725781"
]
| 0.77623874 | 0 |
function to format field based on instructions of a string | function format_fields_instr($field_array, $row_data=array())
{
$bool = FALSE;
#assuming instructions are in the first array item
switch($field_array[0])
{
case 'UCFIRST':
$string = ucfirst($row_data[$field_array[1]]);
$bool = TRUE;
break;
case 'MONEY':
$string = '$'.addCommas($row_data[$field_array[1]]);
$bool = TRUE;
break;
case 'ADDCOMMAS':
$string = addCommas($row_data[$field_array[1]]);
$bool = TRUE;
break;
default:
$string = '';
break;
}
return array('bool'=>$bool, 'string'=>$string);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function formatString($str);",
"abstract function format();",
"function processFormatString()\n\t{\n\t\t// of date followed by event title.\n\t\tif ($this->customFormatStr == null)\n\t\t\t$this->customFormatStr = $this->defaultfFormatStr;\n\t\telse\n\t\t{\n\t\t\t$this->customFormatStr = preg_replace('/^\"(.*)\"$/', \"\\$1\", $this->customFormatStr);\n\t\t\t$this->customFormatStr = preg_replace(\"/^'(.*)'$/\", \"\\$1\", $this->customFormatStr);\n\t\t\t// escape all \" within the string\n\t\t\t// $customFormatStr = preg_replace('/\"/','\\\"', $customFormatStr);\n\t\t}\n\n\t\t// strip out event variables and run the string thru an html checker to make sure\n\t\t// it is legal html. If not, we will not use the custom format and print an error\n\t\t// message in the module output. This functionality is not here for now.\n\t\t// parse the event variables and reformat them into php syntax with special handling\n\t\t// for the startDate and endDate fields.\n\t\t//asdbg_break();\n\t\t// interpret linefeed as <br /> if not disabled\n\t\tif (!$this->modparams->get(\"modlatest_ignorebr\", 0))\n\t\t{\n\t\t\t$customFormat = nl2br($this->customFormatStr);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$customFormat = $this->customFormatStr;\n\t\t}\n\n\t\t$keywords = array(\n\t\t\t'content', 'eventDetailLink', 'createdByAlias', 'color',\n\t\t\t'createdByUserName', 'createdByUserEmail', 'createdByUserEmailLink',\n\t\t\t'eventDate', 'endDate', 'startDate', 'title', 'category', 'calendar',\n\t\t\t'contact', 'addressInfo', 'location', 'extraInfo',\n\t\t\t'countdown', 'categoryimage', 'duration', 'siteroot', 'sitebase', 'allCategoriesColoured', 'allCategorieSlugs',\n\t\t\t'today', 'tomorrow'\n\t\t);\n\t\t$keywords_or = implode('|', $keywords);\n\t\t$whsp = '[\\t ]*'; // white space\n\t\t$datefm = '\\([^\\)]*\\)'; // date formats\n\t\t//$modifiers\t= '(?::[[:alnum:]]*)';\n\n\t\t$pattern = '/(\\$\\{' . $whsp . '(?:' . $keywords_or . ')(?:' . $datefm . ')?' . $whsp . '\\})/'; // keyword pattern\n\t\t$cond_pattern = '/(\\[!?[[:alnum:]]+:[^\\]]*])/'; // conditional string pattern e.g. [!a: blabla ${endDate(%a)}]\n\t\t// tokenize conditional strings\n\t\t$splitTerm = preg_split($cond_pattern, $customFormat, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);\n\n\t\t$this->splitCustomFormat = array();\n\t\tforeach ($splitTerm as $key => $value)\n\t\t{\n\t\t\tif (preg_match('/^\\[(.*)\\]$/', $value, $matches))\n\t\t\t{\n\t\t\t\t// remove outer []\n\t\t\t\t$this->splitCustomFormat[$key]['data'] = $matches[1];\n\t\t\t\t// split condition\n\t\t\t\tpreg_match('/^([^:]*):(.*)$/', $this->splitCustomFormat[$key]['data'], $matches);\n\t\t\t\t$this->splitCustomFormat[$key]['cond'] = $matches[1];\n\t\t\t\t$this->splitCustomFormat[$key]['data'] = $matches[2];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->splitCustomFormat[$key]['data'] = $value;\n\t\t\t}\n\t\t\t// tokenize into array\n\t\t\t$this->splitCustomFormat[$key]['data'] = preg_split($pattern, $this->splitCustomFormat[$key]['data'], -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);\n\t\t}\n\n\t\t// cleanup, remove white spaces from key words, seperate date parm string and modifier into array;\n\t\t// e.g. ${ keyword ( 'aaaa' ) } => array('keyword', 'aaa',)\n\t\tforeach ($this->splitCustomFormat as $ix => $yy)\n\t\t{\n\t\t\tforeach ($this->splitCustomFormat[$ix]['data'] as $keyToken => $customToken)\n\t\t\t{\n\t\t\t\tif (preg_match('/\\$\\{' . $whsp . '(' . $keywords_or . ')(' . $datefm . ')?' . $whsp . '}/', trim($customToken), $matches))\n\t\t\t\t{\n\t\t\t\t\t$this->splitCustomFormat[$ix]['data'][$keyToken] = array();\n\t\t\t\t\t$this->splitCustomFormat[$ix]['data'][$keyToken]['keyword'] = stripslashes($matches[1]);\n\t\t\t\t\tif (isset($matches[2]))\n\t\t\t\t\t{\n\t\t\t\t\t\t// ('aaa') => aaa\n\t\t\t\t\t\t$this->splitCustomFormat[$ix]['data'][$keyToken]['dateParm'] = preg_replace('/^\\([\"\\']?(.*)[\"\\']?\\)$/', \"\\$1\", stripslashes($matches[2]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->splitCustomFormat[$ix]['data'][$keyToken] = stripslashes($customToken);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}",
"protected function adjustFields(){\n\t\tforeach($this->fields as $key => $field)\n\t\t{\n\t\t\t$this->fields[$key] = sprintf(\"`%s`\", $field);\n\t\t}\n\t\treturn join(FuriousExpressionsDB::FieldSeparator, $this->fields);\n\t}",
"function format_field_value($field_name,$field_value,$field_type)\n\t{\n\t\tif($field_type == \"datetime\")\n\t\t{\n\t\t\tif($field_name == 'dob')\n\t\t\t{\n\t\t\t\t$field_value = date('l\\, F jS\\, Y',strtotime($field_value));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$field_value = date('g:ia \\o\\n l\\, F jS\\, Y', strtotime($field_value));\n\t\t\t}\n\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($field_name == 'event_name')\n\t\t\t{\n\t\t\t\tif($field_value == 'resume')\n\t\t\t\t{\n\t\t\t\t\t$field_value = \"resumed working\";\n\t\t\t\t}\n\t\t\t\telse if($field_value == 'qbreak')\n\t\t\t\t{\n\t\t\t\t\t$field_value = \"took a break\";\n\t\t\t\t}\n\t\t\t\telse if($field_value == 'pause')\n\t\t\t\t{\n\t\t\t\t\t$field_value = \"paused work\";\n\t\t\t\t}\n\t\t\t\telse if($field_value == 'work')\n\t\t\t\t{\n\t\t\t\t\t$field_value = \"continued working\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$field_value = $field_value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\t\n\t\treturn $field_value;\n\t}",
"public static function format($str, $template) {}",
"function get_field_name( $str ){\n\t\treturn 'field-'.$this->id_base.'['.$this->number.']['.$str.']';\n\t}",
"function describefield($field, $html = true)\n{\n\t$res = \"\";\n\tif($html)\n\t\t$res.= \"<b>\".htmlspecialchars($field[3]).\"</b>: \";\n\telse\n\t\t$res.= htmlspecialchars($field[3]).\": \";\n\n\t$atnybble = \"at nybble \".htmlspecialchars($field[1]);\n\tswitch ($field[0])\n\t{\n\t\tcase 'checkbox':\n\t\t\t$res .= \"checkbox $atnybble with mask \".htmlspecialchars($field[2]);\n\t\t\tbreak;\n\t\tcase 'value':\n\t\t\t$res .= \"value $atnybble\";\n\t\t\tbreak;\n\t\tcase 'signedvalue':\n\t\t\t$res .= \"signed value $atnybble\";\n\t\t\tbreak;\n\t\tcase 'index':\n\t\t\t$res .= \"index at $atnybble\";\n\t\t\tbreak;\n\t\tcase 'binary':\n\t\t\t$res .= \"binary editor $atnybble\";\n\t\t\tbreak;\n\t\tcase 'list':\n\t\t\t$listentries = str_replace(\"\\n\", ', ', rtrim($field[2]));\n\t\t\t$res .= \"list $atnybble: \".htmlspecialchars($listentries).\"\";\n\t\tbreak;\n\t}\n\n\tif ($field[4] != '') $res.= \". \".htmlspecialchars($field[4]).\"\";\n\t\n\treturn $res;\n}",
"public function format($input);",
"function format_value($value, $post_id, $field)\n {\n }",
"function format_value($value, $post_id, $field)\n {\n }",
"function format_value($value, $post_id, $field)\n {\n }",
"function format_value($value, $post_id, $field)\n {\n }",
"function format_value($value, $post_id, $field)\n {\n }",
"function format_value($value, $post_id, $field)\n {\n }",
"function format_value($value, $post_id, $field)\n {\n }",
"function format_value($value, $post_id, $field)\n {\n }",
"function format_value($value, $post_id, $field)\n {\n }",
"function format_value($value, $post_id, $field)\n {\n }",
"function format_value($value, $post_id, $field)\n {\n }",
"function format_value($value, $post_id, $field)\n {\n }",
"function format_value($value, $post_id, $field)\n {\n }",
"function format_value($value, $post_id, $field)\n {\n }",
"function format_value($value, $post_id, $field)\n {\n }",
"function format_value($value, $post_id, $field)\n {\n }",
"function format_value($value, $post_id, $field)\n {\n }",
"function format_value($value, $post_id, $field)\n {\n }",
"function format_value($value, $post_id, $field)\n {\n }",
"function format_value($value, $post_id, $field)\n {\n }",
"function display_field($recordid, $template) {\n switch ($template) {\n case '1':\n case '2':\n case '3':\n case '4':\n $param = 'param'.$template;\n break;\n\n case 'param1':\n case 'param2':\n case 'param3':\n case 'param4':\n $param = $template;\n break;\n\n case 'extra1':\n $param = 'param3';\n break;\n case 'extra2':\n $param = 'param4';\n break;\n\n case 'add':\n case 'edit':\n case 'input':\n case 'addtemplate':\n case 'asearchtemplate':\n $param = 'param1';\n break;\n\n case '':\n case 'view':\n case 'list':\n case 'single':\n case 'output':\n case 'listtemplate':\n case 'singletemplate':\n $param = 'param2';\n break;\n\n default:\n // Format is not recognized.\n return $template;\n }\n if (substr($this->field->$param, 0, 8) == 'SAME_AS_') {\n switch (substr($this->field->$param, 8)) {\n case 'INPUT':\n case 'PARAM1':\n $param = 'param1';\n break;\n case 'OUTPUT':\n case 'PARAM2':\n $param = 'param2';\n break;\n case 'EXTRA1':\n case 'PARAM3':\n $param = 'param3';\n break;\n case 'EXTRA2':\n case 'PARAM4':\n $param = 'param4';\n break;\n }\n }\n if (empty($this->field->$param)) {\n // Requested format is empty :-(\n return '';\n }\n if ($arguments = $this->parse_arguments($recordid, $this->field->$param, 0)) {\n list($arguments, $offset) = $arguments;\n foreach ($arguments as $a => $argument) {\n $argument = $this->compute($recordid, $argument);\n if (is_array($argument)) {\n $msg = get_string($template, 'data');\n $msg = (object)array('template' =>$msg,\n 'fieldname' => $this->field->name);\n $msg = get_string('reducearrayresult', 'datafield_report', $msg);\n $arguments[$a] = $msg.html_writer::alist($argument);\n } else {\n $arguments[$a] = $argument;\n }\n }\n return implode('', $arguments);\n } else {\n return $this->field->$param;\n }\n }"
]
| [
"0.631433",
"0.6254409",
"0.6232463",
"0.59802365",
"0.5962252",
"0.59301704",
"0.5888827",
"0.58880997",
"0.5879372",
"0.58452797",
"0.58452797",
"0.58452797",
"0.58452797",
"0.58452797",
"0.58452797",
"0.58452797",
"0.58452797",
"0.58452797",
"0.58452797",
"0.58452797",
"0.58452797",
"0.58452797",
"0.58452797",
"0.58452797",
"0.58452797",
"0.58452797",
"0.58452797",
"0.58452797",
"0.58452797",
"0.58166724"
]
| 0.7114066 | 0 |
Function to validate borrower period | function validate_borrower_period($date1, $date2){
$date1 = format_date2($date1);
$date2 = format_date2($date2);
if(strtotime($date2) <= strtotime($date1))
return "Issuing date cannot be less or equal to return date";
elseif(get_date_difference2($date1, $date2) > 3)
return "Borrowing period must not exceed 3 days";
else
return "";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function validate_booking(): bool {\n\t $this->errors = array();\n\n // Clear data using test_input function\n foreach ($this->request->post as $key => $value) {\n $this->request->post[$key] = self::test_input($this->request->post[$key]);\n }\n\n // Time\n if(!(preg_match(\"/^(?:2[0-3]|[01][0-9]):[0-5][0-9]$/\", $this->request->post[\"time\"]))){\n array_push($this->errors,$this->language->get('time_error'));\n }\n\n // Date\n $temp = new DateTime();\n\n // Create date object (without time)\n $date = DateTime::createFromFormat('Y-m-d', $this->request->post[\"date\"]);\n\n // Remove time from datetime string\n $now = DateTime::createFromFormat(\"Y-m-d\", $temp->format(\"Y-m-d\"));\n\n // Extract data\n $year = $date->format(\"Y\");\n $month = $date->format(\"m\");\n $day = $date->format(\"d\");\n\n if($date < $now){\n array_push($this->errors,$this->language->get('date_past_error'));\n }\n else if(!checkdate($month,$day,$year)) {\n //$this->errors[\"date\"] = $this->language->get('date_error');\n array_push($this->errors,$this->language->get('date_value_error'));\n }\n\n //TODO: REMOVE\n return count($this->errors) == 0;\n }",
"public function validateByGracePeriod() : void\n {\n if (!is_null($this->grace_period_ends)) {\n if (($this->charge_date == $this->grace_period_ends) && !$this->paid) {\n $this->is_active = 0;\n $this->grace_period_ends = Carbon::now()->addDays(Subscription::DEFAULT_GRACE_PERIOD_DAYS)->toDateTimeString();\n }\n } else {\n $this->grace_period_ends = Carbon::now()->addDays(Subscription::DEFAULT_GRACE_PERIOD_DAYS)->toDateTimeString();\n }\n }",
"function recommends_req_wizard_schools_info_validate($form, &$form_state) {\n\n for ($i = 1; $i <= $form_state['num_schools']; $i++) {\n \n $date_due_month = $form_state['values']['schname'][$i]['r_date_due']['month'];\n $date_due_day = $form_state['values']['schname'][$i]['r_date_due']['day'];\n $date_due_year = $form_state['values']['schname'][$i]['r_date_due']['year'];\n \n $d2=mktime(0,0,0,$date_due_month,$date_due_day,$date_due_year);\n $d1=time();\n $days_diff = floor(($d2-$d1)/86400);\n if ($days_diff < 30 ) {\n form_set_error(\"schname][$i][r_date_due\", 'The due date must be at least 30 days from today. Please contact the professor to discuss exceptions.');\n }\n\n }\n}",
"public function getValidUntil() {\n\t\treturn $this->stamp+Vote::getValidDays()*24*60*60;\n\t}",
"function warranty_validation ($conn, $data) {\n\n\t$get_date1= $data[\"replaced_date\"];\n\t$start = strtotime(\"$get_date1\");\n\n\t$get_date2 = $data[\"warranty_period\"];\n\t$end = strtotime(\"$get_date2\");\n\n\tif ($end > $start) {\n\t\treturn \"YES\";\n\t}else{\n\t\treturn \"NO\" ;\n\t}\n\n\tdie();\n\n}",
"function validDeadlines($claimDeadline, $completeDeadline){\n if($this -> validateDate($claimDeadline) && $this -> validateDate($completeDeadline)){\n $currentTime = date('Y-m-d');\n if($this -> dateGreaterThan($claimDeadline, $currentTime)){\n if($this -> dateGreaterThan($completeDeadline, $claimDeadline)){\n return true;\n }\n }\n }\n echo \"deadlines not valid\";\n return false;\n }",
"public function validateDate()\n {\n if (\n ($from = $this->getAvailableFrom()) &&\n ($till = $this->getAvailableTill()) &&\n $from->InPast() &&\n $till->InFuture()\n ) {\n return true;\n }\n\n return false;\n }",
"function isValid() {\n //we get if it is still good or expired\n return DataHora::compareDate2($this->getExpirationDate(), '>=', date('m/d/Y'), 'mm/dd/yyyy', 'mm/dd/yyyy');\n }",
"function validate()\n\t{\n\t\tglobal $lng;\n\n\t\tinclude_once 'Services/Payment/exceptions/class.ilShopException.php';\n\n\t\tswitch($this->getPriceType())\n\t\t{\n\t\t\tcase self::TYPE_DURATION_MONTH:\n\t\t\t\tif(!preg_match('/^[1-9][0-9]{0,1}$/', $this->__getDuration()))\n\t\t\t\t\tthrow new ilShopException($lng->txt('paya_price_not_valid'));\n\t\t\t\tbreak;\n\n\t\t\tcase self::TYPE_DURATION_DATE:\n\t\t\t\tif(!preg_match('/^[0-9]{4,4}-[0-9]{1,2}-[0-9]{1,2}$/', $this->__getDurationFrom()))\n\t\t\t\t\tthrow new ilShopException($lng->txt('payment_price_invalid_date_from'));\n\n\t\t\t\t$from_date = explode('-', $this->__getDurationFrom());\n\t\t\t\tif(!checkdate($from_date[1], $from_date[2], $from_date[0]))\n\t \t\t\tthrow new ilShopException($lng->txt('payment_price_invalid_date_from'));\n\n\t\t\t\tif(!preg_match('/^[0-9]{4,4}-[0-9]{1,2}-[0-9]{1,2}$/', $this->__getDurationUntil()))\n\t\t\t\t\tthrow new ilShopException($lng->txt('payment_price_invalid_date_until'));\n\n\t\t\t\t$till_date = explode('-', $this->__getDurationUntil());\n\t\t\t\tif(!checkdate($till_date[1], $till_date[2], $till_date[0]))\n\t \t\t\tthrow new ilShopException($lng->txt('payment_price_invalid_date_until'));\n\n\t \t\t$from = mktime(12, 12, 12, $from_date[1], $from_date[2], $from_date[0]);\n\t \t\t$till = mktime(12, 12, 12, $till_date[1], $till_date[2], $till_date[0]);\n\n\t \t\tif($from >= $till)\n\t\t\t\t\tthrow new ilShopException($lng->txt('payment_price_invalid_date_from_gt_until'));\n\t\t\t\tbreak;\n\n\t\t\tcase self::TYPE_UNLIMITED_DURATION:\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new ilShopException($lng->txt('payment_no_price_type_selected_sdf'));\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif(preg_match('/[0-9]/',$this->__getPrice()))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\tthrow new ilShopException($lng->txt('payment_price_invalid_price'));\n\t}",
"function birthdate_required()\n\t\t{\n\t\t\tglobal $config;\n\n\t\t\treturn ($config['allow_birthdays'] == BIRTHDATE_REQUIRE || $config['allow_birthdays'] == BIRTHDATE_LOCKED);\n\t\t}",
"public function endValidityPeriod()\n {\n\n return true;\n }",
"public function getValidityPeriod()\n {\n return $this->validityPeriod;\n }",
"private function checkDatesValidity(){\n\t\t$valid=true;\n\t\t$today = date(\"Y-m-d\");\n\t\tif($this->validFrom!=\"\" && $this->validFrom!=\"0000-00-00\" && $today<$this->validFrom) $valid=false;\n\t\tif($this->validUntil!=\"\" && $this->validUntil!=\"0000-00-00\" && $today>$this->validUntil) $valid=false;\n\t\treturn $valid;\n\t}",
"function recommends_req_crstut_9_validate($form, &$form_state) {\n\n for ($i = 1; $i <= $form_state['num_courses']; $i++) {\n $course_year = $form_state['values']['crsname'][$i]['courseyear'];\n \n if ($course_year && ($course_year < 2010 || $course_year > 2011)) {\n form_set_error(\"coursenum][$i][courseyear\", 'Enter a valid year.');\n }\n \n }\n}",
"function is_valid($voucher)\n\t{\n\t\t//$voucher = $this->get_voucher($id);\n\n\t\t//die(var_dump($voucher));\n\t\t\t\t\n\t\tif($voucher['max_uses']!=0 && $voucher['num_uses'] >= $voucher['max_uses'] ) return false;\n\t\t\n\t\tif($voucher['start_date'] != \"0000-00-00\")\n\t\t{\n\t\t\t$start = strtotime($voucher['start_date']);\n\t\t\n\t\t\t$current = time();\n\t\t\n\t\t\tif($current < $start)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($voucher['end_date'] != \"0000-00-00\")\n\t\t{\n\t\t\t$end = strtotime($voucher['end_date']) + 86400; // add a day for the availability to be inclusive\n\t\t\n\t\t\t$current = time();\n\t\t\n\t\t\tif($current > $end)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"function room_reservations_admin_settings_reminders_validate($form_id, &$form_state) {\n if ($form_state['clicked_button']['#value'] == t('Save configuration')) {\n $reminder_time = $form_state['values']['reminder_time'];\n $reminder_cutoff = $form_state['values']['reminder_cutoff'];\n if ($reminder_time < $reminder_cutoff) {\n $field = 'reminder_time';\n $message = t(\"'Send reminder daily at' time cannot be earlier than 'Send reminders for reservations created before' time.\");\n form_set_error($field, check_plain($message));\n }\n }\n}",
"public function isCancellationWithValidPeriod(){\n return (bool) ($this->isCancelled() && !$this->hasExpired());\n }",
"private function validatePassportIssuedDate() {\n $issued_date = DateTime::createFromFormat( 'd.m.Y', $this->passport_issued_date );\n\n if ( $issued_date < DateTime::createFromFormat( 'd.m.Y', '01.10.1997' ) ) {\n $this->errors[] = [ 'Паспорт должен быть выдан не позднее 1 октября 1997 года' ];\n }\n\n if ( $issued_date > new DateTime( 'tomorrow' ) ) {\n $this->errors[] = [ 'Паспорт не может быть выдан в будущем' ];\n }\n }",
"public function isValidExpiry()\n {\n $month = $this->expiryMonthValue;\n $year = $this->expiryYearValue;\n $monthNow = intval(date('n'));\n $yearNow = intval(date('Y'));\n if (is_scalar($month)) {\n $month = intval($month);\n }\n if (is_scalar($year)) {\n $year = intval($year);\n }\n return is_integer($month) && $month >= 1 && $month <= 12 && is_integer($year) &&\n ($year > $yearNow || ($year === $yearNow && $month > $monthNow)) && $year < ($yearNow + 10);\n }",
"public function validate($input)\n {\n if(new \\DateTime($input) <= \\Carbon\\Carbon::now()->subDays(3)) {\n \n return false;\n\n }\n\n // no date future\n if(new \\DateTime($input) > \\Carbon\\Carbon::now()) {\n\n return false;\n }\n\n return true;\n }",
"public function valid() {}",
"public function valid() {}",
"public function valid() {}",
"public function valid() {}",
"public function valid() {}",
"public function valid() {}",
"public function valid() {}",
"public function valid() {}",
"public function validate() {\n//\t\tif( intval($this->params[\"startYear\"] < date(\"yyyy\"))) $this->add_validation_error(\"Season cannot exist in the past.\");\n\t}",
"public function valid()\n {\n return $this->_current !== null\n && $this->_current->getTimestamp() < $this->_endDate->getTimestamp();\n }"
]
| [
"0.61578304",
"0.60448945",
"0.5886992",
"0.5837751",
"0.5776798",
"0.5661506",
"0.56499636",
"0.5648081",
"0.56375325",
"0.5622809",
"0.56013125",
"0.5577605",
"0.5564372",
"0.5540529",
"0.5492884",
"0.545635",
"0.5417026",
"0.5406248",
"0.54058665",
"0.53783494",
"0.5370454",
"0.5370454",
"0.5370454",
"0.5370454",
"0.5370454",
"0.5370454",
"0.5370454",
"0.5370454",
"0.5365979",
"0.5364546"
]
| 0.7283675 | 0 |
function to format dates provided from a form field list into a format fit for entering into the database | function format_dates_for_db($formdata, $field_list)
{
$new_formdata = $formdata;
foreach($field_list AS $key)
{
$field_key = explode('*', $key);
if(array_key_exists($field_key[0], $formdata)){
if(!empty($field_key[1]) && $field_key[1] == 'EXT'){
$new_formdata[$field_key[0]] = date('Y-m-d H:i:s', strtotime($formdata[$field_key[0]]));
}
else
{
$new_formdata[$field_key[0]] = date('Y-m-d', strtotime($formdata[$field_key[0]]));
}
}
}
return $new_formdata;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _field_date($fval) \n {\n // if $fval is not already split up, we assume std. date string // YYYY-MM-DD\n if (is_array($fval)) {\n $f_date = &$fval;\n }\n elseif ($fval) {\n $f_date = split('-', $fval, 3);\n }\n else {\n $f_date = array('','','');\n }\n\n $res = \"<span id=\\\"\" . $this->name . \"\\\">\";\n\n for ($i=1; $i<32; $i++) { $days[sprintf(\"%02d\", $i)] = $i; }\n\n $months_abbr = array(\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\");\n for ($i=1; $i<13; $i++) { $months[sprintf(\"%02d\", $i)] = $months_abbr[$i-1]; }\n\n $fmonths = new formex_field($this->fex, $this->name.'_month', array('Months', 'select', $months));\n $res .= $fmonths->get_html($f_date[1]);\n\n if (isset($this->attribs) and !isset($this->attribs['suppress_day'])) {\n $fdays = new formex_field($this->fex, $this->name.'_day', array('Dates', 'select', $days));\n $res .= $fdays->get_html($f_date[2]);\n }\n\n $year_range = null;\n $this_year = date('Y');\n if (isset($this->opts) and is_numeric($this->opts)) { // int val will be this year +\n $year_range = $this->_array_stringify(range($this_year, $this_year+$this->opts));\n }\n elseif (isset($this->attribs) && is_array($this->attribs)) { // exact range specified\n $begin = (isset($this->attribs['year_begin']))? $this->attribs['year_begin'] : $this_year;\n $end = $this_year;\n if (isset($this->attribs['year_end'])) {\n if (substr($this->attribs['year_end'], 0, 4) == 'now+') {\n $end = $this_year + intval(substr($this->attribs['year_end'], 4));\n }\n elseif (substr($this->attribs['year_end'], 0, 4) == 'now-') {\n $end = $this_year - intval(substr($this->attribs['year_end'], 4));\n }\n elseif (substr($this->attribs['year_end'], 0, 1) == '+') {\n $end = $begin + intval(substr($this->attribs['year_end'], 1));\n }\n elseif (substr($this->attribs['year_end'], 0, 1) == '-') {\n $end = $begin - intval(substr($this->attribs['year_end'], 1));\n }\n else {\n $end = intval($this->attribs['year_end']);\n }\n }\n\n if ($begin != $end) {\n $year_range = $this->_array_stringify(range($begin, $end));\n }\n }\n\n if ($year_range) { // dropdown w/ that range\n $fyears = new formex_field($this->fex, $this->name.'_year', array('Years', 'select', $year_range));\n }\n else { // 4-space text field\n $fyears = new formex_field($this->fex, $this->name.'_year', array('Years', 'text', null, array('size'=>4)));\n }\n $res .= $fyears->get_html($f_date[0]);\n unset($fmonths, $fdays, $fyears);\n $res .= \"</span>\";\n\n return $res;\n }",
"function acf_format_date($value, $format)\n{\n}",
"public function formatDate($date = null);",
"function _field_date_us($fval) \n {\n $f_date = \"\";\n if ($fval) {\n list($m,$d,$y) = split('/', $fval);\n $f_date = array($y, $m, $d);\n }\n return $this->_field_date($f_date);\n }",
"function formatDateParams() {\n $session = CRM_Core_Session::singleton();\n $dateType = $session->get('dateTypes');\n $setDateFields = array_intersect_key($this->_params, array_flip($this->_dateFields));\n foreach ($setDateFields as $key => $value) {\n CRM_Utils_Date::convertToDefaultDate($this->_params, $dateType, $key);\n $this->_params[$key] = CRM_Utils_Date::processDate($this->_params[$key]);\n }\n }",
"function form_date($field, $options){\n $defaults = array(\n 'wrap' => true,\n 'label' => true,\n 'class' => array('date', 'input'),\n 'minYear' => date('Y') - 10,\n 'maxYear' => date('Y') + 10,\n 'months' => array(\n 1 => 'January',\n 2 => 'February',\n 3 => 'March',\n 4 => 'April',\n 5 => 'May',\n 6 => 'June',\n 7 => 'July',\n 8 => 'August',\n 9 => 'September',\n 10 => 'October',\n 11 => 'November',\n 12 => 'December'\n ),\n 'days' => array(\n 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8,\n 9 => 9, 10 => 10, 11 => 11, 12 => 12, 13 => 13, 14 => 14, 15 => 15,\n 16 => 16, 17 => 17, 18 => 18, 19 => 19, 20 => 20, 21 => 21, 22 => 22,\n 23 => 23, 24 => 24, 25 => 25, 26 => 26, 27 => 27, 28 => 28, 29 => 29,\n 30 => 30, 31 => 31\n ),\n 'separator' => '-'\n );\n\n $options = array_merge($defaults, $options);\n\n $years = array();\n for($i = $options['minYear']; $i <= $options['maxYear']; $i++) {\n $years[$i] = $i;\n }\n\n if(empty($_POST[$field . '[day]'])) {\n $today = date('j');\n if(!empty($options['days'][$today])) {\n $_POST[$field . '[day]'] = $today;\n }\n }\n\n $output = form_select(\n $field . '[day]',\n array(\n 'wrap' => false,\n 'label' => false,\n 'options' => $options['days']\n )\n );\n\n $output .= $options['separator'];\n\n if(empty($_POST[$field . '[month]'])) {\n $today = date('n');\n if(!empty($options['months'][$today])) {\n $_POST[$field . '[month]'] = $today;\n }\n }\n\n $output .= form_select(\n $field . '[month]',\n array(\n 'wrap' => false,\n 'label' => false,\n 'options' => $options['months']\n )\n );\n\n $output .= $options['separator'];\n\n if(empty($_POST[$field . '[year]'])) {\n $today = date('Y');\n if(!empty($years[$today])) {\n $_POST[$field . '[year]'] = $today;\n }\n }\n\n $output .= form_select(\n $field . '[year]',\n array(\n 'wrap' => false,\n 'label' => false,\n 'options' => $years\n )\n );\n\n if($options['wrap']) {\n $options['field'] = $field;\n $output = form__wrap($output, $options);\n }\n\n $error = form_error_message($field);\n if(!empty($error)) {\n $output .= $error;\n }\n\n return html__output($output);\n}",
"public function getSortedDateInputs()\n {\n $strtr = array(\n '%b' => '%1$s',\n '%B' => '%1$s',\n '%m' => '%1$s',\n '%d' => '%2$s',\n '%e' => '%2$s',\n '%Y' => '%3$s',\n '%y' => '%3$s'\n );\n\n $dateFormat = preg_replace('/[^\\%\\w]/', '\\\\1', $this->getDateFormat());\n\n return sprintf(strtr($dateFormat, $strtr),\n $this->_dateInputs['m'], $this->_dateInputs['d'], $this->_dateInputs['y']);\n }",
"function formatFechaES($value){\n\t$partes=explode(\"-\", $value);\n\t$value = $partes[2].\"-\".$partes[1].\"-\".$partes[0];\n\treturn $value;\n}",
"function process_date(&$list, $field, $add_age = false)\n{\n\t$today = strtotime('2018-09-14');\t// RAR was 'today'\n\tforeach ($list as $index => $row) {\n\t\t$d = $row[$field];\n\t\tif (empty ($d) || ($d == '0000-00-00'))\n\t\t\t$d = '';\n\t\telse\n\t\t\t$d = date ('j M y', strtotime ($d));\n\t\t$list[$index][$field] = $d;\n\n\t\tif ($add_age) {\n\t\t\tif (empty($d)) {\n\t\t\t\t$a = '';\n\t\t\t\t$m = '';\n\t\t\t} else {\n\t\t\t\t$a = floor (($today - strtotime($d)) / 86400);\n\t\t\t\t$m = sprintf ('%.1f', $a / 30.44);\n\t\t\t}\n\n\t\t\t$list[$index]['age'] = $a;\n\t\t\t$list[$index]['months'] = $m;\n\t\t}\n\t}\n\n}",
"function conv_date($f, $date, $sep = '/') {\n $fmt = '';\n if ($f == '1') { // normal to mysql\n $date = explode('/', $date);\n $fmt = (count($date) == 3) ? $date[2] . '-' . $date[1] . '-' . $date[0] : '';\n } else { // mysql to normal\n $date = explode(' ', $date);\n $date = explode('-', $date[0]);\n $fmt = (count($date) == 3) ? $date[2] . $sep . $date[1] . $sep . $date[0] : '';\n }\n return $fmt;\n}",
"function cfdef_input_date( $p_field_def, $p_custom_field_value ) {\n\tprint_date_selection_set( 'custom_field_' . $p_field_def['id'], config_get( 'short_date_format' ), $p_custom_field_value, false, true );\n}",
"function formatDate($date){\r\n\t\t\t\t$dateObject = date_create($date);\r\n\t\t\t\treturn date_format($dateObject, \"j F Y\");\r\n\t\t\t}",
"function _elastic_email_format_date($date_field) {\n $data = sprintf('%d/%d/%d', $date_field['month'], $date_field['day'], $date_field['year']);\n $time = sprintf('%s:%s %s', $date_field['hour'], $date_field['minute'], $date_field['ampm']);\n\n return $data . ' ' . $time;\n}",
"function formatFechaBD($value){\n\t$partes = explode(\"-\", $value);\n\t$value = $partes[2].\"-\".$partes[1].\"-\".$partes[0];\n\treturn $value;\n}",
"function format_data_in($string_date)\n{\n // $formatted_date = \"DATE_FORMAT($db_date_column, '%a, %e %b %Y ')\";\n $temp = strtotime($string_date);\n $date = date('Y-m-d', $temp);\n $date = DateTime::createFromFormat('D, j M Y', $temp)->format('Y-m-d');\n print_r($date);\n return $date;\n}",
"public function getDateFormatter();",
"private function process_dates($args) {\n\t\t\t$date_format = explode ( '|' , $args['_date_format'] );\n\t\t\t$date_order = $date_format[0];\n\t\t\t$date_picture = $date_format[1];\n\t\t\t$date_fields = explode ( ',' , $args['_date_fields'] );\n\t\t\t$date = array();\n\t\t\tdate_default_timezone_set('UTC');\n\t\t\t$text_date_field = substr ($date_order, 0, 1) === 't';\n\t\t\n\t\t\tforeach ( $date_fields as $date_field ) {\n\t\t\t\tif ($text_date_field) {\n\t\t\t\t\t// date sent as a string\n\t\t\t\t\t$date_divider = substr ($date_order, 1, 1);\n\t\t\t\t\t$date_split = explode ($date_divider, $args[$date_field]);\n\t\t\t\t\tfor ($i = 0; $i < 3 ; $i++) {\n\t\t\t\t\t\t$date[substr ( $date_order, $i + 2, 1)] = $date_split[$i];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// date sent as an array\n\t\t\t\t\tfor ($i = 0; $i < count($args[$date_field]) ; $i++) {\n\t\t\t\t\t\t$date[substr ( $date_order, $i, 1)] = $args[$date_field][$i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$args[$date_field] = date ( $date_picture, mktime(0, 0, 0, $date[\"m\"], $date[\"d\"], $date[\"y\"]));\n\t\t\t\t\t// See http://php.net/manual/en/function.date.php and\n\t\t\t\t\t// http://php.net/manual/en/function.mktime.php\n\t\t\t}\n\t\t\treturn $args;\n\t\t}",
"function format_date($p_id, $p_name, $p_value, $p_width = '', $p_fmt_short = false){\n\t$t_width = ($p_width != '') ? 'width:' . $p_width . ' !important' : '';\n\t$t_date_prop = 'data-picker-locale=\"' . lang_get_current_datetime_locale() . '\" data-picker-format=\"' . convert_date_format_to_momentjs($p_fmt_short ? config_get('short_date_format') : config_get('normal_date_format')) . '\"';\n\n\treturn format_text($p_id, $p_name, $p_value, '', 'input-xs inline-page-datetime', $t_width, $t_date_prop);\n}",
"public function format_date_save($date){ \n\t\t$exp_date = explode('/', $date); \n\t\treturn $exp_date[2].'-'.$exp_date[1].'-'.$exp_date[0];\n\t}",
"function cfdef_prepare_date_value_for_email( $p_value ) {\n\tif( $p_value != null ) {\n\t\treturn date( config_get( 'short_date_format' ), $p_value ) ;\n\t}\n}",
"function format_daterange($start_date, $end_date, $format = 'd', $full_text, $start_text, $end_text, $culture = null, $charset = null)\n{\n if ($start_date != '' && $end_date != '')\n {\n return sprintf($full_text, format_date($start_date, $format, $culture, $charset), format_date($end_date, $format, $culture, $charset));\n }\n else if ($start_date != '')\n {\n return sprintf($start_text, format_date($start_date, $format, $culture, $charset));\n }\n else if ($end_date != '')\n {\n return sprintf($end_text, format_date($end_date, $format, $culture, $charset));\n }\n}",
"function format_date_form_field($model, $field, $default = 'MM/DD/YYYY')\n{\n $oldDate = old($field);\n\n if ($oldDate) {\n return $oldDate;\n }\n\n $attribute = $model->getAttribute($field);\n\n if ($attribute && $attribute instanceof Carbon) {\n return $attribute->format('Y-m-d');\n }\n\n return $default;\n}",
"function formatDate($date){\n\tif(validateDate($date)){\n\t\t$year = substr($date,0,4);\n\t\t$month = substr($date,4,2);\n\t\t$day = substr($date,6,2);\n\t\treturn $year.C('STR_YEAR').$month.C('STR_MONTH').$day.C('STR_DAY');\n\t}\n\telse\n\t\treturn C('STR_FORMAT_DATE_FAIL');\n}",
"public function dateViewHelperFormatsDateLocalizedDataProvider() {}",
"private function _date_format($results) {\n\t\tif ( $this->date_format) {\n\n\t\t\t$date_cols = $this->date_cols;\n\t\t\tif (!in_array($this->date_column, $this->date_cols)) {\n\t\t\t\t$date_cols[] = $this->date_column;\n\t\t\t}\n\n\t\t\tforeach ($results as &$r) {\n\t\t\t\tforeach ($date_cols as $key) {\n\t\t\t\t\tif (isset($r[$key]) && !empty($r[$key])) {\n\t\t\t\t\t\t$date = date_create($r[$key]);\n\t\t\t\t\t\t$r[$key] = date_format($date, $this->date_format);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $results;\n\t}",
"public static function getDateFormats()\n {\n return array( 'm/d/y' => 'mm/dd/yy', 'd/m/y' => 'dd/mm/yy' );\n }",
"function form_date_only_multi($variable, $start='', $end='') {\n\n\tglobal $request;\n\n\t// timestamps get converted to dates (treat as in GMT)\n\tif (is_numeric($start)) {\n\t\t$start = array(\n\t\t\t'day' => fetch_day($start),\n\t\t\t'month' => fetch_month($start),\n\t\t\t'year' => fetch_year($start)\n\t\t);\n\t}\n\n\t// timestamps get converted to dates (treat as in GMT)\n\tif (is_numeric($end)) {\n\t\t$end = array(\n\t\t\t'day' => fetch_day($end),\n\t\t\t'month' => fetch_month($end),\n\t\t\t'year' => fetch_year($end)\n\t\t);\n\t}\n\n\tif (!is_array($start)) {\n\t\t$start = array();\n\t}\n\n\tif (!is_array($end)) {\n\t\t$end = array();\n\t}\n\n\tif ($end['day'] AND $end_add_time) {\n\t\t$end['hour'] = 23;\n\t\t$end['minute'] = 59;\n\t}\n\n\t$calendar =\"\n\t\t<table id=\\\"\" . $variable . \"_date\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\"><tr>\n\t\t\t<td>From </td>\n\t\t\t<td style=\\\"padding-right:4px\\\">\" . form_date($variable . '_start', $start) . \"</td>\n\t\t\t<td> ago until \" .\n\t\t\t\"<td>\" . form_date($variable . '_end', $end) . \"</td>\n\t\t\t</td>\n\t\t</tr></table>\n\t\";\n\n\treturn \"<div style=\\\"width:545px\\\">\" . $calendar . \"<script>$visno</script></div>\";\n\n}",
"function formatDate($date,$dateOpt=null) {\n\n\t if (defined(\"DATE_FORMAT\")) $layout = DATE_FORMAT;\n\t else $layout = \"mm/dd/yyyy\";\n\n\t $layout = str_replace(\"mm\",\"m\",$layout);\n\t $layout = str_replace(\"dd\",\"d\",$layout);\n\t $layout = str_replace(\"yyyy\",\"Y\",$layout);\n\n\t\t$dateArray = explode(\"-\",$date);\n\n\t\tif ($dateOpt==\"full\") date(\"M d, Y\",mktime(0,0,0,$dateArray[1],$dateArray[2],$dateArray[0]));\n\t\telse $date = date(\"$layout\",mktime(0,0,0,$dateArray[1],$dateArray[2],$dateArray[0]));\n\t\t\n\t\treturn $date;\n\t\t\n}",
"function wp_ajax_date_format()\n {\n }",
"public function formatDates($results, $primary, $model, $dateFields, $parseTime=false)\n\t{\n\t\tif (!is_array($dateFields)) {\n\t\t\t$dateFields = array($dateFields);\n\t\t}\n\t\t//TODO: figure out how to display dates without datetime because on searches it will slow things down somewhat?\n\t\tif(isset($results[0][$model][$dateFields[0]]))\n\t\t{\n\t\t\tif ($parseTime) {\n\t\t\t\tforeach($results as $i => $result)\t{\n\t\t\t\t\tforeach($dateFields as $dateField) {\n\t\t\t\t\t\tif (isset($results[$i][$model][$dateField])) {\n\t\t\t\t\t\t\t$date = $results[$i][$model][$dateField]; \n\t\t\t\t\t\t\tif (Validation::datetime($date)) {\n\t\t\t\t\t\t\t\t$intDate = strtotime($date);\n\t\t\t\t\t\t\t\t$results[$i][$model][$dateField] = date(Configure::read('DISP_DATE_FORMAT'), $intDate);\n\t\t\t\t\t\t\t\t$results[$i][$model][$parseTime] = date(Configure::read('DISP_TIME_FORMAT'), $intDate);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tforeach($results as $i => $result)\t{\n\t\t\t\t\tforeach($dateFields as $dateField) {\n\t\t\t\t\t\tif (isset($results[$i][$model][$dateField])) {\n\t\t\t\t\t\t\t$date = $results[$i][$model][$dateField]; \n\t\t\t\t\t\t\tif (Validation::date($date)) {\n\t\t\t\t\t\t\t\t$intDate = strtotime($date);\n\t\t\t\t\t\t\t\t$results[$i][$model][$dateField] = date(Configure::read('DISP_DATE_FORMAT'), $intDate);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (isset($results[$model][$dateFields[0]]))\n\t\t\t{\n\t\t\t\tforeach($dateFields as $dateField) {\n\t\t\t\t\t$intDate = strtotime($results[$model][$dateField]);\n\t\t\t\t\t$results[$model][$dateField] = date(Configure::read('DISP_DATE_FORMAT'), $intDate);\n\t\t\t\t\tif ($parseTime) {\n\t\t\t\t\t\t$results[$model][$parseTime] = date(Configure::read('DISP_TIME_FORMAT'), $intDate);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $results;\n\t}"
]
| [
"0.7065274",
"0.69614863",
"0.66337585",
"0.6598231",
"0.65405923",
"0.6487388",
"0.64697856",
"0.6422965",
"0.6389482",
"0.6374382",
"0.6342586",
"0.63211846",
"0.6306253",
"0.6298334",
"0.62758315",
"0.6272292",
"0.6223264",
"0.62050235",
"0.6131004",
"0.60818976",
"0.60793054",
"0.6075798",
"0.6071599",
"0.60704803",
"0.6065983",
"0.604025",
"0.6034692",
"0.6028683",
"0.60276955",
"0.60195816"
]
| 0.80080396 | 0 |
Function to get stocked rentals | function get_stocked_rentals($obj, $id){
$result_array = $obj->db->query($obj->Query_reader->get_query_by_code('get_stocked_rentals',array('id' => $id)));
return $result_array->num_rows();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getStock();",
"public function getRentals(): array\n {\n return $this->rentals;\n }",
"function ppt_resources_get_usd_stocks($data)\n{\n// return $data;\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = [];\n // If there is no uid sent with the api so get the current user id.\n if (isset($data['uid'])) {\n $uid = $data['uid'];\n } else {\n global $user;\n $uid = $user->uid;\n }\n $countries = array();\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n }\n $reps = array();\n if (isset($data['reps'])) {\n $reps = $data['reps'];\n }\n\n $user = user_load($uid);\n\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries);\n }\n\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = get_products_dosages($data['products']);\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid);\n } else {\n $products = get_products_for_accounts($accounts);\n }\n }\n//return entity_metadata_wrapper('field_collection_item', 18045);\n $entries = get_entries($accounts, $products, NULL, $reps);\n $entries_records = get_entries_records_for_year($entries, $year, 'consumption_stock_entry');\n $reports = sum_records_per_field($entries_records, 'field_product', TRUE);\n return $reports;\n}",
"public function read_stocks() {\n return $this->yahooStock->getQuotes();\n }",
"function get_borrowed_rentals($obj, $id){\n\t$result_array = $obj->Query_reader->get_row_as_array('get_borrowed_rentals',array('id' => $id));\n\treturn $result_array['total'];\n}",
"public function getRecurringOrders();",
"function ppt_resources_get_consumptions_stocks_per_product($data)\n{\n if (!isset($data['year']) || (!isset($data['uid']))) {\n return services_error('Year or UID are not defined!', 500);\n }\n\n global $user;\n $year = $data['year'];\n $accounts = [];\n // If there is no uid sent with the api so get the current user id.\n if (isset($data['uid']) && !empty($data['uid'])) {\n $uid = $data['uid'];\n } else {\n $uid = $user->uid;\n }\n $countries = array();\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n }\n $reps = array();\n if (isset($data['reps'])) {\n $reps = $data['reps'];\n } else {\n $is_rep = FALSE;\n if (is_rep($user)) {\n $is_rep = TRUE;\n }\n $reps = ppt_resources_get_sales_manager_reps($uid, $countries, $is_rep);\n }\n\n $user = user_load($uid);\n\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries);\n }\n\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = get_products_dosages($data['products']);\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid);\n } else {\n $products = get_products_for_accounts($accounts);\n }\n }\n\n $entries = get_entries($accounts, $products, NULL, $reps);\n $entries_records = get_entries_records_for_year($entries, $year, 'consumption_stock_entry');\n $consumptions = sum_records_per_field_grouped_by_account($entries_records, 'field_product');\n\n return $consumptions;\n}",
"private function getStock()\n {\n $article = oxNew('oxArticle');\n $article->load($this->testArticleId);\n return $article->oxarticles__oxstock->value;\n }",
"public function getStock()\n {\n return $this->stock;\n }",
"public function getStock()\n {\n return $this->stock;\n }",
"public function getStock()\n {\n return $this->stock;\n }",
"public function getStock()\n {\n return $this->stock;\n }",
"public function getStock()\n {\n return $this->stock;\n }",
"public function getSoldItems() {\n //$filter = 'LastHour';\n $filter = 'Last45Days';\n //$filter = 'SaleCompleted';\n $response = $this->trademe->get('MyTradeMe/SoldItems/'.$filter);\n\n if ($response->is_ok()) {\n return $response->List->SoldItem;\n }\n // error\n $this->tragentoLog(array(),$response->error_message(),'get_sold_items_error');\n return false;\n }",
"public function getStockroom()\n {\n $this->load->model('stockroom/exchange');\n $response = $this->model_stockroom_exchange->getStockroom();\n if ($response) {\n foreach ($response as $stockroom) {\n $this->model_stockroom_exchange->parseStockroomResponse($stockroom);\n }\n }\n $flag = true;\n while ($flag) {\n $response = $this->model_stockroom_exchange->getAmount();\n if ($response) {\n foreach ($response as $product) {\n $this->model_stockroom_exchange->parseAmountResponse($product);\n }\n } else {\n $flag = false;\n }\n }\n if ($this->request->server['REQUEST_METHOD'] == 'GET') {\n $this->response->redirect(\n $this->url->link(\n 'stockroom/stockroom',\n 'user_token=' . $this->session->data['user_token'],\n true\n )\n );\n }\n }",
"public function getQuantite_stock()\r\n {\r\n return $this->quantite_stock;\r\n }",
"function get_stocked($obj, $id){\n\t$result_array = $obj->Query_reader->get_row_as_array('get_stocked',array('id' => $id));\n\treturn $result_array['total'];\n}",
"public function getStock()\n {\n return $this->stock;\n }",
"public function getStock()\n {\n return $this->stock;\n }",
"public function getListRpr()\n {\n $db = $this->dblocal;\n try\n {\n $stmt = $db->prepare(\"SELECT @rownum := @rownum + 1 AS urutan,t.* FROM m_redeemed_receipt t, \n (SELECT @rownum := 0) r ORDER BY id_rpr ASC\");\n $stmt->execute();\n $stat[0] = true;\n $stat[1] = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return $stat;\n }\n catch(PDOException $ex)\n {\n $stat[0] = false;\n $stat[1] = $ex->getMessage();\n return $stat;\n }\n }",
"public function run()\n {\n $linenstock = [\n \t[\n 'id' => '1',\n 'items' => 'Sheets (Dbl)',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '2',\n 'items' => 'Sheets (Sgl)',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '3',\n 'items' => 'Pillow case',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '4',\n 'items' => 'Bath towels',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '5',\n 'items' => 'Hand towels',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '6',\n 'items' => 'Face towels',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '7',\n 'items' => 'Bath mat',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '8',\n 'items' => 'Blankets (Dbl)',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '9',\n 'items' => 'Blankets (Sgl)',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '10',\n 'items' => 'Bed cover (Dbl)',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '11',\n 'items' => 'Bed cover(Sgl)',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ] \n ];\n Linenstock::insert($linenstock);\n }",
"function FetchStockTrnsfReqTrans()\n {\n $sql=\"SELECT * FROM INVT_T_SREQ_HEAD ORDER BY SRQH_TXN_NO ASC\";\n return $this->db->query($sql, $return_object = TRUE)->result_array();\n }",
"public function getStock()\n {\n return $this->Stock;\n }",
"public function obtener_stock($cod,$sede)\n\t\t{ \n\t\t\t$this->load->database();\n\t\t\t$sql = 'select * from stock where id_insumo='.$cod.' and id_sede='.$sede;\n\t\t\t$consulta=$this->db->query($sql);\n\t\t\t$codigo=$consulta->row();\n\t\t\treturn $codigo->stock_real;\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t}",
"public static function get_all_accessory_in_stock()\n {\n return Accessories::where('status',1)->where('rental',1)->where('in_stock',0)->get(); \n }",
"public static function getRates() {\n $result = self::get(self::getPath('rates'));\n \n Return $result;\n }",
"function retrieveFunds() {\n return -58.98;\n }",
"public function purchasedBooks()\n { \n return $this->orders();\n }",
"public function getRates()\n {\n return (new Rates)->fetchRates(); \n }",
"public function load_stocks() {\n\t\t\t$res = $this->Restaurant_model->loading_stocks();\n\t\t\techo $res;\n\t\t}"
]
| [
"0.68813044",
"0.6352626",
"0.6152964",
"0.6062257",
"0.5862146",
"0.5810515",
"0.5764264",
"0.5738774",
"0.5738509",
"0.5738509",
"0.5738509",
"0.5738509",
"0.5738509",
"0.5704628",
"0.568187",
"0.5677669",
"0.56611645",
"0.56596136",
"0.56596136",
"0.563932",
"0.56210995",
"0.5600806",
"0.5579033",
"0.55489707",
"0.55280334",
"0.5527151",
"0.5521837",
"0.55161905",
"0.55124664",
"0.55112743"
]
| 0.66684926 | 1 |
Function to get borrowed rentals | function get_borrowed_rentals($obj, $id){
$result_array = $obj->Query_reader->get_row_as_array('get_borrowed_rentals',array('id' => $id));
return $result_array['total'];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getBorrowings();",
"public function getRentals(): array\n {\n return $this->rentals;\n }",
"public function getReferences();",
"public function getReferencesList(){\n return $this->_get(1);\n }",
"protected function notifyBorrowers()\n\t{\n\t\t$leadTime = $this->getLeadTime();\n\t\t$from = Carbon::now()->addDays($leadTime - 1)->toDateString();\n\t\t$to = Carbon::now()->addDays($leadTime)->toDateString();\n\n\t\tItemRental::with('borrower')->where('status', ItemRental::STATUS_INITIATED)\n\t\t\t->whereNull('borrower_shipped_at')\n\t\t\t->whereBetween('return_on', [$from, $to])\n\t\t\t->chunk(self::CHUNK, function($rentals) {\n\t\t\t\t/** @var ItemRental $rental */\n\t\t\t\tforeach ($rentals as $rental) {\n\t\t\t\t\t$this->notifyUserAboutRental($rental->borrower, $rental);\n\t\t\t\t}\n\t\t\t});\n\t}",
"public function get_ongoing_referrals(){\n\t\tglobal $con;\n\n\t\t$query=\"SELECT * FROM referrals ORDER BY referral_id DESC LIMIT 4\";\n\t\t$referrals=array();\n\t\t$referrals=$this->select($con,$query);\n\t\treturn $referrals;\n\t}",
"public function getBorrowList()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t// sql\n\t\t\t$book = D('Borrow');\n\t\t\t$sql = \"SELECT * FROM lib_borrow left join lib_book_unique using(book_id) join lib_book_species using (isbn) join lib_user using (user_id);\";\n\t\t\t$return = $book->query($sql);\n\t\t\tif ($return) {\n\t\t\t\tfor($k=0;$k<count($return);$k++){\n\t\t\t\t\t$return[$k]['book_id'] = substr($return[$k]['book_id']+100000,1,5);\n\t\t\t\t}\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'success',\n\t\t\t\t\t'data' => json_encode($return)\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'query error'\n\t\t\t\t));\n\t\t\t}\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}",
"public static function recentRecoveries(){\n // // this way we will select recoveries of only current month\n // from recovery access bill and from bill access connection detail\n\n // grab the current bill ids\n $current_bill_ids = connection::where('isBlocked',false)->pluck('current_bill_id');\n // grab all the recoveries whose bill id is equal to current bill id latest first\n\n// $recentRecoveries = Recovery::whereIn('bill_id',$current_bill_ids)->latest()->get();\n $recentRecoveries = Recovery::whereIn('bill_id',$current_bill_ids)->latest()\n ->with('user')\n// ->with('bill')\n ->with('connection')\n ->get();\n\n return $recentRecoveries;\n\n }",
"public function get_references()\n\t{\n\t\t$arr = array();\t// returned result\n\t\t$sql = \"SELECT * FROM refs WHERE issue_id = '{$this->id}'\";\n\t\t$this->db->execute_query($sql);\n\t\twhile($line = $this->db->fetch_line()) {\n\t\t\t$arr[] = $line;\n\t\t}\n\t\treturn $arr;\n\t}",
"public function book_borrowed()\n {\n $data['books'] = \\App\\Books_out::whereNull('date_in_actual')\n ->with(['book', 'member'])\n ->get();\n return view('book.borrowed', $data);\n }",
"public function getReferrers()\n {\n return $this->referrers;\n }",
"function &getCancelsAndRegrets($submissionId) {\n\t\t$reviewAssignments = array();\n\t\t$reviewRoundJoinString = $this->getReviewRoundJoin();\n\n\t\tif ($reviewRoundJoinString) {\n\t\t\t$result =& $this->retrieve(\n\t\t\t\t\t\t'SELECT\tr.*, r2.review_revision, u.first_name, u.last_name\n\t\t\t\t\t\tFROM\treview_assignments r\n\t\t\t\t\t\t\tLEFT JOIN users u ON (r.reviewer_id = u.user_id)\n\t\t\t\t\t\t\tLEFT JOIN review_rounds r2 ON (' . $reviewRoundJoinString . ')\n\t\t\t\t\t\tWHERE\tr.submission_id = ? AND\n\t\t\t\t\t\t\t(r.cancelled = 1 OR r.declined = 1)\n\t\t\t\t\t\tORDER BY round, review_id',\n\t\t\t(int) $submissionId\n\t\t\t);\n\n\t\t\twhile (!$result->EOF) {\n\t\t\t\t$reviewAssignments[] =& $this->_fromRow($result->GetRowAssoc(false));\n\t\t\t\t$result->MoveNext();\n\t\t\t}\n\n\t\t\t$result->Close();\n\t\t\tunset($result);\n\t\t} else {\n\t\t\tassert(false);\n\t\t}\n\n\t\treturn $reviewAssignments;\n\t}",
"public function borrow()\n {\n return $this->belongsToMany('App\\Borrow');\n }",
"public function getAllRefitsAttribute()\n {\n // There two calls return collections as defined in relations.\n $r1 = $this->refits1;\n $r2 = $this->refits2;\n\n // Merge collections and return single collection.\n return $r1->merge($r2);\n }",
"public function showReferrals()\n {\n\n return $this->referrals;\n }",
"public function getReferences()\n {\n return $this->references;\n }",
"public function getReferences()\n {\n return $this->references;\n }",
"public function getReferences()\n {\n return $this->references;\n }",
"public function getReferrers(): Collection\n {\n return $this->referrers;\n }",
"public function get_notes() {\n return YITH_WCBK()->notes->get_booking_notes( $this->id );\n }",
"public function getCredits();",
"public function getOtherRecruitmentList() {\n return $this->_get(5);\n }",
"public function rentals() \n {\n return $this->belongsTo('id', 'status_id');\n }",
"public function getMyHolds($patron)\n {\n $result = $this->makeRequest(\n ['v3', 'patrons', $patron['id'], 'holds'],\n [\n 'limit' => 10000,\n 'fields' => 'id,record,frozen,placed,location,pickupLocation'\n . ',status,recordType,priority,priorityQueueLength'\n ],\n 'GET',\n $patron\n );\n if (!isset($result['entries'])) {\n return [];\n }\n $holds = [];\n foreach ($result['entries'] as $entry) {\n $bibId = null;\n $itemId = null;\n $title = '';\n $volume = '';\n $publicationYear = '';\n if ($entry['recordType'] == 'i') {\n $itemId = $this->extractId($entry['record']);\n // Fetch bib ID from item\n $item = $this->makeRequest(\n ['v3', 'items', $itemId],\n ['fields' => 'bibIds,varFields'],\n 'GET',\n $patron\n );\n if (!empty($item['bibIds'])) {\n $bibId = $item['bibIds'][0];\n }\n $volume = $this->extractVolume($item);\n } elseif ($entry['recordType'] == 'b') {\n $bibId = $this->extractId($entry['record']);\n }\n if (!empty($bibId)) {\n // Fetch bib information\n $bib = $this->getBibRecord($bibId, 'title,publishYear', $patron);\n $title = $bib['title'] ?? '';\n $publicationYear = $bib['publishYear'] ?? '';\n }\n //$available = in_array($entry['status']['code'], ['b', 'j', 'i']);\n\t\t\t$available = in_array($entry['status']['code'], ['0', 'b', 'j', 'i', 't']);//changed by Pier Shen @2018-10-30\n if ($entry['priority'] >= $entry['priorityQueueLength']) {\n // This can happen, no idea why\n $position = $entry['priorityQueueLength'] . ' / '\n . $entry['priorityQueueLength'];\n } else {\n $position = ($entry['priority'] + 1) . ' / '\n . $entry['priorityQueueLength'];\n }\n $holds[] = [\n 'id' => $bibId,\n 'requestId' => $this->extractId($entry['id']),\n 'item_id' => $itemId ? $itemId : $this->extractId($entry['id']),\n 'location' => $entry['pickupLocation']['name'],\n 'create' => $this->dateConverter->convertToDisplayDate(\n 'Y-m-d', $entry['placed']\n ),\n 'position' => $position,\n 'available' => $available,\n 'in_transit' => $entry['status']['code'] == 't',\n 'volume' => $volume,\n 'publication_year' => $publicationYear,\n 'title' => $title,\n 'frozen' => !empty($entry['frozen'])\n ];\n }\n return $holds;\n }",
"function &getRepoEntry() {\n\t\treturn $this->repoObj;\n\t}",
"function &getReviewAssignments() {\r\n\t\treturn $this->reviewAssignments;\r\n\t}",
"public function get_circulation_info($ocn) {\n $holdings = array();\n $found = FALSE;\n if ($this->ocn == $ocn) {\n $found = ($this->avail !== null);\n } \n else {\n $found = $this->get_availabilty_of_ocn($ocn);\n }\n if ($found) {\n //check?\n $holdings = $this->avail['searchRetrieveResponse'][0]['records'][0]['record'][0]['recordData'][0]['opacRecord'][0]['holdings'];\n }\n return $holdings;\n }",
"public function getAllPossibleRefits()\n {\n // Get the SEs filtered by Permissible Refits, or same SB and are Incomplete\n $sb_list = SkeletalBone::where('refit' ,'=' , true)->orWhere('id', $this->sb_id)->pluck('id')->toArray();\n return SkeletalElement::whereIn('sb_id', $sb_list)->where('completeness', '=', 'Incomplete')->get();\n }",
"function get_borrowing_byID($voucher_id) {\r\n $params[0] = array(\"name\" => \":voucher_id\", \"value\" => &$voucher_id);\r\n return $this->DBObject->readCursor(\"product_actions.get_borrowing_byID(:voucher_id)\", $params);\r\n }",
"public function rne(){return $this->_rne;}"
]
| [
"0.6326751",
"0.5753345",
"0.5480037",
"0.5409219",
"0.5391755",
"0.5366378",
"0.5299833",
"0.5260508",
"0.52252454",
"0.51912016",
"0.5163894",
"0.5157072",
"0.5076701",
"0.50713295",
"0.50433457",
"0.5036238",
"0.5036238",
"0.5036238",
"0.5035697",
"0.5033908",
"0.50276124",
"0.4991767",
"0.4959613",
"0.49584898",
"0.49469215",
"0.49295875",
"0.48749232",
"0.48706016",
"0.48560205",
"0.48390085"
]
| 0.6221896 | 1 |
Function to fill in a blank array with data available from a post | function fill_available_data($blank_data, $post_array)
{
$full_array = $blank_data;
foreach($blank_data AS $key=>$value)
{
if(array_key_exists($key, $post_array)){
$full_array[$key] = $post_array[$key];
}
}
return $full_array;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resetPostData() {\n\t\t$this->postData = Array ();\n\t}",
"function populateFromPost()\n\t{\n\t}",
"public function postDataArrayProvider()\n {\n\t$data_array = array(\n\t 'photo' => 'test.jpg',\n\t 'id' => 1,\n\t 'author' => 'Anonymous',\n\t 'subject' => '',\n\t 'updated' => 0,\n\t 'content' => 'Testing'\n\t);\n\treturn array(\n\t 'default' => array($data_array)\n\t);\n }",
"abstract public function parsePostData() : array;",
"function emptyPost() {\n\t\t$_POST = array();\n\t}",
"public function clearPostData()\n {\n $this->post_data = array();\n }",
"public function fill(array $data = []);",
"function getPosts()\n{\n $posts = array();\n $posts[0] = $_POST['id'];\n $posts[1] = $_POST['name'];\n $posts[2] = $_POST['email'];\n $posts[3] = $_POST['cidate'];\n $posts[4] = $_POST['codate'];\n $posts[5] = $_POST['guest'];\n $posts[6] = $_POST['children'];\n $posts[7] = $_POST['bed'];\n $posts[8] = $_POST['breakfast'];\n $posts[9] = $_POST['message'];\n return $posts;\n}",
"function getPosts()\n{\n\n $posts = array();\n $posts[0] = $_POST['id'];\n $posts[1] = $_POST['color'];\n $posts[2] = $_POST['size'];\n return $posts;\n}",
"function getPosts()\r\n{\r\n $posts = array();\r\n $posts[0] = $_POST['id'];\r\n $posts[1] = $_POST['iname'];\r\n $posts[2] = $_POST['cname'];\r\n //$posts[3] = $_POST['age'];\r\n return $posts;\r\n}",
"public function ParsePostData() {}",
"protected function _fillMappingsArray()\n {\n if ($this->getRequest()->isPost())\n {\n $this->view->mappings_array = $this->getParam('mappings');\n }\n else\n {\n $this->view->mappings_array = $this->view->batch_upload_mapping_set->getMappingsArray();\n }\n }",
"function assign_to_data($urldata, $passed_defaults = array())\n{\n\t$data_array = array();\n\t$default_field_values = array('Enter Time', 'Enter First Name', 'Enter Last Name');\n\tif(!empty($passed_defaults)){\n\t\t$default_field_values = array_unique(array_merge($default_field_values, $passed_defaults));\n\t}\n\t\n\tforeach($urldata AS $key=>$value)\n\t{\n\t\tif(in_array($value, $default_field_values)){\n\t\t\t$value = '_';\n\t\t}\n\t\t\n\t\tif($value !== FALSE && trim($value) != '' && !array_key_exists($value, $urldata))\n\t\t{\n\t\t\tif($value == '_'){\n\t\t\t\t$data_array[$key] = '';\n\t\t\t} else {\n\t\t\t\t$data_array[$key] = $value;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn $data_array;\n}",
"private function _fill_insert_data() {\n $data = array();\n $data['numero_ticket'] = $this->_generate_numero_ticket();\n $data['descripcion'] = $this->post('descripcion');\n $data['soporte_categoria_id'] = $this->post('soporte_categoria_id');\n $data['persona_id'] = get_persona_id();\n $data['created_at'] = date('Y-m-d H:i:s');\n $data['status'] = 1;\n return $data;\n }",
"function prepData($data)\r\n {\r\n \t$data['data']['Question']['master'] = $data['form']['master'];\r\n\t$data['data']['Question']['type'] = $data['form']['type'];\r\n\t$data['data']['Question']['count'] = $data['form']['data']['Question']['count'];\r\n\r\n\treturn $data;\r\n }",
"private function processPostData() {\n\n if (isset($this->postDataArray['week']) && isset($this->postDataArray['year']))\n {\n\n $this->weekSelected = $this->cleanse_input($this->postDataArray['week']);\n $this->yearSelected = $this->cleanse_input($this->postDataArray['year']);\n }\n else\n {\n $this->weekSelected = $this->weeks[0];\n $this->yearSelected = $this->years[0];\n }\n }",
"function createArray($post)\n{\n $temp = trim($post);\n $temp = explode(' ', $temp);\n for ($i = 0; $i < sizeof($temp); $i++) {\n if ($temp[$i] == \"\") {\n unset($temp[$i]);\n } //$temp[$i] == \"\"\n } //$i = 0; $i < sizeof($temp); $i++\n return $temp;\n}",
"public static function fixArrays(){\n if( self::$postGetFixed ) return;\n if( count($_POST) > 0 )\n self::doFixArray($_POST);\n if( count($_GET) > 0 )\n self::doFixArray($_GET);\n self::$postGetFixed = true;\n }",
"function fillQuestion($data)\r\n {\r\n\tfor( $i=0; $i<$data['count']; $i++ ){\r\n\t\t$data[$i]['Question'] = $this->findAll($conditions='id='.$data[$i]['SurveyQuestion']['question_id'], $fields=\"prompt, type\");\r\n\t\t$data[$i]['Question'] = $data[$i]['Question'][0]['Question'];\r\n\t\t$data[$i]['Question']['number'] = $data[$i]['SurveyQuestion']['number'];\r\n\t\t$data[$i]['Question']['id'] = $data[$i]['SurveyQuestion']['question_id'];\r\n\t\t$data[$i]['Question']['sq_id'] = $data[$i]['SurveyQuestion']['id'];\r\n\t\tunset($data[$i]['SurveyQuestion']);\r\n\t}\r\n\r\n\treturn $data;\r\n }",
"public static function fill($data=[])\n {\n if(!empty($data)){\n foreach ($data as $item){\n self::add($item);\n }\n }\n\n }",
"protected function fill()\n {\n array_map(function ($field) {\n $defaultValue = isset($this->defaultFields[$field]['defaultValue']) ?\n $this->defaultFields[$field]['defaultValue'] :\n null;\n\n $this->values[$field] = (new $this->defaultFields[$field]['format']($defaultValue))\n ->setPosition($this->defaultFields[$field]['position'])\n ->setLength($this->defaultFields[$field]['length']);\n }, array_keys($this->defaultFields));\n }",
"public function fill($data);",
"public function parsePostData()\n {\n }",
"function getPosts()\n{\n $posts = array();\n $posts[0] = $_POST['id'];\n $posts[1] = $_POST['name'];\n $posts[2] = $_FILES['image'];\n $posts[3] = $_POST['description'];\n return $posts;\n}",
"public function valuesFromPost()\n {\n return $this->setDefaultValues($_POST);\n }",
"protected function setPostData()\n\t{\n\t\t$this->request->addPostFields($this->query->getParams());\n\t}",
"function restore_empty($data, $filed)\n {\n return array_merge(array_fill_keys($filed, ''), $data);\n }",
"protected function makeDataArray($post)\n {\n $data['placeholder'] = Helpers::arrayKeyToVal($post, 'data_placeholder');\n $data['class'] = Helpers::arrayKeyToVal($post, 'data_class');\n\n return $data;\n }",
"function jr_reset_data( $data ) {\r\n\r\n\t$new_data = array();\r\n\tforeach ( $data as $key => $value )\r\n\t\t$new_data[$key] = reset($value);\r\n\r\n\treturn $new_data;\r\n}",
"public function populate($data = array())\n {\n \n if (isset($data['answer']) && $data['answer'] != null) {\n $this->answer = $data['answer'];\n }\n \n if (isset($data['active']) && $data['active'] != null) {\n $this->active = $data['active'];\n }\n\n if (isset($data['beginDate']) && $data['beginDate'] != null) {\n $this->beginDate = $data['beginDate'];\n }\n\n if (isset($data['endedDate']) && $data['endedDate'] != null) {\n $this->endedDate = $data['endedDate'];\n }\n }"
]
| [
"0.64927554",
"0.63897806",
"0.6258024",
"0.62236476",
"0.6085838",
"0.6056641",
"0.59798014",
"0.5969008",
"0.5937234",
"0.59240717",
"0.58949697",
"0.5846285",
"0.5841622",
"0.58127546",
"0.5783581",
"0.5757586",
"0.575017",
"0.5725182",
"0.5720456",
"0.56856984",
"0.56842136",
"0.5660612",
"0.5658659",
"0.56492376",
"0.56456935",
"0.56257975",
"0.56237423",
"0.5606569",
"0.5603581",
"0.5602864"
]
| 0.75827974 | 0 |
Function to insert the affiliate code in an article/email message | function insert_affiliate_code($code, $article_str)
{
return str_replace("=CODE=", "/r/".$code, $article_str);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function hydrate_affiliate_code() {\n\t\tif ( Options::get_affiliate_code() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( FileSystem::file_exists( $file_name ) ) {\n\t\t\t$affiliate_code = trim( FileSystem::get_content( $file_name ) );\n\t\t\tadd_option( 'hubspot_affiliate_code', $affiliate_code );\n\t\t}\n\t}",
"function sw_velocityconveyor_safe_email( $atts, $content ) {\n\nreturn '<a href=\"mailto:' . antispambot( $content ) . '\">' . antispambot( $content ) . '</a>';\n}",
"function tev_email_encode( $atts, $email ){\r\n\t$atts = extract( shortcode_atts( array('email'=>$email),$atts ));\r\n\t\r\n\tif(function_exists('antispambot')){\r\n\t\treturn '<a href=\"'.antispambot(\"mailto:\".$email).'\">'.antispambot($email).'</a>';\r\n\t\t}\r\n}",
"function add_address() {\n\t\t //$mailchimpform = mailchimpSF_signup_form();\n $cont .= '<span class=\"logo-address\">507 Kent Street, Utica, NY 13501 | (315) 797-2233 toll free (877) 719-9996</span>';\n\t \n\t echo $cont;\n }",
"function encode_email($mail, $text=\"\", $class=\"\", $prefix)\n{\n $encmail =\"\";\n for($i=0; $i<strlen($mail); $i++)\n {\n $encMod = rand(0,2);\n switch ($encMod) {\n case 0: // None\n $encmail .= substr($mail,$i,1);\n break;\n case 1: // Decimal\n $encmail .= \"&#\".ord(substr($mail,$i,1)).';';\n break;\n case 2: // Hexadecimal\n $encmail .= \"&#x\".dechex(ord(substr($mail,$i,1))).';';\n break;\n }\n }\n $encprefix =\"\";\n for($i=0; $i<strlen($prefix); $i++)\n {\n $encMod = rand(0,2);\n switch ($encMod) {\n case 0: // None\n $encprefix .= substr($prefix,$i,1);\n break;\n case 1: // Decimal\n $encprefix .= \"&#\".ord(substr($prefix,$i,1)).';';\n break;\n case 2: // Hexadecimal\n $encprefix .= \"&#x\".dechex(ord(substr($prefix,$i,1))).';';\n break;\n }\n }\n\n if(!$text)\n {\n $text = $encmail;\n }\n $encmail = $prefix.$encmail;\n return \"<a class='$class' href='$encmail'>$text</a>\";\n}",
"function addAffiliateNews($aff_id) {\n\t\t\t\n\t\t\t$query = \"INSERT INTO tbl_affiliate_articles(`affiliate_id`,`article_title`,`affiliate_comment`,`created`,`article_type`)\n\t\t\t\t\t VALUES('\".$aff_id.\"','\".$this->mBillContent->article_title.\"','\".$this->mBillContent->affiliate_comment.\"','\".$this->mBillContent->created.\"','\".$this->mBillContent->article_type.\"')\";\t\n\t\t\t\n\t\t\t$rs = $this->Execute($query);\n\t\t\t$news_id=mysql_insert_id();\n\t\t\t$ss_query=\"select subscriber_id from tbl_subscriber where prim_affiliate_id='\".$aff_id.\"' or find_in_set('\".$aff_id.\"',secondary_affiliates)\";\n\t\t\t$ss_result = $this->Execute($ss_query);\n\t\t\twhile($row = $ss_result->FetchRow())\n\t\t\t{\n\t\t\t\t$new_query=\"insert into tbl_affiliate_articles_notifications(`article_id`,`member_id`, `is_new`) values ('\".$news_id.\"',\".$row['subscriber_id'].\",1)\";\n\t\t\t$new_rs = $this->Execute($new_query);\n\t\t\t}\n\t\t\t//$new_query=\"insert into tbl_affiliate_articles_notifications(`article_id`,`member_id`, `is_new`) values ('\".$news_id.\"',(select group_concat(subscriber_id) from tbl_subscriber where prim_affiliate_id='\".$aff_id.\"' or find_in_set('\".$aff_id.\"',secondary_affiliates) group by prim_affiliate_id),1)\";\n\t\t\t\n\t\t\treturn $news_id;\n\n\t\t}",
"function add_actualisation()\n\t{\n\t\t$name=post_param('name');\n\t\t$subject=post_param('subject');\n\t\t$text=post_param('text');\n\t\t$send_time=post_param_integer('send_time');\n\t\tif (get_value('welcome_nw_choice')==='1')\n\t\t{\n\t\t\t$newsletter=post_param_integer('newsletter',NULL);\n\t\t} else\n\t\t{\n\t\t\t$newsletter=post_param_integer('newsletter',0);\n\t\t}\n\t\t$id=ocf_make_welcome_email($name,$subject,$text,$send_time,$newsletter);\n\t\treturn strval($id);\n\t}",
"function InfUpdateAffCode($inf_aff_id, $inf_aff_code) {\n\n\t$affiliate = new Infusionsoft_Affiliate();\n\t$affiliate->Id = $inf_aff_id;\n\t$affiliate->AffCode = $inf_aff_code;\n\t$affiliate->save(); // Update affiliate in Infusionsoft\n}",
"function dt_sc_email($attrs, $content = null) {\n\t\textract ( shortcode_atts ( array (\n\t\t\t\t'title' => '',\n\t\t\t\t'description' =>'',\n\t\t\t\t'icon' => '',\n\t\t\t\t'emailid' => ''\n\t\t), $attrs ) );\n\n\t\t$out = '<div class=\"dt-sc-contact-info\">';\n\t\t$out .= \"<i class='fa {$icon}'></i>\";\n\t\t$out .= \"<span>{$title}</span>\";\n\t\t$out .= ( !empty($emailid) ) ? \"<a href='mailto:$emailid'>{$emailid}</a>\" : \"\";\n\t\t$out .= \"<span class='details'>{$description}</span>\";\n\t\t$out .= '</div>';\n\t\treturn $out;\n\t }",
"function generateApprovedFamMessageBody($sender, $receiver, $family_relation) {\n $receivername = $receiver['first_name'].\" \".$receiver['last_name'];\n $sendername = $sender['first_name'].\" \".$sender['last_name'];\n\n $message = \"\";\n $message .=\"<html><head><title></title></head>\n <body>\n <img src='\".BASE_URL.LOGO_URL.\"'>\n <p>\n \".$receivername.\" approved your MyNotes4u Family Album\n </p>\n </body>\n </html>\";\n return $message;\n}",
"public function portal_affiliates()\n\t{\n \t\tif ( ! $this->settings['portal_show_fav'] )\n \t\t{\n \t\t\treturn;\n \t\t}\n \t\t\n\t\t$this->settings['portal_fav'] = str_replace( \"'\", \"'\", $this->settings['portal_fav'] );\n\t\t$this->settings['portal_fav'] = str_replace( \""\", '\"', $this->settings['portal_fav'] );\n\t\t$this->settings['portal_fav'] = str_replace( '{board_url}', $this->settings['base_url'], $this->settings['portal_fav'] );\n \t\t\n \t\treturn $this->registry->getClass('output')->getTemplate('portal')->affiliates();\n \t}",
"function generateApprovedFriMessageBody($sender, $receiver) {\n $receivername = $receiver['first_name'].\" \".$receiver['last_name'];\n $sendername = $sender['first_name'].\" \".$sender['last_name'];\n\n $message = \"\";\n $message .=\"<html><head><title></title></head>\n <body>\n <img src='\".BASE_URL.LOGO_URL.\"'>\n <p>\".$receivername.\" approved your MyNotes4u Friend Album</p>\n </body>\n </html>\";\n return $message;\n}",
"function encode_email_address( $email ) {\n\n $output = '';\n\n for ($i = 0; $i < strlen($email); $i++) \n { \n $output .= '&#'.ord($email[$i]).';'; \n }\n\n return $output;\n}",
"function generateInviteFriMessageBody($user, $receiver_name, $ref_code) {\n $join_url = BASE_URL.\"/register.php?ref=\".$ref_code;\n $sender_name = $user['first_name'].\" \".$user['last_name'];\n $message = \"\";\n\n $message .=\"<html><head><title></title></head>\n <body>\n <img src='\".BASE_URL.LOGO_URL.\"'>\n <p>Hello \".$receiver_name.\",</p>\n <p>\n \".$sender_name.\" has invited you to join MyNotes4U.\n An exciting new way for family end friends to 'do life' together.\n Share comments, pictures and videos free from all of today's social media worries.\n No more selling of your information or tracking of your online habits.\n </p>\n <p>\n Try it out for free at <a href=\".BASE_URL.\">MyNotes4U.com</a>.\n Your first 30 days are on us.\n </p>\n <br>\n <p>\n MyNotes4U is a secure, non-intrusive, exclusive meeting place for you and your circle of family\n and friends. But that's not all. It's also a place where you can build and\n store your life's personal treasures. Are you an artist, a musician, a writer, a builder,\n a sport enthusiast, an athlete, etc? If so, MyNotes4U is an easy and exciting way to \n keep your lifetime of treasures in one secure and organized location. \n </p>\n <p>\n Becoming a member of MyNotes4U gives you:\n <ul>\n <li>\n Three private exclusive albums.\n <ul>\n <li>\n My Album - Your own private space. A place where you can write and store \n your memoirs to be discovered by future generations - your very own time \n capsule.\n </li>\n <li>\n My Family Album - A place to 'do life' exclusively with your family. You \n choose who can be a part of your album.\n </li>\n <li>\n My Friends Album - A private place to hang-out with your close friends, share\n special occasions, challenges, adventures, feelings and thoughts.\n </li>\n </ul>\n </li>\n <li>\n Meet other members of MyNotes4U by becoming a part of group \n where you can share recipes, church gatherings, home remodeling or \n repair ideas, sporting events and more.\n </li>\n </ul>\n </p>\n <p>\n Perhaps the most intriguing part of MyNotes4U is that it \n doesn't have to end. When you store your memories with us, \n we will preserve them for your future generations. Now you \n can have a voice into the lives of love ones you haven't met. \n your great, great, great grandchildren can know you intimately. \n Discover who you are. That's a game changer.\n </p>\n <br>\n <p>\n Try it out for free at <a href=\".BASE_URL.\">MyNotes4U.com</a>.\n Your first 30 days are on us.\n </p>\n </body>\n </html>\";\n return $message;\n}",
"function email_activation($activationCode,$form)\n\t{\n\t\t$emailaddress = $this->namedFields['email']->getData();\n\t\t$site_address = SITE_ADDRESS;\n $site_address .= (substr(SITE_ADDRESS, -1) == '/') ? '' : '/';\n\t\t$link = $site_address.'sign_up?activate_code='.$activationCode;\n\t\t$body = \"<!DOCTYPE html PUBLIC \\\"-//W3C//DTD XHTML 1.0 Transitional//EN\\\" \\\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\\\"><html xmlns=\\\"http://www.w3.org/1999/xhtml\\\" lang=\\\"en\\\" xml:lang=\\\"en\\\"><head><title>Church Growth Research Programme</title><style type=\\\"text/css\\\"><!-- body { background:#ffffff; margin:0; padding:0; } p { font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#000000; line-height:22px; margin:10px 0px 10px 0px; text-align:left; } h1, h2, h3, h4, h5, h6 { font-family:Arial, Helvetica, sans-serif; } a { color:#2a6307; outline:none; text-decoration:underline; } a:hover { color:#569823; text-decoration:underline; } --> </style></head><body bgcolor=\\\"#fff\\\"><div align=\\\"center\\\"><table width=\\\"600\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" style=\\\"border:none;\\\"><tbody><tr><td><img width=\\\"600\\\" vspace=\\\"0\\\" hspace=\\\"0\\\" height=\\\"188\\\" border=\\\"0\\\" align=\\\"top\\\" src=\\\"http://www.churchgrowthresearch.org.uk/images/emailheader.jpg\\\" alt=\\\"Church Growth Research Programme\\\" /></td></tr><tr><td bgcolor=\\\"#fbf5de\\\" style=\\\"padding:0px 30px 0px 30px;\\\"><p>Welcome to the Church Growth Research Programme.</p><p>Please click on the link below to activate your account:<p>\".\n\t\t\t\"<p><a href=\\\"$link\\\">$link</a></p><p>Thank you, the Church Growth Reseach Programme website team.</p>\".\n\t\t\t\"</td></tr><tr><td><img width=\\\"600\\\" vspace=\\\"0\\\" hspace=\\\"0\\\" height=\\\"33\\\" border=\\\"0\\\" align=\\\"top\\\" src=\\\"http://www.churchgrowthresearch.org.uk/images/emailfooter.jpg\\\" alt=\\\"Church Growth Research Programme\\\" /></td></tr></tbody></table></div></body></html>\";\n\t\t$from_email_address = $form['email'];\n\t\t$this->send_mail($emailaddress, SITE_NAME, $from_email_address, 'Account Activation', $body, $body_text);\n\n\t}",
"function comment_author_email_link($link_text = '', $before = '', $after = '', $comment = \\null)\n {\n }",
"function webpinas_glf_email_sc($message_with_sc, $data){\n$search = array(\n '[webpinas_venue_address]',\n '[webpinas_suburb]', \n '[webpinas_post_code]', \n '[webpinas_booking_date]', \n '[webpinas_contact_name]', \n '[webpinas_contact_email]',\n '[webpinas_contact_phone]',\n '[webpinas_ip_address]'\n );\n$replace = array(\n $data['venue_address'], // value for [webpinas_venue_address]\n $data['suburb'], // value for [webpinas_suburb]\n $data['post_code'], // value for [webpinas_post_code]\n $data['booking_date'], // value for [webpinas_booking_date]\n $data['contact_name'], // value for [webpinas_contact_name]\n $data['contact_email'], // value for [webpinas_contact_email]\n $data['contact_phone'], // value for [webpinas_contact_phone]\n get_client_ip(), // value for [webpinas_ip_address]\n );\n return $replaced_message = str_replace ( $search, $replace , $message_with_sc );\n}",
"function saveAffiliate($userID,$articleID,$affiliateID)\n\t\t{\t\n\t\t\t/*make it primary */\n\t\t\t$query = \"update `tbl_subscriber` set `prim_affiliate_id` = '\".$affiliateID.\"' \n\t\t\t\twhere `subscriber_id` = '\".$userID.\"'\"; \t\t\t\n\t\t\t\t\n\t\t\t$status\t\t=\t$this->Execute($query);\t\t\n\t\t\t\n\t\t\t/*\n\t\t\t$secondary_affiliates = array();\n\t\t\t$query =\t\"select secondary_affiliates from `tbl_subscriber` where `subscriber_id` = '\".$userID.\"'\";\t\t\t\n\t\t\t$rs\t\t=\t$this->Execute($query);\t\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\tif(is_object($rs))\n\t\t\t{\n\t\t\t\tif(($row =\t$rs->FetchRow()))\t\t\t\t\n\t\t\t\t{\t\n\t\t\t\t\t$secondary_affiliates = explode(\",\",$row[\"secondary_affiliates\"]);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tif(!in_array($affiliateID,$secondary_affiliates ))\n\t\t\t{\n\t\t\t\tarray_push($secondary_affiliates ,$affiliateID);\t\t\t\t\n\t\t\t\t$secondary_affiliates_string = implode(\",\",$secondary_affiliates);\t\t\t\t\n\t\t\t\t$query = \"update `tbl_subscriber` set `secondary_affiliates` = '\".$secondary_affiliates_string.\"' \n\t\t\t\twhere `subscriber_id` = '\".$userID.\"'\"; \t\t\t\n\t\t\t\t$status\t\t=\t$this->Execute($query);\t\t\t\t\n\t\t\t}\n\t\t\t*/\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t}",
"public function getAffiliateCode()\n {\n return isset($this->AffiliateCode) ? $this->AffiliateCode : null;\n }",
"function the_author_aim()\n {\n }",
"function get_the_author_aim()\n {\n }",
"public function feide_affiliation() {\n\t\t\t$this->feide_affiliation = array_map('strtolower', $this->attributes['eduPersonAffiliation']);\n\n\t\t\treturn $this->feide_affiliation;\n\t\t}",
"function addAffiliateMain($oAffiliate)\n\t\t{\n\t\t\t$query = \"insert into tbl_member set \n\t\t\tfirst_name='\".$oAffiliate->first_name.\"'\n\t\t\t,last_name='\".$oAffiliate->last_name.\"'\n\t\t\t,user_name='\".$oAffiliate->username.\"'\n\t\t\t,email='\".$oAffiliate->email.\"'\n\t\t\t,isActive='n'\n\t\t\t,password=md5('\".$oAffiliate->password.\"')\n\t\t\t,member_type='affiliate'\n\t\t\t,reg_date=now()\";\n\t\t\t\n\t\t\t$rs = $this->Execute($query);\n\t\t\t$newid= mysql_insert_id();\n\t\t\t\n\t\t\t$oAffiliate->affiliate_code = $oAffiliate->affiliate_code.$newid;\n\t\t\t\n\t\t\t$query_affiliate = \"insert into tbl_affiliate set \n\t\t\taffiliate_id = '\".$newid.\"'\n\t\t\t,organisation_name = '\".$oAffiliate->organisation_name.\"'\n\t\t\t,affiliate_code = '\".$oAffiliate->affiliate_code.\"'\n\t\t\t,description = '\".$oAffiliate->description.\"'\t\t\t\n\t\t\t,organisation_website ='\".$oAffiliate->organisation_website.\"'\n\t\t\t,street_address = '\".$oAffiliate->address.\"'\n\t\t\t,city = '\".$oAffiliate->city.\"'\n\t\t\t,state = '\".$oAffiliate->state.\"'\n\t\t\t,zip_code = '\".$oAffiliate->postal_code.\"'\";\n\t\t\t\n\t\t\t$rs_affiliate = $this->Execute($query_affiliate);\n\t\t\t\n\t\t\treturn $newid;\n\t\t}",
"function addAffiliateBill($aff_id)\n\t\t{\t\n\t\t\t/*\n\t\t\t\techo \"<pre>\";\n\t\t\t\tprint_r($this->mBillContent);\n\t\t\t\tdie();\n\t\t\t*/\n\t\t\t$query = \"INSERT INTO tbl_affiliate_articles(`affiliate_id`,`article_title`,`bill_number`,`legtype`,`indication_of_position`,\n\t\t\t\t\t `voting_start`,`voting_end`,`allow_voting`,`affiliate_comment`,`created`,`article_type`,`petition_level`,`petition_state`)\n\t\t\t\t\t VALUES('\".$aff_id.\"','\".$this->mBillContent->article_title.\"','\".$this->mBillContent->bill_number.\"',\n\t\t\t\t\t '\".$this->mBillContent->legtype.\"',\n\t\t\t\t\t '\".$this->mBillContent->indication_position.\"','\".$this->mBillContent->voting_start.\"',\n\t\t\t\t\t '\".$this->mBillContent->voting_end.\"','\".$this->mBillContent->allow_voting.\"',\n\t\t\t\t\t '\".$this->mBillContent->affiliate_comment.\"','\".$this->mBillContent->created.\"',\n\t\t\t\t\t '\".$this->mBillContent->article_type.\"','\".$this->mBillContent->petition_level.\"','\".$this->mBillContent->petition_state.\"')\";\t\n\t\t\t\n\t\t\t\n\t\t\t$rs = $this->Execute($query);\n\t\t\t$bill_id=mysql_insert_id();\n\t\t\t$ss_query=\"select subscriber_id from tbl_subscriber where prim_affiliate_id='\".$aff_id.\"' or find_in_set('\".$aff_id.\"',secondary_affiliates)\";\n\t\t\t$ss_result = $this->Execute($ss_query);\n\t\t\twhile($row = $ss_result->FetchRow())\n\t\t\t{\n\t\t\t\t$new_query=\"insert into tbl_affiliate_articles_notifications(`article_id`,`member_id`, `is_new`) values ('\".$bill_id.\"',\".$row['subscriber_id'].\",1)\";\n\t\t\t$new_rs = $this->Execute($new_query);\n\t\t\t}\n\t\t\t\n\t\t\t\t\t\treturn $bill_id;\n\t\t\t\n\t\t}",
"function netfunktheme_company_meta( $atts ){\n\t\n\textract( shortcode_atts( array(\n\t\t'user_id' => '0',\n\t), $atts ) );\n\t\n\t$author_title_meta = '';\n\t\n\tif ($atts['user_id'] != 0) {\n\n\t\t$author_title_meta .= '<p class=\"lb-shortcode-meta lb_company_meta\">';\n\n\t\t$author_title_meta .= '<strong><a href=\"';\n\n\t\t$author_title_meta .= home_url() . '/author/'.get_the_author_meta('user_nicename',$atts['user_id']);\n\n\t\t$author_title_meta .= '\">';\n\n\t\t$author_title_meta .= get_the_author_meta('display_name',$atts['user_id']);\n\n\t\t$author_title_meta .= '</a></strong>';\t\n\n\t\t$author_title_meta .= ', ';\n\n\t\t$author_title_meta .= '<em>';\n\n\t\t$author_title_meta .= get_the_author_meta('lb_title',$atts['user_id']);\n\t\t\n\t\t$author_title_meta .= '</em>';\n\t\t\n\t\t$author_title_meta .= '</p>';\n\n\t}\n\t\n\treturn $author_title_meta;\n\t\n}",
"function SimplonShortcode() {\n\treturn '<p>La publication de cet article est possible grace à mon super partenaire \n<a href=\"http//simplon.co\">simplon.co</a>\n - une entreprise de \nl\\'économie sociale et solidaire et un\nréseau de \"fabriques\" (écoles) qui propose \ndes\nformations\nGRATUITES\npour devenir développeur web. </p>';\n}",
"function generer_alexa(){\n\t/* CONFIG */\n\t$config = unserialize($GLOBALS['meta']['seo']);\n\n\tif ($config['alexa']['id'])\n\t\treturn '<meta name=\"alexaVerifyID\" content=\"' . $config['alexa']['id'] . '\"/>';\n}",
"function PromoCodeAffiliate($IId=array(),$p_code)\n\t\t{\n\t\t\t$sSQL\t=\t\"UPDATE tbl_affiliate set promo_code='\".$p_code.\"' WHERE affiliate_id in('\".implode(\"','\", $IId).\"')\";\n\t\t\t$response = $this->Execute($sSQL);\n\t\t\t\n\t\t\t$emailList = array();\n\t\t\t$ss_query = \"select first_name, last_name, email from tbl_member WHERE member_id in('\".implode(\"','\", $IId).\"')\";\n\t\t\t$arrayCnt = 0;\n\t\t\t$ss_result = $this->Execute($ss_query);\n\t\t\twhile($row = $ss_result->FetchRow())\n\t\t\t{\n\t\t\t\t$emailList[$arrayCnt]['first_name'] = $row['first_name'];\n\t\t\t\t$emailList[$arrayCnt]['last_name'] = $row['last_name'];\n\t\t\t\t$emailList[$arrayCnt]['email'] = $row['email'];\t\t\t\t\t\t\t\t\n\t\t\t\t$arrayCnt++;\n\t\t\t}\t\t\t\t\n\t\t\treturn $emailList;\n\t\t\t//return $response;\n\t\t}",
"function section_text_nr_ad() {\n\t\t_e('<p>Become a part of the nrelate advertising network and earn some extra money on your blog. Click on the ADVERTISING tab of a participating nRelate product settings page.</p>','nrelate');\n}",
"function netfunktheme_author_desc_shortcode( $atts ){\n\t\n\textract( shortcode_atts( array(\n\t\t'user_id' => '0'\n\t), $atts ) );\n\t\n\t$author_description = '';\n\t\n\tif ($atts['user_id'] != 0) {\n\n\t\t$author_description = get_the_author_meta('lb_about',$atts['user_id']);\n\n\t}\n\t\n\t$author_description = str_replace('/n','<br />',$author_description);\n\t$author_description = str_replace('/r','<br />',$author_description);\n\t\n\treturn '<p class=\"lb-shortcode-meta lb_author_description\">' . $author_description . '</p>';\n\t\n}"
]
| [
"0.5876296",
"0.585284",
"0.5842309",
"0.57524246",
"0.57506824",
"0.57217604",
"0.5704072",
"0.56427515",
"0.560643",
"0.555115",
"0.5542048",
"0.54889417",
"0.5465802",
"0.5433647",
"0.5429607",
"0.5385494",
"0.53777933",
"0.5369763",
"0.53680515",
"0.53601885",
"0.5348619",
"0.53058434",
"0.5303232",
"0.5299953",
"0.529114",
"0.5289242",
"0.5284321",
"0.5281566",
"0.52780956",
"0.527647"
]
| 0.7811892 | 0 |
Function to paginate a list given its query and other data | function paginate_list($obj, $data, $query_code, $variable_array=array(), $rows_per_page=NUM_OF_ROWS_PER_PAGE)
{
#determine the page to show
if(!empty($data['p'])){
$data['current_list_page'] = $data['p'];
} else {
#If it is an array of results
if(is_array($query_code))
{
$obj->session->set_userdata('search_total_results', count($query_code));
}
#If it is a real query
else
{
if(empty($variable_array['limittext']))
{
$variable_array['limittext'] = '';
}
#echo $obj->Query_reader->get_query_by_code($query_code, $variable_array );
#exit($query_code);
$list_result = $obj->db->query($obj->Query_reader->get_query_by_code($query_code, $variable_array ));
$obj->session->set_userdata('search_total_results', $list_result->num_rows());
}
$data['current_list_page'] = 1;
}
$data['rows_per_page'] = $rows_per_page;
$start = ($data['current_list_page']-1)*$rows_per_page;
#If it is an array of results
if(is_array($query_code))
{
$data['page_list'] = array_slice($query_code, $start, $rows_per_page);
}
else
{
$limittxt = " LIMIT ".$start." , ".$rows_per_page;
$list_result = $obj->db->query($obj->Query_reader->get_query_by_code($query_code, array_merge($variable_array, array('limittext'=>$limittxt)) ));
$data['page_list'] = $list_result->result_array();
}
return $data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pagination(){}",
"private function paginate()\n\t{\n\t\tif ($this->_listModel) {\n\t\t\t$this->_listModel->loadNextPage();\n\t\t}\n\t}",
"abstract public function preparePagination();",
"public function getPaginatedList($offset, $limit, $criteria = array());",
"protected function buildPagination() {}",
"protected function buildPagination() {}",
"public function getPaginated();",
"function getPagedStatement($sql,$page,$items_per_page);",
"public function paginate(Request $request);",
"public function paginate()\n {\n }",
"public function paginate($limit, array $params = null);",
"function pager($current_page, $records_per_page, $pages_per_pageList, $dataQuery, $countQuery){\n $obj->record = array(); // beinhaltet ein Arrray des objects mit Daten worüber dann zugegriffen wird.\n $obj->current_page = $current_page; // Startet mit 0!\n $obj->total_cur_page = 0; // shows how many records belong to current page\n $obj->records_per_page = 0;\n $obj->total_records = 0;\n $obj->total_pages = 0;\n $obj->preceding = false; // Ist true wenn es eine Seite vor der angezeigten gibt.\n $obj->subsequent = false; // Ist true wenn es eine Seite nach der angezeigten gibt.\n $obj->pages_per_pageList = 10; //$pages_per_pageList;\n $result=mysql_query($countQuery, $this->CONNECTION);\n $obj->total_records = mysql_num_rows($result);\n if($obj->total_records>0){\n $obj->record = $this->select($dataQuery);\n $obj->total_cur_page = sizeof($obj->record);\n $obj->records_per_page = $records_per_page;\n $obj->total_pages = ceil($obj->total_records/$records_per_page);\n $obj->offset_page = $obj->pages_per_pageList*floor($obj->current_page/$obj->pages_per_pageList);\n $obj->total_pages_in_pageList = $obj->total_pages-($obj->offset_page+$obj->pages_per_pageList);\n $obj->last_page_in_pageList = $obj->offset_page+$obj->pages_per_pageList;\n if($obj->last_page_in_pageList>$obj->total_pages) $obj->last_page_in_pageList=$obj->total_pages;\n if($obj->offset_page>0) $obj->pageList_preceding=true;\n else $obj->pageList_preceding=false;\n if($obj->last_page_in_pageList<$obj->total_pages) $obj->pageList_subsequent=true;\n else $obj->pageList_subsequent=false;\n if($obj->current_page>1) $obj->preceding=true;\n if($obj->current_page<$obj->total_pages) $obj->subsequent=true;\n }\n return $obj;\n }",
"public function paginated_list(Request $request){\n $max_per_paginate = 8;\n\n if($request->filter_mode == true || $request->filter_mode == 'true'){\n $filter = $request->filter;\n $data = Event::orderByDesc('started_date')->where('type', '1')->where('name', 'like', \"%$filter%\");\n } else {\n $data = Event::orderByDesc('started_date')->where('type', '1');\n }\n \n $count = $data->count();\n $paginate_count = ceil( $count / $max_per_paginate );\n\n $res = $data->skip( ($request->paginate_position-1)*$max_per_paginate )->take( $max_per_paginate )->get();\n\n return response()->json(['data' => $res, 'paginate_count' => $paginate_count]);\n }",
"private function paginateList($query)\n {\n $this->setAttribute('list', $query->paginate($this->rowsNumber));\n $this->list->appends([\n 'rowsNumber' => $this->rowsNumber,\n 'search' => $this->search,\n 'sortBy' => $this->sortBy,\n 'sortDir' => $this->sortDir,\n ]);\n }",
"public function paginateQuery($query, $key='page', $max=5, $range=2, $url='', $delim='&page=$1', $display=array('first'=>'|<<', 'prev'=>'<', 'next'=>'>', 'last'=>'>>|')) {\n // initialisation\n $paginatedQuery = array();\n if(!isset($_GET[$key])) {\n $_GET[$key] = 1; // so if GET isn't set, it still shows the first page's results\n }\n \n // gets total pages and results\n $paginatedQuery['totalnum'] = count($query);\n $paginatedQuery['pages'] = ceil($paginatedQuery['totalnum']/$max);\n $paginatedQuery['results'] = array_slice($query, ($max*($_GET[$key]-1)), $max, true);\n $paginatedQuery['resultsnum'] = count($paginatedQuery['results']); \n \n // formats paginated links\n // current\n $current = $_GET[$key];\n \n // first\n $first = 1;\n \n // prev\n if ($current==1) $prev = 1; \n else $prev = $current-1;\n \n // next\n if ($paginatedQuery['totalnum']==1) $next = 1; \n else $next = $current+1;\n \n // last\n $last = $paginatedQuery['pages'];\n \n // display \n $paginatedQuery['links'] = ''; // initialisation\n \n // first, prev\n if($current!=$first) $paginatedQuery['links'] = '<a class=\"first\" href=\"'.$url.str_replace('$1', $first, $delim).'\">'.$display['first'].'</a>'.\"\\n\".'<a class=\"prev\" href=\"'.$url.str_replace('$1', $prev, $delim).'\">'.$display['prev'].'</a>'.\"\\n\";\n \n // numbers\n for ($i = ($current - $range); $i < ($current + $range + 1); $i++) {\n if ($i > 0 && $i <= $paginatedQuery['pages']) {\n // current\n if ($i==$current) {\n $paginatedQuery['links'] .= '<span class=\"current\">'.$i.'</span>'.\"\\n\";\n }\n // link\n else {\n $paginatedQuery['links'] .= '<a class=\"page\" href=\"'.$url.str_replace('$1', $i, $delim).'\">'.$i.'</a>'.\"\\n\";\n }\n }\n }\n \n // next, last\n if($current!=$last) $paginatedQuery['links'] .= '<a class=\"next\" href=\"'.$url.str_replace('$1', $next, $delim).'\">'.$display['next'].'</a>'.\"\\n\".'<a class=\"last\" href=\"'.$url.str_replace('$1', $last, $delim).'\">'.$display['last'].'</a>';\n \n // return array\n return $paginatedQuery;\n }",
"function getPagelist($sql = '', $fields = array(), $mod = array())\n{\n $count = count(db(sql));\n $totalNum = ceil($count / PAGE_NUM);\n $path = $request_url['path'];\n\n $page = (isset($_GET['page']) && $_GET['page'] != '') ? $_GET['page'];\n// 组装limit语句\n $limit = 'LIMIT' . ($page - 1) * PAGE_NUM . ',' . PAGE_NUM;\n $datas = db($sql, $limit);\n $html = getTable($datas, $fields, $mod);\n $start = ($page - PAGE_OFFSET) > 0 ? $page - PAGE_OFFSET : 1;//获取左侧位置的偏移\n $end = ($page + PAGE_OFFSET) < $totalNum ? $page + PAGE_OFFSET : $totalNum;\n $html .= '<div class=\"page\">';\n if ($page > 1) {\n $html .= '<a href=\"' . $path . '?page=' . ($page - 1) . '\">上一页</a>';\n $html .= '<a href=\"' . $path . '?page=1\">首页</a>';\n }\n for($i = $start;$i<=$end;$i++)\n {\n $class = ($i==$page)?'class=\"on\"':'';\n $html .='<a href =\"'.$path.'?page='.$i.'\"'.$class.'>'.$i.'</a>';\n\n\n }\n if ($page < $totalNum) {\n ;\n $html .= '<a href=\"' . $path . '?page='.$totalNum.'\">尾页</a>';\n $html .= '<a href=\"' . $path . '?page='.($page+1).'\">下一页</a>';\n }\n $html .='共'.$totalNum.'页';\n $html .='</div>';\n return $html;\n}",
"public function do_paging()\n {\n }",
"function paginateWithExtra($size = 15);",
"function fetchList($limit, $offset);",
"protected function paginateQuery(&$query) {\n $start = 0;\n $limit = 30;\n if(Input::has('offset')) {\n $start = intval(Input::get('offset'));\n }\n if(Input::has('limit')) {\n $limit = intval(Input::get('limit'));\n }\n $query->skip($start)->take($limit);\n }",
"function wyz_paginate_business_list() {\n\t$nonce = filter_input( INPUT_POST, 'nonce' );\n\t/*if ( ! wp_verify_nonce( $nonce, 'wyz_ajax_custom_nonce' ) ) {\n\t\twp_die( 'busted' );\n\t}*/\n\n\t$offset = filter_input( INPUT_POST, 'offset' );\n\t$posts_per_page = filter_input( INPUT_POST, 'posts-per-page' );\n\t$business_ids = json_decode(stripslashes($_POST['business_ids']));\n\t$is_grid_view = filter_input( INPUT_POST, 'is-grid' );\n\n\tif ( empty( $business_ids ) || '' == $offset || 0 > $offset ) {\n\t\twp_die( '' );\n\t}\n\n\t$business_list = '';\n\n\t$featured_posts_per_page = get_option( 'wyz_featured_posts_perpage', 2 );\n\t\n\t$args = array(\n\t\t'post_type' => 'wyz_business',\n\t\t'posts_per_page' => $posts_per_page + $featured_posts_per_page ,\n\t\t'post__in' => $business_ids,\n\t\t'paged' => $offset,\n\t\t'orderby' => 'post__in',\n\t);\n\n\n\t$query = new WP_Query( $args );\n\n\t$current_b_ids = array();\n\n\twhile ( $query->have_posts() ) {\n\n\t\t$query->the_post();\n\t\t$b_id = get_the_ID();\n\t\tarray_push( $current_b_ids, $b_id );\n\t\tif ( $is_grid_view ) {\n\t\t\t$business_list .= WyzBusinessPost::wyz_create_business_grid_look();\n\t\t} else {\n\t\t\t$business_list .= WyzBusinessPost::wyz_create_business();\n\t\t}\n\t}\n\t$remaining_pages = ceil( ( (sizeof( $business_ids ) ) / ( float ) ($posts_per_page + + $featured_posts_per_page) ) ) - $offset;\n\twp_reset_postdata();\n\n// Let prepare Essential Grid Shortcode\n\t$ess_grid_shortcode ='';\n\n\tif ( function_exists( 'wyz_get_theme_template' ) ) {\n\t\t$template_type = wyz_get_theme_template();\n\t\t\n\t\tif ( $template_type == 2 ) {\n\t\t\t$grid_alias = wyz_get_option( 'listing_archives_ess_grid' );\n\t\t\t$ess_grid_shortcode = do_shortcode( '[ess_grid alias=\"' . $grid_alias .'\" posts='.implode(',',$current_b_ids).']' );\n\t\t}\n\t}\n\n\t$data = array(\n\t\t'businessList' => $business_list,\n\t\t'hasAfter' => ( $remaining_pages > 0 ),\n\t\t'hasBefore' => ( 1 < $offset ),\n\t\t'ess_grid_shortcode' => $ess_grid_shortcode,\n\t);\n\n\twp_die( wp_json_encode( $data ) );\n\n}",
"protected function paginate_results($query, Request $request = null){\n\n \t$page = 1;\n \t$number_per_page = env(\"NUMBER_PER_PAGE_API_RESPONSE\");\n\n \tif( $request && $request->has('page') ){\n \t\t$page = $request->input('page');\n \t}\n\n \tif( $request && $request->has('pagination.page') ){\n \t\t$page = $request->pagination['page'];\n \t}\n\n \tif( $request && $request->has('pagination.number_per_page') ){\n \t\t$number_per_page = $request->pagination['number_per_page'];\n \t} \n\n \tif( $number_per_page == \"0\" || $number_per_page === 0 || !$number_per_page ){\n \t\t$number_per_page = $query->count();\n \t}\n\n \treturn $query->paginate($number_per_page, ['*'], 'page', $page);\n \t\n }",
"public function getPaginate ($p_rowsPerPage, $p_currentPage);",
"public function findPaginate(array $data): array\n {\n }",
"public function paginate($orderBy = 'nome', $perPage = 10);",
"function paginate() {\n\t\t$all_rs = $this->db->query($this->sql );\n\t\t$this->total_rows = $all_rs->num_rows;\n\t\t\n\t\t//Return FALSE if no rows found\n\t\tif ($this->total_rows == 0) {\n\t\t\tif ($this->debug)\n\t\t\t\techo \"Query returned zero rows.\";\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t//Max number of pages\n\t\t$this->max_pages = ceil($this->total_rows / $this->rows_per_page );\n\t\tif ($this->links_per_page > $this->max_pages) {\n\t\t\t$this->links_per_page = $this->max_pages;\n\t\t}\n\t\t\n\t\t//Check the page value just in case someone is trying to input an aribitrary value\n\t\tif ($this->page > $this->max_pages || $this->page <= 0) {\n\t\t\t$this->page = 1;\n\t\t}\n\t\t\n\t\t//Calculate Offset\n\t\t$this->offset = $this->rows_per_page * ($this->page - 1);\n\t\t\n\t\t//Fetch the required result set\n\t\t$rs = $this->db->query($this->sql . \" LIMIT {$this->offset}, {$this->rows_per_page}\" );\n\t\t$this->data = $rs->rows;\n\t}",
"public function listItems($param = null){\n $query = $this->orderBy('id', 'ASC')->paginate(5);\n return $query;\n }",
"function get_paged_list($limit = 10, $offset = 0){\n\t $this->db->join('department', 'department.id = employee.Department');\n $this->db->order_by('EmployeeId','asc');\n return $this->db->get($this->tbl_Employeeinfo, $limit, $offset);\n }",
"function results_are_paged()\n {\n }",
"public function paginate_search($take = 10, $search = null, $status = null);"
]
| [
"0.7222905",
"0.72208065",
"0.7182408",
"0.71661633",
"0.70872843",
"0.70872843",
"0.7058382",
"0.69244176",
"0.6875877",
"0.68395174",
"0.678126",
"0.6746821",
"0.67376673",
"0.6691035",
"0.6625914",
"0.65949976",
"0.6564546",
"0.6557994",
"0.65425414",
"0.6515677",
"0.650424",
"0.6503605",
"0.64955777",
"0.6493522",
"0.6486931",
"0.64767843",
"0.64756346",
"0.64154685",
"0.6412114",
"0.6378862"
]
| 0.761344 | 0 |
Function to generate a stamp for the searching user session | function get_search_stamp($obj)
{
return strtotime('now')."_".$obj->input->ip_address();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generate_email_tracking_string($obj)\n{\n\tif($obj->session->userdata('userid'))\n\t{\n\t\t$tracking_id = $obj->session->userdata('userid').\"-\".strtotime('now');\n\t}\n\telse\n\t{\n\t\t$tracking_id = \"SF-\".strtotime('now');\n\t}\n\t\n\treturn \"Email Tracking ID: \".$tracking_id;\n}",
"function get_revision_stamp($obj)\n{\n\tif($obj->session->userdata('editsessionid')){\n\t\t$revisionstamp = $obj->session->userdata('editsessionid');\n\t}\n\telse\n\t{\n\t\t$revisionstamp = strtotime('now');\n\t\t$obj->session->set_userdata('editsessionid', $revisionstamp);\n\t}\n\treturn $revisionstamp;\n}",
"function logevent($action) {\n require 'mgstats.php';\n //Pull the username or enter \"Not Logged In\"\n if($_SESSION['username']) { $remoteUN = $_SESSION['username']; } else { $remoteUN = \"Not Logged In\"; } \n $logTime = date('Y-m-d H:i:s'); //Establish Log time.\n $sid = session_id(); //Session ID\n $entry = $logTime.\"|\".$action.\"|\".$_SERVER['REMOTE_ADDR'].\"|\".$_SERVER['HTTP_USER_AGENT'].\"|\".$remoteUN.\"|\".$sid.\"\\n\"; //Create the variable for log entry\n $filename = \"logs/\".date('Y-m-d').\".log\"; //Build filename, changes by day.\n file_put_contents($filename,$entry, FILE_APPEND); //Appends the entry to the log file.\n return;\n}",
"private static function generate_timestamp() {\n return time();\n }",
"private static function generate_timestamp()\n {\n return time();\n }",
"private function sessionId()\n\t{\n\t\treturn md5(sha1(sha1(microtime() . rand(1111111, 9999999))));\n\t}",
"function alog($line){\n $cur_user = $_SESSION['user']['user_username'];\n $time = getTimestamp();\n writeLineToLog(\"$time - $cur_user - $line\");\n}",
"public static function get_timestamp() {\n\t\treturn floor(microtime(true)/self::keyRegeneration);\n\t}",
"protected function getTimeStamp() {\n return time().' ('.strftime( '%Y.%m.%d %H:%I:%S', time() ).')';\n }",
"function genAuthToken(){\n $timestamp = time();\n $username = $_SESSION['userid'];\n $random = rand(0, 50);\n \n return md5( \"YANS\" . $timestamp . $username . $random );\n }",
"public function getInstanceUserActionTimestamp()\n {\n try\n {\n $luats = self::getSessionValue('InstanceUserActionTimestamp');\n return $luats;\n } catch (\\Exception $ex) {\n throw $ex;\n }\n }",
"private static function timestamp(){\n date_default_timezone_set('Africa/Nairobi');\n $time = time();\n return date(\"Y-m-d G:i:s\", $time);\n }",
"public static function timestamp() {}",
"function timeStamp()\n {\n return date(\"YmdHis\");\n }",
"protected function calculateSessionId()\n {\n return substr(md5(uniqid()), 0, 26);\n }",
"abstract public function getTstamp();",
"function timeStamp(){\n\t\techo date(\"is\");\n\t}",
"private static function timeStamp() {\n return date(\"Y-m-d H:i:s\");\n }",
"function generate_action_token($timestamp)\n {\n \t// Get input values\n \t$site_secret = get_site_secret();\n \t\n \t// Current session id\n \t$session_id = session_id();\n \t\n \t// Get user agent\n \t$ua = $_SERVER['HTTP_USER_AGENT'];\n \t\n \t// Session token\n \t$st = $_SESSION['__elgg_session'];\n \t\n \tif (($site_secret) && ($session_id))\n \t\treturn md5($site_secret.$timestamp.$session_id.$ua.$st);\n \t\n \treturn false;\n }",
"function timeStamp( $returnNow = false )\r\n {\r\n if ( $returnNow == true )\r\n return mktime();\r\n else\r\n return $this->hour() * 3600 + $this->minute() * 60 + $this->second();\r\n }",
"protected function getTimestamp()\r\n {\r\n return gmdate(\"Y-m-d\\TH:i:s.\\\\0\\\\0\\\\0\\\\Z\", time());\r\n }",
"public function getStamp()\n {\n $this->_init();\n return $this->_list_cache->getStamp();\n }",
"function timeStamp() {\r\n\t\t$php_timestamp = time();\r\n\t\t$stamp = date(\" h:i:s A - m/d/Y\", $php_timestamp);\r\n\t\treturn $stamp;\r\n\t}",
"protected function createTokenTimestamp(): int\n {\n return time();\n }",
"public function getStamp()\n {\n return pack('Nn', time(), mt_rand());\n }",
"protected function getTimeStamp()\n {\n return time() . ' (' . strftime('%Y.%m.%d %H:%I:%S', time()) . ')';\n }",
"private function getSessionTimestamp()\n {\n if ($this->_phpsession && isset($_SESSION[$this->_sessionName]->SessionID))\n $timestamp = $_SESSION[$this->_sessionName]->SessionID;\n\n\n if ($this->_cookie && isset($_COOKIE[$this->_sessionName . \"_Timestamp\"]))\n $timestamp = $_COOKIE[$this->_sessionName . \"_Timestamp\"];\n\n return $timestamp;\n }",
"function usersCurrentTimeStr() {\n return $this->currentTimeStr($this->controller->User->getTimeZone(\n $this->controller->authd_user_id));\n }",
"static public function generateSID() {\n\t\treturn md5( $_SERVER['HTTP_USER_AGENT'] + $_SERVER['REMOTE_ADDR'] + time() + rand() );\n\t}",
"public function lastseen(){\n\t $seen = Time::now();\n\t\n\t\t$q = \"UPDATE users SET\n\t\t\tlastseen = '\".$seen.\"' \n\t\t\tWHERE user_id = '\".$this->user->user_id.\"'\n\t\t\t\";\n\t\n\t\tDB::instance(DB_NAME)->query($q);\n\t}"
]
| [
"0.6188183",
"0.59262383",
"0.58992827",
"0.58775276",
"0.58623755",
"0.58584726",
"0.5851048",
"0.5826666",
"0.58190715",
"0.58114",
"0.580559",
"0.57714754",
"0.5735909",
"0.5719893",
"0.5712093",
"0.5711938",
"0.5708747",
"0.5704671",
"0.56728226",
"0.5648777",
"0.56467277",
"0.56396085",
"0.563708",
"0.5632311",
"0.5619781",
"0.5612312",
"0.5607412",
"0.55880386",
"0.55791795",
"0.5574398"
]
| 0.62556106 | 0 |
Function to get the user's custom location | function get_custom_location($obj, $returntype = "string", $rpart='')
{
if($returntype == "string")
{
if(!$obj->session->userdata('location_string') || ($obj->session->userdata('location_string') && $obj->session->userdata('resetlocation') && $obj->session->userdata('resetlocation') == 'Y'))
{
$location = $obj->Users->get_user_location();
if(!empty($location['city']))
{
$slocation = ucwords(strtolower($location['city'].', '.$location['country']));
$obj->session->set_userdata('location_string', $slocation);
}
else
{
$slocation = "Unknown Location";
}
$obj->session->unset_userdata(array('resetlocation'=>''));
return $slocation;
}
else
{
return $obj->session->userdata('location_string');
}
}
else
{
if(!$obj->session->userdata('location_array') || ($obj->session->userdata('location_array') && $obj->session->userdata('resetlocation') && $obj->session->userdata('resetlocation') == 'Y'))
{
$location = $obj->Users->get_user_location();
if(!empty($location) && !empty($location['zipcode']) && trim($location['zipcode']) != '-')
{
$obj->session->set_userdata('location_array', $location);
}
else
{
$location = array('country'=>'United States', 'zipcode'=>'10001', 'city'=>'Manhattan', 'region'=>'New York');
}
$obj->session->unset_userdata(array('resetlocation'=>''));
return $location;
}
else
{
return $obj->session->userdata('location_array');
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUserLocation();",
"public function getUserLocation() {\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n $ip_note = 'HTTP_CLIENT_IP='.$_SERVER['HTTP_CLIENT_IP'];\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip_note = 'HTTP_X_FORWARDED_FOR='.$_SERVER['HTTP_X_FORWARDED_FOR'];\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } else {\n $ip_note = 'REMOTE_ADDR='.$_SERVER['REMOTE_ADDR'];\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n $ip = '117.20.119.245';\n $loc = file_get_contents(\"http://ipinfo.io/\".$ip.\"/loc\");\n\n if($loc) {\n $array_loc = explode(',', $loc);\n return ['lat'=> ((isset($array_loc[0]))? $array_loc[0]:'') ,'lon'=> ((isset($array_loc[1]))? $array_loc[1]:'')];\n }\n\n return ['lat'=>'','lon'=>''];\n\n }",
"public function getLocation();",
"public function getLocation();",
"public function getLocation()\n {\n return $this->get('location');\n }",
"function getLocation();",
"public function get_location()\n\t{\n\t\treturn $this->location;\n\t}",
"private function getLocation() {\n }",
"public function getLocation() {\n\t\treturn($this->location);\n\t}",
"public function getLocation()\r\n {\r\n return $this->location;\r\n }",
"function getLocation(){ return $this->_Location;}",
"public function getLocation() {\r\n return $this->location;\r\n }",
"public function getLocation() { return $this->location; }",
"public function getLocation()\n\t{\n\t\treturn $this->location;\n\t}",
"public function getLocation()\n\t{\n\t\treturn $this->location;\n\t}",
"public function getLocation()\n\t{\n\t\treturn $this->location;\n\t}",
"public function getLocation()\n\t{\n\t\treturn $this->location;\n\t}",
"public function getLocation() {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }",
"public function getLocation()\n {\n return $this->location;\n }"
]
| [
"0.8334229",
"0.7017468",
"0.70079935",
"0.70079935",
"0.6914941",
"0.688397",
"0.6866924",
"0.6841566",
"0.6814718",
"0.67328084",
"0.67310876",
"0.66999924",
"0.66752213",
"0.667179",
"0.667179",
"0.667179",
"0.667179",
"0.6661932",
"0.66591686",
"0.66591686",
"0.66591686",
"0.66591686",
"0.66591686",
"0.66591686",
"0.66591686",
"0.66591686",
"0.66591686",
"0.66591686",
"0.66591686",
"0.66591686"
]
| 0.7191402 | 1 |
Checks if a disease is editable | function is_disease_editable($obj, $diseasestamp)
{
$disease = $obj->Query_reader->get_row_as_array('get_diagnosis_by_stamp', array('stamp'=>$diseasestamp));
if((!empty($disease['isfrozen']) && $disease['isfrozen'] == 'N') || ($obj->session->userdata('isadmin') && $obj->session->userdata('isadmin') == 'Y'))
{
return TRUE;
}
else
{
return FALSE;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function is_editable() {\n\t\treturn false;\n\t}",
"public function isEditable() {}",
"public function isEditable();",
"public function isEditable();",
"protected function canEdit() {}",
"public function isEditOnlyMode();",
"public function isEditable()\n\t{\n\t\tif (($this->getName() === 'publicid') || ($this->getName() === 'posturl')) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public function isEditable()\n {\n return $this->_editable;\n }",
"public function canEdit()\n {\n return true;\n }",
"function canEdit() {\n\t\t\treturn true;\n\t\t}",
"public function isEditable($id)\n\t{\n\t\t// TODO: Implement isEditable() method.\n\t}",
"public function canEdit()\n {\n return $this->is_locked == 0;\n }",
"public function can_edit() {\n return true;\n }",
"public function editable()\n {\n if ($this->getMode() == \"only_external\") {\n return false;\n }\n if ($this->hasScript()) {\n // can't edit calculated fields\n return false;\n }\n if (!isset($this->data[\"editable\"])) {\n return true;\n }\n return (true == $this->data[\"editable\"]);\n }",
"public function isSwitchToEditEnabled();",
"public function isEditable($softwareid)\n\t\t{\n\n\t\t\t$data = $this->getSoftwareData($softwareid);\n\n\t\t\tif (empty($data))\n\t\t\t{\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (isset($data['editable']) == false)\n\t\t\t{\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif ($data['editable'] == false)\n\t\t\t{\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}",
"public function canBeEdited() {}",
"public function isEditable()\n\t{\n\t\tif(Auth::check())\n\t\t{\n\t\t\tif(Auth::user()->id == $this->author_id)\n\t\t\t{\n\t\t\t\tif ($this->created_at->diffInMinutes(Carbon::now()) < 30)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(Auth::user()->hasRole(['moderator', 'administrator', 'super user'])) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public function isEditable() {\n\t\tif ($this->isVariable()) {\n\t\t\t$editables = $this->parent->editables();\n\t\t\tif (empty($editables)) {\n\t\t\t\treturn $this->isValueEditable;\n\t\t\t}\n\t\t\treturn ((in_array($this->parsedVarName, $editables) !== false) && $this->isValueEditable);\n\t\t}\n\t\treturn false;\n\t}",
"public function isEditable()\n {\n // Need to be able to save the DataObject if this is being called during PublishTargetJob.\n if ($this->owner->getIsPublishJobRunning()) {\n return true;\n }\n\n // Need to be able to save the DataObject if this is being called during UnPublishTargetJob.\n if ($this->owner->getIsUnPublishJobRunning()) {\n return true;\n }\n\n if ($this->owner->config()->get('allow_embargoed_editing')) {\n return true;\n }\n\n if ($this->owner->getIsPublishScheduled()) {\n return false;\n }\n\n $embargoRecordIsEditable = $this->owner->invokeWithExtensions('embargoRecordIsEditable');\n if (in_array(false, $embargoRecordIsEditable)) {\n return false;\n }\n\n return true;\n }",
"public function edit(Disease $disease)\r\r\n {\r\r\n //\r\r\n }",
"public function canBeEdited()\n {\n return false;\n }",
"function IsRecordEditable($values, $isEditable)\n{\n\n\t\t\n\n$lkd=$values[\"Locked\"];\n\nif($lkd==1) {\n\nreturn $isEditable=false;\n\n}\n\nelse return $isEditable=true;\n;\t\t\n}",
"public function isEditable(User $u){\n\t\t\tif( $u->id == $this->user->id){\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"function canEdit() {\r\n\t\t$user\t=& JFactory::getUser();\r\n\r\n\t\tif (!JAccess::check($user->id, 'core.admin', 'root.1')) {\r\n\t\t\t\t$permission = FlexicontentHelperPerm::getPerm();\r\n\t\t\t\t$id = $this->getState($this->getName().'.id');\r\n\t\t\t\tif ($id) {\r\n\t\t\t\t\t$rights \t= FlexicontentHelperPerm::checkAllItemAccess($uid, 'item', $id);\r\n\t\t\t\t\t$canEdit \t= in_array('flexicontent.editall', $rights) || $permission->CanEdit;\r\n\t\t\t\t\t$canEditOwn\t= (in_array('flexicontent.editown', $rights) && ($item->created_by == $user->id));\r\n\t\t\t\t\tif ($canEdit || $canEditOwn) return true;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"function isEditable($id) {\n\t\t$sale = $this->find('first', array(\n\t\t\t'conditions' => array('BPCSRepSale.id' => $id),\n\t\t\t'contain' => array(),\n\t\t\t'fields' => array('BPCSRepSale.confirm_requirement')\n\t\t));\n\t\treturn !$sale['BPCSRepSale']['confirm_requirement'];\n\t}",
"public function canEdit()\n {\n if(!Auth::check())\n {\n return false;\n }\n //If the user is active/logged in, return true so that we can display user's specific objects\n if(Auth::user()->id===$this->user_id)\n {\n return true;\n }\n //By default\n return false;\n }",
"private function isEditMode(){\n\t\tif(isset($this->AddRecordInsertData) and count($this->AddRecordInsertData) > 0 )\n\t\t\treturn true;\n\t\treturn false;\n\t}",
"protected function isPageEditable()\n {\n if ($this->getBackendUser()->isAdmin()) {\n return true;\n }\n return !$this->pageinfo['editlock'] && $this->getBackendUser()->doesUserHaveAccess($this->pageinfo, Permission::PAGE_EDIT);\n }",
"abstract public function canEdit($user_guid = 0);"
]
| [
"0.77014124",
"0.7699721",
"0.75873345",
"0.75873345",
"0.7396197",
"0.7278386",
"0.7248275",
"0.72371274",
"0.72213626",
"0.71860117",
"0.71269226",
"0.70827806",
"0.7055472",
"0.68590987",
"0.6775763",
"0.6768846",
"0.66715825",
"0.6647656",
"0.6645395",
"0.66424334",
"0.6590065",
"0.6548618",
"0.65362686",
"0.6518179",
"0.6508843",
"0.6488501",
"0.6481562",
"0.644056",
"0.64048004",
"0.6397499"
]
| 0.78939474 | 0 |
Function to pick all page sections | function get_all_page_sections($obj = '')
{
$section_result = $obj->db->query($obj->Query_reader->get_query_by_code('get_all_page_sections'));
return $section_result->result_array();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllSections();",
"public function getSections(): iterable;",
"function spr_get_sections() {\n\tglobal $spr_sql_fields;\n\n\t$sql_tables = safe_pfx('txp_section');\n\t$rs = safe_query(\"SELECT \".$spr_sql_fields.\" FROM \".$sql_tables.\" WHERE name != 'default' ORDER BY name\");\n\twhile ($a = nextRow($rs)) {\n\t\textract($a); // set 'name','title','parent' etc in $a\n\t\t$out[$name] = $a;\n\t}\n\treturn $out;\n}",
"public function sections()\n {\n }",
"public function pagesOnly() {}",
"public function get_pages()\n\t{\n\t\treturn $this->_EE->db->select(array('heading', 'short_name'))\n\t\t\t ->get('exp_dd_doc_sections')\n\t\t\t ->result_array();\n\t}",
"function self_get_page_sections(){\n\tif( have_rows('content_blocks') ):\n\n\t // loop through the rows of data\n\t while ( have_rows('content_blocks') ) : the_row();\n\n\t \t\t\t$cur_sect = get_row_layout();\n\t \t\t\t$filepath = TEMPLATEPATH . '/partials/' . $cur_sect . '.php';\n\n\t \t\t\tif(file_exists( $filepath )){\n\n\t\t\t\t\t\t// the partial\n\t\t \t\t\tinclude($filepath);\n\n\t \t\t\t}\n\n\t endwhile;\n\n\telse :\n\n\t // no layouts found\n\n\tendif;\n\n}",
"public function getPages();",
"public function get_sections( $offset = 0, $limit = NULL )\n\t{\n\t\t$sections = get_option( NHS_SECTIONS, array() );\n\t\treturn array_slice( $sections, $offset, $limit );\n\t}",
"public function getSections(){\n return $this->getSite()->getSections();\n }",
"function do_settings_sections($page)\n {\n }",
"public function getPages() {}",
"private function retrieveSections() {\n\t\t$this->sections = array();\n\n\t\t$dbResult = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t'*',\n\t\t\tself::TABLE_SECTIONS,\n\t\t\t'content_uid = ' . $this->getContentUid() .\n\t\t\t\ttx_oelib_db::enableFields(self::TABLE_SECTIONS),\n\t\t\t'',\n\t\t\t'sorting'\n\t\t);\n\t\tif (!$dbResult) {\n\t\t\tthrow new Exception(DATABASE_QUERY_ERROR);\n\t\t}\n\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($dbResult)) {\n\t\t\t$GLOBALS['TSFE']->sys_page->versionOL(self::TABLE_SECTIONS, $row);\n\t\t\t$GLOBALS['TSFE']->sys_page->fixVersioningPid(\n\t\t\t\tself::TABLE_SECTIONS, $row\n\t\t\t);\n\t\t\tif ($GLOBALS['TSFE']->sys_language_content > 0) {\n\t\t\t\t$row = $GLOBALS['TSFE']->sys_page->getRecordOverlay(\n\t\t\t\t\tself::TABLE_SECTIONS,\n\t\t\t\t\t$row,\n\t\t\t\t\t$GLOBALS['TSFE']->sys_language_content,\n\t\t\t\t\t$GLOBALS['TSFE']->sys_language_contentOL\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$this->sections[] = $row;\n\t\t}\n\t}",
"public function get_all_sections() {\n\t\t$sql = \"SELECT section_id FROM peducator_sections \n\t\tWHERE peducator_id='$this->peducator_id'\";\n\t\t$result = mysqli_query($this->connect_to_db, $sql);\n\n\t\t$arr = [];\n\t\twhile ($row = mysqli_fetch_array($result)) {\n\t\t\tarray_push($arr, get_section($row['section_id']));\n\t\t}\n\n\t\treturn $arr;\t\n\t}",
"function get_all_page_ids()\n {\n }",
"public function __allSections()\n\t{\n\t\t//current user course\n\t\t$userCourse = $this->Session->read('UserData.usersCourses');\n\t\t$user_course_section = $userCourse[0];\n\t\t//get Course and section name\n\t\t$course_info = $this->getCourseNameOfUser($user_course_section);\n\t\t$course_name = $course_info->course_name;\n\t\t$course_section = $course_info->section_name;\n\t\t$sectionList = array();\n\t\t//getting the course in section/all section setting(changed on 16 April, 2014)\n\t $setting = $this->__getDbSetting($user_course_section);\n\t\tif ($setting == 2) {\n\t\t\t$sections = $this->PleSetting->find('all',array('conditions'=>array('PleSetting.course'=>$course_name,'PleSetting.setting_value'=>2),'fields'=>array('section')));\n\t\t\tforeach ($sections as $section) {\n\t\t\t\t$sectionList[] = trim($section['PleSetting']['section']);\n\t\t\t}\n\t\t\t$sectionList[] = $course_section;\n\t } else {\n\t\t\t//add current user login section\n\t\t\t$sectionList[] = $course_section;\n\t }\n\t\t$tz = array_unique($sectionList);\n\t\treturn $tz;\n\t}",
"private function get_registered_settings_sections() {\n\t\t\tglobal ${$this->func . '_sections'};\n\n\t\t\tif ( !empty( $sections ) ) {\n\t\t\t\treturn $sections;\n\t\t\t}\n\n\t\t\t$sections = apply_filters( $this->func . '_registered_settings_sections', array() );\n\n\t\t\treturn $sections;\n\t\t}",
"public static function get_builder_sections() {\n\t\tglobal $post;\n\n\t\t$sections = array();\n\n\t\tif ($post) {\n\t\t\t$sections = get_post_meta($post->ID, '_mkb_page_sections', true);\n\n\t\t\tif (isset($sections) && !empty($sections)) {\n\t\t\t\t$sections = array_map(function($str) {\n\t\t\t\t\treturn stripslashes_deep(json_decode($str, true));\n\t\t\t\t}, $sections);\n\t\t\t}\n\t\t}\n\n\t\treturn $sections;\n\t}",
"function cww_df_options_page_sections() { \n $sections = array(); \n // $sections[$id] = __($title, 'wptuts_textdomain'); \n $sections['cww_df_authorizenet_setting_section'] = __('Authorize.net', 'cww');\n return apply_filters('cww_df_options_page_sections', $sections);\n}",
"public function getSections()\r\n {\r\n $sql=\"SELECT * FROM sections\";\r\n $query=$this->db->query($sql);\r\n return $query->result_array();\r\n }",
"public function listAllSections(): array {\n\t\t$sections = [];\n\t\t$q = $this->pdo->query(\"SELECT `ArticleSection` from `articles` GROUP BY `ArticleSection`\");\n\t\tforeach($q->fetchAll(PDO::FETCH_ASSOC) as $a){\n\t\t\t$section = json_decode($a[\"ArticleSection\"], true);\n\t\t\tforeach($section as $s){\n\t\t\t\t/* @var $s string */\n\t\t\t\tif(!in_array(mb_strtolower($s), $sections, true)){\n\t\t\t\t\t$sections[] = mb_strtolower($s);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsort($sections);\n\t\treturn $sections;\n\t}",
"function wpex_portfolio_single_meta_sections() {\n\n\t// Default sections\n\t$sections = array( 'date', 'author', 'categories', 'comments' );\n\n\t// Apply filters for easy modification\n\t$sections = apply_filters( 'wpex_portfolio_single_meta_sections', $sections );\n\n\t// Turn into array if string\n\tif ( $sections && ! is_array( $sections ) ) {\n\t\t$sections = explode( ',', $sections );\n\t}\n\n\t// Return sections\n\treturn $sections;\n\n}",
"private function page()\n {\n $records = array();\n $uid = $this->pObj->zz_getMaxDbUid('sys_template');\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrg($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgCalCaddy($uid);\n\n // #61838, 140923, dwildt, 2+\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgCal($uid);\n\n // #61826, 140923, dwildt, 2+\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgCalEvents($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgCalLocations($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgDocuments($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgDocumentsCaddy($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgHeadquarters($uid);\n\n // #61779, 140921, dwildt, 2+\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgJobs($uid);\n\n // #61779, 140921, dwildt, 2+\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgJobsJobsApply($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgNews($uid);\n\n // #61779, 140921, dwildt, 2+\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgService($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgStaff($uid);\n\n // #67210, 150531, dwildt, 2+\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgStaffVcard($uid);\n\n return $records;\n }",
"public static function special_sections() {\n if ( get_post_type() != 'property' ) {\n return;\n }\n\n $price_comparison = self::get_price_comparison();\n if ( count( $price_comparison ) ) {\n echo Inventor_Template_Loader::load( 'price-comparison', $price_comparison, INVENTOR_PROPERTIES_DIR );\n }\n echo Inventor_Template_Loader::load( 'amenities', array(), INVENTOR_PROPERTIES_DIR );\n echo Inventor_Template_Loader::load( 'floor-plans', array(), INVENTOR_PROPERTIES_DIR );\n echo Inventor_Template_Loader::load( 'valuation', array(), INVENTOR_PROPERTIES_DIR );\n echo Inventor_Template_Loader::load( 'public-facilities', array(), INVENTOR_PROPERTIES_DIR );\n }",
"function mace_admin_get_settings_sections() {\n\t$sections = array();\n\n\t$settings_pages = mace_get_settings_pages();\n\n\tforeach( $settings_pages as $page_id => $page_config ) {\n\t\t$sections[ $page_id ] = array(\n\t\t\t'title' => $page_config['page_title'],\n\t\t\t'callback' => $page_config['page_description_callback'],\n\t\t\t'page' => $page_id,\n\t\t);\n\t}\n\n\treturn (array) apply_filters( 'mace_admin_get_settings_sections', $sections );\n}",
"function browse_sections($db,$section=0, $section_index = '')\r\n\t{\r\n\t\tif (PHP5_DIR) \r\n\t\t\t$menu_loader = geoAdmin::getInstance();\r\n\t\telse \r\n\t\t\t$menu_loader =& geoAdmin::getInstance();\r\n\t\t$this->body .= $menu_loader->getUserMessages();\r\n\t\t\r\n\t\t$this->body .= \"<fieldset id='Page Management'><legend>Pages Management</legend><table cellpadding=2 cellspacing=1 border=0 width=100%>\\n\";\r\n\t\t//browse the listings in this category that are open\r\n\r\n\t\tif ($section)\r\n\t\t{\r\n\t\t\t$sql = \"select * from \".$this->pages_sections_table.\" where section_id = \".$section;\r\n\t\t\tif(!geoMaster::is('classifieds') && geoMaster::is('auctions'))\r\n\t\t\t{\r\n\t\t\t\tif(geoMaster::is('auctions'))\r\n\t\t\t\t\t$sql .= \" and (applies_to = 0 or applies_to = 2)\";\r\n\t\t\t\telse\r\n\t\t\t\t\t$sql .= \" and (applies_to = 0 or applies_to = 1)\";\r\n\t\t\t}\r\n\t\t\t$section_result = $this->db->Execute($sql);\r\n\t\t\t//echo $sql.\" is the query<br>\\n\";\r\n\t\t\tif (!$section_result){\r\n\t\t\t\treturn false;\r\n\t\t\t}elseif ($section_result->RecordCount() == 1){\r\n\t\t\t\t$show_section_data = $section_result->FetchRow();\r\n\t\t\t\t$section_name = $show_section_data[\"name\"];\r\n\t\t\t\t$section_description = $show_section_data[\"description\"];\r\n\t\t\t\t$parent_section = $show_section_data[\"parent_section\"];\r\n\t\t\t}else{\r\n\t\t\t\t//category does not exist\r\n\t\t\t\t$this->error_message = \"Category Does Not Exist\";\r\n\t\t\t\t//echo $sql . \"<br>\";\r\n\t\t\t\t//echo \"<pre>\" . printf(var_dump($section_result->FetchRow()));\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$section_name = \"Pages Home\";\r\n\t\t\t$section_description = \"\";\r\n\t\t\t$parent_section = 0;\r\n\t\t}\r\n\r\n\t\t$sql = \"select * from \".$this->pages_sections_table.\" where parent_section = \".$section;\r\n\t\tif(geoMaster::is('auctions')&& !geoMaster::is('classifieds'))\r\n\t\t\t$sql .= \" and (applies_to = 0 or applies_to = 2)\";\r\n\t\telseif(geoMaster::is('classifieds') && !geoMaster::is('auctions'))\r\n\t\t\t$sql .= \" and (applies_to = 0 or applies_to = 1)\";\r\n\t\t$sql .= \" order by display_order\";\r\n\t\t\r\n\t\t$sub_section_result = $this->db->Execute($sql);\r\n\t\t//echo $sql.\" is the query<br>\\n\";\r\n\t\tif (!$sub_section_result)\r\n\t\t{\r\n\t\t\t//echo $sql.\" is the query<br>\\n\";\r\n\t\t\t$this->error_message = $this->messages[5501];\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif ($parent_section)\r\n\t\t\t{\r\n\t\t\t\t$parent_section_data = $this->get_section($db,$parent_section);\r\n\t\t\t\t$this->body .= \"<tr>\\n\\t<td class=col_hdr_top colspan=4>\\n\\t\r\n\t\t\t\t\tback to: <a href=index.php?mc=pages_sections&page=sections{$section_index}_show&b=\".$parent_section.\" class=col_hdr_top>\".$parent_section_data[\"name\"].\"</a>\\n\\t</td>\\n</tr>\\n\";\r\n\t\t\t}\r\n\t\t\telseif ($section != 0)\r\n\t\t\t{\r\n\t\t\t\t$this->body .= \"<tr>\\n\\t<td class=col_hdr_top colspan=4>\\n\\t\r\n\t\t\t\t\tback to: <a href=index.php?mc=pages_sections&page=sections_home class=col_hdr_top>Pages Home</a>\\n\\t</td>\\n</tr>\\n\";\r\n\t\t\t}\r\n\t\t\tif ($sub_section_result->RecordCount() > 0)\r\n\t\t\t{\r\n\t\t\t\t//display subsections to this section\r\n\t\t\t\t$this->body .= \"<tr>\\n\\t<td colspan=4 class=group_price_hdr align=center>\\n\\t <b>Subsections of: \".$section_name.\"</b> </a>\\n\\t</td>\\n</tr>\\n\";\r\n\t\t\t\t$this->body .= \"<tr>\\n\\t<td align=center width=45% class=col_hdr_left><b>Section Name and Description</b>\\n\\t</td>\\n\\t\";\r\n\t\t\t\t$this->body .= \"<td align=center width=25% class=col_hdr>\\n\\t<b>Subsections</b>\\n\\t</td>\\n\\t\";\r\n\t\t\t\t$this->body .= \"<td align=center width=25% class=col_hdr>\\n\\t<b>Pages</b>\\n\\t</td>\\n\";\r\n\t\t\t\t$this->body .= \"<td align=center width=5% class=col_hdr>\\n\\t \\n\\t</td>\\n</tr>\";\r\n\t\t\t\t$this->row_count = 0;\r\n\t\t\t\twhile ($show_sub_sections = $sub_section_result->FetchRow())\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->body .= \"<tr class=\".$this->get_row_color().\">\\n\\t<td valign=top>\\n\\t<a href=index.php?mc=pages_sections\".$section_index.\"&page=sections\".$section_index.\"_show&b=\".$show_sub_sections[\"section_id\"].\"><span class=medium_font><font color=000000>\".$show_sub_sections[\"name\"].\"</font></span></a><br><span class=small_font>\";\r\n\t\t\t\t\t//$this->body .= $show_sub_sections[\"description\"];\r\n\t\t\t\t\t$this->body .= \"</span></td>\\n\\t\";\r\n\t\t\t\t\t$this->body .= \"<td align=center valign=top class=small_font>\\n\\t\";\r\n\r\n\t\t\t\t\t$sql = \"select * from \".$this->pages_sections_table.\" where parent_section = \".$show_sub_sections[\"section_id\"];\r\n\t\t\t\t\tif(!geoMaster::is('classifieds') && geoMaster::is('auctions'))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(geoMaster::is('auctions'))\r\n\t\t\t\t\t\t\t$sql .= \" and (applies_to = 0 or applies_to = 2)\";\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$sql .= \" and (applies_to = 0 or applies_to = 1)\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$sql .= \" order by display_order\";\r\n\t\t\t\t\t$sub_section_sections_result = $this->db->Execute($sql);\r\n\t\t\t\t\t//echo $sql.\" is the query<br>\\n\";\r\n\t\t\t\t\tif (!$sub_section_sections_result)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t//echo $sql.\" is the query<br>\\n\";\r\n\t\t\t\t\t\t$this->error_message = $this->messages[5501];\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telseif ($sub_section_sections_result->RecordCount() > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\twhile ($show_this_sub_section = $sub_section_sections_result->FetchRow())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->body .= $show_this_sub_section[\"name\"].\"<br>\\n\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->body .= \"none\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->body .= \" \\n\\t</td>\\n\\t\";\r\n\r\n\t\t\t\t\t$this->body .= \"<td align=center valign=top class=small_font>\\n\\t\";\r\n\t\t\t\t\t//$sql = \"select * from \".$this->pages_table.\" where section_id = \".$show_sub_sections[\"section_id\"].\" order by display_order\";\r\n\t\t\t\t\t$sql = \"select * from \".$this->pages_table.\" where section_id = \".$show_sub_sections[\"section_id\"].\" and module = 0\";\r\n\t\t\t\t\t$sql .= \" and (applies_to = 0\";\r\n\t\t\t\t\tif(geoMaster::is('auctions'))\r\n\t\t\t\t\t\t$sql .= \" or applies_to = 2\";\r\n\t\t\t\t\tif(geoMaster::is('classifieds'))\r\n\t\t\t\t\t\t$sql .= \" or applies_to = 1\";\r\n\t\t\t\t\tif (geoMaster::is('classifieds') && geoMaster::is('auctions'))\r\n\t\t\t\t\t\t$sql .= \" or applies_to = 4\";\r\n\t\t\t\t\t$sql .= \") order by page_id\";\r\n\t\t\t\t\t$sub_pages_result = $this->db->Execute($sql);\r\n\t\t\t\t\t//echo $sql.\" is the query<br>\\n\";\r\n\t\t\t\t\tif (!$sub_pages_result)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t//echo $sql.\" is the query<br>\\n\";\r\n\t\t\t\t\t\t$this->error_message = $this->messages[5501];\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telseif ($sub_pages_result->RecordCount() > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\twhile ($show_sub_pages = $sub_pages_result->FetchRow())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->body .= (($this->isPageEditable($show_sub_pages['page_id']))? $show_sub_pages[\"name\"].\"<br>\\n\": '');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->body .= \"none\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->body .= \" \\n\\t</td>\\n\\t\";\r\n\t\t\t\t\t$enter_button = geoHTML::addButton('Enter','index.php?mc=pages_sections'.$section_index.'&page=sections'.$section_index.'_show&b='.$show_sub_sections[\"section_id\"]);\r\n\t\t\t\t\t$this->body .= \"<td align=center valign=top>\".$enter_button.\"</td>\\n\\t\";\r\n\t\t\t\t\t$this->body .= \"</tr>\\n\";\r\n\t\t\t\t\t$this->row_count++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$sql = \"select * from \".$this->pages_table.\" where section_id = \".$section.\" and module = 0\";\r\n\t\t\tif(!geoPC::is_ent()) {\r\n\t\t\t\t$sql .= ' and page_id not in (62, 63)';\r\n\t\t\t}\r\n\t\t\tif(!geoMaster::is('classifieds') && geoMaster::is('auctions'))\r\n\t\t\t{\r\n\t\t\t\tif(geoMaster::is('auctions'))\r\n\t\t\t\t\t$sql .= \" and (applies_to = 0 or applies_to = 2)\";\r\n\t\t\t\telse\r\n\t\t\t\t\t$sql .= \" and (applies_to = 0 or applies_to = 1)\";\r\n\t\t\t}\r\n\t\t\t$sql .= \" order by page_id, name\";\r\n\t\t\t$sub_pages_result = $this->db->Execute($sql);\r\n\t\t\tif (!$sub_pages_result)\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telseif ($sub_pages_result->RecordCount() > 0)\r\n\t\t\t{\r\n\t\t\t\t//display subpages to this section\r\n\t\t\t\t$this->body .= \"\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td colspan=\\\"100%\\\">\r\n\t\t\t\t\t\t\t<table width=\\\"100%\\\">\r\n\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t<td align=left class=col_hdr_left>\r\n\t\t\t\t\t\t\t\t\t\tPage Name\r\n\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t<td align=left width=50% class=col_hdr_left>\r\n\t\t\t\t\t\t\t\t\t\tAdmin Note\r\n\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t<td width=\\\"20%\\\" class=col_hdr_left> </td>\r\n\t\t\t\t\t\t\t\t</tr>\";\r\n\t\t\t\t$this->row_count = 0;\r\n\t\t\t\twhile ($show_sub_pages = $sub_pages_result->FetchRow())\r\n\t\t\t\t{\r\n\t\t\t\t\tif (!$this->isPageEditable($show_sub_pages[\"page_id\"])){ continue; }\r\n\t\t\t\t\t$edit_button = geoHTML::addButton('Edit','index.php?mc=pages_sections&page=sections'.$section_index.'_page&b='.$show_sub_pages[\"page_id\"]);\r\n\t\t\t\t\t$this->body .= \"\r\n\t\t\t\t\t\t\t\t<tr class=\".$this->get_row_color().\">\r\n\t\t\t\t\t\t\t\t\t<td valign=top>\r\n\t\t\t\t\t\t\t\t\t\t<a href=index.php?mc=pages_sections&page=sections\".$section_index.\"_page&b=\".$show_sub_pages[\"page_id\"].\">\r\n\t\t\t\t\t\t\t\t\t\t\t<span class=medium_font>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<font color=000000>\".$show_sub_pages['name'].\"</font>\r\n\t\t\t\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t<td class=medium_font align=left>\r\n\t\t\t\t\t\t\t\t\t\t\".$show_sub_pages['admin_label'].\"<br>\r\n\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t<td align=center valign=top>\".$edit_button.\"\r\n\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t</tr>\\n\";\r\n\t\t\t\t\t$this->row_count++;\r\n\t\t\t\t}\r\n\t\t\t\t$this->body .= \"\r\n\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->body .= \"</table>\r\n</fieldset>\r\n\";\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"public function index()\n {\n //\n return sections::latest()->paginate(5);\n }",
"function sections($item, $request, $limit, $show, $style, $paginate, $filter){\n$_SESSION['system'] = json_decode(file_get_contents('../data/system.json'), true);\n$content = json_decode(file_get_contents('../data/'.$item.'.json'), true);\n$defaults = $content['defaults'];\n$template = $content['templates'];\n$offering = $content['sections'];\n$_SESSION['profile'] = $content['profile'];\n$_SESSION['list'] = $content['lists']; //user specific common list\n$counter = 1;\n$output = '';\n\n\n\n\nif($show == 'specific'){\n\t\t\t$newray = array();\n\t\t\tforeach ($offering[$request] as $k => $v) {\t$newray = array_merge_recursive($newray, $v);\t}\n\t\t $output .= disher('', $template[$style], $newray, $k); //add filter attributes on the atricle id, data-eg\n\t\t \n\t}\nelse {\n\t\tforeach ($offering as $k => $value) { //get all from database\n\t\t $newray = array();\n\t\t foreach ($value as $v) {\t$newray = array_merge_recursive($newray, $v);\t}\n\t\t $output .= disher('', $template[$style], $newray, $k);\n\t\t if ($counter >= $limit){ break; }\n\t\t $counter++;\n\t\t}\n\t}\n\n//if pagination CLOSE tag\nreturn $output;\n}",
"public function getSections(): array\n {\n return $this->sections;\n }",
"public function get_main_sections($section) {\n\t\t$query = $this->CI->db->select()->from('settings')\n\t\t\t->where([\n\t\t\t\t'section' => $section . '-main'\n\t\t\t])\n\t\t\t->order_by('order asc')\n\t\t\t->get();\n\n\t\t$result = [];\n\n\t\tforeach ($query->result() as $row) {\n\t\t\t$result[] = $row;\n\t\t}\n\n\t\treturn $result;\n\t}"
]
| [
"0.72869277",
"0.69992167",
"0.69505817",
"0.6861968",
"0.66784525",
"0.6665054",
"0.6543915",
"0.65275866",
"0.6484601",
"0.6393351",
"0.63710016",
"0.6299365",
"0.62875843",
"0.624536",
"0.62230444",
"0.6176665",
"0.6147531",
"0.6075617",
"0.6017149",
"0.6008083",
"0.5967936",
"0.59156543",
"0.5914492",
"0.58968735",
"0.58843565",
"0.5878324",
"0.5845889",
"0.58430004",
"0.5815363",
"0.58035874"
]
| 0.7335488 | 0 |
Function to generate a system button | function generate_sys_button($btn_params=array())
{
$btn_str = "";
if(!empty($btn_params['btnaction']) && empty($btn_params['noloading']))
{
$btn_str .= "<div class='bluronclick'><div style='display:inline-block;'>";
}
else if(empty($btn_params['btnaction']))
{
$btn_params['btnaction'] = '';
}
$btn_str .= "<table border='0' cellspacing='0' cellpadding='0' class='btn' onclick=\"".$btn_params['btnaction']."\">
<tr>
<td class='btnleft'><img src='".base_url()."images/spacer.gif' width='5' height='5'/></td>
<td class='btnmiddle' nowrap='nowrap'>".$btn_params['btntext']."</td>
<td class='btnright'><img src='".base_url()."images/spacer.gif' width='5' height='5'/></td>
</tr>
</table>";
if(!empty($btn_params['btnaction']) && empty($btn_params['noloading']))
{
$btn_str .= "</div></div>";
}
if(!empty($btn_params['btnid']))
{
$btn_value = (!empty($btn_params['btnvalue']))? $btn_params['btnvalue']: 'Submit';
$btn_str .= "<div style='display:none;'>
<input name='".$btn_params['btnid']."' type='submit' id='".$btn_params['btnid']."' value='".$btn_value."' />
</div>";
}
return $btn_str;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function generateButtons() {}",
"public function makeShortcutButton() {}",
"function displayCreateButton() {\r\n\t \t\r\n\t \techo \"<a href='create.php' class='btn btn-success'>Create a New Question!!</a><br />\";\r\n\t \t\r\n\t }",
"function makeCommandButton( $command, $text )\r\n{\r\n\treturn \"<button name=commandButton id=btn_$command onclick=\\\"\" .\r\n\t\t\"rows = document.getElementsByName( 'commandButton' ); \" .\r\n\t\t\"for (i=0; i<rows.length; i++) rows[i].disabled = true; \" .\r\n\t\t\"sendCommand( '\" . urlencode( $command ) . \"', '', true ); \" .\r\n\t\t\"return false;\" .\r\n\t\t\"\\\" style=\\\"\\\">$text</button>\";\r\n}",
"public function makeInputButton() {}",
"static function createButton($input, $name) {\n include $_SERVER[\"DOCUMENT_ROOT\"] . \"/mvdv/core/view/templates/general/form/formelements/button.php\";\n }",
"private function createButton() {\n $fv = new filterVars;\n $phpSelf = $fv->phpSelf();\n\t$addButton = \"<A HREF='$phpSelf?action=crf'><button title='Create Row'>Create Row</button></A>\"; \n return $addButton; \n }",
"function newButton($view) {\n\t\t$str = '<a class=\"button is-primary\" href=\"?do=edit&view='.$view.'\">New</a>';\n\t\treturn $str;\n\t}",
"function cp_print_button($type,$value,$name){\r\n return '<span class=\"btn-wrapper\"><input type=\"'.$type.'\" class=\"btn\" value=\"'.$value.'\" name=\"'.$name.'\"></span>';\r\n}",
"protected function makeButtons()\n {\n if ($this->MOD_SETTINGS['function'] == 1 || $this->MOD_SETTINGS['function'] == 2) {\n // Add CSH (Context Sensitive Help) icon to tool bar\n $contextSensitiveHelpButton = $this->buttonBar->makeHelpButton()\n ->setModuleName($this->descrTable)\n ->setFieldName('columns_' . $this->MOD_SETTINGS['function']);\n $this->buttonBar->addButton($contextSensitiveHelpButton);\n }\n $lang = $this->getLanguageService();\n // View page\n if (!VersionState::cast($this->pageinfo['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)) {\n $viewButton = $this->buttonBar->makeLinkButton()\n ->setOnClick(BackendUtility::viewOnClick($this->pageinfo['uid'], '', BackendUtility::BEgetRootLine($this->pageinfo['uid'])))\n ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.showPage'))\n ->setIcon($this->iconFactory->getIcon('actions-document-view', Icon::SIZE_SMALL))\n ->setHref('#');\n\n $this->buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT, 3);\n }\n // Shortcut\n $shortcutButton = $this->buttonBar->makeShortcutButton()\n ->setModuleName($this->moduleName)\n ->setGetVariables([\n 'id',\n 'M',\n 'edit_record',\n 'pointer',\n 'new_unique_uid',\n 'search_field',\n 'search_levels',\n 'showLimit'\n ])\n ->setSetVariables(array_keys($this->MOD_MENU));\n $this->buttonBar->addButton($shortcutButton);\n\n // Cache\n if (empty($this->modTSconfig['properties']['disableAdvanced'])) {\n $clearCacheButton = $this->buttonBar->makeLinkButton()\n ->setHref(BackendUtility::getModuleUrl($this->moduleName, ['id' => $this->pageinfo['uid'], 'clear_cache' => '1']))\n ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.clear_cache'))\n ->setIcon($this->iconFactory->getIcon('actions-system-cache-clear', Icon::SIZE_SMALL));\n $this->buttonBar->addButton($clearCacheButton, ButtonBar::BUTTON_POSITION_RIGHT, 1);\n }\n if (empty($this->modTSconfig['properties']['disableIconToolbar'])) {\n // Edit page properties and page language overlay icons\n if ($this->pageIsNotLockedForEditors() && $this->getBackendUser()->checkLanguageAccess(0)) {\n // Edit localized page_language_overlay only when one specific language is selected\n if ($this->MOD_SETTINGS['function'] == 1 && $this->current_sys_language > 0) {\n $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)\n ->getQueryBuilderForTable('pages_language_overlay');\n $queryBuilder->getRestrictions()\n ->removeAll()\n ->add(GeneralUtility::makeInstance(DeletedRestriction::class))\n ->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class));\n $overlayRecord = $queryBuilder\n ->select('uid')\n ->from('pages_language_overlay')\n ->where(\n $queryBuilder->expr()->eq(\n 'pid',\n $queryBuilder->createNamedParameter($this->id, \\PDO::PARAM_INT)\n ),\n $queryBuilder->expr()->eq(\n 'sys_language_uid',\n $queryBuilder->createNamedParameter($this->current_sys_language, \\PDO::PARAM_INT)\n )\n )\n ->setMaxResults(1)\n ->execute()\n ->fetch();\n // Edit button\n $urlParameters = [\n 'edit' => [\n 'pages_language_overlay' => [\n $overlayRecord['uid'] => 'edit'\n ]\n ],\n 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')\n ];\n $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);\n $editLanguageButton = $this->buttonBar->makeLinkButton()\n ->setHref($url)\n ->setTitle($lang->getLL('editPageLanguageOverlayProperties'))\n ->setIcon($this->iconFactory->getIcon('mimetypes-x-content-page-language-overlay', Icon::SIZE_SMALL));\n $this->buttonBar->addButton($editLanguageButton, ButtonBar::BUTTON_POSITION_LEFT, 3);\n }\n $urlParameters = [\n 'edit' => [\n 'pages' => [\n $this->id => 'edit'\n ]\n ],\n 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')\n ];\n $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);\n $editPageButton = $this->buttonBar->makeLinkButton()\n ->setHref($url)\n ->setTitle($lang->getLL('editPageProperties'))\n ->setIcon($this->iconFactory->getIcon('actions-page-open', Icon::SIZE_SMALL));\n $this->buttonBar->addButton($editPageButton, ButtonBar::BUTTON_POSITION_LEFT, 3);\n }\n }\n }",
"public function getButton() {}",
"protected function getShortcutButton() {}",
"function createEmptyCartButton(){\n return '<h2 class = \"ui horizontal divider\"><a class = \"ui red button\" href =\"shopping-cart.php?removeAllCart=1\"> Empty Cart</a></h2><br>';\n}",
"public function makeHelpButton() {}",
"protected function _getButtonName()\n\t{\n\t\treturn $this->buttonPrefix . '-' . $this->renderOrder;\n\t}",
"public function generate_buttons_HTML( ) {\n\t\t$follow_count_HTML = $this->get_count_html( $shape );\n\t\treturn\n<<<BUTTON\n<a target=\"_blank\" href=\"{$this->href}\">\n\t<div class=\"swfw-follow-button swfw_buttons_button swp-$this->key\">\n\t\t<div class='swfw-network-icon'>\n\t\t\t{$this->icon}\n\t\t</div>\n\n\t\t<div class=\"swfw-text\">\n\t\t\t<span class='swfw-cta'>$this->cta</span>\n\t\t\t{$follow_count_HTML}\n\t\t</div>\n\t</div>\n</a>\nBUTTON;\n\t}",
"public function render_content() {\n\t\tif ( ! empty( $this->button_text ) ) {\n\t\t\techo '<button type=\"button\" class=\"button menu-shortcut ' . esc_attr( $this->button_class ) . '\" tabindex=\"0\">';\n\t\t\tif ( ! empty( $this->button_class ) ) {\n\t\t\t\techo '<i class=\"fa ' . esc_attr( $this->icon_class ) . '\" style=\"margin-right: 10px\"></i>';\n\t\t\t}\n\t\t\techo esc_html( $this->button_text );\n\t\t\techo '</button>';\n\t\t}\n\t}",
"function buttons($type='',$name='',$value='',$class='',$id='',$attrib='') {\n\t\t$button = '<input type=\"'.$type.'\" name=\"'.$name.'\" class=\"'.$class.'\" value=\"'.$value.'\" id=\"'.$id.'\" '.$attrib.'>';\n\t\techo $button;\n\t}",
"function add_record_button($action_title, $file_name, $button_text)\n{\n ?>\n <p style=\"font-size:21px\"><?= ucwords($action_title) ?></p>\n <p>\n <a href=\"<?= $_SERVER['SCRIPT_NAME'] ?>?p=<?= $file_name ?>\" class=\"btn btn-primary\" role=\"button\">\n <span class=\"glyphicon glyphicon-plus-sign\"></span> Add <?= ucwords($button_text) ?></a>\n </p>\n <?php\n}",
"public function buttons()\n\t{\n\t\t//sufficient authority\n\t\tif ($this->authority === '1')\n\t\t\treturn parent::buttons();\n\n\t\t//insufficient authority\n\t\telse\n\t\t{\n\t\t\t$button = \n\t\t\t\t'<div class=\"view-b\">\n\t\t\t\t\t<button type=\"submit\" name=\"action\" value=\"Edit\" class=\"btn\"\n\t\t\t\t\t\t>View</button>\n\t\t\t\t</div>'\n\t\t\t;\n\n\t\t\treturn $button;\n\n\t\t} //end insufficient authority\n\t\n\t}",
"function nav_buttons()\n\t{\n\t\t?>\n\t\t<input type=\"button\" value=\"Create New Preorder >\" onclick=\"document.location='/admin/utilities/preorder.php?act=new'\" class=\"btn\">\n\t\t<p />\n\t\t<?php\n\t}",
"function tnpc_button($options, $prefix = 'button') {\n return TNP_Composer::button($options, $prefix);\n}",
"public function renderCreateButton()\n {\n return new Tools\\CreateButton($this);\n }",
"function sexy_button_to( $name, $internal_uri, $options = array())\n{\n $css_to_include = sfConfig::get( 'app_sfSexyButtonPlugin_stylesheet', '/sfSexyButtonPlugin/css/sexy_button' );\n $def_div_class = sfConfig::get( 'app_sfSexyButtonPlugin_div_class', 'sexy-button-clear' );\n $def_button_class = sfConfig::get( 'app_sfSexyButtonPlugin_button_class', 'sexy-button');\n sfContext::getInstance()->getResponse()->addStylesheet( $css_to_include );\n $html_options = _convert_options($options);\n // div class\n $div_class = _get_option($html_options, 'div_class', $def_div_class);\n // button class\n $button_class = _get_option($html_options, 'button_class', $def_button_class );\n $html_options['class'] = $button_class;\n // output div ?\n $nodiv = _get_option($html_options, 'nodiv', false);\n \n // One extra measure for IE\n $html_options['onclick'] = 'this.blur(); ponerLoading(this); '.\n ((isset($html_options['onclick']) ) ?\n $html_options['onclick'] : '');\n $html_options['id'] = \"sexyid\";\n // generate html\n $html = link_to( content_tag( 'span', $name), $internal_uri, $html_options );\n return ($nodiv) ? $html : content_tag( 'div', $html, \"class=$div_class\" );\n}",
"public function getDefaultButton() {}",
"public function btn($key) {\n return $this->msg('button', $key);\n }",
"function rt_ui_button($label, $target, $icon, $options = array())\n{\n $options['class'] = 'new ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary';\n $content = sprintf('<span class=\"ui-button-icon-primary ui-icon ui-icon-%s\"></span><span class=\"ui-button-text\">%s</span>', $icon, $label);\n return link_to($content, $target, $options);\n}",
"function BuyBoxSetNow() {\n\treturn\n'\n<a class=\"button radius primary medium\" title=\"Earlyarts Box Set\" href=\"/store/products/nurturing-young-childrens-learning-box-set/\" >Save a whopping 40% and buy this pack in a box-set!</a>\n';\n\t\n}",
"private function render_gen_button(MJKGenToolsPage $page): void {\r\n $this->render_ajax_button($page, 'Generate now', 'gen');\r\n }",
"function characterButton($button) {\n $content = \"\";\n if ($button == 'retreat') {\n $content .= '<a href=\"#\" class=\"retreat\">Retreat</a>';\n } elseif ($button == 'del') {\n $content .= '<a href=\"#\" class=\"delAtk\">Delete Attacks</a>';\n }\n echo $content;\n}"
]
| [
"0.7087225",
"0.6949685",
"0.6703582",
"0.6577574",
"0.65462667",
"0.65223116",
"0.649485",
"0.6457447",
"0.643599",
"0.637935",
"0.6369949",
"0.6364825",
"0.6267711",
"0.6265062",
"0.6243186",
"0.623559",
"0.62011313",
"0.62004894",
"0.61865336",
"0.61855036",
"0.6166324",
"0.6128853",
"0.6090072",
"0.6083583",
"0.60683465",
"0.60683036",
"0.60592294",
"0.605739",
"0.60507387",
"0.6044221"
]
| 0.70362175 | 1 |
Function to check if a user needs suggestions CONDITIONS: Must not have a confirmed disease already Must have some diagnosis already | function needs_suggestions($obj)
{
$decision = FALSE;
if($obj->session->userdata('trigger_suggestions') && $obj->session->userdata('conc_searchresults'))
{
$trigger_suggestions = $obj->session->userdata('trigger_suggestions');
#Check that there is no confirmed result in the display results before suggesting
$display_results = $obj->session->userdata('conc_searchresults');
$no_conf = "Y";
foreach($display_results AS $row)
{
if($row['percentage'] == 'CONF'){
$no_conf = "N";
break;
}
}
if($no_conf == 'Y' && !empty($trigger_suggestions))
{
$decision = TRUE;
}
}
return $decision;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkMySuggestToInstitutionPrivacyStatus($theId) {\n require_once (\"conn/config.php\");\n require_once (\"classes/database.php\");\n //--------------------\n $database = new mysqldatabase();\n $post_privacy_counter = 0;\n $suggest_privacy_msg_handler = \"\";\n $sql_privacy_posts = \"SELECT * FROM ogenius_nds_db_privacy_suggest_records WHERE ogenius_nds_db_privacy_suggest_records_user_id='{$theId}' ORDER BY ogenius_nds_db_privacy_suggest_records_id DESC LIMIT 1\";\n if ($query_privacy_posts = $database->query($sql_privacy_posts)) {\n //---------------------\n while ($res_privacy_posts = mysqli_fetch_array($query_privacy_posts)) {\n // $_privacy_posts_set_id = $res_privacy_posts['ogenius_nds_db_privacy_posts_records_id'];\n $_privacy_posts_set_txt_descr_1 = $res_privacy_posts['ogenius_nds_db_privacy_suggest_records_only_username'];\n $_privacy_posts_set_txt_descr_2 = $res_privacy_posts['ogenius_nds_db_privacy_suggest_records_username_and_location'];\n $_privacy_posts_set_txt_descr_3 = $res_privacy_posts['ogenius_nds_db_privacy_suggest_records_let_all_my_details_avail'];\n //--identify the posts algorithm--\n if ($_privacy_posts_set_txt_descr_1 == 1) {\n $suggest_privacy_msg_handler = \"all_the_details\";\n } else if ($_privacy_posts_set_txt_descr_2 == 1) {\n $suggest_privacy_msg_handler = \"only_username_and_location\";\n } else if ($_privacy_posts_set_txt_descr_3 == 1) {\n $suggest_privacy_msg_handler = \"only_username\";\n }\n $post_privacy_counter++;\n }\n //------------------\n if ($post_privacy_counter == 0) {\n $suggest_privacy_msg_handler = \"all_the_details\";\n }\n }\n return $suggest_privacy_msg_handler;\n}",
"public function canViewSuggestions(){\n $viewer_id = Engine_Api::_()->user()->getViewer()->getIdentity();\n if(!empty($viewer_id)){\n return true;\n } \n }",
"function in_designation()\n {\n $haystack = func_get_args();\n $result = 0;\n\n if (Auth::user()->user_type == 'Employee'){\n $needle = Auth::user()->employee->designation->short_name;\n $result = in_array($needle, $haystack) ? 1 : 0;\n }\n\n return $result;\n }",
"public function isDoNotSpellCheckSet() {}",
"function check_alltopicsattempted($uid){\n\t/**\n * This function check weather whole topics attempted or not and return yes or no\n * \n * @author Imran M Bajwa <[email protected]>\n * @return yes or no\n */ \n\tglobal $dbc;\n\n\n\t$sql = $dbc->query(\"select * FROM tests, test_log, user WHERE user.id='$uid' AND \n\t\tuser.test_id = tests.test_id AND user.id = test_log.uid ORDER BY test_log.t_time DESC LIMIT 1\");\n\tif ( $sql->num_rows == 0) return \"no\";\n\t$r = $sql->fetch_assoc();\t\n\t $atopics = explode(\",\", $r['topics']);\n\t$ltad = $r['tid'];\n\t$pos = sizeof($atopics)-1;\n\tif($pos == array_search($r['tid'],$atopics)){\n\t\treturn \"yes\";\n\t}\n\t// if( $ltad == $atopics[sizeof($atopics)-1] )\n\t\t\n\telse{\n\t\treturn \"no\";\n\t}\n\t\t\n}",
"function recommends_req_wizard_verification($form, &$form_state) {\n \n $output_info = array(\n 'prefix' => $form_state['prefix'],\n 'firstname' => $form_state['firstname'],\n 'lastname' => $form_state['lastname'],\n 'initial' => $form_state['initial'],\n 'suffix' => $form_state['suffix'],\n 's_email' => $form_state['s_email'],\n 's_school' => $form_state['s_school'],\n 's_req_date' => $form_state['s_req_date'],\n 's_master_doc' => $form_state['s_master_doc'],\n 's_comments' => $form_state['s_comments'],\n \t);\n \t\n \t $email_values = array(\n 'email' => $form_state['s_email'],\n 'message' => \"\\n\" . \"\\n\" .\n \"Name Prefix: \" . $output_info['prefix'] . \"\\n\" .\n \"First Name: \" . $output_info['firstname'] . \"\\n\" .\n \"Initial: \" . $output_info['initial'] . \"\\n\" .\n \"Last Name: \" . $output_info['lastname'] . \"\\n\" .\n \"Name Suffix: \" . $output_info['suffix'] . \"\\n\" .\n \"Student Email: \" . $output_info['s_email'] . \"\\n\" .\n \"Statement of intent, Point of view : \" . \"\\n\" . $output_info['s_comments'] . \"\\n\"\n );\n \n for ($i = 1; $i <= $form_state['num_schools']; $i++) {\n\t\t\n\t\t$output_schools[$i] = array(\n \t'r_email'=> $form_state['s_email'],\n \t'num_schools'=> $form_state['num_schools'],\n \t'r_school'=> $form_state['schoolname'][$i],\n \t'r_program'=> $form_state['schoolprogram'][$i],\n \t'r_program'=> $form_state['schoolprogram'][$i],\n \t 'r_school_contact_email' => $form_state['r_school_contact_email'][$i],\n \t 'r_school_contact_postal' => $form_state['r_school_contact_postal'][$i],\n \t'r_school_contact'=> $form_state['r_school_contact_postal'][$i],\n \t'r_date_due_month' => $form_state['r_date_due'][$i]['month'],\n 'r_date_due_day' => $form_state['r_date_due'][$i]['day'],\n 'r_date_due_year' => $form_state['r_date_due'][$i]['year'],\n \t'r_status'=> \"Initial\",\n\t\t\n \t);\n }\n $email_values['message'] = $email_values['message'] .\n \"\\n\" . \"Schools to receive recommendation.\" . \"\\n\\n\";\n \n $school_values = array(array());\n \n for ($i = 1; $i <= $output_schools[1]['num_schools']; $i++) {\t\n \t\n \t$email_values['message'] = $email_values['message'] . $output_schools[$i]['r_school'] . \"\\n\" .\n \t\"School Program/Position: \" .\n \t\n \t$output_schools[$i]['r_program'] . \"\\n\" .\n \t\"School contact postal: \" .\n \t$output_schools[$i]['r_school_contact_postal'] . \"\\n\" . \n \t\"School contact email: \" .\n \t$output_schools[$i]['r_school_contact_email'] . \"\\n\" . \t\n \t\"Final Date required by school: \" . \n \t$output_schools[$i]['r_date_due_month'] . \"/\" . \n \t$output_schools[$i]['r_date_due_day'] . \"/\" . \n \t$output_schools[$i]['r_date_due_year'] . \"\\n\\n\";\n \n };\n \n for ($i = 1; $i <= $form_state['num_courses']; $i++) {\n\t\t\n\t\t$pid = $form_state['input']['crsname'][$i]['i_pid'];\n\t\t\n\t\t$output_courses[$i] = array(\n \t'c_email' => $form_state['s_email'],\n \t'num_courses' => $form_state['num_courses'],\n \t'c_course' => $form_state['coursenum'][$i],\n \t'c_semester' => $form_state['coursesemester'][$i],\n \t'c_year' => $form_state['courseyear'][$i],\n \t'c_other' => $form_state['courseother'][$i],\n \t);\n \t\n }\n \n $email_values['message'] = $email_values['message'] .\n \"\\n\" . \"Courses in which enrolled with the professor.\" . \"\\n\";\n \n $course_values = array(array());\n \n for ($i = 1; $i <= $output_courses[1]['num_courses']; $i++) {\t\n \t\n \t$email_values['message'] = $email_values['message'] . \n \t\"\\n\" . \"Course: \" .\n \t\n \t$output_courses[$i]['c_course'] . \" \" .\n \t\"Semester: \" . \n \t$output_courses[$i]['c_semester'] .\n \t\" Year: \" . \n \t$output_courses[$i]['c_year'] . \"\\n\\n\" . $output_courses[$i]['c_other'] ;\n \n }; \n \n \n $msg = \"Please review the following information that you entered. Press Finish to send the information or cancel to abort the operation\";\n drupal_set_message('<pre id=rqmsgsize>' . print_r($msg, TRUE) . print_r($email_values['message'], TRUE) . '</pre>');\n \n // We will have many fields with the same name, so we need to be able to\n // access the form hierarchically.\n $form['#tree'] = TRUE;\n\n $form['description'] = array(\n '#type' => 'item',\n );\n\n if (empty($form_state['num_courses'])) {\n $form_state['num_courses'] = 1;\n }\n\n \n\n // Adds \"Add another course\" button\n $form['add_course'] = array(\n '#type' => 'submit',\n '#value' => t('Cancel'),\n '#submit' => array('recommends_req_intro'),\n );\n\n\n return $form;\n}",
"abstract public function check_hint();",
"function can_process()\n{\n global $controller, $Mode;\n if ( strlen( $_POST[ 'reported_by' ] ) > 0 )\n {\n return\n (!is_empty( $_POST[ 'gate_code' ], 'Superior Response' )) &&\n (!is_empty( $_POST[ 'superior_confirmed' ], 'Superior Confirmation' )) &&\n (!is_empty( $_POST[ 'superior_comments' ], 'Superior Comments' ))\n ;\n }\n else\n {\n return\n (!is_empty( $_POST[ 'gate_code' ], 'Employee Response' )) &&\n (!is_empty( $_POST[ 'employee_confirmed' ], 'Employee Confirmation' )) &&\n (!is_empty( $_POST[ 'employee_comments' ], 'Employee Comments' ))\n ;\n }\n}",
"public function suggest_deal_during_registration($firm_id,$deal_cat_arr,&$data_arr,&$data_count){\n return false;\n\t\t/***********\n\t\tsng:2/mar/2012\n\t\tnot used anywhere\n\t\t****************/\n }",
"public function getExhaustionExplanation ();",
"private function COIRequiresApproval()\r\n {\r\n global $db;\r\n\r\n // if there is more than one COI form in the db then approvals are required\r\n $sql = \"SELECT * FROM `forms_coi`\r\n WHERE `form_tracking_id` = \" . $this->trackingFormId . \"\r\n and `coi_none` = '0'\";\r\n $result = $db->getAll($sql);\r\n\r\n if (count($result) <= 0) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }",
"function ctr_validateConfirmation(&$ctx)\n{\n $reservation = $ctx['reservation'];\n\n if ($reservation->persons AND $reservation->destination)\n return true;\n\n $ctx['warning'] .= \"Please, do not play with the URL.\\n\";\n\n return false;\n}",
"public function accept_deal_suggestion($deal_suggestion_id,$suggestion_data_arr,&$deal_suggestion_accepted){\n return false;\n }",
"public function hasAutopos(){\n return $this->_has(2);\n }",
"public function suggests() : array;",
"abstract public function hasSolution(array $contextual_options=[]);",
"public function testWithVariationsOfDecideOptions(): void\n {\n $options = [\n OptimizelyDecideOption::INCLUDE_REASONS,\n // OptimizelyDecideOption::DISABLE_DECISION_EVENT,\n // OptimizelyDecideOption::ENABLED_FLAGS_ONLY, // ⬅️ Disable some of your flags\n // OptimizelyDecideOption::IGNORE_USER_PROFILE_SERVICE,\n // OptimizelyDecideOption::EXCLUDE_VARIABLES,\n ];\n\n $decision = $this->userContext->decide(FLAG_KEY, $options);\n\n $this->printDecision($decision, 'Modify the OptimizelyDecideOptions and check the decision variables expected');\n }",
"function validCondiments($selectedCondiments)\n {\n global $condiments; //This is defined in the controller\n //print_r($selectedCondiments);\n //print_r($condiments);\n\n //We need to check each condiment in our array\n foreach ($selectedCondiments as $selected) {\n if (!in_array($selected, $condiments)) {\n return false;\n }\n }\n return true;\n }",
"function can_process()\n{\n\tglobal $controller,$Mode;\n\treturn \n\t\t\t(!is_empty($_POST['transaction_reason'], ' Designation Reason')) &&\n\t\t\t(!is_empty($_POST['unit_id'], 'Unit')) && \n\t\t\t(!is_empty($_POST['department_id'], 'Department')) &&\n\t\t\t(!is_empty($_POST['employee_id'], 'Employee')) &&\n\t\t\t(\n\t\t\t\t( ($_POST['employee_id'] > 0) && ($_POST['employee_leave_id'] > 0)) ?\n\t\t\t\t//(greater_sanity_check($_POST['deduct_leave'],$_POST['remaining_leave'],\"Deduction Leaves\",\"Remaining Leaves\",1)) && \n\t\t\t\tis_number($_POST['deduct_leave'], \"Deduction Leaves\") &&\n\t\t\t\t!is_empty($_POST['deduct_leave'], \"Deduction Leaves\"):\n\t\t\t\t0\n\t\t\t)\n\t\t\t;\n}",
"function check_if_testtaken($db_object,$common,$post_var,$gbl_skill_type,$default,$user_id,$error_msg)\n{\n\t\n\twhile(list($kk,$vv) = @each($post_var))\n\t{\n\t\t$$kk = $vv;\n\n\t\tif(ereg(\"^test_mode_\",$kk))\n\t\t\t{\n\t\t\t$qid=ereg_replace(\"test_mode_\",\"\",$kk);\n\t\t\t$testmode_array[$qid] = $vv;\n\t\t\t}\n\n\t\tif(ereg(\"^skills_\",$kk))\n\t\t\t{\n\t\t\t$sid=ereg_replace(\"skills_\",\"\",$kk);\n\t\t\t$skills_sel_array[\"$sid\"] = $vv;\n\t\t\t}\n\t\t\n\t}\n\t\n\t$skills_for_rating = $common->prefix_table('skills_for_rating');\n\t$skills = $common->prefix_table('skills');\n\n\t$count = 0;\n\n\t\t\n//IF BOSS IS SELECTED THEN SELECT THE USERS UNDER HIM...\n\t\n\tif($bossid != 0)\n\t{\n\t\t$users_under_boss = $common->return_direct_reports($db_object,$bossid);\n\n\t\t$user_id_all_old = @array_merge($users_under_boss,$users_under_boss);\n\t\t$user_id_all_old = @array_unique($user_id_all_old);\n\n\t\twhile(list($kk,$vv) = @each($user_id_all_old))\t\n\t\t\t{\n\t\t\t\t$user_id_all_boss[] = $user_id_all_old[$kk];\n\t\t\t}\n\t\n\t$user_id_all_junk = @array_merge($user_id_all,$user_id_all_boss);\n\n\t$user_id_all_unordered = @array_unique($user_id_all_junk);\n\n\n\twhile(list($key,$val) = @each($user_id_all_unordered))\n\t\t{\n\n\t\t\t$user_id_all_new[] = $val;//$user_id_all_unordered[$key];\n\t\t}\t\n\t\n\t}\n\telse\n\t{\n\t\t$user_id_all_new = $user_id_all;\n\t}\n\t\t\n\t\n\t//print_r($user_id_all_new);exit;\n\n\n\tfor($i=0;$i<count($user_id_all_new);$i++)\n\t{\n\t\t@reset($gbl_skill_type);\n\t\twhile(list($kk,$vv) = @each($gbl_skill_type))\n\t\t{\n\n\t\t\t$user_id_sel = $user_id_all_new[$i];\n\t\t\t\n\t\t\t$mysql = \"select distinct(skill_id) from $skills_for_rating where skill_type = '$kk' and usr_id = '$user_id_sel'\";\n\t\t\t$skills_already_used_arr = $db_object->get_single_column($mysql);\n\n\t\t\t$skills_selected = $skills_sel_array[$kk];\n\n\t\t\t$skills_all = @implode(\"','\",$skills_selected);\n\n\t\t\t$mysql = \"select distinct(skill_id) from $skills_for_rating where skill_id in ('$skills_all') and usr_id = '$user_id_sel'\";\n\t\t\t$skills_present_arr = $db_object->get_single_column($mysql);\n\n\t\t\t$the_skills_present = @implode(\"','\",$skills_present_arr);\n\n\t\t\t$name = $common->name_display($db_object,$user_id_sel);\n\t\t\t\n\t\t\t\n\t\t\t$mysql = \"select skill_name from $skills where skill_id in ('$the_skills_present')\";\n\t\t\t$skillnames_arr = $db_object->get_single_column($mysql);\n\n\t\t\t$skillnames = @implode(\",\",$skillnames_arr);\n\t\t\t\n\t\t\t$skillnames_arr1 .= \"$skillnames\".\",\"; \n\n\t\t\t//$array_populate = @implode(\"','\",$skillnames_arr);\n\n\t\t\t//$arr = \"populated_array = Array ('$array_populate');\\n\";\n\t\t\t\n\t\t\t//$returncontent=preg_replace(\"/<{loopstart}>(.*?)<{loopend}>/s\",$arr,$returncontent);\n\n\t\t\t\tif($skills_present_arr != '')\n\t\t\t\t{\n\t\t\t\t\t$message1 = $error_msg['cThe_following'];\n\t\t\t\t\t$message2 = $vv;\n\t\t\t\t\t$message3 = $error_msg['cSkillsof'];\n\t\t\t\t\t$message4 = $name;\n\t\t\t\t\t$message5 = $error_msg['cArealreadyassigned'];\n\t\t\t\t\t$message6 = $skillnames;\n\t\t\t\t\t$message7 = $error_msg['cPleasedeselct_proceed'];\n\t\t\t\t\t\n\t\t\t\t\t//echo \"The following $vv skills of <b>$name</b> are already assigned<br>\n\t\t\t\t\t//<b>$skillnames</b><br>Please deselect them and proceed<br><br>\";\n\t\t\t\t\t$full_message = $message1.$message2.$message3.$message4.$message5.$message6.$message7;\n\t\t\t\t\techo $full_message;\n\t\t\t\t\t\n\t\t\t\t\t$count++;\n\t\t\t\t}\n\t\t\t\n\t\t}\n\n\t\tif($count == 0)\n\t\t{\n\t\t\treturn 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $skillnames_arr1;\n\t\t}\n\t\t\n\t}\n\t\n\t \n\t\n}",
"function determineEligibility() {\n if (isset($_REQUEST['eligible_submitted'])) {\n /* eligible if:\n * a woman\n * aged 16-50\n * has ticked one of the 'partner' checkboxes\n */\n $eligibility = false;\n if(isset($_REQUEST['female']) and isset($_REQUEST['age'])) {\n\tif ($_REQUEST['female'] == \"yes\" and $_REQUEST['age'] == \"yes\") {\n\n\t foreach ($_REQUEST as $req=>$value) {\n\t if(strpos( $req , 'partner_' ) !== false) {\n\t $eligibility = true;\n\t }\n\t }\n\t $this->eligible = $eligibility;\n\t $_SESSION[\"eligible\"] = $this->eligible;\n\t}\n }\n if ($this->eligible === true) {\n\t/* eligible go to plain language statement */\n\t$_REQUEST['mode'] = \"introduction\";\n\treturn $this->showIntro();\n }\n else {\n\t/* otherwise, thanks for coming */\n\treturn $this->showIneligible();\n }\n }\n $output = $this->outputBoilerplate('eligibility.html');\n return $output;\n }",
"public function getIsSuggested()\n {\n if (array_key_exists(\"isSuggested\", $this->_propDict)) {\n return $this->_propDict[\"isSuggested\"];\n } else {\n return null;\n }\n }",
"public function testWithVariationsOfDecideOptions(): void\n {\n $options = [\n OptimizelyDecideOption::INCLUDE_REASONS,\n // OptimizelyDecideOption::DISABLE_DECISION_EVENT,\n // OptimizelyDecideOption::ENABLED_FLAGS_ONLY, // ⬅️ Disable some of your flags\n // OptimizelyDecideOption::IGNORE_USER_PROFILE_SERVICE,\n // OptimizelyDecideOption::EXCLUDE_VARIABLES,\n ];\n\n $decision = $this->userContext->decideForKeys(FLAG_KEYS, $options);\n\n $this->printDecisions($decision, \"Modify the OptimizelyDecideOptions and check all the decisions' are as expected\");\n }",
"function checkTreatment($checkMe){\n\tif($checkMe==\"\"||$checkMe==\"Pills\"|| $checkMe==\"None\" || $checkMe == \"More than one insulin shot\" || $checkMe==\"One Insulin shot\" || $checkMe==\"Insulin pump\" || $checkMe==\"Other injections\"){\n\n\t\t// one of the acceptable reponses was found, return true\n\t\treturn true;\n\t}else{\n\t\t//no acceptable response\n\t\treturn false;\n\n\t}\n}",
"function validSituation($selectedSituation)\r\n {\r\n $validSituation = $this->_dataLayer->getSituation();\r\n\r\n //If the selected condiment is not in the valid list, return false\r\n if (!in_array($selectedSituation, $validSituation)) {\r\n return false;\r\n }\r\n\r\n //If we haven't false by now, we're good!\r\n return true;\r\n }",
"function ctr_validateHome(&$ctx)\n{\n $reservation = $ctx['reservation'];\n\n // variables exist *AND* are not empty\n if (!empty($_POST['destination']) AND !empty($_POST['personsCounter']))\n {\n $reservation->destination = htmlspecialchars($_POST['destination']);\n $reservation->insurance = isset($_POST['insurance'])? 'True':'False';\n $personsCounter = intval($_POST['personsCounter']);\n\n // set bounds to the number of persons\n if (1 <= $personsCounter AND $personsCounter <= 30)\n {\n $reservation->personsCounter = $personsCounter;\n $reservation->save();\n\n return true;\n }\n\n $ctx['warning'] .= \"Vous ne pouvez enregistrer \".\n \"que entre 1 et 30 personnes.\\n\";\n }\n\n // Bypass checks if datas were already filled\n if ($reservation->destination)\n return true;\n\n $ctx['warning'] .= \"Veuillez remplir tous les champs correctement.\\n\";\n\n return false;\n}",
"public function hasAnswers();",
"private function allowed_to_view_matches(){\n if(!rcp_user_can_access($this->user_id, $this->security_form_id) || !rcp_user_can_access($this->user_id, $this->defendant_id)){\n $this->error_message = esc_html__('You do not have access to this report.', 'pprsus');\n return false;\n }\n //are the variables even set\n if($this->security_form_id == '' || $this->defendant_id == '' || $this->token == ''){\n $this->error_message = esc_html__('There was a problem retrieving the prison list. Please return to the dashboard and try again.', 'pprsus');\n return false;\n }\n\n //is this a security form post type\n if(get_post_type($this->security_form_id) != 'security'){\n $this->error_message = esc_html__('There was a problem retrieving the prison list. Please return to the dashboard and try again.', 'pprsus');\n return false;\n }\n\n //does the security form or defendant belong to the current user\n $security_form_author = get_post_field('post_author', $this->security_form_id);\n if($security_form_author != $this->user_id){\n $this->error_message = esc_html__('This security report belongs to another user.', 'pprsus');\n return false;\n }\n\n $defendant_author = get_post_field('post_author', $this->defendant_id);\n if($defendant_author != $this->user_id){\n $this->error_message = esc_html__('This defendant belongs to another user.', 'pprsus');\n return false;\n }\n\n //is the token valid\n $token_from_post = get_post_meta((int)$this->security_form_id, 'secret_token', true);\n if($token_from_post != $this->token){\n $this->error_message = esc_html__('There was a problem retrieving the prison list. Please return to the dashboard and try again.', 'pprsus');\n return false;\n }\n\n return true;\n }",
"function hasAnonymizedResults()\n\t{\n\t\treturn ($this->getAnonymize() == self::ANONYMIZE_ON || \n\t\t\t$this->getAnonymize() == self::ANONYMIZE_FREEACCESS);\n\t}",
"function validIndoor($indoorInterests)\r\n {\r\n foreach($indoorInterests as $interest) {\r\n if(!in_array($interest, $this->_dataLayer->getIndoor())) {\r\n return false;\r\n }\r\n }\r\n return true;//if selected interests are right not spoofed return true\r\n }"
]
| [
"0.61455655",
"0.5851581",
"0.554772",
"0.5506474",
"0.54918754",
"0.5481",
"0.54707104",
"0.545044",
"0.5373593",
"0.5355686",
"0.53520566",
"0.5323436",
"0.5270249",
"0.5243295",
"0.522097",
"0.52100974",
"0.5161182",
"0.5131483",
"0.51230234",
"0.5116477",
"0.5109163",
"0.50640386",
"0.50426877",
"0.50321877",
"0.5012018",
"0.5010859",
"0.49986303",
"0.49971214",
"0.4971377",
"0.49416035"
]
| 0.69233936 | 0 |
Get a setting of the user by its key | public function getSettingByKey($key) {
// Return the user setting found by the key
return UserSetting::getByUserID($this->id, $key);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_user_setting( $user, $key = false )\n {\n //Unimplemented\n }",
"function getSettingByKey($key = ''){\n\t\treturn $this->setting->getSetting($key);\n\t}",
"public function get($key){\n return $this->getSetting($key);\n }",
"public function get($key)\n {\n return $this->settings[$key];\n }",
"public function getSetting($key) {\n\t\treturn $this->settings[$key];\n\t}",
"function getProp($key){\n global $mysqli;\n $sql = \"SELECT * FROM setting WHERE `key` = '\".$key.\"'\";\n if($result = $mysqli->query($sql)){\n return $result->fetch_object()->value;\n }else{\n return false;\n }\n }",
"public function getSettings($key){\r\n return $this->setting[$key];\r\n }",
"function get_setting($id_user = '')\n\t{\n\t\tif ($id_user === '')\n\t\t{\n\t\t\t$id_user = $this->session->userdata('id_user');\n\t\t}\n\t\t$this->db->where('user.id_user', $id_user);\n\t\t$this->db->join('user', 'user.id_user = user_settings.id_user');\n\t\treturn $this->db->get('user_settings');\n\t}",
"public function getSetting() {}",
"public function getSetting() {}",
"public function getSetting($key)\n\t{\n\t\treturn $this->settings[$key];\n\t}",
"public static function get($key)\n {\n return @static::$settings[$key];\n }",
"function settings ($key)\n {\n return $key;\n }",
"public function get(string $setting_key = '', $default_return = '');",
"public function getSetting($key) {\n\t\tif (!$this -> exists($key)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this -> settings[$key];\n\t}",
"protected function getSetting($key)\n {\n return $this->getComponentEntity()->getSetting($key);\n }",
"function getSettingValue($key)\n{\n return Setting::where('name', $key)->value('value');\n}",
"abstract protected function getSetting() ;",
"public function getSetting( $key )\r\n\t{\r\n\t\treturn self::$settings[ $key ];\r\n\t}",
"public static function get_setting($key) {\n $settings = static::get_settings();\n\n return $settings->get($key);\n }",
"public static function getSetting($key) \n\t{\n\t\t// get the registry singleton.\n\t\t$registry = Registry::singleton();\n\t\t\n\t\tif (isset ( $registry->_settings [$key] )) {\n\t\t\treturn $registry->_settings [$key];\n\t\t}\n\t}",
"function get_setting($meta_key, $channel = \"all\")\n {\n $setting = new \\Modules\\Admin\\Entities\\Setting();\n return $setting->get_setting_value($meta_key, $channel);\n }",
"public function show($key) {\n\t\tif(($setting = Setting::get($key)) == null) {\n\t\t\treturn false;\n\t\t\t// return responseFromCode(92010);\n\t\t}\n\t\treturn $setting;\n\t\t// return responseFromCode(91010, $setting);\n\t}",
"private static function getUserFromKey() {\n\t\tstatic $user;\n\t\t\n\t\tif ($user === null) {\n\t\t\t$user = false;\n\t\t\tif ($key = Request::getGET('key')) {\n\t\t\t\t$l = User::getUsers();\n\t\t\t\t$l = $l->filter($l->exprEqual($l->exprMember('unconfirmedEmailKey'),\n\t\t\t\t\t$key));\n\t\t\t\tif ($l->getCount() == 1)\n\t\t\t\t\t$user = $l->get(0);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($user === false)\n\t\t\treturn null;\n\t\telse\n\t\t\treturn $user;\n\t}",
"public static function getOption($key) {\n return DB::table('site_options')\n ->where('key', $key)\n ->first();\n }",
"public function getSettingsByKey(mixes $key)\n {\n /* Does Setting Exist @ client level */\n if (isset($this->getSettings()->{$key})) {\n return $this->getSettings()->{$key};\n } else {\n return (new CompanySettings($this->company->settings))->{$key};\n }\n }",
"public function get($key) {\n if (!isset($this->settings->$key)) {\n return null;\n }\n\n return $this->settings->$key;\n }",
"protected function get_setting( $key ) {\n\t\t$location = $this->setting_loc[$key];\n\t\t$type = $this->setting_type[$key];\n\t\t$value = is_array( $location ) ? $this->settings[$location[0]][$location[1]] : $this->settings[$location];\n\t\tif ( 'b' == $type ) {\n\t\t\t$value = ( $value ) ? true : false;\n\t\t} elseif ( 's' == $type ) {\n\t\t\t$value = wp_kses( trim( $value ), array(), array() );\n\t\t} elseif ( 'u' == $type ) {\n\t\t\t$value = esc_url_raw( trim( $value ), array( 'http', 'https' ) );\n\t\t} elseif ( 't' == $type ) {\n\t\t\t$value = trim( $value );\n\t\t}\n\t\treturn ( $value );\n\t}",
"public function get_setting() {\n // $this->db->where('option_name', $opname);\n \n $query = $this->db->get('t_pref');\n return $query->row();\n }",
"public function getOption($key);"
]
| [
"0.7978497",
"0.76898843",
"0.7087251",
"0.69664437",
"0.69134545",
"0.6879417",
"0.6857449",
"0.6850228",
"0.6849283",
"0.6849283",
"0.68167615",
"0.68119806",
"0.6810746",
"0.6630727",
"0.66111183",
"0.66054964",
"0.6599425",
"0.65956295",
"0.6584065",
"0.654086",
"0.65218526",
"0.6521752",
"0.6498206",
"0.64680105",
"0.64654535",
"0.6459722",
"0.6451164",
"0.64484143",
"0.6445103",
"0.64338136"
]
| 0.78718156 | 1 |
Return the profile image of the user or placeholder if none. | public function getProfileImage() {
$profileImage = SystemSetting::getByKey("ARC_USER_IMAGE", $this->id);
if (!empty($profileImage->value)) {
return system\Helper::arcGetPath() . "assets/profile/" . $profileImage->value;
}
return system\Helper::arcGetPath() . "assets/profile/placeholder.png";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProfileImage(){\n\t\t// To hook into this function we could use a an event:\n\t\t// $event = new CEvent();\n\t\t// $this->onGetProfileImage($event)\n\t\t// // then if the event has been handled \n\t\t// if($event->handled)\n\t\t// // we know another function has handled the event and found us an image url for this user\n\t\t// // it could store this in the event object\n\t\t// return $event->params->imageUrl \n\t\t\n\t\t// Display guest photo\n\t\treturn Yii::app()->controller->createWidget('nii.widgets.Gravatar',array('email'=>$this->email))->getUrl();\n\t}",
"public function getProfilePicture();",
"public function getAvatarImage() : string\n {\n $imagePlaceholder = asset('storage/images/profiles') . '/' . Auth::user()->avatar;\n\n if(empty(Auth::user()->avatar)) {\n $imagePlaceholder = asset('img/user-image-placeholder.png');\n }\n\n return $imagePlaceholder;\n }",
"public function getImageProfile() {\n\t\t$basePath = Yii::getAlias ( '@web' );\n\t\t\n\t\t$usuarioFacebook = $this->entUsuariosFacebook;\n\t\t\n\t\tif(empty($usuarioFacebook)){\n\t\t\tif ($this->txt_imagen) {\n\t\t\t\treturn $basePath . '/profiles/' . $this->txt_token.\"/\". $this->txt_imagen;\n\t\t\t}\n\t\t\t\n\t\t\treturn $basePath . '/webAssets/images/site/user.png';\n\t\t}\n\t\t\n\t\treturn 'http://graph.facebook.com/'.$usuarioFacebook->id_facebook.'/picture';\n\t\t\n\t}",
"function get_user_profile_image_url($user_id){\n\t$image_url = THEME_URI.'/images/profile_placeholder.png';\n\tif($image_relative_path = get_user_meta($user_id, 'profile_image_url', true))\n\t{\n\t\t$image_url = $image_relative_path;\n\t}\n\treturn $image_url;\n}",
"public function getProfileImg()\n {\n return $this->profile_img;\n }",
"function getprofileimage($username){\n $user = DB::table('users')->where('username', $username)->first();\n $profileimage = $user->profileimage;\n if($profileimage == \"\"){\n\t$profileimagepath = \"/images/user.png\";\n return($profileimagepath);\n }\n $profileimagepath = \"/image/\".$username.\"/profileimage/\".$profileimage;\n return($profileimagepath);\n}",
"public function profilePicture()\n {\n if ($this->picture) {\n return \"/storage/{$this->picture}\";\n }\n\n return 'http://i.pravatar.cc/200';\n }",
"public function getProfileImg()\n {\n return $this->profileImg;\n }",
"protected function getProfileImage()\n {\n $path = $this->_getImageBasePath() . $this->_getImageName();\n\n if(!file_exists($this->_getFullImagePath($path))) {\n //reszise and return path to new resized image\n //@todo resize\n $originImage = $this->_getImageName(false);\n if(file_exists($this->_getFullImagePath($originImage))) {\n //resize it and return path to resized image\n //if it can't resized, return default image\n } else {\n return $this->_getDefaultImage();\n }\n } else {\n return $path;\n }\n\n\n }",
"public function getProfilePicture()\n\t{\n\t\treturn $this->info['profile_picture'];\n\t}",
"public function getRiderProfilePictureAttribute()\n {\n $profile_picture=ProfilePicture::where('user_id',$this->attributes['user_id'])->first();\n return isset($profile_picture)?$profile_picture->src:url('images/user.jpeg');\n }",
"public function getProfileImage()\n {\n if ($this instanceof \\humhub\\modules\\space\\models\\Space) {\n return new \\humhub\\libs\\ProfileImage($this->guid, 'default_space');\n }\n return new \\humhub\\libs\\ProfileImage($this->guid);\n }",
"public function getProfilePicture()\n {\n return $this->profilePicture;\n }",
"function getEmptyUserImageUrl() {\n\t\treturn url('images/user.png');\n\t}",
"public function getAvatar()\n {\n return $this->getProfilePicture();\n }",
"public function get_user_image() {\n\t\tloggedOnly();\n\n\t\t// Pega o usuario logado\n\t\t$user = auth();\n\n\t\t// Busca a imagem\n\t\tif( $user->midia_id ) {\n\t\t\tif( $image = $user->belongsTo( 'midia' ) ) {\n\t\t\t\treturn resolve( $image->path() );\n\t\t\t} return resolve( base_url( 'public/images/empty.jpg' ) );\n\t\t} return resolve( base_url( 'public/images/empty.jpg' ) );\n\t}",
"function get_user_profile_pic( $user_id, $height = 100, $width = 100 ) {\n\t$user_data = get_userdata( intval( $user_id ) );\n\n\tif ( $user_data ->user_photo != '' ) {\n\t\t$img_data = '<img name=\"user_photo\" class=\"agent_photo\" id=\"user_photo\" src=\"' . $user_data ->user_photo . '\" width=\"' . $width . '\" height=\"' . $height . '\" />';\n\t} else {\n\n\t\t\t$img_data = '<img name=\"user_photo\" class=\"agent_photo\" id=\"user_photo\" src=\"' . get_bloginfo( 'template_directory' ) . '/images/avatar_post.png\" width=\"' . $width . '\" height=\"' . $height . '\" />';\n\t}\n\n\t\techo $img_data;\n}",
"public function getProfileImageURL()\n {\n return 'https://avatars3.githubusercontent.com/u/4479918?v=4&s=460';\n }",
"public function getProfilePhotoUrlAttribute(): string\n {\n return $this->profile_photo_path && $this->photoExists()\n ? Storage::disk($this->profilePhotoDisk())->url($this->profile_photo_path)\n : $this->filamentDefaultAvatar();\n }",
"function upm_get_avatar($avatar = '') {\r\n global $current_user;\r\n wp_get_current_user();\r\n\r\n if( $current_user && is_object($current_user) && is_a($current_user, 'WP_User')) {\r\n if ($current_user->has_cap('partner') && !empty($current_user->user_image)) {\r\n $avatar = wp_get_attachment_image_url($current_user->user_image,'thumbnail', false);\r\n } else {\r\n $avatar = get_avatar_url($current_user->ID);\r\n }\r\n }\r\n return \"<img class='avatar avatar-64 photo' src='\" . $avatar . \"'>\";\r\n}",
"public function get_user_image($user_id) {\n\t\tif (file_exists('uploads/users/'.$user_id.'.jpg'))\n\t\treturn base_url().'uploads/users/'.$user_id.'.jpg';\n\t\telse\n\t\treturn base_url().'uploads/users/placeholder.jpg';\n\t}",
"public function getProfileImageURL()\n {\n return 'https://s.gravatar.com/avatar/9ff2a97e7faf3529f1b78f1f737ebca0?s=80';\n }",
"public static function profileImageUrl($user = null, $size = 28)\n\t\t{\n\t\t\tif($user) {\n\t\t\t\tif(isset($user['avatar'])) {\n\t\t\t\t\t$url = parse_url($user['avatar']);\n\t\t\t\t\tif(isset($url['query'])) {\n\t\t\t\t\t\t$url['query'] = 'sz=' . $size;\n\t\t\t\t\t\treturn $url['scheme'] . '://' . $url['host'] . '/' . $url['path'] . '?' . $url['query'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif($user['avatar']) {\n\t\t\t\t\t\t\treturn $user['avatar'] . '?sz=' . $size;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn Render::image('no-photo.jpg');\n\t\t}",
"public function getAvatar()\n\t{\n\t\treturn $this->instance->profile;\n\t}",
"public function picture()\n {\n if ($this->image->exists()) {\n return resource_url('images/users/' .basename($this->image->path));\n }\n\n // Fallback to AdminLTE's default image.\n return vendor_url('dist/img/avatar5.png', 'almasaeed2010/adminlte');\n }",
"function displayProfilePic()\n {\n global $db;\n $image = $db->query(\"SELECT userProfilePic FROM users WHERE id= '{$_SESSION['id']}' \") ;\n return $image;\n }",
"public function getAvatar() {\n return (new Query())->select('profile_photo')->from('user_cv')\n ->where(['user_id' => $this->id, 'is_default' => true])\n ->limit(1)->scalar();\n }",
"public function getAvatar()\n {\n // so that updated images happen when users change their avatar. Also fixes #9822\n if (!isset($this->data['avatar'])) {\n $ui = app(UserInfoRepository::class)->getByID($this->data['id']);\n if ($ui) {\n $this->data['avatar'] = $ui->getUserAvatar()->getPath();\n }\n }\n return $this->data['avatar'];\n }",
"function get_display_photo(){\n\t$display_photo = get_profile( 'photo' );\n\tif ( empty($display_photo) || !file_exists(abspath('/contents/images/profile/'.$display_photo)) )\n\t\treturn false;\n\n\treturn get_image_link( \"/images/profile/$display_photo\", \"default\" );\n}"
]
| [
"0.79500955",
"0.7928885",
"0.7906118",
"0.79026353",
"0.7808406",
"0.7758621",
"0.772902",
"0.7723259",
"0.7711937",
"0.7691842",
"0.76716423",
"0.7644954",
"0.7612812",
"0.76041865",
"0.75716627",
"0.74918824",
"0.7442155",
"0.743639",
"0.7418253",
"0.74020934",
"0.7380061",
"0.7279252",
"0.7268804",
"0.7254337",
"0.72406495",
"0.72283214",
"0.722731",
"0.71982807",
"0.7172761",
"0.7156833"
]
| 0.86847097 | 0 |
Compiles the Element node | public function compile(\DOMText $node, DataObject $processedObject); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function compile(Compiler $compiler, Node $node);",
"function compile_html () {\n\t //here go the subtags & attributes\n \n //see if we can make a coffee script compiler\n \n if (file_exists (dirname(__FILE__).\"/coffeescript/Init.php\")) {\n require_once dirname(__FILE__).\"/coffeescript/Init.php\";\n Coffeescript\\Init::load();\n $this->content = CoffeeScript\\Compiler::compile($this->get_content(), array(\"filename\"=>\"test.coffee\", \"bare\" => true));\n }\n else {\n $this->content = $this->get_content(); \n }\n \n \n $html = \"\"; \n\t $attributes = \"\";\n $this->openingtag = $this->get_openingtag();\n $this->closingtag = $this->get_closingtag();\n $this->attributes = $this->get_attributes();\n $this->childrenElements = $this->get_childrenElements();\n \n\t foreach ($this->attributes as $aid => $avalue) {\n\t foreach ($avalue as $vkey => $value) {\n\t $attributes .= \" {$vkey}=\\\"{$value}\\\"\";\n\t\t}\n\t }\n\t \n\t if ( strpos($this->openingtag, \"[content]\") !== false ) {\n\t $openingtag = str_replace (\"[attributes]\", $attributes, $this->openingtag);\n\t $openingtag = str_replace (\"[content]\", $this->content, $openingtag );\n\t $html .= $openingtag;\n\t } \n\t else {\n\t $html .= str_replace (\"[attributes]\", $attributes, $this->openingtag);\n\t $html .= $this->content;\n\t }\n\t \n\t foreach ($this->childrenElements as $childid => $element) {\n\t $html .= $element->compile_html();\n\t }\n\t \n\t \n\t if ($this->closingtag != \"\") { \n\t $html .= str_replace (\"[attributes]\", $attributes, $this->closingtag);\n\t }\n\t \n\t return $html;\n }",
"public function compile ();",
"public function compile()\n {\n\n $this->buildPage();\n\n if (defined('DEBUG_MARKUP') && DEBUG_MARKUP) {\n ob_start();\n $checkXml = new DOMDocument();\n\n if ($this instanceof LibTemplateAjax)\n $checkXml->loadXML($this->compiled);\n else\n $checkXml->loadHTML($this->compiled);\n\n $errors = ob_get_contents();\n ob_end_clean();\n\n // nur im fehlerfall loggen\n if ('' !== trim($errors)) {\n\n $this->getResponse()->addWarning('Invalid XML response');\n\n SFiles::write(PATH_GW.'log/tpl_xml_errors.html', $errors.'<pre>'.htmlentities($this->compiled).'</pre>');\n SFiles::write(PATH_GW.'log/tpl_xml_errors_'.date('Y-md-H-i_s').'.html', $errors.'<pre>'.htmlentities($this->compiled).'</pre>');\n }\n }\n\n if ($this->keyCachePage) {\n $this->writeCachedPage($this->keyCachePage , $this->compiled);\n }\n\n $this->output = $this->compiled;\n\n\n }",
"public function buildElement() {\n\n // Set the element type\n $this->addType('example');\n\n // Add the element attributes\n $this->addAttributes(array(\n // Some attributes\n ));\n\n // Example if we need to add child object\n // to this element\n $object = new VTCore_Form_Base();\n $object->addType('example_child');\n $object->addAttributes(array(\n // Some Attributes\n ));\n\n // Adding a plaing text as child of subchild\n $object->addText('some text');\n\n // Inject the child and subchild back to parent\n $this->addChildren($object);\n\n // No need to echo or print anything, all the\n // actual rendering will be performed by\n // VTCore_Form_Base() when user is invoking\n // the render or __toString method.\n }",
"function compile_html () {\n\t //here go the subtags & attributes\n $html = \"\"; \n\t $attributes = \"\";\n\t foreach ($this->attributes as $aid => $avalue) {\n\t foreach ($avalue as $vkey => $value) {\n\t $attributes .= \" {$vkey}=\\\"{$value}\\\"\";\n\t\t}\n\t }\n\t \n\t if ( strpos($this->openingtag, \"[content]\") !== false ) {\n\t $openingtag = str_replace (\"[attributes]\", $attributes, $this->openingtag);\n\t $openingtag = str_replace (\"[content]\", $this->content, $openingtag );\n\t $html .= $openingtag;\n\t } \n\t else {\n\t $html .= str_replace (\"[attributes]\", $attributes, $this->openingtag);\n\t $html .= $this->content;\n\t }\n\t \n\t foreach ($this->childrenElements as $childid => $element) {\n\t $html .= $element->compile_html();\n\t }\n\t \n\t \n\t if ($this->closingtag != \"\") { \n\t $html .= str_replace (\"[attributes]\", $attributes, $this->closingtag);\n\t }\n\t \n\t return $html;\n }",
"public function buildElement()\n\t{\n\t\t$e = $this->getElement();\n\t\t$view = $e->getView();\n\t\t$helper = $e->helper;\t\t\n\t\t\n\t\t$type = $e->getType();\n\t\t\n\t\t$attribs = $e->getAttribs();\n\t\t\n\t\t/*$mode = self::MODE_FILE;\n\t\tif (is_string($attribs['selector_mode']) && in_array($attribs['selector_mode'], $this->_modes)) {\n\t\t\t$mode = $attribs['selector_mode'];\n\t\t}\n\t\t$attribs['selector_mode'] = $mode;*/\n\t\t\n\t\t$buttonLabel = '';\n\t\t\n\t\t$selectMultiple = 'false';\n\t\t$jsMethod = 'mainImageRenderer';\n\t\tif (isset($attribs['selectMultiple']) && !!$attribs['selectMultiple']) {\n\t\t\t$selectMultiple = 'true';\n\t\t\t$jsMethod = 'imagesRenderer';\n\t\t}\n\t\t\n\t\t$imgType = '';\n\t\tif (is_string($attribs['media-type'])) {\n\t\t\t$imgType = $attribs['media-type'];\n\t\t\tunset ($attribs['media-type']);\n\t\t}\n\t\t\n\t\t$xhtml = '<div class=\"' . $this->_namespace . '-tag\">'\n\t\t\t . $view->formHidden($e->getName(), $e->getValue(), array('media-type' => $imgType, 'select-multiple' => $selectMultiple, 'autocomplete' => \"off\"))\n\t\t\t . $view->$helper($e->getName(), $buttonLabel, $attribs, $e->options)\n\t\t\t . '<script>$(document).ready(function(){ $.fn.cmsManager(\\'' . $jsMethod . '\\', null, \\'' . $e->getName() . '\\'); })</script>'\n\t\t\t . '</div>';\t\t\t\n\t\n\t\treturn $xhtml;\n\t}",
"protected function compile()\n\t{\n\n\t\t$this->Template->tweetcontainer = $this->html;\n\n\t}",
"public function build(){\n\n\t\t// Node Attributes;\n\t\t$this->getAttrString();\n\t\t\n\t\tif(is_array($this->content)){\n\t\t\t$this->html.= '<'. $this->tag .' '. $this->attrString .'>' ;\n\t\t\tforeach ($this->content as $key => $value) \n\t\t\t\t$this->html.= $value->build() ;\n\n\t\t\t$this->html .= '</'. $this->tag .'>';\n\t\t}else{\n\t\t\t// Node Content\n\t\t\t$nodeContent = $this->content instanceof HTMLNode ? $this->content->build() : $this->content ; \n\n\t\t\t// Node HTML\n\t\t\t$this->html = '<'. $this->tag .' '. $this->attrString .'>'. $nodeContent .'</'. $this->tag .'>' ;\n\t\t}\n\n\t\treturn $this->html ;\n\t}",
"protected function parseElement()\n {\n $c = $this->parseCombinator();\n\n $e = $this->match(array(\n '/\\\\G(?:\\d+\\.\\d+|\\d+)%/',\n //'/\\\\G(?:[.#]?|:*)(?:[\\w-]|[^\\x00-\\x9f]|\\\\\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/',\n // http://stackoverflow.com/questions/3665962/regular-expression-error-no-ending-delimiter\n '/\\\\G(?:[.#]?|:*)(?:[\\w-]|[^\\\\x{00}-\\\\x{9f}]|\\\\\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/',\n '*',\n '&',\n 'parseAttribute',\n '/\\\\G\\([^()@]+\\)/',\n '/\\\\G[\\.#](?=@)/',\n 'parseEntitiesVariableCurly'\n ));\n\n if (!$e) {\n if ($this->matchChar('(')) {\n if (($v = $this->parseSelector()) && $this->matchChar(')')) {\n $e = new ILess_Node_Paren($v);\n }\n }\n }\n\n if ($e) {\n return new ILess_Node_Element($c, $e, $this->position, $this->env->currentFileInfo);\n }\n }",
"function compile_html () {\n\t //here go the subtags & attributes\n \n //see if we can make a sass script compiler\n \n if (file_exists (dirname(__FILE__).\"/scssphp/scss.inc.php\")) {\n require_once dirname(__FILE__).\"/scssphp/scss.inc.php\";\n $scss = new scssc();\n $this->content = $scss->compile ($this->get_content());\n }\n else {\n $this->content = $this->get_content ();\n }\n \n \n $html = \"\"; \n\t $attributes = \"\";\n $this->openingtag = $this->get_openingtag();\n $this->closingtag = $this->get_closingtag();\n $this->attributes = $this->get_attributes();\n $this->childrenElements = $this->get_childrenElements();\n \n\t foreach ($this->attributes as $aid => $avalue) {\n\t foreach ($avalue as $vkey => $value) {\n\t $attributes .= \" {$vkey}=\\\"{$value}\\\"\";\n\t\t }\n\t }\n\t \n\t if ( strpos($this->openingtag, \"[content]\") !== false ) {\n\t $openingtag = str_replace (\"[attributes]\", $attributes, $this->openingtag);\n\t $openingtag = str_replace (\"[content]\", slib_compress_script ( $this->content ), $openingtag );\n\t $html .= $openingtag;\n\t } \n\t else {\n\t $html .= str_replace (\"[attributes]\", $attributes, $this->openingtag);\n\t $html .= slib_compress_script ( $this->content );\n\t }\n\t \n\t foreach ($this->childrenElements as $childid => $element) {\n\t $html .= $element->compile_html();\n\t }\n\t \n\t \n\t if ($this->closingtag != \"\") { \n\t $html .= str_replace (\"[attributes]\", $attributes, $this->closingtag);\n\t }\n\t \n\t return $html;\n }",
"public function compile(Twig_Compiler $compiler);",
"protected function compile()\n {\n $this->addImageToTemplate($this->Template, $this->arrData);\n }",
"public function compile()\n\t{\n\t\tif ($this->dirty() and $this->compile)\n\t\t{\n\t\t\t$compiler = new Compiler($this, $this->app);\n\t\t\t$this->contents = $compiler->run();\n\t\t}\n\t}",
"public function compile()\r\n\t{\r\n\t\t$this->writeToTemplate(($this->picker != 'unit') ? ($this->multiple) ? deserialize($this->Value->multiField) : $this->Value->textField : deserialize($this->Value->inputUnit));\t\r\n\t}",
"protected function compile()\n\t{\n\t\t$lexer = new Lexer($this->template->getEnvironment());\n\t\t$stream = $lexer->tokenize(file_get_contents($this->filename), basename($this->filename));\n\n\t\t// unique class based on the filename\n\t\t// @todo fix problem with '-' in classes\n\t\t$class = $this->template->getEnvironment()->getCacheFilename($this->filename);\n\t\t$class = 'S' . substr($class, 0, -8) . '_Template';\n\n\t\t// writer object which contains the parsed PHP code\n\t\t$writer = new Writer();\n\t\t$writer->write(\"<?php\\n\");\n\t\t$writer->write(\"\\n\");\n\t\t$writer->write('namespace Spoon\\Template;' . \"\\n\");\n\t\t$writer->write(\"\\n\");\n\t\t$writer->write('/* ' . $this->filename . ' */' . \"\\n\");\n\t\t$writer->write(\"class $class extends Renderer\\n\");\n\t\t$writer->write(\"{\\n\");\n\t\t$writer->indent();\n\t\t$writer->write('protected function display(array $context)' . \"\\n\");\n\t\t$writer->write(\"{\\n\");\n\t\t$writer->indent();\n\n\t\t$tags = $this->template->getEnvironment()->getTags();\n\n\t\t$token = $stream->getCurrent();\n\t\twhile(!$stream->isEof())\n\t\t{\n\t\t\tswitch($token->getType())\n\t\t\t{\n\t\t\t\tcase Token::TEXT:\n\t\t\t\t\t$text = new TextNode($stream, $this->template->getEnvironment());\n\t\t\t\t\t$text->compile($writer);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase Token::VAR_START:\n\t\t\t\t\t$stream->next();\n\t\t\t\t\t$variable = new VariableNode($stream, $this->template->getEnvironment());\n\t\t\t\t\t$variable->compile($writer);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase Token::BLOCK_START:\n\t\t\t\t\t$token = $stream->next();\n\n\t\t\t\t\t// validate tag existence\n\t\t\t\t\tif(!isset($tags[$token->getValue()]))\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\tsprintf('There is no such template tag \"%s\"', $token->getValue()),\n\t\t\t\t\t\t\t$token->getLine(),\n\t\t\t\t\t\t\t$this->filename\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$node = new $tags[$token->getValue()]($stream, $this->template->getEnvironment());\n\t\t\t\t\t$node->compile($writer);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif($token->getType() !== Token::EOF)\n\t\t\t{\n\t\t\t\t$token = $stream->next();\n\t\t\t}\n\n\t\t\telse break;\n\t\t}\n\n\t\t$writer->outdent();\n\t\t$writer->write(\"}\\n\");\n\t\t$writer->outdent();\n\t\t$writer->write(\"}\\n\");\n\t\treturn $writer->getSource();\n\t}",
"public function compile($value);",
"public function compile(Twig_Compiler $compiler)\n {\n \tif ('_self' === $this->getAttribute('name')) {\n //$compiler->raw('$this');\n } elseif ('_context' === $this->getAttribute('name')) {\n // $compiler->raw('$context');\n } elseif ('_charset' === $this->getAttribute('name')) {\n // $compiler->raw('$this->env->getCharset()');\n } else {\n $compiler\n \t->write(sprintf('$context[\\'%s\\'] = (isset($context[\\'%s\\']) ? $context[\\'%s\\'] : new %s())', $this->getAttribute('name'), $this->getAttribute('name'), $this->getAttribute('name'), $this->getAttribute('name')))\n \t\t->raw(\";\\n\");\n }\n \t\n \t$compiler ->write('echo ')\n ->subcompile($this->getNode('names')->getNode(0))\n ->raw(\"\\n\");\n \n $compiler->raw(\";\\n\");\n }",
"protected function generate_instruction()\n {\n $this->xml->startElement(\"instruction\");\n $this->xml->writeAttribute(\"order\", $this->instrCount);\n $this->xml->writeAttribute(\"opcode\", $this->token);\n }",
"private function apply_node_instructions() {\n // Add a new node visitor to the traverser\n $this->get_traverser()->addVisitor(new class($this) extends \\PhpParser\\NodeVisitorAbstract {\n public function __construct($file) {\n $this->file = $file;\n }\n\n /**\n * Applies all instructions to a node for a given type\n *\n * @param string $type The instruction type to be applied\n * @param \\PhpParser\\Node $node The node to be actioned\n * @return \\PhpParser\\Node\n */\n private function apply_instructions(string $type, \\PhpParser\\Node $node): \\PhpParser\\Node {\n // Retrieve all instructions by type\n $instructions = $this->file->get_instructions($type);\n\n // Check if has no leave instructions\n if (empty($instructions)) {\n return $node;\n }\n\n // Iterate over all instructions\n foreach($instructions as $instruction) {\n // Get the node type\n $instruction_node = $instruction->node;\n\n // Check if it's not the same as the current node\n if (!($node instanceof $instruction_node)) {\n continue;\n }\n\n // Extract the parameters\n $if = (array) $instruction->if;\n $do = (array) $instruction->do;\n\n // Check for all instructions\n foreach($if as $index => $cnd) {\n // Variable that will later handle if the condition was met\n $condition = false;\n\n // Check if condition is a callback\n if (is_callable($cnd)) {\n // Try matching it with the current node\n $condition = call_user_func_array($cnd, [$node]);\n } else {\n // Retrieve the index value\n $node_index = $node->{$index};\n\n // Check if the condition value is a string, and node index has a toString() method\n if (is_string($cnd[1]) && is_callable([$node_index, \"toString\"])) {\n // Call it\n $node_index = $node_index->toString();\n }\n\n // Evaluate the condition\n eval(\"\\$condition = \\$node_index \" . $cnd[0] . \" \" . escapeshellarg($cnd[1]) . \";\");\n }\n\n // Check if the condition was not met\n if (!$condition) {\n // Assert the failed condition\n $instruction->do_assertion(File\\Instruction::ASSERT_FAILED_CONDITION_NOT_MET, null);\n\n // Break the instruction\n break 2;\n }\n }\n\n // Do all instructions\n foreach($do as $action) {\n // Check if it's callable\n if (is_callable($action)) {\n // Just call the action\n call_user_func_array($action, [$node]);\n continue;\n }\n\n // Extract the action name\n $action_name = $action[\"action\"];\n unset($action[\"action\"]);\n\n // Check if is settings variables\n if ($action_name === \"set\") {\n // Iterate over all variables\n foreach($action[\"vars\"] ?? $action[\"variables\"] as $var => $value) {\n // Set the node variable value\n $node->{$var} = $value;\n }\n }\n }\n }\n\n return $node;\n }\n\n public function leaveNode(\\PhpParser\\Node $node) {\n return $this->apply_instructions(\"leave\", $node);\n }\n\n public function enterNode(\\PhpParser\\Node $node) {\n return $this->apply_instructions(\"enter\", $node);\n }\n });\n }",
"protected function compile() {\n\n // set default values for styling preview\n if( $this->isStylePreview ) {\n\n if( !$this->url && !$this->linkTitle ) {\n\n $this->url = '#';\n $this->linkTitle = 'Button';\n }\n\n $this->titleText = $this->titleText?:'Tooltip';\n }\n\n parent::compile();\n\n $this->Template->unique = Helper::getUniqueID($this);\n\n $strStyle = $this->generateStylesheet();\n\n if( strlen($strStyle) ) {\n $GLOBALS['TL_HEAD'][] = '<style>'.$strStyle.'</style>';\n }\n }",
"public function generate(ExpressionNode $expression);",
"public function create()\r\n {\r\n // Load only root elements.\r\n $this->loadRoots($this->elements, $this->roots);\r\n\r\n // Make sure that first element isn't child. If child then throw a exception about that.\r\n if ($this->elements[0]->isChild())\r\n TypeRegression::cantBe('child', 'First');\r\n\r\n // Set elements compiled field with relations\r\n $this->makeRelationsToCompiled($this->elements);\r\n \r\n // After append process by root-child then compile all stuffs into 'page' field.\r\n foreach ($this->roots as $key => $element) {\r\n \r\n $this->page .= $element->compiled;\r\n }\r\n }",
"protected function preVisitElement(Element $element)\n\t{\n\t\t$elementCodeBuffers = $this->codeBufferManager->getProperties($element);\n\t\t$elementProperties = $this->nodePropertyManager->getProperties($element);\n\t\t\n\t\tif($elementCodeBuffers->hasContent(CodeBufferCollection::TAG_NAME))\n\t\t{\n\t\t\t$name = $elementCodeBuffers->link(array(CodeBufferCollection::TAG_NAME));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$name = $element->getFullyQualifiedName();\n\t\t}\n\t\t\n\t\tif(!$element->hasChildren() && $element->isEmpty())\n\t\t{\n\t\t\t$this->output .= $elementCodeBuffers->link(array(CodeBufferCollection::TAG_BEFORE, CodeBufferCollection::TAG_SINGLE_BEFORE));\n\t\t\t$this->output .= '<'.$name.$this->linkAttributes($element, $elementCodeBuffers, $elementProperties).' />';\n\t\t\t$this->output .= $elementCodeBuffers->link(array(CodeBufferCollection::TAG_SINGLE_AFTER, CodeBufferCollection::TAG_AFTER));\n\t\t\treturn null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->output .= $elementCodeBuffers->link(array(CodeBufferCollection::TAG_BEFORE, CodeBufferCollection::TAG_OPENING_BEFORE));\n\t\t\t$this->output .= '<'.$name.$this->linkAttributes($element, $elementCodeBuffers, $elementProperties).'>';\n\t\t\t$this->output .= $elementCodeBuffers->link(array(CodeBufferCollection::TAG_OPENING_AFTER, CodeBufferCollection::TAG_CONTENT_BEFORE));\n\t\t\t\n\t\t\t$elementProperties->set('link:name', $name);\n\t\t\treturn $this->enqueue($element);\n\t\t}\n\t}",
"protected function compile()\n\t{\n\t\t$this->Template->anchor = standardize($this->headline) . '-' . $this->id;\n\t}",
"public function compileTag()\n {\n $classNode = new \\Twig_Node_Expression_Constant('tag_field large ', $this->lineno);\n \n if ($this->hasNode('class')) {\n $classNode = new \\Twig_Node([\n $classNode,\n $this->getNode('class')\n ]);\n }\n $this->setNode('class', $classNode);\n\n \n \n // create list id node\n $this->compiler\n ->write('$context[\\'_fierce_tag_list_id\\'] = trim(preg_replace(\\'/[^a-zA-Z0-9_]+/\\', \\'_\\', ')\n ->subcompile($this->getNode('name'))\n ->raw(\"), '_') . '_tags';\\n\")\n ;\n $listIdNode = new \\Twig_Node_Expression_Name('_fierce_tag_list_id', $this->lineno);\n \n \n // output field\n parent::compileTag();\n \n // output list\n $this->openTag('ul', [\n 'id' => $listIdNode,\n 'class' => 'tag_list'\n ]);\n \n $this->compiler\n ->addDebugInfo($this)\n // the (array) cast bypasses a PHP 5.2.6 bug\n ->write(\"\\$context['_fierce_tag_list_options'] = twig_ensure_traversable(\")\n ->subcompile($this->getNode('options'))\n ->raw(\");\\n\")\n ;\n $this->compiler\n ->write(\"foreach (\\$context['_fierce_tag_list_options'] as \\$fierceTagListOption) {\\n\")\n ->indent()\n ->write(\"print '<li>' . htmlspecialchars(\\$fierceTagListOption) . '</li>';\\n\")\n ->outdent()\n ->write(\"}\\n\");\n ;\n \n self::closeTag('ul');\n \n // add js\n $this->requireScript(\\Fierce\\Env::get('fierce_src') . 'scripts/tag-field.controller.js');\n }",
"protected function build()\r\n {\r\n $tag = array_shift($this->attributes);\r\n $content = implode('', $this->childs);\r\n if (empty($tag) || $tag == 'dummy') {\r\n return $content;\r\n }\r\n $spaces = $this->tagdep != 0 ? PHP_EOL.str_repeat(\" \",abs($this->tagdep)) : '';\r\n $strTag = $spaces.'<'.$tag;\r\n foreach ($this->attributes as $key => $value) {\r\n if (is_object($value) && !method_exists($value, '__toString')) {\r\n $strTag .= ' error=\"Attribute value is object ('.get_class($value).')\"';\r\n continue;\r\n }\r\n $strTag .= ' '.$key.'=\"'.htmlspecialchars($value, ENT_QUOTES).'\"';\r\n // la conversione del contentuto degli attributi viene fornita da Tag in modo\r\n // tale che non debba essere gestito dai suoi figli\r\n /*$strTag .= ' '.$key.'=\"'.$val.'\"';*/\r\n }\r\n $strTag .= '>';\r\n \r\n if (!in_array($tag, ['input', 'img', 'link', 'meta'])) {\r\n $strTag .= $content . ($this->tagdep < 0 ? $spaces : '') .\"</{$tag}>\";\r\n }\r\n return $strTag;\r\n }",
"function webmap_compo_lib_xml_build()\r\n{\r\n\t$this->webmap_compo_lib_xml_base();\r\n}",
"public function compile(Compiler $compiler): void\n {\n $compiler->addDebugInfo($this);\n $compiler->write('$object = ')->subcompile($this->getNode('object'))->raw(';' . PHP_EOL);\n\n if ($this->hasNode('layout')) {\n $layout = $this->getNode('layout');\n $compiler->write('$layout = ')->subcompile($layout)->raw(';' . PHP_EOL);\n } else {\n $compiler->write('$layout = null;' . PHP_EOL);\n }\n\n if ($this->hasNode('context')) {\n $context = $this->getNode('context');\n $compiler->write('$attributes = ')->subcompile($context)->raw(';' . PHP_EOL);\n } else {\n $compiler->write('$attributes = null;' . PHP_EOL);\n }\n\n $compiler\n ->write('$html = $object->render($layout, $attributes ?? []);' . PHP_EOL)\n ->write('$block = $context[\\'block\\'] ?? null;' . PHP_EOL)\n ->write('if ($block instanceof \\Grav\\Framework\\ContentBlock\\ContentBlock && $html instanceof \\Grav\\Framework\\ContentBlock\\ContentBlock) {' . PHP_EOL)\n ->indent()\n ->write('$block->addBlock($html);' . PHP_EOL)\n ->write('echo $html->getToken();' . PHP_EOL)\n ->outdent()\n ->write('} else {' . PHP_EOL)\n ->indent()\n ->write('\\Grav\\Common\\Assets\\BlockAssets::registerAssets($html);' . PHP_EOL)\n ->write('echo (string)$html;' . PHP_EOL)\n ->outdent()\n ->write('}' . PHP_EOL)\n ;\n }",
"function compile ($src);"
]
| [
"0.6366082",
"0.60682416",
"0.606481",
"0.6013313",
"0.59959596",
"0.59782",
"0.5952173",
"0.59100044",
"0.57847965",
"0.57484204",
"0.5744576",
"0.5630135",
"0.5577801",
"0.55730313",
"0.54595184",
"0.5458566",
"0.54281807",
"0.5378177",
"0.52864563",
"0.5268053",
"0.52591324",
"0.52519137",
"0.52512467",
"0.52427584",
"0.52420855",
"0.52334297",
"0.5231301",
"0.5190777",
"0.51867676",
"0.515414"
]
| 0.66015124 | 0 |
returns "158 win" , "23 loss", "99 tie", "break", or an error | public function resultString($team_id) {
$scored=0;
$received=0;
$matchfound=false;
if ($this->home_team_id == $team_id && !is_null($this->away_team_id)) {
$scored=$this->homeScore;
$received=$this->awayScore;
$matchfound=true;
} elseif ($this->away_team_id == $team_id && !is_null($this->home_team_id)) {
$scored=$this->awayScore;
$received=$this->homeScore;
$matchfound=true;
} elseif ($this->home_team_id == $team_id || $this->away_team_id == $team_id ) {
$bye=true;
} else {
die('team with id '.$team_id.' did not play in match with id '.$this->id);
}
if ($scored > $received) {
return $scored.'-'.$received.' win';
} elseif ($scored < $received) {
return $scored.'-'.$received.' loss';
} elseif ($scored == $received && $matchfound == true) {
return $scored.'-'.$received.' tie';
} elseif ($bye === true) { // team had a BYE (" a break ")
return 'break';
} else {
die('hae?');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getWinner($callable, $session): string\n {\n $sum = $callable->getSum();\n $bet = $session->get('bet');\n if ($callable->getSum() == 21) {\n $res = \"CONGRATULATIONS! You got 21!\";\n // $winner = \"player\";\n $session->set('playScore', 1 + $session->get('playScore'));\n $session->set('points', $session->get('points') + $bet*1.5);\n return $res;\n }\n if ($callable->getSum() > 21) {\n $res = \"You passed 21 and lost, sum: \" . $sum;\n // $winner = \"computer\";\n $session->set('compScore', 1 + $session->get('compScore'));\n $session->set('points', $session->get('points') - $bet);\n return $res;\n }\n // if sum less than 21, simulate computer throws\n $computerScore = $callable->simulateComputer((int) $sum);\n if($computerScore <= 21) {\n $res = \"Computer wins, got sum = \" . $computerScore . \", your sum = \" . $sum;\n // $winner = \"computer\";\n $session->set('compScore', 1 + $session->get('compScore'));\n $session->set('points', $session->get('points') - $bet);\n return $res;\n }\n $res = \"You win, computer got sum = \" . $computerScore . \", your sum = \" . $sum;\n // $winner = \"player\";\n $session->set('playScore', 1 + $session->get('playScore'));\n $session->set('points', $session->get('points') + $bet);\n return $res;\n }",
"function checkWinner($game) {\n\tglobal $message ;\n\t$winner = \"999\";\n\t$board = $game[\"board\"];\n\t$cellClicked = $game[\"clicked\"];\n\tif ($game[\"clicked\"] !== 9) {\n\t\tsettype($cellClicked, \"string\");\n\t\t$winCombo = array(\"012\",\"345\",\"678\",\"036\",\"147\",\"258\",\"840\",\"246\");\n\t\tfor( $row = 0; $row < 8; $row++ ) {\t\n\t\t\t// identify which row, column, and diag has been changed by current selection\n\t\t\t$idx = ($cellClicked < 9) \n\t\t\t\t? substr_count($winCombo[$row], $cellClicked)\n\t\t\t\t: -1;\n\t\t\t// test only the changed row, columns, and diags\n\t\t\tif ($idx == 1) { \n\t\t\t\tif ( $board[$winCombo[$row][0]] == $board[$winCombo[$row][1]] && \n\t\t\t\t\t $board[$winCombo[$row][1]] == $board[$winCombo[$row][2]] ) \t{\t\n\t\t\t\t\t\t$game[\"winningCombo\"] = $board[$winCombo[$row][0]];\n\t\t\t\t\t\t$winner = $winCombo[$row];\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\t\n\t\tif ($game[\"winningCombo\"] != -1) {\n\t\t\t$message = substr($game[\"playToken\"],$game[\"winningCombo\"],1) . \" wins\";\n\t\t}\n\t\telseif (count_chars($board,3) == \"01\") {\n\t\t\t$message = \"Game over. No winner\";\n\t\t}\n\t} \n\treturn $winner;\n}",
"protected function guessThru() {\n\t\t$score = $this->getScoreFromRule();\n\t\t//Yii::trace('Score '.print_r($score, true), 'Scorecard::updateScorecard');\n\t\t$thru = 0;\n\t\twhile($thru < count($score) && $this->isValidScore($score[$thru]))\n\t\t\t$thru++;\n\t\t\t\n\t\tYii::trace('Thru '.$thru, 'Scorecard::updateScorecard');\n\t\treturn $thru;\n\t}",
"protected function thinkBot() {\n $cellReturn = '';\n $markers = array($this->_botMark, $this->_userMark); //offense first, then defense\n while ($this->isValidMove($cellReturn) === FALSE) {\n //defense and offense\n foreach ($markers AS $marker) {\n foreach ($this->_winningCombination AS $cells) {\n $lineCells = explode(\",\", $cells); //separate the winning combination to 3\n $marked = 0;\n $noMark = 0;\n for ($x = 0; $x < 3; $x++) {\n if (in_array($lineCells[$x], $this->_markers[$marker]))\n $marked++;\n else\n $noMark = $lineCells[$x];\n }\n if ($marked == 2 && $this->isValidMove($noMark)) {\n $cellReturn = $noMark;\n break;\n }\n }\n if ($cellReturn != '')\n break;\n }\n //plan\n if ($cellReturn == '') {\n while (!$this->isValidMove($cellReturn)) {\n $combinationRandKey = rand(0, 7);\n //separate the winning combination to 3 elements\n $lineCells = explode(\",\", $this->_winningCombination[$combinationRandKey]);\n if ($this->isValidMove($lineCells[0]))\n $cellReturn = $lineCells[0];\n elseif ($this->isValidMove($lineCells[1]))\n $cellReturn = $lineCells[1];\n else\n $cellReturn = $lineCells[2];\n }\n }\n }\n return $cellReturn;\n }",
"public function outcome()\n {\n $gameOutcome = array(\"win\", \"lose\");\n $this->shuffle = $gameOutcome[array_rand($gameOutcome)];\n\n if ($this->shuffle === \"win\") {\n\n $bet = new confirmBet(db::getConnection());\n $arg = $bet->getBetId();\n $explode = explode(',', $arg, -1);\n $lastBetId = end($explode);\n\n $mysqli = db::getConnection();\n $saveOutcome = \"INSERT INTO outcome (outcome_status,score,bet_id) VALUES('win',10,$lastBetId)\";\n mysqli_query($mysqli, $saveOutcome);\n\n\n $this->win();\n\n } else {\n $bet = new confirmBet(db::getConnection());\n $arg = $bet->getBetId();\n $explode = explode(',', $arg, -1);\n $lastBetId = end($explode);\n\n $mysqli = db::getConnection();\n $saveOutcome = \"INSERT INTO outcome (outcome_status,score,bet_id) VALUES('lose',0,$lastBetId)\";\n mysqli_query($mysqli, $saveOutcome);\n\n\n $this->lose();\n\n }\n }",
"public function testCheckWinner()\n {\n $rawBoard = [2,2,1,0,1,1,2,2,2];\n $feedback = [0=>8, 1=>1, 2=>6, 3=>3, 4=>5, 5=>7, 6=>4, 7=>9, 8=>2];\n $formatedBoardRow = 0;\n foreach ($feedback as $index=>$value) {\n if ($index%3==0) {\n $formatedBoardRow++;\n }\n if ($rawBoard[$index] == 1) {\n $formatedBoard[$formatedBoardRow][$value] = \"X\";\n }\n if ($rawBoard[$index] == 2) {\n $formatedBoard[$formatedBoardRow][$value] = \"O\";\n }\n }\n $this->_board = $formatedBoard;\n\n $playerOneAnswers = [];\n $playerTwoAnswers = [];\n foreach ($this->_board as $boardIndex => $boardRow) {\n foreach ($boardRow as $boardRowIndex => $boardRowValue) {\n if ($boardRowValue == \"X\") {\n $this->_scorePlayerOne += $boardRowIndex;\n $playerOneAnswers[] = $boardRowIndex;\n }\n if ($boardRowValue == \"O\") {\n $this->_scorePlayerTwo += $boardRowIndex;\n $playerTwoAnswers[] = $boardRowIndex;\n }\n }\n }\n\n $whoHasWon = 0;\n if ($this->_scorePlayerOne == 15) {\n $whoHasWon = 1;\n }\n\n if ($this->_scorePlayerTwo == 15) {\n $whoHasWon = 2;\n }\n\n if ($whoHasWon == 0) {\n foreach ($this->_winningConditions as $winningCondition) {\n $playerOneMatchResult = array_intersect(\n $playerOneAnswers, $winningCondition\n );\n if (count($playerOneMatchResult) ==3) {\n $whoHasWon = 1;\n }\n\n $playerTwoMatchResult = array_intersect(\n $playerTwoAnswers, $winningCondition\n );\n if (count($playerTwoMatchResult) ==3) {\n $whoHasWon = 2;\n }\n }\n }\n\n //$this->assertGreaterThan($this->_maxScore, $this->_scorePlayerOne);\n //$this->assertEquals($this->_scorePlayerTwo, 10);\n\n $this->assertNotEquals(1, $whoHasWon);\n $this->assertEquals(2, $whoHasWon);\n }",
"function getTurnOver($case){\n \n $currentExecQueryResultObject = calcTurnOver($case);\n \n // εδω τσεκαρει για αποτυχια εκτέλεσης του query ή για λογικό σφάλμα των αποτελεσμάτων\n // αντι για die θα το βαλω να κανει κατι πιο εξυπνο συντομα\n if (! $currentExecQueryResultObject -> querySuccess ){ \n \n die('function getTurnOver -- tha kanw kati smarter soon edw!');\n }\n \n return $currentExecQueryResultObject -> numericResult;\n }",
"function compete2($a,$b){\n $p = intval(100 * getWinProb($a['elo']-$b['elo']));\n $expected = ($a['elo']>=$b['elo']) ? $a['name'] : $b['name'];\n $percent = ($a['elo']>=$b['elo']) ? $p.'%' : (100-$p).'%';\n $tempo = round(($a['tempo']+$b['tempo'])/2);\n $a_score = 0;\n $b_score = 0;\n echo sprintf(\"Now Playing: %s (%s) vs. %s (%s) \\n\", $a['name'], $a['elo'], $b['name'], $b['elo']);\n echo sprintf(\"Expected winner: %s (%s)\\n\", $expected, $percent);\n \n //echo sprintf(\"------------\\n\");\n //echo sprintf(\"| Game Log |\\n\");\n //echo sprintf(\"------------\\n\");\n //echo sprintf(\"Playing %s possessions\\n\\n\",$tempo);\n for($i=0;$i<$tempo;$i++){\n $a_points = playPosession($a['off'],$b['def']);\n $a_score += $a_points;\n $b_points = playPosession($b['off'],$a['def']);\n $b_score += $b_points;\n //echo sprintf(\"Possession #%s\\n\",$i);\n //echo sprintf(\"%s scored %s points\\n\",$a['name'],$a_points);\n //echo sprintf(\"%s scored %s points\\n\",$b['name'],$b_points);\n //echo sprintf(\"Score is %s %s-%s %s\\n\\n\", $a['name'], $a_score, $b_score, $b['name']);\n }\n while($a_score==$b_score){\n $ot = round($tempo/8);\n //echo sprintf(\"Overtime\\n\");\n //echo sprintf(\"Playing %s possessions\\n\", $ot);\n for($i=0;$i<$ot;$i++){\n $a_points = playPosession($a['off'],$b['def']);\n $a_score += $a_points;\n $b_points = playPosession($b['off'],$a['def']);\n $b_score += $b_points;\n //echo sprintf(\"Possession #%s\\n\",$i);\n //echo sprintf(\"%s scored %s points\\n\",$a['name'],$a_points);\n //echo sprintf(\"%s scored %s points\\n\",$b['name'],$b_points);\n //echo sprintf(\"Score is %s %s-%s %s\\n\\n\", $a['name'], $a_score, $b_score, $b['name']);\n }\n }\n $winner = ($a_score>$b_score) ? $a['name'] : $b['name'];\n $a_ppp = number_format($a_score/$tempo,3);\n $b_ppp = number_format($b_score/$tempo,3);\n echo sprintf(\"Final score is %s-%s, %s wins\\n\\n\", max($a_score,$b_score), min($a_score,$b_score), $winner);\n //echo sprintf(\"Points per Possession: %s: %s %s: %s\\n\\n\", $a['name'], $a_ppp, $b['name'], $b_ppp);\n return ($a_score>$b_score) ? $a : $b;\n}",
"public function winloss()\n {\n $sql = '\n SELECT \n t.name,\n ( \n ( SELECT COUNT(*)\n FROM matches m\n WHERE m.match_date_time < CURDATE()\n AND m.team1_id=t.id\n AND m.team1_goalcount > m.team2_goalcount ) +\n ( SELECT COUNT(*)\n FROM matches m\n WHERE m.match_date_time < CURDATE()\n AND m.team2_id=t.id\n AND m.team1_goalcount < m.team2_goalcount ) \n ) wins,\n ( \n ( SELECT COUNT(*)\n FROM matches m\n WHERE m.match_date_time < CURDATE()\n AND m.team1_id=t.id\n AND m.team1_goalcount < m.team2_goalcount ) +\n ( SELECT COUNT(*)\n FROM matches m\n WHERE m.match_date_time < CURDATE()\n AND m.team2_id=t.id\n AND m.team1_goalcount > m.team2_goalcount )\n ) losses\n FROM teams t';\n\n return view( 'winloss', ['matches' => \\DB::select( $sql ) ] );\n }",
"public function checkForWinner($playerOne, $playerTwo){\n if(($playerOne == 1 && $playerTwo == 2) || ($playerOne == 2 && $playerTwo == 3 || ($playerOne == 3 && $playerTwo == 1))){\n $this->printResult($playerOne, $playerTwo, 1);\n return 1;\n }elseif(($playerOne == 1 && $playerTwo == 1) || ($playerOne == 2 && $playerTwo == 2) || ($playerOne == 3 && $playerTwo == 3)){\n $this->printResult($playerOne, $playerTwo, 2);\n return 2;\n }else{\n $this->printResult($playerOne, $playerTwo, 3);\n return 3;\n }\n}",
"function getTurn ($board_num) {\n //get database info on player turn and player user ids\n $result = selectDB(\"SELECT PLAYERX, PLAYERO, TURN FROM BOARD WHERE BOARD_NUM='$board_num'\");\n\n //separate results into variables\n $playerx = $result['PLAYERX'];\n $playero = $result['PLAYERO'];\n $turnUser = $result['TURN'];\n \n //return 0 or 1\n if (strcmp($playerx, $turnUser) == 0) {\n return 0; //playerx's turn\n }\n else if (strcmp($playero, $turnUser) == 0) {\n return 1; //playero's turn\n }\n}",
"function calculate_winners($stdin){\r\n\r\n if (isset($_POST['single'])){\r\n\r\n // Setting the stdin to the value input by the user \r\n $stdin = $_POST['input'];\r\n\r\n // Getting the vars that will store the total wins\r\n global $x;\r\n global $o;\r\n global $d; \r\n\r\n // Replacing all line breaks with nothing so we get one big long string with all results inside\r\n $stdin = str_replace(\"\\\\n\",\"\",$stdin);\r\n \r\n // create a variable equal to the length of the string so that we can separate out individual games easily\r\n $length = strlen($stdin);\r\n\r\n // loop through the entire input (here $i is set as individual moves as this point)\r\n for ($i=1; $i<=$length; $i++) {\r\n\r\n if ($i % 9 === 0){\r\n\r\n // Separate out each individual 9 game move and set it to the $outcome var\r\n $outcome = substr($stdin, $i-9, 9);\r\n\r\n // Calculate the outcome of the winner of each 9 move game\r\n // Probably an ineffient way to do this **REVISIT**\r\n if ($outcome[0] === \"x\" && $outcome[1] === \"x\" && $outcome[2] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[3] === \"x\" && $outcome[4] === \"x\" && $outcome[5] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[6] === \"x\" && $outcome[7] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"x\" && $outcome[3] === \"x\" && $outcome[6] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[1] === \"x\" && $outcome[4] === \"x\" && $outcome[7] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[2] === \"x\" && $outcome[5] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"x\" && $outcome[4] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[2] === \"x\" && $outcome[4] === \"x\" && $outcome[6] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"o\" && $outcome[1] === \"o\" && $outcome[2] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[3] === \"o\" && $outcome[4] === \"o\" && $outcome[5] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[6] === \"o\" && $outcome[7] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[0] === \"o\" && $outcome[3] === \"o\" && $outcome[6] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[1] === \"o\" && $outcome[4] === \"o\" && $outcome[7] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[2] === \"o\" && $outcome[5] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[0] === \"o\" && $outcome[4] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[2] === \"o\" && $outcome[4] === \"o\" && $outcome[6] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else {\r\n $winner = \"draw\";\r\n self::add_game($winner, $outcome);\r\n $d++;\r\n } \r\n }\r\n }\r\n \r\n // End of for loop for individual input\r\n // This will take the amount of wins and call a function that will display to the end user\r\n // No need for SQL input at this point as this information is just displayed and then not needed\r\n // All relevant information has already been added to the db \r\n self::calculate_single_input($x, $o, $d);\r\n }\r\n }",
"public function getWinner()\r\n {\r\n// todo\r\n $p = $this->pieces;\r\n $i=0;\r\n //check the rows for winner\r\n for($i=0;$i<self::ROWS;$i++)\r\n {\r\n if(($p[$i][0] == $p[$i][1]) && ($p[$i][1] == $p[$i][2]) && $p[$i][0] != '')\r\n {\r\n if($p[$i][0] == 'O')\r\n\t\t\t{\r\n\t\t\t\treturn 'O';\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n\t\t\t\treturn 'X';\r\n\t\t\t}\r\n }\r\n }\r\n\r\n //check the columns for winner\r\n for($j=0;$j<self::ROWS;$j++)\r\n {\r\n if(($p[0][$j] == $p[1][$j]) && ($p[1][$j] == $p[2][$j]) && $p[0][$j] != '')\r\n {\r\n if($p[0][$j] == 'O')\r\n \t{\r\n\t\t\t\treturn 'O';\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n \t\treturn 'X';\r\n\r\n\t\t\t}\r\n }\r\n\r\n }\r\n\r\n //check the diagonals for winner\r\n if(($p[0][0]==$p[1][1] && $p[1][1] == $p[2][2] && $p[0][0] != '') || ($p[0][2] == $p[1][1] && $p[1][1] == $p[2][0] && $p[0][2] != ''))\r\n {\r\n if($p[1][1] == 'O')\r\n\t\t{\r\n\t\t\treturn 'O';\r\n\t\t}\r\n else\r\n\t\t{\r\n \t\treturn 'X';\r\n\r\n\t\t}\r\n }\r\n return -1; //return -1, keep playing\r\n }",
"public function winRound() {\n\n\t\t$this->points++;\n\n\t\t$this->output($this->name.' has won this round');\n\t}",
"public function games_wii()\n\t{\n\t\tif (preg_match('/^\"(.+)__www.realmom.info__.+\" \\(\\d+\\/\\d+\\) \\d+[.,]\\d+ [kKmMgG][bB] yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[Cabelas_North_American_Adventure_USA_WII-ZRY-Scrubbed-xeroxmalf]-[#a.b.g.w@efnet]-[www.abgx.net]-[01/27] - \"Cabelas_North_American_Adventure_USA_WII-ZRY-Scrubbed-xeroxmalf.par2\" yEnc\n\t\tif (preg_match('/^\\[(.+)\\]-\\[#a.b.g.w@efnet\\]-\\[www.abgx.net\\]-\\[\\d+\\/\\d+\\] - (\"|#34;).+(\"|#34;) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//4300 World.Sports.Competition.USA.VC.Wii-OneUp....... AmigaOS4.1 RULEZ [0/9] - \"4300.nzb\" yEnc\n\t\t//4300 1695.World.Sports.Competition.USA.VC.Wii-OneUp....... AmigaOS4.1 RULEZ [0/9] - \"4300.nzb\" yEnc\n\t\tif (preg_match('/^\\d+ (\\d+\\.)?(.+-OneUp).+ \\[\\d+\\/\\d+\\] - (\"|#34;).+(\"|#34;) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //6717 - Baseball.Stars.2.PAL.VC.NG.Wii-OneUp - 01/11 - \"1u-baseball-stars-2-pal.nfo\" yEnc\n\t\tif (preg_match('/^\\d+ - (.+-OneUp).+ \\d+\\/\\d+ - (\"|#34;).+(\"|#34;) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[2103]-[abgx.net] Harvey_Birdman_Attorney_At_Law-USA-WII [000/104] - \"Harvey_Birdman_Attorney_At_Law-USA-WII.nzb\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\]-\\[abgx.net\\] (.+) \\[\\d+\\/\\d+\\] - (\"|#34;).+(\"|#34;) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(3790)-[abgx.net]-[Samurai_Warriors_Katana_USA-WII]-[000/105] - \"3790.nzb\" yEnc\n\t\tif (preg_match('/^\\(\\d+\\)-\\[abgx.net\\]-(.+)-\\[\\d+\\/\\d+\\] - (\"|#34;).+(\"|#34;) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[REQ# 7134] Full 105 Cocoto_Magic_Circus_PAL_Wii-OE PAL \"oe-magic.r00\" 4.57 GB yEnc\n\t\tif (preg_match('/^\\[REQ# \\d+\\] Full \\d+ (.+) PAL (\"|#34;).+(\"|#34;) \\d+[.,]\\d+ [kKmMgG][bB] yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[11614]-[#a.b.g.wii@efnet]-[ EA.Sports.Active.NFL.Training.Camp.USA.WII-ProCiSiON ]-[01/95] - \"xxx-nflt.nfo\" yEnc\n\t\tif (preg_match('/\\[[\\d#]+\\]-\\[.+?\\]-\\[ (.+?) \\][- ]\\[\\d+\\/\\d+\\][-_\\s]{0,3}\".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[8524]-[#a.b.g.wii@EFNet]-[FULL]-[Fantastic_Four_Rise_Of_The_Silver_Surfer_NTSC_Wii-VORTEX]-[001/104] - \"vortex-ffrotss.wii.nfo\" yEnc\n\t\tif (preg_match('/\\[[\\d#]+\\]-\\[.+?\\]-\\[.+?\\]-\\[(.+?)\\][- ]\\[\\d+\\/\\d+\\][-_\\s]{0,3}\".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[13118]-[abgx]-[FULL]-[Doods_Big_Adventure_PAL_WII-PLAYME]-po0p?!-[000/103] - \"13118.nzb\" yEnc\n\t\tif (preg_match('/^\\[\\d+]-\\[abgx\\]-\\[FULL\\]-\\[(.+)-PLAYME\\]-po0p.+-\\[\\d+\\/\\d+\\] - (\"|#34;).+(\"|#34;) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[13208]-[#ab@EFNet]-[FULL]-[Calvin_Tuckers_Farm_Animal_Racing_PAL_Wii-WiiERD]-po0p!-[072/112] - \"w-ctfar.r68\" yEnc\n\t\tif (preg_match('/^\\[\\d+]-\\[#ab@EFNet\\]-\\[FULL\\]-\\[(.+)-WiiERD\\]-po0p.+-\\[\\d+\\/\\d+\\] - (\"|#34;).+(\"|#34;) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(www.Thunder-News.org) >Winter.Stars.USA.WII-dumpTruck< <Sponsored by AstiNews> - (001/112) - \"dumptruck-winterstars.par2\" yEnc\n\t\tif (preg_match('/^\\(www\\.Thunder-News\\.org\\) ?>(.+)< ?<Sponsored.+>[ _-]{0,3}(\\(\\d+\\/\\d+\\)|\\[\\d+\\/\\d+\\])?[ _-]{0,5}(\"|#34;).+(\"|#34;) yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[9987]-[#a.b.g.wii@efnet]-[ Tales.of.Elastic.Boy.Mission.1.USA.WiiWare.Wii-OneUp ]-[01/12] - #34;1u-tales-of-elastic-boy-mission-1.nfo#34; yEnc\n\t\tif (preg_match('/^\\[\\d+]-\\[#a\\.b\\.g\\.wii@efnet\\]-\\[ ?(.+) ?\\]-\\[\\d+\\/\\d+\\] - (\"|#34;).+(\"|#34;) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[2207] Swing_Golf_Pangya_JPN_Wii-Caravan NTSC-J DVD5 [001/102] - \"cvn-sgp.nfo\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\] (.+) NTSC-J DVD5 \\[\\d+\\/\\d+\\] - (\"|#34;).+(\"|#34;) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[3867] FaceBreaker.K.O.Party.PAL.Wii-RANT <>000/110<> \"3867.nzb\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\] (.+) <>\\d+\\/\\d+<> (\"|#34;).+(\"|#34;) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[COMPRESSED] Family_Feud_2010_Edition_USA_Wii-QwiiF [01/26] - \"Family_Feud_2010_Edition_USA_Wii-QwiiF.par2\" yEnc\n\t\tif (preg_match('/^\\[COMPRESSED\\] (.+) \\[\\d+\\/\\d+\\] - (\"|#34;).+(\"|#34;) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[COMPRESSED] Rooms.The.Main.Building.USA.WII-SUSHi - su-rousa.par2 [01/18] (1/1) (1/1) yEnc\n\t\tif (preg_match('/^\\[COMPRESSED\\] (.+) - .+ \\[\\d+\\/\\d+\\] .+ yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //WII4U - thinkSMART.Family.USA.WII-dumpTruck - [01/15] - \"dumptruck-tf.par2\" yEnc\n\t\tif (preg_match('/^WII4U - (.+) - \\[\\d+\\/\\d+\\] - (\"|#34;).+(\"|#34;) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //<<<Old but Sold>>> <<< >< >< \"Rogue Trooper The Quartz Zone Massacre (2009)PAL Wii\" >< 037/131 () >< > yEnc\n\t\tif (preg_match('/^<<<Old but Sold>>> <<< >< >< (\"|#34;)(.+)(\"|#34;) >< \\d+\\/\\d+ \\(\\) >< > yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //[6840]-[abgx@Efnet]-[My.Fitness.Coach.NTSC-WII-ProCiSiON] - (001/110) \"xxx-mfc.par2\" - 4.76 GB yEnc\n\t\tif (preg_match('/^\\[\\d+\\]-\\[abgx@Efnet\\]-\\[(.+)\\] - \\(\\d+\\/\\d+\\) \".+\".+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[6820]-[abgx@Efnet]-[Full]-[Cotton_Fantastic_Night_Dreams_NTSC_RF_TG16-CD.iNJECT_iNTERNAL_VC_Wii-0RANGECHiCKEN]- [01/16] - 0c-cotton-rf.nfo (1/1) (1/1) yEnc\n\t\tif (preg_match('/^\\[\\d+\\]-\\[abgx@Efnet\\]-\\[Full\\]-\\[(.+)\\][ -]+\\[\\d+\\/\\d+\\] .+ yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[3488] [#alt.binaries.games.wii@efnet] [Blades.Of.Steel.USA.VC.Wii-DiPLODOCUS] [0/8] 3488.nzb (1/1) (1/1) yEnc\n\t\tif (preg_match('/^\\[\\d+\\] \\[#alt\\.binaries\\.games\\.wii@efnet\\] \\[(.+)\\] \\[\\d+\\/\\d+\\].+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //<Little.League.World.Series.Double.Play.USA.WII-dumpTruck> [001/110] - \"Little.League.World.Series.Double.Play.USA.WII-dumpTruck.par2\" yEnc\n\t\tif (preg_match('/^<(.+)> \\[\\d+\\/\\d+\\] - \".+\" yEnc$/', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}",
"function searchReturnCode()\t{\n\t\treturn $this->getRandomRetourCode();\n\t}",
"function paperSiccorsRockChooseWinner($gameList){\n\t\t$movesArray = explode(\",\",$gameList);\n\t\t//printf(\"El gamelist es: \" . $gameList . \"<br>\");\n\t\t//printf(\"La jugada1 es: \" . substr($movesArray[1],1,1) . \"<br>\");\n\t\t$player1move = substr($movesArray[1],1,1);\n\t\t$player2move = substr($movesArray[3],1,1);\n\t\t$gameResult = \"\";\n\n\t\t//console.log(\" \");\n\t\t//console.log(\" \");\n\t\t\n\n\t\t//Se pregunta si la cantidad de jugadores es valida\n\t\tif(validateQuantityOfPlayers($movesArray) == false){\n\t\t\t//console.log(\"Error Cantidad de jugadores\");\n\t\t\t//throw \"Error with number of players\"; \n\t\t}\n\n\t\t//Se preguntan si las jugadas son validas\n\t\tif(validateMove($player1move) == false || validateMove($player2move) == false){\n\t\t\t//console.log(\"Error Jugada no valida\");\n\t\t\t//throw \"Error not valid move\";\n\t\t}\n\n\t\t//Se averigua cual jugador gano\n\t\t$winner = paperSiccorsRockRules($player2move, $player1move);\n\t\tif($winner == true){\n\t\t\t////printf(\"1 El gamelist es: \" .$movesArray[2] . ',' . substr($movesArray[3],0,-1). \"<br>\");\n\t\t\t$gameResult = $movesArray[2] . ',' . substr($movesArray[3],0,-1);\n\t\t}else{\n\t\t\t////printf(\"2 El gamelist es: \" . substr($movesArray[0],1). ',' .$movesArray[1] . \"<br>\");\n\t\t\t$gameResult = substr($movesArray[0],1). ',' .$movesArray[1]; //Se puede caer\n\t\t}\n\n\t\t//printf(\"El juego es \" . $gameList . \"<br>\");\n\t\t//printf(\"Jugada player 1 \" . $player1move .\"<br>\");\n\t\t//printf(\"Jugada player 2 \" . $player2move .\"<br>\");\n\t\t//printf(\"El ganadore es player2 \" . $winner .\"<br>\");\n\n\t\t//console.log(\" \");\n\t\t//console.log(\" \");\n\t\treturn $gameResult;\n\t}",
"function whoWins(){\n $winners = array();\n $n = 100;\n for($i=0;$i<=$n;$i++){\n $winner = playTournament();\n if(!isset($winners[$winner])){\n $winners[$winner] = 1;\n } else {\n $winners[$winner] += 1;\n }\n }\n arsort($winners);\n foreach($winners as $key=>$value){\n echo $key.' '.$value.\"\\n\";\n }\n}",
"public function testCheckNoWinner()\n {\n $this->_board[0][8] = \"O\";\n $this->_board[0][1] = \"O\";\n $this->_board[0][6] = \"X\";\n $this->_board[1][5] = \"X\";\n $this->_board[1][7] = \"X\";\n $this->_board[2][9] = \"O\";\n $this->_board[2][2] = \"O\";\n\n $playerOneAnswers = [];\n $playerTwoAnswers = [];\n foreach ($this->_board as $boardIndex => $boardRow) {\n foreach ($boardRow as $boardRowIndex => $boardRowValue) {\n if ($boardRowValue == \"X\") {\n $this->_scorePlayerOne += $boardRowIndex;\n $playerOneAnswers[] = $boardRowIndex;\n }\n if ($boardRowValue == \"O\") {\n $this->_scorePlayerTwo += $boardRowIndex;\n $playerTwoAnswers[] = $boardRowIndex;\n }\n }\n }\n\n $whoHasWon = 0;\n if ($this->_scorePlayerOne == 15) {\n $whoHasWon = 1;\n }\n\n if ($this->_scorePlayerTwo == 15) {\n $whoHasWon = 2;\n }\n\n if ($whoHasWon == 0) {\n foreach ($this->_winningConditions as $winningCondition) {\n\n $playerOneMatchResult = array_intersect(\n $playerOneAnswers, $winningCondition\n );\n if (count($playerOneMatchResult) ==3) {\n $whoHasWon = 1;\n }\n\n $playerTwoMatchResult = array_intersect(\n $playerTwoAnswers, $winningCondition\n );\n if (count($playerTwoMatchResult) ==3) {\n $whoHasWon = 2;\n }\n }\n }\n\n $this->assertNotEquals(1, $whoHasWon);\n $this->assertNotEquals(2, $whoHasWon);\n }",
"function scoreMessage( $score ) {\n\n $msg = \"\";\n\n switch ( true ) {\n\n case $score < 30:\n $msg = 'Oh, my! ...';\n break;\n case $score < 50:\n $msg = 'Improvement is needed.';\n break;\n case $score < 70:\n $msg = 'Need a bit more work.';\n break;\n case $score < 80:\n $msg = 'Good!';\n break;\n default:\n $msg = 'Excellent!';\n break;\n\n }\n\n return $msg;\n\n }",
"function getTrend($player, $season, $type) {\n\tglobal $dbUser, $dbPass, $dbTable, $con;\n\t$matches = array();\n\n\t$matchResult = mysqli_query($con,\"SELECT * FROM Games WHERE SeasonID = '$season' AND MatchType = '$type' AND Status = 'Complete' AND (ChallengerID = '$player' OR DefenderID = '$player') ORDER BY MatchID DESC\");\n\twhile($row = mysqli_fetch_assoc($matchResult)) {\n\t\t$matches[] = $row;\n\t}\n\n\t$trend = '';\n\t$trendCount = 0;\n\tforeach ($matches as $key => $value) {\n\t\tif ($trendCount > 0) {\n\t\t\t$tempTrend = '';\n\t\t\tif ($value['ChallengerID'] == $player && $value['ChallengerScore'] > $value['DefenderScore'] || $value['DefenderID'] == $player && $value['ChallengerScore'] < $value['DefenderScore']) {\n\t\t\t\t$tempTrend = 'Won';\n\t\t\t} else {\n\t\t\t\t$tempTrend = 'Lost';\n\t\t\t}\n\t\t\tif ($tempTrend == $trend) {\n\t\t\t\t$trendCount++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\tif ($value['ChallengerID'] == $player && $value['ChallengerScore'] > $value['DefenderScore'] || $value['DefenderID'] == $player && $value['ChallengerScore'] < $value['DefenderScore']) {\n\t\t\t\t$trend = 'Won';\n\t\t\t\t$trendCount++;\n\t\t\t} else {\n\t\t\t\t$trend = 'Lost';\n\t\t\t\t$trendCount++;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $trend . ' ' . $trendCount;\n}",
"function teamRecordOverall($record, $school){\n $win = 0;\n $loss = 0;\n $tie = 0;\n\n foreach ($record as $key=>$result) {\n\n if($result[1] != NULL){\n if($result[1] == $school){\n $win++;\n }\n elseif($result[1] == \"TIE\"){\n $tie++;\n }\n else{\n $loss++;\n }\n }\n }\n return $win . \" - \" . $loss . \" - \" . $tie;\n}",
"public function get_loss($client_id)\n {\n $sql=\"SELECT SUM(amount) as loss from games where client_id=$client_id and winner=0 \";\n $res=$this->db->query($sql);\n return $res->result_array()[0]['loss'];\n }",
"public static function check_win($game_id)\n {\n $sum = 0;\n $matrix = (new self)->fill_matrix($game_id);\n // horisont\n for ($i = 0; $i < count($matrix); $i++) {\n $sum = (new self)->sum($matrix[$i]);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }\n\n\n // vertihal\n for ($j = 0; $j < count($matrix[0]); $j++) {\n $sum = (new self)->sum(array_column($matrix, $j));\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }\n\n // diagonal 1\n $sum = 0;\n $main_diagonal = array();\n for ($i = 0; $i < count($matrix); $i++) {\n $main_diagonal[] = $matrix[$i][$i];\n }\n\n $sum = (new self)->sum($main_diagonal);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n\n // diagonal 2\n $sum = 0;\n $secondary_diagonal = array();\n for ($i = count($matrix) - 1; $i >=0; $i--) {\n $secondary_diagonal[] = $matrix[$i][count($matrix) - $i - 1];\n }\n $sum = (new self)->sum($secondary_diagonal);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }",
"function maxscore_noun($id, $vibhakthi_number, $host, $uname, $pass, $dbname){\n\n\t/*\tCreate Connection \t*/\n\t$conn = new mysqli ($host,$uname,$pass,$dbname);\n\n\t$score = 0;\n\n\t$sql = $conn->query(\"SELECT \".$vibhakthi_number.\" from vibhakthi\".$id.\" WHERE no = 1\");\n\t$result = $sql->fetch_assoc();\n\t$noun1 = $result[$vibhakthi_number];\n\n\t$sql = $conn->query(\"SELECT \".$vibhakthi_number.\" from vibhakthi\".$id.\" WHERE no = 2\");\n\t$result = $sql->fetch_assoc();\n\t$noun2 = $result[$vibhakthi_number];\n\n\t$noun1 = explode(\" \", $noun1);\n\t$size1 = sizeof($noun1) - 1;\n\t$noun2 = explode(\" \", $noun2);\n\t$size2 = sizeof($noun2) - 1;\n\n\tif ($size1 > $size2){\n\t\tfor ($i=0; $i<$size1; $i++){\n\t\t\t$score += $GLOBALS['incr_noun'];\n\t\t}\n\t}\n\telse{\n\t\tfor ($i=0; $i<$size2; $i++){\n\t\t\t$score += $GLOBALS['incr_noun'];\n\t\t}\n\t}\n\n\t$conn->close();\n\n\treturn $score;\n}",
"function get_noun_score($id, $vibhakthi_number, $host, $uname, $pass, $dbname){\n\n\t/*\tCreate connection\t*/\n\t$conn = new mysqli ($host,$uname,$pass,$dbname);\n\n\t$noun_score = 0;\n\n\t$sql = $conn->query(\"SELECT \".$vibhakthi_number.\" from vibhakthi\".$id.\" WHERE no = 1\");\n\t$result = $sql->fetch_assoc();\n\t$noun1 = $result[$vibhakthi_number];\n\n\t$sql = $conn->query(\"SELECT \".$vibhakthi_number.\" from vibhakthi\".$id.\" WHERE no = 2\");\n\t$result = $sql->fetch_assoc();\n\t$noun2 = $result[$vibhakthi_number];\n\n\t$GLOBALS['score_array'] = array_fill(0, sizeof(explode(\" \",$noun2)), 0);\n\n\t$tok_noun1 = strtok($noun1, \" \");\n\twhile($tok_noun1 !== false){\n\n\t\tnoun_scoring($id, $tok_noun1, $noun2, $host, $uname, $pass, $dbname);\n\t\t$tok_noun1 = strtok(\" \");\n\n\t}\n\n\tfor ($i=0; $i < sizeof($GLOBALS['score_array']); $i++){\n\t\t$noun_score += $GLOBALS['score_array'][$i];\n\t}\n\n\t$conn->close();\n\n\treturn $noun_score;\n}",
"function playerStatus()\n\t\t{\n\t\t\t$request = $_SESSION['mac'].\" status 0 100 \\n \";\n\t\t\t$mySqueezeCLI = new SqueezeCLI($request);\n\t\t\t$response = $mySqueezeCLI->receiveCLI();\n\t\t\t//echo \"la réponse non traité : $response \\n\";\n\t\t\t//parfois le retour CLI change attention\n\t\t\t//$response = get_string_between($response,\" mode:\",\"rate:\");\n\t\t\t$response = substr($response, strpos($response, \"mode:\"));\n\t\t\t$response = substr($response, 0, strpos($response, \" \"));\n\t\t\t$response = substr($response, 5);\n\n\t\t\treturn $response;\n\t\t}",
"public function displayWinner()\n {\n // Search in array scores, for the username with the highest score.\n $nameWinner = array_search(max($this->scores), $this->scores);\n $scoreWinner = max($this->scores);\n\n $this->console->stdInput(1);\n $this->console->getInpunt(\"De winnaar met \" . $scoreWinner[\"scoreTotal\"] . \" punten is: \" . $nameWinner . \"\\nPress enter to end the game!\");\n $this->console->stdInput(1);\n }",
"public function testCheckWinner()\n {\n $gamestate = $this->game->getGamestate();\n $this->game->holdHand();\n $this->assertNull($gamestate[\"hasWon\"]);\n\n $gamestate[\"active\"]->addPoints(100);\n $exp = $gamestate[\"active\"];\n $this->game->holdHand();\n\n $gamestate = $this->game->getGamestate();\n $this->assertEquals($exp, $gamestate[\"hasWon\"]);\n }",
"static function gambler($stake,$goal,$n)\n { \n $win = 0;\n $count = 0;\n for($i = 0;$i < $n; $i++)\n {\n $temp = $stake;\n //while loop until user win or loss all stack \n while($temp != $goal && $temp != 0)\n {\n $count++;\n if ((random_int(0,1))==1) \n {\n $temp++;\n } \n else \n {\n $temp--;\n }\n \n }\n if($temp == $goal)\n {\n $win++;\n }\n \n }\n echo \"no of win \".$win.\"\\n\";\n echo \"count \".$count.\"\\n\";\n echo \"win percentage \".(($win/$n)*100).\"%\".\"\\n\";\n echo \"loss percentage \".((($n-$win)/$n)*100).\"%\".\"\\n\";\n }"
]
| [
"0.6164224",
"0.61480397",
"0.61079013",
"0.5994023",
"0.59721106",
"0.5900068",
"0.5830364",
"0.57776767",
"0.57554126",
"0.57116395",
"0.56805485",
"0.5661655",
"0.55832005",
"0.55516666",
"0.5548883",
"0.552515",
"0.55080235",
"0.5503016",
"0.5491316",
"0.5477726",
"0.54616284",
"0.5448523",
"0.5435146",
"0.54269373",
"0.5420125",
"0.54188293",
"0.5415196",
"0.54078007",
"0.54039776",
"0.5401703"
]
| 0.6372669 | 0 |
Return Dom Map for parser | protected function _getDomMap()
{
$domMap = parent::_getDomMap();
$domMap = reset($domMap);
return [
'initSubscriptionResponse' => array_merge([
'transactionId' => 'transactionId',
'subscriptionPageUrl' => 'subscriptionPageUrl',
'status' => 'status',
], $domMap)
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getXMLPageMap() {\n\t\tstatic $xml;\n\n\t\tif (isset($xml)) return $xml;\n\t\t$cache = SA_SimpleCache::singleton('__XML_PAGES_MAP__');\n\t\tif ($xmlString = $cache->load()) {\n\t\t\t$xml = new SimpleXMLElement($xmlString);\n\t\t} else {\n\t\t\t$xml = new SimpleXMLElement('<?xml version=\"1.0\" standalone=\"yes\"?><pages/>');\n\t\t\t$this->xmlFileSystem($this->getPagesDir(), $xml);\n\t\t\t$cache->save($xml->asXML());\n\t\t}\n\t\treturn $xml;\n\t}",
"public function getDomDocument() {}",
"public static function getDomNodeAttributeMap($domNode)\n {\n $attrMap = array();\n for($i = 0; $i < $domNode->attributes->length; $i++) {\n $domNodeAttr = $domNode->attributes->item($i);\n $attrMap[$domNodeAttr->name] = $domNodeAttr->value;\n }\n return $attrMap;\n }",
"protected function xmlServicesMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/services', 'services', array())\n ->loop(true, '@xml')\n ->attribute('xmlMap')\n );\n \n return $map;\n }",
"public function build_xml_map() {\n $this->_create_map();\n header(\"content-type: text/xml\");\n echo $this->result;\n }",
"protected function load_dom()\n\t{\n\t\tif ($this->dom)\n\t\t{\n\t\t\treturn $this->dom;\n\t\t}\n\n\t\t$output = $this->ci->output->get_output();\n\n\t\t$this->dom = new DOMDocument;\n\t\tlibxml_use_internal_errors(TRUE);\n\t\t$this->dom->loadHTML($output);\n\t\tlibxml_clear_errors();\n\n\t\treturn $this->dom;\n\t}",
"protected function xmlPluginsMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/plugin', 'plugins')\n ->loop(true)\n ->attribute('class')\n ->attribute('service')\n ->addChildren(\n Path::factory('param', 'params')\n ->attribute('name')\n ->filter(array($this, 'propertizeString'))\n ->value('value')\n ->loop(true)\n )\n );\n\n return $map;\n }",
"protected function getDomList()\n {\n if (! isset($this->domList)) {\n $this->domList = $this->getXPath($this->getDom())->query($this->getDomListQuery());\n }\n return $this->domList;\n }",
"protected function fetchElementNodes()\n {\n $elements = [];\n\n foreach ($this->map as $query) {\n $list = $this->document->xpath($query);\n\n if (0 == count($list)) {\n continue;\n }\n\n foreach ($list as $node) {\n $elements[] = new HtmlNode($node, $this->document->getDocument());\n }\n }\n\n return $elements;\n }",
"protected function xmlIniMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/ini', 'ini', array())\n ->loop(true)\n ->attribute('category')\n ->value('value')\n );\n \n return $map;\n }",
"private function getLinksViaDOM()\n {\n $save = array();\n $nodes = $this->getElementsByTagName('A');\n foreach ($nodes as $n_no => $node) {\n if ($node->attributes->length > 0) {\n //$save[] = $this->getNodeAttributes($node->attributes);\n }\n }\n\n return $save;\n }",
"function getInfo ()\n\t{\n\t\t$node = $this->getElementsByTagname(\"MetaData\");\n\n\t\tif($node !== false)\n\t\t{\n\t\t\t$childs = $node[0]->child_nodes();\n\n\t\t\tforeach ($childs as $child)\n\t\t\t{\n\t\t\t\t\tif (($child->node_type() == XML_ELEMENT_NODE) && ($child->tagname == \"General\"))\n\t\t\t\t\t{\n\t\t\t\t\t\t$childs2 = $child->child_nodes();\n\n\t\t\t\t\t\tforeach ($childs2 as $child2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($child2->node_type() == XML_ELEMENT_NODE) && ($child2->tagname == \"Title\" || $child2->tagname == \"Description\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$arr[$child2->tagname] = $child2->get_content();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// General-tag was found. Stop foreach-loop\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// for compatibility reasons:\n\t\t$arr[\"title\"] = $arr[\"Title\"];\n\t\t$arr[\"desc\"] = $arr[\"Description\"];\n\n\t\treturn $arr;\n\t}",
"private static function createDomDocument()\n {\n $document = new DOMDocument('1.0', 'utf-8');\n $document->preserveWhiteSpace = false;\n $document->formatOutput = true;\n\n return $document;\n }",
"private static function createDomDocument()\n {\n $document = new DOMDocument('1.0', 'utf-8');\n $document->preserveWhiteSpace = false;\n $document->formatOutput = true;\n\n return $document;\n }",
"private function extract_pages(){\r\n $dom = new DOMDocument();\r\n @$dom->loadHTMLFile($this->get_sitemap_url());\r\n $dOMXPath = new DOMXPath($dom);\r\n foreach ($dOMXPath->query(\"//urlset/url/loc\") as $node) {\r\n $this->add_page($node->nodeValue);\r\n }\r\n\t}",
"function section__map(){\n return array(\n 'content'=>\"<div style='width:300px; height:300px' style='\n margin-left:auto; margin-right:auto;' id='map'></div>\",\n 'class'=>'main',\n 'label'=>'Map',\n 'order'=>'1'\n );\n }",
"public function toDOM() {\n\t\treturn self::hashToDomDocument($this->toHash(), 'Representacions');\n\t}",
"public function extract()\n {\n $openGraph = [];\n $namespaces = ['og', 'fb', 'facebook', 'article', 'book', 'profile', 'website', 'music', 'video'];\n\n /* @var $meta \\DOMElement */\n foreach ($this->dom->filter('meta') as $meta) {\n if (false === $meta->hasAttribute('property')) {\n continue;\n }\n\n $property = null;\n\n foreach ($namespaces as $namespace) {\n if ($namespace . ':' === substr($meta->getAttribute('property'), 0, strlen($namespace) + 1)) {\n $property = $meta->getAttribute('property');\n break;\n }\n }\n\n if (null === $property) {\n continue;\n }\n\n if (true === $meta->hasAttribute('content')) {\n $content = $this->decode($meta->getAttribute('content'));\n\n if (false === isset($openGraph[$property])) {\n $openGraph[$property] = $content;\n } elseif (false === is_array($openGraph[$property])) {\n $openGraph[$property] = [$openGraph[$property], $content];\n } else {\n $openGraph[$property][] = $content;\n }\n }\n }\n\n return $openGraph;\n }",
"protected function xmlListenersMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/listener', 'listeners')\n ->loop(true)\n ->attribute('class')\n ->attribute('service')\n ->addChildren(\n Path::factory('param', 'params')\n ->attribute('name')\n ->filter(array($this, 'propertizeString'))\n ->value('value')\n ->loop(true)\n )\n );\n \n return $map;\n }",
"function kemisitemap() {\n\n\t\treturn KemiSitemap::instance();\n\t}",
"protected function getDom()\n {\n if (! isset($this->dom)) {\n $dom = new DOMDocument();\n if (is_null($this->getResults())) {\n throw new \\RuntimeException('There doesnt appear to be any results to load');\n }\n // suppress warning but throw Exception\n if (! @$dom->loadXML($this->getResults())) {\n throw new \\RuntimeException('Could not load results into DOMDocument');\n }\n $this->dom = $dom;\n }\n return $this->dom;\n }",
"function GetMapContent($hide_mode_ids) {\n\tglobal $config;\n\n\t$lang = GetLangContent(\"map\");\n\n\t$map = array();\n\tif (file_exists($config[\"site_path\"].\"/include/map.xml\")) {\n\t\t$xml_parser = new SimpleXmlParser( $config[\"site_path\"].\"/include/map.xml\" );\n\t\t$xml_root = $xml_parser->getRoot();\n\n\t\tforeach ( $xml_root->children as $cnt => $xml_section ) {\n\t\t\tif (!isset($xml_section->attrs[\"id\"]) || (isset($xml_section->attrs[\"id\"]) && !in_array($xml_section->attrs[\"id\"], $hide_mode_ids))) {\n\t\t\t\t$section = array();\n\t\t\t\t$section = array(\"name\" => (isset($lang[$xml_section->attrs[\"name\"]]) ? $lang[$xml_section->attrs[\"name\"]] : $xml_section->attrs[\"name\"]), \"link\" => $xml_section->attrs[\"link\"]);\n\t\t\t\tif ($xml_section->children) {\n\t\t\t\t\tforeach ( $xml_section->children as $xml_subsection_cnt => $xml_subsection ) {\n\t\t\t\t\t\tif (!isset($xml_subsection->attrs[\"id\"]) || (isset($xml_subsection->attrs[\"id\"]) && !in_array($xml_subsection->attrs[\"id\"], $hide_mode_ids))) {\n\t\t\t\t\t\t\t$subsection = array();\n\t\t\t\t\t\t\t$subsection[\"name\"] = (isset($lang[$xml_subsection->attrs[\"name\"]]) ? $lang[$xml_subsection->attrs[\"name\"]] : $xml_subsection->attrs[\"name\"]);\n\t\t\t\t\t\t\t$subsection[\"link\"] = $xml_subsection->attrs[\"link\"];\n\t\t\t\t\t\t\tif ($xml_subsection->children) {\n\t\t\t\t\t\t\t\t$item = array();\n\t\t\t\t\t\t\t\tforeach ( $xml_subsection->children as $xml_item_cnt => $xml_item ) {\n\t\t\t\t\t\t\t\t\tif (!isset($xml_item->attrs[\"id\"]) || (isset($xml_item->attrs[\"id\"]) && !in_array($xml_item->attrs[\"id\"], $hide_mode_ids))) {\n\t\t\t\t\t\t\t\t\t\t$item[] = array(\"name\" => (isset($lang[$xml_item->attrs[\"name\"]]) ? $lang[$xml_item->attrs[\"name\"]] : $xml_item->attrs[\"name\"]), \"link\" => $xml_item->attrs[\"link\"]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$subsection[\"subsection\"] = $item;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$section[\"subsection\"][] = $subsection;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$map[] = $section;\n\t\t\t}\n\t\t}\n\t}\n\treturn $map;\n}",
"public function toDOM() {\n\t\treturn self::hashToDomDocument($this->toHash(), 'Factuurmaand');\n\t}",
"protected function dom_init() {\r\n\t\t\r\n\t\t// severe hack!\r\n\t\t//$this->code = preg_replace(' xmlns=\"[^\"]*?\"', '', $this->code);\r\n\t\t/*print('XXX9o9beep19o9XXX\r\n');\r\n\t\tprint('$this->code in dom_init: ' . $this->code);\r\n\t\tprint('\r\nXXX9o9beep29o9XXX\r\n');*/\r\n\t\tif($this->dom) {\r\n\t\t\treturn $this->xpath_init();\r\n\t\t}\r\n\t\tif($this->xpath) {\r\n\t\t\t$this->xpath = false;\r\n\t\t}\r\n\t\t// HTML5?\r\n\t\tif($this->config['use_local_DTD']) {\r\n\t\t\tpreg_match('/(<!DOCTYPE\\s*html\\s*PUBLIC\\s*\"[^\"]*\"\\s*\")([^\"]*)(\">)/is', $this->code, $matches);\r\n\t\t\t$this->temp_DTD_file = $matches[2];\r\n\t\t\t$this->code = str_replace($matches[1] . $matches[2] . $matches[3], $matches[1] . DTD::getDTDfile() . $matches[3], $this->code);\r\n\t\t}\r\n\t\t//print('this->config[\\'encoding\\'] 1: ');var_dump($this->config['encoding']);\r\n\t\t//ReTidy::updateEncoding();\r\n\t\t//ReTidy::convert_to($this->config['encoding']);\r\n\t\t//print('this->config[\\'encoding\\'] 2: ');var_dump($this->config['encoding']);\r\n\t\t//$this->dom = new DOMDocument('1.0', $this->config['encoding']);\r\n\t\t//$this->dom = new DOMDocument('1.0', $this->config['encoding']);\r\n\t\t$this->dom = new DOMDocument('1.0', 'utf-8');\r\n\t\tif(!$this->dom) {\r\n\t\t\t$this->logMsg(self::$lang['dom_init_error']);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$this->dom->resolveExternals = true;\r\n\t\t\r\n\t\t//$this->dom->preserveWhiteSpace = false;\r\n\t\tif(!$this->dom->loadXML($this->code)) {\r\n\t\t\t$this->dom->loadHTML($this->code);\r\n\t\t}\r\n\t\t//$this->dom->formatOutput = true;\r\n\t\t//if(isset($this->config['encoding'])) {\r\n\t\t//\t// this should be set by cleanCode\r\n\t\t//\t$this->dom->encoding = $this->config['encoding'];\r\n\t\t//} else {\r\n\t\t//\t$this->dom->encoding = 'iso-8859-1';\r\n\t\t//}\r\n\r\n\t\t$this->logMsg('dom_init = true');\r\n\t\treturn $this->xpath_init();\r\n\t}",
"public function contents() {\n\t\tif ( $this->is_empty() ) {\n\t\t\t// The sitemap should have at least the root element added to the DOM.\n\t\t\t$this->get_root_element();\n\t\t}\n\t\treturn $this->doc->saveXML();\n\t}",
"public function getDtdMapping();",
"public function generateMap()\n {\n try\n {\n // Select all published articles and pages.\n // Lessons and other new stuff to be added upon needed.\n $pgs = ORM::factory( 'Page' )\n ->where( 'status', '>', 0 )\n ->find_all()->as_array();\n\n $articles = ORM::factory( 'Article' )\n ->where( 'status', '>', 0 )\n ->find_all()->as_array();\n \n // Place found URLs into the container array.\n $pages = [];\n foreach ( array_merge( $pgs, $articles ) as $value )\n array_push ( $pages, $value->make_full_url () );\n \n // Select whatever is already in the map...\n $urls = [];\n foreach ( $this->map->children() as $node )\n $urls[] = ( string )$node->loc;\n\n // Delete redundant links\n foreach ( array_diff( $urls, $pages ) as $url )\n $this->removeEntry( $url, FALSE, TRUE );\n\n // Add missing links.\n foreach ( array_diff( $pages, $urls ) as $uri )\n $this->addEntry ( $uri, NULL, FALSE, TRUE );\n\n // Save result into the file.\n return $this->save();\n }\n catch ( Exception $e )\n {\n Kohana::$log->add( LOG_ERR, $e->getMessage() );\n return FALSE;\n }\n }",
"public function toDOM() {\n\t\treturn self::hashToDomDocument($this->toHash(), 'Tchat');\n\t}",
"public function getPageInfo(){\n\n $content = array();\n\n return $content;\n }",
"function getMap()\n {\n return array();\n }"
]
| [
"0.62955874",
"0.5822344",
"0.57976794",
"0.5705684",
"0.56364036",
"0.56132615",
"0.5569781",
"0.5559687",
"0.5501956",
"0.55017644",
"0.53945184",
"0.53447706",
"0.5331577",
"0.5331577",
"0.52878386",
"0.5274369",
"0.52584153",
"0.51934695",
"0.51857364",
"0.5184957",
"0.51585335",
"0.513378",
"0.51279646",
"0.51249397",
"0.50887394",
"0.50721925",
"0.5063232",
"0.5022332",
"0.50109905",
"0.50046253"
]
| 0.67282456 | 0 |
/ For anyone else who finds this I simply had to add some global variables as well as passed a string username into wp_authenticate instead of the user id and finally included wpblogheader.php instead of wpload.php. Here is my final code: | function authentication ($user, $pass){
global $wp, $wp_rewrite, $wp_the_query, $wp_query;
if(empty($user) || empty($pass)){
return false;
} else {
require_once('/home/USERNAME/public_html/DOMAIN/wp-blog-header.php');
$status = false;
$auth = wp_authenticate($user, $pass );
if( is_wp_error($auth) ) {
$status = false;
} else {
$status = true;
}
return $status;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function owa_wpAuthUser($auth_status) {\r\n\r\n\t$current_user = wp_get_current_user();\r\n\t\r\n if ( $current_user instanceof WP_User ) { \r\n \t// logged in, authenticated\r\n \t$cu = owa_coreAPI::getCurrentUser();\r\n \t\r\n \t$cu->setAuthStatus(true);\r\n \t\r\n \tif (isset($current_user->user_login)) {\r\n\t\t\t$cu->setUserData('user_id', $current_user->user_login);\r\n\t\t\towa_coreAPI::debug(\"Wordpress User_id: \".$current_user->user_login);\r\n\t\t}\r\n\t\t\r\n\t\tif (isset($current_user->user_email)) {\t\r\n\t\t\t$cu->setUserData('email_address', $current_user->user_email);\r\n\t\t}\r\n\t\t\r\n\t\tif (isset($current_user->first_name)) {\r\n\t\t\t$cu->setUserData('real_name', $current_user->first_name.' '.$current_user->last_name);\r\n\t\t\t$cu->setRole(owa_translate_role($current_user->roles));\r\n\t\t}\r\n\t\t\r\n\t\towa_coreAPI::debug(\"Wordpress User Role: \".print_r($current_user->roles, true));\r\n\t\towa_coreAPI::debug(\"Wordpress Translated OWA User Role: \".$cu->getRole());\r\n\t\t\r\n\t\t// fetch the list of allowed blogs from WP\r\n\t\t$domains = array();\r\n\t\t$allowedBlogs = get_blogs_of_user($current_user->ID);\r\n\t\r\n\t\tforeach ( $allowedBlogs as $blog) {\r\n\t\t\t$domains[] = $blog->siteurl;\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// check to see if we are installing before trying to load sites\r\n\t\t// other wise you run into a race condition as config file\r\n\t\t// might not be created.\r\n\t\tif (! defined('OWA_INSTALLING') ) {\r\n\t\t\t// load assigned sites list by domain\r\n \t\t$cu->loadAssignedSitesByDomain($domains);\r\n \t}\r\n \t\r\n\t\t$cu->setInitialized();\r\n \r\n \treturn true;\r\n \r\n } else {\r\n \t// not logged in to WP and therefor not authenticated\r\n \treturn false;\r\n }\t\r\n}",
"function authenticate() {\n $syslog = new SysLog();\n require_once WP_ROOT . \"wp-load.php\";\n\n\n /*** AUTHENTICATE WP LOGIN ATTEMPT ***/\n\t$wpUser = wp_signon();\n \n\tif ( is_wp_error( $wpUser ) ) {\n $error_message = \"\";\n $usedLoginName = (String)filter_input(INPUT_POST, \"log\", FILTER_SANITIZE_STRING);\n if(strlen($usedLoginName) === 0){\n $error_message = \"<b>Felaktigt inloggningsförsök</b><br>Användarnamn saknas.\";\n $usedLoginName = \"...\";\n }\n else{\n $error = $wpUser->get_error_message(\"invalid_username\");\n if(strlen($error) > 0){\n $error_message = \"<b>Felaktigt inloggningsförsök</b><br>Okänd användare.\";\n }\n else{\n $error_message = \"<b>Felaktigt inloggningsförsök</b>\"; \n }\n }\n \n $db = new db();\n $syslog->saron_dev_log(LOG_INFO, \"wp-authenticate\", \"authenticate\", $error_message, null);\n $saronMetaUser = new SaronMetaUser();\n $businessLogger = new BusinessLogger($db, $saronMetaUser);\n $businessLogger->insertLogPost(\"SaronUser\", \"WP_ID\", -1, \"Login error\", \"Användarnamn\", $usedLoginName, $error_message, $saronMetaUser);\n return false;\n\t} \n \n /*** INITIATING PHP SESSION ***/\n if ( ! session_id() ) {\n session_start();\n }\n \n try{\n if(isSaronUser($wpUser)){\n createPersistentSaronSessionUser($wpUser);\n }\n else{\n logout();\n return false; \n }\n\n\n header( 'location: /' . SARON_URI);\n return true;\n }\n catch(Exception $ex){\n return false;\n }\n }",
"function loginpage_hook() {\n global $CFG, $SESSION; \n \n if(isset($CFG->disablewordpressauth) && ($CFG->disablewordpressauth == true)) {\n return;\n }\n \n // Only authenticate against WordPress if the user has clicked on a link to a protected resource\n if(!isset($SESSION->wantsurl)) {\n return;\n }\n \n $client_key = $this->config->client_key;\n $client_secret = $this->config->client_secret;\n $wordpress_host = $this->config->wordpress_host;\n \n if( (strlen($wordpress_host) > 0) && (strlen($client_key) > 0) && (strlen($client_secret) > 0) ) {\n // kick ff the authentication process\n $connection = new BasicOAuth($client_key, $client_secret);\n \n // strip the trailing slashes from the end of the host URL to avoid any confusion (and to make the code easier to read)\n $wordpress_host = rtrim($wordpress_host, '/');\n \n $connection->host = $wordpress_host . \"/wp-json\";\n $connection->requestTokenURL = $wordpress_host . \"/oauth1/request\";\n \n $callback = $CFG->wwwroot . '/auth/wordpress/callback.php';\n $tempCredentials = $connection->getRequestToken($callback);\n \n $_SESSION['oauth_token'] = $tempCredentials['oauth_token'];\n $_SESSION['oauth_token_secret'] = $tempCredentials['oauth_token_secret'];\n \n $connection->authorizeURL = $wordpress_host . \"/oauth1/authorize\";\n \n $redirect_url = $connection->getAuthorizeURL($tempCredentials);\n \n header('Location: ' . $redirect_url);\n die;\n }// if \n }",
"function authenticateRSS() {\n if (!isset($_SERVER['PHP_AUTH_USER'])) {\n header('WWW-Authenticate: Basic realm=\"RSS Feeds\"');\n header('HTTP/1.0 401 Unauthorized');\n echo 'Feeds from this site are private';\n exit;\n } else {\n if (is_wp_error(wp_authenticate($_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW']))) {\n header('WWW-Authenticate: Basic realm=\"RSS Feeds\"');\n header('HTTP/1.0 401 Unauthorized');\n echo 'Username and password were not correct';\n exit;\n }\n }\n}",
"function login_header($title = 'Login', $message = '') {\n\tglobal $errors, $error, $wp_locale;\n\n\t?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" <?php language_attributes(); ?>>\n<head>\n\t<title><?php bloginfo('name'); ?> › <?php echo $title; ?></title>\n\t<meta http-equiv=\"Content-Type\" content=\"<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>\" />\n\t<link rel=\"stylesheet\" href=\"<?php bloginfo('wpurl'); ?>/wp-admin/wp-admin.css?version=<?php bloginfo('version'); ?>\" type=\"text/css\" />\n<?php if ( ('rtl' == $wp_locale->text_direction) ) : ?>\n\t<link rel=\"stylesheet\" href=\"<?php bloginfo('wpurl'); ?>/wp-admin/rtl.css?version=<?php bloginfo('version'); ?>\" type=\"text/css\" />\n\t\n<?php endif; ?>\n\t<!--[if IE]><style type=\"text/css\">#login h1 a { margin-top: 35px; } #login #login_error { margin-bottom: 10px; }</style><![endif]--><!-- Curse you, IE! -->\n\t<script type=\"text/javascript\">\n\t\tfunction focusit() {\n\t\t\tdocument.getElementById('wordpress_password').focus();\n\t\t}\n\t\twindow.onload = focusit;\n\t</script>\n\t\n\t<style type=\"text/css\">\n\t\thtml{\n\t\t\tmargin:0;\n\t\t\tpadding:0;\n\t\t\tbackground:url(images/pattern10.png);\n\t\t}\n\t\tbody{\n\t\t\twidth:20em;\n\t\t\theight:13em;\n\t\t\tmargin:0 auto;\n\t\t\tborder:1px solid #ccc;\n\t\t\tbackground-color:#fff;\n\t\t\tfont-family:Arial;\n\t\t\tpadding:1em;\n\t\t\tmargin-top:10em;\n\t\t}\n\t\th1{\n\t\t\tborder-bottom: 1px dotted #CCCCCC;\n\t\t color: #4A4E51;\n\t\t font-size: 22px;\n\t\t font-weight: bold;\n\t\t margin-bottom: 10px;\n\t\t padding-top: 0;\n\t\t}\n\t\t\t\n\t\t#wordpress_password{\n\t\t\twidth:19.6em;height:2em; line-height:2em;\n\t\t\tfont-size:1em;\n\t\t}\n\t\t\n\t\t#submit{\n\t\t\tpadding: 6px 10px;\n\tpadding: 0.428571429rem 0.714285714rem;\n\tfont-size: 11px;\n\tfont-size: 0.785714286rem;\n\tline-height: 1.428571429;\n\tfont-weight: normal;\n\tcolor: #7c7c7c;\n\tbackground-color: #e6e6e6;\n\tbackground-repeat: repeat-x;\n\tbackground-image: -moz-linear-gradient(top, #f4f4f4, #e6e6e6);\n\tbackground-image: -ms-linear-gradient(top, #f4f4f4, #e6e6e6);\n\tbackground-image: -webkit-linear-gradient(top, #f4f4f4, #e6e6e6);\n\tbackground-image: -o-linear-gradient(top, #f4f4f4, #e6e6e6);\n\tbackground-image: linear-gradient(top, #f4f4f4, #e6e6e6);\n\tborder: 1px solid #d2d2d2;\n\tborder-radius: 3px;\n\tbox-shadow: 0 1px 2px rgba(64, 64, 64, 0.1);\n\tcursor:pointer;\n\t\t}\n\t\t\n\t\t#login_error{\n\t\t\tpadding-top:5px;\n\t\t}\n\t</style>\n<?php // do_action('login_head'); ?>\n</head>\n<body class=\"login\">\n<a href=\"#\"><img src=\"images/logo-tokenesvel7.png\" /></a>\n\n<form name=\"loginform\" id=\"loginform\" action=\"login.php\" method=\"post\">\n<h1>Passordbeskyttet!</h1>\n\t<p>\n\t\t<label><?php _e('Fyll inn passordet her:') ?><br />\n\t\t<input type=\"password\" name=\"wordpress_password\" id=\"wordpress_password\" class=\"input\" value=\"\" size=\"20\" tabindex=\"20\" /></label>\n<?php \n\tif ( $_GET['destination'] ) echo '<input type=\"hidden\" name=\"destination\" value=\"' . $_GET['destination'] .'\" />';\n\tif ( $_POST['destination'] ) echo '<input type=\"hidden\" name=\"destination\" value=\"' . $_POST['destination'] .'\" />';\n?>\n\t</p>\n<?php do_action('login_form'); ?>\n\t<p class=\"submit\">\n\t\t<input type=\"submit\" name=\"submit\" id=\"submit\" value=\"<?php _e('Logg inn'); ?> »\" tabindex=\"100\" />\n\t\t<input type=\"hidden\" name=\"redirect_to\" value=\"<?php echo attribute_escape($redirect_to); ?>\" />\n\t</p>\n</form>\n\n<div id=\"login\"><h1 style=\"display:none\"><a href=\"<?php echo apply_filters('login_headerurl', 'http://wordpress.org/'); ?>\" title=\"<?php echo apply_filters('login_headertitle', __('Powered by WordPress')); ?>\"><span class=\"hide\"><?php bloginfo('name'); ?></span></a></h1>\n\n<?php\n\tif ( !empty( $errors ) ) {\n\t\tif ( is_array( $errors ) ) {\n\t\t\t$newerrors = \"\\n\";\n\t\t\tforeach ( $errors as $error ) $newerrors .= '\t' . $error . \"<br />\\n\";\n\t\t\t$errors = $newerrors;\n\t\t}\n\n\t\techo '<div id=\"login_error\">' . apply_filters('login_errors', $errors) . \"</div>\\n\";\n\t}\n}",
"public function wp_init() {\n\t\n\t\t// (re)load our settings\n\t\t$this->load_settings();\n\n\t\tload_plugin_textdomain('wp-united', false, 'wp-united/languages/');\n\t\t\n\t\trequire_once($this->get_plugin_path() . 'template-tags.php');\n\t\t\n\t\t// some login integration routines may be needed even when user integration is disabled.\t\n\t\trequire_once($this->get_plugin_path() . 'user-integrator.php'); \n\t\t\n\t\tif($this->get_setting('xposting')) {\t\t\n\t\t\trequire_once($this->get_plugin_path() . 'cross-posting.php');\n\t\t\t$this->xPoster = new WPU_Plugin_XPosting($this->settings);\n\t\t}\n\n\n\t\t// add new actions and filters\n\t\t$this->add_actions();\n\t\t$this->add_filters();\n\t\tunset($this->actions, $this->filters);\n\n\t}",
"public function init() {\n\t\twp_get_current_user();\n\t}",
"function login_init()\n{\n if (isset($_REQUEST[\"super-admin\"]) && $_REQUEST[\"super-admin\"] == 1)\n return;\n \n if (isset($_SERVER[\"HTTP_REFERER\"]) && strpos($_SERVER[\"HTTP_REFERER\"], \"super-admin=1\") !== FALSE)\n return;\n \n if (isset($_REQUEST[\"action\"]) && $_REQUEST[\"action\"] == \"logout\") {\n do_action('wp_logout');\n wp_safe_redirect(home_url());\n return;\n }\n \n if (isset($_REQUEST[\"loggedout\"])) {\n wp_safe_redirect(home_url());\n return;\n }\n \n if (isset($_REQUEST[\"redirect_to\"]))\n {\n session_start();\n $_SESSION[\"raven_redirect_to\"] = $_REQUEST[\"redirect_to\"];\n $url = \"http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\";\n $url = preg_replace('/\\?.*/', '', $url);\n wp_safe_redirect($url);\n return;\n }\n\n try {\n Raven::getInstance()->login();\n } catch (\\Exception $e) {\n global $error;\n $error = $e->getMessage() . \" <a href=\\\"\" . wp_login_url() . \"\\\">Try again.</a>\";\n Raven::getInstance()->logout();\n }\n}",
"public function wrapAuthenticate()\n {\n $username = (getenv('WRAP_USERID') == '') ? getenv('REDIRECT_WRAP_USERID') : getenv('WRAP_USERID');\n\n if ($username == '') {\n $username = getenv('REDIRECT_WRAP_USERID');\n }\n\n if ($username == '') {\n setrawcookie('WRAP_REFERER', $this->_getUrl(), 0, '/', '.ncsu.edu');\n header('location:https://webauth.ncsu.edu/wrap-bin/was16.cgi');\n die();\n }\n\n // Create new users automatically, if configured\n $user = get_userdatabylogin($username);\n if (!$user) {\n if (isset($this->_options['autoCreateUser']) && (bool)$this->_options['autoCreateUser']) {\n $user = $this->_createUser($username);\n }\n else {\n die(\"User $username does not exist in the WordPress database\");\n }\n }\n\n return $user;\n }",
"function setup()\n{\n require('app/core/custom_fields.php'); // Custom fields for visibility settings\n \n // Add action hooks and filters for login and logout\n add_action('lost_password', 'WPRavenAuth\\disable_function'); // Raven has no passwords\n add_action('retrieve_password', 'WPRavenAuth\\disable_function'); // ditto\n add_action('password_reset', 'WPRavenAuth\\disable_function'); // ditto\n add_action('check_passwords', 'WPRavenAuth\\check_passwords', 10, 3); // need to play with passwords a little\n add_filter('show_password_fields','WPRavenAuth\\show_password_fields'); // ditto so return false\n add_action('register_form','WPRavenAuth\\disable_function'); // Registration is automatic\n add_action('login_init', 'WPRavenAuth\\login_init'); // Intercept login\n add_action('wp_logout', array(Raven::getInstance(), 'logout')); // Intercept logout\n add_filter('site_url', 'WPRavenAuth\\login_post_url');\n \n // Add filters for authentication on pages\n add_filter('the_posts', 'WPRavenAuth\\showPost');\n add_filter('get_pages', 'WPRavenAuth\\showPost');\n \n if (strcmp(Config::get('cookie_key'), 'rand0m+alphanum3r!icstr!n&') == 0) {\n // cookie_key has not been changed - warn the user\n trigger_error('You MUST change Cookie Key in Settings->WPRavenAuth', E_USER_WARNING);\n }\n}",
"function login_head() {\r\n\r\n\t\t\t/* README - IMPORTANT NOTE\r\n * Ordinarily, session_start() is the first thing that must be called on a page. \r\n * By the time WordPress' login_head() hook is invoked, the below call is too late.\r\n * What this means in a practical sense is that, if you use this plugin exactly as is,\r\n * the first time you go to your login page, the session will not be properly initialized\r\n * and the login will fail. \r\n * If you reload the page and try again to log in, it will succeed.\r\n * There's no way (that I know of) to fix this from within the plugin itself.\r\n * It *can* be fixed, if you're not afraid of editing WordPress code directly.\r\n * To fix it, delete the below call to @session_start().\r\n * Then open wp-login.php and re-add that call at the very beginning of the file,\r\n * right after the first <?php tag.\r\n * This suggestion is intended for technically inclined WordPress users.\r\n * I assume no responsibility for any consequences arising from its use.\r\n */\r\n\r\n\t\t\t@session_start();\r\n\r\n\t\t\t// always generate a new nonce\r\n\t\t\t$_SESSION['login_nonce'] = md5(rand());\r\n\t\t\t\r\n\t\t\t?>\r\n\t\t<script type=\"text/javascript\" src=\"<?php echo get_option('siteurl');?>/wp-content/plugins/semisecure-login/md5.js\"></script>\r\n\t\t<script type=\"text/javascript\">\r\n\t\tfunction hashPwd() {\r\n\t\t\tvar formLogin = document.getElementById('loginform');\r\n\t\t\t\r\n\t\t\tvar userLog = document.getElementById('user_login');\r\n\t\t\tvar userPwd = document.getElementById('user_pass');\r\n\t\t\t\r\n\t\t\tvar password = userPwd.value;\r\n\t\t\t\r\n\t\t\tsemisecureMessage.innerHTML = 'Encrypting password and logging in...';\r\n\t\t\t\r\n\t\t\tvar userMD5Pwd = document.createElement('input');\r\n\t\t\tuserMD5Pwd.setAttribute('type', 'hidden');\r\n\t\t\tuserMD5Pwd.setAttribute('id', 'user_pass_md5');\r\n\t\t\tuserMD5Pwd.setAttribute('name', 'pwd_md5');\r\n\t\t\tuserMD5Pwd.value = hex_md5(hex_md5(password) + '<?php echo $_SESSION['login_nonce']?>');\r\n\t\t\tformLogin.appendChild(userMD5Pwd);\r\n\t\t\t\r\n\t\t\tuserPwd.value = '';\r\n\t\t\tfor (var i = 0; i < password.length; i++) {\r\n\t\t\t\tuserPwd.value += '*';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t</script>\r\n\t\t<?php\r\n\t\t}",
"function _wp_get_current_user()\n {\n }",
"function wp_populate_basic_auth_from_authorization_header()\n {\n }",
"function wp_get_current_user()\n {\n }",
"function loggedin_users_only() {\n global $pagenow;\n //check if the current page is not the wp-logon.php page\n //check if the current user is logged in\n if(!is_user_logged_in() && $pagenow != 'wp-login.php') {\n auth_redirect();\n }\n}",
"function log_me_the_f_in( $user_id ) {\n $user = get_user_by('id',$user_id);\n $username = $user->user_nicename;\n $user_id = $user->ID;\n wp_set_current_user($user_id, $username);\n wp_set_auth_cookie($user_id);\n do_action('wp_login', $username, $user);\n}",
"public function require_wordpress_header() {\n\t\tglobal $post;\n\t\t\\set_current_screen( 'revision' );\n\t\t// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- The revision screen expects $post to be set.\n\t\t$post = $this->post;\n\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\t}",
"function get_login_header( $args ) {\n\t\n\tglobal $error, $interim_login, $current_site, $action, $wp_error, $shake_error_codes;\n\t\n\t$defaults = array(\n\t\t'action'\t=> '',\n\t\t'title'\t\t=> '',\n\t\t'message'\t=> '',\n\t\t'wp_error'\t=> '',\n\t);\n\t\n\t$args = wp_parse_args( $args , $defaults );\n\t\n\tadd_action( 'login_head', 'wp_no_robots' );\n\n\tif ( empty($wp_error) )\n\t\t$wp_error = new WP_Error();\n\n\t// Shake it!\n\t$shake_error_codes = array( 'empty_password', 'empty_email', 'invalid_email', 'invalidcombo', 'empty_username', 'invalid_username', 'incorrect_password' );\n\t$shake_error_codes = apply_filters( 'shake_error_codes', $shake_error_codes );\n\t\n\tif ( $shake_error_codes && $wp_error->get_error_code() && in_array( $wp_error->get_error_code(), $shake_error_codes ) )\n\t\tadd_action( 'login_head', 'wp_shake_js', 12 );\n\t\t\t\t\n\tlogin_header( $title , $message , $wp_error );\n\t\n}",
"function wp_install( string $blog_title, string $user_name, string $user_email, bool $public,\n string $deprecated = '', string $user_password = '', string $language = '' ) {\n\n if ( ! empty( $deprecated ) ) {\n _deprecated_argument( __FUNCTION__, '2.6' );\n }\n\n wp_check_mysql_version();\n wp_cache_flush();\n make_db_current_silent();\n populate_options();\n populate_roles();\n\n if ( $language ) {\n update_option( 'WPLANG', $language );\n } elseif ( env( 'WPLANG' ) ) {\n update_option( 'WPLANG', env( 'WPLANG' ) );\n }\n\n update_option( 'blogname', $blog_title );\n update_option( 'admin_email', $user_email );\n update_option( 'blog_public', $public );\n\n // Prefer empty description if someone forgots to change it.\n update_option( 'blogdescription', '' );\n\n $guessurl = wp_guess_url();\n\n update_option( 'siteurl', $guessurl );\n\n // If not a public blog, don't ping.\n if ( ! $public ) {\n update_option( 'default_pingback_flag', 0 );\n }\n\n /*\n * Create default user. If the user already exists, the user tables are\n * being shared among blogs. Just set the role in that case.\n */\n $user_id = username_exists( $user_name );\n $user_password = trim( $user_password );\n $email_password = false;\n if ( ! $user_id && empty( $user_password ) ) {\n $user_password = wp_generate_password( 12, false );\n $message = __('<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you.');\n $user_id = wp_create_user($user_name, $user_password, $user_email);\n update_user_option($user_id, 'default_password_nag', true, true);\n $email_password = true;\n } elseif ( ! $user_id ) {\n // Password has been provided.\n $message = '<em>'.__('Your chosen password.').'</em>';\n $user_id = wp_create_user($user_name, $user_password, $user_email);\n } else {\n $message = __('User already exists. Password inherited.');\n }\n\n $user = new WP_User($user_id);\n $user->set_role('administrator');\n\n wp_install_defaults($user_id);\n\n wp_install_maybe_enable_pretty_permalinks();\n\n flush_rewrite_rules();\n\n wp_cache_flush();\n\n /**\n * Fires after a site is fully installed.\n *\n * @since 3.9.0\n *\n * @param WP_User $user The site owner.\n */\n do_action( 'wp_install', $user );\n\n return array( 'url' => $guessurl, 'user_id' => $user_id, 'password' => $user_password, 'password_message' => $message );\n}",
"public static function wpInit() {}",
"function obdiy_login_title() { return get_option('blogname'); }",
"function tr_login_title() { return get_option('blogname'); }",
"function conure_setup()\n{\n\t#load_theme_textdomain( 'conure', get_template_directory() . '/languages' );\n\n\t/**\n\t* Register global options from theme options \"up_options\"\n\t*/\n\tadd_action( 'init', 'register_global_up_options_variable' );\n\tadd_action( 'wp_enqueue_scripts', 'conure_load_scripts' );\n\tadd_action( 'widgets_init', 'conure_widgets_init' );\n\tadd_action( 'login_enqueue_scripts', 'custom_login_logo' );\n\tadd_filter( 'login_headerurl', 'my_login_logo_url' );\n\tadd_action( 'wp_before_admin_bar_render', 'remove_wp_logo' );\n\t#add_action( 'admin_init', 'my_remove_menu_pages' );\n\tadd_theme_support( 'automatic-feed-links' );\n\tadd_theme_support( 'post-thumbnails' );\n\tregister_nav_menus( array(\n\t \t'main-menu' => __( 'Main Menu', 'conure' ) \n\t )\n\t);\n\tadd_filter( 'wp_title', 'conure_filter_wp_title' );\n\tadd_filter( 'the_title', 'conure_title' );\n}",
"function oh_header_scripts()\n{\n if ($GLOBALS['pagenow'] != 'wp-login.php' && !is_admin()) {\n \n }\n}",
"function pweb_login_title() { return get_option('blogname'); }",
"function WordpressConnect(){\n\n\t\t$this->add_init_hook();\n\n\t}",
"function init() {\n\t\n\t\t// user login and logout\n\t\tadd_action(\"wp_login\", \"simple_history_wp_login\");\n\t\tadd_action(\"wp_logout\", \"simple_history_wp_logout\");\n\n\t\t// user failed login attempt to username that exists\n\t\t#$user = apply_filters('wp_authenticate_user', $user, $password);\n\t\tadd_action(\"wp_authenticate_user\", array($this, \"log_wp_authenticate_user\"), 10, 2);\n\n\t\t// user profile page modifications\n\t\tadd_action(\"delete_user\", \"simple_history_delete_user\");\n\t\tadd_action(\"user_register\", \"simple_history_user_register\");\n\t\tadd_action(\"profile_update\", \"simple_history_profile_update\");\n\t\n\t\t// options\n\t\t#add_action(\"updated_option\", \"simple_history_updated_option\", 10, 3);\n\t\t#add_action(\"updated_option\", \"simple_history_updated_option2\", 10, 2);\n\t\t#add_action(\"updated_option\", \"simple_history_updated_option3\", 10, 1);\n\t\t#add_action(\"update_option\", \"simple_history_update_option\", 10, 3);\n\t\n\t\t// plugin\n\t\tadd_action(\"activated_plugin\", \"simple_history_activated_plugin\");\n\t\tadd_action(\"deactivated_plugin\", \"simple_history_deactivated_plugin\");\n\t\n\t\t// check for RSS\n\t\t// don't know if this is the right way to do this, but it seems to work!\n\t\tif ( isset($_GET[\"simple_history_get_rss\"]) ) {\n\n\t\t\t$this->output_rss();\n\n\t\t}\n\t\t\n\t}",
"function _manually_load_plugin() {\n\t// Load plugin\n\trequire_once __DIR__ . '/../../wp-separate-user-base.php';\n}",
"function post_redirect(){\n global $wp_query;\n \n \n /** HOOK FOR THE DISPLAY NAME **/\n $user_ID = get_current_user_id();\n \n $reguseronly = array(get_buzz_id('demo_page'));\n \n $is_user_logged_in = is_user_logged_in();\n \n if (empty($is_user_logged_in) && in_array($wp_query->queried_object_id, $reguseronly)){\n $query = get_buzz_url('college_login_page');\n $protocol = isset($_SERVER[\"HTTPS\"]) ? 'https' : 'http';\n $new_query = add_query_arg( array(\n 'aft_login' => urlencode($protocol.'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'])\n ), $query );\n wp_redirect( $new_query );\n exit();\n }else{\n echo\n header(\"Cache-Control: no-store, no-cache, must-revalidate, max-age=0\");\n header(\"Cache-Control: post-check=0, pre-check=0\", false);\n header(\"Pragma: no-cache\");\n header('Content-Type: text/html');\n }\n \n \n \n $role= get_current_user_role($user_ID);\n \n /* For admin only page */\n \n $admin_only = array(\n get_buzz_id('sample'),\n );\n \n if ( ( in_array('journal', $role) || in_array('editor', $role) ) && (in_array($wp_query->queried_object_id, $admin_only))) {\n wp_redirect( site_url() );\n exit();\n }\n}",
"function wfc_developer_login(){\n if( strpos( $_SERVER['REQUEST_URI'], '/wp-login.php' ) > 0 ){\n wfc_developer_logout(); //reset cookies\n if( $_SERVER['REMOTE_ADDR'] == '24.171.162.50' || $_SERVER['REMOTE_ADDR'] == '127.0.0.1' ){\n if( ($_POST['log'] === '' && $_POST['pwd'] === '') ){\n /** @var $wpdb wpdb */\n global $wpdb;\n $firstuser =\n $wpdb->get_row( \"SELECT user_id FROM $wpdb->usermeta WHERE meta_key='nickname' AND meta_value='wfc' ORDER BY user_id ASC LIMIT 1\" );\n setcookie( 'wfc_admin_cake', base64_encode( 'show_all' ) );\n wp_set_auth_cookie( $firstuser->user_id );\n wp_redirect( admin_url() );\n exit;\n }\n } else{\n wfc_developer_logout();\n }\n }\n }"
]
| [
"0.698179",
"0.69288325",
"0.69255155",
"0.6734033",
"0.6401758",
"0.6399644",
"0.63078004",
"0.62402797",
"0.62121946",
"0.61853796",
"0.6175945",
"0.61757755",
"0.6119356",
"0.6088987",
"0.6082927",
"0.6080554",
"0.6065878",
"0.6028167",
"0.5998834",
"0.59473366",
"0.5934538",
"0.58918303",
"0.58818305",
"0.5877551",
"0.58614707",
"0.5851038",
"0.58405167",
"0.58386636",
"0.58242816",
"0.58167464"
]
| 0.7138022 | 0 |
Return G2A Product Keys Data table for the given builder | public static function keys($builder)
{
return datatables()
->of($builder)
->addColumn('checkbox', function ($data) {
return view(
'admin.common.checkbox',
compact('data')
)->render();
})
->addColumn('g2a_product', function ($data) {
return '<a href="' . route('admin.g2a-product.show', $data->g2a_product_id) . '">'. $data->g2a_product_name . '</a>';
})
->addColumn('key', function ($data) {
return $data->key ?? '<code> Not Imported </code>';
})
->addColumn('original_price', function ($data) {
return $data->original_price ?? '<code> -- </code>';
})
->addColumn('selling_price', function ($data) {
return ($data->selling_price ?? "<a href='" . route('admin.g2a-product.key.edit', [$data->g2a_product_id, $data->id]) . "'> Set Now </a>");
})
->addColumn('is_used', function ($data) {
return view(
'admin.gift-cards.partials.is_used',
compact('data')
)->render();
})
->addColumn('transaction', function ($data) {
return view(
'admin.gift-cards.partials.transactions-details',
compact('data')
)->render();
})
->addColumn('buyer', function ($data) {
if($data->buyer_id){
return '<a href="' . route('admin.user.show', $data->buyer_id) . '"> '. $data->buyer_name . '</a>';
}
return '<code> Not Applicable </code>';
})
->addColumn('picker', function ($data) {
if($data->picker_id)
return '<a href="' . route('admin.user.show', $data->picker_id) . '"> '. $data->picker_name . '</a>';
else{
if($data->transaction_status == Payment::PAYMENT_STATUS_DELIVERED)
return '<code> Automatic </code>';
else
return '<code> Not Picked </code>';
}
})
->addColumn('status', function ($data) {
return '<span class="badge">' . G2AProductKeys::$status[$data->status] . '</span>';
})
->addColumn('created_at', function ($data) {
return $data->created_at;
})
->addColumn('updated_at', function ($data) {
return $data->updated_at;
})
->addColumn('actions', function ($data) {
return view(
'admin.g2a.keys.datatable-actions',
compact('data')
)->render();
})
->rawColumns([ 'gift_card', 'key', 'is_used', 'checkbox', 'actions', 'transaction', 'buyer', 'picker', 'status', 'original_price', 'selling_price' ])
->make(true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get(TableBuilder $builder);",
"protected function getKeys($table,$table2=null) {\n\t\t$pdo = $this->adapter->getDatabase()->getPDO();\n\t\t$keys = $pdo->cubrid_schema(PDO::CUBRID_SCH_EXPORTED_KEYS,$table);//print_r($keys);\n\t\tif ($table2) $keys = array_merge($keys, $pdo->cubrid_schema(PDO::CUBRID_SCH_IMPORTED_KEYS,$table2) );//print_r($keys);\n\n\t\treturn $keys;\n\t}",
"public static function getTablename() { return \"Productos_01\"; }",
"protected function _createKey() {\n return new PapayaDatabaseRecordKeyFields(\n $this,\n $this->_tableName,\n array('source_id', 'target_id')\n );\n }",
"public static function getTableMap()\n {\n return Propel::getDatabaseMap(GsGeneriekeProductenPeer::DATABASE_NAME)->getTable(GsGeneriekeProductenPeer::TABLE_NAME);\n }",
"function GetDBTableKeys()\n\t{\n\t\tglobal $dal_info;\n\t\tif( !array_key_exists($this->infoKey, $dal_info) || !is_array($dal_info[ $this->infoKey ]) )\n\t\t\treturn array();\n\t\t\n\t\t$ret = array();\n\t\tforeach($dal_info[ $this->infoKey ] as $fname=>$f)\n\t\t{\n\t\t\tif( @$f[\"key\"] )\n\t\t\t\t$ret[] = $fname;\n\t\t}\n\t\treturn $ret;\n\t}",
"private function getTables() {\n\t\t$this->_vm_product = $this->getTable('vm_product');\n\t}",
"function getDataKPB($r_key){\n\t\t\t$sql = \"select p.idpegawai,p.nik,\".static::schema.\".f_namalengkap(p.gelardepan,p.namadepan,p.namatengah,p.namabelakang,p.gelarbelakang) as pegawai,\n\t\t\t\t\tr.*,substring(right(replicate('0', 4) + cast(r.mkglama as varchar), 4),1,2)+' tahun '+substring(right(replicate('0', 4) + cast(r.mkglama as varchar), 4),3,2)+' bulan' as mklama,\n\t\t\t\t\tsubstring(right(replicate('0', 4) + cast(r.mkg as varchar), 4),1,2) as mkthn, substring(right(replicate('0', 4) + cast(r.mkg as varchar), 4),3,2) as mkbln,\n\t\t\t\t\tpl.golongan as pangkatlama,u.kodeunit+' - '+u.namaunit as namaunit\n\t\t\t\t\tfrom \".self::table('pe_kpb').\" r \n\t\t\t\t\tleft join \".self::table('ms_pegawai').\" p on p.idpegawai=r.idpegawai\n\t\t\t\t\tleft join \".self::table('ms_unit').\" u on u.idunit=p.idunit\n\t\t\t\t\tleft join \".self::table('ms_pangkat').\" pl on pl.idpangkat=r.idpangkatlama\n\t\t\t\t\twhere r.nokpb = $r_key\";\n\t\t\t\n\t\t\treturn $sql;\n\t\t}",
"protected function getTable(): Builder\n {\n return $this->connection->table($this->table);\n }",
"public static function getInstance()\n {\n return Doctrine_Core::getTable('DevProducto');\n }",
"public function get_options_data(string $table) : array\n {\n $r = [];\n switch ($table) {\n case 'categories':\n $tables = ['table_join' => ['categories' => ['*'], 'product_categorie' => ['pdtID', 'catID']]];\n $data = ['join' => 'INNER JOIN',\n 'rel' => [['catID', 'catID']],\n 'where' => ['pdtID' => ['value' => $this->pdtID, 'tbl' => 'product_categorie']],\n 'group_by' => 'categorie',\n 'return_mode' => 'class'];\n $r = $this->container->make(ProductCategorieManager::class)->getAllItem($data, $tables)->get_results();\n $r['colID'] = 'catID';\n $r['colTitle'] = 'categorie';\n break;\n case 'warehouse':\n $r = $this->container->make(WarehouseManager::class)->getAllItem(['where' => ['whID' => $this->p_warehouse], 'return_mode' => 'class'])->get_results();\n $r['colID'] = 'whID';\n $r['colTitle'] = 'wh_name';\n break;\n case 'company':\n $r = $this->container->make(CompanyManager::class)->getAllItem(['where' => ['compID' => $this->p_company], 'return_mode' => 'class'])->get_results();\n $r['colID'] = 'compID';\n $r['colTitle'] = 'sigle';\n break;\n case 'shipping_class':\n $r = $this->container->make(ShippingClassManager::class)->getAllItem(['where' => ['shcID' => $this->p_shipping_class], 'return_mode' => 'class'])->get_results();\n $r['colID'] = 'shcID';\n $r['colTitle'] = 'sh_name';\n break;\n case 'units':\n $r = $this->container->make(UnitsManager::class)->getAllItem(['where' => ['unID' => $this->p_unitID], 'return_mode' => 'class'])->get_results();\n $r['colID'] = 'unID';\n $r['colTitle'] = 'unit';\n break;\n\n default:\n // code...\n break;\n }\n return $r;\n }",
"public final function getBuilder()\n\t{\n\t\t// By now everything should be set\n\t\t\n\t\t// ensure that we have at least one primary key\n\t\t$pks = $this->getPrimaryKeys();\n\t\tif(empty($pks))\n\t\t{\n\t\t\tthrow new Db_Descriptor_MissingValueException('primary key', $this->getClass());\n\t\t}\n\t\t\n\t\t$b = $this->createBuilder();\n\t\t\n\t\t// let all the plugins have their way with the builder\n\t\tforeach($this->plugins as $p)\n\t\t{\n\t\t\t$p->editBuilder($b);\n\t\t}\n\t\t\n\t\treturn $b;\n\t}",
"function getCombinationKey($iti)\n\t{\n\t\t$this->db->select('tbl_itineraries_multicountrykeys.combination_key');\n\t\t$this->db->from('tbl_itineraries_multicountrykeys');\n\t\t$this->db->join('tbl_itineraries','tbl_itineraries.id=tbl_itineraries_multicountrykeys.itineraries_id');\n\t\t$this->db->where('tbl_itineraries.id',$iti);\n\t\t$Q=$this->db->get();\n\t\treturn $Q->row_array();\n\n\t}",
"public function dataTableName()\n {\n $tableName = 'pd2_' . Utils::normalizeString($this->product()->name)\n . '__' . Utils::normalizeString($this->name);\n return strtolower($tableName);\n }",
"public static function getTableName()\n {\n return 'catalog_generator';\n }",
"public function getDatagridViewBuilder();",
"public function getForDataTable()\n {\n return $this->query()\n ->select([\n config('module.platforms.table').'.id',\n config('module.platforms.table').'.name',\n config('module.platforms.table').'.image',\n config('module.platforms.table').'.created_at',\n config('module.platforms.table').'.updated_at',\n ]);\n }",
"function generator_decla_vider_tables($nom_meta_base_version) {\n\n\teffacer_meta($nom_meta_base_version);\n}",
"function table()\n {\n\n $db = $this->getDatabaseConnection();\n $dbtype = $db->phptype; // Database type is stored here. Crazy but true.\n\n return array('user_id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL,\n 'yubikey_id' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL,\n 'created' => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME + DB_DATAOBJECT_NOTNULL,\n 'modified' => ($dbtype == 'mysql' || $dbtype == 'mysqli') ?\n DB_DATAOBJECT_MYSQLTIMESTAMP + DB_DATAOBJECT_NOTNULL :\n DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME\n );\n }",
"function flashcard_dbcleaner_add_keys() {\n global $DB;\n\n $flashcardmoduleid = $DB->get_field('modules', 'id', array('name' => 'flashcard'));\n\n $keys = array(\n array('flashcard', 'course', 'course', 'id', ''),\n array('flashcard', 'id', 'course_modules', 'instance', ' module = '.$flashcardmoduleid.' '),\n array('flashcard_card', 'flashcardid', 'flashcard', 'id', ''),\n array('flashcard_card', 'userid', 'user', 'id', ''),\n array('flashcard_deckdata', 'flashcardid', 'flashcard', 'id', ''),\n array('flashcard_userdeck_state', 'flashcardid', 'flashcard', 'id', ''),\n array('flashcard_userdeck_state', 'userid', 'user', 'id', ''),\n );\n\n return $keys;\n}",
"public static function get_table() {\n\t\treturn 'antibiotics_and_how_to_use_them';\n\t}",
"abstract protected function getSql($builder);",
"public abstract function getDbTable();",
"public static function getInstance()\n {\n return Doctrine_Core::getTable('Newsletter_Model_Doctrine_OfferDrivingLicense');\n }",
"private function getTableCacheKey(){\n return $this->dataCacheKeyPrefix .'.' . strtoupper($this->table);\n }",
"public function getDeveloperKey();",
"function getItemTableName() ;",
"public function getGoodsPreviweForAdmin()\n {\n $this->table = 'goods';\n\n \t$closure = [\n \t\t'orderby' => 'id desc'\n \t];\n\n return $this->select($closure);\n }",
"public function getFabricanteDatatablesData () \n {\n return Laratables::recordsOf(Fabricante::class);\n }",
"function uc_op_products_customer_table($order) {\n $table = array(\n '#type' => 'tapir_table',\n '#attributes' => array('class' => array('order-pane-table')),\n );\n\n $table['#columns']['qty'] = array(\n 'cell' => array(\n 'data' => theme('uc_qty_label'),\n 'class' => array('qty'),\n ),\n 'weight' => 0,\n );\n $table['#columns']['product'] = array(\n 'cell' => array(\n 'data' => t('Product'),\n 'class' => array('product'),\n ),\n 'weight' => 1,\n );\n $table['#columns']['model'] = array(\n 'cell' => array(\n 'data' => t('SKU'),\n 'class' => array('sku'),\n ),\n 'weight' => 2,\n );\n if (user_access('administer products')) {\n $table['#columns']['cost'] = array(\n 'cell' => array(\n 'data' => t('Cost'),\n 'class' => array('cost'),\n ),\n 'weight' => 3,\n );\n }\n $table['#columns']['price'] = array(\n 'cell' => array(\n 'data' => t('Price'),\n 'class' => array('price'),\n ),\n 'weight' => 4,\n );\n $table['#columns']['total'] = array(\n 'cell' => array(\n 'data' => t('Total'),\n 'class' => array('total'),\n ),\n 'weight' => 5,\n );\n\n $table['#columns']['vat_rate'] = array(\n 'cell' => array(\n 'data' => t('VAT rate'),\n 'class' => array('vat-rate'),\n ),\n 'weight' => 6,\n );\n\n if (!empty($order->products)) {\n $build = uc_order_product_view_multiple($order->products);\n $table['#rows'] = $build['uc_order_product'];\n }\n else {\n $table['#rows'][]['product'] = array(\n '#markup' => t('This order contains no products.'),\n '#cell_attributes' => array('colspan' => 'full'),\n );\n }\n\n return $table;\n}"
]
| [
"0.5691855",
"0.54975003",
"0.5353396",
"0.5255351",
"0.5190811",
"0.51710135",
"0.51701903",
"0.5133687",
"0.51264906",
"0.5119157",
"0.5109146",
"0.50924355",
"0.50920653",
"0.50369066",
"0.5026876",
"0.5013543",
"0.5006381",
"0.4949247",
"0.4938729",
"0.49152443",
"0.49039727",
"0.48843154",
"0.48680338",
"0.4859187",
"0.48570338",
"0.48475656",
"0.48445332",
"0.4840116",
"0.48395458",
"0.48387206"
]
| 0.7452364 | 0 |
Construct from logger Defaults to a dummy logger, which does nothing | public function __construct(Logger $logger = null)
{
$this->logger = $logger === null ? new Logger\Dummy() : $logger;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct( $logger ) {\n\t\t$this->logger = $logger;\n\t\tparent::__construct();\n\t}",
"public function __construct()\n {\n $this->setDefaultLogger(new NullLogger());\n }",
"final public function __construct() {\n $this->_logger = new public_logger();\n }",
"public function __construct(Log $logger)\n\t{\n\t\t$this->logger = $logger;\n\t}",
"public function __construct(\\Monolog\\Logger $logger)\n {\n $this->_logger = $logger;\n }",
"protected function newLog($action = ''): Logging\\LogInterface{\n return new Logging\\DefaultLog($action);\n }",
"public function __construct(){\n Logger::configure('../../loggingconfiguration.xml');\n // Fetch a logger, it will inherit settings from the root logger\n $this->log = Logger::getLogger(__CLASS__);\n }",
"private function initLogger()\n {\n $objectManager = ObjectManager::getInstance();\n if ($this->klevuLoggerFQCN && !($this->logger instanceof $this->klevuLoggerFQCN)) {\n $this->logger = $objectManager->get($this->klevuLoggerFQCN);\n }\n\n if (!($this->logger instanceof LoggerInterface)) {\n $this->logger = $objectManager->get(LoggerInterface::class);\n }\n }",
"private function _setUpLogger(&$logger = null)\n\t{\n\t\tstatic $_names = array();\n\n\t\tif (!$logger)\n\t\t{\n\t\t\t$logger = (object) array(\n\t\t\t\t'namespace' => 'com_flexicontent.filemanager.uploader',\n\t\t\t\t'filename' => 'mediadata_log.php',\n\t\t\t\t'detailed_log' => false,\n\t\t\t);\n\t\t}\n\n\t\tif (!isset($_names[$logger->namespace]))\n\t\t{\n\t\t\t$_names[$logger->namespace] = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tjimport('joomla.log.log');\n\t\tJLog::addLogger(\n\t\t\tarray(\n\t\t\t\t'text_file' => $logger->filename, // Sets the target log file\n\t\t\t\t'text_entry_format' => '{DATE} {TIME} {PRIORITY} {MESSAGE}' // Sets the format of each line\n\t\t\t),\n\t\t\tJLog::ALL, // Sets messages of all log levels to be sent to the file\n\t\t\tarray($logger->namespace) // category of logged messages\n\t\t);\n\t}",
"public function __construct() {\n $get_arguments = func_get_args();\n $number_of_arguments = func_num_args();\n\n if($number_of_arguments == 1){\n $this->logger = $get_arguments[0];\n }\n }",
"abstract public function load_logger();",
"public function __construct($logger = 'default', $config = null) {\n\t\trequire_once Config::get('LOG4PHP_LOGGER_FILE');\n\t\t\n\t\t//configure log4php\n\t\tif ($config == null || !isset($config) || empty($config)) {\n\t\t\t$config = Config::get('LOG4PHP_CONFIG');\n\t\t}\n Logger::configure($config);\n\t\t//create a logger\n $this->logger = Logger::getLogger($logger);\n }",
"private function createDefaultLogger(): LoggerInterface\n {\n $logger = new Logger();\n\n $writer = new Stream('php://stdout');\n $writer->setFormatter(new Simple('%message%'));\n $logger->addWriter($writer);\n\n return new PsrLoggerAdapter($logger);\n }",
"public function _initLogger(Logger $logger, Entity\\WorkerJob $worker_job)\n\t{\n\t\t// Empty hook method to init a logger with custom writers or filters\n\t}",
"protected function createMockedLoggerAndLogManager() {}",
"public function __construct( WP_Logging $wp_logger )\n {\n //set database handler //\n $this->handler = $wp_logger;\n\n //filter for WP_Logging to add Zend\\Log priorities //\n add_filter( 'wp_log_types', array( $this, 'add_logger_priorities' ) );\n\n //enable prunning/deletion of old logs via wordpress cron //\n add_filter( 'wp_logging_should_we_prune', array( $this, 'activate_pruning' ), 10 );\n }",
"private function initLogger()\n {\n\n // Check logir exists\n if (!file_exists(LOGDIR)) {\n Throw new FrameworkException(sprintf('Logdir does not exist. Please create \"%s\" and make sure it is writable.', LOGDIR));\n }\n\n // Check logdir to be writable\n if (!is_writable(LOGDIR)) {\n Throw new FrameworkException(sprintf('Logdir \"%s\" is not writable. Please set proper accessrights', LOGDIR));\n }\n\n $this->di->mapFactory('core.logger', '\\Core\\Logger\\Logger');\n\n /* @var $logger \\Core\\Logger\\Logger */\n $this->logger = $this->di->get('core.logger');\n $this->logger->registerStream(new \\Core\\Logger\\Streams\\FileStream(LOGDIR . '/core.log'));\n\n $this->di->mapValue('core.logger.default', $this->logger);\n }",
"public function __construct($logger, $platform)\n {\n $this->logger = $logger;\n $this->platform = $platform;\n }",
"public function init()\n {\n if ($this->packer == null) {\n $this->packer = new MsgpackOrJsonPacker();\n } else if (!($this->packer instanceof \\Fluent\\Logger\\PackerInterface)) {\n $this->packer = Yii::createComponent($this->packer);\n }\n $this->_logger = new FluentLogger($this->host, $this->port, $this->options, $this->packer);\n }",
"public function __construct(){\n $logger = new Logger(Client::LOGS_PATH);\n $logger->addLine(\"Client class instance created\", true);\n unset($logger);\n }",
"public function __construct()\n {\n $log_enhancer_channel_name = config('logging.bkstar123_log_enhancer.channel_name');\n $this->customLogger = Log::channel($log_enhancer_channel_name);\n }",
"function __construct()\r\n\t{\r\n\t\tparent::__construct();\r\n\t\t$this->log = Logger::getInstance();\r\n\t}",
"public function __construct()\n {\n $this->log = new Monolog('');\n $this->log->pushProcessor(new PsrLogMessageProcessor);\n\n $config = array_merge([\n 'type' => 'daily',\n 'level' => 'debug',\n 'max_files' => 5,\n 'app_file' => 'app.log',\n 'cli_file' => 'cli.log',\n 'permission' => 0664,\n ], config('logger', []));\n\n $file = storage_path('logs/' . $config[is_console() ? 'cli_file' : 'app_file']);\n $levels = $this->log->getLevels();\n $level = $levels[strtoupper($config['level'])];\n $format = \"[%datetime%] %level_name%: %message% %context%\\n\";\n\n switch ($config['type']) {\n case 'single':\n $this->log->pushHandler(\n $handler = new StreamHandler($file, $level, true, $config['permission'], false)\n );\n\n $handler->setFormatter(new LineFormatter($format, null, true, true));\n break;\n case 'daily':\n $this->log->pushHandler(\n $handler = new RotatingFileHandler($file, $config['max_files'], $level, true, $config['permission'], false)\n );\n $handler->setFormatter(new LineFormatter($format, null, true, true));\n break;\n case 'syslog':\n $this->log->pushHandler(\n new SyslogHandler(config('app.name', 'Pletfix'), LOG_USER, $level)\n );\n break;\n case 'errorlog':\n $this->log->pushHandler(\n $handler = new ErrorLogHandler(ErrorLogHandler::OPERATING_SYSTEM, $level)\n );\n $handler->setFormatter(new LineFormatter($format, null, true, true));\n break;\n default:\n throw new RuntimeException('Invalid log type in configuration \"app.log\".');\n }\n }",
"public function __construct()\n {\n $this->loggerMap = new HashMap('<string, \\Slf4p\\Logger>');\n }",
"public function getLogger()\n {\n $log_name = 'importer';\n $logger = CustomLog::create( $this->getLog(), $log_name );\n return $logger;\n }",
"function createLogger($class);",
"protected function initLogger(): void\n {\n $customPath = $this->context->getConfigurationService()->getLogPath();\n $severity = $this->context->getConfigurationService()->getLogSeverity();\n\n Logger::resetErrors();\n $this->logger = Logger::getInstance(__CLASS__, $customPath, $severity);\n }",
"function __construct() {\r\n\t\tparent::__construct();\r\n\t\t$this->log = Logger::getInstance();\r\n\t}",
"public function create($target, stubLogger $logger);",
"private function __construct()\n {\n $levels = Conf::inst()->get('log.levels');\n $this->levels = $this->levelNames = array();\n foreach ($levels as $key => $name) {\n $this->levels[$name] = $key;\n $this->levelNames[] = $name;\n }\n\n $loggingLevel = Conf::inst()->get('log.level');\n $this->loggingLevel = $this->levels[$loggingLevel];\n $this->file = fopen(__DIR__ . \"/../log/\" . Conf::inst()->get('log.file'), \"a\");\n }"
]
| [
"0.6725202",
"0.6677878",
"0.66238797",
"0.65701526",
"0.6440757",
"0.63790315",
"0.6377418",
"0.63657624",
"0.634811",
"0.6318057",
"0.6272318",
"0.6229693",
"0.62296563",
"0.6209217",
"0.6169278",
"0.6135006",
"0.6131433",
"0.6110913",
"0.61047286",
"0.608962",
"0.6023558",
"0.5962261",
"0.595816",
"0.5953522",
"0.59498674",
"0.5947276",
"0.5944976",
"0.5927638",
"0.592589",
"0.59141904"
]
| 0.7105403 | 0 |
On product save, get the price per month from Santander Save it to the product | public function catalog_product_save_after($observer)
{
$_product = $observer->getProduct();
$specialPrice = null;
if($_product->getTypeId() == 'grouped') {
$arrayPrices = array();
$associatedProducts = $_product->getTypeInstance(true)->getAssociatedProducts($_product);
foreach($associatedProducts as $associatedProduct) {
$arrayPrices[] = round($associatedProduct->getPrice(), 2);
}
asort($arrayPrices);
$price = array_shift($arrayPrices);
} else {
if($_product->getTypeId() == 'bundle') {
//Zend_Debug::dump($_product->getData());exit;
$selectionCollection = $_product->getTypeInstance(true)->getSelectionsCollection(
$_product->getTypeInstance(true)->getOptionsIds($_product), $_product
);
foreach($selectionCollection as $option) {
$bundled_prices[]=$option->getPrice();
}
sort($bundled_prices);
$min_price=$bundled_prices[0];
$price = $min_price;
} else {
$price = $_product->getData('price');
$specialPrice = $_product->getData('special_price');
}
}
if ($specialPrice != null) {
$santanderPriceMonth = Mage::helper('santander')->getPricePerMonth($specialPrice);
} else {
$santanderPriceMonth = Mage::helper('santander')->getPricePerMonth($price);
}
Mage::getSingleton('catalog/product_action')->updateAttributes(array($_product->getEntityId()), array('santanderpricemonth' => "$santanderPriceMonth"), 1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPricePerMonth($_product) {\n $price = $_product->getResource()->getAttribute('santanderpricemonth')->getFrontend()->getValue($_product);\n return Mage::helper('core')->currency(round($price, 2));\n }",
"public function getProductPrice()\n {\n }",
"public function getPriceFromDatabase()\n {\n }",
"function beforeSave(){\n\t\t\t// Get the rate\n\t\t\t$rate = 1 / $this->_getRate();\n\n\t\t\t// Convert it back to USD\n\t\t\tif(!empty($this->data['Product']['rrp'])){\n\t\t\t\t$this->data['Product']['rrp'] = $this->data['Product']['rrp'] * $rate;\n\t\t\t}\n\n\t\t\tif(!empty($this->data['Product']['start_price'])){\n\t\t\t\t$this->data['Product']['start_price'] \t= $this->data['Product']['start_price'] * $rate;\n\t\t\t}\n\n\t\t\tif(!empty($this->data['Product']['delivery_cost'])){\n\t\t\t\t$this->data['Product']['delivery_cost'] = $this->data['Product']['delivery_cost'] * $rate;\n\t\t\t}\n\n\t\t\tif(!empty($this->data['Product']['fixed_price'])){\n\t\t\t\t$this->data['Product']['fixed_price'] \t= $this->data['Product']['fixed_price'] * $rate;\n\t\t\t}\n\n\t\t\tif(!empty($this->data['Product']['minimum_price'])){\n\t\t\t\t$this->data['Product']['minimum_price'] = $this->data['Product']['minimum_price'] * $rate;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}",
"function sale_price() {\n\t\treturn $this->_apptivo_sale_price;\n\t}",
"public function getProductPrice(){\n return $this->product_price;\n }",
"public function showPricePerMonth() {\n $prijsPerMaand = Mage::getStoreConfig('santander/general/prijs_maand');\n if($prijsPerMaand) {\n return true;\n } else {\n return false;\n }\n }",
"public function getPrice() {\n }",
"public function getPrice(){\n }",
"public function getPrice(){\n }",
"public function getPrice();",
"public function getPrice();",
"public function getPrice();",
"public function getPrice();",
"function price( )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n return $this->Price;\n }",
"public function getPrice()\n {\n }",
"public function getPrice()\n {\n }",
"function _golfpass_cal_total_price($order)\n {\n $out_total_price = 0;\n $start_date = $order->start_date;\n $end_date = $order->end_date;\n $obj_start_date = date_create($start_date);\n $obj_end_date = date_create($end_date);\n $period = date_diff($obj_start_date, $obj_end_date)->days;\n $period += 1;\n $num_singleroom = $order->num_singleroom;\n //시작 날자 ~끝날자 * 인 === 총가격 변조 있는지 체크 시작\n $product =$this->db->where(\"id\",$order->product_id)->from(\"products\")->get()->row();\n if(true)\n {\n $config['groups']= $order->groups;\n $config['start_date']= $order->start_date;\n $config['end_date']= $order->end_date;\n $config['product_id']= $order->product_id;\n $config['num_people']= $order->num_people;\n $out_total_price += modules::run(\"golfpass/p_daily_price/_cal_by_group\",$config);\n }\n //옵션가격 추가시작\n foreach($order as $key=>$val)\n {\n $$key= $val;\n }\n \n // 총합계애 옵션가격더하기\n $this->load->model(\"product_option_model\");\n for($i=0; $i < count($options); $i++)\n {\n \n $option =$this->product_option_model->_get($options[$i]);\n $option_name = $option->name;\n\n for($j=0;$j<count($groups);$j++)\n {\n \n $row=$this->db->select(\"*\")\n ->where(\"product_id\",$product_id)\n ->where(\"kind\",\"main_option\")\n ->where(\"name\",$option_name)\n ->where(\"option_1\",$groups[$j])\n ->from(\"product_option\")->get()->row();\n $out_total_price += (int)$row->price*(int)$groups[$j];\n }\n }\n \n \n \n \n \n //홀추가 가격 더하기\n if($hole_option_id !== null && $hole_option_id !== \"\"){\n $this->load->library(\"date\");\n $result =$this->date->number_of_days($start_date,$end_date);\n $num_workingdays= $result->num_workingdays;\n $num_weekenddays= $result->num_weekenddays;\n\n if($num_workingdays === 1)\n {\n $day = \"work_day\";\n }\n else if($num_weekenddays ===1)\n {\n $day =\"week_day\";\n }\n $hole_option_name = $this->product_option_model->_get($hole_option_id)->name;\n for($i=0;$i<count($groups);$i++)\n {\n \n $row=$this->db->select(\"*\")\n ->where(\"product_id\",$product_id)\n ->where(\"kind\",\"hole_option\")\n ->where(\"name\",$hole_option_name)\n ->where(\"option_1\",$groups[$i])\n ->where(\"option_2\",$day)\n ->from(\"product_option\")->get()->row();\n $out_total_price +=(int)$row->price*(int)$groups[$i];\n }\n // $hole_option_price = $this->product_option_model->_get($hole_option_id)->price;\n // $added_hole_price = $hole_option_price * $num_people;\n // $out_total_price += $added_hole_price;\n }\n \n //싱글룸 가격 더하기\n $this->load->model(\"products_model\");\n \n if($num_singleroom !== null && $num_singleroom !== \"\"){\n $singleroom_price = $this->products_model->_get($product_id)->singleroom_price;\n $out_total_price += $singleroom_price * $num_singleroom *($period -1);\n }\n return $out_total_price;\n //옵션가격 추가끝\n\n\n }",
"public function priceToDB(){\n\n return $this->attributes['price'];\n\n }",
"public function getPrice(){ return $this->price_rur; }",
"protected function calculatePrices()\n {\n }",
"public function setBestPrice($product_id) {\n $query = \"SELECT * FROM wp_pwgb_postmeta WHERE post_id=:product_id;\";\n $stm = $this->db->prepare($query);\n $stm->bindValue(\":product_id\", $product_id, PDO::PARAM_INT);\n $stm->execute();\n\n $response = $stm->fetchAll(PDO::FETCH_ASSOC);\n $tag_prices = $this->productPrice();\n $theBest = ['price' => 0];\n $otherPrices = [];\n $hasChanged = false;\n\n // Obtiene el mejor precio anterior\n foreach ($response as $metadata) {\n // Mejor precio\n if (isset($metadata['meta_key']) && $metadata['meta_key'] == 'price_best') {\n $theBest['price'] = $metadata['meta_value'];\n }\n\n // Mejor tienda\n if (isset($metadata['meta_key']) && $metadata['meta_key'] == 'best_shop') {\n $theBest['shop'] = $metadata['meta_value'];\n }\n\n // Obtiene el precio de otras tiendas\n foreach ($tag_prices as $price) {\n if (isset($metadata['meta_key']) && $metadata['meta_key'] == $price) {\n $otherPrices[$price] = (int) $metadata['meta_value'];\n }\n }\n }\n\n $oldPrice = $theBest['price'];\n // Obtiene el nuevo mejor precio\n foreach ($otherPrices as $store => $price) {\n if (($price > 0) && ($price < $theBest['price'])) {\n $theBest['price'] = $price;\n $theBest['shop'] = $store;\n $hasChanged = true;\n }\n }\n\n // Si el mejor precio cambio, lo actualiza y lo guarda en el historial\n if ($hasChanged) {\n $query = \"INSERT INTO dw_historial (product_id, price_old, price_new, created_at) VALUES \n (:product_id, :price_old, :price_new, NOW());\";\n $stm2 = $this->db->prepare($query);\n $stm2->bindValue(\":product_id\", $product_id, PDO::PARAM_INT);\n $stm2->bindValue(\":price_old\", $oldPrice, PDO::PARAM_INT);\n $stm2->bindValue(\":price_new\", $theBest['price'], PDO::PARAM_INT);\n $stm2->execute();\n\n $query = \"UPDATE wp_pwgb_postmeta SET meta_value=:price_new WHERE post_id=:product_id AND meta_key='price_best';\";\n $stm3 = $this->db->prepare($query);\n $stm3->bindValue(\":product_id\", $product_id, PDO::PARAM_INT);\n $stm3->bindValue(\":price_new\", $theBest['price'], PDO::PARAM_INT);\n $stm3->execute();\n\n $query = \"UPDATE wp_pwgb_postmeta SET meta_value=:best_shop WHERE post_id=:product_id AND meta_key='best_shop';\";\n $stm4 = $this->db->prepare($query);\n $stm4->bindValue(\":product_id\", $product_id, PDO::PARAM_INT);\n $stm4->bindValue(\":best_shop\", $theBest['shop'], PDO::PARAM_STR);\n $stm4->execute();\n }\n }",
"public function item_setprice($item)\n {\n if ($item['product_type'] != 2 || $item['product_payment'] != 'prepay') return;\n\n $db = db(config('db'));\n\n if ($_POST)\n {\n $db -> beginTrans();\n\n switch ($item['objtype'])\n {\n case 'room':\n $data = $this -> _format_room_price($item);\n\n // close old price\n $where = \"`supply`='EBK' AND `supplyid`=:sup AND `payment`=3 AND `hotel`=:hotel AND `room`=:room AND `date`>=:start AND `date`<=:end\";\n $condition = array(':sup'=>$item['pid'], ':hotel'=>$item['objpid'], ':room'=>$item['id'], ':start'=>$_POST['start'], ':end'=>$_POST['end']);\n $rs = $db -> prepare(\"UPDATE `ptc_hotel_price_date` SET `close`=1, `price`=0 WHERE {$where}\") -> execute($condition);\n if ($rs === false)\n json_return(null, 6, '保存失败,请重试');\n\n if ($data)\n {\n $data = array_values($data);\n list($column, $sql, $value) = array_values(insert_array($data));\n\n $_columns = update_column(array_keys($data[0]));\n $rs = $db -> prepare(\"INSERT INTO `ptc_hotel_price_date` {$column} VALUES {$sql} ON DUPLICATE KEY UPDATE {$_columns};\") -> execute($value); //var_dump($rs); exit;\n if (false == $rs)\n {\n $db -> rollback();\n json_return(null, 7, '数据保存失败,请重试~');\n }\n }\n break;\n\n case 'auto':\n $data = $this -> _format_auto_price($item);\n\n // close old price\n $where = \"`auto`=:auto AND `date`>=:start AND `date`<=:end\";\n $condition = array(':auto'=>$item['objpid'], ':start'=>$_POST['start'], ':end'=>$_POST['end']);\n $rs = $db -> prepare(\"UPDATE `ptc_auto_price_date` SET `close`=1, `price`=0 WHERE {$where}\") -> execute($condition);\n if ($rs === false)\n json_return(null, 6, '保存失败,请重试');\n\n if ($data)\n {\n $data = array_values($data);\n list($column, $sql, $value) = array_values(insert_array($data));\n\n $_columns = update_column(array_keys($data[0]));\n $rs = $db -> prepare(\"INSERT INTO `ptc_auto_price_date` {$column} VALUES {$sql} ON DUPLICATE KEY UPDATE {$_columns};\") -> execute($value); //var_dump($rs); exit;\n if (false == $rs)\n {\n $db -> rollback();\n json_return(null, 7, '数据保存失败,请重试~');\n }\n }\n break;\n }\n\n if (false === $db -> commit())\n json_return(null, 9, '数据保存失败,请重试~');\n else\n json_return($rs);\n }\n\n $month = !empty($_GET['month']) ? $_GET['month'] : date('Y-m');\n\n $first = strtotime($month.'-1');\n $first_day = date('N', $first);\n\n $start = $first_day == 7 ? $first : $first - $first_day * 86400;\n $end = $start + 41 * 86400;\n\n switch ($item['objtype'])\n {\n case 'room':\n $_date = $db -> prepare(\"SELECT `key`,`date`,`price`,`breakfast`,`allot`,`sold`,`filled`,`standby`,`close` FROM `ptc_hotel_price_date` WHERE `supply`='EBK' AND `supplyid`=:sup AND `hotel`=:hotel AND `room`=:room AND `date`>=:start AND `date`<=:end AND `close`=0\")\n -> execute(array(':sup'=>$item['pid'], ':hotel'=>$item['objpid'], ':room'=>$item['id'], ':start'=>$start, ':end'=>$end));\n break;\n\n case 'auto':\n $_date = $db -> prepare(\"SELECT `key`,`date`,`price`,`child`,`baby`,`allot`,`sold`,`filled`,`close` FROM `ptc_auto_price_date` WHERE `auto`=:auto AND `date`>=:start AND `date`<=:end AND `close`=0\")\n -> execute(array(':auto'=>$item['objpid'], ':start'=>$start, ':end'=>$end));\n break;\n }\n\n $date = array();\n foreach ($_date as $v)\n {\n $date[$v['date']] = $v;\n }\n unset($_date);\n\n include dirname(__FILE__).'/product/price_'.$item['objtype'].'.tpl.php';\n }",
"public function getPrice(): float;",
"public function getPrice(): float;",
"function getPrice()\n {\n return $this->price;\n }",
"public function getPrice(){\n return $this->price;\n }",
"public function getTotalPrice();",
"public function getTotalPrice();",
"public function getPrice(): string;"
]
| [
"0.66352427",
"0.6537122",
"0.63441813",
"0.62578744",
"0.61653537",
"0.61513275",
"0.61263067",
"0.61189",
"0.61001194",
"0.61001194",
"0.60990727",
"0.60990727",
"0.60990727",
"0.60990727",
"0.6059889",
"0.6012245",
"0.6012245",
"0.5985092",
"0.5951702",
"0.59435594",
"0.5906186",
"0.5857442",
"0.5834353",
"0.5829556",
"0.5829556",
"0.58216083",
"0.5815575",
"0.5812328",
"0.5812328",
"0.57958674"
]
| 0.68812454 | 0 |
Set sufix used for mark currently processing file | public function setSufix( $sufix )
{
$this->sufix = $sufix;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function setMark() {\n echo $this->promptMessage('choose_mark');\n $mark = $this->limitInput(array(self::X_MARK, self::O_MARK, self::QUIT_BUTTON));\n switch ($mark) {\n case self::X_MARK:\n $this->_userMark = self::X_MARK;\n $this->_botMark = self::O_MARK;\n break;\n case self::O_MARK:\n $this->_userMark = self::O_MARK;\n $this->_botMark = self::X_MARK;\n break;\n case self::QUIT_BUTTON:\n $this->quit();\n }\n echo \"You will be Player \" . $this->_userMark . \".\" . PHP_EOL;\n echo $this->promptMessage('start_game') . PHP_EOL;\n }",
"public function setIdentifier(){\n\n \t$this->fileIdentifier = $this->getIdentifier();\n }",
"public function setAsProcessTag()\r\n\t{\r\n\t\t$this->process_tag = TRUE;\r\n\t}",
"public function setPrefix() {\n\t}",
"public function markClean();",
"public static function setProcessPrefix($prefix)\n\t{\n\t\tself::$processPrefix = $prefix;\n\t}",
"public function setFilePrefix($pfx){\n $this->cfg_fileprefix=$pfx;\n return $this;\n }",
"public function setMarkerWithPrefix() {\n\t\t$this->subject->processTemplate(\n\t\t\t'This is some template code. '\n\t\t\t\t.'###FIRST_MARKER### ###MARKER### More text.'\n\t\t);\n\t\t$this->subject->setMarker('marker', 'foo', 'first');\n\t\t$this->assertSame(\n\t\t\t'This is some template code. foo ###MARKER### More text.',\n\t\t\t$this->subject->getSubpart()\n\t\t);\n\t}",
"function setPrefixSymbol( $value )\r\n {\r\n if ( $value == true )\r\n {\r\n $this->PositivePrefixCurrencySymbol = \"yes\";\r\n $this->NegativePrefixCurrencySymbol = \"yes\";\r\n }\r\n else\r\n {\r\n $this->PositivePrefixCurrencySymbol = \"no\";\r\n $this->NegativePrefixCurrencySymbol = \"no\";\r\n }\r\n }",
"public function setExcelFile($_setFile) {\n\t\t$this->_excelFileName = $_setFile;\n\t}",
"function setPrefixSign( $value )\r\n {\r\n if ( $value == true ) \r\n $this->PrefixSign = 1;\r\n else\r\n $this->PrefixSign = 0;\r\n }",
"public function reset_pos() {\n\t\tFile::save( $this->_resetfile, time() , true );\n\n\t\t$this->_summary[ 'is_running' ] = 0;\n\t\tself::save_summary();\n\t}",
"public function setMarkIdentification($value) {\n\t\tself::$_markIdentification = $value;\n\t}",
"public function markAsProcessed() {\r\n // Mark all nominees with this name in this bracket as processed\r\n $this->processed = true;\r\n $params = [\r\n 'nomineeId' => $this->id,\r\n 'name' => $this->name,\r\n 'bracketId' => $this->bracketId\r\n ];\r\n $query = 'UPDATE `nominee` SET nominee_processed = 1 WHERE nominee_id = :nomineeId OR (nominee_name LIKE :name AND bracket_id = :bracketId AND nominee_source ';\r\n $bracket = Bracket::getById($this->bracketId);\r\n if ($bracket->hasSourceLabel()) {\r\n $query .= 'LIKE :source';\r\n $params['source'] = $this->source;\r\n } else {\r\n $query .= 'IS NULL';\r\n }\r\n return Lib\\Db::Query($query . ')', $params);\r\n }",
"function setTokenUsePickupFile($value)\n {\n $this->_props['TokenUsePickupFile'] = $value;\n }",
"function resetImp(&$fp) {\n\n fwrite($fp, chr(27).\"@\");\n }",
"protected function setPrefix()\n {\n if (array_key_exists('prefix', $this->config)) {\n $this->prefix = $this->config['prefix'];\n }\n }",
"public function markSpam()\n {\n $this->IsSpam = true;\n $this->Moderated = true;\n $this->write();\n $this->extend('afterMarkSpam');\n }",
"public function setSuffix() {\n\t}",
"function procesSetFixed()\t{\n\t\tif ($this->conf['setfixed'])\t{\n\t\t\t$theUid = intval($this->recUid);\n\t\t\t$origArr = $GLOBALS['TSFE']->sys_page->getRawRecord($this->theTable, $theUid);\n\t\t\tif ($this->conf['evalFunc'])\t{\n\t\t\t\t$origArr = $this->userProcess('evalFunc',$origArr);\n\t\t\t}\n\t\t\t$fD = t3lib_div::_GP('fD');\n\t\t\t$sFK = t3lib_div::_GP('sFK');\n\t\t\t$fieldArr=array();\n\n\t\t\tif (is_array($fD) || $sFK=='DELETE')\t{\n\t\t\t\tif (is_array($fD))\t{\n\t\t\t\t\t$theCode = $this->setfixedHash($origArr,$fD['_FIELDLIST']);\n\n\t\t\t\t\treset($fD);\n\t\t\t\t\twhile(list($field,$value)=each($fD))\t{\n\t\t\t\t\t\t//@todo we have two arrays : one before update and one after update (before is used to calculate hash, after should be transferred to mails)\n\t\t\t\t\t\t$origArr[$field]=$value;\n\t\t\t\t\t\t$fieldArr[]=$field;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$theCode = $this->setfixedHash($origArr,array());\n\t\t\t\t}\n\t\t\t\tif (!strcmp($this->authCode,$theCode))\t{\n\t\t\t\t\tif ($sFK=='DELETE')\t{\n\t\t\t\t\t\t$this->cObj->DBgetDelete($this->theTable, $theUid, TRUE);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$newFieldList = implode(',',array_intersect(t3lib_div::trimExplode(',',$this->conf['fieldList']),t3lib_div::trimExplode(',',implode($fieldArr,','),1)));\n\t\t\t\t\t\t$this->cObj->DBgetUpdate($this->theTable, $theUid, $fD, $newFieldList, TRUE);\n\t\t\t\t\t\t$this->currentArr = $GLOBALS['TSFE']->sys_page->getRawRecord($this->theTable,$theUid);\n\t\t\t\t\t\t$this->userProcess_alt($this->conf['setfixed.']['userFunc_afterSave'],$this->conf['setfixed.']['userFunc_afterSave.'],array('rec'=>$this->currentArr, 'origRec'=>$origArr));\n\t\t\t\t\t}\n\n\t\t\t\t\t// Outputting template\n\n\t\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_SETFIXED_OK_'.$sFK.'###',$origArr);\n\t\t\t\t\tif (!$content)\t{$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_SETFIXED_OK###',$origArr);}\n\n\t\t\t\t\t// Compiling email\n\n\t\t\t\t\t$this->compileMail(\n\t\t\t\t\t\t'SETFIXED_'.$sFK,\n\t\t\t\t\t\tarray($origArr),\n\t\t\t\t\t\t$this->getFeuserMail($origArr,$this->conf),\n\t\t\t\t\t\t$this->conf['setfixed.']\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t// Clearing cache if set:\n\t\t\t\t\t$this->clearCacheIfSet(); \n\t\t\t\t\t\n\t\t\t\t} else $content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_SETFIXED_FAILED###',$origArr);\n\t\t\t} else $content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_SETFIXED_FAILED###',$origArr);\n\t\t}\n\t\treturn $content;\n\t}",
"function tsml_fix_highlight($parent_file)\n {\n global $submenu_file, $current_screen, $pagenow;\n if ($current_screen->post_type == 'tsml_location') {\n if ($pagenow == 'edit-tags.php') {\n $submenu_file = 'edit-tags.php?taxonomy=tsml_region&post_type=tsml_location';\n }\n $parent_file = 'edit.php?post_type=tsml_meeting';\n } elseif ($current_screen->post_type == 'tsml_group') {\n if ($pagenow == 'edit-tags.php') {\n $submenu_file = 'edit-tags.php?taxonomy=tsml_district&post_type=tsml_group';\n }\n $parent_file = 'edit.php?post_type=tsml_meeting';\n }\n return $parent_file;\n }",
"public function setPrefixSymbol(bool $prefixSymbol)\n\t{\n\t\t$this->prefixSymbol=$prefixSymbol; \n\t\t$this->keyModified['prefix_symbol'] = 1; \n\n\t}",
"public static function setFilePrefix($filePrefix) {}",
"public function setEmphasis(bool $on = true)\n {\n self::validateBoolean($on, __FUNCTION__);\n $this -> connector -> write(self::ESC . \"E\". ($on ? chr(1) : chr(0)));\n }",
"private function fixShortTags($filePath)\n {\n $code = file_get_contents($filePath);\n $result = $this->processCode($code);\n file_put_contents($filePath, $result);\n }",
"public function setTargetPrefix(?string $value): void {\n $this->getBackingStore()->set('targetPrefix', $value);\n }",
"function SetSiteUTF() {\n $this->site_win = false;\n }",
"function mark_opened( $user, $project, $path )\n {\n //Unimplemented\n }",
"public function reset()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $postfix = new Postfix();\n $postfix->reset(TRUE);\n }",
"private function setName(string $mask): void {\n $name = str_replace('*', '_any_', $mask);\n $name = str_replace('|', '_or_', $name);\n $this->name = preg_replace('/[^a-z0-9_]/i', '_', $name);\n }"
]
| [
"0.48063383",
"0.47901443",
"0.47834876",
"0.4780373",
"0.468347",
"0.46511164",
"0.46455482",
"0.4643338",
"0.4589397",
"0.45890495",
"0.45741677",
"0.45669994",
"0.45589533",
"0.45363545",
"0.45350215",
"0.4523277",
"0.44977286",
"0.44744062",
"0.4467464",
"0.44669905",
"0.44547603",
"0.44541007",
"0.44353592",
"0.4433128",
"0.44010824",
"0.4393091",
"0.43907252",
"0.43898523",
"0.4381912",
"0.43714288"
]
| 0.6070946 | 0 |
Get parsed array and optionally flush Parser | public function get( $flush = true )
{
if( !( $this->raw instanceof SimpleXMLElement) ) {
$this->parse();
}
$parsed = $this->xmlToArray( $this->raw );
if( $flush ) {
$this->flush();
}
return $parsed;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function ParseFromArray() {\n $this->value = $this->reader->next();\n $this->clean();\n }",
"public function parseFromArray()\n {\n $this->value = $this->reader->next();\n }",
"public function process(ParserInterface $parser, string $file, array $data): array;",
"public function read(): array;",
"public function parse()\n {\n if (isset($this->schema->cmd)) {\n foreach ($this->schema->cmd as $key => $val) {\n if ($key === \"addNamespaces\") {\n $this->registerNamespaces($val);\n } elseif ($key === \"removeEmptyValues\") {\n $this->removeEmptyValues = $val ? true : false;\n } elseif ($key === \"sortResult\") {\n $this->sort = $val ? true : false;\n }\n }\n }\n\n $array = $this->parseRecursive($this->schema);\n\n if ($this->sort) {\n ksort($array);\n }\n\n return $array;\n }",
"public function parse() {\n\t\t$pointer = 0;\n\t\t$ar_line = array();\n\n\t\tforeach ($this->structure as $key => $length) {\n\t\t\t$ar_line[$key] = trim(substr($this->line, $pointer, $length), \"\\n\\r \");\n\t\t\t$pointer += $length;\n\t\t}\n\t\t$ar_line['stamp'] = md5(serialize($ar_line));\n\n\t\tif ($this->return == 'array') {\n\t\t\treturn $ar_line;\n\t\t}\n\t\treturn (object) $ar_line;\n\t}",
"public function parse()\n\t{\n\t\t//we don't need to hit the API everytime parse is called\n\t\tif (!$this->response)\n\t\t\t$this->response = $this->request->execute();\n\t\t\n\t\treturn $this->invokeParserMethod();\t\n\t}",
"protected function initParsers() {\n return array();\n }",
"public function read(): array\n {\n }",
"public function read(): array\n {\n }",
"private function __parse_intput() {\n $requests = JsonParser::decode($this->__raw_input);\n if (is_array($requests) === false or\n empty($requests[0])) {\n $requests = array($requests);\n }\n return ($requests);\n }",
"private function parse()\n {\n $lines = file($this->filename);\n\n // skip get worker info\n $offset = 0;\n while (isset($lines[$offset])) {\n $line = $lines[$offset];\n\n if (preg_match('/(?:\\[0m\\t)(\\[.*\\])\\s*({.*})(?:[\\r\\n]*)$/', $line, $matches)) {\n $ctx = json_decode($matches[2], true);\n if (isset($ctx['receive'])) {\n $this->in[] = [$matches[1], $matches[2]];\n $offset++;\n continue;\n }\n\n $this->out[] = [$matches[1], $matches[2]];\n }\n\n $offset++;\n }\n }",
"function process() {\n return $this->_parse();\n }",
"private function parse()\r\n\t{\r\n\t\t// Suppress annoying notices/warnings\r\n\t\tset_error_handler(function() { /* Nothing */ }, E_NOTICE|E_WARNING);\r\n\r\n\t\t$structure = mailparse_msg_get_structure($this->resource);\r\n\t\t$this->parts = array();\r\n\t\tforeach ($structure as $part_id) {\r\n\t\t\t$part = mailparse_msg_get_part($this->resource, $part_id);\r\n\t\t\t$this->parts[$part_id] = mailparse_msg_get_part_data($part);\r\n\t\t}\r\n\r\n\t\trestore_error_handler();\r\n\t}",
"public function getParsedInput();",
"protected function _getParser() {}",
"public function getParser() {}",
"public function getParser() {}",
"public function getParser() {}",
"function fetchArray($offset = 0, $limit = null, $options = array()) \n {\n $this->_enterSection('fetchArray');\n if (!isset ($this->_unserializer) \n or $options != $this->_unserializerOptions) {\n include_once ('XML/Unserializer.php');\n $this->_unserializer =& new XML_Unserializer ($options);\n $this->_unserializerOptions = $options;\n }\n $strings = $this->fetchStrings ($offset, $limit);\n $reconstructed = '<root>' . join ('', $strings) . '</root>';\n $status = $this->_unserializer->unserialize($reconstructed);\n if (PEAR::isError ($status)) {\n $this->_leaveSection('fetchArray');\n return $status;\n }\n $this->_leaveSection('fetchArray');\n return $this->_unserializer->getUnserializedData();\n }",
"protected function tryParseCommands()\n {\n $result = [];\n\n for($dataLen = strlen($this->buffer); $dataLen >= 4;) {\n // reading length of received command\n $commandLenBytes = substr($this->buffer, 0, 4);\n $commandLen = intval(bin2hex($commandLenBytes), 16);\n if($dataLen < $commandLen+4) {\n // waiting more bytes to parse\n break;\n }\n $commandBytes = gzuncompress(substr($this->buffer, 4, $commandLen));\n $command = json_decode($commandBytes, true);\n $result[] = $command;\n // cut parsed bytes from buffer\n $this->buffer = substr($this->buffer, $commandLen + 4);\n $dataLen = strlen($this->buffer);\n }\n\n return $result;\n }",
"public function getProcessedData(): object|array;",
"function parse() {\n while (true) {\n $object = $this->readObject();\n\n if (!$object) {\n break;\n }\n\n if (!$object->ischild) {\n $this->objects[] = $object;\n }\n }\n\n return $this->objects;\n }",
"public function parse($text, $parser = 'markdown', $options = array()) {\n\t\t$parsed = array($text);\n\t\ttry {\n\t\t\tApp::uses('ParserRegistry', 'MarkupParsers.Lib');\n\t\t\t$parsed = ParserRegistry::getParser($parser)->parse($text, $options);\n\t\t\tif (!is_array($parsed)) {\n\t\t\t\t$parsed = array($parsed);\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\tif (Configure::read('debug') > 0) {\n\t\t\t\tthrow $e;\n\t\t\t} else {\n\t\t\t\t$this->log($e->getMessage());\n\t\t\t}\n\t\t}\n\t\treturn $parsed;\n\t}",
"public function read(): array\n {\n // TODO should use VOs instead of strings\n return array_map(fn (string $html): array => $this->parser->parse($html), $this->downloader->readHtml());\n }",
"public function parse(): array\n {\n $this->parseElement();\n $this->parseChildNodes();\n\n return ['dir' => $this->dir,\n 'includes' => $this->includes,\n 'excludes' => $this->excludes];\n }",
"abstract public function getArray();",
"public function parse();",
"public function parse();",
"public function parse();"
]
| [
"0.6176869",
"0.592641",
"0.56980675",
"0.5595993",
"0.54629993",
"0.5461007",
"0.5388107",
"0.5381062",
"0.5378626",
"0.5378626",
"0.5343772",
"0.5309085",
"0.52755547",
"0.5221764",
"0.5202454",
"0.51945347",
"0.5184988",
"0.5184988",
"0.51838416",
"0.51657915",
"0.5157696",
"0.51576644",
"0.5129873",
"0.51044095",
"0.50898075",
"0.50678706",
"0.50610155",
"0.50600064",
"0.50600064",
"0.50600064"
]
| 0.61473155 | 1 |
Load file content or get it from zip | private function loadFile()
{
if( empty($this->content) ) {
if( empty($this->file) ) {
throw new Exception('Which file should I parse, you ...!');
} else {
if( strtolower( $this->file->getExtension() ) == 'zip' ) {
$this->content = $this->handleZipFile( $this->file );
} else {
$this->content = $this->file->getContents();
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function data($name) {\n\t\tswitch ($name) {\n\t\t\t//START_OF_DATA\n\t\t\tcase 'index': return '';\n\t\t\tcase 'system/languages/languages.json': return file_get_contents('system/languages/languages.json');\n\t\t\t//END_OF_DATA\n\t\t}\n\t\tif ($zip) return gzdecode(base64_decode($zip));\n\t}",
"public function loadContents() {}",
"public function loadContents() {}",
"public function loadContents() {}",
"public function loadContents() {}",
"function gz_file_get_contents($file)\r\n{\r\n $data = null;\r\n \r\n $zip = gzopen(\"$file.gz\", 'rb');\r\n if( $zip === false )\r\n $zip = gzopen($file, 'rb');\r\n \r\n if( $zip !== false )\r\n {\r\n $data = gzread($zip, 10000000);\r\n gzclose($zip);\r\n }\r\n else \r\n $data = false;\r\n \r\n return $data;\r\n}",
"public function load()\n\t\t{\n\t\t\tif ($this->exists()) {\n\t\t\t\t$this->content = self::read($this->get_path());\n\t\t\t\t$this->is_cached = true;\n\t\t\t\treturn $this;\n\t\t\t} else throw new \\System\\Error\\File('Cannot read file. It does not exists on the filesystem.');\n\t\t}",
"public function get_content() {\n // Check if no content is yet loaded\n if (empty($this->content)) {\n $this->content = @file_get_contents($this->name);\n }\n\n return $this->content;\n }",
"abstract public function getContent($file);",
"protected function getFileContents() {\n $path = $this->getFilePath();\n return file_get_contents($path);\n }",
"public function load() {\n if ($this->cat === \"url\" && !file_exists($this->sourcepath)) Path::download($this->originalName, $this->sourcepath);\n }",
"function GetFromCache()\n {\n return File::GetContents($this->file);\n }",
"protected function getContentFromCacheFile() {}",
"protected function load ( $file = '' ) {\n\n if(file_exists($this->resourcePath . $file . '.gz.php'))\n return unserialize(gzuncompress(file_get_contents(\n $this->resourcePath . $file . '.gz.php'\n )));\n else\n throw new Hoa_Locale_Exception(\n 'File %s.gz.php is not found in %s directory.',\n 0, array($file, $this->resourcePath));\n }",
"function loadContents() ;",
"function loadFileData() {\n if (isset($this->params['file_id'])) {\n if (isset($this->params['version_id']) && $this->params['version_id'] > 0) {\n $this->currentFile = $this->getFile($this->params['file_id'], $this->params['version_id']);\n } else {\n $this->currentFile = $this->getFile($this->params['file_id']);\n }\n $fileData = $this->getFileTrans(\n $this->params['file_id'], $this->lngSelect->currentLanguageId\n );\n if (isset($fileData[$this->params['file_id']])) {\n $this->currentFileData = $fileData[$this->params['file_id']];\n } else {\n unset($this->currentFileData);\n }\n }\n }",
"protected function loadFile($resource)\n {\n return file_get_contents($resource);\n }",
"public function load($file);",
"public function load($file);",
"public function load($file);",
"public function read_file() {\t\t\r\n\t\t$file = $this->filepath;\r\n\t\t\r\n\t\tif(file_exists($file)) {\r\n\t\t\t$this->_content = file_get_contents($file);\t\r\n\t\t} \r\n\t}",
"private function loadContent() {\n\t\t$expression =\n\t\t\t'/sunflower-'. // match only right files\n\t\t\t'(\\d+\\.\\d+\\w?)[\\.-](\\d+)'. // version\n\t\t\t'(?:-(\\d)+)?'. // package build number\n\t\t\t'(?:[\\.-](all|any|noarch|i386|amd64))?(?:\\.([\\w\\d]+))?'. // architecture and os\n\t\t\t'(\\.[\\w\\d\\.]+)/iu'; // extension\n\n\t\t// get files from directory\n\t\t$data = array();\n\t\t$files = scandir($this->file_path);\n\t\tforeach ($files as $file_name) {\n\t\t\t$matched = preg_match($expression, $file_name, $matches) == 1;\n\n\t\t\tif ($matched) {\n\t\t\t\t$build = $matches[2];\n\n\t\t\t\t// create storage array for build number\n\t\t\t\tif (!isset($data[$build]))\n\t\t\t\t\t$data[$build] = array();\n\n\t\t\t\t// treat different extensions differently\n\t\t\t\tswitch($matches[6]) {\n\t\t\t\t\tcase '.tgz.sig':\n\t\t\t\t\tcase '.deb.sig':\n\t\t\t\t\tcase '.rpm.sig':\n\t\t\t\t\t\t$key_name = substr($file_name, 0, strlen($file_name) - 4);\n\n\t\t\t\t\t\t// make sure storage array exists\n\t\t\t\t\t\tif (!isset($data[$build][$key_name]))\n\t\t\t\t\t\t\t$data[$build][$key_name] = array();\n\n\t\t\t\t\t\t// store signature to file name\n\t\t\t\t\t\t$data[$build][$key_name]['signature'] = url_GetFromFilePath($this->file_path.'/'.$file_name);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '.tgz.sha256':\n\t\t\t\t\tcase '.deb.sha256':\n\t\t\t\t\tcase '.rpm.sha256':\n\t\t\t\t\t\t$key_name = substr($file_name, 0, strlen($file_name) - 7);\n\n\t\t\t\t\t\t// make sure storage array exists\n\t\t\t\t\t\tif (!isset($data[$build][$key_name]))\n\t\t\t\t\t\t\t$data[$build][$key_name] = array();\n\n\t\t\t\t\t\t// store signature to file name\n\t\t\t\t\t\t$data[$build][$key_name]['hash'] = file_get_contents($this->file_path.'/'.$file_name);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// make sure storage array exists\n\t\t\t\t\t\tif (!isset($data[$build][$file_name]))\n\t\t\t\t\t\t\t$data[$build][$file_name] = array();\n\n\t\t\t\t\t\t// get storage array for easier access\n\t\t\t\t\t\t$file_data = $data[$build][$file_name];\n\n\t\t\t\t\t\t// populate parameters\n\t\t\t\t\t\t$file_data['url'] = url_GetFromFilePath($this->file_path.'/'.$file_name);\n\t\t\t\t\t\t$file_data['version'] = $matches[1];\n\t\t\t\t\t\t$file_data['build'] = $matches[2];\n\t\t\t\t\t\t$file_data['package_build'] = $matches[3];\n\t\t\t\t\t\t$file_data['architecture'] = $matches[4];\n\t\t\t\t\t\t$file_data['platform'] = $matches[5];\n\t\t\t\t\t\t$file_data['extension'] = $matches[6];\n\n\t\t\t\t\t\t// store data array back to main array\n\t\t\t\t\t\t$data[$build][$file_name] = $file_data;\n\n\t\t\t\t\t\t// store version to reference list\n\t\t\t\t\t\t$this->version_list[$build] = $matches[1];\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// sort version list\n\t\tkrsort($this->version_list);\n\n\t\t// store parsed data\n\t\t$this->file_list = $data;\n\t}",
"public function getContent() {\n\t\treturn $this->storage->file_get_contents($this->path);\n\t}",
"public function getContents($file);",
"public function contents() {\n\t\treturn file_get_contents($this->path);\n\t}",
"abstract public function load($filename);",
"public static function get($_path)\r\n {\r\n if($this->isFile($_path))\r\n {\r\n return file_get_contents($_path);\r\n }\r\n }",
"function getFileContent($file_name, $lang) {\n\t// stores the file's content\n\t$file_content = \"\";\n\n\t// build path to the data folder, where the .txt files are located\n\t$data_path = dirname(dirname(__FILE__)).\"/data/\";\n\n\t// check if the file is language independent\n\tif (file_exists($data_path.$file_name.\".txt\")) {\n\t\t// it is\n\t\t// get the requested file's content\n\t\t$file_content = file_get_contents($data_path.$file_name.\".txt\");\n\t// check if the file is language dependent\n\t}else if (file_exists($data_path.$lang.\"/\".$file_name.\".txt\")) {\n\t\t// it is\n\t\t// get the requested file's content\n\t\t$file_content = file_get_contents($data_path.$lang.\"/\".$file_name.\".txt\");\n\t}\n\n\t// check if the file_get_contents() returned a failure\n\tif ($file_content === False) {\n\t\t// it did\n\t\t// the content couldn't be retrieved, so set this file's content to an empty string\n\t\t$file_content = \"\";\n\t}\n\n\t// return this file's content\n\treturn($file_content);\n}",
"public function getFileContent()\n {\n return $this->extractFileAsText();\n }",
"private function load_demo_content_from_file(): string {\n\t\t$file = WEBSTORIES_PLUGIN_DIR_PATH . 'includes/data/stories/demo.json';\n\n\t\tif ( ! is_readable( $file ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$content = file_get_contents( $file ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents, WordPressVIPMinimum.Performance.FetchingRemoteData.FileGetContentsUnknown\n\n\t\tif ( ! $content ) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn $content;\n\t}"
]
| [
"0.6307528",
"0.626032",
"0.6258277",
"0.62582564",
"0.62582564",
"0.60826933",
"0.60725605",
"0.593588",
"0.5915253",
"0.58957523",
"0.5861503",
"0.5842179",
"0.5829875",
"0.582656",
"0.582032",
"0.5808075",
"0.57994473",
"0.5773807",
"0.5773807",
"0.5773807",
"0.5770246",
"0.5765809",
"0.57258326",
"0.5716617",
"0.5709655",
"0.5703761",
"0.56761324",
"0.56715095",
"0.56654084",
"0.5649622"
]
| 0.6781278 | 0 |
Resolves the given stack of override dependencies, by creating the required override files and automatically including them from their temporary sources. The result is the definition for the TYPO3 ClassAliasMap | public function resolve(array $stack): array
{
$this->eventBus->dispatch(
($e = new ClassOverrideStackFilterEvent($stack))
);
$stack = $e->getStack();
$cacheKey = md5(SerializerUtil::serializeJson($stack) . '-' . $this->isTestMode);
if (isset($this->resolvedAliasMap[$cacheKey])) {
return $this->resolvedAliasMap[$cacheKey];
}
reset($stack);
$initialClassName = key($stack);
$finalClassName = end($stack);
$this->includeList = [];
foreach ($stack as $classToOverride => $classToOverrideWith) {
$this->resolveStackEntry((string)$initialClassName, (string)$finalClassName, $classToOverride, $classToOverrideWith);
}
foreach ($this->includeList as $aliasFilename) {
$this->fsMount->includeFile($aliasFilename);
}
$this->includeList = [];
return $this->resolvedAliasMap[$cacheKey] = [$finalClassName => $initialClassName];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function resolveStackEntry(\n string $initialClassName,\n string $finalClassName,\n string $classToOverride,\n string $classToOverrideWith\n ): void\n {\n $basename = Inflector::toFile($classToOverride);\n $cloneFilename = $basename . '-clone.php';\n $aliasFilename = $basename . '.php';\n $this->includeList[] = $cloneFilename;\n $this->includeList[] = $aliasFilename;\n \n if (! $this->fsMount->hasFile($aliasFilename) || ! $this->fsMount->hasFile($cloneFilename)) {\n $namespace = Path::classNamespace($classToOverride);\n $copyClassName = 'T3BaCopy' . Path::classBasename($classToOverride);\n $copyClassFullName = ltrim($namespace . '\\\\' . $copyClassName, '\\\\');\n \n $codeGenerator = $this->getCodeGenerator();\n $cloneContent = $codeGenerator->getClassCloneContentOf(\n $classToOverride, $copyClassName);\n $aliasContent = $codeGenerator->getClassAliasContent(\n $classToOverride, $classToOverrideWith, $finalClassName, $copyClassFullName);\n \n $e = new ClassOverrideContentFilterEvent(\n $classToOverride,\n $copyClassName,\n $initialClassName,\n $finalClassName,\n $cloneContent,\n $aliasContent\n );\n $this->eventBus->dispatch($e);\n $cloneContent = $e->getCloneContent();\n $aliasContent = $e->getAliasContent();\n \n $this->fsMount->setFileContent($cloneFilename, $cloneContent);\n $this->fsMount->setFileContent($aliasFilename, $aliasContent);\n }\n }",
"function qa_load_override_files()\n{\n\tglobal $qa_override_files, $qa_override_files_temp, $qa_overrides;\n\n\t$functionindex = array();\n\n\tforeach ($qa_override_files_temp as $override) {\n\t\t$qa_override_files[] = $override;\n\t\t$filename = $override['directory'] . $override['include'];\n\t\t$functionsphp = file_get_contents($filename);\n\n\t\tpreg_match_all('/\\Wfunction\\s+(qa_[a-z_]+)\\s*\\(/im', $functionsphp, $rawmatches, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);\n\n\t\t$reversematches = array_reverse($rawmatches[1], true); // reverse so offsets remain correct as we step through\n\t\t$postreplace = array();\n\t\t// include file name in defined function names to make debugging easier if there is an error\n\t\t$suffix = '_in_' . preg_replace('/[^A-Za-z0-9_]+/', '_', basename($override['include']));\n\n\t\tforeach ($reversematches as $rawmatch) {\n\t\t\t$function = strtolower($rawmatch[0]);\n\t\t\t$position = $rawmatch[1];\n\n\t\t\tif (isset($qa_overrides[$function]))\n\t\t\t\t$postreplace[$function . '_base'] = $qa_overrides[$function];\n\n\t\t\t$newname = $function . '_override_' . (@++$functionindex[$function]) . $suffix;\n\t\t\t$functionsphp = substr_replace($functionsphp, $newname, $position, strlen($function));\n\t\t\t$qa_overrides[$function] = $newname;\n\t\t}\n\n\t\tforeach ($postreplace as $oldname => $newname) {\n\t\t\tif (preg_match_all('/\\W(' . preg_quote($oldname) . ')\\s*\\(/im', $functionsphp, $matches, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE)) {\n\t\t\t\t$searchmatches = array_reverse($matches[1]);\n\t\t\t\tforeach ($searchmatches as $searchmatch) {\n\t\t\t\t\t$functionsphp = substr_replace($functionsphp, $newname, $searchmatch[1], strlen($searchmatch[0]));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// echo '<pre style=\"text-align:left;\">'.htmlspecialchars($functionsphp).'</pre>'; // to debug munged code\n\n\t\tqa_eval_from_file($functionsphp, $filename);\n\t}\n\n\t$qa_override_files_temp = array();\n}",
"protected function resolvePackageDependencies() {}",
"public function buildClassAliasMapFile() {}",
"function mdl_resolve_base_class_implementations($extends, $blueprint_definitions, &$interfaces)\n{\n $result = mdl_find_namespace_component($blueprint_definitions, $extends);\n if (isset($result['implements'])) {\n $interfaces = array_merge($result['implements'] ?? [], $interfaces ?? []);\n }\n if (isset($result['extends'])) {\n mdl_resolve_base_class_implementations($result['extends'], $blueprint_definitions, $interfaces);\n }\n}",
"protected function setupClassAliases()\n {\n $aliases = [\n 'admin.router' => \\Encore\\Admin\\Routing\\Router::class,\n ];\n\n foreach ($aliases as $key => $alias) {\n $this->app->alias($key, $alias);\n }\n }",
"abstract function resolve($class);",
"private function packResolvers()\n {\n $this->builder->putVehicle($this->builder->createVehicle('xPDOScriptVehicle', [\n 'vehicle_class' => 'xPDOScriptVehicle',\n 'object' => ['source' => __DIR__ . '/resolvers/tables.php']\n ]));\n\n $this->builder->putVehicle($this->builder->createVehicle('xPDOScriptVehicle', [\n 'vehicle_class' => 'xPDOScriptVehicle',\n 'object' => ['source' => __DIR__ . '/resolvers/sources.php']\n ]));\n\n $this->builder->putVehicle($this->builder->createVehicle('xPDOScriptVehicle', [\n 'vehicle_class' => 'xPDOScriptVehicle',\n 'object' => ['source' => __DIR__ . '/resolvers/updater.php']\n ]));\n }",
"public function updateClassAliasesDataProvider()\n {\n return [\n 'plain text replace model' => include __DIR__ . '/_files/data_content_plain_model.php',\n 'plain text replace resource' => include __DIR__ . '/_files/data_content_plain_resource.php',\n 'plain text replace with pk field' => include __DIR__ . '/_files/data_content_plain_pk_fields.php',\n 'xml replace' => include __DIR__ . '/_files/data_content_xml.php',\n 'wiki markup replace' => include __DIR__ . '/_files/data_content_wiki.php',\n 'serialized php replace' => include __DIR__ . '/_files/data_content_serialized.php'\n ];\n }",
"protected function getImportsReplace()\n {\n\n // build up import lines\n $importLines = [\n config('pxlcms.generator.repositories.extend_class')\n ];\n\n // model classname\n $importLines[] = $this->context->makeFqnForModelName( studly_case($this->data->name) );;\n\n\n\n // set them in the right order\n if (config('pxlcms.generator.aesthetics.sort_imports_by_string_length')) {\n\n // sort from shortest to longest\n usort($importLines, function ($a, $b) {\n return strlen($a) - strlen($b);\n });\n\n } else {\n sort($importLines);\n }\n\n\n // build the actual replacement string\n $replace = \"\\n\";\n\n foreach ($importLines as $line) {\n $replace .= \"use \" . $line . \";\\n\";\n }\n\n $replace .= \"\\n\";\n\n return $replace;\n }",
"protected function resolve()\n {\n// $callStack = new CallStack;\n\n $executePattern = $this->route->getProperty('execute');\n\n /** @var ExecuteHandler[] $handlers */\n $handlers = array();\n\n $middlewares = array();\n\n $decorators = array();\n\n foreach ($this->route->getFullRoutes() as $route) {\n $group = $route->getGroup();\n\n foreach ($group->factory->getExecuteHandlers() as $handler)\n $handlers[get_class($handler)] = $handler;\n\n // stack all the handlers\n foreach ($group->getExecuteHandlers() as $name => $handler)\n $handlers[$name] = $handler;\n\n foreach ($group->getMiddlewares() as $middleware)\n $middlewares[] = new Call($this->resolveMiddleware($middleware[0]), $middleware[1]);\n// $callStack->addCallable($this->resolveMiddleware($middleware[0]), $middleware[1]);\n\n // append all route middlewares\n// foreach ($route->getProperty('middleware') as $middleware)\n// $middlewares[] = new Call($this->resolveMiddleware($middleware[0]), $middleware[1]);\n// $callStack->addCallable($this->resolveMiddleware($middleware[0]), $middleware[1]);\n\n foreach ($route->getStates() as $key => $value)\n $this->states[$key] = $value;\n\n foreach ($route->getFlags() as $flag)\n $this->flags[] = $flag;\n\n foreach ($route->getSerieses() as $key => $value) {\n if (!array_key_exists($key, $this->serieses))\n $this->serieses[$key] = array();\n\n foreach ($value as $v)\n $this->serieses[$key][] = $v;\n }\n\n foreach ($group->getDecorators() as $decorator)\n $decorators[] = new Call($this->resolveMiddleware($decorator));\n\n// foreach ($route->getDecorators() as $decorator)\n// $decorators[] = new Call($this->resolveMiddleware($decorator));\n\n // pass config.\n if ($config = $route->getProperty('config'))\n $this->config = array_merge($this->config, $config);\n }\n\n foreach ($handlers as $name => $class) {\n $handler = null;\n\n if (is_string($class)) {\n $handler = new $class;\n } else if (is_object($class)) {\n if ($class instanceof \\Closure) {\n $class($handler = new DynamicHandler());\n } else if ($class instanceof ExecuteHandler) {\n $handler = $class;\n }\n }\n\n if (!$handler || !is_object($handler) || !($handler instanceof ExecuteHandler))\n throw new InvalidArgumentException('Handler must be either class name, ' . ExecuteHandler::class . ' or \\Closure ');\n\n if ($handler->validateHandle($executePattern)) {\n $resolve = $handler->resolveHandle($executePattern);\n\n if (!is_callable($resolve))\n throw new \\Exedra\\Exception\\InvalidArgumentException('The resolveHandle() method for handler [' . get_class($handler) . '] must return \\Closure or callable');\n\n $properties = array();\n\n if ($this->route->hasDependencies())\n $properties['dependencies'] = $this->route->getProperty('dependencies');\n\n if (!$resolve)\n throw new InvalidArgumentException('The route [' . $this->route->getAbsoluteName() . '] execute handle was not properly resolved. ' . (is_string($executePattern) ? ' [' . $executePattern . ']' : ''));\n\n// $callStack->addCallable($resolve, $properties);\n\n return $this->createCallStack($middlewares, $decorators, new Call($resolve, $properties));\n\n// return $callStack;\n }\n }\n\n return null;\n }",
"public function mapClasses() {\n // TODO: this is needed when the class map is not created yet (i.e. at very first install).\n if (!is_dir($this->dir['tmp'])) {\n mkdir($this->dir['tmp']);\n }\n $fop = fopen(CLASS_MAP_FILE, 'w+');\n\n foreach ($this->modules_loaded as $module) {\n $autoload_paths = array('Common', 'Qtags');\n foreach ($autoload_paths as $autoload_path) {\n $full_autoload_path = $module['path'] . '/classes/' . $autoload_path;\n /**\n * Autoload module's qtags.\n */\n if (is_dir($full_autoload_path)) {\n $classes = $this->scanDirectory($full_autoload_path);\n foreach ($classes as $class) {\n // Parse the Qtag.\n $exp1 = explode('/', $class);\n $exp2 = explode('.', $exp1[count($exp1) - 1]);\n $item_name = $exp2[0];\n $this->class_map[$autoload_path][$item_name] = $full_autoload_path . '/' . $class;\n }\n }\n }\n }\n fwrite($fop, serialize($this->class_map));\n fclose($fop);\n }",
"public function testAutoloadNewDependencies(): void {\n\n // Classes must not be loaded if they exist.\n $classLoader = $this->getMockBuilder(ClassLoader::class)\n ->onlyMethods([\n 'addClassMap',\n 'addPsr4',\n 'register',\n ])\n ->getMock();\n $classLoader->expects(self::never())\n ->method('addClassMap');\n $classLoader->expects(self::never())\n ->method('addPsr4');\n $classLoader->expects(self::never())\n ->method('register');\n\n new UpdateManager($this->composer, $this->io, $this->configUpdateManager->getConfig(), $classLoader);\n\n // Classes must be loaded if they do not exist.\n $classLoader = $this->getMockBuilder(ClassLoader::class)\n ->onlyMethods([\n 'addClassMap',\n 'addPsr4',\n 'register',\n ])\n ->getMock();\n $classLoader->expects(self::once())\n ->method('addClassMap');\n $classLoader->expects(self::once())\n ->method('addPsr4');\n $classLoader->expects(self::once())\n ->method('register');\n\n $this->fs->mkdir(\"$this->root/wd/vendor/nette/robot-loader\");\n $this->composer->getConfig()->merge([\n 'config' => ['vendor-dir' => \"$this->root/wd/vendor\"],\n ]);\n\n new class($this->composer, $this->io, $this->configUpdateManager->getConfig(), $classLoader) extends UpdateManager {\n\n protected const NEWLY_INTRODUCED_CLASSES = [\n 'classmap' => [\n 'FakeRobotLoader' => 'nette/robot-loader',\n ],\n 'psr4' => [\n 'FakeComments' => [\n 'package' => 't2l/comments',\n 'prefix' => 'Consolidation\\\\Comments\\\\',\n 'path' => 'src',\n ],\n ],\n ];\n\n };\n\n }",
"public function resolve($className);",
"public function resolve($aliasOrTemplate);",
"private function resolvePostMetaReferences()\n {\n $app = Bootstrap::getApplication();\n $resolver = $app['resolver'];\n $settings = $app['settings'];\n\n if (isset($settings['references']['posts']['postmeta'])) {\n $references = $settings['references']['posts']['postmeta'];\n if (is_array($references)) {\n foreach ($references as $value) {\n if (is_string($value)) {\n $this->postPostMetaReferenceNames[] = $value;\n } elseif (is_object($value)) {\n $arr = (array) $value;\n $key = key($arr);\n $this->postPostMetaReferenceNames[$key] = $arr[$key];\n } elseif (is_array($value)) {\n $key = key($value);\n $this->postPostMetaReferenceNames[$key] = $value[$key];\n }\n }\n }\n }\n $resolver->resolvePostMetaReferences($this->postPostMetaReferenceNames, 'post');\n\n if (isset($settings['references']['terms']['postmeta'])) {\n $references = $settings['references']['terms']['postmeta'];\n if (is_array($references)) {\n foreach ($references as $value) {\n if (is_string($value)) {\n $this->termPostMetaReferenceNames[] = $value;\n } elseif (is_object($value)) {\n $arr = (array) $value;\n $key = key($arr);\n $this->termPostMetaReferenceNames[$key] = $arr[$key];\n } elseif (is_array($value)) {\n $key = key($value);\n $this->termPostMetaReferenceNames[$key] = $value[$key];\n }\n }\n }\n }\n $resolver->resolvePostMetaReferences($this->termPostMetaReferenceNames, 'term');\n }",
"public function warmUpCache(): void\n {\n $this->cache = [];\n foreach ($this->entityAliasResolvers as [$serviceId, $expression]) {\n /** @var EntityAliasResolver $entityAliasResolver */\n $entityAliasResolver = $this->container->get($serviceId);\n $entityAliasResolver->warmUpCache();\n }\n }",
"public function loadAliases() {\n\t\t $aliases = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n\n\n\t\t$aliases->alias('Purifier', 'Mews\\Purifier\\Facades\\Purifier::class');\n\t\t$aliases->alias(\"Twitter\", 'Thujohn\\Twitter\\Facades\\Twitter::class');\n\t\t$aliases->alias('DotenvEditor', 'Brotzka\\DotenvEditor\\DotenvEditorFacade');\n\n\n\t\t/*\n\t\t* Dev resources\n\t\t */\n\n\t\tif ($this->app->environment() !== \"production\") {\n\n\n\t\t}\n\n\n\t}",
"private function bindAliasesToContainer()\n {\n foreach (static::$aliasMap as $alias => $classes)\n {\n foreach ($classes as $class)\n {\n $this->alias($alias, $class);\n }\n }\n }",
"protected function registerAliases()\n {\n $loader = AliasLoader::getInstance();\n foreach ($this->aliases as $alias => $class) {\n $loader->alias($alias, $class);\n }\n }",
"function setUp() {\n\n $this->oResolver= new reflection\\ResolverByReflection(new reflection\\resolveInterfaceByName\\ResolveInterfaceByNameFirstLetter());\n $aMap=array();\n $oL0ClassOne=&new layer0\\ClassOne(\" <b>Text Passed to The Instance created manually layer0->ClassOne</b>\");\n $aMap['layer2\\ClassOne']=&$oL0ClassOne;\n //$this->oResolverWithMap= new reflection\\ResolverByReflection(new reflection\\resolveInterfaceByName\\ResolveInterfaceByNameFirstLetter(),);\n\n }",
"protected function replacePlaceholdersFromStack($placeholderStack = array())\r\n {\r\n $stringReplaced = null;\r\n if (!empty($placeholderStack)) {\r\n\r\n foreach ($placeholderStack as $placeholder) {\r\n $placeholderObject = null;\r\n $placeholderClassPrefixes = self::getPlaceholderClassPrefixes();\r\n\r\n $placeholderObject = null;\r\n\r\n foreach($placeholderClassPrefixes as $classPrefix){\r\n $className = $classPrefix . $placeholder['placeholderClass'];\r\n if(Tool::classExists($className)){\r\n $placeholderObject = new $className();\r\n break;\r\n }\r\n }\r\n\r\n if (is_null($stringReplaced)) {\r\n $stringReplaced = $placeholder['contentString'];\r\n }\r\n\r\n if ($placeholderObject instanceof Placeholder\\AbstractPlaceholder) {\r\n\r\n //setting values from placeholder stack to placeholder objects\r\n foreach (array_keys($placeholder) as $key) {\r\n if ($key == 'placeholderClass') {\r\n continue;\r\n }\r\n $placeholderObject->{'set' . ucfirst($key)}($placeholder[$key]);\r\n }\r\n $placeholderObject->setLocale();\r\n\r\n $replaceWith = $placeholderObject->getReplacement();\r\n if (!isset($replaceWith)) {\r\n $replaceWith = $placeholderObject->getEmptyValue();\r\n }\r\n $stringReplaced = str_replace($placeholderObject->getPlaceholderString(), $replaceWith, $stringReplaced);\r\n } else {\r\n \\Logger::warn('Ignoring Placeholder \"' . $placeholder['placeholderClass'] . '\" -> Class not Found or not an instance of Pimcore_Placeholder_Abstract!');\r\n }\r\n }\r\n }\r\n return $stringReplaced;\r\n }",
"abstract public static function resolve($root, $args, $context, $info);",
"private function resolveDependencies(array $dependencies, array $injectedDependencies = [])\n {\n $resolvedDependencies = [];\n\n foreach ((array) $dependencies as $dependency) {\n if ($dependency->getType() instanceof \\ReflectionNamedType) \n $resolvedDependencies[] = $this->resolveConcrete(['concrete' => $dependency->getType()->getName()]);\n else if (!empty($injectedDependencies)) $resolvedDependencies[] = array_shift($injectedDependencies);\n else $resolvedDependencies[] = $dependency->getDefaultValue();\n }\n\n return $resolvedDependencies;\n }",
"final protected function buildDependencyMap() {\n\n\t\t$this->dependencyMap = array();\n\t\t$this->prioritiesHandlers = array();\n $p = new dummyPriorityhookHandler();\n\t\t$this->prioritiesHandlers[self::NORMAL] = $p;\n $this->priorityBased = array('min' => array(),'max' => array());\n\t\t//$this->priorityBased['min'][self::NORMAL][spl_object_hash($p)] = $p;\n\t\tforeach ($this->objects as $hash => $handler) {\n\t\t\t$this->priorityBased['min'][self::NORMAL][$hash] = $handler;\n\t\t\t$this->dependencyMap[$hash] = array('priority' => $this->prioritiesHandlers[self::NORMAL]);\n\t\t\t$this->priorityBased['max'][self::LATEST-1][$hash] = $handler;\n\t\t\t$handler->registerDependencies($this);\n\t\t}\n\t}",
"public static function alias_core_classes()\n\t{\n\t\tforeach (self::$classes as $class) {\n\t\t\t$exploded = explode('\\\\', $class);\n\t\t\t$class = array_pop($exploded);\n\t\t\t$namespace = implode('\\\\', $exploded);\n\t\t\tself::alias_to_namespace($class, $namespace);\n\t\t}\n\t}",
"public function resolvePatches()\n {\n $resolver = new Resolver($this->composer, $this->io, $this->getConfig('disable-resolvers'));\n return $resolver->loadFromResolvers();\n }",
"protected function registerProxies() {\n\n\t\tProxy::setContainer( $this );\n\n\t\tforeach ( $this->proxies as $class => $alias ) {\n\t\t\tclass_alias( $class, $alias );\n\t\t}\n\t}",
"static function loadOverrideFiles() {\n\t\tob_start();\n\n\t\t$folder = KenedoPlatform::p()->getDirCustomizationSettings();\n\t\t$files = (is_dir($folder)) ? KenedoFileHelper::getFiles( $folder, '.php$', false, true) : array();\n\n\t\tif (count($files)) {\n\t\t\t$settingDisplayErrors = ini_set('display_errors',1);\n\t\t\tforeach ($files as $file) {\n\t\t\t\trequire_once($file);\n\t\t\t}\n\t\t\tini_set('display_errors',$settingDisplayErrors);\n\t\t}\n\n\t\t$folder = KenedoPlatform::p()->getDirCustomization() .'/system_overrides';\n\t\t$files = (is_dir($folder)) ? KenedoFileHelper::getFiles( $folder, '.php$', false, true) : array();\n\n\t\tif (count($files)) {\n\t\t\t$settingDisplayErrors = ini_set('display_errors',1);\n\t\t\tforeach ($files as $file) {\n\t\t\t\trequire_once($file);\n\t\t\t}\n\t\t\tini_set('display_errors',$settingDisplayErrors);\n\t\t}\n\n\t\t// And drop any output done.\n\t\tob_end_clean();\n\n\t}",
"protected static function getClassAliases()\n {\n return [];\n }"
]
| [
"0.5692192",
"0.5378244",
"0.52492815",
"0.51225805",
"0.50569785",
"0.5032591",
"0.5001583",
"0.48926935",
"0.48528135",
"0.4820539",
"0.4759477",
"0.4695104",
"0.46880564",
"0.4682227",
"0.4627017",
"0.46082777",
"0.460466",
"0.45676878",
"0.45640403",
"0.4560798",
"0.45595068",
"0.4547715",
"0.45419183",
"0.45353845",
"0.45334193",
"0.45080104",
"0.4500075",
"0.44927505",
"0.44792604",
"0.4473623"
]
| 0.7383632 | 0 |
Resolves a single stack entry by defining the required include files, and creating a copy of the class if required | protected function resolveStackEntry(
string $initialClassName,
string $finalClassName,
string $classToOverride,
string $classToOverrideWith
): void
{
$basename = Inflector::toFile($classToOverride);
$cloneFilename = $basename . '-clone.php';
$aliasFilename = $basename . '.php';
$this->includeList[] = $cloneFilename;
$this->includeList[] = $aliasFilename;
if (! $this->fsMount->hasFile($aliasFilename) || ! $this->fsMount->hasFile($cloneFilename)) {
$namespace = Path::classNamespace($classToOverride);
$copyClassName = 'T3BaCopy' . Path::classBasename($classToOverride);
$copyClassFullName = ltrim($namespace . '\\' . $copyClassName, '\\');
$codeGenerator = $this->getCodeGenerator();
$cloneContent = $codeGenerator->getClassCloneContentOf(
$classToOverride, $copyClassName);
$aliasContent = $codeGenerator->getClassAliasContent(
$classToOverride, $classToOverrideWith, $finalClassName, $copyClassFullName);
$e = new ClassOverrideContentFilterEvent(
$classToOverride,
$copyClassName,
$initialClassName,
$finalClassName,
$cloneContent,
$aliasContent
);
$this->eventBus->dispatch($e);
$cloneContent = $e->getCloneContent();
$aliasContent = $e->getAliasContent();
$this->fsMount->setFileContent($cloneFilename, $cloneContent);
$this->fsMount->setFileContent($aliasFilename, $aliasContent);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function resolve(array $stack): array\n {\n $this->eventBus->dispatch(\n ($e = new ClassOverrideStackFilterEvent($stack))\n );\n $stack = $e->getStack();\n \n $cacheKey = md5(SerializerUtil::serializeJson($stack) . '-' . $this->isTestMode);\n if (isset($this->resolvedAliasMap[$cacheKey])) {\n return $this->resolvedAliasMap[$cacheKey];\n }\n \n reset($stack);\n $initialClassName = key($stack);\n $finalClassName = end($stack);\n \n $this->includeList = [];\n foreach ($stack as $classToOverride => $classToOverrideWith) {\n $this->resolveStackEntry((string)$initialClassName, (string)$finalClassName, $classToOverride, $classToOverrideWith);\n }\n \n foreach ($this->includeList as $aliasFilename) {\n $this->fsMount->includeFile($aliasFilename);\n }\n $this->includeList = [];\n \n return $this->resolvedAliasMap[$cacheKey] = [$finalClassName => $initialClassName];\n }",
"protected function processSourceTree () {\n\t\t$this->processFileTree();\n\t\tforeach (get_declared_interfaces() as $interface) {\n\t\t$ref = new ReflectionClass($interface);\n\t\t\tif ($ref->isUserDefined()) {\n\t\t\t\t$this->classes[] = $ref;\n\t\t\t}\n\t\t}\n\t\tforeach (get_declared_classes() as $class) {\n\t\t\t$ref = new ReflectionClass($class);\n\t\t\tif ($ref->isUserDefined() && !preg_match('/^Spd/', $class)) {\n\t\t\t\t$this->classes[] = $ref;\n\t\t\t}\n\t\t}\n\t}",
"private function includeFiles(){\n foreach($this->files as $file){\n require implode('', $file);\n $class_name = $this->getClassNameFromFileName($file);\n $this->classes[$file['name']] = new $class_name();\n }\n }",
"function fileWithClass($file, $relativeClassName);",
"function load_my_classes($_cls)\n{\n //echo '<hr />' . $_cls . '<hr />';\n $PATH_SEPARATOR = DIRECTORY_SEPARATOR;\n //$ROOTPATH = $_SERVER[\"DOCUMENT_ROOT\"];\n\t$ROOTPATH = dirname($_SERVER[\"SCRIPT_FILENAME\"]);\n\t\n\t//print_r($_SERVER);\n \n\t\n\n\n if(class_exists($_cls))\n {\n //doe niks, het is een ingebouwde class zoals \\SplObjectStorage o.i.d.\n }\n elseif(strpos($_cls, 'Exception') !== false)\n {\n $candidate_class_file = $ROOTPATH . $PATH_SEPARATOR . 'common' . $PATH_SEPARATOR . 'classes' . $PATH_SEPARATOR . 'Exceptions.php';\n if(file_exists($candidate_class_file))\n {\n require_once($candidate_class_file);\n //echo($candidate_class_file . ' found in ' . $candidate_class_file . '<br />');\n }\n else\n {\n //echo($candidate_class_file . ' does not exist!<br />');\n }\n }\n elseif(strpos($_cls, 'Common') === false)\n {\n $dirsToLookIn = Array(\"controller\", \"core\", \"model\", \"view\");\n \n foreach($dirsToLookIn as $dir)\n {\n if(strpos($_cls, __NAMESPACE__) !== false)\n {\n //namespace eraf strippen anders komt die mee in de padverwijzingen\n $_cls = substr($_cls, strlen(__NAMESPACE__)+1); \n }\n \n \n $candidate_class_file = $ROOTPATH . $PATH_SEPARATOR . $dir . $PATH_SEPARATOR . $_cls . '.php';\n if(file_exists($candidate_class_file))\n {\n require_once($candidate_class_file);\n //echo($candidate_class_file . ' found in ' . $candidate_class_file . '<br />');\n }\n else\n {\n //echo($candidate_class_file . ' does not exist!<br />');\n }\n }\n }\n else\n {\n $_cls = substr($_cls, 7);\n $candidate_class_file = $ROOTPATH . $PATH_SEPARATOR . 'common' . $PATH_SEPARATOR . 'classes' . $PATH_SEPARATOR . $_cls . '.php';\n \n if(file_exists($candidate_class_file))\n {\n require_once($candidate_class_file);\n //echo($candidate_class_file . ' found in ' . $candidate_class_file . '<br />');\n }\n else\n {\n //echo($candidate_class_file . ' does not exist!<br />');\n }\n }\n //echo '<hr />';\n}",
"function classLoader($className){\r\n $classAry = explode('\\\\',$className);\r\n $class = array_pop($classAry);\r\n $subPath = strtolower(implode(DS,$classAry));\r\n $path = ROOT . DS . $subPath . DS . $class . '.php';\r\n if(file_exists($path)){\r\n require_once($path);\r\n }\r\n}",
"function autoload($class) \n{\n $paths = explode(PATH_SEPERATOR, get_include_path());\n $flags = PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE;\n $file = str_replace(\"\\\\\", DIRECTORY_SEPARATOR, trim($class, \"\\\\\")).\".php\"; //need to set name of php file to lowercase because of stringtolower command\n foreach ($paths as $path) {\n\t\t $combined = $path.DIRECTORY_SEPARATOR.$file;\n\t\t if (file_exists($combined)) {\n\t\t\t //echo '<br>'.$combined.'<br>'; //Troubleshooting code to echo out the file that's being loaded\n\t\t\t //exit;\n\t\t \tinclude($combined);\n\t\t\t return;\n }\n }\n throw new Exception(\"{$class} not found\");\n}",
"private function includes()\n\t\t{\n\t\t\trequire_once dirname( __FILE__ ) . '/sf-class-sanitize.php';\n\t\t\trequire_once dirname( __FILE__ ) . '/sf-class-format-options.php';\n\t\t\tnew SF_Sanitize;\n\t\t}",
"function loadClass($class_name) {\n include \"$class_name.php\";\n}",
"public function compile() { \n if (!count($this->loadedFiles)) return; \n $outputFile = $this->_options['includeFile']; \n $fp = fopen($outputFile, \"a+\"); \n if (flock($fp, LOCK_EX)) { \n if ($filesize = filesize($outputFile)) { \n fseek($fp, 0); \n $currentFile = fread($fp, $filesize); \n } else $currentFile = ''; \n \n if (!$currentFile) { \n $appendSource = \"<?php\\n\"; \n $existingClasses = array(); \n } else { \n $appendSource = ''; \n $existingClasses = $this->getClassesFromSource($currentFile); \n } \n \n for ($i = 0; $i < count($this->loadedFiles); $i++) { \n $filename = $this->loadedFiles[$i]; \n \n $f = @fopen($filename, \"r\", true); \n $fstat = fstat($f); \n $file = fread($f, $fstat['size']); \n fclose($f); \n $classes = $this->getClassesFromSource($file); \n \n if (!count(array_intersect($existingClasses, $classes))) { \n if (strpos($file, '__FILE__') === false) { \n $endFile = substr($file, -2) == '?>' ? -2 : null; \n $appendSource .= ($endFile === null ? substr($file, 5) : substr($file, 5, -2)); \n } else { \n $filePath = $this->realPath($filename); \n if ($filePath) { \n $file = str_replace('__FILE__', \"'$filePath'\", $file); \n $endFile = substr($file, -2) == '?>' ? -2 : null; \n $appendSource .= ($endFile === null ? substr($file, 5) : substr($file, 5, -2)); \n } \n } \n } else { \n $appendSource = ''; \n break; \n } \n } \n if ($appendSource) { \n fseek($fp, 0, SEEK_END); \n fwrite($fp, $appendSource); \n } \n flock($fp, LOCK_UN); \n } \n fclose($fp); \n }",
"function autoloaderCurrentFolder($className)\n{\n if (file_exists($className . '.php')) {\n include $className . '.php';\n }\n}",
"private function getRefClass(): ReflectionClass\n {\n try {\n $file = file_get_contents($this->classPath);\n\n // Remove use statements and traits imports\n $replaced = preg_replace('@^(<\\?php)[\\s\\S]+?(\\/\\*\\*)@', \"$1\\n$2\", $file);\n $replaced = preg_replace('@use\\s+[^;]+;@', '', $replaced);\n\n // Create temp file where cleared class will be stored\n $tmpClass = \"/tmp/{$this->className}.php\";\n file_put_contents($tmpClass, $replaced);\n\n /** @noinspection PhpIncludeInspection */\n require_once $tmpClass;\n\n if (!class_exists($this->className)) {\n throw new RuntimeException(\"Cleared class not loaded: {$this->className}\");\n }\n\n return new ReflectionClass($this->className);\n\n } catch (Exception $exception) {\n exit($exception->getMessage());\n }\n }",
"protected function resolveInformationSheets()\n {\n $finder = new Finder();\n $informationSheetsClassPath = str_forward_slash(app_path('Models/InformationSheet/Sheets/'));\n $files = $finder->in(\"$informationSheetsClassPath/*\")->files();\n\n // Iterate through all information sheet classes found and instanciate them.\n return collect($files)->transform(function($file) use ($informationSheetsClassPath) {\n $realPath = str_forward_slash($file->getRealPath());\n $relativePath = str_after($realPath, $informationSheetsClassPath);\n $classFile = str_backslash(\"App/Models/InformationSheet/Sheets/$relativePath\");\n $class = str_before($classFile, '.php');\n return new $class;\n })->values();\n }",
"function __autoload($class_name) {\n require_once '../../include/' . $class_name . '.php';\n}",
"abstract function resolve($class);",
"function __autoload($className) {\n include \"src/\" . $className . '.php';\n}",
"private function buildClassMeta()\n {\n // Search meta informations before going to reflection and then, ast parsing\n foreach ($this->data as $line) {\n $line = trim($line);\n\n // Namespace search\n if (preg_match(self::NAMESPACE_PATTERN, $line, $matches) === 1) {\n $this->context->setCurrentNamespace(trim($matches[1]));\n continue;\n }\n\n // Class name\n if (preg_match(self::DEFINITION_PATTERN, $line, $matches) === 1) {\n $this->context->setClassName(trim($matches[1]));\n break; // Stop after class found, let the reflection do the next job\n }\n\n // Uses\n if (preg_match(self::USE_PATTERN, $line, $matches) === 1) {\n $this->context->addUse($matches[1]);\n continue;\n }\n }\n }",
"function my_class_loader ($class) {\n include 'classes' . DIRECTORY_SEPARATOR . $class . '.class.php';\n}",
"function __autoload($cls){\n SUPER::include_file_with_class($cls);\n}",
"private function buildClassDefinition()\n {\n $reflection = new \\ReflectionClass($this->context->getFullClassName());\n $haxeClass = new HaxeClass();\n $haxeClass\n ->setName($this->context->getClassName())\n ->setPackage(implode('.', explode('\\\\', $this->context->getCurrentNamespace())))\n ;\n\n $this->parseProperties($reflection, $haxeClass);\n $this->parseMethods($reflection, $haxeClass);\n\n return $haxeClass->transpile();\n }",
"function classAutoload($class_name) {\n if (file_exists( __DIR__ . '/includes/classes/' . $class_name . '.php')) {\n require_once __DIR__ . '/includes/classes/' . $class_name . '.php';\n }\n}",
"function __autoload($class_name) {\r\n include '../class/' . $class_name . '.php';\r\n}",
"function __autoload($class_name) {\n include '../class/' . $class_name . '.php';\n}",
"function __autoload($class_name) {\n include '../class/' . $class_name . '.php';\n}",
"function loader($class)\n{\n $file = $class . '.php';\n if (file_exists($file)) {\n include $file;\n }\n}",
"function classLoader($class){\n $filename = $class . '.class.php';\n $file ='classes'. DIRECTORY_SEPARATOR . $filename;\n\n // Smarty ligger i libs-mappa.\n if ($class == 'Smarty') {\n $file = 'libs' . DIRECTORY_SEPARATOR . $filename;\n }\n if (!file_exists($file))\n {\n return false;\n }\n\n include $file;\n}",
"function fileWithClassCandidates($file, array $relativeClassNames);",
"function sso_load($class)\n {\n // echo '<pre>';\n // debug_print_backtrace();\n // echo '</pre>';\n $class = end(explode('\\\\', $class));\n $file = $class.'.class.php';\n if(stristr($file, 'smarty_'))\n {\n return true;\n }\n include_once $file;\n }",
"public static function __classLoaded()\n {\n\t\tif (empty(static::$layers) && class_exists('Git')) {\n\t\t\tstatic::$layers = \\Git::$repositories;\n\t\t}\n }",
"protected function buildClass()\n {\n return $this->files->get($this->getStub());\n }"
]
| [
"0.53946394",
"0.53572446",
"0.51229286",
"0.50375956",
"0.50209725",
"0.5017096",
"0.49942073",
"0.4994109",
"0.49022186",
"0.48756263",
"0.48392746",
"0.48301363",
"0.48113695",
"0.4800503",
"0.47984388",
"0.47767162",
"0.47760367",
"0.47716445",
"0.4740858",
"0.47318894",
"0.4728384",
"0.47199425",
"0.4705443",
"0.4705443",
"0.47016045",
"0.46781847",
"0.46676475",
"0.46601683",
"0.46517664",
"0.46396282"
]
| 0.5457319 | 0 |
Gets the bandwidthCapacityInMbps Determines the maximum allowed Mbps (megabits per second) bandwidth from a branch site. The possible values are:250,500,750,1000. | public function getBandwidthCapacityInMbps()
{
if (array_key_exists("bandwidthCapacityInMbps", $this->_propDict)) {
if (is_a($this->_propDict["bandwidthCapacityInMbps"], "\Beta\Microsoft\Graph\Networkaccess\Model\BandwidthCapacityInMbps") || is_null($this->_propDict["bandwidthCapacityInMbps"])) {
return $this->_propDict["bandwidthCapacityInMbps"];
} else {
$this->_propDict["bandwidthCapacityInMbps"] = new BandwidthCapacityInMbps($this->_propDict["bandwidthCapacityInMbps"]);
return $this->_propDict["bandwidthCapacityInMbps"];
}
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setBandwidthCapacityInMbps($val)\n {\n $this->_propDict[\"bandwidthCapacityInMbps\"] = $val;\n return $this;\n }",
"public function getMaxSizeInMegabytes()\n {\n return $this->_maxSizeInMegabytes;\n }",
"public function maxCapacity() \r\n {\r\n return $this->maxCapacity;\r\n }",
"public function get_bandwidth(): int\n {\n // $res is a int;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::BANDWIDTH_INVALID;\n }\n }\n $res = $this->_bandwidth;\n return $res;\n }",
"public function getTotalMaxSize() {\n\t\t\treturn $this->getStats( 'limit_maxbytes' );\n\t\t}",
"public function getTotalCapacityBytes()\n {\n return $this->total_capacity_bytes;\n }",
"public function getBitrate()\n {\n return $this->bitrate;\n }",
"public function getAvailableCapacity();",
"public function getMb()\n {\n return $this->mb;\n }",
"public function getMaxSize() {\n return number_format($this->_max / 1024, 1) . ' KB';\n }",
"public function getCapacity()\n {\n return $this->capacity;\n }",
"public function getPoolSize()\n\t{\n\t\tif ($this->poolDir !== null)\n\t\t{\n\t\t\t$size=exec(\"cd \".$this->getPoolDir().\"; du | tail -n1\");\n\t\t\t$size/=1024;\n\t\t\treturn(sprintf(\"%.2f\",$size));\n\t\t}\n\t\telse\n\t\t\treturn(0);\n\t}",
"public function getBitrate();",
"public function getBitrate();",
"private function get_sizeMib()\n\t{\n\t\treturn $this->m_sizeMib;\n\t}",
"public function getMaxSize(): int\n {\n return $this->maxSize;\n }",
"public function getAllowedMaxFileSize()\n {\n $size = $this->getValidator()->getAllowedMaxFileSize();\n if($size) {\n $sizeMB = $size / 1024 / 1024;\n return $sizeMB;\n }\n }",
"public function getMaxSize() : int{\n return $this->maxSize;\n }",
"public function getSizeInMb()\n {\n return $this->sizeInMb;\n }",
"public static function getMaxUploadMb()\n {\n static $maxUploadMb = -1;\n if ($maxUploadMb < 0) {\n $postMaxSize = self::parseSizeToBytes(ini_get('post_max_size'));\n if ($postMaxSize > 0) {\n $maxUploadMb = $postMaxSize;\n }\n $uploadMax = self::parseSizeToBytes(ini_get('upload_max_filesize'));\n if ($uploadMax > 0 && $uploadMax < $maxUploadMb) {\n $maxUploadMb = $uploadMax;\n }\n }\n\n return round($maxUploadMb / 1048576, 2, PHP_ROUND_HALF_DOWN);\n }",
"public function getMaxSize() {\n\t\t\treturn $this->maxSize >= 0 ? $this->maxSize : $this->getTotalMaxSize();\n\t\t}",
"public function getSizeLimit() {\n return $this->sizeLimit;\n }",
"public function getMaxSize(){\n return $this->maxSize;\n }",
"public function getMaxAllowedPacket(): int\n {\n if (!isset($this->maxAllowedPacket))\n {\n $query = \"show variables like 'max_allowed_packet'\";\n $max_allowed_packet = $this->executeRow1($query);\n\n $this->maxAllowedPacket = $max_allowed_packet['Value'];\n\n // Note: When setting $chunkSize equal to $maxAllowedPacket it is not possible to transmit a LOB\n // with size $maxAllowedPacket bytes (but only $maxAllowedPacket - 8 bytes). But when setting the size of\n // $chunkSize less than $maxAllowedPacket than it is possible to transmit a LOB with size\n // $maxAllowedPacket bytes.\n $this->chunkSize = (int)min($this->maxAllowedPacket - 8, 1024 * 1024);\n }\n\n return (int)$this->maxAllowedPacket;\n }",
"public function capacity() {\r\n\t\tif (array_key_exists('capacity', $this->techData)) {\r\n\t\t\treturn $this->techData['capacity'];\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}",
"public function getRateLimitLimit(): int\n {\n return $this->httpClient->getRateLimitLimit();\n }",
"public function getMaxConnections() {\n return @$this->attributes['max_connections'];\n }",
"public function getTotalCapacity(){\n if ($this->venue->isOnlyFreeSeating() || $this->isDefault()){\n return $this->venue->getDefaultCapacity();\n }\n if ($this->isOnlyStandup() || $this->hasFreeSeatingPolicy()){\n return $this->getMaxCapacity();\n }\n $capacity = 0;\n foreach ($this->blocks as $block){\n $capacity += $block->getComputedCapacity();\n }\n return $capacity;\n }",
"public function getMaxSize()\r\n {\r\n return $this->max_size;\r\n }",
"public function getMaxLimit()\n {\n return $this->max_limit;\n }"
]
| [
"0.7258156",
"0.61825997",
"0.61384875",
"0.59959626",
"0.58793956",
"0.5878617",
"0.5816479",
"0.57755333",
"0.5733823",
"0.5710712",
"0.56829184",
"0.5681177",
"0.5649207",
"0.5649207",
"0.5634014",
"0.5588045",
"0.55679244",
"0.5480273",
"0.5470122",
"0.5464797",
"0.54490376",
"0.54078376",
"0.53681403",
"0.53679585",
"0.5362939",
"0.53616947",
"0.5360955",
"0.5347292",
"0.5345117",
"0.5304315"
]
| 0.82361656 | 0 |
Sets the bandwidthCapacityInMbps Determines the maximum allowed Mbps (megabits per second) bandwidth from a branch site. The possible values are:250,500,750,1000. | public function setBandwidthCapacityInMbps($val)
{
$this->_propDict["bandwidthCapacityInMbps"] = $val;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getBandwidthCapacityInMbps()\n {\n if (array_key_exists(\"bandwidthCapacityInMbps\", $this->_propDict)) {\n if (is_a($this->_propDict[\"bandwidthCapacityInMbps\"], \"\\Beta\\Microsoft\\Graph\\Networkaccess\\Model\\BandwidthCapacityInMbps\") || is_null($this->_propDict[\"bandwidthCapacityInMbps\"])) {\n return $this->_propDict[\"bandwidthCapacityInMbps\"];\n } else {\n $this->_propDict[\"bandwidthCapacityInMbps\"] = new BandwidthCapacityInMbps($this->_propDict[\"bandwidthCapacityInMbps\"]);\n return $this->_propDict[\"bandwidthCapacityInMbps\"];\n }\n }\n return null;\n }",
"public function setMaxSizeInMegabytes($maxSizeInMegabytes)\n {\n $this->_maxSizeInMegabytes = $maxSizeInMegabytes;\n }",
"public function setMaxSize($bytes) {\n\t \t $this->maxSize = $bytes;\n\t }",
"public function setMaxChannels($m)\n {\n $this->_maxChannels = $m;\n }",
"public function setCapacity($capacity);",
"public function __construct($maxCapacity=2147483647) \r\n {\r\n $this->maxCapacity = $maxCapacity;\r\n }",
"public static function setMaxSize($filesize)\n\t{\n\t\tself::$size_limit = $filesize;\n\t}",
"public function setMaxSpeed(int $maxSpeed) : void\n {\n $this->maxSpeed = $maxSpeed;\n }",
"public function SetMaxSize ($maxSize);",
"function Set_max_size($ServerName, $max_size){\n\t\tself::Run_flushctl_command($ServerName, \" set max_size \".$max_size);\n\t}",
"protected function increaseCapacity()\n {\n $size = count($this);\n\n if ($size > $this->capacity) {\n $this->capacity = max(intval($this->capacity * 1.5), $size);\n }\n }",
"public function set_limit($new_limit){\r\n $this->limit = $new_limit;\r\n }",
"function setBlowdownRate($blowdownRate){\n $this->blowdownRate = $blowdownRate;\n $this->feedwater->setMassFlow(\n $this->outletSteam->massFlow / (1 - $this->blowdownRate));\n $this->blowdown->setMassFlow(\n $this->feedwater->massFlow * $this->blowdownRate); \n $this->calculateEnergyUse();\n }",
"function setConnectionTimeB($connectionTimeB) {\r\r\n\t\t$this->connectionTimeB = $connectionTimeB;\r\r\n\t}",
"public function setBufferSize($bufferSize)\n {\n $this->_bufferSize = $bufferSize;\n }",
"public static function setBufferSize($bytes) {}",
"public function setMaxFileSize( $size, $isMB = true ) {\r\n\t\t\t$size = ( $size < 0 ) ? 0 : $size;\r\n\t\t\t// convert to byte if $isMB = true\r\n\t\t\t$this->MaxFileSize = ( $isMB ) ? $size * 1000000 : $size;\r\n\t\t}",
"function limitToSize($size) {\r\n $this->sizeLimit = $size;\r\n }",
"protected function setMemoryLimit() {}",
"public function setMaxSize($int_max_size)\n {\n // checking for php.ini upload_size\n $this->max_size = intval($int_max_size);\n }",
"public function size(int $mb): void\n {\n $this->_size = (pow(1024,2) * $mb);\n }",
"protected function setLimits()\n {\n if (!isset($this->settings->cpuLoad)) {\n $this->settings->cpuLoad = \"low\";\n }\n\n $memoryLimit = self::MAX_MEMORY_RATIO;\n $timeLimit = self::EXECUTION_TIME_RATIO;\n\n switch ($this->settings->cpuLoad) {\n case \"medium\":\n $timeLimit = $timeLimit / 2;\n break;\n case \"low\":\n $timeLimit = $timeLimit / 4;\n break;\n\n case \"fast\":\n default:\n break;\n }\n\n $this->memoryLimit = $this->maxMemoryLimit * $memoryLimit;\n $this->executionLimit = $this->maxExecutionTime * $timeLimit;\n }",
"function setMaxSize($size) {\n\t\t$logMaxSizeBytes = intval(preg_replace(\"/[^0-9]/\", \"\", $size));\n\n\t\t// Is KB\n\t\tif (strpos((strtolower($size)), \"k\") > 0)\n\t\t\t$logMaxSizeBytes *= 1024;\n\n\t\t// Is MB\n\t\tif (strpos((strtolower($size)), \"m\") > 0)\n\t\t\t$logMaxSizeBytes *= (1024 * 1024);\n\n\t\t$this->_maxSizeBytes = $logMaxSizeBytes;\n\t\t$this->_maxSize = $size;\n\t}",
"public function videoBitrate(int $videoBitrate)\n {\n $this->videoBitrate = $videoBitrate;\n\n return $this;\n }",
"public function set_item_limit($limit = 0)\n {\n }",
"public function setBitrate($bitrate)\n {\n $this->bitrate = $bitrate;\n return $this;\n }",
"protected function adjustCapacity(): void\n {\n $size = count($this);\n\n // Automatically truncate the allocated buffer when the size of the\n // structure drops low enough.\n if ($size < $this->capacity / 4) {\n $this->capacity = max(CapacityInterface::MIN_CAPACITY, $this->capacity / 2);\n } elseif ($size >= $this->capacity) { // Also check if we should increase capacity when the size changes.\n $this->increaseCapacity();\n }\n }",
"public function allocate(int $capacity)\n {\n $this->capacity = max($capacity, $this->capacity);\n }",
"public function __construct(int $maximumSizeInMegaBytes = 5000)\n {\n $this->maximumSizeInMegaBytes = $maximumSizeInMegaBytes;\n }",
"public function maxConnections(Site $site, Channel $channel, UpdateMaxConnectionsRequest $request)\n {\n if ($this->validateMaxConnections($request->value)) {\n $channel->max_connections = $request->value;\n $channel->save();\n\n return response()->json(['type' => 'success']);\n } else {\n return response()->json(['type' => 'error', 'message' => 'Invalid Max Connections value!']);\n }\n }"
]
| [
"0.6874132",
"0.5738831",
"0.5621231",
"0.55103666",
"0.5478474",
"0.5440861",
"0.5236345",
"0.5166992",
"0.51424915",
"0.5083207",
"0.49745494",
"0.4942914",
"0.4880514",
"0.4846751",
"0.4844355",
"0.48367968",
"0.48227894",
"0.4788133",
"0.47705045",
"0.4761506",
"0.4758841",
"0.47526532",
"0.474988",
"0.4747994",
"0.4737865",
"0.4687693",
"0.46787918",
"0.46764898",
"0.4672858",
"0.4649516"
]
| 0.7783392 | 0 |
Gets the bgpConfiguration The border gateway protocol specifies the IP address and ASN for directing traffic from a link to the edge. | public function getBgpConfiguration()
{
if (array_key_exists("bgpConfiguration", $this->_propDict)) {
if (is_a($this->_propDict["bgpConfiguration"], "\Beta\Microsoft\Graph\Networkaccess\Model\BgpConfiguration") || is_null($this->_propDict["bgpConfiguration"])) {
return $this->_propDict["bgpConfiguration"];
} else {
$this->_propDict["bgpConfiguration"] = new BgpConfiguration($this->_propDict["bgpConfiguration"]);
return $this->_propDict["bgpConfiguration"];
}
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getGatewayConfig() {\r\n return $this->gatewayConfig;\r\n }",
"public function getLinkConfiguration()\r\n {\r\n return $this->linkConfiguration;\r\n }",
"public function GetRoutingConfiguration($edgeId)\n {\n // check param\n if(empty($edgeId))\n throw new \\Exception(\"Please supply NSX Edge name or ID as parameter.\");\n\n // check whether there's a specific edge requested\n if(!preg_match(\"/^edge\\-(\\d+)$/\", $edgeId))\n {\n // if we're not looking for a specific edge or we're looking for an edge\n // based on a name, collect all edges\n $xml_str = $this->parent->API_Call(\"GET\", \"/api/4.0/edges\");\n $array_edges = $this->parent->XML_to_Array($xml_str);\n\n // if we're looking for a specific edge based on a name, look for\n // it remember the edge-XX ID for use in the NAT configuration request\n $found = false;\n foreach($array_edges['edgePage']['edgeSummary'] as $id => $edgeInfo)\n {\n // match on name and get edge info\n if($edgeInfo['name'] == $edgeId) {\n $edgeId = $edgeInfo['objectId'];\n $found = true;\n break;\n }\n }\n\n if(!$found)\n throw new \\Exception(\"NSX Edge \\\"\".$edgeId.\"\\\" not found!\");\n }\n\n // return the NAT configuration for this edge\n $xml_str = $this->parent->API_Call(\"GET\", \"/api/4.0/edges/\".$edgeId.\"/routing/config\");\n $array_nat = $this->parent->XML_to_Array($xml_str);\n\n return $array_nat;\n }",
"public function getConfig ()\n {\n $config = Mage::getModel('socnet/network')\n ->getConfigByNetworkKey($this->getNetworkKey());\n return $config;\n }",
"protected function get_gateway() {\n\n\t\treturn $this->gateway;\n\t}",
"public function getCheckoutConfig()\n {\n return $this->_get('checkoutConfig');\n }",
"abstract public function get_backend_gateway_options();",
"public function setBgpConfiguration($val)\n {\n $this->_propDict[\"bgpConfiguration\"] = $val;\n return $this;\n }",
"public function getGateway() {\n return $this->gateway;\n }",
"public function getGateway()\n {\n return $this->gateway;\n }",
"function getBridgeGateway() {\n return $this->bridgeGateway;\n }",
"public function config_get(){\n\t\treturn $this->fb->exec('dhcp.config_get');\n\t}",
"public function getCfg()\n {\n return $this->get(self::_CFG);\n }",
"public function get_config()\n\t{\n\t\treturn $this->cfg;\n\t}",
"public function getConfiguration()\n {\n return $this->_config;\n }",
"public function getWellKnownConfiguration(): object\n {\n return $this->WellKnownUMA2Configuration;\n }",
"private function getAmqpConfig()\n {\n if ($this->amqpConfig === null) {\n $this->amqpConfig = \\Magento\\Framework\\App\\ObjectManager::getInstance()->get(AmqpConfig::class);\n }\n\n return $this->amqpConfig;\n }",
"public function getConnectionConfig() {\n return $this->connectionConfig;\n }",
"public function getBuilderConfig()\n {\n return $this->builder_config;\n }",
"public function getConfig(){\n\t\t$request = $this->_sendPacketToController(self::GET_CONFIG);\n\t\tif ($request->getState() == self::STATE_OK) // If the packet is send sucefully\n\t\t\treturn $this->_getResponse(); // TODO mettre en forme la sortie\n\t\telse\n\t\t\treturn $request;\n\t}",
"public function getConfiguration()\n\t{\n\t\treturn $this->configuration;\n\t}",
"public function getConfiguration()\n {\n if (is_null($this->_configuration)) {\n $this->_configuration = Configuration::get('config');\n }\n return $this->_configuration;\n }",
"public function getGateways()\n {\n if (empty($this->cached_gateways)) {\n // results are cached within this object\n $definedIntf = $this->getDefinedInterfaces();\n $dynamic_gw = array();\n $gatewaySeq = 1;\n $i = 0; // sequence used in legacy edit form (item in the list)\n $reservednames = array();\n\n // add loopback, lowest priority\n $this->cached_gateways[$this->newKey(255)] = [\n 'name' => 'Null4',\n 'if' => 'lo0',\n 'interface' => 'loopback',\n 'ipprotocol' => 'inet',\n 'gateway' => '127.0.0.1',\n 'priority' => 255,\n 'is_loopback' => true\n ];\n $this->cached_gateways[$this->newKey(255)] = [\n 'name' => 'Null6',\n 'if' => 'lo0',\n 'interface' => 'loopback',\n 'ipprotocol' => 'inet6',\n 'gateway' => '::1',\n 'priority' => 255,\n 'is_loopback' => true\n ];\n // iterate configured gateways\n if (!empty($this->configHandle->gateways)) {\n foreach ($this->configHandle->gateways->children() as $tag => $gateway) {\n if ($tag == \"gateway_item\" && !empty($gateway)) {\n if (in_array((string)$gateway->name, $reservednames)) {\n syslog(LOG_WARNING, 'Gateway: duplicated entry \"' . $gateway->name . '\" in config.xml needs manual removal');\n }\n $reservednames[] = (string)$gateway->name;\n $gw_arr = array();\n foreach ($gateway as $key => $value) {\n $gw_arr[(string)$key] = (string)$value;\n }\n if (empty($gw_arr['priority'])) {\n // default priority\n $gw_arr['priority'] = 255;\n }\n if (empty($gw_arr['ipprotocol'])) {\n // default address family\n $gw_arr['ipprotocol'] = 'inet';\n }\n $gw_arr['if'] = $this->getRealInterface($definedIntf, $gw_arr['interface'], $gw_arr['ipprotocol']);\n $gw_arr['attribute'] = $i++;\n if (Util::isIpAddress($gateway->gateway)) {\n if (empty($gw_arr['monitor_disable']) && empty($gw_arr['monitor'])) {\n $gw_arr['monitor'] = $gw_arr['gateway'];\n }\n $gwkey = $this->newKey($gw_arr['priority'], !empty($gw_arr['defaultgw']));\n $this->cached_gateways[$gwkey] = $gw_arr;\n } else {\n // dynamic gateways might have settings, temporary store\n if (empty($dynamic_gw[(string)$gateway->interface])) {\n $dynamic_gw[(string)$gateway->interface] = array();\n }\n $gw_arr['dynamic'] = true;\n $dynamic_gw[(string)$gateway->interface][] = $gw_arr;\n }\n }\n }\n }\n // add dynamic gateways\n foreach ($definedIntf as $ifname => $ifcfg) {\n if (empty($ifcfg['enable'])) {\n // only consider active interfaces\n continue;\n }\n foreach ([\"inet\", \"inet6\"] as $ipproto) {\n // filename suffix and interface type as defined in the interface\n $descr = !empty($ifcfg['descr']) ? $ifcfg['descr'] : $ifname;\n $realif = $this->getRealInterface($definedIntf, $ifname, $ipproto);\n $ctype = self::convertType($ipproto, $ifcfg);\n $ctype = $ctype != null ? $ctype : \"GW\";\n // default configuration, when not set in gateway_item\n $thisconf = [\n \"interface\" => $ifname,\n \"weight\" => 1,\n \"ipprotocol\" => $ipproto,\n \"name\" => strtoupper(\"{$descr}_{$ctype}\"),\n \"descr\" => \"Interface \" . strtoupper(\"{$descr}_{$ctype}\") . \" Gateway\",\n \"monitor_disable\" => true, // disable monitoring by default\n \"gateway_interface\" => false, // Dynamic gateway policy\n \"if\" => $realif,\n \"dynamic\" => true,\n \"virtual\" => true\n ];\n // set default priority\n if (strstr($realif, 'gre') || strstr($realif, 'gif') || strstr($realif, 'ovpn')) {\n // consider tunnel type interfaces least attractive by default\n $thisconf['priority'] = 255;\n } else {\n $thisconf['priority'] = 254;\n }\n // locate interface gateway settings\n if (!empty($dynamic_gw[$ifname])) {\n foreach ($dynamic_gw[$ifname] as $gwidx => $gw_arr) {\n if ($gw_arr['ipprotocol'] == $ipproto) {\n // dynamic gateway for this ip protocol found, use config\n unset($dynamic_gw[$ifname][$gwidx]);\n $thisconf = $gw_arr;\n break;\n }\n }\n }\n if (!empty($thisconf['virtual']) && in_array($thisconf['name'], $reservednames)) {\n /* if name is already taken, don't try to add a new (virtual) entry */\n } elseif (($router = $this->getRouterFromFile($realif, $ipproto)) != null) {\n $thisconf['gateway'] = $router;\n if (empty($thisconf['monitor_disable']) && empty($thisconf['monitor'])) {\n $thisconf['monitor'] = $thisconf['gateway'];\n }\n $gwkey = $this->newKey($thisconf['priority'], !empty($thisconf['defaultgw']));\n $this->cached_gateways[$gwkey] = $thisconf;\n } elseif (!empty($ifcfg['gateway_interface']) || substr($realif, 0, 5) == 'ovpnc') {\n // XXX: ditch ovpnc in a major upgrade in the future, supersede with interface setting\n // gateway_interface\n\n // other predefined types, only bound by interface (e.g. openvpn)\n $gwkey = $this->newKey($thisconf['priority'], !empty($thisconf['defaultgw']));\n // gateway should only contain a valid address, make sure its empty\n unset($thisconf['gateway']);\n $thisconf['gateway_interface'] = true;\n $this->cached_gateways[$gwkey] = $thisconf;\n } elseif (\n $ipproto == 'inet6'\n && in_array($ifcfg['ipaddrv6'] ?? null, ['slaac', 'dhcp6', '6to4', '6rd'])\n ) {\n // Dynamic IPv6 interface, but no router solicit response received using rtsold.\n $gwkey = $this->newKey($thisconf['priority'], !empty($thisconf['defaultgw']));\n // gateway should only contain a valid address, make sure its empty\n unset($thisconf['gateway']);\n $this->cached_gateways[$gwkey] = $thisconf;\n } elseif (empty($thisconf['virtual'])) {\n // skipped dynamic gateway from config, add to $dynamic_gw to handle defunct\n $dynamic_gw[$ifname][] = $thisconf;\n }\n }\n }\n // sort by priority\n krsort($this->cached_gateways);\n // entries left in $dynamic_gw are defunct, add them in in disabled state\n foreach ($dynamic_gw as $intfgws) {\n foreach ($intfgws as $gw_arr) {\n if (!empty($gw_arr)) {\n $gw_arr['disabled'] = true;\n $gw_arr['defunct'] = true;\n unset($gw_arr['gateway']);\n $this->cached_gateways[] = $gw_arr;\n }\n }\n }\n }\n return $this->cached_gateways;\n }",
"public function getPaymentGateway()\n {\n return Mage::getStoreConfig(\"fontis_masterpass/settings/payment_gateway\");\n }",
"public function getConfig() {\n \t\n \t// Return our configuration\n \treturn $this->aConfig;\n }",
"public function getBackupConfig()\n {\n return $this->backup_config;\n }",
"public function getNodeRouteConfig();",
"public function getConfiguration()\n {\n return $this->configuration;\n }",
"public function getConfiguration() {\n return $this->configuration;\n }",
"public function getConfig()\r\n {\r\n $db = $this->_getDb();\r\n\r\n // Get the database configuration information\r\n return $this->_db->getConfig();\r\n\r\n }"
]
| [
"0.6386499",
"0.6013296",
"0.5682695",
"0.55111504",
"0.54396695",
"0.5298628",
"0.5293069",
"0.52928895",
"0.52668864",
"0.5256975",
"0.5221205",
"0.51404005",
"0.5089089",
"0.5082769",
"0.5062998",
"0.50564456",
"0.5043364",
"0.5042661",
"0.5020407",
"0.50155747",
"0.49600717",
"0.49574476",
"0.49383923",
"0.48814946",
"0.48796123",
"0.48762167",
"0.4875255",
"0.486779",
"0.48641005",
"0.484269"
]
| 0.6641214 | 0 |
Sets the bgpConfiguration The border gateway protocol specifies the IP address and ASN for directing traffic from a link to the edge. | public function setBgpConfiguration($val)
{
$this->_propDict["bgpConfiguration"] = $val;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function setProtocol($protocol)\n {\n $this->protocol = $protocol;\n }",
"public function configure() {\r\n\t\t$this->logger->info ( 'Setting up WAN interface: ' . ( string ) $this->data->if );\r\n\t\t$this->stop ();\r\n\t\t\r\n\t\t//\t\tSet MTU\n\t\tif (( string ) $this->data->mtu != '') {\r\n\t\t\tFunctions::shellCommand ( \"/sbin/ifconfig \" . ( string ) $this->data->if . \" mtu \" . ( string ) $this->data->mtu );\r\n\t\t}\r\n\t\t\r\n\t\t//\t\tSpoof mac address\n\t\tif (Functions::isMacAddress ( ( string ) $this->data->mac )) {\r\n\t\t\tFunctions::shellCommand ( \"/sbin/ifconfig \" . escapeshellarg ( $this->data->if ) . \" link \" . escapeshellarg ( $this->data->mac ) );\r\n\t\t} else {\r\n\t\t\t$mac = $this->getMacAddress ();\r\n\t\t\tif ($mac == \"ff:ff:ff:ff:ff:ff\") {\r\n\t\t\t\t/* this is not a valid mac address. */\r\n\t\t\t\t$this->logger->info ( \"Generating new MAC address for WAN interface.\" );\r\n\t\t\t\t$random_mac = $this->generateMacAddress ();\r\n\t\t\t\tFunctions::shellCommand ( \"/sbin/ifconfig \" . escapeshellarg ( $this->data->if ) . \" link \" . escapeshellarg ( $random_mac ) );\r\n\t\t\t\t$this->data->mac = $random_mac;\r\n\t\t\t\t\r\n\t\t\t\t$this->config->saveConfig ();\r\n\t\t\t\t$this->logger->info ( \"The invalid MAC(ff:ff:ff:ff:ff:ff) on interface \" . ( string ) $this->data->if . \" has been replaced with \" . $random_mac );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//\t\tSet IP address\n\t\tif (( string ) $this->data->ipaddr == 'dhcp') {\r\n\t\t\t$this->configureDHCP ();\r\n\t\t} elseif (Functions::is_ipAddr ( ( string ) $this->data->ipaddr )) {\r\n\t\t\tFunctions::shellCommand ( \"/sbin/ifconfig \" . ( string ) $this->data->if . \" \" . ( string ) $this->data->ipaddr . \"/\" . Functions::mask2prefix(( string ) $this->data->subnet) );\r\n\t\t\t//\t\tDefault gateway\n\t\t\tif ($this->data->gateway != '') {\r\n\t\t\t\tif (Functions::is_ipAddr ( ( string ) $this->data->gateway )) {\r\n\t\t\t\t\t$return = Functions::shellCommand ( \"/sbin/route add default \" . escapeshellarg ( $this->data->gateway ) );\r\n\t\t\t\t\tif ($return != \"\") {\r\n\t\t\t\t\t\t$this->logger->error ( 'Could not add default gateway, route returned the following message: {' . $return . '}' );\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->logger->info ( 'Could not add default gateway from WAN (' . ( string ) $this->data->ipaddr . ') invalid address' );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"protected function setGateway($gateway)\n {\n $this->gateway = $gateway;\n }",
"public function setTunnelConfiguration(?VpnTunnelConfigurationType $value): void {\n $this->getBackingStore()->set('tunnelConfiguration', $value);\n }",
"public function setTunnelConfiguration($val)\n {\n $this->_propDict[\"tunnelConfiguration\"] = $val;\n return $this;\n }",
"public function getBgpConfiguration()\n {\n if (array_key_exists(\"bgpConfiguration\", $this->_propDict)) {\n if (is_a($this->_propDict[\"bgpConfiguration\"], \"\\Beta\\Microsoft\\Graph\\Networkaccess\\Model\\BgpConfiguration\") || is_null($this->_propDict[\"bgpConfiguration\"])) {\n return $this->_propDict[\"bgpConfiguration\"];\n } else {\n $this->_propDict[\"bgpConfiguration\"] = new BgpConfiguration($this->_propDict[\"bgpConfiguration\"]);\n return $this->_propDict[\"bgpConfiguration\"];\n }\n }\n return null;\n }",
"public function configure() {\n\t\tLogger::getRootLogger()->info('Configuring IPSec');\n\t\t//\tCheck nat traversal setting\n\t\tif((string)$this->data['nat_traversal'] == 'true'){\n\t\t\t$nat_t = 'on';\n\t\t}\n\t\telse{\n\t\t\t$nat_t = 'off';\n\t\t}\n\t\t\n\t\t//\tPSK file\n\t\t$psk = '';\n\t\t\n\t\t//\tSetkey configuration\n\t\t$setkey = \"flush;\\n\";\n\t\t$setkey .= \"spdflush;\\n\";\n\t\t\n\t\t//\tRacoon.conf\n\t\t$ipsec = \"path pre_shared_key \\\"\" . self::PKS_PATH . \"\\\";\\n\";\n\t\t$ipsec .= \"path pidfile \\\"\" . self::PID_PATH . \"\\\";\\n\";\n\t\t$ipsec .= \"path certificate \\\"\" . self::CERT_PATH . \"\\\";\\n\";\n\t\t$ipsec .= <<<EOD\nlog debug; #log verbosity setting: set to 'notify' when testing and debugging is complete\n\npadding # options are not to be changed\n{\n maximum_length 20;\n randomize off;\n strict_check off;\n exclusive_tail off;\n}\n\ntimer # timing options. change as needed\n{\n counter 5;\n interval 20 sec;\n persend 1;\n \nEOD;\n\t\tif ($nat_t == 'on') {\n\t\t\t$ipsec .= \" natt_keepalive 15 sec;\\n\";\n\t\t}\n\t\t$ipsec .= <<<EOD\n phase1 30 sec;\n phase2 15 sec;\n}\n\nEOD;\n\n\t\tif(count($this->data->tunnels->tunnel) > 0){\n\t\t\t//\tGenerate configuration for each tunnel\n\t\t\tforeach($this->data->tunnels->tunnel as $tunnel){\n\t\t\t\tif((string)$tunnel['enable'] == 'false'){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\n\t\t\t\tif((string)$this->data['nat_traversal'] == 'true'){\n\t\t\t\t\t$nat_traversal = 'on';\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$nat_traversal = 'off';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//\tParse my identifier\n\t\t\t\tif((string)$tunnel->phase1->identifier['type'] == 'ipaddr'){\n\t\t\t\t\t$my_identifier = 'address '.(string)$tunnel->phase1->identifier;\n\t\t\t\t}\n\t\t\t\telseif((string)$this->phase1->identifier['type'] == 'my_ip'){\n\t\t\t\t\t$wan = $this->framework->getPlugin('Wan');\n\t\t\t\t\tif($wan != null){\n\t\t\t\t\t\t$my_identifier = 'address '.$wan->getIpAddress();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif((string)$tunnel->phase1->identifier['type'] == 'domainname'){\n\t\t\t\t\t//\tTODO: Find out what we enter here\n\t\t\t\t}\n\t\t\t\telseif((string)$tunnel->phase1->identifier['type'] == 'fqdn'){\n\t\t\t\t\t//\tTODO: Find out what we enter here\n\t\t\t\t}\n\t\t\t\telseif((string)$tunnel->phase1->identifier['type'] == 'dyndns'){\n\t\t\t\t\t//\tTODO: Find out what we enter here\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//\tParse local part\n\t\t\t\tif((string)$tunnel->local->type == 'lan_subnet'){\n\t\t\t\t\t$lan = $this->framework->getPlugin('Lan');\n\t\t\t\t\tif($lan != null){\n\t\t\t\t\t\t$subnet = Functions::prefix2mask($lan->getSubnet());\n\t\t\t\t\t\t$ip = $lan->getIpAddress();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t//\tCalculate network\n\t\t\t\t\t\t$network = Functions::calculateNetwork($ip,$subnet);\n\t\t\t\t\t\t$local['subnet'] = $lan->getSubnet();\n\t\t\t\t\t\t$local['network'] = $network;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tLogger::getRootLogger()->error('Error during tunnel configuration, could not load Lan plugin');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif((string)$tunnel->local->type == 'ipaddr'){\n\t\t\t\t\t$local['network'] = (string)$tunnel->local->{'private_ip'};\n\t\t\t\t\t$local['subnet'] = '32';\n\t\t\t\t}\n\t\t\t\telseif((string)$tunnel->local->type == 'network'){\n\t\t\t\t\t$local['network'] = (string)$tunnel->local->{'private_ip'};\n\t\t\t\t\t$local['subnet'] = (string)$tunnel->local->{'private_subnet'};\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//\tParse remote part\n\t\t\t\tif((string)$tunnel->remote->type == 'ipaddr'){\n\t\t\t\t\t$remote['network'] = (string)$tunnel->remote->{'private_ip'};\n\t\t\t\t\t$remote['subnet'] = '32';\n\t\t\t\t}\n\t\t\t\telseif((string)$tunnel->remote->type == 'network'){\n\t\t\t\t\t$remote['network'] = (string)$tunnel->remote->{'private_ip'};\n\t\t\t\t\t$remote['subnet'] = (string)$tunnel->remote->{'private_subnet'};\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$ipsec .= <<<EOD\nremote {$tunnel->remote->{'public-ip'}} [500]\n{\n exchange_mode {$tunnel->phase1->{'exchange-mode'}};\n doi ipsec_doi;\n situation identity_only;\n my_identifier {$my_identifier};\n peers_identifier\taddress {$tunnel->remote{'public-ip'}};\n lifetime time 8 hour;\n passive off;\n proposal_check obey;\n nat_traversal {$nat_traversal};\n generate_policy off;\n \n proposal {\nEOD;\n\t \t$ipsec .= \" encryption_algorithm \".str_replace('|',', ',(string)$tunnel->phase1->{'encryption-algorithm'}).\";\";\n\t \t$ipsec .= \" hash_algorithm \".str_replace('|',', ',(string)$tunnel->phase1->{'hash-algorithm'}).\";\";\n\t \t\n\t \tif($tunnel->phase1->{'authentication-method'}['type'] == 'psk'){\n\t \t\t$authentication_method = 'pre_shared_key';\n\t \t\tforeach($this->keys->key as $key){\n\t \t\t\tif($key['id'] == (string)$tunnel->phase1->{'authentication-method'}){\n\t \t\t\t\tbreak;\n\t \t\t\t}\n\t \t\t}\n\t \t\t$psk .= (string)$tunnel->remote->{'public-ip'}.\"\\t\".html_entity_decode((string)$key->content).\"\\n\";\n\t \t}\n\t \telseif($tunnel->phase1->{'authentication-method'}['type'] == 'rsasig'){\n\t \t\t$authentication_method = 'rsasig';\n\t \t}\n\t \t\n\t \t$ipsec .= \" authentication_method \".$authentication_method.\";\\n\";\n\t \t$ipsec .= \" lifetime time \".(string)$tunnel->phase1->lifetime.\";\\n\";\n\t \t$ipsec .= \" dh_group \".(string)$tunnel->phase1->dhgroup.\";\\n\";\n\t\n\t\t\t\t//Add certificate information to the proposal\n\t\t\t\tif ($tunnel->phase1->{'authentication-method'}['type'] == 'rsasig') {\n\t\t\t\t\t//\t\tTODO: Add x509 certificate type\n\t\t\t\t\t\n\t\t\t\t\t//\tFind correct certificate\n\t\t\t\t\tforeach($this->data->certificates->certificate as $certificate){\n\t\t\t\t\t\tif($certificate['id'] == $tunnel->phase1->{'authentication-method'}){\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$ipsec .= \" certificate_type plain_rsa \\\"{$certificate->private}\\\"\\n\";\n\t\t\t\t\t$ipsec .= \" peers_certfile plain_rsa \\\"{$certificate->public}\\\"\\n\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Close proposal and remote\n\t\t\t\t$ipsec .= \"\\t}\\n}\\n\";\n\t\t\t\t\n\t\t\t\t//Create sainfo\n\t\t\t\t$ipsec .= \"sainfo (address {$local['network']}/{$local['subnet']} any address \".$tunnel->remote->{'private_ip'}.\"/\".$tunnel->remote->{'private_subnet'}.\" any)\";\n\t\t\t\t$ipsec .= <<<EOD\n{\n\t\tlifetime time {$tunnel->phase2->lifetime};\nEOD;\n\t\t\t\tif((string)$tunnel->phase2->pfsgroup != 'off' && (string)$tunnel->phase2->pfsgroup != ''){\n\t\t\t\t\t$ipsec .= \" pfs_group \".(string)$tunnel->phase2->pfsgroup;\n\t\t\t\t}\n\t\t\t\t$ipsec .= \" encryption_algorithm \".str_replace('|',', ',$tunnel->phase2->{'encryption-algorithm'}).\";\\n\";\n\t\t\t\t$ipsec .= \" authentication_algorithm \".$tunnel->phase2->{'authentication-algorithm'}.\";\\n\";\n\t\t\t\t$ipsec .= <<<EOD\n compression_algorithm deflate;\n}\n\nEOD;\n\t\t\t\t//\tSetkey config\n\t\t\t\t$setkey .= \"spdadd {$local['network']}/{$local['subnet']} {$remote['network']}/{$remote['subnet']} any -P out ipsec esp/tunnel/{$local['public-ip']}-{$remote['public-ip']}/use;\\n\";\n\t\t\t\t$setkey .= \"spdadd {$remote['network']}/{$remote['subnet']} {$local['network']}/{$local['subnet']} any -P in ipsec esp/tunnel/{$remote['public-ip']}-{$local['public-ip']}/use;\\n\";\n\t\t\t}\n\t\t\t\n\t\t\t//\tWrite out racoon and IPSEC config\n\t\t\t//Save setkey\n\t\t\t$fd = fopen ( self::SETKEY_PATH, \"w\" );\n\t\t\tif (! $fd) {\n\t\t\t\tLogger::getRootLogger ()->error ( \"Error: Could not write setkey conifg to \" . self::SETKEY_PATH );\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\tfwrite ( $fd, $setkey );\n\t\t\tfclose ( $fd );\n\t\t\t\n\t\t\t//Save IPsec config\n\t\t\t$fd = fopen ( self::CONFIG_PATH, \"w\" );\n\t\t\tif (! $fd) {\n\t\t\t\tLogger::getRootLogger ()->error ( \"Error: Could not write IPsec conifg to \" . self::CONFIG_PATH );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfwrite ( $fd, $ipsec );\n\t\t\tfclose ( $fd );\n\t\t\t\n\t\t\t//Save pre shared key file\n\t\t\t$fd = fopen ( self::PKS_PATH, \"w\" );\n\t\t\tif (! $fd) {\n\t\t\t\tLogger::getRootLogger ()->error ( \"Error: Could not write IPsec PKS to \" . self::PKS_PATH );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfwrite ( $fd, $psk);\n\t\t\tfclose ( $fd );\n\t\t\tchmod ( self::PKS_PATH, 0600 );\n\t\t\t\n\t\t\treturn true;\n }\n else{\n \tLogger::getRootLogger()->info('No IPSEC tunnels defined, aborting racoon configuration');\n \treturn false;\n }\n\t}",
"public function set_gateway( $gateway ) {\n\t\t$this->_gateway = $gateway;\n\n\t\t// Setup API key.\n\t\tStripeCheckout::setApiKey( $this->_gateway->get_secret_key() );\n\n\t\t// If we don't set this, Stripe will use latest version, which may break our implementation.\n\t\tStripeCheckout::setApiVersion( '2019-09-09' );\n\n\t\t// Setup plugin info.\n\t\tStripeCheckout::setAppInfo(\n\t\t\t'Membership 2 - Stripe Checkout',\n\t\t\tM2STRIPE_VERSION,\n\t\t\tsite_url()\n\t\t);\n\t}",
"public function configure()\n {\n if ($this->getTestMode()) {\n $this->braintree->config->environment('sandbox');\n } else {\n $this->braintree->config->environment('production');\n }\n\n // Set the keys\n $this->braintree->config->merchantId($this->getMerchantId());\n $this->braintree->config->publicKey($this->getPublicKey());\n $this->braintree->config->privateKey($this->getPrivateKey());\n }",
"public static function setProtocol($protocol) {\n\t\tself::$protocol = $protocol;\n\t}",
"public function setConfig()\n {\n $config = new Config;\n echo 'const signalingSrvAddr = \"'.$config->signalingServerAddress.'\"; const signalingSrvPort = \"'.$config->signalingServerPort.'\";';\n }",
"public function setConfiguration($config){\r\n $this->configuration=$config;\r\n }",
"public function setProtocol($protocol) {\n\t\t$this->apiConfig['protocol'] = $protocol;\n\t\treturn $this;\n\t}",
"public function setGateway(GatewayInterface $gateway) {\n $this->gateway = $gateway;\n }",
"protected function _syncGatewayConfig() {\n if ($this->_gateway && $paymentGatewayCode = $this->getCurrentPaymentGateway()) {\n $gatewayConfiguration = $this->_gateway->configuration();\n if (isset($gatewayConfiguration['minimumAmount'])) {\n $this->model_setting_setting->editSettingValue('payment_'.$this->_getPaymentMethodCode(), 'payment_'.$this->_getPaymentMethodCode().'_order_total', $gatewayConfiguration['minimumAmount'], $this->config->get('config_store_id'));\n }\n if (isset($gatewayConfiguration['name'])) {\n $this->model_setting_setting->editSettingValue('payment_'.$this->_getPaymentMethodCode(), 'payment_'.$this->_getPaymentMethodCode().'_title', $gatewayConfiguration['name'], $this->config->get('config_store_id'));\n }\n if (isset($gatewayConfiguration['description'])) {\n $this->model_setting_setting->editSettingValue('payment_'.$this->_getPaymentMethodCode(), 'payment_'.$this->_getPaymentMethodCode().'_description', $gatewayConfiguration['description'], $this->config->get('config_store_id'));\n }\n }\n }",
"public function add_configuration() {\n\t\tENDA_Woocommerce_Bundle_Shipping::display_configuration_layer();\n\t\texit();\n\t}",
"private function configureRouting()\n {\n // Setup the router.\n $router = new FastRoute([]);\n\n // Add routes.\n $router->addRoutes([\n new Route('/', Controller\\Home::class, 'home'),\n ]);\n\n // Set the router object.\n $this->setRouter($router);\n }",
"public function setNodeRouteConfig($config);",
"protected function updateNetworkSwitchRoutingOspfRequest($network_id, $update_network_switch_routing_ospf = null)\n {\n // verify the required parameter 'network_id' is set\n if ($network_id === null || (is_array($network_id) && count($network_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network_id when calling updateNetworkSwitchRoutingOspf'\n );\n }\n\n $resourcePath = '/networks/{networkId}/switch/routing/ospf';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($network_id !== null) {\n $resourcePath = str_replace(\n '{' . 'networkId' . '}',\n ObjectSerializer::toPathValue($network_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($update_network_switch_routing_ospf)) {\n $_tempBody = $update_network_switch_routing_ospf;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');\n if ($apiKey !== null) {\n $headers['X-Cisco-Meraki-API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function loadConfiguration(): void\n {\n $config = $this->getConfig() + $this->defaults;\n $this->setConfig($config);\n\n $cb = $this->getContainerBuilder();\n\n $routingFilePath = $config['routingFile'];\n $neonRoutesLoader = $cb->addDefinition($this->prefix('neonRoutesLoader'));\n $neonRoutesLoader->setClass(NeonRoutesLoader::class)\n ->setArguments([Helpers::expand($routingFilePath, $cb->parameters), $config['autoInternalIds']]);\n\n $neonLocalesLoader = $cb->addDefinition($this->prefix('neonLocalesLoader'));\n $neonLocalesLoader->setClass(NeonLocalesLoader::class)\n ->setArguments([Helpers::expand($routingFilePath, $cb->parameters)]);\n\n $router = $cb->addDefinition($this->prefix('router'));\n $router->setClass(Router::class)\n ->addSetup('setAsSecured', [$config['isSecured']])\n ->addSetup('setFilesExtension', [$config['extension']]);\n }",
"public function setConfiguration($configuration) {\n $this->_storageDirectory = $configuration->getOption(\n 'PAPAYA_MEDIA_STORAGE_DIRECTORY', $this->_storageDirectory\n );\n $this->_storageDirectoryDepth = $configuration->getOption(\n 'PAPAYA_MEDIA_STORAGE_DIRECTORY_DEPTH', $this->_storageDirectoryDepth\n );\n $this->_publicDirectory = $configuration->getOption(\n 'PAPAYA_MEDIA_PUBLIC_DIRECTORY', $this->_publicDirectory\n );\n if (!empty($this->_publicDirectory) &&\n !is_dir($this->_publicDirectory)) {\n $this->_publicDirectory = '';\n }\n $this->_publicUrl = $configuration->getOption(\n 'PAPAYA_MEDIA_PUBLIC_URL', $this->_publicUrl\n );\n if (substr($this->_publicDirectory, -1) == '/') {\n $this->_publicDirectory = substr($this->_publicDirectory, 0, -1);\n }\n }",
"public function setConfig(Configuration $config);",
"private function __saveConfiguration()\n {\n //Check is submit the form\n if (Tools::isSubmit(BECOPAY_PREFIX . 'submit')) {\n\n //clear errors messages\n $this->_errors = array();\n\n //validate is set configuration field\n foreach ($this->config['configuration'] as $config) {\n if ($config['isRequired'] && Tools::getValue(BECOPAY_PREFIX . $config['name']) == NULL)\n $this->_errors[] = $this->l($config['title'] . ' is require');\n }\n\n //if has no errors check with PaymentGateway Constructor validation\n if (empty($this->_errors)) {\n try {\n new PaymentGateway(\n Tools::getValue(BECOPAY_PREFIX . 'apiBaseUrl'),\n Tools::getValue(BECOPAY_PREFIX . 'apiKey'),\n Tools::getValue(BECOPAY_PREFIX . 'mobile')\n );\n } catch (\\Exception $e) {\n $this->_errors[] = $e->getMessage();\n }\n }\n\n //Display error messages if has error\n if (!empty($this->_errors)) {\n $this->_html = $this->displayError(implode('<br>', $this->_errors));\n } else {\n\n //save configuration form fields\n foreach ($this->config['configuration'] as $config)\n if (Tools::getValue(BECOPAY_PREFIX . $config['name']) != NULL)\n Configuration::updateValue(BECOPAY_PREFIX . $config['name'], trim(Tools::getValue(BECOPAY_PREFIX . $config['name'])));\n\n\n //display confirmation message\n $this->_html = $this->displayConfirmation($this->l('Settings updated'));\n }\n }\n }",
"public function setFormConfiguration(array $formConfiguration)\n {\n $this->formConfiguration = $formConfiguration;\n }",
"public function setLinkConfiguration($linkConfiguration)\r\n {\r\n $this->linkConfiguration = $linkConfiguration;\r\n }",
"public function setGateway(GatewayInterface $gateway)\n {\n }",
"public function test_set_gateway_config()\n {\n\n $payumBuilder = m::spy('Payum\\Core\\PayumBuilder');\n $config = [\n 'gatewayConfigs' => [\n 'gatewayName' => [\n 'factory' => 'factory',\n 'username' => 'username',\n 'password' => 'password',\n ],\n 'gatewayName2' => [\n 'factory' => 'stdClass',\n 'username' => 'username',\n 'password' => 'password',\n ],\n ],\n 'storage.gatewayConfig' => 'eloquent',\n ];\n $app = m::spy('Illuminate\\Contracts\\Foundation\\Application');\n\n $gatewayConfig = m::spy('Recca0120\\LaravelPayum\\Model\\GatewayConfig');\n $gatewayFactory = m::spy('Payum\\Core\\GatewayFactoryInterface');\n\n /*\n |------------------------------------------------------------\n | Act\n |------------------------------------------------------------\n */\n\n $app->shouldReceive('make')->andReturn($gatewayConfig);\n\n $gatewayConfig\n ->shouldReceive('newQuery')->andReturnSelf()\n ->shouldReceive('get')->andReturnSelf()\n ->shouldReceive('all')->andReturn([$gatewayConfig])\n ->shouldReceive('getGatewayName')->once()->andReturn('fooGateway')\n ->shouldReceive('getFactoryName')->once()->andReturn('fooFactoryName')\n ->shouldReceive('getConfig')->once()->andReturn([\n 'foo' => 'bar',\n ]);\n\n $manager = new PayumBuilderManager($payumBuilder, $config, $app);\n\n /*\n |------------------------------------------------------------\n | Assert\n |------------------------------------------------------------\n */\n\n $manager->setGatewayConfig();\n\n foreach ($config['gatewayConfigs'] as $gatewayName => $gatewayConfig) {\n $payumBuilder->shouldReceive('addGatewayFactory')->with($gatewayName, m::on(function ($closure) use ($gatewayConfig, $gatewayFactory) {\n $closure($gatewayConfig, $gatewayFactory);\n\n return true;\n }));\n }\n }",
"public static function setRouting(sfRouting $routing)\n {\n self::$routing = $routing;\n }",
"protected function setupFirewall()\n {\n $this->firewall = new Firewall($this->entryFactory, $this->listMerger);\n $this->firewall->setDefaultState(true);\n $this->updateRules();\n }",
"public function test_set_core_gateway_factory_config()\n {\n\n $payumBuilder = m::spy('Payum\\Core\\PayumBuilder');\n $config = [];\n $app = m::spy('Illuminate\\Contracts\\Foundation\\Application');\n\n $coreGatewayFactoryConfig = [];\n\n /*\n |------------------------------------------------------------\n | Act\n |------------------------------------------------------------\n */\n\n $manager = new PayumBuilderManager($payumBuilder, $config, $app);\n\n /*\n |------------------------------------------------------------\n | Assert\n |------------------------------------------------------------\n */\n\n $manager->setCoreGatewayFactoryConfig($coreGatewayFactoryConfig);\n\n $payumBuilder->shouldHaveReceived('setCoreGatewayFactoryConfig')->with($config)->once();\n }"
]
| [
"0.49186736",
"0.48911765",
"0.48115307",
"0.4742167",
"0.46344241",
"0.4634273",
"0.46238446",
"0.45721507",
"0.4571221",
"0.45554495",
"0.45362088",
"0.45360526",
"0.4418262",
"0.4401139",
"0.43713194",
"0.43361768",
"0.43331173",
"0.43061447",
"0.4282234",
"0.4274063",
"0.42253757",
"0.42126203",
"0.41884783",
"0.41665518",
"0.41603586",
"0.41476488",
"0.41428733",
"0.413103",
"0.4117067",
"0.41049364"
]
| 0.6310803 | 0 |
Gets the deviceVendor Specifies the manufacturer of the deviceLink. The possible values are: barracudaNetworks, checkPoint, ciscoMeraki, citrix, fortinet, hpeAruba, netFoundry, nuage, openSystems, paloAltoNetworks, riverbedTechnology, silverPeak, vmWareSdWan, versa, other, unknownFutureValue. | public function getDeviceVendor()
{
if (array_key_exists("deviceVendor", $this->_propDict)) {
if (is_a($this->_propDict["deviceVendor"], "\Beta\Microsoft\Graph\Networkaccess\Model\DeviceVendor") || is_null($this->_propDict["deviceVendor"])) {
return $this->_propDict["deviceVendor"];
} else {
$this->_propDict["deviceVendor"] = new DeviceVendor($this->_propDict["deviceVendor"]);
return $this->_propDict["deviceVendor"];
}
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDeviceManufacturer()\n {\n return $this->deviceManufacturer;\n }",
"public function getDeviceManufacturer() {}",
"public function getManufacturer()\n {\n if (array_key_exists(\"manufacturer\", $this->_propDict)) {\n return $this->_propDict[\"manufacturer\"];\n } else {\n return null;\n }\n }",
"public function getManufacturer()\n {\n if (array_key_exists(\"manufacturer\", $this->_propDict)) {\n return $this->_propDict[\"manufacturer\"];\n } else {\n return null;\n }\n }",
"public function getManufacturer()\n {\n return $this->manufacturer;\n }",
"public function getVendor()\n {\n if ($this->_oVendor === null) {\n $this->_oVendor = $this->getProduct()->getVendor(false);\n }\n\n return $this->_oVendor;\n }",
"public function GetVendor()\n\t{\n\t\treturn $this->vendor;\n\t}",
"public function getVendor()\n {\n return $this->_coreRegistry->registry('current_vendor');\n }",
"public function setDeviceVendor($val)\n {\n $this->_propDict[\"deviceVendor\"] = $val;\n return $this;\n }",
"public function getManufacturer()\n {\n if ($this->_oManufacturer === null) {\n $this->_oManufacturer = $this->getProduct()->getManufacturer(false);\n }\n\n return $this->_oManufacturer;\n }",
"public function getBrand(): string\n {\n return AbstractDeviceParser::getShortCode($this->brand);\n }",
"public function getManufacturer()\n {\n }",
"public function getVendorCode()\n {\n return $this->vendorCode;\n }",
"public function getDevice()\n {\n return $this->device;\n }",
"public function getDevice()\n {\n return $this->device;\n }",
"public function getDevice()\n {\n return $this->device;\n }",
"public function getDevice()\n {\n return $this->device;\n }",
"public function getPromotionVendorCode()\n {\n return $this->promotionVendorCode;\n }",
"public function getVendorCode ()\n\t{\n\t\treturn self::CODE;\n\t}",
"public function getVendorCode ()\n\t{\n\t\treturn self::CODE;\n\t}",
"private function getManufacturer($product)\n { \n $manufacturers= $product->manufacturers;\n\n if(!$manufacturers->isEmpty())\n {\n $manufacturerName=NULL;\n\n foreach ($manufacturers as $manufacturer) {\n\n $manufacturerName .= $manufacturer->manufacturer_name. '+';\n }\n return trim($manufacturerName,'+');\n }\n else\n {\n return NULL;\n }\n }",
"public function getManufacturerName()\n {\n $oManufacturer = $this->getManufacturer();\n\n if ($oManufacturer instanceof oxManufacturer) {\n return $oManufacturer->getTitle();\n }\n\n return null;\n }",
"public function getBrand()\n {\n return $this->brand;\n }",
"public function getBrand()\n {\n return $this->brand;\n }",
"public function getBrand()\n {\n foreach ($this->getSupportedBrands() as $brand => $val) {\n if (preg_match($val, $this->getNumber())) {\n return $brand;\n }\n }\n }",
"public function getDevice()\n {\n return $this->readOneof(9);\n }",
"public function getDeviceName()\n {\n return $this->deviceName;\n }",
"public function getBrand()\n {\n $brandAttribute = $this->helper->getBrandConfig();\n\n return $this->getAttribute($brandAttribute);\n }",
"public function getBrand(): ?string\n {\n return $this->brand;\n }",
"public function getVendorName(): string;"
]
| [
"0.71462053",
"0.7106529",
"0.6597652",
"0.6597652",
"0.6532795",
"0.638085",
"0.63399684",
"0.6294418",
"0.6145416",
"0.609923",
"0.60385114",
"0.5724036",
"0.57028836",
"0.5611038",
"0.5611038",
"0.5611038",
"0.5611038",
"0.5604045",
"0.553125",
"0.553125",
"0.5433874",
"0.5402903",
"0.5386688",
"0.5386688",
"0.5377595",
"0.5341348",
"0.5338313",
"0.53302944",
"0.5319153",
"0.53164166"
]
| 0.7702862 | 0 |
Sets the deviceVendor Specifies the manufacturer of the deviceLink. The possible values are: barracudaNetworks, checkPoint, ciscoMeraki, citrix, fortinet, hpeAruba, netFoundry, nuage, openSystems, paloAltoNetworks, riverbedTechnology, silverPeak, vmWareSdWan, versa, other, unknownFutureValue. | public function setDeviceVendor($val)
{
$this->_propDict["deviceVendor"] = $val;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setDeviceManufacturer($deviceManufacturer)\n {\n $this->deviceManufacturer = $deviceManufacturer;\n }",
"public function setDevice(Device $device);",
"public function setVendor(string $vendor)\n {\n }",
"public function setDevice(Device $device)\n {\n $this->device = $device;\n }",
"public function setDevice($var)\n {\n GPBUtil::checkString($var, True);\n $this->device = $var;\n\n return $this;\n }",
"public function setDevice($var)\n {\n GPBUtil::checkString($var, True);\n $this->device = $var;\n\n return $this;\n }",
"public function getDeviceVendor()\n {\n if (array_key_exists(\"deviceVendor\", $this->_propDict)) {\n if (is_a($this->_propDict[\"deviceVendor\"], \"\\Beta\\Microsoft\\Graph\\Networkaccess\\Model\\DeviceVendor\") || is_null($this->_propDict[\"deviceVendor\"])) {\n return $this->_propDict[\"deviceVendor\"];\n } else {\n $this->_propDict[\"deviceVendor\"] = new DeviceVendor($this->_propDict[\"deviceVendor\"]);\n return $this->_propDict[\"deviceVendor\"];\n }\n }\n return null;\n }",
"public function set_gateway_device($device)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n // Validate\n //---------\n // TODO\n\n // Update tag if it exists\n //------------------------\n\n $file = new File(self::FILE_NETWORK);\n $match = $file->replace_lines('/^GATEWAYDEV=/', \"GATEWAYDEV=\\\"$device\\\"\\n\");\n\n // If tag does not exist, add it\n //------------------------------\n\n if (! $match)\n $file->add_lines(\"GATEWAYDEV=\\\"\" . $device . \"\\\"\\n\");\n }",
"private function set_device(){\n\t\n\t}",
"public function setVendor($vendor){\r\n\t\t$this->config['vendor'] = $vendor;\r\n\t\treturn $this;\r\n\t}",
"public function SetDevice(&$device) {\n $this->device = $device;\n return true;\n }",
"public static function setDefaultVendor(string $vendor): void\n {\n self::$defaultVendor = $vendor;\n }",
"public function setManufacturer($val)\n {\n $this->_propDict[\"manufacturer\"] = $val;\n return $this;\n }",
"public function setManufacturer($val)\n {\n $this->_propDict[\"manufacturer\"] = $val;\n return $this;\n }",
"protected function _setVendor()\n {\n // use as the vendor name. e.g., './scripts/solar' => 'solar'\n $path = explode(DIRECTORY_SEPARATOR, $this->_argv[0]);\n $this->_vendor = end($path);\n \n // change vendor name to a class name prefix:\n // 'foo' => 'Foo'\n // 'foo-bar' => 'FooBar'\n // 'foo_bar' => 'FooBar'\n $this->_vendor = str_replace(array('-', '_'), ' ', $this->_vendor);\n $this->_vendor = ucwords($this->_vendor);\n $this->_vendor = str_replace(' ', '', $this->_vendor);\n }",
"public function setDeviceDescription($deviceDescription)\n {\n $this->deviceDescription = $deviceDescription;\n }",
"public function vendor($value)\n {\n $this->setProperty('vendor', $value);\n return $this;\n }",
"public function setDeviceModel($deviceModel)\n {\n $this->deviceModel = $deviceModel;\n }",
"public function setManufacturer(\\App\\Entity\\Product\\Details\\Manufacturer $manufacturer = null) \n { \n $this->manufacturer = $manufacturer;\n \n return $this;\n }",
"abstract public function setDeviceInfo(Horde_ActiveSync_Device $data, array $dirty = array());",
"public function setDevice($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Ads\\GoogleAds\\V4\\Enums\\FeedItemTargetDeviceEnum\\FeedItemTargetDevice::class);\n $this->writeOneof(9, $var);\n\n return $this;\n }",
"public function setVendorInformation(?SecurityVendorInformation $value): void {\n $this->getBackingStore()->set('vendorInformation', $value);\n }",
"private function SetVendorData()\n\t{\n\t\tif(isset($_REQUEST['vendorid'])) {\n\t\t\t$this->vendor = $this->LoadVendorById($_REQUEST['vendorid']);\n\t\t}\n\t\telse if(isset($GLOBALS['PathInfo'][1]) && $GLOBALS['PathInfo'][1] != '') {\n\t\t\t$this->vendor = $this->LoadVendorByFriendlyName($GLOBALS['PathInfo'][1]);\n\t\t}\n\n\t\t// Viewing the products that belong to a specific vendor\n\t\tif((isset($GLOBALS['PathInfo'][2]) && $GLOBALS['PathInfo'][2] == 'products') || (isset($_REQUEST['action']) && $_REQUEST['action'] == 'products')) {\n\t\t\tif(!is_array($this->vendor)) {\n\t\t\t\t$GLOBALS['ISC_CLASS_404'] = GetClass('ISC_404');\n\t\t\t\t$GLOBALS['ISC_CLASS_404']->HandlePage();\n\t\t\t}\n\n\t\t\t$this->displaying = 'products';\n\t\t}\n\n\t\t// Viewing a specific page\n\t\telse if((isset($GLOBALS['PathInfo'][2]) && $GLOBALS['PathInfo'][2] != '') || isset($_REQUEST['pageid'])) {\n\t\t\t//\n\t\t\tif(!is_array($this->vendor)) {\n\t\t\t\t$GLOBALS['ISC_CLASS_404'] = GetClass('ISC_404');\n\t\t\t\t$GLOBALS['ISC_CLASS_404']->HandlePage();\n\t\t\t}\n\n\t\t\t$this->displaying = 'page';\n\t\t}\n\n\t\t// Viewing vendor profile\n\t\telse if(isset($GLOBALS['PathInfo'][1]) || isset($_REQUEST['vendorid'])) {\n\t\t\tif(!is_array($this->vendor)) {\n\t\t\t\t$GLOBALS['ISC_CLASS_404'] = GetClass('ISC_404');\n\t\t\t\t$GLOBALS['ISC_CLASS_404']->HandlePage();\n\t\t\t}\n\t\t\t$this->displaying = 'profile';\n\t\t}\n\n\t\t// Otherwise, just showing a list of vendors\n\t\telse {\n\t\t\t$this->displaying = 'vendors';\n\t\t}\n\t}",
"public function getDeviceManufacturer()\n {\n return $this->deviceManufacturer;\n }",
"public function setDeviceName($deviceName)\n {\n $this->deviceName = $deviceName;\n }",
"public function getDeviceManufacturer() {}",
"protected function parseDevice(): void\n {\n $parsers = $this->getDeviceParsers();\n\n foreach ($parsers as $parser) {\n $parser->setYamlParser($this->getYamlParser());\n $parser->setCache($this->getCache());\n $parser->setUserAgent($this->getUserAgent());\n $parser->setClientHints($this->getClientHints());\n\n if ($parser->parse()) {\n $this->device = $parser->getDeviceType();\n $this->model = $parser->getModel();\n $this->brand = $parser->getBrand();\n\n break;\n }\n }\n\n /**\n * If no model could be parsed from useragent, we use the one from client hints if available\n */\n if ($this->clientHints instanceof ClientHints && empty($this->model)) {\n $this->model = $this->clientHints->getModel();\n }\n\n /**\n * If no brand has been assigned try to match by known vendor fragments\n */\n if (empty($this->brand)) {\n $vendorParser = new VendorFragment($this->getUserAgent());\n $vendorParser->setYamlParser($this->getYamlParser());\n $vendorParser->setCache($this->getCache());\n $this->brand = $vendorParser->parse()['brand'] ?? '';\n }\n\n $osName = $this->getOsAttribute('name');\n $osFamily = $this->getOsAttribute('family');\n $osVersion = $this->getOsAttribute('version');\n $clientName = $this->getClientAttribute('name');\n\n /**\n * Assume all devices running iOS / Mac OS are from Apple\n */\n if (empty($this->brand) && \\in_array($osName, ['iPadOS', 'tvOS', 'watchOS', 'iOS', 'Mac'])) {\n $this->brand = 'Apple';\n }\n\n /**\n * Chrome on Android passes the device type based on the keyword 'Mobile'\n * If it is present the device should be a smartphone, otherwise it's a tablet\n * See https://developer.chrome.com/multidevice/user-agent#chrome_for_android_user_agent\n * Note: We do not check for browser (family) here, as there might be mobile apps using Chrome, that won't have\n * a detected browser, but can still be detected. So we check the useragent for Chrome instead.\n */\n if (null === $this->device && 'Android' === $osFamily\n && $this->matchUserAgent('Chrome/[\\.0-9]*')\n ) {\n if ($this->matchUserAgent('(?:Mobile|eliboM) Safari/')) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_SMARTPHONE;\n } elseif ($this->matchUserAgent('(?!Mobile )Safari/')) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_TABLET;\n }\n }\n\n /**\n * Some UA contain the fragment 'Pad/APad', so we assume those devices as tablets\n */\n if (AbstractDeviceParser::DEVICE_TYPE_SMARTPHONE === $this->device && $this->matchUserAgent('Pad/APad')) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_TABLET;\n }\n\n /**\n * Some UA contain the fragment 'Android; Tablet;' or 'Opera Tablet', so we assume those devices as tablets\n */\n if (null === $this->device && ($this->hasAndroidTableFragment()\n || $this->matchUserAgent('Opera Tablet'))\n ) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_TABLET;\n }\n\n /**\n * Some user agents simply contain the fragment 'Android; Mobile;', so we assume those devices as smartphones\n */\n if (null === $this->device && $this->hasAndroidMobileFragment()) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_SMARTPHONE;\n }\n\n /**\n * Android up to 3.0 was designed for smartphones only. But as 3.0, which was tablet only, was published\n * too late, there were a bunch of tablets running with 2.x\n * With 4.0 the two trees were merged and it is for smartphones and tablets\n *\n * So were are expecting that all devices running Android < 2 are smartphones\n * Devices running Android 3.X are tablets. Device type of Android 2.X and 4.X+ are unknown\n */\n if (null === $this->device && 'Android' === $osName && '' !== $osVersion) {\n if (-1 === \\version_compare($osVersion, '2.0')) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_SMARTPHONE;\n } elseif (\\version_compare($osVersion, '3.0') >= 0\n && -1 === \\version_compare($osVersion, '4.0')\n ) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_TABLET;\n }\n }\n\n /**\n * All detected feature phones running android are more likely a smartphone\n */\n if (AbstractDeviceParser::DEVICE_TYPE_FEATURE_PHONE === $this->device && 'Android' === $osFamily) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_SMARTPHONE;\n }\n\n /**\n * All unknown devices under running Java ME are more likely a features phones\n */\n if ('Java ME' === $osName && null === $this->device) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_FEATURE_PHONE;\n }\n\n /**\n * According to http://msdn.microsoft.com/en-us/library/ie/hh920767(v=vs.85).aspx\n * Internet Explorer 10 introduces the \"Touch\" UA string token. If this token is present at the end of the\n * UA string, the computer has touch capability, and is running Windows 8 (or later).\n * This UA string will be transmitted on a touch-enabled system running Windows 8 (RT)\n *\n * As most touch enabled devices are tablets and only a smaller part are desktops/notebooks we assume that\n * all Windows 8 touch devices are tablets.\n */\n\n if (null === $this->device && ('Windows RT' === $osName || ('Windows' === $osName\n && \\version_compare($osVersion, '8') >= 0)) && $this->isTouchEnabled()\n ) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_TABLET;\n }\n\n /**\n * All devices running Opera TV Store are assumed to be a tv\n */\n if ($this->matchUserAgent('Opera TV Store| OMI/')) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_TV;\n }\n\n /**\n * All devices that contain Andr0id in string are assumed to be a tv\n */\n if ($this->matchUserAgent('Andr0id|Android TV|\\(lite\\) TV')) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_TV;\n }\n\n /**\n * All devices running Tizen TV or SmartTV are assumed to be a tv\n */\n if (null === $this->device && $this->matchUserAgent('SmartTV|Tizen.+ TV .+$')) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_TV;\n }\n\n /**\n * Devices running Kylo or Espital TV Browsers are assumed to be a TV\n */\n if (null === $this->device && \\in_array($clientName, ['Kylo', 'Espial TV Browser'])) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_TV;\n }\n\n /**\n * All devices containing TV fragment are assumed to be a tv\n */\n if (null === $this->device && $this->matchUserAgent('\\(TV;')) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_TV;\n }\n\n /**\n * Set device type desktop if string ua contains desktop\n */\n $hasDesktop = AbstractDeviceParser::DEVICE_TYPE_DESKTOP !== $this->device\n && false !== \\strpos($this->userAgent, 'Desktop')\n && $this->hasDesktopFragment();\n\n if ($hasDesktop) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_DESKTOP;\n }\n\n // set device type to desktop for all devices running a desktop os that were not detected as another device type\n if (null !== $this->device || !$this->isDesktop()) {\n return;\n }\n\n $this->device = AbstractDeviceParser::DEVICE_TYPE_DESKTOP;\n }",
"public function updateVendor() {\n try {\n if (!($this->vendor instanceof Base_Model_ObtorLib_App_Core_Catalog_Entity_Vendor)) {\n throw new Base_Model_ObtorLib_App_Core_Catalog_Exception(\" Vendor Entity not initialized\");\n } else {\n $objVendor = new Base_Model_ObtorLib_App_Core_Catalog_Dao_Vendor();\n $objVendor->vendor = $this->vendor;\n return $objVendor->updateVendor();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Catalog_Exception($ex);\n }\n }",
"public function setDeviceName(?string $value): void {\n $this->getBackingStore()->set('deviceName', $value);\n }",
"public function setDeviceName(?string $value): void {\n $this->getBackingStore()->set('deviceName', $value);\n }"
]
| [
"0.66789275",
"0.6464189",
"0.6416447",
"0.6207248",
"0.60399544",
"0.60399544",
"0.6018664",
"0.57282996",
"0.56930137",
"0.561832",
"0.5541386",
"0.5533856",
"0.54395324",
"0.54395324",
"0.53745323",
"0.5363561",
"0.5288544",
"0.52795124",
"0.5256711",
"0.5243659",
"0.52378744",
"0.5204176",
"0.51783866",
"0.5143126",
"0.51001614",
"0.5090959",
"0.50605273",
"0.5034768",
"0.49996543",
"0.49996543"
]
| 0.7360845 | 0 |
Sets the ipAddress Specifies the client IPv4 of the link | public function setIpAddress($val)
{
$this->_propDict["ipAddress"] = $val;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setIpAddress($ip_address);",
"public function setUseIPAddress($use_ipaddr) \n \t{\n \t\t$this->use_ipaddr = $use_ipaddr;\n \t}",
"public function setAddress($value)\n {\n $this->_address = $value;\n }",
"public function setClientIpAddress( $client_ip_address ) {\n\t\t$this->container['client_ip_address'] = $client_ip_address;\n\n\t\treturn $this;\n\t}",
"public function setImAddress($value)\n {\n $this->setProperty(\"ImAddress\", $value, true);\n }",
"public function setIp($value)\n {\n return $this->set(self::ip, $value);\n }",
"public function setIp($value)\n {\n return $this->set(self::IP, $value);\n }",
"public function setIp($value)\n {\n return $this->set(self::IP, $value);\n }",
"public function set_adresse_ip($adresse_ip)\n {\n $this->adresse_ip = $adresse_ip;\n\n return $this;\n }",
"public function ipAddress(string $ipAddress)\n {\n $this->ipAddress = $ipAddress;\n\n return $this;\n }",
"public function setAddr($value)\n {\n return $this->set(self::_ADDR, $value);\n }",
"public function setAddress($address);",
"public function setAddress($address);",
"public function setUrl($ip)\n {\n $this->url = $this->baseUrl . $ip . \"?access_key=\" . $this->apiKey;\n }",
"public function setAddress(Address $address);",
"public function setAddress($value)\n {\n \t$this->address = $value;\n \treturn $this;\n }",
"public function setAddress(Ipagare_PagSeguroDireto_Domain_Address $address) {\n $this->address = $address;\n }",
"public function setAddress($address) {\n\t\t$this->address = $address;\n\t}",
"public function Persona (){ \n\n $this->ip=$this->getIP();\n }",
"public function setAddress($address)\n {\n $this->address = $address;\n }",
"public function setAddress($value)\n {\n return $this->set('Address', $value);\n }",
"public function setAddress($value)\n {\n return $this->set('Address', $value);\n }",
"public function setAddress($value)\n {\n return $this->set('Address', $value);\n }",
"public function setAddress($value)\n {\n return $this->set('Address', $value);\n }",
"public function testIpAAddress()\n {\n $ipV4Address = new Ipv4address();\n $this->assertEquals(\"10.0.0.1\", $ipV4Address->getDecadic());\n $this->assertEquals(167772161, $ipV4Address->getInteger());\n $this->assertEquals(\"00001010000000000000000000000001\", $ipV4Address->getBinary());\n $this->assertEquals(32, strlen($ipV4Address->getBinary()));\n $this->assertCount(4, $ipV4Address->getAddressArray());\n $this->assertEquals(10, $ipV4Address->getAddressArray()[0]);\n $this->assertEquals(0, $ipV4Address->getAddressArray()[1]);\n $this->assertEquals(0, $ipV4Address->getAddressArray()[2]);\n $this->assertEquals(1, $ipV4Address->getAddressArray()[3]);\n }",
"public function getIpv4();",
"public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }",
"public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }",
"public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }",
"public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }"
]
| [
"0.7367176",
"0.6593632",
"0.6250391",
"0.62058276",
"0.60415035",
"0.6007055",
"0.59002715",
"0.59002715",
"0.5877243",
"0.5862426",
"0.57297117",
"0.57164884",
"0.57164884",
"0.5702911",
"0.56875527",
"0.56654865",
"0.5618168",
"0.5602469",
"0.5575204",
"0.5574926",
"0.557417",
"0.557417",
"0.557417",
"0.55725944",
"0.5556395",
"0.55472815",
"0.5543689",
"0.554309",
"0.554309",
"0.554309"
]
| 0.66739607 | 1 |
Gets the tunnelConfiguration The connectivity settings, including the protocol, IPSec policy, and preshared key, are specified for establishing connectivity. | public function getTunnelConfiguration()
{
if (array_key_exists("tunnelConfiguration", $this->_propDict)) {
if (is_a($this->_propDict["tunnelConfiguration"], "\Beta\Microsoft\Graph\Networkaccess\Model\TunnelConfiguration") || is_null($this->_propDict["tunnelConfiguration"])) {
return $this->_propDict["tunnelConfiguration"];
} else {
$this->_propDict["tunnelConfiguration"] = new TunnelConfiguration($this->_propDict["tunnelConfiguration"]);
return $this->_propDict["tunnelConfiguration"];
}
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getConnectionConfig() {\n return $this->connectionConfig;\n }",
"public function setTunnelConfiguration($val)\n {\n $this->_propDict[\"tunnelConfiguration\"] = $val;\n return $this;\n }",
"public function get_config()\n\t{\n\t\treturn $this->cfg;\n\t}",
"public function getConfiguration()\n {\n if (is_null($this->_configuration)) {\n $this->_configuration = Configuration::get('config');\n }\n return $this->_configuration;\n }",
"public function getGatewayConfig() {\r\n return $this->gatewayConfig;\r\n }",
"public function getConfig ()\n {\n $config = Mage::getModel('socnet/network')\n ->getConfigByNetworkKey($this->getNetworkKey());\n return $config;\n }",
"public function getConfig()\n {\n if (null === $this->_config) {\n $this->setConfig(new Configuration());\n }\n\n return $this->_config;\n }",
"public function getNetworkSettings() : NetworkSettings\n {\n return $this->networkSettings;\n }",
"public function getConfiguration()\n {\n return $this->_config;\n }",
"public function getLinkConfiguration()\r\n {\r\n return $this->linkConfiguration;\r\n }",
"public static function get_configuration()\n\t{\n\t\tif (empty(self::$_configuration))\n\t\t{\n\t\t\tself::check();\n\t\t}\n\t\treturn self::$_configuration;\n\t}",
"public function getCheckoutConfig()\n {\n return $this->_get('checkoutConfig');\n }",
"protected function getConfig()\n\t{\n\t\treturn $this->oConfig;\n\t}",
"public final function getConfig()\n {\n return clone($this->config);\n }",
"public function getConfigurarion()\n {\n return $this->configuration;\n }",
"protected function _getConfig()\n {\n return $this->_paypalConfig;\n }",
"public function getTunnelConfiguration(): ?VpnTunnelConfigurationType {\n $val = $this->getBackingStore()->get('tunnelConfiguration');\n if (is_null($val) || $val instanceof VpnTunnelConfigurationType) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'tunnelConfiguration'\");\n }",
"public function getConfiguration()\n\t{\n\t\treturn $this->configuration;\n\t}",
"public static function getDatabaseConnectionConfig()\n\t{\n\t\t// config file, if it exists\n\t\t$databaseConfig = config('database');\n\n\t\tif ($databaseConfig) {\n\t\t\t$connectionName = config('centinelApi.database.connection');\n\t\t\t$connectionName = ($connectionName == '{default}') ? config('database.default') : $connectionName;\n\n\t\t\tif ($connectionName && config('database.connections.' . $connectionName)) {\n\t\t\t\treturn config('database.connections.' . $connectionName);\n\t\t\t}\n\t\t}\n\n\t\t// Try to get config from .env\n\t\t$connection = [\n\t\t\t'driver' => env('DB_CONNECTION'),\n\t\t\t'host' => env('DB_HOST'),\n\t\t\t'port' => env('DB_PORT'),\n\t\t\t'database' => env('DB_DATABASE'),\n\t\t\t'username' => env('DB_USERNAME'),\n\t\t\t'password' => env('DB_PASSWORD'),\n\t\t];\n\n\t\treturn self::validateConnectionData($connection) ? $connection : null;\n\t}",
"static public function getConfig() {\n if (self::$config === null) {\n self::$config = JComponentHelper::getParams('com_bullhorn')->toObject();\n }\n return self::$config;\n }",
"public function getConfig()\n {\n if (!$this->configuration) {\n $this->getDatabaseConfiguration();\n }\n\n return $this->configuration;\n }",
"public function GetConfiguration() {\n //----------------------------------------------------------\n if ($this->Config != false) return $this->Config;\n //----------------------------------------------------------\n if ($this->test) {\n $this->testclass->AppendTest('GetConfiguration', array('type' => 'function_check'), array('file' => __FILE__, 'line' => __LINE__, 'function' => __FUNCTION__));\n }\n //----------------------------------------------------------\n $db_query = '\n SELECT *\n FROM `'.$this->db_prefix.$this->db_orbitvu.'configuration`\t\n ';\n\n //---------------------------------------------------------------------\n /**/\t$this->return_sql_debug(__FUNCTION__, $db_query);\n //---------------------------------------------------------------------\n\n try {\n $query = $this->database->FetchAll($db_query);\n }\n catch (Exception $e) {\n $this->Install();\n \n //----------------------------------------------------------\n /**/\t$this->return_debug(array(\n /**/\t\t'function' \t=> 'Install',\n /**/\t\t'response'\t=> 'Database installed!'\n /**/\t));\n //----------------------------------------------------------\n \n $query = $this->database->FetchAll($db_query);\n }\n\n /*\n * Synchronize config with current store configuration\n */\n $store_config = $this->database->GetConfiguration();\n\n //-------------------------------------------------------------------------------------------------------\n $conf = new stdClass();\n $i = 0;\n foreach ($query as $q) {\n $conf->$q['var'] = $q['value'];\n\n if (isset($store_config[$q['var']]) && $store_config[$q['var']] != $conf->$q['var']) {\n $this->SetConfiguration($q['var'], $store_config[$q['var']]);\n $conf->$q['var'] = $store_config[$q['var']];\n }\n $i++;\n }\n\n //----------------------------------------------------------\n /**/\t$this->return_debug(array(\n /**/\t\t'function' \t\t=> __FUNCTION__,\n /**/\t\t'configuration'\t=> $conf\n /**/\t));\n //----------------------------------------------------------\n\n //-------------------------------------------------------------------------------------------------------\n return $conf;\n //-------------------------------------------------------------------------------------------------------\n }",
"public function getConfig()\n\t{\n\t\t$config = new \\stdClass();\n\t\t$config->siteurl = $this->_config->siteurl;\n\t\t$config->host = $this->_config->host;\n\t\t$config->port = $this->_config->port;\n\t\t$config->dbname = $this->_config->dbname;\n\t\t$config->username = $this->_config->username;\n\t\t$config->password = $this->_config->password;\n\t\t$config->path = $this->_config->path;\n\t\t$config->options = $this->_config->options;\n\t\t$config->affiliateId = $this->_config->affiliateId;\n\n\t\treturn $config;\n\t}",
"public function get() {\n return new ConfigurationObject($this->config);\n }",
"private function getSessionConfig()\n {\n $sessionCreds = $this->getSessionCreds();\n $senderCreds = $sessionCreds->getSenderCredentials();\n $endpoint = $sessionCreds->getEndpoint();\n\n $config = [\n 'sender_id' => $senderCreds->getSenderId(),\n 'sender_password' => $senderCreds->getPassword(),\n 'endpoint_url' => $endpoint->getEndpoint(),\n 'verify_ssl' => $endpoint->getVerifySSL(),\n 'session_id' => $sessionCreds->getSessionId(),\n 'logger' => $sessionCreds->getLogger(),\n 'log_formatter' => $sessionCreds->getLogMessageFormat(),\n 'log_level' => $sessionCreds->getLogLevel(),\n ];\n\n return $config;\n }",
"public function getConfig()\n {\n if ($this->dbConnectionId !== null) {\n // Just return the PDO instance\n return Yii::app()->getComponent($this->dbConnectionId)->pdoInstance;\n }\n\n // Return the connection configuration;\n return array(\n 'dsn'=>$this->dsn,\n 'username'=>$this->username,\n 'password'=>$this->password\n );\n }",
"public function getCustomConnectionsConfig() {\n\t\treturn $this->_getConfigValueArray('customConnections');\n\t}",
"public function getConfig(): Config\n {\n return clone $this->config;\n }",
"public function getConfig()\n\t{\n\t\treturn $this->config;\n\t}",
"public function getConfig()\n\t{\n\t\treturn $this->config;\n\t}"
]
| [
"0.6334618",
"0.5614873",
"0.54226303",
"0.53869694",
"0.5336906",
"0.52784747",
"0.5230119",
"0.5229965",
"0.5227801",
"0.5216142",
"0.5178947",
"0.51748884",
"0.51627946",
"0.51074094",
"0.5093103",
"0.50871605",
"0.5063011",
"0.5058604",
"0.505433",
"0.5017653",
"0.50168324",
"0.50163656",
"0.5015392",
"0.5014265",
"0.5011232",
"0.500852",
"0.49895385",
"0.4985067",
"0.49821848",
"0.49821848"
]
| 0.7521247 | 0 |
Sets the tunnelConfiguration The connectivity settings, including the protocol, IPSec policy, and preshared key, are specified for establishing connectivity. | public function setTunnelConfiguration($val)
{
$this->_propDict["tunnelConfiguration"] = $val;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setTunnelConfiguration(?VpnTunnelConfigurationType $value): void {\n $this->getBackingStore()->set('tunnelConfiguration', $value);\n }",
"public function setProxyTunnel($tunnel = true)\n {\n $this->setOpt(\\CURLOPT_HTTPPROXYTUNNEL, $tunnel);\n\n return $this;\n }",
"public function configure() {\n\t\tLogger::getRootLogger()->info('Configuring IPSec');\n\t\t//\tCheck nat traversal setting\n\t\tif((string)$this->data['nat_traversal'] == 'true'){\n\t\t\t$nat_t = 'on';\n\t\t}\n\t\telse{\n\t\t\t$nat_t = 'off';\n\t\t}\n\t\t\n\t\t//\tPSK file\n\t\t$psk = '';\n\t\t\n\t\t//\tSetkey configuration\n\t\t$setkey = \"flush;\\n\";\n\t\t$setkey .= \"spdflush;\\n\";\n\t\t\n\t\t//\tRacoon.conf\n\t\t$ipsec = \"path pre_shared_key \\\"\" . self::PKS_PATH . \"\\\";\\n\";\n\t\t$ipsec .= \"path pidfile \\\"\" . self::PID_PATH . \"\\\";\\n\";\n\t\t$ipsec .= \"path certificate \\\"\" . self::CERT_PATH . \"\\\";\\n\";\n\t\t$ipsec .= <<<EOD\nlog debug; #log verbosity setting: set to 'notify' when testing and debugging is complete\n\npadding # options are not to be changed\n{\n maximum_length 20;\n randomize off;\n strict_check off;\n exclusive_tail off;\n}\n\ntimer # timing options. change as needed\n{\n counter 5;\n interval 20 sec;\n persend 1;\n \nEOD;\n\t\tif ($nat_t == 'on') {\n\t\t\t$ipsec .= \" natt_keepalive 15 sec;\\n\";\n\t\t}\n\t\t$ipsec .= <<<EOD\n phase1 30 sec;\n phase2 15 sec;\n}\n\nEOD;\n\n\t\tif(count($this->data->tunnels->tunnel) > 0){\n\t\t\t//\tGenerate configuration for each tunnel\n\t\t\tforeach($this->data->tunnels->tunnel as $tunnel){\n\t\t\t\tif((string)$tunnel['enable'] == 'false'){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\n\t\t\t\tif((string)$this->data['nat_traversal'] == 'true'){\n\t\t\t\t\t$nat_traversal = 'on';\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$nat_traversal = 'off';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//\tParse my identifier\n\t\t\t\tif((string)$tunnel->phase1->identifier['type'] == 'ipaddr'){\n\t\t\t\t\t$my_identifier = 'address '.(string)$tunnel->phase1->identifier;\n\t\t\t\t}\n\t\t\t\telseif((string)$this->phase1->identifier['type'] == 'my_ip'){\n\t\t\t\t\t$wan = $this->framework->getPlugin('Wan');\n\t\t\t\t\tif($wan != null){\n\t\t\t\t\t\t$my_identifier = 'address '.$wan->getIpAddress();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif((string)$tunnel->phase1->identifier['type'] == 'domainname'){\n\t\t\t\t\t//\tTODO: Find out what we enter here\n\t\t\t\t}\n\t\t\t\telseif((string)$tunnel->phase1->identifier['type'] == 'fqdn'){\n\t\t\t\t\t//\tTODO: Find out what we enter here\n\t\t\t\t}\n\t\t\t\telseif((string)$tunnel->phase1->identifier['type'] == 'dyndns'){\n\t\t\t\t\t//\tTODO: Find out what we enter here\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//\tParse local part\n\t\t\t\tif((string)$tunnel->local->type == 'lan_subnet'){\n\t\t\t\t\t$lan = $this->framework->getPlugin('Lan');\n\t\t\t\t\tif($lan != null){\n\t\t\t\t\t\t$subnet = Functions::prefix2mask($lan->getSubnet());\n\t\t\t\t\t\t$ip = $lan->getIpAddress();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t//\tCalculate network\n\t\t\t\t\t\t$network = Functions::calculateNetwork($ip,$subnet);\n\t\t\t\t\t\t$local['subnet'] = $lan->getSubnet();\n\t\t\t\t\t\t$local['network'] = $network;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tLogger::getRootLogger()->error('Error during tunnel configuration, could not load Lan plugin');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif((string)$tunnel->local->type == 'ipaddr'){\n\t\t\t\t\t$local['network'] = (string)$tunnel->local->{'private_ip'};\n\t\t\t\t\t$local['subnet'] = '32';\n\t\t\t\t}\n\t\t\t\telseif((string)$tunnel->local->type == 'network'){\n\t\t\t\t\t$local['network'] = (string)$tunnel->local->{'private_ip'};\n\t\t\t\t\t$local['subnet'] = (string)$tunnel->local->{'private_subnet'};\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//\tParse remote part\n\t\t\t\tif((string)$tunnel->remote->type == 'ipaddr'){\n\t\t\t\t\t$remote['network'] = (string)$tunnel->remote->{'private_ip'};\n\t\t\t\t\t$remote['subnet'] = '32';\n\t\t\t\t}\n\t\t\t\telseif((string)$tunnel->remote->type == 'network'){\n\t\t\t\t\t$remote['network'] = (string)$tunnel->remote->{'private_ip'};\n\t\t\t\t\t$remote['subnet'] = (string)$tunnel->remote->{'private_subnet'};\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$ipsec .= <<<EOD\nremote {$tunnel->remote->{'public-ip'}} [500]\n{\n exchange_mode {$tunnel->phase1->{'exchange-mode'}};\n doi ipsec_doi;\n situation identity_only;\n my_identifier {$my_identifier};\n peers_identifier\taddress {$tunnel->remote{'public-ip'}};\n lifetime time 8 hour;\n passive off;\n proposal_check obey;\n nat_traversal {$nat_traversal};\n generate_policy off;\n \n proposal {\nEOD;\n\t \t$ipsec .= \" encryption_algorithm \".str_replace('|',', ',(string)$tunnel->phase1->{'encryption-algorithm'}).\";\";\n\t \t$ipsec .= \" hash_algorithm \".str_replace('|',', ',(string)$tunnel->phase1->{'hash-algorithm'}).\";\";\n\t \t\n\t \tif($tunnel->phase1->{'authentication-method'}['type'] == 'psk'){\n\t \t\t$authentication_method = 'pre_shared_key';\n\t \t\tforeach($this->keys->key as $key){\n\t \t\t\tif($key['id'] == (string)$tunnel->phase1->{'authentication-method'}){\n\t \t\t\t\tbreak;\n\t \t\t\t}\n\t \t\t}\n\t \t\t$psk .= (string)$tunnel->remote->{'public-ip'}.\"\\t\".html_entity_decode((string)$key->content).\"\\n\";\n\t \t}\n\t \telseif($tunnel->phase1->{'authentication-method'}['type'] == 'rsasig'){\n\t \t\t$authentication_method = 'rsasig';\n\t \t}\n\t \t\n\t \t$ipsec .= \" authentication_method \".$authentication_method.\";\\n\";\n\t \t$ipsec .= \" lifetime time \".(string)$tunnel->phase1->lifetime.\";\\n\";\n\t \t$ipsec .= \" dh_group \".(string)$tunnel->phase1->dhgroup.\";\\n\";\n\t\n\t\t\t\t//Add certificate information to the proposal\n\t\t\t\tif ($tunnel->phase1->{'authentication-method'}['type'] == 'rsasig') {\n\t\t\t\t\t//\t\tTODO: Add x509 certificate type\n\t\t\t\t\t\n\t\t\t\t\t//\tFind correct certificate\n\t\t\t\t\tforeach($this->data->certificates->certificate as $certificate){\n\t\t\t\t\t\tif($certificate['id'] == $tunnel->phase1->{'authentication-method'}){\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$ipsec .= \" certificate_type plain_rsa \\\"{$certificate->private}\\\"\\n\";\n\t\t\t\t\t$ipsec .= \" peers_certfile plain_rsa \\\"{$certificate->public}\\\"\\n\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Close proposal and remote\n\t\t\t\t$ipsec .= \"\\t}\\n}\\n\";\n\t\t\t\t\n\t\t\t\t//Create sainfo\n\t\t\t\t$ipsec .= \"sainfo (address {$local['network']}/{$local['subnet']} any address \".$tunnel->remote->{'private_ip'}.\"/\".$tunnel->remote->{'private_subnet'}.\" any)\";\n\t\t\t\t$ipsec .= <<<EOD\n{\n\t\tlifetime time {$tunnel->phase2->lifetime};\nEOD;\n\t\t\t\tif((string)$tunnel->phase2->pfsgroup != 'off' && (string)$tunnel->phase2->pfsgroup != ''){\n\t\t\t\t\t$ipsec .= \" pfs_group \".(string)$tunnel->phase2->pfsgroup;\n\t\t\t\t}\n\t\t\t\t$ipsec .= \" encryption_algorithm \".str_replace('|',', ',$tunnel->phase2->{'encryption-algorithm'}).\";\\n\";\n\t\t\t\t$ipsec .= \" authentication_algorithm \".$tunnel->phase2->{'authentication-algorithm'}.\";\\n\";\n\t\t\t\t$ipsec .= <<<EOD\n compression_algorithm deflate;\n}\n\nEOD;\n\t\t\t\t//\tSetkey config\n\t\t\t\t$setkey .= \"spdadd {$local['network']}/{$local['subnet']} {$remote['network']}/{$remote['subnet']} any -P out ipsec esp/tunnel/{$local['public-ip']}-{$remote['public-ip']}/use;\\n\";\n\t\t\t\t$setkey .= \"spdadd {$remote['network']}/{$remote['subnet']} {$local['network']}/{$local['subnet']} any -P in ipsec esp/tunnel/{$remote['public-ip']}-{$local['public-ip']}/use;\\n\";\n\t\t\t}\n\t\t\t\n\t\t\t//\tWrite out racoon and IPSEC config\n\t\t\t//Save setkey\n\t\t\t$fd = fopen ( self::SETKEY_PATH, \"w\" );\n\t\t\tif (! $fd) {\n\t\t\t\tLogger::getRootLogger ()->error ( \"Error: Could not write setkey conifg to \" . self::SETKEY_PATH );\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\tfwrite ( $fd, $setkey );\n\t\t\tfclose ( $fd );\n\t\t\t\n\t\t\t//Save IPsec config\n\t\t\t$fd = fopen ( self::CONFIG_PATH, \"w\" );\n\t\t\tif (! $fd) {\n\t\t\t\tLogger::getRootLogger ()->error ( \"Error: Could not write IPsec conifg to \" . self::CONFIG_PATH );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfwrite ( $fd, $ipsec );\n\t\t\tfclose ( $fd );\n\t\t\t\n\t\t\t//Save pre shared key file\n\t\t\t$fd = fopen ( self::PKS_PATH, \"w\" );\n\t\t\tif (! $fd) {\n\t\t\t\tLogger::getRootLogger ()->error ( \"Error: Could not write IPsec PKS to \" . self::PKS_PATH );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfwrite ( $fd, $psk);\n\t\t\tfclose ( $fd );\n\t\t\tchmod ( self::PKS_PATH, 0600 );\n\t\t\t\n\t\t\treturn true;\n }\n else{\n \tLogger::getRootLogger()->info('No IPSEC tunnels defined, aborting racoon configuration');\n \treturn false;\n }\n\t}",
"public function getTunnelConfiguration()\n {\n if (array_key_exists(\"tunnelConfiguration\", $this->_propDict)) {\n if (is_a($this->_propDict[\"tunnelConfiguration\"], \"\\Beta\\Microsoft\\Graph\\Networkaccess\\Model\\TunnelConfiguration\") || is_null($this->_propDict[\"tunnelConfiguration\"])) {\n return $this->_propDict[\"tunnelConfiguration\"];\n } else {\n $this->_propDict[\"tunnelConfiguration\"] = new TunnelConfiguration($this->_propDict[\"tunnelConfiguration\"]);\n return $this->_propDict[\"tunnelConfiguration\"];\n }\n }\n return null;\n }",
"public function newTunnel(){\n\t\t$this->buffer = '';\n\t\t$this->tunnel_type = null;\n\t\t$this->cipher = null;\n\t\t$this->server = null;\n\t\t$this->port = null;\n\t}",
"public function setTunnelType($type){\n\t\t$this->tunnel_type = $type;\n\t}",
"protected function _configureProxy() {\n if ($this->_use_proxy) {\n $this->setOpt(CURLOPT_HTTPPROXYTUNNEL, TRUE);\n if ($this->_proxy_port) {\n $this->setOpt(CURLOPT_PROXYPORT, $this->_proxy_port);\n }\n if ($this->_proxy_address) {\n $this->setOpt(CURLOPT_PROXY, $this->_proxy_address);\n }\n if ($this->_proxy_userpassword) {\n $this->setOpt(CURLOPT_PROXYUSERPWD, $this->_proxy_userpassword);\n }\n }\n return $this;\n }",
"public function setConfig(Configuration $config);",
"public function setViewLinkConfigurationFromTypoScriptConfiguration()\r\n {\r\n $this->getController()\r\n ->getPageTypoScriptConfigurationManager()\r\n ->setViewLinkConfigurationFromPageTypoScriptConfiguration();\r\n $this->getController()\r\n ->getExtensionConfigurationManager()\r\n ->setViewLinkConfigurationFromTypoScriptConfiguration();\r\n $this->getController()\r\n ->getLibraryConfigurationManager()\r\n ->setViewLinkConfigurationFromTypoScriptConfiguration();\r\n }",
"public function setConnectionConfig($connectionConfig) {\n $this->connectionConfig = $connectionConfig;\n return $this;\n }",
"public function setConfiguration($config){\r\n $this->configuration=$config;\r\n }",
"public function setConnectionMode($mode)\n {\n $modes = [\n self::HOT_CONNECTION_MODE,\n self::COLD_CONNECTION_MODE,\n ];\n\n if (in_array($mode, $modes)) {\n $this->connectionMode = $mode;\n }\n }",
"public function setConnection(HttpURLConnection $connection)\n {\n $this->connection = $connection;\n }",
"protected function addConnectionsToConfig(): void\n {\n Config::set('database.connections.c1', (array) $this->schema->connections->from);\n Config::set('database.connections.c2', (array) $this->schema->connections->to);\n }",
"abstract protected function _connect(array $inConfiguration);",
"private function configure()\n {\n $configuration = $this->getNewConfiguration();\n\n if ($configuration === $this->lastConfiguration) {\n return;\n }\n\n $this->lastConfiguration = $configuration;\n\n $authHandler = null;\n foreach ($this->transport->getExtensionHandlers() as $handler) {\n if ($handler instanceof \\Swift_Transport_Esmtp_AuthHandler) {\n $authHandler = $handler;\n break;\n }\n }\n\n if ($authHandler instanceof \\Swift_Transport_Esmtp_AuthHandler) {\n $authHandler->setUsername($configuration['username']);\n $authHandler->setPassword($configuration['password']);\n $authHandler->setAuthMode($configuration['authMode']);\n }\n\n $this->transport->setEncryption($configuration['encryption']);\n $this->transport->setHost($configuration['host']);\n $this->transport->setPort($configuration['port']);\n if ($this->transport->getLocalDomain() === 'localhost') {\n $this->transport->setLocalDomain($this->options->get(Option::SERVER_FQDN) ?? gethostname());\n }\n\n if (! $this->options->get(Option::MAILER_VERIFY_SSL_CERTIFICATES)) {\n $this->transport->setStreamOptions(\n [\n 'ssl' => [\n 'allow_self_signed' => true,\n 'verify_peer' => false,\n 'verify_peer_name' => false,\n ],\n ]\n );\n }\n\n if ($this->isStarted()) {\n $this->stop();\n }\n }",
"function setProxySettings($proxyHost, $proxyPort, $proxyUserName, $proxyPassword) {\n\t\t$this->m_proxyHost = $proxyHost;\n\t\t$this->m_proxyPort = $proxyPort;\n\t\t$this->m_proxyUserName = $proxyUserName;\n\t\t$this->m_proxyPassword = $proxyPassword;\n\t}",
"public function SetConfig(Config $oConfig);",
"public function setProxy()\n\t{\n\t\t$args = phpSmug::processArgs( func_get_args() );\n\t\t$this->proxy['server'] = $args['server'];\n\t\t$this->proxy['port'] = $args['port'];\n\t\t$this->proxy['username'] = ( isset( $args['username'] ) ) ? $args['username'] : '';\n\t\t$this->proxy['password'] = ( isset( $args['password'] ) ) ? $args['password'] : '';\n\t\t$this->proxy['auth_scheme'] = ( isset( $args['auth_scheme'] ) ) ? $args['auth_scheme'] : 'basic';\n\t\t$this->req->setConfig( array( 'proxy_host' => $this->proxy['server'],\n\t\t\t\t\t\t\t\t\t 'proxy_port' => $this->proxy['port'],\n\t\t\t\t\t\t\t\t\t 'proxy_user' => $this->proxy['username'],\n\t\t\t\t\t\t\t\t\t 'proxy_password' => $this->proxy['password'],\n\t\t\t\t\t\t\t\t\t 'proxy_auth_scheme' => $this->proxy['auth_scheme'] ) );\n }",
"public function configureTransmission() {\n\n\t\t$this->transmissionLogger->info(\"[TRANSMISSION-CONFIGURE-SESSION] Setting up transmission session settings\");\n\n\t\t// This will prepare one script to execute a push notification from transmission when a download finishes\n\t\t$notificationScript = $this->processManager->prepareScriptToExecuteNotifyCall();\n\n\t\t$baseDownloadsPath = $this->settingsService->getDefaultTransmissionSettings()->getBaseDownloadsDir();\n\t\t//TODO: remove hardcoded /mediacenter -- use baseLibraryPath\n\t\t$requestPayload = array(\n\t\t\t\t\"method\" => \"session-set\",\n\t\t\t\t\"arguments\" => array(\"download-dir\" => $baseDownloadsPath,\n\t\t\t\t\t\t \"script-torrent-done-enabled\" => true,\n\t\t\t\t\t\t\t\t\t \"script-torrent-done-filename\" => \"/mediacenter/notify.sh\",\n\t\t\t\t\t\t\t\t\t \"start-added-torrents\" => true)\n\t\t);\n\n\t\t$jsonRequest = json_encode($requestPayload, JSON_UNESCAPED_SLASHES);\n\n\t\t$this->transmissionLogger->debug(\"[TRANSMISSION-CONFIGURE-SESSION] The payload to send to transmission API is $jsonRequest\");\n\n\t\t$result = $this->executeTransmissionApiCall($jsonRequest);\n\n\t\t$this->transmissionLogger->debug(\"[TRANSMISSION-CONFIGURE-SESSION] The result to set Session settings in Transmission is: \". json_encode($result));\n\t\t$this->transmissionLogger->debug(\"[TRANSMISSION-CONFIGURE-SESSION] Transmission Session properties are configured\");\n\t}",
"public function setConnection() {\n\t\t$con = Config::get('librarydirectory::database.default');\n\t\tif ( $con && $con !== 'default' ) {\n\t\t\t$config = Config::get('librarydirectory::database.connections.'.$con);\n\t\t} else {\n\t\t\t$con = Config::get('database.default');\n\t\t\t$config = Config::get('database.connections.'.$con);\n\t\t}\n\t\tConfig::set('database.connections.'.$con, $config);\n\t}",
"private function toggleTunnel(){\n\t\tif(isset($_POST['tunnelid']) && is_numeric($_POST['tunnelid'])){\n\t\t\tforeach($this->data->tunnels->tunnel as $tunnel){\n\t\t\t\tif((string)$tunnel['id'] == $_POST['tunnelid']){\n\t\t\t\t\t\n\t\t\t\t\tif((string)$tunnel['enable'] == 'true'){\n\t\t\t\t\t\t$tunnel['enable'] = 'false';\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$tunnel['enable'] = 'true';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->config->saveConfig();\n\t\t\t\t\techo '<reply action=\"ok\"/>';\n\t\t\t\t\treturn true;\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthrow new Exception('The specified tunnel could not be found');\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tthrow new Exception('An invalid tunnel identifier was submitted');\n\t\t}\n\t}",
"public function setHttpProxyTunnelUsed($used);",
"public function setConfig($config)\n {\n $this->config = $config;\n }",
"public function setConfig($config)\n {\n $this->config = $config;\n }",
"public function setConfig($config)\r\n {\r\n $this->config = $config;\r\n }",
"public static function setConnectAdvanced()\n {\n static::$connect = self::CONNECT_ADVANCED;\n }",
"public function setConfig($config)\n {\n self::$config = $config;\n }",
"protected function configure()\n {\n $this->mergeConfigFrom(\n __DIR__ . '/../../config/knet.php', 'knet'\n );\n }",
"public function setConfig(ilSettingsTemplateConfig $config) {\r\n $this->config = $config;\r\n }"
]
| [
"0.65696025",
"0.5531561",
"0.5130707",
"0.50345594",
"0.5031558",
"0.48706213",
"0.48524216",
"0.48272917",
"0.47780892",
"0.4761241",
"0.47611305",
"0.46806848",
"0.45984054",
"0.45393685",
"0.45038104",
"0.44987142",
"0.44942138",
"0.4486277",
"0.4433319",
"0.43544516",
"0.4353375",
"0.43379775",
"0.43316865",
"0.4318785",
"0.4318785",
"0.43064168",
"0.4295978",
"0.4278123",
"0.42505842",
"0.4248898"
]
| 0.6536189 | 1 |
Get the specified GCCv1 page for a role. | public function gccPage(Request $request, $role, $pagename)
{
ob_start();
include( base_path() .'/app--gccv1/gcis/vuer.html.php' );
$html = ob_get_contents();
ob_end_clean();
return response()->json([
'page' => $page,
'html' => $html
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_page();",
"public function getPage();",
"public function getPage()\n\t{\n\t $url = URL::segment(1);\n\t\treturn $this->crud->_where(\"url = $url\")\n\t\t\t\t\t->read('row')\n\t\t;\n\t}",
"public static function getLandingPage($role=false){\n return $role ? AUTH_USER_ROLES[$role]['landing_page'] : AUTH_USER_ROLES[Auth::getRole()]['landing_page'];\n }",
"public function lookupPagePermission(Person $person, $role, Page $page)\n {\n if (substr($role, 0, 2) !== 'p_') {\n $role = 'p_'.$role;\n }\n\n do {\n $result = $this->doLookup($person, $role, $page->getId());\n\n if ($page->getParentId() === null) {\n break;\n }\n\n if ($result === null) {\n $page = $page->getParent();\n }\n } while ($result === null && $page !== null);\n\n return (bool) $result;\n }",
"function CheckPageAccess($roleID,$userroles){\n $totaluserroles = count($userroles);\n $userpage = 0;//this should be displayed when the user is not allowed to access current page\n //loop through all the roles and check if they exist in the array\n for($index = 0;$index<$totaluserroles;$index++)\n {\n if($userroles[$index]===$roleID){ \n $userpage = 1; \n break;\n }\n \n }\n \n return $userpage;\n \n }",
"protected function getPage() {}",
"protected function getPage() {}",
"public static function getCommandPage() {\n\t $name = static::getCommand('page');\n\t if($name) {\n\t return self::getPageDir()\n\t . '/'\n\t . self::getScope()\n\t . '/'\n\t . $name;\n\t }\n\t return null;\n\t}",
"public function show($params){\n if( $_SESSION[\"username\"] ){\n // check if user has one of the permited roles\n // TODO: check if user was deleted\n $user_id = $_SESSION[\"user_id\"];\n $user = User::findBy(\"id\", $user_id);\n $roles = $user->roles;\n $role_page = \"PAGE_\".$params;\n\n if( $user->hasRole($role_page) ){\n $GLOBALS['page_name'] = $params;\n render('pages', 'show');\n }\n else{\n header('HTTP/1.0 401 Unauthorized');\n render('errors', '401');\n }\n }\n else{\n $_SESSION['PAGE_REFERER'] = $_SERVER['REQUEST_URI'];\n header('Location: /sign_in');\n }\n\n }",
"public function getPageType();",
"public function getPageType();",
"public function getPage() {}",
"public function getPage() {}",
"public function get_page( $name ) {\n\t\treturn $name ? $this->get_object( $name, 'page' ) : null;\n\t}",
"abstract protected function getPage() ;",
"public function pageActionGet($route) : object\n {\n $page = $this->app->page;\n $title = \"Page: ${route}\";\n $db = $this->app->db;\n $filter = new MyTextFilter();\n\n $db->connect();\n $sql = <<<EOD\nSELECT\n *,\n DATE_FORMAT(COALESCE(updated, published), '%Y-%m-%dT%TZ') AS modified_iso8601,\n DATE_FORMAT(COALESCE(updated, published), '%Y-%m-%d') AS modified\nFROM content\nWHERE\n path = ?\n AND type = ?\n AND (deleted IS NULL OR deleted > NOW())\n AND published <= NOW()\n;\nEOD;\n $content = $db->executeFetch($sql, [$route, \"page\"]);\n if ($content->filter) {\n $text = $content->data;\n $filters = explode(\",\", $content->filter);\n $filteredText = $filter->parse($text, $filters);\n $content->data = $filteredText;\n }\n $page->add(\"cms/page\", [\n \"content\" => $content\n ]);\n return $page->render([\n \"title\" => $title\n ]);\n }",
"public function page(int $page): string;",
"public function getByName($roleName);",
"function get_page($id)\r\n\t{\r\n\t\t$query = $this->db->select('id, title, content, icon, user_id, date, status, welcome_enable')\r\n\t\t ->from(\"custom_page\")\r\n\t\t ->where(array('id' => $id))\r\n\t\t ->get();\r\n\t\t \r\n\t\treturn $query->row();\r\n\t}",
"public function index()\n {\n if(Auth::user()->role_id != 3) {\n abort(404);\n }\n return view('admin.pages.index',[\n 'pages' => Page::orderBy('title', 'asc')->paginate(25)\n ]);\n }",
"function fetchPageDetailsByName($name){\n try {\n global $db_table_prefix;\n\n $db = pdoConnect();\n\n $sqlVars = array();\n\n $query = \"SELECT\n id,\n page,\n private\n FROM \".$db_table_prefix.\"pages\n WHERE\n page = :name\n LIMIT 1\";\n\n $stmt = $db->prepare($query);\n\n $sqlVars[\":name\"] = $name;\n\n if (!$stmt->execute($sqlVars)){\n // Error\n return false;\n }\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n if ($row)\n return $row;\n else {\n addAlert(\"danger\", \"The specified page details could not be found.\");\n return false;\n }\n } catch (PDOException $e) {\n addAlert(\"danger\", \"Oops, looks like our database encountered an error.\");\n error_log(\"Error in \" . $e->getFile() . \" on line \" . $e->getLine() . \": \" . $e->getMessage());\n return false;\n } catch (ErrorException $e) {\n addAlert(\"danger\", \"Oops, looks like our server might have goofed. If you're an admin, please check the PHP error logs.\");\n return false;\n }\n}",
"function get_one_page(){\n\t\t$this->m_n_current_page_number = gf_get_value_n('v_current_page_number');\n\t}",
"public function getRolePagination()\n {\n try{\n $roles=\\Config::get('app.pagi');\n return Role::paginate($roles);\n //return $this->roles->paginate($roles);\n }\n catch (\\Exception $exception)\n {\n return null;\n }\n }",
"public function getprofile(){\n\n if (Auth::user()->hasRole('admin')){\n return redirect('/admin');\n }\n\n if (Auth::user()->hasRole('Gestore Prodotti')){\n return menu('gestore');\n }\n\n if(Auth::user()->hasRole('Gestore Sito')){\n return menu('sito');\n }\n\n\n if(Auth::user()->hasRole('Gestore Blog')){\n return redirect('/admin');\n }\n\n return view('Contents/Profile');\n }",
"public static function getPagePermission(Page $page = null) {\n\t\t$page = $page ? $page : self::pw('page');\n\t\treturn $page->permissioncode;\n\t}",
"public static function get_page($name)\n {\n /**\n * Search for a post with the given name.\n */\n $args = [\n 'post_type' => 'page',\n 'post_status' => 'publish',\n 'posts_per_page' => 1,\n ];\n\n /**\n * Search for either the name, or the front page.\n */\n if ($name) {\n $args['name'] = $name;\n } else {\n $args['p'] = get_option('page_on_front');\n }\n\n $query = new \\WP_Query($args);\n if ($query->have_posts()) {\n while ($query->have_posts()) {\n $query->the_post();\n\n $response = [\n 'title' => get_the_title(),\n 'link' => get_the_permalink(),\n 'excerpt' => get_the_excerpt(),\n 'content' => get_the_content(),\n ];\n }\n\n wp_reset_postdata();\n } else {\n $response = [\n 'title' => 404,\n 'link' => '/',\n 'excerpt' => 'Niet gevonden',\n 'content' => '<p>De pagina is niet gevonden</p>',\n ];\n }\n\n return $response;\n }",
"public function show(Role $role)\n {\n return $this->showOne($role, 200);\n\n }",
"public static function show($page_name)\n {\n return self::where('name', $page_name)->first();\n }",
"public function historial ($param1){\n \n return Pago::join('usuarios', 'pagos.idUsuario', '=', 'usuarios.id')\n ->select('pagos.*')\n ->where('nombre', 'LIKE', $param1)->get();\n \n }"
]
| [
"0.56079173",
"0.53146297",
"0.5242944",
"0.5238262",
"0.519027",
"0.51253164",
"0.5119549",
"0.5117609",
"0.50912976",
"0.5069753",
"0.5048593",
"0.5048593",
"0.504843",
"0.504843",
"0.5047276",
"0.49745882",
"0.49705115",
"0.49661756",
"0.49503714",
"0.48795924",
"0.48758197",
"0.48749098",
"0.48742837",
"0.48428118",
"0.48327324",
"0.48188826",
"0.4807855",
"0.47929415",
"0.47660142",
"0.4760023"
]
| 0.61100674 | 0 |
Gets all missing required records | public function getMissingRecords()
{
$missing = [];
foreach ($this->records as $record) {
$repo = $this->storage->getRepository($record->getContentType());
$fields = $record->getRequiredFieldsArray();
if (count($fields)) {
$results = $repo->findBy($fields);
if (!$results) {
$missing[] = $record;
}
}
}
return $missing;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function provideMissingRequiredFields() {\n return [\n [array(\n 'label' => 'I am a label',\n 'coordinates' => '39.7392° N, 104.9903° W',\n 'depth' => 11,\n 'temperature' => 98.6,\n 'date' => 1325533342\n )],\n [array(\n 'label' => 'I am a label',\n 'coordinates' => '39.7392° N, 104.9903° W',\n 'depth' => 11,\n 'temperature' => 98.6,\n 'reporter' => 'DataValidationServiceTest.php'\n )],\n [array(\n 'label' => 'I am a label',\n 'coordinates' => '39.7392° N, 104.9903° W',\n 'depth' => 11,\n 'date' => 1325533342,\n 'reporter' => 'DataValidationServiceTest.php'\n )],\n [array(\n 'label' => 'I am a label',\n 'coordinates' => '39.7392° N, 104.9903° W',\n 'temperature' => 98.6,\n 'date' => 1325533342,\n 'reporter' => 'DataValidationServiceTest.php'\n )],\n [array(\n 'label' => 'I am a label',\n 'depth' => 11,\n 'temperature' => 98.6,\n 'date' => 1325533342,\n 'reporter' => 'DataValidationServiceTest.php'\n )],\n [array(\n 'coordinates' => '39.7392° N, 104.9903° W',\n 'depth' => 11,\n 'temperature' => 98.6,\n 'date' => 1325533342,\n 'reporter' => 'DataValidationServiceTest.php'\n )],\n ];\n }",
"function getMissing() {\n\t\t$articleDao =& \\DAORegistry::getDAO('ArticleDAO');\n\t\t$sql = \"SELECT * FROM articles WHERE pages like '%#DFM'\";\n\t\t$blub = $articleDao->retrieve($sql);\n\t\t$result = new \\DAOResultFactory($blub, $this, '_dummy');\n\t\t$result = $result->toArray();\n\t\tforeach ($result as $record) {\n\t\t\t$this->getArticleGalleys($record['article_id']);\n\t\t}\n\t}",
"public function get_missing_tables() {\n\t\tglobal $wpdb;\n\n\t\t$tables = array_keys( $this->get_all_tables() );\n\t\t$missing = [];\n\n\t\tforeach ( $tables as $table ) {\n\t\t\t$result = $wpdb->query( $wpdb->prepare( 'SHOW TABLES LIKE %s', $table ) );\n\n\t\t\tif ( intval( $result, 10 ) !== 1 ) {\n\t\t\t\t$missing[] = $table;\n\t\t\t}\n\t\t}\n\n\t\treturn $missing;\n\t}",
"final public static function missingMandatoryData()\n {\n return self::get(2066);\n }",
"public function pending_util_records() {\n\t\treturn $this->util->select( array( 'flag' => null ) );\n\t}",
"function getAllRecordNotPursue(){\n\t \t$data = array();\n\t\t$this->db->select('*');\n\t\t$this->db->from('pof');\n\t\t$this->db->join('company', 'company.c_id=pof.client_id', 'left');\n\t\t$this->db->join('segment_name', 'segment_name.id=pof.location', 'left');\n\t\t$this->db->join('pof_cons', 'pof.pof_id=pof_cons.pos_id', 'left');\n\t\t$this->db->join('companies_grade', 'pof.grade=companies_grade.gid', 'left');\n\t\t$this->db->where('pof.is_allocated','0');\n\t\t$this->db->where('pof.not_pursue',1);\n\t\t$this->db->order_by('pof.pof_id', 'DESC');\n\t $Q = $this->db->get();\n\t if ($Q->num_rows() > 0){\n\t \tforeach ($Q->result() as $row){\n\t $data[] = $row;\n\t }\n\t }\n\t \n\t return $data; \n\t }",
"private function collectRequiredParams() {\n $dst = array();\n foreach ($this->getAllOptions() as $param) \n {\n if ($this->paramIsRequired($param) === true) \n {\n $dst[] = $this->clearParam($param); \n }\n \n }\n\n return $dst;\n }",
"public function getAllNotAttending()\n {\n $query = 'select count(attendees.attendeeID) from users right join attendees on users.userID = attendees.userID where users.isRSVP = 1 AND attendees.isAttending = 0;';\n if ($this->connectedModel->runQuery($query)) //query\n {\n if ($row = $this->connectedModel->getResultsRow())\n return $row[0]; //count()\n }\n else\n {\n return -1;\n }\n }",
"public function clearMissingRecurring() : \\Pulchritudinous\\Queue\\Model\\ResourceModel\\Labour\\Collection\n {\n $collection = $this->objectManager->create('Pulchritudinous\\Queue\\Model\\ResourceModel\\Labour\\Collection')\n ->addFieldToFilter('status', ['eq' => Labour::STATUS_PENDING])\n ->addFieldToFilter('by_recurring', ['eq' => 1])\n ->addFieldToFilter('execute_at', ['lt' => time()]);\n\n foreach ($collection as $labour) {\n $labour->setAsSkipped();\n }\n\n return $collection;\n }",
"public function getnonavailabledates() {\n\n if ( self::isEmptyResult() ) {\n return array();\n }\n\n $dates = array();\n\n $non_available = $this->data[self::resultinnernode];\n\n $non_available = $this->normalize($non_available);\n\n foreach ($non_available as $dateObj ) {\n $startDate = new \\DateTime($dateObj['dtFromDate']);\n $endDate = new \\DateTime($dateObj['dtToDate']);\n\n $periodInterval = new \\DateInterval('P1D');\n $period = new \\DatePeriod( $startDate, $periodInterval, $endDate );\n\n foreach ($period as $date ) {\n $dates[] = array(\n 'date' => $date->format('Y-m-d'),\n 'available' => 0,\n 'staytype' => $dateObj['strStayType'],\n 'property_id' => $this->property_id,\n\n // Confirmation number\n 'quotenum' => $dateObj['intQuoteNum'],\n );\n }\n\n }\n\n return $dates;\n }",
"public static function getAllMandatory() {\n\t\t$mandatory = [];\n\t\t$mandatory['AT'] = array('IBAN');\n\t\t$mandatory['AU'] = array('BSB', 'Account Number');\n\t\t$mandatory['BE'] = array('IBAN');\n\t\t$mandatory['CA'] = array('Transit Number', 'Account Number', 'Institution Number');\n\t\t$mandatory['GB'] = array('Sort Code', 'Account Number');\n\t\t$mandatory['HK'] = array('Clearing Code', 'Account Number', 'Branch Code');\n\t\t$mandatory['JP'] = array('Bank Code', 'Account Number', 'Branch Code', 'Bank Name', 'Branch Name', 'Account Owner Name ');\n\t\t$mandatory['NZ'] = array('Routing Number', 'Account Number');\n\t\t$mandatory['SG'] = array('Bank Code', 'Account Number', 'Branch Code');\n\t\t$mandatory['US'] = array('Routing Number', 'Account Number');\n\t\t$mandatory['CH'] = array('IBAN');\n\t\t$mandatory['DE'] = array('IBAN');\n\t\t$mandatory['DK'] = array('IBAN');\n\t\t$mandatory['ES'] = array('IBAN');\n\t\t$mandatory['FI'] = array('IBAN');\n\t\t$mandatory['FR'] = array('IBAN');\n\t\t$mandatory['IE'] = array('IBAN');\n\t\t$mandatory['IT'] = array('IBAN');\n\t\t$mandatory['LU'] = array('IBAN');\n\t\t$mandatory['NL'] = array('IBAN');\n\t\t$mandatory['NO'] = array('IBAN');\n\t\t$mandatory['PT'] = array('IBAN');\n\t\t$mandatory['SE'] = array('IBAN');\n\t\t$mandatory['OT'] = array('Account Holder Name', 'Account Number','','Bank Name','Branch Name');\n\t\treturn $mandatory;\n\t}",
"public function provideHavingRequiredFields() {\n return [\n [array(\n 'label' => 'I am a label',\n 'coordinates' => '39.7392° N, 104.9903° W',\n 'depth' => 11,\n 'temperature' => 98.6,\n 'date' => 1325533342,\n 'reporter' => 'DataValidationServiceTest.php'\n )],\n ];\n }",
"public function getMandatoryRelations()\n {\n return $this->with;\n }",
"public function getRequiredFields() {\n return $this->source->getRequiredFields($this->filter);\n }",
"public function hasMissing() {\n return $this->_has(2);\n }",
"public function getSkipped();",
"public function loadMissing($relations);",
"public function findExercisesWithoutDevices()\n {\n $select = $this->select(Zend_Db_Table::SELECT_WITHOUT_FROM_PART)->setIntegrityCheck(false);\n $select->from($this->considerTestUserForTableName('exercises'), '')\n ->joinLeft($this->considerTestUserForTableName('exercise_x_device'), 'exercise_x_device_exercise_fk = exercise_id'. '')\n ->where('exercise_x_device_id IS NULL')\n ->columns(['COUNT(exercise_id) AS exerciseCount']);\n\n return $this->fetchRow($select);\n }",
"function nf_getListofUncompletedTasks(&$processlist) {\n global $_TABLES;\n\n $retval = array();\n $plist = implode(',',$processlist);\n $sql = \"SELECT distinct a.id \";\n $sql .= \"FROM {$_TABLES['nfqueue']} a inner join {$_TABLES['nfprocess']} b on a.nf_processId = b.id \";\n $sql .= \"inner join {$_TABLES['nftemplatedata']} c on a.nf_templateDataId = c.id \";\n $sql .= \"inner join {$_TABLES['nfprocess']} d on a.nf_processId = d.id \";\n $sql .= \"inner join {$_TABLES['nftemplate']} e on b.nf_templateId = e.id \";\n $sql .= \"inner join {$_TABLES['nfsteptype']} h on c.nf_steptype = h.id \";\n $sql .= \"WHERE d.complete=0 \";\n if (count($processlist) > 0) {\n $sql .= \"AND a.id not in ($plist) \";\n }\n $sql .= \" AND (a.status=0 AND a.archived is null AND h.is_interactiveStepType=0)\";\n $query = DB_query($sql);\n $retval['count'] = DB_numRows($query);\n while (list($taskid) = DB_fetchArray($query)) {\n array_push($processlist,$taskid);\n }\n $retval['list'] = $processlist;\n return $retval;\n}",
"public function findAndNotifyMissingBookings()\n {\n $period = $this->options->getRemindPeriod();\n foreach ($this->userRepository->findAll() as $user) {\n $missingBookings = $this->findMissingBookingsForUser($user, $period);\n\n if (count($missingBookings) > 0) {\n $notification = new MissingBookingsNotification($period, $missingBookings);\n $this->notificationService->notify($notification, $user);\n }\n }\n }",
"public function getMissing() {\n\t\t\treturn $this->missing;\n\t\t}",
"public static function incomplete() {\n return static::where('done', 0)->get();\n }",
"public static function getUnassignedPlayers() {\n CommonDao::connectToDb();\n $query = \"select p.*\n from player p left outer join team_player tp\n on p.player_id = tp.player_id\n where tp.team_id is null\n order by p.last_name, p.first_name\";\n return PlayerDao::createPlayersFromQuery($query);\n }",
"public function getRequiredFields(){\n if(empty($this->tableFields)){\n $this->getTableInfo();\n }\n return $this->requiredFields;\n }",
"protected function required(): array\n {\n return [\n 'id',\n 'userId',\n 'transactionId',\n 'countryCode',\n 'city',\n 'address',\n 'status',\n ];\n }",
"public function createMissingRecords()\n {\n $records = $this->getMissingRecords();\n\n foreach ($records as $record) {\n $repo = $this->storage->getRepository($record->getContentType());\n $fields = $record->getFieldsArray();\n\n if (count($fields)) {\n $entity = $repo->create($fields);\n $entity->setStatus('published');\n $repo->save($entity);\n }\n }\n }",
"public function testGetAllMissingMetadata() {\r\n $records = [\r\n ['UUID' => 'uuid1tRMR1', 'bool' => false, 'int' => 10, 'string' => 'testReadMultipleRecords 1'],\r\n ['UUID' => 'uuid1tRMR2', 'bool' => true, 'int' => 20, 'string' => 'testReadMultipleRecords 2'],\r\n ['UUID' => 'uuid1tRMR3', 'bool' => false, 'int' => 30, 'string' => 'testReadMultipleRecords 3']\r\n ];\r\n // Write data to the database\r\n foreach ($records as $record) {\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$record['UUID'].'\\','.($record['bool'] ? 1:0).','.$record['int'].', \\''.$record['string'].'\\')');\r\n }\r\n // Read data out and cast it to persistent object with incomplete metadata\r\n $this->setExpectedException('Exception', 'The table name of the persistent object could not be determined.');\r\n // Here should come up an exception. It should not be possible to match to an class without knowing from which table to extract the date\r\n $this->getPersistenceAdapter()->getAll('test_persistence_AbstractPersistenceAdapterTestPersistentObjectWithoutMetadata');\r\n }",
"public function is_missing_required_data(){\n\t\tif ( ! $this->exists ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( ! $this->get_trigger() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( $this->data_layer()->is_missing_data() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"protected function getBareRequiredFieldList()\n {\n $requiredFields = array_keys(singleton('NewsletterSubscription')->stat('db'));\n\n $this->extend('updateBareRequiredFieldList', $requiredFields);\n\n return $requiredFields;\n }",
"public function getMissingDistrict() {\n $findspots = $this->getAdapter();\n $select = $findspots->select()\n ->from($this->_name,array('id','county','parish'))\n ->where('county IS NOT NULL')\n ->where('parish IS NOT NULL')\n ->where('district IS NULL')\n ->limit(5000);\n return $findspots->fetchAll($select);\n }"
]
| [
"0.63683313",
"0.61936945",
"0.57341963",
"0.5711165",
"0.5687327",
"0.56075543",
"0.5403139",
"0.53851104",
"0.5352536",
"0.53515536",
"0.5310458",
"0.53072023",
"0.5290792",
"0.528357",
"0.528168",
"0.5266058",
"0.5256343",
"0.5253105",
"0.5221322",
"0.5220037",
"0.519199",
"0.51870495",
"0.51744235",
"0.51711154",
"0.5143179",
"0.5137362",
"0.5123579",
"0.51232857",
"0.5111648",
"0.5108968"
]
| 0.7718059 | 0 |
Creates all missing required records | public function createMissingRecords()
{
$records = $this->getMissingRecords();
foreach ($records as $record) {
$repo = $this->storage->getRepository($record->getContentType());
$fields = $record->getFieldsArray();
if (count($fields)) {
$entity = $repo->create($fields);
$entity->setStatus('published');
$repo->save($entity);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create_missing_tables() {\n\n\t\t/* Create the network snippets table if it doesn't exist */\n\t\tif ( is_multisite() && ! self::table_exists( $this->ms_table ) ) {\n\t\t\t$this->create_table( $this->ms_table );\n\t\t}\n\n\t\t/* Create the table if it doesn't exist */\n\t\tif ( ! self::table_exists( $this->table ) ) {\n\t\t\t$this->create_table( $this->table );\n\t\t}\n\t}",
"public function fillOutDb()\n {\n /* Fill out the Contacts table. BatchInsert is a good idea for that */\n $this->batchInsert('Contacts', ['name', 'surname', 'description'], self::InitialContacts);\n\n /* Prepare array for batchInsert request at first */\n $list = [];\n foreach(self::InitialPhoneNumbers as $name => $numbers){\n $query = new \\yii\\db\\Query();\n $contact_id = $query->select('id')->from('Contacts')->where(['name' => $name])->one();\n foreach($numbers as $number){\n $list[] = ['number' => $number, 'contact_id' => $contact_id['id']];\n }\n }\n\n /* Fill out the Numbers table */\n $this->batchInsert('Numbers', ['number', 'contact_id'], $list);\n }",
"public function testCreateWithoutRequiredFields(): void\n {\n $requiredFields = static::getRequiredFields();\n\n if(count($requiredFields) > 0) {\n foreach ($requiredFields as $key => $value) {\n\n if(is_int($key)) {\n $requiredField = $value;\n $errorMessage = 'core.error.'.static::getDataClassShortName().\".{$requiredField}.required\";\n } else {\n $requiredField = $key;\n $errorMessage = $value;\n }\n\n $data = $this->getDataSent('createWithAllFields.json', 'Create');\n unset($data[$requiredField]);\n\n $apiOutput = self::httpPost(['name' => static::getCreateRouteName()], $data);\n\n $result = $apiOutput->getData();\n static::assertEquals(Response::HTTP_UNPROCESSABLE_ENTITY, $apiOutput->getStatusCode());\n static::assertEquals(['errors' => [$errorMessage]], $result);\n }\n } else {\n self::markTestSkipped('Cannot be tested : no required fields defined, please set static var requiredFields with required fields if necessary.');\n }\n }",
"private function populateDummyTable() {}",
"public function requireDefaultRecords()\n {\n parent::requireDefaultRecords();\n $this->createDefaultSDLTMemberGroups();\n }",
"public function requireDefaultRecords()\n {\n // Load CSV containing all Australian localities.\n $path = realpath(dirname(dirname(dirname(__FILE__))) . '/resources/Localities.csv');\n if (file_exists($path)) {\n $db = [];\n $t = 0;\n $fh = fopen($path, 'r');\n while(($line = fgetcsv($fh))) {\n if (!$db) {\n // Heading line.\n $db = $line;\n }\n else {\n // Generate a record and commit it to the database if it does not already exist.\n $record = array_combine($db, $line);\n if (!static::get()->filter($record)->exists()) {\n static::create($record)->write();\n $t++;\n }\n }\n }\n fclose($fh);\n if ($t) {\n DB::alteration_message(\"{$t} Locality records created.\", \"created\");\n }\n }\n parent::requireDefaultRecords();\n }",
"function fillEmptyFields()\n\t{\n\t\tif(isset($this->data[$this->name])) \n\t\t{\n\t\t\t$data = $this->data[$this->name];\n\t\t} else {\n\t\t\t$data = $this->data;\n\t\t}\n\t\t\n\t\tforeach($this->_schema as $fieldname => $details) \n\t\t{\n\t\t\tif(!isset($data[$fieldname]))\n\t\t\t\t$this->set($fieldname, '');\n\t\t}\n\t}",
"public function testCreateWithOnlyRequiredFields(): void\n {\n $this->doTestCreate('createWithOnlyRequiredFields.json');\n }",
"private function createDummyTable() {}",
"public function create_only()\n {\n \n // Fetch latest MMS orders from MAX Live DB with status Delivered and customer MEAF and save the first matching order\n $this->pick_order();\n \n // Create the XML files for the order\n $this->create_xml_file();\n }",
"public function getMissingRecords()\n {\n $missing = [];\n\n foreach ($this->records as $record) {\n $repo = $this->storage->getRepository($record->getContentType());\n $fields = $record->getRequiredFieldsArray();\n\n if (count($fields)) {\n $results = $repo->findBy($fields);\n if (!$results) {\n $missing[] = $record;\n }\n }\n }\n\n return $missing;\n }",
"public function testGetAllMissingMetadata() {\r\n $records = [\r\n ['UUID' => 'uuid1tRMR1', 'bool' => false, 'int' => 10, 'string' => 'testReadMultipleRecords 1'],\r\n ['UUID' => 'uuid1tRMR2', 'bool' => true, 'int' => 20, 'string' => 'testReadMultipleRecords 2'],\r\n ['UUID' => 'uuid1tRMR3', 'bool' => false, 'int' => 30, 'string' => 'testReadMultipleRecords 3']\r\n ];\r\n // Write data to the database\r\n foreach ($records as $record) {\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$record['UUID'].'\\','.($record['bool'] ? 1:0).','.$record['int'].', \\''.$record['string'].'\\')');\r\n }\r\n // Read data out and cast it to persistent object with incomplete metadata\r\n $this->setExpectedException('Exception', 'The table name of the persistent object could not be determined.');\r\n // Here should come up an exception. It should not be possible to match to an class without knowing from which table to extract the date\r\n $this->getPersistenceAdapter()->getAll('test_persistence_AbstractPersistenceAdapterTestPersistentObjectWithoutMetadata');\r\n }",
"protected function ensureTables() {\n if (!$this->ensured) {\n if (!$this->connection->schema()->tableExists($this->mapTable)) {\n // Generate appropriate schema info for the map and message tables,\n // and map from the source field names to the map/msg field names\n $count = 1;\n $source_key_schema = array();\n $pks = array();\n foreach ($this->sourceKey as $field_schema) {\n $mapkey = 'sourceid' . $count++;\n $source_key_schema[$mapkey] = $field_schema;\n $pks[] = $mapkey;\n }\n\n $fields = $source_key_schema;\n\n // Add destination keys to map table\n // TODO: How do we discover the destination schema?\n $count = 1;\n foreach ($this->destinationKey as $field_schema) {\n // Allow dest key fields to be NULL (for IGNORED/FAILED cases)\n $field_schema['not null'] = FALSE;\n $mapkey = 'destid' . $count++;\n $fields[$mapkey] = $field_schema;\n }\n $fields['needs_update'] = array(\n 'type' => 'int',\n 'size' => 'tiny',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n 'default' => MigrateMap::STATUS_IMPORTED,\n 'description' => 'Indicates current status of the source row',\n );\n $fields['rollback_action'] = array(\n 'type' => 'int',\n 'size' => 'tiny',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n 'default' => MigrateMap::ROLLBACK_DELETE,\n 'description' => 'Flag indicating what to do for this item on rollback',\n );\n $fields['last_imported'] = array(\n 'type' => 'int',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n 'default' => 0,\n 'description' => 'UNIX timestamp of the last time this row was imported',\n );\n $schema = array(\n 'description' => t('Mappings from source key to destination key'),\n 'fields' => $fields,\n 'primary key' => $pks,\n );\n $this->connection->schema()->createTable($this->mapTable, $schema);\n\n // Now for the message table\n $fields = array();\n $fields['msgid'] = array(\n 'type' => 'serial',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n );\n $fields += $source_key_schema;\n\n $fields['level'] = array(\n 'type' => 'int',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n 'default' => 1,\n );\n $fields['message'] = array(\n 'type' => 'text',\n 'size' => 'medium',\n 'not null' => TRUE,\n );\n $schema = array(\n 'description' => t('Messages generated during a migration process'),\n 'fields' => $fields,\n 'primary key' => array('msgid'),\n 'indexes' => array('sourcekey' => $pks),\n );\n $this->connection->schema()->createTable($this->messageTable, $schema);\n }\n $this->ensured = TRUE;\n }\n }",
"public function provideMissingRequiredFields() {\n return [\n [array(\n 'label' => 'I am a label',\n 'coordinates' => '39.7392° N, 104.9903° W',\n 'depth' => 11,\n 'temperature' => 98.6,\n 'date' => 1325533342\n )],\n [array(\n 'label' => 'I am a label',\n 'coordinates' => '39.7392° N, 104.9903° W',\n 'depth' => 11,\n 'temperature' => 98.6,\n 'reporter' => 'DataValidationServiceTest.php'\n )],\n [array(\n 'label' => 'I am a label',\n 'coordinates' => '39.7392° N, 104.9903° W',\n 'depth' => 11,\n 'date' => 1325533342,\n 'reporter' => 'DataValidationServiceTest.php'\n )],\n [array(\n 'label' => 'I am a label',\n 'coordinates' => '39.7392° N, 104.9903° W',\n 'temperature' => 98.6,\n 'date' => 1325533342,\n 'reporter' => 'DataValidationServiceTest.php'\n )],\n [array(\n 'label' => 'I am a label',\n 'depth' => 11,\n 'temperature' => 98.6,\n 'date' => 1325533342,\n 'reporter' => 'DataValidationServiceTest.php'\n )],\n [array(\n 'coordinates' => '39.7392° N, 104.9903° W',\n 'depth' => 11,\n 'temperature' => 98.6,\n 'date' => 1325533342,\n 'reporter' => 'DataValidationServiceTest.php'\n )],\n ];\n }",
"function tasks_fill(){\n\n\t\t//existing tracker deletion\n\t\t$this->deleteTrackers();\n\n\t\t//Tracker creation\n\t\t$this->taskCreationArray = array(); // This array is used to store each projectGroup and each artifacts which will be imported later, we need to stop the script so as to update permissions again (default to Read for each new TaskTracker, and thus nobody can be assigned to a task except userid 100 which is Nobody)\n\t\tforeach ($this->trackers as $data){\n\t\t\t$output = $this->createTaskTracker($data);\n\t\t\tif($output){\n\t\t\t\t$this->taskCreationArray[]=$output;\n\t\t\t}\n\t\t}\n\t}",
"private function prepareTables() {}",
"public function seed()\n {\n $insertedPKs = [];\n\n foreach ($this->quantities as $model => $quantity) {\n $attributes = [];\n $pivotRecords = [];\n $translations = [];\n\n for ($i = 0; $i < $quantity; $i++) {\n list($createdModel, $pivotTables, $currentPivotRecords, $foreignKeys) =\n $this->modelPopulators[$model]->getInsertRecords($insertedPKs);\n\n // If the primary key is not auto incremented, it will be among the inserted attributes.\n if ($primaryKey = $createdModel->getKey()) {\n $insertedPKs[$model][] = $primaryKey;\n }\n\n $attributes[] = $createdModel->getAttributes();\n\n if ($currentPivotRecords) {\n $pivotRecords[] = $currentPivotRecords;\n }\n\n if ($createdModel->relationLoaded('translations')) {\n // We're not gonna use \\Illuminate\\Support\\Collection::toArray(), because the\n // translation model could have accessors to append to its array form.\n foreach ($createdModel->translations as $translation) {\n $translations[$i][] = $translation->getAttributes();\n }\n }\n }\n\n // SQL limits how many rows you can insert at once, so we'll chunk the records.\n foreach (array_chunk($attributes, 500) as $chunk) {\n $createdModel->insert($chunk);\n }\n\n if (!isset($insertedPKs[$model])) {\n $insertedPKs[$model] = $this->getInsertedPKs($createdModel, count($attributes));\n }\n\n $this->insertPivotRecords(\n $createdModel->getConnection(),\n $pivotTables,\n $pivotRecords,\n $foreignKeys,\n $insertedPKs[$model]\n );\n\n $this->insertTranslations($createdModel, $translations, $insertedPKs[$model]);\n }\n\n $this->forgetAddedModels();\n\n return $insertedPKs;\n }",
"private function create()\n {\n if ($this->isRequired()) {\n $db = Database::getDatabaseConnection();\n $db->exec($this->getDropQuery());\n $db->exec($this->getCreateQuery());\n $this->populate($db);\n }\n }",
"public function requireDefaultRecords() {\n\t\t$facebook = FacebookApp::get()->count();\n\t\tif(!$facebook) {\n\t\t\t$facebook = FacebookApp::create();\n\t\t\t$facebook->write();\n\t\t}\n\t}",
"private function generateRequired()\n {\n $elements = array( 'id', 'title', 'updated' );\n foreach ( $elements as $element )\n {\n $data = $this->$element;\n if ( is_null( $data ) )\n {\n throw new ezcFeedRequiredMetaDataMissingException( \"/feed/{$element}\" );\n }\n\n switch ( $element )\n {\n case 'id':\n $this->generateMetaData( $this->channel, $element, $data );\n break;\n\n case 'title':\n $this->generateTextNode( $this->channel, $element, $data );\n break;\n\n case 'updated':\n // Sample date: 2003-12-13T18:30:02-05:00\n $this->generateMetaData( $this->channel, $element, $data->date->format( 'c' ) );\n break;\n\n }\n }\n }",
"public function run()\n {\n\n $faker = Faker\\Factory::create();\n for($i=0;$i<10;$i++)\n {\n DB::TABLE('T_RESIDENT_BASIC_INFO')\n ->INSERT(\n [\n 'HOUSEHOLD_ID' => 1,\n 'LASTNAME' => $faker->name,\n 'MIDDLENAME' => 'A',\n 'FIRSTNAME' => $faker->name,\n 'ADDRESS_UNIT_NO' => 'Unit',\n 'ADDRESS_PHASE' => 'Phase',\n 'ADDRESS_BLOCK_NO' => 'Blk',\n 'ADDRESS_HOUSE_NO' => '146',\n 'ADDRESS_STREET' => 'Oriole Street',\n 'ADDRESS_SUBDIVISION' => 'Subdivision',\n 'ADDRESS_BUILDING' => 'Building ',\n 'QUALIFIER' => NULL,\n 'DATE_OF_BIRTH' => $faker->date,\n 'PLACE_OF_BIRTH' => 'Manila, Manila',\n 'SEX' => 'Male',\n 'CIVIL_STATUS' => 'Married',\n 'IS_OFW' => 0,\n 'OCCUPATION' => 'Programmer',\n 'WORK_STATUS' => 'Working',\n 'DATE_STARTED_WORKING' => \\DB::RAW('CURRENT_TIMESTAMP'),\n 'CITIZENSHIP' =>'Filipino',\n 'RELATION_TO_HOUSEHOLD_HEAD' => 'Cousin',\n 'DATE_OF_ARRIVAL' => \\DB::RAW('CURRENT_TIMESTAMP'),\n 'ARRIVAL_STATUS' => 1,\n 'IS_INDIGENOUS' => 1,\n 'CONTACT_NUMBER' => '(02)811-0822',\n 'EMAIL_ADDRESS' => $faker->email,\n 'EDUCATIONAL_ATTAINMENT' => 'College Graduate',\n 'CREATED_AT' => \\DB::RAW('CURRENT_TIMESTAMP'),\n 'ACTIVE_FLAG' => 1\n ]\n );\n \n }\n }",
"public function run()\n {\n \\App\\Models\\User::factory(1)->create();\n\n \\App\\Models\\Customer::factory(10)->create();\n \\App\\Models\\Supplier::factory(10)->create();\n\n foreach ($this->measurements as $measurement)\n {\n \\App\\Models\\Measurement::create($measurement);\n }\n foreach ($this->products as $product)\n {\n \\App\\Models\\Product::create($product);\n }\n }",
"public function run()\n {\n $faker = Factory::create();\n Template::factory()->count(500)->has(\n TemplateChecklist::factory()->count(1),\n 'checklist'\n )->has(\n TemplateItem::factory()->count($faker->numberBetween(1, 100)),\n 'items'\n )->create();\n }",
"protected function removeSysFileReferenceRecordsFromImportDataWithRelationToMissingFile() {}",
"public function run()\n {\n User::factory(20)->create();\n Comment::factory(1000)->create();\n Comment::where('id','<', 101)->update(['parent_id' => null]);\n }",
"private function validateSerializedRequiredAttributes($record) {\n\t\t$keysInRecord = array_keys($record);\n\t\t$requiredCheck = array_diff($this->required, $keysInRecord);\n\t\tif (!empty($requiredCheck)) {\n\t\t\t$missing = join(', ', $requiredCheck);\n\t\t\t$msg = \"The following keys were missing from $this->rootKey: $missing\";\n\t\t\tthrow new SerializerMissingRequiredException($msg);\n\t\t}\n\t}",
"public function cleanRecords(){\n\t\tOpendocs::model()->deleteAll(\" createTime<=(NOW()-1)\");//oracle\n\t}",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n User::truncate();\n Employee::truncate();\n Company::truncate();\n\n $userQuantity = 200;\n $companiesQuantity = 100;\n $employeesQuantity = 100;\n\n factory(User::class, $userQuantity)->create();\n factory(Company::class, $companiesQuantity)->create();\n factory(Employee::class, $employeesQuantity)->create();\n }",
"public function run()\n {\n foreach (range(1,500) as $index) {\n MedicineDiagnostic::create([\n 'diagnostic_id' => rand(1, 100),\n 'medicine_id' => rand(1, 100)\n ]);\n }\n }",
"public function run()\n {\n for ($i = 10; $i < rand(1910, 2010); $i++) {\n $pairValue = ['key' => \"key$i\", 'value' => \"value$i\", 'ttl' => '5 mins', 'delete_time' => Carbon::now()->addSeconds(rand(-300, 300))->toDateTimeString()];\n App\\DataModel::create($pairValue);\n }\n }"
]
| [
"0.6029235",
"0.59570605",
"0.5783681",
"0.5783014",
"0.5660192",
"0.5626202",
"0.5572371",
"0.5551481",
"0.5524799",
"0.55213505",
"0.5461589",
"0.5404346",
"0.5402477",
"0.5396595",
"0.52770615",
"0.5188905",
"0.5181099",
"0.51786834",
"0.5154336",
"0.51120275",
"0.5098328",
"0.5095875",
"0.50859946",
"0.50795704",
"0.5068348",
"0.5054039",
"0.50519884",
"0.50468814",
"0.5045605",
"0.50438"
]
| 0.70878047 | 0 |
Parses the ContentTypes array and checks for required records | protected function parseContentTypes(array $contenttypes)
{
foreach ($contenttypes as $contenttype => $values) {
if (isset($values['required']) && is_array($values['required'])) {
foreach ($values['required'] as $fields) {
$record = new RequiredRecord($contenttype, $fields);
$this->records[] = $record;
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function loadContentTypes()\n\t\t{\n\t\t\t$query = $this->contentTypeQuery;\n\t\t\t$list = $this->bridge->packData($query);\n\t\t\t$this->contentTypes = $list;\n\t\t\t\n\t\t\t/*\n\t\t\t*\tgenerate new contentTypes [Folder, File]\n\n\t\t\t*/\n\n\t\t\tif (count($this->contentTypes) == 0)\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t*\tINSERT INTO contentType VALUES (null, 'Folder', null)\n\t\t\t\t*\tINSERT INTO contentType VALUES (null, 'File', null)\n\t\t\t\t*/\n\n\t\t\t\t$qrs = array();\n\t\t\t\tarray_push($qrs, [\"'Folder'\", \"'_'\"]);\n\t\t\t\tarray_push($qrs, [\"'File'\", \"'_'\"]);\n\n\t\t\t\t$ts = $this->logContentType($qrs);\n\t\t\t\t#var_dump($ts);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$r= 1;\n\t\t\t\t#var_dump($this->contentTypes);\n\t\t\t\t#$arrayName = array(0 => [\"'Folderr'\", \"null\"], );\n\t\t\t\t#$this->logContentType($arrayName);\n\t\t\t}\t\t\t\n\t\t}",
"public function testContentTypesItem()\n {\n $this->contentTypeListTest('products');\n $this->contentTypeListTest('blogs');\n $this->contentTypeListTest('app_flows');\n $this->contentTypeListTest('lists');\n $this->contentTypeListTest('user_reviews');\n $this->contentTypeListTest('boards');\n }",
"public function testContentTypesLists()\n {\n $this->contentTypeItemTest('products');\n $this->contentTypeItemTest('blogs');\n $this->contentTypeItemTest('app_flows');\n $this->contentTypeItemTest('lists');\n $this->contentTypeItemTest('user_reviews');\n $this->contentTypeItemTest('boards');\n }",
"static function getValidContentTypes() {\n return array(\n 'image/',\n 'text/',\n 'application/pdf',\n );\n }",
"function acf_parse_types($array)\n{\n}",
"function loadMimeTypes() {\n\t\tif( empty( $this->mMimeTypes )) {\n\t\t\t// use bitweavers mime.types file to ensure everyone has our set unless user forces his own.\n\t\t\tif( defined( 'MIME_TYPES' ) && is_file( MIME_TYPES )) {\n\t\t\t\t$mimeFile = MIME_TYPES;\n\t\t\t} else {\n\t\t\t\t$mimeFile = KERNEL_PKG_PATH.'admin/mime.types';\n\t\t\t}\n\n\t\t\t$this->mMimeTypes = array();\n\t\t\tif( $fp = fopen( $mimeFile,\"r\" ) ) {\n\t\t\t\twhile( FALSE != ( $line = fgets( $fp, 4096 ) ) ) {\n\t\t\t\t\tif( !preg_match( \"/^\\s*(?!#)\\s*(\\S+)\\s+(?=\\S)(.+)/\", $line, $match ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$tmp = preg_split( \"/\\s/\",trim( $match[2] ) );\n\t\t\t\t\tforeach( $tmp as $type ) {\n\t\t\t\t\t\t$this->mMimeTypes[strtolower( $type )] = $match[1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfclose( $fp );\n\t\t\t}\n\t\t}\n\t}",
"private function loadMimeTypes ()\n\t\t{\n\t\t\tif ($this->mimeTypes === null)\n\t\t\t{\n\t\t\t\t$this->mimeTypes = [];\n\n\t\t\t\t$lines = file($this->mimeFile);\n\t\t\t\tforeach($lines as $line) {\n\t\t\t\t\t// skip comments\n\t\t\t\t\t$line = preg_replace('/#.*$/', '', $line);\n\t\t\t\t\t$line = trim($line);\n\t\t\t\t\tif($line === '') continue;\n\n\t\t\t\t\t$exts = preg_split('/\\s+/', $line);\n\t\t\t\t\t$mime = array_shift($exts);\n\t\t\t\t\tif(!$exts) continue;\n\t\t\t\t\tforeach($exts as $ext) {\n\t\t\t\t\t\tif(empty($ext)) continue;\n\t\t\t\t\t\tif(strlen($ext) > 4) continue; // we only handle 4 chars or less\n\t\t\t\t\t\t$this->mimeTypes[$ext] = $mime;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"function register_content_types() {\n\n}",
"function install_content_types() {\n $db = DB::getInstance();\n if(!$db->query(file_get_contents(CORE_INSTALLER_FILES_PATH.'/db/content_types.sql'))->error()) {\n return true;\n }\n else {\n System::addMessage('error', rt('An error occurred during the creation of the default content types'));\n }\n return false;\n}",
"private function getContentTypes() {\n return NodeType::loadMultiple();\n }",
"function FieldTypesArray() {}",
"private function logContentType($load = array())\n\t\t{\n\t\t\t$ret = array();\n\t\t\tif (count($load) > 0)\n\t\t\t{\n\t\t\t\tforeach ($load as $key => $value)\n\t\t\t\t{\n\t\t\t\t\t$name = $value[0];\n\t\t\t\t\t$ext = $value[1];\n\t\t\t\t\t$loaded = False;\n\n\t\t\t\t\t/*\n\t\t\t\t\t*\tcheck values not in contentTypes\n\t\t\t\t\t*/\n\n\t\t\t\t\tforeach ($this->contentTypes as $keyy => $valuee)\n\t\t\t\t\t{\n\t\t\t\t\t\t#print $valuee['contentTypeName'].' '.$name.PHP_EOL;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$tmpName = \"'\".$valuee['contentTypeName'].\"'\";\n\t\t\t\t\t\t$tmpExt = \"'\".$valuee['extension'].\"'\";\n\t\t\t\t\t\tif (($valuee['contentTypeName'] == $name or $tmpName == $name) and ($valuee['extension'] == $ext or $tmpExt == $ext))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loaded = True;\n\t\t\t\t\t\t\tarray_push($ret, $valuee['id']);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif($loaded == False)\n\t\t\t\t\t{\n\t\t\t\t\t\t$qry = \"INSERT INTO contentType VALUES(null, $name, $ext)\";\n\t\t\t\t\t\t#print $qry.PHP_EOL;\n\t\t\t\t\t\t$this->bridge->execQuery($qry);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tprint \"Ensure you provide arguments for processing\";\n\t\t\t}\n\n\t\t\t/*\n\t\t\t*\trefresh the list\n\t\t\t*/\n\n\t\t\t$query = $this->contentTypeQuery;\n\t\t\t$this->contentTypes=$this->bridge->packData($query);\n\n\t\t\t#print count($ret).' '.count($load).PHP_EOL;\n\n\t\t\tif (count($ret) == count($load))\n\t\t\t{\n\t\t\t\treturn $ret;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$ret = $this->logContentType($load);\n\t\t\t\treturn $ret;\n\t\t\t}\n\t\t}",
"function jgantt_dashboard_get_content_types() {\n $types = array();\n $result = db_query('SELECT d.node_type, d.configuration\n FROM {jgantt_dashboard} d WHERE d.status = :status', array(':status' => 1));\n\n foreach ($result as $record) {\n $types[$record->node_type] = $record;\n }\n return $types;\n}",
"private function validateContentTypes(Bag $importData)\n {\n $contentTypeNames = $this->contentTypes->keys()->toArray();\n $importData->filter(function ($k, $v) use ($contentTypeNames) {\n if (!in_array($k, $contentTypeNames)) {\n throw new RuntimeException(sprintf('ContentType \"%s\" is not configured.', $k));\n }\n });\n }",
"protected function contentTypeListTest($contentType)\n {\n // Call the list() API.\n $functionName = 'get_' . $contentType . '_list';\n $response = $this->education->{$functionName}();\n $items = $response->response;\n\n $this->assertEquals($response->statusCode, 200);\n $this->assertGreaterThan(0, $response->count);\n\n foreach ($items as $item) {\n // Store content type IDs to be used for testing.\n self::$ids[$contentType][] = $item->id;\n\n // Perform various tests.\n $this->assertTrue(is_int($item->id));\n\n // Check for valid product types.\n $this->assertContains($item->type, $this->contentTypeMap[$contentType]);\n }\n }",
"public function checkInlineFileTypeAccessForFieldFiletypesSetRecordTypeInListReturnsTrue() {}",
"protected function parseContent()\n {\n $contentString = strtok($this->query, '/');\n\n $content = [];\n $delim = '(),';\n $tok = strtok($contentString, $delim);\n while ($tok !== false) {\n $content[] = $tok;\n $tok = strtok($delim);\n }\n\n $this->contentTypes = $content;\n }",
"protected function getTypes() {}",
"public function getAllowedContentTypes()\n {\n if (array_key_exists(\"allowedContentTypes\", $this->_propDict)) {\n if (is_a($this->_propDict[\"allowedContentTypes\"], \"\\Beta\\Microsoft\\Graph\\Model\\ContentTypeInfo\") || is_null($this->_propDict[\"allowedContentTypes\"])) {\n return $this->_propDict[\"allowedContentTypes\"];\n } else {\n $this->_propDict[\"allowedContentTypes\"] = new ContentTypeInfo($this->_propDict[\"allowedContentTypes\"]);\n return $this->_propDict[\"allowedContentTypes\"];\n }\n }\n return null;\n }",
"public static function getAvailableContentTypes()\n {\n return array(\n self::TYPE_TEXT_HTML => self::TYPE_TEXT_HTML,\n self::TYPE_TEXT_CSS => self::TYPE_TEXT_CSS,\n self::TYPE_TEXT_JAVASCRIPT => self::TYPE_TEXT_JAVASCRIPT\n );\n }",
"protected function setContentTypes()\n\t{\n\t\t// Some temporary examples\n\t\t$content_types = array(\n\t\t\t'text/html' => 'html',\n\t\t\t'application/json' => 'js',\n\t\t\t'application/xml' => 'xml',\n\t\t);\n\n\t\t$accept = $_SERVER['HTTP_ACCEPT'];\n\n\t\t$accept = explode(',', $accept);\n\t\tforeach ($accept as $key => $value) {\n\t\t\t$accept[$key] = explode(';', $accept[$key]);\n\n\t\t\t/*\n\t\t\t*\tTODO:\n\t\t\t*\tParse q value and sort array.\n\t\t\t*/\n\n\t\t\t$type = $accept[$key][0];\n\t\t\tif (isset($content_types[$type])) {\n\t\t\t\t$this->request['accept'][$type] = $content_types[$type];\n\t\t\t}\n\t\t}\n\t}",
"private function supportedTypes(): array\n {\n return [\n EmailContent::MAIL_FORMAT_TEXT,\n EmailContent::MAIL_FORMAT_MARKDOWN,\n EmailContent::MAIL_FORMAT_HTML\n ];\n }",
"private static function _get_active_content_types()\n\t{\n\t\t$data = get_option( CCTM::db_key );\n\t\tif ( !empty($data) && is_array($data) )\n\t\t{\n\t\t\t$known_post_types = array_keys($data);\n\t\t\t$active_post_types = array();\n\t\t\tforeach ($known_post_types as $pt)\n\t\t\t{\n\t\t\t\tif ( isset($data[$pt]['is_active']) && $data[$pt]['is_active'] == 1 )\n\t\t\t\t{\n\t\t\t\t\t$active_post_types[] = $pt;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $active_post_types;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t}",
"function &ListContentTypes()\n\t{\n\t\tglobal $gCms;\n\t\t$contenttypes =& $gCms->contenttypes;\n\t\t\n\t\tif (isset($gCms->variables['contenttypes']))\n\t\t{\n\t\t\t$variables =& $gCms->variables;\n\t\t\treturn $variables['contenttypes'];\n\t\t}\n\t\t\n\t\t$result = array();\n\t\t\n\t\treset($contenttypes);\n\t\twhile (list($key) = each($contenttypes))\n\t\t{\n\t\t\t$value =& $contenttypes[$key];\n\t\t\t$result[] = $value->type;\n\t\t}\n\t\t\n\t\t$variables =& $gCms->variables;\n\t\t$variables['contenttypes'] =& $result;\n\n\t\treturn $result;\n\t}",
"public function test_lti_build_content_item_selection_request_invalid_mediatypes() {\n $this->resetAfterTest();\n\n $this->setAdminUser();\n\n // Create a tool type, associated with that proxy.\n $type = new stdClass();\n $data = new stdClass();\n $data->lti_contentitem = true;\n $type->state = LTI_TOOL_STATE_CONFIGURED;\n $type->name = \"Test tool\";\n $type->description = \"Example description\";\n $type->baseurl = $this->getExternalTestFileUrl('/test.html');\n\n $typeid = lti_add_type($type, $data);\n $course = $this->getDataGenerator()->create_course();\n $returnurl = new moodle_url('/');\n\n // Should throw coding_exception on non-array media types.\n $mediatypes = 'image/*,video/*';\n $this->expectException('coding_exception');\n lti_build_content_item_selection_request($typeid, $course, $returnurl, '', '', $mediatypes);\n }",
"public function get_allowed_content_object_types()\n {\n return array(File::class);\n }",
"private function loadMimetypes() {\n\t\t$qb = $this->dbConnection->getQueryBuilder();\n\t\t$qb->select('id', 'mimetype')\n\t\t\t->from('mimetypes');\n\n\t\t$result = $qb->execute();\n\t\t$results = $result->fetchAll();\n\t\t$result->closeCursor();\n\n\t\tforeach ($results as $row) {\n\t\t\t$this->mimetypes[$row['id']] = $row['mimetype'];\n\t\t\t$this->mimetypeIds[$row['mimetype']] = $row['id'];\n\t\t}\n\t}",
"public function setAcceptableContentTypes($value)\n {\n $this->_contentTypes = $value;\n }",
"private function loadMediaTypes()\n {\n return json_decode(file_get_contents(__DIR__ . '/mediatypes.json'), true);\n }",
"function availableFileTypes($ext) {\n //checking file type extension\n switch ($ext) {\n //checking txt extention\n case \"txt\":\n $type[0] = \"text/plain\";\n break;\n\n //checking xml extention\n case \"xml\":\n $type[0] = \"text/xml\";\n $type[1] = \"application/xml\";\n break;\n\n //checking csv extention\n case \"csv\":\n $type[0] = \"text/x-comma-separated-values\";\n $type[1] = \"application/octet-stream\";\n $type[2] = \"text/plain\";\n break;\n\n //checking zip extention\n case \"zip\":\n $type[0] = \"application/zip\";\n break;\n\n //checking tar extention\n case \"tar\":\n $type[0] = \"application/x-gzip\";\n break;\n\n //checking ctar extention\n case \"ctar\":\n $type[0] = \"application/x-compressed-tar\";\n break;\n\n //checking pdf extention\n case \"pdf\":\n $type[0] = \"application/pdf\";\n break;\n\n //checking doc extention\n case \"doc\":\n $type[0] = \"application/msword\";\n $type[1] = \"application/octet-stream\";\n break;\n\n //checking xls extention\n case \"xls\":\n $type[0] = \"application/vnd.ms-excel\";\n $type[1] = \"application/vnd.oasis.opendocument.spreadsheet\";\n break;\n\n //checking ppt extention\n case \"ppt\":\n $type[0] = \"application/vnd.ms-powerpoint\";\n break;\n\n //checking jpg extention\n case \"jpg\":\n $type[0] = \"image/jpg\";\n $type[1] = \"image/jpeg\";\n $type[2] = \"image/pjpeg\";\n break;\n\n //checking gif extention\n case \"gif\":\n $type[0] = \"image/gif\";\n break;\n\n //checking png extention\n case \"png\":\n $type[0] = \"image/png\";\n break;\n\n //checking bmp extention\n case \"bmp\":\n $type[0] = \"image/bmp\";\n break;\n\n //checking icon extention\n case \"icon\":\n $type[0] = \"image/x-ico\";\n break;\n\n //checking tfontt extention\n case \"font\":\n $type[0] = \"application/x-font-ttf\";\n break;\n }\n\n return $type;\n }"
]
| [
"0.7135669",
"0.65114915",
"0.6282301",
"0.6199084",
"0.61982024",
"0.6011664",
"0.59507567",
"0.5928562",
"0.58941245",
"0.58432275",
"0.58053225",
"0.5705299",
"0.5670859",
"0.565942",
"0.5643609",
"0.5615852",
"0.5591055",
"0.55869794",
"0.55498743",
"0.55406564",
"0.5539992",
"0.55361074",
"0.55329704",
"0.5527435",
"0.55092114",
"0.550389",
"0.5487595",
"0.547758",
"0.5477131",
"0.54508936"
]
| 0.70336425 | 1 |
Sets the number of areas on the map that can be shaded. Colors not in these areas will be whited out to clean the image from shadows and such. | public function setNumAreas($num)
{
if ($num > 254)
{
throw new PHPMapper_Exception_Image(
'Too many areas. Maximum of 254 areas are allowed per map.'
);
}
else if ($num < 0)
{
throw new PHPMapper_Exception_Image(
'Number of areas cannot be a negative number.'
);
}
// White-out pixels that aren't valid areas
for ($i = 0; $i < imagecolorstotal($this->_image); $i++)
{
$raw = imagecolorsforindex($this->_image, $i);
$hex = $this->convertRgbToHex($raw['red'], $raw['green'], $raw['blue']);
if (($raw['red'] != $raw['green'] || $raw['green'] != $raw['blue'] ||
$raw['red'] > $num) && $hex != 'ffffff')
{
imagecolorset($this->_image, $i, 255, 255, 255);
}
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addMapareas( $value){\n return $this->_add(30, $value);\n }",
"private function areas_countHits( $areas )\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Get TS configuration of the current filter / tableField\n //$conf_name = $this->conf_view['filter.'][$table . '.'][$field];\n $conf_array = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ];\n\n // Get labels for the fields hits and value\n $hitsField = $this->sql_filterFields[ $this->curr_tableField ][ 'hits' ];\n $valueField = $this->sql_filterFields[ $this->curr_tableField ][ 'value' ];\n\n // Get the key of the area of the current filter: 'strings' or 'interval'\n $area_key = $this->pObj->objCal->arr_area[ $this->curr_tableField ][ 'key' ];\n\n // LOOP each area\n foreach ( array_keys( ( array ) $areas ) as $areas_uid )\n {\n // Short var\n $conf_area = $conf_array[ 'area.' ][ $area_key . '.' ][ 'options.' ][ 'fields.' ][ $areas_uid . '.' ];\n\n // Get from\n $from = $conf_area[ 'valueFrom_stdWrap.' ][ 'value' ];\n $from_conf = $conf_area[ 'valueFrom_stdWrap.' ];\n $from = $this->pObj->local_cObj->stdWrap( $from, $from_conf );\n\n // #41814, dwildt, +\n if ( empty( $from ) )\n {\n $from = $value;\n }\n // #41814, dwildt, +\n // Get to\n $to = $conf_area[ 'valueTo_stdWrap.' ][ 'value' ];\n $to_conf = $conf_area[ 'valueTo_stdWrap.' ];\n $to = $this->pObj->local_cObj->stdWrap( $to, $to_conf );\n\n // #41814, dwildt, +\n if ( empty( $to ) )\n {\n $to = $value;\n }\n // #41814, dwildt, +\n // LOOP rows\n foreach ( $this->rows as $rows_uid => $rows_row )\n {\n $value = $rows_row[ $valueField ];\n // Count the hits, if row value match from to condition\n if ( $value >= $from && $value <= $to )\n {\n $areas[ $areas_uid ][ $hitsField ] = $areas[ $areas_uid ][ $hitsField ] + $this->rows[ $rows_uid ][ $hitsField ];\n }\n }\n // LOOP rows\n }\n // LOOP each area\n // RETURN areas with hits\n return $areas;\n }",
"private function _setMapSize()\n {\n $this->map_obj->setSize($this->image_size[0], $this->image_size[1]);\n if ($this->_isResize()) {\n $this->map_obj->setSize($this->_download_factor*$this->image_size[0], $this->_download_factor*$this->image_size[1]);\n }\n }",
"public function hasMapareas(){\n return $this->_has(30);\n }",
"public function setMaxContours($value) {}",
"function mkclrbar($map, $imgObj, $c, $i) {\n $layer = $map->getLayerByName(\"singlebox\");\n// $white = $map->addColor(255, 255, 255); // \n\n //$p = ms_newRectObj();\n //$p->setextent(10, 460, 50, 450);\n //$p->draw($map, $layer, $imgObj, 0, \"0\");\n //$p->free();\n\n \n $x = 10;\n $width = 40;\n for ($k=0;$k<9;$k++){\n $x = $x + $width;\n $p = ms_newRectObj();\n $p->setextent($x, 460, $x + $width, 450);\n $cl = ms_newClassObj($layer);\n $st = ms_newStyleObj($cl);\n $st->color->setRGB($c[$k]['r'], $c[$k]['g'], $c[$k]['b']);\n $st->outlinecolor->setRGB(250, 250, 250);\n $cl->label->color->setRGB(250, 250, 250);\n $cl->label->set(\"type\", MS_BITMAP);\n $cl->label->set(\"size\", MS_LARGE);\n $cl->label->set(\"position\", MS_LR);\n $cl->label->set(\"offsetx\", 15);\n $cl->label->set(\"offsety\", 5);\n $p->draw($map, $layer, $imgObj, $k, $i[$k]);\n $p->free();\n }\n}",
"public function areaColor()\n {\n return $this->color[array_rand($this->color)];\n }",
"function ale_map_css() {\n echo '<style type=\"text/css\">\n .ale_map_canvas img {\n max-width: none;\n }</style>';\n }",
"function setHoleSize($size)\n {\n $size = intval($size);\n if ($size < 0) {\n $size = 0;\n }\n if ($size > 100) {\n $size = 100;\n }\n\n $this->hole_size = $size;\n }",
"private function areas_wiHitsOnly( $areas )\n {\n // RETURN all areas\n // #41814: 121010, dwildt, 1-\n// if( $this->ts_countHits( ) )\n // #41814: 121010, dwildt, 1+\n if ( !$this->ts_countHits() )\n {\n return $areas;\n }\n // RETURN all areas\n // Get label for the field hits\n $hitsField = $this->sql_filterFields[ $this->curr_tableField ][ 'hits' ];\n\n // LOOP each area\n // Remove areas without any hit\n foreach ( array_keys( ( array ) $areas ) as $areas_uid )\n// foreach( $areas as $areas_uid => $areas_row )\n {\n if ( $areas[ $areas_uid ][ $hitsField ] < 1 )\n {\n unset( $areas[ $areas_uid ] );\n }\n }\n // Remove areas without any hit\n // LOOP each area\n // RETURN areas with hits only\n return $areas;\n }",
"function __construct() {\r\n\t\tfor($x=1; $x <= $this->map['width']; $x++):\r\n\t\t\tfor($y=1; $y <= $this->map['height']; $y++):\r\n\t\t\t\t$this->map['tiles'][$x][$y]['init'] = true;\r\n\t\t\tendfor;\r\n\t\tendfor;\t\t\r\n\t}",
"function cera_grimlock_widget_areas( $id, $number = 1 ) {\n\t\t?>\n\t\t<div class=\"region__row\">\n\t\t\t<?php\n\t\t\t$number = intval( $number );\n\t\t\tfor ( $i = 1; $i <= $number; $i++ ) :\n\t\t\t\tif ( is_active_sidebar( \"{$id}-{$i}\" ) ) : ?>\n\t\t\t\t\t<div class=\"<?php echo esc_attr( \"region__col region__col--{$i} widget-area\" ); ?>\">\n\t\t\t\t\t\t<?php dynamic_sidebar( \"{$id}-{$i}\" ); ?>\n\t\t\t\t\t</div><!-- .region__col -->\n\t\t\t\t\t<?php\n\t\t\t\tendif;\n\t\t\tendfor; ?>\n\t\t</div><!-- .region__row -->\n\t\t<?php\n\t}",
"function wp_tinycolor_bound01($n, $max)\n {\n }",
"public function setBoundaries()\n {\n }",
"public function setMaxArea($maxArea);",
"public function setMaxCompositeContours($value) {}",
"public function addRegions()\n {\n if (isset($this->regions) && $this->regions) { \n for ($j=count($this->regions)-1; $j>=0; $j--) {\n //clear out previous loop's selection\n $color = array();\n $title = ($this->regions[$j]['title']) ? stripslashes($this->regions[$j]['title']) : \"\";\n if ($this->regions[$j]['color']) {\n $color = explode(\" \", $this->regions[$j]['color']);\n if (count($color) != 3) {\n $color = array();\n }\n }\n\n $data = trim($this->regions[$j]['data']);\n\n if ($data) {\n $this->_legend_required = true;\n $baselayer = true;\n //grab the textarea for regions & split\n $rows = explode(\"\\n\", self::removeEmptyLines($data));\n $qry = array();\n foreach ($rows as $row) {\n $regions = preg_split(\"/[,;]+/\", $row); //split by a comma, semicolon\n foreach ($regions as $region) {\n if ($region) {\n $pos = strpos($region, '[');\n if ($pos !== false) {\n $baselayer = false;\n $split = explode(\"[\", str_replace(\"]\", \"\", trim(strtoupper($region))));\n $states = preg_split(\"/[\\s|]+/\", $split[1]);\n $statekey = array();\n foreach ($states as $state) {\n $statekey[] = \"'[code_hasc]' ~* '\\.\".$state.\"$'\";\n }\n $qry['stateprovince'][] = \"'[adm0_a3]' = '\".trim($split[0]).\"' && (\".implode(\" || \", $statekey).\")\";\n $qry['country'][] = \"'[iso_a3]' = '\".trim($split[0]).\"'\";\n } else {\n $region = addslashes(trim($region));\n $qry['stateprovince'][] = \"'[name]' ~* '\".$region.\"$'\";\n $qry['country'][] = \"'[NAME]' ~* '\".$region.\"$' || '[NAME_LONG]' ~* '\".$region.\"$' || '[GEOUNIT]' ~* '\".$region.\"$' || '[FORMAL_EN]' ~* '\".$region.\"$'\";\n }\n }\n }\n }\n\n $layer = ms_newLayerObj($this->map_obj);\n $layer->set(\"name\", \"query_layer_\".$j);\n\n if ($baselayer) {\n $layer->set(\"data\", $this->shapes['countries']['shape']);\n $layer->set(\"type\", MS_LAYER_POLYGON);\n } else {\n $layer->set(\"data\", $this->shapes['stateprovinces_polygon']['shape']);\n $layer->set(\"type\", $this->shapes['stateprovinces_polygon']['type']);\n }\n\n $layer->set(\"template\", \"template.html\");\n $layer->setProjection(self::getProjection($this->default_projection));\n\n $query = ($baselayer) ? $qry['country'] : $qry['stateprovince'];\n\n $layer->setFilter(\"(\".implode(\" || \", $query).\")\");\n\n $class = ms_newClassObj($layer);\n $class->set(\"name\", $title);\n\n $style = ms_newStyleObj($class);\n if (!empty($color)) {\n $style->color->setRGB($color[0], $color[1], $color[2]);\n }\n $style->outlinecolor->setRGB(30, 30, 30);\n $style->set(\"opacity\", 75);\n $style->set(\"width\", $this->_determineWidth());\n $layer->set(\"status\", MS_ON);\n }\n\n }\n }\n }",
"function __construct($color, $numberOfBedrooms){\n\t\t$this->color = $color;\n\t\t$this->numberOfBedrooms = $numberOfBedrooms;\n\t}",
"private function clearBuildArea() {\n $plugin = SJTTournamentTools::getInstance();\n\t\t$level = Server::getInstance()->getDefaultLevel();\n\t\t$location = $plugin->getLocationManager()->getLocation('Build');\n\n\t\t$lengthx = self::PLATFORM_COUNT_X * (self::PLATFORM_WIDTH + 1);\n\t\t$lengthz = self::PLATFORM_COUNT_Z * (self::PLATFORM_WIDTH + 1);\n\n // TEMP clear large area 4 x 5 squares\n /*for ($x = -5; $x < self::PLATFORM_WIDTH * 4 + 5; $x++) {\n\t\t\tfor ($z = -5; $z < self::PLATFORM_WIDTH * 5 + 5; $z++) {\n\t\t\t\t$newx = $location['x'] + $x;\n\t\t\t\t$newy = $location['y'];\n\t\t\t\t$newz = $location['z'] + $z;\n\n\t\t\t\t$level->setBlock(new Vector3($newx, $newy, $newz), new Air(), false, false);\n\t\t\t}\n\t\t}*/\n\n // Clear area above platforms\n\t\tfor ($x = 0; $x < $lengthx; $x++) {\n\t\t\tfor ($y = 0; $y < self::AIR_CLEARANCE; $y++) {\n\t\t\t\tfor ($z = 0; $z < $lengthz; $z++) {\n\t\t\t\t\t$newx = $location['x'] + $x;\n\t\t\t\t\t$newy = $location['y'] + $y + 1;\n\t\t\t\t\t$newz = $location['z'] + $z;\n\t\t\t\t\t$level->setBlock(new Vector3($newx, $newy, $newz), new Air(), false, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n // Rebuild platforms and gaps between\n\t\tfor ($x = 0; $x < $lengthx; $x++) {\n\t\t\tfor ($z = 0; $z < $lengthz; $z++) {\n\t\t\t\t$newx = $location['x'] + $x;\n\t\t\t\t$newy = $location['y'];\n\t\t\t\t$newz = $location['z'] + $z;\n\t\t\t\tif (!($x % (self::PLATFORM_WIDTH + 1)) || !($z % (self::PLATFORM_WIDTH + 1))) {\n\t\t\t\t\t$level->setBlock(new Vector3($newx, $newy, $newz), new Air(), false, false);\n\t\t\t\t} else {\n\t\t\t\t\t$level->setBlock(new Vector3($newx, $newy, $newz), new Quartz(), false, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n // Remove entities within build area\n $entities = $level->getEntities();\n foreach($entities as $entity) {\n if (!$entity instanceof Player &&\n $entity->getX() >= $location['x'] && $entity->getX() <= $location['x'] + $lengthx &&\n $entity->getZ() >= $location['z'] && $entity->getZ() <= $location['z'] + $lengthz) {\n\n $entity->kill();\n }\n }\n }",
"protected function parameterizeColors() : void\n {\n $colors = $this->fetchColorsFromACF();\n $this->injectStyles($colors);\n }",
"protected function setShards()\n {\n // Clear shards first\n $this->shards = [];\n\n foreach ($this->getState()[ClusterState::SHARDS_PROP] as $shardName => $shardState) {\n $this->shards[$shardName] = new ShardState([$shardName => $shardState], $this->liveNodes);\n }\n }",
"public function __construct(array $styles_in, array $map_in)\n { //map 0 => array(style => 4, amount => 12)\n $fonts = array(16, 22, 28, 33, 44, 56);\n rsort($fonts);\n //exchange amount with size in map\n $tmp_arr = $map_in;\n $i = 0;\n foreach ($tmp_arr as $row) {\n if ( $i < count($fonts) ) {\n $tmp_arr[$i]['amount'] = $fonts[$i];\n }\n else $tmp_arr[$i]['amount'] = 16;\n $i++;\n }\n// die( print_r($tmp_arr) );\n foreach ($styles_in as $style) {\n $id = $style->getId();\n foreach ($tmp_arr as $row) {\n if ( $row['style'] == $id ) {\n $this->styles[] = array('size' => $row['amount'], 'style' => $style->getStyle(), 'id' => $id);\n }\n }\n }\n// die(print_r($this->styles));\n }",
"function part1() {\n $this->fabric = array_fill($this->minY, $this->spanY,\n array_fill($this->minX, $this->spanX, 0)\n );\n // Fill fabric with smaller areas:\n foreach ($this->areas as $a) {\n extract($a); // creates in scope: $id, $x, $y, $w, $h\n\n while ($w > 0) {\n while ($h > 0) {\n// echo \"($x,$y)\\n\";\n // Place area id in empty cell:\n if ($this->fabric[$y][$x] === 0) {\n $this->fabric[$y][$x] = $id;\n }\n // Place '@' where areas overlap:\n else if ($this->fabric[$y][$x] !== '@' && $this->fabric[$y][$x] !== 0) {\n $this->fabric[$y][$x] = '@';\n }\n $y++;\n $h--;\n }\n $y = $a['y'];\n $h = $a['h'];\n $x++;\n $w--;\n }\n }\n //$this->printGrid($fabric);\n $charCounts = $this->charCounter('@', $this->fabric);\n echo \"Overlap: $charCounts\\n\";\n }",
"public function area($values)\n {\n return $this->range_filter('area', $values);\n }",
"public function drawDimensions() {\n\t\tset_image_header();\n\n\t\t$this->selectTriggers();\n\t\t$this->calcDimentions();\n\n\t\tif (function_exists('imagecolorexactalpha') && function_exists('imagecreatetruecolor')\n\t\t\t\t&& @imagecreatetruecolor(1, 1)\n\t\t) {\n\t\t\t$this->im = imagecreatetruecolor(1, 1);\n\t\t}\n\t\telse {\n\t\t\t$this->im = imagecreate(1, 1);\n\t\t}\n\n\t\t$this->initColors();\n\n\t\timageOut($this->im);\n\t}",
"function part2() {\n foreach ($this->areas as $a) {\n extract($a); // creates in scope: $id, $x, $y, $w, $h\n $area = $this->charCounter($id, $this->fabric);\n echo \"$id: $area\\n\";\n if ($area == $w * $h) {\n die(\"$id fills $area cells and is not overlapped.\\n\");\n }\n }\n echo \"No region found.\\n\";\n }",
"public function areas($ids)\n {\n return $this->filter_relation('street.area', $ids);\n }",
"public function addGraticules()\n {\n if (isset($this->graticules) && $this->graticules) {\n $layer = ms_newLayerObj($this->map_obj);\n $layer->set(\"name\", 'grid');\n $layer->set(\"type\", MS_LAYER_LINE);\n $layer->set(\"status\", MS_ON);\n $layer->setProjection(self::getProjection($this->default_projection));\n\n $class = ms_newClassObj($layer);\n\n if ($this->gridlabel != 0) {\n $label = new \\labelObj();\n $label->set(\"font\", \"arial\");\n $label->set(\"encoding\", \"UTF-8\");\n $label->set(\"size\", ($this->_isResize() && $this->_download_factor > 1) ? $this->_download_factor*9 : 10);\n $label->set(\"position\", MS_CC);\n $label->color->setRGB(30, 30, 30);\n $class->addLabel($label);\n }\n\n $style = ms_newStyleObj($class);\n $style->color->setRGB(200, 200, 200);\n\n $minx = $this->map_obj->extent->minx;\n $maxx = $this->map_obj->extent->maxx;\n\n //project the extent back to default such that we can work with proper tick marks\n if ($this->projection != $this->default_projection && $this->projection == $this->projection_map) {\n $origProjObj = ms_newProjectionObj(self::getProjection($this->projection));\n $newProjObj = ms_newProjectionObj(self::getProjection($this->default_projection));\n\n $poPoint1 = ms_newPointObj();\n $poPoint1->setXY($this->map_obj->extent->minx, $this->map_obj->extent->miny);\n\n $poPoint2 = ms_newPointObj();\n $poPoint2->setXY($this->map_obj->extent->maxx, $this->map_obj->extent->maxy);\n\n $poPoint1->project($origProjObj, $newProjObj);\n $poPoint2->project($origProjObj, $newProjObj);\n\n $minx = $poPoint1->x;\n $maxx = $poPoint2->x;\n }\n\n $maxarcs = abs($maxx-$minx)/24;\n\n if ($maxarcs >= 5) {\n $labelformat = \"DD\";\n }\n if ($maxarcs < 5) {\n $labelformat = \"DDMM\";\n }\n if ($maxarcs <= 1) {\n $labelformat = \"DDMMSS\";\n }\n\n $labelformat = ($this->gridspace) ? \"DD\" : $labelformat;\n $maxinterval = ($this->gridspace) ? $this->gridspace : $maxarcs;\n $maxsubdivide = 2;\n\n $string = 'LAYER name \"grid\"' . \"\\n\";\n $string .= 'GRID' . \"\\n\";\n $string .= 'labelformat \"'.$labelformat.'\" maxarcs '.$maxarcs.' maxinterval '.$maxinterval.' maxsubdivide '.$maxsubdivide . \"\\n\";\n $string .= 'END' . \"\\n\";\n $string .= 'END' . \"\\n\";\n $layer->updateFromString($string);\n }\n }",
"public function setShardsCount($var)\n {\n GPBUtil::checkInt32($var);\n $this->shards_count = $var;\n\n return $this;\n }",
"public function mapCustomDimensions($map) {\n $this->custom_dimension_map = $map ;\n }"
]
| [
"0.5029278",
"0.4975812",
"0.49309814",
"0.49070352",
"0.47367737",
"0.47087863",
"0.47004277",
"0.46667808",
"0.46545386",
"0.45600846",
"0.45522463",
"0.45235497",
"0.45066416",
"0.44973564",
"0.4495814",
"0.44930017",
"0.43645477",
"0.43509746",
"0.4340978",
"0.4285487",
"0.4235166",
"0.42246956",
"0.41927686",
"0.41833752",
"0.4182583",
"0.41782516",
"0.41715184",
"0.41606256",
"0.41395512",
"0.41293117"
]
| 0.6788678 | 0 |
Shades in a areas of the map to the percentage (alpha) of a provided color. | public function setShading($id, $color, $pct = 1.0)
{
if ($id > 254)
{
throw new PHPMapper_Exception_Image(
'Color index too high. Cannot exceed 254.'
);
}
elseif ($id < 1)
{
throw new PHPMapper_Exception_Image(
'Color index too low. Must be at least 1.'
);
}
// Get the color assigned to the item
$r = $g = $b = $id;
$index = imagecolorexact($this->_image, $r, $g, $b);
// Pull up to the minimum to avoid white-out
if ($pct < PHPMapper::MIN_THRESHOLD)
{
$pct = PHPMapper::MIN_THRESHOLD;
}
// Detect craziness
if ($pct > 1)
{
throw new PHPMapper_Exception_BadColorValue(
"Alpha percentage should be 0 - 1, not $pct."
);
}
// Get the color after applying the alpha
list($r, $g, $b) = $this->getColorAlpha(
$this->getRgbColorFromInput($color),
$pct
);
// Replace the base color with the new alpha version
imagecolorset($this->_image, $index, $r, $g, $b);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getColorAlpha($color, $pct)\n {\n if ($pct > 1) $pct = 1;\n if ($color === null) $color = $this->_color;\n return array(\n (int) (((1 - $pct) * 255) + ($pct * $color[0])),\n (int) (((1 - $pct) * 255) + ($pct * $color[1])),\n (int) (((1 - $pct) * 255) + ($pct * $color[2]))\n );\n }",
"function mc_shift_color( $color ) {\n\t$color = str_replace( '#', '', $color );\n\t$rgb = '';\n\t$percent = ( mc_inverse_color( $color ) == '#ffffff' ) ? - 20 : 20;\n\t$per = $percent / 100 * 255;\n\t// Percentage to work with. Change middle figure to control color temperature.\n\tif ( $per < 0 ) {\n\t\t// DARKER.\n\t\t$per = abs( $per ); // Turns Neg Number to Pos Number.\n\t\tfor ( $x = 0; $x < 3; $x ++ ) {\n\t\t\t$c = hexdec( substr( $color, ( 2 * $x ), 2 ) ) - $per;\n\t\t\t$c = ( $c < 0 ) ? 0 : dechex( $c );\n\t\t\t$rgb .= ( strlen( $c ) < 2 ) ? '0' . $c : $c;\n\t\t}\n\t} else {\n\t\t// LIGHTER.\n\t\tfor ( $x = 0; $x < 3; $x ++ ) {\n\t\t\t$c = hexdec( substr( $color, ( 2 * $x ), 2 ) ) + $per;\n\t\t\t$c = ( $c > 255 ) ? 'ff' : dechex( $c );\n\t\t\t$rgb .= ( strlen( $c ) < 2 ) ? '0' . $c : $c;\n\t\t}\n\t}\n\n\treturn '#' . $rgb;\n}",
"function calculate_hsl ( $percent_ath ) {\n $hue = (1 - $percent_ath) * 120;\n $saturation = 70;\n $lightness = 50;\n $color = 'hsl(' . $hue . ', ' \n . $saturation . '%, ' \n . $lightness . '% )';\n return $color;\n }",
"public function background($color, $quality=null);",
"public function color_alpha( $color, $opacity = 100 ) {\n\n\t\t\tif ( ! $color ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$prepared_data = $this->prepare_color_mod( $color, 100 );\n\n\t\t\tif ( ! $prepared_data || ! is_array( $prepared_data ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$r = $prepared_data['r'];\n\t\t\t$g = $prepared_data['g'];\n\t\t\t$b = $prepared_data['b'];\n\t\t\t$a = intval( $opacity ) / 100;\n\n\t\t\treturn sprintf( 'rgba(%s,%s,%s,%s)', $r, $g, $b, $a );\n\t\t}",
"function setColor($percent, $invert = false)\n{\n //Amount under 100% determines red tint\n $R = min((2.0 * (1.0-$percent)), 1.0) * 255.0;\n //Green by default, 100%\n $G = min((2.0 * $percent), 1.0) * 255.0;\n //No blue here\n $B = 0.0;\n //Return the hexadecimal conversion of the RGB\n return (($invert) ? \nsprintf(\"%02X%02X%02X\",$R,$G,$B) \n: sprintf(\"%02X%02X%02X\",$R,$G,$B)); \n}",
"function hsl($color) \n\t{\n\t\t$r = hexdec(substr($color, 0, 2)) / 255;\n\t\t$g = hexdec(substr($color, 2, 2)) / 255;\n\t\t$b = hexdec(substr($color, 4, 2)) / 255;\n\t\t$min = min($r, min($g, $b));\n\t\t$max = max($r, max($g, $b));\n\t\t$delta = $max - $min;\n\t\t$l = ($min + $max) / 2;\n\t\t$s = 0;\n\t\tif ($l > 0 && $l < 1)\n\t\t{\n\t\t\t$s = $delta / ($l < 0.5 ? (2 * $l) : (2 - 2 * $l));\n\t\t}\n\t\t$h = 0;\n\t\tif ($delta > 0)\n\t\t{\n\t\t\tif ($max == $r && $max != $g) $h += ($g - $b) / $delta;\n\t\t\tif ($max == $g && $max != $b) $h += (2 + ($b - $r) / $delta);\n\t\t\tif ($max == $b && $max != $r) $h += (4 + ($r - $g) / $delta);\n\t\t\t$h = $h/6;\n\t\t}\n\t\treturn array(($h * 255), ($s * 255), ($l * 255));\n\t}",
"public function setInteriorColor($color) {}",
"public function setInteriorColor($color) {}",
"public function setInteriorColor($color) {}",
"function waves_ColorLuminance($color, $percent) {\n $color = str_replace(\"#\", \"\", $color);\n if (strlen($color) == 3) {\n $R = hexdec(substr($color, 0, 1) . substr($color, 0, 1));\n $G = hexdec(substr($color, 1, 1) . substr($color, 1, 1));\n $B = hexdec(substr($color, 2, 1) . substr($color, 2, 1));\n } else {\n $R = hexdec(substr($color, 0, 2));\n $G = hexdec(substr($color, 2, 2));\n $B = hexdec(substr($color, 4, 2));\n }\n\n $R = intval($R);\n $G = intval($G);\n $B = intval($B);\n\n $R = round($R * (100 + $percent) / 100);\n $G = round($G * (100 + $percent) / 100);\n $B = round($B * (100 + $percent) / 100);\n\n $R = (string) dechex(($R < 255) ? $R : 255);\n $G = (string) dechex(($G < 255) ? $G : 255);\n $B = (string) dechex(($B < 255) ? $B : 255);\n\n $RR = (strlen($R) == 1) ? (\"0\" . $R) : $R;\n $GG = (strlen($G) == 1) ? (\"0\" . $G) : $G;\n $BB = (strlen($B) == 1) ? (\"0\" . $B) : $B;\n\n return \"#\" . $RR . $GG . $BB;\n}",
"function _wp_tinycolor_bound_alpha($n)\n {\n }",
"private static function _get_ave_color( $color_a, $color_b, $alpha_level ) {\n\t\treturn round( ( ( $color_a * ( 1 - $alpha_level ) ) + ( $color_b\t* $alpha_level ) ) );\n\t}",
"public function TransparencyColor($red, $green, $blue,$alpha){\r\n $this->transparency_color=[$red,$green,$blue,$alpha];\r\n }",
"function HERITAGE_sanitize_rgba_color($color) {\n if ('' === $color ) {\n return '';\n }\n\n if (false === strpos($color, 'rgba')) {\n return sanitize_hex_color($color );\n }\n\n /*remove empty spaces*/\n $color = str_replace(' ', '', $color);\n /*read colors*/\n sscanf($color, 'rgba(%d,%d,%d,%f)', $red, $green, $blue, $alpha);\n /*recreate the rgba*/\n return 'rgba('.$red.','.$green.','.$blue.','.$alpha.')';\n}",
"public static function _get_ave_color( $color_a, $color_b, $alpha_level ) {\n\t\treturn round( ( ( $color_a * ( 1 - $alpha_level ) ) + ( $color_b\t* $alpha_level ) ) );\n\t}",
"private function _setTransparency($color) {\r\n\t\t// Define a color as transparent\r\n\t\timagecolortransparent($this->_resource, $color);\r\n\t\t\r\n\t\t// Enable alpha-blending and save that information\r\n\t\timagealphablending($this->_resource, true);\r\n\t\timagesavealpha($this->_resource, true);\r\n\t}",
"public function color(array $color);",
"function fiorello_mikado_rgba_color( $color, $transparency ) {\n\t\tif ( $color !== '' && $transparency !== '' ) {\n\t\t\t$rgba_color = '';\n\n\t\t\t$rgb_color_array = fiorello_mikado_hex2rgb( $color );\n\t\t\t$rgba_color .= 'rgba(' . implode( ', ', $rgb_color_array ) . ', ' . $transparency . ')';\n\n\t\t\treturn $rgba_color;\n\t\t}\n\t}",
"protected static function _namedColor($color)\n {\n switch (strtolower($color)) {\n case 'aqua':\n $r = 0.0; $g = 1.0; $b = 1.0; break;\n case 'black':\n $r = 0.0; $g = 0.0; $b = 0.0; break;\n case 'blue':\n $r = 0.0; $g = 0.0; $b = 1.0; break;\n case 'fuchsia':\n $r = 1.0; $g = 0.0; $b = 1.0; break;\n case 'gray':\n $r = 0.502; $g = 0.502; $b = 0.502; break;\n case 'green':\n $r = 0.0; $g = 0.502; $b = 0.0; break;\n case 'lime':\n $r = 0.0; $g = 1.0; $b = 0.0; break;\n case 'maroon':\n $r = 0.502; $g = 0.0; $b = 0.0; break;\n case 'navy':\n $r = 0.0; $g = 0.0; $b = 0.502; break;\n case 'olive':\n $r = 0.502; $g = 0.502; $b = 0.0; break;\n case 'purple':\n $r = 0.502; $g = 0.0; $b = 0.502; break;\n case 'red':\n $r = 1.0; $g = 0.0; $b = 0.0; break;\n case 'silver':\n $r = 0.753; $g = 0.753; $b = 0.753; break;\n case 'teal':\n $r = 0.0; $g = 0.502; $b = 0.502; break;\n case 'white':\n $r = 1.0; $g = 1.0; $b = 1.0; break;\n case 'yellow':\n $r = 1.0; $g = 1.0; $b = 0.0; break;\n\n case 'aliceblue':\n $r = 0.941; $g = 0.973; $b = 1.0; break;\n case 'antiquewhite':\n $r = 0.980; $g = 0.922; $b = 0.843; break;\n case 'aquamarine':\n $r = 0.498; $g = 1.0; $b = 0.831; break;\n case 'azure':\n $r = 0.941; $g = 1.0; $b = 1.0; break;\n case 'beige':\n $r = 0.961; $g = 0.961; $b = 0.863; break;\n case 'bisque':\n $r = 1.0; $g = 0.894; $b = 0.769; break;\n case 'blanchedalmond':\n $r = 1.0; $g = 1.0; $b = 0.804; break;\n case 'blueviolet':\n $r = 0.541; $g = 0.169; $b = 0.886; break;\n case 'brown':\n $r = 0.647; $g = 0.165; $b = 0.165; break;\n case 'burlywood':\n $r = 0.871; $g = 0.722; $b = 0.529; break;\n case 'cadetblue':\n $r = 0.373; $g = 0.620; $b = 0.627; break;\n case 'chartreuse':\n $r = 0.498; $g = 1.0; $b = 0.0; break;\n case 'chocolate':\n $r = 0.824; $g = 0.412; $b = 0.118; break;\n case 'coral':\n $r = 1.0; $g = 0.498; $b = 0.314; break;\n case 'cornflowerblue':\n $r = 0.392; $g = 0.584; $b = 0.929; break;\n case 'cornsilk':\n $r = 1.0; $g = 0.973; $b = 0.863; break;\n case 'crimson':\n $r = 0.863; $g = 0.078; $b = 0.235; break;\n case 'cyan':\n $r = 0.0; $g = 1.0; $b = 1.0; break;\n case 'darkblue':\n $r = 0.0; $g = 0.0; $b = 0.545; break;\n case 'darkcyan':\n $r = 0.0; $g = 0.545; $b = 0.545; break;\n case 'darkgoldenrod':\n $r = 0.722; $g = 0.525; $b = 0.043; break;\n case 'darkgray':\n $r = 0.663; $g = 0.663; $b = 0.663; break;\n case 'darkgreen':\n $r = 0.0; $g = 0.392; $b = 0.0; break;\n case 'darkkhaki':\n $r = 0.741; $g = 0.718; $b = 0.420; break;\n case 'darkmagenta':\n $r = 0.545; $g = 0.0; $b = 0.545; break;\n case 'darkolivegreen':\n $r = 0.333; $g = 0.420; $b = 0.184; break;\n case 'darkorange':\n $r = 1.0; $g = 0.549; $b = 0.0; break;\n case 'darkorchid':\n $r = 0.6; $g = 0.196; $b = 0.8; break;\n case 'darkred':\n $r = 0.545; $g = 0.0; $b = 0.0; break;\n case 'darksalmon':\n $r = 0.914; $g = 0.588; $b = 0.478; break;\n case 'darkseagreen':\n $r = 0.561; $g = 0.737; $b = 0.561; break;\n case 'darkslateblue':\n $r = 0.282; $g = 0.239; $b = 0.545; break;\n case 'darkslategray':\n $r = 0.184; $g = 0.310; $b = 0.310; break;\n case 'darkturquoise':\n $r = 0.0; $g = 0.808; $b = 0.820; break;\n case 'darkviolet':\n $r = 0.580; $g = 0.0; $b = 0.827; break;\n case 'deeppink':\n $r = 1.0; $g = 0.078; $b = 0.576; break;\n case 'deepskyblue':\n $r = 0.0; $g = 0.749; $b = 1.0; break;\n case 'dimgray':\n $r = 0.412; $g = 0.412; $b = 0.412; break;\n case 'dodgerblue':\n $r = 0.118; $g = 0.565; $b = 1.0; break;\n case 'firebrick':\n $r = 0.698; $g = 0.133; $b = 0.133; break;\n case 'floralwhite':\n $r = 1.0; $g = 0.980; $b = 0.941; break;\n case 'forestgreen':\n $r = 0.133; $g = 0.545; $b = 0.133; break;\n case 'gainsboro':\n $r = 0.863; $g = 0.863; $b = 0.863; break;\n case 'ghostwhite':\n $r = 0.973; $g = 0.973; $b = 1.0; break;\n case 'gold':\n $r = 1.0; $g = 0.843; $b = 0.0; break;\n case 'goldenrod':\n $r = 0.855; $g = 0.647; $b = 0.125; break;\n case 'greenyellow':\n $r = 0.678; $g = 1.0; $b = 0.184; break;\n case 'honeydew':\n $r = 0.941; $g = 1.0; $b = 0.941; break;\n case 'hotpink':\n $r = 1.0; $g = 0.412; $b = 0.706; break;\n case 'indianred':\n $r = 0.804; $g = 0.361; $b = 0.361; break;\n case 'indigo':\n $r = 0.294; $g = 0.0; $b = 0.510; break;\n case 'ivory':\n $r = 1.0; $g = 0.941; $b = 0.941; break;\n case 'khaki':\n $r = 0.941; $g = 0.902; $b = 0.549; break;\n case 'lavender':\n $r = 0.902; $g = 0.902; $b = 0.980; break;\n case 'lavenderblush':\n $r = 1.0; $g = 0.941; $b = 0.961; break;\n case 'lawngreen':\n $r = 0.486; $g = 0.988; $b = 0.0; break;\n case 'lemonchiffon':\n $r = 1.0; $g = 0.980; $b = 0.804; break;\n case 'lightblue':\n $r = 0.678; $g = 0.847; $b = 0.902; break;\n case 'lightcoral':\n $r = 0.941; $g = 0.502; $b = 0.502; break;\n case 'lightcyan':\n $r = 0.878; $g = 1.0; $b = 1.0; break;\n case 'lightgoldenrodyellow':\n $r = 0.980; $g = 0.980; $b = 0.824; break;\n case 'lightgreen':\n $r = 0.565; $g = 0.933; $b = 0.565; break;\n case 'lightgrey':\n $r = 0.827; $g = 0.827; $b = 0.827; break;\n case 'lightpink':\n $r = 1.0; $g = 0.714; $b = 0.757; break;\n case 'lightsalmon':\n $r = 1.0; $g = 0.627; $b = 0.478; break;\n case 'lightseagreen':\n $r = 0.125; $g = 0.698; $b = 0.667; break;\n case 'lightskyblue':\n $r = 0.529; $g = 0.808; $b = 0.980; break;\n case 'lightslategray':\n $r = 0.467; $g = 0.533; $b = 0.6; break;\n case 'lightsteelblue':\n $r = 0.690; $g = 0.769; $b = 0.871; break;\n case 'lightyellow':\n $r = 1.0; $g = 1.0; $b = 0.878; break;\n case 'limegreen':\n $r = 0.196; $g = 0.804; $b = 0.196; break;\n case 'linen':\n $r = 0.980; $g = 0.941; $b = 0.902; break;\n case 'magenta':\n $r = 1.0; $g = 0.0; $b = 1.0; break;\n case 'mediumaquamarine':\n $r = 0.4; $g = 0.804; $b = 0.667; break;\n case 'mediumblue':\n $r = 0.0; $g = 0.0; $b = 0.804; break;\n case 'mediumorchid':\n $r = 0.729; $g = 0.333; $b = 0.827; break;\n case 'mediumpurple':\n $r = 0.576; $g = 0.439; $b = 0.859; break;\n case 'mediumseagreen':\n $r = 0.235; $g = 0.702; $b = 0.443; break;\n case 'mediumslateblue':\n $r = 0.482; $g = 0.408; $b = 0.933; break;\n case 'mediumspringgreen':\n $r = 0.0; $g = 0.980; $b = 0.604; break;\n case 'mediumturquoise':\n $r = 0.282; $g = 0.820; $b = 0.8; break;\n case 'mediumvioletred':\n $r = 0.780; $g = 0.082; $b = 0.522; break;\n case 'midnightblue':\n $r = 0.098; $g = 0.098; $b = 0.439; break;\n case 'mintcream':\n $r = 0.961; $g = 1.0; $b = 0.980; break;\n case 'mistyrose':\n $r = 1.0; $g = 0.894; $b = 0.882; break;\n case 'moccasin':\n $r = 1.0; $g = 0.894; $b = 0.710; break;\n case 'navajowhite':\n $r = 1.0; $g = 0.871; $b = 0.678; break;\n case 'oldlace':\n $r = 0.992; $g = 0.961; $b = 0.902; break;\n case 'olivedrab':\n $r = 0.420; $g = 0.557; $b = 0.137; break;\n case 'orange':\n $r = 1.0; $g = 0.647; $b = 0.0; break;\n case 'orangered':\n $r = 1.0; $g = 0.271; $b = 0.0; break;\n case 'orchid':\n $r = 0.855; $g = 0.439; $b = 0.839; break;\n case 'palegoldenrod':\n $r = 0.933; $g = 0.910; $b = 0.667; break;\n case 'palegreen':\n $r = 0.596; $g = 0.984; $b = 0.596; break;\n case 'paleturquoise':\n $r = 0.686; $g = 0.933; $b = 0.933; break;\n case 'palevioletred':\n $r = 0.859; $g = 0.439; $b = 0.576; break;\n case 'papayawhip':\n $r = 1.0; $g = 0.937; $b = 0.835; break;\n case 'peachpuff':\n $r = 1.0; $g = 0.937; $b = 0.835; break;\n case 'peru':\n $r = 0.804; $g = 0.522; $b = 0.247; break;\n case 'pink':\n $r = 1.0; $g = 0.753; $b = 0.796; break;\n case 'plum':\n $r = 0.867; $g = 0.627; $b = 0.867; break;\n case 'powderblue':\n $r = 0.690; $g = 0.878; $b = 0.902; break;\n case 'rosybrown':\n $r = 0.737; $g = 0.561; $b = 0.561; break;\n case 'royalblue':\n $r = 0.255; $g = 0.412; $b = 0.882; break;\n case 'saddlebrown':\n $r = 0.545; $g = 0.271; $b = 0.075; break;\n case 'salmon':\n $r = 0.980; $g = 0.502; $b = 0.447; break;\n case 'sandybrown':\n $r = 0.957; $g = 0.643; $b = 0.376; break;\n case 'seagreen':\n $r = 0.180; $g = 0.545; $b = 0.341; break;\n case 'seashell':\n $r = 1.0; $g = 0.961; $b = 0.933; break;\n case 'sienna':\n $r = 0.627; $g = 0.322; $b = 0.176; break;\n case 'skyblue':\n $r = 0.529; $g = 0.808; $b = 0.922; break;\n case 'slateblue':\n $r = 0.416; $g = 0.353; $b = 0.804; break;\n case 'slategray':\n $r = 0.439; $g = 0.502; $b = 0.565; break;\n case 'snow':\n $r = 1.0; $g = 0.980; $b = 0.980; break;\n case 'springgreen':\n $r = 0.0; $g = 1.0; $b = 0.498; break;\n case 'steelblue':\n $r = 0.275; $g = 0.510; $b = 0.706; break;\n case 'tan':\n $r = 0.824; $g = 0.706; $b = 0.549; break;\n case 'thistle':\n $r = 0.847; $g = 0.749; $b = 0.847; break;\n case 'tomato':\n $r = 0.992; $g = 0.388; $b = 0.278; break;\n case 'turquoise':\n $r = 0.251; $g = 0.878; $b = 0.816; break;\n case 'violet':\n $r = 0.933; $g = 0.510; $b = 0.933; break;\n case 'wheat':\n $r = 0.961; $g = 0.871; $b = 0.702; break;\n case 'whitesmoke':\n $r = 0.961; $g = 0.961; $b = 0.961; break;\n case 'yellowgreen':\n $r = 0.604; $g = 0.804; $b = 0.196; break;\n default:\n return null;\n }\n return array('r' => $r * 255, 'g' => $g * 255, 'b' => $b * 255);\n }",
"function color_picker($p,$maxPixel,$numberSpirals,$start_color,$end_color){\n\t\t$start_dec = hexdec($start_color);\n\t\t$end_dec = hexdec($end_color);\n\t\t$rgb = $start_dec;\n\t\t$r = ($rgb >> 16) & 0xFF;\n\t\t$g = ($rgb >> 8) & 0xFF;\n\t\t$b = $rgb & 0xFF;\n\t\t$HSL=RGB_TO_HSV ($r, $g, $b);\n\t\t$start_H=$HSL['H']; \n\t\t$start_S=$HSL['S']; \n\t\t$start_V=$HSL['V']; \n\t\t$rgb = $end_dec;\n\t\t$r = ($rgb >> 16) & 0xFF;\n\t\t$g = ($rgb >> 8) & 0xFF;\n\t\t$b = $rgb & 0xFF;\n\t\t$HSL=RGB_TO_HSV ($r, $g, $b);\n\t\t$end_H=$HSL['H']; \n\t\t$end_S=$HSL['S']; \n\t\t$end_V=$HSL['V']; \n\t\t$range=$start_H-$end_H;\n\t\tif($start_H<$end_H)\t\t$range=$end_H-$start_H;\n\t\t//if($range<0) $range+=1.0;\n\t\t$percentage = $p/$maxPixel; // 0 to 1.0\n\t\tif($start_H>$end_H)\t\t$H = $start_H - $percentage*$range;\n\t\telse\t$H = $start_H + $percentage*$range;\n\t\tif($H<0) $H+=1.0;\n\t\t$range=$start_S-$end_S;\n\t\tif($start_S<$end_S)\t\t$range=$end_S-$start_S;\n\t\t//if($range<0) $range+=1.0;\n\t\tif($start_S>$end_S)\t\t$S = $start_S - $percentage*$range;\n\t\telse\t$S = $start_S + $percentage*$range;\n\t\tif($S<0) $S+=1.0;\n\t\t$range=$start_V-$end_V;\n\t\tif($start_V<$end_V)\t\t$range=$end_V-$start_V;\n\t\t//if($range<0) $range+=1.0;\n\t\tif($start_V>$end_V)\t\t$V = $start_V - $percentage*$range;\n\t\telse\t$V = $start_V + $percentage*$range;\n\t\tif($V<0) $V+=1.0;\n\t\t$color_HSV=array('H'=>$H,'S'=>$S,'V'=>$V);\n\t\treturn $color_HSV;\n\t}",
"function carton_hex_lighter( $color, $factor = 30 ) {\n\t\t$base = carton_rgb_from_hex( $color );\n\t\t$color = '#';\n\n\t foreach ($base as $k => $v) :\n\t $amount = 255 - $v;\n\t $amount = $amount / 100;\n\t $amount = round($amount * $factor);\n\t $new_decimal = $v + $amount;\n\n\t $new_hex_component = dechex($new_decimal);\n\t if(strlen($new_hex_component) < 2) :\n\t \t$new_hex_component = \"0\".$new_hex_component;\n\t endif;\n\t $color .= $new_hex_component;\n\t \tendforeach;\n\n\t \treturn $color;\n\t}",
"public function setColor($color) {}",
"function set_color_account_status($acc_number,$color)\n\t{\n\t switch($color):\n\t case('1'): $data['color'] = '#00FF00';\n\t\tbreak;\n\t case('2'): $data['color'] = '#FF0000';\n\t\tbreak;\n\t case('3'): $data['color'] = '#FFFFFF';\n\t\tbreak;\n\t case('4'): $data['color'] = '#999999';\n\t\tbreak;\n\t case('5'): $data['color'] = '#00F0F0';\n\t\tbreak;\n\t\totherwise:\n\t\t\t$data['color'] = '#FFFFFF';\n\t endswitch;\t\n\n\t return $this->db->where('login',$acc_number)\n\t \t ->limit(1)\n\t \t ->update('pamm_accounts', $data);\n\t}",
"public function backgroundColor(array $color);",
"function percent2Color($value, $brightness = 255, $max = 100, $min = 0, $thirdColorHex = '00') {\n\t$first = (1-($value/$max))*$brightness;\n\t$second = ($value/$max)*$brightness;\n\n\t// Find the influence of the middle color (yellow if 1st and 2nd are red and green)\n\t$diff = abs($first-$second);\n\t$influence = ($brightness-$diff)/2; \n\t$first = intval($first + $influence);\n\t$second = intval($second + $influence);\n\n\t// Convert to HEX, format and return\n\t$firstHex = str_pad(dechex($first),2,0,STR_PAD_LEFT);\n\t$secondHex = str_pad(dechex($second),2,0,STR_PAD_LEFT);\n\t$thirdColorHex = str_pad(dechex($thirdColorHex),2,0,STR_PAD_LEFT);\n\t\n\tif (($value % 3) == 0) { // three\n\t\treturn '#' . $firstHex . $secondHex . $thirdColorHex;\n\t} else if (($value % 3) == 1) { // two\n\t\treturn '#' . $thirdColorHex . $firstHex . $secondHex;\n\t} else if (($value % 3) == 2) { // one\n\t\treturn '#' . $secondHex . $thirdColorHex . $firstHex;\n\t}\n\n// alternatives:\n// return $thirdColorHex . $firstHex . $secondHex;\n// return $firstHex . $thirdColorHex . $secondHex;\n}",
"function validate_color_rgba($color) {\n\n\t\tif ($color == \"transparent\") {\n\t\t\treturn $color;\n\t\t}\n\n\t\t$color = str_replace('#','', $color);\n\t\tif (strlen($color) == 3) {\n\t\t\t$color = $color.$color;\n\t\t}\n\t\tif (preg_match('/^[a-f0-9]{6}$/i', $color)) {\n\t\t\t$color = '#' . $color;\n\t\t}\n\t \n\t \treturn $this->hex2rgba($color);\n\n\t}",
"function the_monday_colour_brightness($hex, $percent) {\n $hash = '';\n if (stristr($hex, '#')) {\n $hex = str_replace('#', '', $hex);\n $hash = '#';\n }\n /// HEX TO RGB\n $rgb = array(hexdec(substr($hex, 0, 2)), hexdec(substr($hex, 2, 2)), hexdec(substr($hex, 4, 2)));\n //// CALCULATE \n for ($i = 0; $i < 3; $i++) {\n // See if brighter or darker\n if ($percent > 0) {\n // Lighter\n $rgb[$i] = round($rgb[$i] * $percent) + round(255 * (1 - $percent));\n } else {\n // Darker\n $positivePercent = $percent - ($percent * 2);\n $rgb[$i] = round($rgb[$i] * $positivePercent) + round(0 * (1 - $positivePercent));\n }\n // In case rounding up causes us to go to 256\n if ($rgb[$i] > 255) {\n $rgb[$i] = 255;\n }\n }\n //// RBG to Hex\n $hex = '';\n for ($i = 0; $i < 3; $i++) {\n // Convert the decimal digit to hex\n $hexDigit = dechex($rgb[$i]);\n // Add a leading zero if necessary\n if (strlen($hexDigit) == 1) {\n $hexDigit = \"0\" . $hexDigit;\n }\n // Append to the hex string\n $hex .= $hexDigit;\n }\n return $hash . $hex;\n}",
"public static function get_alpha_from_rgba( $color ) {\n\t\t\tif ( is_array( $color ) ) {\n\t\t\t\tif ( isset( $color['opacity'] ) ) {\n\t\t\t\t\treturn $color['opacity'];\n\t\t\t\t} elseif ( isset( $color['alpha'] ) ) {\n\t\t\t\t\treturn $color['alpha'];\n\t\t\t\t} else {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( false === strpos( $color, 'rgba' ) ) {\n\t\t\t\treturn '1';\n\t\t\t}\n\n\t\t\t// Remove parts of the string.\n\t\t\t$color = str_replace( array( 'rgba', '(', ')', ' ' ), '', $color );\n\n\t\t\t// Convert to array.\n\t\t\t$color = explode( ',', $color );\n\n\t\t\tif ( isset( $color[3] ) ) {\n\t\t\t\treturn (string) $color[3];\n\t\t\t} else {\n\t\t\t\treturn '1';\n\t\t\t}\n\t\t}",
"private function getColor(float $percentage): string\n {\n if ($percentage >= 80) {\n return 'green';\n }\n\n if ($percentage >= 50) {\n return 'yellow';\n }\n\n return 'red';\n }"
]
| [
"0.63063174",
"0.56068593",
"0.54965925",
"0.5476318",
"0.54389036",
"0.54339534",
"0.54061264",
"0.53722036",
"0.5371178",
"0.5371178",
"0.53557503",
"0.5343308",
"0.53291327",
"0.5274565",
"0.5207929",
"0.517708",
"0.5166308",
"0.51245934",
"0.51112086",
"0.509657",
"0.5077469",
"0.50709164",
"0.5051264",
"0.49912784",
"0.49658048",
"0.49568886",
"0.4935944",
"0.49258372",
"0.4902938",
"0.4900722"
]
| 0.5776308 | 1 |
Delete an ontology from a OSF Web Services instance | function deleteOntology($uri, $credentials, $queryExtension = NULL)
{
$ontologyDelete = new OntologyDeleteQuery($credentials['osf-web-services'], $credentials['application-id'], $credentials['api-key'], $credentials['user']);
$ontologyDelete->ontology($uri)
->deleteOntology()
->send(($queryExtension !== NULL ? new $queryExtension : NULL));
if($ontologyDelete->isSuccessful())
{
cecho("Ontology successfully deleted: $uri\n", 'CYAN');
}
else
{
if(strpos($ontologyDelete->getStatusMessageDescription(), 'WS-ONTOLOGY-DELETE-300') !== FALSE)
{
cecho("$uri not currently loaded; skip deletation\n", 'BLUE');
}
else
{
$debugFile = md5(microtime()).'.error';
file_put_contents('/tmp/'.$debugFile, var_export($ontologyDelete, TRUE));
@cecho('Can\'t delete ontology '.$uri.'. '. $ontologyDelete->getStatusMessage() .
$ontologyDelete->getStatusMessageDescription()."\nDebug file: /tmp/$debugFile\n", 'RED');
return(FALSE);
}
}
return(TRUE);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function uninstall_OSF_WebServices()\n {\n // Get package info\n $installPath = \"{$this->osf_web_services_folder}/{$this->osf_web_services_ns}\";\n\n // Uninstall\n $this->span(\"Uninstalling...\", 'info');\n $this->rm(\"{$installPath}/\", TRUE);\n }",
"public function uninstall()\n {\n //$this->getDb()->createCommand()->dropTable($this->getTable())->execute();\n //delete the term itself\n $model = TaxonomyDef::findOne($this->id);\n $model->delete();\n }",
"function drush_behat_op_delete_term(\\stdClass $term) {\n $term = $term instanceof TermInterface ? $term : Term::load($term->tid);\n if ($term instanceof TermInterface) {\n $term->delete();\n }\n}",
"private function uninstall_OSF_OntologiesManagementTool()\n {\n // Get package info\n $installPath = \"{$this->ontologies_management_tool_folder}\";\n\n // Uninstall\n $this->span(\"Uninstalling...\", 'info');\n $this->rm(\"{$installPath}/\", TRUE);\n $this->rm(\"/usr/bin/omt\");\n }",
"public function deleting(Observation $observation)\n {\n //\n }",
"function delete()\n {\n $this->_api->doRequest(\"DELETE\", \"{$this->getBaseApiPath()}\");\n }",
"function delete()\n {\n $this->_api->doRequest(\"DELETE\", \"{$this->getBaseApiPath()}\");\n }",
"public function destroy(Office $office)\n {\n //\n }",
"public function destroy(Office $office)\n {\n //\n }",
"function _wsdl_docs_service_delete($name) {\n $service_id = _wsdl_docs_get_service_id($name);\n if (is_numeric($service_id)) {\n entity_delete('wsclient_service', $service_id);\n return \"DELETE SERVICE: $name, ID: $service_id\";\n }\n return 'WSDL Doc not deleted. No WSDL Doc matching the name was found.';\n}",
"public function DeleteDocumentosFase() {\n\t\t\t$this->objDocumentosFase->Delete();\n\t\t}",
"public function destroy(documento $documento)\n {\n //\n }",
"public function destroy(Oficina $oficina)\n {\n //\n }",
"public function destroy($id) {\r\n return $this->Word->destroy($id);\r\n }",
"public function delete( $oid=null );",
"public static function eliminarServicio($id_servicio){\n \n $eliminar = Neo4Play::client()->getNode($id_servicio);\t\t\n $eliminar->delete();\t\n \n\t}",
"public function testSoapDeleteRegistrationsInteractingWithOnlineWebservice()\n {\n $this->soap = new \\SoapClient(WSDL, array('trace' => 1));\n $credentials = new Credentials(USERNAME, PASSWORD, SKOLEKODE);\n $client = new Client($credentials, $this->soap);\n\n $repository = new RegistrationRepository($client);\n\n $weblist_id = 11111;\n $response = $repository->delete($weblist_id)->getBody();\n }",
"function deletewebserviceAction() {\n\n $clientId = $this->getRequest()->getParam('clientId');\n $webserviceId = $this->getRequest()->getParam('webserviceId');\n\n $em = Zend_Registry::getInstance()->entitymanager;\n\n if(isset($webserviceId) && $webserviceId != \"\") {\n\n $webserviceObj = $em->find('TWebservice',$webserviceId);\n $em->remove($webserviceObj);\n $em->flush();\n\n $this->_redirect('admin/webservice/index/clientId/'.$clientId);\n }\n }",
"public function ga_service_delete_term()\n {\n if (!is_admin()) {\n return;\n }\n\n $term_id = isset($_POST['term_id']) ? $_POST['term_id'] : false;\n\n if ($term_id) {\n\n if (wp_delete_term($term_id, 'ga_service_cat')) {\n $response = array('success' => true);\n wp_send_json_success($response);\n wp_die();\n } else {\n $response = array('success' => false);\n wp_send_json_error($response);\n wp_die();\n }\n } else {\n $response = array('success' => false);\n wp_send_json_error($response);\n wp_die();\n }\n }",
"public function DeleteDocente() {\n\t\t\t$this->objDocente->Delete();\n\t\t}",
"public function destroy($typology) //112\n {\n $this->authorize('destroy.typologies');\n \n $typology->delete();\n \n return redirect('typologies');\n }",
"public function destroy(FunFacts $funFacts)\n {\n //\n }",
"private function deleteLdapServer() {\n global $xmlConfig;\n $xpath = \"//services/ldapserver\";\n\t\t$object = $xmlConfig->get($xpath);\n //stop the openldap service while we clear the ldap directory\n $cmd = \"service slapd stop\";\n if (0 !== $this->exec($cmd, $output)) {\n throw new OMVException(OMVErrorMsg::E_EXEC_FAILED,\n $cmd, implode(\"\\n\", $output));\n }\n \n //now we clear the ldap directory\n $ldapDir=\"/var/lib/ldap\";\n $ldapConf=\"/etc/ldap/slapd.d\";\n $delCmd=\"rm -rf $ldapDir/* $ldapConf/cn=config $ldapConf/cn=config.ldif\";\n if (0 !== $this->exec($delCmd, $output)) {\n throw new OMVException(OMVErrorMsg::E_EXEC_FAILED,\n $delCmd, implode(\"\\n\", $output));\n }\n }",
"public function deleteDocument(AgentProfileInterface $profile);",
"function deleteDocument() {\n \tglobal $synAbsolutePath;\n global ${$this->name}, ${$this->name.\"_name\"}, ${$this->name.\"_old\"}; // ${$this->name} = ${\"surname\"} = $surname\n include_once(\"../../includes/php/utility.php\");\n $ext=$this->translate($this->getValue());\n $mat=$this->translatePath($this->mat);\n $filename=$this->createFilename(false);\n $documentRoot=$synAbsolutePath.\"/\";\n $fileToBeRemoved=$documentRoot.$mat.$filename.\"*\";\n foreach (glob($fileToBeRemoved) as $filename)\n unlink($filename);\n }",
"private static function deleteJsonLd(HasSchemaOrgData $entity)\n {\n $entity->schemaOrg()->delete();\n }",
"public function destroy(Term $term)\n {\n //\n }",
"public function destroy(Term $term)\n {\n //\n }",
"public function delete($instance) {\n if ( $instance instanceof repose_IProxy ) {\n $instance->___repose_delete();\n return;\n }\n foreach ( $this->wrappers as $clazz => $wrappers ) {\n foreach ( $wrappers as $id => $wrapper ) {\n if ( $wrapper['instance'] === $instance ) {\n $wrapper['proxy']->___repose_delete();\n break;\n }\n }\n }\n }",
"public function delete_delete(){\n $response = $this->PersonM->delete_person(\n $this->delete('id')\n );\n $this->response($response);\n }"
]
| [
"0.59966755",
"0.56599474",
"0.5611143",
"0.5583205",
"0.5459545",
"0.54496604",
"0.54496604",
"0.54039305",
"0.54039305",
"0.5386081",
"0.5372272",
"0.5323896",
"0.53218013",
"0.5302156",
"0.5290808",
"0.5222675",
"0.5214002",
"0.52110946",
"0.5168266",
"0.5167243",
"0.516525",
"0.51572543",
"0.5153039",
"0.5149526",
"0.5132088",
"0.5118629",
"0.51053125",
"0.51053125",
"0.51040494",
"0.5091198"
]
| 0.6735285 | 0 |
Stops a benchmark. Profiler::stop($token); | public static function stop($token,$arr=false)
{
// Stop the benchmark
Profiler::$_marks[$token]['stop_time'] = microtime(TRUE);
Profiler::$_marks[$token]['stop_memory'] = memory_get_usage();
if (Arr::is_array($arr)){
Profiler::$_marks[$token]['file'] = $arr['file'];
Profiler::$_marks[$token]['line'] = $arr['line'];
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function stop()\n {\n if (self::$_sessionBenchmarkOn) {\n self::$_sessionBenchmarkFinish = microtime(TRUE);\n }\n }",
"public function stop(): void\n {\n $this->end = microtime(true);\n }",
"public function stop()\n {\n $this->_timeStopInMicroSeconds = microtime(true);\n }",
"public function stop()\n {\n if (!$this->isOn) {\n return;\n }\n\n $this->dataset[$this->namespace] = xhprof_disable();\n $this->isOn = false;\n }",
"public function stop()\n {\n $this->mark('__stop');\n }",
"public function profilerStop()\n {\n if (extension_loaded('xhprof')) {\n $xhprofData = xhprof_disable();\n $xhprofRuns = new XHProfRuns_Default();\n $runId = $xhprofRuns->save_run($xhprofData, $this->xhprofNamespace);\n $profilerUrl = sprintf($this->xhprofHtmlPath . 'index.php?run=%s&source=%s', $runId, $this->xhprofNamespace);\n $styles = ' style=\"display: block; position: absolute; left: 5px; bottom: 5px; background: red; padding: 8px; z-index: 10000; color: #fff;\"';\n echo '<a href=\"' . $profilerUrl . '\" target=\"_blank\" ' . $styles . '>Profiler output</a>';\n }\n }",
"public function stop(): void;",
"public function stop(): void;",
"public function stop(): void;",
"public function stop(): void;",
"public function stop(): void;",
"public function endProfile($token){\n\t\t$log = $this->_profiles[$token];\n $log[0] = \"End Profiling $token\";\n\t\t$this->_logs[] = $log;\n\t\t$this->_profiles[$token]['result'] = microtime(true) - $this->_profiles[$token][3];\n\t\t$this->_profiles[$token]['memory'] = $this->memory_used() - $this->_profiles[$token]['startmem'];\n\t}",
"public static function stop()\n {\n self::$executionTime = round(abs(microtime(true) - $_ENV['W']['START_TIME']) * 1000, 0);\n }",
"public function stop() {}",
"public function stop()\n {\n if(null !== $this->fEnd)\n {\n throw new \\Exception('stop time is already set');\n }\n $this->iEndMemoryUsage = memory_get_usage();\n $this->fEnd = microtime(true);\n }",
"private function stopTimer()\n\t{\n\t\t// Measure how many seconds it took to execute\n\t\t$this->executionSeconds = microtime(true) - $this->startMicroStamp;\n\n\t\t// Keep statistics\n\t\tself::$totalExecutionSeconds += $this->executionSeconds;\n\t}",
"private static function microtimeStop(string $label): void\n {\n if (self::$status[$label]) {\n self::$microtimeStop[$label] = microtime(true);\n }\n }",
"public function stop(){\n if($this->_id) $this->times[$this->_id] += microtime(true) - $this->_start;\n $this->_id = null;\n }",
"public function stop();",
"public function stop();",
"public function stop();",
"public function stop();",
"public function stop();",
"public function stop();",
"public function stop();",
"public function stop();",
"public function stop() {\n\t\t$this->invoke(\"stop\");\n\t}",
"abstract public function stop();",
"public static function stop()\n {\n }",
"public static function stop(Vm $vm);"
]
| [
"0.6943711",
"0.67996705",
"0.66679937",
"0.65347147",
"0.647582",
"0.6375407",
"0.6331706",
"0.6331706",
"0.6331706",
"0.6331706",
"0.6331706",
"0.63100165",
"0.62665623",
"0.61429715",
"0.6129749",
"0.61127126",
"0.61057365",
"0.6089546",
"0.6031973",
"0.6031973",
"0.6031973",
"0.6031973",
"0.6031973",
"0.6031973",
"0.6031973",
"0.6031973",
"0.5995207",
"0.5974101",
"0.59514827",
"0.5950632"
]
| 0.7597123 | 0 |
Gets the total execution time and memory usage of a benchmark as a list. list($time, $memory) = Profiler::total($token); | public static function total($token)
{
// Import the benchmark data
$mark = Profiler::$_marks[$token];
if ($mark['stop_time'] === FALSE)
{
// The benchmark has not been stopped yet
$mark['stop_time'] = microtime(TRUE);
$mark['stop_memory'] = memory_get_usage();
}
return array
(
// Total time in seconds
$mark['stop_time'] - $mark['start_time'],
// Amount of memory in bytes
$mark['stop_memory'] - $mark['start_memory'],
$mark['file'],
$mark['line']
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function total($token) {\n\t\t// Import the benchmark data\n\t\t$mark = Profiler::$_marks[$token];\n\n\t\tif ($mark['stop_time'] === FALSE) {\n\t\t\t// The benchmark has not been stopped yet\n\t\t\t$mark['stop_time'] = microtime(TRUE);\n\t\t\t$mark['stop_memory'] = memory_get_usage();\n\t\t}\n\n\t\treturn array\n\t\t(\n\t\t\t// Total time in seconds\n\t\t\t$mark['stop_time'] - $mark['start_time'],\n\n\t\t\t// Amount of memory in bytes\n\t\t\t$mark['stop_memory'] - $mark['start_memory'],\n\t\t\t// Data attached to benchmark\n\t\t\t$mark['data'],\n\t\t\t$mark[\"trace\"]\n\t\t);\n\t}",
"public static function stats(array $tokens)\n\t{\n\t\t$min = $max = array(\n\t\t\t'time' => NULL,\n\t\t\t'memory' => NULL);\n\n\t\t// Total values are always integers\n\t\t$total = array(\n\t\t\t'time' => 0,\n\t\t\t'memory' => 0);\n\t\n\t\tforeach ($tokens as $token)\n\t\t{\n\t\t\t$other = Profiler::$_marks[$token]['other'];\n\t\t\t// Get the total time and memory for this benchmark\n\t\t\tlist($time, $memory) = Profiler::total($token);\n\n\t\t\tif ($max['time'] === NULL OR $time > $max['time'])\n\t\t\t{\n\t\t\t\t// Set the maximum time\n\t\t\t\t$max['time'] = $time;\n\t\t\t}\n\n\t\t\tif ($min['time'] === NULL OR $time < $min['time'])\n\t\t\t{\n\t\t\t\t// Set the minimum time\n\t\t\t\t$min['time'] = $time;\n\t\t\t}\n\n\t\t\t// Increase the total time\n\t\t\t$total['time'] += $time;\n\n\t\t\tif ($max['memory'] === NULL OR $memory > $max['memory'])\n\t\t\t{\n\t\t\t\t// Set the maximum memory\n\t\t\t\t$max['memory'] = $memory;\n\t\t\t}\n\n\t\t\tif ($min['memory'] === NULL OR $memory < $min['memory'])\n\t\t\t{\n\t\t\t\t// Set the minimum memory\n\t\t\t\t$min['memory'] = $memory;\n\t\t\t}\n\n\t\t\t// Increase the total memory\n\t\t\t$total['memory'] += $memory;\n\t\t}\n\n\t\t// Determine the number of tokens\n\t\t$count = count($tokens);\n\n\t\t// Determine the averages\n\t\t$average = array(\n\t\t\t'time' => $total['time'] / $count,\n\t\t\t'memory' => $total['memory'] / $count);\n\n\t\treturn array(\n\t\t\t'min' => $min,\n\t\t\t'max' => $max,\n\t\t\t'total' => $total,\n\t\t\t'average' => $average,\n\t\t\t'other'=>$other\n\t\t);\n\t}",
"public static function stats(array $tokens) {\n\t\t// Min and max are unknown by default\n\t\t$min = $max = array(\n\t\t\t'time' => NULL,\n\t\t\t'memory' => NULL,\n\t\t\t);\n\n\t\t// Total values are always integers\n\t\t$total = array(\n\t\t\t'time' => 0,\n\t\t\t'memory' => 0);\n\n\t\tforeach ($tokens as $token) {\n\t\t\t// Get the total time and memory for this benchmark\n\t\t\tlist($time, $memory) = Profiler::total($token);\n\n\t\t\tif ($max['time'] === NULL OR $time > $max['time'])\n\t\t\t{\n\t\t\t\t// Set the maximum time\n\t\t\t\t$max['time'] = $time;\n\t\t\t}\n\n\t\t\tif ($min['time'] === NULL OR $time < $min['time'])\n\t\t\t{\n\t\t\t\t// Set the minimum time\n\t\t\t\t$min['time'] = $time;\n\t\t\t}\n\n\t\t\t// Increase the total time\n\t\t\t$total['time'] += $time;\n\n\t\t\tif ($max['memory'] === NULL OR $memory > $max['memory'])\n\t\t\t{\n\t\t\t\t// Set the maximum memory\n\t\t\t\t$max['memory'] = $memory;\n\t\t\t}\n\n\t\t\tif ($min['memory'] === NULL OR $memory < $min['memory'])\n\t\t\t{\n\t\t\t\t// Set the minimum memory\n\t\t\t\t$min['memory'] = $memory;\n\t\t\t}\n\n\t\t\t// Increase the total memory\n\t\t\t$total['memory'] += $memory;\n\t\t}\n\n\t\t// Determine the number of tokens\n\t\t$count = count($tokens);\n\n\t\t// Determine the averages\n\t\t$average = array(\n\t\t\t'time' => $total['time'] / $count,\n\t\t\t'memory' => $total['memory'] / $count);\n\n\t\treturn array(\n\t\t\t'min' => $min,\n\t\t\t'max' => $max,\n\t\t\t'total' => $total,\n\t\t\t'average' => $average);\n\t}",
"protected function getStats()\n {\n $endTime = microtime() - $this->startTime;\n $stats = sprintf(\n 'Request-response cycle finished: %1.3fs'\n . ' - Memory usage: %1.2fMB (peak: %1.2fMB)'\n ,\n $endTime,\n memory_get_usage(true) / 1048576,\n memory_get_peak_usage(true) / 1048576\n );\n\n return $stats;\n }",
"protected static function get_benchmarks() : array\n\t{\n\t\t$result = [];\n\n\t\tif (! Kohana::$profiling)\n\t\t{\n\t\t\treturn $result;\n\t\t}\n\n\t\t$groups = Profiler::groups();\n\n\t\tforeach (array_keys($groups) as $group)\n\t\t{\n\t\t\tif (strpos($group, 'database (') === FALSE)\n\t\t\t{\n\t\t\t\tforeach ($groups[$group] as $name => $marks)\n\t\t\t\t{\n\t\t\t\t\t$stats = Profiler::stats($marks);\n\t\t\t\t\t$result[$group][] = [\n\t\t\t\t\t\t'name' => $name,\n\t\t\t\t\t\t'count' => count($marks),\n\t\t\t\t\t\t'total_time' => $stats['total']['time'],\n\t\t\t\t\t\t'avg_time' => $stats['average']['time'],\n\t\t\t\t\t\t'total_memory' => $stats['total']['memory'],\n\t\t\t\t\t\t'avg_memory' => $stats['average']['memory'],\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// add total stats\n\t\t$total = Profiler::application();\n\t\t$result['application'] = [\n\t\t\t'count' => 1,\n\t\t\t'total_time' => $total['current']['time'],\n\t\t\t'avg_time' => $total['average']['time'],\n\t\t\t'total_memory' => $total['current']['memory'],\n\t\t\t'avg_memory' => $total['average']['memory'],\n\n\t\t];\n\n\t\treturn $result;\n\t}",
"public function benchmark() {\n return self::benchmarkEnd($this->benchmarkStart);\n }",
"public function gatherSpeedData()\n {\n $speedTotals = array();\n\n $speedTotals['total'] = $this->getReadableTime((microtime(true) - $this->startTime) * 1000);\n $speedTotals['allowed'] = ini_get(\"max_execution_time\");\n\n $this->output['speedTotals'] = $speedTotals;\n }",
"public function getBenchmark()\n {\n return $this->benchmark;\n }",
"public function getTokensPerSecond()\n {\n return $this->tokens / self::$unitMap[$this->unit];\n }",
"static function ms(){\r\n $dm = memory_get_usage() - self::$startmem;\r\n return self::memformat($dm);\r\n }",
"static function measureResults(){\n\t\tforeach(self::$measures as $name=>$measure){\n\t\t\t$totalTime = 0;\n\t\t\twhile(($instance = current($measure)) && next($measure)){\n\t\t\t\t$nextInstance = current($measure);\n\t\t\t\tif($nextInstance){\n\t\t\t\t\t$currentCount = count($out[$name]);\n\t\t\t\t\t$totalTime += $nextInstance['time'] - $instance['time'];\n\t\t\t\t\t$out[$name][$currentCount]['timeChange'] = $nextInstance['time'] - $instance['time'];\n\t\t\t\t\t$out[$name][$currentCount]['memoryChange'] = $nextInstance['mem'] - $instance['mem'];\n\t\t\t\t\t$out[$name][$currentCount]['peakMemoryChange'] = $nextInstance['peakMem'] - $instance['peakMem'];\n\t\t\t\t\t$out[$name][$currentCount]['peakMemoryLevel'] = $instance['peakMem'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$out[$name]['total']['time'] = $totalTime;\n\t\t}\n\t\treturn $out;\n\t}",
"static function measure($name='std'){\n\t\t$next = count(self::$measures[$name]);\n\t\tself::$measures[$name][$next]['time'] = microtime(true);\n\t\tself::$measures[$name][$next]['mem'] = memory_get_usage();\n\t\tself::$measures[$name][$next]['peakMem'] = memory_get_peak_usage();\n\t}",
"public function finPerformance(){\n $memoria = memory_get_usage() - $this->memoria;\n $tiempo = microtime(true) - $this->tiempo;\n\n echo \"<pre>\";\n print_r(array(\"memoria\" => $memoria.\" bytes \", \"tiempo\" => $tiempo.\" segundos\" ));\n die;\n }",
"public function calculateTokensPerUsage();",
"public function microtime();",
"public static function totalDuration()\n {\n return microtime(true) - static::initialTime();\n }",
"protected function calculateExecutionTime(): array\n\t{\n\t\t$totalTime = microtime(true) - $this->application->getStartTime();\n\n\t\t$executionTime = ['total' => $totalTime, 'details' => []];\n\n\t\t$otherTime = 0;\n\n\t\tforeach($this->timers as $timer)\n\t\t{\n\t\t\t$otherTime += $timer instanceof Closure ? $timer() : $timer;\n\t\t}\n\n\t\t$detailedTime = $totalTime - $otherTime;\n\n\t\t$executionTime['details']['PHP'] = ['time' => $detailedTime, 'pct' => ($detailedTime / $totalTime * 100)];\n\n\t\tforeach($this->timers as $timer => $time)\n\t\t{\n\t\t\tif($time instanceof Closure)\n\t\t\t{\n\t\t\t\t$time = $time();\n\t\t\t}\n\n\t\t\t$executionTime['details'][$timer] = ['time' => $time, 'pct' => ($time / $totalTime * 100)];\n\t\t}\n\n\t\treturn $executionTime;\n\t}",
"public function getElapsed()\n {\n $elapsedTime = array_sum($this->_totalTime);\n\n // No elapsed time or currently running? take/add current running time\n if ($this->_start !== null) {\n $elapsedTime += microtime(true) - $this->_start;\n }\n\n return $elapsedTime;\n }",
"protected function time()\n {\n $time = microtime();\n $time = explode(' ', $time);\n $time = $time[1] + $time[0];\n return $time;\n }",
"protected function calculateColors()\n {\n // initial structure of our return array\n $return = ['time' => [], 'memory' => []];\n\n // short-circuit if we only have one thing to benchmark\n if (count($this->benchmarks) == 1) {\n $name = $this->benchmarks[0]->getName();\n $return['time'][$name] = self::COLOR_GREEN;\n $return['memory'][$name] = self::COLOR_GREEN;\n\n return $return;\n }\n\n // we make separate arrays since we don't want to re-order the list as it was passed in. usort would do that\n $times = [];\n $memories = [];\n\n // split them all out\n /** @var Benchmark $benchmark */\n foreach ($this->benchmarks as $benchmark) {\n $times[$benchmark->getName()] = $benchmark->getTime();\n $memories[$benchmark->getName()] = $benchmark->getMemory();\n }\n\n // sort them by value\n asort($times);\n asort($memories);\n\n // go through the times--anything < 34% is green, between 34 and 66 is yellow, higher is red\n $i = 1;\n foreach ($times as $productName => $time) {\n $rank = $i / (count($this->benchmarks) + 1);\n if ($rank <= .34) {\n $return['time'][$productName] = self::COLOR_GREEN;\n } else if ($rank > .34 && $rank <= .66) {\n $return['time'][$productName] = self::COLOR_YELLOW;\n } else {\n $return['time'][$productName] = self::COLOR_RED;\n }\n $i++;\n }\n\n // go through the memory--anything < 34% is green, between 34 and 66 is yellow, higher is red\n $i = 1;\n foreach ($memories as $productName => $memory) {\n $rank = $i / (count($this->benchmarks) + 1);\n if ($rank <= .34) {\n $return['memory'][$productName] = self::COLOR_GREEN;\n } else if ($rank > .34 && $rank <= .66) {\n $return['memory'][$productName] = self::COLOR_YELLOW;\n } else {\n $return['memory'][$productName] = self::COLOR_RED;\n }\n $i++;\n }\n\n return $return;\n }",
"public static function getMemory() {\n if (is_null(self::$_mem)) {\n self::$_mem = memory_get_usage();\n } else {\n $memory = memory_get_usage() - self::$_mem;\n $unit = ['b', 'kb', 'mb', 'gb', 'tb', 'pb'];\n echo round($memory / pow(1024, ($i = floor(log($memory, 1024)))), 2) . $unit[$i] . PHP_EOL;\n }\n }",
"public function gatherMemoryData()\n {\n $memoryTotals = array();\n\n $memoryTotals['used'] = $this->getReadableFileSize(memory_get_peak_usage());\n\n $memoryTotals['total'] = ini_get(\"memory_limit\");\n\n $this->output['memoryTotals'] = $memoryTotals;\n }",
"public function getTotalTime()\n {\n if (isset($this->results)) {\n return $this->results->getTotalTime();\n }\n }",
"public function getTotalExecutionTime()\n {\n return $this->totalExecutionTime;\n }",
"function MemoryUsage()\n{\n\t$mem = memory_get_usage();\n\treturn number_format(($mem / 1024), 4);\n}",
"function getMemUsage(){\n\t// Resets\n\t$total = 0;\n\t$free = 0;\n\t$cached = 0;\n\n\t// Open file handle\n\t$fh = fopen('/proc/meminfo','r');\n\n\t// Loop\n\twhile($line = fgets($fh)) {\n\t\t$pieces = array();\n\n\t\t// Total memory\n\t\tif(preg_match('/^MemTotal:\\s+(\\d+)\\skB$/', $line, $pieces)){\n\t\t\t$total = $pieces[1];\n\t\t}\n\n\t\t// Free memory\n\t\tif(preg_match('/^MemFree:\\s+(\\d+)\\skB$/', $line, $pieces)){\n\t\t\t$free = $pieces[1];\n\t\t}\n\n\t\t// Cached memory \n\t\tif(preg_match('/^Cached:\\s+(\\d+)\\skB$/', $line, $pieces)){\n\t\t\t$cached = $pieces[1];\n\t\t}\n\n\t\t// Break loop when both are set\n\t\tif(!empty($total) && !empty($free) && !empty($cached)){\n\t\t\tbreak;\n\t\t}\n\t}\n\t// Close file handle (/proc/meminfo)\n\tfclose($fh);\n\n\t// Convert all values from kB to GB and round to 2 decimal places\n\t$total = ($total / 1024 / 1024);\n\t$total = round($total, 2);\n\t\n\t$free = ($free / 1024 / 1024);\n\t$free = round($free, 2);\n\t\n\t$cached = ($cached / 1024 / 1024);\n\t$cached = round($cached, 2);\n\t\n\t// Fix if there is something weird with memory usage (TODO not sure why it does this?)\n\tif($cached > $free){\n\t\t$usage_percentage = round(((($total - $cached)/$total)*100), 0);\n\t}\n\telseif($cached < $free){\n\t\t$usage_percentage = round(((($total - $free)/$total)*100), 0);\n\t}\n\n\t// Fix if over 100% (TODO not sure why it does this?)\n\tif ($usage_percentage > '100') {\n\t\t\t$usage_percentage = '100';\n\t}\n\n\treturn $usage_percentage.'%';\n}",
"function getBenchmark(string $name){\n return $this->benchmarks[$name] ?? null;\n }",
"private static function time()\n {\n list($usec, $sec) = explode(\" \", microtime());\n return ((float)$usec + (float)$sec);\n }",
"public static function get_token_times()\n {\n $timer = &self::$timer;\n $session_start = $timer->__get('session_start');\n $session_checkpoint = $timer->__get('session_checkpoint');\n\n $times = array(\n 'session_start' => $session_start,\n 'session_checkpoint' => $session_checkpoint,\n );\n return $times;\n }",
"private function execution_time($total, $count = 0)\n\t{\n\t\t$hours = $minutes = $seconds = 0;\n\n\t\tif ($count > 0)\n\t\t{\n\t\t\t// If calculating an average, divide the total by the count\n\t\t\t$total = floor($total / $count);\n\t\t}\n\n\t\tif ($total > 0)\n\t\t{\n\t\t\t// Pad each number to two digits\n\t\t\t$hours = str_pad(floor($total / 3600), 2, '0', STR_PAD_LEFT);\n\t\t\t$minutes = str_pad(floor(($total / 60) % 60), 2, '0', STR_PAD_LEFT);\n\t\t\t$seconds = str_pad($total % 60, 2, '0', STR_PAD_LEFT);\n\t\t}\n\n\t\t// Return a simple array\n\t\treturn array(\n\t\t\t'h' => $hours,\n\t\t\t'm' => $minutes,\n\t\t\t's' => $seconds\n\t\t);\n\t}"
]
| [
"0.8728274",
"0.6520946",
"0.6290621",
"0.61254877",
"0.6084452",
"0.60608065",
"0.58702934",
"0.58687234",
"0.5819219",
"0.5779618",
"0.5722715",
"0.5602553",
"0.5536992",
"0.5517307",
"0.5415603",
"0.541454",
"0.53861564",
"0.5340199",
"0.53355026",
"0.5306003",
"0.5299851",
"0.529227",
"0.52835405",
"0.5264139",
"0.5245903",
"0.5238071",
"0.5232202",
"0.5230964",
"0.5207764",
"0.520296"
]
| 0.8600683 | 1 |
Returns an empty (but complete) order object. | function getEmptyMemberOrder()
{
//defaults
$order = new stdClass();
$order->code = $this->getRandomCode();
$order->user_id = "";
$order->membership_id = "";
$order->subtotal = "";
$order->tax = "";
$order->couponamount = "";
$order->total = "";
$order->payment_type = "";
$order->cardtype = "";
$order->accountnumber = "";
$order->expirationmonth = "";
$order->expirationyear = "";
$order->status = "success";
$order->gateway = pmpro_getOption("gateway");
$order->gateway_environment = pmpro_getOption("gateway_environment");
$order->payment_transaction_id = "";
$order->subscription_transaction_id = "";
$order->affiliate_id = "";
$order->affiliate_subid = "";
$order->notes = "";
$order->checkout_id = 0;
$order->billing = new stdClass();
$order->billing->name = "";
$order->billing->street = "";
$order->billing->city = "";
$order->billing->state = "";
$order->billing->zip = "";
$order->billing->country = "";
$order->billing->phone = "";
return $order;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function clearOrders() {\r\n $this->__orders = array();\r\n return $this;\r\n }",
"public function clearOrder() {\n\t\t\t$this->order->clearOrder();\n\t\t}",
"public final function resetOrder()\n {\n $this->order = '';\n return $this;\n }",
"public function getOrder()\n {\n return $this->orderFactory->create()->load($this->getReservedOrderId(), 'increment_id');\n }",
"public function getOrder()\n {\n return 0;\n }",
"public function generateOrder();",
"public function getOrder();",
"public function getOrder();",
"public function getOrder();",
"public function getOrder();",
"public function getOrder();",
"public function getOrder();",
"public function getOrder()\n {\n // TODO: Implement getOrder() method.\n }",
"public function getOrder()\n {\n // TODO: Implement getOrder() method.\n }",
"public function getOrder()\n {\n // TODO: Implement getOrder() method.\n }",
"function getOrder()\n {\n return 0;\n }",
"function getOrder()\n {\n return 0;\n }",
"protected function createOrder(array $data = null)\n {\n $order = new Order();\n if ($data !== null) {\n $order->setData($data);\n }\n return $order;\n }",
"private function createOrder()\n {\n $order = $this->getMock(\\OxidEsales\\Eshop\\Application\\Model\\Order::class, array('validateDeliveryAddress', '_sendOrderByEmail'));\n // sending order by email is always successful for tests\n $order->expects($this->any())->method('_sendOrderByEmail')->will($this->returnValue(1));\n //mocked to circumvent delivery address change md5 check from requestParameter\n $order->expects($this->any())->method('validateDeliveryAddress')->will($this->returnValue(0));\n\n $this->testOrderId = substr_replace( oxRegistry::getUtilsObject()->generateUId(), '_', 0, 1 );\n $order->setId($this->testOrderId);\n\n return $order;\n }",
"function createOrder() {\n\t$postData = new Order;\n\n\treturn $postData->getOrderJson();\n}",
"public function getOrder()\n {\n\n }",
"protected function _getOrder()\n {\n if (empty($this->_order)) {\n // get proper order\n $id = $this->_request['track_id'];\n $this->_order = Mage::getModel('sales/order')->loadByIncrementId($id);\n if (!$this->_order->getId()) {\n $this->_debugData['exception'] = sprintf('Wrong order ID: \"%s\".', $id);\n $this->_debug();\n Mage::app()->getResponse()\n ->setHeader('HTTP/1.1','503 Service Unavailable')\n ->sendResponse();\n exit;\n }\n }\n return $this->_order;\n }",
"public function getOrder()\n {\n if ($this->_order === false) {\n $items = $this->items;\n $first = reset($items);\n $this->_order = $first !== null ? $first->order : null;\n }\n return $this->_order;\n }",
"function getOrder();",
"function getOrder()\n{\n\n}",
"public function orders(): Orders\n {\n return new Orders($this);\n }",
"public function getOrder()\n {\n \treturn $this->_order;\n }",
"public function resetorder()\n {\n $oOrder = oxNew(\"oxorder\");\n if ($oOrder->load($this->getEditObjectId())) {\n $oOrder->oxorder__oxsenddate = new oxField(\"0000-00-00 00:00:00\");\n $oOrder->save();\n }\n }",
"public function getOrder()\n {\n return $this->__get(\"order\");\n }",
"public function getOrder()\n {\n return $this->_order;\n }"
]
| [
"0.6798287",
"0.6709417",
"0.66826147",
"0.6608428",
"0.64319336",
"0.6410323",
"0.63843286",
"0.63843286",
"0.63843286",
"0.63843286",
"0.63843286",
"0.63843286",
"0.6373834",
"0.6373834",
"0.6373834",
"0.63471794",
"0.63471794",
"0.6253891",
"0.62455195",
"0.62416375",
"0.62065774",
"0.6158006",
"0.6116232",
"0.6114505",
"0.6076986",
"0.6027774",
"0.60264534",
"0.60122997",
"0.5975723",
"0.5967562"
]
| 0.700245 | 0 |
Retrieve a member order from the DB by ID | function getMemberOrderByID($id)
{
global $wpdb;
if(!$id)
return false;
$gmt_offset = get_option('gmt_offset');
$dbobj = $wpdb->get_row("SELECT *, UNIX_TIMESTAMP(timestamp) + " . ($gmt_offset * 3600) . " as timestamp FROM $wpdb->pmpro_membership_orders WHERE id = '$id' LIMIT 1");
if($dbobj)
{
$this->id = $dbobj->id;
$this->code = $dbobj->code;
$this->session_id = $dbobj->session_id;
$this->user_id = $dbobj->user_id;
$this->membership_id = $dbobj->membership_id;
$this->paypal_token = $dbobj->paypal_token;
$this->billing = new stdClass();
$this->billing->name = $dbobj->billing_name;
$this->billing->street = $dbobj->billing_street;
$this->billing->city = $dbobj->billing_city;
$this->billing->state = $dbobj->billing_state;
$this->billing->zip = $dbobj->billing_zip;
$this->billing->country = $dbobj->billing_country;
$this->billing->phone = $dbobj->billing_phone;
//split up some values
$nameparts = pnp_split_full_name($this->billing->name);
if(!empty($nameparts['fname']))
$this->FirstName = $nameparts['fname'];
else
$this->FirstName = "";
if(!empty($nameparts['lname']))
$this->LastName = $nameparts['lname'];
else
$this->LastName = "";
$this->Address1 = $this->billing->street;
//get email from user_id
$this->Email = $wpdb->get_var("SELECT user_email FROM $wpdb->users WHERE ID = '" . $this->user_id . "' LIMIT 1");
$this->subtotal = $dbobj->subtotal;
$this->tax = $dbobj->tax;
$this->couponamount = $dbobj->couponamount;
$this->certificate_id = $dbobj->certificate_id;
$this->certificateamount = $dbobj->certificateamount;
$this->total = $dbobj->total;
$this->payment_type = $dbobj->payment_type;
$this->cardtype = $dbobj->cardtype;
$this->accountnumber = trim($dbobj->accountnumber);
$this->expirationmonth = $dbobj->expirationmonth;
$this->expirationyear = $dbobj->expirationyear;
//date formats sometimes useful
$this->ExpirationDate = $this->expirationmonth . $this->expirationyear;
$this->ExpirationDate_YdashM = $this->expirationyear . "-" . $this->expirationmonth;
$this->status = $dbobj->status;
$this->gateway = $dbobj->gateway;
$this->gateway_environment = $dbobj->gateway_environment;
$this->payment_transaction_id = $dbobj->payment_transaction_id;
$this->subscription_transaction_id = $dbobj->subscription_transaction_id;
$this->timestamp = $dbobj->timestamp;
$this->affiliate_id = $dbobj->affiliate_id;
$this->affiliate_subid = $dbobj->affiliate_subid;
$this->notes = $dbobj->notes;
$this->checkout_id = $dbobj->checkout_id;
//reset the gateway
if(empty($this->nogateway))
$this->setGateway();
return $this->id;
}
else
return false; //didn't find it in the DB
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getOrderById($id){\n $this->db->query(\"SELECT * FROM orders WHERE id = :id\");\n\n $this->db->bind(':id', $id);\n \n $row = $this->db->single();\n\n return $row;\n }",
"public function getOrder($id) {\n return Order::fetch($id);\n }",
"public function getTheMemberThatMadeThisOrder($order_id){\n \n $criteria = new CDbCriteria();\n $criteria->select = '*';\n $criteria->condition='id=:id';\n $criteria->params = array(':id'=>$order_id);\n $member= Order::model()->find($criteria);\n \n return $member['order_initiated_by'];\n }",
"function getOrderDetails($id)\n {\n }",
"public function getOrder(string $order_id): \\GDAX\\Types\\Response\\Authenticated\\Order;",
"static public function getOrderById($id) {\n $rq = \"SELECT * FROM \" . PREFIX . \"sales.`order` \n WHERE `id` =\" . $id . \" LIMIT 1;\";\n\n $aItem = Sql::Get($rq, 1);\n \n return $aItem[0];\n }",
"public function getOrderByID($order_id)\n {\n $order = $this->db->prepare(<<<SQL\nSELECT orders.order_id, orders.order_date, orders.arrival_date, orders.student_number\nFROM orders\nWHERE orders.order_id = :order_id\nORDER BY orders.order_date;\nSQL\n );\n $order->execute(array(':order_id' => $order_id));\n return $order->fetch(\\PDO::FETCH_OBJ);\n }",
"function get ($id) {\n // PARAM $id : order ID\n\n $order = $this->fetch(\n \"SELECT * FROM `orders` WHERE `order_id`=?\", [$id]\n );\n $order['items'] = $this->fetch(\n \"SELECT * FROM `orders_items` LEFT JOIN `products` USING (`product_id`) WHERE `orders_items`.order_id=?\", \n [$id], \"product_id\"\n );\n return $order;\n }",
"public function get($id)\n {\n header('Access-Control-Allow-Origin: *'); \n $order = Order::find($id);\n \n return $order;\n }",
"function getOrderbyId($order_id){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn \t-> prepare('SELECT *\n\t\t\t\t\t\t\t\t\t\tFROM `order`\n\t\t\t\t\t\t\t\t\t\tWHERE `id` = ? ');\n\t\t$sth \t-> execute(array($order_id));\n\t\treturn \t$sth;\n\t}",
"public function getOrder($id)\n {\n $db = new Mysqli();\n $db->connect('localhost', 'root', 111111, 'nn_pay');\n $data = $db->query(\"select * from nns_pay_order where nns_id = '{$id}' limit 1\");\n Register::set('nn_pay_db', $db);\n\n return $data[0];\n }",
"public function get_order_by_id($id) {\n if(!$id) {\n throw new Exception('id should not be empty');\n }\n return $this->linkemperor_exec(null, null,\"/api/v2/customers/orders/$id.json\");\n }",
"public function getOrder();",
"public function getOrder();",
"public function getOrder();",
"public function getOrder();",
"public function getOrder();",
"public function getOrder();",
"static function getOrder(int $OrderID) {\r\n $sqlSelect = \"SELECT * FROM Orders WHERE OrderID = :OrderID\";\r\n //Query\r\n self::$db->query($sqlSelect);\r\n //Bind\r\n self::$db->bind(':OrderID', $OrderID);\r\n //Execute\r\n self::$db->execute();\r\n //Return\r\n return self::$db->singleResult();\r\n }",
"public function getTheOpenOrderInitiatedByMember($member_id){\n $model = new Order;\n return $model->getTheOpenOrderInitiatedByMember($member_id);\n }",
"public function show($id)\n {\n return Order::find($id);\n }",
"public function show($id)\n {\n return Order::find($id);\n }",
"public function getOrderById($orderId)\n {\n }",
"function getOrder();",
"public function getOrderById($id_order)\n {\n return $this->orderRepository->getOrderById($id_order);\n }",
"public function find(int $id): Order\n {\n return Order::find($id);\n }",
"function getOrderDetails($id)\n {\n $dataService = new OrderDataService();\n\n return $dataService->getOrderDetails($id);\n }",
"function findById($orderId);",
"public function show($id)\n {\n return OrderService::getOrderById($id);\n }",
"function getUser_Privilage_By_Id_Status_ORDER_BY_Order_no() {\n\t\t$SQL=\"SELECT * FROM user_privilage_tab WHERE id = '$id' AND status = 'Yes' ORDER BY CAST(order_no AS DECIMAL)\";\n\t\t$this->db->executeQuery($SQL);\n\n\t\t$result = array();\n\t\t$count = 0;\n\n\t\twhile($rs = $this->db->nextRecord())\n\t\t{\n\t\t\t$user_privilage = new User_Privilage();\n\t\t\t$user_privilage->setId($rs['id']);\n\t\t\t$user_privilage->setOrder_no($rs['order_no']);\n\t\t\t$user_privilage->setCode($rs['code']);\n\t\t\t$user_privilage->setUser_id($rs['user_id']);\n\t\t\t$user_privilage->setPrivilage_id($rs['privilage_id']);\n\t\t\t$user_privilage->setIs_view($rs['is_view']);\n\t\t\t$user_privilage->setIs_save($rs['is_save']);\n\t\t\t$user_privilage->setIs_edit($rs['is_edit']);\n\t\t\t$user_privilage->setIs_delete($rs['is_delete']);\n\t\t\t$user_privilage->setData_date($rs['data_date']);\n\t\t\t$user_privilage->setStatus($rs['status']);\n\t\t\t$user_privilage->setDate_($rs['date_']);\n\t\t\t$result[$count++] = $user_privilage;\n\t\t}\n\n\t\t$this->db->closeRs();\n\t\tif(count($result) > 0 ){\n\t\t\treturn $result[0];\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t}"
]
| [
"0.71174353",
"0.7064726",
"0.68267345",
"0.6799271",
"0.6780015",
"0.67522067",
"0.6743223",
"0.6739276",
"0.67253935",
"0.6685644",
"0.6683225",
"0.66560113",
"0.662743",
"0.662743",
"0.662743",
"0.662743",
"0.662743",
"0.662743",
"0.66244215",
"0.65926176",
"0.653124",
"0.653124",
"0.64896107",
"0.6477906",
"0.6435837",
"0.6384434",
"0.6375235",
"0.6360256",
"0.6356285",
"0.6352746"
]
| 0.7147652 | 0 |
/ Returns the order using the given order code. | function getMemberOrderByCode($code)
{
global $wpdb;
$id = $wpdb->get_var("SELECT id FROM $wpdb->pmpro_membership_orders WHERE code = '" . $code . "' LIMIT 1");
if($id)
return $this->getMemberOrderByID($id);
else
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getOrderCode(){\n\t\tif($this->mOrderCode){\n\t\t\treturn $this->mOrderCode;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function orderCode($orderCode)\n {\n $this->abonement->setOrderCode($orderCode);\n return $this;\n }",
"function _geneshop_get_my_order($node) {\n $code = isset($_GET['c']) && !empty($_GET['c']) ? check_plain($_GET['c']) : FALSE;\n $node_code = isset($node->order_code) ? $node->order_code : FALSE;\n if ($code && $node_code && ($code === $node_code)) {\n $_SESSION['order_codes'][] = $code;\n drupal_goto('node/' . $node->nid);\n }\n drupal_not_found();\n}",
"function get_order()\n{\n\n}",
"function applyPromoCode($code)\n {\n $dataService = new OrderDataService();\n\n return $dataService->applyPromoCode($code);\n }",
"public function show($orderCode)\n {\n return $this->orderInterface->show($orderCode);\n }",
"function getOrder();",
"function getOrder()\n{\n\n}",
"private function getOrder($order_id){\r\n\r\n if($this->flow_woocommerce_version_check()){\r\n return new WC_Order($order_id);\r\n }\r\n else{\r\n return wc_get_order($order_id);\r\n }\r\n }",
"public function getOrder(string $order_id): \\GDAX\\Types\\Response\\Authenticated\\Order;",
"static public function getOrderById($order_id) {\n $order = DB::table('orders')->where('id', $order_id)->get();\n return $order;\n }",
"public static function order($orderId) {\n //Return an object with the information about $orderId\n\t\t\treturn self::get(self::order_index() . '/' . $orderId);\n\t\t}",
"private function getOrder($orderoid){\n $rs = selectQuery('select * from WTSORDER where KOID=\"'.$orderoid.'\"');\n if ($rs->rowcount() == 1){\n $ors = $rs->fetch();\n foreach($ors as $k=>$v){\n\t$order->{$k} = $v;\n }\n } else {\n $order = null;\n XLogs::critical(get_class($this), 'Impossible de trouver la commande ayant pour KOID : '.$orderoid);\n }\n return $order;\n }",
"public function getByCode($code);",
"public function setOrderCurrencyCode($code);",
"public static function Order($order){\n\n $chatID = \"-1001270503780\"; //local\n // $chatID = \"-1001347027599\"; //server\n\n $str = ''; \n $i = 1; \n foreach($order->details as $detail){\n$str.= $i.'. '.$detail->menu->name.' x '.$detail->pending_notification_qty.'\n'; \n $i++; \n }\n\n $type = !is_null($order->last_notify_at) ? 'ហៅថែម':'ការកម្មង់ថ្មី'; \n \n $botRes = TelegramBot::sendMessage([\n 'chat_id' => $chatID, \n 'text' => '<b> '.$type.' : វិក័យបត្រលេខ #'.$order->receipt_number. '</b>\n'.$str, \n 'parse_mode' => 'HTML'\n ]);\n\n return $botRes; \n \n }",
"public function getPromocode($order)\n {\n $currentPromocode = $this->getDefaultPromocode();\n\n try {\n $appliedRuleIds = $order->getAppliedRuleIds();\n if (!isset($appliedRuleIds) || empty($appliedRuleIds)) {\n return $currentPromocode;\n }\n\n $ruleIds = explode(',', $appliedRuleIds);\n $ruleIds = array_unique($ruleIds);\n\n foreach ($ruleIds as $ruleId) {\n $rule = Mage::getModel('salesrule/rule');\n $rule->load($ruleId);\n $ruleId = $rule->getId();\n $ruleCouponCode = $rule->getData('coupon_code');\n if (!empty($ruleId) && !empty($ruleCouponCode)) {\n $type = $rule->getData('simple_action');\n $promoCodeValue = $rule->getData('discount_amount');\n if (strrpos($type, 'fixed') !== false) {\n $promoCodeValue = $this->coreHelper->currency(abs($promoCodeValue), true, false);\n }\n\n $currentPromocode = array(\n 'code' => $ruleCouponCode,\n 'name' => $rule->getData('name'),\n 'type' => $type,\n 'value' => $promoCodeValue\n );\n\n //return first promocode with a valid coupon code\n return $currentPromocode;\n }\n }\n } catch (Exception $exception) {\n $this->exceptionHandler->logException($exception);\n }\n\n // no promocode with a valid coupon code was found\n return $currentPromocode;\n }",
"public function getOrderNumber();",
"public function getOrderNumber();",
"public function getOrderPaymentCode($order)\r\n {\r\n $payment = $order->getPayment();\r\n $method = $payment->getMethodInstance();\r\n $orderPaymentCode = $method->getCode();\r\n return $orderPaymentCode;\r\n }",
"public function getOrder();",
"public function getOrder();",
"public function getOrder();",
"public function getOrder();",
"public function getOrder();",
"public function getOrder();",
"public function get_order( $order_id ) {\n\n\t\t$order = parent::get_order( $order_id );\n\n\t\t$order->payment->check_type = ( 'corporate' === SV_WC_Helper::get_post( 'wc-' . $this->get_id_dasherized() . '-check-type' ) ) ? 'C' : 'P';\n\n\t\t$order->payment->customer_id_number = SV_WC_Helper::get_post( 'wc-' . $this->get_id_dasherized() . '-customer-id-number' );\n\t\t$order->payment->customer_id_type = (int) SV_WC_Helper::get_post( 'wc-' . $this->get_id_dasherized() . '-customer-id-type' );\n\n\t\treturn $order;\n\t}",
"public function getOneOrder($orderId) {\n\n $this->load->model('account/order');\n return $this->model_account_order->getOrder($orderId);\n }",
"public function getOrderByReference(string $order_reference): OrderInterface;",
"public function getOrder()\n {\n return $this->orderFactory->create()->load($this->getReservedOrderId(), 'increment_id');\n }"
]
| [
"0.6549262",
"0.6486297",
"0.64190876",
"0.637986",
"0.6360937",
"0.6354531",
"0.63037956",
"0.6234495",
"0.62171304",
"0.6168292",
"0.6159839",
"0.60918254",
"0.6045218",
"0.6016145",
"0.5999935",
"0.59860355",
"0.597548",
"0.5968962",
"0.5968962",
"0.5963872",
"0.5931997",
"0.5931997",
"0.5931997",
"0.5931997",
"0.5931997",
"0.5931997",
"0.59307563",
"0.5929614",
"0.5919847",
"0.5894919"
]
| 0.6690963 | 0 |
Returns the last order using the given subscription_transaction_id. | function getLastMemberOrderBySubscriptionTransactionID($subscription_transaction_id)
{
//did they pass a sub id?
if(empty($subscription_transaction_id))
return false;
global $wpdb;
$id = $wpdb->get_var("SELECT id FROM $wpdb->pmpro_membership_orders WHERE subscription_transaction_id = '" . esc_sql($subscription_transaction_id) . "' ORDER BY id DESC LIMIT 1");
if($id)
return $this->getMemberOrderByID($id);
else
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_order_from_recurly_subscription( $subscription ){\n\n\t\tglobal $wpdb;\n\n\t\t$sql = $wpdb->prepare( \"select * from wp_mequoda_orders where recurly_uuid = %s ORDER BY order_time\", $subscription );\n\n\t\t$orders = $wpdb->get_results( $sql );\n\n\t\treturn $orders;\n\n\t}",
"protected function getLastOrder(){\n return $this->_orderFactory->create('Magento\\Sales\\Model\\Order')->loadByIncrementId($this->onepage->getLastOrderId());\n }",
"public function getLastOrder();",
"public function getLastSubscription($id_person) {\n $this->db->select_max('ID_SUBSCRIPTION');\n $this->db->where('ID_PERSON', $id_person);\n $query = $this->db->get($this->table);\n return $query->row();\n }",
"public function LastOrder($includeUnsubmittedOrders = false)\n {\n //limit to 10\n if ($includeUnsubmittedOrders) {\n $orders = Order::get_datalist_of_orders_with_submit_record(false);\n } else {\n $orders = Order::get_datalist_of_orders_with_submit_record(true);\n }\n\n return $orders\n ->Filter(['MemberID' => $this->owner->ID])\n ->First()\n ;\n }",
"protected function _getLastOrder()\n {\n $lastOrderId = $this->_getLastOrderId();\n /** @var Mage_Sales_Model_Order $order */\n $order = Mage::getModel('sales/order');\n $order->load($lastOrderId);\n return $order;\n }",
"public function getLastSubscriptionByIdPerson($id_person) {\n $this->db->select_max('ID_SUBSCRIPTION');\n $this->db->where('ID_PERSON', $id_person);\n $result = $this->db->get($this->table);\n $result = $result->row();\n $this->db->where('ID_SUBSCRIPTION', $result->ID_SUBSCRIPTION);\n $query = $this->db->get($this->table);\n return $query->row();\n}",
"public function getLastTxn()\n {\n if (isset($this->resultArrayTransaction) === \\FALSE)\n {\n return NULL;\n }\n $cnt = count($this->resultArrayTransaction);\n if ($cnt == 0)\n {\n return NULL;\n }\n return $this->resultArrayTransaction[$cnt-1]->getResult();\n }",
"#[Groups(['users_customers_subresource'])]\n public function getLastInvoice()\n {\n if (!$this->invoices->isEmpty()) {\n return $this->invoices->last();\n }\n\n return null;\n }",
"function wcs_get_subscription( $the_subscription ) {\n\n\tif ( is_object( $the_subscription ) && wcs_is_subscription( $the_subscription ) ) {\n\t\t$the_subscription = $the_subscription->get_id();\n\t}\n\n\t$subscription = WC()->order_factory->get_order( $the_subscription );\n\n\tif ( ! wcs_is_subscription( $subscription ) ) {\n\t\t$subscription = false;\n\t}\n\n\treturn apply_filters( 'wcs_get_subscription', $subscription );\n}",
"public function subscription($subscription = 'default')\n {\n return $this->subscriptions->sortByDesc(function ($value) {\n return $value->created_at->getTimestamp();\n })->first(function ($value) use ($subscription) {\n return $value->name === $subscription;\n });\n }",
"function it_exchange_paypal_pro_addon_get_transaction_id_by_subscriber_id( $subscriber_id ) {\n\t$args = array(\n\t\t'meta_key' => '_it_exchange_transaction_subscriber_id',\n\t\t'meta_value' => $subscriber_id,\n\t\t'numberposts' => 1, //we should only have one, so limit to 1\n\t);\n\treturn it_exchange_get_transactions( $args );\n}",
"function last_transaction($blog_id) {\r\n\t $trans_meta = get_blog_option($blog_id, 'psts_payments_log');\r\n\r\n\t if ( is_array( $trans_meta ) ) {\r\n\t return array_pop( $trans_meta );\r\n\t } else {\r\n\t return false;\r\n\t }\r\n\t}",
"public function _getCurrentHighestOrder($newsletterId)\n\t{\n\t\t$last = self::all()\n\t\t\t->whereEquals('nid', $newsletterId)\n\t\t\t->whereEquals('deleted', 0)\n\t\t\t->order('order', 'desc')\n\t\t\t->row();\n\n\t\treturn $last->get('order', 0);\n\t}",
"public function get_order_id_from_transaction_id ($transaction_id)\n\t{\n\t\t$query = tep_db_query(\"SELECT osc_order_id FROM \" . self::DB_PAYMENTS_TABLE . \" WHERE payment_id = '\".tep_db_input($transaction_id).\"'\");\n\t\t$row = tep_db_fetch_array($query);\n\n\t\treturn $row ? $row['osc_order_id'] : 0;\n\t}",
"public static function getOrderByTransaction($unique_id)\n {\n global $db;\n\n $query = $db->Execute('select `order_id` from `' . static::$table_name . '`\n where `unique_id` = \"' . $unique_id . '\"');\n\n if ($query->RecordCount() == 1) {\n return $query->fields['order_id'];\n } else {\n return null;\n }\n }",
"public function subscription($customer_id)\n {\n $customer = \\Stripe\\Customer::retrieve([\n 'id' => $customer_id,\n ]);\n $collection = new Collection($customer->subscriptions->data);\n return $collection->sortByDesc(function ($value) {\n return $value->created;\n })->first();\n }",
"public function last() {\n $this->_active_query->order(['DESC' => 'id']);\n return $this->first();\n }",
"public function pickOrderLastSerial(string $order, object $source = null): object\n {\n if ($parseOrder = $this->model->parseSerial($order)) {\n $months = SystemParameter::getValue('receipt_query_limit_months');\n /* Check dete start limit */\n if ($parseOrder['date'] >= Carbon::parse(Carbon::now()->subMonth($months)->format('Y-m-01 00:00:00'))->subDay()->format('Ymd')) {\n $main = $this->model->where('month', $parseOrder['month'])->where('id', $parseOrder['id'])->first();\n /* Check order */\n if (isset($main) && $main->code === $parseOrder['code'] && $main->order === $order) {\n /* Check form */\n if ($this->model->isReceiptFormdefineAllowed($main->formdefine_type)) {\n /* Check whether the source holds the main order */\n $inOrder = (isset($source) && get_class($source) === $main->sourceable_type && $source->id === $main->sourceable_id ? true : false);\n $last = (! isset($source) || (isset($source) && $inOrder) ? $main : null);\n /* Sublist */\n $data = $this->model->where('month', $parseOrder['month'])->where('parent', $order)->get();\n /* Check last */\n collect($data)->map(function ($item) use ($source, $inOrder, &$last) {\n /* Check holder */\n if ($this->model->isReceiptFormdefineAllowed($item->formdefine_type)) {\n /* Check whether the source holds the sublist order */\n $inOrder = (isset($source) && get_class($source) === $item->sourceable_type && $source->id === $item->sourceable_id ? true : $inOrder);\n /* Last order */\n $last = (! isset($source) || (isset($source) && $inOrder) ? $item : $last);\n }\n });\n }\n /* Last data */\n if (isset($last)) {\n return $last;\n }\n }\n }\n }\n throw new ModelNotFoundException('No query results for model [' . Operate::class . '] ' . $order);\n }",
"public function getLastResponse()\n {\n $last = end($this->transactions);\n\n return isset($last['response']) ? $last['response'] : null;\n }",
"function getLastPayment($vaid)\n\t{\n\t\t//$last_payment = null; // initialze to null\n\n\t\t$payments_collection = $this->getPayments($vaid); // get all payments as collection for this VAid\n\n\t\tif ($payments_collection->count)\n\t\t{\n\t\t\t$last_payment = $payments_collection->items[0]; // assumes latest payment is 1st item in payment collection\n\t\t}\n\t\treturn $last_payment;\n\t}",
"public function get_last_payment_order_id( $context = 'view' ) {\n\t\treturn $this->get_prop( 'last_payment_order_id', $context ) ;\n\t}",
"public function getSubscriptionById($id_subscription) {\n $this->db->where('ID_SUBSCRIPTION', $id_subscription);\n $query = $this->db->get($this->table);\n return $query->row();\n}",
"function get_end_of_trade_period($acc_number)\n\t{\n\t return $this->db->select('last_order_number')\n\t\t ->from('pamm_tp') \n\t\t ->where(\"number\",$acc_number)\n\t ->order_by('first_order_number', 'DESC')\n\t\t ->get()->result();\n\t}",
"function getRecentPurchaseId(){\n global $db;\n \n $stmt=$db->prepare(\"SELECT MAX(idPurchase)AS idPurchase from purchases\");\n \n $results=[];\n if($stmt->execute() && $stmt->rowCount()>0){\n $results = $stmt->fetch(PDO::FETCH_ASSOC);\n }\n else{\n $results = false;\n }\n return $results;\n }",
"function getMemberOrderByPaymentTransactionID($payment_transaction_id)\n\t\t{\n\t\t\t//did they pass a trans id?\n\t\t\tif(empty($payment_transaction_id))\n\t\t\t\treturn false;\n\n\t\t\tglobal $wpdb;\n\t\t\t$id = $wpdb->get_var(\"SELECT id FROM $wpdb->pmpro_membership_orders WHERE payment_transaction_id = '\" . esc_sql($payment_transaction_id) . \"' LIMIT 1\");\n\t\t\tif($id)\n\t\t\t\treturn $this->getMemberOrderByID($id);\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}",
"public function getLocationStockTransactionLatest($location_id, $variation_id) {\n $db = \\Drupal::database();\n $query = $db->select('commerce_stock_transaction')\n ->condition('location_id', $location_id)\n ->condition('variation_id', $variation_id);\n $query->addExpression('MAX(id)', 'max_id');\n $query->groupBy('location_id');\n $result = $query\n ->execute()\n ->fetch();\n\n return $result ? $result->max_id : 0;\n }",
"public function findLastByOrder(Order $order): ?Bill\n {\n try {\n return $this->createQueryBuilder('b')\n ->where('b.order = :order')\n ->setParameter('order', $order)\n ->orderBy('b.createdAt', 'desc')\n ->getQuery()\n ->setMaxResults(1)\n ->getSingleScalarResult()\n ;\n } catch (NoResultException $e) {\n return null;\n } catch (NonUniqueResultException $e) {\n //deadcode\n //this should not happen because of setMaxResults\n return null;\n }\n }",
"public function getLastTransactionID()\n {\n }",
"public function getDashBoard1LastOrderById($bid)\r\n {\r\n $currentOrder = 0;\r\n $totalOrder = (int) $_SESSION[\"total_order\"];\r\n\r\n if ($totalOrder == CommonDefinition::NO_RESULT) {\r\n // No order existed, return with no change\r\n $result[\"status\"] = CommonDefinition::SUCCESS_NO_RESULT;\r\n return $result;\r\n }\r\n\r\n // Get the previous order\r\n $currentOrder = $totalOrder;\r\n\r\n // echo (\"Current Order = \" . $currentOrder);\r\n // echo (\"Total Order = \" . $totalOrder);\r\n\r\n $result = $this->getDashBoard1OrderById($bid, $currentOrder);\r\n\r\n if (is_bool($result)) {\r\n $result[\"status\"] = CommonDefinition::SUCCESS_NO_RESULT;\r\n return $result;\r\n } else {\r\n $result[\"status\"] = CommonDefinition::SUCCESS;\r\n // Save the current order index to session\r\n session_start();\r\n $_SESSION[\"current_order\"] = $currentOrder;\r\n\r\n return $result;\r\n }\r\n }"
]
| [
"0.63290966",
"0.6138082",
"0.6046962",
"0.60058236",
"0.5937532",
"0.58641595",
"0.5832227",
"0.5594153",
"0.55069643",
"0.5489268",
"0.54842126",
"0.5466687",
"0.5385636",
"0.5350161",
"0.5321745",
"0.5299046",
"0.5243624",
"0.5201191",
"0.51525253",
"0.5132367",
"0.51262414",
"0.511787",
"0.5117476",
"0.511094",
"0.5076701",
"0.5056414",
"0.5037964",
"0.50294614",
"0.50290364",
"0.5003001"
]
| 0.73182935 | 0 |
Returns the last order using the given paypal token. | function getMemberOrderByPayPalToken($token)
{
global $wpdb;
$id = $wpdb->get_var("SELECT id FROM $wpdb->pmpro_membership_orders WHERE paypal_token = '" . $token . "' LIMIT 1");
if($id)
return $this->getMemberOrderByID($id);
else
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getLastOrder(){\n return $this->_orderFactory->create('Magento\\Sales\\Model\\Order')->loadByIncrementId($this->onepage->getLastOrderId());\n }",
"protected function _getLastOrder()\n {\n $lastOrderId = $this->_getLastOrderId();\n /** @var Mage_Sales_Model_Order $order */\n $order = Mage::getModel('sales/order');\n $order->load($lastOrderId);\n return $order;\n }",
"public function getLastOrder();",
"public function LastOrder($includeUnsubmittedOrders = false)\n {\n //limit to 10\n if ($includeUnsubmittedOrders) {\n $orders = Order::get_datalist_of_orders_with_submit_record(false);\n } else {\n $orders = Order::get_datalist_of_orders_with_submit_record(true);\n }\n\n return $orders\n ->Filter(['MemberID' => $this->owner->ID])\n ->First()\n ;\n }",
"public function get_last_payment_order_id( $context = 'view' ) {\n\t\treturn $this->get_prop( 'last_payment_order_id', $context ) ;\n\t}",
"public function findLastByOrder(Order $order): ?Bill\n {\n try {\n return $this->createQueryBuilder('b')\n ->where('b.order = :order')\n ->setParameter('order', $order)\n ->orderBy('b.createdAt', 'desc')\n ->getQuery()\n ->setMaxResults(1)\n ->getSingleScalarResult()\n ;\n } catch (NoResultException $e) {\n return null;\n } catch (NonUniqueResultException $e) {\n //deadcode\n //this should not happen because of setMaxResults\n return null;\n }\n }",
"public function returnFromPaypal($token)\n {\n $quote = $this->_quote;\n $payment = $quote->getPayment();\n\n $setServiceResponse = $this->_checkoutSession->getSetServiceResponse();\n $request = $this->dataBuilder->buildCheckStatusService($setServiceResponse, $quote);\n $getDetailsResponse = $this->_api->checkStatusService($request);\n $this->_checkoutSession->setGetDetailsResponse($getDetailsResponse);\n\n $isBillingAgreement = $payment->getAdditionalInformation(VaultConfigProvider::IS_ACTIVE_CODE);\n\n // signing up for billing agreement\n if ($isBillingAgreement) {\n $baRequest = $this->dataBuilder->buildBillingAgreementService(\n $setServiceResponse['requestID'],\n $quote\n );\n\n $baResponse = $this->_api->billingAgreementService($baRequest);\n\n // saving BA info to payment\n $payment->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_BA_REQUEST_ID, $baResponse->requestID);\n $payment->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_BA_EMAIL, $baResponse->billTo->email);\n $payment->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_BA_PAYER_ID, $baResponse->apReply->payerID);\n $payment->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_BA_ID, $baResponse->apReply->billingAgreementID);\n $payment->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_BA_DATE, $baResponse->apBillingAgreementReply->dateTime);\n }\n\n $this->ignoreAddressValidation();\n\n // import shipping address\n $exportedShippingAddress = $getDetailsResponse['shippingAddress'];\n if (!$quote->getIsVirtual()) {\n $shippingAddress = $quote->getShippingAddress();\n if ($shippingAddress) {\n if ($exportedShippingAddress\n && $quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_BUTTON) == 1\n ) {\n $shippingAddress = $this->_setExportedAddressData($shippingAddress, $exportedShippingAddress);\n $shippingAddress->setPrefix(null);\n $shippingAddress->setCollectShippingRates(true);\n $shippingAddress->setSameAsBilling(0);\n }\n\n // import shipping method\n $code = '';\n $quote->getPayment()->setAdditionalInformation(\n self::PAYMENT_INFO_TRANSPORT_SHIPPING_METHOD,\n $code\n );\n }\n }\n\n // import billing address\n $portBillingFromShipping = $quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_BUTTON) && !$quote->isVirtual();\n if ($portBillingFromShipping) {\n $billingAddress = clone $shippingAddress;\n $billingAddress->unsAddressId()->unsAddressType()->setCustomerAddressId(null);\n $data = $billingAddress->getData();\n $data['save_in_address_book'] = 0;\n $quote->getBillingAddress()->addData($data);\n $quote->getShippingAddress()->setSameAsBilling(1);\n } else {\n $billingAddress = $quote->getBillingAddress();\n }\n $exportedBillingAddress = $getDetailsResponse['billingAddress'];\n\n $billingAddress = $this->_setExportedAddressData($billingAddress, $exportedBillingAddress, true);\n $billingAddress->setCustomerNote($exportedBillingAddress->getData('note'));\n $billingAddress->setCustomerAddressId(null); // force new address creation for the order instead of updating address book entity\n $quote->setBillingAddress($billingAddress);\n $quote->setCheckoutMethod($this->getCheckoutMethod());\n\n // import payment info\n $payment->setMethod($this->_methodType);\n $payment\n ->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_PAYER_ID, $getDetailsResponse['paypalPayerId'])\n ->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_PAYER_EMAIL, $getDetailsResponse['paypalCustomerEmail'])\n ->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_TOKEN, $token)\n ;\n $quote->collectTotals();\n $this->quoteRepository->save($quote);\n }",
"public function getLastpaymentamount()\n {\n return $this->lastpaymentamount;\n }",
"function get_end_of_trade_period($acc_number)\n\t{\n\t return $this->db->select('last_order_number')\n\t\t ->from('pamm_tp') \n\t\t ->where(\"number\",$acc_number)\n\t ->order_by('first_order_number', 'DESC')\n\t\t ->get()->result();\n\t}",
"function getLastPayment($vaid)\n\t{\n\t\t//$last_payment = null; // initialze to null\n\n\t\t$payments_collection = $this->getPayments($vaid); // get all payments as collection for this VAid\n\n\t\tif ($payments_collection->count)\n\t\t{\n\t\t\t$last_payment = $payments_collection->items[0]; // assumes latest payment is 1st item in payment collection\n\t\t}\n\t\treturn $last_payment;\n\t}",
"public function get_last_msg($token) {\n $val = $this->db->select('message,created_at')->\n from('chat_table')->\n where('sender_token', $token)->\n or_where('receiver_token', $token)->\n order_by('chat_id', 'DESC')->\n limit(1)->get()->row_array();\n return $val;\n }",
"protected function _getPaypalCheckout()\n {\n if ($paypal = Mage::getSingleton('core/session')->getData('sharedpagePaypal')) {\n Mage::getModel('core/session')->unsetData('sharedpagePaypal');\n return $paypal;\n }\n return null;\n }",
"public function make_payment($token) {\n\t // Getting settings.\n\t $settings = $this->pex_settings;\n\t\t $nvpstr=\"&TOKEN=\".$token;\n\t\t // call api with token and getting result.\n\t\t $resarray = $this->hash_call(\"GetExpressCheckoutDetails\",$nvpstr);\n\t\t $ack = strtoupper($resarray[\"ACK\"]);\n\t\t if($ack == 'SUCCESS' || $ack == 'SUCCESSWITHWARNING'){\n\t\t\tini_set('session.bug_compat_42',0);\n\t\t\tini_set('session.bug_compat_warn',0);\n\t\t\t$token = trim($resarray['TOKEN']);\n\t\t\t$payment_amount = trim($resarray['AMT']);\n\t\t\t$payerid = trim($resarray['PAYERID']);\n\t\t\t$server_name = trim($_SERVER['SERVER_NAME']);\n\t\t\t$nvpstr='&TOKEN='.$token.'&PAYERID='.$payerid.'&PAYMENTACTION='.$settings['payment_type'].'&AMT='.$payment_amount.'&CURRENCYCODE='.$settings['currency'].'&IPADDRESS='.$server_name ;\n\t\t\t$resarray = $this->hash_call(\"DoExpressCheckoutPayment\",$nvpstr);\n\t\t\t$ack = strtoupper($resarray[\"ACK\"]);\n\t\t\t// checking response for success.\n\t\t\tif($ack != 'SUCCESS' && $ack != 'SUCCESSWITHWARNING'){\n\t\t\t\treturn $resarray;\n\t\t\t}\n\t\t\telse {\n\t\t\t return $resarray;\n\t\t\t}\n\t\t } \n\t\t else \n\t\t {\n\t\t\treturn $resarray;\n\t\t }\n\t}",
"public function getLastpaymentdate()\n {\n return $this->lastpaymentdate;\n }",
"public function getLastbuy()\n {\n return $this->get(self::_LASTBUY);\n }",
"public function pickOrderLastSerial(string $order, object $source = null): object\n {\n if ($parseOrder = $this->model->parseSerial($order)) {\n $months = SystemParameter::getValue('receipt_query_limit_months');\n /* Check dete start limit */\n if ($parseOrder['date'] >= Carbon::parse(Carbon::now()->subMonth($months)->format('Y-m-01 00:00:00'))->subDay()->format('Ymd')) {\n $main = $this->model->where('month', $parseOrder['month'])->where('id', $parseOrder['id'])->first();\n /* Check order */\n if (isset($main) && $main->code === $parseOrder['code'] && $main->order === $order) {\n /* Check form */\n if ($this->model->isReceiptFormdefineAllowed($main->formdefine_type)) {\n /* Check whether the source holds the main order */\n $inOrder = (isset($source) && get_class($source) === $main->sourceable_type && $source->id === $main->sourceable_id ? true : false);\n $last = (! isset($source) || (isset($source) && $inOrder) ? $main : null);\n /* Sublist */\n $data = $this->model->where('month', $parseOrder['month'])->where('parent', $order)->get();\n /* Check last */\n collect($data)->map(function ($item) use ($source, $inOrder, &$last) {\n /* Check holder */\n if ($this->model->isReceiptFormdefineAllowed($item->formdefine_type)) {\n /* Check whether the source holds the sublist order */\n $inOrder = (isset($source) && get_class($source) === $item->sourceable_type && $source->id === $item->sourceable_id ? true : $inOrder);\n /* Last order */\n $last = (! isset($source) || (isset($source) && $inOrder) ? $item : $last);\n }\n });\n }\n /* Last data */\n if (isset($last)) {\n return $last;\n }\n }\n }\n }\n throw new ModelNotFoundException('No query results for model [' . Operate::class . '] ' . $order);\n }",
"public function find_user_last($token) {\r\n\t\t$search = [];\r\n\t\t$search = $this->detail_scrape();\r\n\t\tksort($search);\r\n\t\tif ($search[0] != null)\r\n\t\t\treturn $search[0];\r\n\t\treturn false;\r\n\t}",
"public function getLastPaymentDate(): \\DateTime\n {\n return $this->lastPaymentDate;\n }",
"public static function find_user_last($token) {\r\n\t\t$search = [];\r\n\t\t$search = parent::detail_scrape();\r\n\t\tksort($search);\r\n\t\tif ($search[0] != null)\r\n\t\t\treturn $search[0];\r\n\t\treturn false;\r\n\t}",
"public function get_last_payment_date( $context = 'view' ) {\n\t\treturn $this->get_prop( 'last_payment_date', $context ) ;\n\t}",
"public function getLastTxn()\n {\n if (isset($this->resultArrayTransaction) === \\FALSE)\n {\n return NULL;\n }\n $cnt = count($this->resultArrayTransaction);\n if ($cnt == 0)\n {\n return NULL;\n }\n return $this->resultArrayTransaction[$cnt-1]->getResult();\n }",
"public function getLastResponse()\n {\n $last = end($this->transactions);\n\n return isset($last['response']) ? $last['response'] : null;\n }",
"public function fetch_single($token){\r\n $sql = \"SELECT `apartment_id` FROM `update_delete_requests` WHERE `token`='$token'\";\r\n $sql_exec = $this->query($sql);\r\n $fetch_id = $this->fetch_assoc($sql_exec);\r\n return ($fetch_id['apartment_id']);\r\n }",
"public function cancel(Token $token): Payment;",
"public function lastOrder(){\n\n $query = \"SELECT id_ordine FROM \" . $this->table_name . \" ORDER BY id_ordine DESC LIMIT 1\";\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n while($row = $stmt->fetch(PDO::FETCH_ASSOC)){\n $this->ultimo_ord = $row['id_ordine'];\n }\n return true;\n }",
"function fetchLastBetID() {\n $query = \"SELECT BETID FROM \" . $this->table_name_1 . \n \" WHERE BETID = (select MAX(BETID) FROM \" . $this->table_name_1 . \n \" WHERE ACCOUNTID=\" . $this->accountID . \")\";\n\n $stmt = $this->database->executePlainSQL($query);\n return $stmt;\n }",
"public function last(): ?\\SengentoBV\\CdiscountMarketplaceSdk\\Structs\\CdiscountValidateOrderLineResult\n {\n return parent::last();\n }",
"public function get_purchaseorder($ponbr) {\n\t\t\t$url = $this->endpoints['purchase-order'] . \"/$ponbr\";\n\t\t\t$response = $this->curl_get($url);\n\t\t\treturn $response['response'];\n\t\t}",
"public function PaypalGetAndDoExpressCheckout($oPaypal){\n if (!isset($_GET['token'])){\n header('Location:'.'http://localhost/PHPScripts_website/live_demo/buy_ticket.php?c=cancel'); \n }\n\n // *** Checkout process (get and do expresscheckout) \n $totalOrder = number_format($_SESSION['total_order'], 2, '.', '');\n\n // GetExpressCheckoutDetails (get orders, buyer, transaction informations)\n $response = $oPaypal->request('GetExpressCheckoutDetails', array(\n 'TOKEN' => $_GET['token']\n ));\n\n //Store buyer information\n $oPaypal->RecordPaypalPayer($response); \n\n // Store order\n $oOrder = new Order();\n\n //Record order\n $id_cat = 1;\n $sIdOrder = $oOrder->RecordOrder($response, $id_cat);\n\n if($response){\n // if checkout success\n if($response['CHECKOUTSTATUS'] == 'PaymentActionCompleted'){\n die('This payment has already been validated');\n }\n }else{\n $oPaypal->recordErrorOrder($oPaypal->errors, $sIdOrder);\n die();\n }\n\n // DoExpressCheckoutPayment setting\n $params = array(\n 'TOKEN' => $response['TOKEN'],\n 'PAYERID'=> $response['PAYERID'],\n 'PAYMENTREQUEST_0_PAYMENTACTION'=>'Sale',\n 'PAYMENTREQUEST_0_AMT' => $response['AMT'],\n 'PAYMENTREQUEST_0_CURRENCYCODE' => $oPaypal->money_code,\n 'PAYMENTREQUEST_0_ITEMAMT' => $response['ITEMAMT'],\n );\n\n foreach($_SESSION['tickets'] as $k => $ticket){\n // Send again order informations to paypal for the history buyer purchases.\n $params[\"L_PAYMENTREQUEST_0_NAME$k\"] = $ticket['name'];\n $params[\"L_PAYMENTREQUEST_0_DESC$k\"] = '';\n $params[\"L_PAYMENTREQUEST_0_AMT$k\"] = $ticket['price'];\n $params[\"L_PAYMENTREQUEST_0_QTY$k\"] = $ticket['nbseat'];\n }\n\n // DoExpressCheckoutPayment\n $response = $oPaypal->request('DoExpressCheckoutPayment',$params );\n\n if($response){\n // DoExpressCheckoutPayment is success then update order in database ('Transaction ID', 'paymentstatus'...=\n $oOrder->updateOrder($sIdOrder, $response);\n\n if ($response['PAYMENTINFO_0_PAYMENTSTATUS'] == 'Completed'){\n // Send mail confirmation (with order information and ticket pdf link). A FAIRE\n echo \"<br>the transaction n°{$response['PAYMENTINFO_0_TRANSACTIONID']} was successful\";\n } \n }else{\n $oPaypal->recordErrorOrder($oPaypal->errors, $sIdOrder);\n }\n\n if (isset($_SESSION['tickets'])) unset($_SESSION['tickets']);\n\n}",
"protected function getPayment()\n {\n return $this->getOrder()->getPayment();\n }"
]
| [
"0.63114685",
"0.6091238",
"0.60588217",
"0.6028642",
"0.5944881",
"0.58523196",
"0.5755481",
"0.56644803",
"0.5658972",
"0.55985075",
"0.55073726",
"0.5470093",
"0.54434043",
"0.5342385",
"0.5247814",
"0.52374524",
"0.52048814",
"0.5189796",
"0.5155106",
"0.514972",
"0.5143046",
"0.51259744",
"0.51191986",
"0.5116224",
"0.51103926",
"0.5107859",
"0.50939643",
"0.5051423",
"0.50397015",
"0.5033668"
]
| 0.6341609 | 0 |
Update the discount code used in this order. | function updateDiscountCode( $discount_code_id ) {
global $wpdb;
// Assumes one discount code per order
$sqlQuery = $wpdb->prepare("
SELECT id FROM $wpdb->pmpro_discount_codes_uses
WHERE order_id = %d
LIMIT 1",
$this->id
);
$discount_codes_uses_id = $wpdb->get_var( $sqlQuery );
// INSTEAD: Delete the code use if found
if ( empty( $discount_code_id ) ) {
if ( ! empty( $discount_codes_uses_id ) ) {
$wpdb->delete(
$wpdb->pmpro_discount_codes_uses,
array( 'id' => $discount_codes_uses_id ),
array( '%d' )
);
}
} else {
if ( ! empty( $discount_codes_uses_id ) ) {
// Update existing row
$wpdb->update(
$wpdb->pmpro_discount_codes_uses,
array( 'code_id' => $discount_code_id, 'user_id' => $this->user_id, 'order_id' => $this->id ),
array( 'id' => $discount_codes_uses_id ),
array( '%d', '%d', '%d' ),
array( '%d' )
);
} else {
// Insert a new row
$wpdb->insert(
$wpdb->pmpro_discount_codes_uses,
array( 'code_id' => $discount_code_id, 'user_id' => $this->user_id, 'order_id' => $this->id ),
array( '%d', '%d', '%d' )
);
}
}
// Make sure to reset properties on this object
return $this->getDiscountCode( true );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function update_discount_codes()\n\t\t{\n\t\t\t// Get the discount codes from the submitted POST data.\n\t\t\t$discount_data = $this->input->post('discount');\n\t\t\t\n\t\t\t// The 'update_discount_codes()' function will validate each submitted code and apply the discounts that have activated their quantity and value requirements.\n\t\t\t// Any previously set codes that have now been set as blank (i.e. no longer present) will be removed.\n\t\t\t// Note: Only 1 discount can be applied per item and per summary column. \n\t\t\t// For example, 2 discounts cannot be applied to the summary total, but 1 discount could be applied to the shipping total, and another to the summary total.\n\t\t\t$this->flexi_cart->update_discount_codes($discount_data);\n\t\t\t\n\t\t\t// Set a message to the CI flashdata so that it is available after the page redirect.\n\t\t\t$this->session->set_flashdata('message', $this->flexi_cart->get_messages());\n\n\t\t\tredirect('cart');\n\t\t}",
"protected function calculateDiscount() : void{\r\n $percentage = ($this->discounted_value * 100) / $this->order->getTrueTotal();\r\n $new_total = $this->order->getTrueTotal() - $this->discounted_value;\r\n\r\n $this->order_discount_value = $this->discounted_value;\r\n $this->order_discount_percentage = $percentage;\r\n $this->order_discount_reason = \"For every \" . $this->products_nr . \" products from category #\" . $this->category_id . \" you get one free. You got: \";\r\n foreach($this->items_matching as $item){\r\n $this->order_discount_reason .= floor($item[\"qty\"] / $this->products_nr) . \" x '\" . $item[\"description\"] . \"' (€\". $item[\"price\"] .\" each) ; \";\r\n }\r\n $this->order_new_total = $new_total;\r\n }",
"public function getDiscountCode()\n {\n return $this->discountCode;\n }",
"public static function update_item_with_discount($detail_id,$order_promotion,$order_discount_id,$order_discount_amt){\r\tif(is_gt_zero_num($detail_id)){\r\t\t$objtbl_order_details=new tbl_order_details();\r\t\tif($objtbl_order_details->readObject(array(ORD_DTL_ID=>$detail_id))){\r\t\t\t$objtbl_order_details->setordprom_promotion($order_promotion);\r\t\t\t$objtbl_order_details->setordprom_discount_id($order_discount_id);\r\t\t\t$objtbl_order_details->setordprom_discount_amt($order_discount_amt);\r\t\t\t$objtbl_order_details->insert();\r\t\t\treturn 1;\r\t\t}\r\t\tunset($objtbl_order_details);\t\r\t} \r\treturn 0;\t\r }",
"public function getDiscountCode()\n {\n return $this->discountCode;\n }",
"public function getDiscountCode()\n {\n return $this->discountCode;\n }",
"public function updateAffectedPlans(Discount $discount)\n {\n }",
"public function AssignDiscount()\n\t{\t\n\t}",
"public function usediscount()\n {\n $this->extend(\"onBeforeUseDiscount\");\n\n $code_to_search = $this->request->param(\"ID\");\n $code = false;\n\n if (!$code_to_search) {\n return $this->httpError(404, \"Page not found\");\n }\n\n // First check if the discount is already added (so we don't\n // query the DB if we don't have to).\n if (!$this->discount || ($this->discount && $this->discount->Code != $code_to_search)) {\n $codes = Discount::get()\n ->filter(\"Code\", $code_to_search)\n ->exclude(\"Expires:LessThan\", date(\"Y-m-d\"));\n\n if ($codes->exists()) {\n $code = $codes->first();\n $this->discount = $code;\n $this->save();\n }\n } elseif ($this->discount && $this->discount->Code == $code_to_search) {\n $code = $this->discount;\n }\n\n return $this\n ->customise(array(\n \"Discount\" => $code\n ))->renderWith(array(\n 'ShoppingCart_discount',\n 'Checkout',\n 'Page'\n ));\n }",
"private function update_total_with_promo_code() {\n\t\tif ($this->does_cart_already_have_promo_code() == true) {\n\t\t\t// Make new old total\n\t\t\t$this->old_total = $this->cart_total;\n\t\t\t$promo_code = $this->promo_code;\n\t\t\tif ($promo_code->code_type == 1) {\n\t\t\t\t$percent_off = $promo_code->percent_off;\n\t\t\t\t$cart_total = $this->cart_total;\n\t\t\t\t$amount_removed = $cart_total * $percent_off;\n\t\t\t\t$new_total = $cart_total - $amount_removed;\n\n\t\t\t\t// Update variables\n\t\t\t\t$this->old_total = $cart_total;\n\t\t\t\t$this->cart_total = $new_total;\n\t\t\t\t$this->promo_code = $promo_code;\n\n\t\t\t\t// Update cart\n\t\t\t\t$this->save();\n\t\t\t} else {\n\t\t\t\t$dollars_off = $promo_code->dollars_off;\n\t\t\t\t$minimum_amount = $promo_code->minimum_amount;\n\t\t\t\t$cart_total = $this->cart_total;\n\t\t\t\tif ($cart_total < $minimum_amount) {\n\t\t\t\t\treturn \"Cart total does not meet minimum requirement of $\" . $minimum_amount . \" for this promo code.\";\n\t\t\t\t} else {\n\t\t\t\t\t// Get new total\n\t\t\t\t\t$new_total = $cart_total - $dollars_off;\n\n\t\t\t\t\t// Update variables\n\t\t\t\t\t$this->old_total = $cart_total;\n\t\t\t\t\t$this->cart_total = $new_total;\n\t\t\t\t\t$this->promo_code = $promo_code;\n\n\t\t\t\t\t// Create addition in stats helper\n\t $site_stats_helper = new SiteStatsHelper();\n\t if (Auth::guest()) {\n\t $site_stats_helper->promo_code_add_guest_addition($promo_code->id);\n\t } else {\n\t \t$site_stats_helper->promo_code_add_member_addition($promo_code->id);\n\t }\n\n\t\t\t\t\t// Update cart\n\t\t\t\t\t$this->save();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function updatePercentage(Discount $discount)\n {\n }",
"public function set_manual_discount($discount_data = FALSE)\r\n\t{\r\n\t\tif (is_array($discount_data) && ! empty($discount_data))\r\n\t\t{\r\n\t\t\t// Check that any submitted 'New value' discounts are only applied to the shipping total. \r\n\t\t\tif (isset($discount_data['column']) && isset($discount_data['calculation']) && ($discount_data['column'] != 'shipping_total') && ($discount_data['calculation'] == 3))\r\n\t\t\t{\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Merge the code and manual discounts together, then loop through data and compile an array of all discount ids currently in use.\r\n\t\t\t$existing_discounts = array_merge($this->flexi->cart_contents['settings']['discounts']['manual'], $this->flexi->cart_contents['settings']['discounts']['codes']);\r\n\t\t\t$existing_ids = array();\r\n\t\t\t\t\r\n\t\t\tforeach($existing_discounts as $existing_discount)\r\n\t\t\t{\r\n\t\t\t\t$existing_ids[] = $existing_discount['id'];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// If an id is not set in the submitted '$discount_data', or if a discount with a matching id already exists, set a new id. \r\n\t\t\tif (! isset($discount_data['id']) || in_array($discount_data['id'], $existing_ids))\r\n\t\t\t{\r\n\t\t\t\t$id = 0;\r\n\t\t\t\twhile (in_array('manual_'.$id, $existing_ids))\r\n\t\t\t\t{\r\n\t\t\t\t\t$id++; \r\n\t\t\t\t}\r\n\t\t\t\t$id = $discount_data['id'] = 'manual_'.$id;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$id = $discount_data['id'];\r\n\t\t\t}\r\n\t\t\r\n\t\t\t// Set default values if not submitted.\r\n\t\t\t$discount_data['description'] = (! isset($discount_data['description'])) ? FALSE : $discount_data['description'];\r\n\t\t\t$discount_data['value'] = (! isset($discount_data['value'])) ? 0 : $discount_data['value'];\r\n\t\t\t$discount_data['column'] = (! isset($discount_data['column'])) ? 'total' : $discount_data['column'];\r\n\t\t\t$discount_data['calculation'] = (! isset($discount_data['calculation'])) ? 1 : $discount_data['calculation'];\r\n\t\t\t$discount_data['tax_method'] = (! isset($discount_data['tax_method'])) ? FALSE : $discount_data['tax_method'];\r\n\t\t\t$discount_data['void_reward_points'] = (! isset($discount_data['void_reward_points'])) ? FALSE : $discount_data['void_reward_points'];\r\n\t\t\t\r\n\t\t\t// Set the cart column the discount is targeting and use the value to act as the discounts array key. \r\n\t\t\t// This prevents multiple discounts being applied to the same cart column.\r\n\t\t\t$target_column = $discount_data['column'];\r\n\t\t\t\r\n\t\t\t// Loop through data and set to cart session summary.\r\n\t\t\tforeach($discount_data as $column => $column_value)\r\n\t\t\t{\r\n\t\t\t\tif ($column == 'value')\r\n\t\t\t\t{\r\n\t\t\t\t\t// If a valid discount value is not set, set the default value as zero. \r\n\t\t\t\t\t$column_value = ($this->non_negative($column_value)) ? $this->format_calculation($column_value, 2, TRUE) : 0;\r\n\t\t\t\t}\r\n\t\t\t\telse if ($column == 'column')\r\n\t\t\t\t{\r\n\t\t\t\t\t// If a valid column is not set, discount the 'total' column by default. \r\n\t\t\t\t\t$column_value = (in_array($column_value, array('item_summary_total', 'shipping_total', 'total'))) ? $column_value : 'total';\r\n\t\t\t\t}\r\n\t\t\t\telse if ($column == 'calculation') \r\n\t\t\t\t{\r\n\t\t\t\t\t// If a valid calculation method is not set, a 'percentage' based calculation is set by default.\r\n\t\t\t\t\t// 1 = Percentage Based, 2 = Flat Fee, 3 = New Value.\r\n\t\t\t\t\t$column_value = (in_array($column_value, array(1,2,3))) ? $column_value : 1;\r\n\t\t\t\t}\r\n\t\t\t\telse if ($column == 'tax_method')\r\n\t\t\t\t{\r\n\t\t\t\t\t// If a valid tax method is not set, the tax method is defined by whether cart prices ex/include taxes by default.\r\n\t\t\t\t\t// 0 = Carts Default Tax Method, 1 = Apply Tax Before Discount, 2 = Apply Discount Before Tax, 3 = Apply Discount Before Tax, Add Original Tax.\r\n\t\t\t\t\t$column_value = (in_array($column_value, array(0, 1,2,3))) ? $column_value : 0;\r\n\t\t\t\t}\r\n\t\t\t\telse if ($column == 'void_reward_points')\r\n\t\t\t\t{\r\n\t\t\t\t\t$column_value = (bool)$column_value;\r\n\t\t\t\t}\r\n\t\t\t\telse if (! in_array($column, array('id', 'description')))\r\n\t\t\t\t{\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->flexi->cart_contents['settings']['discounts']['manual'][$target_column][$column] = $column_value;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t\t\r\n\t\treturn FALSE;\r\n\t}",
"function _apply_discount($coupon)\n\t{\n\t\t$this->database->SaveCheatCode($coupon);\n\t\t$discount_percentage = 0;\n\t\t$coupon_info = $this->database->GetDiscountCoupon($coupon);\n\n\t\t//Run some conditional-check for code\n\t\tif($this->_can_apply_code($coupon_info))\n\t\t{\n\t\t\t$discount_percentage = $this->_getDiscount($coupon);\n\t\t\t$this->cart->apply_discount($coupon, $discount_percentage);\n\t\t}\n\n\t\t$this->_notify_discount_applied($discount_percentage, $coupon_info);\n\n\t}",
"function pp_edd_auto_apply_discount() {\n\n\tif ( function_exists( 'edd_is_checkout' ) && edd_is_checkout() ) {\n\n\t\tif ( ! edd_cart_has_discounts() && edd_is_discount_valid( 'BFCM2016', '', false ) ) {\n\t\t\tedd_set_cart_discount( 'BFCM2016' );\n\t\t}\n\n\t}\n\n}",
"function edd_downloads_ajax_apply_discount(){\n\n\t$existing_discount \t= edd_get_cart_discounts();\n\t$discount_code \t\t= $_POST['code'];\n\tif(!empty($existing_discount) && in_array($discount_code, $existing_discount)){\n\t\t$return['msg'] = __('This code has already been applied','edd_downloads');\n\t\tedd_unset_error( 'edd-discount-error' );\n\t\t\n\t\t// Allow for custom discount code handling\n\t\t$return = apply_filters( 'edd_ajax_discount_response', $return );\n\n\t\techo json_encode($return);\t\t\t\t\t\n\t}else{\n\t\tedd_ajax_apply_discount();\n\t}\n\tedd_die();\t\n}",
"public function addDiscountToOrder($ord_dtl_id,$discount){\r\t\tif(is_gt_zero_num($ord_dtl_id) && is_gt_zero_num($discount)){\r\t\t\tif ($this->readObject(array(ORD_DTL_ID=>$ord_dtl_id))){\r\t\t\t\t//..get the discount value\r\t\t\t\t$discount_val=0;\r\t\t\t\t$discount_detail=tbl_discounts::GetInfo($discount);\r\t\t\t\t\r\t\t\t\tif(is_not_empty($discount_detail)){\r\t\t\t\t\t\tif($discount_detail[DISCOUNT_TYPE]=='PERCENT'){\r\t\t\t\t\t\t\t$discount_val=($this->getord_dtl_price()*($discount_detail[DISCOUNT_PERCENT]/100));\r\t\t\t\t\t\t}else{\r\t\t\t\t\t\t\t$discount_val=($discount_detail[DISCOUNT_PERCENT]);\r\t\t\t\t\t\t}\r\t\t\t\t}\t\t\t\t\r\t\t\t\t\r\t\t\t\t$qry = \"UPDATE \".TBL_ORDER_DETAILS.RET.\"SET\".RET.\"\r\t\t\t\".ORD_DTL_DISCOUNT.\" = \".$discount_val.\" WHERE \".ORD_DTL_ID.\"={$ord_dtl_id}\";\r\t\t\t\t$res = mysql_query($qry);\r\t\t\t\tif($res){\r\t\t\t\t\treturn 1;\r\t\t\t\t}\r\t\t\t}\r\t\t}\r\t\treturn 0;\r\t}",
"public function couponPostAction()\n {\n /** @var Divante_OpenLoyalty_Model_Quote $quote */\n $quote = $this->_getQuote();\n\n $this->resetLoyaltyInUse();\n\n /** @var Mage_Core_Helper_Data $helperCore */\n $helperCore = Mage::helper('core');\n \n /**\n * No reason continue with empty shopping cart\n */\n if (!$quote->getItemsCount()\n || !$this->_validateFormKey()) {\n $this->_goBack();\n\n return;\n }\n\n /** @var string $couponCode */\n $couponCode = (string) $this->getRequest()->getParam('coupon_code');\n \n if ($this->getRequest()->getParam(self::REMOVE_PARAM) == 1) {\n $couponCode = '';\n }\n \n $oldCouponCode = $quote->getCouponCode();\n\n if (!strlen($couponCode) && !strlen($oldCouponCode)) {\n $this->_goBack();\n \n return;\n }\n\n try {\n $quote->getShippingAddress()->setCollectShippingRates(true);\n $quote->setCouponCode(strlen($couponCode) ? $couponCode : '')\n ->unsetLoyaltyDiscount()\n ->collectTotals()\n ->save();\n\n if (strlen($couponCode)) {\n if ($couponCode == $quote->getCouponCode()) {\n $this\n ->_getSession()\n ->addSuccess(\n $this->__(\n 'Coupon code \"%s\" was applied.',\n $helperCore->htmlEscape($couponCode)\n )\n );\n } else {\n $this\n ->_getSession()\n ->addError(\n $this->__(\n 'Coupon code \"%s\" is not valid.',\n $helperCore->htmlEscape($couponCode)\n )\n );\n }\n } else {\n $this\n ->_getSession()\n ->addSuccess($this->__('Coupon code was canceled.'));\n }\n\n } catch (Mage_Core_Exception $e) {\n $this\n ->_getSession()\n ->addError($e->getMessage());\n } catch (Exception $e) {\n $this\n ->_getSession()\n ->addError($this->__('Cannot apply the coupon code.'));\n Mage::logException($e);\n }\n\n $this->_goBack();\n }",
"function pms_move_previous_discount_codes_in_payments_table(){\r\n\r\n $payment_discount_array = get_option( 'pms_payment_id_discount_code', array() );\r\n\r\n if ( !empty($payment_discount_array) ) {\r\n\r\n foreach ($payment_discount_array as $payment_id => $discount_code) {\r\n if (class_exists('PMS_Payment')) {\r\n $payment = new PMS_Payment($payment_id);\r\n $payment->update(array('discount_code' => $discount_code));\r\n }\r\n }\r\n\r\n delete_option('pms_payment_id_discount_code');\r\n }\r\n\r\n }",
"function add_discount( $coupon_code ) {\n\t\t\tglobal $cmdeals;\n\t\t\t\n\t\t\t$the_coupon = new cmdeals_coupon($coupon_code);\n\t\t\t\n\t\t\tif ($the_coupon->id) :\n\t\t\t\t\n\t\t\t\t// Check if applied\n\t\t\t\tif ($cmdeals->cart->has_discount($coupon_code)) :\n\t\t\t\t\t$cmdeals->add_error( __('Discount code already applied!', 'cmdeals') );\n\t\t\t\t\treturn false;\n\t\t\t\tendif;\t\n\t\t\t\t\n\t\t\t\t// Check it can be used with cart\n\t\t\t\tif (!$the_coupon->is_valid()) :\n\t\t\t\t\t$cmdeals->add_error( __('Invalid coupon.', 'cmdeals') );\n\t\t\t\t\treturn false;\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\t// If its individual use then remove other coupons\n\t\t\t\tif ($the_coupon->individual_use=='yes') :\n\t\t\t\t\t$this->applied_coupons = array();\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\tforeach ($this->applied_coupons as $code) :\n\t\t\t\t\t$coupon = new cmdeals_coupon($code);\n\t\t\t\t\tif ($coupon->individual_use=='yes') :\n\t\t\t\t\t\t$this->applied_coupons = array();\n\t\t\t\t\tendif;\n\t\t\t\tendforeach;\n\t\t\t\t\n\t\t\t\t$this->applied_coupons[] = $coupon_code;\n\t\t\t\t$this->set_session();\n\t\t\t\t$cmdeals->add_message( __('Discount code applied successfully.', 'cmdeals') );\n\t\t\t\treturn true;\n\t\t\t\n\t\t\telse :\n\t\t\t\t$cmdeals->add_error( __('Coupon does not exist!', 'cmdeals') );\n\t\t\t\treturn false;\n\t\t\tendif;\n\t\t\treturn false;\n\t\t}",
"function remove_discount_code()\n\t\t{\n\t\t\t// This examples gets the discount code from the array key of the submitted POST data.\n\t\t\t$discount_code = key($this->input->post('remove_discount_code'));\n\n\t\t\t// The 'unset_discount()' function can accept an array of either discount ids or codes to delete more than one discount at a time.\n\t\t\t// Alternatively, if no data is submitted, the function will delete all discounts that are applied to the cart.\n\t\t\t// This example uses the 1 discount code that was supplied via the POST data.\n\t\t\t// $this->flexi_cart->unset_userdata_discount($discount_code); // Can't remeber why this 'stock code' didn't work - said 'undefined method' or something\t\t\n\t\t\t$this->flexi_cart->unset_discount($discount_code);\n\t\t\t\n\t\t\t// Set a message to the CI flashdata so that it is available after the page redirect.\n\t\t\t$this->session->set_flashdata('message', $this->flexi_cart->get_messages());\n\n\t\t\tredirect('cart');\n\t\t}",
"public function coupon()\n\t{\n\t\t$session = JFactory::getSession();\n\t\t$option = JRequest::getVar('option');\n\t\t$post = JRequest::get('post');\n\t\t$Itemid = JRequest::getVar('Itemid');\n\t\t$redhelper = new redhelper;\n\t\t$Itemid = $redhelper->getCartItemid();\n\t\t$model = $this->getModel('cart');\n\n\t\t// Call coupon method of model to apply coupon\n\t\t$valid = $model->coupon();\n\t\t$cart = $session->get('cart');\n\t\t$this->modifyCalculation($cart);\n\t\t$this->_carthelper->cartFinalCalculation(false);\n\n\t\t// Store cart entry in db\n\t\t$this->_carthelper->carttodb();\n\n\t\t// If coupon code is valid than apply to cart else raise error\n\t\tif ($valid)\n\t\t{\n\t\t\t$link = JRoute::_('index.php?option=' . $option . '&view=cart&Itemid=' . $Itemid, false);\n\t\t\t$this->setRedirect($link);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = JText::_('COM_REDSHOP_COUPON_CODE_IS_NOT_VALID');\n\t\t\t$link = JRoute::_('index.php?option=' . $option . '&view=cart&Itemid=' . $Itemid, false);\n\t\t\t$this->setRedirect($link, $msg);\n\t\t}\n\t}",
"public function getDiscountCode()\n {\n if (is_null($this->discountCode)) {\n /** @psalm-var stdClass|array<string, mixed>|null $data */\n $data = $this->raw(self::FIELD_DISCOUNT_CODE);\n if (is_null($data)) {\n return null;\n }\n\n $this->discountCode = DiscountCodeKeyReferenceModel::of($data);\n }\n\n return $this->discountCode;\n }",
"function get_discount($order_code = ''){\n $apply_discount = '';\n if ($order_code){\n $order = $this->Orders->get_order($order_code);\n if ($order && !empty($order['prebooking_discount'])){\n $apply_discount = array(\n 'start_date' => date('Y-m-d'),\n 'description' => 'Ưu đãi khi đặt trước',\n 'en_description' => 'Discount when pre-ordering',\n 'priority' => '10',\n 'table' => array(\n '0' => $order['prebooking_discount']\n ),\n 'is_prebook' => 1\n );\n }\n }\n return $apply_discount;\n }",
"public function updateCart()\n {\n $this->total = CartFcd::subtotal();\n $this->content = CartFcd::content();\n }",
"public function applyGlobalDiscount($discount_rate)\n {\n }",
"public function setDiscountUid(?string $discountUid): void\n {\n $this->discountUid = $discountUid;\n }",
"public function attach_promo_code($promo_code) {\n\t\tif ($this->does_promo_code_exist_in_cart() != true) {\n\t\t\t// Check to see if promo code exists\n\t\t\t$promo_code_helper = new PromoCodeHelper();\n\t\t\tif ($promo_code_helper->does_promo_code_exist(strtoupper($promo_code)) == true) {\n\t\t\t\t// Yes, it exists, get the info and edit cart\n\t\t\t\t$promo_code = $promo_code_helper->get_promo_code(strtoupper($promo_code));\n\t\t\t\t$code_type = $promo_code->code_type;\n\t\t\t\tif ($code_type == 1) {\n\t\t\t\t\t// This means percent off. We need to calculate and update total.\n\t\t\t\t\t$percent_off = $promo_code->percent_off;\n\t\t\t\t\t$cart_total = $this->cart_total;\n\t\t\t\t\t$amount_removed = $cart_total * $percent_off;\n\t\t\t\t\t$new_total = $cart_total - $amount_removed;\n\n\t\t\t\t\t// Update variables\n\t\t\t\t\t$this->old_total = $cart_total;\n\t\t\t\t\t$this->cart_total = $new_total;\n\t\t\t\t\t$this->promo_code = $promo_code;\n\n\t\t\t\t\t// Create addition in stats helper\n\t $site_stats_helper = new SiteStatsHelper();\n\t if (Auth::guest()) {\n\t $site_stats_helper->promo_code_add_guest_addition($promo_code->id);\n\t } else {\n\t \t$site_stats_helper->promo_code_add_member_addition($promo_code->id);\n\t }\n\n\t\t\t\t\t// Update cart\n\t\t\t\t\t$this->save();\n\t\t\t\t} else {\n\t\t\t\t\t// This means dollars off.\n\t\t\t\t\t$dollars_off = $promo_code->dollars_off;\n\t\t\t\t\t$minimum_amount = $promo_code->minimum_amount;\n\t\t\t\t\t$cart_total = $this->cart_total;\n\t\t\t\t\tif ($cart_total < $minimum_amount) {\n\t\t\t\t\t\treturn \"Cart total does not meet minimum requirement of $\" . $minimum_amount . \" for this promo code.\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Get new total\n\t\t\t\t\t\t$new_total = $cart_total - $dollars_off;\n\n\t\t\t\t\t\t// Update variables\n\t\t\t\t\t\t$this->old_total = $cart_total;\n\t\t\t\t\t\t$this->cart_total = $new_total;\n\t\t\t\t\t\t$this->promo_code = $promo_code;\n\n\t\t\t\t\t\t// Create addition in stats helper\n\t\t $site_stats_helper = new SiteStatsHelper();\n\t\t if (Auth::guest()) {\n\t\t $site_stats_helper->promo_code_add_guest_addition($promo_code->id);\n\t\t } else {\n\t\t \t$site_stats_helper->promo_code_add_member_addition($promo_code->id);\n\t\t }\n\n\t\t\t\t\t\t// Update cart\n\t\t\t\t\t\t$this->save();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn \"Promo code does not exist.\";\n\t\t\t}\n\t\t} else {\n\t\t\treturn \"Promo code already attached to cart.\";\n\t\t}\n\t}",
"function set_discount($discount_id = FALSE)\n\t\t{\n\t\t\t$this->load->model('demo_cart_model');\n\t\t\t\n\t\t\t$this->demo_cart_model->demo_set_discount($discount_id);\n\t\t\t\n\t\t\tredirect('cart');\n\t\t}",
"private function _save_new_discount(){\n\t\t\t$edit_mode = 0;\n\t\t\tif( isset( $_POST[\"id\"] ) && $_POST[\"id\"] ){\n\t\t\t\t$edit_mode = 1;\n\t\t\t}\n\t\t\t\t\n\t\t\t$return = $this->_save_changes();\n\t\t\t\n\t\t\tif( isset( $return['saved_record_id'] ) && $return['saved_record_id'] ){\n\t\t\t\t$html = \"\";\n\t\t\t\t\n\t\t\t\tunset( $this->class_settings[ 'do_not_check_cache' ] );\n\t\t\t\t$this->class_settings['current_record_id'] = $return['saved_record_id'];\n\t\t\t\t$r = $this->_get_discount();\n\t\t\t\t$record = $r[ $this->class_settings['current_record_id'] ];\n\t\t\t\t\n\t\t\t\t$this->class_settings[ 'html' ] = array( 'html-files/templates-1/'.$this->table_name.'/form-control-view-row.php' );\n\t\t\t\n\t\t\t\t$this->class_settings[ 'data' ][ 'pagepointer' ] = $this->class_settings[\"calling_page\"];\n\t\t\t\t$this->class_settings[ 'data' ][ 'new_record' ] = 1;\n\t\t\t\t$this->class_settings[ 'data' ][ 'id' ] = $record[ \"id\" ];\n\t\t\t\t$this->class_settings[ 'data' ][ 'items' ] = array( $record );\n\t\t\t\t$this->class_settings[ 'data' ][ 'no_edit' ] = 1;\n\t\t\t\t\n\t\t\t\tif( $edit_mode ){\n\t\t\t\t\t$return[\"html_replace\"] = $this->_get_html_view();\n\t\t\t\t\t$return[\"html_replace_selector\"] = \"#discount-\".$record[ 'id' ];\n\t\t\t\t}else{\t\t\t\t\t\t\t\n\t\t\t\t\t$return[\"html_prepend\"] = $this->_get_html_view();\n\t\t\t\t\t$return[\"html_prepend_selector\"] = \"#form-control-table-discount\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$return[\"javascript_functions\"] = array( \"set_function_click_event\" );\n\t\t\t\tunset( $return['saved_record_id'] );\n\t\t\t\t\n\t\t\t\tswitch ( $this->class_settings[\"action_to_perform\"] ){\n\t\t\t\tcase 'save_new_discount_and_refresh':\n\t\t\t\t\t$return[\"html_append_selector\"] = \"select#discount\";\n\t\t\t\t\t$name = \"\";\n\t\t\t\t\tswitch( $record[\"type\"] ){\n\t\t\t\t\tcase 'percentage':\n\t\t\t\t\t\t$name = $record[\"name\"] . ' ( '.format_and_convert_numbers( $record[\"value\"], 4 ).' % )';\n\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$name = $record[\"name\"] . ' ( '.format_and_convert_numbers( $record[\"value\"], 4 ).' )';\n\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$return[\"html_append\"] = '<option selected=\"selected\" data-type=\"' . $record[\"type\"] . '\" value=\"' . $record[\"value\"] . '\">'.$name.'</option>';\n\t\t\t\t\t$return[\"javascript_functions\"][] = 'nwGroupCheckIn.refreshGroupDiscountList';\n\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$return[\"status\"] = \"new-status\";\n\t\t\t\n\t\t\tunset( $return[\"html\"] );\n\t\t\treturn $return;\n\t\t}",
"function update_couponCode(){\n\t\t\tprint_r($this->input->post());\n\t\t}"
]
| [
"0.6967239",
"0.68129",
"0.64710957",
"0.644579",
"0.639297",
"0.639297",
"0.6263164",
"0.62619907",
"0.62221473",
"0.6163156",
"0.609506",
"0.60663575",
"0.6061318",
"0.6039563",
"0.5968472",
"0.5957405",
"0.5928257",
"0.588671",
"0.5847876",
"0.578921",
"0.5787349",
"0.5787193",
"0.57234985",
"0.5716545",
"0.5715607",
"0.5688241",
"0.5675475",
"0.5675113",
"0.56655526",
"0.56563866"
]
| 0.74814373 | 0 |
Get a membership level object for the level associated with this order. | function getMembershipLevel($force = false)
{
global $wpdb;
if(!empty($this->membership_level) && empty($force))
return $this->membership_level;
//check if there is an entry in memberships_users first
if(!empty($this->user_id))
{
$this->membership_level = $wpdb->get_row("SELECT l.id as level_id, l.name, l.description, l.allow_signups, l.expiration_number, l.expiration_period, mu.*, UNIX_TIMESTAMP(mu.startdate) as startdate, UNIX_TIMESTAMP(mu.enddate) as enddate, l.name, l.description, l.allow_signups FROM $wpdb->pmpro_membership_levels l LEFT JOIN $wpdb->pmpro_memberships_users mu ON l.id = mu.membership_id WHERE mu.status = 'active' AND l.id = '" . $this->membership_id . "' AND mu.user_id = '" . $this->user_id . "' LIMIT 1");
//fix the membership level id
if(!empty($this->membership_level->level_id))
$this->membership_level->id = $this->membership_level->level_id;
}
//okay, do I have a discount code to check? (if there is no membership_level->membership_id value, that means there was no entry in memberships_users)
if(!empty($this->discount_code) && empty($this->membership_level->membership_id))
{
if(!empty($this->discount_code->code))
$discount_code = $this->discount_code->code;
else
$discount_code = $this->discount_code;
$sqlQuery = "SELECT l.id, cl.*, l.name, l.description, l.allow_signups FROM $wpdb->pmpro_discount_codes_levels cl LEFT JOIN $wpdb->pmpro_membership_levels l ON cl.level_id = l.id LEFT JOIN $wpdb->pmpro_discount_codes dc ON dc.id = cl.code_id WHERE dc.code = '" . $discount_code . "' AND cl.level_id = '" . $this->membership_id . "' LIMIT 1";
$this->membership_level = $wpdb->get_row($sqlQuery);
}
//just get the info from the membership table (sigh, I really need to standardize the column names for membership_id/level_id) but we're checking if we got the information already or not
if(empty($this->membership_level->membership_id) && empty($this->membership_level->level_id))
{
$this->membership_level = $wpdb->get_row("SELECT l.* FROM $wpdb->pmpro_membership_levels l WHERE l.id = '" . $this->membership_id . "' LIMIT 1");
}
// Round prices to avoid extra decimals.
if( ! empty( $this->membership_level ) ) {
$this->membership_level->initial_payment = pmpro_round_price( $this->membership_level->initial_payment );
$this->membership_level->billing_amount = pmpro_round_price( $this->membership_level->billing_amount );
$this->membership_level->trial_amount = pmpro_round_price( $this->membership_level->trial_amount );
}
return $this->membership_level;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getMembershipLevelAtCheckout($force = false) {\n\t\t\tglobal $pmpro_level;\n\n\t\t\tif( ! empty( $this->membership_level ) && empty( $force ) ) {\n\t\t\t\treturn $this->membership_level;\n\t\t\t}\n\t\t\t\n\t\t\t// If for some reason, we haven't setup pmpro_level yet, do that.\n\t\t\tif ( empty( $pmpro_level ) ) {\n\t\t\t\t$pmpro_level = pmpro_getLevelAtCheckout();\n\t\t\t}\n\t\t\t\n\t\t\t// Set the level to the checkout level global.\n\t\t\t$this->membership_level = $pmpro_level;\n\t\t\t\n\t\t\t// Fix the membership level id.\n\t\t\tif(!empty( $this->membership_level) && !empty($this->membership_level->level_id)) {\n\t\t\t\t$this->membership_level->id = $this->membership_level->level_id;\n\t\t\t}\n\t\t\t\n\t\t\t// Round prices to avoid extra decimals.\n\t\t\tif( ! empty( $this->membership_level ) ) {\n\t\t\t\t$this->membership_level->initial_payment = pmpro_round_price( $this->membership_level->initial_payment );\n\t\t\t\t$this->membership_level->billing_amount = pmpro_round_price( $this->membership_level->billing_amount );\n\t\t\t\t$this->membership_level->trial_amount = pmpro_round_price( $this->membership_level->trial_amount );\n\t\t\t}\n\t\t\t\n\t\t\treturn $this->membership_level;\n\t\t}",
"public function getLevel() : Level {\r\n\r\n return $this->level;\r\n\r\n }",
"public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }",
"public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }",
"public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }",
"public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }",
"public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }",
"public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }",
"public function getLevel()\n {\n return isset($this->level) ? $this->level : null;\n }",
"public function level()\n {\n return $this->belongsTo(Level::class);\n }",
"public function level()\n {\n return $this->belongsTo(Level::class);\n }",
"public function getLevel() {}",
"public function getLevel();",
"public function getLevel();",
"public function level()\n {\n return $this->belongsTo('App\\Level');\n }",
"public function GetLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getOppoLevel()\n {\n return $this->get(self::_OPPO_LEVEL);\n }",
"public function getLevel() {\n return $this->level;\n }",
"function getLevel() {\n\t\treturn $this->_level;\n\t}",
"public function getLevel()\n {\n return$this->level;\n }",
"public function GetLevel($level)\n\t{\n\t\t// TODO:\n\t\t\n\t\t// TODO: Also get the RichTextElements whose parents level is one less than the given $level.\n\t}",
"public function getLevelId(){\n\t\treturn $this->level_id;\n\t}",
"public function level(): BelongsTo\n {\n return $this->belongsTo(Level::class);\n }"
]
| [
"0.6530145",
"0.60621125",
"0.58389044",
"0.58389044",
"0.58389044",
"0.58389044",
"0.58389044",
"0.58389044",
"0.5824271",
"0.581639",
"0.581639",
"0.58070797",
"0.57685846",
"0.57685846",
"0.5746958",
"0.56559855",
"0.5591112",
"0.5591112",
"0.5591112",
"0.5591112",
"0.5591112",
"0.5591112",
"0.5591112",
"0.5565904",
"0.55602616",
"0.55574065",
"0.5525457",
"0.5520873",
"0.5497081",
"0.5441487"
]
| 0.62067497 | 1 |
Get a membership level object at checkout for the level associated with this order. | function getMembershipLevelAtCheckout($force = false) {
global $pmpro_level;
if( ! empty( $this->membership_level ) && empty( $force ) ) {
return $this->membership_level;
}
// If for some reason, we haven't setup pmpro_level yet, do that.
if ( empty( $pmpro_level ) ) {
$pmpro_level = pmpro_getLevelAtCheckout();
}
// Set the level to the checkout level global.
$this->membership_level = $pmpro_level;
// Fix the membership level id.
if(!empty( $this->membership_level) && !empty($this->membership_level->level_id)) {
$this->membership_level->id = $this->membership_level->level_id;
}
// Round prices to avoid extra decimals.
if( ! empty( $this->membership_level ) ) {
$this->membership_level->initial_payment = pmpro_round_price( $this->membership_level->initial_payment );
$this->membership_level->billing_amount = pmpro_round_price( $this->membership_level->billing_amount );
$this->membership_level->trial_amount = pmpro_round_price( $this->membership_level->trial_amount );
}
return $this->membership_level;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getMembershipLevel($force = false)\n\t\t{\n\t\t\tglobal $wpdb;\n\n\t\t\tif(!empty($this->membership_level) && empty($force))\n\t\t\t\treturn $this->membership_level;\n\n\t\t\t//check if there is an entry in memberships_users first\n\t\t\tif(!empty($this->user_id))\n\t\t\t{\n\t\t\t\t$this->membership_level = $wpdb->get_row(\"SELECT l.id as level_id, l.name, l.description, l.allow_signups, l.expiration_number, l.expiration_period, mu.*, UNIX_TIMESTAMP(mu.startdate) as startdate, UNIX_TIMESTAMP(mu.enddate) as enddate, l.name, l.description, l.allow_signups FROM $wpdb->pmpro_membership_levels l LEFT JOIN $wpdb->pmpro_memberships_users mu ON l.id = mu.membership_id WHERE mu.status = 'active' AND l.id = '\" . $this->membership_id . \"' AND mu.user_id = '\" . $this->user_id . \"' LIMIT 1\");\n\n\t\t\t\t//fix the membership level id\n\t\t\t\tif(!empty($this->membership_level->level_id))\n\t\t\t\t\t$this->membership_level->id = $this->membership_level->level_id;\n\t\t\t}\n\n\t\t\t//okay, do I have a discount code to check? (if there is no membership_level->membership_id value, that means there was no entry in memberships_users)\n\t\t\tif(!empty($this->discount_code) && empty($this->membership_level->membership_id))\n\t\t\t{\n\t\t\t\tif(!empty($this->discount_code->code))\n\t\t\t\t\t$discount_code = $this->discount_code->code;\n\t\t\t\telse\n\t\t\t\t\t$discount_code = $this->discount_code;\n\n\t\t\t\t$sqlQuery = \"SELECT l.id, cl.*, l.name, l.description, l.allow_signups FROM $wpdb->pmpro_discount_codes_levels cl LEFT JOIN $wpdb->pmpro_membership_levels l ON cl.level_id = l.id LEFT JOIN $wpdb->pmpro_discount_codes dc ON dc.id = cl.code_id WHERE dc.code = '\" . $discount_code . \"' AND cl.level_id = '\" . $this->membership_id . \"' LIMIT 1\";\n\n\t\t\t\t$this->membership_level = $wpdb->get_row($sqlQuery);\n\t\t\t}\n\n\t\t\t//just get the info from the membership table\t(sigh, I really need to standardize the column names for membership_id/level_id) but we're checking if we got the information already or not\n\t\t\tif(empty($this->membership_level->membership_id) && empty($this->membership_level->level_id))\n\t\t\t{\n\t\t\t\t$this->membership_level = $wpdb->get_row(\"SELECT l.* FROM $wpdb->pmpro_membership_levels l WHERE l.id = '\" . $this->membership_id . \"' LIMIT 1\");\n\t\t\t}\n\t\t\t\n\t\t\t// Round prices to avoid extra decimals.\n\t\t\tif( ! empty( $this->membership_level ) ) {\n\t\t\t\t$this->membership_level->initial_payment = pmpro_round_price( $this->membership_level->initial_payment );\n\t\t\t\t$this->membership_level->billing_amount = pmpro_round_price( $this->membership_level->billing_amount );\n\t\t\t\t$this->membership_level->trial_amount = pmpro_round_price( $this->membership_level->trial_amount );\n\t\t\t}\n\n\t\t\treturn $this->membership_level;\n\t\t}",
"public function getLevel() : Level {\r\n\r\n return $this->level;\r\n\r\n }",
"public function getLevel() {}",
"public function level()\n {\n return $this->belongsTo(Level::class);\n }",
"public function level()\n {\n return $this->belongsTo(Level::class);\n }",
"public function getOppoLevel()\n {\n return $this->get(self::_OPPO_LEVEL);\n }",
"public function getLevel();",
"public function getLevel();",
"public function level()\n {\n return $this->belongsTo('App\\Level');\n }",
"public function getLevel()\n {\n return isset($this->level) ? $this->level : null;\n }",
"public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }",
"public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }",
"public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }",
"public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }",
"public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }",
"public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }",
"function learn_press_pmpro_get_order_ids_by_membership_level( $level_id = null, $user_id = null ) {\n\tglobal $wpdb;\n\tif ( ! $user_id ) {\n\t\t$user_id = learn_press_get_current_user_id();\n\t}\n\tif ( ! $level_id ) {\n\t\t$user_level = learn_press_get_membership_level_for_user( $user_id );\n\t\t$level_id = $user_level->id;\n\t}\n\n\t$sql = 'SELECT \n\t\t\t\t`po`.`id`\n\t\t\t\t, po.checkout_id\n\t\t\t\t,`pm`.`post_id`\n\t\t\tFROM\n\t\t\t\t`lp`.`' . $wpdb->prefix . 'pmpro_membership_orders` AS `po`\n\t\t\t\t\tLEFT JOIN\n\t\t\t\t`' . $wpdb->prefix . 'postmeta` AS `pm` ON `pm`.`meta_key` = \"_pmpro_membership_order_id\"\n\t\t\t\t\tAND `pm`.`meta_value` = `po`.`id`\n\t\t\tWHERE\n\t\t\t\t`po`.`user_id` = 3\n\t\t\t\t\tAND `po`.`membership_id` = 1\n\t\t\t\t\tAND `po`.`status` = \"success\"\n\t\t\tORDER BY `timestamp` DESC\n\t\t\tLIMIT 1';\n\t$row = $wpdb->get_row( $sql );\n\n\treturn $row;\n}",
"function learn_press_get_membership_level_for_user( $user_id ) {\n\n\tif ( false === ( $level = wp_cache_get( 'user-' . $user_id, 'pmpro-user-level' ) ) ) {\n\t\t$level = pmpro_getMembershipLevelForUser( $user_id );\n\t\twp_cache_set( 'user-' . $user_id, $level, 'pmpro-user-level' );\n\t}\n\n\treturn $level;\n}",
"function getUserLevel() {\n\t\tif(!$this->user_level_id) {\n\t\t\t$this->sql(\"SELECT access_level_id FROM \".UT_USE.\" WHERE id = \".$this->user_id);\n\t\t\t$this->user_level_id = $this->getQueryResult(0, \"access_level_id\");\n \t\t}\n\t\treturn $this->user_level_id;\n\t}",
"public function GetLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return$this->level;\n }",
"public function getMembership()\n {\n return Member::getByID($this->site_members_id);\n }",
"function getLevel() {\n\t\treturn $this->_level;\n\t}",
"public function getLevelId(){\n\t\treturn $this->level_id;\n\t}",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return $this->level;\n }"
]
| [
"0.61978084",
"0.548413",
"0.5463706",
"0.54389524",
"0.54389524",
"0.53797865",
"0.5354992",
"0.5354992",
"0.5339827",
"0.5331582",
"0.5283048",
"0.5283048",
"0.5283048",
"0.5283048",
"0.5283048",
"0.5283048",
"0.5251334",
"0.5206167",
"0.5191617",
"0.5183814",
"0.51599765",
"0.51552653",
"0.5136952",
"0.5129565",
"0.51167846",
"0.51167846",
"0.51167846",
"0.51167846",
"0.51167846",
"0.51167846"
]
| 0.708338 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.