{ // 获取包含Hugging Face文本的span元素 const spans = link.querySelectorAll('span.whitespace-nowrap, span.hidden.whitespace-nowrap'); spans.forEach(span => { if (span.textContent && span.textContent.trim().match(/Hugging\s*Face/i)) { span.textContent = 'AI快站'; } }); }); // 替换logo图片的alt属性 document.querySelectorAll('img[alt*="Hugging"], img[alt*="Face"]').forEach(img => { if (img.alt.match(/Hugging\s*Face/i)) { img.alt = 'AI快站 logo'; } }); } // 替换导航栏中的链接 function replaceNavigationLinks() { // 已替换标记,防止重复运行 if (window._navLinksReplaced) { return; } // 已经替换过的链接集合,防止重复替换 const replacedLinks = new Set(); // 只在导航栏区域查找和替换链接 const headerArea = document.querySelector('header') || document.querySelector('nav'); if (!headerArea) { return; } // 在导航区域内查找链接 const navLinks = headerArea.querySelectorAll('a'); navLinks.forEach(link => { // 如果已经替换过,跳过 if (replacedLinks.has(link)) return; const linkText = link.textContent.trim(); const linkHref = link.getAttribute('href') || ''; // 替换Spaces链接 - 仅替换一次 if ( (linkHref.includes('/spaces') || linkHref === '/spaces' || linkText === 'Spaces' || linkText.match(/^s*Spacess*$/i)) && linkText !== 'OCR模型免费转Markdown' && linkText !== 'OCR模型免费转Markdown' ) { link.textContent = 'OCR模型免费转Markdown'; link.href = 'https://fast360.xyz'; link.setAttribute('target', '_blank'); link.setAttribute('rel', 'noopener noreferrer'); replacedLinks.add(link); } // 删除Posts链接 else if ( (linkHref.includes('/posts') || linkHref === '/posts' || linkText === 'Posts' || linkText.match(/^s*Postss*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } // 替换Docs链接 - 仅替换一次 else if ( (linkHref.includes('/docs') || linkHref === '/docs' || linkText === 'Docs' || linkText.match(/^s*Docss*$/i)) && linkText !== '模型下载攻略' ) { link.textContent = '模型下载攻略'; link.href = '/'; replacedLinks.add(link); } // 删除Enterprise链接 else if ( (linkHref.includes('/enterprise') || linkHref === '/enterprise' || linkText === 'Enterprise' || linkText.match(/^s*Enterprises*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } }); // 查找可能嵌套的Spaces和Posts文本 const textNodes = []; function findTextNodes(element) { if (element.nodeType === Node.TEXT_NODE) { const text = element.textContent.trim(); if (text === 'Spaces' || text === 'Posts' || text === 'Enterprise') { textNodes.push(element); } } else { for (const child of element.childNodes) { findTextNodes(child); } } } // 只在导航区域内查找文本节点 findTextNodes(headerArea); // 替换找到的文本节点 textNodes.forEach(node => { const text = node.textContent.trim(); if (text === 'Spaces') { node.textContent = node.textContent.replace(/Spaces/g, 'OCR模型免费转Markdown'); } else if (text === 'Posts') { // 删除Posts文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } else if (text === 'Enterprise') { // 删除Enterprise文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } }); // 标记已替换完成 window._navLinksReplaced = true; } // 替换代码区域中的域名 function replaceCodeDomains() { // 特别处理span.hljs-string和span.njs-string元素 document.querySelectorAll('span.hljs-string, span.njs-string, span[class*="hljs-string"], span[class*="njs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换hljs-string类的span中的域名(移除多余的转义符号) document.querySelectorAll('span.hljs-string, span[class*="hljs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换pre和code标签中包含git clone命令的域名 document.querySelectorAll('pre, code').forEach(element => { if (element.textContent && element.textContent.includes('git clone')) { const text = element.innerHTML; if (text.includes('huggingface.co')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 处理特定的命令行示例 document.querySelectorAll('pre, code').forEach(element => { const text = element.innerHTML; if (text.includes('huggingface.co')) { // 针对git clone命令的专门处理 if (text.includes('git clone') || text.includes('GIT_LFS_SKIP_SMUDGE=1')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 特别处理模型下载页面上的代码片段 document.querySelectorAll('.flex.border-t, .svelte_hydrator, .inline-block').forEach(container => { const content = container.innerHTML; if (content && content.includes('huggingface.co')) { container.innerHTML = content.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 特别处理模型仓库克隆对话框中的代码片段 try { // 查找包含"Clone this model repository"标题的对话框 const cloneDialog = document.querySelector('.svelte_hydration_boundary, [data-target="MainHeader"]'); if (cloneDialog) { // 查找对话框中所有的代码片段和命令示例 const codeElements = cloneDialog.querySelectorAll('pre, code, span'); codeElements.forEach(element => { if (element.textContent && element.textContent.includes('huggingface.co')) { if (element.innerHTML.includes('huggingface.co')) { element.innerHTML = element.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { element.textContent = element.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); } // 更精确地定位克隆命令中的域名 document.querySelectorAll('[data-target]').forEach(container => { const codeBlocks = container.querySelectorAll('pre, code, span.hljs-string'); codeBlocks.forEach(block => { if (block.textContent && block.textContent.includes('huggingface.co')) { if (block.innerHTML.includes('huggingface.co')) { block.innerHTML = block.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { block.textContent = block.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); }); } catch (e) { // 错误处理但不打印日志 } } // 当DOM加载完成后执行替换 if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', () => { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); }); } else { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); } // 增加一个MutationObserver来处理可能的动态元素加载 const observer = new MutationObserver(mutations => { // 检查是否导航区域有变化 const hasNavChanges = mutations.some(mutation => { // 检查是否存在header或nav元素变化 return Array.from(mutation.addedNodes).some(node => { if (node.nodeType === Node.ELEMENT_NODE) { // 检查是否是导航元素或其子元素 if (node.tagName === 'HEADER' || node.tagName === 'NAV' || node.querySelector('header, nav')) { return true; } // 检查是否在导航元素内部 let parent = node.parentElement; while (parent) { if (parent.tagName === 'HEADER' || parent.tagName === 'NAV') { return true; } parent = parent.parentElement; } } return false; }); }); // 只在导航区域有变化时执行替换 if (hasNavChanges) { // 重置替换状态,允许再次替换 window._navLinksReplaced = false; replaceHeaderBranding(); replaceNavigationLinks(); } }); // 开始观察document.body的变化,包括子节点 if (document.body) { observer.observe(document.body, { childList: true, subtree: true }); } else { document.addEventListener('DOMContentLoaded', () => { observer.observe(document.body, { childList: true, subtree: true }); }); } })(); \n\nHEREDOC;\n\necho $html;\n?>"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":804,"cells":{"blob_id":{"kind":"string","value":"4b73722824f7a59beee2a094e2768599f41c9df2"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"eddymio/demo"},"path":{"kind":"string","value":"/pdo_mvc/src/Model/Entity/Person.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":464,"string":"464"},"score":{"kind":"number","value":3.5625,"string":"3.5625"},"int_score":{"kind":"number","value":4,"string":"4"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"name . \", I'm \".$this->age;\n }\n\n public function sayHelloToMyBooks(): void\n {\n foreach($this->books as $book)\n {\n $book->sayHello();\n echo \"
\";\n }\n }\n}"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":805,"cells":{"blob_id":{"kind":"string","value":"cc7516d7ba56fc5b7780820499d8c4f6f9797a1a"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"mhmj/mhmj-pms-nilai"},"path":{"kind":"string","value":"/app/Http/Controllers/Packaging/Updates/UpdatePackagingRemark.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":691,"string":"691"},"score":{"kind":"number","value":2.65625,"string":"2.65625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"repository = $repository;\n }\n\n public function updates($packagingNo, $remark)\n {\n $data = $this->repository->where('packaging_no', $packagingNo)->first();\n\n $data->remark = $remark;\n\n if($data->save()){\n return $data;\n }\n }\n\n}"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":806,"cells":{"blob_id":{"kind":"string","value":"103a519cf859a6ba2e66633155e40c38037cf2bd"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"Sovannrath/itservicedesk.com.kh"},"path":{"kind":"string","value":"/app/Department.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":290,"string":"290"},"score":{"kind":"number","value":2.515625,"string":"2.515625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"\";\nmysql_select_db(\"$db_name\") or die(mysql_error());\n//echo \"Connected to Database
\";\n\nif (mysqli_connect_errno()) {\n\techo \"Failed to connect to MySQL: \" . mysqli_connect_error();\n}\n\n//END OF SET CONNECTION\n\n$postdata = file_get_contents(\"php://input\");\n\nif(isset($postdata)){\n\t$uname =\"\";\n\t$pwd = \"\";\n\n\t$decodedpostdata = json_decode($postdata,true); //JSON decode\n\t\n\t$uname = $decodedpostdata['username']; //fetching username\n\t$pwd = $decodedpostdata['password'];// fetching password\n \n\t// echo $uname;\n\t// echo $pwd;\n \n\t$sql=\"SELECT * FROM $tbl_name WHERE username='$uname' and password='$pwd' and isactive = 1\";\n\t$result=mysql_query($sql);\n\n\t// Mysql_num_row is counting table row\n\t$count=mysql_num_rows($result);\n\t\n\t// If result matched $uname and $pwd, table row must be 1 row\n\tif ($count==1) {\n\t{\n\t\techo '1';\n\t}\n\t} else {\n\t\techo '0';\n\t}\t\n}\nelse\n\techo \"Invalid parameter\";\n\nob_end_flush();\n?>"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":808,"cells":{"blob_id":{"kind":"string","value":"ca7371e592263f1e2010658a6c408fcf900756d6"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"RegisFR69/SkatingRanking"},"path":{"kind":"string","value":"/Skatingranking/lib/class/class_Competitions.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":2094,"string":"2,094"},"score":{"kind":"number","value":3.34375,"string":"3.34375"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"_competitions = [new Competition(0, 'unknow', 0)]; }\n\n // Retourne le nom de la competition à partie de l'id\n public function name($id) {\n if (key_exists($id, $this->_competitions)) { return $this->_competitions[$id]->name(); }\n else { return $this->_competitions[0]->name(); }\n }\n\n // Retourne le coefficient de la competition à partir de l'id\n public function coefficient($id) {\n if (key_exists($id, $this->_competitions)) { return $this->_competitions[$id]->coefficient(); }\n else { return $this->_competitions[0]->coefficient(); }\n }\n\n // Alias de exist()\n public function id($name) { return $this->exist($name); }\n\n // Ajoute une competition\n public function add($name, $coefficient) {\n $id = $this->id($name); // Vérifie si la competition existe\n if ( $id == -1 ) { // si non la rajouter et renvoie l'id\n $id = count($this->_competitions);\n array_push($this->_competitions, new Competition($id, $name, $coefficient));\n }\n return $id;\n }\n\n // Vérifie l'existence d'une competition à partir de son nom et renvoie son id (-1 if not exists)\n public function exist($name) {\n foreach ($this->_competitions as $key => $competition) {\n if ( $competition->name() == $name ) { return $key; }\n }\n return -1;\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":809,"cells":{"blob_id":{"kind":"string","value":"c3b4f8690832f395fe8abec7e56585af58c32d3b"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"calebporzio/advent-of-code-2018"},"path":{"kind":"string","value":"/tests/Unit/Day2Puzzle1.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":11482,"string":"11,482"},"score":{"kind":"number","value":2.5625,"string":"2.5625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"wrap(array_count_values($this->items));\n });\n }\n\n public function test()\n {\n $twoCount = $this->input()\n ->map(function($c) { return collect(str_split($c)); })\n ->filter(function ($line) {\n return $line->countValues()->search(2);\n })\n ->count();\n\n $threeCount = $this->input()\n ->map(function($c) { return collect(str_split($c)); })\n ->filter(function ($line) {\n return $line->countValues()->search(3);\n }k\n ->count();\n\n $checksum = $twoCount * $threeCount;\n\n $this->assertEquals(7808, $checksum);\n }\n\n public function input()\n {\n return collect([\n 'efmyhuxcqqldtwjzvisepargvo',\n 'efuyhuxckqldtwjrvrsbpargno',\n 'efmyhuxckqlxtwjxvisbpargoo',\n 'efmyhuxczqbdtwjzvisbpargjo',\n 'efmyhugckqldtwjzvisfpargnq',\n 'tfmyhuxckqljtwjzvisbpargko',\n 'efmyhuxckqldtvuzvisbpavgno',\n 'efmyhufcrqldtwjzvishpargno',\n 'tfmyhuxbkqlduwjzvisbpargno',\n 'efayhtxckqldbwjzvisbpargno',\n 'efgyhuxckuldtwjzvisbpardno',\n 'efmyhuxckuldtwizvisbpargqo',\n 'efmyhuxcknldtjjzvihbpargno',\n 'efmyhuxcnqddtwjzvisbpafgno',\n 'efmyhubokqldtwjzvisbpargdo',\n 'efmhhuxckqldtwdzvisbpjrgno',\n 'efmyhuxckqldtwjrcisbpargny',\n 'efmyhuxckqsdtwjzlisbpargng',\n 'effyhuxckqlqtwjzjisbpargno',\n 'nfmyhjxckqldtwjzcisbpargno',\n 'efmyhvxckqldtwszvwsbpargno',\n 'efmyhuxckqldtwutvisbpprgno',\n 'kfmyhuxckqldtwzuvisbpargno',\n 'efhyhtxckqldtwjmvisbpargno',\n 'efmyhuhckqldtwjzvisbpxwgno',\n 'efmyhuxcfqldtrjzvitbpargno',\n 'efmyhudckqldtwjfvisbparvno',\n 'ekmyhuxckqlstwjzvisbdargno',\n 'efmyhuxckqlxtwjftisbpargno',\n 'etsyhuxckqldtwjzvisbpargnf',\n 'exmyhusckqldtwjzvisbpakgno',\n 'efmyhubckqlrtljzvisbpargno',\n 'efmyhuxckwldtwjovizbpargno',\n 'efmyhulckqzdtwjzvisbpargpo',\n 'efmyhuxckbcdlwjzvisbpargno',\n 'zfmyhulckqbdtwjzvisbpargno',\n 'efmyquxckfldtwazvisbpargno',\n 'efxyhuxakqldtwjzvisupargno',\n 'efmlhuxckkedtwjzvisbpargno',\n 'efhyhuxwkqldtwjzvisbparjno',\n 'efmyhuxfkqldtwjzvisvparyno',\n 'efmyhuxckqfdtijzvisblargno',\n 'efmyhuxckqldtfjzvisbwhrgno',\n 'efmymuxcknldtwzzvisbpargno',\n 'eomybuxckqldtwkzvisbpargno',\n 'pfmyhuxckqldtwgzvasbpargno',\n 'vfmyhuxcoqldtwjzvisbparvno',\n 'eflyhuxckqldtwjzvirypargno',\n 'efmyvuxckqldtwizvisbpaqgno',\n 'epmyhuxckqldtwjzvesbparpno',\n 'efoyhuxckoldtwjmvisbpargno',\n 'efmyhuxckqydtwpzvisbpaqgno',\n 'efmyhuxckqldezbzvisbpargno',\n 'efmyhuxckqldtwjzvisboalxno',\n 'efmyhuxckqldtwuzvipbjargno',\n 'efmymuxcuqldtwjzvasbpargno',\n 'jfmyhuxckqldtwjzvzsbpargdo',\n 'nfmyhuxckqlntsjzvisbpargno',\n 'efmxhuxckqgdtwjzvisbparjno',\n 'efmyhuxckpldtpjzvpsbpargno',\n 'efmyhuxcyqldtwjhvisbpargqo',\n 'efmyhexgkqydtwjzvisbpargno',\n 'ffmyhuxckqldtwjzvisbpafgnk',\n 'efmyfuxckqldtwjpvisbpartno',\n 'efmyhoxckcmdtwjzvisbpargno',\n 'efmyhuxxkqldtwjzviabparyno',\n 'jfmyhuxakqldtwgzvisbpargno',\n 'efmjhuxckqcdtwjzvisbjargno',\n 'efmyhuxccqldtwjzxisbxargno',\n 'efmyhurckqldiwjzvrsbpargno',\n 'efmyhuxckasdtwjzvisboargno',\n 'efmyhvxckmldtwjgvisbpargno',\n 'efmyhuxckoldtwjuvisbpardno',\n 'efmyduxckqldtwjgvzsbpargno',\n 'ejmyhuxckqldtwbzvisbpargnb',\n 'efmymuxchqldtwjzvibbpargno',\n 'efmyhjxckqldtwjgvinbpargno',\n 'efmyhuxhyqldtwbzvisbpargno',\n 'efmyhuxckqldtwjzvisbpzignq',\n 'efmyuueckqldxwjzvisbpargno',\n 'qfmyhyxckqldtwizvisbpargno',\n 'efmyhupckqldtwjzvpgbpargno',\n 'efmycuxckqldtwjzvfdbpargno',\n 'efmyhugcrqldtwjfvisbpargno',\n 'efmyhexckqldtwjzvischargno',\n 'efmyhuxckqldtljzvasbpamgno',\n 'efmyzdxckqldtwjovisbpargno',\n 'efmyhuxccqldtwjzvdsbpaigno',\n 'ufmyhuxekqldtwjzvisbpargne',\n 'efmyhuxckqldfwozvisgpargno',\n 'afmyhuackqldtwjzvisbdargno',\n 'efmyauxckqldtwjzvisiparmno',\n 'efmysuxckqldtwjzvisbeaggno',\n 'efmyhuxckqldtwjzvisbgzigno',\n 'efryhuxlkqldtwozvisbpargno',\n 'lfmyhuxckqldtwjzvhsbparuno',\n 'efmyhzxckqldswjzvisqpargno',\n 'efmyhuxrkqldtwjzvisgpargco',\n 'efmyhudckqldtwjzyisbkargno',\n 'efmyhuacqqldtwjzviabpargno',\n 'jfmyhuxckqldtwvzvicbpargno',\n 'efmkhuxckqlftejzvisbpargno',\n 'nfmyhuxckqldnwjzvisbxargno',\n 'efmyhuxckqldtwjvvisjpyrgno',\n 'efmyhuxcmxldtwjzvisbpargto',\n 'efmyhuxckqldtwqbvpsbpargno',\n 'efmyhuxckzldjwjzvisbplrgno',\n 'efmywgxckqldtwxzvisbpargno',\n 'efmsguxckqldhwjzvisbpargno',\n 'nfmyhuxlkqldtwjzvisbgargno',\n 'etmyhuxckqldtwjzvqsbptrgno',\n 'efmyxuxckqldtfjzvisbyargno',\n 'cfmihuxckqldtwjzvisbpargnf',\n 'jfzyhuxckqldtwjzviscpargno',\n 'efmyhuxckqldtmjzvisbpbzgno',\n 'bfmyhuzckqldcwjzvisbpargno',\n 'efmyhuxckqldtmjzvmslpargno',\n 'efqyvuxckqldtwazvisbpargno',\n 'efmecrxckqldtwjzvisbpargno',\n 'efmyhuuckqldtwjzvisrpargnt',\n 'efmphuxckqldtwjzvisbparmho',\n 'ifmyhuxckqldtwjzvismpsrgno',\n 'efmyhuookqldywjzvisbpargno',\n 'efmyhfxckyldtwjnvisbpargno',\n 'efmyhxhckqldtwjzvisqpargno',\n 'efryhuxcfqldtwjzvisbparkno',\n 'efmyhutckqldpwjzvixbpargno',\n 'efmyoukckqldtwjzvisbpargko',\n 'efmyhuxckqldtwjzviseparynv',\n 'efmyhuxcksldvwjzvisbnargno',\n 'efmyhuxckqrdtwlzmisbpargno',\n 'efmyhuxcwqldtwjzviqapargno',\n 'eymyhuxckqrdtwkzvisbpargno',\n 'efmyhuxckqldtwjzpisopargnj',\n 'efmyhuxikqldtwjzvirupargno',\n 'efmyhuxcuzldtnjzvisbpargno',\n 'efmyhxxikqldtwjzvisbpalgno',\n 'efmyhuxceqldtwjzvdsbparguo',\n 'efmyhuxwkqldtwjmvisbparxno',\n 'efmyhuxpkqldtwjzvisfpargfo',\n 'efmyfuxckaldtwjzvirbpargno',\n 'efmyhuxckqrdtwjzvismprrgno',\n 'efmyhuxckqldzwjzvisbpnrgfo',\n 'efmyhfuckqldtwjyvisipargno',\n 'efmyhuxcpqlqfwjzvisbpargno',\n 'efmyyuxckqldtwjzvrsepargno',\n 'efmphuxckqlptqjzvisbpargno',\n 'efmyhuxnfqldtwjzvisbpmrgno',\n 'efmyhuxckqldtwjzkisnpnrgno',\n 'mfmyhuxckqldtwjzvisbzarcno',\n 'efmyhuxckqldtwlzviszpargwo',\n 'efmytuxckqndtwjqvisbpargno',\n 'efmyzuxckqldtwjzvisbaargjo',\n 'efmihuxckqlutwjzvimbpargno',\n 'efmyhuxckqldgwjzvixbparono',\n 'tfmyduxckqldtyjzvisbpargno',\n 'ejmyhuockqldtwjzvidbpargno',\n 'efmyheyckqkdtwjzvisbpargno',\n 'efmyhuxckqldtwjzoisbpargfj',\n 'efqyhuxcxqldtwxzvisbpargno',\n 'jfmyhaxckqldtwjzvisbvargno',\n 'hfmyhqxckqldtwjzvisbparvno',\n 'efmyhukckqlrtwjzvqsbpargno',\n 'efmyhuxckqldvwmzvisbparrno',\n 'efoyhuxckqldtwjzvilwpargno',\n 'ejmyhuxckqldtwjzxisbprrgno',\n 'efmyhuxckqldtsjzvisupdrgno',\n 'efzyhjxckqldtwjzvisbpasgno',\n 'ebmyhulckqldtwjzvisbpargnr',\n 'efmyhuxcjqlntwjzqisbpargno',\n 'efmlocxckqldtwjzvisbpargno',\n 'efmyhuxckqldtwjzvizkpargnm',\n 'ebmyhuxckqldtwjzvlfbpargno',\n 'efmyhuxckqldtwjyvisbpjrgnq',\n 'afmyhuxckqldtwjzvpsbpargnv',\n 'efmyxuxckqwdzwjzvisbpargno',\n 'efmyhuxskqlqthjzvisbpargno',\n 'efmyhuxckqldtwdzvisbearglo',\n 'mfmyhuxckqldtzjzvisbparggo',\n 'efmyhuqckqodtwjzvisbpadgno',\n 'efmyhuxctqldywjzvisspargno',\n 'efmyhuxckqqdtwjnvisbporgno',\n 'efmyhixckqldowjzvisbpaagno',\n 'efmyhuxckqldtsszvisbpargns',\n 'edmyhuxckqpdtwjzrisbpargno',\n 'efsyhuxckqldtijzvisbparano',\n 'efmyhuxckqxdzwjzviqbpargno',\n 'efmyhuxckqldtwjzviqqpsrgno',\n 'efmyhuockqlatwjzvisbpargho',\n 'efmyhuxckqldtwjzvishkavgno',\n 'vfmyhuxckqldtwjzvksbaargno',\n 'efmahuxckqudtwbzvisbpargno',\n 'ewmyhixckqudtwjzvisbpargno',\n 'efmywuxczqldtwjzvisbpargao',\n 'efmyhuqjkqldtwyzvisbpargno',\n 'efmyhuxekqldtwjzmksbpargno',\n 'efmyhuxcoqtdtwjzvinbpargno',\n 'ebmyhuxkkqldtwjzvisbdargno',\n 'ecmyhnxckqldtwnzvisbpargno',\n 'efmyhuxbkqldtwjzvksbpaigno',\n 'efayhuxckqidtwjzvisbpavgno',\n 'efmrhuxckqldswjzvisbpaugno',\n 'efmyhuuckqldtwjyvisipargno',\n 'xfmyhuxckqldawjzvosbpargno',\n 'efmyhuxckklhtwjzvisbpargnq',\n 'efmyhmxcaqldzwjzvisbpargno',\n 'efiyhuxcksldtwjzvisbpamgno',\n 'zfmyhuzckqldtwjzvisbparhno',\n 'efmyhuxckqlvtwjdvisbparsno',\n 'efmyhmxckaldtwjzmisbpargno',\n 'efmysuxcqoldtwjzvisbpargno',\n 'efmyhuxckqldtwjzvisbsargrb',\n 'effyhuxckqldtwjzvisbpwfgno',\n 'efmyhuxclqmdtwjzxisbpargno',\n 'edmohuxckqldtwjziisbpargno',\n 'efmyhuxckpldtwjzviubpaegno',\n 'efmyhuxcpqldtwjzjimbpargno',\n 'ehmyhuxckqldtwjzsisbpargnq',\n 'efmyhcxcdqldtwjzvisbqargno',\n 'efmjhuxckqldmwjzviybpargno',\n 'efeyhzxckqlxtwjzvisbpargno',\n 'efmyhuxczqadtwazvisbpargno',\n 'efmahuxckqldtwjzvisbpafgnl',\n 'efmyouxckqldtwjzvizbpacgno',\n 'emmrhuxckqldtwjzvisqpargno',\n 'exmyhuxckqlftwjnvisbpargno',\n 'efuyhuxckqldrwjzvisbpargnw',\n 'efmywuxfkqldtwjztisbpargno',\n 'efmyhuxdkqldtwjzvisbpqrzno',\n 'eemyhuxckqldrwjzvisbpajgno',\n 'efmyiuxckqldtbjzvrsbpargno',\n 'eqmyhuxckqldlwjzfisbpargno',\n 'efmyhuxckqlitwuzvisbpvrgno',\n 'ecoyhuxckqldtwjzvishpargno',\n 'efmyhuxckcldtwjzlisbparlno',\n 'efmyhsxcknldtwjfvisbpargno',\n 'efmyhuxckqldtwjrvosbpargbo',\n 'enmehuxckzldtwjzvisbpargno',\n 'hfmyhuxckqqdtwjzvisbpawgno',\n 'efmyhufckcjdtwjzvisbpargno',\n 'efmxhuxckqldthjzvisfpargno',\n 'efmyaukckqldtwjsvisbpargno',\n 'efmyhukckqldtwpzvisbpmrgno',\n 'dfmyhuxckqldtwjzvisbvarmno',\n 'afmbhuxckqldtwjzvssbpargno',\n 'efmyhuxchqldtwezvisbpargzo',\n 'efmphuxckqlxjwjzvisbpargno',\n 'efhyxuxckqldtwjzvisbpargko',\n 'sfmyhexckqldtwjzvisbqargno',\n 'efmghuxckqldtwjzvitbparnno',\n ]);\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":810,"cells":{"blob_id":{"kind":"string","value":"213283592734161dfead91ad3dc22264602ca5ee"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"FilenkoAI/dewoo-shop-host"},"path":{"kind":"string","value":"/local/modules/czebra.south/lib/Methods.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":10631,"string":"10,631"},"score":{"kind":"number","value":2.640625,"string":"2.640625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"setFilter(['PHONE_AUTH.PHONE_NUMBER' => $phone])\n ->setSelect(['ID', 'PHONE_AUTH.PHONE_NUMBER'])\n ->fetchObject();\n $result = [];\n if ($user) {\n $result['ID'] = $user->getId();\n $result['STATUS'] = 'Y';\n } else {\n $result['STATUS'] = 'N';\n }\n return $result;\n }\n\n public static function sendCode($phone, $register = 'N')\n {\n $result = [];\n\n if (self::isUserRegistered($phone)['STATUS'] == 'N' && $register == 'N') {\n $result['status'] = 'error';\n $result['message'] = 'Пользователь не найден';\n return $result;\n }\n\n $ip = $_SESSION['SESS_IP'];\n\n $isAllowed = self::isSendingAllowed($ip);\n $result[] = $isAllowed;\n\n $isValid = \\Bitrix\\Main\\PhoneNumber\\Parser::getInstance()->parse($phone)->isValid();\n\n if ($isValid) {\n if ($isAllowed['code'] !== 4) {\n\n $code = \\Bitrix\\Main\\Security\\Random::getInt(self::CODE_MIN, self::CODE_MAX);\n\n $sms = new \\Bitrix\\Main\\Sms\\Event(\n \"SMS_USER_CONFIRM_NUMBER\",\n [\n \"USER_PHONE\" => $phone,\n \"CODE\" => $code,\n ]\n );\n $smsResult = $sms->send(true);\n if (!$smsResult->isSuccess()) {\n $result['success'] = false;\n $result['status'] = 'error';\n $result['message'] = 'Слишком много запросов. Попробуйте позднее';\n return $result;\n }\n\n $result['success'] = true;\n $result['sms_result'] = $smsResult;\n $codeHash = md5($code);\n\n $res = \\Czebra\\South\\AuthTable::getByPrimary($phone)->fetchObject();\n\n if ($res) {\n $res->setAttemptsCount(0);\n $res->setMessagesSentCount($res->getMessagesSentCount() + 1);\n $res->setCodeHash($codeHash);\n $res->save();\n } else {\n \\Czebra\\South\\AuthTable::add([\n 'PHONE' => $phone,\n 'CODE_HASH' => $codeHash\n ]);\n }\n\n\n }\n } else {\n $result['success'] = false;\n $result['status'] = 'error';\n $result['message'] = 'Неверный формат номера телефона';\n }\n\n return $result;\n }\n\n public static function authProcess($phone)\n {\n $phone = trim($phone);\n $userIsRegistered = self::isUserRegistered($phone);\n if ($userIsRegistered['STATUS'] === 'Y') {\n return 'Y';\n } else {\n return 'N';\n }\n }\n //временно public\n // придумать что возвращать еслли не нашел телефон\n public static function checkHashCode($phone, $code): array\n {\n $res = \\Czebra\\South\\AuthTable::getByPrimary($phone)->fetchObject();\n $result = [];\n if ($res) {\n if ($res->getAttemptsCount() > self::MAX_ATTEMPTS_COUNT) {\n $result['STATUS'] = 'N';\n $result['MESSAGE'] = 'Слишком много попыток. Попробуйте другой код.';\n } else {\n $res->setAttemptsCount($res->getAttemptsCount() + 1);\n if ($res->getCodeHash() === md5($code)) {\n $res->delete();\n $result['STATUS'] = 'Y';\n $result[] = self::userProceed($phone);\n } else {\n $result['STATUS'] = 'N';\n $result['MESSAGE'] = 'Неверный код подтверждения';\n }\n }\n\n } else {\n $result['STATUS'] = 'N';\n $result['MESSAGE'] = 'ERROR';\n }\n $res->save();\n return $result;\n }\n\n public static function isSendingAllowed($ip): array\n {\n $res = \\Czebra\\South\\IPTable::getByPrimary($ip)->fetchObject();\n $result = [];\n if ($res === null) {\n \\Czebra\\South\\IPTable::add(['IP' => $ip]);\n $result['status'] = 'success';\n $result['message'] = 'added';\n $result['code'] = 0;\n } else {\n $lastSent = $res->getDateLastSent()->getTimestamp();\n $secondsPast = (new \\Bitrix\\Main\\Type\\DateTime())->getTimestamp() - $lastSent;\n if ($res->getMessagesSentCount() > self::MESSAGES_MAX_COUNT) {\n if ($secondsPast > self::SEND_TIMEOUT) {\n\n $res->setMessagesSentCount(0);\n $res->setDateLastSent(new \\Bitrix\\Main\\Type\\DateTime());\n $res->save();\n\n $result['status'] = 'success';\n $result['message'] = 'sending allowed again';\n $result['code'] = 3;\n\n } else {\n $result['status'] = 'error';\n $result['message'] = 'required time did not expired';\n $result['code'] = 4;\n }\n } else {\n if ($secondsPast > self::SEND_INTERVAL) {\n $res->setDateLastSent(new \\Bitrix\\Main\\Type\\DateTime());\n $res->setMessagesSentCount(0);\n\n $result['message'] = 'another message has been sent, sent messages field have been set to 0';\n $result['code'] = 1;\n } else {\n $res->setDateLastSent(new \\Bitrix\\Main\\Type\\DateTime());\n $res->setMessagesSentCount($res->getMessagesSentCount() + 1);\n\n $result['message'] = 'another message has been sent, sent messages field have been incremented';\n $result['code'] = 2;\n }\n $res->save();\n $result['status'] = 'success';\n }\n }\n\n return $result;\n }\n\n public static function userProceed($phone)\n {\n $result = [];\n $result['AUTHORIZED'] = 'Y';\n $result['AUTHORIZATION']['STATUS'] = self::authorizeUser($phone);\n return $result;\n }\n\n public static function registerUser($phone, $name, $email, $code)\n {\n $isValid = \\Bitrix\\Main\\PhoneNumber\\Parser::getInstance()->parse($phone)->isValid();\n $result = [];\n\n if (self::isUserRegistered($phone)['STATUS'] == 'N'){\n if ($isValid) {\n global $USER;\n\n $res = \\Czebra\\South\\AuthTable::getByPrimary($phone)->fetchObject();\n if ($res) {\n if ($res->getAttemptsCount() > self::MAX_ATTEMPTS_COUNT) {\n $result['status'] = 'error';\n $result['message'] = 'Слишком много попыток. Попробуйте другой код.';\n } else {\n $res->setAttemptsCount($res->getAttemptsCount() + 1);\n if ($res->getCodeHash() === md5($code)) {\n $res->delete();\n\n $bConfirmReq = (\\COption::GetOptionString(\"main\", \"new_user_registration_email_confirmation\", \"N\")) == \"Y\";\n $password = \\Bitrix\\Main\\Security\\Random::getString(25);\n $login = \\Bitrix\\Main\\Security\\Random::getString(50);\n\n $arFields = array(\n \"NAME\" => $name,\n \"LOGIN\" => $login,\n \"LID\" => SITE_ID,\n \"ACTIVE\" => \"Y\",\n \"EMAIL\" => $email,\n \"PASSWORD\" => $password,\n \"CONFIRM_PASSWORD\" => $password,\n \"CONFIRM_CODE\" => $bConfirmReq ? randString(8) : \"\",\n \"PHONE_NUMBER\" => $phone,\n );\n\n $USER_ID = $USER->Add($arFields);\n\n if (intval($USER_ID) > 0) {\n $USER->Authorize($USER_ID);\n $result['status'] = 'success';\n $result['message'] = 'Вы успешно зарегистрировались!';\n } else {\n $result['status'] = 'error';\n $result['message'] = $USER->LAST_ERROR;\n }\n\n } else {\n $result['status'] = 'error';\n $result['message'] = 'Неверный код подтверждения';\n }\n }\n } else {\n $result['status'] = 'error';\n $result['message'] = 'Попытка подтвердить номер телефона без отправленного сообщения';\n }\n $res->save();\n return $result;\n\n } else {\n $result['status'] = 'error';\n $result['message'] = 'Неверный номер телефона';\n }\n } else {\n $result['status'] = 'error';\n $result['message'] = 'Пользователь уже существует';\n }\n return $result;\n }\n\n public static function authorizeUser($phone)\n {\n global $USER;\n $result = '';\n $user = UserTable::query()\n ->setFilter(['PHONE_AUTH.PHONE_NUMBER' => $phone])\n ->setSelect(['ID', 'PHONE_AUTH.PHONE_NUMBER'])\n ->fetchObject();\n $id = $user->getId();\n if ($id) {\n $USER->Update($id, ['ACTIVE' => 'Y']);\n $USER->Authorize($id);\n $result = 'success';\n } else {\n $result = 'error';\n }\n return $result;\n }\n\n}"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":811,"cells":{"blob_id":{"kind":"string","value":"bfe49a0d9ffc716e7ea769cb0d7e471ca218d1d9"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"cocoast/IntranetSchool"},"path":{"kind":"string","value":"/app/Docente.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":476,"string":"476"},"score":{"kind":"number","value":2.515625,"string":"2.515625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"hasOne('App\\Curso');\n\t}\n\tpublic function Asignaturas()\n\t{\n\t\treturn $this->hasMany('App\\Asignatura');\n\t}\n\t//Aqui Scope\n\tpublic function scopeSearch($query, $name)\n {\n return $query->where('apellido','LIKE',\"%$name%\");\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":812,"cells":{"blob_id":{"kind":"string","value":"5c95ea913814b741c607b856e6ff90c72d22ccfb"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"lkarpik/SnippetsPHP"},"path":{"kind":"string","value":"/SQL/index.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1521,"string":"1,521"},"score":{"kind":"number","value":2.546875,"string":"2.546875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"\n
\n \n

Posty

\n \n \n \n
\n\n \n
\n\n
\n \n
\n\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":813,"cells":{"blob_id":{"kind":"string","value":"8848e124cf0f807e1b805746ae85cc918864d9fa"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"Chridox/PHPTesis"},"path":{"kind":"string","value":"/class.usuario.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1149,"string":"1,149"},"score":{"kind":"number","value":3.109375,"string":"3.109375"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"idUsuario = $idUsuario;\n $this->logUsuario = $logUsuario;\n $this->nombreUsuario = $nombreUsuario;\n $this->conUsuario = $conUsuario;\n $this->cargoUsuario = $cargoUsuario;\n \n \n}\nfunction getIdUsuario() {\n return $this->idUsuario;\n}\n\nfunction getLogUsuario() {\n return $this->logUsuario;\n}\n\nfunction getNombreUsuario() {\n return $this->nombreUsuario;\n}\n\nfunction getConUsuario() {\n return $this->conUsuario;\n}\n\nfunction getCargoUsuario() {\n return $this->cargoUsuario;\n}\n\nfunction setIdUsuario($idUsuario) {\n $this->idUsuario = $idUsuario;\n}\n\nfunction setLogUsuario($logUsuario) {\n $this->logUsuario = $logUsuario;\n}\n\nfunction setNombreUsuario($nombreUsuario) {\n $this->nombreUsuario = $nombreUsuario;\n}\n\nfunction setConUsuario($conUsuario) {\n $this->conUsuario = $conUsuario;\n}\n\nfunction setCargoUsuario($cargoUsuario) {\n $this->cargoUsuario = $cargoUsuario;\n}\n\n\n\n\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":814,"cells":{"blob_id":{"kind":"string","value":"4feef293ef6b0774526298085bf6b24eab348e32"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"Obelixvn/QuanXa"},"path":{"kind":"string","value":"/show_expenseTB.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1302,"string":"1,302"},"score":{"kind":"number","value":2.5625,"string":"2.5625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"format('Y-m-d').\"' >= tb_expense.From\n AND '\".$Ngay_hom_nay->format('Y-m-d').\"' <= tb_expense.To\";\n}\n$sql .= \" ORDER BY ID DESC\n Limit 10\";\n$result = DB_run_query($sql);\nif ($result->num_rows > 0){\n\n ?>\n \n \n \n \n \n \n \n \n \n \n \n \n \n fetch_assoc()) {\n?>\n \n \n \n \n \n \n \n \n \n\n\n \n \n \n
TenAmountFromTo
format(\"d M Y\"); ?>format(\"d M Y\");?>
\n \n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":815,"cells":{"blob_id":{"kind":"string","value":"b74f52938938375e5c9bcb9dff43cc2e980b1bcd"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"TimeToogo/Pinq"},"path":{"kind":"string","value":"/Source/ITraversable.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":8710,"string":"8,710"},"score":{"kind":"number","value":3.109375,"string":"3.109375"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"\n */\ninterface ITraversable extends IAggregatable, \\IteratorAggregate, \\ArrayAccess\n{\n const ITRAVERSABLE_TYPE = __CLASS__;\n\n /**\n * Returns the values as an array.\n * Only valid array keys (strings or integers) will be used,\n * all others will be reindexed numerically.\n *\n * @return array\n */\n public function asArray();\n\n /**\n * Returns the values as a traversable.\n * The following queries will be performed in memory.\n *\n * @return ITraversable\n */\n public function asTraversable();\n\n /**\n * Returns the values as a collection.\n * The following queries will be performed in memory.\n *\n * @return ICollection\n */\n public function asCollection();\n\n /**\n * Returns whether the traversable is the source of the elements.\n *\n * @return boolean\n */\n public function isSource();\n\n /**\n * Returns the source traversable or itself if the current traversable\n * is the source.\n *\n * @return ITraversable\n */\n public function getSource();\n\n /**\n * Iterates the elements with the supplied function.\n * Returning false will break the iteration loop.\n *\n * @param callable $function The iteration function, parameters are passed as ($value, $key)\n *\n * @return void\n */\n public function iterate(callable $function);\n\n /**\n * Returns an array compatible iterator for the elements.\n * Non string or integer keys will be numerically reindexed.\n *\n * @return \\Traversable\n */\n public function getIterator(): \\Traversable;\n\n /**\n * Returns an iterator for all the elements.\n * All keys types will remain unaltered.\n *\n * @return \\Traversable\n */\n public function getTrueIterator();\n\n /**\n * Returns the underlying iterator scheme used by the implementation.\n *\n * @return IIteratorScheme\n */\n public function getIteratorScheme();\n\n /**\n * Returns the first value, null if empty\n *\n * @return mixed The first value\n */\n public function first();\n\n /**\n * Returns the last value, null if empty\n *\n * @return mixed The last value\n */\n public function last();\n\n /**\n * Returns whether the supplied value is contained within the aggregate\n *\n * @param mixed $value The value to check for\n *\n * @return boolean\n */\n public function contains($value);\n\n /**\n * Filters the values by a supplied predicate.\n *\n * @param callable $predicate The predicate function\n *\n * @return ITraversable\n */\n public function where(callable $predicate);\n\n /**\n * Orders the values mapped from the supplied function according the supplied\n * direction.\n *\n * @param callable $function The projection function\n * @param int $direction\n *\n * @return IOrderedTraversable\n */\n public function orderBy(callable $function, $direction);\n\n /**\n * Orders the values mapped from the supplied function ascendingly\n * Example function:\n *\n * @param callable $function The mapping function\n *\n * @return IOrderedTraversable\n */\n public function orderByAscending(callable $function);\n\n /**\n * Orders the values mapped from the supplied function descendingly\n * Example expression function:\n *\n * @param callable $function The mapping function\n *\n * @return IOrderedTraversable\n */\n public function orderByDescending(callable $function);\n\n /**\n * Skip the amount of values from the start.\n *\n * @param int $amount The amount of values to skip, must be > 0\n *\n * @return ITraversable\n */\n public function skip($amount);\n\n /**\n * Limits the amount of values by the supplied amount\n *\n * @param int|null $amount The amount of values to retrieve, must be > 0 or null if all\n *\n * @return ITraversable\n */\n public function take($amount);\n\n /**\n * Retrieve a slice of the values.\n *\n * @param int $start The amount of values to skip\n * @param int|null $amount The amount of values to retrieve\n *\n * @return ITraversable\n */\n public function slice($start, $amount);\n\n /**\n * Index the values according to the supplied mapping function.\n * All duplicate indexes will be associated with the first value\n * for that index.\n *\n * @param callable $function The projection function\n *\n * @return ITraversable\n */\n public function indexBy(callable $function);\n\n /**\n * Selects the keys as the values (indexed by their 0-based position).\n *\n * @return ITraversable\n */\n public function keys();\n\n /**\n * Indexes the values by their 0-based position.\n *\n * @return ITraversable\n */\n public function reindex();\n\n /**\n * Groups values according the supplied function. (Uses strict equality '===')\n * The values will be grouped into instances of the traversable.\n * This will implicitly index each group by the group key returned from the supplied function.\n *\n * @param callable $function The grouping function\n *\n * @return ITraversable\n */\n public function groupBy(callable $function);\n\n /**\n * Matches the values with the supplied values according to the supplied filter\n * then maps the results into as according to the supplied function.\n *\n * @param array|\\Traversable $values\n *\n * @return IJoiningOnTraversable\n */\n public function join($values);\n\n /**\n * Matches the values with the supplied values according to the supplied filter,\n * groups the the joined values for every original and then maps into as\n * according to the supplied function.\n *\n * @param array|\\Traversable $values\n *\n * @return IJoiningOnTraversable\n */\n public function groupJoin($values);\n\n /**\n * Returns the values mapped by the supplied function.\n *\n * @param callable $function The function returning the data to select\n *\n * @return ITraversable\n */\n public function select(callable $function);\n\n /**\n * Returns the values mapped by the supplied function and then flattens\n * the values into a single traversable. Keys will be reindexed.\n *\n * @param callable $function The function returning the data to select\n *\n * @return ITraversable\n */\n public function selectMany(callable $function);\n\n /**\n * Only return unique values. (Uses strict equality '===')\n *\n * @return ITraversable\n */\n public function unique();\n\n /**\n * Returns values from the original and supplied values, keys will be reindexed.\n *\n * @param array|\\Traversable $values The values to append\n *\n * @return ITraversable\n */\n public function append($values);\n\n /**\n * Returns all values from the original present in the supplied values.\n * (Uses strict equality '===')\n *\n * @param array|\\Traversable $values\n *\n * @return ITraversable\n */\n public function whereIn($values);\n\n /**\n * Returns values all values from the original not present in the supplied values.\n * (Uses strict equality '===')\n *\n * @param array|\\Traversable $values The values to union\n *\n * @return ITraversable\n */\n public function except($values);\n\n /**\n * Returns unique results present in both the original and supplied values,\n * keys will be reindexed.\n * (Uses strict equality '===')\n *\n * @param array|\\Traversable $values The values to union\n *\n * @return ITraversable\n */\n public function union($values);\n\n /**\n * Returns unique values the are present in the original and supplied values.\n * (Uses strict equality '===')\n *\n * @param array|\\Traversable $values The values to intersect with\n *\n * @return ITraversable\n */\n public function intersect($values);\n\n /**\n * Returns unique values from the original not present in the supplied values.\n * (Uses strict equality '===')\n *\n * @param array|\\Traversable $values The values to remove\n *\n * @return ITraversable\n */\n public function difference($values);\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":816,"cells":{"blob_id":{"kind":"string","value":"4ea0d63399419543311dfde0c6731f5712385270"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"lammspace/SpaceAPI-WP"},"path":{"kind":"string","value":"/admin/class-spaceapi-wp-admin.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":6839,"string":"6,839"},"score":{"kind":"number","value":2.65625,"string":"2.65625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"\n */\nclass SpaceAPI_WP_Admin {\n\n\t/**\n\t * The ID of this plugin.\n\t *\n\t * @since 0.1\n\t * @access private\n\t * @var string $plugin_name The ID of this plugin.\n\t */\n\tprivate $plugin_name;\n\n\t/**\n\t * The version of this plugin.\n\t *\n\t * @since 0.1\n\t * @access private\n\t * @var string $version The current version of this plugin.\n\t */\n\tprivate $version;\n\n\t/**\n\t * The Settings Page ID.\n\t *\n\t * @since 0.1\n\t * @access private\n\t * @var string $settings_page The Settings Page ID.\n\t */\n\tprivate $settings_page;\n\n\t/**\n\t * The Settings Section ID.\n\t *\n\t * @since 0.1\n\t * @access private\n\t * @var string $settings_section The Settings Section ID.\n\t */\n\tprivate $settings_section;\n\n\t/**\n\t * The Settings Section array of options.\n\t *\n\t * @since 0.1\n\t * @access private\n\t * @var string $settings_section The Settings Section array of options.\n\t */\n\tprivate $settings_section_options;\n\t\n\t/**\n\t * Gets the WP Option name\n\t * \n\t * @since 0.1\n\t * @param string $option The name of the option\n\t */\n\tprivate function get_option_name($option) {\n\t\tif ( isset( $this->settings_section_options[$option] ) ) {\n\t\t\treturn $this->settings_section.'-'.$this->settings_section_options[$option]['name'];\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}\n\n\t/**\n\t * Gets the WP Option value\n\t * \n\t * @since 0.1\n\t * @param string $option The name of the option\n\t */\n\tprivate function get_option($option) {\n\t\tif ( isset( $this->settings_section_options[$option] ) ) {\n\t\t\t$name = $this->settings_section.'-'.$this->settings_section_options[$option]['name'];\n\t\t\treturn esc_attr( get_option( $name ) );\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}\n\n\t/**\n\t * Initialize the class and set its properties.\n\t *\n\t * @since 0.1\n\t * @param string $plugin_name The name of this plugin.\n\t * @param string $version The version of this plugin.\n\t */\n\tpublic function __construct( $plugin_name, $version, $settings_page, $settings_section, $settings_section_options ) {\n\n\t\t$this->plugin_name = $plugin_name;\n\t\t$this->version = $version;\n\t\t$this->settings_page = $settings_page;\n\t\t$this->settings_section = $settings_section;\n\t\t$this->settings_section_options = $settings_section_options;\n\t\t\n\t}\n\n\t/**\n\t * Admin init\n\t * \n\t * @since 0.1\n\t */\n\tpublic function admin_init() {\n\t\t// Ad a Settings section that goes with the above page\n\t\tadd_settings_section(\n\t\t\t$this->settings_section,\n\t\t\t'SpaceAPI for WordPress Settings',\n\t\t\tarray($this, 'settings_section'),\n\t\t\t$this->settings_page\n\t\t);\n\t\tforeach ( $this->settings_section_options as $key => $option) {\n\t\t\tadd_settings_field(\n\t\t\t\t$this->get_option_name($key),\n\t\t\t\t$option['label'],\n\t\t\t\tarray($this, $option['function']),\n\t\t\t\t$this->settings_page,\n\t\t\t\t$this->settings_section,\n\t\t\t\tarray(\n\t\t\t\t\t'label_for'=>$this->get_option_name($key)\n\t\t\t\t)\n\t\t\t);\n\t\t\tregister_setting(\n\t\t\t\t$this->settings_section,\n\t\t\t\t$this->get_option_name($key)\n\t\t\t);\n\t\t}\n\t}\n\n\n\t/**\n\t * Admin menu\n\t * \n\t * @since 0.1\n\t */\n\tpublic function admin_menu() {\n\t\t// Add a custom Menu and Page to the top level menu\n\t\tadd_menu_page(\n\t\t\t'Space API Settings',\n\t\t\t'Space API',\n\t\t\t'manage_options',\n\t\t\t$this->settings_page,\n\t\t\tarray($this,'render_menu_page'),\n\t\t\t'dashicons-admin-plugins',\n\t\t\t'67'\n\t\t);\n\t}\n\t\n\t/**\n\t * Settings Section callback\n\t * \n\t * @since 0.1\n\t */\n\tpublic function settings_section() {\n\t\techo \"

SpaceAPI Settings Section

\";\n\t}\n\n\t/**\n\t * Using this magic methods to use an array with all the options\n\t * \n\t * @since 0.1\n\t * @param string $name Name of the method\n\t * @param mixed $arguments Params for the method\n\t */\n\tpublic function __call($name, $arguments) {\n\t\tforeach ( $this->settings_section_options as $key => $option) {\n\t\t\tif ( 'settings_'.$option['name'] == $name ) {\n\t\t\t\t$name = $this->get_option_name( $key );\n\t\t\t\t$option = $this->get_option($key);\n\t\t\t\techo \"\";\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Menu rendering method\n\t * \n\t * @since 0.1\n\t */\n\tpublic function render_menu_page() {\n if ( ! isset( $_REQUEST['settings-updated'] ) )\n $_REQUEST['settings-updated'] = false;\n?>\n
\n\t\n\t

plugin_name ); ?>

\n\t\n

\n
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\tsettings_section ); ?>\n\t\t\t\t\t\t\n\t\t\t\t\t\tsettings_page, $this->settings_section );\t?>\n\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
\n
\nplugin_name, plugin_dir_url( __FILE__ ) . 'css/spaceapi-wp-admin.css', array(), $this->version, 'all' );\n\n\t}\n\n\t/**\n\t * Register the JavaScript for the admin area.\n\t *\n\t * @since 0.1\n\t */\n\tpublic function enqueue_scripts() {\n\n\t\t/**\n\t\t * This function is provided for demonstration purposes only.\n\t\t *\n\t\t * An instance of this class should be passed to the run() function\n\t\t * defined in SpaceAPI_WP_Loader as all of the hooks are defined\n\t\t * in that particular class.\n\t\t *\n\t\t * The SpaceAPI_WP_Loader will then create the relationship\n\t\t * between the defined hooks and the functions defined in this\n\t\t * class.\n\t\t */\n\n\t\twp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/spaceapi-wp-admin.js', array( 'jquery' ), $this->version, false );\n\n\t}\n\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":817,"cells":{"blob_id":{"kind":"string","value":"2ee504e1692cf669a66748e44e9fb9ae8f26dd37"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"laureano59/alphanotarial"},"path":{"kind":"string","value":"/public/assets/images/camino/core/models/class.Acceso.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":3333,"string":"3,333"},"score":{"kind":"number","value":2.953125,"string":"2.953125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"=0; $x--) {\n $result .= $string{$x};\n\t\t}\n\t\t$result = md5($result);\n\t\treturn $result;\n\t}\n\n public function Login() {\n try {\n if(!empty($_POST['usuario']) and !empty($_POST['pass']) and !empty($_POST['session'])) {\n require_once(\"core/models/class.Consultas.php\");\n \t\t$db = new Consultas();\n \t\t$this->usuario = $_POST['usuario'];\n \t\t$this->pass = $this->Encrypt($_POST['pass']);\n \t\t$sql = $db->getUsers($this->usuario, $this->pass);\n\n if($sql){\n $online = time() + (60*5);\n \t\t\t$id = $sql['id'];\n \t\t\t$_SESSION['id'] = $id;\n \t\t\t$_SESSION['usuario'] = $sql['usuario'];\n \t\t\t$_SESSION['email'] = $sql['email'];\n $_SESSION['admin'] = $sql['admin'];\n \t\t\t//$_SESSION['nombre'] = $sql['nombre'];\n \t\t\t//$_SESSION['apellido'] = $sql['apellido'];\n \t\t\t//$_SESSION['fecha'] = $sql['fecha'];\n \t\t\t//$_SESSION['cambio'] = $sql['cambio'];\n \t\t\t//$_SESSION['ext'] = $sql['ext'];\n \t\t\t//$_SESSION['online'] = $online;\n \t\t\t//$db->update_session($id, $online);\n\t\t\t\t\t/*-------Le damos el tiempo que durará la sessión en este caso dos días-----*/\n\n\t\t\t\t\tif($_POST['session'] == true) {\n ini_set('session.cookie_lifetime', time() + (60*60*24*2));\n\t\t\t\t\t}\n echo 1;\n\n\t\t\t\t}else{\n throw new Exception(2);\n\t\t\t\t\t}\n\t }else{\n throw new exception('Error: datos vacíos');//solo se cumple cuando alguien no mande los datos por ajax, es decir cuando bugean el código fuente.\n }\n }catch(Exception $login){\n echo $login->getMessage();\n }\n }\n\n public function Registrar(){\n try {\n if(!empty($_POST['usuario']) and !empty($_POST['pass']) and !empty($_POST['email'])){\n require_once(\"core/models/class.Consultas.php\");\n\t\t\t\t$db = new Consultas();\n\t\t\t\t$this->usuario = $_POST['usuario'];\n\t\t\t\t$this->pass = $this->Encrypt($_POST['pass']);\n\t\t\t\t$this->email = $_POST['email'];\n\t\t\t\t$sql = $db->getUsers2($this->usuario, $this->email);\n\t\t\t\tif(!$sql){\n $online = time() + (60*5);\n\t\t\t\t\t$db->inserta_usuarios($this->usuario, $this->pass, $this->email, $online);\n\t\t\t\t\t$sql2 = $db->MaxId();\n\t\t\t\t\t$id = $sql2['id'];\n\t\t\t\t\t$_SESSION['id'] = $id['0'];\n\t\t\t\t\t$_SESSION['usuario'] = $this->usuario;\n\t\t\t\t\t$_SESSION['email'] = $this->email;\n $_SESSION['admin'] = $sql['admin'];\n\t\t\t\t\t//$_SESSION['nombre'] = '';\n\t\t\t\t\t//$_SESSION['apellido'] = '';\n\t\t\t\t\t//$_SESSION['fecha'] = ''; //date('d-m-Y',time());\n\t\t\t\t\t//$_SESSION['cambio'] = 0;\n\t\t\t\t\t//$_SESSION['ext'] = 'jpg';\n\t\t\t\t\t$_SESSION['online'] = $online;\n\t\t\t\t\techo 1;\n\t\t\t\t}else{\n if(strtolower($this->usuario)== strtolower($sql['usuario'])){\n throw new Exception(2);//ya exixte el usuario\n\t\t\t\t\t}else{\n throw new Exception(3);//ya exixte el email\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n }else{\n throw new exception('Error: datos vacíos');//solo se cumple cuando alguien no mande los datos por ajax, es decir cuando bugean el código fuente.\n }\n }catch(Exception $reg){\n echo $reg->getMessage();\n }\n }\n}\n\n\n?>\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":818,"cells":{"blob_id":{"kind":"string","value":"3a5c567089b400af81a10666b361eeae0a9f25b7"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"axex/kratos"},"path":{"kind":"string","value":"/app/Helper/functions.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":2779,"string":"2,779"},"score":{"kind":"number","value":2.59375,"string":"2.59375"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":" 2) {\n\n // 二级链接\n // 如 kratos.com/dashboard/article 对应的路由别名是 dashboard.article.index, 所以碰到别名有 index 的要手动加上\n if ($routeArray[2] == 'index') {\n $route1 = $route;\n } else {\n // 三级链接\n $route1 = preg_replace('/[^\\.]*$/i', 'index', $route, 1);\n }\n\n if (Route::getRoutes()->hasNamedRoute($route1)) {\n return route($route1);\n }\n\n return route($route);\n }\n return route($route);\n\n }\n}\n\nif (! function_exists('tap')) {\n /**\n * 5.3 版本提供的方法, 链式调用时动态加入查询语句\n * Call the given Closure with the given value then return the value.\n *\n * @param mixed $value\n * @param callable $callback\n * @return mixed\n */\n function tap($value, $callback)\n {\n $callback($value);\n\n return $value;\n }\n}\n\nif (! function_exists('writeToSystemLog')) {\n\n /**\n * 写入系统日志\n *\n * @param $log\n * @return bool\n */\n function writeToSystemLog($log) {\n if (is_array($log) && array_key_exists('content', $log)) { // 操作内容不存在则不写入\n $log = array_add($log, 'user_id', 0);\n $log = array_add($log, 'operator_ip', Request::getClientIp()); //操作者ip\n SystemLog::create($log);\n return true;\n }\n return false;\n }\n}\n\nif (! function_exists('getVerifyCode')) {\n\n /**\n * 获取激活码\n *\n * @return string\n */\n function getVerifyCode()\n {\n return str_random(48);\n }\n}\n\nif (! function_exists('getPerPageRows')) {\n\n /**\n * @return mixed\n */\n function getPerPageRows()\n {\n $setting = \\Cache::rememberForever('systemSetting', function () {\n return (object) SystemSetting::first()->toArray();\n });\n\n return $setting->page_size;\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":819,"cells":{"blob_id":{"kind":"string","value":"6db6bdaee4d21b9486104f65d4a73df6854cb14b"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"itk-dev/serviceplatformen"},"path":{"kind":"string","value":"/generated-classes/ItkDev/Serviceplatformen/SF1600/EnumType/KvitteringsTypeKodeType.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":993,"string":"993"},"score":{"kind":"number","value":2.609375,"string":"2.609375"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"\n\n\n\n\n\nRegistration\n\n\n\n\n\n 0){\n\t\techo \"There is already an existing Research.\";\n\t\techo \"
View Research\";\n\t\techo \"
Back\";\n\t}\n // If form submitted, insert values into the database.\n else if (isset($_POST['research'])){\n\n\t\t$research = $_POST['research'];\n $researchtype = $_POST['researchtype'];\n $schoolyear = $_POST['schoolyear'];\n $semester = $_POST['semester'];\n $facultyId = $_POST['adviser'];\n\n\t\t$research = stripslashes($research);\n $research = mysql_real_escape_string($research);\n\n $researchtype = stripslashes($researchtype);\n $researchtype = mysql_real_escape_string($researchtype);\n\n $schoolyear = stripslashes($schoolyear);\n $schoolyear = mysql_real_escape_string($schoolyear);\n\n $semester = stripslashes($semester);\n $semester = mysql_real_escape_string($semester);\n\n $facultyId = stripslashes($facultyId);\n $facultyId = mysql_real_escape_string($facultyId);\n\n $userid = $_SESSION['userid'];\n\n $queryStudentNum = \"SELECT * FROM `users` WHERE user_id='$userid'\";\n \t$resultStudentNum = mysql_query($queryStudentNum) or die(mysql_error());\n \t\t$rows = mysql_num_rows($resultStudentNum);\n \t\t\n \t\twhile ($row = mysql_fetch_array($resultStudentNum)) \n \t\t{\n \t\t\t$student_no = $row['student_no']; \n \t\t}\n\t\t\n $queryInsert = \"INSERT into `researches` (\n\t\t\t\tresearch_title, \n\t\t\t\tresearch_type, \n\t\t\t\tschool_year, \n\t\t\t\tsem_type,\n faculty_id, \n\t\t\t\tstudent_no\n\t\t\t\t) VALUES (\n\t\t\t\t'$research', \n\t\t\t\t'$researchtype', \n\t\t\t\t'$schoolyear', \n\t\t\t\t'$semester', \n '$facultyId',\n\t\t\t\t'$student_no')\";\n $resultInsert = mysql_query($queryInsert);\n if($resultInsert){\n header(\"Location: http://\". $_SERVER['SERVER_NAME'] .\"/dashboard_student/view_research.php\");\n }else{\n \techo mysql_error();\n }\n }else{\n?>\n\n
\n

Register your Research

\n
\n

\n

\n 0){\n\t\t\techo \"
\";\n\t\t}\n\n\t\t\techo \"

\";\n?>\n

\n\n
\nBack
\";?>\n\n\n\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":821,"cells":{"blob_id":{"kind":"string","value":"ef1b7b5de5523b89e8e09c8c955405a879e6c0bb"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"KiranBendkoli1/blood-bank-management-system"},"path":{"kind":"string","value":"/checkadmin.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":759,"string":"759"},"score":{"kind":"number","value":2.5625,"string":"2.5625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"= 1){\n $_SESSION['login'] = $row['admin_id'];\n $_SESSION['fname'] = $row['fname'];\n $_SESSION['lname'] = $row['lname'];\n\n echo 'true';\n \n}\nelse{\n echo 'false';\n}\n\n\n?>"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":822,"cells":{"blob_id":{"kind":"string","value":"638482fac495c46bdf39709e4922bd12c966cd35"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"dav3loper/siesta"},"path":{"kind":"string","value":"/application/movie/usecases/response/ObtainMovieResponse.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1053,"string":"1,053"},"score":{"kind":"number","value":3,"string":"3"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"_movie;\n }\n\n /**\n * @param Movie $movie\n */\n public function setMovie(Movie $movie): void\n {\n $this->_movie = $movie;\n }\n\n /**\n * @return User[]\n */\n public function getUserList()\n {\n return $this->_userList;\n }\n\n /**\n * @param User[] $userList\n */\n public function setUserList(array $userList): void\n {\n $this->_userList = $userList;\n }\n\n public function setRemaining(int $remainingMovies)\n {\n $this->remaining = $remainingMovies;\n }\n\n /**\n * @return int\n */\n public function getRemaining(): int\n {\n return $this->remaining;\n }\n\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":823,"cells":{"blob_id":{"kind":"string","value":"911ca22c8e51dc546d14d2c9dd72c02b8dc9181d"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"lishu1994/SVH5"},"path":{"kind":"string","value":"/php/Dao/SqlDao.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":2581,"string":"2,581"},"score":{"kind":"number","value":2.96875,"string":"2.96875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"sql = new Model();\r\n }\r\n\r\n public function getById($table=\"\",$id=\"\"){\r\n $this->str = \"Select * from `\".$table.\"` WHERE `id`={$id} \";\r\n $list = $this->sql->query($this->str);\r\n if(!$list)\r\n return null;\r\n return $list[0];\r\n }\r\n\r\n public function select($table=\"\",$where=\"\",$limit=\"\",$orderby=\"\"){\r\n $this->str = \"Select * from `\".$table.\"` WHERE 1=1 and \".$where.\" \".($orderby==\"\"?\"ORDER BY `id` desc \":$orderby).$limit;\r\n $list = $this->sql->query($this->str);\r\n return $list;\r\n }\r\n\r\n public function count($table=\"\",$where=\"\"){\r\n $this->str = \"Select count(1) from `\".$table.\"` WHERE 1=1 and \".$where;\r\n $count = $this->sql->getField($this->str);\r\n return $count;\r\n }\r\n\r\n public function update($table=\"\",$where=\"\",$model = array()){\r\n $set = \"\";\r\n foreach($model as $key=>$val){\r\n $set .=\"`\".$key.\"`='\".$val.\"' ,\";\r\n }\r\n $set = substr($set,0,strlen($set)-1);\r\n $this->str = \"UPDATE `\".$table.\"` SET \".$set.\"WHERE 1=1 AND \".$where;\r\n $ret = $this->sql->execute($this->str);\r\n return $ret;\r\n }\r\n\r\n /**\r\n * @param string $table\r\n * @param array $model\r\n * @return int\r\n */\r\n public function insert($table=\"\", $model = array()){\r\n $keys = \"\";\r\n $vals = \"\";\r\n foreach($model as $key=>$val){\r\n if ($key=='id'){\r\n continue;\r\n }\r\n $keys.=\"`\".$key.\"`,\";\r\n if($val===null){\r\n $vals.= \"null,\";\r\n }else{\r\n $vals.=\"'\".$val.\"',\";\r\n }\r\n\r\n }\r\n $keys = substr($keys,0,strlen($keys)-1);\r\n $vals = substr($vals,0,strlen($vals)-1);\r\n $this->str = \"INSERT INTO `\".$table.\"`(\".$keys .\")VALUES(\".$vals.\")\";\r\n $ret = $this->sql->execute($this->str);\r\n return $this->sql->getLastInsID();\r\n }\r\n\r\n public function getQuery($str = \"\"){\r\n if($str==\"\"){\r\n return null;\r\n }\r\n $this->str=$str;\r\n $ret = $this->sql->query($this->str);\r\n return $ret;\r\n }\r\n\r\n public function delete($table=\"\",$id){\r\n $this->str=\"DELETE FROM `\".$table.\"` WHERE `id`=\".$id;\r\n $ret = $this->sql->execute($this->str);\r\n return $ret;\r\n }\r\n}"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":824,"cells":{"blob_id":{"kind":"string","value":"9c9751346164ec8209d1e9751f099293f9c0807e"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"Coquevas/PocketPriorityTags"},"path":{"kind":"string","value":"/src/Pocket/PriorityTags.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":8705,"string":"8,705"},"score":{"kind":"number","value":2.734375,"string":"2.734375"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"curl = $curl;\n $this->debug = $debug;\n $this->dryRun = $dryRun;\n $this->silent = $silent;\n $this->pocket = $pocket;\n $this->resolver = $resolver;\n\n $this->initResolver();\n }\n\n public function run()\n {\n $readingList = $this->retrieveReadingList();\n $ratedList = $this->computeSocialRating($readingList);\n $ratedList = $this->sortByRating($ratedList);\n $this->updatePriorityTags($ratedList);\n }\n\n private function getTagsByPartialName($haystack, $needle)\n {\n $foundTags = array();\n\n foreach ($haystack as $tagItem) {\n $pos = strpos($tagItem->tag, $needle);\n if ($pos !== false) {\n $foundTags[] = $tagItem->tag;\n }\n }\n\n return $foundTags;\n }\n\n private function toReadableNumber($n, $precision = 0)\n {\n if ($n < 1000) {\n // Anything less than a thousand\n $formattedNumber = number_format(floor($n / self::TAG_MIN_RATING) * self::TAG_MIN_RATING, $precision);\n } elseif ($n < 1000000) {\n // Anything less than a million\n $formattedNumber = number_format($n / 1000, $precision) . 'K';\n } elseif ($n < 1000000000) {\n // Anything less than a billion\n $formattedNumber = number_format($n / 1000000, $precision) . 'M';\n } else {\n // At least a billion\n $formattedNumber = number_format($n / 1000000000, $precision) . 'B';\n }\n\n return $formattedNumber;\n }\n\n private function initResolver()\n {\n // Identify your crawler (otherwise the default will be used)\n $this->resolver->setUserAgent('Mozilla/5.0 (compatible; PocketPriorityTags/1.0; +http://getpocket.com/)');\n\n // Designate a temporary file that will store cookies during the session.\n // Some web sites test the browser for cookie support, so this enhances results.\n $this->resolver->setCookieJar('/tmp/url_resolver.cookies', true);\n }\n\n /**\n * @param array $ratedList\n * @return array\n */\n private function sortByRating(Array $ratedList)\n {\n usort($ratedList, array($this, 'compareItems'));\n return $ratedList;\n }\n\n /**\n * @param array $a\n * @param array $b\n * @return int Must be less than, equal to, or greater than zero if the first argument is considered to be\n * respectively less than, equal to, or greater than the second.\n */\n private function compareItems($a, $b)\n {\n if ($a['rating'] > $b['rating']) {\n return -1;\n } else {\n if ($a['rating'] < $b['rating']) {\n return 1;\n }\n }\n return 0;\n }\n\n private function retrieveReadingList()\n {\n if (!$this->silent) $progressBar = new Bar('Downloading reading list', self::TAG_MIN_RATING);\n if (!$this->silent) $progressBar->tick();\n // TODO: Change pockpak to use the CURLOPT_NOPROGRESS support (and pull request)\n // TODO: Local cache and request only changes since the last OK timestamp\n $options = array('detailType' => 'complete');\n if ($this->debug) {\n $options['count'] = self::DEBUG_MAX_ITEMS;\n }\n $apiResponse = $this->pocket->retrieve($options);\n if (!$this->silent) $progressBar->finish();\n\n if ($this->debug) {\n var_dump($apiResponse->list);\n }\n\n return $apiResponse->list;\n }\n\n /**\n * @param $readingList\n * @return array\n */\n private function computeSocialRating($readingList)\n {\n if (!$this->silent) $progressBar = new Bar('Getting social relevance', count(get_object_vars($readingList)));\n $ratedList = array();\n\n foreach ($readingList as $savedLink) {\n if ($this->debug) {\n var_dump($savedLink);\n }\n\n if (!$this->silent) $progressBar->tick();\n\n $pocketResolvedUrl = isset($savedLink->resolved_url) ? : $savedLink->given_url;\n $givenUrl = $savedLink->given_url;\n\n //TODO: Review. Too much value for different URLs\n if ($givenUrl != '') {\n $myResolvedUrl = $this->resolver->resolveURL($givenUrl)->getURL();\n if ($givenUrl == $pocketResolvedUrl && $givenUrl == $myResolvedUrl) {\n $rating = SocialCounters::getRelevance($givenUrl, $this->debug);\n } elseif ($givenUrl == $pocketResolvedUrl) {\n $rating = SocialCounters::getRelevance($givenUrl, $this->debug)\n + SocialCounters::getRelevance($myResolvedUrl, $this->debug);\n } elseif ($givenUrl == $myResolvedUrl) {\n $rating = SocialCounters::getRelevance($givenUrl, $this->debug)\n + SocialCounters::getRelevance($pocketResolvedUrl, $this->debug);\n } else {\n $rating = SocialCounters::getRelevance($givenUrl, $this->debug)\n + SocialCounters::getRelevance($pocketResolvedUrl, $this->debug)\n + SocialCounters::getRelevance($myResolvedUrl, $this->debug);\n }\n } else {\n $rating = 0;\n }\n\n $ratedList[] = array(\n 'rating' => $rating,\n 'item' => $savedLink,\n );\n }\n if (!$this->silent) $progressBar->finish();\n return $ratedList;\n }\n\n /**\n * @param $ratedList\n */\n private function updatePriorityTags($ratedList)\n {\n if ($this->debug) {\n var_dump($ratedList);\n }\n\n $actions = new PockpackQueue();\n $ratedListSize = count($ratedList);\n if (!$this->silent) $progressBar = new Bar(' Updating priority tags', $ratedListSize);\n\n for ($i = 0; $i < $ratedListSize; $i++) {\n if (!$this->silent) $progressBar->tick();\n $item = $ratedList[$i]['item'];\n $rating = $ratedList[$i]['rating'];\n if (isset($item->tags) && count($item->tags) > 0) {\n $tagsForDeletion = array_unique(\n array_merge(\n $this->getTagsByPartialName($item->tags, 'zz-score-'),\n $this->getTagsByPartialName($item->tags, 'zz-'),\n array('001', '010', '040')\n )\n );\n\n $actions->tags_remove(\n array(\n 'item_id' => $item->item_id,\n 'tags' => $tagsForDeletion,\n )\n );\n }\n\n $tags = array();\n if ($i < 1) {\n $tags = array('040', '010', '001');\n } elseif ($i < 10) {\n $tags = array('040', '010');\n } elseif ($i < 40) {\n $tags = array('040');\n }\n\n if ($rating >= self::TAG_MIN_RATING) {\n $tags[] = 'zz-' . $this->toReadableNumber($rating);\n }\n\n if (!empty($tags)) {\n $actions->tags_add(\n array(\n 'item_id' => $item->item_id,\n 'tags' => $tags,\n )\n );\n }\n\n $actionCount = count($actions->getActions());\n $shallSendActions = $actionCount >= 10 || (($i == $ratedListSize - 1) && ($actionCount > 0));\n if ($shallSendActions) {\n $apiResponse = '';\n\n if (!$this->dryRun) {\n $apiResponse = $this->pocket->send($actions);\n }\n\n if ($this->debug) {\n var_export($actions->getActions());\n var_export($apiResponse);\n }\n $actions->clear();\n }\n }\n if (!$this->silent) $progressBar->finish();\n }\n}"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":825,"cells":{"blob_id":{"kind":"string","value":"5bfab857ea8910c6e5082bcde5482dac3b2f0876"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"quark-dev/Via"},"path":{"kind":"string","value":"/src/RoutableInterface.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":262,"string":"262"},"score":{"kind":"number","value":2.578125,"string":"2.578125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"\n\nquery($sql) or die ($con->error);\n\n // Now let's move the uploaded image into the folder: upload\n if(move_uploaded_file($_FILES['featured_img']['tmp_name'], $target)) {\n $msg = \"Image uploaded successfully\";\n }else{\n $msg = \"There was a problem uploading image\";\n }\n\n\n $page = $_SERVER['REQUEST_URI'];\n echo '';\n\n\n\n}\n\n\n?>\n\n
\n
\n \"\"\n
\n
\n\n\n
\n \n \n \n\n\n\n\n\n
\n
\n
\n
\n
\n \n
\n \n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n\n\n\n\n\n\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":828,"cells":{"blob_id":{"kind":"string","value":"462e419d04a88ebfa531914ef0a151229b290903"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"rahulyhg/moneyzaurus-api"},"path":{"kind":"string","value":"/web/app/src/Service/User/Data.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":556,"string":"556"},"score":{"kind":"number","value":2.6875,"string":"2.6875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":" $username);\n\n return $this->getUser()->findOneBy($criteria);\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":829,"cells":{"blob_id":{"kind":"string","value":"22f041f36308e322ec79bfed6a21bc853c2cf1ca"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"lossendae/Previously-on"},"path":{"kind":"string","value":"/src/repositories/Eloquent/EloquentRepository.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1793,"string":"1,793"},"score":{"kind":"number","value":2.703125,"string":"2.703125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT","LicenseRef-scancode-unknown-license-reference"],"string":"[\n \"MIT\",\n \"LicenseRef-scancode-unknown-license-reference\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"\n*\n* For the full copyright and license information, please view the LICENSE\n* file that was distributed with this source code.\n*/\n\nnamespace Lossendae\\PreviouslyOn\\Repositories\\Eloquent;\n\nuse Illuminate\\Container\\Container;\n\n/**\n * Class EloquentRepository\n *\n * @package Lossendae\\PreviouslyOn\\Repositories\\Eloquent\n */\nabstract class EloquentRepository\n{\n /**\n * @var \\Illuminate\\Container\\Container\n */\n protected $app;\n\n /**\n * @var the model to use for query\n */\n protected $model;\n\n /**\n * @var string The namespaced model name specified in child classes\n */\n protected $modelClassName;\n\n /**\n * @param Container $app\n */\n function __construct(Container $app)\n {\n $this->app = $app;\n $this->model = $app[$this->modelClassName];\n }\n\n /**\n * @param array $attributes\n * @return mixed\n */\n public function create(array $attributes)\n {\n return $this->model->create($attributes);\n }\n\n /**\n * @param array $columns\n * @return mixed\n */\n public function all($columns = array('*'))\n {\n return $this->model->all($columns);\n }\n\n /**\n * @param $id\n * @param array $columns\n * @return mixed\n */\n public function find($id, $columns = array('*'))\n {\n return $this->model->find($id, $columns);\n }\n\n /**\n * @param $id\n * @param array $columns\n * @return mixed\n */\n public function findOrFail($id, $columns = array('*'))\n {\n return $this->model->findOrFail($id, $columns);\n }\n\n /**\n * @return mixed\n */\n public function delete()\n {\n return $this->model->delete();\n }\n} \n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":830,"cells":{"blob_id":{"kind":"string","value":"bacc5a867ca9917ac094fbd09e9ba3b761334794"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"zjhczl/myWork"},"path":{"kind":"string","value":"/past/cd/includes/pdo.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":364,"string":"364"},"score":{"kind":"number","value":2.796875,"string":"2.796875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["Apache-2.0"],"string":"[\n \"Apache-2.0\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"\n\n\n \n\tpdo.php\n\n\n query('set names utf8');\n }\n catch(PDOException $e)\n {\n \t$output='连接不到sql服务器';\n \techo $output;\n \texit();\n }\n ?>\n\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":831,"cells":{"blob_id":{"kind":"string","value":"7580e7af3352b9737adf816a526b94df120fdde0"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"madkixt/portal-terintegrasi"},"path":{"kind":"string","value":"/protected/models/ExecForm.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1545,"string":"1,545"},"score":{"kind":"number","value":2.765625,"string":"2.765625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"name, $b->name);\r\n}\r\n\r\nfunction sortQuery($a, $b) {\r\n\treturn strcasecmp($a->title, $b->title);\r\n}\r\n\r\nclass ExecForm extends CFormModel {\r\n\tpublic $queryID;\r\n\tpublic $database;\r\n\tpublic $connection;\r\n\tpublic $queries;\r\n\r\n\t/*rules */\r\n\tpublic function rules()\r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray('database, connection','required'),\r\n\t\t//\tarray('database,mesin','authenticate'),\r\n\t\t);\r\n\t}\r\n\t\r\n\t/*relation*/\r\n\tpublic function relations()\r\n\t{\r\n\t\treturn array(\r\n\t\t\t'judulQuery'=>array(self::HAS_MANY,'ExecForm','queryID'),\r\n\t\t\t'connection'=>array(SELF::HAS_MANY,'ExecForm','ConnectionID'),\r\n\t\t);\r\n\t}\r\n\t\r\n\t/**\r\n\t * Declares attribute labels.\r\n\t */\r\n\tpublic function attributeLabels() {\r\n\t\treturn array(\r\n\t\t\t'queryID' => 'Query Title',\r\n\t\t\t'database' => 'Database',\r\n\t\t\t'mesin' => 'Connection'\r\n\t\t);\r\n\t}\r\n\t\r\n\t/*memeperoleh mesin*/\r\n\tpublic static function getConnection()\r\n\t{\r\n\t\t$user = User::model()->findByPk(Yii::app()->user->getId());\r\n\t\t$model = $user->tblConnections;\r\n\t\t\r\n\t\tuasort($model, \"sortConn\");\r\n\t\tif (Controller::isAdmin()) {\r\n\t\t\t$conn = new Connection;\r\n\t\t\t$conn->connectionID = 'other';\r\n\t\t\t$conn->IPAddress = 'New connection';\r\n\t\t\t$conn->username = '';\r\n\t\t\t$model[] = $conn;\r\n\t\t}\r\n\t\t\r\n\t\treturn CHtml::listData($model, 'connectionID', 'name');\r\n\t}\r\n\t\r\n\tpublic static function getJudul() {\r\n\t\t$user = User::model()->findByPk(Yii::app()->user->getId());\r\n\t\t$model = $user->tblQueries;\r\n\t\t\r\n\t\tuasort($model, \"sortQuery\");\r\n\t\treturn CHtml::listData($model, 'queryID', 'title');\r\n\t}\r\n}"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":832,"cells":{"blob_id":{"kind":"string","value":"43c73d9f4b0bdcd4b29fd380b89d5215acf3cb7d"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"atefBB/KeywordTracker"},"path":{"kind":"string","value":"/Classes/googleScraper.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":2028,"string":"2,028"},"score":{"kind":"number","value":2.640625,"string":"2.640625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["Apache-2.0"],"string":"[\n \"Apache-2.0\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":" 'google.com');\n\n static function scrape($keyword, $urlToSearch, $country = 'en', $resultsToFetch = 100) {\n $keyword = str_replace(\" \", \"+\", $keyword);\n try {\n $domain = self::$domains[$country];\n $url = 'https://www.' . $domain . '/search?num=' . $resultsToFetch . '&safe=off&site=&source=hp&q=' . $keyword;\n } catch (Exception $e) {\n echo \"Exception thrown:\" . $e->getMessage();\n die();\n }\n $agent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)';\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_VERBOSE, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_USERAGENT, $agent);\n curl_setopt($ch, CURLOPT_URL, $url);\n $html = curl_exec($ch);\n $dom = new DOMDocument();\n @$dom->loadHTML($html);\n\n// grab all the on the page\n $xpath = new DOMXPath($dom);\n $links = $xpath->query('//h3[@class=\"r\"]//a');\n\n $length = $links->length;\n $all_links = array();\n //echo $urlToSearch;\n //echo '
';\n for ($i = 0; $i < $length; $i++) {\n\n $element = $links->item($i);\n // echo $urlToSearch = preg_quote($urlToSearch);\n $resultUrl = $xpath->evaluate('@href', $element)->item(0)->value;\n // echo '
';\n if (!empty($urlToSearch)) {\n foreach ($urlToSearch as $u2s) {\n if (preg_match(\"#{$u2s}#i\", $resultUrl)) {\n return $i + 1;\n }\n }\n }\n }\n return 0;\n }\n\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":833,"cells":{"blob_id":{"kind":"string","value":"fa35dc9229558e576c25f1a648b53557fbecd14a"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"RomanSaulenko/shop"},"path":{"kind":"string","value":"/app/Services/OrderService.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1281,"string":"1,281"},"score":{"kind":"number","value":2.703125,"string":"2.703125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"repository = $repository;\n }\n\n /**\n * @param int $orderId\n * @return Order\n */\n public function getOrder(int $orderId)\n {\n return $this->repository->getOrder($orderId);\n }\n\n /**\n * @param $data\n * @return Order\n */\n public function store($data)\n {\n\n try {\n DB::beginTransaction();\n\n $order = new Order();\n\n $responses = event(new BeforeOrderStore($data));\n\n foreach ($responses as $response) {\n $order->fill($response);\n }\n $order->save();\n\n $order->products()->createMany($data['order_products']);\n\n event(new AfterOrderStore($order));\n\n DB::commit();\n\n } catch (Exception $exception) {\n DB::rollBack();\n throw $exception;\n }\n\n\n return $order;\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":834,"cells":{"blob_id":{"kind":"string","value":"a5a44ee3e112bb0e42ee44a2735bc709ce1f342b"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"Makhendra/training-simulator.site"},"path":{"kind":"string","value":"/app/Models/Family.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":743,"string":"743"},"score":{"kind":"number","value":2.640625,"string":"2.640625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":" Settings::MODE[ 'driving' ],\n 'units' => Settings::UNIT[ 'metric' ],\n 'language' => Settings::LANGUAGE\n ];\n /**\n * Human readable origin addresses\n * @var array\n */\n protected $origins = [];\n /**\n * Human readable destination addresses\n * @var array\n */\n protected $destinations = [];\n\n /**\n * DistanceMatrix constructor.\n * @param string|null $apiKey\n * @throws Exceptions\\NoApiKeyException\n */\n public function __construct( string $apiKey = null )\n {\n $this->client = \\curl_init();\n \\curl_setopt( $this->client, \\CURLOPT_RETURNTRANSFER, 1 );\n \\curl_setopt( $this->client, \\CURLOPT_TIMEOUT, 10 );\n\n if( $apiKey )\n $this->params[ 'key' ] = $apiKey;\n else\n throw new Exceptions\\NoApiKeyException();\n }\n\n /**\n * Requests the geo coordinates from Human readable addresses.\n * It will be useful to determine the distance between the user to a store, restaurant, shopping, service center, constrain a promotion physical reach...\n * @param array|null $origins Origins array\n * @param array|null $destinations Destinations array\n * @return array|null\n * @throws Exceptions\\AddressTypeException\n * @throws Exceptions\\DestinationsNotFoundException\n * @throws Exceptions\\OriginsNotFoundException\n */\n public function request( array $origins = null, array $destinations = null ): array\n {\n if( $origins )\n $this->addAddresses( $origins );\n\n if( $destinations )\n $this->addAddresses( $destinations, 'destinations' );\n\n $this->validate();\n\n $url = Settings::URL . \\http_build_query( $this->params );\n $url .= '&origins=' . $this->convertAddresses( $this->origins );\n $url .= '&destinations=' . $this->convertAddresses( $this->destinations );\n\n \\curl_setopt( $this->client, \\CURLOPT_URL, $url );\n $response = \\curl_exec( $this->client );\n\n return $this->getResponse( $response );\n }\n\n /**\n * Parses a json string response\n * @param string $response a json string response from gcp maps service\n * @return null|array returns an Array with distance and car travel duration time between origin and destination\n */\n public function getResponse( string $response ) : array\n {\n $result = null;\n $response = json_decode( $response );\n if( is_object( $response ) && $response->status === 'OK' ){\n $result = [];\n foreach( $response->rows as $row ){\n foreach ( $row->elements as $element ){\n if( $element->status === 'OK' ){\n $result[] = [ 'distance' => $element->distance->value, 'duration' => $element->duration->value ];\n }\n }\n }\n }\n\n return $result;\n }\n\n /**\n * simple validation\n * @todo implement a entity to specialize the validation methods\n * @throws Exceptions\\DestinationsNotFoundException\n * @throws Exceptions\\OriginsNotFoundException\n */\n protected function validate()\n {\n if( !$this->origins )\n throw new Exceptions\\OriginsNotFoundException;\n\n if( !$this->destinations )\n throw new Exceptions\\DestinationsNotFoundException;\n\n }\n\n /**\n * Add addresses to the origins and destinations parameters\n * @param array $addresses the addresses formatted according to the distance matrix documentation\n * @param string $type 'origins' or 'destinations', defaults to 'origins'\n * @return DistanceMatrix the object itself\n * @throws Exceptions\\AddressTypeException\n * @see https://developers.google.com/maps/documentation/distance-matrix/intro#DistanceMatrixRequests\n */\n public function addAddresses( array $addresses, $type = 'origins' ) : DistanceMatrix\n {\n if( !in_array( $type, ['destinations', 'origins' ] ) )\n throw new Exceptions\\AddressTypeException( \"The $type is not a valid address type\" );\n\n foreach( $addresses as $address ){\n if( !in_array( $address, $this->$type ) )\n $this->$type[] = $address;\n }\n return $this;\n }\n\n /**\n * helper method to deal with an array of addresses\n * @param array $addresses addresses that will be split by pipe \"|\" according to the api documentation\n * @return string the addresses separated by | if more than one address is provided\n * @see https://developers.google.com/maps/documentation/distance-matrix/overview#required-parameters\n */\n public function convertAddresses( array $addresses ): string\n {\n return urlencode( implode('|', $addresses ) );\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":836,"cells":{"blob_id":{"kind":"string","value":"c1836375f123f565d52e56b19e34870e5314b1c2"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"pillowinacoma/MandoMangi"},"path":{"kind":"string","value":"/functions.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":3266,"string":"3,266"},"score":{"kind":"number","value":2.625,"string":"2.625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"\n \n \\\"$titre\\\"\n

$titre

\n
\n

$pTitre

\n
\";\n }\n function createBlog($websiteUrl){\n $html = file_get_html($websiteUrl);\n $i = 0;\n echo \"
\\n\";\n foreach ($html->find('.postcard') as $postDiv) {\n if ($i%3 == 0 && $i >= 1 ) {\n echo \"\n
\n
\\n\";\n }\n foreach (\n $postDiv->find('.card__image') as $a) {\n $img = str_replace(array(\"background-image: url('\",\"')\"),array(\"\",\"\"),$a->getAttribute(\"style\",\"background-image\"));\n }\n foreach ($postDiv->find('.card__title') as $a) {\n $titre = $a->plaintext;\n $link = $a->first_child()->getAttribute(\"href\");\n }\n foreach ($postDiv->find('.posted-on') as $a) {\n $date = $a->pl;\n }\n foreach ($postDiv->find('.card__links li a ') as $a) {\n $categorie = $a->plaintext;\n }\n createBlogTbNl($titre,$categorie.\" \".$date,$img,$link);\n $i++;\n }\n echo \"
\\n\";\n foreach ($html->find(\".nav-previous\") as $key) {\n $lien = $key->firstChild()->getAttribute('href');\n echo \"\";\n }foreach ($html->find(\".nav-next\") as $key) {\n $lien = $key->firstChild()->getAttribute('href');\n echo \"\";\n }\n echo \"
\";\n }\n function createEventTbNl($titre,$description,$img,$link){\n echo\"
\n \n
\n

$titre

\n

$description

\n
\n
\";\n }\n function createEvent(){\n $files = scandir('articles/');\n echo \"
\\n\";\n for ($i=2; $i < sizeof($files); $i++) {\n if (($i-2)%4 == 0) {\n echo \"\n
\n
\\n\";\n }\n $fh = fopen('articles/'.$files[$i].'/registre.txt',\"r\");\n $tmp = explode(\"\\n\",fread($fh,filesize('articles/'.$files[$i].'/registre.txt')));\n $titre = $tmp[0];\n $pTitre = $tmp[1];\n fclose($fh);\n $img = glob('articles/'.$files[$i].'/1.*')[0];\n $link = 'articles/'.$files[$i].'/index.html.php';\n createBlogTbNl($titre,$pTitre,$img,$link);\n }\n echo \"
\";\n }\n?>\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":837,"cells":{"blob_id":{"kind":"string","value":"91fe322516ff59a238ef2efd64fb9489882ccdc8"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"merk/FOSMessageBundle"},"path":{"kind":"string","value":"/SpamDetection/SpamDetectorInterface.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":477,"string":"477"},"score":{"kind":"number","value":2.734375,"string":"2.734375"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"\n */\ninterface SpamDetectorInterface\n{\n /**\n * Tells whether or not a new message looks like spam\n *\n * @param NewThreadMessage $message\n * @return boolean true if it is spam, false otherwise\n */\n public function isSpam(NewThreadMessage $message);\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":838,"cells":{"blob_id":{"kind":"string","value":"99e3bb7b26946f11add3c000be92b2baa8fda922"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"xiko/livrariaRus"},"path":{"kind":"string","value":"/helpers/Logger.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1659,"string":"1,659"},"score":{"kind":"number","value":2.828125,"string":"2.828125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"\n */\nclass ITunesComponent extends Component {\n\n\t/**\n\t * Search URL\n\t *\n\t * @var string\n\t */\n\tconst SEARCH_URL = 'https://itunes.apple.com/search';\n\n\t/**\n\t * Lookup URL\n\t *\n\t * @var string\n\t */\n\tconst LOOKUP_URL = 'https://itunes.apple.com/lookup';\n\n\t/**\n\t * Search API method\n\t *\n\t * @param string $term\n\t * @param array $params\n\t * @return mixed\n\t */\n\tpublic function search($term, $params=array()) {\n\t\t$params['term'] = $term;\n\t\t$request = $this->_makeRequest(self::SEARCH_URL, $params);\n\t\tif (!$request) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$response = $this->_parseResponse($request->body);\n\t\treturn $response;\n\t}\n\n\t/**\n\t * Lookup API method\n\t *\n\t * @param array $params\n\t * @return mixed\n\t */\n\tpublic function lookup($params) {\n\t\t$request = $this->_makeRequest(self::LOOKUP_URL, $params);\n\t\tif (!$request) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$response = $this->_parseResponse($request->body);\n\t\treturn $response;\t\t\n\t}\n\n\t/**\n\t * Make a Request\n\t *\n\t * @param string $url\n\t * @param array $url\n\t */\n\tprotected function _makeRequest($url, $params) {\n\t\t$http = new HttpSocket();\n\t\treturn $http->get($url, http_build_query($params));\n\t}\n\n\t/**\n\t * Parse a Response\n\t *\n\t * @param string $body\n\t * @return array\n\t */\n\tprotected function _parseResponse($body) {\n\t\treturn (array) json_decode($body);\n\t}\n\n}"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":840,"cells":{"blob_id":{"kind":"string","value":"a5c2fc5e83c64595ba060afa4464bcf70ca42b8c"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"microsoftgraph/msgraph-beta-sdk-php"},"path":{"kind":"string","value":"/src/Generated/Models/DeviceManagementConfigurationSettingInstance.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":8447,"string":"8,447"},"score":{"kind":"number","value":2.71875,"string":"2.71875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"backingStore = BackingStoreFactorySingleton::getInstance()->createBackingStore();\n $this->setAdditionalData([]);\n }\n\n /**\n * Creates a new instance of the appropriate class based on discriminator value\n * @param ParseNode $parseNode The parse node to use to read the discriminator value and create the object\n * @return DeviceManagementConfigurationSettingInstance\n */\n public static function createFromDiscriminatorValue(ParseNode $parseNode): DeviceManagementConfigurationSettingInstance {\n $mappingValueNode = $parseNode->getChildNode(\"@odata.type\");\n if ($mappingValueNode !== null) {\n $mappingValue = $mappingValueNode->getStringValue();\n switch ($mappingValue) {\n case '#microsoft.graph.deviceManagementConfigurationChoiceSettingCollectionInstance': return new DeviceManagementConfigurationChoiceSettingCollectionInstance();\n case '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance': return new DeviceManagementConfigurationChoiceSettingInstance();\n case '#microsoft.graph.deviceManagementConfigurationGroupSettingCollectionInstance': return new DeviceManagementConfigurationGroupSettingCollectionInstance();\n case '#microsoft.graph.deviceManagementConfigurationGroupSettingInstance': return new DeviceManagementConfigurationGroupSettingInstance();\n case '#microsoft.graph.deviceManagementConfigurationSettingGroupCollectionInstance': return new DeviceManagementConfigurationSettingGroupCollectionInstance();\n case '#microsoft.graph.deviceManagementConfigurationSettingGroupInstance': return new DeviceManagementConfigurationSettingGroupInstance();\n case '#microsoft.graph.deviceManagementConfigurationSimpleSettingCollectionInstance': return new DeviceManagementConfigurationSimpleSettingCollectionInstance();\n case '#microsoft.graph.deviceManagementConfigurationSimpleSettingInstance': return new DeviceManagementConfigurationSimpleSettingInstance();\n }\n }\n return new DeviceManagementConfigurationSettingInstance();\n }\n\n /**\n * Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.\n * @return array|null\n */\n public function getAdditionalData(): ?array {\n $val = $this->getBackingStore()->get('additionalData');\n if (is_null($val) || is_array($val)) {\n /** @var array|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'additionalData'\");\n }\n\n /**\n * Gets the backingStore property value. Stores model information.\n * @return BackingStore\n */\n public function getBackingStore(): BackingStore {\n return $this->backingStore;\n }\n\n /**\n * The deserialization information for the current model\n * @return array\n */\n public function getFieldDeserializers(): array {\n $o = $this;\n return [\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'settingDefinitionId' => fn(ParseNode $n) => $o->setSettingDefinitionId($n->getStringValue()),\n 'settingInstanceTemplateReference' => fn(ParseNode $n) => $o->setSettingInstanceTemplateReference($n->getObjectValue([DeviceManagementConfigurationSettingInstanceTemplateReference::class, 'createFromDiscriminatorValue'])),\n ];\n }\n\n /**\n * Gets the @odata.type property value. The OdataType property\n * @return string|null\n */\n public function getOdataType(): ?string {\n $val = $this->getBackingStore()->get('odataType');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'odataType'\");\n }\n\n /**\n * Gets the settingDefinitionId property value. Setting Definition Id\n * @return string|null\n */\n public function getSettingDefinitionId(): ?string {\n $val = $this->getBackingStore()->get('settingDefinitionId');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'settingDefinitionId'\");\n }\n\n /**\n * Gets the settingInstanceTemplateReference property value. Setting Instance Template Reference\n * @return DeviceManagementConfigurationSettingInstanceTemplateReference|null\n */\n public function getSettingInstanceTemplateReference(): ?DeviceManagementConfigurationSettingInstanceTemplateReference {\n $val = $this->getBackingStore()->get('settingInstanceTemplateReference');\n if (is_null($val) || $val instanceof DeviceManagementConfigurationSettingInstanceTemplateReference) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'settingInstanceTemplateReference'\");\n }\n\n /**\n * Serializes information the current object\n * @param SerializationWriter $writer Serialization writer to use to serialize this model\n */\n public function serialize(SerializationWriter $writer): void {\n $writer->writeStringValue('@odata.type', $this->getOdataType());\n $writer->writeStringValue('settingDefinitionId', $this->getSettingDefinitionId());\n $writer->writeObjectValue('settingInstanceTemplateReference', $this->getSettingInstanceTemplateReference());\n $writer->writeAdditionalData($this->getAdditionalData());\n }\n\n /**\n * Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.\n * @param array $value Value to set for the additionalData property.\n */\n public function setAdditionalData(?array $value): void {\n $this->getBackingStore()->set('additionalData', $value);\n }\n\n /**\n * Sets the backingStore property value. Stores model information.\n * @param BackingStore $value Value to set for the backingStore property.\n */\n public function setBackingStore(BackingStore $value): void {\n $this->backingStore = $value;\n }\n\n /**\n * Sets the @odata.type property value. The OdataType property\n * @param string|null $value Value to set for the @odata.type property.\n */\n public function setOdataType(?string $value): void {\n $this->getBackingStore()->set('odataType', $value);\n }\n\n /**\n * Sets the settingDefinitionId property value. Setting Definition Id\n * @param string|null $value Value to set for the settingDefinitionId property.\n */\n public function setSettingDefinitionId(?string $value): void {\n $this->getBackingStore()->set('settingDefinitionId', $value);\n }\n\n /**\n * Sets the settingInstanceTemplateReference property value. Setting Instance Template Reference\n * @param DeviceManagementConfigurationSettingInstanceTemplateReference|null $value Value to set for the settingInstanceTemplateReference property.\n */\n public function setSettingInstanceTemplateReference(?DeviceManagementConfigurationSettingInstanceTemplateReference $value): void {\n $this->getBackingStore()->set('settingInstanceTemplateReference', $value);\n }\n\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":841,"cells":{"blob_id":{"kind":"string","value":"111db1ff742e8f742498793ef0b88b98eebd5b66"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"Focus43/tcap"},"path":{"kind":"string","value":"/web/packages/sequence/blocks/statistic/controller.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1639,"string":"1,639"},"score":{"kind":"number","value":2.53125,"string":"2.53125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"edit();\n }\n\n\n public function composer(){\n $this->edit();\n }\n\n\n public function edit(){\n $this->requireAsset('redactor');\n $this->requireAsset('core/file-manager');\n }\n\n\n public function _translateFromEditMode( $content ){\n return LinkAbstractor::translateFromEditMode($content);\n }\n\n\n public function _translateFrom( $content ){\n return LinkAbstractor::translateFrom($content);\n }\n\n\n public function save( $args ){\n $args['statDetails'] = LinkAbstractor::translateTo($args['statDetails']);\n parent::save($args);\n }\n\n }"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":842,"cells":{"blob_id":{"kind":"string","value":"da8fbcf13cadc0a2a89523944439495621570862"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"sfrizell/pennsouth-reports"},"path":{"kind":"string","value":"/src/Pennsouth/MdsBundle/Entity/AptResidentAttributes.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":8565,"string":"8,565"},"score":{"kind":"number","value":2.5625,"string":"2.5625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"building = $building;\n\n return $this;\n }\n\n /**\n * Get building\n *\n * @return string\n */\n public function getBuilding()\n {\n return $this->building;\n }\n\n /**\n * Set floorNumber\n *\n * @param integer $floorNumber\n *\n * @return AptResidentAttributes\n */\n public function setFloorNumber($floorNumber)\n {\n $this->floorNumber = $floorNumber;\n\n return $this;\n }\n\n /**\n * Get floorNumber\n *\n * @return integer\n */\n public function getFloorNumber()\n {\n return $this->floorNumber;\n }\n\n /**\n * Set aptLine\n *\n * @param string $aptLine\n *\n * @return AptResidentAttributes\n */\n public function setAptLine($aptLine)\n {\n $this->aptLine = $aptLine;\n\n return $this;\n }\n\n /**\n * Get aptLine\n *\n * @return string\n */\n public function getAptLine()\n {\n return $this->aptLine;\n }\n\n /**\n * Set lockerStorage\n *\n * @param string $lockerStorage\n *\n * @return AptResidentAttributes\n */\n public function setLockerStorage($lockerStorage)\n {\n $this->lockerStorage = $lockerStorage;\n\n return $this;\n }\n\n /**\n * Get lockerStorage\n *\n * @return string\n */\n public function getLockerStorage()\n {\n return $this->lockerStorage;\n }\n\n /**\n * Set utilityCloset\n *\n * @param string $utilityCloset\n *\n * @return AptResidentAttributes\n */\n public function setUtilityCloset($utilityCloset)\n {\n $this->utilityCloset = $utilityCloset;\n\n return $this;\n }\n\n /**\n * Get utilityCloset\n *\n * @return string\n */\n public function getUtilityCloset()\n {\n return $this->utilityCloset;\n }\n\n /**\n * Set smallCloset\n *\n * @param string $smallCloset\n *\n * @return AptResidentAttributes\n */\n public function setSmallCloset($smallCloset)\n {\n $this->smallCloset = $smallCloset;\n\n return $this;\n }\n\n /**\n * Get smallCloset\n *\n * @return string\n */\n public function getSmallCloset()\n {\n return $this->smallCloset;\n }\n\n /**\n * Set parking\n *\n * @param string $parking\n *\n * @return AptResidentAttributes\n */\n public function setParking($parking)\n {\n $this->parking = $parking;\n\n return $this;\n }\n\n /**\n * Get parking\n *\n * @return string\n */\n public function getParking()\n {\n return $this->parking;\n }\n\n /**\n * Set windowGuardInstalled\n *\n * @param string $windowGuardInstalled\n *\n * @return AptResidentAttributes\n */\n public function setWindowGuardInstalled($windowGuardInstalled)\n {\n $this->windowGuardInstalled = $windowGuardInstalled;\n\n return $this;\n }\n\n /**\n * Get windowGuardInstalled\n *\n * @return string\n */\n public function getWindowGuardInstalled()\n {\n return $this->windowGuardInstalled;\n }\n\n /**\n * Set dogAllowed\n *\n * @param string $dogAllowed\n *\n * @return AptResidentAttributes\n */\n public function setDogAllowed($dogAllowed)\n {\n $this->dogAllowed = $dogAllowed;\n\n return $this;\n }\n\n /**\n * Get dogAllowed\n *\n * @return string\n */\n public function getDogAllowed()\n {\n return $this->dogAllowed;\n }\n\n /**\n * Set loanCreditUnion\n *\n * @param string $loanCreditUnion\n *\n * @return AptResidentAttributes\n */\n public function setLoanCreditUnion($loanCreditUnion)\n {\n $this->loanCreditUnion = $loanCreditUnion;\n\n return $this;\n }\n\n /**\n * Get loanCreditUnion\n *\n * @return string\n */\n public function getLoanCreditUnion()\n {\n return $this->loanCreditUnion;\n }\n\n /**\n * Set toddlerRoomMember\n *\n * @param string $toddlerRoomMember\n *\n * @return AptResidentAttributes\n */\n public function setToddlerRoomMember($toddlerRoomMember)\n {\n $this->toddlerRoomMember = $toddlerRoomMember;\n\n return $this;\n }\n\n /**\n * Get toddlerRoomMember\n *\n * @return string\n */\n public function getToddlerRoomMember()\n {\n return $this->toddlerRoomMember;\n }\n\n /**\n * Set youthRoomMember\n *\n * @param string $youthRoomMember\n *\n * @return AptResidentAttributes\n */\n public function setYouthRoomMember($youthRoomMember)\n {\n $this->youthRoomMember = $youthRoomMember;\n\n return $this;\n }\n\n /**\n * Get youthRoomMember\n *\n * @return string\n */\n public function getYouthRoomMember()\n {\n return $this->youthRoomMember;\n }\n\n /**\n * Set ceramicsMember\n *\n * @param string $ceramicsMember\n *\n * @return AptResidentAttributes\n */\n public function setCeramicsMember($ceramicsMember)\n {\n $this->ceramicsMember = $ceramicsMember;\n\n return $this;\n }\n\n /**\n * Get ceramicsMember\n *\n * @return string\n */\n public function getCeramicsMember()\n {\n return $this->ceramicsMember;\n }\n\n /**\n * Set woodworkingMember\n *\n * @param string $woodworkingMember\n *\n * @return AptResidentAttributes\n */\n public function setWoodworkingMember($woodworkingMember)\n {\n $this->woodworkingMember = $woodworkingMember;\n\n return $this;\n }\n\n /**\n * Get woodworkingMember\n *\n * @return string\n */\n public function getWoodworkingMember()\n {\n return $this->woodworkingMember;\n }\n\n /**\n * Set gymMember\n *\n * @param string $gymMember\n *\n * @return AptResidentAttributes\n */\n public function setGymMember($gymMember)\n {\n $this->gymMember = $gymMember;\n\n return $this;\n }\n\n /**\n * Get gymMember\n *\n * @return string\n */\n public function getGymMember()\n {\n return $this->gymMember;\n }\n\n /**\n * Set lastChangedDate\n *\n * @param \\DateTime $lastChangedDate\n *\n * @return AptResidentAttributes\n */\n public function setLastChangedDate($lastChangedDate)\n {\n $this->lastChangedDate = $lastChangedDate;\n\n return $this;\n }\n\n /**\n * Get lastChangedDate\n *\n * @return \\DateTime\n */\n public function getLastChangedDate()\n {\n return $this->lastChangedDate;\n }\n\n /**\n * Set pennsouthAptApartment\n *\n * @param \\Pennsouth\\MdsBundle\\Entity\\PennsouthApt $pennsouthAptApartment\n *\n * @return AptResidentAttributes\n */\n public function setPennsouthAptApartment(\\Pennsouth\\MdsBundle\\Entity\\PennsouthApt $pennsouthAptApartment)\n {\n $this->pennsouthAptApartment = $pennsouthAptApartment;\n\n return $this;\n }\n\n /**\n * Get pennsouthAptApartment\n *\n * @return \\Pennsouth\\MdsBundle\\Entity\\PennsouthApt\n */\n public function getPennsouthAptApartment()\n {\n return $this->pennsouthAptApartment;\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":843,"cells":{"blob_id":{"kind":"string","value":"9f580123326f84fbf4dbf026c8ebc5767aa68c1f"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"mneuhaus/GitHub-API-Tests"},"path":{"kind":"string","value":"/Ghost.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":4469,"string":"4,469"},"score":{"kind":"number","value":2.65625,"string":"2.65625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"client = new Github\\Client();\n\t\t$this->client->authenticate($username, $password, Github\\Client::AUTH_HTTP_PASSWORD);\n\n\t\t$this->go();\n\t}\n\n\tpublic function go() {\n\t\t$cglUsers = $this->getCglUsers();\n\t\tforeach ($this->getRepositories() as $repository) {\n\t\t\t$teamMembers = $this->getTeamMembers($repository);\n\t\t\tforeach ($this->getPullRequests($repository) as $pullRequest) {\n\t\t\t\t$state = 'pending';\n\t\t\t\t$messages = array();\n\t\t\t\t#echo 'PullRequest: ' . $pullRequest['title'] . chr(10);\n\n\t\t\t\t// CGL Checks\n\t\t\t\t$cglMissing = array();\n\t\t\t\tforeach ($this->getCommits($pullRequest) as $commit) {\n\t\t\t\t\t$sha = $commit['sha'];\n\t\t\t\t\t$user = $commit['author']['login'];\n\n\t\t\t\t\tif (!in_array($user, $cglUsers)) {\n\t\t\t\t\t\t$state = 'error';\n\t\t\t\t\t\t$cglMissing[$user] = $user;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$lastCommitTimestamp = strtotime($commit['commit']['author']['date']);\n\n\t\t\t\t#echo 'Last Commit: ' . $commit['commit']['message'] . ' (' . date('H:i:s d.m.Y', $lastCommitTimestamp) . ')' . chr(10);\n\n\t\t\t\t// Vote Checks\n\t\t\t\t$votesFor = array();\n\t\t\t\t$votesAgainst = array();\n\t\t\t\t$voting = 0;\n\t\t\t\t$cglNotified = FALSE;\n\t\t\t\tforeach ($this->getComments($pullRequest) as $comment) {\n\t\t\t\t\t$commentTimestamp = strtotime($comment['created_at']);\n\t\t\t\t\t$user = $comment['user']['login'];\n\t\t\t\t\t#echo 'Comment: ' . $user . ' (' . date('H:i:s d.m.Y', $commentTimestamp) . ')' . chr(10);\n\n\t\t\t\t\tif ($user == 'mneuhaus-bot') {\n\t\t\t\t\t\t$cglNotified = TRUE;\n\t\t\t\t\t}\n\t\t\t\t\tif ($commentTimestamp <= $lastCommitTimestamp) {\n\t\t\t\t\t\t// echo 'skipping comment' . chr(10);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (in_array($user, $teamMembers)) {\n\t\t\t\t\t\tif (stristr($comment['body'], '+1')) {\n\t\t\t\t\t\t\t$votesFor[$user] = $user;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (stristr($comment['body'], '-1')) {\n\t\t\t\t\t\t\t$votesAgainst[$user] = $user;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (count($cglMissing) > 0) {\n\t\t\t\t\t$messages['cgl'] = 'No approved CGL found for: ' . implode(', ', $cglMissing);\n\t\t\t\t\t// echo 'No approved CGL found for: ' . implode(', ', $cglMissing) . chr(10);\n\t\t\t\t\tif ($cglNotified === FALSE) {\n\t\t\t\t\t\t$user = $pullRequest['base']['user']['login'];\n\t\t\t\t\t\t$repository = $pullRequest['base']['repo']['name'];\n\t\t\t\t\t\t$this->client->api('issue')->comments()->create($user, $repository, $pullRequest['number'], array(\n\t\t\t\t\t\t\t'body' => 'Hey @' . implode(', @', $cglMissing) . '!\nThank you for contributing!\n\nIn order to merge this Pull-Request we need an signed CGL from you.\n...'\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$voting = count($votesFor) - count($votesAgainst);\n\n\t\t\t\tif (count($votesFor) > 0) {\n\t\t\t\t\t$messages[] = 'The following Team members votes for this: ' . implode(', ', $votesFor);\n\t\t\t\t}\n\n\t\t\t\tif ($voting >= $this->votesRequired && $state === 'pending') {\n\t\t\t\t\t$state = 'success';\n\t\t\t\t} else {\n\t\t\t\t\t$messages[] = 'Missing ' . ($this->votesRequired - $voting) . ' votes';\n\t\t\t\t}\n\n\t\t\t\tif (count($votesAgainst) > 0) {\n\t\t\t\t\t$messages[] = 'The following Team members votes against this: ' . implode(', ', $votesAgainst);\n\t\t\t\t}\n\n\t\t\t\t$this->client->api('repo')->commits()->createStatus(\n\t\t\t\t\t$pullRequest['base']['user']['login'],\n\t\t\t\t\t$pullRequest['base']['repo']['name'],\n\t\t\t\t\t$sha,\n\t\t\t\t\t$state,\n\t\t\t\t\timplode(' | ', $messages)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic function getRepositories() {\n\t\treturn $this->client->api('current_user')->repositories();\n\t}\n\n\tpublic function getPullRequests($repository) {\n\t\t$user = $repository['owner']['login'];\n\t\t$repository = $repository['name'];\n\t\treturn $this->client->api('pull_request')->all($user, $repository, 'open');\n\t}\n\n\tpublic function getCommits($pullRequest) {\n\t\t$user = $pullRequest['base']['user']['login'];\n\t\t$repository = $pullRequest['base']['repo']['name'];\n\t\treturn $this->client->api('pull_request')->commits($user, $repository, $pullRequest['number']);\n\t}\n\n\tpublic function getComments($pullRequest) {\n\t\t$user = $pullRequest['base']['user']['login'];\n\t\t$repository = $pullRequest['base']['repo']['name'];\n\t\treturn $this->client->api('issue')->comments()->all($user, $repository, $pullRequest['number']);\n\t}\n\n\tpublic function getTeamMembers($repository) {\n\t\treturn $this->getCglUsers();\n\t}\n\n\tpublic function getCglUsers() {\n\t\treturn array(\n\t\t\t'aertmann',\n\t\t\t'bjen',\n\t\t\t'chlu',\n\t\t\t'christianjul',\n\t\t\t'foerthner',\n\t\t\t'kitsunet',\n\t\t\t'MattiasNilsson',\n\t\t\t'mgoldbeck',\n\t\t\t'mneuhaus',\n\t\t\t'patrickbroens',\n\t\t\t'radmiraal',\n\t\t\t'robertlemke',\n\t\t\t'skurfuerst',\n\t\t\t'sorenmalling'\n\t\t);\n\t}\n}\n?>"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":844,"cells":{"blob_id":{"kind":"string","value":"91c27a60a384ab9e7f382b4af5b337bae15dd3bc"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"revlenuwe/framework"},"path":{"kind":"string","value":"/app/Session/Session.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":720,"string":"720"},"score":{"kind":"number","value":2.890625,"string":"2.890625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":" $s_value){\n $_SESSION[$s_key] = $s_value;\n }\n return $key;\n }\n\n $_SESSION[$key] = $value;\n return $value;\n }\n\n public function get($key,$default = null){\n if($this->exists($key)){\n return $_SESSION[$key];\n }\n return $default;\n }\n\n public function exists($key){\n return isset($_SESSION[$key]);\n }\n\n public function remove(...$keys){\n foreach ($keys as $key){\n unset($_SESSION[$key]);\n }\n }\n}"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":845,"cells":{"blob_id":{"kind":"string","value":"6f9c53aca65eca4425d874ec5672e1b4492756b0"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"YTLink/ytlinksite"},"path":{"kind":"string","value":"/Chat/BE/newMessage.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":593,"string":"593"},"score":{"kind":"number","value":2.78125,"string":"2.78125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":" $_POST['username'], \"channelId\" => $_POST['channelId'], \"message\" => $_POST['message'], \"time\" => $_POST['time']);\n saveFileOnDB($fileName.\".json\", json_encode($message));\n}\n\nfunction saveFileOnDB($fileName, $text) {\n $file = fopen(\"../DB/\".$fileName, \"w\") or die(\"Unable to open file\");\n fwrite($file, $text);\n fclose($file);\n}\n\n?>"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":846,"cells":{"blob_id":{"kind":"string","value":"4c4c12eac4b8a99b262101b5a7a77032367c47ba"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"kgeerts/ooOefening"},"path":{"kind":"string","value":"/db/propertyobject.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":5541,"string":"5,541"},"score":{"kind":"number","value":3.375,"string":"3.375"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"data = $arData;\n }\n\n function __get($propertyName) {\n if (!array_key_exists($propertyName, $this->propertyTable))\n throw new Exception(\"Invalid property \\\"$propertyName\\\"!\");\n\n if (method_exists($this, 'get' . $propertyName)) { // kris --- eigenlijk is deze get een soort default . Als getvoornaam bv bestaat in het obect wordt dat gebruikt anders wordt default\n //gebruikt default = gewoon het ophalen van het veld uit de tabel dus een link van 1 veld op 1 property\n return call_user_func(array($this, 'get' . $propertyName));\n } else {\n if ($this->doesdatapropexist($propertyName)) {\n return $this->data->$propertyName;\n } else {\n return null;\n }\n }\n }\n\n function __set($propertyName, $value) {\n if (!array_key_exists($propertyName, $this->propertyTable))\n throw new Exception(\"Invalid property \\\"$propertyName\\\"!\");\n\n if (method_exists($this, 'set' . $propertyName)) {\n return call_user_func(\n array($this, 'set' . $propertyName), $value\n );\n } else {\n $valuetoupdate = $this->convertValue($this->propertyTable[$propertyName]->convert, $value); // copy over the real value with the datatype\n //what follows records the properties that have been changed ; used to update\n\n\n if ($this->$propertyName != $valuetoupdate &&\n !in_array($propertyName, $this->changedProperties)) {\n $this->changedProperties[] = $propertyName;\n };\n $this->data->{$propertyName} = $valuetoupdate; //update the value\n }\n }\n\n function hyphenNeeded($propertyName) { //gives yes or no when normally the data should be in a query with hyphens --like strings\n if (!array_key_exists($propertyName, $this->propertyTable))\n throw new Exception(\"Invalid property \\\"$propertyName\\\"!\");\n\n if (method_exists($this, 'isString' . $propertyName)) {\n return call_user_func(array($this, 'get' . $propertyName));\n } else {\n switch ($this->propertyTable[$propertyName]->convert) {\n case 'int':\n $Hyphen = false;\n break;\n case 'double':\n $Hyphen = false;\n break;\n case 'bool':\n $Hyphen = false;\n break;\n case 'time':\n $Hyphen = true;\n break;\n default:\n $Hyphen = true;\n }\n return $Hyphen;\n }\n }\n\n function getDatafieldname($propertyName) { // takes the propertyname and gives back the datafieldname\n if (!array_key_exists($propertyName, $this->propertyTable))\n throw new Exception(\"Invalid property \\\"$propertyName\\\"!\");\n else {\n return $this->propertyTable[$propertyName]->fieldName; // so we get the object and from there the fieldname of the object\n }\n }\n\n //loops through the data and copies alle the data into the right properties\n protected function copyValueToKey($data) {\n\n foreach ($this->propertyTable as $key => &$obj) {\n $value = null;\n $datafieldname = $this->getDatafieldname($key);\n\n if (is_null($datafieldname) == false) {\n $value = $data->{$datafieldname};\n }\n $valuetoupdate = $this->convertValue($obj->convert, $value);\n $this->data->$key = $valuetoupdate;\n }\n }\n \n \n // gives back tot total dataobject\n protected function getObjectData() {\n return $this->data;\n }\n \n protected function valtodata($key, $value) {\n $datafieldname = $this->getDatafieldname($key);\n if (is_null($datafieldname) == false) { //if there is a datafield\n $this->data->{$datafieldname} = $value;\n } else {\n $this->data->{$key} = $value; //if there is NO translation we expect the name of the data is the same as the key\n }\n }\n private function doesdatapropexist($prop) {\n if (is_null($this->data) == true) {\n $ret = false;\n } else {\n $ret = property_exists($this->data, $prop);\n }\n\n return $ret;\n }\n\n //copies one value into the right property with right datatype\n private function convertValue($convert, $value) {\n switch ($convert) {\n case 'int':\n $value = intval($value);\n break;\n case 'bool':\n $value = (( $value == '1' or $value == 'true' or $value == true) ? true : false);\n break;\n case 'time':\n $value = DateTime::createFromFormat('Y-m-d H:i:s', $value);\n break;\n case 'double':\n $value = doubleval($value);\n break;\n default :\n $value = $value;\n }\n return ($value);\n }\n\n \n\n \n\n}\n\n?>\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":847,"cells":{"blob_id":{"kind":"string","value":"4c09581836bb76e31aead3958b2bb96225c40071"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"rezya16/Internship"},"path":{"kind":"string","value":"/SOLID/I.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1701,"string":"1,701"},"score":{"kind":"number","value":2.96875,"string":"2.96875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"format = \"Z100name/Z8mode/Z8uid/Z8gid/Z12size/Z12mtime/Z8checksum/Z1type/Z100symlink/Z6magic/Z2version/Z32owner/Z32group/Z8deviceMajor/Z8deviceMinor/Z155prefix/Z12unpacked\";\n\n if (PHP_VERSION < 5.5) {\n // PHP 5.5 replaced 'a' with 'Z' (read X bytes and removing trailing NULL bytes)\n $this->format = str_replace('Z', 'a', $this->format); // @codeCoverageIgnore\n }\n }\n\n public function write($data)\n {\n if (!$this->writable) {\n return false;\n }\n\n // incomplete entry => read until end of entry before expecting next header\n if ($this->streaming !== null) {\n $data = $this->consumeEntry($data);\n\n // entry still incomplete => wait for next chunk\n if ($this->streaming !== null) {\n return !$this->paused;\n }\n }\n\n // trailing padding remaining => skip padding before expecting next header\n if ($this->padding !== 0) {\n $data = $this->consumePadding($data);\n\n // padding still remaining => wait for next chunk\n if ($this->padding !== 0) {\n return true;\n }\n }\n\n $this->buffer .= $data;\n\n while (isset($this->buffer[self::BLOCK_SIZE - 1])) {\n $header = substr($this->buffer, 0, self::BLOCK_SIZE);\n $this->buffer = (string)substr($this->buffer, self::BLOCK_SIZE);\n\n if (rtrim($header, \"\\0\") === '') {\n // skip if whole header consists of null bytes\n // trailing nulls indicate end of archive, but continue reading next block anyway\n continue;\n }\n try {\n $header = $this->readHeader($header);\n } catch (RuntimeException $e) {\n // clean up before throwing\n $this->buffer = '';\n $this->writable = false;\n\n $this->emit('error', array($e));\n $this->close();\n return false;\n }\n\n $this->streaming = new ThroughStream();\n $this->remaining = $header['size'];\n $this->padding = $header['padding'];\n\n // entry stream is not paused by default - unless explicitly paused\n // emit \"drain\" even when entry stream is ready again to support backpressure\n $that = $this;\n $paused =& $this->paused;\n $paused = false;\n $this->streaming->on('drain', function () use (&$paused, $that) {\n $paused = false;\n $that->emit('drain');\n });\n $this->streaming->on('close', function () use (&$paused, $that) {\n if ($paused) {\n $paused = false;\n $that->emit('drain');\n }\n });\n\n $this->emit('entry', array($header, $this->streaming));\n\n if ($this->remaining === 0) {\n $this->streaming->end();\n $this->streaming = null;\n } else {\n $this->buffer = $this->consumeEntry($this->buffer);\n }\n\n // incomplete entry => do not read next header\n if ($this->streaming !== null) {\n return !$this->paused;\n }\n\n if ($this->padding !== 0) {\n $this->buffer = $this->consumePadding($this->buffer);\n }\n\n // incomplete padding => do not read next header\n if ($this->padding !== 0) {\n return true;\n }\n }\n\n return true;\n }\n\n public function end($data = null)\n {\n if ($data !== null) {\n $this->write($data);\n }\n\n if ($this->streaming !== null) {\n // input stream ended but we were still streaming an entry => emit error about incomplete entry\n $this->streaming->emit('error', array(new \\RuntimeException('TAR input stream ended unexpectedly')));\n $this->streaming->close();\n $this->streaming = null;\n\n // add some dummy data to also trigger error on decoder stream\n $this->buffer = '.';\n }\n\n if ($this->buffer !== '') {\n // incomplete entry in buffer\n $this->emit('error', array(new \\RuntimeException('Stream ended with incomplete entry')));\n $this->buffer = '';\n }\n\n $this->writable = false;\n $this->close();\n }\n\n public function close()\n {\n if ($this->closing) {\n return;\n }\n\n $this->closing = true;\n $this->writable = false;\n $this->buffer = '';\n\n if ($this->streaming !== null) {\n // input stream ended but we were still streaming an entry => forcefully close without error\n $this->streaming->close();\n $this->streaming = null;\n }\n\n // ignore whether we're still expecting NUL-padding\n\n $this->emit('close');\n $this->removeAllListeners();\n }\n\n public function isWritable()\n {\n return $this->writable;\n }\n\n private function consumeEntry($buffer)\n {\n // try to read up to [remaining] bytes from buffer\n $data = substr($buffer, 0, $this->remaining);\n $len = strlen($data);\n\n // reduce remaining buffer by number of bytes actually read\n $buffer = substr($buffer, $len);\n $this->remaining -= $len;\n\n // emit chunk of data\n $ret = $this->streaming->write($data);\n\n // nothing remaining => entry stream finished\n if ($this->remaining === 0) {\n $this->streaming->end();\n $this->streaming = null;\n }\n\n // throttle input when streaming entry is still writable but returns false (backpressure)\n if ($ret === false && $this->streaming !== null && $this->streaming->isWritable()) {\n $this->paused = true;\n }\n\n return $buffer;\n }\n\n private function consumePadding($buffer)\n {\n if (strlen($buffer) > $this->padding) {\n // data exceeds padding => skip padding and continue\n $buffer = (string)substr($buffer, $this->padding);\n $this->padding = 0;\n\n return $buffer;\n }\n\n // less data than padding, skip only a bit of the padding and wait for next chunk\n $this->padding -= strlen($buffer);\n return '';\n }\n\n // https://github.com/mishak87/archive-tar/blob/master/Reader.php#L155\n private function readHeader($header)\n {\n $record = unpack($this->format, $header);\n\n // we only support \"ustar\" format (for now?)\n if ($record['magic'] !== 'ustar') {\n throw new RuntimeException('Unsupported archive type, expected \"ustar\", but found \"' . $record['magic'] . '\"');\n }\n\n // convert to decimal values\n foreach (array('uid', 'gid', 'size', 'mtime', 'checksum') as $key) {\n $record[$key] = octdec($record[$key]);\n }\n\n // calculate and compare header checksum\n $checksum = 0;\n for ($i = 0; $i < self::BLOCK_SIZE; $i++) {\n $checksum += 148 <= $i && $i < 156 ? 32 : ord($header[$i]);\n }\n if ($record['checksum'] != $checksum) {\n throw new RuntimeException('Invalid header checksum, expected \"' . $record['checksum'] . '\", but calculated \"' . $checksum . '\" (looks like the archive is corrupted)');\n }\n\n // padding consits of X NULL bytes after record entry until next BLOCK_SIZE boundary\n $record['padding'] = (self::BLOCK_SIZE - ($record['size'] % self::BLOCK_SIZE)) % self::BLOCK_SIZE;\n\n // filename consits of prefix and name\n $record['filename'] = $record['prefix'] . $record['name'];\n\n return $record;\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":849,"cells":{"blob_id":{"kind":"string","value":"c5894c2ab6e14ed338786b33f32fe9186dc6d9a1"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"alborodin85/certbot-yandex-dns"},"path":{"kind":"string","value":"/src/CheckCertNeedUpdate/CertDeadlineChecker.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1995,"string":"1,995"},"score":{"kind":"number","value":2.75,"string":"2.75"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"addPhrases(__DIR__ . '/localization/ru.php');\r\n }\r\n\r\n public function isPeriodCritical(string $certPath, int $criticalRemainingDays, bool $isSudoMode): bool\r\n {\r\n $result = true;\r\n\r\n try {\r\n $fileType = filetype($certPath);\r\n // TODO: Тестируется на реальном пути для сертификата Certbot\r\n if (!$fileType) {\r\n return true;\r\n }\r\n } catch (\\Throwable) {\r\n return true;\r\n }\r\n\r\n $certDeadline = $this->getCertDeadlineString($certPath, $isSudoMode);\r\n if (!$this->checkNeedUpdate($certDeadline, $criticalRemainingDays)) {\r\n $result = false;\r\n }\r\n\r\n return $result;\r\n }\r\n\r\n private function getCertDeadlineString(string $certPath, bool $isSudoMode): string\r\n {\r\n $commandPattern = \"%s openssl x509 -enddate -noout -in %s\";\r\n $isSudoMode = $isSudoMode ? 'sudo ' : '';\r\n $command = sprintf($commandPattern, $isSudoMode, $certPath);\r\n $commandResult = `{$command}`;\r\n\r\n $commandResult = str_replace(\"\\n\", '', $commandResult);\r\n $commandResult = trim($commandResult);\r\n $commandResult = str_replace('notAfter=', '', $commandResult);\r\n $testTime = strtotime($commandResult);\r\n if (!$testTime) {\r\n throw new CheckCertNeedUpdateError(Trans::T('errors.openssl_error'));\r\n }\r\n\r\n return $commandResult;\r\n }\r\n\r\n private function checkNeedUpdate(string $certDeadline, int $criticalRemainingDays): bool\r\n {\r\n $deadLineTimestamp = strtotime($certDeadline);\r\n $currentTimestamp = time();\r\n\r\n $needUpdate = ($deadLineTimestamp - $currentTimestamp) < $criticalRemainingDays * 24 * 3600;\r\n\r\n return $needUpdate;\r\n }\r\n}\r\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":850,"cells":{"blob_id":{"kind":"string","value":"783286d82db9f3d825a08f9d4729e3a83e31ad03"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"jareddgotte/mcm"},"path":{"kind":"string","value":"/move.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":2012,"string":"2,012"},"score":{"kind":"number","value":2.859375,"string":"2.859375"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["Apache-2.0"],"string":"[\n \"Apache-2.0\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"\\n\";\ntry {\n\t$db_connection = new PDO('mysql:host='. DB_HOST .';dbname='. DB_NAME, DB_USER, DB_PASS);\n} catch (PDOException $e) {\n\t$db_connection = false;\n\t$errors[] = 'Database error' . $e->getMessage();\n}\n\n//echo \"selecting the movie id
\\n\";\n$query = $db_connection->prepare('SELECT id FROM movies WHERE movie_list_id = :from_list AND tmdb_movie_id = :movie_id');\n$query->bindValue(':from_list', $from_list, PDO::PARAM_INT);\n$query->bindValue(':movie_id', $movie_id, PDO::PARAM_INT);\nif ($query->execute() === FALSE) {\n\t$errorInfo = $query->errorInfo();\n\t$errors[] = sprintf(\"Execute error: %s
\\n\", $errorInfo[2]);\n}\n$rows = $query->fetchAll(PDO::FETCH_OBJ);\nif (count($rows) > 0) {\n\t//echo \"moving movie
\\n\";\n\t$row = $rows[0];\n\t//echo 'row id: ' + $row->id + \"
\\n\";\n\t$query = $db_connection->prepare('UPDATE movies SET movie_list_id = :to_list WHERE id = :id');\n\t$query->bindValue(':to_list', $to_list, PDO::PARAM_INT);\n\t$query->bindValue(':id', $row->id, PDO::PARAM_INT);\n\tif ($query->execute() === FALSE) {\n\t\t$errorInfo = $query->errorInfo();\n\t\t$errors[] = sprintf(\"Execute error: %s
\\n\", $errorInfo[2]);\n\t}\n}\n//echo \"done
\\n\";\n\nif (isset($errors)) if (count($errors) > 0) var_dump($errors);\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":851,"cells":{"blob_id":{"kind":"string","value":"1c1257e0c3afb4785519e52064a75e5f44b788e9"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"sirio3mil/imdb-scraper"},"path":{"kind":"string","value":"/tests/Feature/MovieHomeTest.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":4270,"string":"4,270"},"score":{"kind":"number","value":2.59375,"string":"2.59375"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"imdbScrapper = (new HomeMapper())->setImdbNumber(1563742)->setContentFromUrl();\n parent::__construct($name, $data, $dataName);\n }\n\n /**\n * @throws ExpectationFailedException\n * @throws InvalidArgumentException\n */\n public function testGetYear()\n {\n $this->assertEquals(2018, $this->imdbScrapper->getYear());\n }\n\n /**\n * @throws ExpectationFailedException\n * @throws InvalidArgumentException\n */\n public function testGetTvShow()\n {\n $this->assertEquals(null, $this->imdbScrapper->getTvShow());\n }\n\n /**\n * @throws ExpectationFailedException\n * @throws InvalidArgumentException\n */\n public function testHaveReleaseInfo()\n {\n $this->assertEquals(true, $this->imdbScrapper->haveReleaseInfo());\n }\n\n /**\n * @throws ExpectationFailedException\n * @throws InvalidArgumentException\n */\n public function testGetLanguages()\n {\n $this->assertEquals(['English', 'Norwegian', 'Spanish', 'French'], $this->imdbScrapper->getLanguages());\n }\n\n /**\n * @throws ExpectationFailedException\n * @throws InvalidArgumentException\n */\n public function testIsTvShow()\n {\n $this->assertEquals(false, $this->imdbScrapper->isTvShow());\n }\n\n /**\n * @throws ExpectationFailedException\n * @throws InvalidArgumentException\n */\n public function testGetTitle()\n {\n $this->assertEquals('Overboard', $this->imdbScrapper->getTitle());\n }\n\n /**\n * @throws ExpectationFailedException\n * @throws InvalidArgumentException\n */\n public function testGetDuration()\n {\n $this->assertEquals(112, $this->imdbScrapper->getDuration());\n }\n\n /**\n * @throws ExpectationFailedException\n * @throws InvalidArgumentException\n */\n public function testGetColor()\n {\n $this->assertEquals('Color', $this->imdbScrapper->getColor());\n }\n\n /**\n * @throws ExpectationFailedException\n * @throws InvalidArgumentException\n */\n public function testGetRecommendations()\n {\n $this->assertNotEmpty($this->imdbScrapper->getRecommendations());\n }\n\n /**\n * @throws ExpectationFailedException\n * @throws InvalidArgumentException\n */\n public function testGetCountries()\n {\n $this->assertEquals(['United States', 'Mexico'], $this->imdbScrapper->getCountries());\n }\n\n /**\n * @throws ExpectationFailedException\n * @throws InvalidArgumentException\n */\n public function testIsEpisode()\n {\n $this->assertFalse($this->imdbScrapper->isEpisode());\n }\n\n /**\n * @throws ExpectationFailedException\n * @throws InvalidArgumentException\n */\n public function testGetGenres()\n {\n $this->assertEquals(['Comedy', 'Romance'], $this->imdbScrapper->getGenres());\n }\n\n /**\n * @throws ExpectationFailedException\n * @throws InvalidArgumentException\n */\n public function testGetSounds()\n {\n $this->assertEquals(['Dolby Digital'], $this->imdbScrapper->getSounds());\n }\n\n /**\n * @throws ExpectationFailedException\n * @throws InvalidArgumentException\n */\n public function testGetScore()\n {\n $this->assertGreaterThan(5, $this->imdbScrapper->getScore());\n }\n\n /**\n * @throws ExpectationFailedException\n * @throws InvalidArgumentException\n */\n public function testGetVotes()\n {\n $this->assertGreaterThan(30000, $this->imdbScrapper->getVotes());\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":852,"cells":{"blob_id":{"kind":"string","value":"29e541aad2e6c25e2303315c25a5179174a8c072"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"s9e/TextFormatter"},"path":{"kind":"string","value":"/tests/Configurator/Helpers/TemplateInspectorTest.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":15197,"string":"15,197"},"score":{"kind":"number","value":2.734375,"string":"2.734375"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"');\n\n\t\t$this->assertEquals(1, $templateInspector->evaluate('count(//br)'));\n\t\t$this->assertEquals(0, $templateInspector->evaluate('count(//b)'));\n\t}\n\n\t/**\n\t* @testdox Test cases\n\t* @dataProvider getTemplateInspectorTests\n\t*/\n\tpublic function test($title, $xslSrc, $rule, $xslTrg = null)\n\t{\n\t\t$src = new TemplateInspector($xslSrc);\n\t\t$trg = new TemplateInspector($xslTrg);\n\n\t\t$assert = ($rule[0] === '!') ? 'assertFalse' : 'assertTrue';\n\t\t$method = ltrim($rule, '!');\n\n\t\t$this->$assert($src->$method($trg), $title);\n\t}\n\n\tpublic static function getTemplateInspectorTests()\n\t{\n\t\treturn [\n\t\t\t[\n\t\t\t\t' does not allow
as child',\n\t\t\t\t'',\n\t\t\t\t'!allowsChild',\n\t\t\t\t'
'\n\t\t\t],\n\t\t\t[\n\t\t\t\t' does not allow
as child even with a sibling',\n\t\t\t\t'',\n\t\t\t\t'!allowsChild',\n\t\t\t\t'xxx
'\n\t\t\t],\n\t\t\t[\n\t\t\t\t' and
does not allow and
as child',\n\t\t\t\t'
',\n\t\t\t\t'!allowsChild',\n\t\t\t\t'
'\n\t\t\t],\n\t\t\t[\n\t\t\t\t'
  • closes parent
  • ',\n\t\t\t\t'
  • ',\n\t\t\t\t'closesParent',\n\t\t\t\t'
  • '\n\t\t\t],\n\t\t\t[\n\t\t\t\t'
    closes parent

    ',\n\t\t\t\t'

    ',\n\t\t\t\t'closesParent',\n\t\t\t\t'

    '\n\t\t\t],\n\t\t\t[\n\t\t\t\t'

    closes parent

    ',\n\t\t\t\t'

    ',\n\t\t\t\t'closesParent',\n\t\t\t\t'

    '\n\t\t\t],\n\t\t\t[\n\t\t\t\t'
    does not close parent
    ',\n\t\t\t\t'
    ',\n\t\t\t\t'!closesParent',\n\t\t\t\t'
    '\n\t\t\t],\n\t\t\t[\n\t\t\t\t// This test mainly exist to ensure nothing bad happens with HTML tags that don't\n\t\t\t\t// have a \"cp\" value in TemplateInspector::$htmlElements\n\t\t\t\t' does not close parent ',\n\t\t\t\t'',\n\t\t\t\t'!closesParent',\n\t\t\t\t''\n\t\t\t],\n\t\t\t[\n\t\t\t\t' closes parent ',\n\t\t\t\t'',\n\t\t\t\t'closesParent',\n\t\t\t\t''\n\t\t\t],\n\t\t\t[\n\t\t\t\t' closes parent ',\n\t\t\t\t'',\n\t\t\t\t'closesParent',\n\t\t\t\t''\n\t\t\t],\n\t\t\t[\n\t\t\t\t' closes parent ',\n\t\t\t\t'',\n\t\t\t\t'closesParent',\n\t\t\t\t''\n\t\t\t],\n\t\t\t[\n\t\t\t\t' closes parent ',\n\t\t\t\t'',\n\t\t\t\t'closesParent',\n\t\t\t\t''\n\t\t\t],\n\t\t\t[\n\t\t\t\t' does not close parent '\n\t\t\t],\n\t\t\t[\n\t\t\t\t' denies as descendant',\n\t\t\t\t'',\n\t\t\t\t'!allowsDescendant',\n\t\t\t\t''\n\t\t\t],\n\t\t\t[\n\t\t\t\t' allows with no usemap attribute as child',\n\t\t\t\t'',\n\t\t\t\t'allowsChild',\n\t\t\t\t''\n\t\t\t],\n\t\t\t[\n\t\t\t\t' denies as child',\n\t\t\t\t'',\n\t\t\t\t'!allowsChild',\n\t\t\t\t''\n\t\t\t],\n\t\t\t[\n\t\t\t\t' does not allow
    ',\n\t\t\t\t'
    ',\n\t\t\t\t'!closesParent',\n\t\t\t\t'